Page 1 of 2

Aladdin (Super Game) mapper 4 bug? [SOLVED]

Posted: Tue Jan 31, 2017 5:30 pm
by Zepper
In my emulator, the title screen has a green-ish color instead of black, and the game hangs after pressing START because of a RAM clearing routine, but always calling the JMP address from RAM $07F4.

Code: Select all

6C, F9F7 JMP ($07F4)
48, CA01 PHA 
A9, CA02 LDA #$00
8D, CA04 STA $E002
8D, CA07 STA $E003
68, CA0A PLA 
40, CA0B RTI 
D0, E962 BNE $E94D [A:0 X:F4 Y:10 S:F9 P:A0]
95, E94D STA $00, X [X=F4, Addr+X=F4]
9D, E94F STA $0200, X [X=F4, Addr+X=2F4]
9D, E952 STA $0300, X [X=F4, Addr+X=3F4]
9D, E955 STA $0400, X [X=F4, Addr+X=4F4]
9D, E958 STA $0500, X [X=F4, Addr+X=5F4]
9D, E95B STA $0600, X [X=F4, Addr+X=6F4]
9D, E95E STA $0700, X [X=F4, Addr+X=7F4]
E8, E961 INX 
D0, E962 BNE $E94D [A:0 X:F5 Y:10 S:F9 P:A0]
95, E94D STA $00, X [X=F5, Addr+X=F5]
9D, E94F STA $0200, X [X=F5, Addr+X=2F5]
9D, E952 STA $0300, X [X=F5, Addr+X=3F5]
9D, E955 STA $0400, X [X=F5, Addr+X=4F5]
9D, E958 STA $0500, X [X=F5, Addr+X=5F5]
9D, E95B STA $0600, X [X=F5, Addr+X=6F5]
9D, E95E STA $0700, X [X=F5, Addr+X=7F5]
E8, E961 INX 
6C, F9F7 JMP ($07F4)
00, 0000 BRK 
Any clues? A CPU bug?
(after 2 milions and half lines of debugging code)

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 6:37 pm
by James
It was hanging in my emulator as well, but I was able to get it to work by forcing the "old" IRQ behavior.

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 7:13 pm
by Zepper
James wrote:It was hanging in my emulator as well, but I was able to get it to work by forcing the "old" IRQ behavior.
It worked! Such option is already available in my emulator though.
One more question - what about the green-ish title screen?

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 7:34 pm
by zeroone
The game works fine in Nintendulator. Nintendulator does not require old IRQ behavior to be explicitly set and it does not appear to detect the ROM in a cart DB. Maybe the issue is a bit more complicated.

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 8:05 pm
by James
Took a quick glance at Nintendulator's source code, and it appears to be using the old IRQ behavior.

Zepper -- the green title screen is emphasis bits related. If I disable emphasis bit support, I get the same result.

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 8:45 pm
by tepples
If a game is made for PAL famiclones, such as Dendy, it'll have the sense of green and red emphasis bits inverted. What does it look like with emphasis off, and what is $2001 set to?

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 9:42 pm
by zeroone
James wrote:Took a quick glance at Nintendulator's source code, and it appears to be using the old IRQ behavior.
That's interesting. I have it the opposite in my emulator (i.e. use the new IRQ behavior except in MMC3 variants that require it). I never noticed any issues until this game. Are there others I should know about?

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Tue Jan 31, 2017 10:40 pm
by lidnariq
If Nintendulator is using the old behavior, then Star Trek - 25th Anniversary is supposed to not work correctly...

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 7:52 am
by zeroone
lidnariq wrote:If Nintendulator is using the old behavior, then Star Trek - 25th Anniversary is supposed to not work correctly...
I noticed that the Nestopia cart DB does mark some mapper 4 games as MMC3A:

Code: Select all

<chip type="MMC3A" />
In my GoodNES audit, I treated mapper 1 games marked with MMC1A as mapper 155 games. Why isn't there a separate mapper for MMC3A games?

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 9:40 am
by Zepper
tepples wrote:If a game is made for PAL famiclones, such as Dendy, it'll have the sense of green and red emphasis bits inverted. What does it look like with emphasis off, and what is $2001 set to?
I tested it here. The green-ish background is still there. The emphasis bits are NOT inverted in this game, since the "Aladdin" word becomes green-emphasized if I swap the bits.

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 10:21 am
by thefox
lidnariq wrote:If Nintendulator is using the old behavior, then Star Trek - 25th Anniversary is supposed to not work correctly...
Yet it does.

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 10:38 am
by zeroone
thefox wrote:
lidnariq wrote:If Nintendulator is using the old behavior, then Star Trek - 25th Anniversary is supposed to not work correctly...
Yet it does.
What part of the game supposedly fails to work?

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 12:45 pm
by tepples
zeroone wrote:In my GoodNES audit, I treated mapper 1 games marked with MMC1A as mapper 155 games. Why isn't there a separate mapper for MMC3A games?
Because no licensed games are known to rely on MMC3A behavior (as opposed to MMC3BS/MMC3C). If this game does, then a proposal for an MMC3 submapper may be in order.

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 1:10 pm
by Zepper
Any clues about the green as background color?

Re: Aladdin (Super Game) mapper 4 bug?

Posted: Wed Feb 01, 2017 1:54 pm
by zeroone
Zepper wrote:Any clues about the green as background color?
How is that image different from other emulators? Even the mapper 114 (MMC3a variant) version looks like that.