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.

#1 2018-10-09 03:22:19

26F
Member
Registered: 2018-07-25
Posts: 13
Website

Draw background after using drawing.h functions

I'm having trouble drawing background after using text/drawing commands from drawing.h.

After drawing the score and some lines to the screen when I try to load the background for the win/lose screen it looks glitchy and weird. I know it's something to do with using the drawing functions in drawing.h in conjunction with the background?



    if (enemy_score != player_score) {
        wait_vbl_done();
        HIDE_BKG;
        set_bkg_data(0,212, &win_data);
        set_bkg_tiles(0,0,20,18,&win_map);
        HIDE_SPRITES;
        SHOW_BKG;
        waitpad(J_START);
        waitpadup();
    }
    else {
        wait_vbl_done();
        HIDE_BKG;
        set_bkg_data(0,180, &lose_data);
        set_bkg_tiles(0,0,20,18,&lose_map);
        HIDE_SPRITES;
        SHOW_BKG;
        waitpad(J_START);
        waitpadup();
    }

Offline

 

#2 2018-10-09 04:47:11

ISSOtm
Member
From: Somewhere in Echo RAM
Registered: 2017-04-18
Posts: 160
Website

Re: Draw background after using drawing.h functions

Yep. I'm prettu sure you can't mix drawing.h with anything else (and you should avoid drawing.h anyways), due to how Game Boy gfx work.


The French Lord Of Laziness.
Legend of Zelda and Undertale fan, I also tend to break Pokémon R/B/Y a little too much.

Twitter | Me on GCL | Discord : ISSOtm#9015 | Skype : isso.tm (I don't login anymore)

Offline

 

#3 2018-10-09 19:17:32

26F
Member
Registered: 2018-07-25
Posts: 13
Website

Re: Draw background after using drawing.h functions

ISSOtm wrote:

Yep. I'm prettu sure you can't mix drawing.h with anything else (and you should avoid drawing.h anyways), due to how Game Boy gfx work.

It's just for drawing lines and gprintf etc.

So there's really no way to fix it? All I want it to do is draw a background. Is there no way I can flush the memory of VRAM or do some kind of work around?

Offline

 

#4 2018-10-10 01:22:30

ISSOtm
Member
From: Somewhere in Echo RAM
Registered: 2017-04-18
Posts: 160
Website

Re: Draw background after using drawing.h functions

You can clear the tilemap, that should remove all the glitchiness.


The French Lord Of Laziness.
Legend of Zelda and Undertale fan, I also tend to break Pokémon R/B/Y a little too much.

Twitter | Me on GCL | Discord : ISSOtm#9015 | Skype : isso.tm (I don't login anymore)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson