From 3b1756efaebdcc7860ae9f584fc6edfed111afdd Mon Sep 17 00:00:00 2001 From: meepingsnesroms Date: Wed, 25 Apr 2018 16:15:37 -0700 Subject: [PATCH] Add list all P*DATA registers mode for hwTests Also remove UINT64_C anc UINT32_C, they were meant to fix a sprintf issue but they dident and were leftovers. --- hwTestSuite/cpu.c | 11 ++-- hwTestSuite/cpu.h | 3 +- hwTestSuite/emuFeatureRegistersSpec.h | 5 +- hwTestSuite/emuFunctions.c | 4 +- hwTestSuite/hardwareRegisterNames.h | 4 +- hwTestSuite/readme.md | 6 +-- hwTestSuite/testSuite.h | 3 -- hwTestSuite/tests.c | 73 ++++++++++++++++++++------- hwTestSuite/tests.h | 3 +- hwTestSuite/tools.c | 69 +++++++++++-------------- hwTestSuite/tools.h | 1 + hwTestSuite/viewer.c | 47 +++++++---------- hwTestSuite/viewer.h | 1 + src/emuFeatureRegistersSpec.h | 5 +- src/hardwareRegisterNames.h | 4 +- 15 files changed, 131 insertions(+), 108 deletions(-) diff --git a/hwTestSuite/cpu.c b/hwTestSuite/cpu.c index 3c3a694..27d1fdf 100644 --- a/hwTestSuite/cpu.c +++ b/hwTestSuite/cpu.c @@ -2,6 +2,7 @@ #include #include "testSuite.h" #include "emuFunctions.h" +#include "hardwareRegisterNames.h" #include "viewer.h" #include "cpu.h" @@ -18,14 +19,14 @@ uint8_t getPhysicalCpuType(){ else if(osVer >= PalmOS50) return CPU_ARM; - /*get dragonball cpu sub type*/ + /*get dragonball CPU subtype*/ return CPU_M68K; } uint8_t getSupportedInstructionSets(){ if((getPhysicalCpuType() & CPU_ARM) || isEmulator()){ - /*emulated m68k on physical arm or running both cpus from emulator*/ + /*emulated m68k on physical ARM or running both CPUs from emulator*/ return CPU_BOTH; } return CPU_M68K; @@ -74,7 +75,11 @@ var enterUnsafeMode(){ exitSubprogram();/*only run once/for one frame*/ if((getPhysicalCpuType() & CPU_M68K) || isEmulator()){ - /*here all ram banks must be set to read/write and all memory access execptions must be turned off, along with most interrupts*/ + /*here all RAM banks must be set to read/write and all memory access execptions must be turned off, along with most interrupts*/ + + /*disable interrupt on invalid memory access*/ + writeArbitraryMemory8(HW_REG_ADDR(SCR), readArbitraryMemory8(HW_REG_ADDR(SCR)) & 0xEF); + unsafeMode = true; resetFunctionViewer(); return makeVar(LENGTH_1, TYPE_BOOL, true);/*now in unsafe mode*/ diff --git a/hwTestSuite/cpu.h b/hwTestSuite/cpu.h index 338398c..bebb133 100644 --- a/hwTestSuite/cpu.h +++ b/hwTestSuite/cpu.h @@ -4,7 +4,6 @@ #include #include - #define CPU_NONE 0x00/*only if in emulator with special features enabled, returned for physical cpu in emulator*/ #define CPU_M68K 0x01 #define CPU_ARM 0x02 @@ -17,9 +16,9 @@ #define CPU_M68K_SZ 0x80 #define CPU_M68K_TYPES 0xF0 - uint8_t getPhysicalCpuType(); uint8_t getSupportedInstructionSets(); char* getCpuString(); var enterUnsafeMode(); + #endif diff --git a/hwTestSuite/emuFeatureRegistersSpec.h b/hwTestSuite/emuFeatureRegistersSpec.h index ad0648d..313f10e 100644 --- a/hwTestSuite/emuFeatureRegistersSpec.h +++ b/hwTestSuite/emuFeatureRegistersSpec.h @@ -8,13 +8,14 @@ These registers will do nothing it there corresponding feature bit is not set on #define EMU_REGISTER_BASE 0xFFFFE000/*just before the m68k hardware registers, in the same bank*/ #define EMU_REGISTER_SIZE 0x1000 +#define EMU_REG_ADDR(x) (EMU_REGISTER_BASE | x) /*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_HYBRID_CPU 0x00000004/*allows running ARM opcodes in an OS 4 enviroment*/ -#define FEATURE_320x320 0x00000008/*creates a 320x320 framebuffer for hires mode, the 320x320 framebuffer is a transparent overlay over the 160x160 framebuffer*/ +#define FEATURE_320x320 0x00000008/*creates a 320x320 framebuffer for hires mode, the 160x160 framebuffer is a transparent overlay over the 320x320 framebuffer*/ #define FEATURE_SYNCED_RTC 0x00000010/*RTC always equals host system time*/ #define FEATURE_HLE_APIS 0x00000020/*memcpy, memcmp, wait on timer will be replaced with the hosts function*/ #define FEATURE_EMU_HONEST 0x00000040/*tell the OS that its running in an emu, does nothing else*/ @@ -23,7 +24,7 @@ These registers will do nothing it there corresponding feature bit is not set on /*registers*/ #define EMU_INFO 0x000/*gets the feature bits, read only*/ -#define EMU_HIRESFB 0x004/*gets the address of the 320x320 framebuffer, read only*/ +#define EMU_HIRESFB 0x004/*sets the address of the 320x320 framebuffer, read/write*/ #define EMU_SRC 0x008/*write only*/ #define EMU_DST 0x00C/*write only*/ #define EMU_SIZE 0x010/*write only*/ diff --git a/hwTestSuite/emuFunctions.c b/hwTestSuite/emuFunctions.c index 485d4a6..3c0ea18 100644 --- a/hwTestSuite/emuFunctions.c +++ b/hwTestSuite/emuFunctions.c @@ -3,12 +3,12 @@ #include "emuFeatureRegistersSpec.h" Boolean isEmulator(){ - /*return (readArbitraryMemory32(EMU_REGISTER_BASE | EMU_INFO) & FEATURE_EMU_HONEST) != 0;*/ + /*return (readArbitraryMemory32(EMU_REG_ADDR(EMU_INFO)) & FEATURE_EMU_HONEST) != 0;*/ return false; } Boolean isEmulatorFeatureEnabled(uint32_t feature){ if(isEmulator()) - return (readArbitraryMemory32(EMU_REGISTER_BASE | EMU_INFO) & feature) != 0; + return (readArbitraryMemory32(EMU_REG_ADDR(EMU_INFO)) & feature) != 0; return false; } diff --git a/hwTestSuite/hardwareRegisterNames.h b/hwTestSuite/hardwareRegisterNames.h index b614b3c..02e25f8 100644 --- a/hwTestSuite/hardwareRegisterNames.h +++ b/hwTestSuite/hardwareRegisterNames.h @@ -1,5 +1,5 @@ -#ifndef DRAGONBALL_VZ_REGISTER_H -#define DRAGONBALL_VZ_REGISTER_H +#ifndef HARDWARE_REGISTER_NAMES_H +#define HARDWARE_REGISTER_NAMES_H /*Dragonball VZ Hardware Register Definitions*/ #define HW_REG_ADDR(x) (0xFFFFF000 | (x)) diff --git a/hwTestSuite/readme.md b/hwTestSuite/readme.md index 8b06f0d..edfe2b2 100644 --- a/hwTestSuite/readme.md +++ b/hwTestSuite/readme.md @@ -1,8 +1,8 @@ # Palm OS Hardware Test Suite The tests available in the end will be: -Dump Bootloader(Original, EZ, VZ) -Rom Writes +Dump Bootloader(EZ, VZ, SZ) +ROM Writes m68k CPU Version Test Emu Registers Verify TBLXX Opcodes @@ -13,7 +13,7 @@ The version of gcc avalible for Palm OS is very old, any change you make must be 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. +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/testSuite.h b/hwTestSuite/testSuite.h index af1de24..f62b89b 100644 --- a/hwTestSuite/testSuite.h +++ b/hwTestSuite/testSuite.h @@ -5,7 +5,6 @@ #include #include "testSuiteConfig.h" - /*defines*/ #define SHARED_DATA_BUFFER_SIZE 1000 @@ -35,7 +34,6 @@ #define LENGTH_ANY 0x70/*for pointers with a user defined end or no end*/ #define LENGTH_STR 0xF0/*for pointers to string*/ - /*types*/ typedef struct{ uint8_t type; @@ -49,7 +47,6 @@ typedef struct{ activity_t testFunction; }test_t; - /*variables*/ extern uint16_t palmButtons; extern uint16_t palmButtonsLastFrame; diff --git a/hwTestSuite/tests.c b/hwTestSuite/tests.c index 6f95488..4c59509 100644 --- a/hwTestSuite/tests.c +++ b/hwTestSuite/tests.c @@ -1,17 +1,11 @@ #include "testSuite.h" #include "testSuiteConfig.h" +#include "hardwareRegisterNames.h" #include "debug.h" #include "tools.h" #include "ugui.h" -var testFileAccessWorks(){ - uint32_t testTook = UINT32_C(0xFFFFFE00); - makeFile((uint8_t*)&testTook, 4, "FILEOUT.BIN"); - exitSubprogram(); - return makeVar(LENGTH_0, TYPE_NULL, 0); -} - var testButtonInput(){ static Boolean firstRun = true; static Boolean polaritySwap; @@ -23,19 +17,19 @@ var testButtonInput(){ debugSafeScreenClear(C_WHITE); polaritySwap = false; frameCount = 0; - portDOriginalPolarity = readArbitraryMemory8(0xFFFFF41C); + portDOriginalPolarity = readArbitraryMemory8(HW_REG_ADDR(PDPOL)); firstRun = false; } frameCount++; if(frameCount >= 30){ - writeArbitraryMemory8(0xFFFFF41C, ~readArbitraryMemory8(0xFFFFF41C) & 0x07); + writeArbitraryMemory8(HW_REG_ADDR(PDPOL), ~readArbitraryMemory8(HW_REG_ADDR(PDPOL)) & 0x07); frameCount = 0; } if(getButton(buttonLeft) && getButton(buttonRight) && getButton(buttonUp) && getButton(buttonBack) && !getButton(buttonDown) && !getButton(buttonSelect)){ firstRun = true; - writeArbitraryMemory8(0xFFFFF41C, portDOriginalPolarity); + writeArbitraryMemory8(HW_REG_ADDR(PDPOL), portDOriginalPolarity); exitSubprogram(); } @@ -46,21 +40,64 @@ var testButtonInput(){ UG_PutString(0, y, "This requirement is to allow button testing."); y += (FONT_HEIGHT + 1) * 2; - /*setDebugTag("PDPOL read");*/ - StrPrintF(sharedDataBuffer, "PDPOL:0x%02X", readArbitraryMemory8(0xFFFFF41C)); + StrPrintF(sharedDataBuffer, "PDPOL:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PDPOL))); UG_PutString(0, y, sharedDataBuffer); y += FONT_HEIGHT + 1; - - /*setDebugTag("PDDATA read");*/ - StrPrintF(sharedDataBuffer, "PDDATA:0x%02X", readArbitraryMemory8(0xFFFFF419)); + StrPrintF(sharedDataBuffer, "PDDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PDDATA))); UG_PutString(0, y, sharedDataBuffer); y += FONT_HEIGHT + 1; - - /*setDebugTag("PDKBEN read");*/ - StrPrintF(sharedDataBuffer, "PDKBEN:0x%02X", readArbitraryMemory8(0xFFFFF41E)); + StrPrintF(sharedDataBuffer, "PDKBEN:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PDKBEN))); UG_PutString(0, y, sharedDataBuffer); y += FONT_HEIGHT + 1; + return makeVar(LENGTH_0, TYPE_NULL, 0); +} + +var listDataRegisters(){ + static Boolean firstRun = true; + uint32_t y = 0; + + if(firstRun){ + firstRun = false; + debugSafeScreenClear(C_WHITE); + } + + StrPrintF(sharedDataBuffer, "PADATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PADATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PBDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PBDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PCDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PCDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PDDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PDDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PEDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PEDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PFDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PFDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PGDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PGDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PJDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PJDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PKDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PKDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + StrPrintF(sharedDataBuffer, "PMDATA:0x%02X", readArbitraryMemory8(HW_REG_ADDR(PMDATA))); + UG_PutString(0, y, sharedDataBuffer); + y += FONT_HEIGHT + 1; + + if(getButtonPressed(buttonBack)){ + firstRun = true; + exitSubprogram(); + } + return makeVar(LENGTH_0, TYPE_NULL, 0); } diff --git a/hwTestSuite/tests.h b/hwTestSuite/tests.h index 896bff0..306fcb2 100644 --- a/hwTestSuite/tests.h +++ b/hwTestSuite/tests.h @@ -3,6 +3,7 @@ #include "testSuite.h" -var testFileAccessWorks(); var testButtonInput(); +var listDataRegisters(); + #endif diff --git a/hwTestSuite/tools.c b/hwTestSuite/tools.c index ecb0379..fa91484 100644 --- a/hwTestSuite/tools.c +++ b/hwTestSuite/tools.c @@ -1,4 +1,5 @@ #include +#include "hardwareRegisterNames.h" #include "testSuite.h" #include "viewer.h" #include "debug.h" @@ -24,8 +25,11 @@ Err makeFile(uint8_t* data, uint32_t size, char* fileName){ sharedDataBuffer[i] = data[i + size - count]; } bytesWritten = FileWrite(file, sharedDataBuffer, 1, chunkSize, &error); - if(bytesWritten != chunkSize || error) + if(bytesWritten != chunkSize || error){ + FileClose(file); return error; + } + count -= chunkSize; } @@ -40,28 +44,24 @@ var hexRamBrowser(){ if(firstRun){ debugSafeScreenClear(C_WHITE); - nibble = UINT32_C(0x10000000); - pointerValue = UINT32_C(0x77777777);/*in the middle of the address space*/ + nibble = 0x10000000; + pointerValue = 0x77777777;/*in the middle of the address space*/ firstRun = false; } - if(getButtonPressed(buttonUp)){ + if(getButtonPressed(buttonUp)) pointerValue += nibble; - } - if(getButtonPressed(buttonDown)){ + if(getButtonPressed(buttonDown)) pointerValue -= nibble; - } - if(getButtonPressed(buttonRight)){ - if(nibble > UINT32_C(0x00000001)) + if(getButtonPressed(buttonRight)) + if(nibble > 0x00000001) nibble >>= 4; - } - if(getButtonPressed(buttonLeft)){ - if(nibble < UINT32_C(0x10000000)) + if(getButtonPressed(buttonLeft)) + if(nibble < 0x10000000) nibble <<= 4; - } if(getButtonPressed(buttonSelect)){ /*open hex viewer*/ @@ -93,23 +93,19 @@ var getTrapAddress(){ firstRun = false; } - if(getButtonPressed(buttonUp)){ + if(getButtonPressed(buttonUp)) trapNum = (trapNum + nibble & 0xFFF) | 0xA000; - } - if(getButtonPressed(buttonDown)){ + if(getButtonPressed(buttonDown)) trapNum = (trapNum - nibble & 0xFFF) | 0xA000; - } - if(getButtonPressed(buttonRight)){ + if(getButtonPressed(buttonRight)) if(nibble > 0x001) nibble >>= 4; - } - if(getButtonPressed(buttonLeft)){ + if(getButtonPressed(buttonLeft)) if(nibble < 0x100) nibble <<= 4; - } if(getButtonPressed(buttonSelect)){ /*open hex viewer*/ @@ -137,42 +133,37 @@ var manualLssa(){ static Boolean firstRun = true; if(firstRun){ - nibble = UINT32_C(0x10000000); - hexValue = UINT32_C(0x77777777); - originalLssa = readArbitraryMemory32(0xFFFFFA00); + nibble = 0x10000000; + hexValue = 0x77777777; + originalLssa = readArbitraryMemory32(HW_REG_ADDR(LSSA)); customEnabled = false; debugSafeScreenClear(C_WHITE); firstRun = false; } - if(getButtonPressed(buttonUp)){ + if(getButtonPressed(buttonUp)) hexValue += nibble; - } - if(getButtonPressed(buttonDown)){ + if(getButtonPressed(buttonDown)) hexValue -= nibble; - } - if(getButtonPressed(buttonRight)){ - if(nibble > UINT32_C(0x00000001)) + if(getButtonPressed(buttonRight)) + if(nibble > 0x00000001) nibble >>= 4; - } - if(getButtonPressed(buttonLeft)){ - if(nibble < UINT32_C(0x10000000)) + if(getButtonPressed(buttonLeft)) + if(nibble < 0x10000000) nibble <<= 4; - } - if(getButtonPressed(buttonSelect)){ + if(getButtonPressed(buttonSelect)) if(customEnabled){ - writeArbitraryMemory32(0xFFFFFA00, originalLssa); + writeArbitraryMemory32(HW_REG_ADDR(LSSA), originalLssa); customEnabled = false; } else{ - writeArbitraryMemory32(0xFFFFFA00, hexValue); + writeArbitraryMemory32(HW_REG_ADDR(LSSA), hexValue); customEnabled = true; } - } if(getButtonPressed(buttonBack)){ firstRun = true; @@ -186,7 +177,7 @@ var manualLssa(){ } var dumpBootloaderToFile(){ - makeFile((uint8_t*)UINT32_C(0xFFFFFE00), 0x200, "BOOTLOADER.BIN"); + makeFile((uint8_t*)0xFFFFFE00, 0x200, "BOOTLOADER.BIN"); exitSubprogram(); return makeVar(LENGTH_0, TYPE_NULL, 0); } diff --git a/hwTestSuite/tools.h b/hwTestSuite/tools.h index fc3235a..9fe7c0b 100644 --- a/hwTestSuite/tools.h +++ b/hwTestSuite/tools.h @@ -9,4 +9,5 @@ var hexRamBrowser(); var getTrapAddress(); var manualLssa(); var dumpBootloaderToFile(); + #endif diff --git a/hwTestSuite/viewer.c b/hwTestSuite/viewer.c index 2f291e5..ceffd7d 100644 --- a/hwTestSuite/viewer.c +++ b/hwTestSuite/viewer.c @@ -132,49 +132,40 @@ static void resetListHandler(){ } static var listModeFrame(){ + Boolean forceListRefreshOnNextRun = false; setDebugTag("List Mode Running"); - if(getButtonPressed(buttonUp)){ + if(getButtonPressed(buttonUp)) if(selectedEntry > 0) selectedEntry--; - } - if(getButtonPressed(buttonDown)){ + if(getButtonPressed(buttonDown)) if(selectedEntry + 1 < listLength) selectedEntry++; - } - if(getButtonPressed(buttonLeft) && listLength > ITEM_LIST_ENTRYS){ + if(getButtonPressed(buttonLeft) && listLength > ITEM_LIST_ENTRYS) if(selectedEntry - ITEM_LIST_ENTRYS >= 0) selectedEntry -= ITEM_LIST_ENTRYS;/*flip the page*/ else selectedEntry = 0; - } - if(getButtonPressed(buttonRight) && listLength > ITEM_LIST_ENTRYS){ + if(getButtonPressed(buttonRight) && listLength > ITEM_LIST_ENTRYS) if(selectedEntry + ITEM_LIST_ENTRYS < listLength) selectedEntry += ITEM_LIST_ENTRYS;/*flip the page*/ else selectedEntry = listLength - 1; - } if(getButtonPressed(buttonSelect)){ - /*select*/ + forceListRefreshOnNextRun = true; listHandler(LIST_ITEM_SELECTED); } - if(getButtonPressed(buttonBack)){ - /*go back*/ + if(getButtonPressed(buttonBack)) exitSubprogram(); - } if(selectedEntry != lastSelectedEntry || forceListRefresh){ listHandler(LIST_REFRESH); - } - - if(selectedEntry != lastSelectedEntry || forceListRefresh){ - /*update item colors*/ renderListFrame(); } @@ -183,6 +174,9 @@ static var listModeFrame(){ if(forceListRefresh) forceListRefresh = false; + if(forceListRefreshOnNextRun) + forceListRefresh = true; + return makeVar(LENGTH_0, TYPE_NULL, 0); } @@ -192,7 +186,6 @@ var valueViewer(){ uint64_t varData = getVarValue(value); if(getButtonPressed(buttonBack)){ - /*go back*/ clearNeeded = true; exitSubprogram(); } @@ -217,18 +210,16 @@ var valueViewer(){ UG_PutString(0, 0, sharedDataBuffer); break; - /* case TYPE_FLOAT: - StrPrintF(sharedDataBuffer, "float:%f", *(float*)(&varData + 4)); + StrPrintF(sharedDataBuffer, "float:%f", *(float*)&varData); UG_PutString(0, 0, sharedDataBuffer); break; - */ case TYPE_BOOL: if(varData) - UG_PutString(0, 0, "Bool:true"); + UG_PutString(0, 0, "Boolean:true"); else - UG_PutString(0, 0, "Bool:false"); + UG_PutString(0, 0, "Boolean:false"); break; default: @@ -254,7 +245,7 @@ var hexViewer(){ /*free roam ram access*/ selectedEntry = (uint32_t)getVarPointer(where); bufferAddress = 0; - listLength = UINT64_C(0x100000000); + listLength = 0x100000000; } listHandler = hexHandler; execSubprogram(listModeFrame); @@ -294,6 +285,10 @@ void resetFunctionViewer(){ hwTests[totalHwTests].testFunction = dumpBootloaderToFile; totalHwTests++; + StrNCopy(hwTests[totalHwTests].name, "List P*DATA Registers", TEST_NAME_LENGTH); + hwTests[totalHwTests].testFunction = listDataRegisters; + totalHwTests++; + if(unsafeMode){ StrNCopy(hwTests[totalHwTests].name, "Manual LSSA", TEST_NAME_LENGTH); hwTests[totalHwTests].testFunction = manualLssa; @@ -310,10 +305,4 @@ void resetFunctionViewer(){ totalHwTests++; } } - - /* - StrNCopy(hwTests[totalHwTests].name, "File Access Test", TEST_NAME_LENGTH); - hwTests[totalHwTests].testFunction = testFileAccessWorks; - totalHwTests++; - */ } diff --git a/hwTestSuite/viewer.h b/hwTestSuite/viewer.h index 84f33af..b9edc54 100644 --- a/hwTestSuite/viewer.h +++ b/hwTestSuite/viewer.h @@ -7,4 +7,5 @@ var valueViewer(); var hexViewer(); var functionPicker(); void resetFunctionViewer(); + #endif diff --git a/src/emuFeatureRegistersSpec.h b/src/emuFeatureRegistersSpec.h index ad0648d..313f10e 100644 --- a/src/emuFeatureRegistersSpec.h +++ b/src/emuFeatureRegistersSpec.h @@ -8,13 +8,14 @@ These registers will do nothing it there corresponding feature bit is not set on #define EMU_REGISTER_BASE 0xFFFFE000/*just before the m68k hardware registers, in the same bank*/ #define EMU_REGISTER_SIZE 0x1000 +#define EMU_REG_ADDR(x) (EMU_REGISTER_BASE | x) /*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_HYBRID_CPU 0x00000004/*allows running ARM opcodes in an OS 4 enviroment*/ -#define FEATURE_320x320 0x00000008/*creates a 320x320 framebuffer for hires mode, the 320x320 framebuffer is a transparent overlay over the 160x160 framebuffer*/ +#define FEATURE_320x320 0x00000008/*creates a 320x320 framebuffer for hires mode, the 160x160 framebuffer is a transparent overlay over the 320x320 framebuffer*/ #define FEATURE_SYNCED_RTC 0x00000010/*RTC always equals host system time*/ #define FEATURE_HLE_APIS 0x00000020/*memcpy, memcmp, wait on timer will be replaced with the hosts function*/ #define FEATURE_EMU_HONEST 0x00000040/*tell the OS that its running in an emu, does nothing else*/ @@ -23,7 +24,7 @@ These registers will do nothing it there corresponding feature bit is not set on /*registers*/ #define EMU_INFO 0x000/*gets the feature bits, read only*/ -#define EMU_HIRESFB 0x004/*gets the address of the 320x320 framebuffer, read only*/ +#define EMU_HIRESFB 0x004/*sets the address of the 320x320 framebuffer, read/write*/ #define EMU_SRC 0x008/*write only*/ #define EMU_DST 0x00C/*write only*/ #define EMU_SIZE 0x010/*write only*/ diff --git a/src/hardwareRegisterNames.h b/src/hardwareRegisterNames.h index b614b3c..02e25f8 100644 --- a/src/hardwareRegisterNames.h +++ b/src/hardwareRegisterNames.h @@ -1,5 +1,5 @@ -#ifndef DRAGONBALL_VZ_REGISTER_H -#define DRAGONBALL_VZ_REGISTER_H +#ifndef HARDWARE_REGISTER_NAMES_H +#define HARDWARE_REGISTER_NAMES_H /*Dragonball VZ Hardware Register Definitions*/ #define HW_REG_ADDR(x) (0xFFFFF000 | (x))