Commit graph

71 commits

Author SHA1 Message Date
madmaurice d0a4b5a217 cpu - Add run method to run a specific number of mcycles 2023-09-18 23:32:58 +02:00
madmaurice 7bc272afb6 cpu/decoder - Fix DAA 2023-09-09 15:42:46 +02:00
madmaurice 9c20befc60 cpu/decoder - Fix ADC edge case 2023-09-09 15:41:02 +02:00
madmaurice 9ca6c84043 cpu/decoder - Fix output reg for LD HL, SP + e8 2023-09-02 00:38:47 +02:00
madmaurice cfa32424c7 cpu/decoder - Fix H and C bits for ADD SP, e8 and LD HL, SP + e8 2023-09-02 00:38:01 +02:00
madmaurice c7cb345c08 cpu/cpu - Fix writeback for add16 2023-09-02 00:13:07 +02:00
madmaurice 9db97b80ab cpu/decoder - Fix decoding of bit op codes 2023-09-02 00:01:55 +02:00
madmaurice 243553acba cpu/cpu - Fix F register 2023-09-01 23:43:24 +02:00
madmaurice 899cebb698 cpu/cpu - Fix carry and halfcarry in aluop8
Found by Gameboy Doctor
2023-09-01 23:19:31 +02:00
madmaurice c52aa91f26 Implement everything for Gameboy Doctor 2023-09-01 23:19:02 +02:00
madmaurice 66c19caaee Use exceptions instead of panic 2023-09-01 23:13:12 +02:00
madmaurice 9c07356ead memory - Rename mem_device.* to device.* 2023-08-30 22:34:45 +02:00
madmaurice 3f1a23b7e5 cpu/cpu - Fix build errors 2023-08-30 22:13:58 +02:00
madmaurice 57f029bc6e cpu - best effort implementation of haltbug 2023-08-30 21:47:38 +02:00
madmaurice c1ba944fc9 cpu/decoder - RETI enables interrupts without delay 2023-08-30 21:35:57 +02:00
madmaurice 7574c9f709 cpu/decoder - Remove superfluous include mem_device.h 2023-08-30 18:34:22 +02:00
madmaurice 175a24c77d cpu/decoder - define opcode class with methods
Instead of doing the same bit operations on the opcode everywhere, and
possibly botching it in the process, we create a datatype which has
methods return often used values extracted from the opcode.
2023-08-30 18:27:53 +02:00
madmaurice ef9bda4a30 cpu/decoder - Little conversion fix for ADD SP, e8 2023-08-30 13:43:10 +02:00
madmaurice 53daaeba6b cpu/decoder - Remove more extraneous brackets 2023-08-30 13:41:35 +02:00
madmaurice a8edf40b96 cpu/decoder - Unify code for ALU n ops 2023-08-30 13:41:15 +02:00
madmaurice 9bc6f935ac cpu/decoder - Fix comment 2023-08-30 13:40:50 +02:00
madmaurice 77bd32114a cpu/decoder - Join code for INC rr and DEC rr 2023-08-30 13:34:14 +02:00
madmaurice e45704e2ab cpu/decoder - Reduct empty lines 2023-08-30 13:27:04 +02:00
madmaurice dbd42c4573 cpu/decoder - Remove extraneous brackets 2023-08-30 13:26:35 +02:00
madmaurice 87b939c80e cpu/decoder - add function with shared code for 16-bit addition 2023-08-30 13:20:57 +02:00
madmaurice 3d244d1ec0 cpu/decoder - Implement DAA
This is a best effort implementation, possible quirks of the actual
hardware have not been considered.
2023-08-30 12:56:00 +02:00
madmaurice 2d4daf821e cpu/decoder - Add missing breaks 2023-08-30 12:32:38 +02:00
madmaurice 7d1d20becf cpu/decoder - Fix comment 2023-08-30 00:36:20 +02:00
madmaurice efc6762068 cpu/decoder - Remove extaneous code of instruction already implemented elsewhere 2023-08-30 00:25:49 +02:00
madmaurice aec3c7b0e6 cpu - Fix build errors 2023-08-30 00:01:45 +02:00
madmaurice c4a9a10e09 cpu/decoder - Treat undefined opcodes as NOP 2023-08-29 23:59:32 +02:00
madmaurice c90788d330 cpu/decoder - Implement STOP n8 2023-08-29 23:47:18 +02:00
madmaurice 2ab37c6468 cpu/cpu - Implement stop mode 2023-08-29 23:46:36 +02:00
madmaurice 4e506a4d3c cpu/decoder - Implement LD HL, SP + e8 2023-08-29 23:46:09 +02:00
madmaurice 7180ae8c40 cpu/decoder - Implement HALT 2023-08-29 23:32:11 +02:00
madmaurice 5cabe03d25 cpu/cpu - Handle halt mode 2023-08-29 23:30:31 +02:00
madmaurice 5281ceb0d6 cpu/cpu - Fix include 2023-08-29 23:16:18 +02:00
madmaurice 7425663f16 Move types.h to misc 2023-08-29 23:16:09 +02:00
madmaurice eb0e591b25 Move panic.h to misc 2023-08-29 23:15:00 +02:00
madmaurice ef2615c1a7 cpu/decoder - Fix build errors 2023-08-29 23:13:23 +02:00
madmaurice 517577d546 Improve consistency for including 2023-08-29 23:11:31 +02:00
madmaurice c39a680293 cpu/decoder - Fix IME state for RETI 2023-08-29 23:06:50 +02:00
madmaurice 28bc389644 cpu/decoder - Reset carry flag for PREFIX SWAP instruction 2023-08-29 23:06:28 +02:00
madmaurice b6f0f4416f cpu/decoder - Implement ADD SP, e8 2023-08-29 23:06:05 +02:00
madmaurice 41c4038d0a cpu/decoder - Implement ADD HL, rr 2023-08-29 23:05:55 +02:00
madmaurice 8f1b1eb924 cpu/decoder - Implement INC rr and DEC rr 2023-08-29 23:04:59 +02:00
madmaurice e893d2b9f5 cpu/decoder - Use variable instead calculating twice 2023-08-29 23:04:31 +02:00
madmaurice 43088a7f99 cpu/decoder - Remove extraneous comments 2023-08-29 21:27:32 +02:00
madmaurice 39e041f473 cpu/decoder - Implement RLCA, RLA, RRCA, RRA 2023-08-29 21:25:19 +02:00
madmaurice 7902ac4641 cpu/decoder - little code improvement 2023-08-29 21:14:19 +02:00