	NAME	bank1(17)
	RSEG	CODE(0)
	RSEG	CSTR(0)
	RSEG	CONST(0)
	RSEG	TEMP(0)
	RSEG	UDATA0(0)
	RSEG	IDATA0(0)
	RSEG	CDATA0(0)
	PUBLIC	AS0_Init
	PUBLIC	AS0_Play
	PUBLIC	ASC0_Detect
	PUBLIC	ASC1_Detect
	PUBLIC	ASC_Detect
	PUBLIC	ASC_GetInfo
	PUBLIC	ASC_GetInfo_orig
	PUBLIC	ASC_GetRegisters
	PUBLIC	ASC_Init
	PUBLIC	ASC_Init_orig
	PUBLIC	ASC_PatternInterpreter
	PUBLIC	ASC_Play
	PUBLIC	ASC_Play_orig
	PUBLIC	ASM_Table
	PUBLIC	ClearString
	PUBLIC	FN
	PUBLIC	GetDecodeBuffer
	EXTERN	Getnfiles
	PUBLIC	II
	PUBLIC	PSC_Detect
	PUBLIC	PSC_GetInfo
	PUBLIC	PSC_GetRegisters
	PUBLIC	PSC_Init
	PUBLIC	PSC_PatternInterpreter
	PUBLIC	PSC_Play
	EXTERN	PSG_Detect
	EXTERN	PSG_GetInfo
	PUBLIC	PSG_Init
	PUBLIC	PSG_Play
	EXTERN	PT1_Detect
	EXTERN	PT1_GetInfo
	EXTERN	PT1_Init
	EXTERN	PT1_Play
	EXTERN	PT2_Detect
	EXTERN	PT2_GetInfo
	EXTERN	PT2_Init
	EXTERN	PT2_Play
	EXTERN	PT3_Detect
	EXTERN	PT3_GetInfo
	EXTERN	PT3_Init
	EXTERN	PT3_Play_Chip
	EXTERN	Pr_Sym
	PUBLIC	ResetDecodeBuffers
	EXTERN	SQT_Detect
	EXTERN	SQT_GetInfo
	EXTERN	SQT_Init
	EXTERN	SQT_Play
	EXTERN	STC_Detect
	EXTERN	STC_GetInfo
	EXTERN	STC_Init
	EXTERN	STC_Play
	EXTERN	STP_Detect
	EXTERN	STP_GetInfo
	EXTERN	STP_Init
	EXTERN	STP_Play
	EXTERN	Shuffle
	EXTERN	Status
	PUBLIC	X
	PUBLIC	Y
	PUBLIC	asc
	EXTERN	attr_new
	PUBLIC	ay_readay
	EXTERN	ay_sys_getword
	PUBLIC	ay_writeay
	PUBLIC	back
	EXTERN	back_classic
	EXTERN	clock
	PUBLIC	copy
	EXTERN	curcor
	PUBLIC	d2s
	PUBLIC	d2srv
	PUBLIC	decode_buffers
	EXTERN	decode_lzss_step
	EXTERN	delay
	PUBLIC	detect
	EXTERN	di_
	PUBLIC	disker
	PUBLIC	disker2
	EXTERN	dstatus
	EXTERN	ei_
	PUBLIC	g
	PUBLIC	gotoxy
	PUBLIC	info
	PUBLIC	init
	EXTERN	input
	EXTERN	l
	EXTERN	memcmp
	EXTERN	memcpy
	EXTERN	memset
	EXTERN	next
	EXTERN	next_m
	EXTERN	nfiles
	PUBLIC	o
	PUBLIC	offset
	EXTERN	output
	PUBLIC	pc_counter
	EXTERN	play
	PUBLIC	plays
	PUBLIC	pp
	PUBLIC	ppp
	PUBLIC	print
	PUBLIC	printchar
	PUBLIC	printf
	PUBLIC	printi
	PUBLIC	prints
	EXTERN	printstring
	PUBLIC	printstring1
	PUBLIC	putchar
	PUBLIC	re
	EXTERN	read_d
	PUBLIC	resume
	EXTERN	s
	EXTERN	sort
	EXTERN	space_buf0
	EXTERN	space_buf1
	EXTERN	space_buf2
	EXTERN	space_buf3
	EXTERN	space_buf4
	PUBLIC	sprintf
	PUBLIC	state
	PUBLIC	stop
	EXTERN	strcpy
	PUBLIC	string_copy
	EXTERN	strncpy
	EXTERN	tiho
	PUBLIC	title1
	EXTERN	vars
	EXTERN	?CLZ80B_4_06_L00
	EXTERN	?UC_DIV_L01
	EXTERN	?SC_DIV_L01
	EXTERN	?UC_MOD_L01
	EXTERN	?S_LSH_L02
	EXTERN	?SS_RSH_L02
	EXTERN	?SS_DIV_L02
	EXTERN	?US_MOD_L02
	EXTERN	?SS_MOD_L02
	EXTERN	?S_MUL_L02
	EXTERN	?S_LSHASG_L02
	EXTERN	?US_DIVASG_L02
	EXTERN	?S_MULASG_L02
	EXTERN	?SL_CMP_L03
	EXTERN	?L_INC_L03
	EXTERN	?L_ADDASG_L03
	EXTERN	?C_S_SWITCH_L06
	EXTERN	?BANK_CALL_DIRECT_EXAF_L08
	EXTERN	?BANK_FAST_LEAVE_L08
	RSEG	CODE
; 1.	# include "all.h"
; 2.	
; 3.	
; 4.	
; 5.	const unsigned short ASM_Table[] =
; 6.	{ 0xedc, 0xe07, 0xd3e, 0xc80, 0xbcc, 0xb22, 0xa82, 0x9ec, 0x95c, 0x8d6, 0x858, 0x7e0, 0x76e, 0x704, 0x69f, 0x640, 0x5e6, 0x591, 0x541, 0x4f6, 0x4ae, 0x46b, 0x42c, 0x3f0, 0x3b7,
; 7.	0x382, 0x34f, 0x320, 0x2f3, 0x2c8, 0x2a1, 0x27b, 0x257, 0x236, 0x216, 0x1f8, 0x1dc, 0x1c1, 0x1a8, 0x190, 0x179, 0x164, 0x150, 0x13d, 0x12c, 0x11b, 0x10b, 0xfc, 0xee, 0xe0, 
; 8.	0xd4, 0xc8, 0xbd, 0xb2, 0xa8, 0x9f, 0x96, 0x8d, 0x85, 0x7e, 0x77, 0x70, 0x6a, 0x64, 0x5e, 0x59, 0x54, 0x50, 0x4b, 0x47, 0x43, 0x3f, 0x3c, 0x38, 0x35, 0x32, 0x2f, 0x2d, 0x2a, 
; 9.	0x28, 0x26, 0x24, 0x22, 0x20, 0x1e, 0x1c };
; 10.	
; 11.	typedef struct 
; 12.	{
; 13.	        signed char PSC_MusicName[69];
; 14.	        unsigned char PSC_UnknownPointer0, PSC_UnknownPointer1;
; 15.	        unsigned char PSC_PatternsPointer0, PSC_PatternsPointer1;
; 16.	        unsigned char PSC_Delay;
; 17.	        unsigned char PSC_OrnamentsPointer0, PSC_OrnamentsPointer1;
; 18.	        unsigned char PSC_SamplesPointers0[64];
; 19.	} PSC_File;
; 20.	
; 21.	#define PSC_UnknownPointer (header->PSC_UnknownPointer0 | (header->PSC_UnknownPointer1 << 8))
; 22.	#define PSC_PatternsPointer (header->PSC_PatternsPointer0 | (header->PSC_PatternsPointer1 << 8))
; 23.	#define PSC_OrnamentsPointer (header->PSC_OrnamentsPointer0 | (header->PSC_OrnamentsPointer1 << 8))
; 24.	#define PSC_SamplesPointers(x) (header->PSC_SamplesPointers0 [(x) * 2] | ((header->PSC_SamplesPointers0 [((x) * 2) + 1]) << 8))
; 25.	
; 26.	typedef struct 
; 27.	{
; 28.	        unsigned char num;
; 29.	        unsigned int Address_In_Pattern, OrnamentPointer, SamplePointer, Ton;
; 30.	        int Current_Ton_Sliding, Ton_Accumulator, Addition_To_Ton;
; 31.	        signed char Initial_Volume, Note_Skip_Counter;
; 32.	        unsigned char Note, Volume, Amplitude, Volume_Counter, Volume_Counter1, Volume_Counter_Init, Noise_Accumulator, Position_In_Sample, Loop_Sample_Position, Position_In_Ornament, Loop_Ornament_Position;
; 33.	        bool Enabled, Ornament_Enabled, Envelope_Enabled, Gliss, Ton_Slide_Enabled, Break_Sample_Loop, Break_Ornament_Loop, Volume_Inc;
; 34.	} PSC_Channel_Parameters;
; 35.	
; 36.	typedef struct 
; 37.	{
; 38.	        unsigned char Delay, DelayCounter, Lines_Counter, Noise_Base;
; 39.	        unsigned int Positions_Pointer;
; 40.	} PSC_Parameters;
; 41.	
; 42.	typedef struct 
; 43.	{
; 44.	        PSC_Parameters PSC;
; 45.	        PSC_Channel_Parameters PSC_A, PSC_B, PSC_C;
; 46.	} PSC_SongInfo;
; 47.	
; 48.	
; 49.	PSC_SongInfo ppp;
; 50.	
; 51.	#define PSC_A ((PSC_SongInfo *)info->data)->PSC_A
; 52.	#define PSC_B ((PSC_SongInfo *)info->data)->PSC_B
; 53.	#define PSC_C ((PSC_SongInfo *)info->data)->PSC_C
; 54.	#define PSC ((PSC_SongInfo *)info->data)->PSC
; 55.	
; 56.	void PSC_Init(AYSongInfo * info)
; 57.	{
PSC_Init:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 58.	        unsigned char * module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010),HL
; 59.	        PSC_File *header = (PSC_File *)module;
	LD	(?0010+2),HL
; 60.	
; 61.	        info->data = (PSC_SongInfo *) &ppp;
	LD	(IX+4),LOW(ppp)
	LD	(IX+5),HIGH(ppp)
; 62.	
; 63.	        if (info)
	LD	A,IXL
	OR	IXH
	JR	Z,?0012
?0011:
; 64.	
; 65.	                PSC.DelayCounter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	LD	(HL),1
?0012:
; 66.	        PSC.Delay = header->PSC_Delay;
	LD	L,(IX+4)
	LD	H,(IX+5)
	PUSH	HL
	LD	HL,73
	LD	BC,(?0010+2)
	ADD	HL,BC
	LD	D,(HL)
	POP	HL
	LD	(HL),D
; 67.	        PSC.Positions_Pointer = PSC_PatternsPointer;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,4
	ADD	HL,DE
	PUSH	HL
	LD	HL,71
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,72
	ADD	HL,BC
	LD	H,(HL)
	LD	C,A
	LD	A,D
	OR	H
	LD	B,A
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 68.	        PSC.Lines_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	(HL),1
; 69.	        PSC.Noise_Base = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	INC	HL
	LD	(HL),D
; 70.	
; 71.	        PSC_A.num = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,6
	ADD	HL,BC
	LD	(HL),B
; 72.	        PSC_B.num = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,42
	ADD	HL,BC
	LD	(HL),1
; 73.	        PSC_C.num = 2;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,78
	ADD	HL,BC
	LD	(HL),2
; 74.	
; 75.	        PSC_A.SamplePointer = PSC_SamplesPointers(0) + 0x4c;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,11
	ADD	HL,BC
	PUSH	HL
	LD	HL,76
	LD	BC,(?0010+2)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,77
	ADD	HL,BC
	LD	H,(HL)
	LD	C,A
	LD	A,D
	OR	H
	LD	B,A
	LD	HL,76
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 76.	        PSC_B.SamplePointer = PSC_A.SamplePointer;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,47
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,11
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 77.	        PSC_C.SamplePointer = PSC_A.SamplePointer;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,83
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,11
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 78.	        PSC_A.OrnamentPointer = ay_sys_getword(&module[PSC_OrnamentsPointer]) + PSC_OrnamentsPointer;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,9
	ADD	HL,BC
	PUSH	HL
	LD	HL,74
	LD	BC,(?0010+2)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	H,(HL)
	LD	C,A
	LD	A,D
	OR	H
	LD	B,A
	LD	HL,(?0010)
	CALL	LWRD ?1581
	PUSH	HL
	LD	HL,74
	LD	BC,(?0010+2)
	ADD	HL,BC
	LD	A,(HL)
	LD	D,0
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	C,A
	LD	A,D
	OR	B
	LD	B,A
	POP	HL
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 79.	        PSC_B.OrnamentPointer = PSC_A.OrnamentPointer;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,45
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,9
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 80.	        PSC_C.OrnamentPointer = PSC_A.OrnamentPointer;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,81
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,9
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 81.	
; 82.	        PSC_A.Break_Ornament_Loop = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,40
	ADD	HL,BC
	LD	(HL),B
; 83.	        PSC_A.Ornament_Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,35
	ADD	HL,BC
	LD	(HL),B
; 84.	        PSC_A.Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	DEC	BC
	ADD	HL,BC
	LD	(HL),B
; 85.	        PSC_A.Break_Sample_Loop = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,39
	ADD	HL,BC
	LD	(HL),B
; 86.	        PSC_A.Ton_Slide_Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	DEC	BC
	ADD	HL,BC
	LD	(HL),B
; 87.	        PSC_A.Note_Skip_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,22
	ADD	HL,BC
	LD	(HL),1
; 88.	        PSC_A.Ton = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,13
	ADD	HL,BC
	XOR	A
	LD	(HL),A
	INC	HL
	LD	(HL),A
; 89.	
; 90.	        PSC_B.Break_Ornament_Loop = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,76
	ADD	HL,BC
	LD	(HL),B
; 91.	        PSC_B.Ornament_Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,71
	ADD	HL,BC
	LD	(HL),B
; 92.	        PSC_B.Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	DEC	BC
	ADD	HL,BC
	LD	(HL),B
; 93.	        PSC_B.Break_Sample_Loop = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,75
	ADD	HL,BC
	LD	(HL),B
; 94.	        PSC_B.Ton_Slide_Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	DEC	BC
	ADD	HL,BC
	LD	(HL),B
; 95.	        PSC_B.Note_Skip_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,58
	ADD	HL,BC
	LD	(HL),1
; 96.	        PSC_B.Ton = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,49
	ADD	HL,BC
	LD	(HL),A
	INC	HL
	LD	(HL),A
; 97.	
; 98.	        PSC_C.Break_Ornament_Loop = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,112
	ADD	HL,BC
	LD	(HL),B
; 99.	        PSC_C.Ornament_Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,107
	ADD	HL,BC
	LD	(HL),B
; 100.	        PSC_C.Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	DEC	BC
	ADD	HL,BC
	LD	(HL),B
; 101.	        PSC_C.Break_Sample_Loop = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,111
	ADD	HL,BC
	LD	(HL),B
; 102.	        PSC_C.Ton_Slide_Enabled = false;
	LD	L,(IX+4)
	LD	H,(IX+5)
	DEC	BC
	ADD	HL,BC
	LD	(HL),B
; 103.	        PSC_C.Note_Skip_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,94
	ADD	HL,BC
	LD	(HL),1
; 104.	        PSC_C.Ton = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,85
	ADD	HL,BC
	LD	(HL),A
	INC	HL
	LD	(HL),A
; 105.	
; 106.	        info->slow = 1;
?1573:
	LD	(IX+109),1
; 107.	}
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1586:
	ADD	HL,BC
	LD	H,(HL)
	LD	C,E
	OR	H
	LD	B,A
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	DE,(?0010+97)
	ADD	HL,DE
	LD	L,(HL)
	LD	H,0
	LD	DE,65344
?1584:
	ADD	HL,DE
	ADD	HL,HL
	ADD	HL,BC
?1585:
	LD	BC,(?0010+97)
?1581:
	ADD	HL,BC
?1583:
	EX	DE,HL
?1582:
	LD	A,BYTE3 ay_sys_getword
	LD	HL,LWRD ay_sys_getword
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 108.	
; 109.	void PSC_PatternInterpreter(AYSongInfo * info, PSC_Channel_Parameters * chan)
; 110.	{
PSC_PatternInterpreter:
	PUSH	IY
	PUSH	IX
	PUSH	BC
	POP	IX
	PUSH	DE
	POP	IY
; 111.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+4),HL
; 112.	        PSC_File *header = (PSC_File *)module;
	LD	(?0010+6),HL
; 113.	        bool quit;
; 114.	        bool b1b, b2b, b3b, b4b, b5b, b6b, b7b;
; 115.	        quit = b1b = b2b = b3b = b4b = b5b = b6b = b7b = false;
	XOR	A
	LD	(?0010+15),A
	LD	(?0010+14),A
	LD	(?0010+13),A
	LD	(?0010+12),A
	LD	(?0010+11),A
	LD	(?0010+10),A
	LD	(?0010+9),A
	LD	(?0010+8),A
?0015:
; 116.	        do
; 117.	        {
; 118.	                unsigned char val = module[chan->Address_In_Pattern];
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+16),A
; 119.	                if(val >= 0xc0)
	CP	192
	JR	C,?0017
?0016:
; 120.	                {
; 121.	                        chan->Note_Skip_Counter = val - 0xbf;
	ADD	A,65
	LD	(IX+16),A
; 122.	                        quit = true;
	LD	A,1
	LD	(?0010+8),A
	JP	LWRD ?1167
?0017:
; 123.	                }
; 124.	                else if(val >= 0xa0 && val <= 0xbf)
	CP	160
	JR	C,?0020
	LD	B,A
	LD	A,191
	CP	B
	JR	C,?0020
?0022:
?0021:
?0019:
; 125.	                {
; 126.	                        //chan->OrnamentPointer = (*(unsigned short *) &module[PSC_OrnamentsPointer + (val - 0xa0) * 2]) +PSC_OrnamentsPointer;
; 127.	                        chan->OrnamentPointer = ay_sys_getword(&module[PSC_OrnamentsPointer + (val - 0xa0) * 2]) + PSC_OrnamentsPointer;
	LD	HL,74
	LD	BC,(?0010+6)
	ADD	HL,BC
	LD	E,(HL)
	LD	D,0
	LD	HL,75
	ADD	HL,BC
	LD	H,(HL)
	LD	L,D
	LD	C,E
	LD	A,D
	OR	H
	LD	B,A
	LD	DE,(?0010+16)
	LD	D,L
	LD	HL,65376
	ADD	HL,DE
	ADD	HL,HL
	ADD	HL,BC
	LD	BC,(?0010+4)
	CALL	LWRD ?1581
	PUSH	HL
	LD	HL,74
	LD	BC,(?0010+6)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	C,E
	OR	B
	LD	B,A
	POP	HL
	ADD	HL,BC
	LD	(IX+3),L
	LD	(IX+4),H
	JP	LWRD ?1167
?0020:
; 128.	                }
; 129.	                else if(val >= 0x7e && val <= 0x9f)
	LD	A,(?0010+16)
	CP	126
	JR	C,?0025
	LD	B,A
	LD	A,159
	CP	B
	JR	C,?0025
?0027:
?0026:
?0024:
; 130.	                {
; 131.	                        if(val >= 0x80)
	LD	A,B
	CP	128
	JP	C,?1167
?0028:
; 132.	                                chan->SamplePointer = PSC_SamplesPointers(val - 0x80) + 0x4c;
	LD	C,B
	LD	B,0
	LD	HL,65408
	ADD	HL,BC
	ADD	HL,HL
	LD	BC,(?0010+6)
	ADD	HL,BC
	LD	DE,76
	ADD	HL,DE
	LD	E,(HL)
	PUSH	DE
	LD	L,A
	LD	H,D
	LD	DE,65408
	ADD	HL,DE
	ADD	HL,HL
	ADD	HL,BC
	LD	BC,77
	ADD	HL,BC
	LD	B,(HL)
	POP	DE
	LD	L,E
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,76
	ADD	HL,BC
	LD	(IX+5),L
	LD	(IX+6),H
?0029:
	JP	LWRD ?1167
?0025:
; 133.	                }
; 134.	                else if(val == 0x6b)
	LD	A,(?0010+16)
	CP	107
	JR	NZ,?0032
?0031:
; 135.	                {
; 136.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1157
	INC	(IX+2)
?1157:
; 137.	                        chan->Addition_To_Ton = module[chan->Address_In_Pattern];
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	C,(HL)
	LD	(IX+13),C
	LD	(IX+14),0
; 138.	                        b5b = true;
	JR	?1169
?0032:
; 139.	                }
; 140.	                else if(val == 0x6c)
	CP	108
	JR	NZ,?0035
?0034:
; 141.	                {
; 142.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1158
	INC	(IX+2)
?1158:
; 143.	                        chan->Addition_To_Ton = -(signed char)(module[chan->Address_In_Pattern]);
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	C,(HL)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	AND	A
	LD	HL,0
	SBC	HL,BC
	LD	(IX+13),L
	LD	(IX+14),H
; 144.	                        b5b = true;
?1169:
	LD	A,1
	LD	(?0010+13),A
	JP	LWRD ?1167
?0035:
; 145.	                }
; 146.	                else if(val == 0x6d)
	CP	109
	JR	NZ,?0038
?0037:
; 147.	                {
; 148.	                        b4b = true;
	LD	A,1
	LD	(?0010+12),A
; 149.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1159
	INC	(IX+2)
?1159:
; 150.	                        chan->Addition_To_Ton = module[chan->Address_In_Pattern];
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	C,(HL)
	LD	(IX+13),C
	LD	(IX+14),0
	JP	LWRD ?1167
?0038:
; 151.	                }
; 152.	                else if(val == 0x6e)
	CP	110
	JR	NZ,?0041
?0040:
; 153.	                {
; 154.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1160
	INC	(IX+2)
?1160:
; 155.	                        PSC.Delay = module[chan->Address_In_Pattern];
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	B,(HL)
	LD	L,(IY+4)
	LD	H,(IY+5)
	JP	LWRD ?1173
?0041:
; 156.	                }
; 157.	                else if(val == 0x6f)
	CP	111
	JR	NZ,?0044
?0043:
; 158.	                {
; 159.	                        b1b = true;
	LD	A,1
	LD	(?0010+9),A
; 160.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JP	NZ,?1167
	JP	LWRD ?1171
?0044:
; 161.	                }
; 162.	                else if(val == 0x70)
	CP	112
	JR	NZ,?0047
?0046:
; 163.	                {
; 164.	                        b3b = true;
	LD	A,1
	LD	(?0010+11),A
; 165.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1162
	INC	(IX+2)
?1162:
; 166.	                        chan->Volume_Counter1 = module[chan->Address_In_Pattern];
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	B,(HL)
	LD	(IX+21),B
	JP	LWRD ?1167
?0047:
; 167.	                }
; 168.	                else if(val == 0x71)
	CP	113
	JR	NZ,?0050
?0049:
; 169.	                {
; 170.	                        chan->Break_Ornament_Loop = true;
	LD	(IX+34),1
; 171.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JP	NZ,?1167
	JP	LWRD ?1171
?0050:
; 172.	                }
; 173.	                else if(val == 0x7a)
	CP	122
	JR	NZ,?0053
?0052:
; 174.	                {
; 175.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1164
	INC	(IX+2)
?1164:
; 176.	                        if(chan->num == 1)
	LD	B,(IX+0)
	DEC	B
	JP	NZ,?1167
?0054:
; 177.	                        {
; 178.	                                ay_writeay(AY_ENV_SHAPE, module[chan->Address_In_Pattern] & 15);
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,13
	CALL	LWRD ?1592
; 179.	                                ay_writeay(AY_ENV_FINE, module[chan->Address_In_Pattern + 1]);
	LD	C,(HL)
	LD	E,11
	CALL	LWRD ?1592
; 180.	                                ay_writeay(AY_ENV_COARSE, module[chan->Address_In_Pattern + 2]);
	INC	HL
	LD	C,(HL)
	LD	E,12
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 181.	                                chan->Address_In_Pattern += 2;
	PUSH	IX
	POP	HL
	INC	HL
	LD	A,(HL)
	ADD	A,2
	LD	(HL),A
	JP	NC,?1167
	INC	HL
	INC	(HL)
?0055:
	JP	LWRD ?1167
?0053:
; 182.	                        }
; 183.	                }
; 184.	                else if(val == 0x7b)
	CP	123
	JR	NZ,?0058
?0057:
; 185.	                {
; 186.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1166
	INC	(IX+2)
?1166:
; 187.	                        if(chan->num == 1)
	LD	B,(IX+0)
	DEC	B
	JP	NZ,?1167
?0059:
; 188.	                                PSC.Noise_Base = module[chan->Address_In_Pattern];
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	LD	B,(HL)
	LD	L,(IY+4)
	LD	H,(IY+5)
	INC	HL
	INC	HL
	INC	HL
?1173:
	LD	(HL),B
?0060:
	JR	?1167
?0058:
; 189.	                }
; 190.	                else if(val == 0x7c)
	CP	124
	JR	NZ,?0063
?0062:
; 191.	                {
; 192.	                        b1b = b3b = b4b = b5b = b6b = b7b = false;
	XOR	A
	LD	(?0010+15),A
	LD	(?0010+14),A
	LD	(?0010+13),A
	LD	(?0010+12),A
	LD	(?0010+11),A
	LD	(?0010+9),A
; 193.	                        b2b = true;
	LD	A,1
	LD	(?0010+10),A
	JR	?1167
?0063:
; 194.	                }
; 195.	                else if(val == 0x7d)
	CP	125
	JR	NZ,?0066
?0065:
; 196.	                {
; 197.	                        chan->Break_Sample_Loop = true;
	LD	(IX+33),1
	JR	?1167
?0066:
; 198.	                }
; 199.	                else if(val >= 0x58 && val <= 0x66)
	CP	88
	JR	C,?0069
	LD	B,A
	LD	A,102
	CP	B
	JR	C,?0069
?0071:
?0070:
?0068:
; 200.	                {
; 201.	                        chan->Initial_Volume = val - 0x57;
	LD	A,B
	ADD	A,169
	LD	(IX+15),A
; 202.	                        chan->Envelope_Enabled = false;
	LD	(IX+30),0
; 203.	                        b6b = true;
	JR	?1170
?0069:
; 204.	                }
; 205.	                else if(val == 0x57)
	LD	A,(?0010+16)
	CP	87
	JR	NZ,?0074
?0073:
; 206.	                {
; 207.	                        chan->Initial_Volume = 0xf;
	LD	(IX+15),15
; 208.	                        chan->Envelope_Enabled = true;
	LD	(IX+30),1
; 209.	                        b6b = true;
?1170:
	LD	A,1
	LD	(?0010+14),A
	JR	?1167
?0074:
; 210.	                }
; 211.	                else if(val <= 0x56)
	LD	B,A
	LD	A,86
	CP	B
	JR	C,?0077
?0076:
; 212.	                {
; 213.	                        chan->Note = val;
	LD	(IX+17),B
; 214.	                        b6b = true;
	LD	A,1
	LD	(?0010+14),A
; 215.	                        b7b = true;
	LD	(?0010+15),A
; 216.	                }
; 217.	                else
	JR	?1167
?0077:
; 218.	                        chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1167
?1171:
	INC	(IX+2)
?1167:
?0078:
?0075:
?0072:
?0067:
?0064:
?0061:
?0056:
?0051:
?0048:
?0045:
?0042:
?0039:
?0036:
?0033:
?0030:
?0023:
?0018:
; 219.	                chan->Address_In_Pattern++;
	INC	(IX+1)
	JR	NZ,?1168
	INC	(IX+2)
?1168:
; 220.	        }
; 221.	        while(!quit);
	LD	A,(?0010+8)
	OR	A
	JP	Z,?0015
?0013:
; 222.	
; 223.	        if(b7b)
	LD	A,(?0010+15)
	OR	A
	JR	Z,?0080
?0079:
; 224.	        {
; 225.	                chan->Break_Ornament_Loop = false;
	LD	(IX+34),0
; 226.	                chan->Ornament_Enabled = true;
	LD	(IX+29),1
; 227.	                chan->Enabled = true;
	LD	(IX+28),1
; 228.	                chan->Break_Sample_Loop = false;
	LD	(IX+33),0
; 229.	                chan->Ton_Slide_Enabled = false;
	LD	(IX+32),0
; 230.	                chan->Ton_Accumulator = 0;
	XOR	A
	LD	(IX+11),A
	LD	(IX+12),A
; 231.	                chan->Current_Ton_Sliding = 0;
	LD	(IX+9),A
	LD	(IX+10),A
; 232.	                chan->Noise_Accumulator = 0;
	LD	(IX+23),A
; 233.	                chan->Volume_Counter = 0;
	LD	(IX+20),A
; 234.	                chan->Position_In_Sample = 0;
	LD	(IX+24),A
; 235.	                chan->Position_In_Ornament = 0;
	LD	(IX+26),A
?0080:
; 236.	        }
; 237.	        if(b6b)
	LD	A,(?0010+14)
	OR	A
	JR	Z,?0082
?0081:
; 238.	                chan->Volume = chan->Initial_Volume;
	LD	B,(IX+15)
	LD	(IX+18),B
?0082:
; 239.	        if(b5b)
	LD	A,(?0010+13)
	OR	A
	JR	Z,?0084
?0083:
; 240.	        {
; 241.	                chan->Gliss = false;
	LD	(IX+31),0
; 242.	                chan->Ton_Slide_Enabled = true;
	LD	(IX+32),1
?0084:
; 243.	        }
; 244.	        if(b4b)
	LD	A,(?0010+12)
	OR	A
	JR	Z,?0086
?0085:
; 245.	        {
; 246.	                chan->Current_Ton_Sliding = chan->Ton - ASM_Table[chan->Note];
	LD	L,(IX+17)
	LD	H,0
	ADD	HL,HL
	LD	BC,ASM_Table
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	LD	L,(IX+7)
	LD	H,(IX+8)
	AND	A
	SBC	HL,BC
	LD	(IX+9),L
	LD	(IX+10),H
; 247.	                chan->Gliss = true;
	LD	(IX+31),1
; 248.	                if(chan->Current_Ton_Sliding >= 0)
	BIT	7,(IX+10)
	JR	NZ,?0088
?0087:
; 249.	                        chan->Addition_To_Ton = -chan->Addition_To_Ton;
	AND	A
	LD	HL,0
	LD	C,(IX+13)
	LD	B,(IX+14)
	SBC	HL,BC
	LD	(IX+13),L
	LD	(IX+14),H
?0088:
; 250.	                chan->Ton_Slide_Enabled = true;
	LD	(IX+32),1
?0086:
; 251.	        }
; 252.	        if(b3b)
	LD	A,(?0010+11)
	OR	A
	JR	Z,?0090
?0089:
; 253.	        {
; 254.	                chan->Volume_Counter = chan->Volume_Counter1;
	LD	B,(IX+21)
	LD	(IX+20),B
; 255.	                chan->Volume_Inc = true;
	LD	(IX+35),1
; 256.	                if((chan->Volume_Counter & 0x40) != 0)
	BIT	6,(IX+20)
	JR	Z,?0092
?0091:
; 257.	                {
; 258.	                        chan->Volume_Counter = -(signed char)(chan->Volume_Counter | 128);
	LD	B,(IX+20)
	SET	7,B
	LD	A,B
	NEG
	LD	(IX+20),A
; 259.	                        chan->Volume_Inc = false;
	LD	(IX+35),0
?0092:
; 260.	                }
; 261.	                chan->Volume_Counter_Init = chan->Volume_Counter;
	LD	B,(IX+20)
	LD	(IX+22),B
?0090:
; 262.	        }
; 263.	        if(b2b)
	LD	A,(?0010+10)
	OR	A
	JR	Z,?0094
?0093:
; 264.	        {
; 265.	                chan->Break_Ornament_Loop = false;
	LD	(IX+34),0
; 266.	                chan->Ornament_Enabled = false;
	LD	(IX+29),0
; 267.	                chan->Enabled = false;
	LD	(IX+28),0
; 268.	                chan->Break_Sample_Loop = false;
	LD	(IX+33),0
; 269.	                chan->Ton_Slide_Enabled = false;
	LD	(IX+32),0
?0094:
; 270.	        }
; 271.	        if(b1b)
	LD	A,(?0010+9)
	OR	A
	JR	Z,?0096
?0095:
; 272.	                chan->Ornament_Enabled = false;
	LD	(IX+29),0
?0096:
; 273.	}
	POP	IX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1592:
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	L,(IX+1)
	LD	H,(IX+2)
	LD	BC,(?0010+4)
	ADD	HL,BC
	INC	HL
	RET
; 274.	
; 275.	void PSC_GetRegisters(AYSongInfo * info, PSC_Channel_Parameters * chan, unsigned char * TempMixer)
; 276.	{
PSC_GetRegisters:
	PUSH	IY
	PUSH	IX
	PUSH	BC
	POP	IX
; 277.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+17),HL
; 278.	        unsigned char j, b;
; 279.	        if(chan->Enabled)
	LD	HL,28
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JP	Z,?0098
?0097:
; 280.	        {
; 281.	                j = chan->Note;
	LD	A,(IX+17)
	LD	(?0010+19),A
; 282.	                if(chan->Ornament_Enabled)
	LD	A,(IX+29)
	OR	A
	JP	Z,?0116
?0099:
; 283.	                {
; 284.	                        b = module[chan->OrnamentPointer + chan->Position_In_Ornament * 2];
	LD	L,(IX+26)
	LD	H,0
	ADD	HL,HL
	LD	C,(IX+3)
	LD	B,(IX+4)
	ADD	HL,BC
	LD	BC,(?0010+17)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+20),A
; 285.	                        chan->Noise_Accumulator += b;
	ADD	A,(IX+23)
	LD	(IX+23),A
; 286.	                        j += module[chan->OrnamentPointer + chan->Position_In_Ornament * 2 + 1];
	LD	L,(IX+26)
	LD	H,0
	ADD	HL,HL
	LD	E,(IX+3)
	LD	D,(IX+4)
	ADD	HL,DE
	ADD	HL,BC
	INC	HL
	LD	A,(?0010+19)
	ADD	A,(HL)
	LD	(?0010+19),A
; 287.	                        if((signed char)j < 0)
	JP	P,?0102
?0101:
; 288.	                                j += 0x56;
	ADD	A,86
	LD	(?0010+19),A
?0102:
; 289.	                        if(j > 0x55)
	LD	B,A
	LD	A,85
	CP	B
	JR	NC,?0104
?0103:
; 290.	                                j -= 0x56;
	LD	HL,?0010+19
	LD	A,B
	SUB	86
	LD	(HL),A
?0104:
; 291.	                        if(j > 0x55)
	LD	A,(?0010+19)
	LD	B,A
	LD	A,85
	CP	B
	JR	NC,?0106
?0105:
; 292.	                                j = 0x55;
	LD	(?0010+19),A
?0106:
; 293.	                        if((b & 128) == 0)
	LD	A,(?0010+20)
	OR	A
	JP	M,?0108
?0107:
; 294.	                                chan->Loop_Ornament_Position = chan->Position_In_Ornament;
	LD	B,(IX+26)
	LD	(IX+27),B
?0108:
; 295.	                        if((b & 64) == 0)
	BIT	6,A
	JR	NZ,?0110
?0109:
; 296.	                        {
; 297.	                                if(!chan->Break_Ornament_Loop)
	LD	A,(IX+34)
	OR	A
	JR	NZ,?0112
?0111:
; 298.	                                        chan->Position_In_Ornament = chan->Loop_Ornament_Position;
	LD	B,(IX+27)
	LD	(IX+26),B
; 299.	                                else
	JR	?0116
?0112:
; 300.	                                {
; 301.	                                        chan->Break_Ornament_Loop = false;
	LD	(IX+34),0
; 302.	                                        if((b & 32) == 0)
	LD	A,(?0010+20)
	BIT	5,A
	JR	NZ,?0118
?0114:
; 303.	                                                chan->Ornament_Enabled = false;
	JR	?1189
?0115:
; 304.	                                        chan->Position_In_Ornament++;
?0113:
; 305.	                                }
; 306.	                        }
; 307.	                        else
?0110:
; 308.	                        {
; 309.	                                if((b & 32) == 0)
	BIT	5,A
	JR	NZ,?0118
?0117:
; 310.	                                        chan->Ornament_Enabled = false;
?1189:
	LD	(IX+29),0
?0118:
; 311.	                                chan->Position_In_Ornament++;
	INC	(IX+26)
?0116:
?0100:
; 312.	                        }
; 313.	                }
; 314.	                chan->Note = j;
	LD	A,(?0010+19)
	LD	(IX+17),A
; 315.	                //chan->Ton = *(unsigned short *) &module[chan->SamplePointer + chan->Position_In_Sample * 6];
; 316.	                chan->Ton = ay_sys_getword(&module[chan->SamplePointer + chan->Position_In_Sample * 6]);
	LD	L,(IX+24)
	LD	H,0
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,(IX+5)
	LD	B,(IX+6)
	ADD	HL,BC
	LD	BC,(?0010+17)
	CALL	LWRD ?1581
	LD	(IX+7),L
	LD	(IX+8),H
