~rabbits/nasu

433aa11a6aa5825906f88dfa13b847c3894b83f7 — Devine Lu Linvega 7 months ago 1c0f461
Fixed issue with new-file and nametables
1 files changed, 21 insertions(+), 20 deletions(-)

M src/nasu.tal
M src/nasu.tal => src/nasu.tal +21 -20
@@ 69,7 69,7 @@
	#32 .settings/ratio STZ
	#01 .settings/tool STZ
	#00 .settings/brush STZ
	#0000 ;set-focus JSR2
	;set-focus JSR2
	( place )
	.Screen/width DEI2 #01 SFT2 .frame/width LDZ2 #01 SFT2 SUB2 #001c .frame/width LDZ2 .frame/height LDZ2 ;frame ;set-size JSR2
	.frame/x1 LDZ2 #0001 SUB2 .frame/y1 LDZ2 #0038 ADD2 #007f DUP2 ;tileview ;set-size JSR2


@@ 441,10 441,16 @@ JMP2r

@set-selection-from ( x y -- )

	DUP .selection/y1 STZ .selection/y2 STZ
	DUP .selection/x1 STZ .selection/x2 STZ
	;clamp-selection JSR2
	.selection LDZ2 ;set-focus JSR2
	OVR #30 SFT
	OVR #30 SFT
		,set-selection-zoom JSR
	#0f AND
		DUP .selection/y1 STZ
		.selection/y2 STZ
	#0f AND
		DUP .selection/x1 STZ
		.selection/x2 STZ
	;set-focus JSR2
	;redraw JSR2

JMP2r


@@ 458,12 464,9 @@ JMP2r

JMP2r

@set-focus ( x y -- )
@set-focus ( -- )

	( set zoom )
	DUP2
		;get-tile-addr JSR2 .settings/focus STZ2
		#40 SFT ADD .selection/a STZ
	.selection LDZ2 ;get-tile-addr JSR2 .settings/focus STZ2

JMP2r



@@ 488,7 491,7 @@ JMP2r
	.selection/x1 LDZ #30 SFT .selection/y1 LDZ #30 SFT ;set-selection-zoom JSR2

	( focus )
	.selection LDZ2 ;set-focus JSR2
	;set-focus JSR2

	;redraw JSR2



@@ 521,7 524,7 @@ JMP2r
		.selection/y1 LDZ .selection/y2 STZ
		&no-y
	( focus )
	.selection LDZ2 ;set-focus JSR2
	;set-focus JSR2
	;redraw JSR2

JMP2r


@@ 737,7 740,7 @@ JMP2r

@get-tile-addr ( x y -- addr* )

	#00 SWP #40 SFT2 ROT #00 SWP ADD2 #40 SFT2 ;spritesheet ADD2
	#40 SFT ADD #00 SWP #40 SFT2 ;spritesheet ADD2

JMP2r



@@ 795,7 798,7 @@ JMP2r

@has-nametable ( -- bool )

	;spritesheet/nametable STH2k #0200 ADD2 STH2r
	;spritesheet/nametable STH2k #0300 ADD2 STH2r
	&loop
		LDAk #00 EQU ,&continue JCN
			POP2 POP2 #01 JMP2r


@@ 952,7 955,7 @@ JMP2r
	.dataview/x1 LDZ2 .Screen/x DEO2
	.dataview/y2 LDZ2 #0008 SUB2 .Screen/y DEO2
	#03 ;draw-chr/color STA
	.selection/a LDZ ;draw-byte JSR2
	.selection LDZ2 #40 SFT ADD ;draw-byte JSR2
	.dataview/y1 LDZ2 .Screen/y DEO2
	#0400
	&loop


@@ 1065,11 1068,10 @@ JMP2r

	#00 ;draw-filepath JSR2
	( clear )
	;spritesheet #1200 ;mclr JSR2
	;spritesheet #1300 ;mclr JSR2
	( rename to untitled.txt )
	;filepath #0020 ;mclr JSR2
	;untitled-txt ;filepath #000c ;mcpy JSR2

	#00 .state/changed STZ ;draw-state JSR2
	;redraw JSR2



@@ 1084,7 1086,7 @@ JMP2r
@file-open ( -- )

	( clear )
	;spritesheet #1200 ;mclr JSR2
	;spritesheet #1300 ;mclr JSR2
	( spritesheet )
	;filepath .File/name DEO2
	#1000 .File/length DEO2


@@ 1104,7 1106,7 @@ JMP2r
@file-open-mono ( -- )

	( clear )
	;spritesheet #1200 ;mclr JSR2
	;spritesheet #1300 ;mclr JSR2
	( spritesheet )
	;filepath .File/name DEO2
	#0008 .File/length DEO2


@@ 1362,7 1364,6 @@ JMP2r
@zoom-icns 0030 4884 8448 3402 0032 4582 8448 3402
@slider-icns f0f0 f0f0 f0f0 f000 50a0 50a0 50a0 5000
@circle-icns 001c 2241 4141 221c 001c 3e7f 7f7f 3e1c

@arrow-hor-icns 08 0c0e 7f0e 0c08 0008 1838 7f38 1808 00
@arrow-ver-icns 08 1c3e 7f08 0808 0008 0808 7f3e 1c08 00