diff --git a/README.md b/README.md index a89f358..38b7143 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ An [8-bit stack-based computer](https://wiki.xxiivv.com/site/uxn.html), written ## Build -To build the Uxn emulator on Linux, you must have [SDL2](https://wiki.libsdl.org/) and [Portmidi](http://portmedia.sourceforge.net/portmidi/). +To build the Uxn emulator on Linux, you must have [SDL2](https://wiki.libsdl.org/). ```sh ./build.sh diff --git a/build.sh b/build.sh index aa2dcda..66fbd7e 100755 --- a/build.sh +++ b/build.sh @@ -25,12 +25,12 @@ if [ "${1}" = '--debug' ]; then echo "[debug]" cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined src/assembler.c -o bin/uxnasm - cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined src/uxn.c src/devices/ppu.c src/devices/apu.c src/devices/mpu.c src/emulator.c -L/usr/local/lib -lSDL2 -lportmidi -o bin/uxnemu + cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined src/uxn.c src/devices/ppu.c src/devices/apu.c src/devices/mpu.c src/emulator.c -L/usr/local/lib -lSDL2 -o bin/uxnemu cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werror=implicit-int -Werror=incompatible-pointer-types -Werror=int-conversion -Wvla -g -Og -fsanitize=address -fsanitize=undefined src/uxn.c src/debugger.c -o bin/debugger else cc src/assembler.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o bin/uxnasm cc src/uxn.c src/debugger.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -o bin/debugger - cc src/uxn.c src/devices/ppu.c src/devices/apu.c src/devices/mpu.c src/emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -lportmidi -o bin/uxnemu + cc src/uxn.c src/devices/ppu.c src/devices/apu.c src/devices/mpu.c src/emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/uxnemu fi echo "Installing.." @@ -42,7 +42,7 @@ then fi echo "Assembling.." -./bin/uxnasm projects/examples/devices/screen.usm bin/boot.rom +./bin/uxnasm projects/examples/devices/controller.buttons.usm bin/boot.rom echo "Running.." if [ "${2}" = '--cli' ]; diff --git a/src/devices/mpu.c b/src/devices/mpu.c index 19d6bde..bca2b82 100644 --- a/src/devices/mpu.c +++ b/src/devices/mpu.c @@ -15,6 +15,7 @@ WITH REGARD TO THIS SOFTWARE. int initmpu(Mpu *m, Uint8 device) { + /* int i; Pm_Initialize(); for(i = 0; i < Pm_CountDevices(); ++i) @@ -25,12 +26,14 @@ initmpu(Mpu *m, Uint8 device) Pm_OpenInput(&m->midi, device, NULL, 128, 0, NULL); m->queue = 0; m->error = pmNoError; + */ return 1; } void listenmpu(Mpu *m) { + /* const int result = Pm_Read(m->midi, m->events, 32); if(result < 0) { m->error = (PmError)result; @@ -38,4 +41,5 @@ listenmpu(Mpu *m) return; } m->queue = result; + */ } diff --git a/src/devices/mpu.h b/src/devices/mpu.h index 352b522..bd91c6f 100644 --- a/src/devices/mpu.h +++ b/src/devices/mpu.h @@ -1,6 +1,6 @@ #include #include -#include +/* #include */ /* Copyright (c) 2021 Devine Lu Linvega @@ -16,11 +16,17 @@ WITH REGARD TO THIS SOFTWARE. typedef unsigned char Uint8; +typedef struct { + int message; +} PmEvent; + typedef struct { Uint8 queue; - PmStream *midi; PmEvent events[32]; + /* + PmStream *midi; PmError error; + */ } Mpu; int initmpu(Mpu *m, Uint8 device);