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 2017-12-16 15:00:03

chris
Member
From: USA
Registered: 2016-11-27
Posts: 142
Website

Putting text on screen and colors

I want the background to be black. But whenever I put text on the screen, no matter what way, the background turns to white. How do I stop it from doing this?


My avatar is from Nintendo Power. I miss those days, so I decided to bring them back.

Offline

 

#2 2017-12-16 15:53:00

chris
Member
From: USA
Registered: 2016-11-27
Posts: 142
Website

Re: Putting text on screen and colors

Never mind, I figured it out.


My avatar is from Nintendo Power. I miss those days, so I decided to bring them back.

Offline

 

#3 2017-12-16 17:17:19

Hell_666
Member
Registered: 2017-12-13
Posts: 18

Re: Putting text on screen and colors

If your issue can happen to a lot of people I think you should post how you resolved it, it could help someone with the problem and searching for a solution wink

Last edited by Hell_666 (2017-12-16 17:17:27)

Offline

 

#4 2017-12-17 09:33:32

chris
Member
From: USA
Registered: 2016-11-27
Posts: 142
Website

Re: Putting text on screen and colors

from my new game I'm working on:

Code:

void get_font()
{
  set_bkg_data(0x30, 0x0A, number_tile_data);  
  set_bkg_data(0x40, 0x0A, alphabet_tile_data);  
  set_bkg_data(0x4A, 0x09, alphabet_tile_data2); 
  set_bkg_data(0x53, 0x09, alphabet_tile_data3); 
    }

void main()
    {
      unsigned char randomthing = *(ptr_div_reg);    

    BGP_REG = 0x27U;

    printf(" ");
    get_font();    

           gotoxy(8,15);
        printf("2018"); // should show up as white text on black background

I made outer space white and changed the white to black with the BGP_REG command. Earlier it still was displaying black text on white even though I was using the BGP_REG command. So I added a blank printf command before I got the font loaded and that seemed to please it.


My avatar is from Nintendo Power. I miss those days, so I decided to bring them back.

Offline

 

#5 2018-07-30 01:33:44

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

Re: Putting text on screen and colors

What does BGP_REG = 0x27U; actually do?

Offline

 

#6 2018-07-30 06:40:06

gbjosh
Member
From: KY
Registered: 2016-06-15
Posts: 51

Re: Putting text on screen and colors

26F wrote:

What does BGP_REG = 0x27U; actually do?

BGP_REG is BG palette data.

Offline

 

#7 2018-07-30 22:42:07

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

Re: Putting text on screen and colors

Reasons not to use GBDK...

Also, `printf` should never be used on GB.


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