This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

Question: How do I convert between 8bit IRQs and 16bit IRQs

Question: How do I convert between 8bit IRQs and 16bit IRQs
by on (#48072)
An example is that I am trying this on my mario hack, use mapper #69 (Sunsoft FME7) instead of mapper #4 (MMC3). But the IRQs in this mapper is 16bit, and not 8bit.

For short: How do I convert between MMC3 8bit and FME7 16bit?

I hope I am asking the question right, I get so nervous sometimes!

by on (#48073)
Take the MMC3 scanline counts and multiply them by 341/3 (NTSC) or 341/3.2 (PAL).

by on (#48074)
Pay attention to WHEN you write to the IRQ counter. FME-7 uses a CPU cycle based counter instead of a scanline based counter.

There are 113.666 CPU cycles per scanline. There are 22 scanlines between NMI starting and the first visible scanline.
So you want something to happen on scanline 192? Write (192+22)*113.66, 16 bit value 5F04.

You should do your writes at the very beginning of NMI just to have a consistent reference time.