Moved away from using lazy_static for this one since every access to a
lazy_static reference adds a runtime check, Currently using a build.rs script to generate a const table instead.
Worked out the ARM decoding issues, seems to run fine now.
Though the dynamic decoding for ARM is broken now since I had to change things in Data Processing and MSR instructions
TODO use `const fn` when it becomes stable
Former-commit-id: ba09748ff74a403c7016adcbe0ca553b591f6855
Lookup tables are generally faster than matching in most architectures.
There is some trouble in decoding some arm data processing instructions
so this is non-default feature for now
* Crashes on armwrestler but many games seem to work
Former-commit-id: 3c06ea344ae0097947d8cd5bd05b1f882c7f743a
Also, get rid of unnecessary derive Copy.
Since the ArmInstruction (and Thumb) derived from Copy, the compiler
always saves them to the stack when they are passed by value to other
functions, thus making some unwanted performance overhead.
I removed the derive Copy, and also pass them as references. This
project has a lot of "derive Copy" everywhere, and I should take note if
this is happenning elsewhere aswell.
Former-commit-id: 2f94c6050fa26c5b777244bd26706d4e6e2f0dc9
Initially I began implementing the gdb protocol on my own, but I then found a
nice work-in-progress crate on https://github.com/daniel5151/gdbstub
that suited my needs.
Former-commit-id: f77557cbbd8652c2ed05ac439efc1956d8e99729
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
1) Decouple SysBus from Gpu
2) Split Gpu rendering function into separate modules
3) Cleanup
Former-commit-id: 0435ad1c9c1de72ed50769fabfea7c5f33b670e0
Cleanup timer.rs
run cargo fmt
restore debugging continue&frame commands
Fix bug introduced in previous commit causing the bios animation to
hang
Former-commit-id: 188acaa1121503a97f2d3be816f6f57835e17fe1
- Add tracing of opcodes and potentially more stuff
- Add option to run a script file at the beginnig (I use it to redirect
traces to a file)
- Support breakpoints again
Former-commit-id: 4e988d6bc1a59456c96547f0320a6d9abedcae00
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