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 2022-08-19 16:33:48

BuffaloBingo
New member
Registered: 2022-08-19
Posts: 1

I can't change my background to another one.

How to do you unload a background and then reload a new one.

Last edited by BuffaloBingo (2022-08-20 00:11:50)

Offline

 

#2 2022-09-04 12:13:46

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

Re: I can't change my background to another one.

You don't "unload" a background, you just change it.
You need two things for a background: tile data and map data. The tile data are the individual tiles for the background, and the map data is where they go in the background. Once you've figured out that, (in C) you do this:

Code:

    set_bkg_tiles(0, 0, 20, 20, your_map_data);
    set_bkg_data(0x00, 0x1a, your_tile_data);

With 1A being the amount of tiles in the tile data (in hexadecimal).


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

Offline

 

#3 2022-09-04 14:02:39

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

Re: I can't change my background to another one.

Here is a helpful link to turn an image into a Game Boy background.
http://chrisantonellis.github.io/gbtdg/


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

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson