File : ys_main.asm RICOH SFX ASSEMBLER VER. V2.11Tue Aug  1 16:33:06 1995

     1				;************************************************************************
     2				;*									*
     3				;*	title name	: "yossy"					*
     4				;*	proccess	: system main					*
     5				;*	file name	: ys_main					*
     6				;*									*
     7				;************************************************************************
     8				;
     9				;
    10						SALL
    11				;
    12						include		ys_header.inc
    13						include		ys_unit.h
    14						include		../sound/ys_sound.h
    15				;
    16						XALL
    17				;
    18				;
    19				;------------------------------------------------------------------------
    20				;-		global symbol						-
    21				;------------------------------------------------------------------------
    22						GLB	system_pause
    23				;
    24						GLB	BLNKON,BLNKOFF,DMA_M_M,DMA_D_M,RAMCLR,URAMCLR,VRAMCL
    25						GLB	VRAMCL2,OAMCLR,OAMDXCLR,OAMCHG,JSRSUB,JSLSUB
    26						GLB	RANDAM,FADEST_SUB
    27						GLB	SOUND_TR,SOUND_TR_2
    28						GLB	SOUND_3_ON
    29				;
    30						GLB	VCLDAT
    31				;
    32						GLB	GMIN,GMFD,GMPL,MPIN,TMUP,DMIN,D_00,D_01,SFCSTP
    33						GLB	HMPIN,HMPPL,HMPDM,BNSGM,BNSMV,MINPL,MINIT
    34						GLB	HMPHIDM,BS_SCRE,HMPWDCRDM,INT_GM,HF_STAT,KEYSTP
    35						GLB	GM_OVR,AGAIN,BNSIN,HMPFAD,GM_CTN
    36				;
    37						GLB	TITLE_SOUND,W1_0_SOUND,MAP_SOUND,END_SOUND
    38				;
    39				;------------------------------------------------------------------------
    40				;-		extern symbol						-
    41				;------------------------------------------------------------------------
    42				;
    43				;-------------< ys_save >------------------------------------------------
    44						EXT	SVRMCK_INT
    45				;
    46				;-------------< ys_rpro >------------------------------------------------
    47						EXT	RPRO_ROM
    48						EXT	NMISUB,IRQSUB,CHIPON
    49						EXT	VMADSPL,OBJDMA
    50				;
    51						EXT	VTCL
    52				;
    53				;-------------< ys_title >-----------------------------------------------
    54						EXT	MODINC,MODINC2
    55						EXT	TLINIT,TLPLAY,KEYINCHK
    56						EXT	SFC_STOP,KEYCHK_DSP
    57				;
    58				;-------------< ys_mini >-------------------------------------------------
    59						EXT	MINIPLAY,MINIINIT
    60				;
    61				;-------------< ys_map >-------------------------------------------------
    62						EXT	MAPINIT,MAPPLAY
    63				;
    64				;-------------< ys_game >------------------------------------------------
    65						EXT	GMINIT,GMPLAY,GMFADE,GMGOAL
    66						EXT	BOSCLR_SCORE,HALF_INIT,HALF_SLCT
    67						EXT	COS_AGAIN_INT,CORS_AGAIN,AGAIN_WAIT_SET
    68				;
    69				;-------------< ys_bgsc >------------------------------------------------
    70						EXT	GMBGIN,TIMEUP
    71				;
    72				;-------------< ys_demo >------------------------------------------------
    73						EXT	DEMO_00_IN,DEMO_00_MV
    74						EXT	DEMO_01_IN,DEMO_01_MV
    75				;
    76				;-------------< ys_demo >------------------------------------------------
    77						EXT	BONUSIT,BONUSMV
    78				;
    79				;-------------< ys_start >-----------------------------------------------
    80						EXT	START_INIT,START_PLAY
    81				;
    82				;-------------< ys_ending >----------------------------------------------
    83						EXT	ENDING_MAP_IN
    84						EXT	ENDING1_IN,ENDING1_PL,ENDING_START
    85						EXT	GAME_OVER_INT,GAME_OVER
    86				;
    87				;-------------< ys_hmap >------------------------------------------------
    88						EXT	HMAPINIT,HMAPPLAY,HMAPDEMO
    89						EXT	HMAPHIDEMO,HMPWLDCLRDEMO
    90				;
    91				;
    92				;------------------------------------------------------------------------
    93				;-		define symbol						-
    94				;------------------------------------------------------------------------
    95				;
    96				;
    97				;
    98				;************************************************************************
    99				;*									*
   100				;*		“ú•t							*
   101				;*									*
   102				;************************************************************************
   103				;
   104						ORG	0FFA0H
   105				;
   106						include ys_date.inc
   106- A00FFA0 95 07 10 11 09	DATE		HEX	95,07,10,11,09
   107				;
   108				;
   109				;************************************************************************
   110				;*									*
   111				;*		interrupt vector					*
   112				;*									*
   113				;************************************************************************
   114				;
   115						ORG	0FFE0H
   116				;
   117				;------------------------------------------------------------------------
   118				;-		NATIVE							-
   119				;------------------------------------------------------------------------
   120	A00FFE0 014F'                           WORD    RTISUB
   121	A00FFE2 014F'                           WORD    RTISUB
   122	A00FFE4 014F'                           WORD    COPSUB          ;COP
   123	A00FFE6 014F'                           WORD    RTISUB
   124	A00FFE8 014F'                           WORD    RTISUB
   125	A00FFEA 0108				WORD	00108H		;NMI
   126	A00FFEC 014F'                           WORD    RTISUB
   127	A00FFEE 010C				WORD	0010CH		;IRQ
   128				;
   129				;------------------------------------------------------------------------
   130				;-		EMULATION						-
   131				;------------------------------------------------------------------------
   132	A00FFF0 014F'                           WORD    RTISUB
   133	A00FFF2 014F'                           WORD    RTISUB
   134	A00FFF4 014F'                           WORD    RTISUB
   135	A00FFF6 014F'                           WORD    RTISUB
   136	A00FFF8 014F'                           WORD    RTISUB
   137	A00FFFA 014F'                           WORD    RTISUB
   138	A00FFFC 0000'                           WORD    RESET           ;reset
   139	A00FFFE 014F'                           WORD    RTISUB
   140				;
   141				;
   142				;************************************************************************
   143				;*									*
   144				;*		program start						*
   145				;*									*
   146				;************************************************************************
   147				;
   148				;
   149						EXTEND
   150				;
   151				;
   152						MEM8
   153						IDX8
   154				;
   155				Group_0		GROUP	Main_pro
   156				Main_pro	SECT	REL
   157				;
   158				;************************************************************************
   159				;*		reset							*
   160				;************************************************************************
   161				;
   162		000000		RESET		EQU	$
   163	M000000 78				SEI			;IRQ disable
   164	M000001 C2 09				REP	#00001001B
   165	M000003 FB				XCE
   166				;
   167						MI8
   167+ M000004 E2 30				SEP	#00110000b
   168				;
   169	M000006 A9 00				LDA	#00		;(DBR) <-- 0
   170	M000008 48				PHA
   171	M000009 AB				PLB
   172	M00000A 48				PHA			;(D) <-- 0
   173	M00000B 48				PHA
   174	M00000C 2B				PLD
   175				;
   176				;-------------- PPU Reg initial clear -----------------------------------
   177	M00000D 9C 4200				STZ	4200H		;NMI disable
   178	M000010 9C 4016				STZ	4016H
   179	M000013 A9 8F				LDA	#10001111B	;blanking "ON"
   180	M000015 8D 2100				STA	2100H
   181				;
   182	M000018 A9 01				LDA	#00000001B	;B-RAM enable
   183	M00001A 8D 3033				STA	3033H
   184	M00001D 9C 2106				STZ	2106H		;mozaiku flag reset
   185	M000020 9C 2140				STZ	2140H		;sound port reset
   186	M000023 9C 2141				STZ	2141H		;	"
   187	M000026 9C 2142				STZ	2142H		;	"
   188	M000029 9C 2143				STZ	2143H		;	"
   189				;
   190	M00002C A9 FF				LDA	#0FFH		;I/O port reset
   191	M00002E 8D 4201				STA	4201H
   192	M000031 9C 4207				STZ	4207H		;H counter reset
   193	M000034 9C 4208				STZ	4208H
   194	M000037 9C 4209				STZ	4209H		;V	"
   195	M00003A 9C 420A				STZ	420AH
   196	M00003D 9C 420B				STZ	420BH		;M-DMA switch reset
   197	M000040 9C 420C				STZ	420CH		;H-	  "
   198	M000043 9C 420D				STZ	420DH		;memory access cycle reset (2.68MHz)
   199				;
   200						M16
   200+ M000046 C2 20				REP	#00100000b
   201				;
   202	M000048 A9 8000				LDA	#8000H		;OAM rotation reset
   203	M00004B 8D 2102				STA	2102H
   204				;
   205				;-------------- stack pointer set ---------------------------------------
   206	M00004E A9 01FF				LDA	#01FFH		;(SP) set
   207	M000051 1B				TCS
   208				;
   209						M8
   209+ M000052 E2 20				SEP	#00100000b
   210	M000054 22 0002D0'                      JSL     >RAMCLR         ;all RAM clear !!
   211				;
   212				;
   213				;-------------- ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—iƒƒCƒ“j ------------------------
   214				;
   215	M000058 A2 10				LDX	#TITLE_SOUND	;(X) <-- ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—ƒe[ƒuƒ‹‚m‚D
   216	M00005A 22 000543'                      JSL     >SOUND_TR_2
   217				;
   218						M16
   218+ M00005E C2 20				REP	#00100000b
   219				;
   220				;
   221				;-------------- RAM vecter set ------------------------------------------
   222	M000060 A2 0F				LDX	#(RMVCTTBLE-RMVCTTBL)-1
   223		000062		RESET010	EQU	$
   224	M000062 BD 013F'                        LDA     !RMVCTTBL,X
   225	M000065 9D 0100				STA	RAMVCT,X
   226	M000068 CA				DEX
   227	M000069 CA				DEX
   228	M00006A 10 F6				BPL	RESET010
   229				;
   230				;-------------- RAM program set -----------------------------------------
   231	M00006C A9 C000				LDA	#RPRO_RAM	;to memory address set
   232	M00006F 85 20				STA	<WORK20
   233	M000071 A0 7E				LDY	#BANK RPRO_RAM
   234	M000073 84 22				STY	<WORK22
   235	M000075 A9 0000"                        LDA     #RPRO_ROM       ;from memory address set
   236	M000078 85 23				STA	<WORK23
   237	M00007A A0 00"                          LDY     #BANK RPRO_ROM
   238	M00007C 84 25				STY	<WORK25
   239	M00007E A9 4000				LDA	#4000H		;(A) <-- number of byte set
   240	M000081 22 000288'                      JSL     >DMA_M_M        ;DMA "ON"
   241				;
   242						M8
   242+ M000085 E2 20				SEP	#00100000b
   243						I16
   243+ M000087 C2 10				REP	#00010000b
   244				;
   245				;-------------- system RAM initial clear --------------------------------
   246	M000089 A2 0046				LDX	#STACK-SYSRAM-1
   247		00008C		RESET020	EQU	$
   248	M00008C 9E 0118				STZ	SYSRAM,X
   249	M00008F CA				DEX
   250	M000090 10 FA				BPL	RESET020
   251				;
   252						I8
   252+ M000092 E2 10				SEP	#00010000b
   253				;
   254				;-------------- ƒ}ƒŠƒIƒ`ƒbƒv‰ŠúƒZƒbƒg ----------------------------------
   255	M000094 A9 01				LDA	#00000001B	;M-chip 21MHz mode set
   256	M000096 8D 3039				STA	3039H
   257	M000099 A9 A0				LDA	#10100000B	;M-chip config set ( IRQ disable , mult speed up )
   258	M00009B 8D 3037				STA	3037H
   259	M00009E A9 16				LDA	#016H		;M-chip screen base initial set
   260	M0000A0 8D 012D				STA	CIPSCB
   261	M0000A3 A9 3D				LDA	#00111101B	;	"      size mode set
   262	M0000A5 8D 012E				STA	CIPSCR
   263				;
   264	M0000A8 AF 707E7D			LDA	>SLCT_FILE_NO+1
   265	M0000AC D0 08				BNE	SV_CLS_000
   266	M0000AE AF 707E7C			LDA	>SLCT_FILE_NO
   267	M0000B2 C9 03				CMP	#003
   268	M0000B4 90 27				BCC	SV_CLS_900
   269		0000B6		SV_CLS_000	EQU	$
   270						M16			; memory 16bit mode
   270+ M0000B6 C2 20				REP	#00100000b
   271	M0000B8 A9 0000				LDA	#000
   272	M0000BB 8F 707E7C			STA	>SLCT_FILE_NO
   273	M0000BF 8F 707E70			STA	>RAMCHK0
   274	M0000C3 8F 707E72			STA	>RAMCHK1
   275	M0000C7 8F 707E74			STA	>RAMCHK2
   276	M0000CB 8F 707E76			STA	>RAMCHK0_BAK
   277	M0000CF 8F 707E78			STA	>RAMCHK1_BAK
   278	M0000D3 8F 707E7A			STA	>RAMCHK2_BAK
   279	M0000D7 22 000000"                      JSL     >SVRMCK_INT
   280						M8			; memory 8bit mode
   280+ M0000DB E2 20				SEP	#00100000b
   281		0000DD		SV_CLS_900	EQU	$
   282				;
   283						M16			; memory 16bit mode
   283+ M0000DD C2 20				REP	#00100000b
   284	M0000DF 9C 012B				STZ	!TITL_SND
   285	M0000E2 9C 0216				STZ	!WLD6_FLG
   286				;
   287	M0000E5 A2 08				LDX	#BANK CHIPINIT
   288	M0000E7 A9 A97B				LDA	#CHIPINIT
   289	M0000EA 22 000000"                      JSL     >CHIPON
   290				;
   291						M8			; memory 8bit mode
   291+ M0000EE E2 20				SEP	#00100000b
   292				;
   293	M0000F0 58				CLI			;IRQ enable
   294				;
   295				;************************************************************************
   296				;*		game main						*
   297				;************************************************************************
   298				;
   299		0000F1		GSTART		EQU	$
   300	M0000F1 AD 011B				LDA	NMIFLG
   301	M0000F4 30 FB				BMI	GSTART
   302				;
   303		0000F6		system_pause	equ	$
   304	M0000F6 80 38				bra	GST040
   305				;
   306				;
   307				;
   308				;
   309				;
   310				;-------------- pause check -----------------------------
   311	M0000F8 AD 0943				LDA	KEYB2
   312	M0000FB 29 10				AND	#00010000B
   313	M0000FD F0 08				BEQ	GST010
   314	M0000FF AD 012F				LDA	PAUSE
   315	M000102 49 01				EOR	#01
   316	M000104 8D 012F				STA	PAUSE
   317		000107		GST010		EQU	$
   318	M000107 AD 012F				LDA	PAUSE
   319	M00010A F0 24				BEQ	GST040
   320				;
   321	M00010C A0 20				LDY	#20H
   322	M00010E AD 0942				LDA	KEYB2L
   323	M000111 29 10				AND	#00010000B
   324	M000113 D0 18				BNE	GST032
   325				;
   326	M000115 AD 0940				LDA	KEYB1L
   327	M000118 29 30				AND	#00110000B
   328	M00011A D0 05				BNE	GST020
   329				;
   330	M00011C 9C 0130				STZ	PASTM
   331	M00011F 80 19				BRA	GST050
   332				;
   333		000121		GST020		EQU	$
   334	M000121 AD 0130				LDA	PASTM
   335	M000124 F0 05				BEQ	GST030
   336	M000126 CE 0130				DEC	PASTM
   337	M000129 80 0F				BRA	GST050
   338				;
   339		00012B		GST030		EQU	$
   340	M00012B A0 04				LDY	#04H
   341		00012D		GST032		EQU	$
   342	M00012D 8C 0130				STY	PASTM
   343				;
   344				;--------------------------------------------------------
   345				;
   346				;
   347				;
   348				;
   349				;
   350		000130		GST040		EQU	$
   351				;
   352						M16
   352+ M000130 C2 20				REP	#00100000b
   353				;
   354	M000132 E6 30				INC	<FRCNT		;frame counter set
   355				;
   356						M8
   356+ M000134 E2 20				SEP	#00100000b
   357				;
   358	M000136 22 000150'                      JSL     >MODESEL        ;game mode select
   359				;
   360		00013A		GST050		EQU	$
   361	M00013A CE 011B				DEC	NMIFLG
   362	M00013D 80 B2				BRA	GSTART
   363				;
   364				;
   365				;************************************************************************
   366				;		RAM vecter data						*
   367				;************************************************************************
   368		00013F		RMVCTTBL	EQU	$
   369	M00013F 40				RTI			;[100]
   370	M000140 EA				NOP
   371	M000141 EA				NOP
   372	M000142 EA				NOP
   373				;
   374	M000143 40				RTI			;[104] COP
   375	M000144 EA				NOP
   376	M000145 EA				NOP
   377	M000146 EA				NOP
   378				;
   379	M000147 5C 000000"                      JMP     >NMISUB         ;[108] NMI
   380				;
   381	M00014B 5C 000000"                      JMP     >IRQSUB         ;[10C] IRQ
   382				;
   383		00014F		RMVCTTBLE	EQU	$
   384				;
   385				;************************************************************************
   386				;		cop							*
   387				;************************************************************************
   388		00014F		COPSUB		EQU	$
   389				;;;;		JMP	>CHIPCALL
   390				;
   391				;************************************************************************
   392				;		interrapt return					*
   393				;************************************************************************
   394		00014F		RTISUB		EQU	$
   395	M00014F 40				RTI
   396				;
   397				;
   398				;
   399				;************************************************************************
   400				;		game mode select					*
   401				;************************************************************************
   402				;
   403		000150		MODESEL		EQU	$
   404	M000150 AD 0118				LDA	MODENO
   405	M000153 0A				ASL	A
   406				;;;;		CLC
   407	M000154 6D 0118				ADC	MODENO
   408	M000157 AA				TAX
   409	M000158 8B				PHB			;(DBR) save
   410	M000159 BD 016C'                        LDA     !MODETBL+2,X
   411	M00015C 48				PHA
   412	M00015D 48				PHA
   413	M00015E AB				PLB			;(DBR) <-- (PBR)
   414	M00015F BF 00016B'                      LDA     >MODETBL+1,X
   415	M000163 48				PHA
   416	M000164 BF 00016A'                      LDA     >MODETBL,X
   417	M000168 48				PHA
   418	M000169 6B				RTL
   419				;
   420				;-------------- game mode program address table -----------------
   421		00016A		MODETBL		EQU	$
   422	M00016A FFFFFF"         TTLIN           LWORD   TLINIT-1        ;title initial
   423	M00016D FFFFFF"                         LWORD   KEYINCHK-1      ;ƒL[ƒ`ƒFƒbƒN
   424	M000170 0003EF'                         LWORD   FADEST2-1       ;fade "in/out" ( timer type ) set
   425	M000173 FFFFFF"                         LWORD   TLPLAY-1        ;title play
   426	M000176 0003CC'         DM_01           LWORD   FADEST-1        ;fade "in/out" set
   427	M000179 FFFFFF"                         LWORD   DEMO_01_IN-1    ;ƒ~ƒ…[ƒWƒJƒ‹‰ŠúƒZƒbƒg
   428	M00017C 0003CC'                         LWORD   FADEST-1        ;fade "in/out" set
   429	M00017F FFFFFF"                         LWORD   DEMO_01_MV-1    ;ƒ~ƒ…[ƒWƒJƒ‹ƒfƒ‚
   430	M000182 0003EF'         MPINT           LWORD   FADEST2-1       ;fade "in/out" set
   431	M000185 FFFFFF"                         LWORD   MAPINIT-1       ;map test initial
   432	M000188 FFFFFF"                         LWORD   MAPPLAY-1       ;    "	  play
   433	M00018B 0003CC'         GMINT           LWORD   FADEST-1        ;fade "in/out" set
   434	M00018E FFFFFF"                         LWORD   GMINIT-1        ;game initial
   435	M000191 FFFFFF"         GMFAD           LWORD   GMFADE-1        ;  "  fade "in/out" set
   436	M000194 FFFFFF"         GM_CATEN        LWORD   GMBGIN-1        ;  "  initial course BG write
   437	M000197 FFFFFF"         GMPLY           LWORD   GMPLAY-1        ;  "  play
   438	M00019A FFFFFF"                         LWORD   GMGOAL-1        ;  "  goal in
   439	M00019D FFFFFF"         TIMUP           LWORD   TIMEUP-1        ;ƒ^ƒCƒ€ƒAƒbƒvƒfƒ‚
   440				;
   441	M0001A0 0003CC'         DM_00           LWORD   FADEST-1        ;fade "in/out" set
   442	M0001A3 FFFFFF"                         LWORD   DEMO_00_IN-1    ;Ž€_ƒfƒ‚‰ŠúƒZƒbƒg
   443	M0001A6 0003CC'                         LWORD   FADEST-1        ;fade "in/out" set
   444	M0001A9 FFFFFF"                         LWORD   DEMO_00_MV-1    ;Ž€_ƒfƒ‚
   445				;
   446	M0001AC 0003FB'         DEMIN           LWORD   FADEST3-1       ;ƒGƒ“ƒfƒBƒ“ƒO
   447	M0001AF FFFFFF"                         LWORD   ENDING_MAP_IN-1
   448	M0001B2 FFFFFF"                         LWORD   MAPINIT-1
   449	M0001B5 FFFFFF"                         LWORD   MAPPLAY-1
   450	M0001B8 0003CC'                         LWORD   FADEST-1        ;fade "in/out" set
   451	M0001BB FFFFFF"                         LWORD   ENDING1_IN-1
   452	M0001BE FFFFFF"                         LWORD   ENDING_START-1
   453	M0001C1 FFFFFF"                         LWORD   ENDING1_PL-1
   454				;
   455	M0001C4 0003A7'         HMAP_FADE       LWORD   HMAPFADE-1
   456	M0001C7 0003EF'         HMPINT          LWORD   FADEST2-1
   457	M0001CA FFFFFF"         HMAP_SB         LWORD   HMAPINIT-1      ;‰¡ƒXƒNƒ[ƒ‹ ƒ}ƒbƒv
   458	M0001CD 0003CC'         HMPPLY          LWORD   FADEST-1
   459	M0001D0 FFFFFF"                         LWORD   HMAPPLAY-1
   460	M0001D3 0003CC'         HMPDEM          LWORD   FADEST-1
   461	M0001D6 FFFFFF"                         LWORD   HMAPDEMO-1
   462	M0001D9 0003CC'         HMPHIDEM        LWORD   FADEST-1
   463	M0001DC FFFFFF"                         LWORD   HMAPHIDEMO-1
   464	M0001DF 0003CC'         HMPWDCRDEM      LWORD   FADEST-1
   465	M0001E2 FFFFFF"                         LWORD   HMPWLDCLRDEMO-1
   466				;
   467	M0001E5 0003EF'         BONUSGM         LWORD   FADEST2-1       ;ƒ{[ƒiƒX ƒQ[ƒ€
   468	M0001E8 FFFFFF"         BONUSIN         LWORD   BONUSIT-1
   469	M0001EB 0003CC'                         LWORD   FADEST-1
   470	M0001EE FFFFFF"         BONUS_MD        LWORD   BONUSMV-1
   471				;
   472	M0001F1 0003CC'         MININT          LWORD   FADEST-1        ;ƒ~ƒj ƒQ[ƒ€
   473	M0001F4 FFFFFF"                         LWORD   MINIINIT-1
   474	M0001F7 0003CC'         MINIPL          LWORD   FADEST-1
   475	M0001FA FFFFFF"                         LWORD   MINIPLAY-1
   476				;
   477	M0001FD FFFFFF"         BSCR_SCRE       LWORD   BOSCLR_SCORE-1  ;ƒ{ƒXƒNƒŠƒAŒã‚ÌƒXƒRƒA¸ŽZ
   478				;
   479	M000200 0003CC'         HALF_STAT       LWORD   FADEST-1        ; ’†ŠÔƒQ[ƒg ÄƒXƒ^[ƒgƒZƒŒƒNƒg
   480	M000203 FFFFFF"                         LWORD   HALF_INIT-1
   481	M000206 0003CC'                         LWORD   FADEST-1
   482	M000209 FFFFFF"                         LWORD   HALF_SLCT-1
   483	M00020C FFFFFF"                         LWORD   AGAIN_WAIT_SET-1
   484				;
   485	M00020F 0003EF'         INT_GAME        LWORD   FADEST2-1       ; ƒCƒjƒVƒƒƒ‹ ƒR[ƒXƒCƒ“ ƒfƒ‚
   486	M000212 FFFFFF"                         LWORD   START_INIT-1
   487	M000215 FFFFFF"                         LWORD   START_PLAY-1
   488				;
   489	M000218 0003CC'         AGAIN_STAT      LWORD   FADEST-1        ; ¡‚ÌƒR[ƒX‚Ì ÄƒXƒ^[ƒgƒZƒŒƒNƒg
   490	M00021B FFFFFF"                         LWORD   COS_AGAIN_INT-1
   491	M00021E 0003CC'                         LWORD   FADEST-1
   492	M000221 FFFFFF"                         LWORD   CORS_AGAIN-1
   493	M000224 FFFFFF"                         LWORD   AGAIN_WAIT_SET-1
   494				;
   495	M000227 FFFFFF"         GM_OVER         LWORD   GAME_OVER_INT-1 ; ‚f‚`‚l‚d ‚n‚u‚d‚q
   496	M00022A FFFFFF"                         LWORD   GAME_OVER-1
   497				;
   498	M00022D 0003CC'         KEYSTOP         LWORD   FADEST-1
   499	M000230 FFFFFF"                         LWORD   KEYCHK_DSP-1    ;ƒL[ƒ`ƒFƒbƒN‚É‚æ‚éƒQ[ƒ€ ƒXƒgƒbƒv
   500				;
   501	M000233 0003CC'         SFCSTOP         LWORD   FADEST-1
   502	M000236 FFFFFF"                         LWORD   SFC_STOP-1      ;ƒQ[ƒ€ ƒXƒgƒbƒv !!
   503				;
   504				;
   505				;
   506		000000		TLIN		EQU	(TTLIN-MODETBL)/3
   507		000008		MPIN		EQU	(MPINT-MODETBL)/3
   508		00000B		GMIN		EQU	(GMINT-MODETBL)/3
   509		00000D		GMFD		EQU	(GMFAD-MODETBL)/3
   510		00000E		GM_CTN		EQU	(GM_CATEN-MODETBL)/3
   511		00000F		GMPL		EQU	(GMPLY-MODETBL)/3
   512		000011		TMUP		EQU	(TIMUP-MODETBL)/3
   513				;
   514		000012		D_00		EQU	(DM_00-MODETBL)/3
   515		000004		D_01		EQU	(DM_01-MODETBL)/3
   516				;
   517		000016		DMIN		EQU	(DEMIN-MODETBL)/3
   518				;
   519		00001E		HMPFAD		EQU	(HMAP_FADE-MODETBL)/3
   520		00001F		HMPIN		EQU	(HMPINT-MODETBL)/3
   521		000020		HMPSB		EQU	(HMAP_SB-MODETBL)/3
   522		000021		HMPPL		EQU	(HMPPLY-MODETBL)/3
   523		000023		HMPDM		EQU	(HMPDEM-MODETBL)/3
   524		000025		HMPHIDM		EQU	(HMPHIDEM-MODETBL)/3
   525		000027		HMPWDCRDM	EQU	(HMPWDCRDEM-MODETBL)/3
   526				;
   527		000029		BNSGM		EQU	(BONUSGM-MODETBL)/3
   528		00002A		BNSIN		EQU	(BONUSIN-MODETBL)/3
   529		00002C		BNSMV		EQU	(BONUS_MD-MODETBL)/3
   530				;
   531		00002D		MINIT		EQU	(MININT-MODETBL)/3
   532		00002F		MINPL		EQU	(MINIPL-MODETBL)/3
   533				;
   534		000031		BS_SCRE		EQU	(BSCR_SCRE-MODETBL)/3
   535				;
   536		000032		HF_STAT		EQU	(HALF_STAT-MODETBL)/3
   537				;
   538		000037		INT_GM		EQU	(INT_GAME-MODETBL)/3
   539		00003F		GM_OVR		EQU	(GM_OVER-MODETBL)/3
   540		00003A		AGAIN		EQU	(AGAIN_STAT-MODETBL)/3
   541				;
   542		000041		KEYSTP		EQU	(KEYSTOP-MODETBL)/3
   543		000043		SFCSTP		EQU	(SFCSTOP-MODETBL)/3
   544				;
   545				;************************************************************************
   546				;*		blanking "ON"						*
   547				;************************************************************************
   548		000239		BLNKON		EQU	$
   549	M000239 9C 4200				STZ	4200H		;NMI disable
   550	M00023C 9C 420C				STZ	420CH		;H-DMA "OFF"
   551	M00023F A9 8F				LDA	#10001111B	;blanking "ON"
   552	M000241 8D 2100				STA	2100H
   553	M000244 6B				RTL
   554				;
   555				;************************************************************************
   556				;*		blanking "OFF"						*
   557				;************************************************************************
   558		000245		BLNKOFF		EQU	$
   559	M000245 A9 81				LDA	#10000001B	;NMI enable
   560	M000247 8D 4200				STA	4200H
   561	M00024A 6B				RTL
   562				;
   563				;************************************************************************
   564				;*		OAM clear						*
   565				;************************************************************************
   566		00024B		OAMCLR		EQU	$
   567				;
   568						M16
   568+ M00024B C2 20				REP	#00100000b
   569				;
   570	M00024D A2 08				LDX	#BANK OAM_CLR
   571	M00024F A9 BD16				LDA	#OAM_CLR
   572	M000252 22 000000"                      JSL     >CHIPON
   573				;
   574						M8
   574+ M000256 E2 20				SEP	#00100000b
   575				;
   576	M000258 6B				RTL
   577				;
   578				;************************************************************************
   579				;*		OAM clear ( to game mode )				*
   580				;************************************************************************
   581		000259		OAMDXCLR	EQU	$
   582				;
   583						M16
   583+ M000259 C2 20				REP	#00100000b
   584				;
   585	M00025B A2 08				LDX	#BANK OAM_DXCLR
   586	M00025D A9 B1D8				LDA	#OAM_DXCLR
   587	M000260 22 000000"                      JSL     >CHIPON
   588				;
   589						M8
   589+ M000264 E2 20				SEP	#00100000b
   590				;
   591	M000266 6B				RTL
   592				;
   593				;************************************************************************
   594				;*		OAM convert & change					*
   595				;************************************************************************
   596		000267		OAMCHG		EQU	$
   597				;
   598						M16
   598+ M000267 C2 20				REP	#00100000b
   599				;
   600	M000269 A2 08				LDX	#BANK OAMCHG2
   601	M00026B A9 B289				LDA	#OAMCHG2
   602	M00026E 22 000000"                      JSL     >CHIPON
   603				;
   604						M8
   604+ M000272 E2 20				SEP	#00100000b
   605				;
   606	M000274 6B				RTL
   607				;
   608				;************************************************************************
   609				;*		VRAM clear						*
   610				;*			in  : (A) <-- VRAM clear data table pointer	*
   611				;************************************************************************
   612		000275		VCLDAT		EQU	$		;screen all clear data !!
   613	M000275 FFFF				WORD	0FFFFH
   614				;
   615		000277		VRAMCL		EQU	$
   616	M000277 A9 00"                          LDA     #VTCL
   617		000279		VRAMCL2		EQU	$
   618	M000279 8D 0127				STA	VRFLG		;VRAM clear data table pointer
   619				;
   620	M00027C 22 000239'                      JSL     >BLNKON
   621				;
   622				;-------------- OAM intial --------------------------------------
   623	M000280 22 00024B'                      JSL     >OAMCLR         ;OAM clear
   624				;
   625				;-------------- VRAM clear --------------------------------------
   626	M000284 5C 000000"                      JMP     >VMADSPL
   627				;
   628				;************************************************************************
   629				;*		memory DMA ( block transfer )				*
   630				;*			in  : (WK20,21,22) <-- to memory address	*
   631				;*			      (WK23,24,25) <-- from	 "              *
   632				;*			      (A)	   <-- number of byte		*
   633				;************************************************************************
   634				;
   635						MEM16
   636						IDX8
   637				;
   638		000288		DMA_M_M		EQU	$
   639	M000288 8D 4305				STA	4305H		;number of byte set
   640				;
   641	M00028B A5 20				LDA	<WORK20		;to memory address set
   642	M00028D 8D 2181				STA	2181H		;	  "
   643	M000290 A4 22				LDY	<WORK22
   644	M000292 8C 2183				STY	2183H
   645				;
   646	M000295 A9 8000				LDA	#00000000B+(080H*100H)	;DMA parameter & B bus address set
   647	M000298 8D 4300				STA	4300H
   648	M00029B A5 23				LDA	<WORK23		;A bus address set
   649	M00029D 8D 4302				STA	4302H
   650	M0002A0 A4 25				LDY	<WORK25
   651	M0002A2 8C 4304				STY	4304H
   652				;
   653	M0002A5 A0 01				LDY	#00000001B	;DMA "ON"
   654	M0002A7 8C 420B				STY	420BH
   655	M0002AA 6B				RTL
   656				;
   657				;************************************************************************
   658				;*		memory DMA ( 1 byte data fill )				*
   659				;*			in  : (WK20,21,22) <-- to memory address	*
   660				;*			      (A)	   <-- number of byte		*
   661				;*			      (Y)	   <-- fill 1 byte data		*
   662				;************************************************************************
   663				;
   664						MEM16
   665						IDX8
   666				;
   667		0002AB		DMA_D_M		EQU	$
   668	M0002AB 8D 4305				STA	4305H		;number of byte set
   669				;
   670	M0002AE 8C 211B				STY	211BH
   671	M0002B1 A2 00				LDX	#00
   672	M0002B3 8E 211B				STX	211BH
   673	M0002B6 E8				INX			;x1
   674	M0002B7 8E 211C				STX	211CH
   675				;
   676	M0002BA A9 3480				LDA	#10000000B+(034H*100H)	;DMA parameter & B bus address set
   677	M0002BD 8D 4300				STA	4300H
   678	M0002C0 A5 20				LDA	<WORK20		;A bus address set
   679	M0002C2 8D 4302				STA	4302H
   680	M0002C5 A6 22				LDX	<WORK22
   681	M0002C7 8E 4304				STX	4304H
   682				;
   683	M0002CA A2 01				LDX	#00000001B	;DMA "ON"
   684	M0002CC 8E 420B				STX	420BH
   685	M0002CF 6B				RTL
   686				;
   687						MEM8
   688				;
   689				;************************************************************************
   690				;*		RAM clear						*
   691				;************************************************************************
   692		0002D0		RAMCLR		EQU	$
   693	M0002D0 22 000239'                      JSL     >BLNKON         ;blanking "ON"
   694				;
   695						M16
   695+ M0002D4 C2 20				REP	#00100000b
   696				;
   697	M0002D6 A0 00				LDY	#00			;(Y) <-- 0 clear data
   698				;
   699				;-------------< 000H - 0FFH >--------------------------------------------
   700	M0002D8 64 20				STZ	<WORK20			;to memory address set
   701	M0002DA 64 22				STZ	<WORK22
   702	M0002DC A9 0100				LDA	#(0FFH-000H)+1		;(A) <-- number of byte
   703	M0002DF 22 0002AB'                      JSL     >DMA_D_M                ;DMA "ON"
   704				;
   705				;-------------< 7E0200H - 7EBFFFH >--------------------------------------
   706	M0002E3 A9 0200				LDA	#0200H			;to memory address set
   707	M0002E6 85 20				STA	<WORK20
   708	M0002E8 A2 7E				LDX	#07EH
   709	M0002EA 86 22				STX	<WORK22
   710	M0002EC A9 BE00				LDA	#(7EBFFFH-7E0200H)+1	;(A) <-- number of data
   711	M0002EF 22 0002AB'                      JSL     >DMA_D_M                ;DMA "ON"
   712				;
   713				;-------------< 7F0000H - 7FFFFFH >--------------------------------------
   714	M0002F3 64 20				STZ	<WORK20			;to memory address set
   715	M0002F5 A2 7F				LDX	#07FH
   716	M0002F7 86 22				STX	<WORK22
   717	M0002F9 A9 0000				LDA	#(7FFFFFH-7F0000H)+1	;(A) <-- number of data
   718	M0002FC 22 0002AB'                      JSL     >DMA_D_M                ;DMA "ON"
   719				;
   720				;-------------< 700000H - 707BFFH >--------------------------------------
   721	M000300 A2 70				LDX	#070H			;to memory address set
   722	M000302 86 22				STX	<WORK22
   723	M000304 A9 7C00				LDA	#(707BFFH-700000H)+1	;(A) <-- number of data
   724	M000307 22 0002AB'                      JSL     >DMA_D_M                ;DMA "ON"
   725				;
   726				;-------------< initial RAM set >----------------------------------------
   727	M00030B A9 FFFF				LDA	#0FFFFH		;BG write( VRAMD ) end code set
   728	M00030E 8F 7E4002			STA	>VRAMD+2
   729	M000312 A9 4802				LDA	#VRAMDX+2	;    "   ( VRAMDX )      "
   730	M000315 8F 7E4800			STA	>VRAMDX
   731				;
   732						M8
   732+ M000319 E2 20				SEP	#00100000b
   733				;
   734	M00031B 6B				RTL
   735				;
   736				;************************************************************************
   737				;*		clear area RAM clear					*
   738				;************************************************************************
   739		00031C		URAMCLR		EQU	$
   740				;
   741						M16
   741+ M00031C C2 20				REP	#00100000b
   742				;
   743	M00031E A0 00				LDY	#00		;(Y) <-- 0 clear data
   744				;
   745				;-------------- SFC ---------------------------------------------
   746	M000320 64 21				STZ	<WORK21		;to memory address set
   747	M000322 A9 0035				LDA	#CLRRM0_S
   748	M000325 85 20				STA	<WORK20
   749	M000327 A9 00CB				LDA	#CLR0SE		;(A) <-- number of byte
   750	M00032A 22 0002AB'                      JSL     >DMA_D_M        ;DMA "ON"
   751				;
   752	M00032E A9 093C				LDA	#CLRRM1_S
   753	M000331 85 20				STA	<WORK20
   754	M000333 A9 087A				LDA	#CLR1SE		;(A) <-- number of byte
   755	M000336 22 0002AB'                      JSL     >DMA_D_M        ;DMA "ON"
   756				;
   757				;-------------- M-chip ------------------------------------------
   758	M00033A A9 6092				LDA	#MCLRRM0_S
   759	M00033D 85 20				STA	<WORK20
   760	M00033F A9 0166				LDA	#MCLR0SE	;(A) <-- number of byte
   761	M000342 22 0002AB'                      JSL     >DMA_D_M        ;DMA "ON"
   762				;
   763	M000346 A9 7E08				LDA	#MCLRRM1_S
   764	M000349 85 20				STA	<WORK20
   765	M00034B A9 01E8				LDA	#MCLR1SE	;(A) <-- number of byte
   766	M00034E 22 0002AB'                      JSL     >DMA_D_M        ;DMA "ON"
   767				;
   768	M000352 A9 2604				LDA	#MCLRRM2_S
   769	M000355 85 20				STA	<WORK20
   770	M000357 A2 70				LDX	#BANK MCLRRM2_S
   771	M000359 86 22				STX	<WORK22
   772	M00035B A9 51FC				LDA	#MCLR2SE	;(A) <-- number of byte
   773	M00035E 22 0002AB'                      JSL     >DMA_D_M        ;DMA "ON"
   774				;
   775						M8
   775+ M000362 E2 20				SEP	#00100000b
   776				;
   777	M000364 6B				RTL
   778				;
   779				;************************************************************************
   780				;*		call subroutine						*
   781				;*			in  : (A) <- call no.				*
   782				;************************************************************************
   783				;
   784		000365		JSRSUB		EQU	$
   785	M000365 84 03				STY	<WORK+3		;(Y) save
   786				;
   787	M000367 7A				PLY
   788	M000368 84 00				STY	<WORK
   789				;
   790						MI16
   790+ M00036A C2 30				REP	#00110000b
   791				;
   792	M00036C 29 00FF				AND	#00FFH
   793	M00036F 0A				ASL	A
   794	M000370 A8				TAY
   795	M000371 68				PLA
   796	M000372 85 01				STA	<WORK+1
   797				;
   798	M000374 C8				INY
   799	M000375 B7 00				LDA	[<WORK],Y
   800	M000377 85 00				STA	<WORK
   801				;
   802						MI8
   802+ M000379 E2 30				SEP	#00110000b
   803				;
   804	M00037B A4 03				LDY	<WORK+3		;(Y) load
   805	M00037D DC 0000				JML	(WORK)
   806				;
   807				;************************************************************************
   808				;*		call subroutine ( long )				*
   809				;*			in  : (A) <- call no.				*
   810				;************************************************************************
   811				;
   812		000380		JSLSUB		EQU	$
   813	M000380 84 05				STY	<WORK+5		;(Y) save
   814				;
   815	M000382 7A				PLY
   816	M000383 84 02				STY	<WORK+2
   817				;
   818						MI16
   818+ M000385 C2 30				REP	#00110000b
   819				;
   820	M000387 29 00FF				AND	#00FFH
   821	M00038A 85 03				STA	<WORK+3
   822	M00038C 0A				ASL	A
   823	M00038D 65 03				ADC	<WORK+3
   824	M00038F A8				TAY
   825	M000390 68				PLA
   826	M000391 85 03				STA	<WORK+3
   827				;
   828	M000393 C8				INY
   829	M000394 B7 02				LDA	[<WORK+2],Y
   830	M000396 85 00				STA	<WORK
   831	M000398 C8				INY
   832	M000399 B7 02				LDA	[<WORK+2],Y
   833	M00039B 85 01				STA	<WORK+1
   834	M00039D EB				XBA
   835				;
   836						MI8
   836+ M00039E E2 30				SEP	#00110000b
   837				;
   838	M0003A0 8B				PHB			;(DBR) save
   839				;;;;		LDA	<WORK+2		;(DBR) <-- (PBR)
   840	M0003A1 48				PHA
   841	M0003A2 AB				PLB
   842	M0003A3 A4 05				LDY	<WORK+5		;(Y) load
   843	M0003A5 DC 0000				JML	(WORK)
   844				;
   845				;************************************************************************
   846				;*		‰¡ƒXƒNƒ[ƒ‹ƒ}ƒbƒv‚Ö‚Ì‚‘¬ƒtƒF[ƒh			*
   847				;************************************************************************
   848		0003A8		HMAPFADE	EQU	$
   849	M0003A8 AE 0201				LDX	!FADMK
   850	M0003AB AD 0200				LDA	!FADNO
   851	M0003AE 29 0F				AND	#00FH
   852	M0003B0 DD 03C6'                        CMP     FADCMP,X        ; ƒtƒF[ƒh ‚¨‚í‚è ?
   853	M0003B3 D0 32				BNE	FAD010		;	NO -> FAD010
   854	M0003B5 8A				TXA			;fade muki set
   855	M0003B6 49 01				EOR	#01H
   856	M0003B8 29 01				AND	#01H
   857	M0003BA 8D 0201				STA	!FADMK
   858				;
   859				;-------------- go to next mode ---------------------------------
   860	M0003BD A9 20				LDA	#HMPSB
   861	M0003BF 8D 0118				STA	!MODENO
   862	M0003C2 80 2A				BRA	FAD020
   863				;
   864				;************************************************************************
   865				;*		fade in/out						*
   866				;************************************************************************
   867		0003C4		FADADD		EQU	$
   868	M0003C4 01 FF				HEX	01,FF
   869		0003C6		FADCMP		EQU	$
   870	M0003C6 0F 00				HEX	0F,00
   871				;
   872		0003C8		FADEST_SUB	EQU	$
   873	M0003C8 8B				PHB
   874	M0003C9 A9 CD'                          LDA     #BANK FADEST
   875	M0003CB 48				PHA
   876	M0003CC AB				PLB
   877				;
   878		0003CD		FADEST		EQU	$
   879	M0003CD AE 0201				LDX	!FADMK
   880	M0003D0 AD 0200				LDA	!FADNO
   881	M0003D3 29 0F				AND	#00FH
   882	M0003D5 DD 03C6'                        CMP     FADCMP,X        ; ƒtƒF[ƒh ‚¨‚í‚è ?
   883	M0003D8 D0 0D				BNE	FAD010		;	NO -> FAD010
   884	M0003DA 8A				TXA			;fade muki set
   885	M0003DB 49 01				EOR	#01H
   886	M0003DD 29 01				AND	#01H
   887	M0003DF 8D 0201				STA	!FADMK
   888				;
   889				;-------------- go to next mode ---------------------------------
   890	M0003E2 EE 0118				INC	!MODENO
   891	M0003E5 80 07				BRA	FAD020
   892				;
   893		0003E7		FAD010		EQU	$
   894	M0003E7 18				CLC
   895	M0003E8 7D 03C4'                        ADC     FADADD,X
   896	M0003EB 8D 0200				STA	!FADNO
   897				;
   898		0003EE		FAD020		EQU	$
   899	M0003EE AB				PLB
   900	M0003EF 6B				RTL
   901				;
   902				;************************************************************************
   903				;*		fade in/out ( timer type )				*
   904				;************************************************************************
   905				;
   906		0003F0		FADEST2		EQU	$
   907	M0003F0 CE 0202				DEC	FADTM
   908	M0003F3 10 F9				BPL	FAD020		;wait ? ( yes:FAD010 )
   909				;
   910	M0003F5 A9 02				LDA	#02H		;wait timer set
   911	M0003F7 8D 0202				STA	FADTM
   912	M0003FA 80 D1				BRA	FADEST
   913				;
   914				;************************************************************************
   915				;*		fade in/out ( long timer type )				*
   916				;************************************************************************
   917				;
   918		0003FC		FADEST3		EQU	$
   919	M0003FC CE 0202				DEC	FADTM
   920	M0003FF 10 ED				BPL	FAD020		;wait ? ( yes:FAD010 )
   921				;
   922	M000401 A9 08				LDA	#08H		;wait timer set
   923	M000403 8D 0202				STA	FADTM
   924	M000406 80 C5				BRA	FADEST
   925				;
   926				;************************************************************************
   927				;*		—””­¶						*
   928				;*			–ß‚è’l	 i‚`jF—”				*
   929				;************************************************************************
   930				;
   931		000408		RANDAM		EQU	$
   932	M000408 08				PHP
   933				;
   934						M8
   934+ M000409 E2 20				SEP	#00100000b
   935				;
   936	M00040B AD 2137				LDA	2137H
   937	M00040E AD 213F				LDA	213FH
   938				;
   939						M16
   939+ M000411 C2 20				REP	#00100000b
   940				;
   941	M000413 AD 213C				LDA	213CH
   942	M000416 18				CLC
   943	M000417 6D 7970				ADC	RANDM0
   944	M00041A 8D 7970				STA	RANDM0
   945				;
   946	M00041D 28				PLP
   947	M00041E 6B				RTL
   948				;
   949				;
   950				;
   951				;
   952				;
   953				;************************************************************************
   954				;*									*
   955				;*		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€ƒu[ƒg				*
   956				;*									*
   957				;************************************************************************
   958				;
   959				;-------------------------------------------------
   960		002140		APU_port0	EQU	02140H
   961		002141		APU_port1	EQU	02141H
   962		002142		APU_port2	EQU	02142H
   963		002143		APU_port3	EQU	02143H
   964		000000		address		EQU	00000H
   965		000003		address2	EQU	address+3
   966		000006		address3	EQU	address2+3
   967		000009		address4	EQU	address3+3
   968		00000C		next_flag	EQU	address4+3
   969		00000E		pointer		EQU	next_flag+2
   970				;-------------------------------------------------
   971				;
   972		00041F		Boot_APU	EQU	$
   973	M00041F 08				PHP
   974				;
   975						MI16
   975+ M000420 C2 30				REP	#00110000b
   976				;
   977	M000422 A0 0000				LDY	#00
   978	M000425 A9 BBAA				LDA	#0BBAAH
   979		000428		boot_initial	EQU	$
   980	M000428 CD 2140				CMP	APU_port0	;m16
   981	M00042B D0 FB				BNE	boot_initial
   982				;
   983						M8
   983+ M00042D E2 20				SEP	#00100000b
   984				;
   985	M00042F A9 CC				LDA	#0CCH
   986	M000431 80 26				BRA	boot_entry1
   987				;
   988		000433		boot_repeat	EQU	$
   989	M000433 B7 00				LDA	[<address],Y
   990	M000435 C8				INY
   991	M000436 EB				XBA
   992	M000437 A9 00				LDA	#00
   993	M000439 80 0B				BRA	boot_entry2
   994				;
   995		00043B		boot_loop	EQU	$
   996	M00043B EB				XBA
   997	M00043C B7 00				LDA	[<address],Y
   998	M00043E C8				INY
   999	M00043F EB				XBA
  1000		000440		boot_wait1	EQU	$
  1001	M000440 CD 2140				CMP	APU_port0
  1002	M000443 D0 FB				BNE	boot_wait1
  1003	M000445 1A				INC	A
  1004		000446		boot_entry2	EQU	$
  1005				;
  1006						M16
  1006+ M000446 C2 20				REP	#00100000b
  1007				;
  1008	M000448 8D 2140				STA	APU_port0	;m16
  1009				;
  1010						M8
  1010+ M00044B E2 20				SEP	#00100000b
  1011				;
  1012	M00044D CA				DEX
  1013	M00044E D0 EB				BNE	boot_loop
  1014				;
  1015		000450		boot_wait2	EQU	$
  1016	M000450 CD 2140				CMP	APU_port0
  1017	M000453 D0 FB				BNE	boot_wait2
  1018		000455		boot_zero	EQU	$
  1019	M000455 69 03				ADC	#03
  1020	M000457 F0 FC				BEQ	boot_zero
  1021		000459		boot_entry1	EQU	$
  1022	M000459 48				PHA			;>
  1023				;
  1024						M16
  1024+ M00045A C2 20				REP	#00100000b
  1025				;
  1026	M00045C B7 00				LDA	[<address],Y	;m16
  1027	M00045E D0 1C				BNE	boot_next_ck_10
  1028				;
  1029	M000460 CE 000C				DEC	next_flag
  1030	M000463 30 17				BMI	boot_next_ck_10
  1031				;
  1032	M000465 AD 000C				LDA	next_flag
  1033	M000468 0A				ASL	A		;
  1034				;;;;		    CLC			;x3
  1035	M000469 6D 000C				ADC	next_flag	;
  1036	M00046C A8				TAY
  1037	M00046D B9 0003				LDA	address2,Y
  1038	M000470 85 00				STA	<address
  1039	M000472 B9 0004				LDA	address2+1,Y
  1040	M000475 85 01				STA	<address+1
  1041	M000477 A0 0000				LDY	#00
  1042	M00047A B7 00				LDA	[<address],Y	;m16
  1043		00047C		boot_next_ck_10 EQU	$
  1044	M00047C C8				INY
  1045	M00047D C8				INY
  1046	M00047E AA				TAX
  1047	M00047F B7 00				LDA	[<address],Y	;m16
  1048	M000481 C8				INY
  1049	M000482 C8				INY
  1050	M000483 8D 2142				STA	APU_port2	;m16
  1051				;
  1052						M8
  1052+ M000486 E2 20				SEP	#00100000b
  1053				;
  1054	M000488 E0 0001				CPX	#01
  1055	M00048B A9 00				LDA	#00
  1056	M00048D 2A				ROL	A
  1057	M00048E 8D 2141				STA	APU_port1
  1058	M000491 69 7F				ADC	#07FH
  1059	M000493 68				PLA			;<
  1060	M000494 8D 2140				STA	APU_port0
  1061		000497		boot_wait3	EQU	$
  1062	M000497 CD 2140				CMP	APU_port0
  1063	M00049A D0 FB				BNE	boot_wait3
  1064	M00049C 70 95				BVS	boot_repeat
  1065				;
  1066	M00049E 9C 2140				STZ	APU_port0	;port reset !!
  1067	M0004A1 9C 2141				STZ	APU_port1
  1068	M0004A4 9C 2142				STZ	APU_port2
  1069	M0004A7 9C 2143				STZ	APU_port3
  1070				;
  1071	M0004AA 28				PLP
  1072	M0004AB 60				RTS
  1073				;
  1074						MEM8
  1075						IDX8
  1076				;
  1077				;************************************************************************
  1078				;*									*
  1079				;*		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—					*
  1080				;*									*
  1081				;************************************************************************
  1082		0004AC		SOUND_TR_ADRS	EQU	$
  1083	M0004AC 4E0000		ysat_PT		LWORD	ysat
  1084	M0004AF 4E169C		ysathre_PT	LWORD	ysathre
  1085	M0004B2 4E23BF		ysbonus_PT	LWORD	ysbonus
  1086	M0004B5 4E2C39		ysboss_PT	LWORD	ysboss
  1087	M0004B8 4E38D2		yschika_PT	LWORD	yschika
  1088	M0004BB 4ED0FE		ysgame0_PT	LWORD	ysgame0
  1089	M0004BE 4ED5D0		ysgame1_PT	LWORD	ysgame1
  1090	M0004C1 4EE279		ysgm_PT		LWORD	ysgm
  1091	M0004C4 4EEC85		yshn_PT		LWORD	yshn
  1092	M0004C7 4F4122		ysmap_PT	LWORD	ysmap
  1093	M0004CA 4F5C48		ysoobs_PT	LWORD	ysoobs
  1094	M0004CD 4F6E5A		ysor_PT		LWORD	ysor
  1095	M0004D0 4F82E6		ysse_PT		LWORD	ysse
  1096	M0004D3 4FFCB2		ysshiro_PT	LWORD	ysshiro
  1097	M0004D6 500342		ystitle_PT	LWORD	ystitle
  1098	M0004D9 4F33F0		yslets_PT	LWORD	yslets
  1099	M0004DC 4EFEC1		yskp_PT		LWORD	yskp
  1100	M0004DF 4F205D		yskuppa_PT	LWORD	yskuppa
  1101	M0004E2 4E3E90		ysed_PT		LWORD	ysed
  1102	M0004E5 4EBBEC		ysend_PT	LWORD	ysend
  1103				;
  1104		000001		ysat_P		EQU	ysat_PT-SOUND_TR_ADRS+1
  1105		000004		ysathre_P	EQU	ysathre_PT-SOUND_TR_ADRS+1
  1106		000007		ysbonus_P	EQU	ysbonus_PT-SOUND_TR_ADRS+1
  1107		00000A		ysboss_P	EQU	ysboss_PT-SOUND_TR_ADRS+1
  1108		00000D		yschika_P	EQU	yschika_PT-SOUND_TR_ADRS+1
  1109		000010		ysgame0_P	EQU	ysgame0_PT-SOUND_TR_ADRS+1
  1110		000013		ysgame1_P	EQU	ysgame1_PT-SOUND_TR_ADRS+1
  1111		000016		ysgm_P		EQU	ysgm_PT-SOUND_TR_ADRS+1
  1112		000019		yshn_P		EQU	yshn_PT-SOUND_TR_ADRS+1
  1113		00001C		ysmap_P		EQU	ysmap_PT-SOUND_TR_ADRS+1
  1114		00001F		ysoobs_P	EQU	ysoobs_PT-SOUND_TR_ADRS+1
  1115		000022		ysor_P		EQU	ysor_PT-SOUND_TR_ADRS+1
  1116		000025		ysse_P		EQU	ysse_PT-SOUND_TR_ADRS+1
  1117		000028		ysshiro_P	EQU	ysshiro_PT-SOUND_TR_ADRS+1
  1118		00002B		ystitle_P	EQU	ystitle_PT-SOUND_TR_ADRS+1
  1119		00002E		yslets_P	EQU	yslets_PT-SOUND_TR_ADRS+1
  1120		000031		yskp_P		EQU	yskp_PT-SOUND_TR_ADRS+1
  1121		000034		yskuppa_P	EQU	yskuppa_PT-SOUND_TR_ADRS+1
  1122		000037		ysed_P		EQU	ysed_PT-SOUND_TR_ADRS+1
  1123		00003A		ysend_P		EQU	ysend_PT-SOUND_TR_ADRS+1
  1124				;
  1125				;------------------------------------------------------------------------
  1126				;-		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—î•ñ				-
  1127				;------------------------------------------------------------------------
  1128		0004E8		SOUND_TR_DATA	EQU	$
  1129				; SOUND_AR_? -->	   [0]	      [1]	 [2]	    [3]
  1130	M0004E8 2B FF FF FF	TITLE_TR_DATA	BYTE	ystitle_P, 0FFH,      0FFH,	 0FFH	    ;[ƒ^ƒCƒgƒ‹]
  1131	M0004EC 25 22 2E FF	W1_0_DM_TR_DATA BYTE	ysse_P,	   ysor_P,    yslets_P,	 0FFH	    ;[‚P‚v|‚Oƒfƒ‚]
  1132	M0004F0 25 22 1C FF	MAP_TR_DATA	BYTE	ysse_P,	   ysor_P,    ysmap_P,	 0FFH	    ;[ƒ}ƒbƒv]
  1133	M0004F4 25 19 13 FF	OHANA_TR_DATA	BYTE	ysse_P,	   yshn_P,    ysgame1_P, 0FFH	    ;[‚¨‰Ô”¨]
  1134	M0004F8 25 16 10 FF	CHIJYO_TR_DATA	BYTE	ysse_P,	   ysgm_P,    ysgame0_P, 0FFH	    ;[’nã]
  1135	M0004FC 25 16 0D FF	CHIKA_TR_DATA	BYTE	ysse_P,	   ysgm_P,    yschika_P, 0FFH	    ;[’n‰º]
  1136	M000500 25 22 28 FF	OSHIRO_TR_DATA	BYTE	ysse_P,	   ysor_P,    ysshiro_P, 0FFH	    ;[‚¨é]
  1137	M000504 25 16 0A FF	BOSS_TR_DATA	BYTE	ysse_P,	   ysgm_P,    ysboss_P,	 0FFH	    ;[ƒ{ƒX]
  1138	M000508 25 19 07 FF	BONUS_TR_DATA	BYTE	ysse_P,	   yshn_P,    ysbonus_P, 0FFH	    ;[ƒ{[ƒiƒX]
  1139	M00050C 25 19 1F FF	OOBOSS_TR_DATA	BYTE	ysse_P,	   yshn_P,    ysoobs_P,	 0FFH	    ;[‘åƒ{ƒX]
  1140	M000510 25 01 04 FF	ATHRE_TR_DATA	BYTE	ysse_P,	   ysat_P,    ysathre_P, 0FFH	    ;[ƒAƒXƒŒƒ`ƒbƒN]
  1141	M000514 31 34 FF FF	KUPPA_TR_DATA	BYTE	yskp_P,	   yskuppa_P, 0FFH,	 0FFH	    ;[‘åƒNƒbƒp]
  1142	M000518 37 3A FF FF	ENDING_TR_DATA	BYTE	ysed_P,	   ysend_P,   0FFH,	 0FFH	    ;[ƒGƒ“ƒfƒBƒ“ƒO]
  1143				;
  1144		000000		TITLE_TR	EQU	TITLE_TR_DATA-SOUND_TR_DATA
  1145		000004		W1_0_DM_TR	EQU	W1_0_DM_TR_DATA-SOUND_TR_DATA
  1146		000008		MAP_TR		EQU	MAP_TR_DATA-SOUND_TR_DATA
  1147		00000C		OHANA_TR	EQU	OHANA_TR_DATA-SOUND_TR_DATA
  1148		000010		CHIJYO_TR	EQU	CHIJYO_TR_DATA-SOUND_TR_DATA
  1149		000014		CHIKA_TR	EQU	CHIKA_TR_DATA-SOUND_TR_DATA
  1150		000018		OSHIRO_TR	EQU	OSHIRO_TR_DATA-SOUND_TR_DATA
  1151		00001C		BOSS_TR		EQU	BOSS_TR_DATA-SOUND_TR_DATA
  1152		000020		BONUS_TR	EQU	BONUS_TR_DATA-SOUND_TR_DATA
  1153		000024		OOBOSS_TR	EQU	OOBOSS_TR_DATA-SOUND_TR_DATA
  1154		000028		ATHRE_TR	EQU	ATHRE_TR_DATA-SOUND_TR_DATA
  1155		00002C		KUPPA_TR	EQU	KUPPA_TR_DATA-SOUND_TR_DATA
  1156		000030		ENDING_TR	EQU	ENDING_TR_DATA-SOUND_TR_DATA
  1157				;
  1158				;------------------------------------------------------------------------
  1159				;-		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—ƒe[ƒuƒ‹				-
  1160				;------------------------------------------------------------------------
  1161		00051C		ITEM_STOP_SW	EQU	$
  1162	M00051C 00				HEX	0		;[0] ‚¨‰Ô”¨
  1163	M00051D 00				HEX	0		;[1] ’nã
  1164	M00051E 00				HEX	0		;[2] ‚¨é
  1165	M00051F 01				HEX	1		;[3] ƒ{ƒX
  1166	M000520 00				HEX	0		;[4] ’n‰º
  1167	M000521 01				HEX	1		;[5] ƒ{ƒXi‚¢‚«‚È‚èƒ{ƒX‚a‚f‚lj
  1168	M000522 00				HEX	0		;[6] ƒ{[ƒiƒXƒQ[ƒ€
  1169	M000523 01				HEX	1		;[7] ‘åƒ{ƒX
  1170	M000524 01				HEX	1		;[8] ‘åƒ{ƒXi‚¢‚«‚È‚èƒ{ƒX‚a‚f‚lj
  1171	M000525 01				HEX	1		;[9] ‘åƒ{ƒXiƒJƒ`ƒJƒ`—p‚¢‚«‚È‚èƒ{ƒX‚a‚f‚lj
  1172	M000526 00				HEX	0		;[A] ƒAƒXƒŒƒ`ƒbƒN
  1173	M000527 00				HEX	0		;[B] –³“Gƒ}ƒŠƒI
  1174	M000528 01				HEX	1		;[C] ‘åƒNƒbƒp
  1175	M000529 00				HEX	0		;[D] ƒXƒyƒVƒƒƒ‹‚S
  1176	M00052A 00				HEX	0		;[E]
  1177	M00052B 00				HEX	0		;[F]
  1178				;
  1179	M00052C FF				HEX	FF		;[10] ƒ^ƒCƒgƒ‹
  1180	M00052D 00				HEX	0		;[11] ‚P‚v|‚Oƒfƒ‚
  1181	M00052E FF				HEX	FF		;[12] ƒ}ƒbƒv
  1182				;
  1183		00052E		GAME_TR_ADRS	EQU	$-1
  1184	M00052F 0C				BYTE	OHANA_TR	;[0] ‚¨‰Ô”¨
  1185	M000530 10				BYTE	CHIJYO_TR	;[1] ’nã
  1186	M000531 18				BYTE	OSHIRO_TR	;[2] ‚¨é
  1187	M000532 1C				BYTE	BOSS_TR		;[3] ƒ{ƒX
  1188	M000533 14				BYTE	CHIKA_TR	;[4] ’n‰º
  1189	M000534 1C				BYTE	BOSS_TR		;[5] ƒ{ƒXi‚¢‚«‚È‚èƒ{ƒX‚a‚f‚lj
  1190	M000535 20				BYTE	BONUS_TR	;[6] ƒ{[ƒiƒXƒQ[ƒ€
  1191	M000536 24				BYTE	OOBOSS_TR	;[7] ‘åƒ{ƒX
  1192	M000537 24				BYTE	OOBOSS_TR	;[8] ‘åƒ{ƒXi‚¢‚«‚È‚èƒ{ƒX‚a‚f‚lj
  1193	M000538 24				BYTE	OOBOSS_TR	;[9] ‘åƒ{ƒXiƒJƒ`ƒJƒ`—p‚¢‚«‚È‚èƒ{ƒX‚a‚f‚lj
  1194	M000539 28				BYTE	ATHRE_TR	;[A] ƒAƒXƒŒƒ`ƒbƒN
  1195	M00053A 28				BYTE	ATHRE_TR	;[B] –³“Gƒ}ƒŠƒI
  1196	M00053B 2C				BYTE	KUPPA_TR	;[C] ‘åƒNƒbƒp
  1197	M00053C 1C				BYTE	BOSS_TR		;[D] ƒXƒyƒVƒƒƒ‹‚S
  1198	M00053D 00				BYTE	0		;[E]
  1199	M00053E 00				BYTE	0		;[F]
  1200				;
  1201	M00053F 00		TITLE_SOUND_ADR BYTE	TITLE_TR	;[10] ƒ^ƒCƒgƒ‹
  1202	M000540 04		W1_0_SOUND_ADR	BYTE	W1_0_DM_TR	;[11] ‚P‚v|‚Oƒfƒ‚
  1203	M000541 08		MAP_SOUND_ADR	BYTE	MAP_TR		;[12] ƒ}ƒbƒv
  1204	M000542 30		END_SOUND_ADR	BYTE	ENDING_TR	;[13] ƒ}ƒbƒv
  1205				;
  1206		000010		TITLE_SOUND	EQU	TITLE_SOUND_ADR-GAME_TR_ADRS-1
  1207		000011		W1_0_SOUND	EQU	W1_0_SOUND_ADR-GAME_TR_ADRS-1
  1208		000012		MAP_SOUND	EQU	MAP_SOUND_ADR-GAME_TR_ADRS-1
  1209		000013		END_SOUND	EQU	END_SOUND_ADR-GAME_TR_ADRS-1
  1210				;
  1211		000543		SOUND_TR_2	EQU	$
  1212	M000543 8E 014E				STX	BGM_NO
  1213		000546		SOUND_TR	EQU	$
  1214				;
  1215				;------------------------------------------------------------------------
  1216				;-		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—ƒ`ƒFƒbƒN				-
  1217				;------------------------------------------------------------------------
  1218	M000546 AE 014E				LDX	BGM_NO
  1219	M000549 BF 00051C'                      LDA     >ITEM_STOP_SW,X ;ƒAƒCƒeƒ€Žg—p‹ÖŽ~ƒtƒ‰ƒOƒZƒbƒg
  1220	M00054D 30 03				BMI	SOUND_TR_0010	;ƒAƒCƒeƒ€Žg—p‹ÖŽ~ƒtƒ‰ƒOƒZƒbƒg‚n‚jH ( no:SOUND_TR_0010 )
  1221				;
  1222	M00054F 8D 0B48				STA	ITEM_STOP
  1223				;
  1224		000552		SOUND_TR_0010	EQU	$
  1225	M000552 E8				INX
  1226	M000553 EC 0203				CPX	GM_BGM_NO
  1227	M000556 D0 01				BNE	SOUND_TR_0020	;‚a‚f‚l•ÏXH ( yes:SOUND_TR_0020 )
  1228	M000558 6B				RTL
  1229				;
  1230		000559		SOUND_TR_0020	EQU	$
  1231	M000559 8E 0203				STX	GM_BGM_NO
  1232	M00055C 9C 0205				STZ	GM_SOUND_0
  1233	M00055F BF 00052E'                      LDA     >GAME_TR_ADRS,X
  1234	M000563 AA				TAX			;(X) <-- “]‘—ƒ^ƒCƒv
  1235				;
  1236				;------------------------------------------------------------------------
  1237				;-		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—î•ñƒ`ƒFƒbƒN			-
  1238				;------------------------------------------------------------------------
  1239	M000564 64 0C				STZ	<next_flag
  1240	M000566 64 0D				STZ	<next_flag+1
  1241	M000568 64 0E				STZ	<pointer
  1242				;
  1243	M00056A A0 00				LDY	#0
  1244		00056C		SOUND_TR_0050	EQU	$
  1245	M00056C BF 0004E8'                      LDA     >SOUND_TR_DATA,X
  1246	M000570 D9 0207				CMP	SOUND_AR_0,Y
  1247	M000573 F0 2A				BEQ	SOUND_TR_0100	;“]‘—ÏH ( yes:SOUND_TR_0100 )
  1248				;
  1249	M000575 99 0207				STA	SOUND_AR_0,Y
  1250	M000578 C9 FF				CMP	#0FFH
  1251	M00057A F0 23				BEQ	SOUND_TR_0100	;“]‘—H ( no:SOUND_TR_0100 )
  1252				;
  1253	M00057C E6 0C				INC	<next_flag
  1254				;
  1255	M00057E DA				PHX			;(X) save
  1256	M00057F 5A				PHY			;(Y) save
  1257				;
  1258	M000580 AA				TAX
  1259	M000581 A4 0E				LDY	<pointer
  1260	M000583 BF 0004AB'                      LDA     >SOUND_TR_ADRS-1,X
  1261	M000587 99 0000				STA	address,Y
  1262	M00058A BF 0004AC'                      LDA     >SOUND_TR_ADRS-1+1,X
  1263	M00058E 99 0001				STA	address+1,Y
  1264	M000591 BF 0004AD'                      LDA     >SOUND_TR_ADRS-1+2,X
  1265	M000595 99 0002				STA	address+2,Y
  1266	M000598 C8				INY
  1267	M000599 C8				INY
  1268	M00059A C8				INY
  1269	M00059B 84 0E				STY	<pointer
  1270				;
  1271	M00059D 7A				PLY			;(Y) load
  1272	M00059E FA				PLX			;(X) load
  1273		00059F		SOUND_TR_0100	EQU	$
  1274	M00059F E8				INX
  1275	M0005A0 C8				INY
  1276	M0005A1 C0 04				CPY	#4
  1277	M0005A3 90 C7				BCC	SOUND_TR_0050
  1278				;
  1279	M0005A5 C6 0C				DEC	<next_flag
  1280	M0005A7 30 0A				BMI	SOUND_TR_0150	;“]‘—–³‚µH ( yes:SOUND_TR_0150 )
  1281				;
  1282				;------------------------------------------------------------------------
  1283				;-		ƒTƒEƒ“ƒhƒvƒƒOƒ‰ƒ€“]‘—					-
  1284				;------------------------------------------------------------------------
  1285	M0005A9 78				SEI			;IRQ disable
  1286				;
  1287	M0005AA A9 FF				LDA	#0FFH		;flag set !!
  1288	M0005AC 8D 2140				STA	APU_port0
  1289	M0005AF 20 041F'                        JSR     Boot_APU        ;sound transfer
  1290				;
  1291	M0005B2 58				CLI			;IRQ enable
  1292				;
  1293		0005B3		SOUND_TR_0150	EQU	$
  1294	M0005B3 A2 03				LDX	#04-1
  1295		0005B5		SOUND_TR_0200	EQU	$
  1296	M0005B5 9E 2140				STZ	2140H,X		;sound port clear !!
  1297	M0005B8 CA				DEX
  1298	M0005B9 10 FA				BPL	SOUND_TR_0200
  1299				;
  1300						M16
  1300+ M0005BB C2 20				REP	#00100000b
  1301				;
  1302	M0005BD 9C 004D				STZ	SOUND_0
  1303	M0005C0 9C 004F				STZ	SOUND_0_CK
  1304	M0005C3 9C 0053				STZ	SOUND_3
  1305	M0005C6 9C 0055				STZ	SOUND_3_CK
  1306	M0005C9 9C 0057				STZ	SOUND_3_P
  1307	M0005CC 9C 0059				STZ	SOUND_3_BF
  1308				;
  1309						M8
  1309+ M0005CF E2 20				SEP	#00100000b
  1310				;
  1311	M0005D1 6B				RTL
  1312				;
  1313				;************************************************************************
  1314				;*									*
  1315				;*		ƒTƒEƒ“ƒh‚r‚dƒtƒ‰ƒOƒoƒbƒtƒ@ƒZƒbƒg			*
  1316				;*			in :						*
  1317				;*				(A) <-- ‚r‚dƒtƒ‰ƒO			*
  1318				;*			break :						*
  1319				;*				(Y)					*
  1320				;*									*
  1321				;************************************************************************
  1322		0005D2		SOUND_3_ON	EQU	$
  1323	M0005D2 AC 0057				LDY	SOUND_3_P
  1324	M0005D5 99 0059				STA	SOUND_3_BF,Y
  1325	M0005D8 EE 0057				INC	SOUND_3_P
  1326	M0005DB 6B				RTL
  1327				;
  1328				;
  1329				;
  1330				;
  1331				;
  1332	M0005DC					END
