Mega Man 3 boss select screen (IRQ?)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

Post Reply
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Mega Man 3 boss select screen (IRQ?)

Post by Zepper »

In Mega Man 3, (as you know) the boss select screen has a half-glitched scanline over Shadowman's box. I don't know why, but even my emulator gettting a "passed" through all MMC3 IRQ tests, such scanline isn't there! There's a bit of line flickering over Magnetman's box (at right) though. I already tried to hack the IRQ timing, but it doesn't seem to be the problem.

Any thoughts? Is that possibly related with my PPU gfx engine?
User avatar
Bregalad
Posts: 8056
Joined: Fri Nov 12, 2004 2:49 pm
Location: Divonne-les-bains, France

Re: Mega Man 3 boss select screen (IRQ?)

Post by Bregalad »

I don't know why
It's quite simple, the game writes to $2006.2 way too early so that the PPU is still rendering the scanline, which causes the PPU to instantly render the playfield from the new adress. They should have waited until HBlank to change the address if they wanted it to look good.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by tepples »

From Game bugs:
On the boss select screen, the scanline above Shadow Man looks wrong.
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by Quietust »

I think Zepper's problem here isn't that the game is glitchy, but that it's glitchy in the wrong way - it's possible you're not emulating the PPU's rendering pipeline correctly.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: Mega Man 3 boss select screen (IRQ?)

Post by tokumaru »

I would bet on something related to the scroll, the exact way in which the temporary end the actual VRAM address registers are affected, something like that.

The IRQ may be firing at the correct time (although it would be a good idea to verify this in this specific situation, instead of relying on test results alone), but if the PPU writes that follow aren't interpreted accurately, the end result will still differ.
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by Zepper »

tepples wrote:From Game bugs:
On the boss select screen, the scanline above Shadow Man looks wrong.
Zepper wrote:In Mega Man 3, (as you know) the boss select screen has a half-glitched scanline over Shadowman's box.
:beer:

It's only at the boss select screen. The rest of the game is okay. About $2006, I could fix Kick Master by delaying the PPU address reset (loopy_v = loopy_t) by 1 CPU cycle. Also, James had suggested to avoid PPU address > $2FFF. None of these things had effect on Mega Man 3.

I don't use the background rendering exactly as Nintendulator does, but a real-time pixel rendering. Yes, fetching tiles at every cycle. What kind of pipeline is missing that affects scrolling?
User avatar
Quietust
Posts: 1920
Joined: Sun Sep 19, 2004 10:59 pm
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by Quietust »

During a single 8-pixel chunk, the real PPU only reads the VRAM address twice (once for tile number, once for attribute) and increments it once, so attempts to manually update it via $2006 can cause some writes to happen before the increment and others to happen after it, resulting in noticeable shaking that you might not get with your "per pixel" method.
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by Zepper »

My PPU rendering engine is off by 16 pixels. As expected, tile/CHR fetching should NOT start at PPU cycle 0, but 16 dots before the ending of the previous scanline. It explains the annoyances until then, unless someone is able to give me an hand, but... dunno.
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

Re: Mega Man 3 boss select screen (IRQ?)

Post by kuja killer »

I know this is not related to emulators how they do things, but just wanted to say..

in Megaman 3 Improvement, i manually edited the coding of every individual IRQ where a scanline glitch would be (stage select, weapon pause menu, and nearly all boss fights where they appear)..
by just squeezing in a simple "ldx #$xx, dex, loop backwards to dex ..to force pushing the "scanline glitch" into the H-blank time thing ..to fix them all
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by Zepper »

kuja killer wrote:I know this is not related to emulators how they do things, but just wanted to say..

in Megaman 3 Improvement, i manually edited the coding of every individual IRQ where a scanline glitch would be (stage select, weapon pause menu, and nearly all boss fights where they appear)..
by just squeezing in a simple "ldx #$xx, dex, loop backwards to dex ..to force pushing the "scanline glitch" into the H-blank time thing ..to fix them all
I'd like to know more about it, really. I want to spot the problem of $2006 vs IRQ triggering.
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

Re: Mega Man 3 boss select screen (IRQ?)

Post by kuja killer »

okay, if you'd like to try it, do this:
use fceux/fceux hex editor to watch in "real-time"

3C2DD:
D057A208CAD0FDAD0220A57A29010A0A09228D0620A5794A4A4A291F09608D0620A57A290305FF8D0020A5798D0520A998D0910000

3C4E0:
CF

-------------
now, edit 3C2E0 to control where the "glitched line" is shown on the screen. this is the LDX value i was talking about earlier. you gotta just "fine tune" it until it's hidden off the screen in that so-called H-blank thing.
it's already set to 08 in the above example as that hides it.

if you start with 01, the line will appear above shadowman as it was, and the higher you go, the farther to the right the line will be hidden. and 08 hides it completely.

at 0D, the line will go across the entire screen, and eventually keep getting smaller as you go higher, until hidden on the next scanline
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

Re: Mega Man 3 boss select screen (IRQ?)

Post by kuja killer »

is everything okay now ??
wondered why no reply from ya yet.

If you need any fixes for any of the other mm 3's irq's i'll post them too.
User avatar
Zepper
Formerly Fx3
Posts: 3262
Joined: Fri Nov 12, 2004 4:59 pm
Location: Brazil
Contact:

Re: Mega Man 3 boss select screen (IRQ?)

Post by Zepper »

kuja killer wrote:is everything okay now ??
wondered why no reply from ya yet.

If you need any fixes for any of the other mm 3's irq's i'll post them too.
Nope. It's not a matter of fixing the software, but the hardware emulation. I'm not getting that glitched scanline, which IS supposed to happen.
kuja killer
Posts: 130
Joined: Mon May 25, 2009 2:20 pm

Re: Mega Man 3 boss select screen (IRQ?)

Post by kuja killer »

oh i see, so i guess i wasnt any help then ? bummer, darn. :( well okay then
Post Reply