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 39642c7..0000000 Binary files a/hwTestSuite/apiBins/HwrADC_PIC.bin and /dev/null differ diff --git a/hwTestSuite/readme.md b/hwTestSuite/readme.md deleted file mode 100644 index edfe2b2..0000000 --- a/hwTestSuite/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# Palm OS Hardware Test Suite - -The tests available in the end will be: -Dump Bootloader(EZ, VZ, SZ) -ROM Writes -m68k CPU Version -Test Emu Registers -Verify TBLXX Opcodes - - -## Warning -The version of gcc avalible for Palm OS is very old, any change you make must be c89 compatible or it wont compile! - -If you enable unsafe mode you will have to reboot to exit, this is because it will take over the whole OS including interrupts, reset vectors(force crashes may be required for some tests), I/O ports, RAM control and clock speed. - -In the hex viewer registers that are not safe to read will say "UNSAFE" instead of a hex value, the main unsafe reads are the UART registers. - -There is almost no memory, 4KB stack on some devices. -(Resolved, writing off the end of the framebuffer caused this)For some reason the official FileClose(FileHandle) crashes with "Fatal Exeption" on Clie Peg-SL10 and "illegal instruction 19F0 at 00000002" on Tungsten E and black screen reboot on Palm T|X, I think that it corrupts the stack triggering a jump to 0x00000000. diff --git a/hwTestSuite/specs b/hwTestSuite/specs deleted file mode 120000 index acbaa6b..0000000 --- a/hwTestSuite/specs +++ /dev/null @@ -1 +0,0 @@ -../specifications \ No newline at end of file diff --git a/tools/PRCExplorer1.0.19.1.zip b/tools/3rdParty/PRCExplorer1.0.19.1.zip similarity index 100% rename from tools/PRCExplorer1.0.19.1.zip rename to tools/3rdParty/PRCExplorer1.0.19.1.zip diff --git a/tools/BufferGraphViewer/BufferGraphViewer.pro b/tools/desktop/BufferGraphViewer/BufferGraphViewer.pro similarity index 100% rename from tools/BufferGraphViewer/BufferGraphViewer.pro rename to tools/desktop/BufferGraphViewer/BufferGraphViewer.pro diff --git a/tools/BufferGraphViewer/main.cpp b/tools/desktop/BufferGraphViewer/main.cpp similarity index 100% rename from tools/BufferGraphViewer/main.cpp rename to tools/desktop/BufferGraphViewer/main.cpp diff --git a/tools/BufferGraphViewer/mainwindow.cpp b/tools/desktop/BufferGraphViewer/mainwindow.cpp similarity index 100% rename from tools/BufferGraphViewer/mainwindow.cpp rename to tools/desktop/BufferGraphViewer/mainwindow.cpp diff --git a/tools/BufferGraphViewer/mainwindow.h b/tools/desktop/BufferGraphViewer/mainwindow.h similarity index 100% rename from tools/BufferGraphViewer/mainwindow.h rename to tools/desktop/BufferGraphViewer/mainwindow.h diff --git a/tools/BufferGraphViewer/mainwindow.ui b/tools/desktop/BufferGraphViewer/mainwindow.ui similarity index 100% rename from tools/BufferGraphViewer/mainwindow.ui rename to tools/desktop/BufferGraphViewer/mainwindow.ui diff --git a/tools/MakePalmIcon/MakePalmIcon.pro b/tools/desktop/MakePalmIcon/MakePalmIcon.pro similarity index 100% rename from tools/MakePalmIcon/MakePalmIcon.pro rename to tools/desktop/MakePalmIcon/MakePalmIcon.pro diff --git a/tools/MakePalmIcon/main.cpp b/tools/desktop/MakePalmIcon/main.cpp similarity index 100% rename from tools/MakePalmIcon/main.cpp rename to tools/desktop/MakePalmIcon/main.cpp diff --git a/hwTestSuite/TstSuite.def b/tools/palm/hwTestSuite/TstSuite.def similarity index 100% rename from hwTestSuite/TstSuite.def rename to tools/palm/hwTestSuite/TstSuite.def diff --git a/hwTestSuite/TstSuite.rcp b/tools/palm/hwTestSuite/TstSuite.rcp similarity index 100% rename from hwTestSuite/TstSuite.rcp rename to tools/palm/hwTestSuite/TstSuite.rcp diff --git a/hwTestSuite/TstSuiteRsc.h b/tools/palm/hwTestSuite/TstSuiteRsc.h similarity index 100% rename from hwTestSuite/TstSuiteRsc.h rename to tools/palm/hwTestSuite/TstSuiteRsc.h diff --git a/hwTestSuite/appIcon.svg b/tools/palm/hwTestSuite/appIcon.svg similarity index 100% rename from hwTestSuite/appIcon.svg rename to tools/palm/hwTestSuite/appIcon.svg diff --git a/hwTestSuite/cpu.c b/tools/palm/hwTestSuite/cpu.c similarity index 100% rename from hwTestSuite/cpu.c rename to tools/palm/hwTestSuite/cpu.c diff --git a/hwTestSuite/cpu.h b/tools/palm/hwTestSuite/cpu.h similarity index 100% rename from hwTestSuite/cpu.h rename to tools/palm/hwTestSuite/cpu.h diff --git a/hwTestSuite/debug.c b/tools/palm/hwTestSuite/debug.c similarity index 100% rename from hwTestSuite/debug.c rename to tools/palm/hwTestSuite/debug.c diff --git a/hwTestSuite/debug.h b/tools/palm/hwTestSuite/debug.h similarity index 100% rename from hwTestSuite/debug.h rename to tools/palm/hwTestSuite/debug.h diff --git a/hwTestSuite/emuFunctions.c b/tools/palm/hwTestSuite/emuFunctions.c similarity index 100% rename from hwTestSuite/emuFunctions.c rename to tools/palm/hwTestSuite/emuFunctions.c diff --git a/hwTestSuite/emuFunctions.h b/tools/palm/hwTestSuite/emuFunctions.h similarity index 100% rename from hwTestSuite/emuFunctions.h rename to tools/palm/hwTestSuite/emuFunctions.h diff --git a/hwTestSuite/install.sh b/tools/palm/hwTestSuite/install.sh similarity index 100% rename from hwTestSuite/install.sh rename to tools/palm/hwTestSuite/install.sh diff --git a/hwTestSuite/make.sh b/tools/palm/hwTestSuite/make.sh similarity index 95% rename from hwTestSuite/make.sh rename to tools/palm/hwTestSuite/make.sh index e514d12..31b2063 100755 --- a/hwTestSuite/make.sh +++ b/tools/palm/hwTestSuite/make.sh @@ -5,7 +5,6 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $DIR APPNAME="TstSuite" -ICONTEXT="HWTests" if [ "$1" = "clean" ]; then rm -rf *.o *.a $APPNAME $APPNAME-sections.s $APPNAME-sections.ld $APPNAME.prc *.bin @@ -13,7 +12,7 @@ if [ "$1" = "clean" ]; then fi declare -a FILES=("testSuite" "viewer" "tools" "tests" "cpu" "emuFunctions" "ugui" "undocumentedApis") -DEFINES="-DHW_TEST" +DEFINES="" CFLAGS="-palmos4 -O3 $DEFINES" if [ "$1" = "debug" ]; then diff --git a/tools/palm/hwTestSuite/readme.md b/tools/palm/hwTestSuite/readme.md new file mode 100644 index 0000000..4fe4834 --- /dev/null +++ b/tools/palm/hwTestSuite/readme.md @@ -0,0 +1,11 @@ +# Palm OS Hardware Test Suite + +The tests are: +Get Dragonball CPU Version +Dump Bootloader(EZ, VZ, SZ) +RAM Browser +Various Palm m515 Protocol And Pinout Tests + + +## Warning +The version of gcc available for Palm OS is very old, any change you make must be C89 compatible or it wont compile! diff --git a/tools/palm/hwTestSuite/specs b/tools/palm/hwTestSuite/specs new file mode 120000 index 0000000..3d183f0 --- /dev/null +++ b/tools/palm/hwTestSuite/specs @@ -0,0 +1 @@ +/Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/specifications \ No newline at end of file diff --git a/hwTestSuite/testSuite.c b/tools/palm/hwTestSuite/testSuite.c similarity index 100% rename from hwTestSuite/testSuite.c rename to tools/palm/hwTestSuite/testSuite.c diff --git a/hwTestSuite/testSuite.h b/tools/palm/hwTestSuite/testSuite.h similarity index 100% rename from hwTestSuite/testSuite.h rename to tools/palm/hwTestSuite/testSuite.h diff --git a/hwTestSuite/testSuiteConfig.h b/tools/palm/hwTestSuite/testSuiteConfig.h similarity index 100% rename from hwTestSuite/testSuiteConfig.h rename to tools/palm/hwTestSuite/testSuiteConfig.h diff --git a/hwTestSuite/tests.c b/tools/palm/hwTestSuite/tests.c similarity index 100% rename from hwTestSuite/tests.c rename to tools/palm/hwTestSuite/tests.c diff --git a/hwTestSuite/tests.h b/tools/palm/hwTestSuite/tests.h similarity index 100% rename from hwTestSuite/tests.h rename to tools/palm/hwTestSuite/tests.h diff --git a/hwTestSuite/tools.c b/tools/palm/hwTestSuite/tools.c similarity index 100% rename from hwTestSuite/tools.c rename to tools/palm/hwTestSuite/tools.c diff --git a/hwTestSuite/tools.h b/tools/palm/hwTestSuite/tools.h similarity index 100% rename from hwTestSuite/tools.h rename to tools/palm/hwTestSuite/tools.h diff --git a/hwTestSuite/ugui.c b/tools/palm/hwTestSuite/ugui.c similarity index 100% rename from hwTestSuite/ugui.c rename to tools/palm/hwTestSuite/ugui.c diff --git a/hwTestSuite/ugui.h b/tools/palm/hwTestSuite/ugui.h similarity index 100% rename from hwTestSuite/ugui.h rename to tools/palm/hwTestSuite/ugui.h diff --git a/hwTestSuite/ugui_config.h b/tools/palm/hwTestSuite/ugui_config.h similarity index 100% rename from hwTestSuite/ugui_config.h rename to tools/palm/hwTestSuite/ugui_config.h diff --git a/hwTestSuite/undocumentedApis.c b/tools/palm/hwTestSuite/undocumentedApis.c similarity index 100% rename from hwTestSuite/undocumentedApis.c rename to tools/palm/hwTestSuite/undocumentedApis.c diff --git a/hwTestSuite/undocumentedApis.h b/tools/palm/hwTestSuite/undocumentedApis.h similarity index 100% rename from hwTestSuite/undocumentedApis.h rename to tools/palm/hwTestSuite/undocumentedApis.h diff --git a/hwTestSuite/viewer.c b/tools/palm/hwTestSuite/viewer.c similarity index 97% rename from hwTestSuite/viewer.c rename to tools/palm/hwTestSuite/viewer.c index 20d5f11..88f8817 100644 --- a/hwTestSuite/viewer.c +++ b/tools/palm/hwTestSuite/viewer.c @@ -263,6 +263,7 @@ var functionPicker(){ void resetFunctionViewer(){ var nullVar = makeVar(LENGTH_0, TYPE_NULL, 0); + uint8_t cpuType = getPhysicalCpuType(); totalHwTests = 0; @@ -282,11 +283,14 @@ void resetFunctionViewer(){ hwTests[totalHwTests].testFunction = getPenPosition; totalHwTests++; - if(getPhysicalCpuType() & CPU_M68K){ + if(cpuType & CPU_M68K){ /*68k only functions*/ - StrNCopy(hwTests[totalHwTests].name, "Dump Bootloader", TEST_NAME_LENGTH); - hwTests[totalHwTests].testFunction = dumpBootloaderToFile; - totalHwTests++; + if((cpuType & CPU_M68K_TYPES) != CPU_M68K_328){ + /*original dragonball doesnt have a bootloader*/ + StrNCopy(hwTests[totalHwTests].name, "Dump Bootloader", TEST_NAME_LENGTH); + hwTests[totalHwTests].testFunction = dumpBootloaderToFile; + totalHwTests++; + } StrNCopy(hwTests[totalHwTests].name, "List ROM Info/Dump ROM", TEST_NAME_LENGTH); hwTests[totalHwTests].testFunction = listRomInfo; diff --git a/hwTestSuite/viewer.h b/tools/palm/hwTestSuite/viewer.h similarity index 100% rename from hwTestSuite/viewer.h rename to tools/palm/hwTestSuite/viewer.h diff --git a/tools/palm/muExpansionDriver/MuExpDriver.def b/tools/palm/muExpansionDriver/MuExpDriver.def new file mode 100644 index 0000000..f3f7c3a --- /dev/null +++ b/tools/palm/muExpansionDriver/MuExpDriver.def @@ -0,0 +1 @@ +application{"MuExpDriver" GuiC} diff --git a/tools/palm/muExpansionDriver/emuFunctions.c b/tools/palm/muExpansionDriver/emuFunctions.c new file mode 100644 index 0000000..9a071ee --- /dev/null +++ b/tools/palm/muExpansionDriver/emuFunctions.c @@ -0,0 +1,16 @@ +#include +#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.