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 > Design Documents for Mapping Memory

#177675 - chrisheseltine - Wed Nov 28, 2012 2:46 pm

Hello,
This is my first post as a new member so please forgive any ignorance.

I am a student studying at university in England and currently am required to create a basic GBA game with Input, Sound, Game Flow, Inline ARM and a couple of other bits.

Anyway my question is that all these memory addresses (particularly of sprites in OAM and characters in VRAM) are ofcourse difficult to impossible to remember.

Is there some sort of set template, a map of sorts, that can be used to keep track of where in memory each sprite is kept, where each character is, and therefore a structure that makes development easier, without having to remember where everything is.

I could knock up a rough map myself but I was wondering if there were any easy to use templates out there?

Thanks in advance,
Chris H
_________________
We're going HAM!

#177687 - Dwedit - Thu Nov 29, 2012 6:52 pm

Nobody needs to memorize the address of anything, that's what symbols are for. If you use Devkitarm, it comes with libgba, which includes header files that define all the registers and memory areas.

A common newbie mistake is to directly use the OAM as a place to hold the state of game objects. Don't do that, you should treat OAM as if it is only for outputting stuff. Have your game objects in memory, then write code that turns the game objects into OAM entries. A game object could be more than one sprite large, also sprite coordinates are always relative to the scroll position of the screen.

TONC is also a nice tutorial.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#177712 - chrisheseltine - Thu Dec 06, 2012 3:02 pm

Thanks!

What do you mean by symbols? Are they like define?

Thanks,
Chris H
_________________
We're going HAM!