0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-26 15:53:01 +00:00

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 ]
|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

View file

@ -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

View file

@ -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);

View file

@ -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

View file

@ -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