It is currently Sat Oct 21, 2017 10:50 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 13 posts ] 
Author Message
PostPosted: Fri Mar 27, 2015 5:42 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
This game writes to $2006 and it's causing the IRQ to clock more than once per scanline. If I filter such raises (leaving only raises from cycle 260 - sprite fetches), the game score is fine.

Any help???

EDIT: log of IRQ counter only. Format is Line, Cycle, Counter OR state.


Attachments:
rocknes.rar [7.04 KiB]
Downloaded 108 times


Last edited by Zepper on Tue May 31, 2016 6:41 pm, edited 3 times in total.
Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 5:53 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6289
Location: Seattle
The Talk page for MMC3 says that the MMC3 logic is:

* Assume a latch "L" and a small counter "C"
* Set the latch "L" on a rising edge of PPU A12 and clear the counter "C"
* If PPU A12 is low, increment the counter "C" on a rising edge of M2.
* Clear the latch "L" if the counter "C" becomes 2.
* Decrement the IRQ counter on a rising edge of the latch "L".

Does that help at all? It sounds subtle enough that it seems unlikely...


Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 6:13 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
What is "M2"?


Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 6:22 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19114
Location: NE Indiana, USA (NTSC)
M2 is a signal that rises once every CPU cycle and indicates to the Game Pak that the address on A14-A0 is valid. It's similar to the Phi2 (second clock phase) output of an ordinary 6502, though M2 (modified Phi2) rises slightly earlier.


Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 6:53 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
It looks fine for a hardware point of view, but not for me. :oops: How is this translated into emulation, in CPU cycles, read/write...?


Top
 Profile  
 
PostPosted: Fri Mar 27, 2015 7:12 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19114
Location: NE Indiana, USA (NTSC)
Zepper wrote:
tepples wrote:
M2 is a signal that rises once every CPU cycle

It looks fine for a hardware point of view, but not for me. :oops: How is this translated into emulation, in CPU cycles, read/write...?

M2 is the CPU clock, as far as the mapper is concerned.


Top
 Profile  
 
PostPosted: Sat Mar 28, 2015 5:58 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
Back to the topic, well... The game is fixed if the IRQ is only clocked if sprites or background are enabled, but is this correct? Kevtris said that "nothing can stop the IRQ counter, as far as A12 toggles". Hmm....

MMC3 test gives an immediate error regarding PPUADDR ($2006), which the IRQ should be clocked.
Plus, this game has an unusual IRQ setup, since BG and SPR are fetched from PPU pattern #0, so it's clocked when using sprites 16x8 while fetching tiles from cycle 260.


Top
 Profile  
 
PostPosted: Sat Mar 28, 2015 8:42 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19114
Location: NE Indiana, USA (NTSC)
Zepper wrote:
Back to the topic, well... The game is fixed if the IRQ is only clocked if sprites or background are enabled, but is this correct? Kevtris said that "nothing can stop the IRQ counter, as far as A12 toggles". Hmm....

You can stop the counter by stopping the PA12 toggles, and turning off rendering entirely stops the PA12 toggles.

Quote:
Plus, this game has an unusual IRQ setup, since BG and SPR are fetched from PPU pattern #0, so it's clocked when using sprites 16x8 while fetching tiles from cycle 260.

As far as I can tell, the sprite pattern table bit in PPUCTRL is ignored when the 8x16 bit is true.


Top
 Profile  
 
PostPosted: Sat Mar 28, 2015 3:02 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
tepples wrote:
(...)and turning off rendering entirely stops the PA12 toggles.

That's not what the test ROM displays. I added a check on $2006/7 writes to assert BG or SP enabled.

Quote:
As far as I can tell, the sprite pattern table bit in PPUCTRL is ignored when the 8x16 bit is true.

True. My bad. :oops:


Attachments:
1-clocking 001.bmp
1-clocking 001.bmp [ 900.05 KiB | Viewed 2098 times ]
Top
 Profile  
 
PostPosted: Sat Mar 28, 2015 3:37 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
I fixed the game, working fine.

Now I need a solution for Rockman 5 and Kick Master. If I delay the IRQ by more than 1 cycle, it fixes. But the test ROM fails. Both have flickering.


Top
 Profile  
 
PostPosted: Tue May 31, 2016 11:33 am 
Offline
User avatar

Joined: Wed Nov 19, 2014 9:00 am
Posts: 40
Location: Mexico
* Bump *

@Zepper, how did you fix it?

Right now I'm having problems with the same game (Mickey in Letterland) in my emulator. The symptoms are different though.

After I select a stage and the scene where goofy picks you up in the jeep passes, all my emu shows is a black screen (The game does not hang, since when I press select, the stage selection screen shows up). If I disable the IRQ counter, I don't get the black screen but obviously graphics are messed up (same thing happens with Startropics and Startropics 2).

Any ideas on how to tackle this?

Thanks a lot in advance.

_________________
*** O-Nes-Sama emulator team ***


Top
 Profile  
 
PostPosted: Tue May 31, 2016 6:42 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
Short answer - I don't know. I still have doubts about how this game handles PPU IRQs with an unusual BG/SPR bank setting. I'm still investigating it... Sorry.

The "solved" wasn't solved after all.


Top
 Profile  
 
PostPosted: Tue May 31, 2016 7:51 pm 
Offline
User avatar

Joined: Wed Nov 19, 2014 9:00 am
Posts: 40
Location: Mexico
Zepper wrote:
Short answer - I don't know. I still have doubts about how this game handles PPU IRQs with an unusual BG/SPR bank setting. I'm still investigating it... Sorry.

The "solved" wasn't solved after all.


No problem at all. If I find out anything useful, I'll let you all guys know.

Thanks a lot!

_________________
*** O-Nes-Sama emulator team ***


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 13 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group