diff --git a/projects/examples/gui/picture.tal b/projects/examples/gui/picture.tal index 0446885..0878d68 100644 --- a/projects/examples/gui/picture.tal +++ b/projects/examples/gui/picture.tal @@ -6,7 +6,7 @@ ( devices ) |00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] -|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] +|20 @Screen [ &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1 ] |a0 @File [ &vector $2 &success $2 &offset-hs $2 &offset-ls $2 &name $2 &length $2 &load $2 &save $2 ] ( variables ) @@ -38,6 +38,19 @@ ( load ) ;chr2-path #0900 LOAD-IMAGE ( draw ) #0068 #0098 #0060 #0060 ;image #85 ;draw-chr JSR2 + + ( auto-x ) + #01 .Screen/auto DEO + #0070 .Screen/x DEO2 + #0070 .Screen/y DEO2 + ;checker-icn .Screen/addr DEO2 + #03 .Screen/sprite DEO + #03 .Screen/sprite DEO + #03 .Screen/sprite DEO + #03 .Screen/sprite DEO + #03 .Screen/sprite DEO + #00 .Screen/auto DEO + BRK @draw-icn ( x* y* width* height* addr* color -- ) diff --git a/src/uxnemu.c b/src/uxnemu.c index 5c32b5f..77fec17 100644 --- a/src/uxnemu.c +++ b/src/uxnemu.c @@ -324,8 +324,8 @@ screen_talk(Device *d, Uint8 b0, Uint8 w) Uint16 y = peek16(d->dat, 0xa); Uint8 layer = d->dat[0xe] & 0x40; ppu_pixel(&ppu, !!layer, x, y, d->dat[0xe] & 0x3); - if(d->dat[0x6] & 0x1) poke16(d->dat, 0x8, x + 1); /* auto x+1 */ - if(d->dat[0x6] & 0x2) poke16(d->dat, 0xa, y + 1); /* auto y+1 */ + if(d->dat[0x6] & 0x01) poke16(d->dat, 0x8, x + 1); /* auto x+1 */ + if(d->dat[0x6] & 0x02) poke16(d->dat, 0xa, y + 1); /* auto y+1 */ reqdraw = 1; } else if(w && b0 == 0xf) { Uint16 x = peek16(d->dat, 0x8); @@ -334,13 +334,13 @@ screen_talk(Device *d, Uint8 b0, Uint8 w) Uint8 *addr = &d->mem[peek16(d->dat, 0xc)]; if(d->dat[0xf] & 0x80) { ppu_2bpp(&ppu, !!layer, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20); - if(d->dat[0x6] & 0x3) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 16); /* auto addr+16 */ + if(d->dat[0x6] & 0x04) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 16); /* auto addr+16 */ } else { ppu_1bpp(&ppu, !!layer, x, y, addr, d->dat[0xf] & 0xf, d->dat[0xf] & 0x10, d->dat[0xf] & 0x20); - if(d->dat[0x6] & 0x3) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 8); /* auto addr+8 */ + if(d->dat[0x6] & 0x04) poke16(d->dat, 0xc, peek16(d->dat, 0xc) + 8); /* auto addr+8 */ } - if(d->dat[0x6] & 0x1) poke16(d->dat, 0x8, x + 8); /* auto x+8 */ - if(d->dat[0x6] & 0x2) poke16(d->dat, 0xa, y + 8); /* auto y+8 */ + if(d->dat[0x6] & 0x01) poke16(d->dat, 0x8, x + 8); /* auto x+8 */ + if(d->dat[0x6] & 0x02) poke16(d->dat, 0xa, y + 8); /* auto y+8 */ reqdraw = 1; } return 1;