Commit Graph

323 Commits

Author SHA1 Message Date
Jeffrey Pfau 8aeafeb762 ARM7: PSR mode bits should not get sign extended 2016-11-30 16:18:02 -08:00
Jeffrey Pfau a0d223eef7 Debugger: Modularize CLI debugger 2016-10-25 21:12:35 -07:00
Jeffrey Pfau 805ef9efdd ARM Debugger: Fix clearing software breakpoints 2016-09-17 12:41:31 -07:00
Jeffrey Pfau 5486e013e0 Debugger: Fix setting software breakpoints 2016-09-15 09:33:13 -07:00
Jeffrey Pfau c45d91d311 Debugger: Add software breakpoints, fix cleanup 2016-09-07 17:49:27 -07:00
Jeffrey Pfau 2ed7d51376 ARM7: Fix decoding of Thumb ADD (variants 5 and 6) 2016-07-31 00:27:16 -07:00
Jeffrey Pfau 6b1cbbd5e2 ARM7: Fix setting spsr privilege bits when spsr is empty 2016-06-10 10:18:21 -07:00
Jeffrey Pfau b1b5cf8a11 ARM7: Clean up instruction decoding for future expandability 2016-06-06 22:08:19 -07:00
Jeffrey Pfau feb5ad2260 ARM7: Fix flags on SBC/RSC 2016-05-20 19:02:15 -07:00
Jeffrey Pfau e81de71f50 ARM7: Flush prefetch cache when loading CPSR via MSR 2016-05-16 01:18:09 -07:00
Jeffrey Pfau b5ff48a74e ARM7: Support forcing Thumb mode via MSR 2016-05-12 00:19:24 -07:00
Jeffrey Pfau 2d1ad16e1c ARM7: Improve decoder for memory access 2016-05-11 23:12:03 -07:00
Jeffrey Pfau 0fa6da495d All move around debugger files a bit 2016-05-08 00:52:15 -07:00
Jeffrey Pfau d6fce03fa3 All: Fix instruction tables getting zeroed when linking sometimes 2016-05-03 22:01:37 -07:00
Jeffrey Pfau 4b4be372c0 All: Fix some warnings 2016-04-29 00:20:45 -07:00
Jeffrey Pfau 37a0839a25 Debugger: Some memory debugger fixes 2016-04-29 00:17:43 -07:00
Jeffrey Pfau c03f9bcc03 Debugger: Fix identifier lookup 2016-04-25 22:44:44 -07:00
Jeffrey Pfau 1cc0bdeec1 Debugger: Refactor large portions of debugger to allow for multiplatform 2016-04-25 21:49:29 -07:00
Jeffrey Pfau fbfbbbf279 Core: Merge ARMComponent and LR35902Component 2016-02-10 22:40:21 -08:00
Jeffrey Pfau 7e6f9f2092 ARM7: Fix typo that invoked undefined behavior 2016-01-16 10:06:01 -08:00
Jeffrey Pfau 1fa904878b ARM7: Fix decoding of some ARM ALU instructions with shifters 2016-01-12 21:11:50 -08:00
Jeffrey Pfau 5c007289e4 GBA: Add extra data section to the end of savestates 2015-12-28 03:26:17 -05:00
Jeffrey Pfau 6604afb670 ARM7: Fix bank switching with LDR[B]T/STR[B]T 2015-11-22 02:31:13 -08:00
Jeffrey Pfau bb79334856 ARM7: Implement more undefined load/store forms 2015-11-22 01:42:58 -08:00
Jeffrey Pfau b67e4b5d78 ARM7: Implement undefined STRH/LDRH versions 2015-11-20 19:11:02 -08:00
Jeffrey Pfau fad1daf3e9 ARM7: Fix STRT/STRBT 2015-11-20 19:10:17 -08:00
Jeffrey Pfau 4bd7a65432 ARM7: Fix sign of unaligned LDRSH 2015-11-06 21:03:52 -08:00
Jeffrey Pfau c27dde73e7 ARM7: Fix regression with Thumb branches 2015-10-21 19:57:29 -07:00
Jeffrey Pfau a442933bbf All: Fix some undefined behavior warnings 2015-10-20 22:30:24 -07:00
Jeffrey Pfau 47eabe1bc7 ARM7: Fix instruction decoding of Thumb shifts 2015-10-08 19:52:38 -07:00
Jeffrey Pfau 3a15553c09 All: Reset next event to cycles instead of zero to interrupt 2015-10-05 19:20:17 -07:00
Jeffrey Pfau 6ba239d3f3 ARM7: Combine shifter-immediate and shifter-register functions to reduce binary size 2015-08-23 07:21:14 -07:00
Jeffrey Pfau ae1fecd4c8 ARM7: Fix decoding some more load/store instructions 2015-08-15 18:03:49 -07:00
Jeffrey Pfau 56208521d6 ARM7: Fix decoding LDR3 2015-07-13 01:15:59 -07:00
Jeffrey Pfau 908e61f415 All: Add clang-format options and run them 2015-06-29 20:45:08 -07:00
Lioncash 3736462c14 arm: ARMHotplugDetach should call deinit. 2015-06-29 03:17:04 -04:00
Jeffrey Pfau 051af279c9 GBA Memory: Implement game pak prefetch approximation 2015-06-22 00:27:21 -07:00
Jeffrey Pfau bdb7635156 ARM7: Reduce the size of the Thumb instruction table 2015-06-21 16:19:23 -07:00
Jeffrey Pfau d524148469 ARM7: Add emulation for Undefined CPU mode 2015-06-19 00:59:52 -07:00
Jeffrey Pfau 910ff621b3 ARM7: Fix timing of multiplies to use N cycles 2015-06-12 03:26:50 -07:00
Jeffrey Pfau c79780f832 ARM7: Fix Thumb MUL timing 2015-05-29 01:45:27 -07:00
Jeffrey Pfau 6b06579277 All: Move most macros back into common.h 2015-05-29 00:17:04 -07:00
Jeffrey Pfau 32d1f5bbfb ARM7: Fix ARM multiply instructions when PC is a destination register 2015-05-09 13:40:58 -07:00
Jeffrey Pfau ec14557a1e ARM7: Make illegal instruction decoding consistent between ARM and Thumb 2015-05-09 00:23:56 -07:00
Jeffrey Pfau ebcb344d64 ARM7: Handle writeback for PC in addressing modes 2 and 3 2015-05-08 01:23:44 -07:00
Jeffrey Pfau 97479c4d00 ARM7: Fix SWI and IRQ timings 2015-04-05 18:06:31 -07:00
Jeffrey Pfau 45473bf7bc ARM7: Fix cycle counting for loads 2015-03-27 21:21:17 -07:00
Jeffrey Pfau 8eeaa11256 ARM7: Add ARMRunFake for rolling back the PC and running a fake opcode 2015-02-04 23:30:04 -08:00
Jeffrey Pfau f9110fc51e ARM7: Make component numbers be size_t instead of int 2015-02-04 02:35:30 -08:00
Jeffrey Pfau 56291e63e5 Debugger: Add support for soft breakpoints 2015-02-03 03:12:04 -08:00
Jeffrey Pfau 8caf58ee42 ARM7: Add function for turning r15 into the address of the current instruction 2015-02-03 03:12:04 -08:00
Jeffrey Pfau e85e8968f2 ARM7: Tidy up decoder MSR and MRS instructions 2015-01-26 01:42:21 -08:00
Jeffrey Pfau 96bc5b9bc7 Debugger: Disassembly now lists PSR bitmasks (fixes #191) 2015-01-26 01:41:06 -08:00
Jeffrey Pfau 6d43fb7890 Debugger: Merge Thumb BL instructions when disassembling (fixes #133) 2015-01-18 13:28:58 -08:00
Jeffrey Pfau 293831e3bf ARM: Fix some decoder errors 2015-01-10 14:19:05 -08:00
Jeffrey Pfau 6d18b9aea5 GBA Memory: Simplify memory API and use fixed bus width 2015-01-10 01:20:21 -08:00
Jeffrey Pfau f9120b842f ARM: Create component hotplugging and use it for attaching and detaching the debugger 2015-01-07 02:05:04 -08:00
Jeffrey Pfau a6f895da7d Debugger: Align PC-relative loads in Thumb 2014-12-25 04:17:32 -08:00
Jeffrey Pfau 0a3cf87745 Debugger: Negative PC-relative loads now properly subtract the offset 2014-12-20 15:10:54 -08:00
Jeffrey Pfau 28ac288d2c ARM7: Extend prefetch by one stage 2014-12-20 05:19:16 -08:00
Jeffrey Pfau 3d21ce1fd0 ARM7: Fix LDM writeback to a register already written 2014-12-17 21:15:49 -08:00
Jeffrey Pfau f6a7fedb28 All: Add MPL 2.0 license and associated headers 2014-12-03 00:39:06 -08:00
Jeffrey Pfau 853bcec0c2 ARM: Use a more robust ROR idiom 2014-11-19 03:37:40 -08:00
Jeffrey Pfau 9e400e86da ARM: multiply wait macros should write to local variable instead of global cycle count 2014-11-19 03:37:40 -08:00
Jeffrey Pfau 3c41bd2427 ARM: Reduce size of ARM condition prediction 2014-11-19 03:37:40 -08:00
Jeffrey Pfau 845d6e1d24 ARM: Run tighter loop in CPU 2014-11-19 03:37:40 -08:00
Jeffrey Pfau 37554a40ea Add likely/unlikely macros 2014-11-18 04:37:17 -08:00
Jeffrey Pfau 6f4a6d6372 Debugger: Disassemble shifted registers in addressing mode 2 2014-11-15 17:16:11 -08:00
Jeffrey Pfau 8b44ea61ab Debugger: Fix *RBT being called *RTB 2014-11-15 17:04:34 -08:00
Jeffrey Pfau 5ace8e5023 Debugger: Fix ARM LDM/STM disassembling 2014-11-15 16:54:19 -08:00
Jeffrey Pfau 264f6f1df2 Debugger: disassemble register shifts 2014-11-15 16:32:38 -08:00
Jeffrey Pfau 537480b940 Load/Store multiple functions 2014-10-21 22:35:02 -07:00
Jeffrey Pfau f7b1cee66e Use branchType instead of branches in decoder for more expressive branch decoding 2014-10-21 00:45:06 -07:00
Jeffrey Pfau 6b382caa0f Fix decoding of {STR/LDR}[B]T 2014-10-19 03:45:11 -07:00
Jeffrey Pfau 4247db81e4 Split out macros from common.h 2014-10-11 18:18:47 -07:00
Jeffrey Pfau 8bbac2f512 Add __attribute__((unused)) to generated bitfield functions 2014-10-06 00:18:53 -07:00
Jeffrey Pfau f30a625b51 Reduce size of ARMInstructionInfo 2014-10-02 04:42:18 -07:00
Jeffrey Pfau 235141f1f3 Fix PSRs on some PPC compilers 2014-10-01 12:42:12 +00:00
Jeffrey Pfau d1f8e58b13 Attempt to stabilize PPC asm across compilers 2014-10-01 12:41:51 +00:00
Jeffrey Pfau 56a105e3da Fix addresses being truncated 2014-10-01 03:23:16 -07:00
Jeffrey Pfau 0a5a099059 Make PPC asm directives a bit more resilient to different compilers 2014-10-01 09:33:37 +00:00
Jeffrey Pfau 5afd8ea1bb The old implementation of endian swapping was sufficient, put it back 2014-10-01 00:57:52 -07:00
Jeffrey Pfau f4d27e5e40 Use new bitfields for DMAs 2014-10-01 00:17:51 -07:00
Jeffrey Pfau 7e4dc6c15c Replace dispstat assorted variables with a bitfield 2014-09-30 23:29:30 -07:00
Jeffrey Pfau 5874d416df Start replacing packed structs with flags 2014-09-30 22:50:27 -07:00
Jeffrey Pfau b6b1060676 Fix PPC asm directives on older GCCs 2014-09-30 22:03:49 -07:00
Jeffrey Pfau 6672aebfe4 Proper endian swapping on older PPC ISAs 2014-09-30 10:08:43 +00:00
Jeffrey Pfau 6cff3d423e Remove unnecessarily duplicated code in ARMStep 2014-08-29 01:41:32 -07:00
Jeffrey Pfau baa71027e3 Reimplement prefetch, temporarily removing busy loop optimization 2014-08-28 05:45:37 -07:00
Jeffrey Pfau 433f0ba360 Tighter looping for ARMRun 2014-08-28 05:00:38 -07:00
Jeffrey Pfau cbb522a702 Fix *mull, *mlal instructions in disassembler 2014-07-23 23:12:54 -07:00
Jeffrey Pfau 5477c891c5 Fix cmp and related opcodes in disassembler 2014-07-23 23:12:28 -07:00
Jeffrey Pfau 823b97603a Properly account for LDR I cycles (fixes #90) 2014-07-19 00:39:51 -07:00
Jeffrey Pfau 42484bbcc3 Allow save file to be specified externally 2014-07-16 02:57:04 -07:00
Jeffrey Pfau d8654f3b88 Use stdbool for readability 2014-07-16 01:02:34 -07:00
Jeffrey Pfau fce2fb9252 Move flags and masks into defines to avoid making enums with values that are too large 2014-07-15 23:38:44 -07:00
Jeffrey Pfau e89a705419 Revise macros for stricter C99 conformance 2014-07-15 23:30:55 -07:00
Jeffrey Pfau 939c349533 Slightly more accurate waitstate emulation 2014-07-13 22:21:37 -07:00
Jeffrey Pfau ca23c47aeb Add missing include 2014-07-13 05:47:16 -07:00
Jeffrey Pfau f74815988b Remove redundant includes 2014-07-12 04:43:41 -07:00
Jeffrey Pfau aefa5f0ab8 Merge branch 'decoder'
Conflicts:
	src/debugger/cli-debugger.c
2014-07-12 00:40:40 -07:00
Jeffrey Pfau 3261dd482c Fix should-be-zero operands being listed 2014-07-12 00:39:05 -07:00
Jeffrey Pfau b41e11d4c1 Decode MSR and MRS 2014-07-12 00:29:00 -07:00
Jeffrey Pfau a2eec31632 Show s flag for ARM instructions 2014-07-12 00:13:11 -07:00
Jeffrey Pfau d245eb3f88 Remove leftover code 2014-07-11 23:52:17 -07:00
Jeffrey Pfau 027a6f129c Fix ordering of flags and condition 2014-07-11 23:31:46 -07:00
Jeffrey Pfau a09d8649ee Begin work on ARM disassembler 2014-07-11 03:50:29 -07:00
Jeffrey Pfau ba4874f8b7 Cleaning up writeback and add some TODOs 2014-07-11 03:19:02 -07:00
Jeffrey Pfau 874f23fc59 Add mnemonics and fourth operand for ARM 2014-07-11 01:28:02 -07:00
Jeffrey Pfau 2b0dccb243 Fold direction into memory format 2014-07-11 01:27:32 -07:00
Jeffrey Pfau 45c6299b3b Fix decoding Thumb TST 2014-07-11 01:26:57 -07:00
Jeffrey Pfau 2921ba8842 Split ARM emitters into own file 2014-07-10 23:21:28 -07:00
Jeffrey Pfau fde2107a6b Fix disassembler memory boundary conditions 2014-07-10 03:31:24 -07:00
Jeffrey Pfau 64cc5ada86 Merge Thumb mnemonics into ARM mnemonics in preparation for ARM decoder 2014-07-10 03:30:59 -07:00
Jeffrey Pfau a22c89fedb Remove notion of special register 2014-07-10 02:33:16 -07:00
Jeffrey Pfau 55977796f3 Move UNUSED macro to common.h 2014-07-10 01:00:38 -07:00
Jeffrey Pfau ea656f188e Remove out-of-date TODO 2014-07-07 03:00:58 -07:00
Jeffrey Pfau e739e4000b Initialize halt 2014-04-20 01:05:29 -07:00
Jeffrey Pfau 9bf77f6653 Call ARMDeinit 2014-04-20 00:52:37 -07:00
Jeffrey Pfau 7a4ca414e5 Restructure watchpoints 2014-04-20 00:47:49 -07:00
Jeffrey Pfau 0f68dbc832 Redo component model/type punning 2014-04-20 00:19:55 -07:00
Jeffrey Pfau c0eb7c81f7 Remove ARMMemory and ARMBoard shims 2014-04-19 18:14:17 -07:00
Jeffrey Pfau 775e417cc6 Move halting functionality out of GBAHalt 2014-04-16 23:05:44 -07:00
Jeffrey Pfau ecb1939ff1 Move common headers to common.h, remove util and debugger from being first class include directories 2014-04-02 23:51:35 -07:00
Jeffrey Pfau fec4040691 Load/store with immediate width corrections 2014-03-29 23:08:32 -07:00
Jeffrey Pfau fc132b4d93 Some instructions can write to pc directly 2014-03-29 23:08:32 -07:00
Jeffrey Pfau 01d4672f56 Reclassify thumb load/store multiple instructions 2014-03-29 23:08:32 -07:00
Jeffrey Pfau 764d9740ee Fix exporting of ARMDecodeThumb 2014-03-29 23:08:32 -07:00
Jeffrey Pfau c8a2f595d4 Start cycle counting 2014-03-29 23:08:32 -07:00
Jeffrey Pfau 9b2cd97505 Split out decoder files in preparation of ARM decoder 2014-03-29 23:08:31 -07:00
Jeffrey Pfau c8e1a9cd59 PC-relative disassembling 2014-03-29 23:08:31 -07:00
Jeffrey Pfau 39e1a85ffc Implement memory decoding 2014-03-29 23:06:07 -07:00
Jeffrey Pfau f32155526b More thumb decompilation 2014-03-29 23:06:07 -07:00
Jeffrey Pfau e60cbfaf84 Begin disassembler 2014-03-29 23:06:07 -07:00
Jeffrey Pfau 58545f112e Rename decompiler to decoder 2014-03-29 22:59:40 -07:00
Jeffrey Pfau 65c1d67dfd Descriptions of all opcodes 2014-03-29 22:59:40 -07:00
Jeffrey Pfau 5d19919df2 Extract emittor macros into headers 2014-03-29 22:59:39 -07:00
Jeffrey Pfau 66d1c0c55c Start fleshing out decompiler 2014-03-29 22:59:39 -07:00
Jeffrey Pfau 5b91d6d336 Small framework for decompiler 2014-03-29 22:59:39 -07:00
Jeffrey Pfau 8e5b806cdd Have board re-read CPSR when it is modified by MSR 2014-01-27 00:21:14 -08:00
Jeffrey Pfau 2553b96e9b Skip table lookup in ARMStep if not needed 2014-01-21 23:15:51 -08:00
Jeffrey Pfau 52808da265 Inline CPU stepping 2014-01-21 22:36:40 -08:00
Jeffrey Pfau e7d4f3ae8a Fix MSR with immediate 2014-01-20 15:40:56 -08:00
Jeffrey Pfau 12f4ff6cbb Fix ARM_ROR 2014-01-20 15:40:44 -08:00
Jeffrey Pfau 2db6d27496 Implement SWP, SWPB 2014-01-20 15:19:52 -08:00
Jeffrey Pfau fede211874 Remove checks for ARM writeback operations that fail on real hardware 2014-01-20 15:10:41 -08:00
Jeffrey Pfau a969d70de3 Handle illegal and stub opcodes separately 2014-01-18 00:39:51 -08:00
Jeffrey Pfau 53a52d8cf8 Call setActiveRegion with the right address 2013-11-02 03:56:13 -07:00
Jeffrey Pfau 915b04dded Add support for PowerPC to the memory and CPU interfaces 2013-10-26 01:53:13 -04:00
Jeffrey Pfau a55b4dc87f Fix valgrind-found uninitialized values 2013-10-18 08:42:15 -07:00