Compare commits

..

No commits in common. "6b42100ab372f4e57b73e2d53e2242a4332d592c" and "762be1770420edf43a93147d90bb4a766a9f8289" have entirely different histories.

3 changed files with 23 additions and 28 deletions

View file

@ -4,8 +4,6 @@ This is an art project drawing canvas tool that enables drawing low resolution
pixel images. The project includes a file specification for the drawings and a canvas pixel images. The project includes a file specification for the drawings and a canvas
app for making the files. app for making the files.
Press "e" to export the drawing to .1line file.
## Dev ## Dev

View file

@ -43,23 +43,19 @@
#65 EQU ?write-drawing-file-to-disk #65 EQU ?write-drawing-file-to-disk
BRK BRK
@on-mouse ( -> )
.Mouse/x DEI2 LIT2 =canvas-width SUB2 .x STZ2
.Mouse/y DEI2 LIT2 =canvas-height SUB2 .y STZ2
.Mouse/x DEI2 .Mouse/y DEI2 ( y x )
draw-cursor
add-px-to-drawing
BRK
@add-px-to-drawing @add-px-to-drawing
( figure out if px on on canvas ) ( figure out if px on on canvas )
( x too small )
LIT2 =canvas-width .x LDZ2 GTH2 ?/end
( x too big ) ( x too big )
LIT2 =canvas-width .x LDZ2 LTH2 ?/end LIT2 =canvas-width #0002 MUL2 .x LDZ2 LTH2 ?/end
( y too small )
LIT2 =canvas-height .y LDZ2 GTH2 ?/end
( y too big ) ( y too big )
LIT2 =canvas-height .y LDZ2 LTH2 ?/end LIT2 =canvas-height #0002 MUL2 .y LDZ2 LTH2 ?/end
( draw px to screen ) ( draw px to screen )
.x LDZ2 LIT2 =canvas-width ADD2 .Screen/x DEO2 .x LDZ2 .Screen/x DEO2
.y LDZ2 LIT2 =canvas-height ADD2 .Screen/y DEO2 .y LDZ2 .Screen/y DEO2
#01 .Screen/pixel DEO #01 .Screen/pixel DEO
( set local pt to start of pixels ) ( set local pt to start of pixels )
!{ &local-pt $2 } !{ &local-pt $2 }
@ -92,24 +88,27 @@
JMP2r JMP2r
@write-drawing-file-to-disk @write-drawing-file-to-disk
#ff
;pxs-pt LDA2 ( ff pt* )
#0001 ADD2 ( ff pt*+1 )
STA
;/filename .File/name DEO2 ;/filename .File/name DEO2
#1556 .File/length DEO2 #1556 .File/length DEO2
;file-start .File/write DEO2 ;file-start .File/write DEO2
JMP2r JMP2r
&filename "drawing.1line $1 &filename "drawing.1line $1
@draw-cursor ( y x -- ) @on-mouse ( -> )
.Mouse/x DEI2 .x STZ2
.Mouse/y DEI2 .y STZ2
draw-cursor
add-px-to-drawing
BRK
@draw-cursor
( clear fg ) ( clear fg )
LIT2 0000 .Screen/x DEO2 LIT2 0000 .Screen/x DEO2
LIT2 0000 .Screen/y DEO2 LIT2 0000 .Screen/y DEO2
#c0 .Screen/pixel DEO #c0 .Screen/pixel DEO
( draw cursor sprite to fg ) ( draw cursor sprite to fg )
#0002 SUB2 .Screen/y DEO2 ( x ) .x LDZ2 #0002 SUB2 .Screen/x DEO2
#0002 SUB2 .Screen/x DEO2 .y LDZ2 #0002 SUB2 .Screen/y DEO2
;cursor-sprite .Screen/addr DEO2 ;cursor-sprite .Screen/addr DEO2
#41 .Screen/sprite DEO #41 .Screen/sprite DEO
JMP2r JMP2r
@ -121,6 +120,7 @@
( store vars ) ( store vars )
!{ &y $1 &l $1 } !{ &y $1 &l $1 }
,/y STR ,/l STR ,/y STR ,/l STR
&loop &loop
( set y ) ( set y )
,/y LDR DUP ( y y ) ,/y LDR DUP ( y y )
@ -144,6 +144,7 @@
( store vars ) ( store vars )
!{ &x $1 &l $1 } !{ &x $1 &l $1 }
,/x STR ,/l STR ,/x STR ,/l STR
&loop &loop
( set x ) ( set x )
,/x LDR DUP ( x x ) ,/x LDR DUP ( x x )

View file

@ -1,7 +1,3 @@
task: render a larger canvas and a real size task: include header in generated .1line file as spec in ./one_line_file_type_spec.ms
task: shift pixel x,y to be zero based
------------------------- task: set terminal byte
DONE: include header in generated .1line file as spec in ./one_line_file_type_spec.ms
DONE: shift pixel x,y to be zero based
DONE: set terminal byte