;*******************************
;* STAGE3 MAP DATA
;* LCD LINE0 DATA
;* LCD LINE1 DATA
;* LCD LINE2 DATA
;* LCD LINE3 DATA
;* EVENT NO
;*  EVENT NO &HFF - BOSS STAGE
;*******************************

INIT_DATA_STAGE3:
; INITIAL DATA(18POINT)
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,1,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,2,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,1,0,0

STAGE3_MAP:
DB 0,0,0,0,0;READY,ERASE
DB 0,0,0,0,0;START,ERASE
DB 0,0,0,0,0;READY START DISPLAY END
DB 0,0,0,0,0;GAME START
;UP-DOWN AREA
DB 0,0,0,0,0
DB 0,0,0,3,0
DB 0,0,0,0,15
DB 0,4,0,0,0
DB 0,0,0,0,0
DB 1,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,2,15
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 1,0,0,0,0
DB 0,0,3,0,0
DB 0,0,0,0,0
;METEOR AREA
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,1
DB 0,0,0,0,0
DB 1,0,0,0,0
DB 0,0,0,0,2
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,4,3
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,2,0,4
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,3,0,0,0
DB 0,0,0,0,5
DB 0,0,0,0,0
DB 1,0,0,0,6
DB 0,2,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,3,0
DB 0,0,0,0,0
DB 0,0,0,0,7
DB 0,0,0,0,0
DB 0,0,1,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,8
DB 0,0,0,0,0
DB 0,0,0,2,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,2,0,0
DB 17,13,9,5,0
DB 18,14,10,6,9
DB 19,15,11,7,0
DB 20,16,12,8,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,1,0
DB 0,0,0,0,0
DB 0,0,0,0,10
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,1
DB 0,2,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,2
DB 0,0,0,0,0
DB 0,0,0,0,9
DB 0,0,3,0,0
DB 0,0,0,0,0
DB 0,1,0,0,0
DB 0,0,0,0,8
DB 0,0,0,0,2
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,6
DB 0,0,4,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,11;WALL
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 3,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,12;三連WALL
DB 0,0,0,0,11;
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 17,13,9,5,0
DB 18,14,10,6,0
DB 19,15,11,7,0
DB 20,16,12,8,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 3,0,0,0,0
DB 0,0,0,4,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,3,0,13
DB 0,0,0,0,14
DB 0,0,0,0,0
DB 0,2,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,1,0,0
DB 0,0,0,1,&HF2
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,4,0
DB 3,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,1,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,2,0
DB 0,0,0,0,0
DB 0,0,0,0,0
DB 0,0,0,0,&HFF ;BOSS

;******************************************************
;*              STAGE3 MAP CHARACTOR
;******************************************************
STAGE3_MAP_CHARA:
MAP3_CHR00:DB 0,0,0,0,0,0,0,0 ;無地背景
MAP3_CHR01:DB &H00,&H00,&H20,&H00,&H00,&H00,&H00,&H00 ;STAR1
MAP3_CHR02:DB &H00,&H00,&H00,&H00,&H00,&H00,&H04,&H00 ;STAR2
MAP3_CHR03:DB &H00,&H00,&H20,&H00,&H00,&H04,&H00,&H00 ;STAR3
MAP3_CHR04:DB &H02,&H00,&H00,&H10,&H38,&H10,&H00,&H00 ;STAR4
;RIVER
MAP3_CHR05:DB &H00,&H00,&H00,&H00,&H00,&H00,&H00,&H10 ;RIVER1_1
MAP3_CHR06:DB &H41,&H00,&H00,&H00,&H11,&H00,&H00,&H00 ;RIVER2_1
MAP3_CHR07:DB &H41,&H00,&H00,&H04,&H00,&H00,&H20,&H00 ;RIVER3_1
MAP3_CHR08:DB &H04,&H00,&H08,&H00,&H40,&H02,&H08,&H80 ;RIVER4_1
MAP3_CHR09:DB &H00,&H00,&H00,&H00,&H02,&H10,&H80,&H00 ;RIVER1_2
MAP3_CHR10:DB &H00,&H10,&H01,&H00,&H00,&H00,&H21,&H00 ;RIVER2_2
MAP3_CHR11:DB &H04,&H00,&H20,&H00,&H00,&H10,&H00,&H00 ;RIVER3_2
MAP3_CHR12:DB &H01,&H40,&H00,&H02,&H10,&H80,&H00,&H00 ;RIVER4_2
MAP3_CHR13:DB &H00,&H00,&H02,&H10,&H00,&H00,&H10,&H00 ;RIVER1_3
MAP3_CHR14:DB &H02,&H00,&H00,&H00,&H12,&H00,&H00,&H10 ;RIVER2_3
MAP3_CHR15:DB &H00,&H00,&H84,&H00,&H01,&H80,&H00,&H00 ;RIVER3_3
MAP3_CHR16:DB &H08,&H01,&H00,&H40,&H00,&H00,&H00,&H00 ;RIVER4_3
MAP3_CHR17:DB &H01,&H20,&H00,&H00,&H00,&H40,&H02,&H10 ;RIVER1_4
MAP3_CHR18:DB &H00,&H02,&H00,&H00,&H10,&H00,&H00,&H01 ;RIVER2_4
MAP3_CHR19:DB &H80,&H10,&H00,&H04,&H00,&H00,&H00,&H01 ;RIVER3_4
MAP3_CHR20:DB &H10,&H00,&H00,&H00,&H00,&H00,&H00,&H00 ;RIVER3_4

;******************************************************
;*              STAGE3 ENEMY CHARACTOR
;******************************************************
;BIG_METEOR
CHR_ST3_01:DB &H1F,&H38,&H77,&HEF,&HEF,&HEF,&HF7,&HF8
CHR_ST3_02:DB &HFF,&H7F,&HFB,&HF3,&H7F,&H3F,&H1F,&H0F
CHR_ST3_03:DB &HF0,&HFC,&H7E,&HBF,&HBF,&HBF,&H7F,&HF3
CHR_ST3_04:DB &HF7,&HFF,&HFF,&H9F,&HDE,&HFC,&HF8,&HE0

