You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rom.s: Assembler messages:
rom.s:42584: use of r13 is deprecated
rom.s:42608: use of r13 is deprecated
rom.s:42623: use of r13 is deprecated
c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/bin/ld.exe: c:/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/11.1.0/../../../../arm-none-eabi/lib/gba_crt0.o: in function `CIDExit':
(.crt0+0x20c): undefined reference to `main'
collect2.exe: error: ld returned 1 exit status
The text was updated successfully, but these errors were encountered:
I'm still figuring this out myself, but I'll share what I have so far:
#command to compile assembly into object file
arm-none-eabi-as -mcpu=arm7tdmi -mthumb-interwork rom.s -o rom.o
#command to link object file (WIP)
arm-none-eabi-ld rom.o rom.elf
#command to format GBA Header portions inside ELF file. (Maybe not necessary for my setup?)
tools/gbafix/gbafix hmfmt.elf -t"HARVESTMOGBA" -c"A4NE" -m"E9" -r"0" --silent
#-r"0"
#-t[<title>] Patch title. Stripped filename if none given.
#-c<game_code> Patch game code (four characters)
#-m<maker_code> Patch maker code (two characters)
#-r Patch game version (number)
#I found a tool called gbata to get me these values from the original rom.
#Command to pull binary out of elf and into a rom file, then pad out the length I'm guessing?
#to find the --pad-to value, I opened up the original rom in HxD and found the last row, then rounded it up.
arm-none-eabi-objcopy -O binary --gap-fill 0xFF --pad-to 0x800000 rom.elf rom.gba
This gets me a correctly sized, validly formatted .gba file. It only has about 10 bytes different from the original rom file. It won't run in an emulator, because of an error that execution jumped to an invalid address.
If you figure it out further from here, let me know.
I am unable to recompile identically to the original rom using devkitARM.
arm-none-eabi-gcc -o rom.elf -specs=gba.specs rom.s
Gives the following output:
The text was updated successfully, but these errors were encountered: