Input textarea is always after last lb

This commit is contained in:
neauoire 2022-04-14 20:45:25 -07:00
parent ac67eb9edd
commit 7c6f54634d
2 changed files with 19 additions and 48 deletions

View File

@ -6,17 +6,6 @@ The assembler is written in about 400 lines, it's designed to help bootstrap the
The Drifblim project also includes a REPL program, called [varvara's bicycle](https://wiki.xxiivv.com/bicycle). The Drifblim project also includes a REPL program, called [varvara's bicycle](https://wiki.xxiivv.com/bicycle).
## Manual
- `LIST` Displays a list of all available routines.
- `PRINT/PRINT2` Prints the value at the top of the stack.
- `MOD/MOD2` Pushes the modulo of X and Y, onto the stack.
- `ABS/ABS2` Pushes the absolute value of X, onto the stack.
- `RAND/RAND2` Pushes a random value between 0 and X, onto the stack.
- `FRE` Prints the number of bytes left in memory.
- `NEW` Erases the current routines in memory.
- `QUIT` Turns off the system.
## Build ## Build
This assembler is written in the language it is assembling, creating a chicken-and-egg problem. You have two choices, download a pre-assembled [drifblim.rom](https://rabbits.srht.site/drifblim/drifblim.rom)(1300 bytes), or use [uxnasm.c](https://git.sr.ht/~rabbits/uxn/tree/main/item/src/uxnasm.c). This assembler is written in the language it is assembling, creating a chicken-and-egg problem. You have two choices, download a pre-assembled [drifblim.rom](https://rabbits.srht.site/drifblim/drifblim.rom)(1300 bytes), or use [uxnasm.c](https://git.sr.ht/~rabbits/uxn/tree/main/item/src/uxnasm.c).
@ -30,4 +19,19 @@ uxncli bin/drifblim.rom src/drifblim.tal
If do not wish to assemble it yourself, you can download [drifblim.rom](https://rabbits.srht.site/drifblim/drifblim.rom). If do not wish to assemble it yourself, you can download [drifblim.rom](https://rabbits.srht.site/drifblim/drifblim.rom).
## Manual
- `LIST` Displays a list of all available routines.
- `PRINT/PRINT2` Prints the value at the top of the stack.
- `MOD/MOD2` Pushes the modulo of X and Y, onto the stack.
- `ABS/ABS2` Pushes the absolute value of X, onto the stack.
- `RAND/RAND2` Pushes a random value between 0 and X, onto the stack.
- `FRE` Prints the number of bytes left in memory.
- `NEW` Erases the current routines in memory.
- `QUIT` Turns off the system.
## Controls
- `mouse2` Inject mouse position into input.
_Drifblim is strong enough to lift Pokémon or people but has no control over its flight. This causes it to drift with the wind and end up anywhere._ _Drifblim is strong enough to lift Pokémon or people but has no control over its flight. This causes it to drift with the wind and end up anywhere._

View File

@ -19,8 +19,6 @@
@selection $2 @selection $2
@cursor @cursor
&x $2 &y $2 &x $2 &y $2
@line
&x $2 &y $2 &dx $2 &dy $2 &e1 $2
|0100 ( -> ) |0100 ( -> )
@ -354,8 +352,8 @@ JMP2r
STH STH
#15 .Screen/auto DEO #15 .Screen/auto DEO
#0020 .Screen/x DEO2 [ LIT2 &x $2 ] .Screen/x DEO2
#00 ;log ;count-lines JSR2 #40 SFT2 #0020 ADD2 .Screen/y DEO2 [ LIT2 &y $2 ] .Screen/y DEO2
;src ;src
&while &while
DUP2 ;src SUB2 .selection LDZ2 EQU2 #05 MUL ,&sel STR DUP2 ;src SUB2 .selection LDZ2 EQU2 #05 MUL ,&sel STR
@ -387,6 +385,8 @@ JMP2r
INC2 LDAk ,&while JCN INC2 LDAk ,&while JCN
POP2 POP2
POPr POPr
.Screen/x DEI2 ;draw-src/x STA2
.Screen/y DEI2 ;draw-src/y STA2
JMP2r JMP2r
@ -495,38 +495,6 @@ JMP2r
JMP2r JMP2r
@draw-line ( x1* y1* x2* y2* color -- )
( load ) STH ,&y STR2 ,&x STR2 .line/y STZ2 .line/x STZ2
,&x LDR2 .line/x LDZ2 SUB2 ;abs2 JSR2 .line/dx STZ2
#0000 ,&y LDR2 .line/y LDZ2 SUB2 ;abs2 JSR2 SUB2 .line/dy STZ2
#ffff #00 .line/x LDZ2 ,&x LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sx STR2
#ffff #00 .line/y LDZ2 ,&y LDR2 ;lts2 JSR2 #10 SFT2 ADD2 ,&sy STR2
.line/dx LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2
&loop
.line/x LDZ2 DUP2 .Screen/x DEO2 [ LIT2 &x $2 ] EQU2
.line/y LDZ2 DUP2 .Screen/y DEO2 [ LIT2 &y $2 ] EQU2
STHkr .Screen/pixel DEO
AND ,&end JCN
.line/e1 LDZ2 #10 SFT2 DUP2
.line/dy LDZ2 ;lts2 JSR2 ,&skipy JCN
.line/e1 LDZ2 .line/dy LDZ2 ADD2 .line/e1 STZ2
.line/x LDZ2 [ LIT2 &sx $2 ] ADD2 .line/x STZ2
&skipy
.line/dx LDZ2 ;gts2 JSR2 ,&skipx JCN
.line/e1 LDZ2 .line/dx LDZ2 ADD2 .line/e1 STZ2
.line/y LDZ2 [ LIT2 &sy $2 ] ADD2 .line/y STZ2
&skipx
,&loop JMP
&end
POPr
JMP2r
@abs2 DUP2 #0f SFT2 EQU #05 JCN #0000 SWP2 SUB2 JMP2r
@lts2 #8000 STH2k ADD2 SWP2 STH2r ADD2 GTH2 JMP2r
@gts2 #8000 STH2k ADD2 SWP2 STH2r ADD2 LTH2 JMP2r
( snarf ) ( snarf )
@snarf-txt ".snarf $1 @snarf-txt ".snarf $1
@ -1131,7 +1099,6 @@ JMP2r
( misc ) ( misc )
:term-ccat "CHAR $1 :term-ccat "CHAR $1
:term-cat-str "TEXT $1 :term-cat-str "TEXT $1
:draw-line "LINE $1
&prefabs &prefabs
$4000 ( addr* name* ) $4000 ( addr* name* )