;SMALL METEOR
CHR_ST3_05:DB &H3E,&H41,&H91,&H81,&H85,&H91,&H83,&H7C
;BF-SPEAR
CHR_ST3_06:DB &H24,&H7E,&H81,&HE7,&H24,&H66,&H81,&HFF
CHR_ST3_06_SMALL:;これはCPRINTで処理するためSUPER GPRINTに登録しない
DB &H00,&H7C,&H44,&H28,&H44,&H38,&H00,&H00
;UP-DOWN
CHR_ST3_07:DB &H66,&HE7,&HA5,&HBD,&HBD,&HA5,&HE7,&H66

;******************************************************
;*              STAGE3 BOSS CHARACTOR
;******************************************************
CHR_BOSS3_MIS:DB &H60,&H90,&HF0,&H90,&H90,&H90,&H90,&HF0

CHR_BOSS3_F_1:DB &H01,&H01,&H02,&H05,&H0B,&H17,&H28,&H4B
CHR_BOSS3_F_2:DB &HC0,&HE0,&H30,&HD0,&HC8,&HC8,&H4C,&H4C
CHR_BOSS3_1_1:DB &H58,&H5C,&HBF,&HFE,&HC0,&H9F,&HE4,&HAA;CORE
CHR_BOSS3_1_2:DB &H4E,&HCF,&H97,&H2F,&H57,&HAD,&H54,&H2C
CHR_BOSS3_2_1:DB &HD5,&H6A,&H55,&H6A,&HD5,&HAA,&HD5,&HAA
CHR_BOSS3_2_2:DB &H14,&HAC,&H54,&HAC,&H54,&HAC,&H54,&HAC
CHR_BOSS3_3_1:DB &HD5,&HAA,&HD5,&HAA,&HD5,&HAA,&HD5,&HAA
CHR_BOSS3_3_2:DB &H54,&HAC,&H56,&HAE,&H56,&HAF,&H57,&HAF
CHR_BOSS3_4_1:DB &HD5,&HAA,&H55,&H2A,&H1F,&H15,&H15,&H0F
CHR_BOSS3_4_2:DB &H57,&HAD,&H54,&HAC,&HFC,&H54,&H54,&HF8

;******************************************************
;*              STAGE3 SENARIO INITIALIZE
;******************************************************
STAGE_3_INIT:
PRE IX,BASE_SENARIO_PTR
LDW $0,SCENARIO
STW $0,(IX+$31)

PRE IX,SCENARIO
LDW $0,ST3_SCENARIO_00 ;DUMMY
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_01
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_02
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_03
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_04
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_05
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_06
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_07
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_08
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_09
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_10
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_11
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_12
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_13
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_14
STIW $0,(IX+$31)
LDW $0,ST3_SCENARIO_15
STIW $0,(IX+$31)
;シナリオを追加する場合はここを修正(MAX64POINT)
RTN

;**********************************
;*    STAGE3 SCENARIO DATA
;*      (9BYTE:MAX64POINT)
;* 1:TIMING(出現タイミング+カウント(今回は1ドットスクロールなので0～7))
;* 2:ENEMY NO
;* 3:X
;* 4:Y
;* 5:LENGTH-X
;* 6:LENGTH-Y
;* 7:FREE
;* 8:FREE
;* 9:EXTRA
;* 10～18：0で自動初期化
;*
;*注意:1 必ず9BYTE定義すること
;*注意:2 10～18バイト目は自動的に0で初期化される
;*
;**********************************
ST3_SCENARIO_00: ;出現しない
ST3_SCENARIO_01:
DB 0,17,136,20,8,8,0,0,&H03,3,1;S:17=-4,1
DB 6,18,136,10,8,8,2,0,&H03,3,1;S:18=-4,1
DB &HFF ;END CODE
ST3_SCENARIO_02:
DB 0,14,136,20,8,8,0,0,&H03,3,1;S:14=-4,-1
DB &HFF ;END CODE
ST3_SCENARIO_03:
DB 0,13,136,10,16,16,0,0,&H0C,1,10;B:13=-2,1
DB &HFF ;END CODE
ST3_SCENARIO_04:
DB 0,13,136,20,16,16,0,0,&H0C,1,10;B:13=-2,1
DB 4,15,136,26,8,8,2,0,&H03,3,1;S:18=-3,-1
DB &HFF ;END CODE
ST3_SCENARIO_05:
DB 0,10,136,24,16,16,0,0,&H0C,1,10;B10=-3,0
DB 4,18,136,12,8,8,2,0,&H03,3,1;S:18=-4,1
DB &HFF ;END CODE
ST3_SCENARIO_06:
DB 0,11,136,20,16,16,0,0,&H0C,1,10;B:11=-3,1
DB 6,18,136,8,10,8,0,0,&H03,3,1;S:18=-4,1
DB &HFF ;END CODE
ST3_SCENARIO_07:
DB 0,12,136,20,16,16,0,0,&H0C,1,10;B:12=-2,0
DB 4,15,136,36,8,8,0,0,&H03,3,1;S:15=-3,-1
DB &HFF ;END CODE
ST3_SCENARIO_08:
DB 0,13,136,20,16,16,0,0,&H0C,1,10;B:13=-2,1
DB 0,14,136,10,8,8,0,0,&H03,3,1;S:14=-4,0
DB &HFF ;END CODE
ST3_SCENARIO_09:
DB 0,10,136,16,16,16,0,0,&H0C,1,10;B10=-3,0
DB 6,15,136,36,8,8,2,0,&H03,3,1;S:15=-3,-1
DB &HFF ;END CODE
ST3_SCENARIO_10:
DB 0,11,136,20,16,16,0,0,&H0C,1,10;B:11=-3,1
DB 2,17,136,12,8,8,0,0,&H03,3,1;S:17=-4,1
DB &HFF ;END CODE
;--------------------WALL---------------
ST3_SCENARIO_11:
DB 0,19,136,08,8,8,0,0,&H64,1,1;LIFE=100
DB 0,19,136,16,8,8,0,0,&H64,1,1;LIFE=100
DB 0,19,136,24,8,8,0,0,&H64,1,1;LIFE=100
DB 0,19,136,32,8,8,0,0,&H64,1,1;LIFE=100
DB &HFF ;END CODE
ST3_SCENARIO_12:
DB 0,19,136,08,8,8,0,0,&H64,1,1;LIFE=100
DB 0,19,136,16,8,8,0,0,&H64,1,1;LIFE=100
DB 0,19,136,24,8,8,0,0,&H64,1,1;LIFE=100
DB 0,19,136,32,8,8,0,0,&H64,1,1;LIFE=100
DB 4,19,136,08,8,8,0,0,&H64,1,1;LIFE=100
DB 4,19,136,16,8,8,0,0,&H64,1,1;LIFE=100
DB 4,19,136,24,8,8,0,0,&H64,1,1;LIFE=100
DB 4,19,136,32,8,8,0,0,&H64,1,1;LIFE=100
DB &HFF ;END CODE
ST3_SCENARIO_13:
;($14:0:上/1※反転後はCOUNTER(3))
;($15:TYPE)
DB 0,2,0,08,8,8,0,0,&H00,1,1;上
DB 0,2,0,24,8,8,1,1,&H00,1,1;下
DB 2,2,0,24,8,8,0,2,&H00,1,1;上
DB 2,2,0,16,8,8,1,0,&H00,1,1;下
DB 4,2,0,12,8,8,0,1,&H00,1,1;上
DB 4,2,0,34,8,8,1,2,&H00,1,1;下
DB 6,2,0,24,8,8,0,0,&H00,1,1;上
DB 6,2,0,18,8,8,1,1,&H00,1,1;下
DB &HFF ;END CODE
ST3_SCENARIO_14:
;($14:0:上/1※反転後はSECTION)
;($15:U-4BIT=3 L-4BIT=TYPE)
DB 0,2,0,16,8,8,0,2,&H00,2,1;上
DB 0,2,0,22,8,8,1,0,&H00,2,1;下
DB 2,2,0,34,8,8,0,1,&H00,2,1;上
DB 2,2,0,32,8,8,1,2,&H00,2,1;下
DB 4,2,0,20,8,8,0,0,&H00,2,1;上
DB 4,2,0,10,8,8,1,1,&H00,2,1;下
DB 6,2,0,12,8,8,0,2,&H00,2,1;上
DB 6,2,0,28,8,8,1,0,&H00,2,1;下
DB &HFF ;END CODE
ST3_SCENARIO_15:
;($14:0:上/1※反転後はSECTION)
;($15:U-4BIT=3 L-4BIT=TYPE)
DB 0,21,136,20,8,8,8,0,&H00,1,1;上
DB 0,21,136,36,8,8,8,0,&H00,1,1;下
DB 2,21,136,20,8,8,8,0,&H00,1,1;上
DB 2,21,136,36,8,8,8,0,&H00,1,1;下
DB 4,21,136,20,8,8,8,0,&H00,1,1;上
DB 4,21,136,36,8,8,8,0,&H00,1,1;下
DB 6,21,136,20,8,8,8,0,&H00,1,1;上
DB 6,21,136,36,8,8,8,0,&H00,1,1;下
DB &HFF ;END CODE
;シナリオは64まで記述可だが今は16のみ
;16以上追加する場合はSTAGE_2_INITを修正

;*********************************
;*        ENEMY MOVE
;*
;*********************************
ST3_ENEMY_MOVE:

LD $28,$31

ST3_ENEMYMOVE_LP:
PRE IX,ENEMY_DATA
;
PHU $28
;
LDM $9,(IX+$28),8
SBC $9,$31
JR Z,NEXT_ST3_ENEMY_M

;-------- NO JUDGE(1-8) ------------
SBC $9,1
JR Z,ST3_ENEMY01_MOVE;(修復中の壁)
SBC $9,2
JR Z,ST3_ENEMY02_MOVE;(背面移動中のBF-SPEAR)
;---------- BULLET(8) --------------
SBC $9,8
JR Z,ST3_ENEMY08_MOVE;BULLET
;---------- BOSS CORE(9) -----------
;---------- NORM(10-255)------------
SBC $9,10
JP Z,ST3_ENEMY10_MOVE;BIG_METEOR_1
SBC $9,11
JP Z,ST3_ENEMY11_MOVE;BIG_METEOR_2
SBC $9,12
JP Z,ST3_ENEMY12_MOVE;BIG_METEOR_3
SBC $9,13
JP Z,ST3_ENEMY13_MOVE;BIG_METEOR_4
SBC $9,14
JP Z,ST3_ENEMY14_MOVE;SMALL_METEOR_1
SBC $9,15
JP Z,ST3_ENEMY15_MOVE;SMALL_METEOR_2
SBC $9,16
JP Z,ST3_ENEMY16_MOVE;SMALL_METEOR_3
SBC $9,17
JP Z,ST3_ENEMY17_MOVE;SMALL_METEOR_4
SBC $9,18
JP Z,ST3_ENEMY18_MOVE;SMALL_METEOR_5
SBC $9,19
JP Z,ST3_ENEMY19_MOVE;自己修復する壁
SBC $9,20
JP Z,ST3_ENEMY20_MOVE;BF-SPEAR
SBC $9,21
JP Z,ST3_ENEMY21_MOVE;UP-DOWN

NEXT_ST3_ENEMY_M:
;
PPU $28
;
AD $28,ENEMY_STRUCT

JR NC,ST3_ENEMYMOVE_LP

RTN

ST3_ENEMY01_MOVE:
AD $15,$30
SB $10,$30
JP NC,ST3_ENEMY01_M_SA
JP ST3_KILL_ENEMY
ST3_ENEMY01_M_SA:
SBC $15,48
JP C,END_ST3ENEMYMOVE
;COUNTER=48なら通常状態に復帰
LD $9,19;壁のキャラNO
LD $16,&H64;LIFE=100
JP END_ST3ENEMYMOVE