; 317.	                chan->Ton_Accumulator += chan->Ton;
	LD	HL,11
	PUSH	IX
	POP	BC
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,(IX+7)
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	ADC	A,(IX+8)
	LD	(HL),A
; 318.	                chan->Ton = ASM_Table[j] + chan->Ton_Accumulator;
	LD	HL,7
	ADD	HL,BC
	PUSH	HL
	LD	HL,(?0010+19)
	LD	H,0
	ADD	HL,HL
	LD	DE,ASM_Table
	ADD	HL,DE
	LD	D,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,D
	PUSH	HL
	LD	HL,11
	ADD	HL,BC
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	POP	HL
	ADD	HL,DE
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 319.	                if(chan->Ton_Slide_Enabled)
	LD	HL,32
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JR	Z,?0120
?0119:
; 320.	                {
; 321.	                        chan->Current_Ton_Sliding += chan->Addition_To_Ton;
	LD	HL,9
	PUSH	IX
	POP	BC
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,(IX+13)
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	ADC	A,(IX+14)
	LD	(HL),A
; 322.	                        if(chan->Gliss && (((chan->Current_Ton_Sliding < 0) && (chan->Addition_To_Ton <= 0)) || ((chan->Current_Ton_Sliding >= 0) && (chan->Addition_To_Ton >= 0))))
	LD	HL,31
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JR	Z,?0122
	BIT	7,(IX+10)
	JR	Z,?0126
	LD	C,(IX+13)
	LD	B,(IX+14)
	LD	HL,0
	OR	128
	SBC	HL,BC
	JP	PO,?1186
	XOR	H
?1186:
	JP	P,?0130
?0126:
?0125:
	BIT	7,(IX+10)
	JR	NZ,?0122
	BIT	7,(IX+14)
	JR	NZ,?0122
?0130:
?0129:
?0127:
?0128:
?0124:
?0123:
?0121:
; 323.	                                chan->Ton_Slide_Enabled = false;
	LD	(IX+32),0
?0122:
; 324.	                        chan->Ton += chan->Current_Ton_Sliding;
	LD	HL,7
	PUSH	IX
	POP	BC
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,(IX+9)
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	ADC	A,(IX+10)
	LD	(HL),A
?0120:
; 325.	                }
; 326.	                chan->Ton = chan->Ton & 0xfff;
	LD	A,(IX+8)
	AND	15
	LD	(IX+8),A
; 327.	                b = module[chan->SamplePointer + chan->Position_In_Sample * 6 + 4];
	LD	L,(IX+24)
	LD	H,0
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,(IX+5)
	LD	B,(IX+6)
	ADD	HL,BC
	LD	BC,(?0010+17)
	ADD	HL,BC
	LD	BC,4
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+20),A
; 328.	                *TempMixer = *TempMixer | ((b & 9) << 3);
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,A
	LD	A,(?0010+20)
	AND	9
	ADD	A,A
	ADD	A,A
	ADD	A,A
	OR	(HL)
	LD	(HL),A
; 329.	                j = 0;
	XOR	A
	LD	(?0010+19),A
; 330.	                if((b & 2) != 0)
	LD	A,(?0010+20)
	BIT	1,A
	JR	Z,?0132
?0131:
; 331.	                        j++;
	LD	HL,?0010+19
	INC	(HL)
?0132:
; 332.	                if((b & 4) != 0)
	BIT	2,A
	JR	Z,?0134
?0133:
; 333.	                        j--;
	LD	HL,?0010+19
	DEC	(HL)
?0134:
; 334.	                if(chan->Volume_Counter > 0)
	LD	A,(IX+20)
	OR	A
	JR	Z,?0138
?0135:
; 335.	                {
; 336.	                        chan->Volume_Counter--;
	DEC	(IX+20)
; 337.	                        if(chan->Volume_Counter == 0)
	LD	A,(IX+20)
	OR	A
	JR	NZ,?0138
?0137:
; 338.	                        {
; 339.	                                if(chan->Volume_Inc)
	LD	A,(IX+35)
	OR	A
	LD	HL,?0010+19
	JR	Z,?0140
?0139:
; 340.	                                        j++;
	INC	(HL)
; 341.	                                else
	JR	?0141
?0140:
; 342.	                                        j--;
	DEC	(HL)
?0141:
; 343.	                                chan->Volume_Counter = chan->Volume_Counter_Init;
	LD	B,(IX+22)
	LD	(IX+20),B
?0138:
?0136:
; 344.	                        }
; 345.	                }
; 346.	                chan->Volume += j;
	LD	A,(?0010+19)
	ADD	A,(IX+18)
	LD	(IX+18),A
; 347.	                if((signed char)chan->Volume < 0)
	LD	A,(IX+18)
	OR	A
	JP	P,?0143
?0142:
; 348.	                        chan->Volume = 0;
	LD	(IX+18),0
	JR	?0146
?0143:
; 349.	                else if(chan->Volume > 15)
	LD	A,15
	CP	(IX+18)
	JR	NC,?0146
?0145:
; 350.	                        chan->Volume = 15;
	LD	(IX+18),A
?0146:
?0144:
; 351.	                chan->Amplitude = ((chan->Volume + 1) * (module[chan->SamplePointer + chan->Position_In_Sample * 6 + 3] & 15)) >> 4;
	LD	L,(IX+24)
	LD	H,0
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,(IX+5)
	LD	B,(IX+6)
	ADD	HL,BC
	LD	BC,(?0010+17)
	ADD	HL,BC
	INC	HL
	INC	HL
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	B,0
	LD	D,B
	LD	E,(IX+18)
	INC	DE
	CALL	LWRD ?S_MUL_L02
	LD	B,4
	CALL	LWRD ?SS_RSH_L02
	LD	(IX+19),E
; 352.	                if(chan->Envelope_Enabled && ((b & 16) == 0))
	LD	A,(IX+30)
	OR	A
	JR	Z,?0148
	LD	A,(?0010+20)
	BIT	4,A
	JR	NZ,?0148
?0150:
?0149:
?0147:
; 353.	                        chan->Amplitude = chan->Amplitude | 16;
	SET	4,(IX+19)
?0148:
; 354.	                if(((chan->Amplitude & 16) != 0) & ((b & 8) != 0))
	BIT	4,(IX+19)
	JR	Z,?1175
	LD	A,1
	JR	?1176
?1175:
	XOR	A
?1176:
	PUSH	AF
	LD	A,(?0010+20)
	BIT	3,A
	JR	Z,?1178
	LD	B,1
	JR	?1179
?1178:
	LD	B,0
?1179:
	POP	AF
	AND	B
	JR	Z,?0152
?0151:
; 355.	                {
; 356.	                        unsigned short env = ay_readay(AY_ENV_FINE) | (ay_readay(AY_ENV_COARSE) << 8);
	LD	E,11
	LD	A,BYTE3 ay_readay
	LD	HL,LWRD ay_readay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	H,0
	PUSH	HL
	LD	E,12
	LD	A,BYTE3 ay_readay
	LD	HL,LWRD ay_readay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	B,L
	LD	C,0
	POP	HL
	LD	E,L
	LD	A,H
	OR	B
	LD	D,A
	LD	(?0010+21),DE
; 357.	                        env += (signed char)(module[chan->SamplePointer + chan->Position_In_Sample * 6 + 2]);
	LD	L,(IX+24)
	LD	H,C
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,(IX+5)
	LD	B,(IX+6)
	ADD	HL,BC
	LD	BC,(?0010+17)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	C,(HL)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	EX	DE,HL
	ADD	HL,BC
	LD	(?0010+21),HL
; 358.	                        ay_writeay(AY_ENV_FINE, env & 0xff);
	LD	C,L
	LD	E,11
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 359.	                        ay_writeay(AY_ENV_COARSE, (env >> 8) & 0xff);
	LD	HL,(?0010+21)
	LD	C,H
	LD	E,12
	JR	?1187
; 360.	                }
; 361.	                else
?0152:
; 362.	                {
; 363.	                        chan->Noise_Accumulator += module[chan->SamplePointer + chan->Position_In_Sample * 6 + 2];
	LD	L,(IX+24)
	LD	H,A
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,(IX+5)
	LD	B,(IX+6)
	ADD	HL,BC
	LD	BC,(?0010+17)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	A,(IX+23)
	ADD	A,(HL)
	LD	(IX+23),A
; 364.	                        if((b & 8) == 0)
	LD	A,(?0010+20)
	BIT	3,A
	JR	NZ,?0155
?0154:
; 365.	                                ay_writeay(AY_NOISE_PERIOD, chan->Noise_Accumulator & 31);
	LD	A,(IX+23)
	AND	31
	LD	C,A
	LD	E,6
?1187:
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0155:
?0153:
; 366.	                }
; 367.	                if((b & 128) == 0)
	LD	A,(?0010+20)
	OR	A
	JP	M,?0157
?0156:
; 368.	                        chan->Loop_Sample_Position = chan->Position_In_Sample;
	LD	B,(IX+24)
	LD	(IX+25),B
?0157:
; 369.	                if((b & 64) == 0)
	BIT	6,A
	JR	NZ,?0159
?0158:
; 370.	                {
; 371.	                        if(!chan->Break_Sample_Loop)
	LD	A,(IX+33)
	OR	A
	JR	NZ,?0161
?0160:
; 372.	                                chan->Position_In_Sample = chan->Loop_Sample_Position;
	LD	B,(IX+25)
	LD	(IX+24),B
; 373.	                        else
	JR	?0168
?0161:
; 374.	                        {
; 375.	                                chan->Break_Sample_Loop = false;
	LD	(IX+33),0
; 376.	                                if((b & 32) == 0)
	LD	A,(?0010+20)
	BIT	5,A
	JR	NZ,?0167
?0163:
; 377.	                                        chan->Enabled = false;
	JR	?1191
?0164:
; 378.	                                chan->Position_In_Sample++;
?0162:
; 379.	                        }
; 380.	                }
; 381.	                else
?0159:
; 382.	                {
; 383.	                        if((b & 32) == 0)
	BIT	5,A
	JR	NZ,?0167
?0166:
; 384.	                                chan->Enabled = false;
?1191:
	LD	(IX+28),0
?0167:
; 385.	                        chan->Position_In_Sample++;
	INC	(IX+24)
?0165:
; 386.	                }
; 387.	        }
; 388.	        else
	JR	?0168
?0098:
; 389.	                chan->Amplitude = 0;
	LD	(IX+19),A
?0168:
; 390.	        *TempMixer = *TempMixer >> 1;
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,A
	SRL	(HL)
; 391.	}
	POP	IX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 392.	
; 393.	void PSC_Play(AYSongInfo * info)
; 394.	{
PSC_Play:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 395.	        unsigned char *module; 
; 396.	        unsigned char TempMixer;
; 397.	
; 398.	        //return;
; 399.	
; 400.	        module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+23),HL
; 401.	
; 402.	        if(--PSC.DelayCounter <= 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JP	NZ,?0170
?0169:
; 403.	        {
; 404.	                if(--PSC.Lines_Counter <= 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JP	NZ,?0172
?0171:
; 405.	                {
; 406.	                        if(module[PSC.Positions_Pointer + 1] == 255)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,4
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+23)
	ADD	HL,BC
	INC	HL
	LD	B,(HL)
	INC	B
	JR	NZ,?0174
?0173:
; 407.	                        {
; 408.	                                //PSC.Positions_Pointer = *(unsigned short *) &module[PSC.Positions_Pointer + 2];
; 409.	                                PSC.Positions_Pointer = ay_sys_getword(&module[PSC.Positions_Pointer + 2]);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,4
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+23)
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
?0174:
; 410.	                        }
; 411.	                        PSC.Lines_Counter = module[PSC.Positions_Pointer + 1];
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,4
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+23)
	ADD	HL,BC
	INC	HL
	LD	D,(HL)
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	(HL),D
; 412.	                        //PSC_A.Address_In_Pattern = *(unsigned short *) &module[PSC.Positions_Pointer + 2];
; 413.	                        //PSC_B.Address_In_Pattern = *(unsigned short *) &module[PSC.Positions_Pointer + 4];
; 414.	                        //PSC_C.Address_In_Pattern = *(unsigned short *) &module[PSC.Positions_Pointer + 6];
; 415.	                        PSC_A.Address_In_Pattern = ay_sys_getword(&module[PSC.Positions_Pointer + 2]);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,7
	ADD	HL,DE
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	E,4
	ADD	HL,DE
	LD	D,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,D
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 416.	                        PSC_B.Address_In_Pattern = ay_sys_getword(&module[PSC.Positions_Pointer + 4]);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,43
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,4
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+23)
	ADD	HL,BC
	LD	DE,4
	ADD	HL,DE
	CALL	LWRD ?1583
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 417.	                        PSC_C.Address_In_Pattern = ay_sys_getword(&module[PSC.Positions_Pointer + 6]);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,79
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,4
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+23)
	ADD	HL,BC
	LD	BC,6
	CALL	LWRD ?1581
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 418.	                        PSC.Positions_Pointer += 8;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,4
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,8
	LD	(HL),A
	JR	NC,?1193
	INC	HL
	INC	(HL)
?1193:
; 419.	                        PSC_A.Note_Skip_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,22
	ADD	HL,BC
	LD	(HL),1
; 420.	                        PSC_B.Note_Skip_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,58
	ADD	HL,BC
	LD	(HL),1
; 421.	                        PSC_C.Note_Skip_Counter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,94
	ADD	HL,BC
	LD	(HL),1
?0172:
; 422.	                }
; 423.	                if(--PSC_A.Note_Skip_Counter == 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,22
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JR	NZ,?0176
?0175:
; 424.	                        PSC_PatternInterpreter(info, &PSC_A);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,6
	CALL	LWRD ?1597
?0176:
; 425.	                if(--PSC_B.Note_Skip_Counter == 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,58
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JR	NZ,?0178
?0177:
; 426.	                        PSC_PatternInterpreter(info, &PSC_B);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,42
	CALL	LWRD ?1597
?0178:
; 427.	                if(--PSC_C.Note_Skip_Counter == 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,94
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JR	NZ,?0180
?0179:
; 428.	                        PSC_PatternInterpreter(info, &PSC_C);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,78
	CALL	LWRD ?1597
?0180:
; 429.	                PSC_A.Noise_Accumulator += PSC.Noise_Base;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,29
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	A,(HL)
	ADD	A,B
	LD	(HL),A
; 430.	                PSC_B.Noise_Accumulator += PSC.Noise_Base;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,65
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	A,(HL)
	ADD	A,B
	LD	(HL),A
; 431.	                PSC_C.Noise_Accumulator += PSC.Noise_Base;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,101
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	A,(HL)
	ADD	A,B
	LD	(HL),A
; 432.	                PSC.DelayCounter = PSC.Delay;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	B,(HL)
	POP	HL
	LD	(HL),B
?0170:
; 433.	        }
; 434.	        TempMixer = 0;
	XOR	A
	LD	(?0010+25),A
; 435.	        PSC_GetRegisters(info, &PSC_A, &TempMixer);
	LD	HL,?0010+25
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,6
	CALL	LWRD ?1604
	POP	HL
; 436.	        PSC_GetRegisters(info, &PSC_B, &TempMixer);
	LD	HL,?0010+25
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,42
	CALL	LWRD ?1604
	POP	HL
; 437.	        PSC_GetRegisters(info, &PSC_C, &TempMixer);
	LD	HL,?0010+25
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,78
	CALL	LWRD ?1604
	POP	HL
; 438.	
; 439.	        ay_writeay(AY_MIXER, TempMixer);
	LD	BC,(?0010+25)
	LD	E,7
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 440.	        ay_writeay(AY_CHNL_A_FINE, PSC_A.Ton & 0xff);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,13
	ADD	HL,BC
	LD	C,(HL)
	LD	E,B
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 441.	        ay_writeay(AY_CHNL_A_COARSE, (PSC_A.Ton >> 8) & 0xf);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,13
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,1
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 442.	        ay_writeay(AY_CHNL_B_FINE, PSC_B.Ton & 0xff);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,49
	ADD	HL,BC
	LD	C,(HL)
	LD	E,2
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 443.	        ay_writeay(AY_CHNL_B_COARSE, (PSC_B.Ton >> 8) & 0xf);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,49
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,3
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 444.	        ay_writeay(AY_CHNL_C_FINE, PSC_C.Ton & 0xff);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,85
	ADD	HL,BC
	LD	C,(HL)
	LD	E,4
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 445.	        ay_writeay(AY_CHNL_C_COARSE, (PSC_C.Ton >> 8) & 0xf);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,85
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,5
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 446.	        ay_writeay(AY_CHNL_A_VOL, PSC_A.Amplitude);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,25
	ADD	HL,BC
	LD	C,(HL)
	LD	E,8
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 447.	        ay_writeay(AY_CHNL_B_VOL, PSC_B.Amplitude);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,61
	ADD	HL,BC
	LD	C,(HL)
	LD	E,9
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 448.	        ay_writeay(AY_CHNL_C_VOL, PSC_C.Amplitude);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,97
?1575:
	ADD	HL,BC
	LD	C,(HL)
	LD	E,10
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 449.	}
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1587:
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,17
	ADD	HL,BC
	LD	C,(HL)
	LD	E,B
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,17
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,1
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	RET
?1588:
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,56
	ADD	HL,BC
	LD	C,(HL)
	LD	E,2
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,56
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,3
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	RET
?1589:
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,95
	ADD	HL,BC
	LD	C,(HL)
	LD	E,4
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,95
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	AND	15
	LD	C,A
	LD	E,5
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	RET
?1590:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,28
	ADD	HL,BC
	LD	C,(HL)
	LD	E,8
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	RET
?1591:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,67
	ADD	HL,BC
	LD	C,(HL)
	LD	E,9
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	RET
?1597:
	ADD	HL,BC
	LD	C,L
	LD	B,H
	PUSH	IX
	POP	DE
	LD	A,BYTE3 PSC_PatternInterpreter
	LD	HL,LWRD PSC_PatternInterpreter
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1604:
	ADD	HL,BC
	LD	C,L
	LD	B,H
	PUSH	IX
	POP	DE
	LD	A,BYTE3 PSC_GetRegisters
	LD	HL,LWRD PSC_GetRegisters
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 450.	
; 451.	void PSC_GetInfo(AYSongInfo * info)
; 452.	{
PSC_GetInfo:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 453.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+26),HL
; 454.	        PSC_File *header = (PSC_File *)module;
	LD	(?0010+28),HL
; 455.	        unsigned char b;
; 456.	        unsigned long tm = 0;
	LD	BC,0
	LD	L,C
	LD	H,B
	LD	(?0010+31),HL
	LD	(?0010+33),BC
; 457.	        long i;
; 458.	        char a1, a2, a3;
; 459.	        unsigned long j1, j2, j3;
; 460.	        unsigned long pptr, cptr;
; 461.	        bool f71, f72, f73, f61, f62, f63, f41, f42, f43, flg;
; 462.	        unsigned short j11, j22, j33;
; 463.	        //unsigned char * ptr;
; 464.	
; 465.	        f71 = f72 = f73 = f61 = f62 = f63 = f41 = f42 = f43 = flg = false;
	XOR	A
	LD	(?0010+71),A
	LD	(?0010+70),A
	LD	(?0010+69),A
	LD	(?0010+68),A
	LD	(?0010+67),A
	LD	(?0010+66),A
	LD	(?0010+65),A
	LD	(?0010+64),A
	LD	(?0010+63),A
	LD	(?0010+62),A
; 466.	        j11 = j22 = j33 = 0;
	LD	(?0010+76),HL
	LD	(?0010+74),HL
	LD	(?0010+72),HL
; 467.	
; 468.	        b = header->PSC_Delay;
	LD	L,73
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+30),A
; 469.	        pptr = PSC_PatternsPointer;
	LD	HL,71
; 470.	        pptr++;
	CALL	LWRD ?1605
?0182:
; 471.	        while(module[pptr] != 255)
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JR	Z,?0181
?0183:
; 472.	        {
; 473.	                pptr += 8;
	LD	HL,?0010+54
	LD	BC,0
	LD	DE,8
	CALL	LWRD ?L_ADDASG_L03
; 474.	                if(pptr >= 65536)
	EX	DE,HL
	LD	E,C
	LD	D,B
	AND	A
	LD	BC,0
	SBC	HL,BC
	EX	DE,HL
	INC	BC
	SBC	HL,BC
	JR	C,?0182
?0184:
; 475.	                {
; 476.	                        info->Length = 0;
	JP	LWRD ?1209
; 477.	                        return;
; 478.	                }
?0185:
?0181:
; 479.	        }
; 480.	        if(pptr >= 65546 - 2)
	AND	A
	LD	HL,(?0010+54)
	LD	C,8
	SBC	HL,BC
	LD	HL,(?0010+56)
	LD	C,1
	SBC	HL,BC
	JR	C,?0187
?0186:
; 481.	        {
; 482.	                info->Length = 0;
	XOR	A
	LD	(IX+6),A
	LD	(IX+7),A
?0187:
; 483.	        }
; 484.	        //cptr = *(unsigned short *) &module[pptr + 1];
; 485.	        cptr = ay_sys_getword(&module[pptr + 1]);
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	CALL	LWRD ?1582
	LD	(?0010+58),HL
	LD	(?0010+60),BC
; 486.	        cptr++;
	CALL	LWRD ?L_INC_L03
	LD	(?0010+58),HL
	LD	(?0010+60),BC
; 487.	        pptr = PSC_PatternsPointer;
	LD	HL,71
	LD	BC,(?0010+28)
; 488.	        pptr++;
	CALL	LWRD ?1605
?0189:
; 489.	        while(module[pptr] != 255)
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JP	Z,?0188
?0190:
; 490.	        {
; 491.	                // if(pptr == cptr)
; 492.	                //     info->Loop = tm;
; 493.	
; 494.	                if(pptr >= 65536 - 6)
	AND	A
	LD	HL,(?0010+54)
	LD	BC,65530
	SBC	HL,BC
	LD	HL,(?0010+56)
	LD	BC,0
	SBC	HL,BC
	JR	NC,?1209
?0191:
; 495.	                {
; 496.	                        info->Length = 0;
; 497.	                        return;
; 498.	                }
?0192:
; 499.	                //j1 = *(unsigned short *) &module[pptr + 1];
; 500.	                //j2 = *(unsigned short *) &module[pptr + 3];
; 501.	                //j3 = *(unsigned short *) &module[pptr + 5];
; 502.	                j1 = ay_sys_getword(&module[pptr + 1]);
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	CALL	LWRD ?1582
	LD	(?0010+42),HL
	LD	(?0010+44),BC
; 503.	                j2 = ay_sys_getword(&module[pptr + 3]);
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	LD	(?0010+46),HL
	LD	(?0010+48),BC
; 504.	                j3 = ay_sys_getword(&module[pptr + 5]);
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	BC,5
	CALL	LWRD ?1581
	LD	(?0010+50),HL
	LD	(?0010+52),BC
; 505.	                pptr += 8;
	LD	HL,?0010+54
	LD	BC,0
	LD	DE,8
	CALL	LWRD ?L_ADDASG_L03
; 506.	                if(pptr >= 65536)
	EX	DE,HL
	LD	E,C
	LD	D,B
	AND	A
	LD	BC,0
	SBC	HL,BC
	EX	DE,HL
	INC	BC
	SBC	HL,BC
	JR	C,?0194
?0193:
; 507.	                {
; 508.	                        info->Length = 0;
?1209:
	XOR	A
	LD	(IX+6),A
	LD	(IX+7),A
; 509.	                        return;
; 510.	                }
	JP	LWRD ?0253
?0194:
; 511.	                a1 = a2 = a3 = 1;
	LD	A,C
	LD	(?0010+41),A
	LD	(?0010+40),A
	LD	(?0010+39),A
; 512.	                for(i = 0; i < module[pptr - 8]; i++)
	DEC	BC
	LD	L,C
	LD	H,B
?1202:
	LD	(?0010+35),HL
	LD	(?0010+37),BC
?0196:
	LD	HL,(?0010+54)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	BC,65528
	ADD	HL,BC
	LD	L,(HL)
	LD	BC,0
	LD	H,C
	PUSH	BC
	PUSH	HL
	LD	BC,(?0010+37)
	LD	HL,(?0010+35)
	CALL	LWRD ?SL_CMP_L03
	JP	NC,?0189
?0197:
; 513.	                {
; 514.	                        a1--;
	LD	HL,?0010+39
	DEC	(HL)
; 515.	                        if(a1 == 0)
	LD	A,(?0010+39)
	OR	A
	JP	NZ,?0201
?0199:
?0202:
; 516.	                        {
; 517.	                                while(true)
?0203:
; 518.	                                {
; 519.	                                        unsigned char val = module[j1];
	LD	HL,(?0010+42)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+78),A
; 520.	                                        if(val >= 0xc0)
	CP	192
	JR	C,?0205
?0204:
; 521.	                                        {
; 522.	                                                a1 = val - 0xbf;
	ADD	A,65
	LD	(?0010+39),A
; 523.	                                                j1++;
	LD	HL,(?0010+42)
	LD	BC,(?0010+44)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+42),HL
	LD	(?0010+44),BC
; 524.	                                                break;
	JR	?0201
?0205:
; 525.	                                        }
; 526.	                                        else if((val >= 0x67 && val <= 0x6d) || (val >= 0x6f && val <= 0x7b))
	CP	103
	JR	C,?0209
	LD	B,A
	LD	A,109
	CP	B
	JR	NC,?0213
?0209:
?0208:
	LD	A,(?0010+78)
	CP	111
	JR	C,?0207
	LD	B,A
	LD	A,123
	CP	B
	JR	C,?0207
?0213:
?0212:
?0210:
?0211:
?0206:
; 527.	                                        {
; 528.	                                                j1++;
	LD	HL,(?0010+42)
	LD	BC,(?0010+44)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+42),HL
	LD	(?0010+44),BC
	JR	?0216
?0207:
; 529.	                                        }
; 530.	                                        else if(val == 0x6e)
	LD	A,(?0010+78)
	CP	110
	JR	NZ,?0216
?0215:
; 531.	                                        {
; 532.	                                                j1++;
	LD	HL,(?0010+42)
	LD	BC,(?0010+44)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+42),HL
	LD	(?0010+44),BC
; 533.	                                                b = module[j1];
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+30),A
?0216:
?0214:
; 534.	                                        }
; 535.	                                        j1++;
	LD	HL,(?0010+42)
	LD	BC,(?0010+44)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+42),HL
	LD	(?0010+44),BC
; 536.	                                }
; 537.	
; 538.	                        }
	JP	LWRD ?0199
?0201:
?0200:
; 539.	
; 540.	                        a2--;
	LD	HL,?0010+40
	DEC	(HL)
; 541.	                        if(a2 == 0)
	LD	A,(?0010+40)
	OR	A
	JP	NZ,?0219
?0217:
?0220:
; 542.	                        {
; 543.	                                while(true)
?0221:
; 544.	                                {
; 545.	                                        unsigned char val = module[j2];
	LD	HL,(?0010+46)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+78),A
; 546.	                                        if(val >= 0xc0)
	CP	192
	JR	C,?0223
?0222:
; 547.	                                        {
; 548.	                                                a2 = val - 0xbf;
	ADD	A,65
	LD	(?0010+40),A
; 549.	                                                j2++;
	LD	HL,(?0010+46)
	LD	BC,(?0010+48)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+46),HL
	LD	(?0010+48),BC
; 550.	                                                break;
	JR	?0219
?0223:
; 551.	                                        }
; 552.	                                        else if((val >= 0x67 && val <= 0x6d) || (val >= 0x6f && val <= 0x7b))
	CP	103
	JR	C,?0227
	LD	B,A
	LD	A,109
	CP	B
	JR	NC,?0231
?0227:
?0226:
	LD	A,(?0010+78)
	CP	111
	JR	C,?0225
	LD	B,A
	LD	A,123
	CP	B
	JR	C,?0225
?0231:
?0230:
?0228:
?0229:
?0224:
; 553.	                                        {
; 554.	                                                j2++;
	LD	HL,(?0010+46)
	LD	BC,(?0010+48)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+46),HL
	LD	(?0010+48),BC
	JR	?0234
?0225:
; 555.	                                        }
; 556.	                                        else if(val == 0x6e)
	LD	A,(?0010+78)
	CP	110
	JR	NZ,?0234
?0233:
; 557.	                                        {
; 558.	                                                j2++;
	LD	HL,(?0010+46)
	LD	BC,(?0010+48)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+46),HL
	LD	(?0010+48),BC
; 559.	                                                b = module[j2];
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+30),A
?0234:
?0232:
; 560.	                                        }
; 561.	                                        j2++;
	LD	HL,(?0010+46)
	LD	BC,(?0010+48)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+46),HL
	LD	(?0010+48),BC
; 562.	                                }
; 563.	                        }
	JP	LWRD ?0217
?0219:
?0218:
; 564.	
; 565.	                        a3--;
	LD	HL,?0010+41
	DEC	(HL)
; 566.	                        if(a3 == 0)
	LD	A,(?0010+41)
	OR	A
	JP	NZ,?0237
?0235:
?0238:
; 567.	                        {
; 568.	                                while(true)
?0239:
; 569.	                                {
; 570.	                                        unsigned char val = module[j3];
	LD	HL,(?0010+50)
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+78),A
; 571.	                                        if(val >= 0xc0)
	CP	192
	JR	C,?0241
?0240:
; 572.	                                        {
; 573.	                                                a3 = val - 0xbf;
	ADD	A,65
	LD	(?0010+41),A
; 574.	                                                j3++;
	LD	HL,(?0010+50)
	LD	BC,(?0010+52)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+50),HL
	LD	(?0010+52),BC
; 575.	                                                break;
	JR	?0237
?0241:
; 576.	                                        }
; 577.	                                        else if((val >= 0x67 && val <= 0x6d) || (val >= 0x6f && val <= 0x7b))
	CP	103
	JR	C,?0245
	LD	B,A
	LD	A,109
	CP	B
	JR	NC,?0249
?0245:
?0244:
	LD	A,(?0010+78)
	CP	111
	JR	C,?0243
	LD	B,A
	LD	A,123
	CP	B
	JR	C,?0243
?0249:
?0248:
?0246:
?0247:
?0242:
; 578.	                                        {
; 579.	                                                j3++;
	LD	HL,(?0010+50)
	LD	BC,(?0010+52)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+50),HL
	LD	(?0010+52),BC
	JR	?0252
?0243:
; 580.	                                        }
; 581.	                                        else if(val == 0x6e)
	LD	A,(?0010+78)
	CP	110
	JR	NZ,?0252
?0251:
; 582.	                                        {
; 583.	                                                j3++;
	LD	HL,(?0010+50)
	LD	BC,(?0010+52)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+50),HL
	LD	(?0010+52),BC
; 584.	                                                b = module[j3];
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+30),A
?0252:
?0250:
; 585.	                                        }
; 586.	                                        j3++;
	LD	HL,(?0010+50)
	LD	BC,(?0010+52)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+50),HL
	LD	(?0010+52),BC
; 587.	                                }
; 588.	                        }
	JP	LWRD ?0235
?0237:
?0236:
; 589.	                        tm += b;
	LD	HL,?0010+31
	LD	DE,(?0010+30)
	LD	BC,0
	LD	D,C
	CALL	LWRD ?L_ADDASG_L03
	LD	HL,(?0010+35)
	LD	BC,(?0010+37)
	CALL	LWRD ?L_INC_L03
	JP	LWRD ?1202
; 590.	                }
; 591.	        }
?0195:
?0188:
; 592.	
; 593.	        info->len = tm;
	LD	HL,(?0010+31)
	LD	(IX+99),L
	LD	(IX+100),H
; 594.	        //ptr = module + 0x19;
; 595.	
; 596.	        //s->counter = (int)&module[0x10];
; 597.	
; 598.	        strncpy(info->Name, &module[0x19], 20);
	LD	HL,20
	PUSH	HL
	LD	L,25
	LD	BC,(?0010+26)
	ADD	HL,BC
	LD	C,L
	LD	B,H
	LD	HL,8
	CALL	LWRD ?1609
	POP	AF
; 599.	        strncpy(info->Autor, &module[0x31], 20);
	LD	HL,20
	PUSH	HL
	LD	L,49
	LD	BC,(?0010+26)
	CALL	LWRD ?1610
	POP	AF
; 600.	        //ptr = module + 0x31;
; 601.	        //info->Author = ay_sys_getstr(ptr, 20);
; 602.	}
?0253:
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1605:
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,72
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	LD	(?0010+54),HL
	LD	(?0010+56),BC
	CALL	LWRD ?L_INC_L03
	LD	(?0010+54),HL
	LD	(?0010+56),BC
	RET
?1610:
	ADD	HL,BC
	LD	C,L
	LD	B,H
	LD	HL,41
?1609:
	PUSH	IX
	POP	DE
?1611:
	ADD	HL,DE
	EX	DE,HL
	LD	A,BYTE3 strncpy
	LD	HL,LWRD strncpy
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 603.	
; 604.	bool PSC_Detect(unsigned char * module, unsigned int length, AYSongInfo * s)
; 605.	{
PSC_Detect:
	PUSH	IY
	PUSH	IX
	EXX
	PUSH	BC
	EXX
	PUSH	BC
	POP	IX
	PUSH	DE
	EXX
	POP	BC
	EXX
	LD	HL,10
	ADD	HL,SP
	LD	A,(HL)
	LD	IYL,A
	INC	HL
	LD	A,(HL)
	LD	IYH,A
; 606.	        unsigned int j, j1;
; 607.	        PSC_File *header = (PSC_File *)module;
	LD	(?0010+83),DE
; 608.	
; 609.	
; 610.	
; 611.	
; 612.	        //s->counter = 1001;
; 613.	
; 614.	        if(length < 0x4c + 2)
	LD	DE,78
	LD	L,C
	LD	H,B
	AND	A
	SBC	HL,DE
	JP	C,?1254
?0254:
; 615.	                return false;
?0255:
; 616.	
; 617.	        //s->counter = 1002;
; 618.	
; 619.	        if(PSC_OrnamentsPointer >= length)
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	PUSH	IX
	POP	BC
	SBC	HL,BC
	JP	NC,?1254
?0256:
; 620.	                return false;
?0257:
; 621.	
; 622.	        // s->counter = 1003; 
; 623.	
; 624.	        if(PSC_OrnamentsPointer < 0x4c + 2)
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,32846
	LD	A,B
	XOR	H
	LD	H,A
	SBC	HL,BC
	JP	C,?1254
?0258:
; 625.	                return false;
?0259:
; 626.	        // s->counter = 1004;    
; 627.	
; 628.	        if(PSC_OrnamentsPointer > 64 + 0x4c)
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	C,A
	LD	A,D
	OR	B
	LD	B,A
	LD	HL,140
	OR	128
	SBC	HL,BC
	JP	PO,?1233
	XOR	H
?1233:
	JP	M,?1254
?0260:
; 629.	                return false;
?0261:
; 630.	
; 631.	        // s->counter = 1005;
; 632.	
; 633.	        if((PSC_OrnamentsPointer % 2) != 0)
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	EX	DE,HL
	LD	BC,2
	CALL	LWRD ?SS_MOD_L02
	LD	A,E
	OR	D
	JP	NZ,?1254
?0262:
; 634.	                return false;
?0263:
; 635.	
; 636.	        //s->counter = 1006;    
; 637.	
; 638.	        if((unsigned long)(PSC_SamplesPointers(0) + 0x4c + 5) > 65534)
	LD	L,76
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	E,(HL)
	LD	D,A
	LD	HL,77
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,81
	ADD	HL,BC
	LD	A,H
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	AND	A
	LD	HL,65534
	POP	BC
	SBC	HL,BC
	LD	L,D
	LD	H,D
	POP	BC
	SBC	HL,BC
	JP	C,?1254
?0264:
; 639.	                return false;
?0265:
; 640.	
; 641.	        // s->counter = 1007;    
; 642.	
; 643.	        if(PSC_SamplesPointers(0) + 0x4c + 5 > length)
	LD	HL,76
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,77
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,81
	ADD	HL,BC
	LD	C,L
	LD	B,H
	PUSH	IX
	POP	HL
	AND	A
	SBC	HL,BC
	JP	C,?1254
?0266:
; 644.	                return false;
?0267:
; 645.	
; 646.	        //s->err = 8;
; 647.	
; 648.	        j = ay_sys_getword(&module[PSC_OrnamentsPointer]);
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	H,(HL)
	LD	C,A
	LD	A,D
	OR	H
	LD	B,A
	EXX
	PUSH	BC
	EXX
	POP	HL
	CALL	LWRD ?1581
	LD	(?0010+79),HL
; 649.	        j += PSC_OrnamentsPointer;
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	D,0
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,(?0010+79)
	ADD	HL,BC
	LD	(?0010+79),HL
; 650.	
; 651.	        //s->counter =j;
; 652.	
; 653.	        //if(j > 65535)
; 654.	        //    return false;
; 655.	
; 656.	        // s->counter = 1009;    
; 657.	
; 658.	        if(j >= length)
	PUSH	IX
	POP	BC
	AND	A
	SBC	HL,BC
	JP	NC,?1254
?0268:
; 659.	                return false;
?0269:
; 660.	
; 661.	        j1 = 0;
	LD	L,D
	LD	H,D
	LD	(?0010+81),HL
; 662.	        j1 = ay_sys_getword(&module[PSC_OrnamentsPointer-2]);
	LD	L,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	EXX
	PUSH	BC
	EXX
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	DEC	DE
	DEC	DE
	CALL	LWRD ?1582
	LD	(?0010+81),HL
; 663.	        j1 += 0x4c;
	LD	HL,76
	LD	BC,(?0010+81)
	ADD	HL,BC
	LD	(?0010+81),HL
; 664.	        //  if(j1 > 65535)
; 665.	        //      return false;
; 666.	
; 667.	        //  s->err = 9;
; 668.	
; 669.	
; 670.	        if(j1 >= length)
	PUSH	IX
	POP	BC
	AND	A
	SBC	HL,BC
	JP	NC,?1254
?0270:
; 671.	                return false;
?0271:
; 672.	
; 673.	        // s->err = 10;
; 674.	
; 675.	
; 676.	        if(j - j1 < 8)
	LD	BC,(?0010+81)
	LD	HL,(?0010+79)
	AND	A
	SBC	HL,BC
	LD	BC,8
	AND	A
	SBC	HL,BC
	JP	C,?1254
?0272:
; 677.	                return false;
?0273:
; 678.	
; 679.	        //s->counter = 1013;    
; 680.	
; 681.	        // s->err = 11; 
; 682.	
; 683.	        if(((j - j1) % 6) != 2) //// 17.11
	LD	BC,(?0010+81)
	LD	HL,(?0010+79)
	SBC	HL,BC
	EX	DE,HL
	LD	BC,6
	CALL	LWRD ?US_MOD_L02
	LD	A,2
	XOR	E
	OR	D
	JR	Z,?0275
?0274:
; 684.	        {
; 685.	                s->err = 1;
	PUSH	IY
	POP	HL
	LD	(HL),1
	INC	HL
	LD	(HL),B
; 686.	                return false;
	JP	LWRD ?1254
; 687.	        }
?0275:
; 688.	
; 689.	        //s->err = 12;
; 690.	
; 691.	        j1 = PSC_SamplesPointers(0) + 0x4c + 4;
	LD	HL,76
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	E,(HL)
	LD	D,A
	LD	HL,77
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,80
?1235:
	ADD	HL,BC
	LD	(?0010+81),HL
?0277:
; 692.	        while(/*(j1 < 65536) &&*/ (j1 <= length) && ((module[j1] & 32) != 0))
	LD	C,L
	LD	B,H
	PUSH	IX
	POP	HL
	AND	A
	SBC	HL,BC
	JR	C,?0276
	LD	L,C
	LD	H,B
	EXX
	PUSH	BC
	EXX
	POP	BC
	ADD	HL,BC
	BIT	5,(HL)
	JR	Z,?0276
?0280:
?0279:
?0278:
; 693.	                j1 += 6;
	LD	HL,6
	LD	BC,(?0010+81)
	JR	?1235
?0276:
; 694.	        if(j1 > 65534)
	LD	BC,(?0010+81)
	LD	HL,65534
	AND	A
	SBC	HL,BC
	JP	C,?1254
?0281:
; 695.	                return false;
?0282:
; 696.	
; 697.	        //s->err = 13;   
; 698.	
; 699.	        // s->counter = 1014;    
; 700.	
; 701.	        if(j1 > length)
	PUSH	IX
	POP	HL
	SBC	HL,BC
	JP	C,?1254
?0283:
; 702.	                return false;
?0284:
; 703.	
; 704.	        //s->err = 1;
; 705.	
; 706.	        if(PSC_OrnamentsPointer - 0x4c - 2 > 0)
	LD	HL,74
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	D,0
	LD	HL,75
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,65458
	ADD	HL,BC
	LD	C,L
	LD	B,H
	LD	L,D
	LD	H,D
	OR	128
	SBC	HL,BC
	JP	PO,?1234
	XOR	H
?1234:
	JP	P,?0286
?0285:
; 707.	        {
; 708.	                if(j1 + 3 != PSC_SamplesPointers(1) + 0x4c) //17.11
	LD	HL,78
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,79
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,76
	ADD	HL,BC
	LD	BC,(?0010+81)
	INC	BC
	INC	BC
	INC	BC
	AND	A
	SBC	HL,BC
	JR	Z,?0291
?0287:
; 709.	                {
; 710.	                        s->err = 2;
	PUSH	IY
	POP	HL
	LD	(HL),2
	INC	HL
	LD	(HL),D
; 711.	                        return false;
	JP	LWRD ?1254
; 712.	                }
?0288:
; 713.	        }
; 714.	        else 
?0286:
; 715.	                if(j1 + 4 != j)
	LD	HL,4
	LD	BC,(?0010+81)
	ADD	HL,BC
	LD	BC,(?0010+79)
	AND	A
	SBC	HL,BC
	JP	NZ,?1254
?0290:
; 716.	                {
; 717.	                        //s->counter = 1015;
; 718.	                        return false;
; 719.	                }
?0291:
?0289:
; 720.	
; 721.	                //s->err = 14;
; 722.	
; 723.	                // s->counter = 1016;
; 724.	
; 725.	                if((unsigned long)(PSC_PatternsPointer + 11) > 65535)
	LD	HL,71
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,72
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,11
	ADD	HL,BC
	LD	A,H
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	AND	A
	LD	HL,65535
	POP	BC
	SBC	HL,BC
	LD	L,D
	LD	H,D
	POP	BC
	SBC	HL,BC
	JR	C,?1254
?0292:
; 726.	                        return false;
?0293:
; 727.	
; 728.	                // s->counter = 1017;     
; 729.	
; 730.	                if(PSC_PatternsPointer + 11 >= length)
	LD	HL,71
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,72
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	LD	BC,11
	ADD	HL,BC
	PUSH	IX
	POP	BC
	AND	A
	SBC	HL,BC
	JR	NC,?1254
?0294:
; 731.	                        return false;
?0295:
; 732.	
; 733.	                //s->counter = 1018;
; 734.	
; 735.	                j = PSC_PatternsPointer + 1;
	LD	HL,71
	LD	BC,(?0010+83)
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,72
	ADD	HL,BC
	LD	B,(HL)
	LD	L,A
	LD	A,D
	OR	B
	LD	H,A
	INC	HL
	LD	(?0010+79),HL
; 736.	                if(module[j] == 255)
	EXX
	PUSH	BC
	EXX
	POP	BC
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JR	Z,?1254
?0296:
; 737.	                        return false;
?0297:
?0299:
; 738.	
; 739.	                //  s->counter = 1019;
; 740.	
; 741.	                while(1)
?0300:
; 742.	                {
; 743.	                        j += 8;
	LD	HL,8
	LD	BC,(?0010+79)
	ADD	HL,BC
	LD	(?0010+79),HL
; 744.	                        if((j > 65532) && (j + 2 > length) || (module[j] == 255))
	LD	C,L
	LD	B,H
	LD	HL,65532
	AND	A
	SBC	HL,BC
	JR	NC,?0304
	INC	BC
	INC	BC
	PUSH	IX
	POP	HL
	AND	A
	SBC	HL,BC
	JR	C,?0305
?0304:
?0303:
	LD	HL,(?0010+79)
	EXX
	PUSH	BC
	EXX
	POP	BC
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JR	NZ,?0297
?0305:
?0306:
?0301:
; 745.	                                break;
?0302:
?0298:
; 746.	                }
; 747.	
; 748.	                if(j > 65532)
	LD	BC,(?0010+79)
	LD	HL,65532
	AND	A
	SBC	HL,BC
	JR	C,?1254
?0307:
; 749.	                        return false;
?0308:
; 750.	
; 751.	                //s->counter = 1020;    
; 752.	
; 753.	                if(j + 2 > length)
	INC	BC
	INC	BC
	PUSH	IX
	POP	HL
	SBC	HL,BC
	JR	NC,?0310
?0309:
; 754.	                        return false;
?1254:
	LD	L,0
	JR	?0312
?0310:
; 755.	
; 756.	                //  s->counter = 1021;
; 757.	
; 758.	                strcpy(s->player, "Pro Sound Creator"); 
	LD	BC,?0311
	CALL	LWRD ?1612
; 759.	
; 760.	                return true;
	LD	L,1
; 761.	
; 762.	}
?0312:
	EXX
	POP	BC
	EXX
	POP	IX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1612:
	LD	HL,74
	PUSH	IY
	POP	DE
	ADD	HL,DE
	EX	DE,HL
	LD	A,BYTE3 strcpy
	LD	HL,LWRD strcpy
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 763.	
; 764.	
; 765.	
; 766.	
; 767.	
; 768.	
; 769.	
; 770.	
; 771.	
; 772.	int pp = 0;
; 773.	int offset;
; 774.	
; 775.	
; 776.	typedef struct 
; 777.	{
; 778.	        unsigned char ASC0_Delay;
; 779.	        unsigned char ASC0_PatternsPointers0, ASC0_PatternsPointers1;
; 780.	        unsigned char ASC0_SamplesPointers0, ASC0_SamplesPointers1;
; 781.	        unsigned char ASC0_OrnamentsPointers0, ASC0_OrnamentsPointers1;
; 782.	        unsigned char ASC0_Number_Of_Positions;
; 783.	        unsigned char ASC0_Positions[65536 - 8];
; 784.	} ASC0_File;
; 785.	
; 786.	typedef struct 
; 787.	{
; 788.	        unsigned char ASC1_Delay, ASC1_LoopingPosition;
; 789.	        unsigned char ASC1_PatternsPointers0, ASC1_PatternsPointers1;
; 790.	        unsigned char ASC1_SamplesPointers0, ASC1_SamplesPointers1;
; 791.	        unsigned char ASC1_OrnamentsPointers0, ASC1_OrnamentsPointers1;
; 792.	        unsigned char ASC1_Number_Of_Positions;
; 793.	        unsigned char ASC1_Positions[65536 - 8];
; 794.	} ASC1_File;
; 795.	
; 796.	#define ASC1_PatternsPointers (header->ASC1_PatternsPointers0 | (header->ASC1_PatternsPointers1 << 8))
; 797.	#define ASC1_SamplesPointers (header->ASC1_SamplesPointers0 | (header->ASC1_SamplesPointers1 << 8))
; 798.	#define ASC1_OrnamentsPointers (header->ASC1_OrnamentsPointers0 | (header->ASC1_OrnamentsPointers1 << 8))
; 799.	
; 800.	#define ASC0_PatternsPointers (header0->ASC0_PatternsPointers0 | (header0->ASC0_PatternsPointers1 << 8))
; 801.	#define ASC0_SamplesPointers (header0->ASC0_SamplesPointers0 | (header0->ASC0_SamplesPointers1 << 8))
; 802.	#define ASC0_OrnamentsPointers (header0->ASC0_OrnamentsPointers0 | (header0->ASC0_OrnamentsPointers1 << 8))
; 803.	
; 804.	
; 805.	typedef struct 
; 806.	{
; 807.	        unsigned short Initial_Point_In_Sample, Point_In_Sample, Loop_Point_In_Sample, Initial_Point_In_Ornament, Point_In_Ornament, Loop_Point_In_Ornament, Address_In_Pattern, Ton, Ton_Deviation;
; 808.	        unsigned char Note, Addition_To_Note, Number_Of_Notes_To_Skip, Initial_Noise, Current_Noise, Volume, Ton_Sliding_Counter, Amplitude, Amplitude_Delay, Amplitude_Delay_Counter;
; 809.	        short Current_Ton_Sliding, Substruction_for_Ton_Sliding;
; 810.	        signed char Note_Skip_Counter, Addition_To_Amplitude;
; 811.	        bool Envelope_Enabled, Sound_Enabled, Sample_Finished, Break_Sample_Loop, Break_Ornament_Loop;
; 812.	} ASC_Channel_Parameters;
; 813.	
; 814.	typedef struct 
; 815.	{
; 816.	        unsigned char Delay, DelayCounter, CurrentPosition;
; 817.	} ASC_Parameters;
; 818.	
; 819.	typedef struct 
; 820.	{
; 821.	        ASC_Parameters ASC;
; 822.	        ASC_Channel_Parameters ASC_A, ASC_B, ASC_C;
; 823.	} ASC_SongInfo;
; 824.	
; 825.	ASC_SongInfo asc;
; 826.	
; 827.	#define ASC_A ((ASC_SongInfo *)info->data)->ASC_A
; 828.	#define ASC_B ((ASC_SongInfo *)info->data)->ASC_B
; 829.	#define ASC_C ((ASC_SongInfo *)info->data)->ASC_C
; 830.	#define ASC ((ASC_SongInfo *)info->data)->ASC
; 831.	
; 832.	#define GET_ADDRINPATT(x,y) ((module[ascPatPt + 6 * module[x + 9] + y * 2] | (module[ascPatPt + 6 * module[x + 9] + 1 + y * 2] << 8))  + ascPatPt)
; 833.	
; 834.	
; 835.	void ASC_Init_orig(AYSongInfo * info)
; 836.	{
ASC_Init_orig:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 837.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+85),HL
; 838.	        ASC1_File *header = (ASC1_File *)module;
	LD	(?0010+87),HL
; 839.	        unsigned short ascPatPt = ASC1_PatternsPointers;
	INC	HL
	INC	HL
	LD	A,(HL)
	LD	B,0
	INC	HL
	LD	D,(HL)
	LD	L,A
	LD	A,B
	OR	D
	LD	H,A
	LD	(?0010+89),HL
; 840.	
; 841.	        info->data = &asc;
	LD	(IX+4),LOW(asc)
	LD	(IX+5),HIGH(asc)
; 842.	
; 843.	        memset(&ASC_A, 0, sizeof(ASC_Channel_Parameters));
	LD	C,39
	PUSH	BC
	LD	C,B
	LD	E,(IX+4)
	LD	D,(IX+5)
	INC	DE
	INC	DE
	INC	DE
	CALL	LWRD ?1606
	POP	AF
; 844.	        memset(&ASC_B, 0, sizeof(ASC_Channel_Parameters));
	LD	HL,39
	PUSH	HL
	CALL	LWRD ?1607
	POP	AF
; 845.	        memset(&ASC_C, 0, sizeof(ASC_Channel_Parameters));
	LD	HL,39
	PUSH	HL
	LD	C,H
	LD	B,H
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,81
	CALL	LWRD ?1608
	POP	AF
; 846.	
; 847.	        ASC.CurrentPosition = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	(HL),0
; 848.	        ASC.DelayCounter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	LD	(HL),1
; 849.	        ASC.Delay = header->ASC1_Delay;
	LD	L,(IX+4)
	LD	H,(IX+5)
	PUSH	HL
	LD	HL,(?0010+87)
	LD	B,(HL)
	POP	HL
	LD	(HL),B
; 850.	        ASC_A.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[9]]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,15
	ADD	HL,BC
	PUSH	HL
	LD	HL,9
	LD	BC,(?0010+85)
	ADD	HL,BC
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+89)
	ADD	HL,DE
	CALL	LWRD ?1581
	LD	BC,(?0010+89)
	ADD	HL,BC
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 851.	        ASC_B.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[9] + 2]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,54
	ADD	HL,DE
	PUSH	HL
	PUSH	BC
	LD	HL,9
	LD	DE,(?0010+85)
	ADD	HL,DE
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	ADD	HL,BC
	LD	DE,(?0010+85)
	ADD	HL,DE
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	POP	BC
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 852.	        ASC_C.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[9] + 4]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,93
	ADD	HL,BC
	PUSH	HL
	LD	HL,9
	LD	BC,(?0010+85)
	ADD	HL,BC
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+89)
	ADD	HL,DE
	ADD	HL,BC
	LD	BC,4
	CALL	LWRD ?1581
	LD	BC,(?0010+89)
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 853.	
; 854.	        info->slow = 1;
	JP	LWRD ?1573
?1607:
	LD	C,H
	LD	B,H
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,42
?1608:
	ADD	HL,DE
	EX	DE,HL
?1606:
	LD	A,BYTE3 memset
	LD	HL,LWRD memset
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 855.	}
; 856.	
; 857.	
; 858.	void AS0_Init(AYSongInfo * info)
; 859.	{
AS0_Init:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 860.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+91),HL
; 861.	        ASC0_File *header0 = (ASC0_File *)module;
	LD	(?0010+93),HL
; 862.	        unsigned short ascPatPt = ASC0_PatternsPointers;
	INC	HL
	LD	A,(HL)
	LD	B,0
	INC	HL
	LD	D,(HL)
	LD	L,A
	LD	A,B
	OR	D
	LD	H,A
	LD	(?0010+95),HL
; 863.	
; 864.	
; 865.	        info->data = &asc;
	LD	(IX+4),LOW(asc)
	LD	(IX+5),HIGH(asc)
; 866.	
; 867.	        memset(&ASC_A, 0, sizeof(ASC_Channel_Parameters));
	LD	C,39
	PUSH	BC
	LD	C,B
	LD	E,(IX+4)
	LD	D,(IX+5)
	INC	DE
	INC	DE
	INC	DE
	CALL	LWRD ?1606
	POP	AF
; 868.	        memset(&ASC_B, 0, sizeof(ASC_Channel_Parameters));
	LD	HL,39
	PUSH	HL
	CALL	LWRD ?1607
	POP	AF
; 869.	        memset(&ASC_C, 0, sizeof(ASC_Channel_Parameters));
	LD	HL,39
	PUSH	HL
	LD	C,H
	LD	B,H
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,81
	CALL	LWRD ?1608
	POP	AF
; 870.	        ASC.CurrentPosition = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	(HL),0
; 871.	        ASC.DelayCounter = 1;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	LD	(HL),1
; 872.	        ASC.Delay = header0->ASC0_Delay;
	LD	L,(IX+4)
	LD	H,(IX+5)
	PUSH	HL
	LD	HL,(?0010+93)
	LD	B,(HL)
	POP	HL
	LD	(HL),B
; 873.	        ASC_A.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[8]]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,15
	ADD	HL,BC
	PUSH	HL
	LD	HL,8
	LD	BC,(?0010+91)
	ADD	HL,BC
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+95)
	ADD	HL,DE
	CALL	LWRD ?1581
	LD	BC,(?0010+95)
	ADD	HL,BC
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 874.	        ASC_B.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[8] + 2]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,54
	ADD	HL,DE
	PUSH	HL
	PUSH	BC
	LD	HL,8
	LD	DE,(?0010+91)
	ADD	HL,DE
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	ADD	HL,BC
	LD	DE,(?0010+91)
	ADD	HL,DE
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	POP	BC
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 875.	        ASC_C.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[8] + 4]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,93
	ADD	HL,BC
	PUSH	HL
	LD	HL,8
	LD	BC,(?0010+91)
	ADD	HL,BC
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+95)
	ADD	HL,DE
	ADD	HL,BC
	LD	BC,4
	CALL	LWRD ?1581
	LD	BC,(?0010+95)
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 876.	
; 877.	        info->slow = 0;
	LD	(IX+109),0
; 878.	}
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 879.	
; 880.	void ASC_Init(AYSongInfo * info)
; 881.	{
ASC_Init:
	PUSH	IX
; 882.	
; 883.	        if (pp==3)
	LD	HL,(pp)
	LD	A,3
	XOR	L
	OR	H
	JR	NZ,?0314
?0313:
; 884.	                AS0_Init(info);           
	LD	A,BYTE3 AS0_Init
	LD	HL,LWRD AS0_Init
	JR	?1257
; 885.	        else    
?0314:
; 886.	                ASC_Init_orig(info);               
	LD	A,BYTE3 ASC_Init_orig
	LD	HL,LWRD ASC_Init_orig
?1257:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0315:
; 887.	}
	POP	IX
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 888.	
; 889.	
; 890.	void ASC_PatternInterpreter(AYSongInfo * info, ASC_Channel_Parameters * chan, int AS0)
; 891.	{
ASC_PatternInterpreter:
	PUSH	IY
	PUSH	IX
	PUSH	BC
	POP	IX
	PUSH	DE
	POP	IY
; 892.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+97),HL
; 893.	
; 894.	        ASC1_File *header = (ASC1_File *)module;
	LD	(?0010+99),HL
; 895.	        ASC0_File *header0 = (ASC0_File *)module;
	LD	(?0010+101),HL
; 896.	
; 897.	        short delta_ton;
; 898.	        bool Initialization_Of_Ornament_Disabled, Initialization_Of_Sample_Disabled;
; 899.	
; 900.	        Initialization_Of_Ornament_Disabled = Initialization_Of_Sample_Disabled = false;
	XOR	A
	LD	(?0010+106),A
	LD	(?0010+105),A
; 901.	
; 902.	        chan->Ton_Sliding_Counter = 0;
	LD	HL,24
	ADD	HL,BC
	LD	(HL),A
; 903.	        chan->Amplitude_Delay_Counter = 0;
	LD	HL,27
	ADD	HL,BC
	LD	(HL),A
?0317:
; 904.	        while(true)
?0318:
; 905.	        {
; 906.	                unsigned char val = module[chan->Address_In_Pattern];
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+107),A
; 907.	                if(val <= 0x55)
	LD	B,A
	LD	A,85
	CP	B
	JP	C,?0320
?0319:
; 908.	                {
; 909.	                        chan->Note = val;
	LD	(IX+18),B
; 910.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1290
	INC	(IX+13)
?1290:
; 911.	                        chan->Current_Noise = chan->Initial_Noise;
	LD	B,(IX+21)
	LD	(IX+22),B
; 912.	                        if((signed char)(chan->Ton_Sliding_Counter) <= 0)
	XOR	A
	SUB	(IX+24)
	JP	PO,?1291
	XOR	128
?1291:
	JP	M,?0322
?0321:
; 913.	                                chan->Current_Ton_Sliding = 0;
	XOR	A
	LD	(IX+28),A
	LD	(IX+29),A
?0322:
; 914.	                        if(!Initialization_Of_Sample_Disabled)
	LD	A,(?0010+106)
	OR	A
	JR	NZ,?0324
?0323:
; 915.	                        {
; 916.	                                chan->Addition_To_Amplitude = 0;
	LD	(IX+33),A
; 917.	                                chan->Ton_Deviation = 0;
	LD	(IX+16),A
	LD	(IX+17),A
; 918.	                                chan->Point_In_Sample = chan->Initial_Point_In_Sample;
	LD	L,(IX+0)
	LD	H,(IX+1)
	LD	(IX+2),L
	LD	(IX+3),H
; 919.	                                chan->Sound_Enabled = true;
	LD	(IX+35),1
; 920.	                                chan->Sample_Finished = false;
	LD	(IX+36),A
; 921.	                                chan->Break_Sample_Loop = false;
	LD	(IX+37),A
?0324:
; 922.	                        }
; 923.	                        if(!Initialization_Of_Ornament_Disabled)
	LD	A,(?0010+105)
	OR	A
	JR	NZ,?0326
?0325:
; 924.	                        {
; 925.	                                chan->Point_In_Ornament = chan->Initial_Point_In_Ornament;
	LD	L,(IX+6)
	LD	H,(IX+7)
	LD	(IX+8),L
	LD	(IX+9),H
; 926.	                                chan->Addition_To_Note = 0;
	LD	(IX+19),A
?0326:
; 927.	                        }
; 928.	                        if(chan->Envelope_Enabled)
	LD	A,(IX+34)
	OR	A
	JP	Z,?0316
?0327:
; 929.	                        {
; 930.	                                ay_writeay(AY_ENV_FINE, module[chan->Address_In_Pattern]);
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	C,(HL)
	LD	E,11
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 931.	                                chan->Address_In_Pattern++;
	INC	(IX+12)
	JP	NZ,?0316
	JR	?1321
?0328:
; 932.	                        }
; 933.	                        break;
?0320:
; 934.	                }
; 935.	                else if((val >= 0x56) && (val <= 0x5d))
	LD	A,B
	CP	86
	JR	C,?0330
	LD	B,A
	LD	A,93
	CP	B
	JR	C,?0330
?0332:
?0331:
?0329:
; 936.	                {
; 937.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JP	NZ,?0316
	JR	?1321
; 938.	                        break;
?0330:
; 939.	                }
; 940.	                else if(val == 0x5e)
	LD	A,B
	CP	94
	JR	NZ,?0334
?0333:
; 941.	                {
; 942.	                        chan->Break_Sample_Loop = true;
	LD	(IX+37),1
; 943.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JP	NZ,?0316
	JR	?1321
; 944.	                        break;
?0334:
; 945.	                }
; 946.	                else if(val == 0x5f)
	CP	95
	JR	NZ,?0336
?0335:
; 947.	                {
; 948.	                        chan->Sound_Enabled = false;
	LD	(IX+35),0
; 949.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JP	NZ,?0316
?1321:
	INC	(IX+13)
; 950.	                        break;
	JP	LWRD ?0316
?0336:
; 951.	                }
; 952.	                else if((val >= 0x60) && (val <= 0x9f))
	CP	96
	JR	C,?0338
	LD	B,A
	LD	A,159
	CP	B
	JR	C,?0338
?0340:
?0339:
?0337:
; 953.	                {
; 954.	                        chan->Number_Of_Notes_To_Skip = val - 0x60;
	LD	A,B
	ADD	A,160
	LD	(IX+20),A
	JP	LWRD ?0415
?0338:
; 955.	                }
; 956.	                else if((val >= 0xa0) && (val <= 0xbf))
	LD	A,B
	CP	160
	JP	C,?0343
	LD	B,A
	LD	A,191
	CP	B
	JP	C,?0343
?0345:
?0344:
?0342:
; 957.	                {
; 958.	                        if (!AS0)
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	OR	(HL)
	JR	NZ,?0347
?0346:
; 959.	                                chan->Initial_Point_In_Sample = ay_sys_getword(&module[(module[chan->Address_In_Pattern] - 0xa0) * 2 + ASC1_SamplesPointers]) + ASC1_SamplesPointers;
	LD	HL,4
	LD	BC,(?0010+99)
	ADD	HL,BC
	LD	E,(HL)
	LD	HL,5
	ADD	HL,BC
	LD	H,(HL)
	LD	C,E
	OR	H
	LD	B,A
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	DE,(?0010+97)
	ADD	HL,DE
	LD	L,(HL)
	LD	H,0
	LD	DE,65376
	CALL	LWRD ?1584
	PUSH	HL
	LD	HL,4
	LD	BC,(?0010+99)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,5
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	JR	?1304
; 960.	                        else
?0347:
; 961.	                                chan->Initial_Point_In_Sample = ay_sys_getword(&module[(module[chan->Address_In_Pattern] - 0xa0) * 2 + ASC0_SamplesPointers]) + ASC0_SamplesPointers;
	LD	HL,(?0010+101)
	INC	HL
	INC	HL
	INC	HL
	LD	C,(HL)
	XOR	A
	LD	HL,4
	LD	DE,(?0010+101)
	ADD	HL,DE
	LD	H,(HL)
	LD	E,C
	OR	H
	LD	D,A
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	L,(HL)
	LD	H,0
	LD	BC,65376
	ADD	HL,BC
	ADD	HL,HL
	ADD	HL,DE
	CALL	LWRD ?1585
	PUSH	HL
	LD	HL,(?0010+101)
	INC	HL
	INC	HL
	INC	HL
	LD	C,(HL)
	XOR	A
	LD	HL,4
	LD	DE,(?0010+101)
	ADD	HL,DE
	LD	D,(HL)
	LD	L,C
	OR	D
?1304:
	LD	B,A
	LD	C,L
	POP	HL
	ADD	HL,BC
	PUSH	HL
	PUSH	IX
	POP	HL
	POP	BC
	LD	(HL),C
	INC	HL
	JP	LWRD ?1318
?0348:
?0343:
; 962.	
; 963.	                }
; 964.	                else if((val >= 0xc0) && (val <= 0xdf))
	LD	A,B
	CP	192
	JR	C,?0351
	LD	B,A
	LD	A,223
	CP	B
	JR	C,?0351
?0353:
?0352:
?0350:
; 965.	                {
; 966.	                        if (!AS0)
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	OR	(HL)
	JR	NZ,?0355
?0354:
; 967.	                                chan->Initial_Point_In_Ornament = ay_sys_getword(&module[(module[chan->Address_In_Pattern] - 0xc0) * 2 + ASC1_OrnamentsPointers]) + ASC1_OrnamentsPointers;
	LD	HL,6
	LD	BC,(?0010+99)
	ADD	HL,BC
	LD	E,(HL)
	LD	HL,7
	CALL	LWRD ?1586
	PUSH	HL
	LD	HL,6
	LD	BC,(?0010+99)
	ADD	HL,BC
	LD	E,(HL)
	LD	D,0
	LD	HL,7
	JR	?1305
; 968.	                        else
?0355:
; 969.	                                chan->Initial_Point_In_Ornament = ay_sys_getword(&module[(module[chan->Address_In_Pattern] - 0xc0) * 2 + ASC0_OrnamentsPointers]) + ASC0_OrnamentsPointers;
	LD	HL,5
	LD	BC,(?0010+101)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,6
	CALL	LWRD ?1586
	PUSH	HL
	LD	HL,5
	LD	BC,(?0010+101)
	ADD	HL,BC
	LD	E,(HL)
	LD	D,0
	LD	HL,6
?1305:
	ADD	HL,BC
	LD	B,(HL)
	LD	C,E
	LD	A,D
	OR	B
	LD	B,A
	POP	HL
	ADD	HL,BC
	LD	(IX+6),L
	LD	(IX+7),H
?0356:
	JP	LWRD ?0415
?0351:
; 970.	
; 971.	                }
; 972.	                else if(val == 0xe0)
	LD	A,B
	CP	224
	JR	NZ,?0359
?0358:
; 973.	                {
; 974.	                        chan->Volume = 15;
	LD	(IX+23),15
; 975.	                        chan->Envelope_Enabled = true;
	LD	(IX+34),1
	JP	LWRD ?0415
?0359:
; 976.	                }
; 977.	                else if((val >= 0xe1) && (val <= 0xef))
	CP	225
	JR	C,?0362
	LD	B,A
	LD	A,239
	CP	B
	JR	C,?0362
?0364:
?0363:
?0361:
; 978.	                {
; 979.	                        chan->Volume = val - 0xe0;
	LD	A,B
	ADD	A,32
	LD	(IX+23),A
; 980.	                        chan->Envelope_Enabled = false;
	LD	(IX+34),0
	JP	LWRD ?0415
?0362:
; 981.	                }
; 982.	                else if(val == 0xf0)
	LD	A,B
	CP	240
	JR	NZ,?0367
?0366:
; 983.	                {
; 984.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1296
	INC	(IX+13)
?1296:
; 985.	                        chan->Initial_Noise = module[chan->Address_In_Pattern];
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	B,(HL)
	LD	(IX+21),B
	JP	LWRD ?0415
?0367:
; 986.	                }
; 987.	                else if(val == 0xf1)
	CP	241
	JR	NZ,?0370
?0369:
; 988.	                {
; 989.	                        Initialization_Of_Sample_Disabled = true;
	LD	A,1
	LD	(?0010+106),A
	JP	LWRD ?0415
?0370:
; 990.	                }
; 991.	                else if(val == 0xf2)
	CP	242
	JR	Z,?1310
?0372:
; 992.	                {
; 993.	                        Initialization_Of_Ornament_Disabled = true;
?0373:
; 994.	                }
; 995.	                else if(val == 0xf3)
	CP	243
	JR	NZ,?0376
?0375:
; 996.	                {
; 997.	                        Initialization_Of_Sample_Disabled = true;
	LD	A,1
	LD	(?0010+106),A
; 998.	                        Initialization_Of_Ornament_Disabled = true;
?1310:
	LD	A,1
	LD	(?0010+105),A
	JP	LWRD ?0415
?0376:
; 999.	                }
; 1000.	                else if(val == 0xf4)
	CP	244
	JR	NZ,?0379
?0378:
; 1001.	                {
; 1002.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1297
	INC	(IX+13)
?1297:
; 1003.	                        ASC.Delay = module[chan->Address_In_Pattern];
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	B,(HL)
	LD	L,(IY+4)
	LD	H,(IY+5)
?1318:
	LD	(HL),B
	JP	LWRD ?0415
?0379:
; 1004.	                }
; 1005.	                else if(val == 0xf5)
	CP	245
	JR	NZ,?0382
?0381:
; 1006.	                {
; 1007.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1298
	INC	(IX+13)
?1298:
; 1008.	                        chan->Substruction_for_Ton_Sliding = -(signed char)(module[chan->Address_In_Pattern]) * 16;
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	C,(HL)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	AND	A
	LD	HL,0
	SBC	HL,BC
	JR	?1311
; 1009.	                        chan->Ton_Sliding_Counter = 255;
?0382:
; 1010.	                }
; 1011.	                else if(val == 0xf6)
	CP	246
	JR	NZ,?0385
?0384:
; 1012.	                {
; 1013.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1299
	INC	(IX+13)
?1299:
; 1014.	                        chan->Substruction_for_Ton_Sliding = (signed char)(module[chan->Address_In_Pattern]) * 16;
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	L,(HL)
	LD	A,L
	RLCA
	SBC	A,A
	LD	H,A
?1311:
	ADD	HL,HL
	ADD	HL,HL
	ADD	HL,HL
	ADD	HL,HL
	LD	(IX+30),L
	LD	(IX+31),H
; 1015.	                        chan->Ton_Sliding_Counter = 255;
	LD	(IX+24),255
	JP	LWRD ?0415
?0385:
; 1016.	                }
; 1017.	                else if(val == 0xf7)
	CP	247
	JR	NZ,?0388
?0387:
; 1018.	                {
; 1019.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1300
	INC	(IX+13)
?1300:
; 1020.	                        Initialization_Of_Sample_Disabled = true;
	LD	A,1
	LD	(?0010+106),A
; 1021.	                        if(module[chan->Address_In_Pattern + 1] < 0x56)
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	CP	86
	JR	NC,?0399
?0389:
; 1022.	                                delta_ton = ASM_Table[chan->Note] + (chan->Current_Ton_Sliding / 16) - ASM_Table[module[chan->Address_In_Pattern + 1]];
	LD	L,(IX+12)
	LD	H,(IX+13)
	ADD	HL,BC
	INC	HL
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	BC,ASM_Table
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	PUSH	BC
	LD	L,(IX+18)
	LD	H,0
	ADD	HL,HL
	LD	DE,ASM_Table
	ADD	HL,DE
	LD	D,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,D
	CALL	LWRD ?1613
	ADD	HL,DE
	POP	BC
	JR	?1317
; 1023.	                        else
?0390:
; 1024.	                                delta_ton = chan->Current_Ton_Sliding / 16;
?0391:
; 1025.	                        delta_ton = delta_ton << 4;
; 1026.	                        chan->Substruction_for_Ton_Sliding = -delta_ton / (signed char)(module[chan->Address_In_Pattern]);
; 1027.	                        chan->Current_Ton_Sliding = delta_ton - delta_ton % (signed char)(module[chan->Address_In_Pattern]);
; 1028.	                        chan->Ton_Sliding_Counter = (signed char)(module[chan->Address_In_Pattern]);
?0388:
; 1029.	                }
; 1030.	                else if(val == 0xf8)
	CP	248
	JR	NZ,?0394
?0393:
; 1031.	                {
; 1032.	                        ay_writeay(AY_ENV_SHAPE, 8);
	LD	C,8
	JP	LWRD ?1307
?0394:
; 1033.	                }
; 1034.	                else if(val == 0xf9)
	CP	249
	JP	NZ,?0397
?0396:
; 1035.	                {
; 1036.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1301
	INC	(IX+13)
?1301:
; 1037.	                        if(module[chan->Address_In_Pattern + 1] < 0x56)
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	INC	HL
	LD	A,(HL)
	CP	86
	JR	NC,?0399
?0398:
; 1038.	                        {
; 1039.	                                delta_ton = ASM_Table[chan->Note] - ASM_Table[module[chan->Address_In_Pattern + 1]];
	LD	L,(IX+12)
	LD	H,(IX+13)
	ADD	HL,BC
	INC	HL
	LD	L,(HL)
	LD	H,0
	ADD	HL,HL
	LD	BC,ASM_Table
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	LD	L,(IX+18)
	LD	H,0
	ADD	HL,HL
	LD	DE,ASM_Table
	ADD	HL,DE
	LD	D,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,D
?1317:
	AND	A
	SBC	HL,BC
	LD	(?0010+103),HL
; 1040.	                        }
; 1041.	                        else
	JR	?0400
?0399:
; 1042.	                                delta_ton = chan->Current_Ton_Sliding / 16;
	CALL	LWRD ?1613
	LD	(?0010+103),DE
?0400:
; 1043.	                        delta_ton = delta_ton << 4;
	LD	HL,?0010+103
	LD	B,4
	CALL	LWRD ?S_LSHASG_L02
; 1044.	                        chan->Substruction_for_Ton_Sliding = -delta_ton / (signed char)(module[chan->Address_In_Pattern]);
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	C,(HL)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	XOR	A
	SUB	E
	LD	E,A
	LD	A,0
	SBC	A,D
	LD	D,A
	CALL	LWRD ?SS_DIV_L02
	LD	(IX+30),E
	LD	(IX+31),D
; 1045.	                        chan->Current_Ton_Sliding = delta_ton - delta_ton % (signed char)(module[chan->Address_In_Pattern]);
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	C,(HL)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	LD	DE,(?0010+103)
	CALL	LWRD ?SS_MOD_L02
	LD	HL,(?0010+103)
	AND	A
	SBC	HL,DE
	LD	(IX+28),L
	LD	(IX+29),H
; 1046.	                        chan->Ton_Sliding_Counter = (signed char)(module[chan->Address_In_Pattern]);
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	LD	B,(HL)
	LD	(IX+24),B
	JR	?0415
?0397:
; 1047.	
; 1048.	                }
; 1049.	                else if(val == 0xfa)
	CP	250
	JR	NZ,?0403
?0402:
; 1050.	                {
; 1051.	                        ay_writeay(AY_ENV_SHAPE, 10);
	LD	C,10
	JR	?1307
?0403:
; 1052.	                }
; 1053.	                else if(val == 0xfb)
	CP	251
	JR	NZ,?0406
?0405:
; 1054.	                {
; 1055.	                        chan->Address_In_Pattern++;
	INC	(IX+12)
	JR	NZ,?1302
	INC	(IX+13)
?1302:
; 1056.	                        if((module[chan->Address_In_Pattern] & 32) == 0)
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	BC,(?0010+97)
	ADD	HL,BC
	BIT	5,(HL)
	LD	L,(IX+12)
	LD	H,(IX+13)
	ADD	HL,BC
	LD	A,(HL)
	JR	NZ,?0408
?0407:
; 1057.	                        {
; 1058.	                                chan->Amplitude_Delay = module[chan->Address_In_Pattern] << 3;
	ADD	A,A
	ADD	A,A
	ADD	A,A
	JR	?1306
; 1059.	                                chan->Amplitude_Delay_Counter = chan->Amplitude_Delay;
; 1060.	                        }
; 1061.	                        else
?0408:
; 1062.	                        {
; 1063.	                                chan->Amplitude_Delay = ((module[chan->Address_In_Pattern] << 3) ^ 0xf8) + 9;
	ADD	A,A
	ADD	A,A
	ADD	A,A
	XOR	248
	ADD	A,9
?1306:
	LD	(IX+26),A
; 1064.	                                chan->Amplitude_Delay_Counter = chan->Amplitude_Delay;
	LD	B,(IX+26)
	LD	(IX+27),B
?0409:
	JR	?0415
?0406:
; 1065.	                        }
; 1066.	                }
; 1067.	                else if(val == 0xfc)
	CP	252
	JR	NZ,?0412
?0411:
; 1068.	                {
; 1069.	                        ay_writeay(AY_ENV_SHAPE, 12);
	LD	C,12
	JR	?1307
?0412:
; 1070.	                }
; 1071.	                else if(val == 0xfe)
	INC	A
	INC	A
	JR	NZ,?0415
?0414:
; 1072.	                {
; 1073.	                        ay_writeay(AY_ENV_SHAPE, 14);
	LD	C,14
?1307:
	LD	E,13
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0415:
?0413:
?0410:
?0404:
?0401:
?0395:
?0392:
?0386:
?0383:
?0380:
?0377:
?0374:
?0371:
?0368:
?0365:
?0360:
?0357:
?0349:
?0341:
; 1074.	                }
; 1075.	                chan->Address_In_Pattern++;
	INC	(IX+12)
	JP	NZ,?0317
	INC	(IX+13)
	JP	LWRD ?0317
?0316:
; 1076.	        }
; 1077.	        chan->Note_Skip_Counter = chan->Number_Of_Notes_To_Skip;
	LD	B,(IX+20)
	LD	(IX+32),B
; 1078.	}
	POP	IX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1613:
	LD	E,(IX+28)
	LD	D,(IX+29)
	LD	BC,16
	JP	LWRD ?SS_DIV_L02
; 1079.	
; 1080.	void ASC_GetRegisters(AYSongInfo * info, ASC_Channel_Parameters * chan, unsigned char * TempMixer)
; 1081.	{
ASC_GetRegisters:
	PUSH	IY
	PUSH	IX
	PUSH	BC
	POP	IX
; 1082.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+108),HL
; 1083.	        signed char j;
; 1084.	        bool Sample_Says_OK_for_Envelope;
; 1085.	        if(chan->Sample_Finished || !chan->Sound_Enabled)
	LD	HL,36
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JR	NZ,?0418
	LD	A,(IX+35)
	OR	A
	JR	NZ,?0417
?0418:
?0419:
?0416:
; 1086.	                chan->Amplitude = 0;
	LD	(IX+25),0
; 1087.	        else
	JP	LWRD ?0486
?0417:
; 1088.	        {
; 1089.	                if(chan->Amplitude_Delay_Counter != 0)
	LD	A,(IX+27)
	OR	A
	JR	Z,?0430
?0421:
; 1090.	                {
; 1091.	                        if(chan->Amplitude_Delay_Counter >= 16)
	LD	A,(IX+27)
	CP	16
	JR	C,?0424
?0423:
; 1092.	                        {
; 1093.	                                chan->Amplitude_Delay_Counter -= 8;
	LD	HL,27
	PUSH	IX
	POP	BC
	ADD	HL,BC
	LD	A,(HL)
	SUB	8
	LD	(HL),A
; 1094.	                                if(chan->Addition_To_Amplitude < -15)
	LD	HL,33
	ADD	HL,BC
	LD	A,(HL)
	XOR	128
	CP	113
	JR	NC,?0426
?0425:
; 1095.	                                        chan->Addition_To_Amplitude++;
	INC	(IX+33)
	JR	?0430
?0426:
; 1096.	                                else if(chan->Addition_To_Amplitude > 15)
	LD	A,15
	SUB	(IX+33)
	JP	PO,?1331
	XOR	128
?1331:
	JP	P,?0430
?0428:
; 1097.	                                        chan->Addition_To_Amplitude--;
	DEC	(IX+33)
?0429:
?0427:
; 1098.	                        }
; 1099.	                        else
	JR	?0430
?0424:
; 1100.	                        {
; 1101.	                                if((chan->Amplitude_Delay_Counter & 1) != 0)
	BIT	0,(IX+27)
	JR	Z,?0432
?0431:
; 1102.	                                {
; 1103.	                                        if(chan->Addition_To_Amplitude > -15)
	LD	A,241
	SUB	(IX+33)
	JP	PO,?1332
	XOR	128
?1332:
	JP	P,?0437
?0433:
; 1104.	                                                chan->Addition_To_Amplitude--;
	DEC	(IX+33)
?0434:
	JR	?0437
?0432:
; 1105.	                                }
; 1106.	                                else if(chan->Addition_To_Amplitude < 15)
	LD	A,(IX+33)
	XOR	128
	CP	143
	JR	NC,?0437
?0436:
; 1107.	                                        chan->Addition_To_Amplitude++;
	INC	(IX+33)
?0437:
?0435:
; 1108.	                                chan->Amplitude_Delay_Counter = chan->Amplitude_Delay;
	LD	B,(IX+26)
	LD	(IX+27),B
?0430:
?0422:
; 1109.	                        }
; 1110.	                }
; 1111.	                if((module[chan->Point_In_Sample] & 128) != 0)
	LD	L,(IX+2)
	LD	H,(IX+3)
	LD	BC,(?0010+108)
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JP	P,?0439
?0438:
; 1112.	                        chan->Loop_Point_In_Sample = chan->Point_In_Sample;
	LD	L,(IX+2)
	LD	H,(IX+3)
	LD	(IX+4),L
	LD	(IX+5),H
?0439:
; 1113.	                if((module[chan->Point_In_Sample] & 96) == 32)
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	LD	A,(HL)
	AND	96
	CP	32
	JR	NZ,?0441
?0440:
; 1114.	                        chan->Sample_Finished = true;
	LD	(IX+36),1
?0441:
; 1115.	                chan->Ton_Deviation += (signed char)(module[chan->Point_In_Sample + 1]);
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	INC	HL
	LD	E,(HL)
	LD	A,E
	RLCA
	SBC	A,A
	LD	D,A
	LD	HL,16
	PUSH	IX
	POP	BC
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,E
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	ADC	A,D
	LD	(HL),A
; 1116.	                *TempMixer |= (module[chan->Point_In_Sample + 2] & 9) << 3;
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,A
	PUSH	HL
	INC	BC
	INC	BC
	LD	A,(BC)
	LD	L,A
	INC	BC
	LD	A,(BC)
	LD	H,A
	LD	BC,(?0010+108)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	A,(HL)
	AND	9
	ADD	A,A
	ADD	A,A
	ADD	A,A
	POP	HL
	OR	(HL)
	LD	(HL),A
; 1117.	                if((module[chan->Point_In_Sample + 2] & 6) == 2)
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	A,(HL)
	AND	6
	DEC	A
	DEC	A
	JR	NZ,?0443
?0442:
; 1118.	                        Sample_Says_OK_for_Envelope = true;
	LD	A,1
	JR	?1338
; 1119.	                else
?0443:
; 1120.	                        Sample_Says_OK_for_Envelope = false;
	XOR	A
?1338:
	LD	(?0010+111),A
?0444:
; 1121.	                if((module[chan->Point_In_Sample + 2] & 6) == 4)
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	A,(HL)
	AND	6
	CP	4
	JR	NZ,?0448
?0445:
; 1122.	                {
; 1123.	                        if(chan->Addition_To_Amplitude > -15)
	LD	A,241
	SUB	(IX+33)
	JP	PO,?1333
	XOR	128
?1333:
	JP	P,?0448
?0447:
; 1124.	                                chan->Addition_To_Amplitude--;
	DEC	(IX+33)
?0448:
?0446:
; 1125.	                }
; 1126.	                if((module[chan->Point_In_Sample + 2] & 6) == 6)
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	A,(HL)
	AND	6
	CP	6
	JR	NZ,?0452
?0449:
; 1127.	                {
; 1128.	                        if(chan->Addition_To_Amplitude < 15)
	LD	A,(IX+33)
	XOR	128
	CP	143
	JR	NC,?0452
?0451:
; 1129.	                                chan->Addition_To_Amplitude++;
	INC	(IX+33)
?0452:
?0450:
; 1130.	                }
; 1131.	                chan->Amplitude = chan->Addition_To_Amplitude + (module[chan->Point_In_Sample + 2] >> 4);
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	INC	HL
	INC	HL
	LD	A,(HL)
	RRA
	RRA
	RRA
	RRA
	AND	15
	ADD	A,(IX+33)
	LD	(IX+25),A
; 1132.	                if((signed char)(chan->Amplitude) < 0)
	LD	A,(IX+25)
	OR	A
	JP	P,?0454
?0453:
; 1133.	                        chan->Amplitude = 0;
	LD	(IX+25),0
	JR	?0457
?0454:
; 1134.	                else if(chan->Amplitude > 15)
	LD	A,15
	CP	(IX+25)
	JR	NC,?0457
?0456:
; 1135.	                        chan->Amplitude = 15;
	LD	(IX+25),A
?0457:
?0455:
; 1136.	                chan->Amplitude = (chan->Amplitude * (chan->Volume + 1)) >> 4;
	LD	C,(IX+23)
	LD	B,0
	INC	BC
	LD	E,(IX+25)
	LD	D,0
	CALL	LWRD ?S_MUL_L02
	LD	B,4
	CALL	LWRD ?SS_RSH_L02
	LD	(IX+25),E
; 1137.	                if(Sample_Says_OK_for_Envelope && ((*TempMixer & 64) != 0))
	LD	A,(?0010+111)
	OR	A
	JR	Z,?0459
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,A
	BIT	6,(HL)
	JR	Z,?0459
?0461:
?0460:
?0458:
; 1138.	                        ay_writeay(AY_ENV_FINE, ay_readay(AY_ENV_FINE) + ((signed char)(module[chan->Point_In_Sample] << 3) / 8));
	LD	E,11
	LD	A,BYTE3 ay_readay
	LD	HL,LWRD ay_readay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	PUSH	HL
	CALL	LWRD ?1614
	POP	HL
	ADD	A,L
	LD	C,A
	LD	E,11
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1139.	                else
	JR	?0462
?0459:
; 1140.	                        chan->Current_Noise += (signed char)(module[chan->Point_In_Sample] << 3) / 8;
	CALL	LWRD ?1614
	ADD	A,(IX+22)
	LD	(IX+22),A
?0462:
; 1141.	                chan->Point_In_Sample += 3;
	PUSH	IX
	POP	HL
	INC	HL
	INC	HL
	LD	A,(HL)
	ADD	A,3
	LD	(HL),A
	JR	NC,?1334
	INC	HL
	INC	(HL)
?1334:
; 1142.	                if((module[chan->Point_In_Sample - 3] & 64) != 0)
	LD	L,(IX+2)
	LD	H,(IX+3)
	LD	BC,(?0010+108)
	ADD	HL,BC
	DEC	HL
	DEC	HL
	DEC	HL
	BIT	6,(HL)
	JR	Z,?0469
?0463:
; 1143.	                {
; 1144.	                        if(!chan->Break_Sample_Loop)
	LD	A,(IX+37)
	OR	A
	JR	NZ,?0466
?0465:
; 1145.	                                chan->Point_In_Sample = chan->Loop_Point_In_Sample;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	(IX+2),L
	LD	(IX+3),H
	JR	?0469
?0466:
; 1146.	                        else if((module[chan->Point_In_Sample - 3] & 32) != 0)
	LD	L,(IX+2)
	LD	H,(IX+3)
	ADD	HL,BC
	DEC	HL
	DEC	HL
	DEC	HL
	BIT	5,(HL)
	JR	Z,?0469
?0468:
; 1147.	                                chan->Sample_Finished = true;
	LD	(IX+36),1
?0469:
?0467:
?0464:
; 1148.	                }
; 1149.	                if((module[chan->Point_In_Ornament] & 128) != 0)
	LD	L,(IX+8)
	LD	H,(IX+9)
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JP	P,?0471
?0470:
; 1150.	                        chan->Loop_Point_In_Ornament = chan->Point_In_Ornament;
	LD	L,(IX+8)
	LD	H,(IX+9)
	LD	(IX+10),L
	LD	(IX+11),H
?0471:
; 1151.	                chan->Addition_To_Note += module[chan->Point_In_Ornament + 1];
	LD	L,(IX+8)
	LD	H,(IX+9)
	ADD	HL,BC
	INC	HL
	LD	A,(IX+19)
	ADD	A,(HL)
	LD	(IX+19),A
; 1152.	                chan->Current_Noise += (-(signed char)(module[chan->Point_In_Ornament] & 0x10)) | module[chan->Point_In_Ornament];
	LD	L,(IX+8)
	LD	H,(IX+9)
	ADD	HL,BC
	LD	A,(HL)
	AND	16
	NEG
	LD	L,(IX+8)
	LD	H,(IX+9)
	ADD	HL,BC
	OR	(HL)
	ADD	A,(IX+22)
	LD	(IX+22),A
; 1153.	                chan->Point_In_Ornament += 2;
	LD	HL,8
	PUSH	IX
	POP	DE
	ADD	HL,DE
	LD	A,(HL)
	ADD	A,2
	LD	(HL),A
	JR	NC,?1335
	INC	HL
	INC	(HL)
?1335:
; 1154.	                if((module[chan->Point_In_Ornament - 2] & 64) != 0)
	LD	HL,8
	ADD	HL,DE
	LD	D,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,D
	ADD	HL,BC
	DEC	HL
	DEC	HL
	BIT	6,(HL)
	JR	Z,?0473
?0472:
; 1155.	                        chan->Point_In_Ornament = chan->Loop_Point_In_Ornament;
	LD	L,(IX+10)
	LD	H,(IX+11)
	LD	(IX+8),L
	LD	(IX+9),H
?0473:
; 1156.	                if((*TempMixer & 64) == 0)
	LD	HL,8
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,A
	BIT	6,(HL)
	JR	NZ,?0475
?0474:
; 1157.	                        ay_writeay(AY_NOISE_PERIOD, ((unsigned char)(chan->Current_Ton_Sliding >> 8) + chan->Current_Noise) & 0x1f);
	LD	E,(IX+28)
	LD	D,(IX+29)
	LD	B,8
	CALL	LWRD ?SS_RSH_L02
	LD	A,(IX+22)
	ADD	A,E
	AND	31
	LD	C,A
	LD	E,6
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0475:
; 1158.	                j = chan->Note + chan->Addition_To_Note;
	LD	A,(IX+19)
	ADD	A,(IX+18)
	LD	(?0010+110),A
; 1159.	                if(j < 0)
	JP	P,?0477
?0476:
; 1160.	                        j = 0;
	XOR	A
	JR	?1339
?0477:
; 1161.	                else if(j > 0x55)
	LD	B,A
	LD	A,85
	SUB	B
	JP	PO,?1336
	XOR	128
?1336:
	JP	P,?0480
?0479:
; 1162.	                        j = 0x55;
	LD	A,85
?1339:
	LD	(?0010+110),A
?0480:
?0478:
; 1163.	                chan->Ton = (ASM_Table[j] + chan->Ton_Deviation + (chan->Current_Ton_Sliding / 16)) & 0xfff;
	CALL	LWRD ?1613
	LD	L,(IX+16)
	LD	H,(IX+17)
	ADD	HL,DE
	PUSH	HL
	LD	HL,(?0010+110)
	LD	A,L
	RLCA
	SBC	A,A
	LD	H,A
	ADD	HL,HL
	LD	BC,ASM_Table
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	POP	HL
	ADD	HL,BC
	LD	A,H
	AND	15
	LD	H,A
	LD	(IX+14),L
	LD	(IX+15),H
; 1164.	                if(chan->Ton_Sliding_Counter != 0)
	LD	A,(IX+24)
	OR	A
	JR	Z,?0482
?0481:
; 1165.	                {
; 1166.	                        if((signed char)(chan->Ton_Sliding_Counter) > 0)
	XOR	A
	SUB	(IX+24)
	JP	PO,?1337
	XOR	128
?1337:
	JP	P,?0484
?0483:
; 1167.	                                chan->Ton_Sliding_Counter--;
	DEC	(IX+24)
?0484:
; 1168.	                        chan->Current_Ton_Sliding += chan->Substruction_for_Ton_Sliding;
	LD	HL,28
	PUSH	IX
	POP	BC
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,(IX+30)
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	ADC	A,(IX+31)
	LD	(HL),A
?0482:
; 1169.	                }
; 1170.	                if(chan->Envelope_Enabled && Sample_Says_OK_for_Envelope)
	LD	A,(IX+34)
	OR	A
	JR	Z,?0486
	LD	A,(?0010+111)
	OR	A
	JR	Z,?0486
?0488:
?0487:
?0485:
; 1171.	                        chan->Amplitude |= 0x10;
	SET	4,(IX+25)
?0486:
?0420:
; 1172.	        }
; 1173.	        *TempMixer = *TempMixer >> 1;
	JP	LWRD ?0168
?1614:
	LD	L,(IX+2)
	LD	H,(IX+3)
	LD	BC,(?0010+108)
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,A
	ADD	A,A
	ADD	A,A
	LD	B,8
	JP	LWRD ?SC_DIV_L01
; 1174.	}
; 1175.	
; 1176.	void ASC_Play_orig(AYSongInfo *info)
; 1177.	{
ASC_Play_orig:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 1178.	        unsigned short ascPatPt ;
; 1179.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+114),HL
; 1180.	        ASC1_File *header = (ASC1_File *)module;
	LD	(?0010+116),HL
; 1181.	        unsigned char TempMixer;
; 1182.	
; 1183.	        if(--ASC.DelayCounter <= 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JP	NZ,?0490
?0489:
; 1184.	        {
; 1185.	                if(--ASC_A.Note_Skip_Counter < 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,35
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	BIT	7,B
	JP	Z,?0492
?0491:
; 1186.	                {
; 1187.	                        if(module[ASC_A.Address_In_Pattern] == 255)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,15
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+114)
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JP	NZ,?0494
?0493:
; 1188.	                        {
; 1189.	                                if(++ASC.CurrentPosition >= header->ASC1_Number_Of_Positions)
	LD	HL,8
	LD	BC,(?0010+116)
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	INC	(HL)
	LD	A,(HL)
	POP	HL
	CP	(HL)
	JR	C,?0496
?0495:
; 1190.	                                        ASC.CurrentPosition = header->ASC1_LoopingPosition;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	PUSH	HL
	LD	HL,(?0010+116)
	INC	HL
	LD	B,(HL)
	POP	HL
	LD	(HL),B
?0496:
; 1191.	                                ascPatPt = ASC1_PatternsPointers;
	LD	HL,(?0010+116)
	INC	HL
	INC	HL
	LD	A,(HL)
	LD	B,0
	INC	HL
	LD	D,(HL)
	LD	L,A
	LD	A,B
	OR	D
	LD	H,A
	LD	(?0010+112),HL
; 1192.	                                //ASC_A.Address_In_Pattern = (*(unsigned short *)&module[ascPatPt + 6 * module[ASC.CurrentPosition + 9]]) + ascPatPt;
; 1193.	                                //ASC_B.Address_In_Pattern = (*(unsigned short *)&module[ascPatPt + 6 * module[ASC.CurrentPosition + 9] + 2]) + ascPatPt;
; 1194.	                                //ASC_C.Address_In_Pattern = (*(unsigned short *)&module[ascPatPt + 6 * module[ASC.CurrentPosition + 9] + 4]) + ascPatPt;
; 1195.	                                ASC_A.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[ASC.CurrentPosition + 9]]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,15
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	C,(HL)
	LD	HL,(?0010+114)
	ADD	HL,BC
	LD	C,9
	ADD	HL,BC
	LD	L,(HL)
	LD	H,B
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	BC,(?0010+112)
	ADD	HL,BC
	LD	DE,(?0010+114)
	ADD	HL,DE
	CALL	LWRD ?1583
	LD	BC,(?0010+112)
	ADD	HL,BC
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 1196.	                                ASC_B.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[ASC.CurrentPosition + 9] + 2]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,54
	ADD	HL,DE
	PUSH	HL
	PUSH	BC
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	E,(HL)
	LD	HL,(?0010+114)
	ADD	HL,DE
	LD	E,9
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	ADD	HL,BC
	LD	DE,(?0010+114)
	ADD	HL,DE
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	POP	BC
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1197.	                                ASC_C.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[ASC.CurrentPosition + 9] + 4]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,93
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	C,(HL)
	LD	HL,(?0010+114)
	ADD	HL,BC
	LD	C,9
	ADD	HL,BC
	LD	L,(HL)
	LD	H,B
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	BC,(?0010+112)
	ADD	HL,BC
	LD	DE,(?0010+114)
	ADD	HL,DE
	LD	DE,4
	ADD	HL,DE
	CALL	LWRD ?1583
	LD	BC,(?0010+112)
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1198.	                                ASC_A.Initial_Noise = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,24
	ADD	HL,BC
	LD	(HL),B
; 1199.	                                ASC_B.Initial_Noise = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,63
	ADD	HL,BC
	LD	(HL),B
; 1200.	                                ASC_C.Initial_Noise = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,102
	ADD	HL,BC
	LD	(HL),B
?0494:
; 1201.	                        }
; 1202.	                        ASC_PatternInterpreter(info, &ASC_A, 0);
	LD	HL,0
	PUSH	HL
	LD	C,(IX+4)
	LD	B,(IX+5)
	INC	BC
	INC	BC
	INC	BC
	CALL	LWRD ?1598
	POP	HL
?0492:
; 1203.	                }
; 1204.	                if(--ASC_B.Note_Skip_Counter < 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,74
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	BIT	7,B
	JR	Z,?0498
?0497:
; 1205.	                {
; 1206.	                        ASC_PatternInterpreter(info, &ASC_B, 0);
	LD	HL,0
	PUSH	HL
	CALL	LWRD ?1599
	POP	HL
?0498:
; 1207.	                }
; 1208.	                if(--ASC_C.Note_Skip_Counter < 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,113
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	BIT	7,B
	JR	Z,?0500
?0499:
; 1209.	                {
; 1210.	                        ASC_PatternInterpreter(info, &ASC_C, 0);
	LD	HL,0
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,81
	CALL	LWRD ?1600
	POP	HL
?0500:
; 1211.	                }
; 1212.	                ASC.DelayCounter = ASC.Delay;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	B,(HL)
	POP	HL
	LD	(HL),B
?0490:
; 1213.	        }
; 1214.	
; 1215.	        TempMixer = 0;
	XOR	A
	LD	(?0010+118),A
; 1216.	        ASC_GetRegisters(info, &ASC_A, &TempMixer);
	LD	HL,?0010+118
	PUSH	HL
	LD	C,(IX+4)
	LD	B,(IX+5)
	INC	BC
	INC	BC
	INC	BC
	CALL	LWRD ?1601
	POP	HL
; 1217.	        ASC_GetRegisters(info, &ASC_B, &TempMixer);
	LD	HL,?0010+118
	PUSH	HL
	CALL	LWRD ?1602
	POP	HL
; 1218.	        ASC_GetRegisters(info, &ASC_C, &TempMixer);
	LD	HL,?0010+118
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,81
	CALL	LWRD ?1603
	POP	HL
; 1219.	
; 1220.	        ay_writeay(AY_MIXER, TempMixer);
	LD	BC,(?0010+118)
	LD	E,7
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1221.	        ay_writeay(AY_CHNL_A_FINE, ASC_A.Ton & 0xff);
	CALL	LWRD ?1587
; 1222.	        ay_writeay(AY_CHNL_A_COARSE, (ASC_A.Ton >> 8) & 0xf);
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1223.	        ay_writeay(AY_CHNL_B_FINE, ASC_B.Ton & 0xff);
	CALL	LWRD ?1588
; 1224.	        ay_writeay(AY_CHNL_B_COARSE, (ASC_B.Ton >> 8) & 0xf);
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1225.	        ay_writeay(AY_CHNL_C_FINE, ASC_C.Ton & 0xff);
	CALL	LWRD ?1589
; 1226.	        ay_writeay(AY_CHNL_C_COARSE, (ASC_C.Ton >> 8) & 0xf);
	CALL	LWRD ?1590
; 1227.	        ay_writeay(AY_CHNL_A_VOL, ASC_A.Amplitude);
	CALL	LWRD ?1591
; 1228.	        ay_writeay(AY_CHNL_B_VOL, ASC_B.Amplitude);
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1229.	        ay_writeay(AY_CHNL_C_VOL, ASC_C.Amplitude);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,106
	JP	LWRD ?1575
?1599:
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,42
?1600:
	ADD	HL,BC
	LD	C,L
	LD	B,H
?1598:
	PUSH	IX
	POP	DE
	LD	A,BYTE3 ASC_PatternInterpreter
	LD	HL,LWRD ASC_PatternInterpreter
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1602:
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,42
?1603:
	ADD	HL,BC
	LD	C,L
	LD	B,H
?1601:
	PUSH	IX
	POP	DE
	LD	A,BYTE3 ASC_GetRegisters
	LD	HL,LWRD ASC_GetRegisters
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1230.	}
; 1231.	
; 1232.	
; 1233.	void AS0_Play(AYSongInfo *info)
; 1234.	{
AS0_Play:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 1235.	        unsigned short ascPatPt ;
; 1236.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+121),HL
; 1237.	        ASC0_File *header0 = (ASC0_File *)module;
	LD	(?0010+123),HL
; 1238.	        unsigned char TempMixer;
; 1239.	
; 1240.	        if(--ASC.DelayCounter <= 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	DEC	(HL)
	LD	B,(HL)
	INC	B
	DEC	B
	JP	NZ,?0502
?0501:
; 1241.	        {
; 1242.	                if(--ASC_A.Note_Skip_Counter < 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,35
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	BIT	7,B
	JP	Z,?0504
?0503:
; 1243.	                {
; 1244.	                        if(module[ASC_A.Address_In_Pattern] == 255)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,15
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	BC,(?0010+121)
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JP	NZ,?0506
?0505:
; 1245.	                        {
; 1246.	                                if(++ASC.CurrentPosition >= header0->ASC0_Number_Of_Positions)
	LD	HL,7
	LD	BC,(?0010+123)
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	INC	(HL)
	LD	A,(HL)
	POP	HL
	CP	(HL)
	JR	C,?0508
?0507:
; 1247.	                                        ASC.CurrentPosition = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	(HL),0
?0508:
; 1248.	                                ascPatPt = ASC0_PatternsPointers;
	LD	HL,(?0010+123)
	INC	HL
	LD	A,(HL)
	LD	B,0
	INC	HL
	LD	D,(HL)
	LD	L,A
	LD	A,B
	OR	D
	LD	H,A
	LD	(?0010+119),HL
; 1249.	
; 1250.	                                ASC_A.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[ASC.CurrentPosition + 8]]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,15
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	C,(HL)
	LD	HL,(?0010+121)
	ADD	HL,BC
	LD	C,8
	ADD	HL,BC
	LD	L,(HL)
	LD	H,B
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	BC,(?0010+119)
	ADD	HL,BC
	LD	DE,(?0010+121)
	ADD	HL,DE
	CALL	LWRD ?1583
	LD	BC,(?0010+119)
	ADD	HL,BC
	EX	DE,HL
	POP	HL
	LD	(HL),E
	INC	HL
	LD	(HL),D
; 1251.	                                ASC_B.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[ASC.CurrentPosition + 8] + 2]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	DE,54
	ADD	HL,DE
	PUSH	HL
	PUSH	BC
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	E,(HL)
	LD	HL,(?0010+121)
	ADD	HL,DE
	LD	E,8
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	ADD	HL,BC
	LD	DE,(?0010+121)
	ADD	HL,DE
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	POP	BC
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1252.	                                ASC_C.Address_In_Pattern = ay_sys_getword(&module[ascPatPt + 6 * module[ASC.CurrentPosition + 8] + 4]) + ascPatPt;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,93
	ADD	HL,BC
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	INC	HL
	LD	C,(HL)
	LD	HL,(?0010+121)
	ADD	HL,BC
	LD	C,8
	ADD	HL,BC
	LD	L,(HL)
	LD	H,B
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	BC,(?0010+119)
	ADD	HL,BC
	LD	DE,(?0010+121)
	ADD	HL,DE
	LD	DE,4
	ADD	HL,DE
	CALL	LWRD ?1583
	LD	BC,(?0010+119)
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1253.	                                ASC_A.Initial_Noise = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,24
	ADD	HL,BC
	LD	(HL),B
; 1254.	                                ASC_B.Initial_Noise = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,63
	ADD	HL,BC
	LD	(HL),B
; 1255.	                                ASC_C.Initial_Noise = 0;
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	C,102
	ADD	HL,BC
	LD	(HL),B
?0506:
; 1256.	                        }
; 1257.	                        ASC_PatternInterpreter(info, &ASC_A, 1);
	LD	HL,1
	PUSH	HL
	LD	C,(IX+4)
	LD	B,(IX+5)
	INC	BC
	INC	BC
	INC	BC
	CALL	LWRD ?1598
	POP	HL
?0504:
; 1258.	                }
; 1259.	                if(--ASC_B.Note_Skip_Counter < 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,74
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	BIT	7,B
	JR	Z,?0510
?0509:
; 1260.	                {
; 1261.	                        ASC_PatternInterpreter(info, &ASC_B, 1);
	LD	HL,1
	PUSH	HL
	CALL	LWRD ?1599
	POP	HL
?0510:
; 1262.	                }
; 1263.	                if(--ASC_C.Note_Skip_Counter < 0)
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,113
	ADD	HL,BC
	DEC	(HL)
	LD	B,(HL)
	BIT	7,B
	JR	Z,?0512
?0511:
; 1264.	                {
; 1265.	                        ASC_PatternInterpreter(info, &ASC_C, 1);
	LD	HL,1
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,81
	CALL	LWRD ?1600
	POP	HL
?0512:
; 1266.	                }
; 1267.	                ASC.DelayCounter = ASC.Delay;
	LD	L,(IX+4)
	LD	H,(IX+5)
	INC	HL
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	B,(HL)
	POP	HL
	LD	(HL),B
?0502:
; 1268.	        }
; 1269.	
; 1270.	        TempMixer = 0;
	XOR	A
	LD	(?0010+125),A
; 1271.	        ASC_GetRegisters(info, &ASC_A, &TempMixer);
	LD	HL,?0010+125
	PUSH	HL
	LD	C,(IX+4)
	LD	B,(IX+5)
	INC	BC
	INC	BC
	INC	BC
	CALL	LWRD ?1601
	POP	HL
; 1272.	        ASC_GetRegisters(info, &ASC_B, &TempMixer);
	LD	HL,?0010+125
	PUSH	HL
	CALL	LWRD ?1602
	POP	HL
; 1273.	        ASC_GetRegisters(info, &ASC_C, &TempMixer);
	LD	HL,?0010+125
	PUSH	HL
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,81
	CALL	LWRD ?1603
	POP	HL
; 1274.	
; 1275.	        ay_writeay(AY_MIXER, TempMixer);
	LD	BC,(?0010+125)
	LD	E,7
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1276.	        ay_writeay(AY_CHNL_A_FINE, ASC_A.Ton & 0xff);
	CALL	LWRD ?1587
; 1277.	        ay_writeay(AY_CHNL_A_COARSE, (ASC_A.Ton >> 8) & 0xf);
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1278.	        ay_writeay(AY_CHNL_B_FINE, ASC_B.Ton & 0xff);
	CALL	LWRD ?1588
; 1279.	        ay_writeay(AY_CHNL_B_COARSE, (ASC_B.Ton >> 8) & 0xf);
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1280.	        ay_writeay(AY_CHNL_C_FINE, ASC_C.Ton & 0xff);
	CALL	LWRD ?1589
; 1281.	        ay_writeay(AY_CHNL_C_COARSE, (ASC_C.Ton >> 8) & 0xf);
	CALL	LWRD ?1590
; 1282.	        ay_writeay(AY_CHNL_A_VOL, ASC_A.Amplitude);
	CALL	LWRD ?1591
; 1283.	        ay_writeay(AY_CHNL_B_VOL, ASC_B.Amplitude);
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1284.	        ay_writeay(AY_CHNL_C_VOL, ASC_C.Amplitude);
	LD	L,(IX+4)
	LD	H,(IX+5)
	LD	BC,106
	JP	LWRD ?1575
; 1285.	}
; 1286.	
; 1287.	void ASC_Play(AYSongInfo *info)
; 1288.	{
ASC_Play:
	PUSH	IX
; 1289.	
; 1290.	        if (pp==3)
	LD	HL,(pp)
	LD	A,3
	XOR	L
	OR	H
	JR	NZ,?0514
?0513:
; 1291.	                AS0_Play(info);
	LD	A,BYTE3 AS0_Play
	LD	HL,LWRD AS0_Play
	JR	?1341
; 1292.	        else      
?0514:
; 1293.	                ASC_Play_orig(info);    
	LD	A,BYTE3 ASC_Play_orig
	LD	HL,LWRD ASC_Play_orig
?1341:
	JP	LWRD ?1257
?0515:
; 1294.	
; 1295.	}
; 1296.	
; 1297.	void ASC_GetInfo_orig(AYSongInfo * info, int ASC0)
; 1298.	{
ASC_GetInfo_orig:
	PUSH	IY
	PUSH	IX
	PUSH	DE
	POP	IX
	PUSH	BC
	POP	IY
; 1299.	        unsigned short pp;
; 1300.	        unsigned char np;
; 1301.	        short a1, a2, a3, a11, a22, a33;
; 1302.	        unsigned long j1, j2, j3;
; 1303.	        bool env1, env2, env3;
; 1304.	        long i, tm = 0;
	LD	BC,0
	LD	(?0010+160),BC
	LD	(?0010+162),BC
; 1305.	        unsigned char b;
; 1306.	        unsigned char ascNumPos;
; 1307.	        unsigned short ascPatPt;
; 1308.	        unsigned char ascDelay;
; 1309.	        unsigned short ascLoopPos;
; 1310.	
; 1311.	        unsigned char *module = info->module;
	INC	DE
	INC	DE
	LD	A,(DE)
	LD	L,A
	INC	DE
	LD	A,(DE)
	LD	H,A
	LD	(?0010+171),HL
; 1312.	        ASC1_File *header = (ASC1_File *)module;
	LD	(?0010+173),HL
; 1313.	        ASC0_File *header0 = (ASC0_File *)module;
	LD	(?0010+175),HL
; 1314.	
; 1315.	
; 1316.	        if (!ASC0)
	LD	A,IYL
	OR	IYH
	LD	A,(HL)
	LD	(?0010+168),A
	JR	NZ,?0517
?0516:
; 1317.	        {
; 1318.	                ascDelay = header->ASC1_Delay;
; 1319.	                ascLoopPos = header->ASC1_LoopingPosition;
	INC	HL
	LD	C,(HL)
	LD	(?0010+169),BC
; 1320.	                ascPatPt = ASC1_PatternsPointers;
	INC	HL
	LD	C,(HL)
	INC	HL
	LD	D,(HL)
	LD	E,B
	LD	L,C
	LD	A,B
	OR	D
	LD	H,A
	LD	(?0010+166),HL
; 1321.	                ascNumPos = header->ASC1_Number_Of_Positions;
	LD	HL,8
	LD	BC,(?0010+173)
	JR	?1355
; 1322.	        }
; 1323.	        else
?0517:
; 1324.	        {
; 1325.	                ascDelay = header0->ASC0_Delay;
; 1326.	                ascLoopPos = 0;
	LD	L,C
	LD	H,C
	LD	(?0010+169),HL
; 1327.	                ascPatPt = ASC0_PatternsPointers;
	LD	HL,(?0010+175)
	INC	HL
	LD	C,(HL)
	INC	HL
	LD	D,(HL)
	LD	E,B
	LD	L,C
	LD	A,B
	OR	D
	LD	H,A
	LD	(?0010+166),HL
; 1328.	                ascNumPos = header0->ASC0_Number_Of_Positions;
	LD	HL,7
	LD	BC,(?0010+175)
?1355:
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+165),A
?0518:
; 1329.	        }
; 1330.	
; 1331.	
; 1332.	
; 1333.	        b = ascDelay;
	LD	A,(?0010+168)
	LD	(?0010+164),A
; 1334.	        a1 = a2 = a3 = a11 = a22 = a33 = 0;
	LD	L,E
	LD	H,E
	LD	(?0010+139),HL
	LD	(?0010+137),HL
	LD	(?0010+135),HL
	LD	(?0010+133),HL
	LD	(?0010+131),HL
	LD	(?0010+129),HL
; 1335.	        env1 = env2 = env3 = false;
	XOR	A
	LD	(?0010+155),A
	LD	(?0010+154),A
	LD	(?0010+153),A
; 1336.	        for(i = 0; i < ascNumPos; i++)
	LD	C,L
	LD	B,H
?1356:
	LD	(?0010+156),HL
	LD	(?0010+158),BC
?0520:
	LD	HL,(?0010+165)
	LD	BC,0
	LD	H,C
	PUSH	BC
	PUSH	HL
	LD	BC,(?0010+158)
	LD	HL,(?0010+156)
	CALL	LWRD ?SL_CMP_L03
	JP	NC,?0519
?0521:
; 1337.	        {
; 1338.	                // if(ascLoopPos == i)
; 1339.	                //   info->Loop = tm;
; 1340.	
; 1341.	                if (ASC0)
	LD	A,IYL
	OR	IYH
	LD	BC,(?0010+171)
	ADD	HL,BC
	JR	Z,?0524
?0523:
; 1342.	                {  
; 1343.	                        j1 = ay_sys_getword(&module[ascPatPt + 6 * module[i + 8]]) + ascPatPt;
	LD	DE,8
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+166)
	ADD	HL,DE
	CALL	LWRD ?1581
	PUSH	BC
	PUSH	HL
	LD	HL,(?0010+166)
	LD	DE,0
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	POP	BC
	ADC	HL,BC
	LD	C,L
	LD	B,H
	EX	DE,HL
	LD	(?0010+141),HL
	LD	(?0010+143),BC
; 1344.	                        j2 = ay_sys_getword(&module[ascPatPt + 6 * module[i + 8] + 2]) + ascPatPt;
	LD	HL,(?0010+156)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	DE,8
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+166)
	ADD	HL,DE
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	PUSH	BC
	PUSH	HL
	LD	HL,(?0010+166)
	LD	DE,0
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	POP	BC
	ADC	HL,BC
	LD	C,L
	LD	B,H
	EX	DE,HL
	LD	(?0010+145),HL
	LD	(?0010+147),BC
; 1345.	                        j3 = ay_sys_getword(&module[ascPatPt + 6 * module[i + 8] + 4]) + ascPatPt;
	LD	HL,(?0010+156)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	DE,8
	JR	?1357
; 1346.	                }
; 1347.	                else
?0524:
; 1348.	                {  
; 1349.	                        j1 = ay_sys_getword(&module[ascPatPt + 6 * module[i + 9]]) + ascPatPt;
	LD	DE,9
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+166)
	ADD	HL,DE
	CALL	LWRD ?1581
	PUSH	BC
	PUSH	HL
	LD	HL,(?0010+166)
	LD	DE,0
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	POP	BC
	ADC	HL,BC
	LD	C,L
	LD	B,H
	EX	DE,HL
	LD	(?0010+141),HL
	LD	(?0010+143),BC
; 1350.	                        j2 = ay_sys_getword(&module[ascPatPt + 6 * module[i + 9] + 2]) + ascPatPt;
	LD	HL,(?0010+156)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	DE,9
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+166)
	ADD	HL,DE
	ADD	HL,BC
	EX	DE,HL
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	PUSH	BC
	PUSH	HL
	LD	HL,(?0010+166)
	LD	DE,0
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	POP	BC
	ADC	HL,BC
	LD	C,L
	LD	B,H
	EX	DE,HL
	LD	(?0010+145),HL
	LD	(?0010+147),BC
; 1351.	                        j3 = ay_sys_getword(&module[ascPatPt + 6 * module[i + 9] + 4]) + ascPatPt;
	LD	HL,(?0010+156)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	DE,9
?1357:
	ADD	HL,DE
	LD	L,(HL)
	LD	H,D
	ADD	HL,HL
	LD	E,L
	LD	D,H
	ADD	HL,HL
	ADD	HL,DE
	LD	DE,(?0010+166)
	ADD	HL,DE
	ADD	HL,BC
	LD	BC,4
	CALL	LWRD ?1581
	PUSH	BC
	PUSH	HL
	LD	HL,(?0010+166)
	LD	DE,0
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	POP	BC
	ADC	HL,BC
	LD	C,L
	LD	B,H
	EX	DE,HL
	LD	(?0010+149),HL
	LD	(?0010+151),BC
?0525:
?0527:
; 1352.	                }
; 1353.	
; 1354.	
; 1355.	                while(true)
?0528:
; 1356.	                {
; 1357.	                        a1--;
	LD	HL,(?0010+129)
	DEC	HL
	LD	(?0010+129),HL
; 1358.	                        if(a1 < 0)
	BIT	7,H
	JP	Z,?0533
?0529:
; 1359.	                        {
; 1360.	                                if(module[j1] == 255)
	LD	HL,(?0010+141)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	B,(HL)
	INC	B
	JP	Z,?0526
?0531:
; 1361.	                                        break;
?0532:
?0534:
; 1362.	                                while(true)
?0535:
; 1363.	                                {
; 1364.	                                        unsigned char val = module[j1];
	LD	HL,(?0010+141)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+177),A
; 1365.	                                        if(val <= 0x55)
	LD	B,A
	LD	A,85
	CP	B
	JR	C,?0537
?0536:
; 1366.	                                        {
; 1367.	                                                a1 = a11;
	LD	HL,(?0010+135)
	LD	(?0010+129),HL
; 1368.	                                                j1++;
	LD	HL,(?0010+141)
	LD	BC,(?0010+143)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+141),HL
	LD	(?0010+143),BC
; 1369.	                                                if(env1)
	LD	A,(?0010+153)
	OR	A
	JP	Z,?0533
?0538:
; 1370.	                                                        j1++;
	JR	?1365
?0539:
; 1371.	                                                break;
?0537:
; 1372.	                                        }
; 1373.	                                        else if((val >= 0x56) && (val <= 0x5f))
	LD	A,B
	CP	86
	JR	C,?0541
	LD	B,A
	LD	A,95
	CP	B
	JR	C,?0541
?0543:
?0542:
?0540:
; 1374.	                                        {
; 1375.	                                                a1 = a11;
	LD	HL,(?0010+135)
	LD	(?0010+129),HL
; 1376.	                                                j1++;
	LD	HL,(?0010+141)
	LD	BC,(?0010+143)
?1365:
	CALL	LWRD ?L_INC_L03
	LD	(?0010+141),HL
	LD	(?0010+143),BC
; 1377.	                                                break;
	JP	LWRD ?0533
?0541:
; 1378.	                                        }
; 1379.	                                        else if((val >= 0x60) && (val <= 0x9f))
	LD	A,B
	CP	96
	JR	C,?0545
	LD	B,A
	LD	A,159
	CP	B
	JR	C,?0545
?0547:
?0546:
?0544:
; 1380.	                                        {
; 1381.	                                                a11 = val - 0x60;
	LD	C,B
	LD	B,0
	LD	HL,65440
	ADD	HL,BC
	LD	(?0010+135),HL
	JR	?0565
?0545:
; 1382.	                                        }
; 1383.	                                        else if(val == 0xe0)
	LD	A,B
	CP	224
	JR	NZ,?0550
?0549:
; 1384.	                                        {
; 1385.	                                                env1 = true;
	LD	A,1
	JR	?1358
?0550:
; 1386.	                                        }
; 1387.	                                        else if((val >= 0xe1) && (val <= 0xef))
	CP	225
	JR	C,?0553
	LD	B,A
	LD	A,239
	CP	B
	JR	C,?0553
?0555:
?0554:
?0552:
; 1388.	                                        {
; 1389.	                                                env1 = false;
	XOR	A
?1358:
	LD	(?0010+153),A
	JR	?0565
?0553:
; 1390.	                                        }
; 1391.	                                        else if((val == 0xf0) || ((val >= 0xf5) && (val <= 0xf7)) || (val == 0xf9) || (val == 0xfb))
	LD	A,B
	CP	240
	JR	Z,?0559
	CP	245
	JR	C,?0562
	LD	B,A
	LD	A,247
	CP	B
	JR	NC,?0559
?0562:
?0561:
	LD	A,B
	CP	249
	JR	Z,?0559
	CP	251
	JR	NZ,?0558
?0559:
?0560:
?0557:
; 1392.	                                        {
; 1393.	                                                j1++;
	LD	HL,(?0010+141)
	LD	BC,(?0010+143)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+141),HL
	LD	(?0010+143),BC
	JR	?0565
?0558:
; 1394.	                                        }
; 1395.	                                        else if(val == 0xf4)
	CP	244
	JR	NZ,?0565
?0564:
; 1396.	                                        {
; 1397.	                                                j1++;
	LD	HL,(?0010+141)
	LD	BC,(?0010+143)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+141),HL
	LD	(?0010+143),BC
; 1398.	                                                b = module[j1];
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+164),A
?0565:
?0563:
?0556:
?0551:
?0548:
; 1399.	                                        }
; 1400.	                                        j1++;
	LD	HL,(?0010+141)
	LD	BC,(?0010+143)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+141),HL
	LD	(?0010+143),BC
; 1401.	                                }
; 1402.	                        }
	JP	LWRD ?0532
?0533:
?0530:
; 1403.	
; 1404.	                        a2--;
	LD	HL,(?0010+131)
	DEC	HL
	LD	(?0010+131),HL
; 1405.	                        if(a2 < 0)
	BIT	7,H
	JP	Z,?0568
?0566:
?0569:
; 1406.	                        {
; 1407.	                                while(true)
?0570:
; 1408.	                                {
; 1409.	                                        unsigned char val = module[j2];
	LD	HL,(?0010+145)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+177),A
; 1410.	                                        if(val <= 0x55)
	LD	B,A
	LD	A,85
	CP	B
	JR	C,?0572
?0571:
; 1411.	                                        {
; 1412.	                                                a2 = a22;
	LD	HL,(?0010+137)
	LD	(?0010+131),HL
; 1413.	                                                j2++;
	LD	HL,(?0010+145)
	LD	BC,(?0010+147)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+145),HL
	LD	(?0010+147),BC
; 1414.	                                                if(env2)
	LD	A,(?0010+154)
	OR	A
	JP	Z,?0568
?0573:
; 1415.	                                                        j2++;
	JR	?1366
?0574:
; 1416.	                                                break;
?0572:
; 1417.	                                        }
; 1418.	                                        else if((val >= 0x56) && (val <= 0x5f))
	LD	A,B
	CP	86
	JR	C,?0576
	LD	B,A
	LD	A,95
	CP	B
	JR	C,?0576
?0578:
?0577:
?0575:
; 1419.	                                        {
; 1420.	                                                a2 = a22;
	LD	HL,(?0010+137)
	LD	(?0010+131),HL
; 1421.	                                                j2++;
	LD	HL,(?0010+145)
	LD	BC,(?0010+147)
?1366:
	CALL	LWRD ?L_INC_L03
	LD	(?0010+145),HL
	LD	(?0010+147),BC
; 1422.	                                                break;
	JP	LWRD ?0568
?0576:
; 1423.	                                        }
; 1424.	                                        else if((val >= 0x60) && (val <= 0x9f))
	LD	A,B
	CP	96
	JR	C,?0580
	LD	B,A
	LD	A,159
	CP	B
	JR	C,?0580
?0582:
?0581:
?0579:
; 1425.	                                        {
; 1426.	                                                a22 = val - 0x60;
	LD	C,B
	LD	B,0
	LD	HL,65440
	ADD	HL,BC
	LD	(?0010+137),HL
	JR	?0600
?0580:
; 1427.	                                        }
; 1428.	                                        else if(val == 0xe0)
	LD	A,B
	CP	224
	JR	NZ,?0585
?0584:
; 1429.	                                        {
; 1430.	                                                env2 = true;
	LD	A,1
	JR	?1359
?0585:
; 1431.	                                        }
; 1432.	                                        else if((val >= 0xe1) && (val <= 0xef))
	CP	225
	JR	C,?0588
	LD	B,A
	LD	A,239
	CP	B
	JR	C,?0588
?0590:
?0589:
?0587:
; 1433.	                                        {
; 1434.	                                                env2 = false;
	XOR	A
?1359:
	LD	(?0010+154),A
	JR	?0600
?0588:
; 1435.	                                        }
; 1436.	                                        else if((val == 0xf0) || ((val >= 0xf5) && (val <= 0xf7)) || (val == 0xf9) || (val == 0xfb))
	LD	A,B
	CP	240
	JR	Z,?0594
	CP	245
	JR	C,?0597
	LD	B,A
	LD	A,247
	CP	B
	JR	NC,?0594
?0597:
?0596:
	LD	A,B
	CP	249
	JR	Z,?0594
	CP	251
	JR	NZ,?0593
?0594:
?0595:
?0592:
; 1437.	                                        {
; 1438.	                                                j2++;
	LD	HL,(?0010+145)
	LD	BC,(?0010+147)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+145),HL
	LD	(?0010+147),BC
	JR	?0600
?0593:
; 1439.	                                        }
; 1440.	                                        else if(val == 0xf4)
	CP	244
	JR	NZ,?0600
?0599:
; 1441.	                                        {
; 1442.	                                                j2++;
	LD	HL,(?0010+145)
	LD	BC,(?0010+147)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+145),HL
	LD	(?0010+147),BC
; 1443.	                                                b = module[j2];
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+164),A
?0600:
?0598:
?0591:
?0586:
?0583:
; 1444.	                                        }
; 1445.	                                        j2++;
	LD	HL,(?0010+145)
	LD	BC,(?0010+147)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+145),HL
	LD	(?0010+147),BC
; 1446.	                                }
; 1447.	                        }
	JP	LWRD ?0566
?0568:
?0567:
; 1448.	
; 1449.	                        a3--;
	LD	HL,(?0010+133)
	DEC	HL
	LD	(?0010+133),HL
; 1450.	                        if(a3 < 0)
	BIT	7,H
	JP	Z,?0603
?0601:
?0604:
; 1451.	                        {
; 1452.	                                while(true)
?0605:
; 1453.	                                {
; 1454.	                                        unsigned char val = (unsigned char)module[j3];
	LD	HL,(?0010+149)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+177),A
; 1455.	                                        if(val <= 0x55)
	LD	B,A
	LD	A,85
	CP	B
	JR	C,?0607
?0606:
; 1456.	                                        {
; 1457.	                                                a3 = a33;
	LD	HL,(?0010+139)
	LD	(?0010+133),HL
; 1458.	                                                j3++;
	LD	HL,(?0010+149)
	LD	BC,(?0010+151)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+149),HL
	LD	(?0010+151),BC
; 1459.	                                                if(env3)
	LD	A,(?0010+155)
	OR	A
	JP	Z,?0603
?0608:
; 1460.	                                                        j3++;
	JR	?1367
?0609:
; 1461.	                                                break;
?0607:
; 1462.	                                        }
; 1463.	                                        else if((val >= 0x56) && (val <= 0x5f))
	LD	A,B
	CP	86
	JR	C,?0611
	LD	B,A
	LD	A,95
	CP	B
	JR	C,?0611
?0613:
?0612:
?0610:
; 1464.	                                        {
; 1465.	                                                a3 = a33;
	LD	HL,(?0010+139)
	LD	(?0010+133),HL
; 1466.	                                                j3++;
	LD	HL,(?0010+149)
	LD	BC,(?0010+151)
?1367:
	CALL	LWRD ?L_INC_L03
	LD	(?0010+149),HL
	LD	(?0010+151),BC
; 1467.	                                                break;
	JP	LWRD ?0603
?0611:
; 1468.	                                        }
; 1469.	                                        else if((val >= 0x60) && (val <= 0x9f))
	LD	A,B
	CP	96
	JR	C,?0615
	LD	B,A
	LD	A,159
	CP	B
	JR	C,?0615
?0617:
?0616:
?0614:
; 1470.	                                        {
; 1471.	                                                a33 = val - 0x60;
	LD	C,B
	LD	B,0
	LD	HL,65440
	ADD	HL,BC
	LD	(?0010+139),HL
	JR	?0635
?0615:
; 1472.	                                        }
; 1473.	                                        else if(val == 0xe0)
	LD	A,B
	CP	224
	JR	NZ,?0620
?0619:
; 1474.	                                        {
; 1475.	                                                env3 = true;
	LD	A,1
	JR	?1360
?0620:
; 1476.	                                        }
; 1477.	                                        else if((val >= 0xe1) && (val <= 0xef))
	CP	225
	JR	C,?0623
	LD	B,A
	LD	A,239
	CP	B
	JR	C,?0623
?0625:
?0624:
?0622:
; 1478.	                                        {
; 1479.	                                                env3 = false;
	XOR	A
?1360:
	LD	(?0010+155),A
	JR	?0635
?0623:
; 1480.	                                        }
; 1481.	                                        else if((val == 0xf0) || ((val >= 0xf5) && (val <= 0xf7)) || (val == 0xf9) || (val == 0xfb))
	LD	A,B
	CP	240
	JR	Z,?0629
	CP	245
	JR	C,?0632
	LD	B,A
	LD	A,247
	CP	B
	JR	NC,?0629
?0632:
?0631:
	LD	A,B
	CP	249
	JR	Z,?0629
	CP	251
	JR	NZ,?0628
?0629:
?0630:
?0627:
; 1482.	                                        {
; 1483.	                                                j3++;
	LD	HL,(?0010+149)
	LD	BC,(?0010+151)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+149),HL
	LD	(?0010+151),BC
	JR	?0635
?0628:
; 1484.	                                        }
; 1485.	                                        else if(val == 0xf4)
	CP	244
	JR	NZ,?0635
?0634:
; 1486.	                                        {
; 1487.	                                                j3++;
	LD	HL,(?0010+149)
	LD	BC,(?0010+151)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+149),HL
	LD	(?0010+151),BC
; 1488.	                                                b = module[j3];
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+164),A
?0635:
?0633:
?0626:
?0621:
?0618:
; 1489.	                                        }
; 1490.	                                        j3++;
	LD	HL,(?0010+149)
	LD	BC,(?0010+151)
	CALL	LWRD ?L_INC_L03
	LD	(?0010+149),HL
	LD	(?0010+151),BC
; 1491.	                                }
; 1492.	                        }
	JP	LWRD ?0601
?0603:
?0602:
; 1493.	                        tm += b;
	LD	HL,?0010+160
	LD	DE,(?0010+164)
	LD	BC,0
	LD	D,C
	CALL	LWRD ?L_ADDASG_L03
; 1494.	                }
; 1495.	        }
	JP	LWRD ?0525
?0526:
	LD	HL,(?0010+156)
	LD	BC,(?0010+158)
	CALL	LWRD ?L_INC_L03
	JP	LWRD ?1356
?0519:
; 1496.	
; 1497.	        info->len = tm;
	LD	HL,(?0010+160)
	LD	(IX+99),L
	LD	(IX+100),H
; 1498.	
; 1499.	        pp = ay_sys_getword(&module [2]);
	LD	DE,(?0010+171)
	INC	DE
	INC	DE
	CALL	LWRD ?1582
	LD	(?0010+126),HL
; 1500.	        np = module [8];
	LD	HL,8
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+128),A
; 1501.	        if((pp - np) == 72)
	LD	C,A
	LD	B,0
	LD	HL,(?0010+126)
	AND	A
	SBC	HL,BC
	LD	A,72
	XOR	L
	OR	H
	JR	NZ,?0637
?0636:
; 1502.	        {
; 1503.	                strncpy(info->Name, &module [pp - 44], 20);
	LD	HL,20
	PUSH	HL
	LD	HL,(?0010+126)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	DE,65492
	ADD	HL,DE
	LD	C,L
	LD	B,H
	LD	HL,8
	CALL	LWRD ?1609
	POP	AF
; 1504.	                strncpy(info->Autor,&module [pp - 20], 20);
	LD	HL,20
	PUSH	HL
	LD	HL,(?0010+126)
	LD	BC,(?0010+171)
	ADD	HL,BC
	LD	BC,65516
	CALL	LWRD ?1610
	POP	AF
?0637:
; 1505.	        }
; 1506.	}
	POP	IX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1507.	
; 1508.	void ASC_GetInfo(AYSongInfo * info)
; 1509.	{
ASC_GetInfo:
	PUSH	BC
	PUSH	IX
; 1510.	
; 1511.	
; 1512.	        if (pp==3)   
	LD	HL,(pp)
	LD	A,3
	XOR	L
	OR	H
	JR	NZ,?0639
?0638:
; 1513.	                ASC_GetInfo_orig(info, 1);
	LD	BC,1
	JR	?1369
; 1514.	        else
?0639:
; 1515.	                ASC_GetInfo_orig(info, 0);
	LD	BC,0
?1369:
	LD	A,BYTE3 ASC_GetInfo_orig
	LD	HL,LWRD ASC_GetInfo_orig
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0640:
; 1516.	
; 1517.	}
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1518.	
; 1519.	
; 1520.	bool ASC1_Detect(unsigned char *module, unsigned long length)
; 1521.	{
ASC1_Detect:
	PUSH	BC
	PUSH	IY
	PUSH	IX
	LD	IX,0
	ADD	IX,SP
	PUSH	DE
	POP	IY
; 1522.	        //INT
; 1523.	        int j;
; 1524.	        int j1;
; 1525.	
; 1526.	        unsigned char j3;
; 1527.	        int delta;
; 1528.	        ASC1_File *header = (ASC1_File *)module;
	LD	(?0010+185),DE
; 1529.	
; 1530.	
; 1531.	
; 1532.	        if(length < 9)
	AND	A
	LD	L,(IX+10)
	LD	H,(IX+11)
	LD	BC,9
	SBC	HL,BC
	LD	L,(IX+12)
	LD	H,(IX+13)
	LD	C,B
	SBC	HL,BC
	JP	C,?1382
?0641:
; 1533.	                return false;
?0642:
; 1534.	        delta = ASC1_PatternsPointers - header->ASC1_Number_Of_Positions;
	LD	HL,8
	LD	C,E
	LD	B,D
	ADD	HL,BC
	LD	E,(HL)
	LD	D,0
	PUSH	DE
	LD	L,C
	LD	H,B
	INC	HL
	INC	HL
	LD	E,(HL)
	LD	A,D
	LD	HL,(?0010+185)
	INC	HL
	INC	HL
	INC	HL
	LD	H,(HL)
	OR	H
	LD	D,A
	EX	DE,HL
	POP	DE
	SBC	HL,DE
	LD	(?0010+183),HL
; 1535.	        if(delta < 9 || delta > 72)
	LD	BC,32777
	LD	A,B
	XOR	H
	LD	H,A
	SBC	HL,BC
	JP	C,?1382
	LD	BC,(?0010+183)
	LD	HL,72
	OR	128
	SBC	HL,BC
	JP	PO,?1370
	XOR	H
?1370:
	JP	M,?1382
?0645:
?0646:
?0643:
; 1536.	                return false;
?0644:
; 1537.	        if(ASC1_PatternsPointers> length)
	LD	HL,(?0010+185)
	INC	HL
	INC	HL
	LD	C,(HL)
	XOR	A
	INC	HL
	LD	D,(HL)
	LD	L,C
	OR	D
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	AND	A
	LD	L,(IX+10)
	LD	H,(IX+11)
	POP	BC
	SBC	HL,BC
	LD	L,(IX+12)
	LD	H,(IX+13)
	POP	BC
	SBC	HL,BC
	JP	C,?1382
?0647:
; 1538.	                return false;
?0648:
; 1539.	        if(ASC1_SamplesPointers> length)
	LD	HL,4
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	E,(HL)
	LD	D,0
	LD	A,D
	LD	HL,5
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	AND	A
	LD	L,(IX+10)
	LD	H,(IX+11)
	POP	BC
	SBC	HL,BC
	LD	L,(IX+12)
	LD	H,(IX+13)
	POP	BC
	SBC	HL,BC
	JP	C,?1382
?0649:
; 1540.	                return false;
?0650:
; 1541.	        if(ASC1_OrnamentsPointers> length)
	LD	HL,6
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	E,(HL)
	LD	HL,7
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	LD	A,D
	OR	B
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	AND	A
	LD	L,(IX+10)
	LD	H,(IX+11)
	POP	BC
	SBC	HL,BC
	LD	L,(IX+12)
	LD	H,(IX+13)
	POP	BC
	SBC	HL,BC
	JP	C,?1382
?0651:
; 1542.	                return false;
?0652:
; 1543.	
; 1544.	
; 1545.	
; 1546.	        j = ay_sys_getword(&module[ASC1_SamplesPointers]);
	LD	HL,4
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	E,(HL)
	LD	HL,5
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	LD	A,D
	OR	B
	LD	H,A
	PUSH	IY
	POP	BC
	CALL	LWRD ?1581
	LD	(?0010+178),HL
; 1547.	        if(j != 0x40)
	LD	A,64
	XOR	L
	OR	H
	JP	NZ,?1382
?0653:
; 1548.	                return false;
?0654:
; 1549.	        j = ay_sys_getword(&module[ASC1_OrnamentsPointers]);
	LD	HL,6
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	E,(HL)
	LD	HL,7
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
	PUSH	IY
	POP	BC
	CALL	LWRD ?1581
	LD	(?0010+178),HL
; 1550.	        if(j != 0x40)
	LD	A,64
	XOR	L
	OR	H
	JP	NZ,?1382
?0655:
; 1551.	                return false;
?0656:
; 1552.	
; 1553.	
; 1554.	
; 1555.	        j3 = 0;
	LD	(?0010+182),A
; 1556.	        for(j1 = 0; j1 < header->ASC1_Number_Of_Positions; j1++)
	LD	L,A
	LD	H,A
?1372:
	LD	(?0010+180),HL
?0658:
	LD	HL,8
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	C,(HL)
	LD	B,0
	LD	HL,(?0010+180)
	OR	128
	SBC	HL,BC
	JP	PO,?1371
	XOR	H
?1371:
	JP	P,?0657
?0659:
; 1557.	                if(j3 < header->ASC1_Positions[j1])
	LD	HL,(?0010+180)
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	BC,9
	ADD	HL,BC
	LD	A,(?0010+182)
	CP	(HL)
	JR	NC,?0662
?0661:
; 1558.	                        j3 = header->ASC1_Positions[j1];
	LD	HL,(?0010+180)
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	BC,9
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+182),A
?0662:
	LD	HL,(?0010+180)
	INC	HL
	JR	?1372
?0657:
; 1559.	
; 1560.	        j = ay_sys_getword(&module[ASC1_PatternsPointers]);
	LD	HL,(?0010+185)
	INC	HL
	INC	HL
	LD	C,(HL)
	INC	HL
	LD	D,(HL)
	LD	L,C
	LD	A,B
	OR	D
	LD	H,A
	PUSH	IY
	POP	BC
	CALL	LWRD ?1581
	LD	(?0010+178),HL
; 1561.	        if(j != (j3 + 1) * 6)
	PUSH	HL
	LD	HL,(?0010+182)
	LD	H,0
	INC	HL
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	AND	A
	SBC	HL,BC
	JP	NZ,?1382
?0663:
; 1562.	                return false;
?0664:
; 1563.	
; 1564.	
; 1565.	
; 1566.	        j = ay_sys_getword(&module[ASC1_OrnamentsPointers + 0x40 - 2]);
	LD	HL,6
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,7
	ADD	HL,BC
	LD	H,(HL)
	LD	C,E
	OR	H
	LD	B,A
	PUSH	IY
	POP	HL
	ADD	HL,BC
	LD	BC,62
	CALL	LWRD ?1581
	LD	(?0010+178),HL
; 1567.	        j += ASC1_OrnamentsPointers;
	LD	HL,6
	LD	BC,(?0010+185)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,7
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
?1373:
	LD	BC,(?0010+178)
	ADD	HL,BC
	LD	(?0010+178),HL
?0666:
; 1568.	        while((j < length) && (j < 65535) && ((module[j] & 0x40) == 0))
	LD	A,H
	RLCA
	SBC	A,A
	LD	E,A
	LD	D,E
	AND	A
	LD	C,(IX+10)
	LD	B,(IX+11)
	SBC	HL,BC
	EX	DE,HL
	LD	C,(IX+12)
	LD	B,(IX+13)
	SBC	HL,BC
	JR	NC,?0665
	LD	HL,0
	PUSH	HL
	DEC	HL
	PUSH	HL
	LD	HL,(?0010+178)
	LD	A,H
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	CALL	LWRD ?SL_CMP_L03
	JR	NC,?0665
	PUSH	IY
	POP	BC
	ADD	HL,BC
	BIT	6,(HL)
	JR	NZ,?0665
?0669:
?0668:
?0667:
; 1569.	                j += 2;
	LD	HL,2
	JR	?1373
?0665:
; 1570.	
; 1571.	        if(j > 65534)
	LD	HL,(?0010+178)
	LD	A,H
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	LD	BC,0
	LD	HL,65534
	CALL	LWRD ?SL_CMP_L03
	JR	C,?1382
?0670:
; 1572.	                return false;    
?0671:
; 1573.	
; 1574.	        if(j >= (length+512))
	INC	HL
	INC	HL
	PUSH	HL
	LD	H,2
	PUSH	HL
	LD	L,(IX+10)
	LD	H,(IX+11)
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	LD	L,(IX+12)
	LD	H,(IX+13)
	POP	BC
	ADC	HL,BC
	PUSH	HL
	PUSH	DE
	LD	HL,(?0010+178)
	LD	A,H
	RLCA
	SBC	A,A
	LD	E,A
	LD	D,E
	AND	A
	POP	BC
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	SBC	HL,BC
	JR	C,?0673
?0672:
; 1575.	                return false;
?1382:
	LD	L,0
	JR	?0674
?0673:
; 1576.	
; 1577.	
; 1578.	        return true;
	LD	L,1
; 1579.	}
?0674:
	LD	SP,IX
	POP	IX
	POP	IY
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1580.	
; 1581.	
; 1582.	bool ASC0_Detect(unsigned char *module, unsigned long length)
; 1583.	{
ASC0_Detect:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 1584.	        int j;
; 1585.	        int j1;
; 1586.	        unsigned char j3;
; 1587.	        //int delta;
; 1588.	        ASC0_File *header0 = (ASC0_File *)module;
	LD	(?0010+192),DE
; 1589.	
; 1590.	
; 1591.	
; 1592.	        //if(length < 9)
; 1593.	        //    return false;
; 1594.	
; 1595.	        // delta = ASC0_PatternsPointers - header0->ASC0_Number_Of_Positions;
; 1596.	        // if(delta < 9 || delta > 72)
; 1597.	        //    return false;
; 1598.	
; 1599.	        //return 1;    
; 1600.	
; 1601.	        if(ASC0_PatternsPointers> length)
	LD	L,(IX+1)
	XOR	A
	LD	D,(IX+2)
	OR	D
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	LD	HL,12
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	INC	HL
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	LD	L,C
	LD	H,B
	AND	A
	POP	BC
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	SBC	HL,BC
	JP	C,?1415
?0675:
; 1602.	                return false;
?0676:
; 1603.	        if(ASC0_SamplesPointers> length)
	LD	HL,(?0010+192)
	INC	HL
	INC	HL
	INC	HL
	LD	C,(HL)
	XOR	A
	LD	HL,4
	LD	DE,(?0010+192)
	ADD	HL,DE
	LD	D,(HL)
	LD	L,C
	OR	D
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	LD	HL,12
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	INC	HL
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	LD	L,C
	LD	H,B
	AND	A
	POP	BC
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	SBC	HL,BC
	JP	C,?1415
?0677:
; 1604.	                return false;
?0678:
; 1605.	        if(ASC0_OrnamentsPointers> length)
	LD	HL,5
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,6
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	LD	HL,12
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	INC	HL
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	LD	L,C
	LD	H,B
	AND	A
	POP	BC
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	SBC	HL,BC
	JP	C,?1415
?0679:
; 1606.	                return false;
?0680:
; 1607.	
; 1608.	
; 1609.	
; 1610.	        j = ay_sys_getword(&module[ASC0_SamplesPointers]);
	LD	HL,(?0010+192)
	INC	HL
	INC	HL
	INC	HL
	LD	C,(HL)
	XOR	A
	LD	HL,4
	LD	DE,(?0010+192)
	ADD	HL,DE
	LD	D,(HL)
	LD	L,C
	OR	D
	LD	H,A
	PUSH	IX
	POP	BC
	CALL	LWRD ?1581
	LD	(?0010+187),HL
; 1611.	        if(j != 0x40)
	LD	A,64
	XOR	L
	OR	H
	JP	NZ,?1415
?0681:
; 1612.	                return false;
?0682:
; 1613.	        j = ay_sys_getword(&module[ASC0_OrnamentsPointers]);
	LD	HL,5
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	E,(HL)
	LD	HL,6
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
	PUSH	IX
	POP	BC
	CALL	LWRD ?1581
	LD	(?0010+187),HL
; 1614.	        if(j != 0x40)
	LD	A,64
	XOR	L
	OR	H
	JP	NZ,?1415
?0683:
; 1615.	                return false;
?0684:
; 1616.	
; 1617.	
; 1618.	
; 1619.	        j3 = 0;
	LD	(?0010+191),A
; 1620.	        for(j1 = 0; j1 < header0->ASC0_Number_Of_Positions; j1++)
	LD	L,A
	LD	H,A
?1407:
	LD	(?0010+189),HL
?0686:
	LD	HL,7
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	C,(HL)
	LD	B,0
	LD	HL,(?0010+189)
	OR	128
	SBC	HL,BC
	JP	PO,?1406
	XOR	H
?1406:
	JP	P,?0685
?0687:
; 1621.	                if(j3 < header0->ASC0_Positions[j1])
	LD	HL,(?0010+189)
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	BC,8
	ADD	HL,BC
	LD	A,(?0010+191)
	CP	(HL)
	JR	NC,?0690
?0689:
; 1622.	                        j3 = header0->ASC0_Positions[j1];
	LD	HL,(?0010+189)
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	BC,8
	ADD	HL,BC
	LD	A,(HL)
	LD	(?0010+191),A
?0690:
	LD	HL,(?0010+189)
	INC	HL
	JR	?1407
?0685:
; 1623.	
; 1624.	        j = ay_sys_getword(&module[ASC0_PatternsPointers]);
	LD	HL,(?0010+192)
	INC	HL
	LD	C,(HL)
	INC	HL
	LD	D,(HL)
	LD	L,C
	LD	A,B
	OR	D
	LD	H,A
	PUSH	IX
	POP	BC
	CALL	LWRD ?1581
	LD	(?0010+187),HL
; 1625.	        if(j != (j3 + 1) * 6)
	PUSH	HL
	LD	HL,(?0010+191)
	LD	H,0
	INC	HL
	ADD	HL,HL
	LD	C,L
	LD	B,H
	ADD	HL,HL
	ADD	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	AND	A
	SBC	HL,BC
	JP	NZ,?1415
?0691:
; 1626.	                return false;
?0692:
; 1627.	
; 1628.	
; 1629.	
; 1630.	        j = ay_sys_getword(&module[ASC0_OrnamentsPointers + 0x40 - 2]);
	LD	HL,5
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,6
	ADD	HL,BC
	LD	H,(HL)
	LD	C,E
	OR	H
	LD	B,A
	PUSH	IX
	POP	HL
	ADD	HL,BC
	LD	BC,62
	CALL	LWRD ?1581
	LD	(?0010+187),HL
; 1631.	        j += ASC0_OrnamentsPointers;
	LD	HL,5
	LD	BC,(?0010+192)
	ADD	HL,BC
	LD	E,(HL)
	XOR	A
	LD	HL,6
	ADD	HL,BC
	LD	B,(HL)
	LD	L,E
	OR	B
	LD	H,A
?1408:
	LD	BC,(?0010+187)
	ADD	HL,BC
	LD	(?0010+187),HL
?0694:
; 1632.	        while((j < length) && (j < 65535) && ((module[j] & 0x40) == 0))
	LD	HL,8
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	INC	HL
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	PUSH	DE
	PUSH	BC
	LD	HL,(?0010+187)
	LD	A,H
	RLCA
	SBC	A,A
	LD	E,A
	LD	D,E
	AND	A
	POP	BC
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	SBC	HL,BC
	JR	NC,?0693
	LD	HL,0
	PUSH	HL
	DEC	HL
	PUSH	HL
	LD	HL,(?0010+187)
	LD	A,H
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	CALL	LWRD ?SL_CMP_L03
	JR	NC,?0693
	PUSH	IX
	POP	BC
	ADD	HL,BC
	BIT	6,(HL)
	JR	NZ,?0693
?0697:
?0696:
?0695:
; 1633.	                j += 2;
	LD	HL,2
	JR	?1408
?0693:
; 1634.	
; 1635.	        if(j > 65534)
	LD	HL,(?0010+187)
	LD	A,H
	RLCA
	SBC	A,A
	LD	C,A
	LD	B,C
	PUSH	BC
	PUSH	HL
	LD	BC,0
	LD	HL,65534
	CALL	LWRD ?SL_CMP_L03
	JR	C,?1415
?0698:
; 1636.	                return false;    
?0699:
; 1637.	
; 1638.	        if(j >= (length+512))
	INC	HL
	INC	HL
	PUSH	HL
	LD	H,2
	PUSH	HL
	LD	HL,12
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	INC	HL
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	LD	L,C
	LD	H,B
	POP	BC
	ADD	HL,BC
	EX	DE,HL
	POP	BC
	ADC	HL,BC
	PUSH	HL
	PUSH	DE
	LD	HL,(?0010+187)
	LD	A,H
	RLCA
	SBC	A,A
	LD	E,A
	LD	D,E
	AND	A
	POP	BC
	SBC	HL,BC
	EX	DE,HL
	POP	BC
	SBC	HL,BC
	JR	C,?0701
?0700:
; 1639.	                return false;
?1415:
	LD	L,0
	JR	?0702
?0701:
; 1640.	
; 1641.	        pp=3;
	LD	HL,3
	LD	(pp),HL
; 1642.	
; 1643.	        return true;
	LD	L,1
; 1644.	}
?0702:
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1645.	
; 1646.	
; 1647.	
; 1648.	
; 1649.	bool ASC_Detect(unsigned char *module, unsigned int length, AYSongInfo * s)
; 1650.	{
ASC_Detect:
	PUSH	IY
	PUSH	IX
	LD	IX,0
	ADD	IX,SP
	PUSH	BC
	PUSH	DE
	LD	L,(IX+8)
	LD	H,(IX+9)
	PUSH	HL
	POP	IY
; 1651.	        pp =0;
	LD	HL,0
	LD	(pp),HL
; 1652.	        offset = 0;
	LD	(offset),HL
; 1653.	
; 1654.	        if(!ASC1_Detect(module, length))
	LD	L,C
	LD	H,B
	LD	BC,0
	PUSH	BC
	PUSH	HL
	LD	A,BYTE3 ASC1_Detect
	LD	HL,LWRD ASC1_Detect
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	POP	AF
	INC	L
	DEC	L
	JR	NZ,?0706
?0703:
; 1655.	                if(!ASC0_Detect(module, length))              
	LD	L,(IX-2)
	LD	H,(IX-1)
	PUSH	BC
	PUSH	HL
	LD	E,(IX-4)
	LD	D,(IX-3)
	LD	A,BYTE3 ASC0_Detect
	LD	HL,LWRD ASC0_Detect
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	POP	AF
	INC	L
	DEC	L
	JR	Z,?0713
?0705:
; 1656.	                        return false;
?0706:
?0704:
; 1657.	
; 1658.	        if (!pp)
	LD	HL,(pp)
	LD	A,L
	OR	H
	JR	NZ,?0708
?0707:
; 1659.	                strcpy(s->player, "ASC Sound Master");  
	LD	BC,?0709
	CALL	LWRD ?1612
?0708:
; 1660.	
; 1661.	        if (pp==3)
	LD	HL,(pp)
	LD	A,3
	XOR	L
	OR	H
	JR	NZ,?0711
?0710:
; 1662.	                strcpy(s->player, "AS0");        
	LD	BC,?0712
	CALL	LWRD ?1612
?0711:
; 1663.	
; 1664.	        return true;
	LD	L,1
; 1665.	
; 1666.	}
?0713:
	LD	SP,IX
	POP	IX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1667.	
