; **************************
; * DAVID WHITTAKER PLAYER *
; * ---------------------- *
; *       (C)1989-90       *
; *    ZENIX of DIRECT!    *
; * ---------------------- *
; * Right shiftkey toggles *
; * different tunes!       *
; *			   *
; * RI tune into MUSICBASE *
; **************************

MusicBase=	$30000			; Tune mem-location

Tunes=		3			; Number of tunes

play=	Musicbase+$0e
kill=	Musicbase+$1c

	move.l	#0,d0			; Init
	move.l	#0,nowplaying
	jsr	musicbase

start:	move.l	$6c.w,irqsave+2
	move.l	#irq,$6c.w

main:	btst	#6,$bfe001		; Test left button
	beq.s	end
	cmp.b	#$3d,$bfec01		; Test right SHIFT key
	bne.s	main
slip:	cmp.b	#$3d,$bfec01		; Is it still pressed?
	beq.s	slip
	add.l	#1,nowplaying
	cmp.l	#tunes,nowplaying
	beq.s	restartcount
	move.l	nowplaying,d0
	jsr	musicbase
	bra	main

restartcount:
	move.l	#0,nowplaying
	move.l	#0,d0
	jsr	musicbase
	bra	main

end:	jsr	kill			; Turn off music
	move.l	irqsave+2,$6c.w
	move.w	#$f,$dff096
	moveq	#0,d0
	rts

irq:	cmp.b	#183,$dff006
	bne.s	irq
	move.w	#$0fff,$dff180
	jsr	play
	move.w	#$0000,$dff180

irqsave:
	jmp	$0

nowplaying:
	dc.l	0

org musicbase
load musicbase

music:	blk.l	0,0