ST3_ENEMY02_MOVE:;(背面移動中のBF-SPEAR)
AD $10,2
SBC $10,140
JP C,END_ST3ENEMYMOVE
LD $9,20;BF-SPEARの実体化
LD $14,3;COUNTER初期化
JP END_ST3ENEMYMOVE

ST3_ENEMY08_MOVE:;BULLET
CAL MOVE_BULLET
JP NEXT_ST3_ENEMY_M

ST3_ENEMY10_MOVE:;BIG_METEOR_1
;LIFEが8未満なら分裂
SBC $16,8
JR C,ST3_METEOR_DIV1

;X移動
SB $10,3;X=X-3
;X<0ならオブジェクトを消す
JP C,ST3_KILL_ENEMY
JP END_ST3ENEMYMOVE

ST3_ENEMY11_MOVE:;BIG_METEOR_2
;LIFEが8未満なら分裂
SBC $16,8
JR C,ST3_METEOR_DIV1

;X移動
SB $10,3;X=X-3
;X<0ならオブジェクトを消す
SBC $10,180
JP NC,ST3_KILL_ENEMY
AD $14,$30
SBC $14,8
JP C,END_ST3ENEMYMOVE
SB $11,$30
LD $14,$31
JP END_ST3ENEMYMOVE

ST3_ENEMY12_MOVE:;BIG_METEOR_3
;LIFEが8未満なら分裂
SBC $16,8
JP C,ST3_METEOR_DIV2

;X移動
SB $10,2;X=X-2
;X<0ならオブジェクトを消す
SBC $10,180
JP NC,ST3_KILL_ENEMY
AD $14,$30
SBC $14,8
JP C,END_ST3ENEMYMOVE
AD $11,$30
LD $14,$31
JP END_ST3ENEMYMOVE

ST3_ENEMY13_MOVE:;BIG_METEOR_4
;LIFEが8未満なら分裂
SBC $16,8
JP C,ST3_METEOR_DIV2

;X移動
SB $10,2;X=X-2
;X<0ならオブジェクトを消す
SBC $10,180
JP NC,ST3_KILL_ENEMY
AD $14,$30
SBC $14,16
JP C,END_ST3ENEMYMOVE
AD $11,$30
LD $14,$31
JP END_ST3ENEMYMOVE

;*********************************
;*          隕石分裂
;*********************************
ST3_DIV_METROR:
DB 8,8,1,2,&H03,1,1

ST3_METEOR_DIV1:
;
CAL DELETE_OBJECT;KILL BIG_METRO
;
PRE IX,ST3_DIV_METROR
LD $17,14
LD $18,$10
LD $19,$11
LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
LD $17,15
LD $18,$10
AD $18,8
LD $19,$11
;LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
LD $17,16
LD $18,$10
LD $19,$11
AD $19,8
;LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
LD $17,17
LD $18,$10
AD $18,8
LD $19,$11
AD $19,8
;LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
JP NEXT_ST3_ENEMY_M

ST3_METEOR_DIV2:
;
CAL DELETE_OBJECT;KILL BIG_METRO
;
PRE IX,ST3_DIV_METROR
LD $17,15
LD $18,$10
LD $19,$11
LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
LD $17,16
LD $18,$10
AD $18,8
LD $19,$11
;LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
LD $17,17
LD $18,$10
LD $19,$11
AD $19,8
;LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
LD $17,18
LD $18,$10
AD $18,8
LD $19,$11
AD $19,8
;LDM $20,(IX+$31),7
CAL INSERT_OBJECT
;
JP NEXT_ST3_ENEMY_M

ST3_ENEMY14_MOVE:;SMALL_METEOR_1
SB $10,4
JP C,ST3_KILL_ENEMY
JP END_ST3ENEMYMOVE

ST3_ENEMY15_MOVE:;SMALL_METEOR_2
SB $10,3
JP C,ST3_KILL_ENEMY
;3回に1回Y座標を減じる
SB $15,$30
JP NC,END_ST3ENEMYMOVE
LD $15,2
SB $11,$30
JP C,ST3_KILL_ENEMY
JP END_ST3ENEMYMOVE

ST3_ENEMY16_MOVE:;SMALL_METEOR_3
SB $10,2
JP C,ST3_KILL_ENEMY
AD $11,2
SBC $11,40
JP NC,ST3_KILL_ENEMY
JP END_ST3ENEMYMOVE

ST3_ENEMY17_MOVE:;SMALL_METEOR_4
SB $10,4
JP C,ST3_KILL_ENEMY
AD $11,$30
SBC $11,40
JP NC,END_ST3ENEMYMOVE
JP END_ST3ENEMYMOVE

ST3_ENEMY18_MOVE:;SMALL_METEOR_5
SB $10,4
JR C,ST3_KILL_ENEMY
;3回に1回Y座標を加算する
SB $14,$30
JR NC,END_ST3ENEMYMOVE
LD $14,2
AD $11,$30
JR C,ST3_KILL_ENEMY
JP END_ST3ENEMYMOVE

ST3_ENEMY19_MOVE:;自己修復する壁

SB $10,$30
JR NC,ST3_ENEMY10_LCK
JR ST3_KILL_ENEMY

ST3_ENEMY10_LCK:
;壁のLIFEが100であれば無傷なので通常状態を継続
SBC $16,100
JR NC,END_ST3ENEMYMOVE
;当たり判定無のオブジェクト(CHR NO=1)に変更、初期化
LD $9,1
LD $15,$31;壁の修復中フラグカウンタ=0
JP END_ST3ENEMYMOVE

ST3_ENEMY20_MOVE:;BF-SPEAR
SB $10,4
JR C,ST3_KILL_ENEMY
SB $14,$30;COOUNTER-=1
JR NC,END_ST3ENEMYMOVE

;SELECT TYPE
SBC $15,$31
JR Z,ST3_ENEMY20_T0
SBC $15,$30
JR Z,END_ST3ENEMYMOVE
ST3_ENEMY20_T2:;(上昇)
SB $11,$30
LD $14,3;COUNTER1 RESET
JR C,ST3_KILL_ENEMY
JR END_ST3ENEMYMOVE
ST3_ENEMY20_T0:;(下降)
AD $11,$30
SBC $11,40
JR NC,ST3_KILL_ENEMY
LD $14,3;COUNTER1 RESET
JR END_ST3ENEMYMOVE

ST3_ENEMY21_MOVE:;UP-DOWN
SB $10,3
JR C,ST3_KILL_ENEMY
SBC $15,$30
JR Z,ST3_E21_SEC1
ST3_E21_SEC0:
SB $11,2
SB $14,$30
JR NZ,END_ST3ENEMYMOVE
LD $14,8
LD $15,$30
JR END_ST3ENEMYMOVE
ST3_E21_SEC1:
AD $11,2
SB $14,$30
JR NZ,END_ST3ENEMYMOVE
LD $14,8
LD $15,$31
JR END_ST3ENEMYMOVE

END_ST3ENEMYMOVE:
;DATA SAVE
PRE IX,ENEMY_DATA
STM $9,(IX+$28),8
JP NEXT_ST3_ENEMY_M

ST3_KILL_ENEMY:
CAL DELETE_OBJECT
JP NEXT_ST3_ENEMY_M

;*********************************
;*        STAGE3 ENEMY DISP
;*********************************
ST3_ENEMY_DISP:

LD $28,$31

ST3_ENEMYDISP_LP:
PRE IX,ENEMY_DATA

LDM $9,(IX+$28),8
SBC $9,$31
JR Z,NEXT_ST3_ENEMY_D
;
PHU $28
;
;GPRINTのRTN命令でRTN_ST3_EDISPに戻れるようにするため、RTN_ST3_EDISPのアドレスを
;SSPにPUSHしておく。
;なおGPRINTからの復帰はRTNでありSSPにスタックされたアドレス+1からプログラムを実行するため
;RTN_ST3_EDISPのアドレスから-1したものをSSPにPUSHする。
LDW $0,RTN_ST3_EDISP-1
PHSW $1

SBC $9,1
JR Z,ST3_ENEMY01_DISP;修復中の壁
SBC $9,2
JR Z,ST3_ENEMY02_DISP;(背面移動中のBF-SPEAR)
SBC $9,9
JR Z,ST3_ENEMY09_DISP;BULLET
SBC $9,14;10～13=BIG_METEOR
JP C,ST3_ENEMY10_DISP
SBC $9,19;14～18=SMALL_METEOR
JP C,ST3_ENEMY14_DISP
SBC $9,19
JP Z,ST3_ENEMY19_DISP;自己修復する壁
SBC $9,20
JP Z,ST3_ENEMY20_DISP;BF-SPEAR
SBC $9,21
JP Z,ST3_ENEMY21_DISP;UP-DOWN

;JUMPしなかった場合はSSPを戻す。
PPSW $0

RTN_ST3_EDISP:
;
PPU $28
;
NEXT_ST3_ENEMY_D:

AD $28,ENEMY_STRUCT

JR NC,ST3_ENEMYDISP_LP

RTN

CHR_ST3_WALL_R1:
DB &H00,&H40,&H02,&H20,&H00,&H40,&H00
CHR_ST3_WALL_R2:
DB &H14,&HC1,&H00,&H92,&H40,&H21,&H44

ST3_ENEMY01_DISP:;(修復中の壁)
;COUNTER<8なら何も表示しない
SBC $15,16
RTN C
SBC $15,32
;COUNTER>32なら修復中2を表示
JR NC,ST3_WALL_DISP_R2
;COUNTER<48なら修復中1を表示
ST3_WALL_DISP_R1:
LDW $13,CHR_ST3_WALL_R1
JR ST3_WALL_R_DISP
ST3_WALL_DISP_R2:
LDW $13,CHR_ST3_WALL_R2
ST3_WALL_R_DISP:
LD $12,8
JP CPRINT_OR

ST3_ENEMY02_DISP:;(背面移動中のBF-SPEAR)
;$14の値(0/1)で表示するY座標(8/32)を決める
LD $11,8
SBC $14,0
JR Z,ST3_ENEMY02_A
LD $11,32
ST3_ENEMY02_A:
LD $12,8
LDW $13,CHR_ST3_06_SMALL
JP CPRINT

ST3_ENEMY09_DISP:;BULLET
LDW $13,@CHR_BULLET
#if (USE_LIB=FAST_LIB)
JP SGPRINT_4
#else
LD $12,8
JP GPRINT
#endif

;BIG_METEOR4種類
ST3_ENEMY10_DISP:
ST3_ENEMY11_DISP:
ST3_ENEMY12_DISP:
ST3_ENEMY13_DISP:

PHUW $11
LD $12,8
LDW $13,SG_CHR_DATA03
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

PHUW $11
AD $10,8
LD $12,8
LDW $13,SG_CHR_DATA04
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

PHUW $11
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA05
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

AD $10,8
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA06
#if (USE_LIB=NORMAL_G)
JP GPRINT
#endif
#if(USE_LIB=SUPER_GP)
JP SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
JP SGPRINT_FAST
#endif

;SMALL_METEOR4種類
ST3_ENEMY14_DISP:
ST3_ENEMY15_DISP:
ST3_ENEMY16_DISP:
ST3_ENEMY17_DISP:
ST3_ENEMY18_DISP:
LD $12,8
LDW $13,SG_CHR_DATA07
#if (USE_LIB=NORMAL_G)
JP GPRINT
#endif
#if(USE_LIB=SUPER_GP)
JP SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
JP SGPRINT_FAST
#endif

ST3_ENEMY19_DISP:;自己修復する壁
LDW $13,CHR_WHITE_BOX
LD $12,8
JP CPRINT

ST3_ENEMY20_DISP:;BF-SPEAR
LD $12,8
LDW $13,SG_CHR_DATA11
#if (USE_LIB=NORMAL_G)
JP GPRINT
#endif
#if(USE_LIB=SUPER_GP)
JP SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
JP SGPRINT_FAST
#endif

ST3_ENEMY21_DISP:
LD $12,7
LDW $13,SG_CHR_DATA11
#if (USE_LIB=NORMAL_G)
JP GPRINT
#endif
#if(USE_LIB=SUPER_GP)
JP SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
JP SGPRINT_FAST
#endif

RTN

;*********************************
;*          BOSS3 INIT
;*  +0($9)  種類(0:未使用フラグ,&H01～&HFF)
;*  +1($10)  x(必須)
;*  +2($11)  y(必須)
;*  +3($12)  キャラのXサイズ
;*  +4($13)  キャラのYサイズ
;*  +5($14)  COUNTER1
;*  +6($15)  COUNTER2
;*  +7($16)  LIFE(Cフラグで破壊)
;*  +8($17)  SCORE
;*  +9($18)  DAMAGE
;**********************************
;NOTE
;
;BOSS3は1つのパーツで構成されている。
;PARTS Noは次のとおり
;
;
;         09999 <- &H09:CORE
;         09999
;
;頭の部分(0)は9(CORE)描画時に表示させているだけなので当たり判定はない
;
;動作の際は下記の各パーツのインデックスアドレスを
;直接指定してXを参照、変更している。
;
; 0:ENEMY_DATA_0 = &H09(09):BOSS3 CORE
;
; &H0A:BOSS3_MIS_UPPER
; &H0B:BOSS3_MIS_LOWER
;
;ENEMY_DATA
;+0 NO
;+1 X
;+2 Y
;+3 CHARACTOR X SIZE(当たり判定で使用するので必須)
;+4 CHARACTOR Y SIZE(当たり判定で使用するので必須)
;+5 WORK
;+6 WORK
;+7 LIFE
;------------------------------------------
;+8 SCORE
;+9 DAMAGE
;+A～+F FREE

BOSS3_DATA:
DB 9,148,16,32,16,0,10,&H0A,0,10,0,0,0,0,0,0       ;CORE
BOSS3_DATA_END:
BOSS3_MIS_DATA:;+0:NO,+1:X,+2:Yは省略しているので注意
DB 8,4,0,0,&H00,1,1
BOSS3_MIS_DATAED:

BOSS3_DATA_NUM:EQU 1;BOSS3のパーツ数

BOSS3_INIT:

;RXCNT
;ENEMY_DATA初期化
LDW $0,ENEMY_DATA
LDW $2,&H0FF
LDW $28,CLEME
CAL IOCS_CAL

;BOSS COREの位置データ等を転送
PRE IX,BOSS3_DATA
LDIM $17,(IX+$31),8
LDM $25,(IX+$31),2
CAL INSERT_OBJECT

;転送したBOSSデータを実体化する
CAL INSERT_OBJECT_ON

;ボス戦闘中フラグをONにする。
PRE IX,NOW_BOSS_FIGHT
ST $30,(IX+$31)
;ボス破壊フラグをOFFにする。
PRE IX,BOSS_DESTROY
ST $31,(IX+$31)
;ボスのデータ数(BOSS3:1)を設定にする。
PRE IX,BOSS_DATA_NUM
LD $0,BOSS3_DATA_NUM
ST $0,(IX+$31)
RTN

;************************************
;*              BOSS3 PRE
;*  (BOSS3 MOVE STANBY POSITION)
;************************************
BOSS3_PRE:

PRE IX,ENEMY_DATA_00;CORE
LD $0,1
SB (IX+$0),$30;BOSS3 CORE X
LD $10,(IX+$0);BOSS3 CORE X

;BOSS3のX座標が80になったらボス戦に突入
SBC $10,80
RTN NC
PRE IX,PHASE
LD $0,3
ST $0,(IX+$31) ;PHASE2->3
ST $31,(IX+$30) ;PHASE_COUNTER->0
RTN

;*********************************
;*          MOVE BOSS3
;*
;*USE:
;*      $0      WORK
;*      $2,$3   JUMP TABLE
;*      $9-$16  ENEMY DATA
;*      $28     COUNTER
;*      IX
;*      IZ
;*********************************
MOVE_BOSS3:

LD $28,$31

MOVE_BOSS3_LOOP:
PHU $28
PRE IX,ENEMY_DATA

LDM $9,(IX+$28),8

SBC $9,$31
JR Z,NEXT_MOVE_BOSS3
SBC $9,BOSS_CORE_NO;(9)
JP Z,BOSS3_P09_MOVE
SBC $9,10
JP Z,BOSS3_P10_MOVE
SBC $9,11
JP Z,BOSS3_P11_MOVE

NEXT_MOVE_BOSS3:
PPU $28
AD $28,ENEMY_STRUCT
JR NC,MOVE_BOSS3_LOOP

RTN

BOSS3_P09_MOVE:

PRE IZ,SECTION
LD $0,(IZ+$31)

SBC $0,7
JP Z,BOSS3_P09_SEC7;突撃(ループ対象外)

SBC $15,$16
JP NZ,BOSS3_P09_SEC6

SBC $0,$31
JR Z,BOSS3_P09_SEC0;ミサイル発射
SBC $0,$30
JR Z,BOSS3_P09_SEC1;上
SBC $0,2
JR Z,BOSS3_P09_SEC2;右
SBC $0,3
JP Z,BOSS3_P09_SEC3;下
SBC $0,4
JP Z,BOSS3_P09_SEC4;左
SBC $0,5
JP Z,BOSS3_P09_SEC5;真ん中
SBC $0,6
JP Z,BOSS3_P09_SEC6;突撃(ループ対象外)

BOSS3_P09_SEC0:

CAL BOSS3_FIRE

END_BOSS3P09SEC0:
LDW $0,&H0001;SECTION=1,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
PRE IX,ENEMY_DATA
JP END_BOSS3_MOVE

