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 2016-06-01 12:57:16

Tag365
Member
Registered: 2016-06-01
Posts: 41

"ERROR: address overflow" Thrown and Blank .gb File is Generated

When the make.bat file attempts to link my object files (the combined size of all objects files is larger than 0x8000 bytes) and create a Game Boy image file using GBDK's linker, "ERROR: address overflow (addr 8853 >= 8000)" is output to the console and the resulting image is completely blank. This prevents me from testing my game, and thus I want to know how to fix it.

The source of the make.bat file is below.

Code:

echo Compiling ROM bank 0...
..\..\..\bin\lcc -Wa-l -c -o matt.o matt.c

echo Compiling ROM bank 1...
..\..\..\bin\lcc -Wa-l -Wf-bo1 -c -o Banks/bank1p1.o Tilesets/SplashTileset.c
..\..\..\bin\lcc -Wa-l -Wf-bo1 -c -o Banks/bank1p2.o Tilesets/TextTileset.c
..\..\..\bin\lcc -Wa-l -Wf-bo1 -c -o Banks/bank1p3.o Tilesets/BlockTileset1.c

echo Compiling ROM bank 2...
..\..\..\bin\lcc -Wa-l -Wf-bo2 -c -o Banks/bank2p1.o Maps/SplashMap.c
..\..\..\bin\lcc -Wa-l -Wf-bo2 -c -o Banks/bank2p2.o Maps/MainMenuMap.c
..\..\..\bin\lcc -Wa-l -Wf-bo2 -c -o Banks/bank2p3.o Maps/MainMenuMap_c.c
..\..\..\bin\lcc -Wa-l -Wf-bo2 -c -o Banks/bank2p4.o Maps/World1Level1Map.c

echo Compiling ROM bank 3...
..\..\..\bin\lcc -Wa-l -Wf-bo3 -c -o Banks/bank3p1.o stringwrite.c

echo Linking object files...
..\..\..\bin\lcc -Wl-yp0x143=0x80 -Wl-yt3 -Wl-yo4 -Wl-ya0 -o matt.gb matt.o Banks/bank1p1.o Banks/bank1p2.o Banks/bank1p3.o Banks/bank2p1.o Banks/bank2p2.o Banks/bank2p3.o Banks/bank2p4.o Banks/bank3p1.o
pause

Here is a compressed file containing the source files of my game.
https://drive.google.com/file/d/0B5zCpy … sp=sharing
You probably need to put the folder in <location of gbdk folder>\gbdev\gb for the make.bat file to work correctly.

How do I fix the address overflow? I also want to know if is there any way to attach a file to this post, so I can show you the affected file.

Offline

 

#2 2016-06-01 13:11:26

nitro2k01
Administrator
Registered: 2008-02-22
Posts: 186

Re: "ERROR: address overflow" Thrown and Blank .gb File is Generated

You're probably storing more than 16 kB of data in one of the banks.


Blog: Gameboy Genius
"A journey of a thousand miles begins with one small step"
Old Chinese Proverb

Offline

 

#3 2016-06-01 13:39:33

Tag365
Member
Registered: 2016-06-01
Posts: 41

Re: "ERROR: address overflow" Thrown and Blank .gb File is Generated

nitro2k01 wrote:

You're probably storing more than 16 kB of data in one of the banks.

That could be the cause if it is trying to insert data from other banks into bank 0 (which is supposed to only contain code and not tileset data or maps). I must have a bug somewhere causing data from other banks to be put into bank 0. When I taken out any object file from being linked the address size changes.

Offline

 

#4 2016-06-01 14:02:03

Tag365
Member
Registered: 2016-06-01
Posts: 41

Re: "ERROR: address overflow" Thrown and Blank .gb File is Generated

Nope. Bank 1 was simply too large due to the SplashTileset having too many tiles. I fixed it already.

Offline

 

#5 2016-06-01 18:34:18

rychan
Member
From: Paignton, Devon, UK
Registered: 2015-12-16
Posts: 103
Website

Re: "ERROR: address overflow" Thrown and Blank .gb File is Generated

If you're using The bgb emulator you can get a good handle on how many bytes are left on either bank during runtime. 0x3FFF and 0x7FFF are the limits for the seperate banks for reference smile Best of luck with your game!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson