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.
So I'm attempting to make a background in C using GBDK, but the set_bkg_tiles function seems to break it. "castle" refers to a the data of 5 16x16 tiles made in GBTD, while "levelOne" refers to a map made in GBMB using the tiles in "castle." I have the c files for castle and levelOne included at the top of my main .c file. If I comment out the set_bkg_tiles, BGB shows a few extra tiles palletted but all of the tiles from castle are included. However, set_bkg_tiles seems to make the sprite "picking" go haywire, as BGB shows a bunch of random spots in VRAM as palletted. Has anyone encountered this before? Does anyone know what I'm doing wrong? The code snippet from my main function is as follows:
wait_vbl_done();
DISPLAY_OFF;
set_bkg_data(0x00,0x13, castle);
set_bkg_tiles(0x00, 0x00, 0x12, 0x12, levelOne);
SHOW_BKG;
DISPLAY_ON;
Offline
If you have to explicitly set GBC mode, I am not in GBC mode. Here's a screenshot of VRAM and what I'm getting:
Offline
Sorry! It should look like this:
Also if you look in the VRAM in my first image, the paletted sprites are all over the place, when they should just be the 19 sprites I loaded. There should be a white space at the bottom (where I would put the window for the score display)
Last edited by Zubie (2017-02-24 00:24:55)
Offline
Well, first of all, you are using 16x16 tiles, which doesn't exist for backgrounds. You can do it but it needs extra code, and I'm sure you don't have that code, so you 'll have to split them to 8x8 blocks.
Offline
I could not find that distinction in any of the resources I found, but that fixed the tiling part. However, the loading into VRAM is still very much broken so that's a different issue.
EDIT: Fixed it thanks!
Last edited by Zubie (2017-02-25 20:34:17)
Offline
If the map is really exported using 8x8 tiles it should be working now, the code looks fine to me. Maybe the export parameters of GBMB are wrong.
Last edited by AntonioND (2017-02-26 07:26:55)
Offline