From 3cb346bbbb0cec0dec19bcde7f389cac45f332cb Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Thu, 21 Feb 2019 11:41:47 -0800 Subject: [PATCH] Remove old feature bits --- src/debug/sandbox.c | 2 +- src/expansionHardware.c | 4 ++-- src/specs/emuFeatureRegisterSpec.h | 10 +++++----- .../hwTestSuite/specs/emuFeatureRegisterSpec.h | 16 +++++++++------- tools/palm/muExpansionDriver/debug.c | 2 +- .../specs/emuFeatureRegisterSpec.h | 10 +++++----- 6 files changed, 23 insertions(+), 21 deletions(-) diff --git a/src/debug/sandbox.c b/src/debug/sandbox.c index c9b4c49..4c01d52 100644 --- a/src/debug/sandbox.c +++ b/src/debug/sandbox.c @@ -330,7 +330,7 @@ static uint32_t sandboxCallGuestFunction(bool fallthrough, uint32_t address, uin //end execution with CMD_EXECUTION_DONE m68k_write_memory_16(callWriteOut, 0x23FC);//move.l data imm to address at imm2 opcode callWriteOut += 2; - m68k_write_memory_32(callWriteOut, CMD_EXECUTION_DONE); + m68k_write_memory_32(callWriteOut, CMD_DEBUG_EXEC_END); callWriteOut += 4; m68k_write_memory_32(callWriteOut, EMU_REG_ADDR(EMU_CMD)); callWriteOut += 4; diff --git a/src/expansionHardware.c b/src/expansionHardware.c index 769babe..1a5c903 100644 --- a/src/expansionHardware.c +++ b/src/expansionHardware.c @@ -159,7 +159,7 @@ void expansionHardwareSetRegister(uint32_t address, uint32_t value){ } return; - case CMD_PRINT: + case CMD_DEBUG_PRINT: if(palmEmuFeatures.info & FEATURE_DEBUG){ char tempString[200]; uint16_t offset; @@ -184,7 +184,7 @@ void expansionHardwareSetRegister(uint32_t address, uint32_t value){ palmEmuFeatures.value = (palmInput.buttonLeft ? EXT_BUTTON_LEFT : 0) | (palmInput.buttonRight ? EXT_BUTTON_RIGHT : 0) | (palmInput.buttonSelect ? EXT_BUTTON_SELECT : 0); return; - case CMD_EXECUTION_DONE: + case CMD_DEBUG_EXEC_END: if(palmEmuFeatures.info & FEATURE_DEBUG) sandboxReturn(); return; diff --git a/src/specs/emuFeatureRegisterSpec.h b/src/specs/emuFeatureRegisterSpec.h index 8a2d70e..e5dcba1 100644 --- a/src/specs/emuFeatureRegisterSpec.h +++ b/src/specs/emuFeatureRegisterSpec.h @@ -19,8 +19,8 @@ These registers will do nothing if their corresponding feature bit is not set on #define FEATURE_EMU_HONEST 0x00000040/*tell the OS that its running in an emu, does nothing else*/ #define FEATURE_EXT_KEYS 0x00000080/*enables the OS 5 buttons, left, right and select*/ #define FEATURE_DEBUG 0x00000100/*enables the debug commands, used to call Palm OS functions like native C functions*/ -#define FEATURE_INVALID 0x00000200/*if this bit is set the returned data is invalid*/ -#define FEATURE_SHELL 0x00000400/*allows executing code on the host machine, is a huge securty hole and is compiled out in releases*/ +/*FEATURE_UNUSED 0x00000200*/ +/*FEATURE_UNUSED 0x00000400*/ #define FEATURE_SND_STRMS 0x00000800/*enables OS 5 audio streams*/ /*new features go here*/ @@ -49,10 +49,10 @@ These registers will do nothing if their corresponding feature bit is not set on #define CMD_SET_CYCLE_COST 0x0000FFF5/*EMU_DST = HLE API number, EMU_VALUE = how many cycles it takes*/ #define CMD_LCD_SET_FB 0x0000FFF6/*EMU_SRC = framebuffer pointer(must be in RAM and word aligned), EMU_VALUE >> 16 = width, EMU_VALUE & 0xFFFF = height*/ #define CMD_GET_KEYS 0x0000FFF7/*EMU_VALUE = OS 5 keys*/ -#define CMD_PRINT 0x0000FFF8/*EMU_SRC = pointer to string*/ -#define CMD_SHELL_EXECUTE 0x0000FFF9/*execute shell commands from inside the emulator, will be used for a cool web project*/ +#define CMD_DEBUG_PRINT 0x0000FFF8/*EMU_SRC = pointer to string*/ +/*CMD_UNUSED 0x0000FFF9*/ #define CMD_SOUND 0x0000FFFA/*needed for OS 5 advanced sound*/ -#define CMD_EXECUTION_DONE 0x0000FFFB/*terminates execution, used when a function is called from outside the emulator*/ +#define CMD_DEBUG_EXEC_END 0x0000FFFB/*terminates execution, used when a function is called from outside the emulator*/ #define CMD_ARM_SERVICE 0x0000FFFC/*EMU_VALUE = 1 if ARM wants service from 68k routines*/ #define CMD_ARM_SET_REG 0x0000FFFD/*EMU_DST = register number, EMU_VALUE = new value*/ #define CMD_ARM_GET_REG 0x0000FFFE/*EMU_SRC = register number, EMU_VALUE = value after calling*/ diff --git a/tools/palm/hwTestSuite/specs/emuFeatureRegisterSpec.h b/tools/palm/hwTestSuite/specs/emuFeatureRegisterSpec.h index 3654123..e5dcba1 100644 --- a/tools/palm/hwTestSuite/specs/emuFeatureRegisterSpec.h +++ b/tools/palm/hwTestSuite/specs/emuFeatureRegisterSpec.h @@ -11,7 +11,7 @@ These registers will do nothing if their corresponding feature bit is not set on /*features*/ #define FEATURE_ACCURATE 0x00000000/*no hacks/addons*/ #define FEATURE_RAM_HUGE 0x00000001/*128mb RAM*/ -#define FEATURE_FAST_CPU 0x00000002/*doubles CPU speed*/ +#define FEATURE_FAST_CPU 0x00000002/*allows the emulator to set its CPU speed*/ #define FEATURE_HYBRID_CPU 0x00000004/*allows running ARM opcodes in an OS 4 enviroment*/ #define FEATURE_CUSTOM_FB 0x00000008/*creates a dynamicly sized framebuffer for hires mode, the 160x160 framebuffer is a transparent overlay over the extended framebuffer*/ #define FEATURE_SYNCED_RTC 0x00000010/*RTC always equals host system time*/ @@ -19,8 +19,9 @@ These registers will do nothing if their corresponding feature bit is not set on #define FEATURE_EMU_HONEST 0x00000040/*tell the OS that its running in an emu, does nothing else*/ #define FEATURE_EXT_KEYS 0x00000080/*enables the OS 5 buttons, left, right and select*/ #define FEATURE_DEBUG 0x00000100/*enables the debug commands, used to call Palm OS functions like native C functions*/ -#define FEATURE_INVALID 0x00000200/*if this bit is set the returned data is invalid*/ -#define FEATURE_SHELL 0x00000400/*allows executing code on the host machine, is a huge securty hole and is compiled out in releases*/ +/*FEATURE_UNUSED 0x00000200*/ +/*FEATURE_UNUSED 0x00000400*/ +#define FEATURE_SND_STRMS 0x00000800/*enables OS 5 audio streams*/ /*new features go here*/ /*registers*/ @@ -43,14 +44,15 @@ These registers will do nothing if their corresponding feature bit is not set on /*new HLE API cmds go here*/ /*new system cmds go here*/ +#define CMD_SET_CPU_SPEED 0x0000FFF3/*EMU_VALUE = CPU speed percent, 100% = normal*/ #define CMD_IDLE_X_CLK32 0x0000FFF4/*EMU_VALUE = CLK32s to waste, used to remove idle loops*/ #define CMD_SET_CYCLE_COST 0x0000FFF5/*EMU_DST = HLE API number, EMU_VALUE = how many cycles it takes*/ -#define CMD_SET_RESOLUTION 0x0000FFF6/*EMU_VALUE >> 16 = width, EMU_VALUE & 0xFFFF = height*/ +#define CMD_LCD_SET_FB 0x0000FFF6/*EMU_SRC = framebuffer pointer(must be in RAM and word aligned), EMU_VALUE >> 16 = width, EMU_VALUE & 0xFFFF = height*/ #define CMD_GET_KEYS 0x0000FFF7/*EMU_VALUE = OS 5 keys*/ -#define CMD_PRINT 0x0000FFF8/*EMU_SRC = pointer to string*/ -#define CMD_SHELL_EXECUTE 0x0000FFF9/*execute shell commands from inside the emulator, will be used for a cool web project*/ +#define CMD_DEBUG_PRINT 0x0000FFF8/*EMU_SRC = pointer to string*/ +/*CMD_UNUSED 0x0000FFF9*/ #define CMD_SOUND 0x0000FFFA/*needed for OS 5 advanced sound*/ -#define CMD_EXECUTION_DONE 0x0000FFFB/*terminates execution, used when a function is called from outside the emulator*/ +#define CMD_DEBUG_EXEC_END 0x0000FFFB/*terminates execution, used when a function is called from outside the emulator*/ #define CMD_ARM_SERVICE 0x0000FFFC/*EMU_VALUE = 1 if ARM wants service from 68k routines*/ #define CMD_ARM_SET_REG 0x0000FFFD/*EMU_DST = register number, EMU_VALUE = new value*/ #define CMD_ARM_GET_REG 0x0000FFFE/*EMU_SRC = register number, EMU_VALUE = value after calling*/ diff --git a/tools/palm/muExpansionDriver/debug.c b/tools/palm/muExpansionDriver/debug.c index bfcdec6..3fa33f1 100644 --- a/tools/palm/muExpansionDriver/debug.c +++ b/tools/palm/muExpansionDriver/debug.c @@ -15,7 +15,7 @@ void debugLog(const char* format, ...){ StrCopy(temp, prefix); StrVPrintF(temp + StrLen(prefix), format, va); writeArbitraryMemory32(EMU_REG_ADDR(EMU_SRC), (uint32_t)temp); - writeArbitraryMemory32(EMU_REG_ADDR(EMU_CMD), CMD_PRINT); + writeArbitraryMemory32(EMU_REG_ADDR(EMU_CMD), CMD_DEBUG_PRINT); va_end(va); } #endif diff --git a/tools/palm/muExpansionDriver/specs/emuFeatureRegisterSpec.h b/tools/palm/muExpansionDriver/specs/emuFeatureRegisterSpec.h index 8a2d70e..e5dcba1 100644 --- a/tools/palm/muExpansionDriver/specs/emuFeatureRegisterSpec.h +++ b/tools/palm/muExpansionDriver/specs/emuFeatureRegisterSpec.h @@ -19,8 +19,8 @@ These registers will do nothing if their corresponding feature bit is not set on #define FEATURE_EMU_HONEST 0x00000040/*tell the OS that its running in an emu, does nothing else*/ #define FEATURE_EXT_KEYS 0x00000080/*enables the OS 5 buttons, left, right and select*/ #define FEATURE_DEBUG 0x00000100/*enables the debug commands, used to call Palm OS functions like native C functions*/ -#define FEATURE_INVALID 0x00000200/*if this bit is set the returned data is invalid*/ -#define FEATURE_SHELL 0x00000400/*allows executing code on the host machine, is a huge securty hole and is compiled out in releases*/ +/*FEATURE_UNUSED 0x00000200*/ +/*FEATURE_UNUSED 0x00000400*/ #define FEATURE_SND_STRMS 0x00000800/*enables OS 5 audio streams*/ /*new features go here*/ @@ -49,10 +49,10 @@ These registers will do nothing if their corresponding feature bit is not set on #define CMD_SET_CYCLE_COST 0x0000FFF5/*EMU_DST = HLE API number, EMU_VALUE = how many cycles it takes*/ #define CMD_LCD_SET_FB 0x0000FFF6/*EMU_SRC = framebuffer pointer(must be in RAM and word aligned), EMU_VALUE >> 16 = width, EMU_VALUE & 0xFFFF = height*/ #define CMD_GET_KEYS 0x0000FFF7/*EMU_VALUE = OS 5 keys*/ -#define CMD_PRINT 0x0000FFF8/*EMU_SRC = pointer to string*/ -#define CMD_SHELL_EXECUTE 0x0000FFF9/*execute shell commands from inside the emulator, will be used for a cool web project*/ +#define CMD_DEBUG_PRINT 0x0000FFF8/*EMU_SRC = pointer to string*/ +/*CMD_UNUSED 0x0000FFF9*/ #define CMD_SOUND 0x0000FFFA/*needed for OS 5 advanced sound*/ -#define CMD_EXECUTION_DONE 0x0000FFFB/*terminates execution, used when a function is called from outside the emulator*/ +#define CMD_DEBUG_EXEC_END 0x0000FFFB/*terminates execution, used when a function is called from outside the emulator*/ #define CMD_ARM_SERVICE 0x0000FFFC/*EMU_VALUE = 1 if ARM wants service from 68k routines*/ #define CMD_ARM_SET_REG 0x0000FFFD/*EMU_DST = register number, EMU_VALUE = new value*/ #define CMD_ARM_GET_REG 0x0000FFFE/*EMU_SRC = register number, EMU_VALUE = value after calling*/