#10268 - poslundc - Mon Sep 01, 2003 5:18 am
Hello there!
While an old hat at C, I'm quite new to the GBA programming scene, and am having a good time thus far slogging my way through the process. (Yay, all the old coding tricks I knew ten years ago are suddenly applicable again!)
Anyway, I've read vague references in these forums to displaying actual bitmaps in the backgrounds used in modes 0-2. Can this only be done by cramming the entire image into the background tile data and then having each tile of your background map point to the corresponding section of your image? Or is there a way to access the screen directly when in these modes, like the way you can in modes 3-5?
My reason for asking is that I would like to superimpose over the various backgrounds and sprites various effects generated from mathematical equations, lines, elipses, etc. and would be easiest to do if I could access the screen's data.
Thanks in advance,
Dan.
#10269 - tepples - Mon Sep 01, 2003 6:12 am
poslundc wrote: |
I've read vague references in these forums to displaying actual bitmaps in the backgrounds used in modes 0-2. Can this only be done by cramming the entire image into the background tile data and then having each tile of your background map point to the corresponding section of your image? |
That's one way, the way that Qix (NES), Qix (Game Boy), Videomation (NES), Game Boy Camera (Game Boy), and many Super FX games (Super NES) work. It's just as applicable on GBA; the "free cylindrical tunnel" scene in the demo fr018 by Farbrausch uses this.
Quote: |
Or is there a way to access the screen directly when in these modes, like the way you can in modes 3-5? |
That works too, actually. It's possible to set up a specially formatted rot/scale map that acts much like a scaled mode 4 bitmap background. This requires putting your head on diagonally and thinking about the rot/scale display hardware in a whole new way.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#10278 - poslundc - Mon Sep 01, 2003 2:13 pm
tepples wrote: |
That works too, actually. It's possible to set up a specially formatted rot/scale map that acts much like a scaled mode 4 bitmap background. This requires putting your head on diagonally and thinking about the rot/scale display hardware in a whole new way. |
Hm, is there a FAQ on this, or can you give me a pointer as to how it might be done?
Thanks,
Dan.
#22510 - Marill - Wed Jun 23, 2004 6:38 am
Is there an FAQ on this or anyone has any pointers?
- Solid image background on layer 3 for Mode 0 instead of a tile/map background?
#22512 - sgeos - Wed Jun 23, 2004 8:01 am
Never tried it, but here is my best guess: Take a big rot/scale BG, format the tiles 0, 1, 2, 3, 4... scale it so the whole thing is shown on the screen and then just change the character entries. I'm guessing that you put solid color tiles in VRAM.
Can this be improved?
-Brendan
#22513 - tepples - Wed Jun 23, 2004 8:45 am
To get a 160x120 pixel linear bitmap in mode 1 or 2, think diagonally.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#22515 - sgeos - Wed Jun 23, 2004 8:57 am
Code: |
/\
/ \ <--BG
/+------+\
/ |SCREEN| \
\ | | /
\+------+/
\ /
\/ |
Sort of like this, only with wrapping enabled?
-Brendan
#22516 - Marill - Wed Jun 23, 2004 8:59 am
thanks guys.
I've just tried out the easy method in mode 0 and it works.
convert the solid image into X unique tiles and then tile 'em up just like any normal tile background.
If it is 256 colors, you'll have to make sure all backgrounds 0-3 use the same palette.
#22517 - sgeos - Wed Jun 23, 2004 9:08 am
Marill wrote: |
If it is 256 colors, you'll have to make sure all backgrounds 0-3 use the same palette. |
Thats the simple way of doing things. If you only use 128 colors, then you have 8 palettes left for 16 color BGs.
Is this the correct Diagonal Way? Code: |
/|\
/ | \
/ | \
/ A | B \
+---------------+
|\ SCREEN /|
| \ / |
| \ / |
| B \ / A |
+---------------+ |
It looks like an envelope!
-Brendan
#22525 - tepples - Wed Jun 23, 2004 5:29 pm
That's not exactly the diagonal I had in mind. Try pa = 256*1/2, pb = 0, pc = 256*1/16, pd = 256*4 (I think, haven't tried it recently), with a size-2 mosaic vertically. Then line up a map like this:
00000000
2222222211111111
4444444433333333
6666666655555555
etc.
Then the beam will cross each tile eight times, scanning successive rows in the tile, until it hits the next set of eight tiles down and to the right.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#22555 - poslundc - Thu Jun 24, 2004 2:57 am
Holy cow, I don't know how this thread got dredged up, but this looks like it was my first post to the forum or something. Wow.
Figures that it's taken the better part of a year for someone to answer my question. >:(
Dan.
#22557 - tepples - Thu Jun 24, 2004 3:04 am
I had figured that a demo would best illustrate the concept, and I was just preoccupied with Other Things(tm) to get a demo working.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#22560 - Marill - Thu Jun 24, 2004 5:40 am
poslundc wrote: |
Holy cow, I don't know how this thread got dredged up, but this looks like it was my first post to the forum or something. Wow.
Dan. |
Sorry Dan for dragging up old posts :)
I was searching the forum for a topic like this because I am trying implement this. I'm searching first b4 asking a newbie-ish question. :)
And gald this forum is really a lot of help!
#22570 - poslundc - Thu Jun 24, 2004 1:51 pm
There's nothing to apologize for; it was just an unexpected surprise. Almost as much as someone new to the forums searching them before asking something.
Dan.
#22605 - dagamer34 - Fri Jun 25, 2004 4:13 am
poslundc wrote: |
There's nothing to apologize for; it was just an unexpected surprise. Almost as much as someone new to the forums searching them before asking something.
Dan. |
:D
_________________
Little kids and Playstation 2's don't mix. :(