Clean up more c89 and Palm OS int length crap

This commit is contained in:
meepingsnesroms
2018-04-03 11:19:43 -07:00
parent 9abbeaa9b3
commit 5dbbd5cc8f
4 changed files with 24 additions and 20 deletions

View File

@@ -249,7 +249,6 @@ static Boolean testerInit(){
lastSubprogramReturnValue = makeVar(LENGTH_0, TYPE_NULL, 0);
subprogramArgs = makeVar(LENGTH_0, TYPE_NULL, 0);
currentSubprogram = testPicker;
/*currentSubprogram = hexRamBrowser;*/
return true;
}

View File

@@ -2,44 +2,47 @@
#include "viewer.h"
#include "ugui.h"
var hexRamBrowser(){
static Boolean clearScreen = true;
static uint32_t column = 0;/*what column to change with up/down keys*/
static uint32_t pointerValue = 0x00000000;
static uint32_t nibble = 0;/*what column to change with up/down keys*/
static uint32_t pointerValue = UINT32_C(0x77777777);/*in the middle of everything*/
static char hexString[100];
if(getButtonPressed(buttonUp)){
pointerValue += 0x1 << (4 * (7 - column));
pointerValue += 0x1 << (4 * (7 - nibble));
}
if(getButtonPressed(buttonDown)){
pointerValue -= 0x1 << (4 * (7 - column));
pointerValue -= 0x1 << (4 * (7 - nibble));
}
if(getButtonPressed(buttonLeft)){
if(column > 0)
column--;
if(nibble > 0)
nibble--;
}
if(getButtonPressed(buttonRight)){
if(column < 7)
column++;
if(nibble < 7)
nibble++;
}
if(getButtonPressed(buttonSelect)){
/*open hex viewer*/
nibble = 0;
clearScreen = true;
setSubprogramArgs(makeVar(LENGTH_ANY, TYPE_PTR, pointerValue));/*length doesnt matter*/
execSubprogram(hexViewer);
}
if(getButtonPressed(buttonBack)){
nibble = 0;
clearScreen = true;
exitSubprogram();
}
StrPrintF(hexString, "Open Hex Viewer At:\n0x%08X", pointerValue);
/*Palm OS sprintf only supports 16 bit ints*/
StrPrintF(hexString, "Open Hex Viewer At:\n0x%04X%04X", (uint16_t)(pointerValue >> 16), (uint16_t)pointerValue);
if(clearScreen){
UG_FillScreen(C_WHITE);

View File

@@ -28,8 +28,8 @@
/*tests*/
static test_t hwTests[TESTS_AVAILABLE];
static uint32_t totalHwTests;
static test_t hwTests[TESTS_AVAILABLE];
static uint32_t totalHwTests;
/*graphics*/
static UG_WINDOW fbWindow;
@@ -38,13 +38,13 @@ static UG_TEXTBOX listEntrys[ITEM_LIST_ENTRYS];
static char textboxString[ITEM_LIST_ENTRYS][ITEM_STRING_SIZE];
/*list handler variables*/
static uint32_t page = 0;
static uint32_t index = 0;
static uint32_t lastIndex = 0;
static uint32_t lastPage = 0;
static uint32_t listLength = 0;
static uint32_t selectedEntry = 0;
static Boolean forceListRefresh = true;
static uint32_t page;
static uint32_t index;
static uint32_t lastIndex;
static uint32_t lastPage;
static uint32_t listLength;
static uint32_t selectedEntry;
static Boolean forceListRefresh;
static void (*listHandler)(uint32_t command);
/*specific handler variables*/
@@ -163,6 +163,8 @@ static var listModeFrame(){
lastIndex = index;
lastPage = page;
//forceTextEntryRefresh(0);
fbWindow.state |= WND_STATE_UPDATE;
UG_Update();
UG_PutString(0, 50, "subprogram exec worked");