

;===============================================================

.macro	play

wait    lda $d40b
        cmp #:1
        bne wait

	lda #:1
	sta $d01a

       	jsr player.sound

	lda #0
	sta $d01a
.endm

;===============================================================

	org $2000

	.local dl
	.byte $70,$70,$70
	.byte $42,a(sm)
	.byte $02,$70,$02,$02,$02,$70,$02,$02
	.byte $41,a(dl)
	.endl

	.local sm
;	.byte "0123456789012345678901234567890123456789"
	.byte "  Party:    Silly Venture 2k13          "
	.byte "  Compo:    ATARI XL/XE POKEY MSX COMPO "
	.byte "  Title:    A Moment of Stop            "
	.byte "  Author:   Dhor/M.E.C.                 "
	.byte "  Runtime:  4:16                        "
	.byte "  Player:   Theta Music Composer 1.1    "
	.byte "  Info:     Stereo, 2nd POKEY required  "
	.endl

	.proc main

	mwa #dl $230
	mva #14 709
	mva #0 710

	lda #$70
	ldx >msx
	ldy <msx
	jsr player.init

	ldx #0		;TMC
	txa
	jsr player.init

	lda #$10
	ldx #0
	jsr player.init

loop    lda 20
        cmp 20
        beq *-2

        jsr player.play		// pierwsze glowne wywolanie playera (1x na ramke)


	ift msx.fps = 2		// player wywolywany 2x na ramke

	play 48

	eli msx.fps = 3		// player wywolywany 3x na ramke

	play 20
	play 76

	eli msx.fps = 4		// player wywolywany 4x na ramke

	play 8
	play 48
	play 88

	eif

	lda $d20f
	and #12
	cmp #12
	bne return
	lda $d010
	beq return
	lda $d01f
	cmp #7
	bne return

        jmp loop

return	rts

        icl 'TMC-Player.asm'
	icl 'TMC-Relocator.mac'

;===============================================================

	.local msx
	tmc_relocator 'MOMENT.tmc', msx
	.sav [6] ?length
	.endl

	.endp		;End of main

        run main
