uxn

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

commit 266152e26019e09d852c1609196ef40ad0d205b7
parent b88d2adc3d8c3193a5e61f35b91a3e50ca08596e
Author: neauoire <aliceffekt@gmail.com>
Date:   Wed,  8 Sep 2021 17:51:23 -0700

Ported devw/devr changes to uxn.c

Diffstat:
Mprojects/examples/demos/life.tal | 6+++---
Mprojects/examples/demos/piano.tal | 4++--
Msrc/uxn.c | 2+-
Msrc/uxncli.c | 10+++++-----
Msrc/uxnemu.c | 14+++++++-------
5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/projects/examples/demos/life.tal b/projects/examples/demos/life.tal @@ -33,6 +33,7 @@ |00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 ] |20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] +|30 @Audio0 [ &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1 ] |80 @Controller [ &vector $2 &button $1 &key $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] @@ -87,7 +88,7 @@ BRK BANK2 STH2k GET-SIZE ++ STH2r &clear-loop DUP2 #0000 SWP2 STA2 - #0002 ++ GTH2k ,&clear-loop JCN + INC2 INC2 GTH2k ,&clear-loop JCN POP2 POP2 ( run grid ) @@ -112,8 +113,7 @@ BRK &copy-loop DUP2 LDA2k SWP2 #2000 -- STA2 - #0002 ++ - GTH2k ,&copy-loop JCN + INC2 INC2 GTH2k ,&copy-loop JCN POP2 POP2 ;draw-grid JSR2 diff --git a/projects/examples/demos/piano.tal b/projects/examples/demos/piano.tal @@ -99,9 +99,9 @@ BRK &loop .adsr-view/x2 LDZ2 #003a -- .Screen/x DEO2 #10 OVR - .Audio0/output DEI #0f AND < .Screen/pixel DEO - .adsr-view/x2 LDZ2 #003a -- #0002 ++ .Screen/x DEO2 + .adsr-view/x2 LDZ2 #003a -- INC2 INC2 .Screen/x DEO2 #10 OVR - .Audio0/output DEI #04 SFT < .Screen/pixel DEO - .Screen/y DEI2 #0002 ++ .Screen/y DEO2 + .Screen/y DEI2 INC2 INC2 .Screen/y DEO2 INC GTHk ,&loop JCN POP2 diff --git a/src/uxn.c b/src/uxn.c @@ -26,7 +26,7 @@ static Uint16 (*pop8)(Stack *s); static Uint16 (*pop)(Stack *s); static void (*poke)(Uint8 *m, Uint16 a, Uint16 b); static Uint16 (*peek)(Uint8 *m, Uint16 a); -static void (*devw)(Device *d, Uint8 a, Uint16 b); +static int (*devw)(Device *d, Uint8 a, Uint16 b); static Uint16 (*devr)(Device *d, Uint8 a); static void (*warp)(Uxn *u, Uint16 a); static void (*pull)(Uxn *u); diff --git a/src/uxncli.c b/src/uxncli.c @@ -63,7 +63,7 @@ system_talk(Device *d, Uint8 b0, Uint8 w) case 0xf: return 0; } } - return 1; + return 1; } static int @@ -71,7 +71,7 @@ console_talk(Device *d, Uint8 b0, Uint8 w) { if(w && b0 > 0x7) write(b0 - 0x7, (char *)&d->dat[b0], 1); - return 1; + return 1; } static int @@ -91,7 +91,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w) } poke16(d->dat, 0x2, result); } - return 1; + return 1; } static int @@ -111,7 +111,7 @@ datetime_talk(Device *d, Uint8 b0, Uint8 w) d->dat[0xa] = t->tm_isdst; (void)b0; (void)w; - return 1; + return 1; } static int @@ -120,7 +120,7 @@ nil_talk(Device *d, Uint8 b0, Uint8 w) (void)d; (void)b0; (void)w; - return 1; + return 1; } #pragma mark - Generics diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -306,7 +306,7 @@ system_talk(Device *d, Uint8 b0, Uint8 w) if(b0 > 0x7 && b0 < 0xe) docolors(d); } - return 1; + return 1; } static int @@ -314,7 +314,7 @@ console_talk(Device *d, Uint8 b0, Uint8 w) { if(w && b0 > 0x7) write(b0 - 0x7, (char *)&d->dat[b0], 1); - return 1; + return 1; } static int @@ -337,7 +337,7 @@ screen_talk(Device *d, Uint8 b0, Uint8 w) ppu_1bpp(&ppu, layer, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] >> 0x4 & 0x1, d->dat[0xf] >> 0x5 & 0x1); reqdraw = 1; } - return 1; + return 1; } static int @@ -359,7 +359,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w) } poke16(d->dat, 0x2, result); } - return 1; + return 1; } static int @@ -383,7 +383,7 @@ audio_talk(Device *d, Uint8 b0, Uint8 w) SDL_UnlockAudioDevice(audio_id); SDL_PauseAudioDevice(audio_id, 0); } - return 1; + return 1; } static int @@ -403,7 +403,7 @@ datetime_talk(Device *d, Uint8 b0, Uint8 w) d->dat[0xa] = t->tm_isdst; (void)b0; (void)w; - return 1; + return 1; } static int @@ -412,7 +412,7 @@ nil_talk(Device *d, Uint8 b0, Uint8 w) (void)d; (void)b0; (void)w; - return 1; + return 1; } #pragma mark - Generics