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: 85
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?


Ten Pest: The Game Boy game I'm working on: http://www.atari2600land.com/gameboy/tenpest.html
Oranges: The other one http://www.atari2600land.com/gameboy/oranges.html

Offline

 

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

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

Re: Putting text on screen and colors

Never mind, I figured it out.


Ten Pest: The Game Boy game I'm working on: http://www.atari2600land.com/gameboy/tenpest.html
Oranges: The other one http://www.atari2600land.com/gameboy/oranges.html

Offline

 

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

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

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: 85
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.


Ten Pest: The Game Boy game I'm working on: http://www.atari2600land.com/gameboy/tenpest.html
Oranges: The other one http://www.atari2600land.com/gameboy/oranges.html

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson