...
|
...
|
@@ -8,11 +8,16 @@
|
8
|
8
|
%RTN { JMP2r }
|
9
|
9
|
%TOS { #00 SWP }
|
10
|
10
|
|
|
11
|
+%DEBUG { ;print-hex JSR2 #0a .Console/write DEO }
|
|
12
|
+%DEBUG2 { SWP ;print-hex JSR2 ;print-hex JSR2 #0a .Console/write DEO }
|
|
13
|
+
|
11
|
14
|
( devices )
|
12
|
15
|
|
13
|
16
|
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]
|
|
17
|
+|10 @Console [ &vector $2 &read $1 &pad $5 &write $1 ]
|
14
|
18
|
|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ]
|
15
|
19
|
|80 @Controller [ &vector $2 &button $1 &key $1 ]
|
|
20
|
+|a0 @File [ &vector $2 &success $2 &offset $2 &pad $2 &name $2 &length $2 &load $2 &save $2 ]
|
16
|
21
|
|
17
|
22
|
( variables )
|
18
|
23
|
|
...
|
...
|
@@ -33,6 +38,12 @@
|
33
|
38
|
|
34
|
39
|
( vectors )
|
35
|
40
|
;on-button .Controller/vector DEO2
|
|
41
|
+
|
|
42
|
+ ( load font )
|
|
43
|
+ #1000 .File/length DEO2
|
|
44
|
+ ;fontpath .File/name DEO2
|
|
45
|
+ ;font-data .File/load DEO2
|
|
46
|
+
|
36
|
47
|
;draw-cursor JSR2
|
37
|
48
|
|
38
|
49
|
BRK
|
...
|
...
|
@@ -53,12 +64,17 @@ BRK
|
53
|
64
|
.Controller/key DEI #0d NEQ ,&no-return JCN
|
54
|
65
|
( draw ) #20 .Screen/color DEO
|
55
|
66
|
( reset ) #0000 .position/x STZ2
|
56
|
|
- ( incr ) .position/y LDZ2 #0008 ++ .position/y STZ2
|
|
67
|
+ ( incr ) .position/y LDZ2 #0010 ++ .position/y STZ2
|
57
|
68
|
;draw-cursor JSR2
|
58
|
69
|
BRK
|
59
|
70
|
&no-return
|
60
|
71
|
|
61
|
|
- ;font #00 .Controller/key DEI #0008 ** ++ .Screen/addr DEO2
|
|
72
|
+ .Controller/key DEI TOS #0020 ** DEBUG2
|
|
73
|
+
|
|
74
|
+ ;font-data .Controller/key DEI TOS #0010 ** ++ .Screen/addr DEO2
|
|
75
|
+ .Controller/button DEI ;mod-color JSR2 .Screen/color DEO
|
|
76
|
+ .Screen/y DEI2 #0008 ++ .Screen/y DEO2
|
|
77
|
+ .Screen/addr DEI2 #0008 ++ .Screen/addr DEO2
|
62
|
78
|
.Controller/button DEI ;mod-color JSR2 .Screen/color DEO
|
63
|
79
|
( incr ) .position/x LDZ2 #0008 ++ .position/x STZ2
|
64
|
80
|
,draw-cursor JSR
|
...
|
...
|
@@ -69,7 +85,7 @@ BRK
|
69
|
85
|
|
70
|
86
|
( ctrl ) DUP #01 = #01 * STH
|
71
|
87
|
( alt ) DUP #02 = #03 * STH
|
72
|
|
- ( shift ) #04 = #0e * STH2r + +
|
|
88
|
+ ( shift ) #04 = #05 * STH2r + +
|
73
|
89
|
#21 +
|
74
|
90
|
|
75
|
91
|
RTN
|
...
|
...
|
@@ -81,6 +97,9 @@ RTN
|
81
|
97
|
;cursor .Screen/addr DEO2
|
82
|
98
|
#22 .Screen/color DEO
|
83
|
99
|
|
|
100
|
+ .position/y LDZ2 #0008 ++ .Screen/y DEO2
|
|
101
|
+ #22 .Screen/color DEO
|
|
102
|
+
|
84
|
103
|
RTN
|
85
|
104
|
|
86
|
105
|
@draw-short ( short* color -- )
|
...
|
...
|
@@ -100,43 +119,19 @@ RTN
|
100
|
119
|
|
101
|
120
|
RTN
|
102
|
121
|
|
|
122
|
+@print-hex ( value -- )
|
|
123
|
+
|
|
124
|
+ STHk #04 SFT ,&parse JSR .Console/write DEO
|
|
125
|
+ STHr #0f AND ,&parse JSR .Console/write DEO
|
|
126
|
+ RTN
|
|
127
|
+ &parse ( value -- char )
|
|
128
|
+ DUP #09 GTH ,&above JCN #30 ADD RTN &above #09 SUB #60 ADD RTN
|
|
129
|
+
|
|
130
|
+RTN
|
|
131
|
+
|
103
|
132
|
@cursor
|
104
|
133
|
ffff ffff ffff ffff
|
105
|
134
|
|
106
|
|
-@font ( spectrum-zx font )
|
107
|
|
- 0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000
|
108
|
|
- 0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000
|
109
|
|
- 007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000
|
110
|
|
- 0038 446c 107c 1000 0000 0000 0000 0000 003e 2222 2266 6600 0000 0822 0022 0800
|
111
|
|
- 0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800
|
112
|
|
- 003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038
|
113
|
|
- 0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000
|
114
|
|
- 0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000
|
115
|
|
- 0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400
|
116
|
|
- 0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000
|
117
|
|
- 0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800
|
118
|
|
- 0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000
|
119
|
|
- 003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00
|
120
|
|
- 0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000
|
121
|
|
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810
|
122
|
|
- 0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800
|
123
|
|
- 003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00
|
124
|
|
- 0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00
|
125
|
|
- 0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200
|
126
|
|
- 0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00
|
127
|
|
- 007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00
|
128
|
|
- 00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200
|
129
|
|
- 0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00
|
130
|
|
- 0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00
|
131
|
|
- 0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00
|
132
|
|
- 0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c
|
133
|
|
- 0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400
|
134
|
|
- 0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800
|
135
|
|
- 0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800
|
136
|
|
- 0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800
|
137
|
|
- 0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00
|
138
|
|
- 0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c
|
139
|
|
-
|
140
|
135
|
@font-hex
|
141
|
136
|
003c 464a 5262 3c00 0018 0808 0808 1c00
|
142
|
137
|
003c 4202 3c40 7e00 003c 421c 0242 3c00
|
...
|
...
|
@@ -145,4 +140,9 @@ RTN
|
145
|
140
|
003c 423c 4242 3c00 003c 4242 3e02 3c00
|
146
|
141
|
003c 4242 7e42 4200 007c 427c 4242 7c00
|
147
|
142
|
003c 4240 4042 3c00 007c 4242 4242 7c00
|
148
|
|
- 007e 4078 4040 7e00 007e 4078 4040 4000
|
149
|
143
|
\ No newline at end of file
|
|
144
|
+ 007e 4078 4040 7e00 007e 4078 4040 4000
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+@fontpath "projects/fonts/437dos8x16.bit
|
|
148
|
+
|
|
149
|
+@font-data
|
150
|
150
|
\ No newline at end of file
|