; 1668.	
; 1669.	
; 1670.	
; 1671.	
; 1672.	////////////////////////////////////////////////////////
; 1673.	/////////////////////////////////////////////////////////
; 1674.	
; 1675.	
; 1676.	
; 1677.	
; 1678.	
; 1679.	typedef struct
; 1680.	{
; 1681.	        unsigned int SOURCE_POINTER;
; 1682.	        char mask;
; 1683.	        char buf;
; 1684.	        int r_r;
; 1685.	        unsigned int DECODER_BUFFER_POINTER;
; 1686.	        int addr ;
; 1687.	        unsigned char OUTPUT ;
; 1688.	        int NUM_B;
; 1689.	        char best_J;
; 1690.	        char best_I;
; 1691.	        char SSS;
; 1692.	        char SPACE;
; 1693.	        ///17b
; 1694.	} global;
; 1695.	
; 1696.	global g [13];
; 1697.	
; 1698.	
; 1699.	void PSG_Play(AYSongInfo * info)
; 1700.	{
PSG_Play:
	PUSH	BC
	PUSH	DE
; 1701.	        decode_lzss_step(g);
	LD	DE,g
	LD	A,BYTE3 decode_lzss_step
	LD	HL,LWRD decode_lzss_step
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1702.	
; 1703.	        if (g[9].OUTPUT & 32)
	LD	A,(g+163)
	BIT	5,A
	JR	Z,?0715
?0714:
; 1704.	                ay_writeay(0, g[0].OUTPUT);
	LD	BC,(g+10)
	LD	E,0
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0715:
; 1705.	
; 1706.	        if (g[9].OUTPUT & 64)
	LD	A,(g+163)
	BIT	6,A
	JR	Z,?0717
?0716:
; 1707.	                ay_writeay(1, g[3].OUTPUT >> 4);
	LD	A,(g+61)
	RRA
	RRA
	RRA
	RRA
	AND	15
	LD	C,A
	LD	E,1
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0717:
; 1708.	
; 1709.	        if (g[9].OUTPUT & 128)
	LD	A,(g+163)
	OR	A
	JP	P,?0719
?0718:
; 1710.	                ay_writeay(2, g[1].OUTPUT);    
	LD	BC,(g+27)
	LD	E,2
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0719:
; 1711.	
; 1712.	
; 1713.	
; 1714.	        if (g[10].OUTPUT & 32)
	LD	A,(g+180)
	BIT	5,A
	JR	Z,?0721
?0720:
; 1715.	                ay_writeay(3, g[4].OUTPUT >> 4);    
	LD	A,(g+78)
	RRA
	RRA
	RRA
	RRA
	AND	15
	LD	C,A
	LD	E,3
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0721:
; 1716.	
; 1717.	        if (g[10].OUTPUT & 64)
	LD	A,(g+180)
	BIT	6,A
	JR	Z,?0723
?0722:
; 1718.	                ay_writeay(4, g[2].OUTPUT); 
	LD	BC,(g+44)
	LD	E,4
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0723:
; 1719.	
; 1720.	        if (g[10].OUTPUT & 128)
	LD	A,(g+180)
	OR	A
	JP	P,?0725
?0724:
; 1721.	                ay_writeay(5, g[4].OUTPUT%16);    
	LD	A,(g+78)
	AND	15
	LD	C,A
	LD	E,5
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0725:
; 1722.	
; 1723.	
; 1724.	
; 1725.	        if (g[12].OUTPUT & 1)
	LD	A,(g+214)
	BIT	0,A
	JR	Z,?0727
?0726:
; 1726.	                ay_writeay(6, g[11].OUTPUT);    
	LD	BC,(g+197)
	LD	E,6
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0727:
; 1727.	
; 1728.	        if (g[12].OUTPUT & 2)
	LD	A,(g+214)
	BIT	1,A
	JR	Z,?0729
?0728:
; 1729.	                ay_writeay(7, g[5].OUTPUT); 
	LD	BC,(g+95)
	LD	E,7
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0729:
; 1730.	
; 1731.	        if (g[12].OUTPUT & 4)
	LD	A,(g+214)
	BIT	2,A
	JR	Z,?0731
?0730:
; 1732.	                ay_writeay(8, g[8].OUTPUT);    
	LD	BC,(g+146)
	LD	E,8
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0731:
; 1733.	
; 1734.	        if (g[12].OUTPUT & 8)
	LD	A,(g+214)
	BIT	3,A
	JR	Z,?0733
?0732:
; 1735.	                ay_writeay( 9, g[ 9].OUTPUT & 31);
	LD	A,(g+163)
	AND	31
	LD	C,A
	LD	E,9
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0733:
; 1736.	
; 1737.	        if (g[12].OUTPUT & 16)
	LD	A,(g+214)
	BIT	4,A
	JR	Z,?0735
?0734:
; 1738.	                ay_writeay(10, g[10].OUTPUT & 31);    
	LD	A,(g+180)
	AND	31
	LD	C,A
	LD	E,10
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0735:
; 1739.	
; 1740.	        if (g[12].OUTPUT & 32)
	LD	A,(g+214)
	BIT	5,A
	JR	Z,?0737
?0736:
; 1741.	                ay_writeay(11, g[6].OUTPUT); 
	LD	BC,(g+112)
	LD	E,11
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0737:
; 1742.	
; 1743.	        if (g[12].OUTPUT & 64)
	LD	A,(g+214)
	BIT	6,A
	JR	Z,?0739
?0738:
; 1744.	                ay_writeay(12, g[7].OUTPUT);  
	LD	BC,(g+129)
	LD	E,12
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0739:
; 1745.	
; 1746.	        if (g[12].OUTPUT & 128)
	LD	A,(g+214)
	OR	A
	JP	P,?0741
?0740:
; 1747.	                ay_writeay(13, g[3].OUTPUT%16);    
	LD	A,(g+61)
	AND	15
	LD	C,A
	LD	E,13
	LD	A,BYTE3 ay_writeay
	LD	HL,LWRD ay_writeay
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0741:
; 1748.	
; 1749.	}
	POP	HL
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1750.	
; 1751.	
; 1752.	
; 1753.	/////////////////////////////////////////////////
; 1754.	///////////////////////////////////////////////////
; 1755.	/////////////////////////////////////////////////////
; 1756.	
; 1757.	# define N_DECODE_BUFFERS 4
; 1758.	
; 1759.	typedef struct 
; 1760.	{
; 1761.	  int free;
; 1762.	  unsigned int pointer;
; 1763.	} buffers_t;
; 1764.	
; 1765.	buffers_t decode_buffers [N_DECODE_BUFFERS];
; 1766.	
; 1767.	void ResetDecodeBuffers(void)
; 1768.	{
ResetDecodeBuffers:
; 1769.	        decode_buffers[0].free = 16384;
	LD	HL,16384
	LD	(decode_buffers),HL
; 1770.	        decode_buffers[0].pointer = 49152;
	LD	H,192
	LD	(decode_buffers+2),HL
; 1771.	        
; 1772.	        decode_buffers[1].free = 8192;
	LD	H,32
	LD	(decode_buffers+4),HL
; 1773.	        decode_buffers[1].pointer = 57344;
	LD	H,224
	LD	(decode_buffers+6),HL
; 1774.	        
; 1775.	        decode_buffers[2].free = 2048;
	LD	H,8
	LD	(decode_buffers+8),HL
; 1776.	        decode_buffers[2].pointer = 0xDE34; 
	LD	HL,56884
	LD	(decode_buffers+10),HL
; 1777.	        
; 1778.	        decode_buffers[3].free = 6144;
	LD	HL,6144
	LD	(decode_buffers+12),HL
; 1779.	        decode_buffers[3].pointer = 49152;
	LD	H,192
	LD	(decode_buffers+14),HL
; 1780.	        
; 1781.	}
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1782.	
; 1783.	unsigned char GetDecodeBuffer(unsigned int * pointer, int len, int max)
; 1784.	{
GetDecodeBuffer:
	PUSH	IX
	PUSH	DE
	PUSH	BC
	POP	IX
; 1785.	        int smallest_free = 20000;
	LD	HL,20000
	LD	(?0010+194),HL
; 1786.	        char i;
; 1787.	        int found;
; 1788.	        
; 1789.	        //static char x = 1;
; 1790.	        
; 1791.	        //gotoxy (10, 0);
; 1792.	        //printf ("%d", len);
; 1793.	        
; 1794.	        for (i=0; i<max; i++)
	XOR	A
	LD	(?0010+196),A
?0743:
	LD	HL,(?0010+196)
	LD	H,0
	PUSH	HL
	LD	L,10
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	POP	HL
	OR	128
	SBC	HL,BC
	JP	PO,?1419
	XOR	H
?1419:
	JP	P,?0742
?0744:
; 1795.	        {
; 1796.	                if (decode_buffers[i].free>=len)
	LD	HL,(?0010+196)
	LD	H,0
	ADD	HL,HL
	ADD	HL,HL
	LD	BC,decode_buffers
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	PUSH	IX
	POP	BC
	OR	128
	SBC	HL,BC
	JP	PO,?1420
	XOR	H
?1420:
	JP	M,?0749
?0746:
; 1797.	                {
; 1798.	                        if (smallest_free>=decode_buffers[i].free) 
	LD	HL,(?0010+196)
	LD	H,0
	ADD	HL,HL
	ADD	HL,HL
	LD	BC,decode_buffers
	ADD	HL,BC
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	LD	HL,(?0010+194)
	OR	128
	SBC	HL,BC
	JP	PO,?1421
	XOR	H
?1421:
	JP	M,?0749
?0748:
; 1799.	                        {
; 1800.	                                smallest_free = decode_buffers[i].free;
	LD	HL,(?0010+196)
	LD	H,0
	ADD	HL,HL
	ADD	HL,HL
	LD	BC,decode_buffers
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	LD	(?0010+194),HL
; 1801.	                                found = i;
	LD	BC,(?0010+196)
	LD	B,0
	LD	(?0010+197),BC
?0749:
?0747:
	LD	HL,?0010+196
	INC	(HL)
	JR	?0743
?0742:
; 1802.	                        }
; 1803.	                }
; 1804.	        }
; 1805.	        
; 1806.	        
; 1807.	        *pointer = decode_buffers[found].pointer;
	LD	HL,(?0010+197)
	ADD	HL,HL
	ADD	HL,HL
	LD	BC,decode_buffers+2
	ADD	HL,BC
	LD	B,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,B
	PUSH	HL
	LD	HL,2
	ADD	HL,SP
	LD	A,(HL)
	INC	HL
	LD	H,(HL)
	LD	L,A
	POP	BC
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1808.	        decode_buffers[found].free -= len;
	LD	HL,(?0010+197)
	ADD	HL,HL
	ADD	HL,HL
	LD	BC,decode_buffers
	ADD	HL,BC
	PUSH	IX
	POP	BC
	LD	A,(HL)
	SUB	C
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	SBC	A,B
	LD	(HL),A
; 1809.	
; 1810.	        //gotoxy (0, x++);
; 1811.	        //printf ("%d %u %d %d", found, *pointer, len, decode_buffers[found].free);
; 1812.	
; 1813.	        //delay (60000);
; 1814.	        
; 1815.	        
; 1816.	        decode_buffers[found].pointer += len;
	LD	HL,(?0010+197)
	ADD	HL,HL
	ADD	HL,HL
	EX	DE,HL
	LD	HL,decode_buffers+2
	ADD	HL,DE
	LD	A,(HL)
	ADD	A,C
	LD	(HL),A
	INC	HL
	LD	A,(HL)
	ADC	A,B
	LD	(HL),A
; 1817.	        return (found);
	LD	HL,(?0010+197)
; 1818.	}
	POP	AF
	POP	IX
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1819.	
; 1820.	
; 1821.	# define NUM_CH 13
; 1822.	
; 1823.	void PSG_Init(AYSongInfo * info)
; 1824.	{
PSG_Init:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 1825.	        unsigned char i;
; 1826.	        int F;
; 1827.	        int N; 
; 1828.	        char space;
; 1829.	        unsigned int pointer;
; 1830.	        unsigned char bank;
; 1831.	
; 1832.	
; 1833.	
; 1834.	
; 1835.	        memset (g, 0 , sizeof(global)*NUM_CH);
	LD	HL,221
	PUSH	HL
	LD	C,H
	LD	B,H
	LD	DE,g
	CALL	LWRD ?1606
	POP	AF
; 1836.	
; 1837.	        ResetDecodeBuffers();
	LD	A,BYTE3 ResetDecodeBuffers
	LD	HL,LWRD ResetDecodeBuffers
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1838.	
; 1839.	        for (i=0; i<NUM_CH; i++)
	XOR	A
	LD	(?0010+199),A
?0751:
	LD	A,(?0010+199)
	CP	13
	JP	NC,?0750
?0752:
; 1840.	        {
; 1841.	                //diag (20+i);
; 1842.	                
; 1843.	                memcpy (&g[i].SOURCE_POINTER, &info->module[6 + i*4], 2);   
	LD	HL,2
	PUSH	HL
	LD	L,(IX+2)
	LD	H,(IX+3)
	PUSH	HL
	LD	L,A
	LD	H,0
	ADD	HL,HL
	ADD	HL,HL
	LD	C,L
	LD	B,H
	POP	HL
	ADD	HL,BC
	LD	BC,6
	ADD	HL,BC
	PUSH	HL
	LD	E,A
	LD	D,B
	LD	C,17
	CALL	LWRD ?S_MUL_L02
	LD	HL,g
	ADD	HL,DE
	EX	DE,HL
	LD	A,BYTE3 memcpy
	LD	HL,LWRD memcpy
	POP	BC
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
; 1844.	                g[i].SOURCE_POINTER+=D_16384;
	CALL	LWRD ?1595
	LD	HL,g
	ADD	HL,DE
	LD	A,64
	INC	HL
	ADD	A,(HL)
	LD	(HL),A
; 1845.	
; 1846.	                memcpy (&g[i].best_I, &info->module[8 + i*4], 1); 
	LD	HL,1
	PUSH	HL
	LD	L,(IX+2)
	LD	H,(IX+3)
	PUSH	HL
	LD	HL,(?0010+199)
	LD	H,B
	ADD	HL,HL
	ADD	HL,HL
	LD	C,L
	LD	B,H
	POP	HL
	ADD	HL,BC
	LD	BC,8
	ADD	HL,BC
	PUSH	HL
	LD	HL,g+14
	CALL	LWRD ?1594
	POP	BC
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
; 1847.	                g[i].best_I /= 16;
	LD	HL,g+14
	CALL	LWRD ?1595
	ADD	HL,DE
	XOR	A
	RRD
; 1848.	
; 1849.	                memcpy (&g[i].best_J, &info->module[8 + i*4], 1); 
	LD	HL,1
	PUSH	HL
	LD	L,(IX+2)
	LD	H,(IX+3)
	PUSH	HL
	LD	HL,(?0010+199)
	LD	H,B
	ADD	HL,HL
	ADD	HL,HL
	LD	C,L
	LD	B,H
	POP	HL
	ADD	HL,BC
	LD	BC,8
	ADD	HL,BC
	PUSH	HL
	LD	HL,g+13
	CALL	LWRD ?1594
	POP	BC
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
; 1850.	                g[i].best_J %= 16;
	LD	HL,g+13
	CALL	LWRD ?1595
	ADD	HL,DE
	LD	A,(HL)
	AND	15
	LD	(HL),A
; 1851.	
; 1852.	                memcpy (&space, &info->module[9 + i*4], 1); 
	LD	HL,1
	PUSH	HL
	LD	L,(IX+2)
	LD	H,(IX+3)
	PUSH	HL
	LD	HL,(?0010+199)
	LD	H,B
	ADD	HL,HL
	ADD	HL,HL
	LD	C,L
	LD	B,H
	POP	HL
	ADD	HL,BC
	LD	BC,9
	ADD	HL,BC
	LD	C,L
	LD	B,H
	LD	DE,?0010+204
	LD	A,BYTE3 memcpy
	LD	HL,LWRD memcpy
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
; 1853.	
; 1854.	                F = ((1 << g[i].best_J) + 1);
	LD	HL,g+13
	CALL	LWRD ?1593
	INC	DE
	LD	(?0010+200),DE
; 1855.	                N = (1 << g[i].best_I);
	LD	HL,g+14
	CALL	LWRD ?1593
	LD	(?0010+202),DE
; 1856.	
; 1857.	                g[i].r_r = N - F;
	LD	HL,g+4
	CALL	LWRD ?1595
	ADD	HL,DE
	PUSH	HL
	LD	BC,(?0010+200)
	LD	HL,(?0010+202)
	AND	A
	SBC	HL,BC
	LD	C,L
	LD	B,H
	POP	HL
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1858.	
; 1859.	                switch (g[i].best_I)
	LD	HL,g+14
	CALL	LWRD ?1595
	ADD	HL,DE
	LD	E,(HL)
	CALL	LWRD ?C_S_SWITCH_L06
	DEFB	8
	DEFW	6
	DEFW	?0754
	DEFW	?0760
	DEFW	?0759
	DEFW	?0758
	DEFW	?0757
	DEFW	?0756
	DEFW	?0755
?0755:
; 1860.	                {
; 1861.	                                
; 1862.	                case 13:
; 1863.	                        g[i].SSS = 31;
	CALL	LWRD ?1596
	ADD	HL,DE
	LD	(HL),31
; 1864.	                        break;
	JR	?0754
?0756:
; 1865.	
; 1866.	                case 12:
; 1867.	                        g[i].SSS = 15;
	CALL	LWRD ?1596
	ADD	HL,DE
	LD	(HL),15
; 1868.	                        break;
	JR	?0754
?0757:
; 1869.	
; 1870.	                case 11:
; 1871.	                        g[i].SSS = 7;
	CALL	LWRD ?1596
	ADD	HL,DE
	LD	(HL),7
; 1872.	                        break;
	JR	?0754
?0758:
; 1873.	
; 1874.	                case 10:
; 1875.	                        g[i].SSS = 3;
	CALL	LWRD ?1596
	ADD	HL,DE
	LD	(HL),3
; 1876.	                        break;
	JR	?0754
?0759:
; 1877.	
; 1878.	                case 9:
; 1879.	                        g[i].SSS = 1;
	CALL	LWRD ?1596
	ADD	HL,DE
	LD	(HL),1
; 1880.	                        break;
	JR	?0754
?0760:
; 1881.	
; 1882.	                case 8:
; 1883.	                        g[i].SSS = 0;
	CALL	LWRD ?1596
	ADD	HL,DE
	LD	(HL),B
; 1884.	                        break;
?0754:
; 1885.	                        
; 1886.	                }
; 1887.	                                        
; 1888.	                        //diag (30+i);          
; 1889.	                                        
; 1890.	                        if (info->variant <2)           
	LD	A,(IX+112)
	CP	2
	JR	NC,?0762
?0761:
; 1891.	                        bank = GetDecodeBuffer(&pointer, N, N_DECODE_BUFFERS);
	LD	HL,4
	PUSH	HL
	LD	BC,(?0010+202)
	LD	DE,?0010+205
	LD	A,BYTE3 GetDecodeBuffer
	LD	HL,LWRD GetDecodeBuffer
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	LD	A,L
	LD	(?0010+207),A
?0762:
; 1892.	                        if (info->variant ==2)          
	LD	B,(IX+112)
	DEC	B
	DEC	B
	JR	NZ,?0764
?0763:
; 1893.	                        bank = GetDecodeBuffer(&pointer, N, N_DECODE_BUFFERS-1);
	LD	HL,3
	PUSH	HL
	LD	BC,(?0010+202)
	LD	DE,?0010+205
	LD	A,BYTE3 GetDecodeBuffer
	LD	HL,LWRD GetDecodeBuffer
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	LD	A,L
	LD	(?0010+207),A
?0764:
; 1894.	                        
; 1895.	                
; 1896.	                        space_buf0(space);
	LD	DE,(?0010+204)
	LD	A,BYTE3 space_buf0
	LD	HL,LWRD space_buf0
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1897.	                        
; 1898.	                        //diag (40+i);
; 1899.	                        
; 1900.	                        di_();
	CALL	LWRD ?1615
; 1901.	                        
; 1902.	                        switch (bank)
	LD	DE,(?0010+207)
	CALL	LWRD ?C_S_SWITCH_L06
	DEFB	0
	DEFW	4
	DEFW	?0765
	DEFW	?0766
	DEFW	?0767
	DEFW	?0768
	DEFW	?0769
?0766:
; 1903.	                        {
; 1904.	                                case 0:
; 1905.	                                        space_buf1(pointer, N);
	LD	BC,(?0010+202)
	LD	DE,(?0010+205)
	LD	A,BYTE3 space_buf1
	LD	HL,LWRD space_buf1
	JR	?1427
; 1906.	                                break;
?0767:
; 1907.	                                
; 1908.	                                case 1:
; 1909.	                                        space_buf2(pointer, N);
	LD	BC,(?0010+202)
	LD	DE,(?0010+205)
	LD	A,BYTE3 space_buf2
	LD	HL,LWRD space_buf2
	JR	?1427
; 1910.	                                break;
?0768:
; 1911.	                                
; 1912.	                                case 2:
; 1913.	                                        space_buf3(pointer, N);
	LD	BC,(?0010+202)
	LD	DE,(?0010+205)
	LD	A,BYTE3 space_buf3
	LD	HL,LWRD space_buf3
	JR	?1427
; 1914.	                                break;
?0769:
; 1915.	                                
; 1916.	                                case 3:
; 1917.	                                        space_buf4(pointer, N);
	LD	BC,(?0010+202)
	LD	DE,(?0010+205)
	LD	A,BYTE3 space_buf4
	LD	HL,LWRD space_buf4
?1427:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1918.	                                break;
?0765:
; 1919.	                                
; 1920.	                        }
; 1921.	                        
; 1922.	                        ei_();
	CALL	LWRD ?1616
; 1923.	                        
; 1924.	                        //diag (50+i);
; 1925.	                        
; 1926.	                        g[i].DECODER_BUFFER_POINTER = pointer;
	LD	HL,g+6
	CALL	LWRD ?1595
	ADD	HL,DE
	LD	BC,(?0010+205)
	LD	(HL),C
	INC	HL
	LD	(HL),B
; 1927.	                        g[i].SPACE = bank;                      
	LD	HL,g+16
	CALL	LWRD ?1595
	ADD	HL,DE
	LD	A,(?0010+207)
	LD	(HL),A
	LD	HL,?0010+199
	INC	(HL)
; 1928.	                        
; 1929.	        }
; 1930.	        
; 1931.	        
; 1932.	        //stop();
; 1933.	}
	JP	LWRD ?0751
?0750:
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1593:
	LD	BC,(?0010+199)
	LD	B,0
	LD	DE,17
	CALL	LWRD ?S_MUL_L02
	ADD	HL,DE
	LD	B,(HL)
	LD	DE,1
	CALL	LWRD ?S_LSH_L02
	RET
?1594:
	LD	DE,(?0010+199)
	LD	D,B
	LD	C,17
	CALL	LWRD ?S_MUL_L02
	ADD	HL,DE
	EX	DE,HL
	LD	A,BYTE3 memcpy
	LD	HL,LWRD memcpy
	RET
?1596:
	LD	HL,g+15
?1595:
	LD	BC,(?0010+199)
	LD	B,0
	LD	DE,17
	JP	LWRD ?S_MUL_L02
?1615:
	LD	A,BYTE3 di_
	LD	HL,LWRD di_
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1617:
	LD	DE,(?0010+264)
	LD	A,BYTE3 disker2
	LD	HL,LWRD disker2
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1616:
	LD	A,BYTE3 ei_
	LD	HL,LWRD ei_
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 1934.	
; 1935.	
; 1936.	
; 1937.	
; 1938.	
; 1939.	
; 1940.	
; 1941.	unsigned char X, Y;
; 1942.	
; 1943.	void gotoxy(char x, char y)
; 1944.	{
gotoxy:
	PUSH	BC
	PUSH	DE
; 1945.	        X=x;
	LD	A,E
	LD	(X),A
; 1946.	        Y=y;
	LD	A,C
	LD	(Y),A
; 1947.	
; 1948.	        if (X>31) X=31;
	LD	A,31
	CP	E
	JR	NC,?0771
?0770:
	LD	(X),A
?0771:
; 1949.	        if (Y>23) Y=23;
	LD	A,(Y)
	LD	B,A
	LD	A,23
	CP	B
	JR	NC,?0773
?0772:
	LD	(Y),A
?0773:
; 1950.	}
	POP	HL
	POP	HL
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1951.	
; 1952.	
; 1953.	char putchar (char aa)
; 1954.	{
putchar:
	PUSH	BC
	PUSH	DE
; 1955.	        if ((X>31) || (aa=='\n'))
	LD	A,(X)
	LD	B,A
	LD	A,31
	CP	B
	JR	C,?0776
	LD	A,E
	CP	10
	JR	NZ,?0779
?0776:
?0777:
?0774:
; 1956.	        {
; 1957.	                X=0;
	XOR	A
	LD	(X),A
; 1958.	                Y++;
	LD	HL,Y
	INC	(HL)
; 1959.	
; 1960.	                if ((Y>23) || (aa=='\n')) return 1;
	LD	A,(Y)
	LD	B,A
	LD	A,23
	CP	B
	JR	C,?0780
	LD	A,E
	CP	10
	JR	NZ,?0779
?0780:
?0781:
?0778:
	LD	L,1
; 1961.	        }
	JR	?0787
?0779:
?0775:
; 1962.	
; 1963.	        if ((aa >= 0x20) && (aa<=0x7f))
	CP	32
	JR	C,?0783
	LD	A,127
	CP	E
	JR	C,?0783
?0785:
?0784:
?0782:
; 1964.	                Pr_Sym(Y*256+X, aa);
	LD	C,E
	JR	?1429
; 1965.	        else
?0783:
; 1966.	                Pr_Sym(Y*256+X, '?');
	LD	C,63
?1429:
	LD	DE,(Y)
	LD	D,E
	LD	E,0
	LD	HL,(X)
	LD	H,E
	ADD	HL,DE
	EX	DE,HL
	LD	A,BYTE3 Pr_Sym
	LD	HL,LWRD Pr_Sym
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0786:
; 1967.	
; 1968.	        X++;
	LD	HL,X
	INC	(HL)
; 1969.	
; 1970.	
; 1971.	
; 1972.	        return 0;
	LD	L,0
; 1973.	}
?0787:
	POP	AF
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1974.	
; 1975.	
; 1976.	
; 1977.	char pc_counter;
; 1978.	void printchar(char ** str, char c)
; 1979.	{
printchar:
	PUSH	IX
	PUSH	BC
	PUSH	DE
	POP	IX
; 1980.	        char pcrv;
; 1981.	
; 1982.	
; 1983.	        char * str1 = (char *) str;
	LD	(?0010+209),DE
; 1984.	
; 1985.	        if (str) 
	LD	A,IXL
	OR	IXH
	JR	Z,?0789
?0788:
; 1986.	        {
; 1987.	                str1[pc_counter++] = c;         
	LD	HL,pc_counter
	LD	C,(HL)
	INC	(HL)
	LD	B,0
	EX	DE,HL
	ADD	HL,BC
	PUSH	HL
	LD	HL,2
	ADD	HL,SP
	LD	B,(HL)
	POP	HL
	LD	(HL),B
; 1988.	        }
; 1989.	        else 
	JR	?0792
?0789:
; 1990.	        {
; 1991.	                pcrv = putchar((char)c);
	LD	E,C
	LD	A,BYTE3 putchar
	LD	HL,LWRD putchar
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	A,L
	LD	(?0010+208),A
; 1992.	
; 1993.	                if (pcrv) return;
?0791:
; 1994.	        }
?0792:
?0790:
; 1995.	}
?0793:
	POP	HL
	POP	IX
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 1996.	
; 1997.	int prints(char **out, char *string, int width, int pad)
; 1998.	{
prints:
	PUSH	IY
	PUSH	IX
	EXX
	PUSH	BC
	EXX
	PUSH	BC
	POP	IY
	PUSH	DE
	EXX
	POP	BC
	EXX
	LD	HL,10
	ADD	HL,SP
	LD	A,(HL)
	LD	IXL,A
	INC	HL
	LD	A,(HL)
	LD	IXH,A
; 1999.	        int pc = 0, padchar = ' ';
	LD	HL,0
	LD	(?0010+211),HL
	LD	L,32
	LD	(?0010+213),HL
; 2000.	        int len;
; 2001.	        char *ptr;
; 2002.	
; 2003.	        if (width > 0) {
	PUSH	IX
	POP	BC
	LD	L,H
	OR	128
	SBC	HL,BC
	JP	PO,?1435
	XOR	H
?1435:
	JP	P,?0804
?0794:
; 2004.	                len = 0;
	LD	HL,0
	LD	(?0010+215),HL
; 2005.	
; 2006.	                for (ptr = string; *ptr; ++ptr) ++len;
	PUSH	IY
	POP	HL
?1439:
	LD	(?0010+217),HL
?0797:
	XOR	A
	OR	(HL)
	JR	Z,?0796
?0798:
	LD	HL,(?0010+215)
	INC	HL
	LD	(?0010+215),HL
	LD	HL,(?0010+217)
	INC	HL
	JR	?1439
?0796:
; 2007.	                if (len >= width) width = 0;
	PUSH	IX
	POP	BC
	LD	HL,(?0010+215)
	OR	128
	SBC	HL,BC
	JP	PO,?1436
	XOR	H
?1436:
	JP	M,?0801
?0800:
	LD	IX,0
	JR	?0802
?0801:
; 2008.	                else width -= len;
	LD	BC,(?0010+215)
	PUSH	IX
	POP	HL
	AND	A
	SBC	HL,BC
	PUSH	HL
	POP	IX
?0802:
; 2009.	                if (pad & PAD_ZERO) padchar = '0';
	LD	HL,12
	ADD	HL,SP
	BIT	1,(HL)
	JR	Z,?0804
?0803:
	LD	HL,48
	LD	(?0010+213),HL
?0804:
?0795:
; 2010.	        }
; 2011.	        if (!(pad & PAD_RIGHT)) {
	LD	HL,12
	ADD	HL,SP
	BIT	0,(HL)
	JR	NZ,?0807
?0805:
?0808:
; 2012.	                for ( ; width > 0; --width) {
	PUSH	IX
	POP	BC
	LD	HL,0
	OR	128
	SBC	HL,BC
	JP	PO,?1437
	XOR	H
?1437:
	JP	P,?0807
?0809:
; 2013.	                        printchar (out, padchar);
	LD	BC,(?0010+213)
	EXX
	PUSH	BC
	EXX
	POP	DE
	CALL	LWRD ?1620
; 2014.	                        ++pc;
; 2015.	                }
; 2016.	        }
	JR	?0805
?0807:
?0806:
?0812:
; 2017.	        for ( ; *string ; ++string) {
	XOR	A
	OR	(IY+0)
	JR	Z,?0811
?0813:
; 2018.	                printchar (out, *string);
	LD	C,(IY+0)
	EXX
	PUSH	BC
	EXX
	POP	DE
	LD	A,BYTE3 printchar
	LD	HL,LWRD printchar
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2019.	                ++pc;
	LD	HL,(?0010+211)
	INC	HL
	LD	(?0010+211),HL
	INC	IY
	JR	?0807
?0811:
?0816:
; 2020.	        }
; 2021.	        for ( ; width > 0; --width) {
	PUSH	IX
	POP	BC
	LD	HL,0
	OR	128
	SBC	HL,BC
	JP	PO,?1438
	XOR	H
?1438:
	JP	P,?0815
?0817:
; 2022.	                printchar (out, padchar);
	LD	BC,(?0010+213)
	EXX
	PUSH	BC
	EXX
	POP	DE
	CALL	LWRD ?1620
; 2023.	                ++pc;
	JR	?0811
?0815:
; 2024.	        }
; 2025.	
; 2026.	        return pc;
	LD	HL,(?0010+211)
; 2027.	}
	JP	LWRD ?0312
?1620:
	LD	A,BYTE3 printchar
	LD	HL,LWRD printchar
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	HL,(?0010+211)
	INC	HL
	LD	(?0010+211),HL
	DEC	IX
	RET
