It is currently Thu Dec 14, 2017 10:08 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Fri Mar 17, 2017 1:05 pm 
Online
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
My emulator experiences a disappearing scanline in Mickey's Safari in Letterland during vertical scrolling.

Image

This game is paired with G.I. Joe on the list of tricky-to-emulate games. But, my emulator is able to run G.I. Joe without issues.

I know this is an MC-ACC MMC3 game. And, it's coded up accordingly.

Does anyone have any recommendations to handle this one? What should I be looking for in a log?


Top
 Profile  
 
PostPosted: Fri Mar 17, 2017 5:29 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
The game sets PPU $2000 to use pattern table #0 for both sprites and background tiles. So, the IRQs are clocked on sprite fetches after PPU cycle 256, when a sprite tile is fetched from PPU $1000. Well, it's supposed to clock just once per line. The shaking is because the time between PPU $1000 risings isn't big enough. Currently, Mickey in Letterland has a glitched scanline (in my emulator) when you scroll up, but the score is perfect. Mickey in Numberland runs here with no problems though.


Top
 Profile  
 
PostPosted: Fri Mar 17, 2017 6:54 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
It's also not even a MMC3. It's the Acclaim version that clocks on falling edges instead of rising edges.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Fri Mar 17, 2017 7:57 pm 
Online
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
Zepper wrote:
The game sets PPU $2000 to use pattern table #0 for both sprites and background tiles. So, the IRQs are clocked on sprite fetches after PPU cycle 256, when a sprite tile is fetched from PPU $1000. Well, it's supposed to clock just once per line. The shaking is because the time between PPU $1000 risings isn't big enough. Currently, Mickey in Letterland has a glitched scanline (in my emulator) when you scroll up, but the score is perfect. Mickey in Numberland runs here with no problems though.


I think that solved the issue. I extended the IRQ reset delay for MC-ACC games. That fixed the disappearing scanline in the status bar. All the other MC-ACC games still appear to work fine (e.g. The Incredible Crash Dummies title screen does not shake). And, the MMC3 test ROMs still work with the increased reset delay time; though, it will only apply it for MC-ACC games. This is likely a hack. But, it does the job for the games that need it without breaking test ROMs.

Dwedit wrote:
It's also not even a MMC3. It's the Acclaim version that clocks on falling edges instead of rising edges.


The increased IRQ reset delay is being used with the MC-ACC falling edge detection. I suspect that the emulator is just timing the reset incorrectly for falling edge. I'll investigate further.


Top
 Profile  
 
PostPosted: Sat Mar 18, 2017 9:13 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
Dwedit wrote:
It's also not even a MMC3. It's the Acclaim version that clocks on falling edges instead of rising edges.

Is this info available on the wiki? What's written about the pattern table setting and sprite fetching is still valid and true.


Top
 Profile  
 
PostPosted: Sat Mar 18, 2017 10:18 am 
Online
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
Zepper wrote:
Dwedit wrote:
It's also not even a MMC3. It's the Acclaim version that clocks on falling edges instead of rising edges.

Is this info available on the wiki? What's written about the pattern table setting and sprite fetching is still valid and true.


See the bottom of this section.

The wiki refers to this thread.

The Nestopia Cart DB covers the list of MC-ACC games.


Top
 Profile  
 
PostPosted: Sat Mar 18, 2017 10:51 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6520
Location: Seattle
Sorry, I just split IRQ Specifics into its own section (off of §Hardware) to make it more obvious


Top
 Profile  
 
PostPosted: Sat Mar 18, 2017 1:42 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
Still unclear. This game sets $2000 to use pattern and sprites from PPU low pattern table ($0000), so sprites fetched from PPU $1000 is the way to detect rising edges. What about falling edges? Could someone describe how to do the things?


Top
 Profile  
 
PostPosted: Sat Mar 18, 2017 2:01 pm 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6520
Location: Seattle
The practical difference between MC-ACC and MMC3C is only that MC-ACC triggers an IRQ 4 pixels later, which is 1 or 2 CPU cycles later depending on complex things.


Top
 Profile  
 
PostPosted: Sat Mar 18, 2017 2:55 pm 
Online
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 750
Location: New York, NY
Zepper wrote:
Still unclear. This game sets $2000 to use pattern and sprites from PPU low pattern table ($0000), so sprites fetched from PPU $1000 is the way to detect rising edges. What about falling edges? Could someone describe how to do the things?


