From db64f3d85a381ef30a9d8a49bffaf144709ad088 Mon Sep 17 00:00:00 2001 From: neauoire Date: Sat, 17 Apr 2021 13:32:07 -0700 Subject: [PATCH] Progress on 2-bit mode for nasu --- projects/pictures/ako10x10.chr | Bin 0 -> 4096 bytes projects/software/nasu.usm | 136 +++++++++++++++++++++++---------- 2 files changed, 96 insertions(+), 40 deletions(-) create mode 100644 projects/pictures/ako10x10.chr diff --git a/projects/pictures/ako10x10.chr b/projects/pictures/ako10x10.chr new file mode 100644 index 0000000000000000000000000000000000000000..5047d8e9d4a36084f25a9d74dc83ae6e55ea283a GIT binary patch literal 4096 zcmcgvZ){sv6~8Zz{Sr6r^F|FR+wwwJwUH++5vY)ATb@z7?F%d^wOds}G=VIdBD8J_ zgGGeAx4_mYs_Im0P+B3`+9dFtXn){K5o2}+X`<5ANUUgRsCNF;4pS66el&isetwU0 z?t3q8T(PPj;9TXMd+t5=oclZX+;bhnFo{@{D`tywN!9l4+voTKQ(tFI>sz@_Oj$#& zD>LpOa4kRL^)1f2y|G{{xG>`E2NuIVHjDkwCAjS^Epn{rS8;bH3l(5BlCQXrMo~e{6p&b~t+Y z;_-`v!RV3b!N@@=7Mwcv_IIYg3+NF>#24KCfrK$P6Un27RzUr+*>eX}c8M%fW*P_=1l<<7wFm(ddf& zDa7-lXc!Gtn^^bSFf8#7x%F=f;5UrF)|nd6jdSUWehdaQ2J*==5K@Xs5yt$Myy#7o zL)X{HjI^uqKs&@rs%va-=i?`qnzM7Aa9Z8X-3h;@&T&wotn($V zi!VZj3dUaYk8F3t`Hp}sGza!fGK~B}C_FS+k-797U%>~;2zN_-Fh~`BL+a2~*_Jis z6wA$pPT6wrMkbp~gn>j^Yb76dAalC&>+rt_6-e! zMqJm+nx>RX`cPR@6jgoV{Xaet7lwx$8z*<|daUE|tJ39H1qhe_mDvmEbK9{vE+@57 zKiz^>)&Z^7j&~WUTrQR5pT5v&N`z$R!g1V*E#qROt#Wz2B5P_=sLUths9lkNHGcN> z*FT+KC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no-brush-click - ~Mouse.x ~tileview.x SUB2 8/ #000e NEQ2 ^$no-load-click JNZ - ( load ) ,filepath1 =File.name #0800 =File.length ~settings.page =File.load - $no-load-click - ~Mouse.x ~tileview.x SUB2 8/ #000f NEQ2 ^$no-save-click JNZ - ( save ) ,filepath1 =File.name #0800 =File.length ~settings.page =File.save - $no-save-click ~Mouse.x ~bankview.x SUB2 8/ #0005 NEQ2 ^$no-toggle-depth JNZ ,toggle-depth JSR2 $no-toggle-depth @@ -281,6 +292,8 @@ BRK ( channel ) ~Mouse.y ~colorview.y1 SUB2 8/ SWP POP STH ( rgb ) ~Mouse.x ~colorview.x1 SUB2 8/ SWP POP + DUP #00 NEQ ^$no-brush JNZ + DUPr STHr =settings.brush $no-brush DUP #01 NEQ ^$no-red JNZ DUPr STHr ,System.r ,set-color JSR2 $no-red DUP #02 NEQ ^$no-green JNZ @@ -297,16 +310,24 @@ BRK STH2 DUP #00 NEQ ^$no-red0 JNZ - DUP2r STH2r PEK2 DUP #04 SFT #01 ADD ~Mouse.state #10 EQU #fe MUL ADD #40 SFT SWP #0f AND ADD DUP2r STH2r POK2 + DUP2r STH2r PEK2 DUP #04 SFT #01 ADD + ( add/sub ) ~Mouse.state #10 EQU #fe MUL ADD + ( resume ) #40 SFT SWP #0f AND ADD DUP2r STH2r POK2 $no-red0 DUP #01 NEQ ^$no-red1 JNZ - DUP2r STH2r PEK2 DUP #0f AND #01 ADD ~Mouse.state #10 EQU #fe MUL ADD #0f AND SWP #f0 AND ADD DUP2r STH2r POK2 + DUP2r STH2r PEK2 DUP #0f AND #01 ADD + ( add/sub ) ~Mouse.state #10 EQU #fe MUL ADD + ( resume ) #0f AND SWP #f0 AND ADD DUP2r STH2r POK2 $no-red1 DUP #02 NEQ ^$no-red2 JNZ - DUP2r STH2r #0001 ADD2 PEK2 DUP #04 SFT #01 ADD ~Mouse.state #10 EQU #fe MUL ADD #40 SFT SWP #0f AND ADD DUP2r STH2r #0001 ADD2 POK2 + DUP2r STH2r #0001 ADD2 PEK2 DUP #04 SFT #01 ADD + ( add/sub ) ~Mouse.state #10 EQU #fe MUL ADD + ( resume ) #40 SFT SWP #0f AND ADD DUP2r STH2r #0001 ADD2 POK2 $no-red2 DUP #03 NEQ ^$no-red3 JNZ - DUP2r STH2r #0001 ADD2 PEK2 DUP #0f AND #01 ADD ~Mouse.state #10 EQU #fe MUL ADD #0f AND SWP #f0 AND ADD DUP2r STH2r #0001 ADD2 POK2 + DUP2r STH2r #0001 ADD2 PEK2 DUP #0f AND #01 ADD + ( add/sub ) ~Mouse.state #10 EQU #fe MUL ADD + ( resume ) #0f AND SWP #f0 AND ADD DUP2r STH2r #0001 ADD2 POK2 $no-red3 POP POP2r @@ -366,6 +387,7 @@ RTN ,draw-tileview JSR2 ,draw-blendview JSR2 ,draw-colorview JSR2 + ,draw-fileview JSR2 RTN @@ -399,14 +421,6 @@ RTN ,tool_eraser =Screen.addr #21 ~bankview.mode #02 EQU ADD =Screen.color - ~tileview.x #0070 ADD2 =Screen.x - ,load_icn =Screen.addr - #21 =Screen.color - - ~tileview.x #0078 ADD2 =Screen.x - ,save_icn =Screen.addr - #21 =Screen.color - ( guides ) #00 =i ,font_hex =Screen.addr @@ -451,7 +465,10 @@ RTN ~tileview.x #0028 ADD2 =Screen.x ~tileview.y #0010 SUB2 =Screen.y ~tileview.addr =Screen.addr - #23 =Screen.color + + ( get blending ) ~settings.blending + ( get depth ) ~settings.depth #20 MUL + ( draw ) #20 ADD ADD =Screen.color ( position ) @@ -505,7 +522,7 @@ RTN #00 =i $bytes ~tileview.x #0088 ADD2 =Screen.x - ~tileview.addr #00 ~i ADD2 PEK2 ,draw-byte JSR2 + ~tileview.addr #00 ~i ADD2 PEK2 #22 ,draw-byte JSR2 ( incr ) ~i #01 ADD =i ( incr ) ~Screen.y 8+ =Screen.y ~i #08 LTH ,$bytes JNZ2 @@ -519,7 +536,7 @@ RTN ,moveup_icn =Screen.addr #21 =Screen.color - ( draw tiles ) + ( draw tiles 2x2 ) ~tileview.y =Screen.y #00 =pt.x #00 =pt.y ~tileview.addr =Screen.addr @@ -560,6 +577,8 @@ RTN RTN @draw-blendview ( -- ) + + ~blendview.x1 #0002 SUB2 ~blendview.y1 #0002 SUB2 ~blendview.x2 #0001 ADD2 ~blendview.y2 #0001 ADD2 #03 ,line-rect JSR2 ~tileview.addr =Screen.addr #00 #10 @@ -572,12 +591,13 @@ RTN DUP2 LTH ^$loop JNZ POP2 - ~blendview.x1 #0019 SUB2 =Screen.x - ~blendview.y1 #0018 ADD2 =Screen.y + ~blendview.x1 #0002 SUB2 ~blendview.y2 #0001 ADD2 ~blendview.x1 #000e ADD2 ~blendview.y2 #0009 ADD2 #03 ,line-rect JSR2 + ~blendview.x1 #0001 SUB2 =Screen.x + ~blendview.y2 #0001 ADD2 =Screen.y ( get blending ) ~settings.blending ( get depth ) ~settings.depth #20 MUL - ( draw ) #20 ADD ADD ,draw-byte JSR2 + ( draw ) #20 ADD ADD #2c ,draw-byte JSR2 RTN @@ -594,10 +614,11 @@ RTN ~System.b ,draw-color-code JSR2 ~colorview.x1 =Screen.x - ,full_icn =Screen.addr + ,circle_icns =Screen.addr #00 #04 $loop + OVR ~settings.brush EQU #00 SWP #0008 MUL2 ,circle_icns ADD2 =Screen.addr OVR ~colorview.y1 ROT #00 SWP #0008 MUL2 ADD2 =Screen.y OVR #20 ADD =Screen.color SWP #01 ADD SWP @@ -606,6 +627,31 @@ RTN RTN +@draw-fileview ( -- ) + + ( line hor ) + ~fileview.y1 =Screen.y + ~fileview.x1 ~fileview.x2 + $line-hor + OVR2 =Screen.x + ( draw ) #03 =Screen.color + ( incr ) SWP2 #0002 ADD2 SWP2 + OVR2 OVR2 LTH2 ^$line-hor JNZ + POP2 POP2 + + ~fileview.y1 #0008 ADD2 =Screen.y + ~fileview.x1 #0008 ADD2 =Screen.x + ,rename_icn =Screen.addr + #21 =Screen.color + ~fileview.x2 #0018 SUB2 =Screen.x + ,load_icn =Screen.addr + #21 =Screen.color + ~fileview.x2 #0010 SUB2 =Screen.x + ,save_icn =Screen.addr + #21 =Screen.color + +RTN + @draw-color-code ( color* -- ) DUP ,font_hex ROT #0f AND #08 MUL #00 SWP ADD2 =Screen.addr @@ -642,14 +688,14 @@ RTN RTN -@draw-byte ( byte -- ) +@draw-byte ( byte color -- ) - STH + =color STH ,font_hex #00 DUPr STHr #f0 AND #04 SFT #08 MUL ADD2 =Screen.addr - ( draw ) #22 =Screen.color + ( draw ) ~color =Screen.color ~Screen.x 8+ =Screen.x ,font_hex #00 STHr #0f AND #08 MUL ADD2 =Screen.addr - ( draw ) #22 =Screen.color + ( draw ) ~color =Screen.color RTN @@ -694,7 +740,10 @@ RTN RTN -@full_icn [ 0038 7cfe fefe 7c38 ] +@circle_icns + [ 0038 7cfe fefe 7c38 ] ( full ) + [ 0038 4482 8282 4438 ] ( line ) + @tool_selector [ 80c0 e0f0 f8e0 1000 ] @tool_hand [ 4040 4070 f8f8 f870 ] @tool_eraser [ 2050 b87c 3e1c 0800 ] @@ -708,15 +757,22 @@ RTN 00fe 9292 fe92 92fe ] -@load_icn [ feaa d6aa d4aa f400 ] -@save_icn [ fe82 8282 848a f400 ] +@eye_icns + [ 0038 4492 2810 0000 ] ( open ) + [ 0000 0082 4438 0000 ] ( closed ) + +@rename_icn [ 1054 28c6 2854 1000 ] +@load_icn [ feaa d6aa d4aa f400 ] +@save_icn [ fe82 8282 848a f400 ] + @moveup_icn [ 0010 387c fe10 1000 ] @movedown_icn [ 0010 1010 fe7c 3810 ] @filepath1 [ projects/fonts/specter8.bit 00 ] @filepath2 [ projects/pictures/cibo.bit 00 ] @filepath3 [ projects/pictures/zerotwo10x10.chr 00 ] @filepath4 [ projects/fonts/katahira8.bit 00 ] -@filepath5 [ projects/pictures/daria10x10.chr 00 ] +@filepath5 [ projects/pictures/ako10x10.chr 00 ] +@filepath6 [ projects/pictures/cyr4x4.chr 00 ] @font_hex ( 0-F ) [