Commit Graph
100 Commits
Author SHA1 Message Date
Riyyi 461fc28c94 Emulator: Add support for negative numbers to DAA opcode 2022-08-31 01:22:36 +02:00
Riyyi 6c2e5d32d4 Emulator: Implement DAA opcode 2022-08-30 18:10:47 +02:00
Riyyi 525391144a Emulator: Fix increment HL opcode 2022-08-30 16:41:20 +02:00
Riyyi cfded56dcd Emulator: Fix offset bug in readMemory() function 2022-08-30 16:24:51 +02:00
Riyyi 024e6aecc3 Emulator: Add comments to cycle waiting amount 2022-08-30 15:20:54 +02:00
Riyyi baa679904c Emulator: Implement RET opcodes, minus one 2022-08-29 01:54:31 +02:00
Riyyi 0c4d7b2112 Emulator: Implement JP opcodes 2022-08-29 01:31:02 +02:00
Riyyi 3346b5329a Emulator: Implement XOR/OR opcodes 2022-08-29 01:12:59 +02:00
Riyyi 275739bd5b Emulator: Implement SUB/SBC opcodes 2022-08-29 00:26:40 +02:00
Riyyi d47dddfe69 Emulator: Implement ADC opcode 2022-08-28 22:47:30 +02:00
Riyyi bf8bd66389 Emulator: Implement 8-bit ADD opcodes 2022-08-28 22:47:12 +02:00
Riyyi 3bac216698 Emulator: Add some missing LD opcodes 2022-08-28 22:16:01 +02:00
Riyyi 7dc569b1a1 Emulator: Add SCF/CCF opcodes 2022-08-28 22:16:01 +02:00
Riyyi 5015b9e59d Emulator: Implement 16-bit INC opcode 2022-08-28 18:12:19 +02:00
Riyyi a7169addd8 Emulator: Rename inc() => inc8() 2022-08-28 17:49:49 +02:00
Riyyi 4dffe1a60a Emulator: Implement push/pop opcodes 2022-08-28 17:44:59 +02:00
Riyyi 69760e349e Emulator: Fix compiler warnings in cpu-prefix.cpp 2022-08-28 17:44:59 +02:00
Riyyi 200cf12a8f Emulator: Fix switch case numbers for prefix opcodes 2022-08-28 16:43:01 +02:00
Riyyi c4ccbecaf7 Emulator: Add warning for illegal opcodes 2022-08-28 16:25:39 +02:00
Riyyi ec0f8bf02e Emulator: Implement SLA/SRA/SRL opcodes 2022-08-27 13:43:15 +02:00
Riyyi ac03d70d83 fixup! Emulator: Implement SWAP opcodes 2022-08-27 13:38:04 +02:00
Riyyi 99c768d400 Emulator: Rename reg => register_ 2022-08-27 13:36:07 +02:00
Riyyi fb6ba43ff1 Emulator: Implement RL/RR opcodes 2022-08-27 13:36:07 +02:00
Riyyi 275cab4da4 Emulator: Implement RLC/RRC opcodes 2022-08-27 13:08:21 +02:00
Riyyi d53f4759e3 Emulator: Implement SWAP opcodes 2022-08-27 12:43:01 +02:00
Riyyi 67698528e1 Emulator: Implement SET opcodes 2022-08-27 02:17:37 +02:00
Riyyi e35aa06471 Emulator: Implement RES opcodes 2022-08-27 02:15:18 +02:00
Riyyi 6ada7261e7 Emulator: Add .cpp file for prefix $cb opcodes, implement BIT opcodes 2022-08-27 02:15:18 +02:00
Riyyi ff2f94fc05 Doc: Added mnemonics for two opcode constants 2022-08-27 00:03:34 +02:00
Riyyi 81fe126068 Emulator: Add cartridge ROM bank loading 2022-08-26 07:22:44 +02:00
Riyyi 27abccf863 Emulator: Implement nop/rst opcodes 2022-08-26 07:14:32 +02:00
Riyyi e7e1b58d01 Emulator: Add error message when reading/writing unmapped memory space 2022-08-26 06:11:57 +02:00
Riyyi d33837f118 Emulator: Implement call opcodes 2022-08-26 05:39:09 +02:00
Riyyi 219520965c Emulator: Implement Accumulator rotate opcodes 2022-08-25 19:53:40 +02:00
Riyyi 462fa09a00 Emulator: Implement AND opcodes 2022-08-25 15:11:03 +02:00
Riyyi be3ee22086 Emulator: Add error message when reading unloaded cartridge header 2022-08-25 14:56:33 +02:00
Riyyi c9e2bf9e94 Emulator: Implement 16-bit add opcodes 2022-08-25 14:56:33 +02:00
Riyyi c81db1d3b5 Emulator: Rename decr16 => dec16 as there is only one variant 2022-08-25 14:55:58 +02:00
Riyyi 69dc545bf0 Emulator: Implement 8-bit decrement opcodes 2022-08-25 14:55:58 +02:00
Riyyi 802995b7d9 Emulator: Implement JR opcodes 2022-08-25 14:55:58 +02:00
Riyyi eb0f4b6a5f Doc: Add explanation of flag conditions 2022-08-25 11:42:46 +02:00
Riyyi 67f8bcfca9 Emulator: Implement INC and CP arithmetic opcodes 2022-08-25 02:02:57 +02:00
Riyyi 8e4dacca8a Emulator: Add cli argument to specify bootrom path 2022-08-25 00:16:32 +02:00
Riyyi dd2920b2a4 Emulator: Load cartridge header 2022-08-25 00:10:57 +02:00
Riyyi 2aa50d3532 Emulator: Put startup into a Loader class 2022-08-24 23:47:36 +02:00
Riyyi 589faceb9b Doc: Clarify opcode mnemonic for 16-bit address registers
When you see a 16-bit register wrapped by parentheses, its referencing
the value at the address the register is pointing to rather than the
address itself.
2022-08-24 22:54:40 +02:00
Riyyi e9b47d7d68 Emulator: Implement 16-bit DEC opcode 2022-08-24 22:53:35 +02:00
Riyyi 009938b126 Meta: Update ruc library 2022-08-24 22:10:19 +02:00
Riyyi 50e1672524 Emulator: Fix opcode logic in the ldi16 function 2022-08-24 21:21:12 +02:00
Riyyi 1b713f8ab0 Emulator: Make ldi8 function more compact 2022-08-24 21:14:59 +02:00
Riyyi 3fcc6823e8 Emulator: Add last LD opcode 2022-08-24 21:14:59 +02:00
Riyyi efe798084f Emulator: Add last 8-bit LD opcode variants 2022-08-24 21:14:59 +02:00
Riyyi c630a7aab6 Emulator: Add more LD opcodes 2022-08-24 20:52:47 +02:00
Riyyi 8cc8f711e9 Emulator: Reorganize 16-bit and more 8-bit load opcode functions 2022-08-24 20:07:10 +02:00
Riyyi 4220c4fcd2 Emulator: Put opcode comment on the case label line 2022-08-24 19:44:16 +02:00
Riyyi 9f12eaa5ff Emulator: Reorganize 8-bit load opcode functions 2022-08-24 19:44:09 +02:00
Riyyi 4c24ade250 Test: Add unit test for carry calculation 2022-08-24 18:57:00 +02:00
Riyyi 1cd6c428e3 Emulator: Update opcode commentary to decided terminology 2022-08-24 18:56:57 +02:00
Riyyi 002c992e0d Emulator: Add FIXME to verify shared register necessity 2022-08-24 18:55:59 +02:00
Riyyi cc120891ca Emulator: Add isCarry() function to CPU 2022-08-24 18:55:47 +02:00
Riyyi 1f25f875e6 Doc: Make the half-carry flag explanation more clear 2022-08-24 15:27:08 +02:00
Riyyi ab550f6d3e Emulator: Fix offset bug in writeMemory() function 2022-08-23 23:08:54 +02:00
Riyyi fe020c9374 Doc: Decide on opcode mnemonics 2022-08-23 23:08:21 +02:00
Riyyi e2ca4359f2 Emulator: Add opcode $20/$0d/$2f 2022-08-23 20:49:46 +02:00
Riyyi 446a777e40 Emulator: Add Formatter for CPU class 2022-08-23 17:03:52 +02:00
Riyyi 1acb5af23e Emulator: Add function to retrieve AF/PC/SP register 2022-08-23 16:55:35 +02:00
Riyyi a20d756e7b Meta: Update ruc library 2022-08-23 16:55:31 +02:00
Riyyi 80e15531f2 Emulator: Add bitmask for additional safety in read/write functions 2022-08-23 13:47:02 +02:00
Riyyi 16235b4663 Emulator: Add opcode $0a/$0e/$1a/$1e/$2a/$2e/$3a 2022-08-23 13:38:08 +02:00
Riyyi af07357812 Emulator: Add opcode $a8/$af 2022-08-23 01:28:16 +02:00
Riyyi 7e54c733a8 Emulator: Add opcode $cd 2022-08-22 23:24:36 +02:00
Riyyi 5d2ee7cbc9 Emulator: Add opcodes $6/$16/$26/$36 2022-08-22 22:53:52 +02:00
Riyyi 2dc4da71e4 Emulator: Add mnemonic comments to opcodes 2022-08-22 22:53:02 +02:00
Riyyi 6bbc705651 Emulator: Make read/write function more generic 2022-08-22 22:47:32 +02:00
Riyyi 5035b26f8a Emulator: Add opcodes $2/$12/$22/$32 2022-08-22 21:49:24 +02:00
Riyyi afedc8a30b Emulator: Some cleanup in the CPU class 2022-08-22 21:49:24 +02:00
Riyyi c83d322d0c Emulator: Make read/write function more generic 2022-08-22 21:49:24 +02:00
Riyyi 2c870e89c6 Emulator: Make memory spaces more accurate 2022-08-22 13:29:54 +02:00
Riyyi e2db1598af Emulator: Change opcode lookup table to regular switch case 2022-08-22 13:25:59 +02:00
Riyyi 2a234fabfd Emulator: Add opcode LDH or LD 0xff00 2022-08-22 13:25:59 +02:00
Riyyi 07345d0552 Emulator: Add some more opcodes 2022-08-22 13:10:30 +02:00
Riyyi 7689efeb44 Meta: Allow single line short case labels in .clang-format 2022-08-22 12:49:44 +02:00
Riyyi 6a44e48244 Doc: Add reference section to terminology.org, add links to mnemonics 2022-08-22 11:47:55 +02:00
Riyyi 4cc21a1c3a Doc: Add document that describes the GameBoy terminology 2022-08-22 11:33:09 +02:00
Riyyi ab5d9cbe69 Emulator: Fix loading 16-bit immediate value
The 8 lower bits are read first. The 8 higher bits come afterwards!
2022-08-21 23:41:26 +02:00
Riyyi 077ba70a16 Emulator: Read bootrom into memory space 2022-08-21 23:40:40 +02:00
Riyyi 5d89883d15 Emulator: Fix Emu memory writing 2022-08-21 22:17:58 +02:00
Riyyi 8768daabfe Emulator: Remove bootrom as separate Emu member variable 2022-08-21 21:13:16 +02:00
Riyyi e38e35ba81 Emulator: Add checks for undefined memory spaces 2022-08-21 20:59:14 +02:00
Riyyi dab457b31f Emulator: Be more const correct 2022-08-21 20:07:43 +02:00
Riyyi 46f3009124 Emulator: Add writing of ECHO RAM 2022-08-21 20:05:10 +02:00
Riyyi 65c3797030 Emulator: Fix memory end address for bootrom segment 1 2022-08-21 19:57:29 +02:00
Riyyi b6e075108e Emulator: Update calls for adding memory spaces 2022-08-21 19:55:18 +02:00
Riyyi 42e54f1344 Emulator: Add support for memory banks to memory spaces 2022-08-21 19:54:02 +02:00
Riyyi 687990edca Emulator: Add more opcodes, convenience functions 2022-08-20 20:24:59 +02:00
Riyyi aa15d9cd3f Doc: Reorder readme reference sections 2022-08-20 12:31:43 +02:00
Riyyi 379ff3babf Doc: Add bootrom section to readme 2022-08-20 12:27:43 +02:00
Riyyi cee8ffabb3 Emulator: Make memory spaces more accurate 2022-08-20 12:27:05 +02:00
Riyyi f6478da541 Emulator: Add copyright header to main, Emu 2022-08-20 11:06:51 +02:00
Riyyi 895b54e927 Emulator: Add opcode function to lookup table 2022-08-20 03:56:31 +02:00