- Bad LSR emulation caused an edge-case making allmost all of the game I tested fail to boot past intro.
- Incorrect sign extension of offset5 in THUMB caused bad address calculation.
Kirby boots with rendering glitches, I played past the first 2 boses
without crashes.
Former-commit-id: 8ea0ad6eb0f70e6dc23d1f2fcc44c8c0b3448fba
According to GBATEK:
The SAD, DAD, and CNT_L registers are holding the initial start
addresses, and initial length. The hardware does NOT change the content
of these registers during or after the transfer.
The actual transfer takes place by using internal pointer/counter
registers. The initial values are copied into internal regs under the
following circumstances:
Upon DMA Enable (Bit 15) changing from 0 to 1: Reloads SAD, DAD, CNT_L.
Upon Repeat: Reloads CNT_L, and optionally DAD (Increment+Reload).
Former-commit-id: 1e606dc88603a4600a79a341ef17fe8ccb482871
- 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
This fixes the glitch in dma_demo.gba where the rendering of the circle
was off by a scanline.
Former-commit-id: 907fefd548b6557ce46e06a99d0bc6ab83a8f332
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
I have fought very hard against the rust ownership model,
In the end for DMA to play nice with my code, I had to resort to use
unsafe code for now..
The DMA implementation itself is not accurate to say the least, but will
have to do for now.
Tonc's dma_demo.gba plays but with a visual glitch.
Former-commit-id: 3b9cdcb2d09c78701290f2c48b77f9f3487e85c9
Long story short, I've been hunting this bug for a while now.
While passing armwresteler tests, I still had an emulation bug which
causeed libgcc's iprintf to produce bugged strings.
In order to find it, I've used https://github.com/fleroviux/NanoboyAdvance/
And patched it to produce a formatted log of every step of the execution
of iprintf:
{OPCODE} {PC} {R0} {R1} ... {R14} {FLAGS}
Did the same on my emulator and searched for differences.
Found out the a "CMP r3, #0x0" instruction turned off the carry flag
when it shouldn't. Found this sad function, the check I'm using for
carry flag is meaningless when done on signed integers. :sigh:
Former-commit-id: 871d2581921796dae9bf4f5fdaa45c6ad46aebec
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
Not going through the memory mapping anymore.
Also, this commit wraps the gpu pixeldata with a struct
Former-commit-id: d7b706d9de61bac7909e10d6bbe092968e6acc9f