uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit 5dbfb6603e130178ff57438c6498de4fc7efd361
parent 1925897c51d38e2b9482583a696b6241bbbf7fbe
Author: neauoire <aliceffekt@gmail.com>
Date:   Mon, 10 May 2021 20:52:57 -0700

Progress on nasu redesign

Diffstat:
Mbuild.sh | 2+-
Mprojects/pictures/cyr10x8.chr | 0
Mprojects/software/nasu.usm | 56++++++++++++++++++++++++++++++++++----------------------
3 files changed, 35 insertions(+), 23 deletions(-)

diff --git a/build.sh b/build.sh @@ -34,7 +34,7 @@ else fi echo "Assembling.." -./bin/assembler projects/demos/life.usm bin/boot.rom +./bin/assembler projects/demos/polycat.usm bin/boot.rom echo "Running.." if [ "${2}" = '--cli' ]; diff --git a/projects/pictures/cyr10x8.chr b/projects/pictures/cyr10x8.chr Binary files differ. diff --git a/projects/software/nasu.usm b/projects/software/nasu.usm @@ -334,6 +334,7 @@ BRK #40 SFT ADD #11 ADD .settings/ratio POK + ( release ) #00 .Mouse/state DEO ;redraw JSR2 BRK @@ -555,14 +556,6 @@ RTN .editview/x1 PEK2 #0002 SUB2 .editview/y1 PEK2 #0002 SUB2 .editview/x2 PEK2 #0001 ADD2 .editview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2 - ( grid ) - .editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0020 ADD2 #03 ;line-hor JSR2 - .editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0040 ADD2 #03 ;line-hor JSR2 - .editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0060 ADD2 #03 ;line-hor JSR2 - .editview/x1 PEK2 #0020 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2 - .editview/x1 PEK2 #0040 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2 - .editview/x1 PEK2 #0060 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2 - ( position ) .editview/x1 PEK2 .Screen/x DEO2 @@ -584,21 +577,17 @@ RTN .settings/ratio PEK #04 SFT LTH STHr #0101 NEQ2 ,&outside JNZ + ( get tile ) DUP2r STH2r .Screen/addr DEO2 + ( draw zoomed tile ) - .Screen/x DEI2 - .Screen/y DEI2 #01 ;draw-tile JSR2 - ( get tile ) DUP2r STH2r .Screen/addr DEO2 - ( get blending ) .settings/blending PEK - ( get depth ) .settings/depth PEK #20 MUL - ( draw ) #20 ADD ADD .Screen/color DEO - ( incr ) STH2r #0008 ADD2 STH2 ,&resume JMP &outside ;halftone_icn .Screen/addr DEO2 #23 .Screen/color DEO + #00 ;draw-tile JSR2 &resume ( incr ) SWP #01 ADD SWP DUP2 LTH ,&hor JNZ @@ -608,19 +597,44 @@ RTN POP2 POP2r + ( grid ) + .editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0020 ADD2 #03 ;line-hor JSR2 + .editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0040 ADD2 #03 ;line-hor JSR2 + .editview/x1 PEK2 DUP2 #0080 ADD2 .editview/y1 PEK2 #0060 ADD2 #03 ;line-hor JSR2 + .editview/x1 PEK2 #0020 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2 + .editview/x1 PEK2 #0040 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2 + .editview/x1 PEK2 #0060 ADD2 .editview/y1 PEK2 DUP2 #0080 ADD2 #03 ;line-ver JSR2 + RTN -@draw-tile ( x* y* color -- ) +@draw-tile ( color -- ) ( TODO: complete ) STH - .Screen/y DEO2 - .Screen/x DEO2 #00 #20 &ver #00 #20 &hor - DUPr STHr .Screen/color DEO + + ( get x,y ) + SWP2 OVR STH SWP2 OVR STHr + + ( get address ) + .Screen/addr DEI2 + + ( after this, ADDR XY ) + SWP2 SWP STH + + + ( got sprite line ) + #04 DIV TOS ADD2 LDA + + ( get pixel ) + STHr #04 DIV + #07 SWP SUB SFT #01 AND + + .Screen/color DEO + #0001 .Screen/x DEI2 ADD2 .Screen/x DEO2 ( incr ) SWP #01 ADD SWP DUP2 LTH ,&hor JNZ @@ -748,8 +762,6 @@ RTN @draw-preview ( -- ) - ( .preview/x1 PEK2 #0002 SUB2 .preview/y1 PEK2 #0002 SUB2 .preview/x2 PEK2 #0001 ADD2 .preview/y2 PEK2 #0001 ADD2 #03 ;line-rect JSR2 ) - ( stash address ) .settings/tile PEK2 DUP2 STH2 .Screen/addr DEO2 #00 #04 @@ -768,7 +780,7 @@ RTN ( get blending ) .settings/blending PEK ( get depth ) .settings/depth PEK #20 MUL ( draw ) #20 ADD ADD .Screen/color DEO - ( incr ) STH2r #0008 ADD2 STH2 + ( incr ) STH2r #0008 [ .settings/depth PEK #08 MUL TOS ADD2 ] ADD2 STH2 ,&resume JMP &outside ;halftone_icn .Screen/addr DEO2