emulation - 6502 cycle timing per instruction -
i writing first nes emulator in c. goal make understandable , cycle accurate (does not have code-efficient though), in order play games @ normal 'hardware' speed. when digging technical references of 6502, seems instructions consume more 1 cpu cycle - , has different cycles depending on given conditions (such branching). plan create read , write functions, , group opcodes addressing modes using switch . the question is: when have multiple-cycle instruction, such brk , need emulate happening in each cycle: #method 1 cycle - action 1 - read brk opcode 2 - read padding byte (ignored) 3 - store high byte of pc 4 - store low byte of pc 5 - store status flags b flag set 6 - low byte of target address 7 - high byte of target address ...or can execute required operations in 1 'cycle' (one switch case ) , nothing in remaining cycles? #method 2 1 - read brk opcode, read padding byte (ignored), store high byte of pc, store low byte of pc, store status flags b flag ...