diff --git a/etc/screen.bounds.tal b/etc/screen.bounds.tal index 701edb1..dd8dacb 100644 --- a/etc/screen.bounds.tal +++ b/etc/screen.bounds.tal @@ -9,6 +9,7 @@ #286c .System/g DEO2 #2358 .System/b DEO2 ;on-mouse .Mouse/vector DEO2 + BRK @on-mouse ( -> ) @@ -16,6 +17,7 @@ #0000 DUP2 .Screen/x DEO2 .Screen/y DEO2 #80 .Screen/pixel DEO + ( | cursor ) #41 ;cursor-icn ( | draw portrait ) @@ -47,6 +49,44 @@ #05 .Screen/sprite DEOk DEOk DEOk DEO JMP2r +@ ( color -- ) + #01 .Screen/auto DEO + ;circle-chr .Screen/addr DEO2 + DUP .Screen/sprite DEO + DUP #10 ORA .Screen/sprite DEO + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + DUP #20 ORA .Screen/sprite DEO + #30 ORA .Screen/sprite DEO + JMP2r + +@ ( -- ) + #0000 DUP2 .Screen/x DEO2 .Screen/y DEO2 + #f2 .Screen/auto DEO + ;guide-icn .Screen/addr DEO2 + #1000 + &l ( -- ) + #01 .Screen/sprite DEO + INC GTHk ?&l + POP2 + ( | circles ) + #0010 DUP2 .Screen/x DEO2 .Screen/y DEO2 + #02 + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #82 + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #05 + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #85 + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #03 + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #83 + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #0a + .Screen/y DEI2k #0008 ADD2 ROT DEO2 + #8a + JMP2r + @ ( color addr* -- ) [ LIT2 00 -Screen/auto ] DEO ;fill-icn .Screen/addr DEO2 @@ -61,6 +101,8 @@ .Screen/sprite DEO JMP2r +@guide-icn [ 0101 0101 0101 01ff ] + @fill-icn [ ffff ffff ffff ffff ] @cursor-icn [ 80c0 e0f0 f8e0 1000 ] @@ -93,3 +135,7 @@ 4142 4448 5020 1f00 0000 0000 0000 ff00 0000 0000 0000 ff00 8242 2212 0a04 f800 ] +@circle-chr [ + 071f 3c70 60e3 c7c7 0000 030f 1f1f 3f3f ] + + diff --git a/src/devices/screen.c b/src/devices/screen.c index c9c0c10..f5d7758 100644 --- a/src/devices/screen.c +++ b/src/devices/screen.c @@ -60,8 +60,8 @@ screen_2bpp(Uint8 *layer, Uint8 *ram, Uint16 addr, Uint16 x1, Uint16 y1, Uint16 { int width = uxn_screen.width, height = uxn_screen.height, opaque = (color % 5); Uint8 *ch1 = &ram[addr], *ch2 = ch1 + 8; - Uint16 y, ymod = (fy < 0 ? 8 : 0), ymax = y1 + ymod + fy * 8; - Uint16 x, xmod = (fx > 0 ? 8 : 0), xmax = x1 + xmod - fx * 8; + Uint16 y, ymod = (fy < 0 ? 7 : 0), ymax = y1 + ymod + fy * 8; + Uint16 x, xmod = (fx > 0 ? 7 : 0), xmax = x1 + xmod - fx * 8; for(y = y1 + ymod; y != ymax; y += fy) { Uint16 c = *ch1++ | (*ch2++ << 8); for(x = x1 + xmod; x != xmax; x -= fx, c >>= 1) { @@ -77,8 +77,8 @@ screen_1bpp(Uint8 *layer, Uint8 *ram, Uint16 addr, Uint16 x1, Uint16 y1, Uint16 { int width = uxn_screen.width, height = uxn_screen.height, opaque = (color % 5); Uint8 *ch1 = &ram[addr]; - Uint16 y, ymod = (fy < 0 ? 8 : 0), ymax = y1 + ymod + fy * 8; - Uint16 x, xmod = (fx > 0 ? 8 : 0), xmax = x1 + xmod - fx * 8; + Uint16 y, ymod = (fy < 0 ? 7 : 0), ymax = y1 + ymod + fy * 8; + Uint16 x, xmod = (fx > 0 ? 7 : 0), xmax = x1 + xmod - fx * 8; for(y = y1 + ymod; y != ymax; y += fy) { Uint16 c = *ch1++; for(x = x1 + xmod; x != xmax; x -= fx, c >>= 1) {