Because of APU test issues, I rebuild my CPU core to handle cycles in a lower level - it means:
* By taking STA $HHLL, it does 1 clock cycle to read the opcode, 2 cycles to fetch the address HHLL, instead of clocking 4 cycles at end of STA. That's an example.
It caused the timing to be better for a few games/demos, but very bad for others (mapper #7). Battletoads&Double Dragon does not hang when a PCM sound is played. While it was playing nicely, it stopped on level 5 beginning. >_<. I suspect I would have to rewrite my PPU core too.
Detail (NTSC only): for each CPU cycle, the PPU does 3 clock cycles, APU does 1 clock cycle. I gave a look in other emus and (except for Nintendulator?), they use a cycle table. Is the PPU/APU clocked before or after an instruction? Any help?
* By taking STA $HHLL, it does 1 clock cycle to read the opcode, 2 cycles to fetch the address HHLL, instead of clocking 4 cycles at end of STA. That's an example.
It caused the timing to be better for a few games/demos, but very bad for others (mapper #7). Battletoads&Double Dragon does not hang when a PCM sound is played. While it was playing nicely, it stopped on level 5 beginning. >_<. I suspect I would have to rewrite my PPU core too.
Detail (NTSC only): for each CPU cycle, the PPU does 3 clock cycles, APU does 1 clock cycle. I gave a look in other emus and (except for Nintendulator?), they use a cycle table. Is the PPU/APU clocked before or after an instruction? Any help?