There wasn't any existing test ROM to see what kind of MMC3 chip any given board has, so here's one. It will show you which of the wiki's "IRQ tick happens at 260,268,276... or 315" pixel values is correct for your chip.

The offset is 195 pixels, so if you measure the effect starting at 169 pixels, 169 - 195 + 341 = 315, that chip would be the 315 type.

According to the wiki, there are four MMC3 variants. "the IRQ counter should decrement on PPU cycle 260,268,276... or 315". I needed to find out which this specific chip was.

... I don't know how that nonsense got in there?

No, I don't know why Zepper added that crap. It's confusing. Nintendo's MMC3s will only fire an IRQ on the first rising edge of PPU A12 within a group, which should always be PPU cycle 260 or PPU cycle 324.

The later values could only possibly make sense if he was referring to mis-screen raster effects changing the Pattern table mapping bits of $2000 in the middle of a scanline.

MMC3 detects scanlines by watching A12 ($1000) on the PPU bus. Every time a rising edge occurs (transitionsfrom 0->1), and it hasn't been too close to the previous rising edge, the IRQ counter gets clocked.

Under *normal* conditions (BG using $0xxx, sprites using $1xxx), A12 will rise exactly 8 times every scanline(once for each sprite CHR fetch). However the 8 rises are so close together that only the first is 'seen'.

During rendering and pre-render scanlines the PPU is fetching NT and CHR data from the cart through a seriesof reads. Each read updates the PPU Address lines (including A12), and each read takes 2 PPU cycles (2dots). There are 4 reads per tile, and 42 tiles per scanline:

(You might be able to see now how I came up with those 260, 324 numbers I threw at you earlier)

MMC3 seems to ignore rises that are too close together. This is why the 8 sprite fetches will only clockthe counter once. Exactly how far apart the rising edges have to be is unknown, but it is somewhere between14 and 16 dots. So any two consecutive opportunities are too close together (including the most distant332->4), but any two non-consecutive opportunities will both be acknowledged.

Figuring whether the tile is being fetched from $0xxx or $1xxx is usually easy. BG and 8x8 sprites arealways fetched from an assigned pattern table (configurable by PPU reg $2000). However, 8x16 sprites cancome from either pattern table. So which tile is begin fetched depends on which sprite is being fetched....which depends on what scanline you're on, and what sprites are found to be in-range on that scanline. Forscanlines which contain less than 8 sprites, tile $FF is fetched as a dummy (in 8x16 sprites, this would befrom the $1xxx pattern table).

This is why, when you have 8x16 sprites, ALL sprites must use the right-hand pattern table. If you havesprites using the left and the right, you'll probably end up having some scanlines where the IRQ countercounts the same scanline multiple times! All depending on which sprites are in-range and when. For example,if there are 4 sprites on the scanline using $0xxx, and 4 using $1xxx, the IRQ counter might count thescanline anywhere from 1 to 4 times!

I still fail to see how you came up with those numbers from disch's docs... What's your logic behind all this? No one here understands your wiki edits, and when asked, you're telling us to guess and dumping worthlessly dumping disch docs. Are you intentionally trying to make this some sort of puzzle?

_________________If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers

Evidently, the problems that Zepper had boiled down to MMC3 games that use 8x16 sprites in an inconvenient manner. (I didn't know there were any. It'd be good to make a partial list of these games.) The cryptic comment about "one of the following 10 alignments" didn't explain why one or another would be chosen, and so Calima assumed there were variations in hardware. (Oh well)

I've attempted to update the wiki page in a way that will both prevent someone else from recapitulating Calima's confusion, and also make the point that Zepper was attempting to make.

Another thing I'd like someone else to check: We have a report that the PPU will spend its "idle" pixel driving the address bus to $1xxx, which would cause an MMC3 with sprites and backgrounds set to the $0xxx page to still generate IRQs. Does anyone have the ability to cross-check this?

Last edited by lidnariq on Sun Sep 24, 2017 9:19 pm, edited 1 time in total.

If one 8x16 sprite from the "wrong" pattern table preceding the first sprite from the "right" one is in range, the PIT is clocked at 268 instead of 260. If two such sprites are in range, the PIT is clocked at 276.

Who is online

Users browsing this forum: No registered users and 11 guests

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