2bd8b56bc6
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 |
||
---|---|---|
.vscode | ||
img | ||
src | ||
.gitignore | ||
.travis.yml | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
README.md |
RustBoyAdvance-NG
RustBoyAdvance-NG aims to be a Nintendo GameBoy Advance emulator and debugger, written in the rust programming language.
RustBoyAdvance-NG currently has implemented
- Dumbed-down ARM/THUMB mode disassembling
- Some ARM/THUMB instruction are implemented, but not all of them.
- A neat debugger REPL
But the way for full emulation is way far ahead, because most of the ARM/THUMB instructions are not yet implemented.
Using the REPL
You need to have rust installed, and somehow legally obtain a gba bios binary. Currently to test the debugger, any binary file containing arm mode instructions will do.
$ cargo run -- debug
Why is this project needed ?
It's actually not. There are quite a lot of GBA emulators, and even some written in rust. Actually, I couldn't find any game capable emulators written in rust.
I'm only doing this as a side project intended for learning rust.
This is my third take on this project. My first go at this was about 3 years ago, but I didn't like rust much at the time so it got abandoned. I tried to resurrect it a year ago but didn't have the time to get invested in a side-project, let alone learning rust.
I've grown to like rust a lot since then, so here we go again. You know what they say, third time's a charm.
Links
- ARM7TDMI Technical Reference Manual Technical Reference Manuals are fun.
- GBATEK A single webpage written by no$gba developer Martin Korth. This page has pretty much everything. Seriously, it's the best.
- NanoboyAdvance] A GameBoy Advance emulator written in C++17 by a nice person called fleroviux. I've used this emulator to search for a tough bug in mine.