Road toward uxnfor
This commit is contained in:
parent
3872c8d272
commit
98eb9cf1f7
|
@ -28,7 +28,7 @@
|
||||||
;on-mouse-body .Mouse/vector DEO2
|
;on-mouse-body .Mouse/vector DEO2
|
||||||
;on-frame .Screen/vector DEO2
|
;on-frame .Screen/vector DEO2
|
||||||
;on-control .Controller/vector DEO2
|
;on-control .Controller/vector DEO2
|
||||||
( let's go! )
|
( | let's go! )
|
||||||
file-init
|
file-init
|
||||||
draw-header
|
draw-header
|
||||||
#00 change-page
|
#00 change-page
|
||||||
|
@ -159,9 +159,9 @@ BRK
|
||||||
|
|
||||||
@insert ( char -- )
|
@insert ( char -- )
|
||||||
|
|
||||||
get-from scap/ get-page #1000 ADD2 LTH2 ?&has-space
|
get-from scap/ get-page #1000 ADD2 LTH2 ?{
|
||||||
POP JMP2r
|
POP JMP2r
|
||||||
&has-space
|
}
|
||||||
|
|
||||||
( | convert linebreaks )
|
( | convert linebreaks )
|
||||||
DUP #0d EQU #03 MUL SUB
|
DUP #0d EQU #03 MUL SUB
|
||||||
|
@ -340,9 +340,9 @@ JMP2r
|
||||||
@file-new ( -- )
|
@file-new ( -- )
|
||||||
|
|
||||||
#0801
|
#0801
|
||||||
&l
|
&>l ( -- )
|
||||||
#00 OVR #c0 SFT2 ;mem ADD2 STH2 #20 STH2r STA
|
#00 OVR #c0 SFT2 ;mem ADD2 STH2 #20 STH2r STA
|
||||||
INC GTHk ?&l
|
INC GTHk ?&>l
|
||||||
POP2
|
POP2
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
@ -361,10 +361,10 @@ JMP2r
|
||||||
.File/name DEO2
|
.File/name DEO2
|
||||||
#0001 .File/length DEO2
|
#0001 .File/length DEO2
|
||||||
[ LIT2r 0000 ]
|
[ LIT2r 0000 ]
|
||||||
&s
|
&>s ( -- )
|
||||||
;&b .File/read DEO2
|
;&b .File/read DEO2
|
||||||
[ LIT2 00 -File/success-lb ] DEI EQU ?&eof
|
[ LIT2 00 -File/success-lb ] DEI EQU ?&eof
|
||||||
INC2r !&s &eof
|
INC2r !&>s &eof
|
||||||
STH2r
|
STH2r
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
@ -373,9 +373,9 @@ JMP2r
|
||||||
@file-inject ( name* -- )
|
@file-inject ( name* -- )
|
||||||
|
|
||||||
DUP2 file-size
|
DUP2 file-size
|
||||||
ORAk ?&exists
|
ORAk ?{
|
||||||
POP2 POP2 JMP2r
|
POP2 POP2 JMP2r
|
||||||
&exists
|
}
|
||||||
STH2
|
STH2
|
||||||
.File/name DEO2
|
.File/name DEO2
|
||||||
STH2kr .File/length DEO2
|
STH2kr .File/length DEO2
|
||||||
|
@ -466,17 +466,17 @@ JMP2r
|
||||||
( | walk to line )
|
( | walk to line )
|
||||||
.Mouse/y DEI2 pos-to-line ,&line STR
|
.Mouse/y DEI2 pos-to-line ,&line STR
|
||||||
get-page
|
get-page
|
||||||
&walk-line
|
&>walk-line
|
||||||
.Screen/y DEI2 pos-to-line [ LIT &line $1 ] EQU ?&end-line
|
.Screen/y DEI2 pos-to-line [ LIT &line $1 ] EQU ?&end-line
|
||||||
walk-char POP
|
walk-char POP
|
||||||
INC2 LDAk ?&walk-line
|
INC2 LDAk ?&>walk-line
|
||||||
&end-line
|
&end-line
|
||||||
( | walk to char )
|
( | walk to char )
|
||||||
.Mouse/x DEI2 #0001 SUB2 ,&x STR2
|
.Mouse/x DEI2 #0001 SUB2 ,&x STR2
|
||||||
&walk-char
|
&>walk-char
|
||||||
.Screen/x DEI2 [ LIT2 &x $2 ] GTH2 ?&end-char
|
.Screen/x DEI2 [ LIT2 &x $2 ] GTH2 ?&end-char
|
||||||
walk-char ?&end-char
|
walk-char ?&end-char
|
||||||
INC2 LDAk ?&walk-char
|
INC2 LDAk ?&>walk-char
|
||||||
&end-char
|
&end-char
|
||||||
|
|
||||||
JMP2r
|
JMP2r
|
||||||
|
@ -543,9 +543,9 @@ JMP2r
|
||||||
@word-width ( str* -- length* )
|
@word-width ( str* -- length* )
|
||||||
|
|
||||||
[ LIT2r 0000 ]
|
[ LIT2r 0000 ]
|
||||||
&while
|
&>w ( -- )
|
||||||
LDAk char-width STH2 ADD2r
|
LDAk char-width STH2 ADD2r
|
||||||
INC2 LDAk #20 GTH ?&while
|
INC2 LDAk #20 GTH ?&>w
|
||||||
POP2
|
POP2
|
||||||
STH2r
|
STH2r
|
||||||
|
|
||||||
|
@ -554,10 +554,10 @@ JMP2r
|
||||||
@find-line-start ( addr* -- addr* )
|
@find-line-start ( addr* -- addr* )
|
||||||
|
|
||||||
;mem SWP2
|
;mem SWP2
|
||||||
&l
|
&>l ( -- )
|
||||||
#0001 SUB2 LDAk
|
#0001 SUB2 LDAk
|
||||||
DUP #0a EQU SWP #00 EQU ORA ?&end
|
DUP #0a EQU SWP #00 EQU ORA ?&end
|
||||||
LTH2k ?&l
|
LTH2k ?&>l
|
||||||
&end
|
&end
|
||||||
NIP2 INC2
|
NIP2 INC2
|
||||||
|
|
||||||
|
@ -566,10 +566,10 @@ JMP2r
|
||||||
@find-line-end ( addr* -- addr* )
|
@find-line-end ( addr* -- addr* )
|
||||||
|
|
||||||
get-eof SWP2
|
get-eof SWP2
|
||||||
&l
|
&>l ( -- )
|
||||||
LDAk #0a EQU ?&end
|
LDAk #0a EQU ?&end
|
||||||
LDAk #00 EQU ?&end
|
LDAk #00 EQU ?&end
|
||||||
INC2 GTH2k ?&l
|
INC2 GTH2k ?&>l
|
||||||
&end
|
&end
|
||||||
NIP2
|
NIP2
|
||||||
|
|
||||||
|
@ -578,9 +578,9 @@ JMP2r
|
||||||
@find-word-start ( addr* -- addr* )
|
@find-word-start ( addr* -- addr* )
|
||||||
|
|
||||||
;mem SWP2
|
;mem SWP2
|
||||||
&l
|
&>l ( -- )
|
||||||
#0001 SUB2 LDAk #21 LTH ?&end
|
#0001 SUB2 LDAk #21 LTH ?&end
|
||||||
LTH2k ?&l
|
LTH2k ?&>l
|
||||||
&end
|
&end
|
||||||
NIP2 INC2
|
NIP2 INC2
|
||||||
|
|
||||||
|
@ -589,9 +589,9 @@ JMP2r
|
||||||
@find-word-end ( addr* -- addr* )
|
@find-word-end ( addr* -- addr* )
|
||||||
|
|
||||||
get-eof SWP2
|
get-eof SWP2
|
||||||
&l
|
&>l ( -- )
|
||||||
LDAk #21 LTH ?&end
|
LDAk #21 LTH ?&end
|
||||||
INC2 GTH2k ?&l
|
INC2 GTH2k ?&>l
|
||||||
&end
|
&end
|
||||||
NIP2
|
NIP2
|
||||||
|
|
||||||
|
@ -615,10 +615,10 @@ JMP2r
|
||||||
#50 SFT2 ADD2 .Screen/addr DEO2
|
#50 SFT2 ADD2 .Screen/addr DEO2
|
||||||
[ LIT2 01 -Screen/sprite ] DEOk DEO
|
[ LIT2 01 -Screen/sprite ] DEOk DEO
|
||||||
( | lead )
|
( | lead )
|
||||||
#e9 &l
|
#e9 &>l ( -- )
|
||||||
;bar-icn/b .Screen/addr DEO2
|
;bar-icn/b .Screen/addr DEO2
|
||||||
[ LIT2 01 -Screen/sprite ] DEO
|
[ LIT2 01 -Screen/sprite ] DEO
|
||||||
INC DUP ?&l
|
INC DUP ?&>l
|
||||||
POP
|
POP
|
||||||
;bar-icn/b .Screen/addr DEO2
|
;bar-icn/b .Screen/addr DEO2
|
||||||
[ LIT2 01 -Screen/sprite ] DEOk DEO
|
[ LIT2 01 -Screen/sprite ] DEOk DEO
|
||||||
|
@ -652,7 +652,7 @@ JMP2r
|
||||||
#0008 .Screen/x DEO2
|
#0008 .Screen/x DEO2
|
||||||
#0018 .Screen/y DEO2
|
#0018 .Screen/y DEO2
|
||||||
get-page
|
get-page
|
||||||
&while
|
&>w ( -- )
|
||||||
( | draw char )
|
( | draw char )
|
||||||
DUP2 #0001 SUB2 LDA2 char-addr .Screen/addr DEO2
|
DUP2 #0001 SUB2 LDA2 char-addr .Screen/addr DEO2
|
||||||
is-selected STH #0701 STHr [ JMP SWP POP ] .Screen/sprite DEOk DEO
|
is-selected STH #0701 STHr [ JMP SWP POP ] .Screen/sprite DEOk DEO
|
||||||
|
@ -666,14 +666,14 @@ JMP2r
|
||||||
.Screen/x DEI2k #0008 SUB2 ROT DEO2
|
.Screen/x DEI2k #0008 SUB2 ROT DEO2
|
||||||
&block
|
&block
|
||||||
walk-char POP
|
walk-char POP
|
||||||
INC2 LDAk ?&while
|
INC2 LDAk ?&>w
|
||||||
POP2
|
POP2
|
||||||
|
|
||||||
@draw-footer ( -- )
|
@draw-footer ( -- )
|
||||||
|
|
||||||
.Screen/height DEI2 #0020 GTH2 ?&visible
|
.Screen/height DEI2 #0020 GTH2 ?{
|
||||||
JMP2r
|
JMP2r
|
||||||
&visible
|
}
|
||||||
[ LIT2 26 -Screen/auto ] DEO
|
[ LIT2 26 -Screen/auto ] DEO
|
||||||
#0000 .Screen/x DEO2
|
#0000 .Screen/x DEO2
|
||||||
.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
|
.Screen/height DEI2 #0020 SUB2 .Screen/y DEO2
|
||||||
|
@ -684,9 +684,9 @@ JMP2r
|
||||||
#0018 .Screen/x DEO2
|
#0018 .Screen/x DEO2
|
||||||
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
|
.Screen/height DEI2 #0008 SUB2 .Screen/y DEO2
|
||||||
;page-icn/bottom .Screen/addr DEO2
|
;page-icn/bottom .Screen/addr DEO2
|
||||||
#e7 &l
|
#e7 &>l ( -- )
|
||||||
[ LIT2 01 -Screen/sprite ] DEO
|
[ LIT2 01 -Screen/sprite ] DEO
|
||||||
INC DUP ?&l
|
INC DUP ?&>l
|
||||||
POP
|
POP
|
||||||
( | page number )
|
( | page number )
|
||||||
[ LIT2 15 -Screen/auto ] DEO
|
[ LIT2 15 -Screen/auto ] DEO
|
||||||
|
|
Loading…
Reference in New Issue