; 2028.	
; 2029.	
; 2030.	
; 2031.	int printi(char **out, int i, int b, int sg, int width, int pad, int letbase)   
; 2032.	{
printi:
	PUSH	IY
	EXX
	PUSH	BC
	PUSH	DE
	EXX
	PUSH	IX
	LD	IX,0
	ADD	IX,SP
	PUSH	BC
	POP	IY
	PUSH	DE
	EXX
	POP	DE
	LD	C,(IX+16)
	LD	B,(IX+17)
	EXX
; 2033.	        char print_buf[PRINT_BUF_LEN];
; 2034.	        char *s;
; 2035.	        int t, neg = 0, pc = 0;
	LD	HL,0
	LD	(?0010+235),HL
	LD	(?0010+237),HL
; 2036.	        unsigned int u = i;
	LD	(?0010+239),BC
; 2037.	
; 2038.	        if (i == 0) {
	LD	A,IYL
	OR	IYH
	JR	NZ,?0820
?0819:
; 2039.	                print_buf[0] = '0';
	LD	A,48
	LD	(?0010+219),A
; 2040.	                print_buf[1] = '\0';
	XOR	A
	LD	(?0010+220),A
; 2041.	                return prints (out, print_buf, width, pad);
	LD	L,(IX+18)
	LD	H,(IX+19)
	PUSH	HL
	EXX
	PUSH	BC
	EXX
	LD	BC,?0010+219
	LD	A,BYTE3 prints
	LD	HL,LWRD prints
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	POP	AF
; 2042.	        }
	JP	LWRD ?0837
?0820:
; 2043.	
; 2044.	        if (sg && b == 10 && i < 0) {
	LD	A,(IX+14)
	OR	(IX+15)
	JR	Z,?0822
	LD	A,10
	XOR	(IX+12)
	OR	(IX+13)
	JR	NZ,?0822
	LD	B,IYH
	BIT	7,B
	JR	Z,?0822
?0824:
?0823:
?0821:
; 2045.	                neg = 1;
	INC	HL
	LD	(?0010+235),HL
; 2046.	                u = -i;
	PUSH	IY
	POP	BC
	DEC	HL
	SBC	HL,BC
	LD	(?0010+239),HL
?0822:
; 2047.	        }
; 2048.	
; 2049.	        s = print_buf + PRINT_BUF_LEN-1;
	LD	HL,?0010+230
	LD	(?0010+231),HL
; 2050.	        *s = '\0';
	LD	(HL),0
?0826:
; 2051.	
; 2052.	        while (u) {
	LD	HL,(?0010+239)
	LD	A,L
	OR	H
	JR	Z,?0825
?0827:
; 2053.	                t =  (u% b);
	LD	C,(IX+12)
	LD	B,(IX+13)
	EX	DE,HL
	CALL	LWRD ?US_MOD_L02
	LD	(?0010+233),DE
; 2054.	
; 2055.	
; 2056.	                if( t >= 10 )
	LD	BC,32778
	EX	DE,HL
	LD	A,B
	XOR	H
	LD	H,A
	SBC	HL,BC
	JR	C,?0829
?0828:
; 2057.	                        t += letbase - '0' - 10;
	LD	HL,65478
	LD	C,(IX+20)
	LD	B,(IX+21)
	ADD	HL,BC
	LD	BC,(?0010+233)
	ADD	HL,BC
	LD	(?0010+233),HL
?0829:
; 2058.	                *--s = t + '0';
	LD	HL,(?0010+231)
	DEC	HL
	LD	(?0010+231),HL
	LD	A,(?0010+233)
	ADD	A,48
	LD	(HL),A
; 2059.	                u = (u/ b);
	LD	HL,?0010+239
	LD	C,(IX+12)
	LD	B,(IX+13)
	CALL	LWRD ?US_DIVASG_L02
	JR	?0826
?0825:
; 2060.	        }
; 2061.	
; 2062.	        if (neg) {
	LD	HL,(?0010+235)
	LD	A,L
	OR	H
	JR	Z,?0836
?0830:
; 2063.	                if( width && (pad & PAD_ZERO) ) {
	EXX
	LD	A,C
	OR	B
	EXX
	JR	Z,?0833
	BIT	1,(IX+18)
	JR	Z,?0833
?0835:
?0834:
?0832:
; 2064.	                        printchar (out, '-');
	LD	C,45
	EXX
	PUSH	DE
	EXX
	POP	DE
	LD	A,BYTE3 printchar
	LD	HL,LWRD printchar
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2065.	                        ++pc;
	LD	HL,(?0010+237)
	INC	HL
	LD	(?0010+237),HL
; 2066.	                        --width;
	EXX
	DEC	BC
	EXX
; 2067.	                }
; 2068.	                else {
	JR	?0836
?0833:
; 2069.	                        *--s = '-';
	LD	HL,(?0010+231)
	DEC	HL
	LD	(?0010+231),HL
	LD	(HL),45
?0836:
?0831:
; 2070.	                }
; 2071.	        }
; 2072.	
; 2073.	        return pc + prints (out, s, width, pad);
	LD	L,(IX+18)
	LD	H,(IX+19)
	PUSH	HL
	EXX
	PUSH	BC
	EXX
	LD	BC,(?0010+231)
	EXX
	PUSH	DE
	EXX
	POP	DE
	LD	A,BYTE3 prints
	LD	HL,LWRD prints
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	POP	AF
	LD	BC,(?0010+237)
	ADD	HL,BC
; 2074.	}
?0837:
	LD	SP,IX
	POP	IX
	EXX
	POP	DE
	POP	BC
	EXX
	POP	IY
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2075.	
; 2076.	
; 2077.	int print(char **out, const char *format, va_list args)
; 2078.	{
print:
	PUSH	IY
	PUSH	IX
	EXX
	PUSH	BC
	EXX
	PUSH	BC
	POP	IX
	PUSH	DE
	POP	IY
	LD	HL,10
	ADD	HL,SP
	PUSH	HL
	EXX
	POP	HL
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	EXX
; 2079.	        int width, pad;
; 2080.	        int pc = 0;
	LD	HL,0
	LD	(?0010+245),HL
?0839:
; 2081.	        char scr[2];
; 2082.	        char *s;
; 2083.	
; 2084.	
; 2085.	        for (; *format != 0; ++format) {
	XOR	A
	OR	(IX+0)
	JP	Z,?0838
?0840:
; 2086.	                if (*format == '%') {
	LD	A,(IX+0)
	CP	37
	JP	NZ,?0843
?0842:
; 2087.	                        ++format;
; 2088.	                        width = pad = 0;
	LD	HL,0
	LD	(?0010+243),HL
	LD	(?0010+241),HL
; 2089.	                        if (*format == '\0') break;
	XOR	A
	OR	(IX+1)
	INC	IX
	JP	Z,?0838
?0844:
?0845:
; 2090.	                        if (*format == '%') goto out;
	LD	A,(IX+0)
	CP	37
	JP	Z,?0843
?0846:
?0847:
; 2091.	                        if (*format == '-') {
	LD	A,(IX+0)
	CP	45
	JR	NZ,?0850
?0849:
; 2092.	                                ++format;
; 2093.	                                pad = PAD_RIGHT;
	INC	HL
	LD	(?0010+243),HL
?1465:
	INC	IX
?0850:
?0852:
; 2094.	                        }
; 2095.	                        while (*format == '0') {
	LD	A,(IX+0)
	CP	48
	JR	NZ,?0851
?0853:
; 2096.	                                ++format;
; 2097.	                                pad |= PAD_ZERO;
	LD	HL,?0010+243
	SET	1,(HL)
	JR	?1465
?0851:
?0855:
; 2098.	                        }
; 2099.	                        for ( ; *format >= '0' && *format <= '9'; ++format) {
	LD	A,(IX+0)
	CP	48
	JR	C,?0854
	LD	A,57
	CP	(IX+0)
	JR	C,?0854
?0858:
?0857:
?0856:
; 2100.	                                width *= 10;
	LD	HL,?0010+241
	LD	BC,10
	CALL	LWRD ?S_MULASG_L02
; 2101.	                                width += *format - '0';
	LD	C,(IX+0)
	LD	HL,65488
	ADD	HL,BC
	LD	BC,(?0010+241)
	ADD	HL,BC
	LD	(?0010+241),HL
	INC	IX
	JR	?0851
?0854:
; 2102.	                        }
; 2103.	                        if( *format == 's' ) {
	LD	A,(IX+0)
	CP	115
	JR	NZ,?0861
?0860:
; 2104.	                                s = (char *)va_arg( args, int );
	EXX
	PUSH	BC
	EXX
	POP	HL
	LD	C,(HL)
	LD	E,C
	INC	HL
	LD	B,(HL)
	LD	D,B
	INC	DE
	INC	DE
	LD	(HL),D
	DEC	HL
	LD	(HL),E
	LD	A,(BC)
	LD	L,A
	INC	BC
	LD	A,(BC)
	LD	H,A
	LD	(?0010+249),HL
; 2105.	                                pc += prints (out, s?s:"(null)", width, pad);
	LD	BC,(?0010+243)
	PUSH	BC
	LD	BC,(?0010+241)
	PUSH	BC
	LD	A,L
	OR	H
	JR	Z,?0866
	LD	C,L
	LD	B,H
	JP	LWRD ?1463
?0866:
	LD	BC,?0867
	JR	?1463
; 2106.	                                continue;
?0861:
; 2107.	                        }
; 2108.	                        if( *format == 'd' ) {
	LD	A,(IX+0)
	CP	100
	JR	NZ,?0870
?0869:
; 2109.	                                pc += printi (out, va_arg( args, int ), 10, 1, width, pad, 'a');
	LD	HL,97
	PUSH	HL
	LD	HL,(?0010+243)
	PUSH	HL
	LD	HL,(?0010+241)
	PUSH	HL
	LD	HL,1
	JR	?1464
; 2110.	                                continue;
?0870:
; 2111.	                        }                       
; 2112.	
; 2113.	                        if( *format == 'u' ) {
	LD	A,(IX+0)
	CP	117
	JR	NZ,?0875
?0874:
; 2114.	                                pc += printi (out, va_arg( args, int ), 10, 0, width, pad, 'a');
	LD	HL,97
	PUSH	HL
	LD	HL,(?0010+243)
	PUSH	HL
	LD	HL,(?0010+241)
	PUSH	HL
	LD	HL,0
?1464:
	PUSH	HL
	LD	L,10
	PUSH	HL
	EXX
	PUSH	BC
	EXX
	POP	HL
	LD	C,(HL)
	LD	E,C
	INC	HL
	LD	B,(HL)
	LD	D,B
	INC	DE
	INC	DE
	LD	(HL),D
	DEC	HL
	LD	(HL),E
	LD	L,C
	LD	H,B
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	PUSH	IY
	POP	DE
	LD	A,BYTE3 printi
	LD	HL,LWRD printi
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	POP	AF
	POP	AF
	JR	?1461
; 2115.	                                continue;
?0875:
; 2116.	                        }
; 2117.	
; 2118.	                        if( *format == 'c' ) {
	LD	A,(IX+0)
	CP	99
	JR	NZ,?0884
?0879:
; 2119.	                                scr[0] = (char)va_arg( args, int );
	EXX
	PUSH	BC
	EXX
	POP	HL
	LD	C,(HL)
	LD	E,C
	INC	HL
	LD	B,(HL)
	LD	D,B
	INC	DE
	INC	DE
	LD	(HL),D
	DEC	HL
	LD	(HL),E
	LD	A,(BC)
	LD	(?0010+247),A
; 2120.	                                scr[1] = '\0';
	XOR	A
	LD	(?0010+248),A
; 2121.	                                pc += prints (out, scr, width, pad);
	LD	HL,(?0010+243)
	PUSH	HL
	LD	HL,(?0010+241)
	PUSH	HL
	LD	BC,?0010+247
?1463:
	PUSH	IY
	POP	DE
	LD	A,BYTE3 prints
	LD	HL,LWRD prints
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1461:
	POP	AF
	POP	AF
	LD	BC,(?0010+245)
	ADD	HL,BC
	JR	?1453
; 2122.	                                continue;
?0880:
; 2123.	                        }                       
; 2124.	                }
; 2125.	                else 
?0843:
?0848:
; 2126.	                {
; 2127.	out:
; 2128.	                        printchar (out, *format);
	LD	C,(IX+0)
	PUSH	IY
	POP	DE
	LD	A,BYTE3 printchar
	LD	HL,LWRD printchar
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2129.	                        ++pc;
	LD	HL,(?0010+245)
	INC	HL
?1453:
	LD	(?0010+245),HL
?0884:
?0841:
	INC	IX
	JP	LWRD ?0839
?0838:
; 2130.	                }
; 2131.	        }
; 2132.	
; 2133.	        if (out) ((char *)out)[pc_counter] = '\0';
	LD	A,IYL
	OR	IYH
	JR	Z,?0886
?0885:
	LD	BC,(pc_counter)
	LD	B,0
	PUSH	IY
	POP	HL
	ADD	HL,BC
	LD	(HL),B
?0886:
; 2134.	
; 2135.	        va_end( args );
; 2136.	        return pc;
	LD	HL,(?0010+245)
; 2137.	}
	JP	LWRD ?0312
; 2138.	
; 2139.	int printf(const char *format, ...)
; 2140.	{
printf:
	PUSH	BC
	PUSH	DE
; 2141.	        va_list args;
; 2142.	
; 2143.	        va_start( args, format );
	LD	HL,8
	ADD	HL,SP
	LD	BC,2
	ADD	HL,BC
	LD	(?0010+251),HL
; 2144.	        return print( 0, format, args );
	LD	HL,?0010+251
	PUSH	HL
	LD	HL,10
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	LD	DE,0
?1580:
	LD	A,BYTE3 print
	LD	HL,LWRD print
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
; 2145.	}
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2146.	
; 2147.	int sprintf(char *out, const char *format, ...)
; 2148.	{
sprintf:
	PUSH	BC
	PUSH	DE
; 2149.	        va_list args;
; 2150.	
; 2151.	        pc_counter = 0;
	XOR	A
	LD	(pc_counter),A
; 2152.	
; 2153.	        va_start( args, format );
	LD	HL,10
	ADD	HL,SP
	LD	BC,2
	ADD	HL,BC
	LD	(?0010+253),HL
; 2154.	        return print((char **)out, format, args );
	LD	HL,?0010+253
	PUSH	HL
	LD	HL,12
	ADD	HL,SP
	LD	C,(HL)
	INC	HL
	LD	B,(HL)
	DEC	HL
	DEC	HL
	DEC	HL
	LD	E,(HL)
	INC	HL
	LD	D,(HL)
	JP	LWRD ?1580
; 2155.	}
; 2156.	
; 2157.	extern AYSongInfo s;
; 2158.	extern vars_t vars;
; 2159.	
; 2160.	
; 2161.	void plays (void)
; 2162.	{
plays:
	PUSH	BC
	PUSH	DE
; 2163.	
; 2164.	        //if (!ss)
; 2165.	        //      return;
; 2166.	
; 2167.	        if (!s.play)  
	LD	A,(s+98)
	OR	A
	JP	Z,?0899
?0893:
?0894:
; 2168.	                return;
; 2169.	
; 2170.	        s.counter ++;
	LD	HL,(s+95)
	INC	HL
	LD	(s+95),HL
; 2171.	
; 2172.	        if ((s.counter<20) && (!vars.flip_flop_p) && (vars.play_mode!=1))
	LD	BC,20
	AND	A
	SBC	HL,BC
	JR	NC,?0896
	LD	A,(vars)
	OR	A
	JR	NZ,?0896
	LD	A,(vars+1)
	DEC	A
	JP	NZ,?0899
?0898:
?0897:
?0895:
?0896:
; 2173.	                return;
; 2174.	
; 2175.	        switch (vars.current_player)
	LD	DE,(vars+2)
	CALL	LWRD ?C_S_SWITCH_L06
	DEFB	0
	DEFW	9
	DEFW	?0899
	DEFW	?0900
	DEFW	?0901
	DEFW	?0902
	DEFW	?0903
	DEFW	?0904
	DEFW	?0905
	DEFW	?0906
	DEFW	?0907
	DEFW	?0908
?0900:
; 2176.	        {
; 2177.	        case 0:
; 2178.	                PT1_Play(&s);
	LD	DE,s
	LD	A,BYTE3 PT1_Play
	LD	HL,LWRD PT1_Play
	JR	?1473
; 2179.	                break;
?0901:
; 2180.	
; 2181.	        case 1:
; 2182.	                PT2_Play(&s);
	LD	DE,s
	LD	A,BYTE3 PT2_Play
	LD	HL,LWRD PT2_Play
	JR	?1473
; 2183.	                break;
?0902:
; 2184.	
; 2185.	        case 2:
; 2186.	                PT3_Play_Chip(&s);
	LD	DE,s
	LD	A,BYTE3 PT3_Play_Chip
	LD	HL,LWRD PT3_Play_Chip
	JR	?1473
; 2187.	                break;
?0903:
; 2188.	
; 2189.	        case 3:
; 2190.	                STP_Play(&s);
	LD	DE,s
	LD	A,BYTE3 STP_Play
	LD	HL,LWRD STP_Play
	JR	?1473
; 2191.	                break;
?0904:
; 2192.	
; 2193.	        case 4:
; 2194.	                ASC_Play(&s);
	LD	DE,s
	LD	A,BYTE3 ASC_Play
	LD	HL,LWRD ASC_Play
	JR	?1473
; 2195.	                break;
?0905:
; 2196.	
; 2197.	        case 5:
; 2198.	                PSC_Play(&s);
	LD	DE,s
	LD	A,BYTE3 PSC_Play
	LD	HL,LWRD PSC_Play
	JR	?1473
; 2199.	                break;
?0906:
; 2200.	
; 2201.	        case 6:
; 2202.	                STC_Play(&s);
	LD	DE,s
	LD	A,BYTE3 STC_Play
	LD	HL,LWRD STC_Play
	JR	?1473
; 2203.	                break;
?0907:
; 2204.	
; 2205.	        case 7:
; 2206.	                SQT_Play(&s);
	LD	DE,s
	LD	A,BYTE3 SQT_Play
	LD	HL,LWRD SQT_Play
	JR	?1473
; 2207.	                break;      
?0908:
; 2208.	
; 2209.	        case 8:         
; 2210.	                if (s.variant==1)
	LD	A,(s+112)
	DEC	A
	JR	NZ,?0910
?0909:
; 2211.	                {
; 2212.	                        PSG_Play(&s);   
	LD	DE,s
	LD	A,BYTE3 PSG_Play
	LD	HL,LWRD PSG_Play
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2213.	                        PSG_Play(&s);   
	LD	DE,s
	LD	A,BYTE3 PSG_Play
	LD	HL,LWRD PSG_Play
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2214.	                        PSG_Play(&s);
	LD	DE,s
	LD	A,BYTE3 PSG_Play
	LD	HL,LWRD PSG_Play
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0910:
; 2215.	                }
; 2216.	
; 2217.	                PSG_Play(&s);
	LD	DE,s
	LD	A,BYTE3 PSG_Play
	LD	HL,LWRD PSG_Play
?1473:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2218.	
; 2219.	                break;  
?0899:
; 2220.	        }
; 2221.	}
?0911:
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2222.	
; 2223.	
; 2224.	
; 2225.	void title1(char);
; 2226.	
; 2227.	unsigned char II = 0;
; 2228.	
; 2229.	
; 2230.	void init (void)
; 2231.	{
init:
	PUSH	BC
	PUSH	DE
; 2232.	
; 2233.	        if (vars.current_player == -1)
	LD	A,(vars+2)
	INC	A
	JP	Z,?0915
?0912:
?0913:
; 2234.	                return;
; 2235.	
; 2236.	        Status("Initialising...", 0, 0, 1);
	LD	HL,1
	PUSH	HL
	DEC	HL
	PUSH	HL
	LD	C,L
	LD	B,H
	LD	DE,?0914
	LD	A,BYTE3 Status
	LD	HL,LWRD Status
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	HL
	POP	HL
; 2237.	
; 2238.	        switch (vars.current_player)
	LD	DE,(vars+2)
	CALL	LWRD ?C_S_SWITCH_L06
	DEFB	0
	DEFW	9
	DEFW	?0915
	DEFW	?0916
	DEFW	?0917
	DEFW	?0918
	DEFW	?0919
	DEFW	?0920
	DEFW	?0921
	DEFW	?0922
	DEFW	?0923
	DEFW	?0924
?0916:
; 2239.	        {
; 2240.	        case 0:
; 2241.	                PT1_Init(&s);
	LD	DE,s
	LD	A,BYTE3 PT1_Init
	LD	HL,LWRD PT1_Init
	JR	?1481
; 2242.	                break;
?0917:
; 2243.	
; 2244.	        case 1:
; 2245.	                PT2_Init(&s);
	LD	DE,s
	LD	A,BYTE3 PT2_Init
	LD	HL,LWRD PT2_Init
	JR	?1481
; 2246.	                break;
?0918:
; 2247.	
; 2248.	        case 2:
; 2249.	                PT3_Init(&s);
	LD	DE,s
	LD	A,BYTE3 PT3_Init
	LD	HL,LWRD PT3_Init
	JR	?1481
; 2250.	                break;
?0919:
; 2251.	
; 2252.	        case 3:
; 2253.	                STP_Init(&s);
	LD	DE,s
	LD	A,BYTE3 STP_Init
	LD	HL,LWRD STP_Init
	JR	?1481
; 2254.	                break;
?0920:
; 2255.	
; 2256.	        case 4:
; 2257.	                ASC_Init(&s);
	LD	DE,s
	LD	A,BYTE3 ASC_Init
	LD	HL,LWRD ASC_Init
	JR	?1481
; 2258.	                break;
?0921:
; 2259.	
; 2260.	        case 5:
; 2261.	                PSC_Init(&s);
	LD	DE,s
	LD	A,BYTE3 PSC_Init
	LD	HL,LWRD PSC_Init
	JR	?1481
; 2262.	                break;
?0922:
; 2263.	
; 2264.	        case 6:
; 2265.	                STC_Init(&s);
	LD	DE,s
	LD	A,BYTE3 STC_Init
	LD	HL,LWRD STC_Init
	JR	?1481
; 2266.	                break;
?0923:
; 2267.	
; 2268.	        case 7:
; 2269.	                SQT_Init(&s);
	LD	DE,s
	LD	A,BYTE3 SQT_Init
	LD	HL,LWRD SQT_Init
	JR	?1481
; 2270.	                break;
?0924:
; 2271.	
; 2272.	        case 8:
; 2273.	                PSG_Init(&s);
	LD	DE,s
	LD	A,BYTE3 PSG_Init
	LD	HL,LWRD PSG_Init
?1481:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2274.	                break;
?0915:
; 2275.	
; 2276.	        }
; 2277.	}
?0925:
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2278.	
; 2279.	void info (void)
; 2280.	{
info:
	PUSH	BC
	PUSH	DE
; 2281.	        if (vars.current_player == -1)
	LD	A,(vars+2)
	INC	A
	JP	Z,?0941
?0926:
?0927:
; 2282.	                return;
; 2283.	
; 2284.	        Status("Get_info", 0, 0, 1);
	LD	HL,1
	PUSH	HL
	DEC	HL
	PUSH	HL
	LD	C,L
	LD	B,H
	LD	DE,?0928
	LD	A,BYTE3 Status
	LD	HL,LWRD Status
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	HL
	POP	HL
; 2285.	
; 2286.	
; 2287.	        switch (vars.current_player)
	LD	DE,(vars+2)
	CALL	LWRD ?C_S_SWITCH_L06
	DEFB	0
	DEFW	9
	DEFW	?0929
	DEFW	?0930
	DEFW	?0931
	DEFW	?0932
	DEFW	?0933
	DEFW	?0934
	DEFW	?0935
	DEFW	?0936
	DEFW	?0937
	DEFW	?0938
?0930:
; 2288.	        {
; 2289.	        case 0:
; 2290.	                PT1_GetInfo(&s);
	LD	DE,s
	LD	A,BYTE3 PT1_GetInfo
	LD	HL,LWRD PT1_GetInfo
	JR	?1489
; 2291.	                break;
?0931:
; 2292.	
; 2293.	        case 1:
; 2294.	                PT2_GetInfo(&s);
	LD	DE,s
	LD	A,BYTE3 PT2_GetInfo
	LD	HL,LWRD PT2_GetInfo
	JR	?1489
; 2295.	                break;
?0932:
; 2296.	
; 2297.	        case 2:
; 2298.	                PT3_GetInfo(&s);
	LD	DE,s
	LD	A,BYTE3 PT3_GetInfo
	LD	HL,LWRD PT3_GetInfo
	JR	?1489
; 2299.	                break;
?0933:
; 2300.	
; 2301.	        case 3:
; 2302.	                STP_GetInfo(&s);    
	LD	DE,s
	LD	A,BYTE3 STP_GetInfo
	LD	HL,LWRD STP_GetInfo
	JR	?1489
; 2303.	                break;
?0934:
; 2304.	
; 2305.	        case 4:
; 2306.	                ASC_GetInfo(&s);    
	LD	DE,s
	LD	A,BYTE3 ASC_GetInfo
	LD	HL,LWRD ASC_GetInfo
	JR	?1489
; 2307.	                break;
?0935:
; 2308.	
; 2309.	        case 5:
; 2310.	                PSC_GetInfo(&s);    
	LD	DE,s
	LD	A,BYTE3 PSC_GetInfo
	LD	HL,LWRD PSC_GetInfo
	JR	?1489
; 2311.	                break;
?0936:
; 2312.	
; 2313.	        case 6:
; 2314.	                STC_GetInfo(&s);
	LD	DE,s
	LD	A,BYTE3 STC_GetInfo
	LD	HL,LWRD STC_GetInfo
	JR	?1489
; 2315.	                break;
?0937:
; 2316.	
; 2317.	        case 7:
; 2318.	                SQT_GetInfo(&s);   
	LD	DE,s
	LD	A,BYTE3 SQT_GetInfo
	LD	HL,LWRD SQT_GetInfo
	JR	?1489
; 2319.	                break;
?0938:
; 2320.	
; 2321.	        case 8:
; 2322.	                PSG_GetInfo(&s);   
	LD	DE,s
	LD	A,BYTE3 PSG_GetInfo
	LD	HL,LWRD PSG_GetInfo
?1489:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2323.	                break;
?0929:
; 2324.	
; 2325.	        }
; 2326.	
; 2327.	        ClearString (s.Name, 32);
	LD	BC,32
	LD	DE,s+8
	LD	A,BYTE3 ClearString
	LD	HL,LWRD ClearString
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2328.	        ClearString (s.Autor,32);
	LD	BC,32
	LD	DE,s+41
	LD	A,BYTE3 ClearString
	LD	HL,LWRD ClearString
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2329.	
; 2330.	        //title1(1);
; 2331.	        gotoxy (24, 0);
	LD	C,0
	LD	E,24
	LD	A,BYTE3 gotoxy
	LD	HL,LWRD gotoxy
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2332.	        printf ("%s", "--:--:--");      
	LD	HL,?0940
	PUSH	HL
	LD	HL,?0939
	PUSH	HL
	LD	A,BYTE3 printf
	LD	HL,LWRD printf
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	POP	AF
; 2333.	}
?0941:
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2334.	
; 2335.	void detect(void)
; 2336.	{
detect:
	PUSH	BC
	PUSH	DE
; 2337.	
; 2338.	        char i;
; 2339.	
; 2340.	        vars.current_player = -1;
	LD	A,255
	LD	(vars+2),A
; 2341.	
; 2342.	
; 2343.	        for (i=0; i<NUM_PLAYERS; i++)
	XOR	A
	LD	(?0010+255),A
?0943:
	LD	A,(?0010+255)
	CP	9
	JP	NC,?0942
?0944:
; 2344.	        {
; 2345.	                s.module=(char *)D_16384; /// tut
	LD	HL,16384
	LD	(s+2),HL
; 2346.	
; 2347.	                switch (i)
	LD	DE,(?0010+255)
	CALL	LWRD ?C_S_SWITCH_L06
	DEFB	0
	DEFW	9
	DEFW	?0946
	DEFW	?0947
	DEFW	?0948
	DEFW	?0949
	DEFW	?0950
	DEFW	?0951
	DEFW	?0952
	DEFW	?0953
	DEFW	?0954
	DEFW	?0955
?0947:
; 2348.	                {
; 2349.	                case 0:
; 2350.	                        s.detected=PT1_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 PT1_Detect
	LD	HL,LWRD PT1_Detect
	JP	LWRD ?1501
; 2351.	                        break;
?0948:
; 2352.	
; 2353.	                case 1:
; 2354.	                        s.detected=PT2_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 PT2_Detect
	LD	HL,LWRD PT2_Detect
	JR	?1501
; 2355.	                        break;
?0949:
; 2356.	
; 2357.	                case 2:
; 2358.	                        s.detected=PT3_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 PT3_Detect
	LD	HL,LWRD PT3_Detect
	JR	?1501
; 2359.	                        break;
?0950:
; 2360.	
; 2361.	                case 3:
; 2362.	                        s.detected=STP_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 STP_Detect
	LD	HL,LWRD STP_Detect
	JR	?1501
; 2363.	                        break;
?0951:
; 2364.	
; 2365.	                case 4:
; 2366.	                        s.detected=ASC_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 ASC_Detect
	LD	HL,LWRD ASC_Detect
	JR	?1501
; 2367.	                        break;
?0952:
; 2368.	
; 2369.	                case 5:
; 2370.	                        s.detected=PSC_Detect(s.module, s.Length, &s);  
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 PSC_Detect
	LD	HL,LWRD PSC_Detect
	JR	?1501
; 2371.	                        break;
?0953:
; 2372.	
; 2373.	                case 6:
; 2374.	                        s.detected=STC_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 STC_Detect
	LD	HL,LWRD STC_Detect
	JR	?1501
; 2375.	                        break;
?0954:
; 2376.	
; 2377.	                case 7:
; 2378.	                        s.detected=SQT_Detect(s.module, s.Length, &s);
	LD	HL,s
	PUSH	HL
	LD	BC,(s+6)
	LD	DE,(s+2)
	LD	A,BYTE3 SQT_Detect
	LD	HL,LWRD SQT_Detect
?1501:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	JR	?1498
; 2379.	                        break;
?0955:
; 2380.	
; 2381.	                case 8:
; 2382.	                        s.detected=PSG_Detect(s.module, &s);
	LD	BC,s
	EX	DE,HL
	LD	A,BYTE3 PSG_Detect
	LD	HL,LWRD PSG_Detect
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1498:
	LD	A,L
	LD	(s+97),A
; 2383.	                        break;
?0946:
; 2384.	                }
; 2385.	
; 2386.	
; 2387.	                if (s.detected)
	LD	A,(s+97)
	OR	A
	JR	Z,?0957
?0956:
; 2388.	                {
; 2389.	                        vars.current_player = i;
	LD	A,(?0010+255)
	LD	(vars+2),A
; 2390.	                        return;
; 2391.	                }
	JR	?0942
?0957:
	LD	HL,?0010+255
	INC	(HL)
; 2392.	        }
; 2393.	
; 2394.	
; 2395.	
; 2396.	}
	JP	LWRD ?0943
?0942:
?0958:
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2397.	
; 2398.	char string_copy[32];
; 2399.	
; 2400.	void printstring1(char * arg)
; 2401.	{
printstring1:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 2402.	        if (!memcmp (arg, string_copy, 32))
	LD	HL,32
	PUSH	HL
	LD	BC,string_copy
	LD	A,BYTE3 memcmp
	LD	HL,LWRD memcmp
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
	LD	A,L
	OR	H
	JR	Z,?0962
?0959:
?0960:
; 2403.	                return;
; 2404.	        
; 2405.	        printstring(256, "                               ");    
	LD	BC,?0961
	LD	DE,256
	LD	A,BYTE3 printstring
	LD	HL,LWRD printstring
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2406.	        printstring(256, arg);  
	PUSH	IX
	POP	BC
	LD	DE,256
	LD	A,BYTE3 printstring
	LD	HL,LWRD printstring
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2407.	        memcpy(string_copy, arg, 32);
	LD	HL,32
	PUSH	HL
	PUSH	IX
	POP	BC
	LD	DE,string_copy
	LD	A,BYTE3 memcpy
	LD	HL,LWRD memcpy
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	AF
; 2408.	}
?0962:
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2409.	
; 2410.	void title1(char force)
; 2411.	{   
title1:
	PUSH	DE
; 2412.	        static char flipflop = 0;
; 2413.	
; 2414.	
; 2415.	
; 2416.	        if (!s.detected)                 
	LD	A,(s+97)
	OR	A
	JR	Z,?0979
?0964:
?0965:
; 2417.	                return;   
; 2418.	
; 2419.	        flipflop++;
	LD	HL,?0963
	INC	(HL)
; 2420.	
; 2421.	        //gotoxy(0, 1);        
; 2422.	
; 2423.	        if (force)
	XOR	A
	OR	E
	JR	Z,?0967
?0966:
; 2424.	        {
; 2425.	                if (s.Name[0])
	LD	A,(s+8)
	OR	A
	JR	NZ,?1510
?0968:
; 2426.	                {
; 2427.	                        printstring1(s.Name);                   
; 2428.	                        return;
; 2429.	                }
?0969:
; 2430.	                
; 2431.	                if (s.Autor[0])                         
	LD	A,(s+41)
	OR	A
	JR	Z,?0971
?0970:
; 2432.	                {
; 2433.	                        printstring1(s.Autor);  
	LD	DE,s+41
	JR	?1511
; 2434.	                        return;
; 2435.	                }
?0971:
; 2436.	
; 2437.	                printstring1("                               ");
	LD	DE,?0961
	JR	?1511
; 2438.	                return;
; 2439.	        }
?0967:
; 2440.	
; 2441.	        if (flipflop&4)
	LD	A,(?0963)
	BIT	2,A
	JR	Z,?0975
?0972:
; 2442.	                if (s.Autor[0])                         
	LD	A,(s+41)
	OR	A
	JR	Z,?0975
?0974:
; 2443.	                        printstring1(s.Autor);                  
	LD	DE,s+41
	LD	A,BYTE3 printstring1
	LD	HL,LWRD printstring1
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0975:
?0973:
; 2444.	
; 2445.	
; 2446.	        if (!(flipflop&4))
	LD	A,(?0963)
	BIT	2,A
	JR	NZ,?0979
?0976:
; 2447.	                if (s.Name[0])  
	LD	A,(s+8)
	OR	A
	JR	Z,?0979
?0978:
; 2448.	                        printstring1(s.Name);                   
?1510:
	LD	DE,s+8
?1511:
	LD	A,BYTE3 printstring1
	LD	HL,LWRD printstring1
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0979:
?0977:
; 2449.	                
; 2450.	}
?0980:
	POP	HL
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2451.	
; 2452.	void disker (char disk)
; 2453.	{
disker:
	PUSH	BC
	PUSH	DE
	LD	HL,0
	LD	(s+95),HL
; 2454.	        
; 2455.	        s.counter = 0;
; 2456.	        read_d(disk, 0);
	LD	C,H
	LD	A,BYTE3 read_d
	LD	HL,LWRD read_d
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2457.	        
; 2458.	}
	POP	HL
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2459.	
; 2460.	char state = 0;
; 2461.	
; 2462.	void disker2(char disk1, char disk2)
; 2463.	{
disker2:
	PUSH	BC
	PUSH	DE
	LD	HL,0
	LD	(s+95),HL
; 2464.	        
; 2465.	        s.counter = 0;
; 2466.	                        
; 2467.	
; 2468.	        read_d(disk1, 3);
	LD	C,3
	LD	A,BYTE3 read_d
	LD	HL,LWRD read_d
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2469.	        read_d(disk2, 1);
	LD	C,1
	LD	HL,2
	ADD	HL,SP
	LD	E,(HL)
	LD	A,BYTE3 read_d
	LD	HL,LWRD read_d
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2470.	
; 2471.	        state = 0;                              
	XOR	A
	LD	(state),A
; 2472.	        
; 2473.	}
	POP	HL
	POP	HL
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2474.	
; 2475.	
; 2476.	
; 2477.	
; 2478.	void o (void)
; 2479.	{
o:
	PUSH	BC
	PUSH	DE
; 2480.	
; 2481.	        unsigned char p7FFE;// -  Space...B 
; 2482.	        unsigned char pBFFE;// -  Enter...H 
; 2483.	        unsigned char pDFFE;// -  P...Y 
; 2484.	        unsigned char pEFFE;// -  0...6 
; 2485.	        unsigned char pF7FE;// -  1...5 
; 2486.	        unsigned char pFBFE;// -  Q...T 
; 2487.	        unsigned char pFDFE;// -  A...G 
; 2488.	        unsigned char pFEFE;// -  CS...V
; 2489.	
; 2490.	        char first_d = 0;
	XOR	A
	LD	(?0010+264),A
; 2491.	        
; 2492.	        char sss = 0;
	LD	(?0010+265),A
; 2493.	        char sec = 0;
	LD	(?0010+266),A
; 2494.	        unsigned char min = 0;
	LD	(?0010+267),A
?0982:
; 2495.	
; 2496.	
; 2497.	
; 2498.	
; 2499.	        //ei_();
; 2500.	
; 2501.	        while (1) 
?0983:
; 2502.	        {
; 2503.	
; 2504.	                if (!vars.dntcounter)
	LD	A,(vars+3)
	OR	A
	JP	NZ,?1062
?0984:
; 2505.	                {
; 2506.	                        p7FFE = input (0x7FFE);
	LD	DE,32766
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+256),A
; 2507.	                        pBFFE = input (0xBFFE);
	LD	DE,49150
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+257),A
; 2508.	                        pDFFE = input (0xDFFE);
	LD	DE,57342
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+258),A
; 2509.	                        pEFFE = input (0xEFFE);
	LD	DE,61438
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+259),A
; 2510.	
; 2511.	                        pF7FE = input (0xF7FE);
	LD	DE,63486
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+260),A
; 2512.	                        pFBFE = input (0xFBFE);
	LD	DE,64510
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+261),A
; 2513.	                        pFDFE = input (0xFDFE);
	LD	DE,65022
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+262),A
; 2514.	                        pFEFE = input (0xFEFE);  
	LD	DE,65278
	CALL	LWRD ?1623
	LD	A,L
	LD	(?0010+263),A
