| ... | ... |
@@ -10,9 +10,10 @@ |
| 10 | 10 |
|
| 11 | 11 |
( devices ) |
| 12 | 12 |
|
| 13 |
+|0100 ;Console { pad 8 char 1 byte 1 short 2 }
|
|
| 13 | 14 |
|0110 ;Screen { width 2 height 2 pad 4 y 2 x 2 color 1 }
|
| 14 | 15 |
|0120 ;Sprite { pad 8 x 2 y 2 addr 2 color 1 }
|
| 15 |
-|0130 ;Controller { buttons 1 }
|
|
| 16 |
+|0130 ;Controller { p1 1 }
|
|
| 16 | 17 |
|01F0 .RESET .FRAME .ERROR ( vectors ) |
| 17 | 18 |
|01F8 [ 0daf 02ff 035f ] ( palette ) |
| 18 | 19 |
|
| ... | ... |
@@ -28,29 +29,34 @@ |
| 28 | 29 |
BRK |
| 29 | 30 |
|
| 30 | 31 |
@FRAME |
| 31 |
- |
|
| 32 |
- ~Controller.buttons #f0 AND #00 EQU BRK? |
|
| 32 |
+ |
|
| 33 |
+ ,on-ctrl-arrows ~Controller.p1 JNZ2 |
|
| 34 |
+ |
|
| 35 |
+BRK |
|
| 36 |
+ |
|
| 37 |
+@on-ctrl-arrows |
|
| 33 | 38 |
|
| 34 | 39 |
#0a =slime |
| 40 |
+ ,default_icn =Sprite.addr |
|
| 35 | 41 |
|
| 36 | 42 |
( hold ctrl key to change slime color ) |
| 37 | 43 |
|
| 38 |
- ~Controller.buttons #0f AND |
|
| 39 |
- DUP #01 NEQ ,$no-ctrl ROT JMP2? #05 =slime $no-ctrl |
|
| 40 |
- DUP #02 NEQ ,$no-alt ROT JMP2? #0f =slime $no-alt |
|
| 44 |
+ ~Controller.p1 #0f AND |
|
| 45 |
+ DUP #01 NEQ ,$no-ctrl ROT JNZ2 #05 =slime $no-ctrl |
|
| 46 |
+ DUP #02 NEQ ,$no-alt ROT JNZ2 #0f =slime $no-alt |
|
| 41 | 47 |
POP |
| 42 | 48 |
|
| 43 | 49 |
( clear ) #10 =Sprite.color |
| 44 | 50 |
|
| 45 | 51 |
( detect movement ) |
| 46 |
- ~Controller.buttons #f0 AND |
|
| 47 |
- DUP #04 SFT #01 AND #01 NEQ ,$no-up ROT JMP2? |
|
| 52 |
+ ~Controller.p1 #f0 AND |
|
| 53 |
+ DUP #04 SFT #01 AND #01 NEQ ,$no-up ROT JNZ2 |
|
| 48 | 54 |
( move ) ~Sprite.y -- =Sprite.y ,up_icn =Sprite.addr $no-up |
| 49 |
- DUP #05 SFT #01 AND #01 NEQ ,$no-down ROT JMP2? |
|
| 55 |
+ DUP #05 SFT #01 AND #01 NEQ ,$no-down ROT JNZ2 |
|
| 50 | 56 |
( move ) ~Sprite.y ++ =Sprite.y ,down_icn =Sprite.addr $no-down |
| 51 |
- DUP #06 SFT #01 AND #01 NEQ ,$no-left ROT JMP2? |
|
| 57 |
+ DUP #06 SFT #01 AND #01 NEQ ,$no-left ROT JNZ2 |
|
| 52 | 58 |
( move ) ~Sprite.x -- =Sprite.x ,left_icn =Sprite.addr $no-left |
| 53 |
- DUP #07 SFT #01 AND #01 NEQ ,$no-right ROT JMP2? |
|
| 59 |
+ DUP #07 SFT #01 AND #01 NEQ ,$no-right ROT JNZ2 |
|
| 54 | 60 |
( move ) ~Sprite.x ++ =Sprite.x ,right_icn =Sprite.addr $no-right |
| 55 | 61 |
POP |
| 56 | 62 |
|
| ... | ... |
@@ -27,10 +27,11 @@ BRK |
| 27 | 27 |
|
| 28 | 28 |
,draw-cursor JSR2 |
| 29 | 29 |
|
| 30 |
- ,$no-touch ~Mouse.state #00 EQU JMP2? |
|
| 30 |
+ ,$no-touch ~Mouse.state #00 EQU JNZ2 |
|
| 31 | 31 |
~Mouse.x =circle.xc |
| 32 | 32 |
~Mouse.y =circle.yc |
| 33 | 33 |
#0000 =circle.r |
| 34 |
+ |
|
| 34 | 35 |
$no-touch |
| 35 | 36 |
|
| 36 | 37 |
( draw ) |
| ... | ... |
@@ -53,7 +54,7 @@ BRK |
| 53 | 54 |
,cursor_icn =Sprite.addr |
| 54 | 55 |
~pointer.x =Sprite.x |
| 55 | 56 |
~pointer.y =Sprite.y |
| 56 |
- #11 =Sprite.color |
|
| 57 |
+ #11 ~Mouse.state #00 NEQ ADD =Sprite.color |
|
| 57 | 58 |
|
| 58 | 59 |
RTN |
| 59 | 60 |
|
| ... | ... |
@@ -65,7 +66,7 @@ RTN |
| 65 | 66 |
( draw ) ,$seg JSR2 |
| 66 | 67 |
$loop |
| 67 | 68 |
( incr ) ~circle.x ++ =circle.x |
| 68 |
- ,$else ~circle.d #0000 #0001 ADD2 LTS2 JMP2? |
|
| 69 |
+ ,$else ~circle.d #0000 #0001 ADD2 LTS2 JNZ2 |
|
| 69 | 70 |
( decr ) ~circle.y -- =circle.y |
| 70 | 71 |
~circle.x ~circle.y SUB2 #0004 MUL2 ~circle.d ADD2 #000a ADD2 =circle.d |
| 71 | 72 |
,$end JMP2 |
| ... | ... |
@@ -73,7 +74,7 @@ RTN |
| 73 | 74 |
~circle.x #0004 MUL2 ~circle.d ADD2 #0006 ADD2 =circle.d |
| 74 | 75 |
$end |
| 75 | 76 |
( draw ) ,$seg JSR2 |
| 76 |
- ,$loop ~circle.y ~circle.x #0001 SUB2 GTS2 JMP2? |
|
| 77 |
+ ,$loop ~circle.y ~circle.x #0001 SUB2 GTS2 JNZ2 |
|
| 77 | 78 |
RTN |
| 78 | 79 |
$seg |
| 79 | 80 |
~circle.xc ~circle.x ADD2 =Screen.x ~circle.yc ~circle.y ADD2 =Screen.y ~color =Screen.color |
| ... | ... |
@@ -53,7 +53,7 @@ |
| 53 | 53 |
$draw-hor NOP |
| 54 | 54 |
( draw ) #01 =Screen.color |
| 55 | 55 |
( incr ) SWP2 #0002 ADD2 DUP2 =Screen.x SWP2 |
| 56 |
- OVR2 OVR2 LTH2 ^$draw-hor SWP JMP? |
|
| 56 |
+ OVR2 OVR2 LTH2 ^$draw-hor SWP JNZ |
|
| 57 | 57 |
POP2 POP2 |
| 58 | 58 |
|
| 59 | 59 |
( draw ver line ) |
| ... | ... |
@@ -62,7 +62,7 @@ |
| 62 | 62 |
$draw-ver NOP |
| 63 | 63 |
( draw ) #02 =Screen.color |
| 64 | 64 |
( incr ) SWP2 #0002 ADD2 DUP2 =Screen.y SWP2 |
| 65 |
- OVR2 OVR2 LTH2 ^$draw-ver SWP JMP? |
|
| 65 |
+ OVR2 OVR2 LTH2 ^$draw-ver SWP JNZ |
|
| 66 | 66 |
POP2 POP2 |
| 67 | 67 |
|
| 68 | 68 |
( draw blending modes ) |
| ... | ... |
@@ -72,7 +72,7 @@ |
| 72 | 72 |
( move ) OVR #00 SWP #0008 MUL2 #0020 ADD2 =Sprite.x |
| 73 | 73 |
( draw ) OVR =Sprite.color |
| 74 | 74 |
( incr ) SWP #01 ADD SWP |
| 75 |
- DUP2 LTH ^$draw-blends SWP JMP? |
|
| 75 |
+ DUP2 LTH ^$draw-blends SWP JNZ |
|
| 76 | 76 |
POP POP |
| 77 | 77 |
|
| 78 | 78 |
,update-theme JSR2 |
| ... | ... |
@@ -82,28 +82,28 @@ BRK |
| 82 | 82 |
|
| 83 | 83 |
@FRAME |
| 84 | 84 |
|
| 85 |
- ,$no-touch ~Mouse.state #00 EQU JMP2? |
|
| 85 |
+ ,$no-touch ~Mouse.state #00 EQU JNZ2 |
|
| 86 | 86 |
|
| 87 | 87 |
~Mouse.y ~window.y1 SUB2 STEP8 |
| 88 | 88 |
|
| 89 |
- DUP2 #0010 NEQ2 ,$no-touch-red ROT JMP2? |
|
| 90 |
- ,$no-touch-red ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JMP2? |
|
| 91 |
- ,$no-touch-red ~Mouse.x ~window.x1 #008c ADD2 GTH2 JMP2? |
|
| 89 |
+ DUP2 #0010 NEQ2 ,$no-touch-red ROT JNZ2 |
|
| 90 |
+ ,$no-touch-red ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JNZ2 |
|
| 91 |
+ ,$no-touch-red ~Mouse.x ~window.x1 #008c ADD2 GTH2 JNZ2 |
|
| 92 | 92 |
( get new value ) ~Mouse.x ~window.x1 SUB2 #0050 SUB2 #0004 DIV2 S2B ,theme.r1 #00 ~selection ADD2 POK2 |
| 93 | 93 |
$no-touch-red |
| 94 |
- DUP2 #0020 NEQ2 ,$no-touch-green ROT JMP2? |
|
| 95 |
- ,$no-touch-green ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JMP2? |
|
| 96 |
- ,$no-touch-green ~Mouse.x ~window.x1 #008c ADD2 GTH2 JMP2? |
|
| 94 |
+ DUP2 #0020 NEQ2 ,$no-touch-green ROT JNZ2 |
|
| 95 |
+ ,$no-touch-green ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JNZ2 |
|
| 96 |
+ ,$no-touch-green ~Mouse.x ~window.x1 #008c ADD2 GTH2 JNZ2 |
|
| 97 | 97 |
( get new value ) ~Mouse.x ~window.x1 SUB2 #0050 SUB2 #0004 DIV2 S2B ,theme.g1 #00 ~selection ADD2 POK2 |
| 98 | 98 |
$no-touch-green |
| 99 |
- DUP2 #0030 NEQ2 ,$no-touch-blue ROT JMP2? |
|
| 100 |
- ,$no-touch-blue ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JMP2? |
|
| 101 |
- ,$no-touch-blue ~Mouse.x ~window.x1 #008c ADD2 GTH2 JMP2? |
|
| 99 |
+ DUP2 #0030 NEQ2 ,$no-touch-blue ROT JNZ2 |
|
| 100 |
+ ,$no-touch-blue ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JNZ2 |
|
| 101 |
+ ,$no-touch-blue ~Mouse.x ~window.x1 #008c ADD2 GTH2 JNZ2 |
|
| 102 | 102 |
( get new value ) ~Mouse.x ~window.x1 SUB2 #0050 SUB2 #0004 DIV2 S2B ,theme.b1 #00 ~selection ADD2 POK2 |
| 103 | 103 |
$no-touch-blue |
| 104 |
- DUP2 #0040 NEQ2 ,$no-touch-radio ROT JMP2? |
|
| 105 |
- ,$no-touch-radio ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JMP2? |
|
| 106 |
- ,$no-touch-radio ~Mouse.x ~window.x1 #008c ADD2 GTH2 JMP2? |
|
| 104 |
+ DUP2 #0040 NEQ2 ,$no-touch-radio ROT JNZ2 |
|
| 105 |
+ ,$no-touch-radio ~Mouse.x ~window.x1 #0050 ADD2 LTH2 JNZ2 |
|
| 106 |
+ ,$no-touch-radio ~Mouse.x ~window.x1 #008c ADD2 GTH2 JNZ2 |
|
| 107 | 107 |
~Mouse.x ~window.x1 SUB2 #0050 SUB2 STEP8 2/ #0008 DIV2 S2B =selection |
| 108 | 108 |
$no-touch-radio |
| 109 | 109 |
|
| ... | ... |
@@ -228,7 +228,7 @@ RTN |
| 228 | 228 |
$loop |
| 229 | 229 |
( incr ) ~Sprite.x 8+ =Sprite.x |
| 230 | 230 |
( draw ) #05 =Sprite.color |
| 231 |
- ,$loop ~Sprite.x ~slider.x2 #0008 ADD2 LTH2 JMP2? |
|
| 231 |
+ ,$loop ~Sprite.x ~slider.x2 #0008 ADD2 LTH2 JNZ2 |
|
| 232 | 232 |
|
| 233 | 233 |
( incr ) ~Sprite.x #0004 ADD2 =Sprite.x |
| 234 | 234 |
,sliderc_icn =Sprite.addr |
| ... | ... |
@@ -248,9 +248,9 @@ RTN |
| 248 | 248 |
$hor |
| 249 | 249 |
( draw ) ~color =Screen.color |
| 250 | 250 |
( incr ) ~Screen.x ++ =Screen.x |
| 251 |
- ,$hor ~Screen.x ~rect.x2 LTH2 JMP2? |
|
| 251 |
+ ,$hor ~Screen.x ~rect.x2 LTH2 JNZ2 |
|
| 252 | 252 |
( incr ) ~Screen.y ++ =Screen.y |
| 253 |
- ,$ver ~Screen.y ~rect.y2 LTH2 JMP2? |
|
| 253 |
+ ,$ver ~Screen.y ~rect.y2 LTH2 JNZ2 |
|
| 254 | 254 |
|
| 255 | 255 |
RTN |
| 256 | 256 |
|
| ... | ... |
@@ -261,13 +261,13 @@ RTN |
| 261 | 261 |
( incr ) ~Screen.x ++ =Screen.x |
| 262 | 262 |
( draw ) ~rect.y1 =Screen.y ~color =Screen.color |
| 263 | 263 |
( draw ) ~rect.y2 =Screen.y ~color =Screen.color |
| 264 |
- ,$hor ~Screen.x ~rect.x2 LTH2 JMP2? |
|
| 264 |
+ ,$hor ~Screen.x ~rect.x2 LTH2 JNZ2 |
|
| 265 | 265 |
~rect.y1 =Screen.y |
| 266 | 266 |
$ver |
| 267 | 267 |
( draw ) ~rect.x1 =Screen.x ~color =Screen.color |
| 268 | 268 |
( draw ) ~rect.x2 =Screen.x ~color =Screen.color |
| 269 | 269 |
( incr ) ~Screen.y ++ =Screen.y |
| 270 |
- ,$ver ~Screen.y ~rect.y2 ++ LTH2 JMP2? |
|
| 270 |
+ ,$ver ~Screen.y ~rect.y2 ++ LTH2 JNZ2 |
|
| 271 | 271 |
|
| 272 | 272 |
RTN |
| 273 | 273 |
|
| ... | ... |
@@ -278,7 +278,7 @@ RTN |
| 278 | 278 |
( draw ) DUP2 PEK2 #00 SWP #0008 MUL2 ,font ADD2 =Sprite.addr ~color =Sprite.color |
| 279 | 279 |
( incr ) ++ |
| 280 | 280 |
( incr ) ~Sprite.x 8+ =Sprite.x |
| 281 |
- DUP2 PEK2 #00 NEQ ,$loop ROT JMP2? |
|
| 281 |
+ DUP2 PEK2 #00 NEQ ,$loop ROT JNZ2 |
|
| 282 | 282 |
POP2 |
| 283 | 283 |
|
| 284 | 284 |
RTN |
| ... | ... |
@@ -34,15 +34,15 @@ BRK |
| 34 | 34 |
|
| 35 | 35 |
@FRAME |
| 36 | 36 |
|
| 37 |
- ,no-ctrl ~Controller.buttons #00 EQU JMP2? |
|
| 37 |
+ ,no-ctrl ~Controller.buttons #00 EQU JNZ2 |
|
| 38 | 38 |
|
| 39 |
- ,no-ctrl-up ~Controller.buttons #10 EQU JMP2? |
|
| 39 |
+ ,no-ctrl-up ~Controller.buttons #10 EQU JNZ2 |
|
| 40 | 40 |
~editor.addr #0001 ADD2 =editor.addr |
| 41 | 41 |
,draw-window JSR2 |
| 42 | 42 |
,draw-editor JSR2 |
| 43 | 43 |
@no-ctrl-up |
| 44 | 44 |
|
| 45 |
- ,no-ctrl-down ~Controller.buttons #20 EQU JMP2? |
|
| 45 |
+ ,no-ctrl-down ~Controller.buttons #20 EQU JNZ2 |
|
| 46 | 46 |
~editor.addr #0001 SUB2 =editor.addr |
| 47 | 47 |
,draw-window JSR2 |
| 48 | 48 |
,draw-editor JSR2 |
| ... | ... |
@@ -50,7 +50,7 @@ BRK |
| 50 | 50 |
|
| 51 | 51 |
@no-ctrl |
| 52 | 52 |
|
| 53 |
- ,no-click ~Mouse.state #00 EQU JMP2? |
|
| 53 |
+ ,no-click ~Mouse.state #00 EQU JNZ2 |
|
| 54 | 54 |
|
| 55 | 55 |
( load ) ~editor.addr ~Mouse.y ~editor.y1 SUB2 #0008 DIV2 ADD2 PEK2 |
| 56 | 56 |
( mask ) #01 #07 ~Mouse.x ~editor.x1 SUB2 #0008 DIV2 SWP POP SUB #40 SFT SFT |
| ... | ... |
@@ -93,10 +93,10 @@ RTN |
| 93 | 93 |
( draw ) #08 =Sprite.color |
| 94 | 94 |
( incr ) ~Sprite.x #0008 ADD2 =Sprite.x |
| 95 | 95 |
( incr ) ~pixel.x #01 ADD =pixel.x |
| 96 |
- ,$hor ~Sprite.x ~editor.x1 #0040 ADD2 LTH2 JMP2? |
|
| 96 |
+ ,$hor ~Sprite.x ~editor.x1 #0040 ADD2 LTH2 JNZ2 |
|
| 97 | 97 |
( incr ) ~Sprite.y #0008 ADD2 =Sprite.y |
| 98 | 98 |
( incr ) ~pixel.y #01 ADD =pixel.y |
| 99 |
- ,$ver ~Sprite.y ~editor.y1 #0040 ADD2 LTH2 JMP2? |
|
| 99 |
+ ,$ver ~Sprite.y ~editor.y1 #0040 ADD2 LTH2 JNZ2 |
|
| 100 | 100 |
~editor.addr =Sprite.addr |
| 101 | 101 |
~window.y1 =Sprite.y |
| 102 | 102 |
~window.x2 #0008 SUB2 =Sprite.x |
| ... | ... |
@@ -163,11 +163,6 @@ RTN |
| 163 | 163 |
RTN |
| 164 | 164 |
|
| 165 | 165 |
@draw-cursor |
| 166 |
- |
|
| 167 |
- ~pointer.x ~Mouse.x NEQU2 |
|
| 168 |
- ~pointer.y ~Mouse.y NEQU2 |
|
| 169 |
- |
|
| 170 |
- #0000 EQU2 BRK? ( Return if unchanged ) |
|
| 171 | 166 |
|
| 172 | 167 |
( clear last cursor ) |
| 173 | 168 |
,clear_icn =Sprite.addr |
| ... | ... |
@@ -1,6 +1,7 @@ |
| 1 | 1 |
( draw routines ) |
| 2 | 2 |
|
| 3 | 3 |
%RTN { JMP2r }
|
| 4 |
+%RTN? { #00 EQU #02 SWP JNZ STH2r JMP2 }
|
|
| 4 | 5 |
|
| 5 | 6 |
;color { byte 1 }
|
| 6 | 7 |
;pointer { x 2 y 2 sprite 2 }
|
| ... | ... |
@@ -26,33 +27,28 @@ BRK |
| 26 | 27 |
|
| 27 | 28 |
@FRAME |
| 28 | 29 |
|
| 29 |
- ~pointer.x ~Mouse.x NEQU2 |
|
| 30 |
- ~pointer.y ~Mouse.y NEQU2 |
|
| 31 |
- |
|
| 32 |
- #0000 EQU2 BRK? ( Return if unchanged ) |
|
| 33 |
- |
|
| 34 | 30 |
,pointer_icn =pointer.sprite |
| 35 | 31 |
|
| 36 | 32 |
#01 =color |
| 37 | 33 |
( matrix comparison ) |
| 38 | 34 |
~Mouse.x ~r1.x1 GTH2 ~Mouse.x ~r1.x2 LTH2 #0101 EQU2 |
| 39 | 35 |
~Mouse.y ~r1.y1 GTH2 ~Mouse.y ~r1.y2 LTH2 #0101 EQU2 |
| 40 |
- #0101 NEQ2 ,$draw1 ROT JMP2? #02 =color ,hand_icn =pointer.sprite |
|
| 36 |
+ #0101 NEQ2 ,$draw1 ROT JNZ2 #02 =color ,hand_icn =pointer.sprite |
|
| 41 | 37 |
$draw1 ~r1.x1 ~r1.y1 ~r1.x2 ~r1.y2 ~color ,line-rect JSR2 |
| 42 | 38 |
|
| 43 | 39 |
#01 =color |
| 44 | 40 |
( 2-step comparison ) |
| 45 |
- ,$draw2 ~Mouse.x ~r2.x1 GTH2 ~Mouse.x ~r2.x2 LTH2 #0101 NEQ2 JMP2? |
|
| 46 |
- ,$draw2 ~Mouse.y ~r2.y1 GTH2 ~Mouse.y ~r2.y2 LTH2 #0101 NEQ2 JMP2? |
|
| 41 |
+ ,$draw2 ~Mouse.x ~r2.x1 GTH2 ~Mouse.x ~r2.x2 LTH2 #0101 NEQ2 JNZ2 |
|
| 42 |
+ ,$draw2 ~Mouse.y ~r2.y1 GTH2 ~Mouse.y ~r2.y2 LTH2 #0101 NEQ2 JNZ2 |
|
| 47 | 43 |
#03 =color ,hand_icn =pointer.sprite |
| 48 | 44 |
$draw2 ~r2.x1 ~r2.y1 ~r2.x2 ~r2.y2 ~color ,line-rect JSR2 |
| 49 | 45 |
|
| 50 | 46 |
#01 =color |
| 51 | 47 |
( 4-step comparison ) |
| 52 |
- ,$draw3 ~Mouse.x ~r3.x1 LTH2 JMP2? |
|
| 53 |
- ,$draw3 ~Mouse.x ~r3.x2 GTH2 JMP2? |
|
| 54 |
- ,$draw3 ~Mouse.y ~r3.y1 LTH2 JMP2? |
|
| 55 |
- ,$draw3 ~Mouse.y ~r3.y2 GTH2 JMP2? |
|
| 48 |
+ ,$draw3 ~Mouse.x ~r3.x1 LTH2 JNZ2 |
|
| 49 |
+ ,$draw3 ~Mouse.x ~r3.x2 GTH2 JNZ2 |
|
| 50 |
+ ,$draw3 ~Mouse.y ~r3.y1 LTH2 JNZ2 |
|
| 51 |
+ ,$draw3 ~Mouse.y ~r3.y2 GTH2 JNZ2 |
|
| 56 | 52 |
#02 =color ,hand_icn =pointer.sprite |
| 57 | 53 |
$draw3 ~r3.x1 ~r3.y1 ~r3.x2 ~r3.y2 ~color ,line-rect JSR2 |
| 58 | 54 |
|
| ... | ... |
@@ -86,13 +82,13 @@ RTN |
| 86 | 82 |
( incr ) ~Screen.x #0001 ADD2 =Screen.x |
| 87 | 83 |
( draw ) ~rect.y1 =Screen.y ~color =Screen.color |
| 88 | 84 |
( draw ) ~rect.y2 =Screen.y ~color =Screen.color |
| 89 |
- ,$hor ~Screen.x ~rect.x2 LTH2 JMP2? |
|
| 85 |
+ ,$hor ~Screen.x ~rect.x2 LTH2 JNZ2 |
|
| 90 | 86 |
~rect.y1 =Screen.y |
| 91 | 87 |
$ver |
| 92 | 88 |
( draw ) ~rect.x1 =Screen.x ~color =Screen.color |
| 93 | 89 |
( draw ) ~rect.x2 =Screen.x ~color =Screen.color |
| 94 | 90 |
( incr ) ~Screen.y #0001 ADD2 =Screen.y |
| 95 |
- ,$ver ~Screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? |
|
| 91 |
+ ,$ver ~Screen.y ~rect.y2 #0001 ADD2 LTH2 JNZ2 |
|
| 96 | 92 |
|
| 97 | 93 |
RTN |
| 98 | 94 |
|
| ... | ... |
@@ -23,7 +23,7 @@ |
| 23 | 23 |
$draw-ver |
| 24 | 24 |
( draw ) #02 =Screen.color |
| 25 | 25 |
( incr ) ~Screen.y #0002 ADD2 =Screen.y |
| 26 |
- ,$draw-ver ~Screen.y ~Screen.height LTH2 JMP2? |
|
| 26 |
+ ,$draw-ver ~Screen.y ~Screen.height LTH2 JNZ2 |
|
| 27 | 27 |
|
| 28 | 28 |
~center.x ~center.y #0010 SUB2 #0c ,text1 ,draw-label-left JSR2 |
| 29 | 29 |
~center.x ~center.y #0c ,text2 ,draw-label-middle JSR2 |
| ... | ... |
@@ -41,7 +41,7 @@ BRK |
| 41 | 41 |
( draw ) DUP2 PEK2 #00 SWP #0008 MUL2 ,font ADD2 =Sprite.addr ~label.color =Sprite.color |
| 42 | 42 |
( incr ) #0001 ADD2 |
| 43 | 43 |
( incr ) ~Sprite.x #0008 ADD2 =Sprite.x |
| 44 |
- DUP2 PEK2 #00 NEQ ,$loop ROT JMP2? |
|
| 44 |
+ DUP2 PEK2 #00 NEQ ,$loop ROT JNZ2 |
|
| 45 | 45 |
POP2 |
| 46 | 46 |
|
| 47 | 47 |
RTN |
| ... | ... |
@@ -55,7 +55,7 @@ RTN |
| 55 | 55 |
( draw ) DUP2 PEK2 #00 SWP #0008 MUL2 ,font ADD2 =Sprite.addr ~label.color =Sprite.color |
| 56 | 56 |
( incr ) #0001 ADD2 |
| 57 | 57 |
( incr ) ~Sprite.x #0008 ADD2 =Sprite.x |
| 58 |
- DUP2 PEK2 #00 NEQ ,$loop ROT JMP2? |
|
| 58 |
+ DUP2 PEK2 #00 NEQ ,$loop ROT JNZ2 |
|
| 59 | 59 |
POP2 |
| 60 | 60 |
|
| 61 | 61 |
RTN |
| ... | ... |
@@ -69,7 +69,7 @@ RTN |
| 69 | 69 |
( draw ) DUP2 PEK2 #00 SWP #0008 MUL2 ,font ADD2 =Sprite.addr ~label.color =Sprite.color |
| 70 | 70 |
( incr ) #0001 ADD2 |
| 71 | 71 |
( incr ) ~Sprite.x #0008 ADD2 =Sprite.x |
| 72 |
- DUP2 PEK2 #00 NEQ ,$loop ROT JMP2? |
|
| 72 |
+ DUP2 PEK2 #00 NEQ ,$loop ROT JNZ2 |
|
| 73 | 73 |
POP2 |
| 74 | 74 |
|
| 75 | 75 |
RTN |
| ... | ... |
@@ -79,7 +79,7 @@ RTN |
| 79 | 79 |
#0000 ( counter ) |
| 80 | 80 |
$loop |
| 81 | 81 |
( incr ) #0001 ADD2 OVR2 OVR2 ADD2 |
| 82 |
- PEK2 #00 NEQ ,$loop ROT JMP2? |
|
| 82 |
+ PEK2 #00 NEQ ,$loop ROT JNZ2 |
|
| 83 | 83 |
SWP2 POP2 |
| 84 | 84 |
|
| 85 | 85 |
RTN |
| ... | ... |
@@ -25,9 +25,9 @@ BRK |
| 25 | 25 |
( draw ) ~pict.color =Sprite.color |
| 26 | 26 |
( incr ) ~Sprite.x #0008 ADD2 =Sprite.x |
| 27 | 27 |
( incr ) ~Sprite.addr #0008 ADD2 =Sprite.addr |
| 28 |
- ,$hor ~Sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP2? |
|
| 28 |
+ ,$hor ~Sprite.x ~pict.width ~pict.x ADD2 LTH2 JNZ2 |
|
| 29 | 29 |
( incr ) ~Sprite.y #0008 ADD2 =Sprite.y |
| 30 |
- ,$ver ~Sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP2? |
|
| 30 |
+ ,$ver ~Sprite.y ~pict.height ~pict.y ADD2 LTH2 JNZ2 |
|
| 31 | 31 |
|
| 32 | 32 |
RTN |
| 33 | 33 |
|
| ... | ... |
@@ -4,9 +4,8 @@ |
| 4 | 4 |
%++ { #0001 ADD2 }
|
| 5 | 5 |
%-- { #0001 SUB2 }
|
| 6 | 6 |
%8+ { #0008 ADD2 }
|
| 7 |
-%ABS2 { DUP2 #000f SFT2 #ffff SWP2 SWP POP MUL2? }
|
|
| 7 |
+%ABS2 { DUP2 #000f SFT2 EQU #04 SWP JNZ #ffff MUL2 }
|
|
| 8 | 8 |
|
| 9 |
-;label { x 2 y 2 color 1 addr 2 }
|
|
| 10 | 9 |
;pict { x 2 y 2 width 2 height 2 color 1 addr 2 }
|
| 11 | 10 |
;rect { x1 2 y1 2 x2 2 y2 2 }
|
| 12 | 11 |
;line { x0 2 y0 2 x 2 y 2 sx 2 sy 2 dx 2 dy 2 e1 2 e2 2 }
|
| ... | ... |
@@ -33,11 +32,6 @@ |
| 33 | 32 |
#0020 #0090 #0020 #0020 #03 ,pict_small ,draw-picture JSR2 |
| 34 | 33 |
#0030 #0098 #0020 #0020 #04 ,pict_small ,draw-picture JSR2 |
| 35 | 34 |
|
| 36 |
- #0028 #0068 #01 ,text ,draw-label JSR2 |
|
| 37 |
- #0038 #0078 #02 ,text ,draw-label JSR2 |
|
| 38 |
- #0048 #0088 #03 ,text ,draw-label JSR2 |
|
| 39 |
- #0058 #0098 #04 ,text ,draw-label JSR2 |
|
| 40 |
- |
|
| 41 | 35 |
#0020 #0020 #0070 #0080 #01 ,draw-line JSR2 |
| 42 | 36 |
#0020 #0080 #0070 #0030 #02 ,draw-line JSR2 |
| 43 | 37 |
#00a0 #0020 #0050 #00b0 #03 ,draw-line JSR2 |
| ... | ... |
@@ -59,13 +53,13 @@ BRK |
| 59 | 53 |
~line.dx ~line.dy ADD2 =line.e1 |
| 60 | 54 |
$loop |
| 61 | 55 |
~line.x =Screen.x ~line.y =Screen.y ~color =Screen.color |
| 62 |
- ,$end ~line.x ~line.x0 EQU2 ~line.y ~line.y0 EQU2 #0101 EQU2 JMP2? |
|
| 56 |
+ ,$end ~line.x ~line.x0 EQU2 ~line.y ~line.y0 EQU2 #0101 EQU2 JNZ2 |
|
| 63 | 57 |
~line.e1 #0002 MUL2 =line.e2 |
| 64 |
- ,$skipy ~line.e2 ~line.dy LTS2 JMP2? |
|
| 58 |
+ ,$skipy ~line.e2 ~line.dy LTS2 JNZ2 |
|
| 65 | 59 |
~line.e1 ~line.dy ADD2 =line.e1 |
| 66 | 60 |
~line.x ~line.sx ADD2 =line.x |
| 67 | 61 |
$skipy |
| 68 |
- ,$skipx ~line.e2 ~line.dx GTS2 JMP2? |
|
| 62 |
+ ,$skipx ~line.e2 ~line.dx GTS2 JNZ2 |
|
| 69 | 63 |
~line.e1 ~line.dx ADD2 =line.e1 |
| 70 | 64 |
~line.y ~line.sy ADD2 =line.y |
| 71 | 65 |
$skipx |
| ... | ... |
@@ -82,13 +76,13 @@ RTN |
| 82 | 76 |
( incr ) ~Screen.x ++ =Screen.x |
| 83 | 77 |
( draw ) ~rect.y1 =Screen.y ~color =Screen.color |
| 84 | 78 |
( draw ) ~rect.y2 =Screen.y ~color =Screen.color |
| 85 |
- ,$hor ~Screen.x ~rect.x2 LTH2 JMP2? |
|
| 79 |
+ ,$hor ~Screen.x ~rect.x2 LTH2 JNZ2 |
|
| 86 | 80 |
~rect.y1 =Screen.y |
| 87 | 81 |
$ver |
| 88 | 82 |
( draw ) ~rect.x1 =Screen.x ~color =Screen.color |
| 89 | 83 |
( draw ) ~rect.x2 =Screen.x ~color =Screen.color |
| 90 | 84 |
( incr ) ~Screen.y ++ =Screen.y |
| 91 |
- ,$ver ~Screen.y ~rect.y2 ++ LTH2 JMP2? |
|
| 85 |
+ ,$ver ~Screen.y ~rect.y2 ++ LTH2 JNZ2 |
|
| 92 | 86 |
|
| 93 | 87 |
RTN |
| 94 | 88 |
|
| ... | ... |
@@ -100,9 +94,9 @@ RTN |
| 100 | 94 |
$hor |
| 101 | 95 |
( draw ) ~color =Screen.color |
| 102 | 96 |
( incr ) ~Screen.x ++ =Screen.x |
| 103 |
- ,$hor ~Screen.x ~rect.x2 LTH2 JMP2? |
|
| 97 |
+ ,$hor ~Screen.x ~rect.x2 LTH2 JNZ2 |
|
| 104 | 98 |
( incr ) ~Screen.y ++ =Screen.y |
| 105 |
- ,$ver ~Screen.y ~rect.y2 LTH2 JMP2? |
|
| 99 |
+ ,$ver ~Screen.y ~rect.y2 LTH2 JNZ2 |
|
| 106 | 100 |
|
| 107 | 101 |
RTN |
| 108 | 102 |
|
| ... | ... |
@@ -115,21 +109,9 @@ RTN |
| 115 | 109 |
( draw ) ~pict.color =Sprite.color |
| 116 | 110 |
( incr ) ~Sprite.x 8+ =Sprite.x |
| 117 | 111 |
( incr ) ~Sprite.addr 8+ =Sprite.addr |
| 118 |
- ,$hor ~Sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP2? |
|
| 112 |
+ ,$hor ~Sprite.x ~pict.width ~pict.x ADD2 LTH2 JNZ2 |
|
| 119 | 113 |
( incr ) ~Sprite.y 8+ =Sprite.y |
| 120 |
- ,$ver ~Sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP2? |
|
| 121 |
- |
|
| 122 |
-RTN |
|
| 123 |
- |
|
| 124 |
-@draw-label ( x y color addr ) |
|
| 125 |
- |
|
| 126 |
- ( load ) =label.addr =label.color =Sprite.y =Sprite.x ~label.addr |
|
| 127 |
- $loop |
|
| 128 |
- ( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =Sprite.addr ~label.color =Sprite.color |
|
| 129 |
- ( incr ) ++ |
|
| 130 |
- ( incr ) ~Sprite.x 8+ =Sprite.x |
|
| 131 |
- DUP2 LDR #00 NEQ ,$loop ROT JMP2? |
|
| 132 |
- POP2 |
|
| 114 |
+ ,$ver ~Sprite.y ~pict.height ~pict.y ADD2 LTH2 JNZ2 |
|
| 133 | 115 |
|
| 134 | 116 |
RTN |
| 135 | 117 |
|
| ... | ... |
@@ -141,7 +123,7 @@ RTN |
| 141 | 123 |
( draw ) ,$seg JSR2 |
| 142 | 124 |
$loop |
| 143 | 125 |
( incr ) ~circle.x ++ =circle.x |
| 144 |
- ,$else ~circle.d #0000 #0001 ADD2 LTS2 JMP2? |
|
| 126 |
+ ,$else ~circle.d #0000 #0001 ADD2 LTS2 JNZ2 |
|
| 145 | 127 |
( decr ) ~circle.y -- =circle.y |
| 146 | 128 |
~circle.x ~circle.y SUB2 #0004 MUL2 ~circle.d ADD2 #000a ADD2 =circle.d |
| 147 | 129 |
,$end JMP2 |
| ... | ... |
@@ -149,7 +131,7 @@ RTN |
| 149 | 131 |
~circle.x #0004 MUL2 ~circle.d ADD2 #0006 ADD2 =circle.d |
| 150 | 132 |
$end |
| 151 | 133 |
( draw ) ,$seg JSR2 |
| 152 |
- ,$loop ~circle.y ~circle.x #0001 SUB2 GTS2 JMP2? |
|
| 134 |
+ ,$loop ~circle.y ~circle.x #0001 SUB2 GTS2 JNZ2 |
|
| 153 | 135 |
RTN |
| 154 | 136 |
$seg |
| 155 | 137 |
~circle.xc ~circle.x ADD2 =Screen.x ~circle.yc ~circle.y ADD2 =Screen.y ~color =Screen.color |
| ... | ... |
@@ -175,43 +157,5 @@ RTN |
| 175 | 157 |
7fef bfff 07af 5fff ffff ffff ffff ffff |
| 176 | 158 |
] |
| 177 | 159 |
|
| 178 |
-@font ( spectrum-zx font ) |
|
| 179 |
-[ |
|
| 180 |
- 0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000 |
|
| 181 |
- 0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000 |
|
| 182 |
- 007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000 |
|
| 183 |
- 0038 446c 107c 1000 000c 0808 0838 3800 003e 2222 2266 6600 0000 0822 0022 0800 |
|
| 184 |
- 0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800 |
|
| 185 |
- 003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038 |
|
| 186 |
- 0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000 |
|
| 187 |
- 0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000 |
|
| 188 |
- 0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400 |
|
| 189 |
- 0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000 |
|
| 190 |
- 0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800 |
|
| 191 |
- 0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000 |
|
| 192 |
- 003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
| 193 |
- 0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
| 194 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810 |
|
| 195 |
- 0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800 |
|
| 196 |
- 003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00 |
|
| 197 |
- 0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00 |
|
| 198 |
- 0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200 |
|
| 199 |
- 0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00 |
|
| 200 |
- 007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00 |
|
| 201 |
- 00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200 |
|
| 202 |
- 0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00 |
|
| 203 |
- 0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00 |
|
| 204 |
- 0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00 |
|
| 205 |
- 0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c |
|
| 206 |
- 0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400 |
|
| 207 |
- 0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800 |
|
| 208 |
- 0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800 |
|
| 209 |
- 0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800 |
|
| 210 |
- 0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00 |
|
| 211 |
- 0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c |
|
| 212 |
-] |
|
| 213 |
- |
|
| 214 |
-@text [ Label 20 Text 00 ] ( add characters to memory ) |
|
| 215 |
- |
|
| 216 | 160 |
@FRAME BRK |
| 217 | 161 |
@ERROR BRK |
| ... | ... |
@@ -36,7 +36,7 @@ |
| 36 | 36 |
@ERROR BRK |
| 37 | 37 |
|
| 38 | 38 |
@FRAME |
| 39 |
- ,recover ~test.status JMP2? |
|
| 39 |
+ ,recover ~test.status JNZ2 |
|
| 40 | 40 |
#01 =test.status |
| 41 | 41 |
~test.code |
| 42 | 42 |
DUP2 ,find-label JSR2 |
| ... | ... |
@@ -56,7 +56,7 @@ |
| 56 | 56 |
|
| 57 | 57 |
@find-code ( label-ptr₂ -- following-code-ptr₂ ) |
| 58 | 58 |
DUP2 PEK2 |
| 59 |
- ,$not-end ROT JMP2? |
|
| 59 |
+ ,$not-end ROT JNZ2 |
|
| 60 | 60 |
|
| 61 | 61 |
$end |
| 62 | 62 |
#0001 ADD2 |
| ... | ... |
@@ -67,7 +67,7 @@ |
| 67 | 67 |
|
| 68 | 68 |
@recover |
| 69 | 69 |
( would it have been a PASS or FAIL? ) |
| 70 |
- ,$clear ~test.label #000a SUB2 PEK2 LIT LIT EQU JMP2? |
|
| 70 |
+ ,$clear ~test.label #000a SUB2 PEK2 LIT LIT EQU JNZ2 |
|
| 71 | 71 |
#02 ^result JMP |
| 72 | 72 |
|
| 73 | 73 |
$clear |
| ... | ... |
@@ -101,13 +101,13 @@ |
| 101 | 101 |
|
| 102 | 102 |
@print-string ( string₂ -- ) |
| 103 | 103 |
DUP2 PEK2 DUP |
| 104 |
- ,$not-end ROT JMP2? |
|
| 104 |
+ ,$not-end ROT JNZ2 |
|
| 105 | 105 |
|
| 106 | 106 |
$end |
| 107 | 107 |
POP POP2 JMP2r |
| 108 | 108 |
|
| 109 | 109 |
$not-end |
| 110 |
- DUP LIT BRK2?r EQU ,$end ROT JMP2? |
|
| 110 |
+ DUP LIT BRK2?r EQU ,$end ROT JNZ2 |
|
| 111 | 111 |
=Console.char |
| 112 | 112 |
#0001 ADD2 ^print-string JMP |
| 113 | 113 |
|