Compucolor.org – Virtual Media

Listing of file='SWARE.MAC;01' on disk='vmedia/joystick_sound-sector.ccvf'

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
;	SOUNDWARE/SCROLL/NO-ECHO PATCH A LA CAP ELECTRONICS
;
	TITLE	SWARE
;
	ENTRY	SWARE
	ENTRY	SOUND

	PUBLIC	PITCH,DURN,NSTEPS,STEP1,STEP2


PITCH:	DB	50,0
DURN:	DB	15,0
NSTEPS:	DB	0
STEP1:	DB	0
STEP2:	DB	0

SWARE:	MOV	A,E
	CPI	0
	JNZ	SCRL
SOUND:	MVI	E,8
	DI
	LDA	STEP1
	MOV	D,A
	LDA	STEP2
	CPI	0
	JNZ	SW10
	MOV	A,D
	STA	STEP2
SW10:	LHLD	PITCH
	SHLD	SW30+1
	LHLD	DURN
	SHLD	SW20+1
SW20:	LXI	H,DURN
SW30:	LXI	B,PITCH
SW40:	DCX	B
	MOV	A,B
	ORA	C
	JNZ	SW40
	MOV	A,E
	XRI	02
	OUT	04
	MOV	E,A
	DCX	H
	MOV	A,H
	ORA	L
	JNZ	SW30
	LDA	NSTEPS
	CPI	0
	JZ	SW50
	DCR	A
	STA	NSTEPS
	LDA	SW30+1
	ADD	D
	STA	SW30+1
	LDA	STEP2
	MOV	H,A
	MOV	A,D
	STA	STEP2
	MOV	D,H
	JMP	SW20
SW50:	STA	STEP2
	STA	DURN+1
	STA	PITCH+1
	MVI	A,15
	STA	DURN
	MVI	A,50
	STA	PITCH
	EI
	RET

	ENTRY	SCRL
	ENTRY	SCROLL

	PUBLIC	STADR,NOLINS,WIDTH,DOUBLE,ENDADR

SCRL:	CPI	1
	JNZ	NOEC
SCROLL:	DB	21H	;LXI	H,STADR
STADR:	DW	7000H
	DB	06H	;MVI	B,NOLINS
NOLINS:	DB	4
SC10:	DB	0EH	;MVI	C,WIDTH
WIDTH:	DB	128
SC20:	LXI	D,128
	DAD	D
	MOV	A,M
	LXI	D,-128
	DAD	D
	MOV	M,A
	INX	H
DOUBLE:	NOP		;POKE AN 'INX H' IN HERE
	DCR	C
	JNZ	SC20
	DB	11H	;LXI	D,ENDADR
ENDADR:	DW	08H
	DAD	D
	DCR	B
	JNZ	SC10
	RET

	ENTRY	NOEC
	ENRTY	NOECHO

KEYTST	EQU	0024H
READY	EQU	81FFH

NOEC:	CPI	02
	JNZ	MORE
NOECHO:	PUSH	PSW
	PUSH	H
	PUSH	B
NO10:	CALL	KEYTST
	JNZ	NO10
	MOV	E,A
	XRA	A
	MOV	D,A
	STA	READY
	POP	B
	POP	H
	POP	PSW
	RET

MORE:	RET

	END