uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 99721ecc55d5333cbaae8129aa1c84e9cc1e79cf
parent 9abcca773bf15f6907d16df10673ed9b9cb81b68
Author: neauoire <aliceffekt@gmail.com>
Date:   Fri, 21 May 2021 08:58:10 -0700

Removed portmidi temporarily

Diffstat:
MREADME.md | 2+-
Mbuild.sh | 6+++---
Msrc/devices/mpu.c | 4++++
Msrc/devices/mpu.h | 10++++++++--
4 files changed, 16 insertions(+), 6 deletions(-)

diff --git 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 @@ -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 @@ -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 @@ -1,6 +1,6 @@ #include <stdio.h> #include <stdlib.h> -#include <portmidi.h> +/* #include <portmidi.h> */ /* Copyright (c) 2021 Devine Lu Linvega @@ -17,10 +17,16 @@ 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);