Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
I've been doing a bit of digging and I just cant seem to find what I'm looking for.
Pretty much I've set up a map using a tile collection of 8x8 tiles but I just cant work out how to properly use the map as a background.
Also, I've gone and set light grey to transparent so I can use white in some sprites, however when I put this in game the white I used in the sprites shows up as light grey, how do you set it to white outside of the tile editor?
Any help would be appreciated thanks.
UPDATE:
I've managed to get the background displaying (sort of) however it only shows up one sprite type instead of what its supposed to show.
Also, I still haven't worked out how to set white to non-transparent yet,
Last edited by jobalisk (2017-06-03 03:42:44)
Offline
To select another color than white as the transparent color, you have to set the sprite palette (OBP0 or OBP1) to the correct value.
Setting OBP0 to %11100001 will probably be correct in your case.
Offline
Thanks, any chance you could show me how to do that that in C?
Also, here's the code I'm using to load the background:
set_bkg_data(0,255, groundTiles);
VBK_REG = 1;
VBK_REG = 0;
set_bkg_tiles(0, 0, 20, 10, map01);
SHOW_BKG;
DISPLAY_ON;
Offline
Well, the code in C would be:
OBP0_REG = 0xE1; // $E1 = %11100001
The problem with the background is probably that you only load the upper 10 rows. Try this:
set_bkg_tiles(0, 0, 20, 18, map01); // 18 instead of only 10 lines.
Setting VBK_REG to 1 and immediately afterwards to 0 doesn't make much sense either but shouldn't be the cause for the problem.
Offline