~rabbits/nasu

1209017120e9484636ff04af55af1d7cf6a4c31c — Devine Lu Linvega 8 months ago 037a338
Improved docs
2 files changed, 23 insertions(+), 67 deletions(-)

M README.md
M src/nasu.tal
M README.md => README.md +14 -35
@@ 4,45 4,24 @@

## Build

You must have the [Uxn](https://git.sr.ht/~rabbits/uxn) assembler and emulator.
You must have an [Uxntal](https://git.sr.ht/~rabbits/uxn) assembler.

```
uxnasm src/main.tal bin/nasu.rom && uxnemu bin/nasu.rom
```sh
uxnasm src/nasu.tal bin/nasu.rom
```

If do not wish to assemble it yourself, you can download [nasu.rom](https://rabbits.srht.site/nasu/nasu.rom).

## Controls
## Run

You must have a Varvara emulator.

```sh
uxnemu bin/nasu.rom
```
File
        An : New
        Ar : Rename
        Ao : Open
        As : Save
Edit
        Ac : Copy
        Av : Paste
        Ax : Cut
Select
        q : Brush
        w : Selector
        e : Zoom
        U : Up
        D : Down
        L : Left
        R : Right
        sU : Decr.Height
        sD : Incr.Height
        sL : Decr.Width
        sR : Incr.Width
        esc : Reset
Pick
        1 : Color1
        2 : Color2
        3 : Color3
        4 : Color4
Options
        del : Erase
        spc : Zoom
```

## Support

- [theme](https://wiki.xxiivv.com/site/theme.html)
- [snarf](https://wiki.xxiivv.com/site/snarf.html)
- [manifest](https://wiki.xxiivv.com/site/manifest.html)

M src/nasu.tal => src/nasu.tal +9 -32
@@ 107,7 107,7 @@ BRK
			01 'x :edit-cut "Cut $1
			00 08 :edit-erase "Erase $1
		01 "View $1
			04 00 :view-zoom "Zoom $1
			02 00 :toggle-zoom "Zoom $1
		09 "Move $1
			10 00 :move-up "Up $1
			20 00 :move-down "Down $1


@@ 654,8 654,6 @@ JMP2r
	;draw-nametable JSR2
	;draw-zoomview JSR2

	#00 .Screen/auto DEO

JMP2r

@draw-tileview ( -- )


@@ 682,13 680,12 @@ JMP2r
		#84 .Screen/sprite DEO
		INC GTHk ,&loop-sel JCN
	POP2
	#00 .Screen/auto DEO
	#01 .Screen/auto DEO

JMP2r

@draw-tileview-zoom ( -- )

	#01 .Screen/auto DEO
	;pixel-icn .Screen/addr DEO2
	#1000
	&ver


@@ 723,7 720,6 @@ JMP2r

@draw-nametable ( -- )

	#01 .Screen/auto DEO
	.nametable/y LDZ2 .Screen/y DEO2
	#1000
	&ver


@@ 741,7 737,6 @@ JMP2r
		.Screen/y DEI2k #0008 ADD2 ROT DEO2
		INC GTHk ,&ver JCN
	POP2
	#00 .Screen/auto DEO

JMP2r



@@ 840,7 835,6 @@ JMP2r
	POP2

	.zoomview/x1 LDZ2 #0008 SUB2 .zoomview/y1 LDZ2 #0008 SUB2 #04 #04 ;frame-icns ;draw-frame JSR2
	#00 .Screen/auto DEO

	( label )
	.zoomview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2


@@ 886,10 880,8 @@ JMP2r
	( label )
	.preview/x1 LDZ2 .Screen/x DEO2
	.preview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2
	#01 .Screen/auto DEO
	#03 ;draw-chr/color STA
	.settings/ratio LDZ ;draw-byte JSR2
	#00 .Screen/auto DEO

JMP2r



@@ 897,18 889,17 @@ JMP2r

	.colorview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2
	.colorview/x1 LDZ2 .Screen/x DEO2
	#01 .Screen/auto DEO
	#03 ;draw-chr/color STA
	.System/r ,&get-color JSR ;draw-hex JSR2
	.System/g ,&get-color JSR ;draw-hex JSR2
	.System/b ,&get-color JSR ;draw-hex JSR2
	#00 .Screen/auto DEO

	.colorview/x1 LDZ2 .colorview/y1 LDZ2
		#00 .Screen/auto DEO
		OVR2 OVR2 [ .System/r ,&get-color JSR ] ,&slider JSR
		OVR2 OVR2 #0008 ADD2 [ .System/g ,&get-color JSR ] ,&slider JSR
		#0010 ADD2 [ .System/b ,&get-color JSR ] ,&slider JSR

		#01 .Screen/auto DEO
	JMP2r

	&slider ( x* y* value -- )


@@ 931,6 922,7 @@ JMP2r

@draw-blendview ( -- )

	#00 .Screen/auto DEO
	.settings/focus LDZ2 .Screen/addr DEO2
	#10 #00
	&loop


@@ 940,14 932,13 @@ JMP2r
		DUP .settings/blend LDZ #b0 AND ADD .Screen/sprite DEO
		INC GTHk ,&loop JCN
	POP2
	#01 .Screen/auto DEO

	( label )
	.blendview/x1 LDZ2 .Screen/x DEO2
	.blendview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2
	#01 .Screen/auto DEO
	#03 ;draw-chr/color STA
	( get blending ) .settings/blend LDZ ;draw-byte JSR2
	#00 .Screen/auto DEO

	( y )
	.blendview/x1 LDZ2 #0010 ADD2 .Screen/x DEO2


@@ 968,12 959,9 @@ JMP2r
	( position )
	.dataview/x1 LDZ2 .Screen/x DEO2
	.dataview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2
	#01 .Screen/auto DEO
	#03 ;draw-chr/color STA
	.selection/a LDZ ;draw-byte JSR2
	#00 .Screen/auto DEO
	.dataview/y1 LDZ2 .Screen/y DEO2
	#01 .Screen/auto DEO
	#0400
	&loop
		.dataview/x1 LDZ2 .Screen/x DEO2


@@ 987,7 975,6 @@ JMP2r
		.Screen/y DEI2k #0008 ADD2 ROT DEO2
		INC GTHk ,&loop JCN
	POP2
	#00 .Screen/auto DEO

JMP2r



@@ 1040,16 1027,12 @@ JMP2r

	.toolview/x1 LDZ2 #0040 ADD2 .Screen/x DEO2
	.toolview/y1 LDZ2 INC2 .Screen/y DEO2
	#01 .Screen/auto DEO
	;draw-chr/color STA

	;filepath
	( scroll )
		DUP2 ;slen JSR2 #0013 GTH2 #00 SWP
		;filepath ;slen JSR2 #0013 SUB2 MUL2 ADD2

	;draw-str JSR2 POP2
	#00 .Screen/auto DEO

JMP2r



@@ 1057,7 1040,7 @@ JMP2r

	.tileview/x1 LDZ2 #0008 SUB2 .tileview/y1 LDZ2 #0008 SUB2 #10 #10 ;frame-icns ;draw-frame JSR2
	.nametable/x LDZ2 #0008 SUB2 .nametable/y LDZ2 #0008 SUB2 #10 #10 ;frame-icns ;draw-frame JSR2
	#00 .Screen/auto DEO
	#01 .Screen/auto DEO

JMP2r



@@ 1280,12 1263,6 @@ JMP2r

JMP2r

@view-zoom ( -- )

	 ;toggle-zoom JSR2

JMP2r

( generics )

@set-size ( x1 y1 w* h* rect* -- )


@@ 1362,7 1339,7 @@ JMP2r
	;&sprite .Screen/addr DEO2
	#f2 .Screen/auto DEO
	STHr .Screen/sprite DEO
	#00 .Screen/auto DEO
	#01 .Screen/auto DEO

JMP2r
	&sprite aa00 0000 0000 0000


@@ 1373,7 1350,7 @@ JMP2r
	;&sprite .Screen/addr DEO2
	#f1 .Screen/auto DEO
	STHr .Screen/sprite DEO
	#00 .Screen/auto DEO
	#01 .Screen/auto DEO

JMP2r
	&sprite 8000 8000 8000 8000