randrew / uxn32

Uxn emulator for Windows and Wine
175 stars 7 forks source link
c uxn win32 windows

Uxn32 - Uxn Emulator for Windows and Wine

Uxn32 is a graphical emulator for the Uxn virtual machine.

⬇️📦Download the latest Uxn32 Essentials Pack
Uxn32.exe plus a collection of pre-built ROMs ready to play.

Features

Use

Download the pre-built Uxn32 Essentials Pack - a bundle of Uxn32.exe and a collection of ROMs. Unzip into a new directory and run Uxn32.exe.

Shortcuts & Controls

F1  Toggle 1x and 2x zoom        F5  Show debugger
F2  Clone window & state         F7  Step debugger by 100 instructions
F3  Show/hide console            F8  Step debugger by 1 instruction
F4  Reset and reload ROM file    F9  Resume or pause emulation

Gamepad Keyboard Mapping

Control Key -> Gamepad 'A'
    Alt Key -> Gamepad 'B'
  Shift Key -> Gamepad 'Select'
   Home Key -> Gamepad 'Start'

Building

Windows

For VC6 and other old Microsoft IDEs and compilers, just open uxn32.dsp and hit build.

For later Visual Studio versions and MinGW, there is a CMakeLists.txt file to use with CMake. It's been tested to work with multiple different combinations of IDEs and toolchains, such as: CLion + MSVC, CLion + MinGW Clang, Qt Creator + MSVC, Qt Creator + MinGW Clang, Visual Studio Code with C/C++ extensions, standalone with Ninja or NMake and MSVC, and more.

VC6 is the easiest way to produce a .exe that works with old Windows versions and which doesn't require bundling .dll files or statically linking to large C runtimes.

Linux & Other UNIX

The easiest way to develop Uxn32 from within Linux is to use Winelib. This lets you use regular GCC or clang, and doesn't require installing MinGW. The output .exe will be ELF (Linux format) instead of PE (Windows format) so you can't copy it to a Windows system, but it will work great with Wine on Linux.

Make sure you have Wine installed, and also either gcc or clang installed, then do something like:

winemaker --wine32 uxn32.dsp
make

Then run it with wine Uxn32.exe. You can use gdb to debug it with winedbg Uxn32.exe. You might want to tweak the compiler flags in the generated Makefile to change optimization and debug symbol generation settings.

(Actually, if you use clang as your compiler with winegcc, and you have lld installed, you can manually invoke winegcc while adding the flags -b i386-pc-windows-msvc -Wl,/safeseh:no and then it will output a PE executable that will run on Windows. But it will probably only run on Windows 7 and later, because it links with ucrtbase.dll.)

If you want to use MinGW on a Linux host to produce an executable for Windows, you can do a similar invocation by hand, or try using CMake.

Other

Building with some other system or by hand is easy. There's only one resource file, uxn32.rc, and three source files, uxn32.c, uxn_lz.c, and uxn_core.c. You don't need any special compiler flags or preprocessor definitions. But you will need to link these libraries: user32.lib gdi32.lib shell32.lib shlwapi.lib comdlg32.lib comctl32.lib winmm.lib

Uxn32 TODO

License

ISC