Added stack pointer position readouts to system device
This commit is contained in:
parent
d343865471
commit
f7506a41c7
|
@ -193,9 +193,13 @@ doctrl(Uxn *u, SDL_Event *event, int z)
|
||||||
void
|
void
|
||||||
system_talk(Device *d, Uint8 b0, Uint8 w)
|
system_talk(Device *d, Uint8 b0, Uint8 w)
|
||||||
{
|
{
|
||||||
if(!w) return;
|
if(!w) {
|
||||||
putcolors(&ppu, &d->dat[0x8]);
|
d->dat[0x2] = d->u->wst.ptr;
|
||||||
reqdraw = 1;
|
d->dat[0x3] = d->u->rst.ptr;
|
||||||
|
} else {
|
||||||
|
putcolors(&ppu, &d->dat[0x8]);
|
||||||
|
reqdraw = 1;
|
||||||
|
}
|
||||||
(void)b0;
|
(void)b0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -183,6 +183,7 @@ portuxn(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *d, Uint8 b0, Uint8
|
||||||
{
|
{
|
||||||
Device *d = &u->dev[id];
|
Device *d = &u->dev[id];
|
||||||
d->addr = id * 0x10;
|
d->addr = id * 0x10;
|
||||||
|
d->u = u;
|
||||||
d->mem = u->ram.dat;
|
d->mem = u->ram.dat;
|
||||||
d->talk = talkfn;
|
d->talk = talkfn;
|
||||||
printf("Device added #%02x: %s, at 0x%04x \n", id, name, d->addr);
|
printf("Device added #%02x: %s, at 0x%04x \n", id, name, d->addr);
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef struct {
|
||||||
struct Uxn;
|
struct Uxn;
|
||||||
|
|
||||||
typedef struct Device {
|
typedef struct Device {
|
||||||
|
struct Uxn *u;
|
||||||
Uint8 addr, dat[16], *mem;
|
Uint8 addr, dat[16], *mem;
|
||||||
void (*talk)(struct Device *d, Uint8, Uint8);
|
void (*talk)(struct Device *d, Uint8, Uint8);
|
||||||
} Device;
|
} Device;
|
||||||
|
|
Loading…
Reference in New Issue