Always return current PPU size when Screen/width,height is read

This commit is contained in:
Andrew Alderwick 2021-09-19 22:53:45 +01:00
parent 15239a1fd2
commit c8f47d8a08
1 changed files with 6 additions and 6 deletions

View File

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