#16582 - Miked0801 - Thu Feb 19, 2004 11:14 pm
Haven't tried this, but in theory it may be possible.
Set any layer to use page 3 such that at char 512 in theory it should be reading from sprite RAM.
The non-char modes already steal from OBJ RAM so I know the hardware can do it. I am just wondering if the hardware wraps the address or return garbage if you try. It'd be real nice in certain cases to be able to access 1/2 of sprite RAM for the backdrop (like on the GBC though there it was possible to access all of OBJ VRAM for BGs if you did it right.)
#16583 - poslundc - Thu Feb 19, 2004 11:32 pm
Interesting idea. You'd think it would work, since the calculation of the memory location (based on the tile number and cbb) is done internally and therefore probably doesn't have bounds checking applied to it, and you've already pointed out that there is no issue regarding physical separation of the memory areas. Of course, we won't know until someone tries it on hardware.
But I find 64K of background VRAM tends to eclipse the 32K of sprite VRAM on most applications anyway, so I don't know what I'd ever do with that extra 16K of tile data that would be worth sacrificing half of my object data. :)
Dan.
#16586 - Miked0801 - Fri Feb 20, 2004 12:19 am
Not half of sprite RAM, just a char or two in a situation where we're out of BG RAM and need just that extra char or two for a last minute request :)
I'm again cruching on work related stuff here and haven't had a chance to pursue this. I was just wondering if anyone else had attempted it yet.
#16601 - Cearn - Fri Feb 20, 2004 2:15 pm
Miked0801 wrote: |
I was just wondering if anyone else had attempted it yet. |
Yes someone has. You can think of VRAM as 6 character-blocks. Only the allowed starting places differ for sprites and BGs (0-3 for tiles, 4 for sprites).
You have 1024 tiles to use for text backgrounds. For 16 color tiles that means you can access 2 successive blocks, but for 256 color tiles you have access to 4 of them!
You still have to watch out with palettes, though. Backgrounds will always use the bg-palette.
#16608 - Miked0801 - Fri Feb 20, 2004 7:55 pm
So I can only access the Sprite page in 8-bit mode? That seems a bit counter-intuitive. In 4-bit mode, I can still reach 512 4-bit chars into sprite RAM (in address space at least.) Yes with 8-bit, I'd get the whole thing in theory. But... has anyone actually tried it on hardware or emu?
#16711 - Cearn - Mon Feb 23, 2004 1:21 pm
Miked0801 wrote: |
So I can only access the Sprite page in 8-bit mode? That seems a bit counter-intuitive. |
It'll work for both 4bit and 8bit tiles. A char block is 0x4000 bytes. 4bit and 8bit tiles are 0x20 and 0x40 bytes in size respectively, so that gives either 512 or 256 tiles / charblock. Text-backgrounds have 10bits of tile-index space so you have access 1024 tiles. Meaning the those of the char-block you start with (0-3), and the one after that if you use 4bit tiles, or the next 3 if you use 8bit tiles.
For example, if you set the char-block to 3 you can access blocks 3 and 4 (==the lower sprite block) for 4bit tiles, or (3-7) (both sprite blocks and whatever comes after that) for 8bit tiles.
The funny thing about bg tile-counting is that you really count the tiles regardless of bitdepth, so a if you use tile-index 1 for 4bit tiles you use the tile that starts at base+0x20, but for 8bit tiles the tile at base+0x40. This is where tile-counting differs for sprites and bgs; for sprites tile-index 1 is always base+0x20, regardless of bitdepth.
Miked0801 wrote: |
But... has anyone actually tried it on hardware or emu? |
I can only check on emu, unfortunately. If anyone want to try it on real hardware I could give you the GCC code I used to test this.
#16724 - Miked0801 - Mon Feb 23, 2004 7:42 pm
Quote: |
This is where tile-counting differs for sprites and bgs; for sprites tile-index 1 is always base+0x20, regardless of bitdepth.
|
Which eplains why it looked weird in the No$ OAM/Tile viewer the one time I tried this. Cool, it sounds like it should work fine then. It's always nice to have some extra chars just in case :)
#20818 - Cearn - Tue May 18, 2004 9:00 am
Crap.
It seems that you can't use the sprite tile-blocks for backgrounds after all. I was limited to emu testing at the time and on VBA or Mappy it'll work, but not on real hardware, unfortunately. Check cbb_demo.gba (should work over multiboot) of my Tonc demos if you want to see for yourself
Sorry about this, hope this hasn't cause anyone any trouble. If you will excuse me, I'll be writing down 100 lines of "Thou shalt test on real hardware" now.
Last edited by Cearn on Fri Jan 06, 2006 7:24 pm; edited 1 time in total
#20851 - Miked0801 - Tue May 18, 2004 6:40 pm
Actually, in a mode7 game, I believe I seen this working - though I won't swear to it as the problem we were trying to solve was taken care of differently. Thanks for the update though (I seen it working in No$Gba as well so maybe it can work :) )
#20913 - sgeos - Wed May 19, 2004 7:46 pm
If it can be made to work under certain conditions, please post here. I'd like to hear about it.
-Brendan