~rabbits/zombie

d6226bce9bf583593d1d4258376b69d4ec4fed0d — Devine Lu Linvega 1 year, 9 months ago c4b3163
Octave plays the right sample
1 files changed, 6 insertions(+), 4 deletions(-)

M src/main.tal
M src/main.tal => src/main.tal +6 -4
@@ 316,8 316,9 @@ JMP2r

@press-key ( pitch -- )

	DUP .sel/octave LDZ #0c MUL ADD .Audio0/pitch DEO
	.sel/octave LDZ #0c MUL ADD .time/frame LDZ2 ;set-key JSR2
	.sel/octave LDZ #0c MUL ADD
	DUP .sel/chan LDZ ;play-piano JSR2
	.time/frame LDZ2 ;set-key JSR2
	#00 .Mouse/state DEO

JMP2r


@@ 414,7 415,8 @@ JMP2r
		&not-empty
	OVR #0c LTH ,play-drum JCN

	( play piano )
@play-piano ( pitch chan -- )

	DUP #40 SFT STH
	#00 SWP #30 SFT2
	DUP2 ;song/piano-pcm ADD2 LDA2 .Audio0/addr STHkr ADD DEO2


@@ 422,7 424,7 @@ JMP2r
	DUP2 ;song/piano-env ADD2 LDA2 .Audio0/adsr STHkr ADD DEO2
	DUP2 ;song/piano-vol ADD2 LDA .Audio0/volume STHkr ADD DEO
	;song/piano-off ADD2 LDA #00 EQU #70 SFT ADD
	.Audio0/pitch STHr ADD DEO
	#0c SUB .Audio0/pitch STHr ADD DEO

JMP2r