Refactor everything, add begining of hardware expansion driver

This commit is contained in:
meepingsnesroms
2018-10-05 16:33:16 -07:00
parent 6d25dc946e
commit eddd84e7a4
47 changed files with 113 additions and 34 deletions

16
.gitignore vendored
View File

@@ -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-*

Binary file not shown.

View File

@@ -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.

View File

@@ -1 +0,0 @@
../specifications

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -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

View File

@@ -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!

View File

@@ -0,0 +1 @@
/Users/Hoppy/Desktop/projects/PalmEmuRedo/libretro-palmm515emu/specifications

View File

@@ -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;

View File

@@ -0,0 +1 @@
application{"MuExpDriver" GuiC}

View File

@@ -0,0 +1,16 @@
#include <PalmOS.h>
#include <stdint.h>
#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;
}

View File

@@ -0,0 +1,13 @@
#ifndef EMU_FUNCTIONS_HEADER
#define EMU_FUNCTIONS_HEADER
#include <PalmOS.h>
#include <stdint.h>
#include "specs/emuFeatureRegistersSpec.h"/*needed for feature names*/
Boolean isEmulator();
Boolean isEmulatorFeatureEnabled(uint32_t feature);
#endif

View File

@@ -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

View File

@@ -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

View File

@@ -0,0 +1 @@

View File

@@ -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.