... | ... |
@@ -193,9 +193,13 @@ doctrl(Uxn *u, SDL_Event *event, int z) |
193 | 193 |
void |
194 | 194 |
system_talk(Device *d, Uint8 b0, Uint8 w) |
195 | 195 |
{ |
196 |
- if(!w) return; |
|
197 |
- putcolors(&ppu, &d->dat[0x8]); |
|
198 |
- reqdraw = 1; |
|
196 |
+ if(!w) { |
|
197 |
+ d->dat[0x2] = d->u->wst.ptr; |
|
198 |
+ d->dat[0x3] = d->u->rst.ptr; |
|
199 |
+ } else { |
|
200 |
+ putcolors(&ppu, &d->dat[0x8]); |
|
201 |
+ reqdraw = 1; |
|
202 |
+ } |
|
199 | 203 |
(void)b0; |
200 | 204 |
} |
201 | 205 |
|
... | ... |
@@ -183,6 +183,7 @@ portuxn(Uxn *u, Uint8 id, char *name, void (*talkfn)(Device *d, Uint8 b0, Uint8 |
183 | 183 |
{ |
184 | 184 |
Device *d = &u->dev[id]; |
185 | 185 |
d->addr = id * 0x10; |
186 |
+ d->u = u; |
|
186 | 187 |
d->mem = u->ram.dat; |
187 | 188 |
d->talk = talkfn; |
188 | 189 |
printf("Device added #%02x: %s, at 0x%04x \n", id, name, d->addr); |