GitXplorerGitXplorer
n

rusty-boy-advance

public
14 stars
0 forks
8 issues

Commits

List of commits on branch master.
Unverified
e33c6255ee6f962280175f0397a30383948f8fbc

Fix DMAs not triggering when doing a 32bit write that had the upper 16bits write to the dma control register

nnico-abram committed 3 months ago
Unverified
0c8875701367539c802832633b5f5116cf366216

Improve scanline IRQ and draw timing, and halt cycle progress

nnico-abram committed 3 months ago
Unverified
fad415a212f431034c6af82721abf42944082feb

Change output buffer from rgb U8U8U8 to gba native u16 (U5U5U5) and perform the conversion in the frontend

nnico-abram committed 3 months ago
Unverified
5482fd7def47639a8f0cde3eac93b5209dc7d9c5

Add missing comment byte to ARM SWI instruction disasm

nnico-abram committed 3 months ago
Unverified
9f193a5c4823c1a0a6284877d181f409a8ce5974

Basic non-affine sprite drawing

nnico-abram committed 3 months ago
Unverified
2c54543dc9ca2b842d5407f925befb8b6461903b

Hacky ssprite debug view

nnico-abram committed 3 months ago

README

The README file for this repository.

Rusty Boy Advance

Build Status

docs

An attempt at a Game Boy Advance emulator in rust (Very much a WIP).

Progress

It can currently run some simple games, like Kirby Nightmare in Dreamland and Pokemon Mystery Dungeon, most of the tonc demos (With varying levels of correctness) and passes all of the armwrestler tests. It recently became able to boot Pokemon Ruby with lots of visual artifacts.

The CPU interpreter should have all the necessary instructions implemented.

Basic functionality that is missing:

  • BG mode 1 and 2 are not implemented at all (These have rotated backgrounds)
  • Affine sprites are not implemented at all
  • DMA's are very incomplete (Immediate DMAs should work, but triggering DMAs on hblank/vblank is not implemented)
  • Timing has not been tested at all, and is missing a lot of functionality (wait states, and the ROM prefetcher)
  • Timers are no implemented
  • Open bus behaviour is not implemented
  • Game pak SRAM is not implemented
  • Saves and save states are not implemented
  • Sound is not implemented
  • The disassembly is incomplete, mostly for the 32bit instructions. 16bit thumb disassembly is close to complete
  • Performance has not been optimized much at all

Possible future directions:

  • Implement a cached interpreter
  • Detect spin loops and don't execute them instruction by instruction
  • Improve memory accesses. Currently it uses a u8 byte array and most accesses go through a single read_byte function. Using a properly aligned array, we should be able to perform a single 32bit read for 32bit reads instead of 4 8bit reads. Maybe use a macro to avoid duplicating the address space match statement?
  • Make a better wasm frontend (Prettier webpage, possibly add debug tooling/output)

Screenshots

Useful references and tools

  • GBATEK
  • The arm7TDMI manual and the technical manual
  • The emulation development discord
  • This online disassembler that supports armv4t
  • This other online disassembler, which works better (The other one doesnt correctly respect the thumb setting all the time) and also has an assembler, but gets some opcodes wrong (Possibly because it's not specifically armv4)
  • This online hex editor
  • This cpu test rom called armwrestler.
  • The MGBA blog posts.
  • Tonc. This is intended for GBA programmers, but contains useful reading material and examples, which have been useful as small and simple ROMs for tests.
  • gbadoc
  • dearimgui
  • mesen2 is an awesome emulator which has a very complete debugger that can step backwards and has conditional breakpoints. It also has a debug view of tiles, backgrounds and sprites.