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.

#1 2020-08-07 09:41:28

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

"gotoxy" implicit declaration

So I've been experimenting with programs larger than 32k. I got a 64k program. I even put a font in bank 3 and have it be read in bank 0. But why is "gotoxy" not allowed in a 64k game when it *is* allowed in a 32k game? Is there another way to place text on the screen where you want it? I'm using C.


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

Offline

 

#2 2020-08-08 05:18:16

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: "gotoxy" implicit declaration

seems that you are switching bank3 into the place where your gotoxy() is landed. so, you either have a code that you want to call, or data that is used with that call, not both at once as required. i suggest you not to use stdio at all, it is too large. also monitor the layout of objects inside your rom, like on picture below. we see 64k rom and usage of 4 banks here. code from bank0 never overrun into bank1 - the problem that you describe.
https://c.radikal.ru/c14/2008/eb/c0cb0212483a.png

Offline

 

#3 2020-08-08 07:20:07

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: "gotoxy" implicit declaration

you see 64K of the rom image here. the first block is bank0, it is mapped to the area 0..0x4000. the second block is bank1, it is mapped from 0x4000. banks 2 and 3 below are not mapped into address space at all. they may be switched from the address 0x4000 instead.

so, if your code in bank0 overgrows the boundary of 0x4000, that part, that appear in bank1 is switched away when you switch on bank3 or any other. that is dangerous, because you can not say, what code becomes broken. in your case it is gotoxy(), but that might be any.

that picture is made using the utility written by PinoBatch and may be found here: https://github.com/pinobatch/240p-test- … omusage.py

Offline

 

#4 2020-08-08 15:23:50

toxa
Member
Registered: 2020-02-13
Posts: 305

Re: "gotoxy" implicit declaration

your rom might look similar with this one:

https://b.radikal.ru/b20/2008/ea/7d48030b87ce.png

you can see here, that code in bank0 overgrow the 0x4000 boundary, and switching bank 2 or 3 make it unreachable. you should do that carefully and always restore bank1.

Last edited by toxa (2020-08-08 15:26:11)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2005 Rickard Andersson