Giter Club home page Giter Club logo

zba's Introduction

ZBA (working title)

A Game Boy Advance Emulator written in Zig ⚡!

ZBA running リズム天国

Scope

I'm hardly the first to write a Game Boy Advance Emulator nor will I be the last. This project isn't going to compete with the GOATs like mGBA or NanoBoyAdvance. There aren't any interesting ideas either like in DSHBA.

This is a simple (read: incomplete) for-fun long-term project. I hope to get "mostly there", which to me means that I'm not missing any major hardware features and the set of possible improvements would be in memory timing or in UI/UX. With respect to that goal, here's what's outstanding:

TODO

  • Affine Sprites
  • Windowing (see this branch)
  • Audio Resampler (Having issues with SDL2's)
  • Refactoring for easy-ish perf boosts

Usage

ZBA supports both a CLI and a GUI. If running from the terminal, try using zba --help to see what you can do. If you want to use the GUI, feel free to just run zba without any arguments.

ZBA does not feature any BIOS HLE, so providing one will be necessary if a ROM makes use of it. Need one? Why not try using the open-source Cult-Of-GBA BIOS written by fleroviux and DenSinH?

Finally it's worth noting that ZBA uses a TOML config file it'll store in your OS's data directory. See example.toml to learn about the defaults and what exactly you can mess around with.

Compiling

Most recently built on Zig v0.11.0

Dependencies

Dependency Source
known-folders https://github.com/ziglibs/known-folders
nfd-zig https://github.com/fabioarnold/nfd-zig
SDL.zig https://github.com/MasterQ32/SDL.zig
tomlz https://github.com/mattyhall/tomlz
zba-gdbstub https://github.com/paoda/zba-gdbstub
zba-util https://git.musuka.dev/paoda/zba-util
zgui https://github.com/michal-z/zig-gamedev/tree/main/libs/zgui
zig-clap https://github.com/Hejsil/zig-clap
zig-datetime https://github.com/frmdstryr/zig-datetime
bitfield.zig https://github.com/FlorenceOS/Florence
gl.zig https://github.com/MasterQ32/zig-opengl

Use git submodule update --init from the project root to pull the git relevant git submodules

Be sure to provide SDL2 using:

  • Linux: Your distro's package manager
  • macOS: ¯\_(ツ)_/¯ (try this formula?)
  • Windows: vcpkg (install sdl2:x64-windows)

SDL.zig will provide a helpful compile error if the zig compiler is unable to find SDL2.

Once you've got all the dependencies, execute zig build -Doptimize=ReleaseSafe. The executable will be under zig-out/bin and the shared libraries (if enabled) under zig-out/lib. If working with shared libraries on windows, be sure to add all artifacts to the same directory. On Unix, you'll want to make use of LD_PRELOAD.

Controls

Key Button Key Button
A L S R
X A Z B
Return Start RShift Select
Arrow Keys D-Pad

Tests

GBA Tests jsmolka gba_tests destoer
arm.gba, thumb.gba PASS cond_invalid.gba PASS
memory.gba, bios.gba PASS dma_priority.gba PASS
flash64.gba, flash128.gba PASS hello_world.gba PASS
sram.gba PASS if_ack.gba PASS
none.gba PASS line_timing.gba FAIL
hello.gba, shades.gba, stripes.gba PASS lyc_midline.gba FAIL
nes.gba PASS window_midframe.gba FAIL
GBARoms DenSinH GBA Test Collection ladystarbreeze
eeprom-test, flash-test PASS retAddr.gba PASS
midikey2freq PASS helloWorld.gba PASS
swi-tests-random FAIL helloAudio.gba PASS
FuzzARM DenSinH arm7wrestler GBA Fixed destoer
main.gba PASS armwrestler-gba-fixed.gba PASS

Resources

zba's People

Contributors

paoda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zba's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.