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 > How many BG in mode4

#10462 - funkeejeffou - Fri Sep 05, 2003 8:08 pm

GBA documentation says that only bg2 is active in mode4, but I've read somewhere that you can use another one.
I just want to make a console like that will always be over the BG2, as the console will only be 240*40 pixels. Can I do that?

#10468 - sajiimori - Fri Sep 05, 2003 11:00 pm

Modes 3-5 are linear framebuffers, so there's no background layering happening.

Off the top of my head, the 2 ways of doing what you want are:

- Build the console out of a bunch of sprites, or a couple of big ones that you draw into when you want to make changes.

- Use direct framebuffer access to draw the console, or at least the parts of it that need to be redrawn, at the end of every frame.

The first method is faster, especially when the area under the console changes a lot (such as when the console is transparent), but it takes up sprite RAM and OAM entries.

#10489 - funkeejeffou - Sat Sep 06, 2003 2:23 pm

Thanks sajimori,

I don't know anything about sprites, could you just tell me what must I do to make this works or point me to a doc. Will there be enough sprites for 240*40 pixels?

#10495 - tepples - Sat Sep 06, 2003 3:43 pm

You have 16 KB of sprite cel VRAM to work with in bitmap mode. Provided you are not doing anything else with sprite cel VRAM, and you're doing your console in 16 colors, you have enough room for a full-screen-width, 128-pixel-tall console.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#10496 - sajiimori - Sat Sep 06, 2003 4:57 pm

The usual docs are GBATEK, CowBite, and the PERN Tutorials.

#10498 - Omega81 - Sat Sep 06, 2003 5:18 pm

Hate to be a total DUMBA*S but what are you talking about? what do you mean when you say console?
_________________
Keep it real, keep it Free, Keep it GNU

#10502 - funkeejeffou - Sat Sep 06, 2003 5:42 pm

A quake console like, where you display the player status bar (life, ammo...). You're not a dumbass, I wasn't very clear.
The problem with VRAM is that I've put code at the end of frame buffer 1. I'm gonna have to change all this...