| ... | ... |
@@ -20,5 +20,5 @@ cc -std=c89 -DDEBUG -Wall -Wno-unknown-pragmas -Wpedantic -Wshadow -Wextra -Werr |
| 20 | 20 |
# cc uxn.c emulator.c -std=c89 -Os -DNDEBUG -g0 -s -Wall -Wno-unknown-pragmas -L/usr/local/lib -lSDL2 -o bin/emulator |
| 21 | 21 |
|
| 22 | 22 |
# run |
| 23 |
-./bin/assembler projects/software/left.usm bin/boot.rom |
|
| 23 |
+./bin/assembler projects/software/nasu.usm bin/boot.rom |
|
| 24 | 24 |
./bin/emulator bin/boot.rom |
| ... | ... |
@@ -4,8 +4,8 @@ |
| 4 | 4 |
|
| 5 | 5 |
|0100 @RESET |
| 6 | 6 |
|
| 7 |
- ,text1 ,print-label JSR |
|
| 8 |
- ,text2 ,print-label JSR |
|
| 7 |
+ ,text1 ,print-label JSR2 |
|
| 8 |
+ ,text2 ,print-label JSR2 |
|
| 9 | 9 |
#ab =dev/console.byte |
| 10 | 10 |
#cdef =dev/console.short |
| 11 | 11 |
|
| ... | ... |
@@ -16,7 +16,7 @@ BRK |
| 16 | 16 |
@print-label-loop |
| 17 | 17 |
DUP2 LDR =dev/console.char ( write pointer value to console ) |
| 18 | 18 |
#0001 ADD2 ( increment string pointer ) |
| 19 |
- DUP2 LDR #00 NEQ ,print-label-loop ROT JMP? POP2 ( while *ptr!=0 goto loop ) |
|
| 19 |
+ DUP2 LDR #00 NEQ ,print-label-loop ROT JMP2? POP2 ( while *ptr!=0 goto loop ) |
|
| 20 | 20 |
POP2 |
| 21 | 21 |
|
| 22 | 22 |
RTS |
| ... | ... |
@@ -21,33 +21,33 @@ BRK |
| 21 | 21 |
|
| 22 | 22 |
#0a =slime-color |
| 23 | 23 |
( hold ctrl key to change slime color ) |
| 24 |
- ,no-ctrl ~dev/ctrl.buttons #0f AND #01 NEQ JMP? POP2 |
|
| 24 |
+ ,no-ctrl ~dev/ctrl.buttons #0f AND #01 NEQ JMP2? POP2 |
|
| 25 | 25 |
#05 =slime-color |
| 26 | 26 |
@no-ctrl |
| 27 | 27 |
( hold alt key to change slime color ) |
| 28 |
- ,no-alt ~dev/ctrl.buttons #0f AND #02 NEQ JMP? POP2 |
|
| 28 |
+ ,no-alt ~dev/ctrl.buttons #0f AND #02 NEQ JMP2? POP2 |
|
| 29 | 29 |
#0f =slime-color |
| 30 | 30 |
@no-alt |
| 31 | 31 |
( detect movement ) |
| 32 |
- ,no-up ~dev/ctrl.buttons #f0 AND #10 NEQ JMP? POP2 |
|
| 32 |
+ ,no-up ~dev/ctrl.buttons #f0 AND #10 NEQ JMP2? POP2 |
|
| 33 | 33 |
( clear ) #10 =dev/sprite.color |
| 34 | 34 |
( move ) ~dev/sprite.y #0001 SUB2 =dev/sprite.y ,up_icn =dev/sprite.addr |
| 35 |
- ( draw ) ,redraw JSR BRK |
|
| 35 |
+ ( draw ) ,redraw JSR2 BRK |
|
| 36 | 36 |
@no-up |
| 37 |
- ,no-down ~dev/ctrl.buttons #f0 AND #20 NEQ JMP? POP2 |
|
| 37 |
+ ,no-down ~dev/ctrl.buttons #f0 AND #20 NEQ JMP2? POP2 |
|
| 38 | 38 |
( clear ) #10 =dev/sprite.color |
| 39 | 39 |
( move ) ~dev/sprite.y #0001 ADD2 =dev/sprite.y ,down_icn =dev/sprite.addr |
| 40 |
- ( draw ) ,redraw JSR BRK |
|
| 40 |
+ ( draw ) ,redraw JSR2 BRK |
|
| 41 | 41 |
@no-down |
| 42 |
- ,no-left ~dev/ctrl.buttons #f0 AND #40 NEQ JMP? POP2 |
|
| 42 |
+ ,no-left ~dev/ctrl.buttons #f0 AND #40 NEQ JMP2? POP2 |
|
| 43 | 43 |
( clear ) #10 =dev/sprite.color |
| 44 | 44 |
( move ) ~dev/sprite.x #0001 SUB2 =dev/sprite.x ,left_icn =dev/sprite.addr |
| 45 |
- ( draw ) ,redraw JSR BRK |
|
| 45 |
+ ( draw ) ,redraw JSR2 BRK |
|
| 46 | 46 |
@no-left |
| 47 |
- ,no-right ~dev/ctrl.buttons #f0 AND #80 NEQ JMP? POP2 |
|
| 47 |
+ ,no-right ~dev/ctrl.buttons #f0 AND #80 NEQ JMP2? POP2 |
|
| 48 | 48 |
( clear ) #10 =dev/sprite.color |
| 49 | 49 |
( move ) ~dev/sprite.x #0001 ADD2 =dev/sprite.x ,right_icn =dev/sprite.addr |
| 50 |
- ( draw ) ,redraw JSR BRK |
|
| 50 |
+ ( draw ) ,redraw JSR2 BRK |
|
| 51 | 51 |
@no-right |
| 52 | 52 |
|
| 53 | 53 |
BRK |
| ... | ... |
@@ -19,39 +19,39 @@ |
| 19 | 19 |
|0100 @RESET |
| 20 | 20 |
|
| 21 | 21 |
#0080 =textarea.x1 #0060 =textarea.y1 #00c0 =textarea.x2 #0090 =textarea.y2 ,body =textarea.addr |
| 22 |
- ,redraw JSR |
|
| 23 |
- ,redraw-window JSR |
|
| 22 |
+ ,redraw JSR2 |
|
| 23 |
+ ,redraw-window JSR2 |
|
| 24 | 24 |
|
| 25 | 25 |
BRK |
| 26 | 26 |
|
| 27 | 27 |
|0200 @FRAME |
| 28 | 28 |
|
| 29 |
- ,do-cursor JSR |
|
| 30 |
- ,do-textarea JSR |
|
| 29 |
+ ,do-cursor JSR2 |
|
| 30 |
+ ,do-textarea JSR2 |
|
| 31 | 31 |
|
| 32 | 32 |
BRK |
| 33 | 33 |
|
| 34 | 34 |
@redraw-window |
| 35 | 35 |
|
| 36 |
- #0000 #0000 ~dev/screen.width ~dev/screen.height #01 ,pattern ,tile-rect JSR |
|
| 36 |
+ #0000 #0000 ~dev/screen.width ~dev/screen.height #01 ,pattern ,tile-rect JSR2 |
|
| 37 | 37 |
( dropshadow ) |
| 38 |
- ~textarea.x2 #0001 ADD2 ~textarea.y1 ~textarea.x2 #0004 ADD2 ~textarea.y2 #0004 ADD2 #01 ,fill-rect JSR |
|
| 39 |
- ~textarea.x1 ~textarea.y2 #0001 ADD2 ~textarea.x2 #0001 ADD2 ~textarea.y2 #0004 ADD2 #01 ,fill-rect JSR |
|
| 40 |
- ~textarea.x1 #0001 SUB2 ~textarea.y1 #0001 SUB2 ~textarea.x2 ~textarea.y2 #00 ,line-rect JSR |
|
| 41 |
- ~textarea.x1 #0002 SUB2 ~textarea.y1 #0002 SUB2 ~textarea.x2 #0001 ADD2 ~textarea.y2 #0001 ADD2 #01 ,line-rect JSR |
|
| 38 |
+ ~textarea.x2 #0001 ADD2 ~textarea.y1 ~textarea.x2 #0004 ADD2 ~textarea.y2 #0004 ADD2 #01 ,fill-rect JSR2 |
|
| 39 |
+ ~textarea.x1 ~textarea.y2 #0001 ADD2 ~textarea.x2 #0001 ADD2 ~textarea.y2 #0004 ADD2 #01 ,fill-rect JSR2 |
|
| 40 |
+ ~textarea.x1 #0001 SUB2 ~textarea.y1 #0001 SUB2 ~textarea.x2 ~textarea.y2 #00 ,line-rect JSR2 |
|
| 41 |
+ ~textarea.x1 #0002 SUB2 ~textarea.y1 #0002 SUB2 ~textarea.x2 #0001 ADD2 ~textarea.y2 #0001 ADD2 #01 ,line-rect JSR2 |
|
| 42 | 42 |
|
| 43 | 43 |
RTS |
| 44 | 44 |
|
| 45 | 45 |
@redraw |
| 46 | 46 |
|
| 47 |
- ~textarea.x1 ~textarea.y1 ~textarea.x2 ~textarea.y2 #01 ,fill-rect JSR |
|
| 48 |
- ~textarea.x1 ~textarea.y1 #04 ~textarea.addr ,draw-textarea JSR |
|
| 47 |
+ ~textarea.x1 ~textarea.y1 ~textarea.x2 ~textarea.y2 #01 ,fill-rect JSR2 |
|
| 48 |
+ ~textarea.x1 ~textarea.y1 #04 ~textarea.addr ,draw-textarea JSR2 |
|
| 49 | 49 |
|
| 50 | 50 |
RTS |
| 51 | 51 |
|
| 52 | 52 |
@blink-cursor |
| 53 | 53 |
|
| 54 |
- ,skip ~timer #10 LTH JMP? POP2 |
|
| 54 |
+ ,skip ~timer #10 LTH JMP2? POP2 |
|
| 55 | 55 |
#00 =timer |
| 56 | 56 |
~blink #00 EQU =blink |
| 57 | 57 |
,cursor =dev/sprite.addr |
| ... | ... |
@@ -70,9 +70,9 @@ RTS |
| 70 | 70 |
@tile-rect-hor |
| 71 | 71 |
( draw ) ~color =dev/sprite.color |
| 72 | 72 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 73 |
- ,tile-rect-hor ~dev/sprite.x ~rect.x2 LTH2 JMP? POP2 |
|
| 73 |
+ ,tile-rect-hor ~dev/sprite.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 74 | 74 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 75 |
- ,tile-rect-ver ~dev/sprite.y ~rect.y2 LTH2 JMP? POP2 |
|
| 75 |
+ ,tile-rect-ver ~dev/sprite.y ~rect.y2 LTH2 JMP2? POP2 |
|
| 76 | 76 |
|
| 77 | 77 |
RTS |
| 78 | 78 |
|
| ... | ... |
@@ -84,9 +84,9 @@ RTS |
| 84 | 84 |
@fill-rect-hor |
| 85 | 85 |
( draw ) ~color =dev/screen.color |
| 86 | 86 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 87 |
- ,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 87 |
+ ,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 88 | 88 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 89 |
- ,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP? POP2 |
|
| 89 |
+ ,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP2? POP2 |
|
| 90 | 90 |
|
| 91 | 91 |
RTS |
| 92 | 92 |
|
| ... | ... |
@@ -97,13 +97,13 @@ RTS |
| 97 | 97 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 98 | 98 |
( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color |
| 99 | 99 |
( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color |
| 100 |
- ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 100 |
+ ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 101 | 101 |
~rect.y1 =dev/screen.y |
| 102 | 102 |
@line-rect-ver |
| 103 | 103 |
( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color |
| 104 | 104 |
( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color |
| 105 | 105 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 106 |
- ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP? POP2 |
|
| 106 |
+ ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
| 107 | 107 |
|
| 108 | 108 |
RTS |
| 109 | 109 |
|
| ... | ... |
@@ -115,7 +115,7 @@ RTS |
| 115 | 115 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~textarea.color =dev/sprite.color |
| 116 | 116 |
|
| 117 | 117 |
( detect linebreaks ) |
| 118 |
- DUP2 LDR #0d NEQ ,no-return ROT JMP? POP2 |
|
| 118 |
+ DUP2 LDR #0d NEQ ,no-return ROT JMP2? POP2 |
|
| 119 | 119 |
~textarea.x1 =dev/sprite.x |
| 120 | 120 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 121 | 121 |
( decr ) ~dev/sprite.x #0008 SUB2 =dev/sprite.x |
| ... | ... |
@@ -124,27 +124,27 @@ RTS |
| 124 | 124 |
( incr ) #0001 ADD2 |
| 125 | 125 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 126 | 126 |
|
| 127 |
- DUP2 LDR #00 NEQ ,draw-textarea-left-loop ROT JMP? POP2 |
|
| 127 |
+ DUP2 LDR #00 NEQ ,draw-textarea-left-loop ROT JMP2? POP2 |
|
| 128 | 128 |
POP2 |
| 129 | 129 |
|
| 130 | 130 |
RTS |
| 131 | 131 |
|
| 132 | 132 |
@do-textarea |
| 133 | 133 |
|
| 134 |
- ( ,blink-cursor JSR ) |
|
| 135 |
- ,do-textarea-end ~dev/key #00 EQU JMP? POP2 ( skip on no key ) |
|
| 134 |
+ ( ,blink-cursor JSR2 ) |
|
| 135 |
+ ,do-textarea-end ~dev/key #00 EQU JMP2? POP2 ( skip on no key ) |
|
| 136 | 136 |
( backspace ) |
| 137 |
- ,any-key ~dev/key #08 NEQ JMP? POP2 |
|
| 138 |
- ,input-end ~textarea.cursor #00 EQU JMP? POP2 |
|
| 137 |
+ ,any-key ~dev/key #08 NEQ JMP2? POP2 |
|
| 138 |
+ ,input-end ~textarea.cursor #00 EQU JMP2? POP2 |
|
| 139 | 139 |
( decr ) ~textarea.cursor #01 SUB =textarea.cursor |
| 140 | 140 |
#00 ~textarea.addr #00 ~textarea.cursor ADD2 STR |
| 141 |
- ,input-end JMP |
|
| 141 |
+ ,input-end JMP2 |
|
| 142 | 142 |
@any-key |
| 143 | 143 |
~dev/key ~textarea.addr #00 ~textarea.cursor ADD2 STR |
| 144 | 144 |
( incr ) ~textarea.cursor #01 ADD =textarea.cursor |
| 145 | 145 |
@input-end |
| 146 | 146 |
#00 =dev/key ( release key ) |
| 147 |
- ,redraw JSR |
|
| 147 |
+ ,redraw JSR2 |
|
| 148 | 148 |
( add cursor ) |
| 149 | 149 |
,cursor =dev/sprite.addr |
| 150 | 150 |
#06 =dev/sprite.color |
| ... | ... |
@@ -154,10 +154,10 @@ RTS |
| 154 | 154 |
|
| 155 | 155 |
@do-cursor |
| 156 | 156 |
|
| 157 |
- ,skip-drag ~dev/mouse.state #01 NEQ JMP? POP2 |
|
| 157 |
+ ,skip-drag ~dev/mouse.state #01 NEQ JMP2? POP2 |
|
| 158 | 158 |
~mouse.x =textarea.x1 ~mouse.y =textarea.y1 |
| 159 |
- ,redraw-window JSR |
|
| 160 |
- ,redraw JSR |
|
| 159 |
+ ,redraw-window JSR2 |
|
| 160 |
+ ,redraw JSR2 |
|
| 161 | 161 |
@skip-drag |
| 162 | 162 |
|
| 163 | 163 |
~mouse.x ~dev/mouse.x NEQU2 |
| ... | ... |
@@ -166,10 +166,10 @@ RTS |
| 166 | 166 |
#0000 EQU2 RTS? ( Return if unchanged ) |
| 167 | 167 |
|
| 168 | 168 |
( clear last cursor ) |
| 169 |
- #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 169 |
+ #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 170 | 170 |
( record mouse positions ) |
| 171 | 171 |
~dev/mouse.x =mouse.x ~dev/mouse.y =mouse.y |
| 172 |
- #12 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 172 |
+ #12 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 173 | 173 |
|
| 174 | 174 |
|
| 175 | 175 |
RTS |
| ... | ... |
@@ -20,43 +20,43 @@ |
| 20 | 20 |
~dev/screen.height #0038 SUB2 =cat.y |
| 21 | 21 |
#01 =color |
| 22 | 22 |
( draw polycat ) |
| 23 |
- ,draw-polycat JSR |
|
| 23 |
+ ,draw-polycat JSR2 |
|
| 24 | 24 |
|
| 25 | 25 |
BRK |
| 26 | 26 |
|
| 27 | 27 |
|0200 @FRAME |
| 28 | 28 |
|
| 29 |
- ,draw-cursor JSR |
|
| 29 |
+ ,draw-cursor JSR2 |
|
| 30 | 30 |
|
| 31 | 31 |
( reset timer -> move cat tail ) |
| 32 |
- ,no-click ~dev/mouse.state #00 EQU JMP? POP2 |
|
| 32 |
+ ,no-click ~dev/mouse.state #00 EQU JMP2? POP2 |
|
| 33 | 33 |
#50 =timer |
| 34 | 34 |
@no-click |
| 35 | 35 |
( detect click ) |
| 36 |
- ,no-click12 ~dev/mouse.state #11 NEQ JMP? POP2 |
|
| 37 |
- #0058 #0040 #01 ,mouse12_text ,draw-label JSR |
|
| 38 |
- #10 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 39 |
- ~color ,mouse12_icn #0048 #0040 ,draw-sprite JSR |
|
| 40 |
- ,end-click JMP |
|
| 36 |
+ ,no-click12 ~dev/mouse.state #11 NEQ JMP2? POP2 |
|
| 37 |
+ #0058 #0040 #01 ,mouse12_text ,draw-label JSR2 |
|
| 38 |
+ #10 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 39 |
+ ~color ,mouse12_icn #0048 #0040 ,draw-sprite JSR2 |
|
| 40 |
+ ,end-click JMP2 |
|
| 41 | 41 |
@no-click12 |
| 42 |
- ,no-click1 ~dev/mouse.state #01 NEQ JMP? POP2 |
|
| 43 |
- #0058 #0040 #01 ,mouse1_text ,draw-label JSR |
|
| 44 |
- #12 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 45 |
- ~color ,mouse1_icn #0048 #0040 ,draw-sprite JSR |
|
| 46 |
- ,end-click JMP |
|
| 42 |
+ ,no-click1 ~dev/mouse.state #01 NEQ JMP2? POP2 |
|
| 43 |
+ #0058 #0040 #01 ,mouse1_text ,draw-label JSR2 |
|
| 44 |
+ #12 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 45 |
+ ~color ,mouse1_icn #0048 #0040 ,draw-sprite JSR2 |
|
| 46 |
+ ,end-click JMP2 |
|
| 47 | 47 |
@no-click1 |
| 48 |
- ,no-click2 ~dev/mouse.state #10 NEQ JMP? POP2 |
|
| 49 |
- #0058 #0040 #01 ,mouse2_text ,draw-label JSR |
|
| 50 |
- #13 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 51 |
- ~color ,mouse2_icn #0048 #0040 ,draw-sprite JSR |
|
| 52 |
- ,end-click JMP |
|
| 48 |
+ ,no-click2 ~dev/mouse.state #10 NEQ JMP2? POP2 |
|
| 49 |
+ #0058 #0040 #01 ,mouse2_text ,draw-label JSR2 |
|
| 50 |
+ #13 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 51 |
+ ~color ,mouse2_icn #0048 #0040 ,draw-sprite JSR2 |
|
| 52 |
+ ,end-click JMP2 |
|
| 53 | 53 |
@no-click2 |
| 54 | 54 |
( default ) |
| 55 |
- #0058 #0040 #01 ,mouse0_text ,draw-label JSR |
|
| 56 |
- ~color ,mouse0_icn #0048 #0040 ,draw-sprite JSR |
|
| 55 |
+ #0058 #0040 #01 ,mouse0_text ,draw-label JSR2 |
|
| 56 |
+ ~color ,mouse0_icn #0048 #0040 ,draw-sprite JSR2 |
|
| 57 | 57 |
@end-click |
| 58 | 58 |
( animate ) |
| 59 |
- ,animate-polycat JSR |
|
| 59 |
+ ,animate-polycat JSR2 |
|
| 60 | 60 |
( update last pos ) |
| 61 | 61 |
~timer #01 ADD =timer |
| 62 | 62 |
|
| ... | ... |
@@ -70,57 +70,57 @@ BRK |
| 70 | 70 |
#0000 EQU2 RTS? ( Return if unchanged ) |
| 71 | 71 |
|
| 72 | 72 |
( clear last cursor ) |
| 73 |
- #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 73 |
+ #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 74 | 74 |
( record mouse positions ) |
| 75 | 75 |
~dev/mouse.x =mouse.x ~dev/mouse.y =mouse.y |
| 76 |
- #11 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 76 |
+ #11 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 77 | 77 |
|
| 78 | 78 |
RTS |
| 79 | 79 |
|
| 80 | 80 |
@draw-polycat |
| 81 | 81 |
|
| 82 | 82 |
( ears ) |
| 83 |
- ,polycat ~cat.x ~cat.y ,draw-sprite-chr JSR |
|
| 84 |
- ,polycat #0010 ADD2 ~cat.x #0008 ADD2 ~cat.y ,draw-sprite-chr JSR |
|
| 83 |
+ ,polycat ~cat.x ~cat.y ,draw-sprite-chr JSR2 |
|
| 84 |
+ ,polycat #0010 ADD2 ~cat.x #0008 ADD2 ~cat.y ,draw-sprite-chr JSR2 |
|
| 85 | 85 |
( eye ) |
| 86 |
- ,polycat #0020 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 87 |
- ,polycat #0030 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 86 |
+ ,polycat #0020 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 87 |
+ ,polycat #0030 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 88 | 88 |
( body ) |
| 89 |
- ,polycat #00a0 ADD2 ~cat.x ~cat.y #0010 ADD2 ,draw-sprite-chr JSR |
|
| 90 |
- ,polycat #00b0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR |
|
| 89 |
+ ,polycat #00a0 ADD2 ~cat.x ~cat.y #0010 ADD2 ,draw-sprite-chr JSR2 |
|
| 90 |
+ ,polycat #00b0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR2 |
|
| 91 | 91 |
|
| 92 | 92 |
RTS |
| 93 | 93 |
|
| 94 | 94 |
@animate-polycat |
| 95 | 95 |
|
| 96 | 96 |
( tail ) |
| 97 |
- ~timer #50 NEQ ,animate-polycat-tail-next0 ROT JMP? POP2 |
|
| 98 |
- ,polycat #00c0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR |
|
| 97 |
+ ~timer #50 NEQ ,animate-polycat-tail-next0 ROT JMP2? POP2 |
|
| 98 |
+ ,polycat #00c0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR2 |
|
| 99 | 99 |
@animate-polycat-tail-next0 |
| 100 |
- ~timer #58 NEQ ,animate-polycat-tail-next1 ROT JMP? POP2 |
|
| 101 |
- ,polycat #00d0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR |
|
| 100 |
+ ~timer #58 NEQ ,animate-polycat-tail-next1 ROT JMP2? POP2 |
|
| 101 |
+ ,polycat #00d0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR2 |
|
| 102 | 102 |
@animate-polycat-tail-next1 |
| 103 |
- ~timer #60 NEQ ,animate-polycat-tail-next2 ROT JMP? POP2 |
|
| 104 |
- ,polycat #00b0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR |
|
| 103 |
+ ~timer #60 NEQ ,animate-polycat-tail-next2 ROT JMP2? POP2 |
|
| 104 |
+ ,polycat #00b0 ADD2 ~cat.x #0008 ADD2 ~cat.y #0010 ADD2 ,draw-sprite-chr JSR2 |
|
| 105 | 105 |
@animate-polycat-tail-next2 |
| 106 | 106 |
( look-at ) |
| 107 |
- ~mouse.x ~cat.x #0008 ADD2 GTH2 ,animate-polycat-right ROT JMP? POP2 |
|
| 108 |
- ~mouse.y ~cat.y #0008 ADD2 GTH2 ,animate-polycat-left-down ROT JMP? POP2 |
|
| 109 |
- ,polycat #0040 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 110 |
- ,polycat #0050 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 107 |
+ ~mouse.x ~cat.x #0008 ADD2 GTH2 ,animate-polycat-right ROT JMP2? POP2 |
|
| 108 |
+ ~mouse.y ~cat.y #0008 ADD2 GTH2 ,animate-polycat-left-down ROT JMP2? POP2 |
|
| 109 |
+ ,polycat #0040 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 110 |
+ ,polycat #0050 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 111 | 111 |
RTS |
| 112 | 112 |
@animate-polycat-left-down |
| 113 |
- ,polycat #0020 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 114 |
- ,polycat #0030 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 113 |
+ ,polycat #0020 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 114 |
+ ,polycat #0030 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 115 | 115 |
RTS |
| 116 | 116 |
@animate-polycat-right |
| 117 |
- ~mouse.y ~cat.y #0008 ADD2 GTH2 ,animate-polycat-right-down ROT JMP? POP2 |
|
| 118 |
- ,polycat #0060 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 119 |
- ,polycat #0070 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 117 |
+ ~mouse.y ~cat.y #0008 ADD2 GTH2 ,animate-polycat-right-down ROT JMP2? POP2 |
|
| 118 |
+ ,polycat #0060 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 119 |
+ ,polycat #0070 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 120 | 120 |
RTS |
| 121 | 121 |
@animate-polycat-right-down |
| 122 |
- ,polycat #0080 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 123 |
- ,polycat #0090 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR |
|
| 122 |
+ ,polycat #0080 ADD2 ~cat.x ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 123 |
+ ,polycat #0090 ADD2 ~cat.x #0008 ADD2 ~cat.y #0008 ADD2 ,draw-sprite-chr JSR2 |
|
| 124 | 124 |
RTS |
| 125 | 125 |
|
| 126 | 126 |
RTS |
| ... | ... |
@@ -133,7 +133,7 @@ RTS |
| 133 | 133 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 134 | 134 |
( incr ) #0001 ADD2 |
| 135 | 135 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 136 |
- DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-loop ROT JMP? POP2 |
|
| 136 |
+ DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-loop ROT JMP2? POP2 |
|
| 137 | 137 |
POP2 |
| 138 | 138 |
|
| 139 | 139 |
RTS |
| ... | ... |
@@ -18,7 +18,7 @@ |
| 18 | 18 |
@draw-hor |
| 19 | 19 |
#03 ~i =dev/screen.x =dev/screen.color |
| 20 | 20 |
~i #0002 ADD2 =i ( increment ) |
| 21 |
- ~i ~dev/screen.width LTH2 ,draw-hor ROT JMP? POP2 |
|
| 21 |
+ ~i ~dev/screen.width LTH2 ,draw-hor ROT JMP2? POP2 |
|
| 22 | 22 |
|
| 23 | 23 |
( draw ver line ) |
| 24 | 24 |
#0000 =i |
| ... | ... |
@@ -26,13 +26,13 @@ |
| 26 | 26 |
@draw-ver |
| 27 | 27 |
#03 ~i =dev/screen.y =dev/screen.color |
| 28 | 28 |
~i #0002 ADD2 =i ( increment ) |
| 29 |
- ~i ~dev/screen.width LTH2 ,draw-ver ROT JMP? POP2 |
|
| 29 |
+ ~i ~dev/screen.width LTH2 ,draw-ver ROT JMP2? POP2 |
|
| 30 | 30 |
|
| 31 | 31 |
( draw blending modes ) |
| 32 | 32 |
@draw-blends |
| 33 |
- ~j ,icon #00 ~j #0008 MUL2 ~dev/screen.height #0010 SUB2 ,draw-sprite JSR |
|
| 33 |
+ ~j ,icon #00 ~j #0008 MUL2 ~dev/screen.height #0010 SUB2 ,draw-sprite JSR2 |
|
| 34 | 34 |
~j #01 ADD =j |
| 35 |
- ~j #10 LTH ,draw-blends ROT JMP? POP2 |
|
| 35 |
+ ~j #10 LTH ,draw-blends ROT JMP2? POP2 |
|
| 36 | 36 |
|
| 37 | 37 |
( draw pixel in the middle ) |
| 38 | 38 |
#01 ~centerx ~centery =dev/screen.y =dev/screen.x =dev/screen.color |
| ... | ... |
@@ -51,16 +51,16 @@ BRK |
| 51 | 51 |
|c000 @FRAME |
| 52 | 52 |
|
| 53 | 53 |
( update colors every 40 frames ) |
| 54 |
- ~timer #40 NEQ ,skip1 ROT JMP? POP2 |
|
| 54 |
+ ~timer #40 NEQ ,skip1 ROT JMP2? POP2 |
|
| 55 | 55 |
#0fac =fffa #f0bb =fffc #f053 =fff8 |
| 56 | 56 |
@skip1 |
| 57 |
- ~timer #80 NEQ ,skip2 ROT JMP? POP2 |
|
| 57 |
+ ~timer #80 NEQ ,skip2 ROT JMP2? POP2 |
|
| 58 | 58 |
#00fc =fffc #f0bb =fff8 #f053 =fffa |
| 59 | 59 |
@skip2 |
| 60 |
- ~timer #c0 NEQ ,skip3 ROT JMP? POP2 |
|
| 60 |
+ ~timer #c0 NEQ ,skip3 ROT JMP2? POP2 |
|
| 61 | 61 |
#000f =fff8 #0f0f =fffa #ff00 =fffc |
| 62 | 62 |
@skip3 |
| 63 |
- ~timer #00 NEQ ,skip4 ROT JMP? POP2 |
|
| 63 |
+ ~timer #00 NEQ ,skip4 ROT JMP2? POP2 |
|
| 64 | 64 |
#f0ac =fff8 #f0bb =fffa #f053 =fffc |
| 65 | 65 |
@skip4 |
| 66 | 66 |
~timer #01 ADD =timer |
| ... | ... |
@@ -28,26 +28,26 @@ BRK |
| 28 | 28 |
( matrix comparison ) |
| 29 | 29 |
~dev/mouse.x ~r1.x1 GTH2 ~dev/mouse.x ~r1.x2 LTH2 #0101 EQU2 |
| 30 | 30 |
~dev/mouse.y ~r1.y1 GTH2 ~dev/mouse.y ~r1.y2 LTH2 #0101 EQU2 |
| 31 |
- #0101 NEQ2 ,draw1 ROT JMP? POP2 #02 =color ,hand_icn =cursor |
|
| 32 |
- @draw1 ~r1.x1 ~r1.y1 ~r1.x2 ~r1.y2 ~color ,line-rect JSR |
|
| 31 |
+ #0101 NEQ2 ,draw1 ROT JMP2? POP2 #02 =color ,hand_icn =cursor |
|
| 32 |
+ @draw1 ~r1.x1 ~r1.y1 ~r1.x2 ~r1.y2 ~color ,line-rect JSR2 |
|
| 33 | 33 |
|
| 34 | 34 |
#01 =color |
| 35 | 35 |
( 2-step comparison ) |
| 36 |
- ,draw2 ~dev/mouse.x ~r2.x1 GTH2 ~dev/mouse.x ~r2.x2 LTH2 #0101 NEQ2 JMP? POP2 |
|
| 37 |
- ,draw2 ~dev/mouse.y ~r2.y1 GTH2 ~dev/mouse.y ~r2.y2 LTH2 #0101 NEQ2 JMP? POP2 |
|
| 36 |
+ ,draw2 ~dev/mouse.x ~r2.x1 GTH2 ~dev/mouse.x ~r2.x2 LTH2 #0101 NEQ2 JMP2? POP2 |
|
| 37 |
+ ,draw2 ~dev/mouse.y ~r2.y1 GTH2 ~dev/mouse.y ~r2.y2 LTH2 #0101 NEQ2 JMP2? POP2 |
|
| 38 | 38 |
#03 =color ,hand_icn =cursor |
| 39 |
- @draw2 ~r2.x1 ~r2.y1 ~r2.x2 ~r2.y2 ~color ,line-rect JSR |
|
| 39 |
+ @draw2 ~r2.x1 ~r2.y1 ~r2.x2 ~r2.y2 ~color ,line-rect JSR2 |
|
| 40 | 40 |
|
| 41 | 41 |
#01 =color |
| 42 | 42 |
( 4-step comparison ) |
| 43 |
- ,draw3 ~dev/mouse.x ~r3.x1 LTH2 JMP? POP2 |
|
| 44 |
- ,draw3 ~dev/mouse.x ~r3.x2 GTH2 JMP? POP2 |
|
| 45 |
- ,draw3 ~dev/mouse.y ~r3.y1 LTH2 JMP? POP2 |
|
| 46 |
- ,draw3 ~dev/mouse.y ~r3.y2 GTH2 JMP? POP2 |
|
| 43 |
+ ,draw3 ~dev/mouse.x ~r3.x1 LTH2 JMP2? POP2 |
|
| 44 |
+ ,draw3 ~dev/mouse.x ~r3.x2 GTH2 JMP2? POP2 |
|
| 45 |
+ ,draw3 ~dev/mouse.y ~r3.y1 LTH2 JMP2? POP2 |
|
| 46 |
+ ,draw3 ~dev/mouse.y ~r3.y2 GTH2 JMP2? POP2 |
|
| 47 | 47 |
#02 =color ,hand_icn =cursor |
| 48 |
- @draw3 ~r3.x1 ~r3.y1 ~r3.x2 ~r3.y2 ~color ,line-rect JSR |
|
| 48 |
+ @draw3 ~r3.x1 ~r3.y1 ~r3.x2 ~r3.y2 ~color ,line-rect JSR2 |
|
| 49 | 49 |
|
| 50 |
- ,draw-cursor JSR |
|
| 50 |
+ ,draw-cursor JSR2 |
|
| 51 | 51 |
|
| 52 | 52 |
BRK |
| 53 | 53 |
|
| ... | ... |
@@ -59,10 +59,10 @@ BRK |
| 59 | 59 |
#0000 EQU2 RTS? ( Return if unchanged ) |
| 60 | 60 |
|
| 61 | 61 |
( clear last cursor ) |
| 62 |
- #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 62 |
+ #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 63 | 63 |
( record mouse positions ) |
| 64 | 64 |
~dev/mouse.x =mouse.x ~dev/mouse.y =mouse.y |
| 65 |
- #11 ~cursor ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 65 |
+ #11 ~cursor ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 66 | 66 |
|
| 67 | 67 |
RTS |
| 68 | 68 |
|
| ... | ... |
@@ -73,13 +73,13 @@ RTS |
| 73 | 73 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 74 | 74 |
( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color |
| 75 | 75 |
( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color |
| 76 |
- ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 76 |
+ ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 77 | 77 |
~rect.y1 =dev/screen.y |
| 78 | 78 |
@line-rect-ver |
| 79 | 79 |
( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color |
| 80 | 80 |
( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color |
| 81 | 81 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 82 |
- ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP? POP2 |
|
| 82 |
+ ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
| 83 | 83 |
|
| 84 | 84 |
RTS |
| 85 | 85 |
|
| ... | ... |
@@ -24,13 +24,13 @@ |
| 24 | 24 |
@draw-ver |
| 25 | 25 |
#03 ~i =dev/screen.y =dev/screen.color |
| 26 | 26 |
~i #0002 ADD2 =i ( increment ) |
| 27 |
- ~i ~dev/screen.width LTH2 ,draw-ver ROT JMP? POP2 |
|
| 27 |
+ ~i ~dev/screen.width LTH2 ,draw-ver ROT JMP2? POP2 |
|
| 28 | 28 |
|
| 29 |
- ~center.x ~center.y #0010 SUB2 #0c ,text1 ,draw-label-left JSR |
|
| 30 |
- ~center.x ~center.y #0c ,text2 ,draw-label-middle JSR |
|
| 31 |
- ~center.x ~center.y #0010 ADD2 #0c ,text3 ,draw-label-right JSR |
|
| 32 |
- ~center.x ~center.y #0020 ADD2 #0c ,text4 ,draw-label-middle JSR |
|
| 33 |
- ~center.x ~center.y #0030 ADD2 #0c ,text5 ,draw-label-middle JSR |
|
| 29 |
+ ~center.x ~center.y #0010 SUB2 #0c ,text1 ,draw-label-left JSR2 |
|
| 30 |
+ ~center.x ~center.y #0c ,text2 ,draw-label-middle JSR2 |
|
| 31 |
+ ~center.x ~center.y #0010 ADD2 #0c ,text3 ,draw-label-right JSR2 |
|
| 32 |
+ ~center.x ~center.y #0020 ADD2 #0c ,text4 ,draw-label-middle JSR2 |
|
| 33 |
+ ~center.x ~center.y #0030 ADD2 #0c ,text5 ,draw-label-middle JSR2 |
|
| 34 | 34 |
|
| 35 | 35 |
BRK |
| 36 | 36 |
|
| ... | ... |
@@ -42,7 +42,7 @@ BRK |
| 42 | 42 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 43 | 43 |
( incr ) #0001 ADD2 |
| 44 | 44 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 45 |
- DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-left-loop ROT JMP? POP2 |
|
| 45 |
+ DUP2 LDR #00 NEQ ,draw-label-left-loop ROT JMP2? POP2 |
|
| 46 | 46 |
POP2 |
| 47 | 47 |
|
| 48 | 48 |
RTS |
| ... | ... |
@@ -50,13 +50,13 @@ RTS |
| 50 | 50 |
@draw-label-middle ( x y color addr ) |
| 51 | 51 |
|
| 52 | 52 |
( load ) =label.addr =label.color =dev/sprite.y |
| 53 |
- ( align ) ~label.addr ,get-text-length JSR #0008 MUL2 #0002 DIV2 SUB2 =dev/sprite.x |
|
| 53 |
+ ( align ) ~label.addr ,get-text-length JSR2 #0008 MUL2 #0002 DIV2 SUB2 =dev/sprite.x |
|
| 54 | 54 |
~label.addr |
| 55 | 55 |
@draw-label-middle-loop |
| 56 | 56 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 57 | 57 |
( incr ) #0001 ADD2 |
| 58 | 58 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 59 |
- DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-middle-loop ROT JMP? POP2 |
|
| 59 |
+ DUP2 LDR #00 NEQ ,draw-label-middle-loop ROT JMP2? POP2 |
|
| 60 | 60 |
POP2 |
| 61 | 61 |
|
| 62 | 62 |
RTS |
| ... | ... |
@@ -64,13 +64,13 @@ RTS |
| 64 | 64 |
@draw-label-right ( x y color addr ) |
| 65 | 65 |
|
| 66 | 66 |
( load ) =label.addr =label.color =dev/sprite.y |
| 67 |
- ( align ) ~label.addr ,get-text-length JSR #0008 MUL2 SUB2 =dev/sprite.x |
|
| 67 |
+ ( align ) ~label.addr ,get-text-length JSR2 #0008 MUL2 SUB2 #0008 SUB2 =dev/sprite.x |
|
| 68 | 68 |
~label.addr |
| 69 | 69 |
@draw-label-right-loop |
| 70 | 70 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 71 | 71 |
( incr ) #0001 ADD2 |
| 72 | 72 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 73 |
- DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-right-loop ROT JMP? POP2 |
|
| 73 |
+ DUP2 LDR #00 NEQ ,draw-label-right-loop ROT JMP2? POP2 |
|
| 74 | 74 |
POP2 |
| 75 | 75 |
|
| 76 | 76 |
RTS |
| ... | ... |
@@ -80,7 +80,7 @@ RTS |
| 80 | 80 |
#0000 ( counter ) |
| 81 | 81 |
@get-text-length-loop |
| 82 | 82 |
( incr ) #0001 ADD2 OVR2 OVR2 ADD2 |
| 83 |
- LDR #00 NEQ ,get-text-length-loop ROT JMP? POP2 |
|
| 83 |
+ LDR #00 NEQ ,get-text-length-loop ROT JMP2? POP2 |
|
| 84 | 84 |
SWP2 POP2 #0001 SUB2 |
| 85 | 85 |
|
| 86 | 86 |
RTS |
| ... | ... |
@@ -9,9 +9,9 @@ |
| 9 | 9 |
|
| 10 | 10 |
|0100 @RESET |
| 11 | 11 |
|
| 12 |
- #0000 #0000 ~dev/screen.width ~dev/screen.height #01 ,pict_large ,draw-picture JSR |
|
| 13 |
- #0008 #0010 #0080 #0080 #01 ,pict_medium ,draw-picture JSR |
|
| 14 |
- #00d0 #0090 #0020 #0020 #0a ,pict_small ,draw-picture JSR |
|
| 12 |
+ #0000 #0000 #0100 #0100 #01 ,pict_large ,draw-picture JSR2 |
|
| 13 |
+ #0098 #0060 #0080 #0080 #01 ,pict_medium ,draw-picture JSR2 |
|
| 14 |
+ #0020 #0090 #0020 #0020 #0a ,pict_small ,draw-picture JSR2 |
|
| 15 | 15 |
|
| 16 | 16 |
BRK |
| 17 | 17 |
|
| ... | ... |
@@ -24,9 +24,9 @@ BRK |
| 24 | 24 |
( draw ) ~pict.color =dev/sprite.color |
| 25 | 25 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 26 | 26 |
( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
| 27 |
- ,draw-picture-hor ~dev/sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP? POP2 |
|
| 27 |
+ ,draw-picture-hor ~dev/sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP2? POP2 |
|
| 28 | 28 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 29 |
- ,draw-picture-ver ~dev/sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP? POP2 |
|
| 29 |
+ ,draw-picture-ver ~dev/sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP2? POP2 |
|
| 30 | 30 |
|
| 31 | 31 |
RTS |
| 32 | 32 |
|
| ... | ... |
@@ -15,22 +15,22 @@ |
| 15 | 15 |
|
| 16 | 16 |
|0100 @RESET |
| 17 | 17 |
|
| 18 |
- #0010 #0020 #0040 #0060 #01 ,fill-rect JSR |
|
| 19 |
- #0020 #0030 #0050 #0070 #02 ,fill-rect JSR |
|
| 20 |
- #0030 #0040 #0060 #0080 #03 ,fill-rect JSR |
|
| 21 |
- #0070 #0020 #00a0 #0060 #01 ,line-rect JSR |
|
| 22 |
- #0080 #0030 #00b0 #0070 #02 ,line-rect JSR |
|
| 23 |
- #0090 #0040 #00c0 #0080 #03 ,line-rect JSR |
|
| 24 |
- |
|
| 25 |
- #0000 #0080 #0020 #0020 #01 ,pict_small ,draw-picture JSR |
|
| 26 |
- #0010 #0088 #0020 #0020 #02 ,pict_small ,draw-picture JSR |
|
| 27 |
- #0020 #0090 #0020 #0020 #03 ,pict_small ,draw-picture JSR |
|
| 28 |
- #0030 #0098 #0020 #0020 #04 ,pict_small ,draw-picture JSR |
|
| 29 |
- |
|
| 30 |
- #0028 #0068 #01 ,text ,draw-label JSR |
|
| 31 |
- #0038 #0078 #02 ,text ,draw-label JSR |
|
| 32 |
- #0048 #0088 #03 ,text ,draw-label JSR |
|
| 33 |
- #0058 #0098 #04 ,text ,draw-label JSR |
|
| 18 |
+ #0010 #0020 #0040 #0060 #01 ,fill-rect JSR2 |
|
| 19 |
+ #0020 #0030 #0050 #0070 #02 ,fill-rect JSR2 |
|
| 20 |
+ #0030 #0040 #0060 #0080 #03 ,fill-rect JSR2 |
|
| 21 |
+ #0070 #0020 #00a0 #0060 #01 ,line-rect JSR2 |
|
| 22 |
+ #0080 #0030 #00b0 #0070 #02 ,line-rect JSR2 |
|
| 23 |
+ #0090 #0040 #00c0 #0080 #03 ,line-rect JSR2 |
|
| 24 |
+ |
|
| 25 |
+ #0000 #0080 #0020 #0020 #01 ,pict_small ,draw-picture JSR2 |
|
| 26 |
+ #0010 #0088 #0020 #0020 #02 ,pict_small ,draw-picture JSR2 |
|
| 27 |
+ #0020 #0090 #0020 #0020 #03 ,pict_small ,draw-picture JSR2 |
|
| 28 |
+ #0030 #0098 #0020 #0020 #04 ,pict_small ,draw-picture JSR2 |
|
| 29 |
+ |
|
| 30 |
+ #0028 #0068 #01 ,text ,draw-label JSR2 |
|
| 31 |
+ #0038 #0078 #02 ,text ,draw-label JSR2 |
|
| 32 |
+ #0048 #0088 #03 ,text ,draw-label JSR2 |
|
| 33 |
+ #0058 #0098 #04 ,text ,draw-label JSR2 |
|
| 34 | 34 |
|
| 35 | 35 |
BRK |
| 36 | 36 |
|
| ... | ... |
@@ -41,13 +41,13 @@ BRK |
| 41 | 41 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 42 | 42 |
( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color |
| 43 | 43 |
( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color |
| 44 |
- ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 44 |
+ ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 45 | 45 |
~rect.y1 =dev/screen.y |
| 46 | 46 |
@line-rect-ver |
| 47 | 47 |
( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color |
| 48 | 48 |
( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color |
| 49 | 49 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 50 |
- ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP? POP2 |
|
| 50 |
+ ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
| 51 | 51 |
|
| 52 | 52 |
RTS |
| 53 | 53 |
|
| ... | ... |
@@ -59,9 +59,9 @@ RTS |
| 59 | 59 |
@fill-rect-hor |
| 60 | 60 |
( draw ) ~color =dev/screen.color |
| 61 | 61 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 62 |
- ,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 62 |
+ ,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 63 | 63 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 64 |
- ,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP? POP2 |
|
| 64 |
+ ,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP2? POP2 |
|
| 65 | 65 |
|
| 66 | 66 |
RTS |
| 67 | 67 |
|
| ... | ... |
@@ -74,9 +74,9 @@ RTS |
| 74 | 74 |
( draw ) ~pict.color =dev/sprite.color |
| 75 | 75 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 76 | 76 |
( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
| 77 |
- ,draw-picture-hor ~dev/sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP? POP2 |
|
| 77 |
+ ,draw-picture-hor ~dev/sprite.x ~pict.width ~pict.x ADD2 LTH2 JMP2? POP2 |
|
| 78 | 78 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 79 |
- ,draw-picture-ver ~dev/sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP? POP2 |
|
| 79 |
+ ,draw-picture-ver ~dev/sprite.y ~pict.height ~pict.y ADD2 LTH2 JMP2? POP2 |
|
| 80 | 80 |
|
| 81 | 81 |
RTS |
| 82 | 82 |
|
| ... | ... |
@@ -87,7 +87,7 @@ RTS |
| 87 | 87 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 88 | 88 |
( incr ) #0001 ADD2 |
| 89 | 89 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 90 |
- DUP2 LDR #00 NEQ ,draw-label-loop ROT JMP? POP2 |
|
| 90 |
+ DUP2 LDR #00 NEQ ,draw-label-loop ROT JMP2? POP2 |
|
| 91 | 91 |
POP2 |
| 92 | 92 |
|
| 93 | 93 |
RTS |
| ... | ... |
@@ -31,51 +31,51 @@ |
| 31 | 31 |
( starting addr ) |
| 32 | 32 |
,pattern =editor.addr |
| 33 | 33 |
|
| 34 |
- ,draw-window JSR |
|
| 35 |
- ,draw-editor JSR |
|
| 34 |
+ ,draw-window JSR2 |
|
| 35 |
+ ,draw-editor JSR2 |
|
| 36 | 36 |
|
| 37 | 37 |
BRK |
| 38 | 38 |
|
| 39 | 39 |
|0200 @FRAME |
| 40 | 40 |
|
| 41 |
- ,no-ctrl ~dev/ctrl.buttons #00 EQU JMP? POP2 |
|
| 41 |
+ ,no-ctrl ~dev/ctrl.buttons #00 EQU JMP2? POP2 |
|
| 42 | 42 |
|
| 43 |
- ,no-ctrl-up ~dev/ctrl.buttons #10 EQU JMP? POP2 |
|
| 43 |
+ ,no-ctrl-up ~dev/ctrl.buttons #10 EQU JMP2? POP2 |
|
| 44 | 44 |
~editor.addr #0001 ADD2 =editor.addr |
| 45 |
- ,draw-window JSR |
|
| 46 |
- ,draw-editor JSR |
|
| 45 |
+ ,draw-window JSR2 |
|
| 46 |
+ ,draw-editor JSR2 |
|
| 47 | 47 |
@no-ctrl-up |
| 48 | 48 |
|
| 49 |
- ,no-ctrl-down ~dev/ctrl.buttons #20 EQU JMP? POP2 |
|
| 49 |
+ ,no-ctrl-down ~dev/ctrl.buttons #20 EQU JMP2? POP2 |
|
| 50 | 50 |
~editor.addr #0001 SUB2 =editor.addr |
| 51 |
- ,draw-window JSR |
|
| 52 |
- ,draw-editor JSR |
|
| 51 |
+ ,draw-window JSR2 |
|
| 52 |
+ ,draw-editor JSR2 |
|
| 53 | 53 |
@no-ctrl-down |
| 54 | 54 |
|
| 55 | 55 |
@no-ctrl |
| 56 | 56 |
|
| 57 |
- ,no-click ~dev/mouse.state #00 EQU JMP? POP2 |
|
| 57 |
+ ,no-click ~dev/mouse.state #00 EQU JMP2? POP2 |
|
| 58 | 58 |
|
| 59 | 59 |
( load ) ~editor.addr ~dev/mouse.y ~editor.y1 SUB2 #0008 DIV2 ADD2 LDR |
| 60 | 60 |
( mask ) #01 #07 ~dev/mouse.x ~editor.x1 SUB2 #0008 DIV2 SWP POP SUB ROL |
| 61 | 61 |
XOR |
| 62 | 62 |
( save ) ~editor.addr ~dev/mouse.y ~editor.y1 SUB2 #0008 DIV2 ADD2 STR |
| 63 | 63 |
|
| 64 |
- ,draw-window JSR |
|
| 65 |
- ,draw-editor JSR |
|
| 64 |
+ ,draw-window JSR2 |
|
| 65 |
+ ,draw-editor JSR2 |
|
| 66 | 66 |
|
| 67 | 67 |
@no-click |
| 68 | 68 |
|
| 69 |
- ,draw-cursor JSR |
|
| 69 |
+ ,draw-cursor JSR2 |
|
| 70 | 70 |
|
| 71 | 71 |
BRK |
| 72 | 72 |
|
| 73 | 73 |
@draw-window |
| 74 | 74 |
|
| 75 |
- ( desktop ) #0000 #0000 ~dev/screen.width ~dev/screen.height #03 ~editor.addr ,tile-rect JSR |
|
| 76 |
- ( outline ) ~window.x1 #0001 SUB2 ~window.y1 #0001 SUB2 ~window.x2 ~window.y2 #01 ,line-rect JSR |
|
| 77 |
- ( background ) ~window.x1 ~window.y1 ~window.x2 ~window.y2 #02 ,fill-rect JSR |
|
| 78 |
- ( label ) ~window.x1 ~window.y1 #04 ,window_name ,draw-label-left JSR |
|
| 75 |
+ ( desktop ) #0000 #0000 ~dev/screen.width ~dev/screen.height #03 ~editor.addr ,tile-rect JSR2 |
|
| 76 |
+ ( outline ) ~window.x1 #0001 SUB2 ~window.y1 #0001 SUB2 ~window.x2 ~window.y2 #01 ,line-rect JSR2 |
|
| 77 |
+ ( background ) ~window.x1 ~window.y1 ~window.x2 ~window.y2 #02 ,fill-rect JSR2 |
|
| 78 |
+ ( label ) ~window.x1 ~window.y1 #04 ,window_name ,draw-label-left JSR2 |
|
| 79 | 79 |
|
| 80 | 80 |
RTS |
| 81 | 81 |
|
| ... | ... |
@@ -99,10 +99,10 @@ RTS |
| 99 | 99 |
( draw ) #08 =dev/sprite.color |
| 100 | 100 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 101 | 101 |
( incr ) ~pixel.x #01 ADD =pixel.x |
| 102 |
- ,redraw-hor ~dev/sprite.x ~editor.x1 #0040 ADD2 LTH2 JMP? POP2 |
|
| 102 |
+ ,redraw-hor ~dev/sprite.x ~editor.x1 #0040 ADD2 LTH2 JMP2? POP2 |
|
| 103 | 103 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 104 | 104 |
( incr ) ~pixel.y #01 ADD =pixel.y |
| 105 |
- ,redraw-ver ~dev/sprite.y ~editor.y1 #0040 ADD2 LTH2 JMP? POP2 |
|
| 105 |
+ ,redraw-ver ~dev/sprite.y ~editor.y1 #0040 ADD2 LTH2 JMP2? POP2 |
|
| 106 | 106 |
|
| 107 | 107 |
~editor.addr =dev/sprite.addr |
| 108 | 108 |
~window.y1 =dev/sprite.y |
| ... | ... |
@@ -110,14 +110,14 @@ RTS |
| 110 | 110 |
( draw ) #01 =dev/sprite.color |
| 111 | 111 |
|
| 112 | 112 |
( TODO: Make a loop.. ) |
| 113 |
- ~window.x1 #0058 ADD2 ~window.y1 #0010 ADD2 #08 ~editor.addr ,draw-byte JSR |
|
| 114 |
- ~window.x1 #0058 ADD2 ~window.y1 #0018 ADD2 #08 ~editor.addr #0001 ADD2 ,draw-byte JSR |
|
| 115 |
- ~window.x1 #0058 ADD2 ~window.y1 #0020 ADD2 #08 ~editor.addr #0002 ADD2 ,draw-byte JSR |
|
| 116 |
- ~window.x1 #0058 ADD2 ~window.y1 #0028 ADD2 #08 ~editor.addr #0003 ADD2 ,draw-byte JSR |
|
| 117 |
- ~window.x1 #0058 ADD2 ~window.y1 #0030 ADD2 #08 ~editor.addr #0004 ADD2 ,draw-byte JSR |
|
| 118 |
- ~window.x1 #0058 ADD2 ~window.y1 #0038 ADD2 #08 ~editor.addr #0005 ADD2 ,draw-byte JSR |
|
| 119 |
- ~window.x1 #0058 ADD2 ~window.y1 #0040 ADD2 #08 ~editor.addr #0006 ADD2 ,draw-byte JSR |
|
| 120 |
- ~window.x1 #0058 ADD2 ~window.y1 #0048 ADD2 #08 ~editor.addr #0007 ADD2 ,draw-byte JSR |
|
| 113 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0010 ADD2 #08 ~editor.addr ,draw-byte JSR2 |
|
| 114 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0018 ADD2 #08 ~editor.addr #0001 ADD2 ,draw-byte JSR2 |
|
| 115 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0020 ADD2 #08 ~editor.addr #0002 ADD2 ,draw-byte JSR2 |
|
| 116 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0028 ADD2 #08 ~editor.addr #0003 ADD2 ,draw-byte JSR2 |
|
| 117 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0030 ADD2 #08 ~editor.addr #0004 ADD2 ,draw-byte JSR2 |
|
| 118 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0038 ADD2 #08 ~editor.addr #0005 ADD2 ,draw-byte JSR2 |
|
| 119 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0040 ADD2 #08 ~editor.addr #0006 ADD2 ,draw-byte JSR2 |
|
| 120 |
+ ~window.x1 #0058 ADD2 ~window.y1 #0048 ADD2 #08 ~editor.addr #0007 ADD2 ,draw-byte JSR2 |
|
| 121 | 121 |
|
| 122 | 122 |
RTS |
| 123 | 123 |
|
| ... | ... |
@@ -129,7 +129,7 @@ RTS |
| 129 | 129 |
( draw ) DUP2 LDR #00 SWP #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 130 | 130 |
( incr ) #0001 ADD2 |
| 131 | 131 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 132 |
- DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-left-loop ROT JMP? POP2 |
|
| 132 |
+ DUP2 #0001 ADD2 LDR #00 NEQ ,draw-label-left-loop ROT JMP2? POP2 |
|
| 133 | 133 |
POP2 |
| 134 | 134 |
|
| 135 | 135 |
RTS |
| ... | ... |
@@ -151,9 +151,9 @@ RTS |
| 151 | 151 |
@fill-rect-hor |
| 152 | 152 |
( draw ) ~color =dev/screen.color |
| 153 | 153 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 154 |
- ,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 154 |
+ ,fill-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 155 | 155 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 156 |
- ,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP? POP2 |
|
| 156 |
+ ,fill-rect-ver ~dev/screen.y ~rect.y2 LTH2 JMP2? POP2 |
|
| 157 | 157 |
|
| 158 | 158 |
RTS |
| 159 | 159 |
|
| ... | ... |
@@ -164,13 +164,13 @@ RTS |
| 164 | 164 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 165 | 165 |
( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color |
| 166 | 166 |
( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color |
| 167 |
- ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 167 |
+ ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 168 | 168 |
~rect.y1 =dev/screen.y |
| 169 | 169 |
@line-rect-ver |
| 170 | 170 |
( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color |
| 171 | 171 |
( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color |
| 172 | 172 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 173 |
- ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP? POP2 |
|
| 173 |
+ ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
| 174 | 174 |
|
| 175 | 175 |
RTS |
| 176 | 176 |
|
| ... | ... |
@@ -183,9 +183,9 @@ RTS |
| 183 | 183 |
@tile-rect-hor |
| 184 | 184 |
( draw ) ~color =dev/sprite.color |
| 185 | 185 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 186 |
- ,tile-rect-hor ~dev/sprite.x ~rect.x2 LTH2 JMP? POP2 |
|
| 186 |
+ ,tile-rect-hor ~dev/sprite.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 187 | 187 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 188 |
- ,tile-rect-ver ~dev/sprite.y ~rect.y2 LTH2 JMP? POP2 |
|
| 188 |
+ ,tile-rect-ver ~dev/sprite.y ~rect.y2 LTH2 JMP2? POP2 |
|
| 189 | 189 |
|
| 190 | 190 |
RTS |
| 191 | 191 |
|
| ... | ... |
@@ -197,10 +197,10 @@ RTS |
| 197 | 197 |
#0000 EQU2 RTS? ( Return if unchanged ) |
| 198 | 198 |
|
| 199 | 199 |
( clear last cursor ) |
| 200 |
- #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 200 |
+ #10 ,clear_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 201 | 201 |
( record mouse positions ) |
| 202 | 202 |
~dev/mouse.x =mouse.x ~dev/mouse.y =mouse.y |
| 203 |
- #13 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR |
|
| 203 |
+ #13 ,cursor_icn ~mouse.x ~mouse.y ,draw-sprite JSR2 |
|
| 204 | 204 |
|
| 205 | 205 |
RTS |
| 206 | 206 |
|
| ... | ... |
@@ -2,17 +2,16 @@ |
| 2 | 2 |
app/left : text editor |
| 3 | 3 |
|
| 4 | 4 |
TODO |
| 5 |
- - Follow cursor when moving out of the screen |
|
| 5 |
+ - Copy/Cut/Paste |
|
| 6 | 6 |
- Save/Load |
| 7 |
- - Real scrolling distance |
|
| 8 | 7 |
- Double-click select word |
| 9 | 8 |
- Right-click find next instance of selection |
| 10 |
- - Copy/Cut/Paste |
|
| 11 |
- - x scroll |
|
| 12 |
- - Don't scroll past oef |
|
| 13 |
- - Don't draw past eof |
|
| 14 | 9 |
- Draw tab characters |
| 15 |
- - Blink cursor |
|
| 10 |
+ - Scrollbar |
|
| 11 |
+ - Don't scroll past oef |
|
| 12 |
+ - Hor scroll |
|
| 13 |
+ - Follow cursor when moving out of the screen |
|
| 14 |
+ - Real scrolling distance |
|
| 16 | 15 |
) |
| 17 | 16 |
|
| 18 | 17 |
&Console { pad 8 stdio 1 }
|
| ... | ... |
@@ -43,13 +42,13 @@ |
| 43 | 42 |
|0100 @RESET |
| 44 | 43 |
|
| 45 | 44 |
( load file ) |
| 46 |
- ,filepath ,load-file JSR |
|
| 45 |
+ ,filepath ,load-file JSR2 |
|
| 47 | 46 |
|
| 48 | 47 |
( place textarea ) |
| 49 | 48 |
#0018 =textarea.x1 ~dev/screen.height #0008 SUB2 =textarea.y2 |
| 50 | 49 |
|
| 51 |
- ,select JSR |
|
| 52 |
- ,redraw JSR |
|
| 50 |
+ ,select JSR2 |
|
| 51 |
+ ,redraw JSR2 |
|
| 53 | 52 |
|
| 54 | 53 |
BRK |
| 55 | 54 |
|
| ... | ... |
@@ -57,63 +56,63 @@ BRK |
| 57 | 56 |
|
| 58 | 57 |
( ctrl ) |
| 59 | 58 |
|
| 60 |
- ,ctrl-end ~dev/ctrl #00 EQU ~lock #00 NEQ #0000 NEQ2 JMP? POP2 |
|
| 59 |
+ ,ctrl-end ~dev/ctrl #00 EQU ~lock #00 NEQ #0000 NEQ2 JMP2? POP2 |
|
| 61 | 60 |
( lock ) #04 =lock |
| 62 |
- ,no-ctrl-up ~dev/ctrl #10 NEQ JMP? POP2 |
|
| 63 |
- ( clamp ) ,no-ctrl-up ~position.y #0000 EQU2 JMP? POP2 |
|
| 64 |
- ,find-lineoffset JSR =position.x |
|
| 61 |
+ ,no-ctrl-up ~dev/ctrl #10 NEQ JMP2? POP2 |
|
| 62 |
+ ( clamp ) ,no-ctrl-up ~position.y #0000 EQU2 JMP2? POP2 |
|
| 63 |
+ ,find-lineoffset JSR2 =position.x |
|
| 65 | 64 |
~position.y #0001 SUB2 =position.y |
| 66 |
- ,find-selection JSR DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 67 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 65 |
+ ,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 66 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 68 | 67 |
@no-ctrl-up |
| 69 |
- ,no-ctrl-down ~dev/ctrl #20 NEQ JMP? POP2 |
|
| 70 |
- ,find-lineoffset JSR =position.x ~position.y #0001 ADD2 =position.y |
|
| 71 |
- ,find-selection JSR DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 72 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 68 |
+ ,no-ctrl-down ~dev/ctrl #20 NEQ JMP2? POP2 |
|
| 69 |
+ ,find-lineoffset JSR2 =position.x ~position.y #0001 ADD2 =position.y |
|
| 70 |
+ ,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 71 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 73 | 72 |
@no-ctrl-down |
| 74 |
- ,no-ctrl-left ~dev/ctrl #40 NEQ JMP? POP2 |
|
| 75 |
- ( clamp ) ,no-ctrl-left ~selection.from ,document.body EQU2 JMP? POP2 |
|
| 73 |
+ ,no-ctrl-left ~dev/ctrl #40 NEQ JMP2? POP2 |
|
| 74 |
+ ( clamp ) ,no-ctrl-left ~selection.from ,document.body EQU2 JMP2? POP2 |
|
| 76 | 75 |
~selection.from #0001 SUB2 DUP2 =selection.from #0001 ADD2 =selection.to |
| 77 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 76 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 78 | 77 |
@no-ctrl-left |
| 79 |
- ,no-ctrl-right ~dev/ctrl #80 NEQ JMP? POP2 |
|
| 78 |
+ ,no-ctrl-right ~dev/ctrl #80 NEQ JMP2? POP2 |
|
| 80 | 79 |
~selection.from #0001 ADD2 DUP2 =selection.from #0001 ADD2 =selection.to |
| 81 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 80 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 82 | 81 |
@no-ctrl-right |
| 83 | 82 |
( alt ) |
| 84 |
- ,no-alt ~dev/ctrl #0f AND #02 NEQ JMP? POP2 |
|
| 85 |
- ,no-aup ~dev/ctrl #04 ROR #01 NEQ JMP? POP2 |
|
| 86 |
- ,find-wordstart JSR =selection.to |
|
| 87 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 83 |
+ ,no-alt ~dev/ctrl #0f AND #02 NEQ JMP2? POP2 |
|
| 84 |
+ ,no-aup ~dev/ctrl #04 ROR #01 NEQ JMP2? POP2 |
|
| 85 |
+ ,find-wordstart JSR2 =selection.to |
|
| 86 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 88 | 87 |
@no-aup |
| 89 |
- ,no-adown ~dev/ctrl #04 ROR #02 NEQ JMP? POP2 |
|
| 90 |
- ,find-wordend JSR =selection.to |
|
| 91 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 88 |
+ ,no-adown ~dev/ctrl #04 ROR #02 NEQ JMP2? POP2 |
|
| 89 |
+ ,find-wordend JSR2 =selection.to |
|
| 90 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 92 | 91 |
@no-adown |
| 93 |
- ,no-aleft ~dev/ctrl #04 ROR #04 NEQ JMP? POP2 |
|
| 92 |
+ ,no-aleft ~dev/ctrl #04 ROR #04 NEQ JMP2? POP2 |
|
| 94 | 93 |
~selection.to #0001 SUB2 =selection.to |
| 95 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 94 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 96 | 95 |
@no-aleft |
| 97 |
- ,no-aright ~dev/ctrl #04 ROR #08 NEQ JMP? POP2 |
|
| 96 |
+ ,no-aright ~dev/ctrl #04 ROR #08 NEQ JMP2? POP2 |
|
| 98 | 97 |
~selection.to #0001 ADD2 =selection.to |
| 99 |
- ,clamp-selection JSR ,redraw JSR ,ctrl-end JMP |
|
| 98 |
+ ,clamp-selection JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 100 | 99 |
@no-aright |
| 101 | 100 |
@no-alt |
| 102 | 101 |
( ctrl ) |
| 103 |
- ,no-ctrl ~dev/ctrl #0f AND #01 NEQ JMP? POP2 |
|
| 104 |
- ,no-cup ~dev/ctrl #04 ROR #01 NEQ JMP? POP2 |
|
| 102 |
+ ,no-ctrl ~dev/ctrl #0f AND #01 NEQ JMP2? POP2 |
|
| 103 |
+ ,no-cup ~dev/ctrl #04 ROR #01 NEQ JMP2? POP2 |
|
| 105 | 104 |
~scroll.y #0004 SUB2 =scroll.y |
| 106 |
- ,redraw JSR ,ctrl-end JMP |
|
| 105 |
+ ,redraw JSR2 ,ctrl-end JMP2 |
|
| 107 | 106 |
@no-cup |
| 108 |
- ,no-cdown ~dev/ctrl #04 ROR #02 NEQ JMP? POP2 |
|
| 107 |
+ ,no-cdown ~dev/ctrl #04 ROR #02 NEQ JMP2? POP2 |
|
| 109 | 108 |
~scroll.y #0004 ADD2 =scroll.y |
| 110 |
- ,redraw JSR ,ctrl-end JMP |
|
| 109 |
+ ,redraw JSR2 ,ctrl-end JMP2 |
|
| 111 | 110 |
@no-cdown |
| 112 |
- ,no-cleft ~dev/ctrl #04 ROR #04 NEQ JMP? POP2 |
|
| 113 |
- ,goto-linestart JSR ,redraw JSR ,ctrl-end JMP |
|
| 111 |
+ ,no-cleft ~dev/ctrl #04 ROR #04 NEQ JMP2? POP2 |
|
| 112 |
+ ,goto-linestart JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 114 | 113 |
@no-cleft |
| 115 |
- ,no-cright ~dev/ctrl #04 ROR #08 NEQ JMP? POP2 |
|
| 116 |
- ,goto-lineend JSR ,redraw JSR ,ctrl-end JMP |
|
| 114 |
+ ,no-cright ~dev/ctrl #04 ROR #08 NEQ JMP2? POP2 |
|
| 115 |
+ ,goto-lineend JSR2 ,redraw JSR2 ,ctrl-end JMP2 |
|
| 117 | 116 |
@no-cright |
| 118 | 117 |
@no-ctrl |
| 119 | 118 |
|
| ... | ... |
@@ -121,68 +120,68 @@ BRK |
| 121 | 120 |
|
| 122 | 121 |
( keys ) |
| 123 | 122 |
|
| 124 |
- ,keys-end ~dev/key #00 EQU JMP? POP2 |
|
| 123 |
+ ,keys-end ~dev/key #00 EQU JMP2? POP2 |
|
| 125 | 124 |
|
| 126 |
- ,no-backspace ~dev/key #08 NEQ JMP? POP2 |
|
| 125 |
+ ,no-backspace ~dev/key #08 NEQ JMP2? POP2 |
|
| 127 | 126 |
( erase ) |
| 128 |
- ~selection.to ~selection.from SUB2 ,shift-left JSR |
|
| 127 |
+ ~selection.to ~selection.from SUB2 ,shift-left JSR2 |
|
| 129 | 128 |
~selection.from #0001 SUB2 =selection.from |
| 130 | 129 |
~selection.from #0001 ADD2 =selection.to |
| 131 | 130 |
( release ) #00 =dev/key |
| 132 |
- ,redraw JSR |
|
| 133 |
- ,keys-end JMP |
|
| 131 |
+ ,redraw JSR2 |
|
| 132 |
+ ,keys-end JMP2 |
|
| 134 | 133 |
@no-backspace |
| 135 | 134 |
|
| 136 | 135 |
( insert ) |
| 137 |
- ~selection.to ~selection.from SUB2 ,shift-right JSR |
|
| 136 |
+ ~selection.to ~selection.from SUB2 ,shift-right JSR2 |
|
| 138 | 137 |
~dev/key ~selection.from STR |
| 139 | 138 |
~selection.from #0001 ADD2 =selection.from |
| 140 | 139 |
~selection.from #0001 ADD2 =selection.to |
| 141 | 140 |
( release ) #00 =dev/key |
| 142 |
- ,redraw JSR |
|
| 141 |
+ ,redraw JSR2 |
|
| 143 | 142 |
|
| 144 | 143 |
@keys-end |
| 145 | 144 |
|
| 146 | 145 |
( mouse ) |
| 147 | 146 |
|
| 148 |
- ,touch-end ~dev/mouse.state #00 EQU JMP? POP2 |
|
| 147 |
+ ,touch-end ~dev/mouse.state #00 EQU JMP2? POP2 |
|
| 149 | 148 |
|
| 150 |
- ,touch-linebar ~dev/mouse.x #0010 LTH2 JMP? POP2 |
|
| 151 |
- ,touch-body ~dev/mouse.x ~dev/screen.width #0008 SUB2 LTH2 JMP? POP2 |
|
| 152 |
- ,touch-scrollbar JMP |
|
| 149 |
+ ,touch-linebar ~dev/mouse.x #0010 LTH2 JMP2? POP2 |
|
| 150 |
+ ,touch-body ~dev/mouse.x ~dev/screen.width #0008 SUB2 LTH2 JMP2? POP2 |
|
| 151 |
+ ,touch-scrollbar JMP2 |
|
| 153 | 152 |
|
| 154 | 153 |
@touch-end |
| 155 | 154 |
|
| 156 | 155 |
~dev/mouse.state =touch.state |
| 157 | 156 |
|
| 158 |
- ( unlock ) ,skip-unlock ~lock #00 EQU JMP? POP2 ~lock #01 SUB =lock @skip-unlock |
|
| 157 |
+ ( unlock ) ,skip-unlock ~lock #00 EQU JMP2? POP2 ~lock #01 SUB =lock @skip-unlock |
|
| 159 | 158 |
|
| 160 |
- ,draw-cursor JSR |
|
| 159 |
+ ,draw-cursor JSR2 |
|
| 161 | 160 |
|
| 162 | 161 |
BRK |
| 163 | 162 |
|
| 164 | 163 |
@touch-scrollbar |
| 165 | 164 |
|
| 166 |
- ,no-click-scroll-up ~dev/mouse.y #0008 GTH2 JMP? POP2 |
|
| 165 |
+ ,no-click-scroll-up ~dev/mouse.y #0008 GTH2 JMP2? POP2 |
|
| 167 | 166 |
( decr ) ~scroll.y #00 ~scroll.y #0000 NEQ2 SUB2 =scroll.y |
| 168 |
- ,redraw JSR ,touch-end JMP |
|
| 167 |
+ ,redraw JSR2 ,touch-end JMP2 |
|
| 169 | 168 |
@no-click-scroll-up |
| 170 |
- ,no-click-scroll-down ~dev/mouse.y ~dev/screen.height #0008 SUB2 LTH2 JMP? POP2 |
|
| 169 |
+ ,no-click-scroll-down ~dev/mouse.y ~dev/screen.height #0008 SUB2 LTH2 JMP2? POP2 |
|
| 171 | 170 |
( incr ) ~scroll.y #0001 ADD2 =scroll.y |
| 172 |
- ,redraw JSR ,touch-end JMP |
|
| 171 |
+ ,redraw JSR2 ,touch-end JMP2 |
|
| 173 | 172 |
@no-click-scroll-down |
| 174 | 173 |
~dev/mouse.y #0008 SUB2 =scroll.y |
| 175 |
- ,redraw JSR |
|
| 176 |
- ,touch-end JMP |
|
| 174 |
+ ,redraw JSR2 |
|
| 175 |
+ ,touch-end JMP2 |
|
| 177 | 176 |
|
| 178 | 177 |
RTS |
| 179 | 178 |
|
| 180 | 179 |
@touch-linebar |
| 181 | 180 |
|
| 182 | 181 |
~dev/mouse.y #0008 DIV2 ~scroll.y ADD2 =position.y #0000 =position.x |
| 183 |
- ,find-selection JSR DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 184 |
- ,redraw JSR |
|
| 185 |
- ,touch-end JMP |
|
| 182 |
+ ,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 183 |
+ ,redraw JSR2 |
|
| 184 |
+ ,touch-end JMP2 |
|
| 186 | 185 |
|
| 187 | 186 |
RTS |
| 188 | 187 |
|
| ... | ... |
@@ -191,18 +190,18 @@ RTS |
| 191 | 190 |
~dev/mouse.y #0008 DIV2 ~scroll.y ADD2 =position.y |
| 192 | 191 |
~dev/mouse.x ~textarea.x1 SUB2 #0007 ADD2 #0007 DIV2 =position.x |
| 193 | 192 |
|
| 194 |
- ,touch-when ~dev/mouse.state ~touch.state NEQ ~dev/ctrl #0f AND #02 NEQ #0101 EQU2 JMP? POP2 |
|
| 193 |
+ ,touch-when ~dev/mouse.state ~touch.state NEQ ~dev/ctrl #0f AND #02 NEQ #0101 EQU2 JMP2? POP2 |
|
| 195 | 194 |
( on drag ) |
| 196 |
- ,find-selection JSR #0001 ADD2 =selection.to |
|
| 197 |
- ,clamp-selection JSR |
|
| 198 |
- ,redraw JSR |
|
| 199 |
- ,touch-end JMP |
|
| 195 |
+ ,find-selection JSR2 #0001 ADD2 =selection.to |
|
| 196 |
+ ,clamp-selection JSR2 |
|
| 197 |
+ ,redraw JSR2 |
|
| 198 |
+ ,touch-end JMP2 |
|
| 200 | 199 |
|
| 201 | 200 |
@touch-when |
| 202 | 201 |
( on click ) |
| 203 |
- ,find-selection JSR DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 204 |
- ,redraw JSR |
|
| 205 |
- ,touch-end JMP |
|
| 202 |
+ ,find-selection JSR2 DUP2 =selection.from #0001 ADD2 =selection.to |
|
| 203 |
+ ,redraw JSR2 |
|
| 204 |
+ ,touch-end JMP2 |
|
| 206 | 205 |
|
| 207 | 206 |
RTS |
| 208 | 207 |
|
| ... | ... |
@@ -214,7 +213,7 @@ RTS |
| 214 | 213 |
,document.body =document.eof |
| 215 | 214 |
@load-file-loop |
| 216 | 215 |
( incr ) ~document.eof #0001 ADD2 =document.eof |
| 217 |
- ,load-file-loop ~document.eof LDR #00 NEQ JMP? POP2 |
|
| 216 |
+ ,load-file-loop ~document.eof LDR #00 NEQ JMP2? POP2 |
|
| 218 | 217 |
|
| 219 | 218 |
RTS |
| 220 | 219 |
|
| ... | ... |
@@ -225,7 +224,7 @@ RTS |
| 225 | 224 |
@shift-left-loop |
| 226 | 225 |
( move ) ~j ~i ADD2 LDR ~j STR |
| 227 | 226 |
( incr ) ~j #0001 ADD2 =j |
| 228 |
- ,shift-left-loop ~j ~document.eof LTH2 JMP? POP2 |
|
| 227 |
+ ,shift-left-loop ~j ~document.eof LTH2 JMP2? POP2 |
|
| 229 | 228 |
~document.eof ~i SUB2 =document.eof |
| 230 | 229 |
|
| 231 | 230 |
RTS |
| ... | ... |
@@ -237,7 +236,7 @@ RTS |
| 237 | 236 |
@shift-right-loop |
| 238 | 237 |
( move ) ~j ~i SUB2 LDR ~j STR |
| 239 | 238 |
( decr ) ~j #0001 SUB2 =j |
| 240 |
- ,shift-right-loop ~j ~selection.from GTH2 JMP? POP2 |
|
| 239 |
+ ,shift-right-loop ~j ~selection.from GTH2 JMP2? POP2 |
|
| 241 | 240 |
~document.eof ~i ADD2 =document.eof |
| 242 | 241 |
|
| 243 | 242 |
RTS |
| ... | ... |
@@ -255,7 +254,7 @@ RTS |
| 255 | 254 |
~selection.from #0001 SUB2 LDR #0a EQU RTS? |
| 256 | 255 |
~selection.from #0001 SUB2 LDR #0d EQU RTS? |
| 257 | 256 |
( decr ) ~selection.from DUP2 =selection.to #0001 SUB2 =selection.from |
| 258 |
- ,goto-linestart-loop ~selection.from LDR #00 NEQ JMP? POP2 |
|
| 257 |
+ ,goto-linestart-loop ~selection.from LDR #00 NEQ JMP2? POP2 |
|
| 259 | 258 |
( clamp at document body ) |
| 260 | 259 |
~selection.from ,document.body GTH2 RTS? |
| 261 | 260 |
,document.body DUP2 =selection.from #0001 ADD2 =selection.to |
| ... | ... |
@@ -268,7 +267,7 @@ RTS |
| 268 | 267 |
~selection.from LDR #0a EQU RTS? |
| 269 | 268 |
~selection.from LDR #0d EQU RTS? |
| 270 | 269 |
( incr ) ~selection.from #0001 ADD2 DUP2 #0001 ADD2 =selection.to =selection.from |
| 271 |
- ,goto-lineend-loop ~selection.from LDR #00 NEQ JMP? POP2 |
|
| 270 |
+ ,goto-lineend-loop ~selection.from LDR #00 NEQ JMP2? POP2 |
|
| 272 | 271 |
( clamp at document body ) |
| 273 | 272 |
~selection.from ,document.eof LTH2 RTS? |
| 274 | 273 |
,document.eof #0001 SUB2 DUP2 =selection.from #0001 ADD2 =selection.to |
| ... | ... |
@@ -280,10 +279,10 @@ RTS |
| 280 | 279 |
~selection.to =j |
| 281 | 280 |
@find-wordstart-loop |
| 282 | 281 |
( decr ) ~j #0001 SUB2 =j |
| 283 |
- ,find-wordstart-end ~j LDR #20 EQU JMP? POP2 |
|
| 284 |
- ,find-wordstart-end ~j LDR #0a EQU JMP? POP2 |
|
| 285 |
- ,find-wordstart-end ~j LDR #0d EQU JMP? POP2 |
|
| 286 |
- ,find-wordstart-loop ~j ,document.body GTH2 JMP? POP2 |
|
| 282 |
+ ,find-wordstart-end ~j LDR #20 EQU JMP2? POP2 |
|
| 283 |
+ ,find-wordstart-end ~j LDR #0a EQU JMP2? POP2 |
|
| 284 |
+ ,find-wordstart-end ~j LDR #0d EQU JMP2? POP2 |
|
| 285 |
+ ,find-wordstart-loop ~j ,document.body GTH2 JMP2? POP2 |
|
| 287 | 286 |
@find-wordstart-end |
| 288 | 287 |
( return ) ~j #0001 SUB2 |
| 289 | 288 |
|
| ... | ... |
@@ -294,10 +293,10 @@ RTS |
| 294 | 293 |
~selection.to =j |
| 295 | 294 |
@find-wordend-loop |
| 296 | 295 |
( incr ) ~j #0001 ADD2 =j |
| 297 |
- ,find-wordend-end ~j LDR #20 EQU JMP? POP2 |
|
| 298 |
- ,find-wordend-end ~j LDR #0a EQU JMP? POP2 |
|
| 299 |
- ,find-wordend-end ~j LDR #0d EQU JMP? POP2 |
|
| 300 |
- ,find-wordend-loop ~j ,document.body GTH2 JMP? POP2 |
|
| 296 |
+ ,find-wordend-end ~j LDR #20 EQU JMP2? POP2 |
|
| 297 |
+ ,find-wordend-end ~j LDR #0a EQU JMP2? POP2 |
|
| 298 |
+ ,find-wordend-end ~j LDR #0d EQU JMP2? POP2 |
|
| 299 |
+ ,find-wordend-loop ~j ,document.body GTH2 JMP2? POP2 |
|
| 301 | 300 |
@find-wordend-end |
| 302 | 301 |
( return ) ~j #0001 ADD2 |
| 303 | 302 |
|
| ... | ... |
@@ -308,9 +307,9 @@ RTS |
| 308 | 307 |
#0000 =j |
| 309 | 308 |
@find-lineoffset-loop |
| 310 | 309 |
( incr ) ~j #0001 ADD2 =j |
| 311 |
- ,find-lineoffset-end ~selection.from ~j SUB2 LDR #0a EQU JMP? POP2 |
|
| 312 |
- ,find-lineoffset-end ~selection.from ~j SUB2 LDR #0d EQU JMP? POP2 |
|
| 313 |
- ,find-lineoffset-loop ~selection.from ~j SUB2 ,document.body GTH2 JMP? POP2 |
|
| 310 |
+ ,find-lineoffset-end ~selection.from ~j SUB2 LDR #0a EQU JMP2? POP2 |
|
| 311 |
+ ,find-lineoffset-end ~selection.from ~j SUB2 LDR #0d EQU JMP2? POP2 |
|
| 312 |
+ ,find-lineoffset-loop ~selection.from ~j SUB2 ,document.body GTH2 JMP2? POP2 |
|
| 314 | 313 |
@find-lineoffset-end |
| 315 | 314 |
( return ) ~j |
| 316 | 315 |
|
| ... | ... |
@@ -320,12 +319,12 @@ RTS |
| 320 | 319 |
|
| 321 | 320 |
,document.body =j #0000 =pt.y |
| 322 | 321 |
@find-line-loop |
| 323 |
- ,find-line-end ~pt.y ~position.y #0001 SUB2 GTH2 JMP? POP2 |
|
| 324 |
- ,find-line-no-space ~j LDR #0a NEQ ~j LDR #0d NEQ #0101 EQU2 JMP? POP2 |
|
| 322 |
+ ,find-line-end ~pt.y ~position.y #0001 SUB2 GTH2 JMP2? POP2 |
|
| 323 |
+ ,find-line-no-space ~j LDR #0a NEQ ~j LDR #0d NEQ #0101 EQU2 JMP2? POP2 |
|
| 325 | 324 |
( incr ) ~pt.y #0001 ADD2 =pt.y |
| 326 | 325 |
@find-line-no-space |
| 327 | 326 |
( incr ) ~j #0001 ADD2 =j |
| 328 |
- ,find-line-loop ~j LDR #00 NEQ JMP? POP2 |
|
| 327 |
+ ,find-line-loop ~j LDR #00 NEQ JMP2? POP2 |
|
| 329 | 328 |
@find-line-end |
| 330 | 329 |
( return ) ~j |
| 331 | 330 |
|
| ... | ... |
@@ -333,15 +332,15 @@ RTS |
| 333 | 332 |
|
| 334 | 333 |
@find-selection ( position -> addr ) |
| 335 | 334 |
|
| 336 |
- ,find-line JSR ( find line ) |
|
| 335 |
+ ,find-line JSR2 ( find line ) |
|
| 337 | 336 |
|
| 338 | 337 |
#0000 =pt.x |
| 339 | 338 |
|
| 340 | 339 |
@find-selection-loop |
| 341 |
- ,find-selection-end ~j ~pt.x ADD2 LDR #0a EQU JMP? POP2 |
|
| 342 |
- ,find-selection-end ~j ~pt.x ADD2 LDR #0d EQU JMP? POP2 |
|
| 340 |
+ ,find-selection-end ~j ~pt.x ADD2 LDR #0a EQU JMP2? POP2 |
|
| 341 |
+ ,find-selection-end ~j ~pt.x ADD2 LDR #0d EQU JMP2? POP2 |
|
| 343 | 342 |
( incr ) ~pt.x #0001 ADD2 =pt.x |
| 344 |
- ,find-selection-loop ~pt.x ~position.x #0001 SUB2 LTH2 JMP? POP2 |
|
| 343 |
+ ,find-selection-loop ~pt.x ~position.x #0001 SUB2 LTH2 JMP2? POP2 |
|
| 345 | 344 |
@find-selection-end |
| 346 | 345 |
( return ) ~pt.x ADD2 |
| 347 | 346 |
|
| ... | ... |
@@ -353,19 +352,19 @@ RTS |
| 353 | 352 |
|
| 354 | 353 |
@select-loop |
| 355 | 354 |
|
| 356 |
- ,no-space ~selection.from LDR #0a NEQ ~selection.from LDR #0d NEQ #0101 EQU2 JMP? POP2 |
|
| 355 |
+ ,no-space ~selection.from LDR #0a NEQ ~selection.from LDR #0d NEQ #0101 EQU2 JMP2? POP2 |
|
| 357 | 356 |
( incr ) ~pt.y #0001 ADD2 =pt.y |
| 358 | 357 |
#0000 =pt.x |
| 359 | 358 |
@no-space |
| 360 | 359 |
|
| 361 |
- ,no-reached ~pt.y ~position.y #0001 SUB2 GTH2 ~pt.x ~position.x #0001 SUB2 GTH2 #0101 NEQ2 JMP? POP2 |
|
| 360 |
+ ,no-reached ~pt.y ~position.y #0001 SUB2 GTH2 ~pt.x ~position.x #0001 SUB2 GTH2 #0101 NEQ2 JMP2? POP2 |
|
| 362 | 361 |
~selection.from #0001 ADD2 =selection.to |
| 363 | 362 |
RTS |
| 364 | 363 |
@no-reached |
| 365 | 364 |
|
| 366 | 365 |
( incr ) ~pt.x #0001 ADD2 =pt.x |
| 367 | 366 |
( incr ) ~selection.from #0001 ADD2 =selection.from |
| 368 |
- ,select-loop ~selection.from LDR #00 NEQ JMP? POP2 |
|
| 367 |
+ ,select-loop ~selection.from LDR #00 NEQ JMP2? POP2 |
|
| 369 | 368 |
|
| 370 | 369 |
RTS |
| 371 | 370 |
|
| ... | ... |
@@ -373,10 +372,10 @@ RTS |
| 373 | 372 |
|
| 374 | 373 |
@redraw |
| 375 | 374 |
|
| 376 |
- ,draw-lines JSR |
|
| 377 |
- ,draw-textarea JSR |
|
| 378 |
- ,draw-scrollbar JSR |
|
| 379 |
- ,draw-titlebar JSR |
|
| 375 |
+ ,draw-lines JSR2 |
|
| 376 |
+ ,draw-textarea JSR2 |
|
| 377 |
+ ,draw-scrollbar JSR2 |
|
| 378 |
+ ,draw-titlebar JSR2 |
|
| 380 | 379 |
|
| 381 | 380 |
( save/load icons ) |
| 382 | 381 |
|
| ... | ... |
@@ -406,7 +405,7 @@ RTS |
| 406 | 405 |
( draw ) #02 ~addr ~position.y EQU2 #06 MUL ADD =dev/sprite.color |
| 407 | 406 |
( incr ) ~j #0001 ADD2 =j |
| 408 | 407 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 409 |
- ,draw-lines-loop ~j ~dev/screen.height #0008 SUB2 #0008 DIV2 NEQ2 JMP? POP2 |
|
| 408 |
+ ,draw-lines-loop ~j ~dev/screen.height #0008 SUB2 #0008 DIV2 NEQ2 JMP2? POP2 |
|
| 410 | 409 |
|
| 411 | 410 |
RTS |
| 412 | 411 |
|
| ... | ... |
@@ -459,12 +458,12 @@ RTS |
| 459 | 458 |
( scroll to position ) |
| 460 | 459 |
#0000 =j ( j is linebreaks ) |
| 461 | 460 |
@find-scroll-offset |
| 462 |
- ,find-scroll-offset-end ~scroll.y ~j EQU2 JMP? POP2 |
|
| 463 |
- ,no-break ~textarea.addr LDR #0a NEQ ~textarea.addr LDR #0d NEQ #0101 EQU2 JMP? POP2 |
|
| 461 |
+ ,find-scroll-offset-end ~scroll.y ~j EQU2 JMP2? POP2 |
|
| 462 |
+ ,no-break ~textarea.addr LDR #0a NEQ ~textarea.addr LDR #0d NEQ #0101 EQU2 JMP2? POP2 |
|
| 464 | 463 |
( incr ) ~j #0001 ADD2 =j |
| 465 | 464 |
@no-break |
| 466 | 465 |
( incr ) ~textarea.addr #0001 ADD2 =textarea.addr |
| 467 |
- ,find-scroll-offset ~textarea.addr LDR #00 NEQ JMP? POP2 |
|
| 466 |
+ ,find-scroll-offset ~textarea.addr LDR #00 NEQ JMP2? POP2 |
|
| 468 | 467 |
@find-scroll-offset-end |
| 469 | 468 |
|
| 470 | 469 |
~textarea.addr #0000 ADD2 =textarea.addr |
| ... | ... |
@@ -475,7 +474,7 @@ RTS |
| 475 | 474 |
|
| 476 | 475 |
@draw-textarea-loop |
| 477 | 476 |
|
| 478 |
- ,draw-textarea-end ~dev/sprite.y ~dev/screen.height #0010 SUB2 GTH2 JMP? POP2 |
|
| 477 |
+ ,draw-textarea-end ~dev/sprite.y ~dev/screen.height #0010 SUB2 GTH2 JMP2? POP2 |
|
| 479 | 478 |
|
| 480 | 479 |
( get character ) |
| 481 | 480 |
,font #00 ~j LDR #20 SUB #0008 MUL2 ADD2 =dev/sprite.addr |
| ... | ... |
@@ -485,7 +484,7 @@ RTS |
| 485 | 484 |
~j ~selection.to LTH2 #0101 EQU2 |
| 486 | 485 |
#05 MUL ADD =dev/sprite.color |
| 487 | 486 |
|
| 488 |
- ,no-linebreak ~j LDR #0a NEQ ~j LDR #0d NEQ #0101 EQU2 JMP? POP2 |
|
| 487 |
+ ,no-linebreak ~j LDR #0a NEQ ~j LDR #0d NEQ #0101 EQU2 JMP2? POP2 |
|
| 489 | 488 |
( draw linebreak ) |
| 490 | 489 |
,linebreak_icn =dev/sprite.addr |
| 491 | 490 |
( draw ) #03 |
| ... | ... |
@@ -497,7 +496,7 @@ RTS |
| 497 | 496 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 498 | 497 |
,font =dev/sprite.addr |
| 499 | 498 |
#01 =dev/sprite.color |
| 500 |
- ,fill-clear ~dev/sprite.x ~dev/screen.width #0008 SUB2 LTH2 JMP? POP2 |
|
| 499 |
+ ,fill-clear ~dev/sprite.x ~dev/screen.width #0008 SUB2 LTH2 JMP2? POP2 |
|
| 501 | 500 |
#0010 =dev/sprite.x |
| 502 | 501 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 503 | 502 |
@no-linebreak |
| ... | ... |
@@ -505,7 +504,7 @@ RTS |
| 505 | 504 |
( incr ) ~j #0001 ADD2 =j |
| 506 | 505 |
( incr ) ~dev/sprite.x #0007 ADD2 =dev/sprite.x |
| 507 | 506 |
|
| 508 |
- ,draw-textarea-loop ~j LDR #00 NEQ JMP? POP2 |
|
| 507 |
+ ,draw-textarea-loop ~j LDR #00 NEQ JMP2? POP2 |
|
| 509 | 508 |
|
| 510 | 509 |
@draw-textarea-end |
| 511 | 510 |
|
| ... | ... |
@@ -520,7 +519,7 @@ RTS |
| 520 | 519 |
@draw-scrollbar-loop |
| 521 | 520 |
( draw ) #08 =dev/sprite.color |
| 522 | 521 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 523 |
- ,draw-scrollbar-loop ~dev/sprite.y ~dev/screen.height LTH2 JMP? POP2 |
|
| 522 |
+ ,draw-scrollbar-loop ~dev/sprite.y ~dev/screen.height LTH2 JMP2? POP2 |
|
| 524 | 523 |
|
| 525 | 524 |
#0000 =dev/sprite.y |
| 526 | 525 |
,arrowup_icn =dev/sprite.addr |
| ... | ... |
@@ -547,11 +546,11 @@ RTS |
| 547 | 546 |
( draw ) DUP2 LDR #00 SWP #20 SUB #0008 MUL2 ,font ADD2 =dev/sprite.addr ~label.color =dev/sprite.color |
| 548 | 547 |
( incr ) #0001 ADD2 |
| 549 | 548 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 550 |
- DUP2 LDR #00 NEQ ,draw-titlebar-loop ROT JMP? POP2 |
|
| 549 |
+ DUP2 LDR #00 NEQ ,draw-titlebar-loop ROT JMP2? POP2 |
|
| 551 | 550 |
POP2 |
| 552 | 551 |
|
| 553 | 552 |
( selection ) |
| 554 |
- ~selection.from ,document.body SUB2 ,draw-short JSR |
|
| 553 |
+ ~selection.from ,document.body SUB2 ,draw-short JSR2 |
|
| 555 | 554 |
|
| 556 | 555 |
RTS |
| 557 | 556 |
|
| ... | ... |
@@ -40,7 +40,7 @@ |
| 40 | 40 |
~dev/screen.height #0002 DIV2 #003f SUB2 =tileview.y |
| 41 | 41 |
,bank1 #0448 ADD2 =tileview.addr |
| 42 | 42 |
|
| 43 |
- ,redraw JSR |
|
| 43 |
+ ,redraw JSR2 |
|
| 44 | 44 |
|
| 45 | 45 |
BRK |
| 46 | 46 |
|
| ... | ... |
@@ -48,62 +48,62 @@ BRK |
| 48 | 48 |
|
| 49 | 49 |
( keyboard controls ) |
| 50 | 50 |
|
| 51 |
- ,no-key ~dev/key #00 EQU JMP? POP2 |
|
| 51 |
+ ,no-key ~dev/key #00 EQU JMP2? POP2 |
|
| 52 | 52 |
|
| 53 |
- ,no-key ~dev/key #31 LTH JMP? POP2 |
|
| 54 |
- ,no-key ~dev/key #33 GTH JMP? POP2 |
|
| 53 |
+ ,no-key ~dev/key #31 LTH JMP2? POP2 |
|
| 54 |
+ ,no-key ~dev/key #33 GTH JMP2? POP2 |
|
| 55 | 55 |
( select ) ~dev/key #31 SUB =bankview.mode |
| 56 | 56 |
( release ) #00 =dev/key |
| 57 |
- ,redraw JSR |
|
| 57 |
+ ,redraw JSR2 |
|
| 58 | 58 |
|
| 59 | 59 |
@no-key |
| 60 | 60 |
|
| 61 |
- ,no-ctrl ~dev/ctrl.buttons #00 EQU JMP? POP2 |
|
| 61 |
+ ,no-ctrl ~dev/ctrl.buttons #00 EQU JMP2? POP2 |
|
| 62 | 62 |
|
| 63 |
- ,no-ctrl-up ~dev/ctrl.buttons #10 EQU JMP? POP2 |
|
| 63 |
+ ,no-ctrl-up ~dev/ctrl.buttons #10 EQU JMP2? POP2 |
|
| 64 | 64 |
~tileview.addr #0080 ADD2 =tileview.addr |
| 65 | 65 |
@no-ctrl-up |
| 66 |
- ,no-ctrl-down ~dev/ctrl.buttons #20 EQU JMP? POP2 |
|
| 66 |
+ ,no-ctrl-down ~dev/ctrl.buttons #20 EQU JMP2? POP2 |
|
| 67 | 67 |
~tileview.addr #0080 SUB2 =tileview.addr |
| 68 | 68 |
@no-ctrl-down |
| 69 |
- ,no-ctrl-left ~dev/ctrl.buttons #40 EQU JMP? POP2 |
|
| 69 |
+ ,no-ctrl-left ~dev/ctrl.buttons #40 EQU JMP2? POP2 |
|
| 70 | 70 |
~tileview.addr #0008 ADD2 =tileview.addr |
| 71 | 71 |
@no-ctrl-left |
| 72 |
- ,no-ctrl-right ~dev/ctrl.buttons #80 EQU JMP? POP2 |
|
| 72 |
+ ,no-ctrl-right ~dev/ctrl.buttons #80 EQU JMP2? POP2 |
|
| 73 | 73 |
~tileview.addr #0008 SUB2 =tileview.addr |
| 74 | 74 |
@no-ctrl-right |
| 75 | 75 |
~tileview.addr #0800 DIV2 #0800 MUL2 =bankview.addr |
| 76 |
- ,redraw JSR |
|
| 76 |
+ ,redraw JSR2 |
|
| 77 | 77 |
|
| 78 | 78 |
@no-ctrl |
| 79 | 79 |
|
| 80 | 80 |
( mouse controls ) |
| 81 | 81 |
|
| 82 |
- ,click-end ~dev/mouse.state #00 EQU JMP? POP2 |
|
| 82 |
+ ,click-end ~dev/mouse.state #00 EQU JMP2? POP2 |
|
| 83 | 83 |
|
| 84 | 84 |
( toolbar ) |
| 85 | 85 |
|
| 86 |
- ,no-toolbar-click ~dev/mouse.y ~bankview.y #0010 SUB2 SUB2 #0008 DIV2 #0000 NEQ2 JMP? POP2 |
|
| 86 |
+ ,no-toolbar-click ~dev/mouse.y ~bankview.y #0010 SUB2 SUB2 #0008 DIV2 #0000 NEQ2 JMP2? POP2 |
|
| 87 | 87 |
|
| 88 | 88 |
( brush ) |
| 89 | 89 |
|
| 90 |
- ,no-brush-click ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #000d LTH2 JMP? POP2 |
|
| 91 |
- ,no-brush-click ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #000f GTH2 JMP? POP2 |
|
| 90 |
+ ,no-brush-click ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #000d LTH2 JMP2? POP2 |
|
| 91 |
+ ,no-brush-click ~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #000f GTH2 JMP2? POP2 |
|
| 92 | 92 |
( select ) ~mouse.x ~bankview.x SUB2 #0008 DIV2 #000d SUB2 SWP POP =bankview.mode |
| 93 | 93 |
( release ) #00 =dev/mouse.state |
| 94 |
- ,redraw JSR ,click-end JMP |
|
| 94 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 95 | 95 |
@no-brush-click |
| 96 | 96 |
|
| 97 |
- ,no-load-click ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #000e NEQU2 JMP? POP2 |
|
| 97 |
+ ,no-load-click ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #000e NEQU2 JMP2? POP2 |
|
| 98 | 98 |
( load ) ,filename =dev/file.name #0800 =dev/file.length ~bankview.addr =dev/file.load |
| 99 | 99 |
( release ) #00 =dev/mouse.state |
| 100 |
- ,redraw JSR ,click-end JMP |
|
| 100 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 101 | 101 |
@no-load-click |
| 102 | 102 |
|
| 103 |
- ,no-save-click ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #000f NEQU2 JMP? POP2 |
|
| 103 |
+ ,no-save-click ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #000f NEQU2 JMP2? POP2 |
|
| 104 | 104 |
( save ) ,filename =dev/file.name #0800 =dev/file.length ~bankview.addr =dev/file.save |
| 105 | 105 |
( release ) #00 =dev/mouse.state |
| 106 |
- ,redraw JSR ,click-end JMP |
|
| 106 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 107 | 107 |
@no-save-click |
| 108 | 108 |
|
| 109 | 109 |
@no-toolbar-click |
| ... | ... |
@@ -112,9 +112,9 @@ BRK |
| 112 | 112 |
|
| 113 | 113 |
~dev/mouse.x ~bankview.x GTH2 ~dev/mouse.x ~bankview.x #0080 ADD2 LTH2 #0101 EQU2 |
| 114 | 114 |
~dev/mouse.y ~bankview.y GTH2 ~dev/mouse.y ~bankview.y #0080 ADD2 LTH2 #0101 EQU2 |
| 115 |
- #0101 NEQ2 ,no-bank-click ROT JMP? POP2 |
|
| 115 |
+ #0101 NEQ2 ,no-bank-click ROT JMP2? POP2 |
|
| 116 | 116 |
|
| 117 |
- ,not-copy-mode ~bankview.mode #01 NEQ JMP? POP2 |
|
| 117 |
+ ,not-copy-mode ~bankview.mode #01 NEQ JMP2? POP2 |
|
| 118 | 118 |
#00 =i |
| 119 | 119 |
@copy-loop |
| 120 | 120 |
( load ) ~tileview.addr ~i ADD LDR |
| ... | ... |
@@ -123,11 +123,11 @@ BRK |
| 123 | 123 |
~dev/mouse.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
| 124 | 124 |
~bankview.addr ADD2 #00 ~i ADD2 STR |
| 125 | 125 |
( incr ) ~i #01 ADD =i |
| 126 |
- ,copy-loop ~i #08 LTH JMP? POP2 |
|
| 127 |
- ,redraw JSR ,click-end JMP |
|
| 126 |
+ ,copy-loop ~i #08 LTH JMP2? POP2 |
|
| 127 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 128 | 128 |
@not-copy-mode |
| 129 | 129 |
|
| 130 |
- ,not-erase-mode ~bankview.mode #02 NEQ JMP? POP2 |
|
| 130 |
+ ,not-erase-mode ~bankview.mode #02 NEQ JMP2? POP2 |
|
| 131 | 131 |
#00 =i |
| 132 | 132 |
@erase-loop |
| 133 | 133 |
#00 |
| ... | ... |
@@ -136,14 +136,14 @@ BRK |
| 136 | 136 |
~dev/mouse.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
| 137 | 137 |
~bankview.addr ADD2 #00 ~i ADD2 STR |
| 138 | 138 |
( incr ) ~i #01 ADD =i |
| 139 |
- ,erase-loop ~i #08 LTH JMP? POP2 |
|
| 140 |
- ,redraw JSR ,click-end JMP |
|
| 139 |
+ ,erase-loop ~i #08 LTH JMP2? POP2 |
|
| 140 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 141 | 141 |
@not-erase-mode |
| 142 | 142 |
|
| 143 | 143 |
~dev/mouse.x ~bankview.x SUB2 #0008 DIV2 #0008 MUL2 |
| 144 | 144 |
~dev/mouse.y ~bankview.y SUB2 #0008 DIV2 #0008 MUL2 #0010 MUL2 ADD2 |
| 145 | 145 |
~bankview.addr ADD2 =tileview.addr |
| 146 |
- ,redraw JSR ,click-end JMP |
|
| 146 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 147 | 147 |
|
| 148 | 148 |
@no-bank-click |
| 149 | 149 |
|
| ... | ... |
@@ -151,7 +151,7 @@ BRK |
| 151 | 151 |
|
| 152 | 152 |
~dev/mouse.x ~tileview.x GTH2 ~dev/mouse.x ~tileview.x #0080 ADD2 LTH2 #0101 EQU2 |
| 153 | 153 |
~dev/mouse.y ~tileview.y GTH2 ~dev/mouse.y ~tileview.y #0080 ADD2 LTH2 #0101 EQU2 |
| 154 |
- #0101 NEQ2 ,no-tile-click ROT JMP? POP2 |
|
| 154 |
+ #0101 NEQ2 ,no-tile-click ROT JMP2? POP2 |
|
| 155 | 155 |
|
| 156 | 156 |
~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0008 MUL2 #0040 DIV2 |
| 157 | 157 |
~dev/mouse.y ~tileview.y SUB2 #0008 DIV2 #0008 MUL2 #0040 DIV2 #0002 MUL2 ADD2 |
| ... | ... |
@@ -159,43 +159,43 @@ BRK |
| 159 | 159 |
~tileview.addr ADD2 =addr ( addr offset ) |
| 160 | 160 |
~dev/mouse.x ~tileview.x SUB2 ~dev/mouse.x ~tileview.x SUB2 #0040 DIV2 #0040 MUL2 SUB2 =pos.x |
| 161 | 161 |
~dev/mouse.y ~tileview.y SUB2 ~dev/mouse.y ~tileview.y SUB2 #0040 DIV2 #0040 MUL2 SUB2 =pos.y |
| 162 |
- ,no-fill-mode ~bankview.mode #01 NEQ JMP? POP2 |
|
| 162 |
+ ,no-fill-mode ~bankview.mode #01 NEQ JMP2? POP2 |
|
| 163 | 163 |
( fill row ) #ff ~addr ~pos.y #0008 DIV2 ADD2 STR |
| 164 |
- ,redraw JSR ,click-end JMP |
|
| 164 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 165 | 165 |
@no-fill-mode |
| 166 |
- ,no-erase-mode ~bankview.mode #02 NEQ JMP? POP2 |
|
| 166 |
+ ,no-erase-mode ~bankview.mode #02 NEQ JMP2? POP2 |
|
| 167 | 167 |
( erase row ) #00 ~addr ~pos.y #0008 DIV2 ADD2 STR |
| 168 |
- ,redraw JSR ,click-end JMP |
|
| 168 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 169 | 169 |
@no-erase-mode |
| 170 | 170 |
( load ) ~addr ~pos.y #0008 DIV2 ADD2 LDR |
| 171 | 171 |
( mask ) #01 #07 ~pos.x #0008 DIV2 SWP POP SUB ROL |
| 172 | 172 |
XOR |
| 173 | 173 |
( save ) ~addr ~pos.y #0008 DIV2 ADD2 STR |
| 174 |
- ,redraw JSR ,click-end JMP |
|
| 174 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 175 | 175 |
|
| 176 | 176 |
@no-tile-click |
| 177 | 177 |
|
| 178 | 178 |
( operations ) |
| 179 | 179 |
|
| 180 |
- ,no-operations ~dev/mouse.y ~tileview.y SUB2 #0008 DIV2 #000c NEQ2 JMP? POP2 |
|
| 180 |
+ ,no-operations ~dev/mouse.y ~tileview.y SUB2 #0008 DIV2 #000c NEQ2 JMP2? POP2 |
|
| 181 | 181 |
|
| 182 |
- ,no-move-up ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0011 NEQ2 JMP? POP2 |
|
| 183 |
- ,op_shiftup JSR |
|
| 182 |
+ ,no-move-up ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0011 NEQ2 JMP2? POP2 |
|
| 183 |
+ ,op_shiftup JSR2 |
|
| 184 | 184 |
( release ) #00 =dev/mouse.state |
| 185 |
- ,redraw JSR ,click-end JMP |
|
| 185 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 186 | 186 |
@no-move-up |
| 187 | 187 |
|
| 188 |
- ,no-move-down ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0012 NEQ2 JMP? POP2 |
|
| 189 |
- ,op_shiftdown JSR |
|
| 188 |
+ ,no-move-down ~dev/mouse.x ~tileview.x SUB2 #0008 DIV2 #0012 NEQ2 JMP2? POP2 |
|
| 189 |
+ ,op_shiftdown JSR2 |
|
| 190 | 190 |
( release ) #00 =dev/mouse.state |
| 191 |
- ,redraw JSR ,click-end JMP |
|
| 191 |
+ ,redraw JSR2 ,click-end JMP2 |
|
| 192 | 192 |
@no-move-down |
| 193 | 193 |
|
| 194 | 194 |
@no-operations |
| 195 | 195 |
|
| 196 | 196 |
@click-end |
| 197 | 197 |
|
| 198 |
- ,draw-cursor JSR |
|
| 198 |
+ ,draw-cursor JSR2 |
|
| 199 | 199 |
|
| 200 | 200 |
BRK |
| 201 | 201 |
|
| ... | ... |
@@ -229,20 +229,20 @@ RTS |
| 229 | 229 |
|
| 230 | 230 |
@redraw |
| 231 | 231 |
|
| 232 |
- ,draw-bankview JSR |
|
| 233 |
- ,draw-tileview JSR |
|
| 232 |
+ ,draw-bankview JSR2 |
|
| 233 |
+ ,draw-tileview JSR2 |
|
| 234 | 234 |
|
| 235 | 235 |
RTS |
| 236 | 236 |
|
| 237 | 237 |
@draw-bankview |
| 238 | 238 |
|
| 239 |
- ~bankview.x #0002 SUB2 ~bankview.y #0002 SUB2 ~bankview.x #0081 ADD2 ~bankview.y #0081 ADD2 #03 ,line-rect JSR |
|
| 239 |
+ ~bankview.x #0002 SUB2 ~bankview.y #0002 SUB2 ~bankview.x #0081 ADD2 ~bankview.y #0081 ADD2 #03 ,line-rect JSR2 |
|
| 240 | 240 |
|
| 241 | 241 |
( position ) |
| 242 | 242 |
|
| 243 | 243 |
~bankview.x =dev/sprite.x |
| 244 | 244 |
~bankview.y #0010 SUB2 =dev/sprite.y |
| 245 |
- ~bankview.addr ,draw-short JSR |
|
| 245 |
+ ~bankview.addr ,draw-short JSR2 |
|
| 246 | 246 |
|
| 247 | 247 |
( toolbar ) |
| 248 | 248 |
|
| ... | ... |
@@ -279,7 +279,7 @@ RTS |
| 279 | 279 |
( draw ) #02 =dev/sprite.color |
| 280 | 280 |
~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
| 281 | 281 |
( incr ) ~i #01 ADD =i |
| 282 |
- ,draw-bankview-guides ~i #10 LTH JMP? POP2 |
|
| 282 |
+ ,draw-bankview-guides ~i #10 LTH JMP2? POP2 |
|
| 283 | 283 |
|
| 284 | 284 |
( body ) |
| 285 | 285 |
|
| ... | ... |
@@ -290,23 +290,23 @@ RTS |
| 290 | 290 |
~bankview.x =dev/sprite.x |
| 291 | 291 |
@draw-bankview-tiles-hor |
| 292 | 292 |
( draw ) #01 =dev/sprite.color |
| 293 |
- ,no-highlight ~dev/sprite.addr ~tileview.addr LTH2 JMP? POP2 |
|
| 294 |
- ,no-highlight ~dev/sprite.addr ~tileview.addr #0018 ADD2 GTH2 JMP? POP2 |
|
| 293 |
+ ,no-highlight ~dev/sprite.addr ~tileview.addr LTH2 JMP2? POP2 |
|
| 294 |
+ ,no-highlight ~dev/sprite.addr ~tileview.addr #0018 ADD2 GTH2 JMP2? POP2 |
|
| 295 | 295 |
( draw ) #0c =dev/sprite.color |
| 296 | 296 |
@no-highlight |
| 297 | 297 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 298 | 298 |
( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
| 299 | 299 |
( incr ) ~pt.x #01 ADD =pt.x |
| 300 |
- ,draw-bankview-tiles-hor ~pt.x #10 LTH JMP? POP2 |
|
| 300 |
+ ,draw-bankview-tiles-hor ~pt.x #10 LTH JMP2? POP2 |
|
| 301 | 301 |
( incr ) ~pt.y #01 ADD =pt.y |
| 302 | 302 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 303 |
- ,draw-bankview-tiles-ver ~pt.y #10 LTH JMP? POP2 |
|
| 303 |
+ ,draw-bankview-tiles-ver ~pt.y #10 LTH JMP2? POP2 |
|
| 304 | 304 |
|
| 305 | 305 |
RTS |
| 306 | 306 |
|
| 307 | 307 |
@draw-tileview |
| 308 | 308 |
|
| 309 |
- ~tileview.x #0002 SUB2 ~tileview.y #0002 SUB2 ~tileview.x #0080 ADD2 ~tileview.y #0081 ADD2 #03 ,line-rect JSR |
|
| 309 |
+ ~tileview.x #0002 SUB2 ~tileview.y #0002 SUB2 ~tileview.x #0080 ADD2 ~tileview.y #0081 ADD2 #03 ,line-rect JSR2 |
|
| 310 | 310 |
|
| 311 | 311 |
~tileview.x #0028 ADD2 =dev/sprite.x |
| 312 | 312 |
~tileview.y #0010 SUB2 =dev/sprite.y |
| ... | ... |
@@ -317,29 +317,29 @@ RTS |
| 317 | 317 |
|
| 318 | 318 |
~tileview.x =dev/sprite.x |
| 319 | 319 |
~tileview.y #0010 SUB2 =dev/sprite.y |
| 320 |
- ~tileview.addr ,draw-short JSR |
|
| 320 |
+ ~tileview.addr ,draw-short JSR2 |
|
| 321 | 321 |
|
| 322 | 322 |
( body ) |
| 323 | 323 |
|
| 324 | 324 |
~tileview.x =dev/sprite.x |
| 325 | 325 |
~tileview.y =dev/sprite.y |
| 326 | 326 |
~tileview.addr =tileview.addr |
| 327 |
- ,draw-tileview-icn JSR |
|
| 327 |
+ ,draw-tileview-icn JSR2 |
|
| 328 | 328 |
|
| 329 | 329 |
~tileview.x #0040 ADD2 =dev/sprite.x |
| 330 | 330 |
~tileview.y =dev/sprite.y |
| 331 | 331 |
~tileview.addr #0008 ADD2 =tileview.addr |
| 332 |
- ,draw-tileview-icn JSR |
|
| 332 |
+ ,draw-tileview-icn JSR2 |
|
| 333 | 333 |
|
| 334 | 334 |
~tileview.x =dev/sprite.x |
| 335 | 335 |
~tileview.y #0040 ADD2 =dev/sprite.y |
| 336 | 336 |
~tileview.addr #0008 ADD2 =tileview.addr |
| 337 |
- ,draw-tileview-icn JSR |
|
| 337 |
+ ,draw-tileview-icn JSR2 |
|
| 338 | 338 |
|
| 339 | 339 |
~tileview.x #0040 ADD2 =dev/sprite.x |
| 340 | 340 |
~tileview.y #0040 ADD2 =dev/sprite.y |
| 341 | 341 |
~tileview.addr #0008 ADD2 =tileview.addr |
| 342 |
- ,draw-tileview-icn JSR |
|
| 342 |
+ ,draw-tileview-icn JSR2 |
|
| 343 | 343 |
|
| 344 | 344 |
( line hor ) |
| 345 | 345 |
~tileview.y #003f ADD2 =dev/screen.y |
| ... | ... |
@@ -347,7 +347,7 @@ RTS |
| 347 | 347 |
@draw-hor |
| 348 | 348 |
( draw ) #03 =dev/screen.color |
| 349 | 349 |
( incr ) ~dev/screen.x #0002 ADD2 =dev/screen.x |
| 350 |
- ~dev/screen.x ~tileview.x #0082 ADD2 LTH2 ,draw-hor ROT JMP? POP2 |
|
| 350 |
+ ~dev/screen.x ~tileview.x #0082 ADD2 LTH2 ,draw-hor ROT JMP2? POP2 |
|
| 351 | 351 |
|
| 352 | 352 |
( line ver ) |
| 353 | 353 |
~tileview.y =dev/screen.y |
| ... | ... |
@@ -355,7 +355,7 @@ RTS |
| 355 | 355 |
@draw-ver |
| 356 | 356 |
( draw ) #03 =dev/screen.color |
| 357 | 357 |
( incr ) ~dev/screen.y #0002 ADD2 =dev/screen.y |
| 358 |
- ~dev/screen.y ~tileview.y #0081 ADD2 LTH2 ,draw-ver ROT JMP? POP2 |
|
| 358 |
+ ~dev/screen.y ~tileview.y #0081 ADD2 LTH2 ,draw-ver ROT JMP2? POP2 |
|
| 359 | 359 |
|
| 360 | 360 |
( rewind ) ~tileview.addr #0018 SUB2 =tileview.addr |
| 361 | 361 |
|
| ... | ... |
@@ -372,7 +372,7 @@ RTS |
| 372 | 372 |
( draw ) #02 =dev/sprite.color |
| 373 | 373 |
( incr ) ~i #01 ADD =i |
| 374 | 374 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 375 |
- ,draw-tileview-bytes ~i #08 LTH JMP? POP2 |
|
| 375 |
+ ,draw-tileview-bytes ~i #08 LTH JMP2? POP2 |
|
| 376 | 376 |
|
| 377 | 377 |
( operations ) |
| 378 | 378 |
|
| ... | ... |
@@ -395,10 +395,10 @@ RTS |
| 395 | 395 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 396 | 396 |
( incr ) ~dev/sprite.addr #0008 ADD2 =dev/sprite.addr |
| 397 | 397 |
( incr ) ~pt.x #01 ADD =pt.x |
| 398 |
- ,draw-tileview-tiles-hor ~pt.x #02 LTH JMP? POP2 |
|
| 398 |
+ ,draw-tileview-tiles-hor ~pt.x #02 LTH JMP2? POP2 |
|
| 399 | 399 |
( incr ) ~pt.y #01 ADD =pt.y |
| 400 | 400 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 401 |
- ,draw-tileview-tiles-ver ~pt.y #02 LTH JMP? POP2 |
|
| 401 |
+ ,draw-tileview-tiles-ver ~pt.y #02 LTH JMP2? POP2 |
|
| 402 | 402 |
|
| 403 | 403 |
RTS |
| 404 | 404 |
|
| ... | ... |
@@ -415,11 +415,11 @@ RTS |
| 415 | 415 |
( draw ) #01 =dev/sprite.color |
| 416 | 416 |
( incr ) ~dev/sprite.x #0008 ADD2 =dev/sprite.x |
| 417 | 417 |
( incr ) ~pt.x #01 ADD =pt.x |
| 418 |
- ,redraw-hor ~pt.x #08 LTH JMP? POP2 |
|
| 418 |
+ ,redraw-hor ~pt.x #08 LTH JMP2? POP2 |
|
| 419 | 419 |
( incr ) ~dev/sprite.y #0008 ADD2 =dev/sprite.y |
| 420 | 420 |
( incr ) ~pt.y #01 ADD =pt.y |
| 421 | 421 |
~dev/sprite.x #0040 SUB2 =dev/sprite.x |
| 422 |
- ,redraw-ver ~pt.y #08 LTH JMP? POP2 |
|
| 422 |
+ ,redraw-ver ~pt.y #08 LTH JMP2? POP2 |
|
| 423 | 423 |
|
| 424 | 424 |
RTS |
| 425 | 425 |
|
| ... | ... |
@@ -474,13 +474,13 @@ RTS |
| 474 | 474 |
( incr ) ~dev/screen.x #0001 ADD2 =dev/screen.x |
| 475 | 475 |
( draw ) ~rect.y1 =dev/screen.y ~color =dev/screen.color |
| 476 | 476 |
( draw ) ~rect.y2 =dev/screen.y ~color =dev/screen.color |
| 477 |
- ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP? POP2 |
|
| 477 |
+ ,line-rect-hor ~dev/screen.x ~rect.x2 LTH2 JMP2? POP2 |
|
| 478 | 478 |
~rect.y1 =dev/screen.y |
| 479 | 479 |
@line-rect-ver |
| 480 | 480 |
( draw ) ~rect.x1 =dev/screen.x ~color =dev/screen.color |
| 481 | 481 |
( draw ) ~rect.x2 =dev/screen.x ~color =dev/screen.color |
| 482 | 482 |
( incr ) ~dev/screen.y #0001 ADD2 =dev/screen.y |
| 483 |
- ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP? POP2 |
|
| 483 |
+ ,line-rect-ver ~dev/screen.y ~rect.y2 #0001 ADD2 LTH2 JMP2? POP2 |
|
| 484 | 484 |
|
| 485 | 485 |
RTS |
| 486 | 486 |
|
| ... | ... |
@@ -33,8 +33,8 @@ Uint16 peek16(Stack *s, Uint8 a) { return peek8(s, a * 2) + (peek8(s, a * 2 + 1)
|
| 33 | 33 |
void op_brk(Uxn *u) { setflag(&u->status, FLAG_HALT, 1); }
|
| 34 | 34 |
void op_lit(Uxn *u) { u->literal += 1; }
|
| 35 | 35 |
void op_nop(Uxn *u) { printf("0x%02x \n", pop8(&u->wst)); fflush(stdout); }
|
| 36 |
-void op_jmp(Uxn *u) { u->ram.ptr = pop16(&u->wst); }
|
|
| 37 |
-void op_jsr(Uxn *u) { push16(&u->rst, u->ram.ptr); u->ram.ptr = pop16(&u->wst); }
|
|
| 36 |
+void op_jmp(Uxn *u) { Uint8 a = pop8(&u->wst); u->ram.ptr += getflag(&u->status, FLAG_SIGN) ? (Sint8)a : a; }
|
|
| 37 |
+void op_jsr(Uxn *u) { Uint8 a = pop8(&u->wst); push16(&u->rst, u->ram.ptr); u->ram.ptr += getflag(&u->status, FLAG_SIGN) ? (Sint8)a : a; }
|
|
| 38 | 38 |
void op_rts(Uxn *u) { u->ram.ptr = pop16(&u->rst); }
|
| 39 | 39 |
void op_ldr(Uxn *u) { Uint16 a = pop16(&u->wst); push8(&u->wst, mempeek8(u, a)); }
|
| 40 | 40 |
void op_str(Uxn *u) { Uint16 a = pop16(&u->wst); Uint8 b = pop8(&u->wst); mempoke8(u, a, b); }
|
| ... | ... |
@@ -63,6 +63,8 @@ void op_lth(Uxn *u) { Uint8 a = pop8(&u->wst), b = pop8(&u->wst); push8(&u->wst,
|
| 63 | 63 |
/* --- */ |
| 64 | 64 |
void op_lit16(Uxn *u) { u->literal += 2; }
|
| 65 | 65 |
void op_nop16(Uxn *u) { printf("%04x\n", pop16(&u->wst)); }
|
| 66 |
+void op_jmp16(Uxn *u) { u->ram.ptr = pop16(&u->wst); }
|
|
| 67 |
+void op_jsr16(Uxn *u) { push16(&u->rst, u->ram.ptr); u->ram.ptr = pop16(&u->wst); }
|
|
| 66 | 68 |
void op_ldr16(Uxn *u) { Uint16 a = pop16(&u->wst); push16(&u->wst, mempeek16(u, a)); }
|
| 67 | 69 |
void op_str16(Uxn *u) { Uint16 a = pop16(&u->wst); Uint16 b = pop16(&u->wst); mempoke16(u, a, b); }
|
| 68 | 70 |
void op_and16(Uxn *u) { Uint16 a = pop16(&u->wst), b = pop16(&u->wst); push16(&u->wst, b & a); }
|
| ... | ... |
@@ -93,7 +95,7 @@ void (*ops[])(Uxn *u) = {
|
| 93 | 95 |
op_pop, op_dup, op_swp, op_ovr, op_rot, op_nop, op_wsr, op_rsw, |
| 94 | 96 |
op_add, op_sub, op_mul, op_div, op_equ, op_neq, op_gth, op_lth, |
| 95 | 97 |
/* 16-bit */ |
| 96 |
- op_brk, op_nop16, op_lit16, op_jmp, op_jsr, op_rts, op_ldr16, op_str16, |
|
| 98 |
+ op_brk, op_nop16, op_lit16, op_jmp16, op_jsr16, op_rts, op_ldr16, op_str16, |
|
| 97 | 99 |
op_nop, op_nop, op_nop, op_nop, op_and16, op_xor16, op_rol16, op_ror16, |
| 98 | 100 |
op_pop16, op_dup16, op_swp16, op_ovr16, op_rot16, op_wsr16, op_rsw16, op_nop, |
| 99 | 101 |
op_add16, op_sub16, op_mul16, op_div16, op_equ16, op_neq16, op_gth16, op_lth16 |