MMC3 normally triggers an IRQ when address bit A12 transitions from 0 to 1. MC-ACC normally triggers an IRQ when address bit A12 transitions from 1 to 0.


Top
 Profile  
 
PostPosted: Sun Mar 19, 2017 1:52 am 
Offline
User avatar

Joined: Tue Mar 07, 2017 4:25 pm
Posts: 29
Location: Ohio, USA
I am having this issue in my emulator as well, and as noted when I change the IRQ to trigger on falling edges, it fixes the shaking.
I have managed this far without having to check rom hashes against a database, but this issues raises the question: is there a heuristic to determine that the MC-ACC A12 behavior should be used, as opposed to the normal rising edge MMC3 behavior?


Top
 Profile  
 
PostPosted: Sun Mar 19, 2017 5:47 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
Well, if what I wrote is correct... and must be A12 1->0, then... What's the inner working of it? Sprites are fetched from PPU cycle 257, from pattern table $1000. So, technically, A12 is 1 during cycles 257~319, and 0 when out of this interval. So, the first clock should occur at cycle 320..?


Top
 Profile  
 
PostPosted: Sun Mar 19, 2017 6:22 am 
Online

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19343
Location: NE Indiana, USA (NTSC)
257-260: Dummy nametable fetch. A12 is low
261-264: Sprite pattern fetch (1 of 8). A12 is high
265-268: Dummy nametable fetch. A12 is low
269-272: Sprite pattern fetch (2 of 8). A12 is high
273-276: Dummy nametable fetch. A12 is low
277-280: Sprite pattern fetch (3 of 8). A12 is high
281-284: Dummy nametable fetch. A12 is low
285-288: Sprite pattern fetch (4 of 8). A12 is high
289-292: Dummy nametable fetch. A12 is low
293-296: Sprite pattern fetch (5 of 8). A12 is high
297-300: Dummy nametable fetch. A12 is low
301-304: Sprite pattern fetch (6 of 8). A12 is high
305-308: Dummy nametable fetch. A12 is low
309-312: Sprite pattern fetch (7 of 8). A12 is high
313-316: Dummy nametable fetch. A12 is low
317-320: Sprite pattern fetch (8 of 8). A12 is high


Top
 Profile  
 
PostPosted: Sun Mar 19, 2017 7:26 am 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3968
No way to identify the Acclaim MMC3 other than ROM hash, or specifying NES 2.0 submapper #4. I guarantee you that you won't see any roms marked with the correct NES 2.0 submapper in the wild.

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun Mar 19, 2017 8:42 am 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3076
Location: Brazil
tepples wrote:
257-260: Dummy nametable fetch. A12 is low
261-264: Sprite pattern fetch (1 of 8). A12 is high
265-268: Dummy nametable fetch. A12 is low
269-272: Sprite pattern fetch (2 of 8). A12 is high
273-276: Dummy nametable fetch. A12 is low
277-280: Sprite pattern fetch (3 of 8). A12 is high
281-284: Dummy nametable fetch. A12 is low
285-288: Sprite pattern fetch (4 of 8). A12 is high
289-292: Dummy nametable fetch. A12 is low
293-296: Sprite pattern fetch (5 of 8). A12 is high
297-300: Dummy nametable fetch. A12 is low
301-304: Sprite pattern fetch (6 of 8). A12 is high
305-308: Dummy nametable fetch. A12 is low
309-312: Sprite pattern fetch (7 of 8). A12 is high
313-316: Dummy nametable fetch. A12 is low
317-320: Sprite pattern fetch (8 of 8). A12 is high

My notes are a bit different... but from the wiki anyways.
Code:
/* Cycles 257-320: Sprite fetches (8 sprites total, 8 cycles per sprite)
    * 0-3: Read the Y-coordinate(0), tile number(1), attributes(2), and X-coordinate(3)
    of the selected sprite from secondary OAM.
    * 4-7: Read the X-coordinate of the selected sprite from secondary OAM 4 times
    (while the PPU fetches the sprite tile data).
    * For the first empty sprite slot, this will consist of sprite #63's Y-coordinate followed by 3 $FF bytes;
    for subsequent empty sprite slots, this will be four $FF bytes.
    */
Is this incorrect?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 6 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