Fix stack argument order, blob execution still isnt working

This commit is contained in:
meepingsnesroms
2018-07-01 13:02:36 -07:00
parent 73c5dc77b4
commit fd741e4634
4 changed files with 14 additions and 4 deletions

View File

@@ -1,3 +1,13 @@
The first argument to a function is the last pushed on the stack(proof below, the 16 bit int is the last argument and its pushed first)
ROM:1003026C move.w d0,-(sp) ; Move Data from Source to Destination
ROM:1003026E move.l a4,-(sp) ; Move Data from Source to Destination
ROM:10030270 move.l d7,-(sp) ; Move Data from Source to Destination
ROM:10030272 trap #$F ; Trap sysTrapStrNCopy
ROM:10030272 dc.w $A2CE
Char * StrNCopy(Char *dst, const Char *src, Int16 n)SYS_TRAP(sysTrapStrNCopy);
HwrIRQ4Handler Interrupt Level 4 Priority(top of the list is checked first):
UART 1 and 2(they have the same priority)
RTC

View File

@@ -105,4 +105,4 @@ static ALIGN(2) uint8_t HwrADC_PIC_bin[] = {
/*static uint32_t HwrADC_PIC_len = 1159;*/
const void (*customCall_HwrADC)(void* returnData, uint16_t mode) = (const void (*)(void* , uint16_t))HwrADC_PIC_bin;
const void (*customCall_HwrADC)(uint16_t mode, void* returnData) = (const void (*)(uint16_t, void*))HwrADC_PIC_bin;

View File

@@ -4,6 +4,6 @@
#include <PalmOS.h>
#include <stdint.h>
const void (*customCall_HwrADC)(void* returnData, uint16_t mode);
const void (*customCall_HwrADC)(uint16_t mode, void* returnData);
#endif

View File

@@ -436,7 +436,7 @@ var ads7846ReadOsVersion(){
static Boolean firstRun = true;
static Boolean referenceMode;
uint8_t ads7846Channel;
uint16_t channelData[7];
uint16_t channelData[14];/*should be 7 but just want to be safe*/
uint16_t y = 0;
if(firstRun){
@@ -453,7 +453,7 @@ var ads7846ReadOsVersion(){
exitSubprogram();
}
customCall_HwrADC(channelData, referenceMode);
customCall_HwrADC(referenceMode, channelData);
StrPrintF(sharedDataBuffer, "Ref Mode:%s", referenceMode ? "true" : "false");
UG_PutString(0, y, sharedDataBuffer);