Merge commit 'ee638b70e5' into varvara
This commit is contained in:
commit
fcb04138fa
|
@ -1,17 +0,0 @@
|
|||
( dev/console )
|
||||
|
||||
|10 @Console $8 &write
|
||||
|
||||
( init )
|
||||
|
||||
|0100 ( -> )
|
||||
|
||||
;hello-word
|
||||
&while
|
||||
( send ) LDAk .Console/write DEO
|
||||
INC2 LDAk ,&while JCN
|
||||
POP2
|
||||
|
||||
BRK
|
||||
|
||||
@hello-word "Hello 20 "Uxn!
|
|
@ -90,11 +90,6 @@ system_deo(Device *d, Uint8 port)
|
|||
switch(port) {
|
||||
case 0x2: d->u->wst.ptr = d->dat[0x2]; break;
|
||||
case 0x3: d->u->rst.ptr = d->dat[0x3]; break;
|
||||
case 0xe:
|
||||
inspect(&d->u->wst, "Working-stack");
|
||||
inspect(&d->u->rst, "Return-stack");
|
||||
break;
|
||||
case 0xf: return;
|
||||
}
|
||||
if(port > 0x7 && port < 0xe)
|
||||
set_palette(&d->dat[0x8]);
|
||||
|
@ -102,10 +97,9 @@ system_deo(Device *d, Uint8 port)
|
|||
|
||||
static Uint8 system_dei(Device *d, Uint8 port) {
|
||||
switch(port) {
|
||||
case 0x2: d->dat[0x2] = d->u->wst.ptr; break;
|
||||
case 0x3: d->dat[0x3] = d->u->rst.ptr; break;
|
||||
case 0x2: return d->u->wst.ptr; break;
|
||||
case 0x3: return d->u->rst.ptr; break;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* taken from uxncli */
|
||||
|
@ -123,10 +117,11 @@ static Uint8
|
|||
screen_dei(Device *d, Uint8 port)
|
||||
{
|
||||
switch(port) {
|
||||
case 0x2: d->dat[0x2] = ppu.width >> 8; break;
|
||||
case 0x3: d->dat[0x3] = ppu.width; break;
|
||||
case 0x4: d->dat[0x4] = ppu.height >> 8; break;
|
||||
case 0x5: d->dat[0x5] = ppu.height; break;
|
||||
case 0x2: return ppu.width >> 8; break;
|
||||
case 0x3: return ppu.width; break;
|
||||
case 0x4: return ppu.height >> 8; break;
|
||||
case 0x5: return ppu.height; break;
|
||||
default: return d->dat[port];
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
@ -198,17 +193,20 @@ datetime_dei(Device *d, Uint8 port)
|
|||
{
|
||||
struct tm* t = rb->get_time();
|
||||
t->tm_year += 1900;
|
||||
poke16(d->dat, 0x0, t->tm_year);
|
||||
d->dat[0x2] = t->tm_mon;
|
||||
d->dat[0x3] = t->tm_mday;
|
||||
d->dat[0x4] = t->tm_hour;
|
||||
d->dat[0x5] = t->tm_min;
|
||||
d->dat[0x6] = t->tm_sec;
|
||||
d->dat[0x7] = t->tm_wday;
|
||||
poke16(d->dat, 0x08, t->tm_yday);
|
||||
d->dat[0xa] = t->tm_isdst;
|
||||
(void)port;
|
||||
return 1;
|
||||
switch(port) {
|
||||
case 0x0: return t->tm_year >> 8;
|
||||
case 0x1: return t->tm_year;
|
||||
case 0x2: return t->tm_mon;
|
||||
case 0x3: return t->tm_mday;
|
||||
case 0x4: return t->tm_hour;
|
||||
case 0x5: return t->tm_min;
|
||||
case 0x6: return t->tm_sec;
|
||||
case 0x7: return t->tm_wday;
|
||||
case 0x8: return t->tm_yday >> 8;
|
||||
case 0x9: return t->tm_yday;
|
||||
case 0xa: return t->tm_isdst;
|
||||
default: return d->dat[port];
|
||||
}
|
||||
}
|
||||
|
||||
// TODO mono and greyscale that don't suck
|
||||
|
|
Loading…
Reference in New Issue