~rabbits/nasu

39fcc095a0409653dfc1ea4b34ea8895753c9b75 — neauoire 1 year, 3 months ago 7c10ebe
Fixed issue with guides in zoomed mode
1 files changed, 15 insertions(+), 34 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +15 -34
@@ 914,20 914,6 @@ RTN

RTN

@draw-nametable ( -- )

	#00
	&loop
		DUP TOS 
			DUP2 10MOD2 8** .nametable/x LDZ2 ++ .Screen/x DEO2
			DUP2 10// 8** .nametable/y LDZ2 ++ .Screen/y DEO2
			DUP2 BANK-NAMETABLE ++ LDA TOS 10** BANK-SPRITESHEET ++ .Screen/addr DEO2
			BANK-COLOR ++ LDA .Screen/sprite DEO
		INC DUP ,&loop JCN
	POP

RTN

@draw-tileview-zoom ( -- )

	( find focus ) GET-POSITION STH2 STH2


@@ 948,27 934,22 @@ RTN
	POP2r POP2r

	( guides )
	VER 8/ #01 - #00
	&guides-hor
		STHk
		.tileview/x1 LDZ2 
			.tileview/x2 LDZ2 
			.tileview/y1 LDZ2 STHr INC 40* #01 - TOS ++ 
			#02 
			;line-hor JSR2
		INC GTHk ,&guides-hor JCN
	POP2
	.tileview/x1 LDZ2 .tileview/x2 LDZ2 .tileview/y1 LDZ2 #003f ++ #02 ;line-hor JSR2
	.tileview/x1 LDZ2 #003f ++ .tileview/y1 LDZ2 .tileview/y2 LDZ2 #02 ;line-ver JSR2

	HOR 8/ #01 - #00
	&guides-ver
		STHk
		.tileview/x1 LDZ2 STHr INC 40* #01 - TOS ++ 
			.tileview/y1 LDZ2 
			.tileview/y2 LDZ2 
			#02 
			;line-ver JSR2
		INC GTHk ,&guides-ver JCN
	POP2
RTN

@draw-nametable ( -- )

	#00
	&loop
		DUP TOS 
			DUP2 10MOD2 8** .nametable/x LDZ2 ++ .Screen/x DEO2
			DUP2 10// 8** .nametable/y LDZ2 ++ .Screen/y DEO2
			DUP2 BANK-NAMETABLE ++ LDA TOS 10** BANK-SPRITESHEET ++ .Screen/addr DEO2
			BANK-COLOR ++ LDA .Screen/sprite DEO
		INC DUP ,&loop JCN
	POP

RTN