UnityHawk lets you run emulated games within a Unity project, using BizHawk.
Made as a tool for the development of plunderludics.
Only works on Windows currently.
Under development, may have bugs; issues, feature requests or contributions are welcome.
Add these two lines under dependencies
in your manifest.json
:
"org.plunderludics.unityhawk": "https://github.com/plunderludics/unity-hawk.git?path=/Packages/org.plunderludics.UnityHawk#upm"
"com.dbrizov.naughtyattributes": "https://github.com/dbrizov/NaughtyAttributes.git#upm"
Or, install using openupm-cli:
openupm add org.plunderludics.unityhawk
UnityHawk should then appear in the Package Manager window. From the Package Manager window you can import the sample called Demo
for a simple example of how to use this package.
You will probably also need to install the BizHawk prerequisites, which can be installed via this installer.
Emulator
component to an object with an attached Renderer
.Emulator.Texture
property.Emulator
component provides an interface to basic Bizhawk API methods: Pause()
, Unpause()
, FrameAdvance()
, LoadState(path)
, SaveState(path)
, LoadRom(path)
. Path argument should be relative to Assets/StreamingAssets/
. Use the ApiControls
component to use these methods directly from the Editor.unityhawk.callmethod(methodName, argString)
method to send and receive information from Unity. The method must be registered on the Unity side using Emulator.RegisterMethod
. See test.lua
and RegisterMethodExample
in the Demo
sample for a brief example.The Emulator
component spawns EmuHawk.exe
as a child process which shares graphics and audio with Unity via shared memory.
UnityHawk uses a modified fork of BizHawk which is here: https://github.com/plunderludics/bizhawk/tree/unity-hawk
The included demo scene contains this shader, this model of a TV, and a rom of Elite for the NES.
If you want help setting up the tool, or you are interested in contributing, or have any other questions, feel free to join our discord: https://discord.gg/ATJSh8W8dp.