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.

Graphics > CHAR_BASE(0) issue

#71161 - naleksiev - Fri Feb 10, 2006 7:12 pm

I have one strange issue with the first row using CHAR_BASE(0). If I use CHAR_BASE(1) then everyting is OK. Any ideas?

[Images not permitted - Click here to view it]

#71165 - DekuTree64 - Fri Feb 10, 2006 7:31 pm

Looks like you're also using screen base 0, which overlaps with char 0. I usualy start with char base 0, and screen base 31. Add more chars going upward, and screens going down, so I don't have to worry about it unless I start running out of VRAM altogether.

Either that or load your char data in past the first screen block (2KB), and offset your map entries to match.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#71166 - Cearn - Fri Feb 10, 2006 7:31 pm

Screenshots aren't as much help in solving programming problems as you may think, as the problem itself is usually underneath it. It's similar to asking a mechanic what's wrong with the engine by showing him a photgraph of your car. The binary or a code snippet would be more beneficial.

That said, I have a sneaking suspicion that you're using screenblock 0 and charblock 0. These use the same memory so that when you set one, you'll overwrite the other. If you separate tiles and screen entries so they won't have lap it should work again. tonc:cbb/sbb overlap table.

#71170 - naleksiev - Fri Feb 10, 2006 8:27 pm

Thanks guys, this will help. I realy use CHAR_BASE_ADR(0) and MAP_BASE_ADR(0).

#71174 - tepples - Fri Feb 10, 2006 8:39 pm

It's OK to use map 0 and chr 0 as long as you don't use tiles 0-64 (16-color) or 0-32 (256-color). If you don't scroll the screen, then you need only avoid tiles 0-40 (16-color) or tiles 0-20 (256-color).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#71193 - naleksiev - Fri Feb 10, 2006 10:30 pm

Thanks. For this project I don't think that I will need so much tiles. But really for the next project that I'm thinking about I will use everythink :)