Gameboy Development Forum

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.

Ads

#1 2018-03-07 15:47:53

MechaSushi
New member
Registered: 2018-03-07
Posts: 3

Prpblems With Backgrounds

I've been recreating snake for the gameboy with the gbdk, and I am having trouble with the background loading correctly.

The tiles that have been loaded into vram look like corrupted versions of the ones I made.

Here are the Tiles in vram, what the original tiles look like, and the map I made for it: https://imgur.com/gallery/yzAaC


Here is the first bit of my code here:

Code:

#include <stdio.h>
#include <gb\gb.h>
#include <gb\drawing.h>
#include "Sprites\ShockedFace.c"
#include "Sprites\BlinkFace.c"
#include "Sprites\SnakeTiles.c"
#include "Maps\SnakeMap.c"

void main(){
    //Setup Variables
    int x = 75; // Our beginning x coord
    int y = 75; // Our beginning y coord
    
    //Setup Sprites
    SPRITES_8x16;
    set_sprite_data(0, 8, SF);
    set_sprite_tile(0, 0);
    set_sprite_tile(1, 2);
    move_sprite(1, 75 + 8, 75);
    move_sprite(0, 75, 75);
    SHOW_SPRITES;
    
    //Draw Border
    set_bkg_data(0, 53, STiles);
    set_bkg_tiles(0, 0, 20, 18, SnakeMap);
    SHOW_BKG;
    DISPLAY_ON

Any help would be appreciated! big_smile

Offline

 

#2 2018-03-07 16:20:55

ssjason123
Member
Registered: 2017-03-21
Posts: 45

Re: Prpblems With Backgrounds

Try looking through this thread:
http://gbdev.gg8.se/forums/viewtopic.php?id=525

They had similar issues with tile data initially. I believe it was a result of some incorrect export options from the tile/map editor tools.

Offline

 

#3 2018-03-07 20:18:19

MechaSushi
New member
Registered: 2018-03-07
Posts: 3

Re: Prpblems With Backgrounds

Sorry, but I got the same results as before. I may have just didn't change the right thing, or I don't know what i'm doing well enough.

When I was looking at the c file for the tiles and it looks like it's doesnt match, but that may just be me talking: https://imgur.com/a/m7eZ6

Offline

 

#4 2018-03-07 20:22:40

MechaSushi
New member
Registered: 2018-03-07
Posts: 3

Re: Prpblems With Backgrounds

Nvm, I just used common sense and changed it from 0 to 0, to, 0 to 53....

Thanks for the help though!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson