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.
Pages: 1
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.
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
You're probably storing more than 16 kB of data in one of the banks.
Offline
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
Nope. Bank 1 was simply too large due to the SplashTileset having too many tiles. I fixed it already.
Offline
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 Best of luck with your game!
Offline
Pages: 1