BOSS3_P09_SEC1:;上
SB $11,$30
SBC $11,8
JP NZ,END_BOSS3_MOVE

END_BOSS3P09SEC1:
LDW $0,&H0002;SECTION=2,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
JP END_BOSS3_MOVE


BOSS3_P09_SEC2:;右
AD $10,$30
SBC $10,100
JP NZ,END_BOSS3_MOVE

END_BOSS3P09SEC2:
LDW $0,&H0003;SECTION=3,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
JP END_BOSS3_MOVE

BOSS3_P09_SEC3:;下
AD $11,$30
SBC $11,16
CAL Z,BOSS3_FIRE
SBC $11,24
JP NZ,END_BOSS3_MOVE

END_BOSS3P09SEC3:
LDW $0,&H0004;SECTION=4,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
JP END_BOSS3_MOVE

BOSS3_P09_SEC4:;左
SB $10,$30
SBC $10,80
JP NZ,END_BOSS3_MOVE

END_BOSS3P09SEC4:
LDW $0,&H0005;SECTION=5,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)

BOSS3_P09_SEC5:;真ん中
SB $11,$30
SBC $11,16
JP NZ,END_BOSS3_MOVE

END_BOSS3P09SEC5:
LDW $0,&H0000;SECTION=0,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
JP END_BOSS3_MOVE

BOSS3_P09_SEC6:;突撃
SB $10,5
JR NC,BOSS3_P09SEC6_SA
LD $10,160
BOSS3_P09SEC6_SA:
SBC $10,80
JP NZ,END_BOSS3_MOVE
;BOSSのLIFEが減じたかを比較するLIFE($15)に現在のLIFEにする
LD $15,$16

END_BOSS3P09SEC6:
LDW $0,&H0007;SECTION=8,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
JP END_BOSS3_MOVE

BOSS3_P09_SEC7:;元のY座標に戻る
SBC $11,16
JR Z,END_BOSS3P09SEC7
JR C,BOSS3_P09SEC7_AD
SB $11,$30
JR BOSS3_P09SEC7_ST
BOSS3_P09SEC7_AD:
AD $11,$30
BOSS3_P09SEC7_ST:
JP END_BOSS3_MOVE

END_BOSS3P09SEC7:
LDW $0,&H0000;SECTION=0,SECTION_COUNTER=0
PRE IZ,SECTION
STW $0,(IZ+$31)
JP END_BOSS3_MOVE

BOSS3_FIRE:

;上
LD $17,10;BOSS3_MIS_UPPER
LD $18,$10
AD $18,8
LD $19,$11
PRE IZ,BOSS3_MIS_DATA
LDM $20,(IZ+$31),7
CAL INSERT_OBJECT

;下
LD $17,11;BOSS3_MIS_LOWER
LD $18,$10
AD $18,8
LD $19,$11
AD $19,12
CAL INSERT_OBJECT

;正面
LD $17,11;BOSS3_MIS_LOWER
LD $18,$10
SB $18,4
LD $19,$11
AD $19,7
LD $23,$30;下移動無し
JP INSERT_OBJECT

BOSS3_P10_MOVE:;MISSILE UPPER

SBC $15,$30
JR Z,BOSS3_PAB_MOVE

BOSS3_P10_SEC0:
AD $10,$30;X+=1
SB $11,$30;Y-=1
AD $14,$30;COUNTER1+=1
SBC $14,5
JR C,END_BOSS3_MOVE
LD $15,$30
JR END_BOSS3_MOVE

BOSS3_P11_MOVE:;MISSILE LOWER

SBC $15,$30
JR Z,BOSS3_PAB_MOVE

BOSS3_P11_SEC0:
AD $10,$30;X+=1
AD $11,$30;Y+=1
AD $14,$30;COUNTER1+=1
SBC $14,5
JR C,END_BOSS3_MOVE
LD $15,$30
JR END_BOSS3_MOVE

;*****************************
;* BOSS3_P10,P11共通処理
;*****************************
BOSS3_PAB_MOVE:
SB $10,4
JR NC,END_BOSS3_MOVE
;JR ST3_KILL_BOSS

;*****************************

ST3_KILL_BOSS:
CAL DELETE_OBJECT
JP NEXT_MOVE_BOSS3

END_BOSS3_MOVE:
PRE IX,ENEMY_DATA
STM $9,(IX+$28),8
JP NEXT_MOVE_BOSS3

;*********************************
;*        DISP BOSS3
;*
;*USE:
;*      $0      WORK
;*      $2,$3   JUMP TABLE
;*      $9-$16  ENEMY DATA
;*      $28     COUNTER
;*      IX
;*      IZ
;*********************************
DISP_BOSS3:
LD $28,$31

DISP_BOSS3_LOOP:

PRE IX,ENEMY_DATA

LDM $9,(IX+$28),8
SBC $9,$31
JR Z,NEXT_DISP_BOSS3
;
PHU $28
;
;GPRINTのRTN命令でRTN_ST3_DBOSS3に戻れるようにするため、RTN_ST3_DBOSS3のアドレスを
;SSPにPUSHしておく。
;なおGPRINTからの復帰はRTNでありSSPにスタックされたアドレス+1からプログラムを実行するため
;RTN_ST3_DBOSS3のアドレスから-1したものをSSPにPUSHする。
LDW $0,RTN_ST3_DBOSS3-1
PHSW $1

SBC $9,BOSS_CORE_NO;(09)
JR Z,BOSS3_P09_DISP
SBC $9,10
JP Z,BOSS3_P10_DISP
SBC $9,11
JP Z,BOSS3_P11_DISP

;JUMPしなかった場合はSSPを戻す。
PPSW $0

RTN_ST3_DBOSS3:

;
PPU $28
;
NEXT_DISP_BOSS3:
AD $28,ENEMY_STRUCT
JR NC,DISP_BOSS3_LOOP
RTN

BOSS3_P09_DISP:;(BOSS3_CORE)

