increase border size and fix small selection bug

This commit is contained in:
~d6 2023-02-17 10:53:22 -05:00
parent 617a1fab72
commit 2cf76e8afb
1 changed files with 19 additions and 10 deletions

View File

@ -138,7 +138,8 @@
#0000 .cur-y STZ2 #0000 .cur-y STZ2
( start cursor at origin - including border ) ( start cursor at origin - including border )
#0008 ( border ) DUP2 .Screen/x DEO2 .Screen/y DEO2 #0010 ( border ) .Screen/x DEO2
#0010 ( border ) .Screen/y DEO2
( confirm no buttons pressed yet ) ( confirm no buttons pressed yet )
#00 .lastkey STZ #00 .lastkey STZ
@ -199,8 +200,8 @@
.cols LDZ2 #0001 SUB2 .max-x STZ2 .cols LDZ2 #0001 SUB2 .max-x STZ2
( set screen height/width based on rows/cols ) ( set screen height/width based on rows/cols )
.cols LDZ2 #30 SFT2 ( width ) #0010 ADD2 .Screen/w DEO2 .cols LDZ2 #30 SFT2 ( width ) #0020 ( 2xborder ) ADD2 .Screen/w DEO2
.rows LDZ2 #000c MUL2 ( height ) #0010 ADD2 .Screen/h DEO2 .rows LDZ2 #000c MUL2 ( height ) #0020 ( 2xborder ) ADD2 .Screen/h DEO2
JMP2r JMP2r
@shell "bash 00 "-i 00 00 @shell "bash 00 "-i 00 00
@ -271,9 +272,9 @@
&pointer-ok &pointer-ok
.dirty LDZ #00 EQU ?&done .dirty LDZ #00 EQU ?&done
LIT2r =cells ( [addr*] ) LIT2r =cells ( [addr*] )
.rows LDZ2 #0000 DUP2 #0008 ( border ) ADD2 .Screen/y DEO2 .rows LDZ2 #0000 DUP2 #0010 ( border ) ADD2 .Screen/y DEO2
&yloop &yloop
.cols LDZ2 #0000 DUP2 #0008 ( border ) ADD2 .Screen/x DEO2 .cols LDZ2 #0000 DUP2 #0010 ( border ) ADD2 .Screen/x DEO2
&xloop &xloop
STH2kr LDA2 draw-cell erase-fg-cell STH2kr LDA2 draw-cell erase-fg-cell
.Screen/x DEI2k #0008 ( width ) ADD2 ROT DEO2 .Screen/x DEI2k #0008 ( width ) ADD2 ROT DEO2
@ -295,8 +296,8 @@
redraw-selection !clear-selection redraw-selection !clear-selection
@screen-to-cell ( row* col* -> ) @screen-to-cell ( row* col* -> )
#30 SFT2 ( width ) #0008 ( border ) ADD2 .Screen/x DEO2 #30 SFT2 ( width ) #0010 ( border ) ADD2 .Screen/x DEO2
#000c MUL2 ( height ) #0008 ( border ) ADD2 .Screen/y DEO2 #000c MUL2 ( height ) #0010 ( border ) ADD2 .Screen/y DEO2
JMP2r JMP2r
@screen-to-cursor ( -> ) @screen-to-cursor ( -> )
@ -386,14 +387,19 @@
GTH2k ?&xloop ( yn* y* xlim* x+1* [addr+2*] ) GTH2k ?&xloop ( yn* y* xlim* x+1* [addr+2*] )
POP2 POP2 ( yn* y* [addr+2*] ) POP2 POP2 ( yn* y* [addr+2*] )
.Screen/y DEI2k #000c ADD2 ROT DEO2 ( yn* y* [addr+2*] ) .Screen/y DEI2k #000c ADD2 ROT DEO2 ( yn* y* [addr+2*] )
#0008 .Screen/x DEO2 ( yn* y* [addr+2*] ) #0010 ( border ) .Screen/x DEO2 ( yn* y* [addr+2*] )
LIT2r 0000 INC2 GTH2k ?&yloop ( yn* y+1* [addr+2* 0*] ) LIT2r 0000 INC2 GTH2k ?&yloop ( yn* y+1* [addr+2* 0*] )
POP2 POP2 POP2r POP2r ( ) POP2 POP2 POP2r POP2r ( )
JMP2r ( ) JMP2r ( )
@y-point-to-row ( y* -> row* )
#0010 LTH2k ?&y0 SUB2 #000c DIV2 .max-y LDZ2 !min &y0 POP2 POP2 #0000 JMP2r
@x-point-to-col ( x* -> col* )
#0010 LTH2k ?&x0 SUB2 #0008 DIV2 .max-x LDZ2 !min &x0 POP2 POP2 #0000 JMP2r
@point-to-coord ( x* y* -> row* col* ) @point-to-coord ( x* y* -> row* col* )
DUP2 #0008 SUB2 min #000c DIV2 .max-y LDZ2 min SWP2 ( row=(y-8)/12* x* ) y-point-to-row SWP2 !x-point-to-col
DUP2 #0008 SUB2 min #03 SFT2 .max-x LDZ2 !min ( row* col=(x-8)/8* )
@start-selection ( -> ) @start-selection ( -> )
#01 .is-lit STZ ( ) #01 .is-lit STZ ( )
@ -895,8 +901,11 @@
DUP #08 EQU ?read-bs DUP #08 EQU ?read-bs
DUP #09 EQU ?read-tab DUP #09 EQU ?read-tab
DUP #0a EQU ?read-nl DUP #0a EQU ?read-nl
DUP #0b EQU ?read-nl
DUP #0c EQU ?read-nl
DUP #0d EQU ?read-cr DUP #0d EQU ?read-cr
DUP #1b EQU ?read-esc DUP #1b EQU ?read-esc
POP BRK
@read-bel ( 07 -> BRK ) @read-bel ( 07 -> BRK )
POP .visual-bell LDZ #00 EQU ?&done POP .visual-bell LDZ #00 EQU ?&done