More fixes for testSuite

This commit is contained in:
meepingsnesroms
2018-04-07 17:50:35 -07:00
parent f21d7516e6
commit 6affae6ee2
9 changed files with 122 additions and 25 deletions

View File

@@ -5,7 +5,7 @@
#ifdef DEBUG
#define DEBUG_AREA_SIZE 10
#define DEBUG_AREA_SIZE 30
#define DEBUG_STRING_SIZE 100

View File

@@ -3,7 +3,8 @@
#include "emuFeatureRegistersSpec.h"
Boolean isEmulator(){
return (readArbitraryMemory32(EMU_REGISTER_BASE | EMU_INFO) & FEATURE_EMU_HONEST) != 0;
/*return (readArbitraryMemory32(EMU_REGISTER_BASE | EMU_INFO) & FEATURE_EMU_HONEST) != 0;*/
return false;
}
Boolean isEmulatorFeatureEnabled(uint32_t feature){

View File

@@ -16,4 +16,4 @@ If you enable unsafe mode you will have to reboot to exit, this is because it wi
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.
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.
(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

@@ -92,6 +92,12 @@ var memoryAllocationError(){
static void uguiDrawPixel(UG_S16 x, UG_S16 y, UG_COLOR color){
/*ugui will call this function even if its over the screen bounds, dont let those writes through*/
/*
if(x >= 0 && x < SCREEN_WIDTH && y >= 0 && y < SCREEN_HEIGHT){
}
*/
/*using 1bit grayscale*/
int pixel = x + y * SCREEN_WIDTH;
int byte = pixel / 8;
@@ -196,7 +202,7 @@ static Boolean testerInit(){
WinSetActiveWindow(WinGetDisplayWindow());
UG_Init(&uguiStruct, uguiDrawPixel, SCREEN_WIDTH, SCREEN_HEIGHT);
UG_FontSelect(&FONT_8X8);
UG_FontSelect(&SELECTED_FONT);
UG_SetBackcolor(C_WHITE);
UG_SetForecolor(C_BLACK);
UG_ConsoleSetBackcolor(C_WHITE);
@@ -225,12 +231,17 @@ static void testerFrameLoop(){
palmButtons = KeyCurrentState();
if(!unsafeMode){
/*allow exiting the app normally*/
/*allow exiting the app normally and prevent filling up the event loop*/
EventType event;
EvtGetEvent(&event, 1);
SysHandleEvent(&event);
if(event.eType == appStopEvent)
applicationRunning = false;
do{
EvtGetEvent(&event, 1);
SysHandleEvent(&event);
if(event.eType == appStopEvent){
applicationRunning = false;
break;
}
}
while(event.eType != nilEvent);
}
lastSubprogramReturnValue = currentSubprogram();
@@ -257,6 +268,18 @@ DWord PilotMain(Word cmd, Ptr cmdBPB, Word launchFlags){
testerExit();
}
else if(cmd == sysAppLaunchCmdSystemReset){
#ifdef DEBUG
/*app crashed, to ease development just self delete from internal storage*/
/*
LocalID whatToDelete;
whatToDelete = DmFindDatabase(0, "HWTests");
DmDeleteDatabase(0, whatToDelete);
SysReset();
*/
#endif
}
return(0);
}

View File

@@ -8,4 +8,8 @@
#define TESTS_AVAILABLE 20
#define TEST_NAME_LENGTH 32
#define FONT_WIDTH 6
#define FONT_HEIGHT 8
#define SELECTED_FONT FONT_6X8
#endif

View File

@@ -29,9 +29,7 @@ Err makeFile(uint8_t* data, uint32_t size, char* fileName){
count -= chunkSize;
}
UG_PutString(0, 0, "File close next");
error = FileClose(file);//I have no idea why, but this function causes a fatal execption but i still get valid data in the file after reboot
error = FileClose(file);
return error;
}
@@ -63,7 +61,7 @@ var hexRamBrowser(){
nibble = UINT32_C(0x10000000);
clearScreen = true;
setSubprogramArgs(makeVar(LENGTH_ANY, TYPE_PTR, (uint64_t)pointerValue));/*length doesnt matter*/
execSubprogram(hexViewer);
callSubprogram(hexViewer);
}
if(getButtonPressed(buttonBack)){
@@ -111,7 +109,7 @@ var getTrapAddress(){
nibble = 0x100;
clearScreen = true;
setSubprogramArgs(makeVar(LENGTH_ANY, TYPE_PTR, (uint64_t)(uint32_t)SysGetTrapAddress(trapNum)));
execSubprogram(valueViewer);
callSubprogram(valueViewer);
}
if(getButtonPressed(buttonBack)){
@@ -131,6 +129,61 @@ var getTrapAddress(){
return makeVar(LENGTH_0, TYPE_NULL, 0);
}
var manualLssa(){
static uint32_t nibble;
static uint32_t hexValue;
static uint32_t originalLssa;
static Boolean customEnabled;
static Boolean firstRun = true;
if(firstRun == true){
nibble = UINT32_C(0x10000000);
hexValue = UINT32_C(0x77777777);
originalLssa = readArbitraryMemory32(0xFFFFFA00);
customEnabled = false;
firstRun = false;
}
if(getButtonPressed(buttonUp)){
hexValue += nibble;
}
if(getButtonPressed(buttonDown)){
hexValue -= nibble;
}
if(getButtonPressed(buttonRight)){
if(nibble > UINT32_C(0x00000001))
nibble >>= 4;
}
if(getButtonPressed(buttonLeft)){
if(nibble < UINT32_C(0x10000000))
nibble <<= 4;
}
if(getButtonPressed(buttonSelect)){
if(customEnabled){
writeArbitraryMemory32(0xFFFFFA00, originalLssa);
customEnabled = false;
}
else{
writeArbitraryMemory32(0xFFFFFA00, hexValue);
customEnabled = true;
}
}
if(getButtonPressed(buttonBack)){
firstRun = true;
exitSubprogram();
}
StrPrintF(sharedDataBuffer, "Enter switchs between this address and the custom LSSA.\nNew LSSA:\n0x%08lX", hexValue);
UG_PutString(0, 0, sharedDataBuffer);
return makeVar(LENGTH_0, TYPE_NULL, 0);
}
var dumpBootloaderToFile(){
makeFile((uint8_t*)UINT32_C(0xFFFFFE00), 0x200, "BOOTLOADER.BIN");
exitSubprogram();

View File

@@ -5,7 +5,8 @@
#include "testSuite.h"
Err makeFile(uint8_t* data, uint32_t size, char* fileName);
var getTrapAddress();
var hexRamBrowser();
var getTrapAddress();
var manualLssa();
var dumpBootloaderToFile();
#endif

View File

@@ -1,7 +1,8 @@
#ifndef __UGUI_CONFIG_H
#define __UGUI_CONFIG_H
#include <stdint.h>
#include <stdint.h>
#include "testSuiteConfig.h"
/* -------------------------------------------------------------------------------- */
/* -- CONFIG SECTION -- */
@@ -13,14 +14,21 @@
//#define USE_COLOR_RGB888 // RGB = 0xFF,0xFF,0xFF
#define USE_COLOR_RGB565 // RGB = 0bRRRRRGGGGGGBBBBB
/* Enable needed fonts here */
//#define USE_FONT_4X6
/* Enable needed fonts here */
#if FONT_WIDTH == 4 && FONT_HEIGHT == 6
#define USE_FONT_4X6
#elif FONT_WIDTH == 5 && FONT_HEIGHT == 8
#define USE_FONT_5X8
#elif FONT_WIDTH == 6 && FONT_HEIGHT == 8
#define USE_FONT_6X8
#endif
//#define USE_FONT_4X6
//#define USE_FONT_5X8
//#define USE_FONT_5X12
//#define USE_FONT_6X8
//#define USE_FONT_6X10
//#define USE_FONT_7X12
#define USE_FONT_8X8
//#define USE_FONT_8X8
//#define USE_FONT_8X12_CYRILLIC
//#define USE_FONT_8X12
//#define USE_FONT_8X12

View File

@@ -3,11 +3,10 @@
#include "tools.h"
#include "tests.h"
#include "debug.h"
#include "cpu.h"
#include "ugui.h"
#define FONT_WIDTH 8
#define FONT_HEIGHT 8
#define FONT_SPACING 0
#define RESERVED_PIXELS_Y (SCREEN_HEIGHT / 4)/*save pixels at the bottom of the screen for other information on the current item*/
@@ -107,7 +106,7 @@ static void testPickerHandler(uint32_t command){
}
else if(command == LIST_ITEM_SELECTED){
setDebugTag("Test Picker Test Selected");
execSubprogram(hwTests[selectedEntry].testFunction);
callSubprogram(hwTests[selectedEntry].testFunction);
}
}
@@ -287,11 +286,19 @@ void initViewer(){
hwTests[totalHwTests].testFunction = getTrapAddress;
totalHwTests++;
StrNCopy(hwTests[totalHwTests].name, "Dump Bootloader", TEST_NAME_LENGTH);
hwTests[totalHwTests].testFunction = dumpBootloaderToFile;
totalHwTests++;
if(getPhysicalCpuType() & CPU_M68K){
/*68k only functions*/
StrNCopy(hwTests[totalHwTests].name, "Dump Bootloader", TEST_NAME_LENGTH);
hwTests[totalHwTests].testFunction = dumpBootloaderToFile;
totalHwTests++;
StrNCopy(hwTests[totalHwTests].name, "Manual LSSA", TEST_NAME_LENGTH);
hwTests[totalHwTests].testFunction = manualLssa;
totalHwTests++;
}
StrNCopy(hwTests[totalHwTests].name, "File Access Test", TEST_NAME_LENGTH);
hwTests[totalHwTests].testFunction = testFileAccessWorks;
totalHwTests++;
}