Ok, ARM blobs seem to be compiling

This commit is contained in:
meepingsnesroms
2019-01-09 11:47:17 -08:00
parent e885942603
commit def07b53d0
8 changed files with 51 additions and 15 deletions

4
.gitignore vendored
View File

@@ -21,8 +21,8 @@
/tools/palm/muExpansionDriver/muExpDriver
/tools/palm/muExpansionDriver/muExpDriver-sections.s
/tools/palm/muExpansionDriver/muExpDriver-sections.ld
/tools/palm/muExpansionDriver/asmSrcs/*.L68
/tools/palm/muExpansionDriver/asmSrcs/*.S68
/tools/palm/muExpansionDriver/armExit
/tools/palm/muExpansionDriver/armCall68k
/tools/desktop/build-BufferGraphViewer-*
/tools/desktop/build-MakePalmIcon-*
/tools/desktop/export16BitImageProperly/convert

View File

@@ -1,5 +0,0 @@
LDR R4, 1
MOV R5, R1
MOV R6, R2
MOV R7, R3
HYPERCALL

View File

@@ -1,2 +0,0 @@
LDR R4, 0
HYPERCALL

View File

@@ -0,0 +1,26 @@
#include <Standalone.h>
#include <stdint.h>
STANDALONE_CODE_RESOURCE_ID(1);
void start(void){
register uint32_t r1 asm("r1");
register uint32_t r2 asm("r2");
register uint32_t r3 asm("r3");
register uint32_t r4 asm("r4");
register uint32_t r5 asm("r5");
register uint32_t r6 asm("r6");
register uint32_t r7 asm("r7");
r4 = 1;
r5 = r1;
r6 = r2;
r7 = r3;
/*hypercall*/
asm(".long 0xF7BBBBBB");
/*return value of the 68k call is put in r0 by the PceNativeCall implementation*/
}

View File

@@ -0,0 +1,16 @@
#include <Standalone.h>
#include <stdint.h>
STANDALONE_CODE_RESOURCE_ID(0);
void start(void){
register uint32_t r4 asm("r4");
r4 = 0;
/*hypercall*/
asm(".long 0xF7BBBBBB");
}

View File

@@ -0,0 +1 @@
These are standalone code resources compiled in ARM mode, no global variables or accessing 68k code is allowed.

View File

@@ -1,5 +1 @@
This project can't use global variables, its executed without being launched so writing to globals will corrupt the currently running application, reading will just retrieve random numbers or crash because of invalid access.
*.func files are binary blobs containing ASM code to perform sensitive functions:
armCall68k.func is ARM asm that sets up a path back to 68k code without ending ARM execution
armExit.func is ARM asm that terminates ARM execution

View File

@@ -7,7 +7,7 @@ cd $DIR
APPNAME="MuExpDriver"
if [ "$1" = "clean" ]; then
rm -rf *.o *.a $APPNAME $APPNAME.prc *.bin
rm -rf *.o *.a $APPNAME ./armExit ./armCall68k $APPNAME.prc *.bin
exit
fi
@@ -18,6 +18,10 @@ if [ "$1" = "debug" ]; then
CFLAGS="$CFLAGS -DDEBUG -g"
fi
arm-palmos-gcc $CFLAGS -c ./armSrc/armExit.c -o ./armSrc/armExit.o
arm-palmos-gcc $CFLAGS -c ./armSrc/armCall68k.c -o ./armSrc/armCall68k.o
arm-palmos-gcc -nostartfiles -o ./armExit ./armSrc/armExit.o
arm-palmos-gcc -nostartfiles -o ./armCall68k ./armSrc/armCall68k.o
for I in "${FILES[@]}"; do
m68k-palmos-gcc $CFLAGS -c $I.c -o $I.o
done
@@ -29,4 +33,4 @@ if type "MakePalmIcon" &> /dev/null; then
fi
pilrc $APPNAME.rcp
build-prc $APPNAME.def $APPNAME *.bin
build-prc $APPNAME.def $APPNAME ./armExit ./armCall68k *.bin