Ran cargo-fix to automatically fix most of the build warnings,
Cleaned up dead code, and fix the rest manually
Former-commit-id: f35faba46b40eaf9c047efb8ab1e77ffa24d41b6
Move reload_pipeline calls inside instructions.
This commit yeilds yet another 5% performance improvment.
The next step is to move `advance_pc` into the instructions themselves
and save the `match result` per executed instruction
Former-commit-id: 42193ffc48fda9943665e6a74e873186627a0b4a
In preperation for later optimization in the CPU pipeline
implementation, this commit refactors the arm/thumb exec functions to return a
CpuAction (Whether to advance the program counter or to flush the
pipeline)
Currently, a lot of host cycles are wasted in the arm7tdmi pipeline
Refill1 & Refill2 states. Optimizing these steps out would make the CPU
a bit faster.
Former-commit-id: 9be7966eaad22cceeb443fcc5823bbd945284027
This commit removes the error handling (CpuResult<>) in order to reduce
overhead in the cpu implementation.
Also, some cleanup of warning messages.
Notice: this commit breaks '--feature debugger' for now
Former-commit-id: d4484047c3f5d509eff89cef7090aa88b07a8d17
The docs state: "If a register is used to specify the shift amount the PC will be 12 bytes ahead"
I probably misread that when implementing DataProcessing instructions,
and because of that added 4 bytes to (op1+8) when shift amount was specified by a rotated immediate.
Fixes#6 (and probably tons of other bugs too!)
Former-commit-id: 129f0951a6381221314c23a468c3da8b31435a30
1) Decouple SysBus from Gpu
2) Split Gpu rendering function into separate modules
3) Cleanup
Former-commit-id: 0435ad1c9c1de72ed50769fabfea7c5f33b670e0
Fix tons of bug and reimplemented some of the core code.
Add a neat feature for debug builds:
When the cpu "swi 0x55" instruction, a breakpoint is triggered on the
host.
Former-commit-id: 959249df4374327d90b2503d7a45f8d5d27995a6
The way cycles were counted up untill now was not accurate enough,
I've avoided doing so because the instruction implementation looks
bloated this way, but I've had problems with cycle accuracy with tonc's
timer demo.
This is not entirely correct though, and I'm 100% sure there are some
mistakes, but works good enough for now.
Former-commit-id: 748faaf99fe2f42925c0a2110192c6a01e5d27d4
This commit refactors the ioregs:
* Use bitfield crate to implement the GPU ioregs.
* IoRegs are stored in their own variables bindings (i.e, Gpu related ioregs are now fields of the Gpu struct)
- This optimize performance quiet alot from my testings - since every scanline was accessing deseralizing ioregs from sysbus. (Getting constant 59fps now)
* For now, comment out DMA model
Also, cleaned the code up to eliminate rustc warnings.
Former-commit-id: 9077695c446ebd1a71783acfdd9819245aa02d7a