
Show HN: LuaGB – A Gameboy emulator written in pure Lua - zeta0134
https://github.com/zeta0134/LuaGB
======
zeta0134
One day when I was really bored in modded Minecraft, I thought it would be a
neat idea to see how far I could get writing a Gameboy emulator in
ComputerCraft. That idea fell apart shortly after I had a somewhat working z80
chip and realized that the graphics display wasn't possible, but I kept
working on the emulator over the course of a year, and this is the result.

It's not the fastest thing in the world, but my own machine manages to play
many games full speed, and it supports almost the full feature set of the
platform. I'm sure there are bugs, but I'm pretty happy with it overall.
Critique and especially bug reports are quite welcome! My own growing Gameboy
library is still quite small and I won't test games I don't own for legal
reasons.

~~~
Sunset
how "pure" is this. Can this be integrated somehow as a world of warcraft
extension, interface modules there are written in lua as well.

~~~
Jack5500
I seems to depend on the Löve Framework for actually drawing the emulation

~~~
cromo
This release does, yes. The actual emulation of the system is straight Lua and
does not require Löve at all. You could run the emulator completely headless
(as I was pestering zeta to do during development for testing), but there's
not yet a headless driver. This also means that you just have to provide the
hooks for drawing/sound/input/file IO to give it a different front end. Löve
is what was used because it's what we're familiar with.

------
cromo
I've been following the development of this for quite a while, and one feature
that is not erm, featured, is that the actual emulator itself is composed of
isolated modules. This means that it's possible to swap out say, the graphics
implementation to do a high definition drawer, or substitute the processor
with a plain Lua script - essentially, it turns the Gameboy itself into a
library! This could be used to make higher-level ROM hacks and patches without
needing to know the nitty-gritty of the whole system.

------
raker
This is really neat to see in Lua. The first(?) issue on the project
highlights this nicely:
[https://github.com/zeta0134/LuaGB/issues/1](https://github.com/zeta0134/LuaGB/issues/1)

I constantly underestimate the reach a project like this can have; in this
case, the possibility to reuse this base for other easily-portable emulators.

I've been following this project since it began, good luck once you start
tackling speed!

------
mrcactu5
what will be your strategy for maintaining this library?

------
kusmi
Speaking of, what's the status of LuaJIT?

