How to compile .s to .gba?

Post Reply
sudo-sandwich
Posts: 1
Joined: Mon Oct 18, 2021 8:14 pm

How to compile .s to .gba?

Post by sudo-sandwich » Fri Nov 19, 2021 6:09 pm

I want to mod a game, but I'm having trouble recompiling after decompiling. I've decompiled my rom with luvdis (https://github.com/aarant/luvdis), which outputs a .s file. Luvdis claims that the decompiled output should recompile identically to the original rom. However, I was unable to recompile my rom (without any modifications). The new rom and the old rom do not match and the new rom doesn't boot in any emulator.

How do I compile a .s file to a useable .gba rom? Am I even approaching this the right way?

WinterMute
Site Admin
Posts: 1567
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: How to compile .s to .gba?

Post by WinterMute » Thu Jun 02, 2022 12:18 am

I tried luvdis with some devkitARM compiled .gba files and managed to build identical ROMs OK. These are the commands I used to recompile the source.

Code: Select all

/opt/devkitpro/devkitARM/bin/arm-none-eabi-gcc rom.s -Ttext=0x8000000 -nostartfiles -nodefaultlibs -o rom.elf
/opt/devkitpro/devkitARM/bin/arm-none-eabi-objcopy -O binary rom.elf rom.gba 
 
There's a warning: cannot find entry symbol _start but that's benign.
Help keep devkitPro toolchains free, Donate today

Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests