Ported devw/devr changes to uxn.c

This commit is contained in:
neauoire 2021-09-08 17:51:23 -07:00
parent b88d2adc3d
commit 266152e260
5 changed files with 18 additions and 18 deletions

View File

@ -33,6 +33,7 @@
|00 @System [ &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 ] |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 ] |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 ] |80 @Controller [ &vector $2 &button $1 &key $1 ]
|90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ] |90 @Mouse [ &vector $2 &x $2 &y $2 &state $1 &wheel $1 ]
@ -87,7 +88,7 @@ BRK
BANK2 STH2k GET-SIZE ++ STH2r BANK2 STH2k GET-SIZE ++ STH2r
&clear-loop &clear-loop
DUP2 #0000 SWP2 STA2 DUP2 #0000 SWP2 STA2
#0002 ++ GTH2k ,&clear-loop JCN INC2 INC2 GTH2k ,&clear-loop JCN
POP2 POP2 POP2 POP2
( run grid ) ( run grid )
@ -112,8 +113,7 @@ BRK
&copy-loop &copy-loop
DUP2 LDA2k DUP2 LDA2k
SWP2 #2000 -- STA2 SWP2 #2000 -- STA2
#0002 ++ INC2 INC2 GTH2k ,&copy-loop JCN
GTH2k ,&copy-loop JCN
POP2 POP2 POP2 POP2
;draw-grid JSR2 ;draw-grid JSR2

View File

@ -99,9 +99,9 @@ BRK
&loop &loop
.adsr-view/x2 LDZ2 #003a -- .Screen/x DEO2 .adsr-view/x2 LDZ2 #003a -- .Screen/x DEO2
#10 OVR - .Audio0/output DEI #0f AND < .Screen/pixel DEO #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 #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 INC GTHk ,&loop JCN
POP2 POP2

View File

@ -26,7 +26,7 @@ static Uint16 (*pop8)(Stack *s);
static Uint16 (*pop)(Stack *s); static Uint16 (*pop)(Stack *s);
static void (*poke)(Uint8 *m, Uint16 a, Uint16 b); static void (*poke)(Uint8 *m, Uint16 a, Uint16 b);
static Uint16 (*peek)(Uint8 *m, Uint16 a); 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 Uint16 (*devr)(Device *d, Uint8 a);
static void (*warp)(Uxn *u, Uint16 a); static void (*warp)(Uxn *u, Uint16 a);
static void (*pull)(Uxn *u); static void (*pull)(Uxn *u);

View File

@ -63,7 +63,7 @@ system_talk(Device *d, Uint8 b0, Uint8 w)
case 0xf: return 0; case 0xf: return 0;
} }
} }
return 1; return 1;
} }
static int static int
@ -71,7 +71,7 @@ console_talk(Device *d, Uint8 b0, Uint8 w)
{ {
if(w && b0 > 0x7) if(w && b0 > 0x7)
write(b0 - 0x7, (char *)&d->dat[b0], 1); write(b0 - 0x7, (char *)&d->dat[b0], 1);
return 1; return 1;
} }
static int static int
@ -91,7 +91,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w)
} }
poke16(d->dat, 0x2, result); poke16(d->dat, 0x2, result);
} }
return 1; return 1;
} }
static int static int
@ -111,7 +111,7 @@ datetime_talk(Device *d, Uint8 b0, Uint8 w)
d->dat[0xa] = t->tm_isdst; d->dat[0xa] = t->tm_isdst;
(void)b0; (void)b0;
(void)w; (void)w;
return 1; return 1;
} }
static int static int
@ -120,7 +120,7 @@ nil_talk(Device *d, Uint8 b0, Uint8 w)
(void)d; (void)d;
(void)b0; (void)b0;
(void)w; (void)w;
return 1; return 1;
} }
#pragma mark - Generics #pragma mark - Generics

View File

@ -306,7 +306,7 @@ system_talk(Device *d, Uint8 b0, Uint8 w)
if(b0 > 0x7 && b0 < 0xe) if(b0 > 0x7 && b0 < 0xe)
docolors(d); docolors(d);
} }
return 1; return 1;
} }
static int static int
@ -314,7 +314,7 @@ console_talk(Device *d, Uint8 b0, Uint8 w)
{ {
if(w && b0 > 0x7) if(w && b0 > 0x7)
write(b0 - 0x7, (char *)&d->dat[b0], 1); write(b0 - 0x7, (char *)&d->dat[b0], 1);
return 1; return 1;
} }
static int 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); ppu_1bpp(&ppu, layer, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] >> 0x4 & 0x1, d->dat[0xf] >> 0x5 & 0x1);
reqdraw = 1; reqdraw = 1;
} }
return 1; return 1;
} }
static int static int
@ -359,7 +359,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w)
} }
poke16(d->dat, 0x2, result); poke16(d->dat, 0x2, result);
} }
return 1; return 1;
} }
static int static int
@ -383,7 +383,7 @@ audio_talk(Device *d, Uint8 b0, Uint8 w)
SDL_UnlockAudioDevice(audio_id); SDL_UnlockAudioDevice(audio_id);
SDL_PauseAudioDevice(audio_id, 0); SDL_PauseAudioDevice(audio_id, 0);
} }
return 1; return 1;
} }
static int static int
@ -403,7 +403,7 @@ datetime_talk(Device *d, Uint8 b0, Uint8 w)
d->dat[0xa] = t->tm_isdst; d->dat[0xa] = t->tm_isdst;
(void)b0; (void)b0;
(void)w; (void)w;
return 1; return 1;
} }
static int static int
@ -412,7 +412,7 @@ nil_talk(Device *d, Uint8 b0, Uint8 w)
(void)d; (void)d;
(void)b0; (void)b0;
(void)w; (void)w;
return 1; return 1;
} }
#pragma mark - Generics #pragma mark - Generics