; 2515.	
; 2516.	
; 2517.	                        if (!(pDFFE&8))   // u
	LD	A,(?0010+258)
	BIT	3,A
	JR	NZ,?0987
?0986:
; 2518.	                        {
; 2519.	                                di_();
	CALL	LWRD ?1615
; 2520.	                                tiho ();
	CALL	LWRD ?1618
; 2521.	                                Shuffle();
	LD	A,BYTE3 Shuffle
	LD	HL,LWRD Shuffle
	JP	LWRD ?1558
; 2522.	                                ei_();
; 2523.	                                continue;
?0987:
; 2524.	                        }                       
; 2525.	
; 2526.	                        if (!(p7FFE&2))
	LD	A,(?0010+256)
	BIT	1,A
	JP	NZ,?0989
?0988:
; 2527.	                        {
; 2528.	                                if (state == 0)
	LD	A,(state)
	OR	A
	JR	NZ,?0999
?0990:
; 2529.	                                {
; 2530.	                                        if (!(pFDFE&1))   // a  
	LD	A,(?0010+262)
	BIT	0,A
	JR	NZ,?0993
?0992:
; 2531.	                                        {
; 2532.	                                                first_d = 0;    
	XOR	A
	LD	(?0010+264),A
; 2533.	                                                state = 1;              
	LD	A,1
	LD	(state),A
?0993:
; 2534.	                                        }
; 2535.	
; 2536.	                                        if (!(p7FFE&16))  // b
	LD	A,(?0010+256)
	BIT	4,A
	JR	NZ,?0995
?0994:
; 2537.	                                        {
; 2538.	                                                first_d = 1;
	LD	A,1
	LD	(?0010+264),A
; 2539.	                                                state = 1;
	LD	(state),A
?0995:
; 2540.	                                        }
; 2541.	
; 2542.	                                        if (!(pFEFE&8))   // c
	LD	A,(?0010+263)
	BIT	3,A
	JR	NZ,?0997
?0996:
; 2543.	                                        {
; 2544.	                                                first_d = 2;       
	LD	A,2
	LD	(?0010+264),A
; 2545.	                                                state = 1;
	LD	A,1
	LD	(state),A
?0997:
; 2546.	                                        }
; 2547.	
; 2548.	                                        if (!(pFDFE&4))   // d                          
	LD	A,(?0010+262)
	BIT	2,A
	JR	NZ,?0999
?0998:
; 2549.	                                        {
; 2550.	                                                first_d = 3;
	LD	A,3
	LD	(?0010+264),A
; 2551.	                                                state = 1;
	LD	A,1
	LD	(state),A
?0999:
?0991:
; 2552.	                                        }                              
; 2553.	                                }
; 2554.	
; 2555.	                                if (state == 1)
	LD	A,(state)
	DEC	A
	JP	NZ,?0982
?1000:
; 2556.	                                {
; 2557.	                                        if ((!(pFDFE& 1)) && (first_d != 0))  // +a  
	LD	A,(?0010+262)
	BIT	0,A
	JR	NZ,?1003
	LD	A,(?0010+264)
	OR	A
	JR	Z,?1003
?1005:
?1004:
?1002:
; 2558.	                                        {
; 2559.	                                                di_();
	CALL	LWRD ?1615
; 2560.	                                                disker2(first_d, 0);
	LD	C,0
; 2561.	                                                ei_();
	CALL	LWRD ?1617
?1003:
; 2562.	                                        }
; 2563.	
; 2564.	                                        if ((!(p7FFE&16)) && (first_d != 1))  // +b                            
	LD	A,(?0010+256)
	BIT	4,A
	JR	NZ,?1007
	LD	A,(?0010+264)
	DEC	A
	JR	Z,?1007
?1009:
?1008:
?1006:
; 2565.	                                        {
; 2566.	                                                di_();
	CALL	LWRD ?1615
; 2567.	                                                disker2(first_d, 1);    
	LD	C,1
; 2568.	                                                ei_();                                          
	CALL	LWRD ?1617
?1007:
; 2569.	                                        }
; 2570.	
; 2571.	                                        if ((!(pFEFE& 8)) && (first_d != 2))  // +c                            
	LD	A,(?0010+263)
	BIT	3,A
	JR	NZ,?1011
	LD	A,(?0010+264)
	DEC	A
	DEC	A
	JR	Z,?1011
?1013:
?1012:
?1010:
; 2572.	                                        {
; 2573.	                                                di_();
	CALL	LWRD ?1615
; 2574.	                                                disker2(first_d, 2);                        
	LD	C,2
; 2575.	                                                ei_();
	CALL	LWRD ?1617
?1011:
; 2576.	                                        }
; 2577.	
; 2578.	                                        if ((!(pFDFE& 4)) && (first_d != 3))  // +d                             
	LD	A,(?0010+262)
	BIT	2,A
	JP	NZ,?0982
	LD	A,(?0010+264)
	CP	3
	JP	Z,?0982
?1017:
?1016:
?1014:
; 2579.	                                        {
; 2580.	                                                di_();
	CALL	LWRD ?1615
; 2581.	                                                disker2(first_d, 3);                                                                                                            
	LD	C,3
	LD	DE,(?0010+264)
	LD	A,BYTE3 disker2
	LD	HL,LWRD disker2
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2582.	                                                ei_();
	JP	LWRD ?1548
?1015:
?1001:
; 2583.	                                        }
; 2584.	                                }
; 2585.	
; 2586.	                                continue;
?0989:
; 2587.	                        }                        
; 2588.	                        else
; 2589.	                                state = 0;
	XOR	A
	LD	(state),A
; 2590.	
; 2591.	
; 2592.	                        if (!(pFDFE&1))   // a  
	LD	A,(?0010+262)
	BIT	0,A
	JR	NZ,?1019
?1018:
; 2593.	                        {
; 2594.	                                di_();
	CALL	LWRD ?1615
; 2595.	                                disker(0);
	LD	E,0
	JR	?1541
; 2596.	                                ei_();
; 2597.	                                continue;
?1019:
; 2598.	                        }
; 2599.	
; 2600.	                        if (!(p7FFE&16))  // b
	LD	A,(?0010+256)
	BIT	4,A
	JR	NZ,?1021
?1020:
; 2601.	                        {
; 2602.	                                di_();
	CALL	LWRD ?1615
; 2603.	                                disker(1);
	LD	E,1
	JR	?1541
; 2604.	                                ei_();
; 2605.	                                continue;
?1021:
; 2606.	                        }  
; 2607.	
; 2608.	                        if (!(pFEFE&8))   // c
	LD	A,(?0010+263)
	BIT	3,A
	JR	NZ,?1023
?1022:
; 2609.	                        {
; 2610.	                                di_();
	CALL	LWRD ?1615
; 2611.	                                disker(2);
	LD	E,2
	JR	?1541
; 2612.	                                ei_();
; 2613.	                                continue;
?1023:
; 2614.	                        }               
; 2615.	
; 2616.	                        if (!(pFDFE&4))   // d                          
	LD	A,(?0010+262)
	BIT	2,A
	JR	NZ,?1025
?1024:
; 2617.	                        {
; 2618.	                                di_();
	CALL	LWRD ?1615
; 2619.	                                disker(3);
	LD	E,3
?1541:
	LD	A,BYTE3 disker
	LD	HL,LWRD disker
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2620.	                                ei_();
	JP	LWRD ?1548
; 2621.	                                continue;
?1025:
; 2622.	                        }
; 2623.	
; 2624.	
; 2625.	
; 2626.	                        if (!(pFBFE&8)) // r
	LD	A,(?0010+261)
	BIT	3,A
	JR	NZ,?1027
?1026:
; 2627.	                        {                             
; 2628.	                                di_();
	CALL	LWRD ?1615
; 2629.	                                s.counter = 0;
	LD	HL,0
	LD	(s+95),HL
; 2630.	                                Getnfiles();
	LD	A,BYTE3 Getnfiles
	LD	HL,LWRD Getnfiles
	JP	LWRD ?1558
; 2631.	                                ei_();
; 2632.	                                continue;   
?1027:
; 2633.	                        }                       
; 2634.	
; 2635.	
; 2636.	                        if (!(pBFFE&1))   // Enter
	LD	A,(?0010+257)
	BIT	0,A
	JR	NZ,?1029
?1028:
; 2637.	                        {
; 2638.	                                di_();
	CALL	LWRD ?1615
; 2639.	                                s.counter = 0;
	LD	HL,0
	LD	(s+95),HL
; 2640.	                                play(vars.tek_file);
	LD	DE,(vars+4)
	LD	A,BYTE3 play
	LD	HL,LWRD play
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2641.	                                ei_();
	JP	LWRD ?1548
; 2642.	                                continue;
?1029:
; 2643.	                        }
; 2644.	
; 2645.	
; 2646.	                        if ( (!(pFEFE&1)) && (!(pEFFE&16)) )   // Down
	LD	A,(?0010+263)
	BIT	0,A
	JR	NZ,?1031
	LD	A,(?0010+259)
	BIT	4,A
	JR	NZ,?1031
?1033:
?1032:
?1030:
; 2647.	                        {
; 2648.	                                di_();                  
	CALL	LWRD ?1615
; 2649.	                                curcor(1);      
	LD	DE,1
	JR	?1566
; 2650.	                                ei_();
; 2651.	                                continue;
?1031:
; 2652.	                        }
; 2653.	
; 2654.	
; 2655.	                        if ( (!(pFEFE&1)) && (!(pEFFE&8)) )   // Up
	LD	A,(?0010+263)
	BIT	0,A
	JR	NZ,?1035
	LD	A,(?0010+259)
	BIT	3,A
	JR	NZ,?1035
?1037:
?1036:
?1034:
; 2656.	                        {
; 2657.	                                di_();
	CALL	LWRD ?1615
; 2658.	                                curcor(-1);     
	LD	DE,65535
	JR	?1566
; 2659.	                                ei_();
; 2660.	                                continue;
?1035:
; 2661.	                        }
; 2662.	
; 2663.	                        if ( (!(pFEFE&1)) && (!(pEFFE&4)) )   // Right
	LD	A,(?0010+263)
	BIT	0,A
	JR	NZ,?1039
	LD	A,(?0010+259)
	BIT	2,A
	JR	NZ,?1039
?1041:
?1040:
?1038:
; 2664.	                        {
; 2665.	                                di_();
	CALL	LWRD ?1615
; 2666.	                                curcor(num_l);
	LD	DE,16
	JR	?1566
; 2667.	                                ei_();
; 2668.	                                continue;       
?1039:
; 2669.	                        }
; 2670.	
; 2671.	                        if ( (!(pFEFE&1)) && (!(pF7FE&16)) )   // Left
	LD	A,(?0010+263)
	BIT	0,A
	JR	NZ,?1043
	LD	A,(?0010+260)
	BIT	4,A
	JR	NZ,?1043
?1045:
?1044:
?1042:
; 2672.	                        {
; 2673.	                                di_();
	CALL	LWRD ?1615
; 2674.	                                curcor(0-num_l);        
	LD	DE,65520
?1566:
	LD	A,BYTE3 curcor
	LD	HL,LWRD curcor
	JR	?1564
; 2675.	                                ei_();
; 2676.	                                continue;
?1043:
; 2677.	                        }
; 2678.	
; 2679.	                        if (!(pDFFE&1))   // p
	LD	A,(?0010+258)
	BIT	0,A
	JR	NZ,?1047
?1046:
; 2680.	                        {
; 2681.	                                di_();
	CALL	LWRD ?1615
; 2682.	
; 2683.	                                if (s.play)
	LD	A,(s+98)
	OR	A
	JR	Z,?1049
?1048:
; 2684.	                                        stop();
	LD	A,BYTE3 stop
	LD	HL,LWRD stop
	JR	?1532
; 2685.	                                else  
?1049:
; 2686.	                                        resume();
	LD	A,BYTE3 resume
	LD	HL,LWRD resume
?1532:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1050:
; 2687.	
; 2688.	                                vars.dntcounter=5;
	LD	A,5
	LD	(vars+3),A
; 2689.	
; 2690.	                                ei_();
	JR	?1548
; 2691.	
; 2692.	                                continue;
?1047:
; 2693.	                        }
; 2694.	
; 2695.	                        if (!(p7FFE&4))  // m
	LD	A,(?0010+256)
	BIT	2,A
	JR	NZ,?1052
?1051:
; 2696.	                        {
; 2697.	                                di_();
	CALL	LWRD ?1615
; 2698.	                                next_m();
	LD	A,BYTE3 next_m
	LD	HL,LWRD next_m
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2699.	                                delay(10000);
	LD	DE,10000
	LD	A,BYTE3 delay
	LD	HL,LWRD delay
?1564:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2700.	                                ei_();
	JR	?1548
; 2701.	                                
; 2702.	                                continue;
?1052:
; 2703.	                        }  
; 2704.	
; 2705.	                        if ( (!(p7FFE&8)) ||  (!(p7FFE&1)))   // n, space
	BIT	3,A
	JR	Z,?1055
	BIT	0,A
	JR	NZ,?1054
?1055:
?1056:
?1053:
; 2706.	                        {
; 2707.	                                di_();
	CALL	LWRD ?1615
; 2708.	                                s.counter = 0;
	LD	HL,0
	LD	(s+95),HL
; 2709.	                                vars.depth =0;
	XOR	A
	LD	(vars+6),A
; 2710.	                                next();
	LD	A,BYTE3 next
	LD	HL,LWRD next
	JR	?1558
; 2711.	                                ei_();
; 2712.	                                continue;
?1054:
; 2713.	                        }
; 2714.	
; 2715.	                        if (!(pBFFE&2))   // l
	LD	A,(?0010+257)
	BIT	1,A
	JR	NZ,?1058
?1057:
; 2716.	                        {               
; 2717.	                                di_();
	CALL	LWRD ?1615
; 2718.	                                l();
	LD	A,BYTE3 l
	LD	HL,LWRD l
	JR	?1558
; 2719.	                                ei_();
; 2720.	                                continue;
?1058:
; 2721.	                        }
; 2722.	
; 2723.	                        if (!(pDFFE&2))   // o  
	LD	A,(?0010+258)
	BIT	1,A
	JR	NZ,?1060
?1059:
; 2724.	                        {
; 2725.	                                di_();                  
	CALL	LWRD ?1615
; 2726.	                                sort();
	LD	A,BYTE3 sort
	LD	HL,LWRD sort
	JR	?1558
; 2727.	                                ei_();
; 2728.	                                continue;
?1060:
; 2729.	                        }
; 2730.	
; 2731.	                        if ((!(pFEFE&1)) && (!(pEFFE&1)))   // back
	LD	A,(?0010+263)
	BIT	0,A
	JR	NZ,?1062
	LD	A,(?0010+259)
	BIT	0,A
	JR	NZ,?1062
?1064:
?1063:
?1061:
; 2732.	                        {       
; 2733.	                                di_();
	CALL	LWRD ?1615
; 2734.	                                vars.depth =0;   
	XOR	A
	LD	(vars+6),A
; 2735.	                                back();
	LD	A,BYTE3 back
	LD	HL,LWRD back
?1558:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2736.	                                ei_();
?1548:
	CALL	LWRD ?1616
; 2737.	                                continue;
	JP	LWRD ?0982
?1062:
?0985:
; 2738.	                        }
; 2739.	
; 2740.	                }
; 2741.	
; 2742.	
; 2743.	                if ((s.counter >= s.len) && (s.play))  
	LD	BC,(s+99)
	LD	HL,(s+95)
	SBC	HL,BC
	JR	C,?1079
	LD	A,(s+98)
	OR	A
	JR	Z,?1079
?1068:
?1067:
?1065:
; 2744.	                {
; 2745.	                        if (vars.play_mode == 1)
	LD	A,(vars+1)
	DEC	A
	JR	Z,?1078
?1069:
; 2746.	                        {
; 2747.	                                di_();
; 2748.	                                re();                                                           
; 2749.	                                ei_();
; 2750.	                        }  
; 2751.	                        else      
?1070:
; 2752.	                                if (!vars.play_mode)
	LD	A,(vars+1)
	OR	A
	JR	NZ,?1073
?1072:
; 2753.	                                {       
; 2754.	                                        di_();                
	CALL	LWRD ?1615
; 2755.	                                        s.counter = 0;  
	LD	HL,0
	LD	(s+95),HL
; 2756.	                                        vars.depth =0;  
	JR	?1542
; 2757.	                                        next();
; 2758.	                                        ei_();
; 2759.	                                }
; 2760.	                                else
?1073:
; 2761.	                                        if (vars.play_mode == 2)
	DEC	A
	DEC	A
	JR	NZ,?1079
?1075:
; 2762.	                                        {
; 2763.	                                                s.counter = 0;  
	LD	L,A
	LD	H,A
	LD	(s+95),HL
; 2764.	
; 2765.	                                                vars.flip_flop_p = 1 - vars.flip_flop_p;
	LD	A,(vars)
	LD	B,A
	LD	A,1
	SUB	B
	LD	(vars),A
; 2766.	
; 2767.	                                                if (!vars.flip_flop_p)
	JR	NZ,?1078
?1077:
; 2768.	                                                {       
; 2769.	                                                        di_();                                        
	CALL	LWRD ?1615
; 2770.	                                                        vars.depth = 0; 
?1542:
	XOR	A
	LD	(vars+6),A
; 2771.	                                                        next();                                                 
	LD	A,BYTE3 next
	LD	HL,LWRD next
	JR	?1534
; 2772.	                                                        ei_();
; 2773.	                                                }
; 2774.	                                                else
?1078:
; 2775.	                                                {
; 2776.	                                                        di_();
	CALL	LWRD ?1615
; 2777.	                                                        re();   
	LD	A,BYTE3 re
	LD	HL,LWRD re
?1534:
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2778.	                                                        ei_();                                                                                  
	CALL	LWRD ?1616
?1079:
?1076:
?1074:
?1071:
?1066:
; 2779.	                                                }
; 2780.	                                        }
; 2781.	                }
; 2782.	                
; 2783.	                
; 2784.	                if (II)
	LD	A,(II)
	OR	A
	JP	Z,?0982
?1080:
; 2785.	                {
; 2786.	                        if (vars.dntcounter)  vars.dntcounter--;
	LD	A,(vars+3)
	OR	A
	JR	Z,?1083
?1082:
	LD	HL,vars+3
	DEC	(HL)
?1083:
; 2787.	
; 2788.	                        if (s.counter<2)
	LD	HL,(s+95)
	LD	BC,2
	SBC	HL,BC
	JR	NC,?1085
?1084:
; 2789.	                        {
; 2790.	                                min = 0;
	XOR	A
	LD	(?0010+267),A
; 2791.	                                sec = 1;
	LD	A,1
	LD	(?0010+266),A
; 2792.	                                sss = 0;
	XOR	A
	LD	(?0010+265),A
; 2793.	                                
; 2794.	                                di_();
	CALL	LWRD ?1615
; 2795.	                                title1(1);
	LD	E,1
	LD	A,BYTE3 title1
	LD	HL,LWRD title1
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2796.	                                ei_();
	CALL	LWRD ?1616
?1085:
; 2797.	                        }
; 2798.	
; 2799.	                        sss++;
	LD	HL,?0010+265
	INC	(HL)
; 2800.	
; 2801.	                        if (sss==50)
	LD	A,(?0010+265)
	CP	50
	JR	NZ,?1091
?1086:
; 2802.	                        {
; 2803.	                                sss=0;
	XOR	A
	LD	(?0010+265),A
; 2804.	                        
; 2805.	                                if (!s.slow)    
	LD	A,(s+109)
	OR	A
	JR	NZ,?1089
?1088:
; 2806.	                                {
; 2807.	                                        di_();
	CALL	LWRD ?1615
; 2808.	                                        title1(0);
	LD	E,B
	LD	A,BYTE3 title1
	LD	HL,LWRD title1
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2809.	                                        ei_();                                  
	CALL	LWRD ?1616
?1089:
; 2810.	                                }                                       
; 2811.	                                
; 2812.	                                if ((s.slow)<2)                         
	LD	A,(s+109)
	CP	2
	JR	NC,?1091
?1090:
; 2813.	                                {
; 2814.	                                        di_();
	CALL	LWRD ?1615
; 2815.	                                        clock ();
	LD	A,BYTE3 clock
	LD	HL,LWRD clock
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2816.	                                        ei_();                                  
	CALL	LWRD ?1616
?1091:
?1087:
; 2817.	                                }                               
; 2818.	                        }
; 2819.	
; 2820.	                        if (s.play) 
	LD	A,(s+98)
	OR	A
	JR	Z,?1099
?1092:
; 2821.	                        {       
; 2822.	                                if (!sss)
	LD	A,(?0010+265)
	OR	A
	JR	NZ,?1099
?1094:
; 2823.	                                {
; 2824.	                                        if ((s.slow)<3)
	LD	A,(s+109)
	CP	3
	JR	NC,?1097
?1096:
; 2825.	                                        {
; 2826.	                                                di_();
	CALL	LWRD ?1615
; 2827.	                                                printstring(512, d2s(min));
	LD	DE,(?0010+267)
	LD	A,BYTE3 d2s
	LD	HL,LWRD d2s
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	C,L
	LD	B,H
	LD	DE,512
	LD	A,BYTE3 printstring
	LD	HL,LWRD printstring
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2828.	                                                printstring(512+3, d2s(sec));   
	LD	DE,(?0010+266)
	LD	A,BYTE3 d2s
	LD	HL,LWRD d2s
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	LD	C,L
	LD	B,H
	LD	DE,515
	LD	A,BYTE3 printstring
	LD	HL,LWRD printstring
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2829.	                                                ei_();
	CALL	LWRD ?1616
?1097:
; 2830.	                                        }
; 2831.	
; 2832.	                                        sec++;
	LD	HL,?0010+266
	INC	(HL)
; 2833.	                                        
; 2834.	                                        if (sec==60)
	LD	A,(?0010+266)
	CP	60
	JR	NZ,?1099
?1098:
; 2835.	                                        { 
; 2836.	                                                sec = 0;
	XOR	A
	LD	(?0010+266),A
; 2837.	                                                min++;
	LD	HL,?0010+267
	INC	(HL)
?1099:
?1095:
?1093:
; 2838.	                                        }       
; 2839.	                                }
; 2840.	                        }
; 2841.	                
; 2842.	                        II=0;
	XOR	A
	LD	(II),A
?1081:
; 2843.	                }
; 2844.	                
; 2845.	        }
; 2846.	}
	JP	LWRD ?0982
?1619:
	LD	(s+98),A
?1618:
	LD	A,BYTE3 tiho
	LD	HL,LWRD tiho
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1623:
	LD	A,BYTE3 input
	LD	HL,LWRD input
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?0981:
; 2847.	
; 2848.	
; 2849.	char copy[16];
; 2850.	
; 2851.	void ay_writeay(unsigned char reg, unsigned char val)
; 2852.	{
ay_writeay:
	PUSH	BC
	PUSH	DE
; 2853.	        if ((reg==0xff) && (val==0xff))
	LD	B,E
	INC	B
	JR	NZ,?1101
	LD	B,C
	INC	B
	JR	NZ,?1101
?1103:
?1102:
?1100:
; 2854.	        {
; 2855.	                output(0xFFFD, 8); output(0xBFFD, copy[8]);  
	LD	C,8
	CALL	LWRD ?1621
	LD	BC,(copy+8)
	LD	DE,49149
	CALL	LWRD ?1622
; 2856.	                output(0xFFFD, 9); output(0xBFFD, copy[9]);  
	LD	C,9
	CALL	LWRD ?1621
	LD	BC,(copy+9)
	LD	DE,49149
	CALL	LWRD ?1622
; 2857.	                output(0xFFFD, 10); output(0xBFFD, copy[10]);  
	LD	C,10
	CALL	LWRD ?1621
	LD	BC,(copy+10)
	JR	?1572
; 2858.	
; 2859.	                return;
; 2860.	        }
?1101:
; 2861.	
; 2862.	        copy[reg] = val;
	LD	HL,0
	ADD	HL,SP
	LD	C,(HL)
	LD	B,0
	LD	HL,copy
	ADD	HL,BC
	PUSH	HL
	LD	HL,4
	ADD	HL,SP
	LD	B,(HL)
	POP	HL
	LD	(HL),B
; 2863.	
; 2864.	        output(0xFFFD, reg);
	CALL	LWRD ?1621
; 2865.	        output(0xBFFD, val);
	LD	HL,2
	ADD	HL,SP
	LD	C,(HL)
?1572:
	LD	DE,49149
	CALL	LWRD ?1622
; 2866.	}
?1104:
	POP	HL
	POP	HL
	JP	LWRD ?BANK_FAST_LEAVE_L08
?1621:
	LD	DE,65533
?1622:
	LD	A,BYTE3 output
	LD	HL,LWRD output
	JP	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2867.	
; 2868.	
; 2869.	
; 2870.	char ay_readay(unsigned char reg)
; 2871.	{
ay_readay:
	PUSH	BC
	PUSH	DE
; 2872.	        return(copy[reg]);
	LD	C,E
	LD	B,0
	LD	HL,copy
	ADD	HL,BC
	LD	L,(HL)
; 2873.	}
	POP	AF
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2874.	
; 2875.	char d2srv[3]={0};
; 2876.	
; 2877.	char * d2s(unsigned char v)
; 2878.	{
d2s:
	PUSH	BC
	PUSH	DE
; 2879.	        d2srv[0] = v/10 + '0';
	LD	B,10
	LD	A,E
	CALL	LWRD ?UC_DIV_L01
	ADD	A,48
	LD	(d2srv),A
; 2880.	        d2srv[1] = v%10 + '0';
	LD	A,E
	CALL	LWRD ?UC_MOD_L01
	ADD	A,48
	LD	(d2srv+1),A
; 2881.	        
; 2882.	        return (d2srv);
	LD	HL,d2srv
; 2883.	}
	POP	AF
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2884.	
; 2885.	
; 2886.	void ClearString(char * name, int len)
; 2887.	{
ClearString:
	PUSH	IX
	PUSH	BC
	PUSH	DE
	POP	IX
; 2888.	        signed char i;
; 2889.	
; 2890.	        for (i=(len-1); i>=0; i--)
	LD	B,C
	DEC	B
	LD	A,B
	LD	(?0010+268),A
?1106:
	LD	A,(?0010+268)
	OR	A
	JP	M,?1105
?1107:
; 2891.	        {
; 2892.	                if ((name[i]==' ') || (!name[i])) 
	LD	BC,(?0010+268)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	PUSH	IX
	POP	HL
	ADD	HL,BC
	LD	A,(HL)
	CP	32
	JR	Z,?1111
	LD	BC,(?0010+268)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	PUSH	IX
	POP	HL
	ADD	HL,BC
	LD	A,(HL)
	OR	A
	JR	NZ,?1105
?1111:
?1112:
?1109:
; 2893.	                        name[i]=0;
	LD	BC,(?0010+268)
	LD	A,C
	RLCA
	SBC	A,A
	LD	B,A
	PUSH	IX
	POP	HL
	ADD	HL,BC
	LD	(HL),0
; 2894.	                else
?1110:
; 2895.	                        return;
; 2896.	        }
?1113:
	LD	HL,?0010+268
	DEC	(HL)
; 2897.	}
	JR	?1106
?1105:
?1114:
	POP	HL
	POP	IX
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2898.	
; 2899.	
; 2900.	extern unsigned int nfiles;
; 2901.	
; 2902.	extern int playing;
; 2903.	
; 2904.	
; 2905.	void stop (void)
; 2906.	{
stop:
	PUSH	BC
	PUSH	DE
	LD	HL,(nfiles)
	LD	A,L
	OR	H
	JR	Z,?1118
; 2907.	        if (!nfiles) return; 
?1115:
?1116:
; 2908.	
; 2909.	        if (s.play==1)
	LD	A,(s+98)
	DEC	A
	JR	NZ,?1118
?1117:
; 2910.	        {
; 2911.	                s.play=0;
; 2912.	                tiho();
	CALL	LWRD ?1619
; 2913.	                Status ("PAUSE", 0, 0, 1);
	LD	HL,1
	PUSH	HL
	DEC	HL
	PUSH	HL
	LD	C,L
	LD	B,H
	LD	DE,?1119
	LD	A,BYTE3 Status
	LD	HL,LWRD Status
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	HL
	POP	HL
; 2914.	                attr_new (0, 6, GREEN, BLACK, 0, 0);
	LD	C,0
	PUSH	BC
	PUSH	BC
	PUSH	BC
	LD	C,4
	PUSH	BC
	LD	C,6
	LD	E,0
	LD	A,BYTE3 attr_new
	LD	HL,LWRD attr_new
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	HL
	POP	HL
	POP	HL
	POP	HL
?1118:
; 2915.	        }
; 2916.	}
?1120:
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2917.	
; 2918.	void resume (void)
; 2919.	{
resume:
	PUSH	BC
	PUSH	DE
	LD	HL,(nfiles)
	LD	A,L
	OR	H
	JR	Z,?1123
; 2920.	        if (!nfiles) return; 
?1121:
?1122:
; 2921.	
; 2922.	        s.play=1;
	LD	A,1
	LD	(s+98),A
; 2923.	        attr_new (0, 6, GREEN, BLACK, 0, 1);
	LD	C,A
	PUSH	BC
	LD	C,0
	PUSH	BC
	PUSH	BC
	LD	C,4
	PUSH	BC
	LD	C,6
	LD	E,0
	LD	A,BYTE3 attr_new
	LD	HL,LWRD attr_new
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
	POP	HL
	POP	HL
	POP	HL
	POP	HL
; 2924.	
; 2925.	        dstatus();
	LD	A,BYTE3 dstatus
	LD	HL,LWRD dstatus
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2926.	}
?1123:
	POP	DE
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2927.	
; 2928.	
; 2929.	void re(void)
; 2930.	{
re:
; 2931.	        s.counter = 0;          
	LD	HL,0
	LD	(s+95),HL
; 2932.	
; 2933.	        if ((vars.current_player==2) || (vars.current_player==8))
	LD	A,(vars+2)
	DEC	A
	DEC	A
	JR	Z,?1126
	LD	A,(vars+2)
	CP	8
	JR	NZ,?1125
?1126:
?1127:
?1124:
; 2934.	        {       
; 2935.	                s.play = 0;                               
	XOR	A
; 2936.	                tiho();
	CALL	LWRD ?1619
; 2937.	                init();
	LD	A,BYTE3 init
	LD	HL,LWRD init
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2938.	                s.play = 1;
	LD	A,1
	LD	(s+98),A
; 2939.	                dstatus();
	LD	A,BYTE3 dstatus
	LD	HL,LWRD dstatus
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1125:
; 2940.	        }
; 2941.	}
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2942.	
; 2943.	
; 2944.	
; 2945.	void FN(AYSongInfo * info)
; 2946.	{
FN:
	PUSH	BC
	PUSH	IX
	PUSH	DE
	POP	IX
; 2947.	        char i;
; 2948.	
; 2949.	        strncpy(info->Name, info->filename, 8);
	LD	HL,8
	PUSH	HL
	LD	L,101
	ADD	HL,DE
	LD	C,L
	LD	B,H
	LD	HL,8
	CALL	LWRD ?1611
	POP	AF
; 2950.	
; 2951.	        for (i=0; i<8; i++)
	XOR	A
	LD	(?0010+269),A
?1129:
	LD	A,(?0010+269)
	CP	8
	JR	NC,?1128
?1130:
; 2952.	                if (info->Name[i]=='.')
	LD	C,A
	LD	B,0
	PUSH	IX
	POP	HL
	ADD	HL,BC
	LD	C,8
	ADD	HL,BC
	LD	A,(HL)
	CP	46
	JR	NZ,?1133
?1132:
; 2953.	                        info->Name[i]=0;
	LD	BC,(?0010+269)
	LD	B,0
	PUSH	IX
	POP	HL
	ADD	HL,BC
	LD	C,8
	ADD	HL,BC
	LD	(HL),B
?1133:
	LD	HL,?0010+269
	INC	(HL)
; 2954.	}
	JR	?1129
?1128:
	POP	IX
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
; 2955.	
; 2956.	
; 2957.	void back (void)
; 2958.	{
back:
	PUSH	BC
; 2959.	        if (!nfiles) return;
	LD	HL,(nfiles)
	LD	A,L
	OR	H
	JR	Z,?1138
?1134:
?1135:
; 2960.	
; 2961.	
; 2962.	
; 2963.	        tiho();
	CALL	LWRD ?1618
; 2964.	
; 2965.	        if (s.counter>250)
	LD	BC,(s+95)
	LD	HL,250
	AND	A
	SBC	HL,BC
	JR	NC,?1137
?1136:
; 2966.	        {
; 2967.	                s.play = 0;
	XOR	A
	LD	(s+98),A
; 2968.	
; 2969.	                init();
	LD	A,BYTE3 init
	LD	HL,LWRD init
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2970.	                s.counter = 0;
	LD	HL,0
	LD	(s+95),HL
; 2971.	
; 2972.	                d_dntcounter
	LD	A,5
	LD	(vars+3),A
; 2973.	                        dstatus();
	LD	A,BYTE3 dstatus
	LD	HL,LWRD dstatus
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
; 2974.	                s.play = 1;
	LD	A,1
	LD	(s+98),A
; 2975.	        }
; 2976.	        else
	JR	?1138
?1137:
; 2977.	                back_classic();
	LD	A,BYTE3 back_classic
	LD	HL,LWRD back_classic
	CALL	LWRD ?BANK_CALL_DIRECT_EXAF_L08
?1138:
; 2978.	}
?1139:
	POP	BC
	JP	LWRD ?BANK_FAST_LEAVE_L08
	RSEG	CSTR
?0311:
	DEFB	'Pro Sound Creator'
	DEFB	0
?0709:
	DEFB	'ASC Sound Master'
	DEFB	0
?0712:
	DEFB	'AS0'
	DEFB	0
?0867:
	DEFB	'(null)'
	DEFB	0
?0914:
	DEFB	'Initialising...'
	DEFB	0
?0928:
	DEFB	'Get_info'
	DEFB	0
?0939:
	DEFB	'%s'
	DEFB	0
?0940:
	DEFB	'--:--:--'
	DEFB	0
?0961:
	DEFB	'                               '
	DEFB	0
?1119:
	DEFB	'PAUSE'
	DEFB	0
	RSEG	CONST
ASM_Table:
	DEFW	3804
	DEFW	3591
	DEFW	3390
	DEFW	3200
	DEFW	3020
	DEFW	2850
	DEFW	2690
	DEFW	2540
	DEFW	2396
	DEFW	2262
	DEFW	2136
	DEFW	2016
	DEFW	1902
	DEFW	1796
	DEFW	1695
	DEFW	1600
	DEFW	1510
	DEFW	1425
	DEFW	1345
	DEFW	1270
	DEFW	1198
	DEFW	1131
	DEFW	1068
	DEFW	1008
	DEFW	951
	DEFW	898
	DEFW	847
	DEFW	800
	DEFW	755
	DEFW	712
	DEFW	673
	DEFW	635
	DEFW	599
	DEFW	566
	DEFW	534
	DEFW	504
	DEFW	476
	DEFW	449
	DEFW	424
	DEFW	400
	DEFW	377
	DEFW	356
	DEFW	336
	DEFW	317
	DEFW	300
	DEFW	283
	DEFW	267
	DEFW	252
	DEFW	238
	DEFW	224
	DEFW	212
	DEFW	200
	DEFW	189
	DEFW	178
	DEFW	168
	DEFW	159
	DEFW	150
	DEFW	141
	DEFW	133
	DEFW	126
	DEFW	119
	DEFW	112
	DEFW	106
	DEFW	100
	DEFW	94
	DEFW	89
	DEFW	84
	DEFW	80
	DEFW	75
	DEFW	71
	DEFW	67
	DEFW	63
	DEFW	60
	DEFW	56
	DEFW	53
	DEFW	50
	DEFW	47
	DEFW	45
	DEFW	42
	DEFW	40
	DEFW	38
	DEFW	36
	DEFW	34
	DEFW	32
	DEFW	30
	DEFW	28
	RSEG	TEMP
?0010:
	DEFS	270
	RSEG	UDATA0
ppp:
	DEFS	114
offset:
	DEFS	2
asc:
	DEFS	120
g:
	DEFS	221
decode_buffers:
	DEFS	16
X:
	DEFS	1
Y:
	DEFS	1
pc_counter:
	DEFS	1
string_copy:
	DEFS	32
copy:
	DEFS	16
	RSEG	IDATA0
pp:
	DEFS	2
II:
	DEFS	1
?0963:
	DEFS	1
state:
	DEFS	1
d2srv:
	DEFS	3
	RSEG	CDATA0
	DEFW	0
	DEFB	0
	DEFB	0
	DEFB	0
	DEFB	0
	DEFB	0,0
	END
