Issue with windows

Discussion of programming and development for the original Game Boy and Game Boy Color.
Post Reply
Pennywise
Posts: 71
Joined: Tue Jul 14, 2009 11:04 am

Issue with windows

Post by Pennywise »

Image

I'm having an issue with part of a window appearing on screen when it shouldn't be and I'm somewhat confused as to why it is happening. I'm thinking this is controlled by an I/O register, but I don't really know a whole lot how screens get pieced together other than their positioning on screen with Window X and Y, which I'm pretty sure isn't related to this issue.

Just for an extra bit of context, this is what the screen looks like in VRAM.

Image

What am I missing here? Thanks.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Issue with windows

Post by MottZilla »

Are you making an emulator or is this a game you are making?
Pennywise
Posts: 71
Joined: Tue Jul 14, 2009 11:04 am

Re: Issue with windows

Post by Pennywise »

I'm hacking a game.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Issue with windows

Post by MottZilla »

Looking at the screenshot, the window layer may be reenabled too soon. There probably is a scanline interrupt being used to disable the Window Layer for a number of lines, but it looks like it's being reenabled too soon. I guess this is a translation hack right?
Pennywise
Posts: 71
Joined: Tue Jul 14, 2009 11:04 am

Re: Issue with windows

Post by Pennywise »

Yeah, translating.

I'm still not entirely clear on what I'm looking for. Since the God window is variable in height depending on the number of gods available and the issue doesn't happen with one god, it'll probably be easier to focus on that part. What is the process of getting from VRAM to the screen on the GB? Are VRAM transfers handled with DMA?
tepples
Posts: 22705
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Issue with windows

Post by tepples »

DMA to VRAM (aka "Blast Processing") works on Game Boy Color, not original Game Boy. Original Game Boy has to copy data the hard way, by using instructions to load data from ROM and write it to VRAM.

The principle of rendering on the Game Boy is essentially the same as that on the NES, modulo some timing differences (NES's pixel output is fixed rate while GB's is variable). While rendering is turned on, the system will use the nametables and pattern tables in VRAM to determine what pixels to output.
nitro2k01
Posts: 252
Joined: Sat Aug 28, 2010 9:01 am

Re: Issue with windows

Post by nitro2k01 »

Could you tell us which game this is, or maybe even give us your current work progress on the ROM?

Are you sure the game is even using the window for this? It could actually be changing the tile map source and SCX/SCY values midscreen on the right scanline, for example using the LCD interrupt.
Pennywise
Posts: 71
Joined: Tue Jul 14, 2009 11:04 am

Re: Issue with windows

Post by Pennywise »

I found the problem which was apparently caused by my accidental changing of 1 byte that was used for the FF45 register, LYC.
User avatar
MottZilla
Posts: 2837
Joined: Wed Dec 06, 2006 8:18 pm

Re: Issue with windows

Post by MottZilla »

You changed when the scanline interrupt was firing then. It does explain how it ended up looking then.
Post Reply