gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > DevKitAdv - multiboot and cart ROM?

#8984 - mtg101 - Fri Jul 25, 2003 3:48 pm

I've found on these forums that using DevKitAdv I can declare:

Code:

int __gba_multiboot;


To make my project compile as multiboot. However, I read in the devrs.com MB FAQ (http://www.devrs.com/gba/files/mbv2faqs.php) that it's possible to make a ROM that's both MB and a normal cart ROM. But I don't understand how to do it - I don't know ASM and don't know all the gcc command line options...

So - is there an easy way using DevKitAdv to get a MB/cart ROM? If not, can someone point me to an example of how to compile for both?


Thanks,
Russell
_________________
---
Speaker for the Dead

#8988 - tepples - Fri Jul 25, 2003 5:45 pm

Multiboot programs compiled and linked with DevKitAdv R4 and DevKitAdv R5 beta 3 are already this way. They will copy themselves from cart ROM to EWRAM if necessary. (This was broken in the first two betas of R5.) However, with R5 beta 3, you'll need to look for appended assets (GBFS, etc) in both EWRAM and ROM.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#8991 - mtg101 - Fri Jul 25, 2003 5:52 pm

I followed the gbajunkie guide to getting DevKitAdv working, so I'm using R4. However when I just add "int __gba_multiboot;" the ROM only works over multiboot. When I try to run from a cart (EZ-F) it just returns to the boot menu.

Is there something other than just adding "int __gba_multiboot;" that I have to do to get this working?


Cheers
Russell
_________________
---
Speaker for the Dead

#9012 - mtg101 - Sat Jul 26, 2003 3:32 pm

I've changed over to using Jeff's crt0.S v1.28 instead of the ones that came with DevKitAdv, but using the crtbegin.o and crtend.o from DevKitAdv. But I'm still getting the same problem - works via MB, but not when downloaded to my EZ-F cart (works fine from cart when I remove the int __bga_multiboot). I've also tested simpler tutorial projects and they have the same behaviour.

So, I think I've removed any dependancy on DevKitAdv by using Jeff's crt0.S stuff... so I can only assume I'm building things wrong. Here's my makefile... any obvious mistakes?

Code:

CFLAGS = -c
MODEL = -mthumb -mthumb-interwork
NAME = mydemo
LIST =  $(NAME).o tilebg.o bgtext.o intro.o


all: $(NAME).mb.gba

$(NAME).mb.gba: $(NAME).elf
   objcopy -O binary $(NAME).elf $(NAME).mb.gba
   c:/gba/dev/gbaromfixer/gbafix -t$(NAME) $(NAME).mb.gba

$(NAME).elf: $(LIST) crt0.o
   gcc $(MODEL) -nostartfiles -T lnkscript -o $(NAME).elf crt0.o obj/crtbegin.o obj/crtend.o $(LIST) -lm

$(LIST): %.o: %.cpp
   gcc $(MODEL) $(CFLAGS) $<

crt0.o: crt0.s
   gcc $(CFLAGS) $(MODEL) crt0.S

clean:
   rm -f *.o
   rm -f *.elf
   rm -f $(NAME).mb.gba



Cheers
Russell
_________________
---
Speaker for the Dead