2021-11-08 13:54:21 -05:00
|
|
|
( launcher )
|
2021-09-21 12:44:10 -04:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
%2* { #10 SFT } %2/ { #01 SFT } %2** { #10 SFT2 } %2// { #01 SFT2 }
|
|
|
|
%4* { #20 SFT } %4/ { #02 SFT } %4** { #20 SFT2 } %4// { #02 SFT2 }
|
|
|
|
%8* { #30 SFT } %8/ { #03 SFT } %8** { #30 SFT2 } %8// { #03 SFT2 }
|
|
|
|
%10* { #40 SFT } %10/ { #04 SFT } %10** { #40 SFT2 } %10// { #04 SFT2 }
|
|
|
|
%20* { #50 SFT } %20/ { #05 SFT } %20** { #50 SFT2 } %20// { #05 SFT2 }
|
2021-11-07 16:23:33 -05:00
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
%40** { #60 SFT2 }
|
|
|
|
|
2021-09-21 12:44:10 -04:00
|
|
|
%RTN { JMP2r }
|
|
|
|
%TOS { #00 SWP }
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
%AUTO-NONE { #00 .Screen/auto DEO }
|
|
|
|
%AUTO-XADDR { #05 .Screen/auto DEO }
|
|
|
|
%AUTO-YADDR { #06 .Screen/auto DEO }
|
2021-11-09 02:06:19 -05:00
|
|
|
|
2022-01-08 17:00:33 -05:00
|
|
|
%HALT { #010f DEO }
|
|
|
|
%EMIT { #18 DEO }
|
|
|
|
%PRINT { ;print-str JSR2 #0a EMIT }
|
|
|
|
%DEBUG { ;print-hex/byte JSR2 #0a EMIT }
|
|
|
|
%DEBUG2 { ;print-hex JSR2 #0a EMIT }
|
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
%LINES-COUNT { .browser/y2 LDZ2 .browser/y LDZ2 SUB2 10// NIP }
|
2022-01-08 17:00:33 -05:00
|
|
|
|
2021-09-21 12:44:10 -04:00
|
|
|
( devices )
|
|
|
|
|
2021-11-08 13:54:21 -05:00
|
|
|
|00 @System &vector $2 &wst $1 &rst $1 &pad $4 &r $2 &g $2 &b $2 &debug $1 &halt $1
|
|
|
|
|10 @Console &vector $2 &read $1 &pad $5 &write $1 &error $1
|
|
|
|
|20 @Screen &vector $2 &width $2 &height $2 &auto $1 &pad $1 &x $2 &y $2 &addr $2 &pixel $1 &sprite $1
|
|
|
|
|30 @Audio0 &vector $2 &position $2 &output $1 &pad $3 &adsr $2 &length $2 &addr $2 &volume $1 &pitch $1
|
|
|
|
|80 @Controller &vector $2 &button $1 &key $1
|
2022-01-08 17:00:33 -05:00
|
|
|
|90 @Mouse &vector $2 &x $2 &y $2 &state $1 &pad $3 &scrollx $2 &scrolly $2
|
2021-11-08 13:54:21 -05:00
|
|
|
|a0 @File &vector $2 &success $2 &stat $2 &delete $1 &append $1 &name $2 &length $2 &read $2 &write $2
|
2022-03-17 14:57:22 -04:00
|
|
|
|c0 @DateTime &year $2 &month $1 &day $1 &hour $1 &minute $1 &second $1 &dotw $1 &doty $2 &isdst $1
|
2021-09-21 12:44:10 -04:00
|
|
|
|
|
|
|
( variables )
|
|
|
|
|
|
|
|
|0000
|
|
|
|
|
2021-09-21 13:45:56 -04:00
|
|
|
@pointer
|
|
|
|
&x $2 &y $2
|
2021-11-07 14:30:36 -05:00
|
|
|
@browser
|
2022-02-06 14:56:42 -05:00
|
|
|
&x $2 &y $2 &x2 $2 &y2 $2
|
2022-01-08 16:34:26 -05:00
|
|
|
&sel $1 &last $1 &scroll $1
|
2022-01-16 12:22:37 -05:00
|
|
|
&lines $1
|
2021-09-21 12:44:10 -04:00
|
|
|
|
|
|
|
( init )
|
|
|
|
|
|
|
|
|0100 ( -> )
|
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
( theme )
|
|
|
|
#f079 .System/r DEO2
|
|
|
|
#f0c2 .System/g DEO2
|
2022-01-08 20:22:04 -05:00
|
|
|
#f0a4 .System/b DEO2
|
2021-09-21 12:44:10 -04:00
|
|
|
|
|
|
|
( vectors )
|
2021-09-21 14:53:04 -04:00
|
|
|
;on-frame .Screen/vector DEO2
|
2021-09-21 12:44:10 -04:00
|
|
|
;on-button .Controller/vector DEO2
|
2021-09-21 13:45:56 -04:00
|
|
|
;on-mouse .Mouse/vector DEO2
|
2021-09-21 12:44:10 -04:00
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
( resize )
|
|
|
|
#0200 .Screen/width DEO2
|
|
|
|
#0140 .Screen/height DEO2
|
|
|
|
|
2022-01-15 14:15:47 -05:00
|
|
|
( asma debugger )
|
|
|
|
#0d ;asma/log-level STA
|
|
|
|
|
|
|
|
;asma-heap ;heap STA2
|
|
|
|
|
2021-11-07 15:55:26 -05:00
|
|
|
( setup synth )
|
2021-11-08 11:21:23 -05:00
|
|
|
#0102 .Audio0/adsr DEO2
|
2021-11-07 15:55:26 -05:00
|
|
|
;sin-pcm .Audio0/addr DEO2
|
|
|
|
#0100 .Audio0/length DEO2
|
|
|
|
#dd .Audio0/volume DEO ( TODO: turn ON )
|
|
|
|
|
2021-11-07 14:30:36 -05:00
|
|
|
( place )
|
2021-11-07 16:23:33 -05:00
|
|
|
#0088 .browser/x STZ2
|
2021-11-07 14:30:36 -05:00
|
|
|
#0010 .browser/y STZ2
|
2022-04-11 19:07:15 -04:00
|
|
|
.Screen/height DEI2 #33 SFT2 #0011 SUB2 .browser/y2 STZ2
|
2021-11-07 14:30:36 -05:00
|
|
|
|
|
|
|
( draw mascot )
|
|
|
|
#0010 #0010 #0060 #0060 ;mascot-icn #01 ;draw-icn JSR2
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
;load-dir JSR2
|
2021-11-07 14:30:36 -05:00
|
|
|
|
2021-09-21 13:45:56 -04:00
|
|
|
( theme support )
|
|
|
|
;load-theme JSR2
|
2021-11-07 14:30:36 -05:00
|
|
|
|
2021-11-08 13:54:21 -05:00
|
|
|
( force selection )
|
|
|
|
#ff .browser/last STZ
|
2021-11-07 16:23:33 -05:00
|
|
|
#00 ;select-file JSR2
|
|
|
|
|
2021-09-21 12:44:10 -04:00
|
|
|
BRK
|
|
|
|
|
2021-09-21 14:53:04 -04:00
|
|
|
@on-frame ( -> )
|
|
|
|
|
2021-11-08 14:02:29 -05:00
|
|
|
( unused )
|
2021-09-21 14:53:04 -04:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2021-09-21 13:45:56 -04:00
|
|
|
@on-mouse ( -> )
|
|
|
|
|
|
|
|
;pointer-icn .Screen/addr DEO2
|
|
|
|
( clear last cursor )
|
|
|
|
.pointer/x LDZ2 .Screen/x DEO2
|
|
|
|
.pointer/y LDZ2 .Screen/y DEO2
|
|
|
|
#40 .Screen/sprite DEO
|
|
|
|
|
|
|
|
( draw new cursor )
|
2021-11-08 14:02:29 -05:00
|
|
|
.Mouse/x DEI2 DUP2 .pointer/x STZ2 .Screen/x DEO2
|
|
|
|
.Mouse/y DEI2 DUP2 .pointer/y STZ2 .Screen/y DEO2
|
2022-04-11 19:07:15 -04:00
|
|
|
#41 .Mouse/state DEI #01 EQU ADD .Screen/sprite DEO
|
2021-09-21 13:45:56 -04:00
|
|
|
|
2022-01-08 17:00:33 -05:00
|
|
|
( wheel )
|
|
|
|
.Mouse/scrolly INC DEI
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP #ff NEQ ,&no-up JCN
|
|
|
|
.browser/scroll LDZ #00 EQU ,&no-up JCN
|
|
|
|
DUP .browser/scroll LDZ ADD ;scroll-to JSR2
|
2022-01-08 17:00:33 -05:00
|
|
|
&no-up
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP #01 NEQ ,&no-down JCN
|
|
|
|
.browser/scroll LDZ .browser/lines LDZ EQU ,&no-down JCN
|
|
|
|
DUP .browser/scroll LDZ ADD ;scroll-to JSR2
|
2022-01-08 17:00:33 -05:00
|
|
|
&no-down
|
|
|
|
POP
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
( within browser )
|
2022-04-11 19:07:15 -04:00
|
|
|
.Mouse/y DEI2 .browser/y LDZ2 LTH2 ,&outside JCN
|
|
|
|
.Mouse/y DEI2 .browser/y2 LDZ2 #0010 SUB2 GTH2 ,&outside JCN
|
2021-11-08 13:54:21 -05:00
|
|
|
( select choice )
|
2022-04-11 19:07:15 -04:00
|
|
|
.Mouse/y DEI2 .browser/y LDZ2 SUB2
|
|
|
|
10// NIP .browser/scroll LDZ ADD ;select-file JSR2
|
2022-01-08 16:34:26 -05:00
|
|
|
( run choice )
|
2022-04-11 19:07:15 -04:00
|
|
|
.Mouse/state DEI #00 EQU ,&no-click JCN
|
2021-11-08 13:54:21 -05:00
|
|
|
.browser/sel LDZ ;run-file JSR2
|
|
|
|
&no-click
|
2022-01-08 16:34:26 -05:00
|
|
|
&outside
|
|
|
|
|
2021-09-21 13:45:56 -04:00
|
|
|
BRK
|
|
|
|
|
2021-09-21 12:44:10 -04:00
|
|
|
@on-button ( -> )
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
( controller )
|
2021-11-07 15:55:26 -05:00
|
|
|
.Controller/button DEI
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP #10 NEQ ,&no-up JCN
|
|
|
|
.browser/sel LDZ #00 EQU ,&no-up JCN
|
|
|
|
.browser/sel LDZ #01 SUB ;select-file JSR2
|
2022-01-08 20:22:04 -05:00
|
|
|
;follow-selection JSR2
|
2021-11-08 14:02:29 -05:00
|
|
|
POP BRK
|
2021-11-07 15:55:26 -05:00
|
|
|
&no-up
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP #20 NEQ ,&no-down JCN
|
|
|
|
.browser/sel LDZ INC .browser/lines LDZ EQU ,&no-down JCN
|
2022-02-06 14:56:42 -05:00
|
|
|
.browser/sel LDZ INC ;select-file JSR2
|
2022-01-08 20:22:04 -05:00
|
|
|
;follow-selection JSR2
|
2021-11-08 14:02:29 -05:00
|
|
|
POP BRK
|
2021-11-07 15:55:26 -05:00
|
|
|
&no-down
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP #01 NEQ ,&no-a JCN
|
2022-02-06 14:56:42 -05:00
|
|
|
.browser/sel LDZ ;run-file JSR2
|
2021-11-08 14:02:29 -05:00
|
|
|
POP BRK
|
2021-11-07 16:23:33 -05:00
|
|
|
&no-a
|
2021-11-07 15:55:26 -05:00
|
|
|
POP
|
2022-01-08 16:34:26 -05:00
|
|
|
( keyboard )
|
2021-11-08 14:02:29 -05:00
|
|
|
.Controller/key DEI
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP #0d NEQ ,&no-enter JCN
|
2021-11-08 14:02:29 -05:00
|
|
|
.browser/sel LDZ ;run-file JSR2
|
2022-01-08 16:34:26 -05:00
|
|
|
POP BRK
|
2021-11-08 14:02:29 -05:00
|
|
|
&no-enter
|
|
|
|
POP
|
2021-09-21 12:44:10 -04:00
|
|
|
|
|
|
|
BRK
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
@load-dir ( -- )
|
2021-11-07 15:55:26 -05:00
|
|
|
|
|
|
|
;dir/path .File/name DEO2
|
|
|
|
#1000 .File/length DEO2
|
|
|
|
;dir/data .File/read DEO2
|
2022-01-08 16:34:26 -05:00
|
|
|
.File/success DEI2 ;dir/length STA2
|
2022-01-16 12:22:37 -05:00
|
|
|
#00 .browser/lines STZ
|
2021-11-07 15:55:26 -05:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
( split with null-char )
|
|
|
|
;dir/data
|
2021-11-07 15:55:26 -05:00
|
|
|
&while
|
2022-04-11 19:07:15 -04:00
|
|
|
LDAk #1f GTH ,&no-lb JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
( split ) STH2k #00 STH2r STA
|
2022-01-16 12:22:37 -05:00
|
|
|
( count lines ) .browser/lines LDZk INC SWP STZ
|
2022-01-08 16:34:26 -05:00
|
|
|
&no-lb
|
|
|
|
INC2 LDAk ,&while JCN
|
2021-11-07 15:55:26 -05:00
|
|
|
POP2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@select-file ( id -- )
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
( has changed )
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP .browser/last LDZ NEQ ,&has-changed JCN
|
2021-11-08 13:54:21 -05:00
|
|
|
POP RTN
|
|
|
|
&has-changed
|
2022-01-08 20:42:38 -05:00
|
|
|
( beyond )
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP .browser/lines LDZ LTH ,&valid JCN
|
2022-01-08 20:42:38 -05:00
|
|
|
POP RTN
|
|
|
|
&valid
|
2021-11-08 13:54:21 -05:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
#00 ;draw-browser JSR2
|
|
|
|
DUP .browser/sel STZ
|
|
|
|
DUP .browser/last STZ
|
2022-04-11 19:07:15 -04:00
|
|
|
#30 ADD .Audio0/pitch DEO
|
2022-01-08 16:34:26 -05:00
|
|
|
#01 ;draw-browser JSR2
|
2021-11-07 16:23:33 -05:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
( draw mascot )
|
2022-02-06 14:56:42 -05:00
|
|
|
#0010 #0010 #0060 #0060
|
2022-04-11 19:07:15 -04:00
|
|
|
;mascot-icn [ .browser/sel LDZ #03 AND TOS #0480 MUL2 ADD2 ] #01
|
2021-11-08 11:21:23 -05:00
|
|
|
;draw-icn JSR2
|
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
( draw position )
|
|
|
|
AUTO-YADDR
|
|
|
|
#0010 .Screen/x DEO2
|
|
|
|
#0080 .Screen/y DEO2
|
|
|
|
.browser/sel LDZ #02 ;draw-byte JSR2
|
|
|
|
LIT '/ #02 ;draw-char JSR2
|
2022-04-11 19:07:15 -04:00
|
|
|
.browser/lines LDZ #01 SUB #02 ;draw-byte JSR2
|
2022-01-08 20:22:04 -05:00
|
|
|
AUTO-NONE
|
|
|
|
|
2021-11-07 16:23:33 -05:00
|
|
|
RTN
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
@follow-selection ( -- )
|
2021-11-27 14:38:12 -05:00
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
LINES-COUNT .browser/sel LDZ .browser/scroll LDZ SUB
|
|
|
|
DUP2 GTH ,&no-down JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
.browser/scroll LDZ INC ,scroll-to JSR
|
2022-01-08 17:00:33 -05:00
|
|
|
&no-down
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP2 SWP LTH ,&no-up JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
.browser/sel LDZ ,scroll-to JSR
|
2022-01-08 17:13:36 -05:00
|
|
|
&no-up
|
2022-01-08 16:34:26 -05:00
|
|
|
POP2
|
2021-11-07 16:23:33 -05:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
@scroll-to ( line -- )
|
2022-01-08 17:00:33 -05:00
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
STH
|
|
|
|
( more lines than visible )
|
2022-02-06 14:56:42 -05:00
|
|
|
.browser/lines LDZ LINES-COUNT
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP2 GTH ,&can-scroll JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
POPr POP2 RTN
|
|
|
|
&can-scroll
|
|
|
|
( less than max scroll )
|
2022-04-11 19:07:15 -04:00
|
|
|
SUB INC STHkr GTH ,&valid-scroll JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
POPr RTN
|
2022-02-06 14:56:42 -05:00
|
|
|
&valid-scroll
|
2022-01-08 20:22:04 -05:00
|
|
|
#00 ;draw-browser JSR2
|
|
|
|
STHr .browser/scroll STZ
|
|
|
|
#01 ;draw-browser JSR2
|
2022-01-08 17:00:33 -05:00
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
RTN
|
2022-01-08 17:00:33 -05:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
@run-file ( id -- )
|
2021-11-07 16:23:33 -05:00
|
|
|
|
2022-01-21 23:44:29 -05:00
|
|
|
( release inputs )
|
|
|
|
#0000 .Controller/button DEO2
|
|
|
|
#00 .Mouse/state DEO
|
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
;get-entry JSR2 #0005 ADD2
|
2022-01-08 16:34:26 -05:00
|
|
|
|
|
|
|
DUP2 ;check-rom JSR2 ,&valid JCN
|
2022-01-15 14:15:47 -05:00
|
|
|
( check if tal file )
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP2 ;scap JSR2 #0004 SUB2 ;&tal-ext ;scmp JSR2 #01 NEQ ,&no-tal JCN
|
2022-01-16 12:22:37 -05:00
|
|
|
( assemble tal file )
|
2022-01-15 14:15:47 -05:00
|
|
|
DUP2 ;&output-path ;scpy JSR2
|
|
|
|
;&rom-ext ;&output-path ;scat JSR2
|
2022-02-06 14:56:42 -05:00
|
|
|
;&output-path ;asma-assemble-file JSR2
|
2022-01-15 14:15:47 -05:00
|
|
|
;load-dir JSR2
|
|
|
|
;redraw JSR2
|
|
|
|
RTN
|
|
|
|
&no-tal
|
2022-01-08 16:34:26 -05:00
|
|
|
POP2 RTN
|
|
|
|
&valid
|
2022-02-06 14:56:42 -05:00
|
|
|
;load-rom JSR2
|
2021-11-07 16:23:33 -05:00
|
|
|
|
2021-11-07 15:55:26 -05:00
|
|
|
RTN
|
2022-01-15 14:15:47 -05:00
|
|
|
&tal-ext ".tal $1
|
|
|
|
&rom-ext ".rom $1
|
|
|
|
&output-path $20
|
2021-11-07 15:55:26 -05:00
|
|
|
|
2021-09-21 14:53:04 -04:00
|
|
|
@redraw ( -- )
|
|
|
|
|
2022-01-15 14:15:47 -05:00
|
|
|
( force selection )
|
|
|
|
#ff .browser/last STZ
|
|
|
|
#00 ;select-file JSR2
|
2021-11-07 14:30:36 -05:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
@draw-browser ( mask -- )
|
2021-11-09 02:06:19 -05:00
|
|
|
|
2022-01-08 20:42:38 -05:00
|
|
|
( when empty )
|
2022-04-11 19:07:15 -04:00
|
|
|
.browser/lines LDZ #01 EQU ;draw-browser-empty JCN2
|
2022-01-08 20:42:38 -05:00
|
|
|
|
2021-11-09 02:06:19 -05:00
|
|
|
STH
|
2021-09-21 14:53:04 -04:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
( draw hand )
|
2022-04-11 19:07:15 -04:00
|
|
|
.browser/x LDZ2 #0018 SUB2 .browser/y LDZ2
|
|
|
|
.browser/sel LDZ .browser/scroll LDZ SUB TOS 10** ADD2
|
2022-02-06 14:56:42 -05:00
|
|
|
#0010 #0010
|
2022-04-11 19:07:15 -04:00
|
|
|
;hand-icn STHkr #02 MUL ;draw-icn JSR2
|
2022-01-08 16:34:26 -05:00
|
|
|
( draw files )
|
2022-01-08 17:00:33 -05:00
|
|
|
LINES-COUNT #00
|
2022-01-08 16:34:26 -05:00
|
|
|
&loop
|
2022-01-08 20:42:38 -05:00
|
|
|
( reached end )
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP INC .browser/lines LDZ GTH ,&end JCN
|
2022-01-08 20:42:38 -05:00
|
|
|
( has file )
|
2022-01-08 16:34:26 -05:00
|
|
|
.browser/x LDZ2 .Screen/x DEO2
|
2022-04-11 19:07:15 -04:00
|
|
|
#00 OVR 10** .browser/y LDZ2 ADD2 .Screen/y DEO2
|
|
|
|
DUP .browser/scroll LDZ ADD ;get-entry JSR2
|
2022-01-08 20:22:04 -05:00
|
|
|
DUP2 ;get-type JSR2 ;draw-type JSR2
|
2022-04-11 19:07:15 -04:00
|
|
|
#01 STHkr MUL ;draw-str JSR2
|
2022-01-08 16:34:26 -05:00
|
|
|
INC GTHk ,&loop JCN
|
2022-01-08 20:42:38 -05:00
|
|
|
&end
|
2021-11-27 14:38:12 -05:00
|
|
|
POP2
|
2022-01-08 16:34:26 -05:00
|
|
|
|
|
|
|
POPr
|
|
|
|
|
2021-11-27 14:38:12 -05:00
|
|
|
RTN
|
|
|
|
|
2022-01-08 20:42:38 -05:00
|
|
|
@draw-browser-empty ( mask -- )
|
|
|
|
|
|
|
|
POP
|
|
|
|
.browser/x LDZ2 .Screen/x DEO2
|
|
|
|
.browser/y LDZ2 .Screen/y DEO2
|
|
|
|
;&empty-txt #01 ;draw-str JSR2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
&empty-txt "Empty 20 "Folder $1
|
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
@get-type ( line* -- type )
|
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
;scap JSR2 #0004 SUB2 ;&rom-ext ;scmp JSR2
|
2022-01-08 20:22:04 -05:00
|
|
|
|
|
|
|
RTN
|
|
|
|
&rom-ext ".rom $1
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
@get-entry ( id -- addr* )
|
|
|
|
|
|
|
|
( limit ) STH
|
|
|
|
( counter ) LITr 00
|
|
|
|
;dir/length LDA2 #0000
|
|
|
|
&loop
|
2022-04-11 19:07:15 -04:00
|
|
|
EQUkr STHr #00 EQU ,&no-reached JCN
|
|
|
|
POP2r NIP2 ;dir/data ADD2 RTN
|
2022-01-08 16:34:26 -05:00
|
|
|
&no-reached
|
2022-04-11 19:07:15 -04:00
|
|
|
DUP2 ;dir/data ADD2 LDA #00 NEQ ,&no-lb JCN
|
2022-01-08 16:34:26 -05:00
|
|
|
INCr
|
|
|
|
&no-lb
|
|
|
|
INC2 GTH2k ,&loop JCN
|
|
|
|
POP2 POP2
|
|
|
|
POP2r
|
|
|
|
;dir/data
|
2021-09-21 14:53:04 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
@draw-type ( type -- )
|
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
STHk TOS 20** ;file-icns ADD2 .Screen/addr DEO2
|
2022-01-08 20:22:04 -05:00
|
|
|
AUTO-XADDR
|
2022-04-11 19:07:15 -04:00
|
|
|
#02 STHkr SUB .Screen/sprite DEOk DEO
|
2021-09-21 14:53:04 -04:00
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
.Screen/x DEI2k #0010 SUB2 ROT DEO2
|
|
|
|
.Screen/y DEI2k #0008 ADD2 ROT DEO2
|
2022-01-08 20:22:04 -05:00
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
#02 STHr SUB .Screen/sprite DEOk DEO
|
2022-01-08 20:22:04 -05:00
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
.Screen/x DEI2k #0008 ADD2 ROT DEO2
|
|
|
|
.Screen/y DEI2k #0008 SUB2 ROT DEO2
|
2022-01-08 20:22:04 -05:00
|
|
|
AUTO-NONE
|
2021-09-21 13:45:56 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-icn ( x* y* width* height* addr* color -- )
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
AUTO-XADDR
|
2021-09-21 13:45:56 -04:00
|
|
|
( load ) STH .Screen/addr DEO2 ,&height STR2 ,&width STR2 ,&y STR2 ,&x STR2
|
2022-02-06 14:56:42 -05:00
|
|
|
,&height LDR2 #0000
|
2021-09-21 13:45:56 -04:00
|
|
|
&ver
|
|
|
|
( save ) DUP2 ,&y LDR2 ADD2 .Screen/y DEO2
|
2022-01-08 16:34:26 -05:00
|
|
|
,&x LDR2 .Screen/x DEO2
|
2021-09-21 13:45:56 -04:00
|
|
|
,&width LDR2 #0000
|
|
|
|
&hor
|
|
|
|
( draw ) STHkr .Screen/sprite DEO
|
|
|
|
#0008 ADD2 GTH2k ,&hor JCN
|
|
|
|
POP2 POP2
|
|
|
|
#0008 ADD2 GTH2k ,&ver JCN
|
|
|
|
POP2 POP2
|
|
|
|
POPr
|
2022-01-08 16:34:26 -05:00
|
|
|
AUTO-NONE
|
2021-09-21 13:45:56 -04:00
|
|
|
|
|
|
|
RTN
|
|
|
|
&x $2 &y $2 &width $2 &height $2
|
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
@draw-str ( text* color -- )
|
2021-09-21 12:44:10 -04:00
|
|
|
|
2022-01-08 16:34:26 -05:00
|
|
|
AUTO-YADDR
|
|
|
|
STH
|
|
|
|
&while
|
|
|
|
LDAk STHkr ,draw-char JSR
|
|
|
|
INC2 LDAk ,&while JCN
|
|
|
|
POP2
|
|
|
|
POPr
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-short ( short* color -- )
|
|
|
|
|
|
|
|
STH SWP STHkr ,draw-byte JSR
|
|
|
|
STHr ,draw-byte JSR
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
|
|
|
@draw-byte ( byte color -- )
|
|
|
|
|
|
|
|
STH
|
|
|
|
DUP #04 SFT ,&parse JSR STHkr ,draw-char JSR
|
|
|
|
#0f AND ,&parse JSR STHr ,draw-char JSR
|
2021-09-21 12:44:10 -04:00
|
|
|
|
|
|
|
RTN
|
2022-02-06 14:56:42 -05:00
|
|
|
&parse ( byte -- char ) DUP #09 GTH ,&above JCN #30 ADD JMP2r
|
2022-01-08 16:34:26 -05:00
|
|
|
&above #57 ADD JMP2r
|
|
|
|
|
|
|
|
@draw-char ( char color -- )
|
|
|
|
|
|
|
|
SWP
|
2022-04-11 19:07:15 -04:00
|
|
|
[ #20 SUB #00 SWP #40 SFT2 ;font ADD2 ] .Screen/addr DEO2
|
2022-01-08 16:34:26 -05:00
|
|
|
.Screen/sprite DEOk DEO
|
2022-04-11 19:07:15 -04:00
|
|
|
.Screen/x DEI2k #0008 ADD2 ROT DEO2
|
|
|
|
.Screen/y DEI2k #0010 SUB2 ROT DEO2
|
2022-01-08 16:34:26 -05:00
|
|
|
|
|
|
|
JMP2r
|
2021-09-21 12:44:10 -04:00
|
|
|
|
2021-09-21 13:45:56 -04:00
|
|
|
( theme )
|
|
|
|
|
|
|
|
@theme-txt ".theme $1
|
|
|
|
|
|
|
|
@load-theme ( -- )
|
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
;theme-txt .File/name DEO2
|
|
|
|
#0006 .File/length DEO2
|
2021-11-07 14:10:30 -05:00
|
|
|
#fffa .File/read DEO2
|
2021-09-21 13:45:56 -04:00
|
|
|
|
2022-04-11 19:07:15 -04:00
|
|
|
.File/success DEI2 #0006 NEQ2 ,&ignore JCN
|
2021-09-21 13:45:56 -04:00
|
|
|
#fffa LDA2 .System/r DEO2
|
|
|
|
#fffc LDA2 .System/g DEO2
|
|
|
|
#fffe LDA2 .System/b DEO2
|
|
|
|
&ignore
|
|
|
|
;redraw JSR2
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2022-01-08 20:22:04 -05:00
|
|
|
( helpers )
|
|
|
|
|
|
|
|
@print-str ( string* -- )
|
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
#0001 SUB2
|
2022-01-08 20:22:04 -05:00
|
|
|
&while
|
2022-02-06 14:56:42 -05:00
|
|
|
INC2 LDAk DUP #18 DEO ,&while JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
POP2
|
|
|
|
|
|
|
|
JMP2r
|
|
|
|
|
|
|
|
@print-hex ( value* -- )
|
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
SWP ,&byte JSR
|
2022-01-08 20:22:04 -05:00
|
|
|
&byte ( byte -- )
|
|
|
|
STHk #04 SFT ,&parse JSR #18 DEO
|
|
|
|
STHr #0f AND ,&parse JSR #18 DEO
|
|
|
|
JMP2r
|
2022-02-06 14:56:42 -05:00
|
|
|
&parse ( byte -- char ) DUP #09 GTH ,&above JCN #30 ADD JMP2r
|
2022-01-08 20:22:04 -05:00
|
|
|
&above #57 ADD JMP2r
|
|
|
|
|
|
|
|
JMP2r
|
|
|
|
|
|
|
|
@scmp ( a* b* -- flag )
|
|
|
|
|
|
|
|
STH2
|
|
|
|
&loop
|
2022-04-11 19:07:15 -04:00
|
|
|
LDAk LDAkr STHr EQU ,¬-diff JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
POP2 POP2r #00 RTN
|
|
|
|
¬-diff
|
2022-04-11 19:07:15 -04:00
|
|
|
LDAk LDAkr STHr #0000 NEQ2 ,¬-end JCN
|
2022-01-08 20:22:04 -05:00
|
|
|
POP2 POP2r #01 RTN
|
|
|
|
¬-end
|
|
|
|
INC2 INC2r
|
|
|
|
,&loop JMP
|
|
|
|
POP2 POP2r #00
|
|
|
|
|
|
|
|
RTN
|
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
@scat ( src* dst* -- )
|
|
|
|
|
|
|
|
DUP2 ,slen JSR ADD2 ,scpy JSR
|
|
|
|
|
|
|
|
JMP2r
|
|
|
|
|
|
|
|
@slen ( str* -- len* )
|
|
|
|
|
|
|
|
DUP2 ,scap JSR SWP2 SUB2
|
|
|
|
|
|
|
|
JMP2r
|
|
|
|
|
|
|
|
@scap ( str* -- end* )
|
|
|
|
|
|
|
|
LDAk #00 NEQ JMP JMP2r
|
|
|
|
&while
|
|
|
|
INC2 LDAk ,&while JCN
|
|
|
|
|
|
|
|
JMP2r
|
|
|
|
|
2022-01-15 14:15:47 -05:00
|
|
|
@scpy ( src* dst* -- )
|
|
|
|
|
|
|
|
STH2
|
|
|
|
&while
|
|
|
|
LDAk STH2kr STA INC2r
|
|
|
|
INC2 LDAk ,&while JCN
|
|
|
|
POP2
|
|
|
|
#00 STH2r STA
|
|
|
|
|
|
|
|
JMP2r
|
|
|
|
|
2021-09-21 13:45:56 -04:00
|
|
|
@pointer-icn
|
|
|
|
80c0 e0f0 f8e0 1000
|
2021-11-07 16:23:33 -05:00
|
|
|
@hand-icn
|
|
|
|
000c 0a0a 1224 4780
|
|
|
|
0000 0000 0000 fc02
|
|
|
|
8180 8080 8040 3f00
|
|
|
|
fc20 c020 c020 c000
|
2022-01-08 20:22:04 -05:00
|
|
|
@file-icns
|
|
|
|
003f 3f30 3f30 3f30
|
|
|
|
00fc fc0c fc0c fc0c
|
|
|
|
3f33 3f3f 3f3f 3f00
|
|
|
|
fcfc fcc4 c8d0 e000
|
|
|
|
003f 3f30 3132 3231
|
|
|
|
00fc fc0c 8c4c 4c8c
|
|
|
|
303f 3f3f 3f3f 3f00
|
|
|
|
0cfc fcc4 c8d0 e000
|
2021-11-07 15:55:26 -05:00
|
|
|
@sin-pcm
|
|
|
|
8083 8689 8c8f 9295 989b 9ea1 a4a7 aaad
|
|
|
|
b0b3 b6b9 bbbe c1c3 c6c9 cbce d0d2 d5d7
|
|
|
|
d9db dee0 e2e4 e6e7 e9eb ecee f0f1 f2f4
|
|
|
|
f5f6 f7f8 f9fa fbfb fcfd fdfe fefe fefe
|
|
|
|
fffe fefe fefe fdfd fcfb fbfa f9f8 f7f6
|
|
|
|
f5f4 f2f1 f0ee eceb e9e7 e6e4 e2e0 dedb
|
|
|
|
d9d7 d5d2 d0ce cbc9 c6c3 c1be bbb9 b6b3
|
|
|
|
b0ad aaa7 a4a1 9e9b 9895 928f 8c89 8683
|
|
|
|
807d 7a77 7471 6e6b 6865 625f 5c59 5653
|
|
|
|
504d 4a47 4542 3f3d 3a37 3532 302e 2b29
|
|
|
|
2725 2220 1e1c 1a19 1715 1412 100f 0e0c
|
|
|
|
0b0a 0908 0706 0505 0403 0302 0202 0202
|
|
|
|
0102 0202 0202 0303 0405 0506 0708 090a
|
|
|
|
0b0c 0e0f 1012 1415 1719 1a1c 1e20 2225
|
|
|
|
2729 2b2e 3032 3537 3a3d 3f42 4547 4a4d
|
|
|
|
5053 5659 5c5f 6265 686b 6e71 7477 7a7d
|
|
|
|
|
2021-11-17 17:06:00 -05:00
|
|
|
~projects/library/check-rom.tal
|
|
|
|
~projects/library/load-rom.tal
|
|
|
|
~projects/assets/mascot0cx0c.tal
|
|
|
|
~projects/assets/msx01x02.tal
|
2021-11-06 12:21:14 -04:00
|
|
|
|
2022-02-06 14:56:42 -05:00
|
|
|
( directory memory )
|
2021-11-07 14:30:36 -05:00
|
|
|
@dir
|
|
|
|
&path ". $1
|
2022-01-08 16:34:26 -05:00
|
|
|
&length $2
|
2022-01-15 14:15:47 -05:00
|
|
|
&data $1000
|
|
|
|
|
|
|
|
( assembler memory )
|
|
|
|
|
|
|
|
~projects/library/asma.tal
|
|
|
|
|
|
|
|
@asma-heap
|
|
|
|
|e000 &end @asma-read-buffer
|
|
|
|
|f800 &end @asma-write-buffer
|
|
|
|
|ffff &end
|