commit c8f47d8a0833afa96dd8501311f775bee5aadb25
parent 15239a1fd27eed85d22a2ff9cc25a61f26de3346
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date: Sun, 19 Sep 2021 22:53:45 +0100
Always return current PPU size when Screen/width,height is read
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/uxnemu.c b/src/uxnemu.c
@@ -343,8 +343,12 @@ console_talk(Device *d, Uint8 b0, Uint8 w)
static int
screen_talk(Device *d, Uint8 b0, Uint8 w)
{
- if(!w)
- return 1;
+ if(!w) switch(b0) {
+ 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;
+ }
else
switch(b0) {
case 0x3:
@@ -583,10 +587,6 @@ main(int argc, char **argv)
/* unused */ uxn_port(&u, 0xe, nil_talk);
/* unused */ uxn_port(&u, 0xf, nil_talk);
- /* Write screen size */
- poke16(devscreen->dat, 2, ppu.width);
- poke16(devscreen->dat, 4, ppu.height);
-
run(&u);
quit();
return 0;