summaryrefslogtreecommitdiff
path: root/cpu.c
AgeCommit message (Collapse)AuthorFilesLines
2026-02-01add incomplete ppuHEADmasterVineet Kumar1-0/+5
2024-09-01add basic ppu register readingvin1-3/+1
2024-09-01add preliminary apu register supportvin1-3/+10
2024-07-21rename struct Rom to struct romvin1-1/+2
2024-07-21start implementing PPUvin1-6/+21
2024-07-20fix rest of logging format issuesvin1-3/+7
Now the format perfectly matches nestest.log. The only mismatch is now at the unimplemented APU memory addresses.
2024-07-20fix status flag bug in ASL and ROLvin1-2/+3
2024-07-20replace tabs with spaces to better match nestest.logvin1-20/+43
2024-07-07fix warnings and move cpu registers+flags to headervin1-23/+2
2024-07-04implement all of the nestest unofficial opcodes and fix branch cyclesvin1-9/+10
2024-07-04add preliminary implementation of the unofficial opcodesvin1-34/+57
2024-07-04start implementing unofficial opcodesvin1-1/+148
2024-07-04achieve cycle accuracy for official opcodesvin1-5/+22
Now, the unofficial opcodes can be implemented, and then the PPU and APU.
2024-07-03finalize trace logging to match nestest.log minus PPU cyclesvin1-8/+12
2024-07-03improve branching cycle accuracyvin1-16/+23
2024-07-03fix SBC bug in the rewrite and improve loggingvin1-60/+29
2024-07-03call opcode function pointer instead of using switch casevin1-1273/+172
Also improve logging.
2024-06-30start refactoring opcode defs into an arrayvin1-16/+2
2024-06-30combine macro for updating N and Z status flagsvin1-54/+30
2024-06-30fix alignment of logging with ABS_X and ZP_Xvin1-2/+2
2024-06-30fix indirect JMP bug where the high byte does not increment out of pagevin1-3/+4
https://old.reddit.com/r/EmuDev/comments/15plfes/having_an_issue_with_nestest_on_my_6502_emulator/jvyck7k/ With this, it seems that all official opcodes run as nestest expects. Now, it's the unofficial opcodes that need to be implemented.
2024-06-30fix incorrect argument for INCvin1-2/+1
Perhaps a refactor is in order for the arguments to the opcodes.
2024-06-30fix incorrect argument for ASL and LSRvin1-6/+6
2024-06-30fix JSR, RTS, and RTIvin1-3/+3
JSR was pushing 1 too high PC and RTS was 1 too low RTI was only pulling the low byte of PC
2024-06-30change SBC to be ADC with one's complement instead of two'svin1-3/+5
It seems that is what was expected when run with nestest.
2024-06-29fix status flag ordering shenanigansvin1-23/+33
2024-06-29fix ADC bug where V is calculated with new A instead of old Avin1-1/+2
2024-06-28fix status register to match nestestvin1-6/+8
2024-06-28improve logging and JMP indirectvin1-136/+503
2024-06-28fix more bugsvin1-46/+7
2024-06-28fix JSR and RTS bugvin1-4/+4
The stack's PUSH and PULL weren't proper and JSR was reading wrong argument it seems.
2024-06-28start logging instructions as nestest.log has donevin1-31/+192
2024-06-17start fixing bugs with memory accessvin1-10/+10
So this is why tests should be written while writing the program and instructions instead of all at once later. If this were all to be rewritten (which it probably will), I should add tests for each opcode instead of waiting until the end for ROM loading support.
2024-06-17implement basic iNES and Mapper 0 ROM loadingvin1-13/+49
It seems like the test ROM loads fine but the instructions are not, but that's exactly what the test ROM is for I suppose.
2024-06-16replace bit comparisons with 0 from greater than to not equalvin1-13/+13
They're both the same and the compiler might have already optimized it away. It also conveys the message better in my opinion.
2024-06-11add memory mirroring for system and ppu memoryvin1-0/+14
2024-06-11add separate implied/accumulator functions for certain opcodesvin1-25/+78
2024-06-10add jsr, rti, rtsvin1-7/+16
2024-06-10implement untested most of stack-related opcodesvin1-66/+57
2024-06-10add lsr, rol, rorvin1-3/+24
2024-06-10implement tay, txa, tyavin1-3/+12
2024-06-10implement sta, stx, styvin1-20/+20
2024-06-10implement se?() opcodes and remove extra 65c02 opcodesvin1-417/+3
2024-06-09implement more instructionsvin1-20/+46
2024-06-09add opcode_mem() function to return memory address and not pre-peekvin1-15/+55
Of course all of these opcodes need to be tested later...
2024-06-09add memory writing functionsvin1-4/+18
2024-06-09implement some more instructions and branching?vin1-25/+64
2024-06-09fix potential adc overflow flag bugvin1-1/+1
2024-06-09add blank todo opcode functions based on opcode jsonvin1-19/+406
2024-06-09programmatically create switch cases for opcodes based on opcode jsonvin1-35/+1011
The JSON is from https://github.com/ericTheEchidna/65C02-JSON/ and saved me a lot of time from writing the cases for each opcode by hand.