From eddd84e7a4c1bab247ccdbafe7fa888e31bf5135 Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Fri, 5 Oct 2018 16:33:16 -0700 Subject: [PATCH] Refactor everything, add begining of hardware expansion driver --- .gitignore | 16 ++++---- hwTestSuite/apiBins/HwrADC_PIC.bin | Bin 1159 -> 0 bytes hwTestSuite/readme.md | 19 --------- hwTestSuite/specs | 1 - tools/{ => 3rdParty}/PRCExplorer1.0.19.1.zip | Bin .../BufferGraphViewer/BufferGraphViewer.pro | 0 .../{ => desktop}/BufferGraphViewer/main.cpp | 0 .../BufferGraphViewer/mainwindow.cpp | 0 .../BufferGraphViewer/mainwindow.h | 0 .../BufferGraphViewer/mainwindow.ui | 0 .../MakePalmIcon/MakePalmIcon.pro | 0 tools/{ => desktop}/MakePalmIcon/main.cpp | 0 .../palm/hwTestSuite}/TstSuite.def | 0 .../palm/hwTestSuite}/TstSuite.rcp | 0 .../palm/hwTestSuite}/TstSuiteRsc.h | 0 .../palm/hwTestSuite}/appIcon.svg | 0 {hwTestSuite => tools/palm/hwTestSuite}/cpu.c | 0 {hwTestSuite => tools/palm/hwTestSuite}/cpu.h | 0 .../palm/hwTestSuite}/debug.c | 0 .../palm/hwTestSuite}/debug.h | 0 .../palm/hwTestSuite}/emuFunctions.c | 0 .../palm/hwTestSuite}/emuFunctions.h | 0 .../palm/hwTestSuite}/install.sh | 0 .../palm/hwTestSuite}/make.sh | 3 +- tools/palm/hwTestSuite/readme.md | 11 ++++++ tools/palm/hwTestSuite/specs | 1 + .../palm/hwTestSuite}/testSuite.c | 0 .../palm/hwTestSuite}/testSuite.h | 0 .../palm/hwTestSuite}/testSuiteConfig.h | 0 .../palm/hwTestSuite}/tests.c | 0 .../palm/hwTestSuite}/tests.h | 0 .../palm/hwTestSuite}/tools.c | 0 .../palm/hwTestSuite}/tools.h | 0 .../palm/hwTestSuite}/ugui.c | 0 .../palm/hwTestSuite}/ugui.h | 0 .../palm/hwTestSuite}/ugui_config.h | 0 .../palm/hwTestSuite}/undocumentedApis.c | 0 .../palm/hwTestSuite}/undocumentedApis.h | 0 .../palm/hwTestSuite}/viewer.c | 12 ++++-- .../palm/hwTestSuite}/viewer.h | 0 tools/palm/muExpansionDriver/MuExpDriver.def | 1 + tools/palm/muExpansionDriver/emuFunctions.c | 16 ++++++++ tools/palm/muExpansionDriver/emuFunctions.h | 13 ++++++ tools/palm/muExpansionDriver/install.sh | 9 +++++ tools/palm/muExpansionDriver/make.sh | 37 ++++++++++++++++++ tools/palm/muExpansionDriver/muExpDriver.c | 1 + tools/palm/muExpansionDriver/readme.md | 7 ++++ 47 files changed, 113 insertions(+), 34 deletions(-) delete mode 100755 hwTestSuite/apiBins/HwrADC_PIC.bin delete mode 100644 hwTestSuite/readme.md delete mode 120000 hwTestSuite/specs rename tools/{ => 3rdParty}/PRCExplorer1.0.19.1.zip (100%) rename tools/{ => desktop}/BufferGraphViewer/BufferGraphViewer.pro (100%) rename tools/{ => desktop}/BufferGraphViewer/main.cpp (100%) rename tools/{ => desktop}/BufferGraphViewer/mainwindow.cpp (100%) rename tools/{ => desktop}/BufferGraphViewer/mainwindow.h (100%) rename tools/{ => desktop}/BufferGraphViewer/mainwindow.ui (100%) rename tools/{ => desktop}/MakePalmIcon/MakePalmIcon.pro (100%) rename tools/{ => desktop}/MakePalmIcon/main.cpp (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/TstSuite.def (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/TstSuite.rcp (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/TstSuiteRsc.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/appIcon.svg (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/cpu.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/cpu.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/debug.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/debug.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/emuFunctions.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/emuFunctions.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/install.sh (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/make.sh (95%) create mode 100644 tools/palm/hwTestSuite/readme.md create mode 120000 tools/palm/hwTestSuite/specs rename {hwTestSuite => tools/palm/hwTestSuite}/testSuite.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/testSuite.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/testSuiteConfig.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/tests.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/tests.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/tools.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/tools.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/ugui.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/ugui.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/ugui_config.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/undocumentedApis.c (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/undocumentedApis.h (100%) rename {hwTestSuite => tools/palm/hwTestSuite}/viewer.c (97%) rename {hwTestSuite => tools/palm/hwTestSuite}/viewer.h (100%) create mode 100644 tools/palm/muExpansionDriver/MuExpDriver.def create mode 100644 tools/palm/muExpansionDriver/emuFunctions.c create mode 100644 tools/palm/muExpansionDriver/emuFunctions.h create mode 100755 tools/palm/muExpansionDriver/install.sh create mode 100755 tools/palm/muExpansionDriver/make.sh create mode 100644 tools/palm/muExpansionDriver/muExpDriver.c create mode 100644 tools/palm/muExpansionDriver/readme.md diff --git a/.gitignore b/.gitignore index 7c94838..abbbae9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,14 +4,14 @@ *.so *.dylib *.pro.user -/hwTestSuite/*.bin -/hwTestSuite/*.grc -/hwTestSuite/*.prc -/hwTestSuite/TstSuite -/hwTestSuite/TstSuite-sections.s -/hwTestSuite/TstSuite-sections.ld /libretroBuildSystem/obj /libretroBuildSystem/libs /qtBuildSystem/build-Mu-* -/tools/build-BufferGraphViewer-* -/tools/build-MakePalmIcon-* +/tools/palm/hwTestSuite/*.bin +/tools/palm/hwTestSuite/*.grc +/tools/palm/hwTestSuite/*.prc +/tools/palm/hwTestSuite/TstSuite +/tools/palm/hwTestSuite/TstSuite-sections.s +/tools/palm/hwTestSuite/TstSuite-sections.ld +/tools/desktop/build-BufferGraphViewer-* +/tools/desktop/build-MakePalmIcon-* diff --git a/hwTestSuite/apiBins/HwrADC_PIC.bin b/hwTestSuite/apiBins/HwrADC_PIC.bin deleted file mode 100755 index 39642c794555dd20fe1f49e59e9b7dfd3678017a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1159 zcmeYZ`~S$}xx7UUgTn!a8g>R-hyRaM@))?7EEs-&F=Vh{VEm%MWWn(7iz1j*GSFk- z;BjE!NMc~ox!_=6&A{gOn}LZzh#`Ps1)~(>6~;eIDol@9L~LsqZvKB^Tf;E(|2x|n z29f`7z~m>7y#FukZ5WvRcKu5;(EI=Dg@>sF1CN2;{|{gmUyOeO1M@Y*KTh61m<<1L zJ@~<3_{Z7%2a|0L!*Z~BHviukSo~mOa$sag`(|MAg8^zHqu;K7A{Ki8Uzxfvu$Zwt z^X748_#fk+%wlH4@ZZ##fhmE3xvqlMwua$7*qrBJcRm0A#VPOq8^?G5Uj%f7bf|e4 z>|wBR%KQHVYAUneuD|;rvN0VR9%cg5^8SDDa*pxOVRCWiac0oS72*kIU`=K*5Kdq! zV7(X|?2>lGKm_a;mIMZ79;`lT2fN@q*abHK-#F#{|Af^~On$rmI)H2kxy&?xfepkC z=+N*m4Pf9XV=xo0V6YI;Vwu&fz^Y`!z`(h~Z`X%gYz+(y91KM~j}~Y!D6oLUxjg-L zeK-VSF~9KJ_0fZ^;s5`C@6{N1ni&}W|Bvy{XH&BQvAmjdn93MTof)_i7?^_KF(~r? z4Ky?u{dWD?fQU6vTrp{Z;}{gvsOmc4>cDZz1d73nV1I7}`}^SkFW?jbO&4G`QmFs& z0QnW=8o8-_c6yM7sj_$RQ~*swA& hSTL}BF*MNo|H$ot0h`Z#nIC>}ex+?5 +#include + +#include "testSuite.h" +#include "specs/emuFeatureRegistersSpec.h" + +Boolean isEmulator(){ + /*return (readArbitraryMemory32(EMU_REG_ADDR(EMU_INFO)) & FEATURE_EMU_HONEST) != 0;*/ + return false; +} + +Boolean isEmulatorFeatureEnabled(uint32_t feature){ + if(isEmulator()) + return (readArbitraryMemory32(EMU_REG_ADDR(EMU_INFO)) & feature) != 0; + return false; +} diff --git a/tools/palm/muExpansionDriver/emuFunctions.h b/tools/palm/muExpansionDriver/emuFunctions.h new file mode 100644 index 0000000..65e6f8a --- /dev/null +++ b/tools/palm/muExpansionDriver/emuFunctions.h @@ -0,0 +1,13 @@ +#ifndef EMU_FUNCTIONS_HEADER +#define EMU_FUNCTIONS_HEADER + +#include +#include + +#include "specs/emuFeatureRegistersSpec.h"/*needed for feature names*/ + +Boolean isEmulator(); +Boolean isEmulatorFeatureEnabled(uint32_t feature); + +#endif + diff --git a/tools/palm/muExpansionDriver/install.sh b/tools/palm/muExpansionDriver/install.sh new file mode 100755 index 0000000..4f94ffe --- /dev/null +++ b/tools/palm/muExpansionDriver/install.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd $DIR + +./make.sh clean +./make.sh +pilot-xfer -p usb: -i ./TstSuite.prc diff --git a/tools/palm/muExpansionDriver/make.sh b/tools/palm/muExpansionDriver/make.sh new file mode 100755 index 0000000..2af028b --- /dev/null +++ b/tools/palm/muExpansionDriver/make.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +cd $DIR + +APPNAME="MuExpDriver" + +if [ "$1" = "clean" ]; then + rm -rf *.o *.a $APPNAME $APPNAME-sections.s $APPNAME-sections.ld $APPNAME.prc *.bin + exit +fi + +declare -a FILES=("muExpDriver" "emuFunctions") +DEFINES="" +CFLAGS="-palmos4 -O3 $DEFINES" + +if [ "$1" = "debug" ]; then + DEFINES="$DEFINES -DDEBUG" + FILES+="debug" + CFLAGS="$CFLAGS -g" +fi + +m68k-palmos-multigen $APPNAME.def +m68k-palmos-gcc $CFLAGS -c $APPNAME-sections.s -o $APPNAME-sections.o +for I in "${FILES[@]}"; do + m68k-palmos-gcc $CFLAGS -c $I.c -o $I.o +done +m68k-palmos-gcc -o $APPNAME *.o $APPNAME-sections.ld + +# if possible generate icon trees +if type "MakePalmIcon" &> /dev/null; then + MakePalmIcon ./appIcon.svg ./ +fi + +pilrc $APPNAME.rcp +build-prc $APPNAME.def $APPNAME *.bin diff --git a/tools/palm/muExpansionDriver/muExpDriver.c b/tools/palm/muExpansionDriver/muExpDriver.c new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tools/palm/muExpansionDriver/muExpDriver.c @@ -0,0 +1 @@ + diff --git a/tools/palm/muExpansionDriver/readme.md b/tools/palm/muExpansionDriver/readme.md new file mode 100644 index 0000000..788eabc --- /dev/null +++ b/tools/palm/muExpansionDriver/readme.md @@ -0,0 +1,7 @@ +# Mu Hardware Expansion Driver + +This exposes the custom hardware provided by the emulator to the OS, if you are not using any expasion features you dont need this. +This is required to maintain accuracy, the OS is in ROM shall not be edited in any way. + + +### Installing on a physical Palm will do nothing and simply return an error.