Skip to content

Commit

Permalink
Merge pull request #15 from mpostaire/dev
Browse files Browse the repository at this point in the history
MBC5 + MBC7 + HuC1 (no IR) + GB PRINTER + refactor
  • Loading branch information
mpostaire committed Sep 26, 2023
2 parents 355378c + 3ad1a36 commit b5f6231
Show file tree
Hide file tree
Showing 68 changed files with 3,931 additions and 3,217 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ all: desktop
debug: CFLAGS+=-g -O0
debug: all

desktop: CFLAGS+=$(shell pkg-config --cflags gtk4 libadwaita-1 manette-0.2 opengl glew openal x11)
desktop: LDLIBS+=$(shell pkg-config --libs gtk4 libadwaita-1 manette-0.2 opengl glew openal x11)
desktop: CFLAGS+=$(shell pkg-config --cflags gtk4 libadwaita-1 manette-0.2 opengl glew openal)
desktop: LDLIBS+=$(shell pkg-config --libs gtk4 libadwaita-1 manette-0.2 opengl glew openal)
desktop: $(PLATFORM_ODIR_STRUCTURE) $(BIN) $(ICONS)

$(SDIR)/platform/desktop/resources.c: $(SDIR)/platform/desktop/ui/gbmulator.gresource.xml $(UI) $(SHADERS)
Expand All @@ -68,7 +68,7 @@ profile: run
gprof ./$(BIN) gmon.out > prof_output

# TODO this should also make a gbmulator.apk file in this project root dir (next do the gbmulator desktop binary)
android: $(SDIR)/emulator/boot.c
android: $(SDIR)/core/boot.c
cd $(SDIR)/platform/android/android-project && ./gradlew assemble

debug_android: android
Expand Down Expand Up @@ -107,8 +107,8 @@ $(PLATFORM_ODIR_STRUCTURE):
mkdir -p $@

# Build boot roms (taken and modified from SameBoy emulator)
$(SDIR)/emulator/boot.c: $(ODIR)/bootroms/dmg_boot $(ODIR)/bootroms/cgb_boot
cd $(ODIR)/bootroms && xxd -i dmg_boot > ../../$(SDIR)/emulator/boot.c && xxd -i cgb_boot >> ../../$(SDIR)/emulator/boot.c
$(SDIR)/core/boot.c: $(ODIR)/bootroms/dmg_boot $(ODIR)/bootroms/cgb_boot
cd $(ODIR)/bootroms && xxd -i dmg_boot > ../../$(SDIR)/core/boot.c && xxd -i cgb_boot >> ../../$(SDIR)/core/boot.c

$(ODIR)/bootroms/gbmulator_logo.1bpp: $(SDIR)/bootroms/gbmulator_logo.png
-@mkdir -p $(dir $@)
Expand Down
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ You can compile and run it on your linux machine or use it in your browser [here
- PPU implements fifo rendering
- Audio
- Wireless link cable
- Support for MBC1, MBC1M, MBC2, MBC3, MBC30 and MBC5 cartridges
- Support for MBC1, MBC1M, MBC2, MBC3, MBC30, MBC5, MBC7 and HuC1 cartridges
- Battery saves and savestates
- Game Boy Printer emulation
- Supports keyboard and gamepad controllers

## Installation
Expand All @@ -29,7 +30,7 @@ Various dependencies are needed to build the desktop app:
- opengl
- glew
- openal
- libx11
- zlib (optional: enables compressed savestates)

In addition to these dependencies, the following tools are needed to build the desktop app:

Expand Down Expand Up @@ -81,14 +82,17 @@ There is also support for gamepad controllers.

### TODO

- implement MBC6, MBC7, HuC1 and multicart MBCs
- implement other MBCs
- implement printer
- implement GBC and HuC1 IR
- find out what are the accurate timings for the ppu pixel fifo/fetcher (especially for corner cases)
- better audio/video sync
- android link cable via bluetooth + cross platform link cable
- Maybe: web link cable using Emscripten WebSockets API (https://emscripten.org/docs/porting/networking.html and https://github.com/emscripten-core/emscripten/blob/main/system/include/emscripten/websocket.h. Example gist: https://gist.github.com/nus/564e9e57e4c107faa1a45b8332c265b9)
- rewrite Makefile (it's a mess) maybe use CMake instead

## Resources used

- https://gbdev.io/pandocs/
- http://marc.rawer.de/Gameboy/Docs/GBCPUman.pdf
- https://gekkio.fi/files/gb-docs/gbctr.pdf
Expand All @@ -97,3 +101,4 @@ There is also support for gamepad controllers.
- https://www.youtube.com/watch?v=HyzD8pNlpwI
- https://github.com/AntonioND/giibiiadvance/blob/master/docs/TCAGBD.pdf
- https://pixelbits.16-b.it/GBEDG/ppu/
- https://shonumi.github.io/articles/art2.html
Loading

0 comments on commit b5f6231

Please sign in to comment.