	device pentagon1024

pt3_init=0 ;classic init-play kernel (0,+5)
pt3_jpplay=0 ;for pt3_init=0: jp PLAY in the beginning (if 1) or just address of PLAY in +1 (if 0)
pt3_vol=0;1 ;non-linear volume table
pt3_frqmin=5;0 ;lowest existing note
pt3_frqmax=78;95 ;highest existing note

pt3_smpfix=0;1 ;vol,T,E/N cumulations in samples
pt3_smpenv=0;1 ;envelope shift in samples
pt3_noi=0;1 ;noise shift in patterns
pt3_ornrange=0;1 ;range checking in ornaments (PTv3.6)

pt3_sld12= 0;1 ;glisses 1,2
pt3_port3= 0;1 ;tone portamento
pt3_dsmp4= 0;1 ;sample offset
pt3_dorn5= 0;1 ;ornament offset
pt3_vib6=  0;1 ;vibrate
pt3_Esld9A=0;1 ;env.gliss
pt3_tempoB=0;1 ;tempo

pt3_ts2=0 ;2nd TS player, plays pattern 47 instead of 0 etc
pt3_timex=0 ;Timex 2048/2068
pt3_msx=0 ;MSX

IMVEC=#3bff ;#be00
	
	org #6000
begin

	xor a
	out (#fe),a
	ld hl,#4000
	ld de,#4001
	ld bc,#17ff
	ld (hl),l
	ldir
	ld hl,#5800
	ld de,#5801
	ld bc,#2ff
	ld (hl),7
	ldir

	;ld (#5d10),a
	;ld (iy+1),#cc
	;ld sp,STACK

	if pt3_init
	ld hl,module
	call pt3player.INIT
	endif

	if IMVEC==#3bff
       ;LD hl,#c9fb
       ;LD (#fff4),hl
	   ld a,#c3
	   ld (#fff4),a
       ld hl,ON_INT
       ld (#fff5),hl
	   ld a,#18
	   ld (#ffff),a
	else
       ld hl,ON_INT
       ld (IMVEC+255),hl
	endif
	ld a,IMVEC/256
    ld i,a
    im 2
	ei ;INIT disables the interrupts
	
	
	jp $

ON_INT
	;disp IMER
	push af,bc,hl
	ld hl,(timer)
	inc hl
	ld (timer),hl
	push de
	push ix
	ex af,af'
	push af
	push iy
	exx
	push bc,de,hl
	call pt3player.PLAY
	pop hl,de,bc
	pop iy
	pop af
	ex af,af'
	pop ix
	pop de
	pop hl,bc,af
	ei
	ret
timer
	dw 0
	;ent
szimer=$-ON_INT


	;ALIGN 256
	org #dc00
muz
	include "PT3X0B.asm"
module
	;incbin "MACROSIK.pt3" ;sld12...
	;incbin "testmusic.pt3" ;not, sld12, port3, tempoB...
	;incbin "m_entryO.pt3" ;sld12, Esld9A...
	;incbin "ACIDCHIC.pt3" ;tempoB, vib6, dsmp4...
	;incbin "dedicate.pt3" ;noi, port3
	;incbin "horror1k.pt3" ;smpfix
	;incbin "TNE4WHAM.pt3" ;tempoB, vib6, port3, sld12, noi...
	;incbin "Hexagonal.pt3" ;tempoB, vib6, port3...
	incbin "b555.m.pt3" ;


	include "PT3X0B_init.asm"


end

	display "begin ",begin
	display "end ",end
	display "Active end ",$
	display "Size ",/d,end-begin," bytes"
	
	savebin "allcode.c",begin,end-begin
	savebin "purecode.c",muz,end-muz
	
	LABELSLIST "..\us\user.l"