;BOSS3 FRONT UPPER
PHUW $11
SB $10,8
LD $12,8
LDW $13,SG_CHR_DATA13
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3 FRONT LOWER
PHUW $11
SB $10,8
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA14
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_1_1(CORE)
PHUW $11
LD $12,8
LDW $13,SG_CHR_DATA15;CHAR_BOSS3_1_1
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_1_2
PHUW $11
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA16;CHAR_BOSS3_1_2
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_2_1
PHUW $11
AD $10,8
LD $12,8
LDW $13,SG_CHR_DATA17;CHAR_BOSS3_1_2
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_2_2
PHUW $11
AD $10,8
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA18;CHAR_BOSS3_2_2
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_3_1
PHUW $11
AD $10,16
LD $12,8
LDW $13,SG_CHR_DATA19;CHAR_BOSS3_3_1
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_3_2
PHUW $11
AD $10,16
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA20;CHAR_BOSS3_3_2
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_4_1
PHUW $11
AD $10,24
LD $12,8
LDW $13,SG_CHR_DATA21;CHAR_BOSS3_4_1
#if (USE_LIB=NORMAL_G)
CAL GPRINT
#endif
#if(USE_LIB=SUPER_GP)
CAL SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
CAL SGPRINT_FAST
#endif
PPUW $10

;BOSS3_4_2
AD $10,24
AD $11,8
LD $12,8
LDW $13,SG_CHR_DATA22;CHAR_BOSS3_4_2
#if (USE_LIB=NORMAL_G)
JP GPRINT
#endif
#if(USE_LIB=SUPER_GP)
JP SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
JP SGPRINT_FAST
#endif
RTN

BOSS3_P10_DISP:;CHAR_BOSS3_MIS
BOSS3_P11_DISP:
LD $12,8
LDW $13,SG_CHR_DATA12;CHAR_BOSS3_MIS
#if (USE_LIB=NORMAL_G)
JP GPRINT
#endif
#if(USE_LIB=SUPER_GP)
JP SGPRINT
#endif
#if(USE_LIB=FAST_LIB)
JP SGPRINT_FAST
#endif
RTN

;**********************************
;*      BOSS3撃破時の処理
;**********************************
BOSS_DEF_ST3:

;RTN CODE 0:継続をセット
LD $5,$31

;下へ降下
LD $0,2
PRE IX,ENEMY_DATA_00;BOSS3 CORE
LD $11,(IX+$0)
AD $11,$30
ST $11,(IX+$0);BOSS3 CORE
AD $0,32
ST $11,(IX+$0);BOSS3 HAND
SB $0,16
SB $11,8
ST $11,(IX+$0);BOSS3 BODY

PRE IX,EXTRA_COUNTER
AD (IX+$31),$30
LD $0,40
SBC (IX+$31),$0
RTN NZ
;RTN CODE 1:次のフェーズに移行をセット
LD $5,$30
RTN

;**********************************
;*      ST3_INIT_GRAPHIC
;**********************************

ST3_INIT_GRAPHIC:
LDW $0,0;自機
LDW $2,CHR_FIGHTER
CAL SET_SGPRINT_DATA

LDW $0,1;MY BOMB L
LDW $2,CHR_BOMB_L
CAL SET_SGPRINT_DATA

LDW $0,2;MY_BOMB_R
LDW $2,CHR_BOMB_R
CAL SET_SGPRINT_DATA

;ENEMY
;BIG_METEOR
LDW $0,3
LDW $2,CHR_ST3_01
CAL SET_SGPRINT_DATA
LDW $0,4
LDW $2,CHR_ST3_02
CAL SET_SGPRINT_DATA
LDW $0,5
LDW $2,CHR_ST3_03
CAL SET_SGPRINT_DATA
LDW $0,6
LDW $2,CHR_ST3_04
CAL SET_SGPRINT_DATA
;SMALL_METEOR
LDW $0,7;B
LDW $2,CHR_ST3_05
CAL SET_SGPRINT_DATA

;LDW $0,8;BOSS
;LDW $2,CHR_BOSS3_6_1
;CAL SET_SGPRINT_DATA

;LDW $0,9;BOSS
;LDW $2,CHR_BOSS3_6_2
;CAL SET_SGPRINT_DATA

LDW $0,10;UP-DOWN
LDW $2,CHR_ST3_07
CAL SET_SGPRINT_DATA

LDW $0,11;BF-SPEAR
LDW $2,CHR_ST3_06
CAL SET_SGPRINT_DATA

;BOSS
LDW $0,12;BOSS3 MIS;ミサイル
LDW $2,CHR_BOSS3_MIS
CAL SET_SGPRINT_DATA

LDW $0,13;BOSS3 FRONT UPPER
LDW $2,CHR_BOSS3_F_1
CAL SET_SGPRINT_DATA

LDW $0,14;BOSS3 FRONT LOWER
LDW $2,CHR_BOSS3_F_2
CAL SET_SGPRINT_DATA

LDW $0,15;BOSS3 CORE
LDW $2,CHR_BOSS3_1_1
CAL SET_SGPRINT_DATA

LDW $0,16;BOSS3
LDW $2,CHR_BOSS3_1_2
CAL SET_SGPRINT_DATA

LDW $0,17;BOSS3
LDW $2,CHR_BOSS3_2_1
CAL SET_SGPRINT_DATA

LDW $0,18;BOSS3
LDW $2,CHR_BOSS3_2_2
CAL SET_SGPRINT_DATA

LDW $0,19;BOSS3
LDW $2,CHR_BOSS3_3_1
CAL SET_SGPRINT_DATA

LDW $0,20;BOSS3
LDW $2,CHR_BOSS3_3_2
CAL SET_SGPRINT_DATA

LDW $0,21;BOSS3
LDW $2,CHR_BOSS3_4_1
CAL SET_SGPRINT_DATA

LDW $0,22;BOSS3
LDW $2,CHR_BOSS3_4_2
CAL SET_SGPRINT_DATA

RTN

