Page 2 of 2

Re: How important is cycle accuracy for the CPU ?

Posted: Sun Jun 05, 2016 9:12 pm
by amhndu
So in other words, are you saying your project is type "a" (early stage) in this taxonomy?
Yes, that sounds about right.

Re: How important is cycle accuracy for the CPU ?

Posted: Mon Jun 06, 2016 9:48 am
by zzo38
amhndu wrote:If I understand you correctly, only the PPU, APU and mapper registers need to touched in the proper cycle, the CPU registers. the ROM and the SRAM read-writes are malleable ?
Yes, if the ROM/SRAM do not have side-effects (possibly with some mappers (even if none such currently exists) can have relevant timing-sensitive side-effects). But since the CPU accesses using one address space and PPU with other address space, it should treat the CPU's address space uniformly and always do the read/writes with the correct timing, and same with the PPU's address space. The A, X, Y, flags, stack pointer, and program counter in the CPU, and the internal calculations it uses, are not externally visible though, so it doesn't matter exactly when the registers are updated and when the calculations are performed, as long as it causes the correct sequence of read/writes, for example to add in the page-crossing penalty if applicable, and so on. For example, a read-modify-write on zero-page must result in the following sequence of operations: Read opcode, read next byte, read from effective address, write the old value to that address, write the new value to that address. During which step you calculate the new value and which step you set the flags is irrelevant, as long as they are done before the next instruction is executed.
I should say that I'm not really aiming for perfect emulation and 100% game coverage.
That is OK, but then it isn't quite correct. I am saying that if I was making the emulator, I would want to aim for correctness. (Note that omitting some mappers does not make it incorrect, so a correct emulation does not necessarily do 100% game coverage anyways.)

Re: How important is cycle accuracy for the CPU ?

Posted: Mon Jun 06, 2016 11:01 am
by Dwedit
I recommend implementing mappers 0 (NROM/no mapper),1 (MMC1), 2 (UxROM), 3 (CNROM), and 7 (AxROM) first, since they are simple, easy, and widely used. It's nice to try to get Megaman working before Super Mario Bros :)

Re: How important is cycle accuracy for the CPU ?

Posted: Mon Jun 06, 2016 8:38 pm
by amhndu
Thank you very much, guys!