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.

Coding > Help a confused coder

#46016 - CpuWhiz - Sat Jun 18, 2005 5:06 am

I am sure all my questions have been asked before, but I need some clarification. I want to make a little RPG (who hasn't?), so I am trying to figure out how to fit all the stuff together. I am going to use devkitARM and libgba. This is where my first two questions come in.

1) Is libgba just a set of header files like the ones from the pern project and similar tutorials? What all is in the library?
2) What is up with the crt object files? I think they have something to do with interrupt handling but what all are they for and why does the pern project want to go writing a IRQ handler?
3) So could sound be using some timers and DMA for two PCM sound effects made with TektronicWave? Why does this also use some custom crt? Darn the crt stuff.
4) BoyScout with the other sound channels for BGM. It looks like this is included in libgba? How would I use this?
5) I think I would use a interrupt for the vblank and during this time write some assembly to update the sprites and such. Is there anything else you should do during certain times?
6) The main game loop is for the game specific stuff, reading input and loading and starting areas and sounds and such?
7) Anywhere I can find a little more info on tiles and maps.

I understand C/C++ and some assembly, I get most of how this stuff works, I just need a little help putting it all together. If there is something I have wrong or may be missing, please tell me! Set me straight :D

Thanks for you time. Please don't flame me :)

#46019 - tepples - Sat Jun 18, 2005 6:10 am

CpuWhiz wrote:
2) What is up with the crt object files? I think they have something to do with interrupt handling but what all are they for and why does the pern project want to go writing a IRQ handler?

The 'crt0' file contains the startup code needed to 1. copy a multiboot program from ROM to RAM if necessary and 2. set up the execution environment expected by a C program. Older versions of Jeff Frohwein's GBA crt0 contained interrupt handling code; this has since been moved to a separate file.

Quote:
5) I think I would use a interrupt for the vblank and during this time write some assembly to update the sprites and such. Is there anything else you should do during certain times?
6) The main game loop is for the game specific stuff, reading input and loading and starting areas and sounds and such?

There are a few games that do almost everything in the vblank interrupt, including game logic. Examples include Super Mario Bros. for NES and Road Rash for Sega Genesis; I can imagine that some GBA games do almost everything in vblank too.

Quote:
7) Anywhere I can find a little more info on tiles and maps.

To get a feel for tiles and maps, use AGBTTY and then try to change the font it uses.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.