	device pentagon1024

pt3_frq=0;1;all freq tables(3.4x)
pt3_smpfix=1;vol,T,E/N cumulations in SMPs
pt3_patchaddr=1;0 ;physical addresses in module
;pt3_oddtempo=0;3 ;3,2,3,2...

pt3_port3=1;tone port.
pt3_vib6=1;vibrate

pt3_msx=0
pt3_ts2=0;2nd TS player;играет пат47 вместо пат0 и т.д.

IMVEC=#3bff ;#be00
	
	org #a000
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 INIT
	;endif

	ld hl,#c000
	ld de,#6000
	ld bc,#4000
	ldir
	;ld hl,tjpplay
	;ld de,#6000
	;ld bc,3
	;ldir

	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 $

tjpplay
	jp PLAY

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 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 #c000
muz
	include "PLAYFAS5.asm"
module
	;incbin "easy.pt3" ;
	;incbin "yerz_fix.pt3" ;
	;incbin "1kmup_fix.pt3" ;effects, noi
	;incbin "dizzy_fix_t.pt3" ;effects
	;incbin "IG.pt3" ;effects, smpfix
	;incbin "late_ev.pt3" ;effects, smpfix
	;incbin "UNDERGRO.pt3" ;effects, smpfix
	;incbin "MmcM_Undertime.pt3" ;effects, smpfix, noi
	;incbin "Night_av.pt3" ;effects, smpfix, noi
	;incbin "nq-retro_kombat-title.pt3" ;effects, smpfix, noi
	;incbin "ritm.pt3" ;effects, noi
	;incbin "HYPNOPUN.pt3" ;effects, noi, smpfix
	incbin "ZAGA9.pt3" ;effects, noi, smpfix


	include "PLAYFAS5_init.asm"


end

	display "begin ",begin
	display "end ",end
	display "Active end ",$
	display "Size ",/d,end-begin," bytes"

	display "SAVE BLOCK: Alt+W #6000..",end-1-muz+#6000
	
	savebin "allcode.c",begin,end-begin
	savebin "purecode.c",muz,end-muz
	
	LABELSLIST "..\us\user.l"
