
		onbankgroup

;==============	バンク０ ================================================
BANK0		GROUP	0
;-------------<	ZCO >-------------
		EXTERN	RNDSUB,OBJBG,DJITRV,SOUNDOUT
;
;-------------<	ZCO >-------------
		EXTERN	PLPSRV,BGMSET,SOUNDCLR
;
;-------------<	ZPL >-------------
		EXTERN	MSGCHK,MSGCHK2,DUSHCL,KNCSET,KNFLSH,PLSHST,MVCALC
		EXTERN	FLASHST,EXIDSH,NXGOTO,LDTIM0,BG1CHG,NAZOCLR,BBSDST
		EXTERN	OTOSET,NXGOTO3,MSGCH2,LDTIM1,LDTIM3,DUSHCL2,CARITMD
		EXTERN	PTOBI,PBULE,POVER,PINDR1,PTATE,PKEN,PMGIC,PBOMB
		EXTERN	PYAST,PBOXER,PROD,PFOLE,PFUCK,ENDG,GMAP,GPLAY
		EXTERN	KURUD
;
;-------------<	ZBS >-------------
		EXTERN	DJRMRD,BGCRRD,BGCRRD2
;
;-------------<	ZES >-------------
		EXTERN	ENPSSV,TAKARSTL,ENMOVEL,ENPTST,STATINC,EN2CST,EN1CST
		EXTERN	ENHNBC,YMVSUBL,ENOMST,HAYAMITL,HAYABITL,ENMOVE,BGKAOITL
		EXTERN	BSLIMITL,TBOSSITL,BSNAKITL,DDNGOITL,BFIREITL,ENFEND
		EXTERN	ENCLER,BBIRDITL,ENSZST,BFISHITL,O2MCHK,SHRVSE,GKFLSH
		EXTERN	ENDTON,PSERCH2L,PSERCHL,CAOFCKL,KTFLCSL,SADWSTL
		EXTERN	NXOMSBL,ENRMCL,EFAIL,EFOLE,EFIRE,EINIT,EMOVE,ESTOP
		EXTERN	ECACH,ESHOT,ENSDCL,HNSMST
;
;-------------<	ZMA >-------------
		EXTERN	HIMITSU,PBSET,HRTC1,HRTC2,HRTC3,HRTC4
		EXTERN	BG1UNIT_ATR_SUB,GK_WhiteOutSub,GET_INIT_EN_SUB
		EXTERN	Unit_change,BBGBRST_SUB,GAKKI_COL_SET_SUB
;
;==============	バンク２ ================================================
BANK2		GROUP	2
;-------------<	ZEX >-------------
                EXTERN  WTUP,SMK1,FLSH,KPWF,HNSM
;
;==============	バンク８ ================================================
BANK8		GROUP	8
;-------------<	ZBD >-------------
		EXTERN	GRBGCR,DJBGCR
;
;==============	バンク１４ ==============================================
BANK14          GROUP   $14
;-------------<	ZDB >-------------
		EXTERN	NOT,DMP,SKY,BKY,KEN,TBO,BMB,KAI,BUL,C01,C10,C20
		EXTERN	C50,GK1,GK5,TAT
;
;==============	バンク２１ ==============================================
BANK21		GROUP	$21
;-------------<	ZCOL >-------------
		EXTERN	BRIGHT,DARK_FRCNT
;
;==============	バンク３６ ==============================================
BANK36		GROUP	$36
;-------------<	ZE9 >-------------
		EXTERN	MUSI_HM,FlyOrBound,OP_LD
;
;========================================================================
;
	PUBALL
;
BANK3	GROUP	03
;
	LIB	ZRAM
	LIB	ZBN
;
;------------------------------------------------
	KANJI
	PAGE
;
	isdmg
;
	LIST
	ORG	$4000
;---------------------------------------------------------------
;;;;;;;;EPBANK	; Program bank
;;;;;;;;	DB	$03 ;PYAAA
;;;;;;;;;;	DB	$04 ;TEST 
;;;;;;;;	DB	$19 ;BUMER
;;;;;;;;	DB	$03 ;BOMBR
;;;;;;;;	DB	$18 ;FUCKS
;;;;;;;;	DB	$03 ;PRTBM
;;;;;;;;;
;;;;;;;;	DB	$03 ;KTOBJ
;;;;;;;;	DB	$03 ;BLOCK
;;;;;;;;	DB	$07 ;TAKAR
;;;;;;;;	DB	$18 ;POWDR
;;;;;;;;;
;;;;;;;;	DB	$03 ;OCTA1
;;;;;;;;	DB	$03 ;OCTAM
;;;;;;;;	DB	$03 ;MORI1
;;;;;;;;	DB	$03 ;MORYA
;;;;;;;;	DB	$06 ;TEKTA
;;;;;;;;	DB	$04 ;RIVER
;;;;;;;;	DB	$06 ;KUZUH
;;;;;;;;	DB	$04 ;GHOST
;;;;;;;;	DB	$04 ;GHOSB
;;;;;;;;	DB	$04 ;GHOSS
;;;;;;;;	DB	$03 ;BOMBO
;;;;;;;;	DB	$07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$18 ;TODD 
;;;;;;;;	DB	$15 ;UNIUNI
;;;;;;;;	DB	$15 ;KANI 
;;;;;;;;	DB	$18 ;MANBO
;;;;;;;;	DB	$18 ;USAGI
;;;;;;;;	DB	$18 ;ONPU 
;;;;;;;;	DB	$18 ;AKUMA
;;;;;;;;	DB	$18 ;ZORA 
;;;;;;;;	DB	$15 ;BLANKA
;;;;;;;;	DB	$19 ;WANI 
;;;;;;;;	DB	$18 ;MAMAD2
;;;;;;;;	DB	$19 ;GAGE   
;;;;;;;;	DB	$18 ;USAG2
;;;;;;;;	DB	$18 ;KUMAS
;;;;;;;;	DB	$18 ;NTORI
;;;;;;;;	DB	$18 ;GMUSI
;;;;;;;;;-Bank 19-
;;;;;;;;	DB	$19 ;OBAKE
;;;;;;;;	DB	$19 ;NIWAX
;;;;;;;;	DB	$19 ;YTUBO
;;;;;;;;	DB	$19 ;DOSNS
;;;;;;;;	DB	$19 ;DOSNB
;;;;;;;;	DB	$19 ;TAIAT
;;;;;;;;	DB	$19 ;FIREB
;;;;;;;;	DB	$19 ;BABUB
;;;;;;;;	DB	$19 ;BOOK 
;;;;;;;;	DB	$19 ;SEIREN
;;;;;;;;	DB	$19 ;KENBM 
;;;;;;;;	DB	$19 ;KAZAM
;;;;;;;;;-Bank 17-
;;;;;;;;	DB	$15 ;SARUK 
;;;;;;;;	DB	$15 ;MOUSE 
;;;;;;;;	DB	$15 ;HODAI 
;;;;;;;;	DB	$15 ;SANBO 
;;;;;;;;	DB	$15 ;MBOSS 
;;;;;;;;	DB	$06 ;FLYIT2  
;;;;;;;;	DB	$15 ;BOSS  
;;;;;;;;	DB	$15 ;SIROS
;;;;;;;;;- - - Ending obj - -
;;;;;;;;	DB	$17 ;EDAI   
;****************************************
;*      Enemy                           *
;****************************************
;- - Kind of enemy - - 
;-- Player wepon - -
PYAAA	EQU	$0
BUMER	EQU	$1
TEST	EQU	$1
BOMBR	EQU	$2
FUCKS	EQU	$3
PRTBM	EQU	$4
;- - - - - - - - - - 
KTOBJ	EQU	$5
BLOCK	EQU	$6
TAKAR	EQU	$7
POWDR	EQU	$8
;- - - - - - - - - -
OCTA1	EQU	$9
OCTAM	EQU	$A
MORI1	EQU	$B
MORYA	EQU	$C
TEKTA	EQU	$D
RIVER	EQU	$E
KUZUH	EQU	$F
GHOST	EQU	$10
GHOSB	EQU	$11
GHOSS	EQU	$12
BOMBO	EQU	$13
HEIS0	EQU	$14
BABUL	EQU	$15
SPARK	EQU	$16
SPAR2	EQU	$17
PORUS	EQU	$18
BLBAT	EQU	$19
SKEL0	EQU	$1A
SLIMB	EQU	$1B
SLIMS	EQU	$1C
BASSF	EQU	$1D
SKEL1	EQU	$1E
MUMMY	EQU	$1F
MOTOS	EQU	$20
MAGE0	EQU	$21
SONIC	EQU	$22
LAIKU	EQU	$23
HIPLP	EQU	$24
BOSS1	EQU	$25
KWUSO	EQU	$26
TRAP0	EQU	$27
COPYA	EQU	$28
HAYAM	EQU	$29
RENO7	EQU	$2A
R7BEM	EQU	$2B
INOSI	EQU	$2C
;- - - - - - - - - -
HART1	EQU	$2D
RUPY1	EQU	$2E
YOSEI	EQU	$2F
KEYSM	EQU	$30	
PLTAT	EQU	$31
HMASK	EQU	$32
POWER	EQU	$33
KINOM	EQU	$34
KAKER	EQU	$35	; ハートのかけら
HARTB	EQU	$36
ALOW1 	EQU	$37
BOMB1	EQU	$38
GAKKI	EQU	$39
KINOK	EQU	$3A
MGPOW	EQU	$3B
KAKIN	EQU	$3C	;葉っぱ！
KAIIN	EQU	$3D	;貝殻！
GIRL0 	EQU	$3E	;マリン
PAPA0 	EQU	$3F	;タリン
BABA0 	EQU	$40
FUKURO	EQU	$41
HINTO 	EQU	$42
EWOOD 	EQU	$43	;話す木
MSPNT 	EQU	$44	;粉かけると話す！
IWAGO 	EQU	$45	;岩ゴロゴロ
SWBLKU	EQU	$46	;スイッチ引くとウゴク！
SWBLKD	EQU	$47	;
SWBLKL	EQU	$48	;
SWBLKR	EQU	$49	;
;
FUKUBOK	EQU	$4A
MSTESF	EQU	$4B
;----------------------- BANK 2-------------
FRBAR	EQU	$4C
NYAMA	EQU	$4D
CHUNLI	EQU	$4E
UFOCH	EQU	$4F
TERSA	EQU	$50
TEKYU	EQU	$51
BHOLE	EQU	$52
BHOL2	EQU	$53
FISHG	EQU	$54	; 釣堀のおじさん
SBOMB	EQU	$55
OBOMB	EQU	$56
NINJA	EQU	$57
NINTM	EQU	$58
HAYAB	EQU	$59
BGKAO	EQU	$5A
BSLIM	EQU	$5B
TBOSS	EQU	$5C
BSNAK	EQU	$5D
GORMA	EQU	$5E
BSKEL	EQU	$5F
DDNGO	EQU	$60	; ドドンゴ
WARP	EQU	$61
BFIRE	EQU	$62
BBIRD	EQU	$63
PSCRL	EQU	$64
BFISH	EQU	$65
ONOFS	EQU	$66
SWTRP	EQU	$67
MVHAS	EQU	$68
HIKUS	EQU	$69
IKADA	EQU	$6A
TANABE	EQU	$6B	; メッセージテスト！
NIWAT	EQU	$6C
WANWAN	EQU	$6D
BTFLY	EQU	$6E
FOXDOG	EQU	$6F
KODOMO	EQU	$70 ; SAME
KODOMA	EQU	$70 ; SAME
KODOMB	EQU	$71
KODOMC	EQU	$72
KODOMD	EQU	$73
MAMA0	EQU	$74
MAMA1	EQU	$75
PAPA1	EQU	$76	;Dr.ライト
URURI	EQU	$77
OZWAN	EQU	$78
MSWAN	EQU	$79
KARAS	EQU	$7A
TRYCY	EQU	$7B
BHANA	EQU	$7C
BHFIR	EQU	$7D
SHANA	EQU	$7E 
KAMEI	EQU	$7F
DENWA	EQU	$80
OBAQ	EQU	$81
OBQBAR	EQU	$82
BEDIN	EQU	$83
IZUMI	EQU	$84
HATO0	EQU	$85
FLYIT	EQU	$86	;Flying item
RANEM	EQU	$87
NOMOS	EQU	$88
HINO0	EQU	$89
PANEL	EQU	$8A
PANEL2	EQU	$8B
SWBLK	EQU	$8C
SWBLK2	EQU	$8D
MIZUB	EQU	$8E
HEIHO	EQU	$8F
SLOT	EQU	$90
KARBY	EQU	$91
OCHAN	EQU	$92
HEISM	EQU	$93	;もぐら兵士
HEISB	EQU	$94	;壁兵士
RICHD	EQU	$95
KAERU	EQU	$96
SWIMP	EQU	$97	;地上水潜りポイント
DAISU	EQU	$98	;サイコロ
AMENB	EQU	$99	;あめんぼ
YUKAB	EQU	$9A	;床 ビュン
YSLIM	EQU	$9B	;床スライム
BALEE	EQU	$9C	;バレリーナ
MOAI 	EQU	$9D	;石像
TBEAM	EQU	$9E	;トウロウビーム
KURI0	EQU	$9F	;栗ぼん
PIHAT	EQU	$A0	;ピーハット
LOPE	EQU	$A1	;ロープ
PACKN	EQU	$A2	;パックン花
LIFTX	EQU	$A3	;リフト 横
LIFTY	EQU	$A4	;リフト 縦
LIFTD	EQU	$A5	;リフト 載ったら落ちる！
LIFTT	EQU	$A6	;リフト 天秤！
HASIR	EQU	$A7	;Level 7 柱
TAMA0	EQU	$A8	;柱ぶつける玉
GESSO	EQU	$A9	;ゲッソー
PUKPK	EQU	$AA	;魚(横）
PUKPV	EQU	$AB	;魚(縦）
PUKPJ	EQU	$AC	;魚（ジャンプ）
MONKY	EQU	$AD	;猿
OCTAJ	EQU	$AE	;パタオクタ
YOSSI	EQU	$AF	;わらしべアイテム！
AMUSI	EQU	$B0	;穴虫！
YUKAS	EQU	$B1	;床作りブロック
AMUST	EQU	$B2	;穴わきだすやつ
HANNY	EQU	$B3	;ハチの巣
PAPA2	EQU	$B4	;タリン（ハチの巣）
KUMA0	EQU	$B5	;クマコック
PAPAL	EQU	$B6	;パパール
MAMAD	EQU	$B7	;人魚
TURI	EQU	$B8	;橋の下釣りおやじ
NYOROO	EQU	$B9	;ニョロニョロ
FUKU	EQU	$0B9
PKURI	EQU	$BA	;パタクリ
SHIGE	EQU	$BB	;しげミン！
TUKAI	EQU	$BC	;鳥使い！
ARIMA	EQU	$BD	;バイア
BOXER	EQU	$BE	;ボクサー
ZONBI	EQU	$BF	;ゾンビ
KHIMI	EQU	$C0	;看板秘密！
GIRL1	EQU	$C1	;海岸マリン！
GIRL2	EQU	$C2	;橋の上マリン！
MAMUU	EQU	$C3	;笛カエル！
TODD	EQU	$C4	;セイウチトッド
UNIUNI	EQU	$C5	;うにうに
KANI	EQU	$C6	;かに！
MANBO	EQU	$C7	;マンボウ
USAGI	EQU	$C8	;マリン呼ぶうさぎ
ONPU 	EQU	$C9	;おんぷ
AKUMA	EQU	$CA	;小悪魔
ZORA	EQU	$CB	;ゾーラ
BLANKA	EQU	$CC	;ピラニア
WANI	EQU	$CD	;ワニ絵かき
MAMAD2	EQU	$CE	;にんぎょ像！
GAGE	EQU	$CF	;剣２もらうとこのやつ！
USAG2	EQU	$D0	;動物村 うさぎ
KUMAS	EQU	$D1	;動物村 小くま
NTORI	EQU	$D2	;動物村 南国鳥
GMUSI	EQU	$D3	;動物村 虫
OBAKE	EQU	$D4	;迷いオバケ（オプション）
NIWAX	EQU	$D5	;ニワトリ（オプション）
YTUBO	EQU	$D6	;横用壷	
DOSNS	EQU	$D7	;ドスン Ｓ	
DOSNB	EQU	$D8	;ドスン Ｌ
TAIAT	EQU	$D9	;体当たりおちる奴！
FIREB	EQU	$DA	;ヨコバブル！
BABUB	EQU	$DB	;大バブル
KAZAM	EQU	$DC	;風見鳥！&ニワトリオヤジ
BOOK	EQU	$DD	;図書館の本
SEIREN	EQU	$DE	;卵山楽器デモ！
KENBM	EQU	$DF	;剣ビーム
;- Bank 15
SARUK	EQU	$E0	;木の上猿！
MOUSE	EQU	$E1	;木の上猿！
HODAI	EQU	$E2	;火のほうだい！
SANBO	EQU	$E3	;さぼてん！
MBOSS	EQU	$E4	;モリブリンボス！
FLYIT2	EQU	$E5	;パタアイテム（矢、ハート）
;------------------------------------
BOSS	EQU	$E6	;ラスト ボス！
SIROS	EQU	$E7	;城スイッチ！
;-- Ending obj - - - -
EDAI	EQU	$E8	;台
;
R_MUSI	EQU	$E9	;赤虫
G_MUSI	EQU	$EA	;緑虫
B_MUSI	EQU	$EB	;青虫
R_GOST	EQU	$EC	;赤オバケ
G_GOST	EQU	$ED	;緑オバケ
B_GOST	EQU	$EE	;青オバケ
R_BLOCK	EQU	$EF	;赤ブロック
G_BLOCK	EQU	$F0	;緑ブロック
B_BLOCK	EQU	$F1	;青ブロック
FLYBND	EQU	$F2	;飛んでいるバウンドする敵
BNDMAN	EQU	$F3	;バウンドする敵
BLKHINO	EQU	$F4	;ヒノックス(ゴーレム)
HINOIWA	EQU	$F5	;ヒノックスゴーレムの岩
R_TUCHI	EQU	$F6	;右側の門番
L_TUCHI	EQU	$F7	;左側の門番
NYO_SLM	EQU	$F8	;ニョロスライム
FK_BOSS	EQU	$F9	;服のボス
C_BOY	EQU	$FA	;カメラ小僧
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	リンク以外のオブジェのパラメータデータ			%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENMDD0
	DB	%01000010 ;PYAAA	00
	DB	%11000010 ;BUMER	01
	DB	%11010010 ;BOMBR	02
	DB	%11000010 ;FUCKS	03
	DB	%11000010 ;PRTBM	04
	DB	%11010010 ;KTOBJ	05
	DB	%11000010 ;BLOCK	06
	DB	%11000010 ;TAKAR	07
	DB	%11000011 ;POWDR	08
	DB	%00010010 ;OCTA1	09
	DB	%01000010 ;OCTAM	0A
	DB	%00010010 ;MORI1	0B
	DB	%01000010 ;MORYA	0C
	DB	%00010010 ;TEKTA	0D
	DB	%00010010 ;RIVER	0E
	DB	%10010010 ;KUZUH	0F
	DB	%00010010 ;GHOST	10
	DB	%00011000 ;GHOSB	11
	DB	%00010010 ;GHOSS	12
	DB	%00010001 ;BOMBO	13
	DB	%00010010 ;HEIS0	14
	DB	%00000010 ;BABUL	15
	DB	%00000010 ;SPARK	16
	DB	%00000010 ;SPAR2	17
	DB	%00010010 ;PORUS	18
	DB	%00000010 ;BLBAT	19
	DB	%00010010 ;SKEL0	1A
	DB	%00010010 ;SLIMB	1B
	DB	%00010001 ;SLIMS	1C
	DB	%00000010 ;BASSF	1D
	DB	%00010010 ;SKEL1	1E
	DB	%00010010 ;MUMMY	1F
	DB	%00010010 ;MOTOS	20
	DB	%00000010 ;MAGE0	21
	DB	%01000010 ;SONIC	22
	DB	%10010010 ;LAIKU	23
	DB	%00010010 ;HIPLP	24
	DB	%11100010 ;BOSS1	25
	DB	%11100010 ;KWUSO	26
	DB	%00000010 ;TRAP0	27
	DB	%00010010 ;COPYA	28
	DB	%00000010 ;HAYAM	29
	DB	%00000010 ;RENO7	2A
	DB	%01000001 ;R7BEM	2B
	DB	%00010010 ;INOSI	2C
	DB	%10110001 ;HART1	2D
	DB	%10110001 ;RUPY1	2E
	DB	%10110001 ;YOSEI	2F
	DB	%10110001 ;KEYSM	30
	DB	%10110001 ;PLTAT	31
	DB	%10110010 ;HMASK	32
	DB	%10110010 ;POWER	33
	DB	%10110001 ;KINOM	34
	DB	%10110010 ;KAKER	35
	DB	%10110010 ;HARTB	36
	DB	%10110010 ;ALOW1	37
	DB	%10110001 ;BOMB1	38
	DB	%10010010 ;GAKKI	39
	DB	%10110010 ;KINOK	3A
	DB	%10110001 ;MGPOW	3B
	DB	%10110010 ;KAKIN	3C
	DB	%10110001 ;KAIIN	3D
	DB	%10000010 ;GIRL0	3E
	DB	%10010010 ;PAPA0	3F
	DB	%10000100 ;BABA0	40
	DB	%10010010 ;FUKURO	41
	DB	%10000010 ;HINTO	42
	DB	%11000000 ;EWOOD	43
	DB	%11000000 ;MSPNT	44
	DB	%11000010 ;IWAGO	45
	DB	%10000010 ;SWBLKU	46
	DB	%10000010 ;SWBLKD	47
	DB	%10000010 ;SWBLKL	48
	DB	%10000010 ;SWBLKR	49
	DB	%11110010 ;FUKUBOK	4A
	DB	%10000010 ;MSTESF	4B
	DB	%01000001 ;FRBAR	4C
	DB	%10000010 ;NYAMA	4D
	DB	%10000010 ;CHUNLI	4E
	DB	%10000010 ;UFOCH	4F
	DB	%00010010 ;TERSA	50
	DB	%00000010 ;TEKYU	51
	DB	%01000010 ;BHOLE	52
	DB	%01000010 ;BHOL2	53
	DB	%11000010 ;FISHG	54
	DB	%00000010 ;SBOMB	55
	DB	%00000010 ;OBOMB	56
	DB	%00000010 ;NINJA	57
	DB	%01000010 ;NINTM	58
	DB	%00001000 ;HAYAB	59
	DB	%01001000 ;BGKAO	5A
	DB	%00000000 ;BSLIM	5B
	DB	%10010001 ;TBOSS	5C
	DB	%00000010 ;BSNAK	5D
	DB	%00000000 ;GORMA	5E
	DB	%00000000 ;BSKEL	5F
	DB	%00000010 ;DDNGO	60
	DB	%11000010 ;WARP		61
	DB	%00001000 ;BFIRE	62
	DB	%00000010 ;BBIRD	63
	DB	%11000000 ;PSCRL	64
	DB	%00000000 ;BFISH	65
	DB	%10000010 ;ONOFS	66
	DB	%00000010 ;SWTRP	67
	DB	%11000000 ;MVHAS	68
	DB	%11000010 ;HIKUS	69
	DB	%10010010 ;IKADA	6A
	DB	%10000010 ;TANABE	6B
	DB	%10010010 ;NIWAT	6C
	DB	%00010010 ;WANWAN	6D
	DB	%11000001 ;BTFLY	6E
	DB	%10010010 ;FOXDOG	6F
	DB	%10010010 ;KODOMA	70
	DB	%10010010 ;KODOMB	71
	DB	%10010010 ;KODOMC	72
	DB	%10010010 ;KODOMD	73
	DB	%10010011 ;MAMA0	74
	DB	%10010010 ;MAMA1	75
	DB	%10010010 ;PAPA1	76
	DB	%10010010 ;URURI	77
	DB	%10010010 ;OZWAN	78
	DB	%10010010 ;MSWAN	79
	DB	%01010010 ;KARAS	7A
	DB	%10010010 ;TRYCY	7B
	DB	%00000000 ;BHANA	7C
	DB	%01000010 ;BHFIR	7D
	DB	%00000010 ;SHANA	7E
	DB	%10000010 ;KAMEI	7F
	DB	%10010010 ;DENWA	80
	DB	%00000000 ;OBAQ		81
	DB	%01000010 ;OBQBAR	82
	DB	%11000010 ;BEDIN	83
	DB	%11010001 ;IZUMI	84
	DB	%11010010 ;HATO0	85
	DB	%11010001 ;FLYIT	86
	DB	%00010010 ;RANEM	87
	DB	%10000100 ;NOMOS	88
	DB	%00001100 ;HINO0	89
	DB	%11000010 ;PANEL	8A
	DB	%11000010 ;PANEL2	8B
	DB	%10010010 ;SWBLK	8C
	DB	%10010010 ;SWBLK2	8D
	DB	%00001000 ;MIZUB	8E
	DB	%00010010 ;HEIHO	8F
	DB	%00010010 ;SLOT		90
	DB	%00010011 ;KARBY	91
	DB	%00010100 ;OCHAN	92
	DB	%00010010 ;HEISM	93
	DB	%10000000 ;HEISB	94
	DB	%10010010 ;RICHD	95
	DB	%10010010 ;KAERU	96
	DB	%11000000 ;SWIMP	97
	DB	%11010010 ;DAISU	98
	DB	%00010010 ;AMENB	99
	DB	%11000000 ;YUKAB	9A
	DB	%11010010 ;YSLIM	9B
	DB	%00010010 ;BALEE	9C
	DB	%10010100 ;MOAI		9D
	DB	%11000000 ;TBEAM	9E
	DB	%00010010 ;KURI0	9F
	DB	%00010010 ;PIHAT	A0
	DB	%00010010 ;LOPE		A1
	DB	%00010100 ;PACKN	A2
	DB	%11000100 ;LIFTX	A3
	DB	%11000100 ;LIFTY	A4
	DB	%11000100 ;LIFTD	A5
	DB	%11000010 ;LIFTT	A6
	DB	%10001010 ;HASIR	A7
	DB	%11010010 ;TAMA0	A8
	DB	%00000010 ;GESSO	A9
	DB	%00010010 ;PUKPK	AA
	DB	%00010010 ;PUKPV	AB
	DB	%00010010 ;PUKPJ	AC
	DB	%10010010 ;MONKY	AD
	DB	%00010010 ;OCTAJ	AE
	DB	%10110010 ;YOSSI	AF
	DB	%00000010 ;AMUSI	B0
	DB	%10000010 ;YUKAS	B1
	DB	%11000000 ;AMUST	B2
	DB	%10000010 ;HANNY	B3
	DB	%10010010 ;PAPA2	B4
	DB	%10000010 ;KUMA0	B5
	DB	%10010010 ;PAPAL	B6
	DB	%10010100 ;MAMAD	B7
	DB	%10010101 ;TURI		B8
	DB	%00010010 ;NYORO	B9
	DB	%00010011 ;PKURI	BA
	DB	%00010010 ;SHIGE	BB
	DB	%00010010 ;TUKAI	BC
	DB	%00010011 ;ARIMA	BD
	DB	%00010110 ;BOXER	BE
	DB	%01010010 ;ZONBI	BF
	DB	%11000000 ;KHIMI	C0
	DB	%11010010 ;GIRL1	C1
	DB	%11010010 ;GIRL2	C2
	DB	%10010100 ;MAMUU	C3
	DB	%10011000 ;TODD		C4
	DB	%00010010 ;UNIUNI	C5
	DB	%00010010 ;KANI		C6
	DB	%11010000 ;MANBO	C7
	DB	%11010010 ;USAGI	C8
	DB	%11000001 ;ONPU		C9
	DB	%10001000 ;AKUMA	CA
	DB	%00000010 ;ZORA		CB
	DB	%01010010 ;BLANKA	CC
	DB	%10000101 ;WANI		CD
	DB	%10000100 ;MAMAD2	CE
	DB	%11000010 ;GAGE		CF
	DB	%10000010 ;USAG2	D0
	DB	%10000010 ;KUMAS	D1
	DB	%10000010 ;NTORI	D2
	DB	%11010010 ;GMUSI	D3
	DB	%11010010 ;OBAKE	D4
	DB	%11010010 ;NIWAX	D5
	DB	%10000010 ;YTUBO	D6
	DB	%00000010 ;DOSNS	D7
	DB	%11000010 ;DOSNB	D8
	DB	%11001000 ;TAIAT	D9
	DB	%01000010 ;FIREB	DA
	DB	%01001000 ;BABUB	DB
	DB	%11000100 ;KAZAM	DC
	DB	%11000010 ;BOOK		DD
	DB	%11000010 ;SEIREN	DE
	DB	%11000010 ;KENBM	DF
	DB	%11010011 ;SARUK	E0
	DB	%11010010 ;MOUSE	E1
	DB	%01000010 ;HODAI	E2
	DB	%00010010 ;SANBO	E3
	DB	%00010011 ;MBOSS	E4
	DB	%11010010 ;FLYIT2	E5
	DB	%01010000 ;BOSS		E6
	DB	%11000000 ;SIROS	E7
	DB	%00000000 ;EDAI		E8
	DB	%00010011 ;R_MUSI	E9
	DB	%00010011 ;G_MUSI	EA
	DB	%00010011 ;B_MUSI	EB
	DB	%01110100 ;R_GOST	EC
	DB	%01110100 ;G_GOST	ED
	DB	%01110100 ;B_GOST	EE
	DB	%10000010 ;R_BLOCK	EF
	DB	%10000010 ;G_BLOCK	F0
	DB	%10000010 ;B_BLOCK	F1
	DB	%10010100 ;FLYBND	F2
	DB	%10010100 ;BNDMAN	F3
	DB	%00001100 ;BLKHINO	F4
	DB	%11000010 ;HINOIWA	F5
	DB	%10000010 ;R_TUCHI	F6
	DB	%10000010 ;L_TUCHI	F7
	DB	%00000110 ;NYO_SLM	F8
	DB	%00001100 ;FK_BOSS	F9
	DB	%10000011 ;C_BOY	FA
;
ENMDD1
	DB	%00000000 ;PYAAA	00
	DB	%00000000 ;BUMER	01
	DB	%00000001 ;BOMBR	02
	DB	%00000001 ;FUCKS	03
	DB	%00000001 ;PRTBM	04
	DB	%00000000 ;KTOBJ	05
	DB	%00000110 ;BLOCK	06
	DB	%00000000 ;TAKAR	07
	DB	%00000000 ;POWDR	08
	DB	%00000000 ;OCTA1	09
	DB	%00000000 ;OCTAM	0A
	DB	%00000000 ;MORI1	0B
	DB	%00000000 ;MORYA	0C
	DB	%00000000 ;TEKTA	0D
	DB	%00000000 ;RIVER	0E
	DB	%10000000 ;KUZUH	0F
	DB	%00000000 ;GHOST	10
	DB	%00001000 ;GHOSB	11
	DB	%00000000 ;GHOSS	12
	DB	%00000001 ;BOMBO	13
	DB	%00000000 ;HEIS0	14
	DB	%00000000 ;BABUL	15
	DB	%00000011 ;SPARK	16
	DB	%00000011 ;SPAR2	17
	DB	%00000000 ;PORUS	18
	DB	%00000000 ;BLBAT	19
	DB	%00000000 ;SKEL0	1A
	DB	%00000000 ;SLIMB	1B
	DB	%00010000 ;SLIMS	1C
	DB	%00000010 ;BASSF	1D
	DB	%00000000 ;SKEL1	1E
	DB	%00000000 ;MUMMY	1F
	DB	%00000000 ;MOTOS	20
	DB	%00000000 ;MAGE0	21
	DB	%00000000 ;SONIC	22
	DB	%00000000 ;LAIKU	23
	DB	%00000000 ;HIPLP	24
	DB	%10000000 ;BOSS1	25
	DB	%10000000 ;KWUSO	26
	DB	%10000010 ;TRAP0	27
	DB	%00000000 ;COPYA	28
	DB	%00000000 ;HAYAM	29
	DB	%10000000 ;RENO7	2A
	DB	%00000000 ;R7BEM	2B
	DB	%10000000 ;INOSI	2C
	DB	%00011101 ;HART1	2D
	DB	%00011101 ;RUPY1	2E
	DB	%00011101 ;YOSEI	2F
	DB	%00011101 ;KEYSM	30
	DB	%00011101 ;PLTAT	31
	DB	%00000001 ;HMASK	32
	DB	%00011101 ;POWER	33
	DB	%00011101 ;KINOM	34
	DB	%00011101 ;KAKER	35
	DB	%00011101 ;HARTB	36
	DB	%00011101 ;ALOW1	37
	DB	%00011101 ;BOMB1	38
	DB	%10011101 ;GAKKI	39
	DB	%00011101 ;KINOK	3A
	DB	%00011101 ;MGPOW	3B
	DB	%00011101 ;KAKIN	3C
	DB	%00011101 ;KAIIN	3D
	DB	%10011000 ;GIRL0	3E
	DB	%10011000 ;PAPA0	3F
	DB	%10011000 ;BABA0	40
	DB	%10011000 ;FUKURO	41
	DB	%10011000 ;HINTO	42
	DB	%10011000 ;EWOOD	43
	DB	%10011000 ;MSPNT	44
	DB	%00000000 ;IWAGO	45
	DB	%10000100 ;SWBLKU	46
	DB	%10000100 ;SWBLKD	47
	DB	%10000100 ;SWBLKL	48
	DB	%10000100 ;SWBLKR	49
	DB	%10000000 ;FUKUBOK	4A
	DB	%10011000 ;MSTESF	4B
	DB	%00000000 ;FRBAR	4C
	DB	%10011000 ;NYAMA	4D
	DB	%10011000 ;CHUNLI	4E
	DB	%10011000 ;UFOCH	4F
	DB	%00000000 ;TERSA	50
	DB	%00000000 ;TEKYU	51
	DB	%00000000 ;BHOLE	52
	DB	%00000000 ;BHOL2	53
	DB	%10000000 ;FISHG	54
	DB	%00000000 ;SBOMB	55
	DB	%00000000 ;OBOMB	56
	DB	%00000000 ;NINJA	57
	DB	%00000000 ;NINTM	58
	DB	%10001000 ;HAYAB	59
	DB	%00001000 ;BGKAO	5A
	DB	%00000000 ;BSLIM	5B
	DB	%10000000 ;TBOSS	5C
	DB	%10000000 ;BSNAK	5D
	DB	%10000000 ;GORMA	5E
	DB	%10101000 ;BSKEL	5F
	DB	%10000000 ;DDNGO	60
	DB	%00000000 ;WARP		61
	DB	%00000000 ;BFIRE	62
	DB	%00000000 ;BBIRD	63
	DB	%00000000 ;PSCRL	64
	DB	%00000000 ;BFISH	65
	DB	%00000000 ;ONOFS	66
	DB	%10000000 ;SWTRP	67
	DB	%00000000 ;MVHAS	68
	DB	%00000000 ;HIKUS	69
	DB	%10000000 ;IKADA	6A
	DB	%10011000 ;TANABE	6B
	DB	%00000000 ;NIWAT	6C
	DB	%10000000 ;WANWAN	6D
	DB	%00000000 ;BTFLY	6E
	DB	%00000000 ;FOXDOG	6F
	DB	%10011000 ;KODOMA	70
	DB	%10011000 ;KODOMB	71
	DB	%10011000 ;KODOMC	72
	DB	%10011000 ;KODOMD	73
	DB	%10011000 ;MAMA0	74
	DB	%10011000 ;MAMA1	75
	DB	%10011000 ;PAPA1	76
	DB	%10011000 ;URURI	77
	DB	%10000000 ;OZWAN	78
	DB	%10011000 ;MSWAN	79
	DB	%00000000 ;KARAS	7A
	DB	%10011000 ;TRYCY	7B
	DB	%00001000 ;BHANA	7C
	DB	%00010000 ;BHFIR	7D
	DB	%00000000 ;SHANA	7E
	DB	%10000000 ;KAMEI	7F
	DB	%10011000 ;DENWA	80
	DB	%00000000 ;OBAQ		81
	DB	%00100000 ;OBQBAR	82
	DB	%00000000 ;BEDIN	83
	DB	%00000000 ;IZUMI	84
	DB	%00000000 ;HATO0	85
	DB	%00111000 ;FLYIT	86
	DB	%00000000 ;RANEM	87
	DB	%10001000 ;NOMOS	88
	DB	%00001000 ;HINO0	89
	DB	%00000100 ;PANEL	8A
	DB	%00000100 ;PANEL2	8B
	DB	%10000100 ;SWBLK	8C
	DB	%10000100 ;SWBLK2	8D
	DB	%10001000 ;MIZUB	8E
	DB	%00000000 ;HEIHO	8F
	DB	%00000000 ;SLOT		90
	DB	%00000000 ;KARBY	91
	DB	%10000000 ;OCHAN	92
	DB	%00000000 ;HEISM	93
	DB	%00000000 ;HEISB	94
	DB	%10000000 ;RICHD	95
	DB	%10000000 ;KAERU	96
	DB	%00000000 ;SWIMP	97
	DB	%00000000 ;DAISU	98
	DB	%00000000 ;AMENB	99
	DB	%00000000 ;YUKAB	9A
	DB	%00000000 ;YSLIM	9B
	DB	%00000000 ;BALEE	9C
	DB	%10100100 ;MOAI		9D
	DB	%00000000 ;TBEAM	9E
	DB	%00000000 ;KURI0	9F
	DB	%00000000 ;PIHAT	A0
	DB	%00000000 ;LOPE		A1
	DB	%00000000 ;PACKN	A2
	DB	%00101100 ;LIFTX	A3
	DB	%00101100 ;LIFTY	A4
	DB	%00101100 ;LIFTD	A5
	DB	%00110000 ;LIFTT	A6
	DB	%10100100 ;HASIR	A7
	DB	%10000000 ;TAMA0	A8
	DB	%00000000 ;GESSO	A9
	DB	%00000000 ;PUKPK	AA
	DB	%00000000 ;PUKPV	AB
	DB	%00000000 ;PUKPJ	AC
	DB	%10000000 ;MONKY	AD
	DB	%00000000 ;OCTAJ	AE
	DB	%00011101 ;YOSSI	AF
	DB	%00000000 ;AMUSI	B0
	DB	%10011000 ;YUKAS	B1
	DB	%00000000 ;AMUST	B2
	DB	%10011000 ;HANNY	B3
	DB	%10011000 ;PAPA2	B4
	DB	%10110100 ;KUMA0	B5
	DB	%10011000 ;PAPAL	B6
	DB	%10011000 ;MAMAD	B7
	DB	%10011000 ;TURI		B8
	DB	%00000000 ;NYORO	B9
	DB	%00000000 ;PKURI	BA
	DB	%00000000 ;SHIGE	BB
	DB	%00000000 ;TUKAI	BC
	DB	%00000000 ;ARIMA	BD
	DB	%10000000 ;BOXER	BE
	DB	%00000000 ;ZONBI	BF
	DB	%00000000 ;KHIMI	C0
	DB	%00011000 ;GIRL1	C1
	DB	%00011000 ;GIRL2	C2
	DB	%10110100 ;MAMUU	C3
	DB	%10110100 ;TODD		C4
	DB	%00000110 ;UNIUNI	C5
	DB	%00000000 ;KANI		C6
	DB	%00110100 ;MANBO	C7
	DB	%10011000 ;USAGI	C8
	DB	%00000000 ;ONPU		C9
	DB	%10000000 ;AKUMA	CA
	DB	%00000000 ;ZORA		CB
	DB	%00000000 ;BLANKA	CC
	DB	%10011000 ;WANI		CD
	DB	%10011000 ;MAMAD2	CE
	DB	%00000000 ;GAGE		CF
	DB	%10011000 ;USAG2	D0
	DB	%10011000 ;KUMAS	D1
	DB	%10011000 ;NTORI	D2
	DB	%10011000 ;GMUSI	D3
	DB	%00000000 ;OBAKE	D4
	DB	%00011000 ;NIWAX	D5
	DB	%10111101 ;YTUBO	D6
	DB	%10000000 ;DOSNS	D7
	DB	%00101101 ;DOSNB	D8
	DB	%00101101 ;TAIAT	D9
	DB	%00000000 ;FIREB	DA
	DB	%00001010 ;BABUB	DB
	DB	%00000000 ;KAZAM	DC
	DB	%00000000 ;BOOK		DD
	DB	%00000000 ;SEIREN	DE
	DB	%00000000 ;KENBM	DF
	DB	%00000000 ;SARUK	E0
	DB	%00000000 ;MOUSE	E1
	DB	%00000000 ;HODAI	E2
	DB	%00000000 ;SANBO	E3
	DB	%10000100 ;MBOSS	E4
	DB	%00111000 ;FLYIT2	E5
	DB	%00000000 ;BOSS		E6
	DB	%00000000 ;SIROS	E7
	DB	%00000000 ;EDAI		E8
	DB	%00000000 ;R_MUSI	E9
	DB	%00000000 ;G_MUSI	EA
	DB	%00000000 ;B_MUSI	EB
	DB	%00000000 ;R_GOST	EC
	DB	%00000000 ;G_GOST	ED
	DB	%00000000 ;B_GOST	EE
	DB	%00000000 ;R_BLOCK	EF
	DB	%00000000 ;G_BLOCK	F0
	DB	%00000000 ;B_BLOCK	F1
	DB	%00000000 ;FLYBND	F2
	DB	%00000000 ;BNDMAN	F3
	DB	%00001000 ;BLKHINO	F4
	DB	%00000000 ;HINOIWA	F5
	DB	%00000000 ;R_TUCHI	F6
	DB	%00000000 ;L_TUCHI	F7
	DB	%00001000 ;NYO_SLM	F8
	DB	%00001000 ;FK_BOSS	F9
	DB	%10011000 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B	$00 ;R_GOST	EC
	DB	$00 ;G_GOST	ED
	DB	$00 ;B_GOST	EE
	DB	$22 ;R_BLOCK	EF
	DB	$22 ;G_BLOCK	F0
	DB	$22 ;B_BLOCK	F1
	DB	$2B ;FLYBND	F2
	DB	$00 ;BNDMAN	F3
	DB	$14 ;BLKHINO	F4
	DB	$00 ;HINOIWA	F5
	DB	$22 ;R_TUCHI	F6
	DB	$22 ;L_TUCHI	F7
	DB	$33 ;NYO_SLM	F8
	DB	$14 ;FK_BOSS	F9
	DB	$00 ;C_BOY	FA
;
ENMDD3
	DB	%00010010 ;PYAAA	00
	DB	%00010010 ;BUMER	01
	DB	%00001010 ;BOMBR	02
	DB	%00010010 ;FUCKS	03
	DB	%00010010 ;PRTBM	04
	DB	%00001010 ;KTOBJ	05
	DB	%00000010 ;BLOCK	06
	DB	%00000010 ;TAKAR	07
	DB	%00000010 ;POWDR	08
	DB	%00001000 ;OCTA1	09
	DB	%00010010 ;OCTAM	0A
	DB	%00001000 ;MORI1	0B
	DB	%00010010 ;MORYA	0C
	DB	%00001000 ;TEKTA	0D
	DB	%00000000 ;RIVER	0E
	DB	%01000000 ;KUZUH	0F
	DB	%00010001 ;GHOST	10
	DB	%00010001 ;GHOSB	11
	DB	%00010001 ;GHOSS	12
	DB	%00000000 ;BOMBO	13
	DB	%00001000 ;HEIS0	14
	DB	%00010010 ;BABUL	15
	DB	%00010010 ;SPARK	16
	DB	%00010010 ;SPAR2	17
	DB	%00001000 ;PORUS	18
	DB	%00010001 ;BLBAT	19
	DB	%00001000 ;SKEL0	1A
	DB	%00001000 ;SLIMB	1B
	DB	%00001000 ;SLIMS	1C
	DB	%00010000 ;BASSF	1D
	DB	%00001000 ;SKEL1	1E
	DB	%00001000 ;MUMMY	1F
	DB	%00001000 ;MOTOS	20
	DB	%00001000 ;MAGE0	21
	DB	%00010010 ;SONIC	22
	DB	%00001000 ;LAIKU	23
	DB	%00001000 ;HIPLP	24
	DB	%00001000 ;BOSS1	25
	DB	%00001000 ;KWUSO	26
	DB	%01010010 ;TRAP0	27
	DB	%00001000 ;COPYA	28
	DB	%00001000 ;HAYAM	29
	DB	%00001010 ;RENO7	2A
	DB	%00010010 ;R7BEM	2B
	DB	%00001000 ;INOSI	2C
	DB	%00001010 ;HART1	2D
	DB	%00001010 ;RUPY1	2E
	DB	%00010011 ;YOSEI	2F
	DB	%00001010 ;KEYSM	30
	DB	%00001010 ;PLTAT	31
	DB	%00001010 ;HMASK	32
	DB	%00001010 ;POWER	33
	DB	%00001010 ;KINOM	34
	DB	%00001010 ;KAKER	35
	DB	%00001000 ;HARTB	36
	DB	%00001010 ;ALOW1	37
	DB	%00001010 ;BOMB1	38
	DB	%00001000 ;GAKKI	39
	DB	%00001010 ;KINOK	3A
	DB	%00001010 ;MGPOW	3B
	DB	%00011011 ;KAKIN	3C
	DB	%00011010 ;KAIIN	3D
	DB	%00000010 ;GIRL0	3E
	DB	%00000010 ;PAPA0	3F
	DB	%00000010 ;BABA0	40
	DB	%00000010 ;FUKURO	41
	DB	%00000010 ;HINTO	42
	DB	%00000010 ;EWOOD	43
	DB	%00000010 ;MSPNT	44
	DB	%01000010 ;IWAGO	45
	DB	%00000010 ;SWBLKU	46
	DB	%00000010 ;SWBLKD	47
	DB	%00000010 ;SWBLKL	48
	DB	%00000010 ;SWBLKR	49
	DB	%01000010 ;FUKUBOK	4A
	DB	%00000010 ;MSTESF	4B
	DB	%00010010 ;FRBAR	4C
	DB	%00000000 ;NYAMA	4D
	DB	%00000010 ;CHUNLI	4E
	DB	%00000010 ;UFOCH	4F
	DB	%00110000 ;TERSA	50
	DB	%00001000 ;TEKYU	51
	DB	%00000010 ;BHOLE	52
	DB	%00000010 ;BHOL2	53
	DB	%00000010 ;FISHG	54
	DB	%00001000 ;SBOMB	55
	DB	%00001000 ;OBOMB	56
	DB	%00001000 ;NINJA	57
	DB	%00010010 ;NINTM	58
	DB	%11010000 ;HAYAB	59
	DB	%10010000 ;BGKAO	5A
	DB	%10010000 ;BSLIM	5B
	DB	%11010000 ;TBOSS	5C
	DB	%10010000 ;BSNAK	5D
	DB	%11010100 ;GORMA	5E
	DB	%10000100 ;BSKEL	5F
	DB	%11010100 ;DDNGO	60
	DB	%00000010 ;WARP		61
	DB	%11010000 ;BFIRE	62
	DB	%10010000 ;BBIRD	63
	DB	%00000010 ;PSCRL	64
	DB	%10000000 ;BFISH	65
	DB	%00000010 ;ONOFS	66
	DB	%01000010 ;SWTRP	67
	DB	%00010010 ;MVHAS	68
	DB	%00000010 ;HIKUS	69
	DB	%00000010 ;IKADA	6A
	DB	%00000010 ;TANABE	6B
	DB	%00000010 ;NIWAT	6C
	DB	%01000011 ;WANWAN	6D
	DB	%00000000 ;BTFLY	6E
	DB	%00000000 ;FOXDOG	6F
	DB	%00000000 ;KODOMA	70
	DB	%00000000 ;KODOMB	71
	DB	%00000000 ;KODOMC	72
	DB	%00000000 ;KODOMD	73
	DB	%00000000 ;MAMA0	74
	DB	%00000000 ;MAMA1	75
	DB	%00000000 ;PAPA1	76
	DB	%00000000 ;URURI	77
	DB	%00000000 ;OZWAN	78
	DB	%00000000 ;MSWAN	79
	DB	%00100000 ;KARAS	7A
	DB	%00000000 ;TRYCY	7B
	DB	%00000010 ;BHANA	7C
	DB	%00000010 ;BHFIR	7D
	DB	%00000010 ;SHANA	7E
	DB	%01000000 ;KAMEI	7F
	DB	%00000000 ;DENWA	80
	DB	%10000100 ;OBAQ		81
	DB	%01000000 ;OBQBAR	82
	DB	%00000000 ;BEDIN	83
	DB	%00000000 ;IZUMI	84
	DB	%00000000 ;HATO0	85
	DB	%00000010 ;FLYIT	86
	DB	%10000100 ;RANEM	87
	DB	%11000100 ;NOMOS	88
	DB	%10010100 ;HINO0	89
	DB	%00000000 ;PANEL	8A
	DB	%00000000 ;PANEL2	8B
	DB	%00000000 ;SWBLK	8C
	DB	%00000000 ;SWBLK2	8D
	DB	%10000100 ;MIZUB	8E
	DB	%00000000 ;HEIHO	8F
	DB	%00000000 ;SLOT		90
	DB	%00000000 ;KARBY	91
	DB	%11000100 ;OCHAN	92
	DB	%00010000 ;HEISM	93
	DB	%00000000 ;HEISB	94
	DB	%00000000 ;RICHD	95
	DB	%00000000 ;KAERU	96
	DB	%00000000 ;SWIMP	97
	DB	%00000000 ;DAISU	98
	DB	%00010000 ;AMENB	99
	DB	%00000000 ;YUKAB	9A
	DB	%00000000 ;YSLIM	9B
	DB	%00000000 ;BALEE	9C
	DB	%01000010 ;MOAI		9D
	DB	%00000010 ;TBEAM	9E
	DB	%00000000 ;KURI0	9F
	DB	%00000000 ;PIHAT	A0
	DB	%00000000 ;LOPE		A1
	DB	%00000000 ;PACKN	A2
	DB	%00000010 ;LIFTX	A3
	DB	%00000010 ;LIFTY	A4
	DB	%00000010 ;LIFTD	A5
	DB	%00000010 ;LIFTT	A6
	DB	%01000010 ;HASIR	A7
	DB	%01000010 ;TAMA0	A8
	DB	%00000000 ;GESSO	A9
	DB	%00010000 ;PUKPK	AA
	DB	%00010000 ;PUKPV	AB
	DB	%00001000 ;PUKPJ	AC
	DB	%00011000 ;MONKY	AD
	DB	%00000000 ;OCTAJ	AE
	DB	%00010011 ;YOSSI	AF
	DB	%00000000 ;AMUSI	B0
	DB	%00010010 ;YUKAS	B1
	DB	%00000000 ;AMUST	B2
	DB	%00000010 ;HANNY	B3
	DB	%00000010 ;PAPA2	B4
	DB	%00000010 ;KUMA0	B5
	DB	%00000010 ;PAPAL	B6
	DB	%00000010 ;MAMAD	B7
	DB	%00000010 ;TURI		B8
	DB	%00000000 ;NYORO	B9
	DB	%00000001 ;PKURI	BA
	DB	%00000000 ;SHIGE	BB
	DB	%10000100 ;TUKAI	BC
	DB	%00010001 ;ARIMA	BD
	DB	%10000100 ;BOXER	BE
	DB	%00000000 ;ZONBI	BF
	DB	%00000000 ;KHIMI	C0
	DB	%00000011 ;GIRL1	C1
	DB	%00000010 ;GIRL2	C2
	DB	%00000010 ;MAMUU	C3
	DB	%00000010 ;TODD		C4
	DB	%00000010 ;UNIUNI	C5
	DB	%00000010 ;KANI		C6
	DB	%00000010 ;MANBO	C7
	DB	%00000010 ;USAGI	C8
	DB	%00000010 ;ONPU		C9
	DB	%00000010 ;AKUMA	CA
	DB	%00000010 ;ZORA		CB
	DB	%00000010 ;BLANKA	CC
	DB	%00000010 ;WANI		CD
	DB	%00000010 ;MAMAD2	CE
	DB	%00000010 ;GAGE		CF
	DB	%00000000 ;USAG2	D0
	DB	%00000000 ;KUMAS	D1
	DB	%00000000 ;NTORI	D2
	DB	%00000000 ;GMUSI	D3
	DB	%00000000 ;OBAKE	D4
	DB	%00000011 ;NIWAX	D5
	DB	%00000010 ;YTUBO	D6
	DB	%01000010 ;DOSNS	D7
	DB	%01000010 ;DOSNB	D8
	DB	%00000010 ;TAIAT	D9
	DB	%00000010 ;FIREB	DA
	DB	%00000010 ;BABUB	DB
	DB	%00000010 ;KAZAM	DC
	DB	%00000010 ;BOOK		DD
	DB	%00000010 ;SEIREN	DE
	DB	%00010010 ;KENBM	DF
	DB	%00000010 ;SARUK	E0
	DB	%00000010 ;MOUSE	E1
	DB	%00000010 ;HODAI	E2
	DB	%00000010 ;SANBO	E3
	DB	%00000000 ;MBOSS	E4
	DB	%00000010 ;FLYIT2	E5
	DB	%00000000 ;BOSS		E6
	DB	%00000010 ;SIROS	E7
	DB	%00000010 ;EDAI		E8
	DB	%00000000 ;R_MUSI	E9
	DB	%00000000 ;G_MUSI	EA
	DB	%00000000 ;B_MUSI	EB
	DB	%00000000 ;R_GOST	EC
	DB	%00000000 ;G_GOST	ED
	DB	%00000000 ;B_GOST	EE
	DB	%00000000 ;R_BLOCK	EF
	DB	%00000000 ;G_BLOCK	F0
	DB	%00000000 ;B_BLOCK	F1
	DB	%00000100 ;FLYBND	F2
	DB	%00000100 ;BNDMAN	F3
	DB	%10010100 ;BLKHINO	F4
	DB	%01000010 ;HINOIWA	F5
	DB	%00000000 ;R_TUCHI	F6
	DB	%00000000 ;L_TUCHI	F7
	DB	%10010100 ;NYO_SLM	F8
	DB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,1,1,0,0,2,0,0,5,2,3,3,0,0,0,0	;2B PKURI 
	DB	0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0	;2C SPARK
	DB	1,1,1,1,1,1,2,1,4,0,1,2,0,0,0,0	;2D SLOT 
	DB	0,0,0,0,0,0,0,2,4,0,2,2,0,0,0,0	;2E KARBY
	DB	1,1,1,1,1,1,1,2,4,0,3,2,0,0,0,0	;2F MUMMY
	DB	1,1,1,1,1,2,2,1,1,0,3,2,0,0,0,0	;30 NINJA
	DB	6,6,6,6,6,6,6,6,6,0,6,6,0,0,0,0	;31 RGBのMUSI
	DB	0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0	;32 RGBのGOST
;;;KK;;;	DB	1,1,1,1,1,0,0,0,0,2,0,0,0,0,0,0	;33 NYO_SLM(ニョロの時)
	DB	1,1,1,1,1,0,0,0,0,6,0,0,0,0,0,0	;33 NYO_SLM(ニョロの時)
	DB	1,1,1,1,1,0,0,0,0,6,0,0,0,0,0,0	;34 NYO_SLM(スライムの時)
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ITMHITP
;;	 FF:Stop  FE:Fire  FD:Fairy
;;		  0   1   2   3   4   5   6   7    剣 Ｌ１　：　Ｌ２
	DB	$00,$01,$02,$40,$00,$00,$FF,$00 ;0    切る
	DB	$00,$02,$01,$40,$00,$00,$FF,$00 ;1　回転切り    切る
	DB	$00,$04,$02,$40,$00,$00,$FF,$00 ;2            回転切り
	DB	$00,$08,$04,$40,$00,$00,$FF,$00 ;3 ？？？？？？？？？？
	DB	$00,$10,$08,$40,$00,$00,$FF,$00 ;4 ？？？？？？？？？？
	DB	$00,$01,$04,$40,$00,$00,$FF,$00 ;5 弓
	DB	$00,$FF,$02,$40,$00,$00,$FF,$00 ;6 フックショット
	DB	$00,$01,$04,$40,$00,$00,$FF,$00 ;7 爆弾
	DB	$00,$FF,024,$FE,$02,$FD,$FF,$00 ;8 ブーメラン
	DB	$00,$FF,$FD,$FE,$00,$00,$02,$00 ;9 魔法の粉
	DB	$00,$01,$04,$FE,$00,$00,$FF,$00 ;A マジックロッド
	DB	$00,$FF,$02,$40,$00,$00,$FF,$00 ;B 投げ物
	DB	$00,$01,$02,$40,$00,$00,$FF,$00 ;C
	DB	$00,$01,$02,$40,$00,$00,$FF,$00 ;D
	DB	$00,$01,$02,$40,$00,$00,$FF,$00 ;E
	DB	$00,$01,$02,$40,$00,$00,$FF,$00 ;F
;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LIFEDT	; 体力
;; 		00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
	DB	 1, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4
;; 	        10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
	DB	12,63, 8, 8,08,12, 0, 0, 4, 6, 8,10, 4,20,10,24
;; 	        20 21 22 23 24 25  26 27 28 29 2A 2B 2C 2D 2E 2F
	DB	 4,02,08, 8, 2, 4,$FF, 0, 2, 4, 2, 3, 1, 1, 8, 6
;; 	        30 31 32 33 34
	DB	 2,10, 1, 8, 8
ATCKDT	; 攻撃力
;; 		00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
	DB	 4, 4, 8, 8,24, 8, 4, 8,16, 8,16, 8, 8, 4, 8, 8
;; 	        10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
	DB	 8, 8, 8, 8, 8,12, 0, 0, 8, 8,08,12,12,20,16,32
;; 	        20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
	DB	 8, 8, 4, 4, 4, 4, 4, 0,20, 8, 4, 8, 4, 4, 8, 8
;; 	        30 31 32 33 34
	DB	 4, 4, 4, 8, 8
ITSTDT	; 摘出アイテム
;;	0:00%  1:25%Rupy  2:50%Rupy  3:50%Heart 4:Heart100%
;;	5:25%Alow 6:25%heart 7:25%randam 8:50%randam 9:fairy50%
;;	A:100%Alow B:Bomb100% C:Rupy100% D:25%Fairy E:100%fairy
;
;; 		00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
	DB	 2, 6, 1, 3, 3, 3,$D, 8,$A, 2, 7,$B, 0, 4, 0, 8
;; 	        10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
	DB	 4,$E,$E,$E,$E,$E, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3
;; 	        20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
	DB	 3, 2, 0, 0, 2, 0, 0, 0, 0, 6, 6,$D,$E, 0, 9, 3
;; 	        30 31 32 33 34
	DB	 6, 0, 2,$E,$E
;- - - - - - - - - - - - - - - - - - - - - -
;-----------------------------------------
ENMDST
	CALL	ENRMCL
;
ENMDSTS
	LD	A,(GRNDPT)
	LD	HL,ENGRPT
	ADD	HL,BC
	LD	(HL),A
;
	LD	HL,ENJYUN
	ADD	HL,BC
	LD	(HL),$FF
;
ENMDSTS2
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	E,(HL)
;
	LD	D,B ;$0
;
	LD	HL,ENMDD0
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	(HL),A
;
	LD	HL,ENMDD1
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENMOD1
	ADD	HL,BC
	LD	(HL),A
;
	CALL	ENSTST
;
	LD	HL,ENMDD3
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	(HL),A
;
	JP  	ENSZST	; Hit size set !!
;;	RET
;===============================================
;=	ステータス　セット		       =
;===============================================
ENSTST
	PUSH	DE
;
	LD	HL,ENMDD2
	ADD	HL,DE
	LD	E,(HL)
	LD	HL,ENMOD2
	ADD	HL,BC
	LD	(HL),E
	LD	D,B
	LD	HL,LIFEDT
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENLIFE
	ADD	HL,BC
	LD	(HL),A
;
	POP	DE
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BSKCLER
	LD	A,$01
	LD	(NAZOCL),A
	JP	ENCLER
;------------------------------------
ENINIT
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%10000000
	JR	Z,EI09010	; Boss ?
;				; Yes !
	LD	A,(DJSVBF)
	AND	%00110000
	JR	Z,EI09008	; Already Boss fail chach ?
;				; yes ! not set
	JP	ENCLER
EI09008
	LD	A,(ENMYNO2)
	CP	BSKEL
	JR	NZ,EI0900A	;逃げるガイコツ？
;				;YES !
	LD	A,(GRNDPT)	;出現順番チェック！
	CP	$95
	JR	Z,EI0900A
	CP	$92
	JR	Z,EI0900A
	CP	$84
	JR	Z,EI0900B
;
	LD	A,(DJRMSV+$84)
	AND	%00110000
	JR	Z,BSKCLER
EI0900B
	LD	A,(DJRMSV+$92)
	AND	%00110000
	JR	Z,BSKCLER
	LD	A,(DJRMSV+$95)
	AND	%00110000
	JR	Z,BSKCLER
EI0900A
	LD	A,(DJFLAG)
	AND	A
	JR	Z,EI090A1
;
	LD	A,(BIRDFG)
	AND	A
	JR	NZ,EI09009
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%00000100
	JR	Z,EI090A1	;中ボス？
;				;YES !
	LD	(DJSDON),A	;スクロールアウトBGMセットフラグ！
EI090A1
	CALL	SOUNDCLR	;(S)
;
EI09009
	XOR	A
	LD	(BSSDFG),A
;
	INC	A
	LD	(BOSSFG),A
;
	LD	A,$20
	LD	(BSSDTM),A
EI09010
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EMOVE ;A
;
	LD	A,$003
	CALL	GET_INIT_EN_SUB
	JP	(HL)
;
;;;KK;;;	LD	A,(ENMYNO2)
;;;KK;;;	RST	0
;;;KK;;;	DW	ENRET	;		00
;;;KK;;;	DW	ENRET ;IT ;ENRET	01
;;;KK;;;	DW	ENRET	;		02
;;;KK;;;	DW	ENRET	;		03
;;;KK;;;	DW	ENRET	;		04
;;;KK;;;	DW	ENRET	;		05
;;;KK;;;	DW	BLOCKIT	;		06
;;;KK;;;	DW	TAKARIT ;1		07
;;;KK;;;	DW	ENRET   ;2		08
;;;KK;;;	DW	OCTA1IT ;3		09
;;;KK;;;	DW	ENRET   ;4		0A
;;;KK;;;	DW	MORI1IT ;5		0B
;;;KK;;;	DW	ENRET	;		0C
;;;KK;;;	DW	ENRET	;		0D
;;;KK;;;	DW	RIVERIT	;		0E
;;;KK;;;	DW	ENRET	;		0F
;;;KK;;;	DW	GHOSTIT	;		10
;;;KK;;;	DW	GHOSBIT	;		11
;;;KK;;;	DW	GHOSSIT	;		12
;;;KK;;;	DW	BOMBOIT	;		13
;;;KK;;;	DW	HEIS0IT	;		14
;;;KK;;;	DW	BABULIT	;		15
;;;KK;;;	DW	SPARKIT	;		16
;;;KK;;;	DW	SPAR2IT	;		17
;;;KK;;;	DW	ENRET	;		18
;;;KK;;;	DW	ENRET	;		19
;;;KK;;;	DW	ENRET	;		1A
;;;KK;;;	DW	SLIMBIT	;		1B
;;;KK;;;	DW	ENRET	;		1C
;;;KK;;;	DW	BASSFIT	;		1D
;;;KK;;;	DW	STATINC	;SKEL1IT	1E
;;;KK;;;	DW	STATINC ;MUMMYIT	1F
;;;KK;;;	DW	ENRET	;		20
;;;KK;;;	DW	MAGE0IT	;		21
;;;KK;;;	DW	ENRET	;		22
;;;KK;;;	DW	STATINC ;LAIKUIT	23
;;;KK;;;	DW	ENRET	;		24
;;;KK;;;	DW	BOSS1IT	;		25
;;;KK;;;	DW	KWUSOIT	;		26
;;;KK;;;	DW	ENRET	;		27
;;;KK;;;	DW	ENRET	;		28
;;;KK;;;	DW	HAYAMITL;		29
;;;KK;;;	DW	ENRET	; RENO7		2A
;;;KK;;;	DW	ENRET	; R7BEM		2B
;;;KK;;;	DW	ENRET	; INOSI		2C
;;;KK;;;	DW	HART1IT ;ENRET		2D
;;;KK;;;	DW	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ET  ;TEKYUIT		51
;;;KK;;;   	DW	ENRET  ;BHOLEIT		52
;;;KK;;;   	DW	ENRET  ;BHOL2IT		53
;;;KK;;;   	DW	EVENTIT ;FISHGIT	54
;;;KK;;;	DW	ENRET  ;SBOMBIT		55
;;;KK;;;	DW	ENRET  ;OBOMBIT		56
;;;KK;;;	DW	ENRET  ;NINJAIT		57
;;;KK;;;	DW	ENRET  ;NINTMIT		58
;;;KK;;;	DW	HAYABITL  ;HAYABIT	59
;;;KK;;;	DW	BGKAOITL	;	5A
;;;KK;;;	DW	BSLIMITL	;	5B
;;;KK;;;	DW	TBOSSITL	;	5C
;;;KK;;;	DW	BSNAKITL	;	5D
;;;KK;;;	DW	ENRET  ;GORMAITL	5E
;;;KK;;;	DW	ENRET  ;BSKELITL	5F
;;;KK;;;	DW	DDNGOITL	;	60
;;;KK;;;	DW	WARPIT ;STATINC WARP	61
;;;KK;;;	DW	BFIREITL	;	62
;;;KK;;;	DW	BBIRDITL	;	63
;;;KK;;;	DW	PSCRLIT	; Part scroll intial
;;;KK;;;	DW	BFISHITL	;	65
;;;KK;;;	DW	ENRET  ;ONOFS		66
;;;KK;;;	DW	ENRET2  ;SWTRP		67
;;;KK;;;	DW	ENRET2  ;MVHAS		68
;;;KK;;;	DW	HIKUSIT ;HIKUS		69
;;;KK;;;	DW	IKADAIT ;IKADA		6A
;;;KK;;;	DW	ENRET2	; TANABE	6B
;;;KK;;;	DW	ENRET2	; NIWAT		6C
;;;KK;;;	DW	WANWANIT ; WANWAN	6D
;;;KK;;;	DW	ENRET2	; BTFLY		6E
;;;KK;;;	DW	ENRET2	; FOXDOG	6F
;;;KK;;;	DW	PEOPLIT	; KODOMA	70
;;;KK;;;	DW	KODOMBIT ; KODOMB	71
;;;KK;;;	DW	KODOMCIT ; KODOMC	72
;;;KK;;;	DW	PEOPLIT	; KODOMD	73
;;;KK;;;	DW	PEOPLIT ;MAMA0		74
;;;KK;;;	DW	PEOPLIT ;MAMA1		75
;;;KK;;;	DW	PAPA1IT ;PAPA1		76
;;;KK;;;	DW	PEOPLIT ;URURI		77
;;;KK;;;	DW	ENRET2 	; OZWAN		78
;;;KK;;;	DW	MSWANIT ;PEOPLIT MSWAN	79
;;;KK;;;	DW	ENRET2 	; KARAS		7A
;;;KK;;;	DW	PEOPLIT	; TRYCY		7B
;;;KK;;;	DW	BHANAIT	; BHANA		7C
;;;KK;;;	DW	ENRET2 	; BHFIR		7D
;;;KK;;;	DW	ENRET2 	; SHANA		7E
;;;KK;;;	DW	ENRET2 	; KAMEI		7F
;;;KK;;;	DW	DENWAIT	; DENWA		80
;;;KK;;;	DW	ENRET2 	; OBAQ		81
;;;KK;;;	DW	ENRET2 	; OBQBAR	82
;;;KK;;;	DW	BEDINIT	; BEDIN		83
;;;KK;;;	DW	IZUMIIT	; IZUMI		84
;;;KK;;;	DW	ENRET2 	; HATO0		85
;;;KK;;;	DW	FLYITIT	; FLYIT		86
;;;KK;;;	DW	RANEMIT ; RANEM		87
;;;KK;;;	DW	ENRET2 	; NOMOS		88
;;;KK;;;	DW	ENRET2 	; HINO0		89
;;;KK;;;	DW	ENRET2 	; PANEL		8A
;;;KK;;;	DW	ENRET2 	; PANEL2	8B
;;;KK;;;	DW	ENRET2 	; SWBLK		8C
;;;KK;;;	DW	ENRET2 	; SWBLK2	8D
;;;KK;;;	DW	PSADD8 	; MIZUB		8E
;;;KK;;;	DW	ENRET2 	; HEIHO		8F
;;;KK;;;	DW	ENRET2 	; SLOT		90
;;;KK;;;	DW	KARBYIT	; KARBY		91
;;;KK;;;	DW	ENRET2 	; OCHAN		92
;;;KK;;;	DW	ENRET2 	; HEISM		93
;;;KK;;;	DW	ENRET2 	; HEISB		94
;;;KK;;;	DW	RICHDIT	; RICHD		95
;;;KK;;;	DW	ENRET2 	; KAERU		96
;;;KK;;;	DW	ENRET2 	; SWIMP		97
;;;KK;;;	DW	DAISUIT ; DAISU		98
;;;KK;;;	DW	ENRET2  ; AMENB		99
;;;KK;;;	DW	ENRET2  ; YUKAB		9A
;;;KK;;;	DW	ENRET2  ; YSLIM		9B
;;;KK;;;	DW	BALEEIT ; BALEE		9C
;;;KK;;;	DW	ENRET2  ; MOAI		9D
;;;KK;;;	DW	TBEAMIT ; TBEAM		9E
;;;KK;;;	DW	ENRET2  ; KURI0		9F
;;;KK;;;	DW	ENRET2  ; PIHAT		A0
;;;KK;;;	DW	LOPEIT  ; LOPE		A1
;;;KK;;;	DW	ENRET2  ; PACKN		A2
;;;KK;;;	DW	ENRET2  ; LIFTX		A3
;;;KK;;;	DW	LIFTYIT ; LIFTY		A4
;;;KK;;;	DW	ENRET2  ; LIFTD		A5
;;;KK;;;	DW	ENRET2  ; LIFTT		A6
;;;KK;;;	DW	ENRET2  ; HASIR		A7
;;;KK;;;	DW	ENRET2  ; TAMA0		A8
;;;KK;;;	DW	ENRET2  ; GESSO		A9
;;;KK;;;	DW	ENRET2  ; PUKPK		AA
;;;KK;;;	DW	ENRET2  ; PUKPV		AB
;;;KK;;;	DW	ENRET2  ; PUKPJ		AC
;;;KK;;;	DW	MONKYIT ; MONKY		AD
;;;KK;;;	DW	ENRET   ; OCTAJ		AE
;;;KK;;;	DW	YOSSIIT ; YOSSI		AF
;;;KK;;;	DW	ENRET2 	; AMUSI		B0
;;;KK;;;	DW	ENRET2 	; YUKAS		B1
;;;KK;;;	DW	ENRET2 	; AMUST		B2
;;;KK;;;	DW	PSADD8	; HANNY		B3
;;;KK;;;	DW	PAPA2IT	; PAPA2		B4
;;;KK;;;	DW	ENRET2 	; KUMA0		B5
;;;KK;;;	DW	ENRET2 	; PAPAL		B6
;;;KK;;;	DW	ENRET2 	; MAMAD		B7
;;;KK;;;	DW	TURIIT 	; TURI		B8
;;;KK;;;	DW	ENRET2 	; NYORO		B9
;;;KK;;;	DW	PKURIIT	; PKURI		BA
;;;KK;;;	DW	SHIGEIT	; SHIGE		BB
;;;KK;;;	DW	PSADD8 	; TUKAI		BC
;;;KK;;;	DW	ENRET2 	; ARIMA		BD
;;;KK;;;	DW	ENRET2 	; BOXER		BE
;;;KK;;;	DW	ENRET2 	; ZONBI		BF
;;;KK;;;	DW	ENRET2 	; KHIMI		C0
;;;KK;;;	DW	GIRL1IT	; GIRL1		C1
;;;KK;;;	DW	GIRL2IT	; GIRL2		C2
;;;KK;;;	DW	ENRET2	; MAMUU		C3
;;;KK;;;	DW	ENRET2 	; TODD		C4
;;;KK;;;	DW	ENRET2 	; UNIUNI	C5
;;;KK;;;	DW	ENRET2 	; KANI		C6
;;;KK;;;	DW	ENRET2 	; MANBO		C7
;;;KK;;;	DW	ENRET2	; USAGI		C8
;;;KK;;;	DW	ENRET2 	; ONPU		C9
;;;KK;;;	DW	ENRET2 	; AKUMA		CA
;;;KK;;;	DW	ENRET2 	; ZORA		CB
;;;KK;;;	DW	ENRET2 	; BLANKA	CC
;;;KK;;;	DW	ENRET2 	; WANI		CD
;;;KK;;;	DW	ENRET2 	; MAMAD2	CE
;;;KK;;;	DW	ENRET2 	; GAGE		CF
;;;KK;;;	DW	ENRET2  ; USAG2		D0
;;;KK;;;	DW	ENRET2  ; KUMAS		D1
;;;KK;;;	DW	ENRET2  ; NTORI		D2
;;;KK;;;	DW	ENRET2  ; GMUSI		D3
;;;KK;;;	DW	ENRET2  ; OBAKE		D4
;;;KK;;;	DW	ENRET2  ; NIWAX		D5
;;;KK;;;	DW	ENRET2  ; YTUBO		D6
;;;KK;;;	DW	ENRET2  ; DOSNS		D7
;;;KK;;;	DW	ENRET2  ; DOSNB		D8
;;;KK;;;	DW	ENRET2  ; TAIAT		D9
;;;KK;;;	DW	ENRET2  ; FIREB		DA
;;;KK;;;	DW	BABUBIT ; BABUB		DB
;;;KK;;;	DW	ENRET2  ; KAZAM		DC
;;;KK;;;	DW	ENRET2  ; BOOK		DD
;;;KK;;;	DW	ENRET2  ; SEIREN	DE
;;;KK;;;	DW	ENRET2  ; KENBM		DF
;;;KK;;;	DW	ENRET2  ; SARUK		E0
;;;KK;;;	DW	ENRET2  ; MOUSE		E1
;;;KK;;;	DW	ENRET2  ; HODAI		E2
;;;KK;;;	DW	ENRET2  ; SANBO		E3
;;;KK;;;	DW	ENRET2  ; MBOSS		E4
;;;KK;;;	DW	FLYIT2IT; FLYIT2	E5
;;;KK;;;	DW	BOSSIT  ; BOSS		E6
;;;KK;;;	DW	ENRET2 	; SIROS		E7
;;;KK;;;	DW	ENRET2 	; EDAI		E8
;;;KK;;;	DW	ENRET 	; R_MUSI	E9
;;;KK;;;	DW	ENRET 	; G_MUSI	EA
;;;KK;;;	DW	ENRET 	; B_MUSI	EB
;;;KK;;;	DW	ENRET 	; R_GOST	EC
;;;KK;;;	DW	ENRET 	; G_GOST	ED
;;;KK;;;	DW	ENRET 	; B_GOST	EE
;
;------------------------------
DAIIPT
	DB	1,4
DAISUIT
	LD	HL,ENJYUN
	ADD	HL,BC
	LD	E,(HL)
;;	INC	A
	LD	D,B
	LD	HL,DAIIPT
	ADD	HL,DE
	LD	A,(HL)
	JP	ENPTST
;------------------------------
GIRL2IT
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$03
	LD	(HL),A
	RET
;------------------------------
LOPEIT
	CALL	LDTIM1
	LD	(HL),$30
	RET
;------------------------------
LIFTYIT
	LD	A,(GRNDPT)
	CP	$65
	RET	NZ
;
	LD	A,(ENDSYP)
	CP	$50
	RET	C
;
	LD	HL,ENWRK0
	ADD	HL,BC
	INC	(HL)
	RET
;------------------------------
SLIMBIT
	LD	HL,ENLIFE
	ADD	HL,BC
	LD	(HL),$02
	RET
;------------------------------
GIRL1IT
	LD	HL,MARINOF
	LD	A,(MARINFG)
	OR	(HL)
	JP	NZ,ENCLER
	RET
;------------------------------
PKURIIT
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),$10
;
	CALL	RNDSUB
	LD	HL,ENCONT
	ADD	HL,BC
	LD	(HL),A
;;	RET
;------------------------------
SHIGEIT
	RET
;------------------------------
PAPA2IT
	CALL	PSADD8
;
	LD	A,$02
	JP	ENPTST
;------------------------------
DENWAIT
	LD	A,$33
	JR	ENBGMST
;------------------------------
RICHDIT
		LD	A,(GRKEY5)
		CP	$06
		JR	C,RCD_PASS
		LD	HL,ENXPSL
		ADD	HL,BC
		LD	(HL),$58
		LD	HL,ENMUKI
		ADD	HL,BC
		LD	(HL),$003
RCD_PASS
;
	LD	A,$40
ENBGMST
	LD	E,A
;
	LD	A,(KENLEV)
	AND	A
	RET	Z	;剣を持ってないときは専用BGM!
;
	LD	A,E
ENBGMST2
	LD	(SOUND4),A	;(S)
	LD	(BGMNO),A
	LD	(BGMNO2),A
	LD	(TODYFG),A
	RET
;------------------------------
BOSSIT
	XOR	A
	LD	(BOSSNO),A
;
		jp	SOUNDCLR	;(S)
;;;;;;;;	CALL	SOUNDCLR	;(S)
;;;;;;;;	RET
;------------------------------
BEDINIT
	LD	A,$24
	JR	ENBGMST2
;------------------------------
TURIIT
	LD	A,$3A
	JR	ENBGMST2	;(S)
;-----------------------------
MONKYIT
	XOR	A
	LD	(SARUFG),A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$04
	LD	(HL),A
	RET
;------------------------------
TBEAMIT
	CALL	RNDSUB
	JP	ENPTST
;------------------------------
KARBYIT
	CALL	LDTIM3
;
	CALL	RNDSUB
	AND	$3F
	ADD	A,$10
	LD	(HL),A
	RET
;------------------------------
HIKUSIT
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,$0A
	LD	(HL),A
	LD	HL,ENWRK1
	ADD	HL,BC
	LD	(HL),A
	RET
;------------------------------
RANEMIT
;	LD	A,(DJSVBF)
;	AND	%00010000
;	JP	NZ,ENCLER
;;
	XOR	A
	LD	(BGMNO),A
;;	LD	(BSSDFG),A
;
;;	CALL	SOUNDCLR	;(S)
	RET
;------------------------------
FLYIT2IT
	CALL	FII100
;
	LD	A,(ENSVXL)
	SWAP	A
	AND	$01
	ADD	A,$04
	JP  	ENPTST
;------------------------------
FLYITIT
	LD	A,(ENSVXL)
	SWAP	A
	AND	$01
	LD	E,A
	LD	A,(ENSVYL)
	SWAP	A
	INC	A
	RLA
	AND	$02
	OR	E
	CALL	ENPTST
	CP	$01
	JR	NZ,FII100
;
	LD	A,(KINOKFG)
	AND	A
	JP	NZ,ENCLER
FII100
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),$13
;
	RET
;------------------------------
KODOMBIT
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	(HL),$02
;
	CALL	STATINC
;
	CALL	LDTIM0
	LD	(HL),$20
KODOMCIT
	RET
;------------------------------
PAPA1IT
;;	LD	A,$??	;TODY
	LD	A,(GRNDPT)
	CP	$D9
	LD	A,$32	;ライト
	JR	NZ,PP1I10
	LD	A,$37	;ヤギ
PP1I10
	JR	ENITSD	;(S)
;------------------------------
;IZHARTD
;;                 3   4   5   6   7   8   9  10  11  12  13  14
;	DB	$18,$20,$28,$30,$38,$40,$48,$50,$58,$60,$68,$70
IZUMIIT
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),$10
;
		LD	A,(DJFLAG)
		AND	A
		JR	Z,IZUMI_PASS
		LD	A,(DNJNNO)
		CP	NEWDJ		;服のダンジョン？
		JR	Z,IZUMI_SET	;	YES --> IZUMI_SET
IZUMI_PASS
;
	LD	A,(HARTFUL)
	AND	A
	JP	NZ,ENCLER
;
IZUMI_SET
	LD	A,$0C
ENITSD
	CALL	ENBGMST	;(S)
	LD	DE,ENXPSH
	LD	HL,ENXPSL
	JP	ITI010
;------------------------------
WANWANIT
	LD	A,(GRNDPT)
	CP	$E2
	JR	NZ,WANI08	;モリブリンに捕まっている？
;				; YES !
	LD	A,(WANFLG)
	CP	$80
	JR	Z,WANI0A
	JP	ENCLER
WANI08
	LD	A,(WANFLG)
	AND	A
	JP	NZ,ENCLER
;
WANI0A
	RET
;---------------------------------------
FUKUROIT	;
	LD	A,(DJSVBF)
;;	AND	%00100000
	RRA
	JR	ITSVCHK
;---------------------------------------
PLTATIT	; 浜べの剣
	LD	A,(DJSVBF)
ITSVCHK
	AND	%00010000
	JP	NZ,ENCLER	; Already have -> Not set !
	RET
;----------------------------------------
GIRL0IT
	LD	A,(GRNDPT)
	CP	$C0
	JR	C,GR0I10	; 動物村？
;				; YES !
	LD	A,(MARINOF)
	AND	A
	JP	Z,ENCLER
;
	LD	A,(MARINFG)
	AND	A
	JP	NZ,ENCLER ;GR0I10
;
	INC	A
	LD	(UTAFLG),A
;
;;	LD	A,$2F
;;	LD	(SOUND4),A	;(S)
	LD	A,$2F
	LD	(BGMSTF),A
	LD	(BGMNO),A
	LD	(BGMNO2),A
	CALL	SOUNDOUT  ;CLR	;(S)
GR0I10
	LD	A,(HIMITSU)
	AND	A
	JP	Z,PEOPLIT
;
	LD	A,(NAME)
	AND	A
	JR	NZ,PEOPLIT	; Message test ?
;				; yes !
	LD	A,(NAME+1)
	AND	A
	JR	NZ,GR0I11
;
	LD	(ITMODE),A
	LD	A,ENDG
	LD	(GMMODE),A
	RET
GR0I11	
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	(HL),TANABE
	RET
;----------------------------------------
TARIN_BANANA_COL
	DW	$7fff,$0fbe,$0213,$0000
;
TARIN_INIT
		LD	A,(CGBFLG)
		AND	A		;ＣＧＢ？
		JR	Z,PEOPLIT	;	NO --> PEOPLIT
		LD	A,(DJFLAG)
		AND	A		;家の中？
		JR	Z,PEOPLIT	;	NO --> PEOPLIT
		LD	A,(MARINFG)
		AND	A		;マリンを連れている？
		JR	NZ,PEOPLIT	;	YES --> PEOPLIT
		LD	A,(WARPSV+$02)
		AND	%00000010	;レベル３クリアしてる？
		JR	NZ,PEOPLIT	;	YES --> PEOPLIT
		LD	A,(MEGAF)
		CP	$04		;バナナ以上を持っている？
		JR	NC,PEOPLIT	;	YES --> PEOPLIT
		LD	A,(PAPA0FG)
		AND	A
		JR	Z,PEOPLIT
		CP	$01
		JR	Z,PEOPLIT
;
		LD	A,$002
		LD	(SVBK),A
		LD	HL,OBCGWK+(($007*$004)*$002)
		LD	DE,TARIN_BANANA_COL
TARIN_BANANA_LOOP
		LD	A,(DE)
		LD	(HLI),A
		INC	DE
		LD	A,L
		AND	$007
		JR	NZ,TARIN_BANANA_LOOP
		XOR	A
		LD	(SVBK),A
;
		JR	PEOPLIT
;----------------------------------------
MSWANIT
	LD	A,(WANFLG)
	CP	$80
	JR	NZ,MSWI10	;逃げられ？
;				; yes !
	LD	A,$0E
	LD	(SOUND4),A	;(S)
MSWI10
	RET
;----------------------------------------
IKADAIT
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,PEOPLIT
;
	LD	A,(IKADAFG)
	AND	A
	RET	NZ	
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$10
	LD	(HL),A
	RET
;
;	LD	A,(IKADAFG)
;	AND	A
;	JP	Z,ENCLER
PEOPLIT
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	(HL),$03
;-----------------------------
EVENTIT
;;	LD	A,(DJFLAG)
;;	AND	A
;;	JR	Z,EVI010	; 
;
	LD	A,(TATLEV)
	AND	A
	JR	NZ,EVI008	; First room?
;
;	LD	A,$0A		; Yes !
;EVI008
;;
	LD	A,$1C	;始めのBGM
;	LD	(SOUND4),A	;(S)
;	LD	(BGMNO),A
;	LD	(TODYFG),A	
	CALL	ENBGMST2	;(S)
EVI008
EVI010
	JR	LEFTMS
;;	RET
;-----------------------------
BABA0IT
;;	LD	A,$02
;;	LD	(SOUND4),A	;(S)
	RET
;-----------------------------
SHOPIT
;	CALL	RNDSUB
;	LD	E,$05
;	AND	$01
;	JR	Z,SHI010
;	LD	E,$07
;SHI010
;	LD	A,E
	LD	A,$07
;;	LD	(SOUND4),A	;(S)
	CALL	ENBGMST	;(S)
;
LEFTMS
	LD	A,$01
	JR	ENMKSET
;;	RET
;-----------------------------
ENRET
	CALL	RNDSUB
	AND	$03
ENMKSET
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	(HL),A
ENRET2
	RET
;=========================================
PSCRLIT
	LD	A,%00000011
	LD	(IE),A
;
	RET
;=========================================
RIVERIT
	LD	A,$FF
	JP	ENPTST
;
;=========================================
ZORA_INIT
		LD	A,(DJFLAG)
		AND	A		;地上以外？
		JR	Z,ENRET2	;	NO --> ENRET2
		LD	A,(GRNDPT)
		CP	$0DA		;動物村の元空家？
		JR	NZ,ENRET2	;	NO --> ENRET2
		LD	A,(MEGAF)
		CP	$00E		;見通しレンズ持ってる？
		JP	NZ,ENCLER	;	NO --> ENCLER
		LD	A,(PHOTOFG+1)
		AND	%00000001	;写真９を持ってる？
		JR	Z,ENRET2	;	NO --> ENRET2
		LD	A,$003
		JP	ENPTST
;
;=========================================
RGB_GOSTIT
		XOR	A
		JR	ENMKSET
;
;=========================================
RGB_BLK_SUB
		LD	HL,NEWDJRM
		LD	A,(GRNDPT)
		LD	E,A
		LD	D,$000
		ADD	HL,DE
		LD	A,(HL)
		RET
;
;=========================================
R_BLK_INIT
		CALL	RGB_BLK_SUB
		AND	$010
		JR	NZ,RGB_BLK_INIT
		XOR	A
		JP	ENPTST
;
;=========================================
G_BLK_INIT
		CALL	RGB_BLK_SUB
		AND	$010
		JR	NZ,RGB_BLK_INIT
		LD	A,$004
		JP	ENPTST
;
;=========================================
B_BLK_INIT
		CALL	RGB_BLK_SUB
		AND	$010
		JR	Z,RGB_BLK_PASS
RGB_BLK_INIT
		LD	HL,ENSTAT
		ADD	HL,BC
		LD	(HL),$080
RGB_BLK_PASS
		LD	A,$008
		JP	ENPTST
;
;=========================================
BNDMAN_INIT
		LD	HL,ENSTAT
		ADD	HL,BC
		LD	(HL),FlyOrBound
		JR	FLY_BND_IT
FLY_BND_INIT
		LD	A,$004
FLY_BND_IT
		LD	HL,ENZPSL
		ADD	HL,BC
		LD	(HL),$010
		JP	ENPTST
;
;=========================================
FK_BOSS_INIT
		LD	HL,ENLIFE
		ADD	HL,BC
		LD	(HL),$010
		LD	HL,ENXPSL
		ADD	HL,BC
		LD	A,(HL)
		SUB	$008
		LD	(HL),A
		JP	ENRET2
;
;=========================================
BLKHINO_INIT
		LD	HL,ENXPSL
		ADD	HL,BC
		LD	(HL),$050
		LD	HL,ENWRK2
		ADD	HL,BC
		LD	(HL),$000
		JP	ENRET2
;
;=========================================
R_MONBAN_INIT
		LD	A,(CGBFLG)
		AND	A
		JP	Z,ENRET2
		CALL	RGB_BLK_SUB
		AND	$010
		JP	Z,ENRET2
		LD	HL,ENXPSL
		ADD	HL,BC
		LD	A,$03C
		JR	MONBAN_INIT
;
;=========================================
L_MONBAN_INIT
		LD	A,(CGBFLG)
		AND	A
		JP	Z,ENRET2
		CALL	RGB_BLK_SUB
		AND	$010
		JP	Z,ENRET2
		LD	HL,ENXPSL
		ADD	HL,BC
		LD	A,$063
MONBAN_INIT
		LD	(HL),A
		LD	HL,ENSTAT
		ADD	HL,BC
		LD	(HL),OP_LD
		JP	ENRET2
;
;=========================================
FKBK_INIT
		LD	HL,ENYPSL
		ADD	HL,BC
		LD	A,(HL)
		ADD	A,$002
		LD	(HL),A
		LD	HL,ENZPSL
		ADD	HL,BC
		LD	(HL),$004
;
;=========================================
NYO_SLM_INIT
		LD	HL,ENLIFE
		ADD	HL,BC
		LD	(HL),$00C
		XOR	A
		LD	HL,ENWRK2
		ADD	HL,BC
		LD	(HL),A
		LD	HL,ENXPSL
		ADD	HL,BC
		LD	A,(HL)
		ADD	A,$008
		LD	(HL),A
		JP	ENRET2
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%						       %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BOSS1IT
KWUSOIT
BOSS1MV
KWUSOMV
;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%					%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%					%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%					%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENFIRECD
	DB	$34,$02,$34,$22
	DB	$34,$14,$34,$34
;;	DB	$34,$00,$36,$00
;;	DB	$36,$20,$34,$20
;- - - - - - - - - - - - - - - - - -
ENFIRE
	CALL	LDTIM0
	JR	Z,ENFRED
;
	LD	A,(FRCNT)
	RRA
	RRA
	RRA
	AND	%00000001
	LD	(ENCHPT2),A
;
	LD	DE,ENFIRECD
	CALL	EN2CST
;
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENCHPT2),A
	CALL	ENMOVEL
;
	CALL	ENSTCK2
	CALL	ENHNSB
;
	CALL	ENBDCL
	CALL	ENSDCL
;
	RET
ENFRED
	LD	A,(ENMYNO2)
	CP	MUMMY
	JR	NZ,ENFE090
;
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	(HL),SKEL1
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EMOVE
	JP	ENMDSTS2
;
ENFE090
	LD	HL,ENTIM4
	ADD	HL,BC
	LD	(HL),$1F
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EFAIL
;
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	(HL),$04
;
	LD	HL,SOUND3	;(S)
	LD	(HL),$13
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EFOLEYD
	DB	$00,$00,$04,$00
EFOLESD
	DB	$00,$01,$03,$06
;;	DB	$FF,$07,$01,$00
EFOLECD
	DB	$24,$01
	DB	$24,$01
	DB	$3E,$01
;;	DB	$22,$00
EFOLECD2
	DB	$1E,$01,$1E,$61
;
ENFOLE
		LD	A,(DNJNNO)
		CP	NEWDJ		;新ダンジョン？
		JR	NZ,EFO000	;	NO --> EFO000
		LD	HL,ENMYNO
		ADD	HL,BC
		LD	A,(HL)
		CP	R_MUSI
		JR	Z,ENFOLE_050
		CP	G_MUSI
		JR	Z,ENFOLE_050
		CP	B_MUSI
		JR	NZ,EFO000
ENFOLE_050
		LD	HL,ENMODE
		ADD	HL,BC
		LD	A,EMOVE
		LD	(HL),A
		LD	HL,ENSTAT
		ADD	HL,BC
		LD	A,MUSI_HM
		LD	(HL),A
		RET
;
EFO000
	CALL	LDTIM0
	JR	NZ,EFO1000
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%00000010
	JR	NZ,ENFLK0
;
	LD	HL,EFLFLG2
	LD	(HL),$01	;１匹でもおちた！
ENFLK0
	LD	A,(ENMYNO2)
	CP	TAMA0
	JR	NZ,EFO00E0
;
TAMA0ST
	LD	A,$16
	LD	(TAMA0PT),A
;
	LD	A,$50
	LD	(TAMA0XP),A
	LD	A,$27
	LD	(TAMA0YP),A
EFO00E0
	JP	ENCLER
;
EFO1000
	CP	$40
	JR	C,EFO010
;
	LD	A,(ENMYNO2)
	CP	OCTA1
	JR	Z,EFO003
	CP	MORI1
	JR	Z,EFO003
	CP	HEIS0
	JR	NZ,EFO008
;
EFO003
	CALL	MKPTST
	CALL	MKPTST
	CALL	MKPTST
EFO008
	CALL	ENMOVEL
	CALL	ENSTCK2
;
	RET
EFO010
	RRA
	RRA
	RRA
	RRA
	AND	$03
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	(HL),A
	LD	(ENCHPT2),A
;
	LD	E,A
	LD	D,B
	LD	HL,EFOLEYD
	ADD	HL,DE
	LD	A,(ENDSYP)
	ADD	A,(HL)
	LD	(ENDSYP),A
;
	LD	A,E
	CP	$03
	JR	NZ,EF0224
;
	XOR	A
	LD	(ENCHPT2),A
;
	LD	DE,EFOLECD2
	CALL	EN2CST
	JR	EF0225
EF0224
	LD	DE,EFOLECD
	CALL	EN1CST
;
EF0225
	CALL	ENSTCK2
;
	CALL	LDTIM0
	CP	$3F
	JR	NZ,EFO033
;
	LD	HL,SOUND1
	LD	(HL),$18	;(S)
EFO033
	RRA
	RRA
	RRA
	RRA
	AND	$03
	LD	E,A
	LD	D,B
	LD	HL,EFOLESD
	ADD	HL,DE
	LD	E,(HL)
;
	LD	A,(PLXPSL)
	PUSH	AF
	LD	HL,ENFLXP
	ADD	HL,BC
	LD	A,(HL)
	LD	(PLXPSL),A
	LD	A,(PLYPSL)
	PUSH	AF
	LD	HL,ENFLYP
	ADD	HL,BC
	LD	A,(HL)
	LD	(PLYPSL),A
;
	LD	A,E  ;$04
	CALL	PSERCH
	POP	AF
	LD	(PLYPSL),A
	POP	AF
	LD	(PLXPSL),A
;
		jp	ENMVCL
;;;;;;;;	CALL	ENMVCL
;;;;;;;;EFO090
;;;;;;;;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENSHOT
	CALL	ENMOVEL
	CALL	ENSTCK2
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),$02	; For fole check !!
	CALL	ENBDCL		; Bounds sub & BG check !
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),B		; For fole check Off !!
;
	CALL	TURCHK
;
	CALL	SHBUTCK	;シャッターぶつけチェック！
;
	LD	A,(ENMYNO2)
	CP	TBOSS
	JR	NZ,ESH011
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,ESH011
;
	LD	HL,ENFLSH
	ADD	HL,BC
	LD	(HL),$20
;
	LD	HL,SOUND2
	LD	(HL),$07	;(S)
;
	LD	HL,ENWRK3
	ADD	HL,BC
	LD	A,(HL)
	INC	A
	LD	(HL),A
	CP	$03
	JR	Z,ESH070
;
ESH011
	LD	A,$B
	LD	(ATCKNO),A
	CALL	CRENEN
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,BC
	OR	(HL)
	JR	NZ,ESHT10
;
	CALL	ESTOPST
;
	LD	A,(ENMYNO2)
	CP	TBOSS
	JR	NZ,ESHT10
;
ESH070
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EMOVE
;
	CALL	STATINC
	LD	(HL),$01
;
	CALL	LDTIM0
	LD	(HL),$80
;
	LD	HL,ENWRK2
	ADD	HL,BC
	LD	(HL),B	; Center serch !
ESHT10
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ESTPXS
	DB	$10,$F0
;
ENSTOP
	CALL	ENMOVEL		; C set 
	CALL	ENSTCK2
	CALL	ENHNSB
;
	CALL	ENBDCL
	CALL	ENSDCL
;
	CALL	CRKNEN
;=====================================
;- - Cach check - -
	LD	A,(ITEMB)
	CP	PBULE
	JR	NZ,EST900	; Bulesret check !
;
	LD	A,(KEYA2)
	AND	%00100000
	JR	NZ,EST910
	JR	ESTP10
EST900
	LD	A,(ITEMA)
	CP	PBULE
	JR	NZ,ESTP10
;
	LD	A,(KEYA2)
	AND	%00010000
	JR	Z,ESTP10
;
CACHCK
EST910
	LD	A,(WPLCAMD)
	AND	A
	JR	NZ,ESTP10
;
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	A,(HL)
	PUSH	HL
	PUSH	AF
	OR	%10000000
	LD	(HL),A
	CALL	CRENPLF
	RL	E
	POP	AF
	POP	HL
	LD	(HL),A
	RR	E
	JR	NC,ESTP10
;
	LD	A,$01
	LD	(WPLCAMD),A
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),ECACH
;
	LD	A,$02
	LD	(SOUND2),A	;(S)
;
	LD	HL,ENCAST
	ADD	HL,BC
	LD	(HL),B ;$00
;
	CALL	LDTIM0
	LD	(HL),$02
;
	LD	A,(PLCMKI)
	LD	(PLCAMK),A
	JP	ENCACH
;;	RET
;
ESTP10
	LD	HL,ENTIM2
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,ESTP20
;
;;;	LD	A,EMOVE
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EMOVE ;A
;
	LD	HL,ENZSPD
	ADD	HL,BC
	LD	(HL),B
ESTP20
;;;CGB;;;	CP	$3C	;1998/09/11 ＣＧＢバージョンで変更
	CP	$38
		ret	NC
;;;;;;;;	JR	NC,ESTP30
;
	SRL	A
	SRL	A
	AND	$1
	LD	E,A
	LD	D,B ;$0
	LD	HL,ESTPXS
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
;
	CALL	ENXCLC
		jp	ENSDCL
;;;;;;;;	CALL	ENSDCL
;;;;;;;;ESTP30
;;;;;;;;	RET
;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;;%				    %
;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;ENNOTH
;	RET
;===================================
BBIXSD
	DB	$0C,$0C,$F4,$F4
BBIYSD
	DB	$0C,$F4,$0C,$F4
;
BABULIT
BABUBIT
BALEEIT
;;	INITIAL
	CALL	RNDSUB
	AND	$03
	LD	E,A
	LD	D,B ;$0
	LD	HL,BBIXSD
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
	LD	HL,BBIYSD
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
	RET
;===================================
;===================================
;;	INITIAL
SPAR2IT
	LD	HL,ENWRK1
	ADD	HL,BC
;;;	LD	A,$04
	LD	(HL),$04 ;A
;
	LD	A,$03
	JR	SPIT10
;- - - - - - - - - - - - - - - -
SPARKIT
	LD	A,$FD
SPIT10
	LD	HL,ENYPSL
	ADD	HL,BC
	ADD	A,(HL)
	LD	(HL),A
	RET
;===================================
;===================================
;;	INITIAL
BASSFIT
;	LD	HL,ENCONT
;	ADD	HL,BC
;	CALL	RNDSUB
;;
;	AND	$01
;	LD	(HL),A
;	RET
;===================================
;===================================
;===================================
;===================================
;;	INITIAL
;LAIKUIT
;	LD	HL,ENSTAT
;	ADD	HL,BC
;;;;	LD	A,$01
;	LD	(HL),$01 ;A
;	RET
;===================================
;;	INITIAL
;SKEL1IT
;	LD	HL,ENSTAT
;	ADD	HL,BC
;;;;	LD	A,$01
;	LD	(HL),$01 ;A
;	RET
;===================================
;===================================
;===================================
;===================================
;;	INITIAL
;MUMMYIT
;	JP	STATINC
;
;	LD	HL,ENSTAT
;	ADD	HL,BC
;;;;	LD	A,$01
;	LD	(HL),$01 ;A
;	RET
;===================================
MAGE0IT
	CALL	LDTIM0
	LD	(HL),$80
;
	LD	HL,ENCHPT
	ADD	HL,BC
	DEC	(HL)
;;	LD	(HL),$FF
;
	RET
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
;===================================
HEIS0IT 
	LD	A,(ENSVXL)
	AND	$10
	LD	A,$0
	JR	NZ,HEI010
;
	LD	A,$3
HEI010
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	(HL),A
	PUSH	HL
;
	CALL	MKPTST
;
	POP	HL
	LD	A,(HL)
	XOR	$1
	LD	(HL),A
	RET
;===============================================
;=					       =
;===============================================
;===============================
KAIINIT
	LD	HL,ENWRK2
	ADD	HL,BC
	LD	(HL),$02
;
	LD	A,(GRNDPT)
	CP	$A4
	JR	Z,KAII01
	CP	$D2  ;97
	JR	NZ,KAII10	;体当たり木？
;
KAII01
	DEC	(HL) ;$01
; 
	CALL	PSADD8
KAII10
		jp	ANI0010
;;;;;;;;	CALL	ANI0010
;;;;;;;;;
;;;;;;;;	RET
;------------------------------------
ANAINIT
	LD	HL,ENWRK2
	ADD	HL,BC
	LD	(HL),$01	;1:Dush check 2:Skop check&Tubo check
;
	LD	A,(DJFLAG)
	AND	A
	JR	Z,ANI0010
;--------------------------------------------
HART1IT
ANAINIT2
	LD	HL,ENWRK2
	ADD	HL,BC
	LD	(HL),$02	;1:Dush check 2:Skop check&Tubo check
ANI0010
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	OR	%00010001
	LD	(HL),A
	RET
;===============================
KEYSMIT
	LD	A,(GRNDPT)
	CP	$F8
	JR	NZ,KSI000	;流さの下？
;
	LD	A,(DJSVBF)
	BIT	4,A
	JP	NZ,ENCLER
;
	BIT	5,A
	JP	Z,ENCLER
;
	LD	A,$02	;魚のかぎ！
	JP	ENPTST
;
KSI000
	CP	$7A
	JR	NZ,KSI001
;
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER
;
	LD	A,$04	;鳥のかぎ！
	JP	ENPTST
;
KSI001
	CP	$7C
	JR	NZ,KSI010	
;
	LD	A,(DJRMSV+$69)
	AND	%00010000
	JP	Z,ENCLER	;上の部屋から落ちた後？
;				; YES !
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER	;取ってへん？
;;	JR	ITEMIT2		; YES !
KSI010
	RET
;------------------------------
YOSSIIT
	LD	A,(MEGAF)
	CP	$0E
	JR	Z,PSADD8	;メガネ！
	RET
;===============================
WARPIT
	LD	A,(DJFLAG)
	AND	A
	RET	Z
;
	CALL	STATINC
	JR	PSADD8
;===============================
ITEMIT
	CALL	ANAINIT
;
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,ITI028
;
;	LD	HL,ENWRK2
;	ADD	HL,BC
;	INC	(HL)
;;
;	LD	HL,ENMOD3
;	ADD	HL,BC
;	LD	A,(HL)
;	OR	%00010001
;	LD	(HL),A
;;
;=======================================
BHANAIT
PSADD8
	LD	DE,ENXPSH
	LD	HL,ENXPSL
	CALL	ITI010
;
ITI008
	LD	DE,ENYPSH
	LD	HL,ENYPSL
ITI010
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,$08
	LD	(HL),A
;
	RLA
		ld	l,e
		ld	h,d
;;10/31;	PUSH	DE
;;10/31;	POP	HL
	ADD	HL,BC
;
	RRA
;
	LD	A,(HL)
	ADC	A,$00
	LD	(HL),A
	RET
;=============================
EWOODIT
GAKKIIT
	LD	DE,ENXPSH
	LD	HL,ENXPSL
	JR  	ITI010
;===============================================
ITI028
;;	LD	HL,ENTIM3
;;	ADD	HL,BC
	CALL	LDTIM3
	LD	(HL),$80
	RET
;===============================================
;=					       =
;===============================================
OCTA1IT
MORI1IT
;	CALL	RNDSUB
;	AND	$F
;	LD	HL,ENTIM0
;	ADD	HL,BC
;	LD	(HL),A
;	AND	$1
;	LD	HL,ENSTAT
;	ADD	HL,BC
;	LD	(HL),A
;
	CALL	LDTIM1
	LD	(HL),$A0
	RET
;===============================================
;=					       =
;===============================================
GHOSTIT
GHOSBIT
GHOSSIT
;
GHI010
	LD	A,(ENMYNO2)
	CP	GHOSS
	JR	NZ,GHI018
;
	LD	HL,ENWRK2
	ADD	HL,BC
	LD	(HL),$01
GHI020
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),$10
	RET
GHI018
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;	RET
;
;================================================================
;=	ヒップループ						=
;================================================================
HIPLPCD
;;;CGB;;;BOSS1CD
;;;CGB;;;JIJIICD
;;;CGB;;;KWUSOCD
;;;CGB;;;CHUNLICD
	DB	$60,$02,$62,$02     ;下１
	DB	$62,$22,$60,$22     ;下２
;
	DB	$64,$02,$66,$02     ;上１
	DB	$66,$22,$64,$22     ;上２
;
	DB	$68,$02,$6A,$02     ;左１
	DB	$6C,$02,$6E,$02     ;左２
;
	DB	$6A,$22,$68,$22     ;右１
	DB	$6E,$22,$6C,$22     ;右２
;
HIPLP2CD
	DB	$70,$02,$72,$02	   ; MASK OFF
	DB	$72,$22,$70,$22	   ; MASK OFF
;- - - - - - - - - - - - - - - - - - - - - -
HP2XSD
	DB	$0C,$F4,$00,$00
HP2YSD
	DB	$00,$00,$F4,$0C
;-- -- -- -- -- -- -- -- -- -- -- -- --
HIPLPMV
	LD	HL,ENWRK1
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,HP1010
;
	LD	DE,HIPLP2CD
	CALL	EN2CST
;
	CALL	ENSTCK
	CALL	ENHNSB
;
	CALL	CREPKE
;
	CALL	ENMVCL
	CALL	ENBGCK
;
	CALL	LDTIM0
	JR	NZ,HP0010
;
	CALL	RNDSUB
	AND	$1F
	ADD	A,$20
	LD	(HL),A
;
	AND	$03
	LD	E,A
	LD	D,B
	LD	HL,HP2XSD
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
	LD	HL,HP2YSD
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
HP0010
	LD	A,(FRCNT)
	RRA
	RRA
	RRA
	RRA
	AND	$01
		jp	ENPTST
;;;;;;;;	CALL	ENPTST
;;;;;;;;	RET
;
HP1010
	LD	DE,HIPLPCD
	CALL	ENMVSB
	RET
;
;========================================================================
;=	リンクが宝箱を開けたときの処理					=
;========================================================================
; Danjyon Takaramono data 
;
;BUL	EQU	$0 ; Buleslet
;TAT	EQU	$1 ; Seeld
;BOW	EQU	$2 ; Bow
;FUC	EQU	$3 ; Fuck shot
;ROD	EQU	$4 ; Rods
;KTU	EQU	$5 ; Kutsu
;FUE	EQU	$6 ; Okarina
;WNG	EQU	$7 ; Wing
;BOK	EQU	$8 ; Book
;TBO	EQU	$9 ; Tsubo
;BMB	EQU	$A ; Bomb
;KEN	EQU	$B ; Ken  
;HRE	EQU	$C ; Hire 
;MEG	EQU	$D ; Megane
;YSI	EQU	$E ; Yoshi
;VTR	EQU	$F ; Video tape
;BIN	EQU	$10 ; Kushori bin
;;
;GK1	EQU	$11 ; Ground key 1
;GK2	EQU	$12 ; " 2
;GK3	EQU	$13 ; " 3
;GK4	EQU	$14 ; " 4
;GK5	EQU	$15 ; " 5
;;
;DMP	EQU	$16 ; Danjyon map
;KNP	EQU	$17 ; Konpass
;PND	EQU	$18 ; Pendant
;BKY	EQU	$19 ; Boss key
;SKY	EQU	$1A ; Small key
;C01	EQU	$1B ; Coin 50
;C02	EQU	$1C ; Coin 20
;C10	EQU	$1D ; Coin 100
;C20	EQU	$1E ; Coin 200
;C50	EQU	$1F ; Coin 500
;KAI	EQU	$20 ; 貝殻
;NOT	EQU	$21 ; Nothing
;SLM  22
;TAR  23
;;
;;
TAKARBD
	DB	$62,$70,$63,$71		;ＢＧ宝箱(ＧＢ用)
TAKARBD2
	DB	$62,$70,$62,$70		;ＢＧ宝箱(ＣＧＢ用)
;- - - - - - - - - - - - - - - - - - -
;;TKSTAD
;;	DB	$5,$6,$7,$3,$FF,$FF,$FF,$FF,$FF,$8,$FF
ITGTDT
	DB	3,4,5,6,7,8,9,$A,$B,$C,$2,$1
;- - Coin up data - - 
COUPD1
;;		 50  20 100 200 500
	DB	$00,$00,$00,$00,$01
COUPD2
	DB	$32,$14,$64,$C8,$F4
;
TAKARIT
	LD	A,$2A
	LD	(ENSTTM),A
;
	LD	A,$04
	LD	(SOUND3),A	;(S)
;
		LD	DE,TAKARBD
		LD	A,(CGBFLG)
		AND	A
		JR	Z,TAKA_PASS
		LD	DE,TAKARBD2
TAKA_PASS
		LD	B,DTOP0	
		CALL	BLBGST
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$08
	LD	(HL),A
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),$FC
;
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENHELP),A
	LD	D,B
	CP	GK1
	JR	NZ,TKI0900	;地上鍵１?
;				;YES !
	PUSH	AF
	LD	A,(FKINDX)
	LD	E,A
	LD	HL,ENTIM1
	ADD	HL,DE
	LD	(HL),$38	;ふくろうセット待ち！
	POP	AF
TKI0900
	LD	E,A
	CP	NOT
	JP	NC,TSV058 ;TAKARRT
	CP	KAI
	JR	NZ,TSV003	; Kaigara ?
;				; Yes !
	JP	KAIINC
TSV003
	CP	C01  ;$04
	JR	C,TSV020
	CP	C50+1  ;$05
	JR	NC,TSV020
TSV012
	LD	HL,COUPD2-$1B  ;CO1  ;$04
	ADD	HL,DE
	LD	A,(HL)
	LD	(COINU2),A
	LD	HL,COUPD1-$1B  ;CO1  ;$04
	ADD	HL,DE
	LD	A,(HL)
	LD	(COINU1),A
;
	LD	A,$18
	LD	(COINWT),A	;メッセージがでるまで待つ！
	JR	SVDTST
;
TSV020
	CP	DMP
	JR	C,TSV030
	CP	SKY+1
	JR	NC,TSV030 ; Danjyon item ?
;				; yes !
	SUB	DMP
	LD	E,A
	LD	D,$00
	LD	HL,DMAPF	; For display use
	ADD	HL,DE
	INC	(HL)
;
	CALL	DJITRV	;Display buffer -> Main buffer!
	JR	SVDTST
;
TSV030
	CP	KEN+1
	JR	NC,TSV050	; Slect item ?
;-----------------------------------
TSV032
	LD	A,(ENHELP)
	CP	TAT
	JR	NZ,TSV0324	; Yes!
;
	LD	HL,TATLEV
	INC	(HL)
TSV0324
	CP	BUL
	JR	NZ,TSV0325	; Yes!
;
	LD	A,(BULLEV)
	CP	$02
	JR	Z,TSV0325
;
	LD	HL,BULLEV
	INC	(HL)
TSV0325
	LD	A,(ENHELP)
	CP	BMB
	JR	NZ,TSV035	; Yes!
;
	LD	HL,BOMBCT
	LD	A,(HL)
	ADD	A,$01
	DAA
	LD	(HL),A
;
TSV035
	LD	D,B
	LD	HL,ITGTDT
	ADD	HL,DE
	LD	D,(HL)
	CALL	ITEMGET
	JR	SVDTST
TSV050
	LD	HL,ITEMB
	ADD	HL,DE
	INC	(HL)
TSV058
;- - Save data set - - - -
SVDTST
	CALL	SVDSSB
;
	LD	A,(HL)
	OR	%00010000
	LD	(HL),A
	LD	(DJSVBF),A	; Save data buffer set !
TAKARRT
	RET
;==================================
SVDSSB
	LD	A,(DJFLAG)
	LD	D,A
	LD	HL,GRRMSV
	LD	A,(GRNDPT)
	LD	E,A
	LD	A,(DNJNNO)
;
		CP	NEWDJ		;新ダンジョン？
		JR	NZ,SVDS11_PASS	;	NO --> SVDS11_PASS
		LD	D,$000
		LD	HL,NEWDJRM
		JR	SVDS11
SVDS11_PASS
;
	CP	DJROOM2 ;$20
	JR	NC,SVDS11
	CP	DJROOM ;$20
	JR	C,SVDS11
;
	INC	D
SVDS11
;;;;	LD	D,$00
	ADD	HL,DE
	RET
;
;================================================
;=	表示エリアへの書き込み!!(CGB)		=
;================================================
BLBGKAI		;かいだん
	DB	$6A,$7A,$6B,$7B	;キャラクター ナンバー
;;;KK;;;	DB	$00,$00,$00,$00	;アトリビュート
BLBGSP		;ゆか
	DB	$10,$12,$11,$13	;キャラクター ナンバー
;;;KK;;;	DB	$00,$00,$00,$00	;アトリビュート
BLBGBL		;ブロックBG
	DB	$F8,$F9,$FA,$FB	;キャラクター ナンバー
;;;KK;;;	DB	$01,$01,$01,$01	;アトリビュート
BLBGHK		;墓BG
	DB	$0E,$1E,$0F,$1F	;キャラクター ナンバー
;;;KK;;;	DB	$00,$00,$00,$00	;アトリビュート
BLBGGKAI	;地上かいだん！
	DB	$68,$77,$69,$4B	;キャラクター ナンバー
;;;KK;;;	DB	$00,$00,$00,$00	;アトリビュート
HAKA_ATO	;墓を動かした後
	DB	$76,$76,$76,$76	;
;- - - - - - - - - - - - - - - - - - -
BLOCKIT
	CALL	EPXYCK
;
	LD	D,$00
;
	LD	HL,BLMVXS
	ADD	HL,DE
	LD	A,(HL)
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
;
	LD	HL,BLMVYS
	ADD	HL,DE
	LD	A,(HL)
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
	CALL	BLOCKMV
;
	CALL	ENBGCK
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,BLS000
;
	JP	ENCLER
BLS000
	LD	A,$11
	LD	(SOUND3),A	;(S)
;
	LD	DE,BLBGGKAI
	LD	B,SINDO	;はか押し！
;
		LD	A,(GRNDPT)
		CP	$077		;墓場の右下？
		JR	NZ,BLS000_PASS	;	NO --> BLS000_PASS
		LD	A,(HAKAFG)
		CP	$80		;新ダンジョンへの入り口出現？
		JR	Z,BLS000_PASS	;	YES --> BLS000_PASS
		LD	DE,HAKA_ATO
		LD	B,NUKI0
BLS000_PASS
;
	LD	A,(DJFLAG)
	AND	A
	JR	Z,BLBGST
;
	LD	DE,BLBGSP
	LD	B,DTU08
;
	LD	A,(GRNDPT)
	CP	$0C7
	JR	NZ,BLBGST	;リチャード王子部屋？
;				;yes !
	LD	DE,BLBGKAI
	LD	B,DTKD0
BLBGST
	PUSH	DE
	LD	A,B
	PUSH	AF
;
	LD	B,$00
;
	LD	A,(ENSVYL)
	SUB	$10-1
	LD	(OBJYP),A
;
	LD	A,(ENSVXL)
	SUB	$8-1
	LD	(OBJXP),A
;
	SWAP	A
	AND	$0F
	LD	E,A
	LD	A,(OBJYP)
	AND	$F0
	OR	E
	LD	E,A
	LD	D,$0
	LD	HL,BGUNDT+$11
	ADD	HL,DE
	POP	AF
	LD	(HL),A
	LD	(UNTATR),A

;--------------------------------------------
;	開いた宝箱
;--------------------------------------------
		LD	A,$03
		CALL	Unit_change	; バンク２ユニット書き換え
;--------------------------------------------

UNBGWT
	CALL	OBJBG
;
	LD	A,(VRAMD)
	LD	E,A
	LD	D,$00
	LD	HL,VRAMD+1
	ADD	HL,DE
;
	ADD	A,$0A
	LD	(VRAMD),A
;
	POP	DE
;				表示エリアへの書き込み!!(CGB)
	LD	A,(VRAMH)
	LD	(HLI),A
	LD	A,(VRAML)
	LD	(HLI),A
	LD	A,$81
	LD	(HLI),A
	LD	A,(DE)
	INC	DE
	LD	(HLI),A
	LD	A,(DE)
	INC	DE
	LD	(HLI),A
;
	LD	A,(VRAMH)
	LD	(HLI),A
	LD	A,(VRAML)
	INC	A
	LD	(HLI),A
	LD	A,$81
	LD	(HLI),A
	LD	A,(DE)
	INC	DE
	LD	(HLI),A
	LD	A,(DE)
	LD	(HLI),A
	XOR	A
	LD	(HL),A
;;	CLC	; For rot beam tourou check !!
;
;---------------------------------------------- CGB
		LD	A,(CGBFLG)
		AND	A		;ＣＧＢモード？
		JR	Z,UNBGWT_PASS	;	NO --> UNBGWT_PASS
		PUSH	BC
		LD	A,$003
		CALL	BG1UNIT_ATR_SUB
		POP	BC
;
;;;kk;;;		INC	DE
;;;kk;;;		PUSH	DE
;;;kk;;;		LD	A,(VRAMD_AT)
;;;kk;;;		LD	E,A
;;;kk;;;		LD	D,$00
;;;kk;;;		LD	HL,VRAMD_AT+1
;;;kk;;;		ADD	HL,DE
;;;kk;;;		ADD	A,$0A
;;;kk;;;		LD	(VRAMD_AT),A
;;;kk;;;		POP	DE
;;;kk;;;;
;;;kk;;;		LD	A,(VRAMH)
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,(VRAML)
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,$81
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,(DE)
;;;kk;;;		INC	DE
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,(DE)
;;;kk;;;		INC	DE
;;;kk;;;		LD	(HLI),A
;;;kk;;;;
;;;kk;;;		LD	A,(VRAMH)
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,(VRAML)
;;;kk;;;		INC	A
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,$81
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,(DE)
;;;kk;;;		INC	DE
;;;kk;;;		LD	(HLI),A
;;;kk;;;		LD	A,(DE)
;;;kk;;;		LD	(HLI),A
;;;kk;;;		XOR	A
;;;kk;;;		LD	(HL),A
UNBGWT_PASS
;---------------------------------------------- CGB
;
	RET
;################################################
;#	ブロック関係				#
;################################################
BLOCKCD
	DB	$6E,$07,$6E,$27	;墓！
	DB	$F8,$17,$FA,$17	;ブロック
BLMVXS
	DB	$F8,$08,$00,$00
BLMVYS
	DB	$00,$00,$08,$F8
BLOCKCD2
	DB	$7E,$07,$7E,$27	;墓！
;
BLOCKMV
	LD	A,(DJFLAG)
	LD	(ENCHPT2),A
	LD	DE,BLOCKCD
;
		AND	A		;ダンジョンの中？
		JR	NZ,BLM000_PASS	;	YES --> BLM000_PASS
		LD	A,(GRNDPT)
		CP	$077		;墓場の右下？
		JR	NZ,BLM000_PASS	;	NO --> BLM000_PASS
		LD	DE,BLOCKCD2
BLM000_PASS
;
	CALL	EN2CST
;
	CALL	ENSTCK
;
	CALL	ENMVCL
;
	CALL	CRBLEN
;
	CALL	CRENPS
	JR	NC,BLM020
;
	CALL	PLPSRV
;
	LD	A,$3
	LD	(PLOSHI),A
BLM020
	LD	A,(GRNDPT)
	CP	$C7
	JR	Z,BLM021	;リチャード部屋？
;			
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,BLM022	;ハカ？
;
BLM021
	LD	A,$02		;YES !
	LD	(PLSTOP),A	;階段出る為プレイヤー止める！
BLM022
	LD	HL,ENCONT
	ADD	HL,BC
;
	LD	A,(HL)
	INC	A
	LD	(HL),A
	CP	$20+1	;5/27
		ret	NZ
;;;;;;;;	JR	NZ,BLM090
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),A
;
	CALL	ENBGCK
	LD	HL,ENMODE
	ADD	HL,BC
	LD	A,(HL)
;;	CP	$00  
	AND	A
		ret	Z
;;;;;;;;	JR	Z,BLM090
	CP	EFOLE
		ret	Z
;;;;;;;;	JR	Z,BLM090
;
	CALL	ENCLER
;
	LD	DE,BLBGHK
	LD	B,OHAKA ;	墓復帰？
;
	LD	A,(DJFLAG)
	AND	A
	JR	Z,BLM032
;
	LD	DE,BLBGBL
	LD	B,DBL00 ;MV  ;
;
BLM032
	CALL	BLBGST
;
	LD	A,(NAZOFG)
	AND	%00011111
	CP	$02
	JR	Z,BLM060	; block nazo ?
	CP	$7
		ret	NZ		; Hit block vs block ?
;;;;;;;;	JR	NZ,BLM090	; Hit block vs block ?
;				; yes !
	CALL	ENBGCK
	LD	A,(ENBGLR)
	CP	DBLMV
	JR	Z,BLM060
	CP	DBL00
		ret	NZ
;;;;;;;;	JR	NZ,BLM090
;	
BLM060
;	LD	A,$01
;	LD	(NAZOCL),A	; Nazo clear flag !
		jp	NAZOCLR	;(S)
;;;;;;;;	CALL	NAZOCLR	;(S)
;;;;;;;;BLM090
;;;;;;;;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				      %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CRBLEN
	LD	E,ENNO-1
	LD	D,B ;$00
BLE000
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	CP	EMOVE
	JR	C,BLE010
;
	LD	HL,ENMOD0
	ADD	HL,DE
	LD	A,(HL)
	AND	%01000000
	JR	NZ,BLE010
;
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	A,(ENSVXL)
	SUB	(HL)
	ADD	A,$0C
	CP	$18
	JR	NC,BLE010
;
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENZPSL
	ADD	HL,DE
	SUB	(HL)
;
	LD	HL,ENDSYP
;;;	LD	A,(ENSVYL)
	SUB	(HL)
	ADD	A,$0C
	CP	$18
	JR	NC,BLE010
;----------------------------------------
	LD	HL,ENMOD0
	ADD	HL,DE
	LD	A,(HL)
	AND	%00100000
	JR	NZ,BLE010	; Item ?
;				; NO,
	PUSH	BC
		ld	c,e
		ld	b,d
;;10/31;	PUSH	DE
;;10/31;	POP	BC
;
	PUSH	DE
	LD	A,$08
	CALL	ENHNST
	POP	DE
;
	POP	BC
BLE010
	DEC	E
	LD	A,E
	CP	$FF
	JP	NZ,BLE000
	RET
;###############################################
;#	対話的人物試験処置		       #
;###############################################
MSTESFMV
;################################################
;#	小石みたいなやつ(破片)			#
;################################################
;- - - - - - - - - - - - - - - - - -
;- - - - - - - - - - - - - - - - - -
;- - - - - - - - - - - - - - - - - -
KTISCD
	DB	$16,$03
;
KTOBJMV
	LD	A,C
	LD	(KTINDX),A
;==========================================
KO0090
	CALL	LDTIM1
	LD	(WORK0),A
	JP	Z,KOM010
;
	CP	$1
	JR	NZ,KOM008
;
	LD	HL,ENWRK4
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,KOM002	;シゲミン草？
;				;YES !
	CALL	RNDSUB		;ランダム妖精セット！
	AND	$03
	JR	NZ,KOM002
;
	LD	A,YOSEI
	CALL	ENIDSH
	JR	C,KOM002
;
	LD	A,(WORK0)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK3)
	LD	HL,ENZPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENTIM3
	ADD	HL,DE
	LD	(HL),$80 ;A
KOM002
	LD	A,(ENCHPT2)
	AND	A
	JR	NZ,KTO0111	;壷？
;				
	LD	A,(DNJNNO)
	CP	$1E
	JR	Z,KOM003
	CP	$10 ;DJMAX
	JR	NZ,KTO0111
;
KOM003
	LD	A,(MARINFG)	;yes!
	AND	A
	JR	Z,KTO0111	
;
	CALL	RNDSUB
	AND	$3F
	JR	NZ,KTO011M
;
	LD	A,$28
	CALL	MSGCHK	;マリンおこる！
	JP	ENCLER
KTO011M
	LD	A,$99
	CALL	MSGCH2	;マリンおこる！
KTO0111
	JP	ENCLER
;----------------------------------------
KOM008
		jp	KTFLCSL
;;;;;;;;	CALL	KTFLCSL
;;;;;;;;	RET
;------------------------------------------------
;	リンクが持ち上げた岩＆壷
;------------------------------------------------
KTOBJCD
	DB	$F0,$17,$F2,$17
	DB	$F4,$16,$F6,$16
KTOBJCD2
	DB	$F0,$16,$F2,$16
	DB	$F4,$16,$F6,$16
;
KOM010
		LD	A,(DJFLAG)
		AND	A		;地上？
		JR	Z,KOM010_200	;	YES --> KOM010_200
		LD	DE,KTOBJCD2
		JR	KOM010_250
KOM010_200
		LD	DE,KTOBJCD
KOM010_250
		CALL	EN2CST
;
	CALL	ENSTCK
;
	LD	A,$B
	LD	(ATCKNO),A
	CALL	CRENEN
	CALL	ENBDCL
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	A,(HL)
	CP	EFOLE
	JP	Z,KTO090
;
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,KTO010
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,KTO090
;
	CALL	SHBUTCK	;シャッター(なぞ）にぶつけたか？
;========================================
KTFLST
KTO010
	LD	HL,SOUND3
	LD	(HL),$05	;(S)
;
;
	LD	E,$1F	; Kusa break time
;
	LD	A,(ENCHPT2)
	CP	$FF
	JR	Z,KFSS10
	CP	$01
	JR	Z,KFSS10
;
	LD	(HL),$09	;(S)
;
	LD	E,$0F	; Ishi break time 
KFSS10
	LD	HL,ENTIM1
	ADD	HL,BC
	LD	(HL),E  ;$1F
;
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	A,(HL)
	ADD	A,$2
	LD	(HL),A
;
KTO090
	RET
;=============================================
ISIBRK
	LD	A,KTOBJ
	CALL	ENIDSH
		ret	C
;;;;;;;;	JR	C,ISB090
;
	LD	A,(WORK0)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,WORK3
	SUB	(HL)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENCHPT
	ADD	HL,DE
	LD	(HL),$00
;
	LD	HL,ENTIM1
	ADD	HL,DE
	LD	(HL),$0F
;
	LD	HL,ENMOD0
	ADD	HL,DE
	LD	(HL),%11000100
;
	LD	A,$09
	LD	(SOUND3),A	;(S)
;
		jp	ENCLER
;;;;;;;;	CALL	ENCLER
;;;;;;;;ISB090
;;;;;;;;	RET
;=====================================
SHBUTCK
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
		ret	Z
;;;;;;;;	JR	Z,SHBC90
;
	LD	A,(NAZOFG)
	AND	%00011111
	CP	$0D
	JR	NZ,SHBC10	;宝箱にぶつける謎？
;				; YES !
	LD	A,(ENBGLR)
	CP	DTRE0
	JR	Z,SHBC08
	LD	A,(ENBGUD)
	CP	DTRE0
		ret	NZ
;;;;;;;;	JR	NZ,SHBC90
SHBC08
	LD	A,$30
	LD	(OBJXP),A
	LD	A,$20
	LD	(OBJYP),A
;
	LD	A,BKY
	LD	(WORK8),A
	CALL	TAKARSTL
	JP	NAZOCLR	;(S)
;--------------------------------------
SHBC10
	CP	$0B
		ret	NZ		;シャッターぶつけ謎？
;;;;;;;;	JR	NZ,SHBC90	;シャッターぶつけ謎？
;				; YES !
	LD	A,(ENBGUD)
	CP	DSHI0
		ret	C
;;;;;;;;	JR	C,SHBC90
	CP	DSHI7+1
	JR	C,SHBC80
;
SHBC70
	LD	A,(ENBGLR)
	CP	DSHI0
		ret	C
;;;;;;;;	JR	C,SHBC90
	CP	DSHI7+1
		ret	NC
;;;;;;;;	JR	NC,SHBC90
SHBC80
		jp	NAZOCLR		;(S)
;;;;;;;;	CALL	NAZOCLR		;(S)
;;;;;;;;SHBC90
;;;;;;;;	RET
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	敵爆発							   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENFLCD
	DB	$32,$01,$32,$61
KEMRICD
	DB	$30,$01,$30,$61
ENFLSCD
;0
	DB	$00,$00,$3C,$01
	DB	$00,$08,$3C,$21
	DB	$FF,$FF,$FF,$FF
	DB	$FF,$FF,$FF,$FF
;1
	DB	$00,$00,$3A,$01
	DB	$00,$08,$3A,$21
	DB	$FF,$FF,$FF,$FF
	DB	$FF,$FF,$FF,$FF
;2
	DB	$FA,$FA,$3A,$01
	DB	$FA,$02,$3A,$21
	DB	$06,$06,$3A,$01
	DB	$06,$0E,$3A,$21
;3
	DB	$04,$FC,$30,$01
	DB	$04,$04,$30,$21
	DB	$FC,$04,$30,$01
	DB	$FC,$0C,$30,$21
ENFLBCD
;0
	DB	$00,$00,$3A,$01
	DB	$00,$08,$3A,$21
	DB	$FF,$FF,$FF,$FF
	DB	$FF,$FF,$FF,$FF
;1
	DB	$F8,$F8,$3A,$01
	DB	$F8,$00,$3A,$21
	DB	$08,$08,$3A,$01
	DB	$08,$10,$3A,$21
;2
	DB	$08,$F8,$3A,$01
	DB	$08,$00,$3A,$21
	DB	$F8,$08,$3A,$01
	DB	$F8,$10,$3A,$21
;3
	DB	$F8,$F8,$10,$02
	DB	$F8,$00,$12,$02
	DB	$F8,$08,$12,$22
	DB	$F8,$10,$10,$22
	DB	$08,$F8,$10,$42
	DB	$08,$00,$12,$42
	DB	$08,$08,$12,$62
	DB	$08,$10,$10,$62
;---------------------------------------------
ENFAIL
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%10000000
	JR	Z,EF0090
;
	JP	ENMOVE
EF0090
	LD	HL,ENTIM4
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JP	Z,ENFEND
;
	PUSH	AF
;
	LD	HL,ENHNMD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENFLSCD
	AND	A
	JR	Z,EF00901
;
	LD	HL,ENFLBCD
EF00901
	POP	AF
;
	CP	$20
	JR	NC,ENFL10
	RLA
	AND	%00110000
	LD	E,A
	LD	D,B
	ADD	HL,DE
;
	CP	%00110000
	JR	NZ,EFBIGCK
;
	PUSH	HL
	LD	HL,ENHNMD
	ADD	HL,BC
	LD	A,(HL)
	POP	HL
	AND	A
	JR	NZ,EFBIG3
;
EFBIGCK
	LD	C,$04
	CALL	ENOMST
;
	JR	ENFL0A
;
EFBIG3
	LD	C,$08
	CALL	ENOMST
;
	LD	A,$08-4
	CALL	NXOMSBL
	JR	ENFL0A
;
EF0091
ENFL0A
	CALL	ENSTCK
;;;KK;;;		jp	ENHNSB
	CALL	ENHNSB
	RET
ENFL10
	CALL	ENMOVEL	; Only chr set
	CALL	ENSTCK2
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,ENFL11
;
	LD	HL,ENTIM4
	ADD	HL,BC
	LD	(HL),$1F
;
		LD	A,(CLOTHFG)
		AND	A
		JR	NZ,ENFL0C
;
	LD	A,(POWRFG)
	CP	$01
	JR	NZ,ENFL0C
;
	LD	A,$12
	LD	(SOUND2),A	;(S)
;
ENFL0C
	LD	HL,SOUND3	;(S)
	LD	(HL),$13
ENFL11
;;;KK;;;		jp	ENHNSB
	CALL	ENHNSB
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	敵やられアイテムセット	   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;;	0:00%  1:25%Rupy  2:50%Rupy  3:50%Heart 4:Heart100%
;;	5:25%Alow 6:25%heart 7:25%randam 8:50%randam 9:fairy50%
;;	A:100%Alow B:Bomb100% C:Rupy100% D:Fairy25% E:100%fairy
ITMSNO
	DB	RUPY1,RUPY1,HART1,HART1
	DB	ALOW1,HART1,$FF,$FF
	DB	YOSEI,ALOW1,BOMB1,RUPY1,YOSEI,YOSEI
ITMSTD
	DB	$03,$01,$01,$00
	DB	$03,$03,$03,$03
	DB	$01,$00,$00,$00,$03,$00
ITMSTD2
	DB	$01,$01,$01,$00
	DB	$01,$01,$01,$01
	DB	$01,$00,$00,$00,$01,$00
ITRNDDT
	DB	RUPY1
	DB	HART1
	DB	BOMB1
	DB	YOSEI
	DB	RUPY1
	DB	HART1
	DB	BOMB1
	DB	ALOW1
;- - - - - - - - - - - - - - - - - - -
ENITMS
	LD	A,(ENMYNO2)
	CP	LAIKU
	JR	NZ,EITS010
;
	LD	HL,ENWRK0
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,EITS010
;
	LD	A,PLTAT
	JP	EITS020
;
EITS010
;- - - - - - - - - - - - - - - -
EITS18
	LD	HL,ENITMF
	ADD	HL,BC
	LD	A,(HL)
	CP	$FF
	RET 	Z
	AND	A
	JP	NZ,EITS020	;強制アイテムセット
;
	LD	A,(ENFLCT2)
	INC	A
	LD	(ENFLCT2),A	;守りの木のみセットカウント！
	CP	12
	JR	C,KIMIS10
;
	XOR	A
	LD	(ENFLCT2),A
;
	LD	A,(BOSSFG)
	LD	HL,POWRFG
	OR	(HL)
	LD	HL,YKFLAG
	OR	(HL)
	JR	NZ,KIMIS10	;ボスへや or 横画面？
;
	LD	A,KINOM		;木のみ！
	JP	EITS020
;
KIMIS10
	LD	HL,ENMOD2
	ADD	HL,BC
	LD	D,B
	LD	E,(HL)
	LD	HL,ITSTDT
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	RET	Z
;				; yes !
	LD	E,A
;
	LD	D,30
	LD	A,(HARTMX)
	CP	07
	JR	C,EFE091
	LD	D,35
	CP	11
	JR	C,EFE091
	LD	D,40
EFE091
	LD	HL,ENFLCT	; All fail counter for level up !
	INC	(HL)
	LD	A,(HL)
	CP	D
	JR	C,EFE0911
;
	LD	(HL),B
;
	LD	A,(BOSSFG)
	LD	HL,YKFLAG
	OR	(HL)
	LD	HL,POWRFG
	OR	(HL)
	JR	NZ,EFE0911	;ボスへや or 横画面？
;				;NO
	LD	A,POWER	;POWER CHIP SET!
	JR	EITS020
EFE0911
	LD	D,B
	LD	HL,ITMSTD-1
	LD	A,(PINCHFG)
	AND	A
	JR	Z,EFE0912
	LD	HL,ITMSTD2-1
EFE0912
	ADD	HL,DE
	CALL	RNDSUB
	AND	(HL)
	RET	NZ
;               		；　ｙｅｓ
;
EITS1A
	LD	HL,ITMSNO-1
	ADD	HL,DE
	LD	A,(HL)
	CP	$FF
	JR	NZ,EITS020
;
	CALL	RNDSUB
	AND	$07
	LD	E,A
	LD	D,B
	LD	HL,ITRNDDT
	ADD	HL,DE
	LD	A,(HL)
EITS020
	CALL	ENIDSH
	RET	C
;
	LD	HL,ENWRK0
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENWRK0	; For PLTAT level !!
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK0)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENTIM3
	ADD	HL,DE
	LD	(HL),$80 ;A
;
	LD	HL,ENTIM1
	ADD	HL,DE
	LD	(HL),$18	;Hit protect !
;
	LD	HL,ENTIM4
	ADD	HL,DE
	LD	(HL),$03 ;A	; Water up protect !
;
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,ITMS10
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	KEYSM
	JR	NZ,KSS010	;地上鍵！
;
	LD	A,(ENMYNO2)
	CP	NOMOS
	JR	NZ,KSS010
;
	LD	HL,ENCHPT
	ADD	HL,DE
	LD	(HL),$03
KSS010
	CP	KAKIN
	JR	NZ,ITMS0C
;
	LD	A,(GRNDPT)
	CP	$58
	JR	Z,ITMS0BB
	CP	$5A
	JR	NZ,ITMS0C
;
ITMS0BB
	PUSH	BC
	PUSH	DE
		ld	c,e
		ld	b,d
;;10/31;	PUSH	DE
;;10/31;	POP	BC
;
	LD	A,$10
	CALL	PSERCH
;
	POP	DE
	POP	BC
ITMS0C
	LD	HL,ENZSPD
	ADD	HL,DE
	LD	(HL),$18 ;A
	JR	ITMS20
ITMS10
	LD	HL,ENYSPD
	ADD	HL,DE
	LD	(HL),$EC ;A
;;;;	JR	ITMS20
ITMS20
;------------------------------------------
ENZPSR
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENZPSL
	ADD	HL,DE
	LD	(HL),A
RPS090
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENCATM		; Normal speed pik up time !
	DB	$01,$08,$08,$10
ENCATM2		; Hi speed 
	DB	$01,$04,$04,$0A
ENCAPD
	DB	$37,$37,$37,$01
	DB	$39,$39,$39,$01
	DB	$3B,$3B,$3B,$01
	DB	$3D,$3D,$3D,$01
ENCAXD
	DB	$10,$10,$08,$00
	DB	$F0,$F0,$F8,$00
	DB	$00,$00,$00,$00
	DB	$FF,$FF,$FF,$FF
ENCAYD
	DB	$00,$00,$00,$00
	DB	$00,$00,$00,$00
	DB	$00,$00,$00,$00
	DB	$00,$00,$08,$00
ENCAZD
	DB	$00,$00,$08,$0E
	DB	$00,$00,$08,$0E
	DB	$00,$00,$08,$0E
	DB	$00,$00,$00,$0E
;-------------------------------------
ENCACH
	LD	A,(ENMYNO2)
	LD	(PLCANO),A
	CP	BOMBR
	JR	NZ,ECA0F00
;
	LD	HL,ENFLSH
	ADD	HL,BC
	LD	(HL),B
;
	CALL	BOMBRCS
	JR	ECA0F10
;
ECA0F00
	CALL	ENMOVEL
;
ECA0F10
	LD	HL,ENCAST ;STAT
	ADD	HL,BC
	LD	A,(HL)
	LD	E,A
	LD	D,B ;$0
	CP	$4
	JR	Z,ENCA30
;
	LD	A,(PLCAMK)
	LD	(PLCMKI),A
;
	PUSH	HL
;
	CALL	LDTIM0
	POP	HL
	AND	A
	JR	NZ,ENCA30
;
	INC	(HL)
;
	LD	HL,ENCATM
;
	LD	A,(ENMYNO2)
	CP	BOMBR
	JR	Z,ENCA21
;
	LD	A,(BULLEV)
	CP	$02
	JR	NC,ENCA21
;
		LD	A,(CLOTHFG)
		AND	$001		;攻撃力ＵＰ？
		JR	NZ,ENCA21	;	YES --> ENCA21
;
	LD	A,(POWRFG)
	CP	$01
	JR	NZ,ENCA22
;
ENCA21
	LD	HL,ENCATM2	; Hi speed take up !
ENCA22
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENTIM0
	ADD	HL,BC
	LD	(HL),A
ENCA30
	LD	A,E
	CP	$00
	JR	NZ,ENCA40
;
	INC	E
ENCA40
	CALL	ENCAPS
;
		jp	CAOFCK
;;;;;;;;	CALL	CAOFCK
;;;;;;;;	RET
;============================================
ENCAPS
	LD	A,(PLCMKI)
	SLA	A
	SLA	A
	ADD	A,E
	LD	E,A
	LD	D,$0
	LD	HL,ENCAPD-1
	ADD	HL,DE
	LD	A,(HL)
	LD	(PLCAMD),A
;
	LD	HL,ENCAXD-1
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,PLXPSL
	ADD	A,(HL)
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	(HL),A
;
	LD	HL,ENCAYD-1
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,PLYPSL
	ADD	A,(HL)
	LD	HL,PLDSYD
	ADD	A,(HL)
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	(HL),A
;
	LD	A,(YKFLAG)
	AND	A
	JR	Z,CPS010
;
	PUSH	HL
	LD	HL,ENCAZD-1
	ADD	HL,DE
	LD	E,(HL)
	POP	HL
	LD	A,(HL)
	SUB	E
	LD	(HL),A
	RET
;
CPS010
	LD	HL,ENCAZD-1
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,PLZPSL
	ADD	A,(HL)
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),A
	RET
;
;-------------------------------------
CAOFCK
		jp	CAOFCKL
;;;;;;;;	CALL	CAOFCKL
;;;;;;;;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;
;###############################################
;#					       #
;###############################################
OCTA1MV
	LD	DE,OCTA1CD2
	LD	A,(GMMODE)
	CP	ENDG
	JR	Z,OCT1100
;
	LD	A,$30
	LD	(ENCHNO),A
OCT1100
	CALL	ENMVSB
	RET
;
;===============================================
OCTA1CD
;	DB	$60,$00,$60,$20 ;D
;	DB	$62,$00,$62,$20
;	DB	$60,$40,$60,$60 ;U
;	DB	$62,$40,$62,$60
;	DB	$64,$00,$66,$00 ;L
;	DB	$68,$00,$6A,$00
;	DB	$66,$20,$64,$20 ;R
;	DB	$6A,$20,$68,$20
OCTA1CD2
	DB	$30,$02,$30,$22 ;D
	DB	$32,$02,$32,$22
	DB	$30,$42,$30,$62 ;U
	DB	$32,$42,$32,$62
	DB	$34,$02,$36,$02 ;L
	DB	$38,$02,$3A,$02
	DB	$36,$22,$34,$22 ;R
	DB	$3A,$22,$38,$22
;###############################################
;#					       #
;###############################################
MRMVXS
	DB	$08,$F8,$00,$00
MRMVYS
	DB	$00,$00,$F8,$08
MRMVPT
	DB	$06,$04,$02,$00
;
MORI1MV
	LD	A,(DNJNNO)
	CP	$15
	JR	NZ,M0M10E0	;洞窟？
;				;YES !
	LD	A,(WANFLG)
	CP	$80
	JP	NZ,ENCLER
;
M0M10E0
	LD	A,C
	LD	(WAINDX2),A	;ワンワン連れ用インデックス
;
	LD	DE,MORI1CD
ENMVSB
	CALL	EN2CST
;
	CALL	ENSTCK
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,EMVS10	;はねかえりストップ！
;
	LD	HL,ENSTAT
	ADD	HL,BC
	LD	A,$01
	LD	(HL),A
	LD	(ENSTAT2),A
;
	CALL	LDTIM0
	LD	(HL),$40
EMVS10
	CALL	ENHNSB
;
	CALL	CREPKE
;
	LD	A,(ENSTAT2) ;HL)
	AND	A
	JR	Z,MR1WLK
;- - STOP - -
	CALL	LDTIM0
	JR	Z,MR1S02
;
	CP	$0A
	JR	NZ,MR1S01	; Shot chance ?
;				; yes 
	CALL	LDTIM1
	JR	NZ,MR1S01
;
	CALL	EPXYCK
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	A,E
	CP	(HL)
	JR	NZ,MR1S01
;
	LD	A,(ENMYNO2)
	CP	HIPLP
	JR	Z,MR1S01
	CP	OCTA1
	JR	Z,OCTAMSS
;
	CALL	MORYAST
MR1S01
	CALL	ENBGCK
	RET
;--------------------------------
OCTAMSS
	LD	A,(GMMODE)
	CP	ENDG
	RET	Z
;
		jp	OCTAMST
;;;;;;;;	CALL	OCTAMST
;;;;;;;;	RET
;--------------------------------
MR1S02
	CALL	RNDSUB
	AND	$1F
	OR	$20
	LD	(HL),A
;
	LD	HL,ENSTAT
	ADD	HL,BC
;;	LD	A,$0
	LD	(HL),$00 ;A
;
	LD	HL,ENWRK0
	ADD	HL,BC
	LD	A,(HL)
	INC	A
	AND	$3
	LD	(HL),A
	CP	$00
	JR	NZ,MR1S08	; 4 move 1 serch !
;
	CALL	EPXYCK
	JR	MR1S0A
MR1S08
	CALL	RNDSUB
MR1S0A
	AND	$03
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	(HL),A
;
	LD	E,A
	LD	D,B ;$0
	LD	HL,MRMVXS
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
	LD	HL,MRMVYS
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
MR1S10
	RET
;------------------------------------------
;- - WALK - -
MR1WLK
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	%00001111
	JR	NZ,MR1STS
;
	CALL	LDTIM0
	JR	NZ,MR1M10
MR1STS
	CALL	RNDSUB
	AND	$0F
	OR	$10
	LD	(HL),A
;
	LD	HL,ENSTAT
	ADD	HL,BC
;;;	LD	A,$1
	LD	(HL),$01 ;A
;
	CALL	ENSDCL
MR1M10
;
	CALL	ENMVCL
	CALL	ENBGCK
;
MKPTST
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	E,(HL)
;;	LD	E,A
	LD	D,B ;$0
	LD	HL,MRMVPT
	ADD	HL,DE
;
	PUSH	HL
	LD	HL,ENCONT
	ADD	HL,BC
	INC	(HL)
;
	LD	A,(HL)  ;(FRCNT)
	RRA	
	RRA	
	RRA	
	POP	HL
	AND	%00000001
	OR	(HL)
;
		jp	ENPTST
;;;;;;;;	CALL	ENPTST
;;;;;;;;;
;;;;;;;;	RET
;===============================================
MORI1CD
	DB	$60,$03,$62,$03
	DB	$62,$23,$60,$23
	DB	$64,$03,$66,$03
	DB	$66,$23,$64,$23
	DB	$68,$03,$6A,$03
	DB	$6C,$03,$6E,$03
	DB	$6A,$23,$68,$23
	DB	$6E,$23,$6C,$23
;###############################################
;#					       #
;###############################################
MYSXAD
	DB	$08,$F8,$04,$FC
MYSYAD
	DB	$FC,$FC,$F8,$00
MYSXSD
	DB	$20,$E0,$00,$00
MYSYSD
	DB	$00,$00,$E0,$20
;- - - - - - - - - - - - - - - - -
MORYAST
	LD	A,MORYA
	CALL	ENIDSH
	JR	C,MYS090
;
	PUSH	BC
;
	LD	A,(WORK2)
	LD	C,A
;
	LD	HL,MYSXAD
	ADD	HL,BC
;
	LD	A,(WORK0)
	ADD	A,(HL)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,MYSYAD
	ADD	HL,BC
;
	LD	A,(WORK1)
	ADD	A,(HL)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,MYSXSD
	ADD	HL,BC
;
	LD 	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,MYSYSD
	ADD	HL,BC
;
	LD 	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,DE
	LD	(HL),A
;
	LD 	A,(WORK2)
	LD	HL,ENCHPT
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENMUKI
	ADD	HL,DE
	LD	(HL),A
;
	POP	BC
MYS090
	RET
;###############################################
;#					       #
;###############################################
OTSXAD
	DB	$08,$F8 ;,$00,$00
OTSYAD
	DB	$00,$00,$F8,$08
OTSXSD
	DB	$20,$E0 ;,$00,$00
OTSYSD
	DB	$00,$00,$E0,$20
;- - - - - - - - - - - - - - - - -
OCTAMST
	LD	A,OCTAM
ENBMST
	CALL	ENIDSH
	JR	C,OTS090
;
	PUSH	BC
;
	LD	A,(WORK2)
	LD	HL,ENMUKI
	ADD	HL,DE
	LD	(HL),A
;
	LD	C,A
;
	LD	HL,OTSXAD
	ADD	HL,BC
;
	LD	A,(WORK0)
	ADD	A,(HL)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,OTSYAD
	ADD	HL,BC
;
	LD	A,(WORK1)
	ADD	A,(HL)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,OTSXSD
	ADD	HL,BC
;
	LD 	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,OTSYSD
	ADD	HL,BC
;
	LD 	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,DE
	LD	(HL),A
;
	POP	BC
	AND	A	; CLC
OTS090
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BOMBOIT
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BOMBOMV
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	ハートの器		   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HARTBCD
	DB	$AA,$14,$AA,$34
HARTBMV
	LD	DE,HARTBCD
	CALL	EN2CST
;
	CALL	LDTIM0
	JP	Z,ITEMSUB
;
	DEC	A
	JR	NZ,HARTB10
;
	LD	A,$18
	LD	(SOUND4),A	;(S)
;
	LD	HL,HARTMX
	INC	(HL)
;
	LD	HL,HARTUP
	LD	(HL),$FF
;
	CALL	SVDSSB
;
	LD	A,(HL)
	OR	%00100000	; Boss fail on !
	LD	(HL),A
	LD	(DJSVBF),A	; Save data buffer set !
;
;
	LD	A,(DNJNNO)	;横画面のボス部屋！
	LD	HL,DJRMSV+$12E
	CP	$06		;塔
	JR	Z,HBSV10	
	CP	$03		;水
	JR	NZ,HBSV20
;
	LD	HL,DJRMSV+$66
HBSV10
	SET	5,(HL)
HBSV20
	JP	ENCLER
HARTB10
PLJYAN
PLJY10
	LD	A,(PLXPSL)
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	(HL),A
;
	LD	A,(PLYPSL)
	LD	HL,ENYPSL
	ADD	HL,BC
	SUB	$0C
	LD	(HL),A
;
	LD	A,(PLZPSL)
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),A
;
JYANPS
	LD	A,$6C  ;
	LD	(PLCHPT),A
;
	LD	A,$03
	LD	(PLCMKI),A
;
	XOR	A
	LD	(PCUTFG),A
	LD	(WCUTFG),A
	LD	(SPCTWT),A
	LD	(SPCTTM),A
;
	LD	HL,ENWATR
	ADD	HL,BC
	LD	(HL),A
;
JYPS090
	LD	A,$02
	LD	(PLSTOP),A
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	ハートのかけら						%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KAKERCD
	DB	$AC,$02,$AC,$22
;- - - - - - - - - - - - - - - - - - -
KAKERMV
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER
;
	LD	A,(ENSTAT2)
;
	RST	0
	DW	KKM010
;
	DW	KK0600
	DW	KK0800

	DW	KK0900
	DW	KK1000
	DW	KK2000
	DW	KK3000
	DW	KK4000
	DW	KK4100
;===========================================
KK0600
	CALL	PLJYAN
;
	CALL	LDTIM0
		ret	NZ
;;;;;;;;	JR	NZ,KK6080
;
		ld	a,001
		ld	(ITEMNOT),a
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;KK6080
;;;;;;;;	RET
;===========================================
KK0800
	LD	A,HRTC1		; Heart chr tr.
	LD	(BKCHFG),A
;
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;;
;;;;;;;;	RET
;===========================================
KK0900
	LD	A,HRTC2		; Heart chr tr.
	LD	(BKCHFG),A
;
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;;
;;;;;;;;	RET
;===========================================
KK1000
	LD	A,$4F
	CALL	MSGCHK
;
	CALL	STATINC
;
	LD	A,$01
	LD	(MSKYOF),A
;
	RET
;===========================================
KK2000
	CALL	PLJYAN
;
	LD	DE,KAKERCD
	CALL	EN2CST
;
	CALL	KAKERCS
;
	LD	HL,ENCONT
	ADD	HL,BC
	INC	(HL)
	LD	A,(HL)
	CP	$A8
	JP	Z,STATINC
	CP	$38
	JR	NZ,KK2010
;
	LD	A,(KAKERCT)
	INC	A
	LD	(KAKERCT),A
KK2010
	RET
;===========================================
KK3000
	CALL	PLJYAN
	LD	DE,KAKERCD
	CALL	EN2CST
;
	XOR	A
	LD	(MSKYOF),A
;
	CALL	KAKERCS
;
	LD	A,(MSGEFG)
	AND	A
		ret	NZ
;;;;;;;;	JR	NZ,KK3020
;
	LD	A,(KAKERCT)
	CP	$04
	JR	NZ,KK3010
;
	LD	A,$19
	LD	(SOUND1),A	;(S)
;
	XOR	A
	LD	(KAKERCT),A
;
	LD	HL,HARTUP
	LD	(HL),$40
;
	LD	HL,HARTMX
	INC	(HL)
;
	LD	A,$50
	CALL	MSGCHK
KK3010
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;KK3020
;;;;;;;;	RET
;===========================================
KK4000
	CALL	PLJYAN
;
	LD	DE,KAKERCD
	CALL	EN2CST
;
	LD	A,(MSGEFG)
	AND	A
		ret	NZ
;;;;;;;;	JR	NZ,KK4080
;
	LD	A,HRTC3
	LD	(BKCHFG),A	; Heart chr revise
;
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;KK4080
;;;;;;;;	RET
;===========================================
KK4100
	LD	A,HRTC4
	LD	(BKCHFG),A	; Heart chr revise
;
	CALL	ENCLER
;
	LD	A,$0D
	LD	(CHTRF2),A
;
		xor	a
		ld	(ITEMNOT),a
	JP    	SVDTST
;;	RET
;===========================================
KAKERCD2
	DB	$9A,$02,$9A,$22
	DB	$9C,$02,$9A,$22
	DB	$9E,$02,$9A,$22
	DB	$9E,$02,$9C,$22
	DB	$9E,$02,$9E,$22
;
KAKERCS
	LD	A,(MSGEFG)
	AND	A
		ret	Z
;;;;;;;;	JR	Z,KKCS90

		LD	A,(MJSTCT)
		CP	$20+1		; 最初の２行？
		RET	NC		; ＮＯ

		LD	A,(MSGEFG)

	AND	%10000000
	LD	A,$23
	JR	Z,KKCS10
	LD	A,$6B
KKCS10
	LD	(ENDSYP),A
;
	LD	A,(KAKERCT)
	LD	(ENCHPT2),A
;
;;;;;;;;	LD	A,$8B
	LD	A,$8E		; メッセージ時のハートの器のＸの位置
	LD	(ENSVXL),A
;
	LD	DE,KAKERCD2
		jp	EN2CST
;;;;;;;;	CALL	EN2CST
;;;;;;;;;
;;;;;;;;KKCS90
;;;;;;;;	RET
;
;===========================================
;===========================================
;
KKM010
	LD	DE,KAKERCD
	CALL	EN2CST
;
	JP	ITEMSUB
;- - - - - - - - - - - - - - - - - - -
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	守りのかけら						%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KINOMCD
	DB	$AE,$14
KINOMMV
	LD	DE,KINOMCD
	CALL	EN1CST
;
	JR	ITEMSBS
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	力のかけら						   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
POWERCD
	DB	$14,$02,$14,$22
	DB	$14,$14,$14,$34
;- - - - - - - - - - - - - - - - - - -
POWERMV
	LD	DE,POWERCD
	CALL	EN2CST
;
	LD	A,(FRCNT)
	RRA
	RRA
	RRA
	AND	$01
	CALL	ENPTST
;
ITEMSBS
	JP	ITEMSUB
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HMASKCD
	DB	$74,$00,$76,$00
	DB	$76,$20,$74,$20
;- - - - - - - - - - - - - - - - - -
HMASKMV
	LD	DE,HMASKCD
	CALL	EN2CST
;
;;;	JP	ITEMSUB
	CALL	ENSTCK
;
	CALL	BUMECK
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	リンクの剣	(拾うやつ)				%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PLTATCD
	DB	$86,$17		; ライクライクからの楯
	DB	$84,$17		; 初めに拾う剣
;
PLTATMV
	LD	DE,PLTATCD
;
	LD	A,(KENLEV)
	AND	A
	JR	NZ,PTMV10
;
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER
;
	LD	DE,PLTATCD+2
PTMV10
	CALL	EN1CST
;
	LD	A,(ENSTAT2)
	RST	00
	DW	IKN1000
	DW	IKN2000
	DW	IKN3000
	DW	IKN4000
;======================================
IKN1000
	CALL	LDTIM0
	JP	Z,ITEMSUB	;剣持ち上げ？
;				; ハイ
	CP	$10
	JR	NZ,PTMV18
;
	DEC	(HL)
;
	LD	A,$9B
	CALL	MSGCHK
;
	XOR	A
PTMV18
	DEC	A
	JR	NZ,PTMV20
;
	LD	A,$31
	LD	(SOUND4),A	;(S)
	LD	A,$05
	LD	(BGMNO),A
	LD	(TODYFG),A
;
	CALL	LDTIM3
	LD	(HL),$52
;
	CALL	STATINC
PTMV20
	JP	PLJYAN
;
;======================================
IKN2000
	CALL	PLJYAN
;
	CALL	LDTIM3
		ret	NZ
;;;;;;;;	JR	NZ,IKN2020
;
	LD	A,$FF
	CALL	ENPTST
;
	CALL	LDTIM0
	LD	(HL),$20
;
	LD	A,$20
	LD	(SPCTTM),A
;
	LD	A,$03
	LD	(SOUND3),A	;(S)
;
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;IKN2020
;;;;;;;;	RET
;======================================
IKN3000
	CALL	LDTIM0
		ret	NZ
;;;;;;;;	JR	NZ,IKN3010
;
	LD	(HL),$20
;
	LD	A,$00
	CALL	ENPTST
;
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;IKN3010
;;;;;;;;	RET
;======================================
IKN4000
	CALL	PLJYAN
;
	LD	A,$6B
	LD	(PLCHPT),A
;
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(PLXPSL)
	SUB	$04
	LD	(HL),A
;
	CALL	LDTIM0
	JR	NZ,IKN4010
;
	LD	(ITEMNOT),A
;
	LD	D,PKEN
	CALL	ITEMGET
;
	LD	A,$01
	LD	(KENLEV),A
;
	CALL	SVDTST
;
	JP	ENCLER
IKN4010
	CP	$1A
	JR	NZ,IKN4030
;
	LD	A,(ENSVYL)
	SUB	$0C
	CALL	EKFLSHS
;
	LD	A,$07
	LD	(SOUND1),A	;(S)
IKN4030
	RET
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	マスタースタルフォスを倒した後に出てきたフックショット	%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PFUCKCD
	DB	$8A,$14
;
PFUCKMV
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER
;
	LD	DE,PFUCKCD
	CALL	EN1CST
;
	CALL	LDTIM0
	JP	Z,ITEMSUB	;剣持ち上げ？
;				; ハイ
	CP	$10
	JR	NZ,PFMV18
;
	DEC	(HL)
;
	LD	A,$93
	CALL	MSGCHK
;
	XOR	A
PFMV18
	DEC	A
	JR	NZ,PFMV20
;
	LD	D,PFUCK
	CALL	ITEMGET
;
	CALL	SVDTST
;
	JP	ENCLER
PFMV20
	JP	PLJYAN
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KEYSMCD
	DB	$CA,$17	;レベル８ Ｑちゃんの上の部屋？？
;
	DB	$C0,$17
	DB	$C2,$14
	DB	$C4,$17
	DB	$C6,$14
	DB	$CA,$17
;----------------------------
GKMSDT
	DB	$00,$A3,$A4,$A5,$00
KEYSMMV
	CALL	ERCHK
	JR	NC,KSMM100	;流さ落ちた？
;
	LD	HL,GRRMSV+$CE
	SET	4,(HL)
	LD	HL,DJRMSV+$F8
	SET	5,(HL)
	RET
KSMM100
	LD	A,(GRNDPT)
	CP	$80
	JP	Z,PFUCKMV
;
KSMM190
	LD	DE,KEYSMCD
	CALL	EN1CST
;
	CALL	LDTIM0
	JP	Z,GKMV10 	;持ち上げ？
;				; ハイ
	CP	$10
	JR	NZ,GKMV03
;
	DEC	(HL)
;
	LD	A,(ENCHPT2)
	DEC	A
	LD	E,A
	LD	D,B
	LD	HL,GKMSDT
	ADD	HL,DE
	LD	A,(HL)
	CALL	MSGCHK
;
	LD	A,(ENCHPT2)
	DEC	A
	LD	E,A
	LD	D,B
	LD	HL,GRKEY1
	ADD	HL,DE
	LD	(HL),$01
;
	CALL	SVDTST	; Save bit on !
;
	XOR	A
GKMV03
	DEC	A
	JR	NZ,GKMV08
;
	JP	ENCLER
GKMV08
	JP	PLJYAN
;----------------------------
GKMV10
	CALL	ENSTCK
	CALL	BUMECK
;
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,KSMV10
;
	CALL	CRITPL
KSMV10
	JP	ENBDCL
;------------------------------				;YES !
ERCHK
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,ERMM190
;
	LD	A,(GRNDPT)
	CP	$CE
	JR	NZ,ERMM190
;
	LD	A,(ENSVYL)
	SUB	$48
	ADD	A,$03
	CP	$06
	JR	NC,ERMM190
;
	LD	A,(ENSVXL)
	SUB	$50
	ADD	A,$03
	CP	$06
	JR	NC,ERMM190	;流さにはまる！
;
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,ERMM190	;流さにはまる！
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	A,(HL)
	CP	EMOVE
	JR	NZ,ERMM190	;流さにはまる！
;
	LD	(HL),EFOLE
;
	LD	HL,ENFLXP
	ADD	HL,BC
	LD	(HL),$50
	LD	HL,ENFLYP
	ADD	HL,BC
	LD	(HL),$48
;
	CALL	LDTIM0
	LD	(HL),$2F
;
	LD	A,$18
	LD	(SOUND1),A	;(S)
;
	SCF
	RET
ERMM190
	AND	A
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	草を刈ったり、敵を倒したりした後に出てくるハート	%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
HART1CD
	DB	$A8,$14
HART1MV
	CALL	ITCLCK	; In data set see thruu
	CALL	ITTIMCK
;
	LD	DE,HART1CD
	CALL	EN1CST
HTM020
	JP	ITEMSUB
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KINOKCD
	DB	$5E,$02,$5E,$22
;
KINOKMV
	LD	HL,KINOKFG
	LD	A,(TUBOCT)
	OR	(HL)		;キノコ持ってる？
	JP	NZ,ENCLER	;魔法の粉を使い切った？
;				; YES!
	LD	DE,KINOKCD
	CALL	EN2CST
;
	CALL	LDTIM0
	JP	Z,ITEMSUB	;持ち上げ？
;				; ハイ
	CP	$10
	JR	NZ,KNMV18
;
	DEC	(HL)
;
	LD	A,$0F
	CALL	MSGCHK
;
	XOR	A
KNMV18
	DEC	A
	JR	NZ,KNMV20
;
	LD	A,$0A
	LD	(CHTRF2),A	;きのこキャラ転送！
;
	LD	D,PMGIC
	CALL	ITEMGET		; アイテム枠表示！
;
	LD	A,$01
	LD	(KINOKFG),A	;きのこを持っている！
;
	JP	ENCLER
KNMV20
	JP	PLJYAN
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	楽器							%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
GAKKICD
	DB	$70,$01,$72,$01	;LV 1
	DB	$74,$01,$76,$01	;LV 2
	DB	$78,$01,$7A,$01	;LV 3
	DB	$7C,$01,$7E,$01	;LV 4
;;	DB	$70,$00,$72,$00	;LV 5
;;	DB	$74,$00,$76,$00	;LV 6
;;	DB	$78,$00,$7A,$00	;LV 7
;;	DB	$7C,$00,$7E,$00	;LV 8
;
;
GAKKIMV
	LD	HL,ENWRK0
	ADD	HL,BC
	LD	A,(HL)
	RST	00
	DW	GKMAIN	;MAIN control
	DW	GKONPU	;Onpu
	DW	GKFLSHS	;Flash
;
GKBGCD
;0
	DB	%11100100
	DB	%11100100
	DB	%11100100
	DB	%11100100
;4
	DB	%10010000
	DB	%10010000
	DB	%10010000
	DB	%10010000
;8
	DB	%01000000
	DB	%01000000
	DB	%01000000
	DB	%01000000
;C
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
;10
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
;14
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
;18
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
GKOBCD
;0
	DB	%00011100
	DB	%00011100
	DB	%00011100
	DB	%00011100
;4
	DB	%00011100
	DB	%00011100
	DB	%00011100
	DB	%00011100
;8
	DB	%00011100
	DB	%00011100
	DB	%00011100
	DB	%00011100
;C
	DB	%00011100
	DB	%00011100
	DB	%00011100
	DB	%00011100
;10
	DB	%00001000
	DB	%00001000
	DB	%00001000
	DB	%00001000
;14
	DB	%00000100
	DB	%00000100
	DB	%00000100
	DB	%00000100
;18
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
	DB	%00000000
;- - - - - - - - - - - - - -
GKFLSHS
	CALL	GKFLSH
;
	LD	A,$01
	LD	(ITEMNOT),A
;
	CALL	LDTIM3
	JR	NZ,GKFL008
;
	CALL	ENCLER
;
GKFL002
	XOR	A
	LD	(PLCHPT),A
;
	LD	A,(BSINDX)
	LD	E,A
	LD	D,B
	LD	HL,ENSTAT
	ADD	HL,DE
	INC	(HL)
;
	CALL	NXGOTO3
;
;-- ダンジョンクリアー後のイベント進行 ---
	LD	A,(DNJNNO)
	RST	00
	DW	DJ1CLR
	DW	DJ2CLR
	DW	DJ3CLR
	DW	DJ4CLR
	DW	DJ5CLR
	DW	DJ6CLR
	DW	DJ7CLR
	DW	DJ8CLR
;=====================================
DJ1CLR
	LD	A,$80
	LD	(WANFLG),A	;ワンワン連れさられる！
	RET
;=====================================
DJ2CLR
	LD	A,$02
	LD	(PAPA0FG),A	;タリンがバナナを食っている！
	RET
;=====================================
DJ3CLR
	RET
;=====================================
DJ4CLR
	LD	A,$02
	LD	(OBAKEFG),A	;オバケ転送セット！
;;	RET
;=====================================
DJ5CLR
;=====================================
DJ8CLR
	RET
;=====================================
DJ6CLR
	XOR	A
	LD	(MARINOF),A
	RET
;=====================================
DJ7CLR
	XOR	A
	LD	(NIWATFG),A	;ニワトリばいばい！
	RET
;
;=====================================
GKFL008
	CP	$50
	JR	NC,GKFL100
;
	LD	HL,ENWRK1
	ADD	HL,BC
	LD	A,(HL)
	CP	$19
	JR	NC,GKFL100
;
	LD	A,(FRCNT)
	AND	$07
	JR	NZ,GKFL04C
;
	LD	A,(HL)
	AND	A
	JR	NZ,GKFL03C
;
	LD	A,$2C
	LD	(SOUND3),A	;(S)
	XOR	A
GKFL03C
	INC	(HL)
;
	CP	$18
	JR	NZ,GKFL04C
;
	LD	A,KURI0		;BG書き換え＆メッセージ！
	CALL	ENIDSH	
;
	LD	HL,ENWRK0
	ADD	HL,DE
	LD	(HL),$01
;
	LD	HL,ENTIM0
	ADD	HL,DE
	LD	(HL),$60
GKFL04C
	LD	A,(FRCNT)
	AND	$03
	LD	HL,ENWRK1
	ADD	HL,BC
	ADD	A,(HL)
	LD	E,A
	LD	D,B
;
;---------------------------------------
		LD	A,(CGBFLG)
		AND	A
		JR	Z,GK_WhiteOutPass
		PUSH	BC
		PUSH	DE
		LD	A,:GK_WhiteOutPass
		CALL	GK_WhiteOutSub
		POP	DE
		POP	BC
		JR	GKFL100
GK_WhiteOutPass
;---------------------------------------
;
	LD	HL,GKBGCD
	ADD	HL,DE
	LD	A,(HL)
	LD	(BGPFG),A
	LD	HL,GKOBCD
	ADD	HL,DE
	LD	A,(HL)
	LD	(OBP0FG),A
	XOR	A
	LD	(OBP1FG),A
;
GKFL100
	RET
;
;===================================
;=================================
GKONPUCD
	DB	$6C,$00,$FF,$FF
	DB	$6C,$00,$6E,$00
;
GKONPU
	LD	DE,GKONPUCD
	CALL	EN2CST
;
	CALL	ENMVCL
;
	CALL	LDTIM0
	JP	Z,ENCLER
	RET
;==================================
GKMAIN
		LD	A,(ENSTAT2)
		CP	$003
		JR	NC,GKMAIN_PASS
		LD	A,:GKMAIN
		CALL	GAKKI_COL_SET_SUB
GKMAIN_PASS
;
	LD	A,C
	LD	(BSINDX),A
;
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER	; Already have ?
;				; Yes !
	LD	A,(DNJNNO)
	AND	$03
	LD	(ENCHPT2),A
;
	CALL	SHRVSE	;シャッター無理矢理補正！
;
	LD	DE,GAKKICD
	CALL	EN2CST
;
	LD	A,(ENSTAT2)
	RST	00
	DW	GK1000
	DW	GK2000
	DW	GK3000
	DW	GK4000
	DW	GK5000
;
GK1000
	CALL	LDTIM0
	JP	Z,ITEMSUB	;持ち上げ？
;				; ハイ
	CP	$10
	JR	NZ,GKMV18
;
	DEC	(HL)
;
	CALL	STATINC
;
	LD	A,(DNJNNO)
	ADD	A,$00
	CALL	MSGCH2
;
	LD	A,(DNJNNO)
	LD	E,A
	LD	D,B
	LD	HL,WARPSV
	ADD	HL,DE
	LD	A,(HL)
	OR	%00000010
	LD	(HL),A
;
	CALL	SVDSSB
;
	LD	A,(HL)
	OR	%00010000	; Boss fail on !
	LD	(HL),A
;;;	LD	(DJSVBF),A	; Save data buffer set !
;
	XOR	A
GKMV18
	DEC	A
	JR	NZ,GKMV20
;
;;	JP	ENCLER
GKMV20
	JP	PLJYAN
;------------------------------------------
GKBGMD
;;;	    LEVEL 1   2   3   4   5   6   7   8
	DB	$20,$28,$29,$2A,$2B,$2C,$2D,$2E
GK2000
	LD	A,($D369)
	AND	A
	JR	NZ,GK2010	; BGM end ?
;				; yes !
	LD	A,(MSGEFG)
	AND	A
	JR	NZ,GK2010
;
	LD	A,(DNJNNO)
	LD	E,A
	LD	D,B
	LD	HL,GKBGMD
	ADD	HL,DE
	LD	A,(HL)
	LD	(SOUND4),A	;(S)
;
	CALL	STATINC
;
	CALL	LDTIM0
	LD	(HL),$FF
GK2010
	JP	PLJYAN
;------------------------------------------
ONPUXD
	DB	$0A,$FA
ONPUXS
	DB	$04,$FC
;- - - - - - - - - - - - - -
GK3000
	CALL	LDTIM0
	JR	NZ,GK3010
;
	LD	A,$2B
	LD	(SOUND1),A	;(S)
;
	LD	A,GAKKI
	CALL	ENIDSH
;
	LD	A,(WORK0)
	DEC	A
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENWRK0
	ADD	HL,DE
	LD	(HL),$02
;
	LD	HL,ENTIM3
	ADD	HL,DE
	LD	(HL),$80 ;$40
	JP  	STATINC
GK3010	
	LD	HL,ENWRK2
	ADD	HL,BC
	DEC	(HL)
	LD	A,(HL)
	CP	$FF
	JR	NZ,GK3020
;
	LD	(HL),$17
;
	LD	HL,ENWRK3
	ADD	HL,BC
	INC	(HL)
	LD	A,(HL)
	AND	$01
	LD	(ENHELP),A
;
	LD	A,GAKKI
	CALL	ENIDSH
;
	PUSH	BC
;
	LD	HL,ENWRK0
	ADD	HL,DE
	INC	(HL)
;
	LD	A,(ENHELP)
	LD	C,A
;
	LD	HL,ONPUXD
	ADD	HL,BC
	LD	A,(WORK0)
	ADD	A,(HL)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ONPUXS
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,ENYPSL
	ADD	HL,DE
	ADD	A,$F8
	LD	(HL),A
;
	LD	HL,ENYSPD
	ADD	HL,DE
	LD	(HL),$FD
;
	LD	HL,ENTIM0
	ADD	HL,DE
	LD	(HL),$38
;
	CALL	RNDSUB
	AND	$01
	LD	HL,ENCHPT
	ADD	HL,DE
	LD	(HL),A
;
	POP	BC
GK3020
	JP	PLJYAN
;------------------------------------------
GK4000
	JP	PLJYAN
;------------------------------------------
GK5000
	RET
;;;	JP	PLJYAN
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	ツボ等の下から出てくる爆弾				%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
BOMB1CD
	DB	$80,$15
BOMB1MV
	CALL	ITCLCK	; In data set see thruu
	CALL	ITTIMCK
;
	LD	DE,BOMB1CD
	CALL	EN1CST
;
	JP	ITEMSUB
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KAIINCD
	DB	$9E,$14
;
KAIINMV
	LD	A,(KENLEV)
	CP	$02
	JP	NC,ENCLER	;剣レベル２取った後？
;				;NO!
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER
;
	LD	A,(GRNDPT)
	CP	$E3
	JR	NZ,KIIM100	;お化けの家？
;				;YES !
	LD	A,(DJSVBF)
	AND	%01000000
	JP	Z,ENCLER    	;おばけが教えた後？
;			  	;YES !
KIIM100
	CALL	ITCLCK	; In data set see thruu
;;;	CALL	ITTIMCK
;
	LD	DE,KAIINCD
	CALL	EN1CST
;
	JP	ITEMSUB
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KAKINCD
	DB	$CA,$14
;
KAKINMV
	LD	A,(DJSVBF)
	AND	%00010000
	JP	NZ,ENCLER
;
	CALL	ITCLCK	; In data set see thruu
;;;	CALL	ITTIMCK
;
	LD	DE,KAKINCD
	CALL	EN1CST
;
	CALL	LDTIM0
	JP	Z,ITEMSUB	;剣持ち上げ？
;				; ハイ
	CP	$10
	JR	NZ,KKIMV18
;
	DEC	(HL)
;
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,KKGT10
;
	LD	A,(GRNDPT)
	CP	$C6
	JR	NZ,KKGT10	;鍵 ５ ステージ？
;				;yes !
	LD	A,$06-1
	LD	(GRKEY5),A	;鍵 5 拾う！
KKGT10
	LD	HL,GRKEY5 ;KEYECT	;
	CALL	IUPSUB
;
	CALL	SVDTST
;
	LD	HL,DJSVBF
	RES	4,(HL)	;表示だけはしておく！
;
;;	LD	A,(GRNDPT)
;;	CP	$C6	;はっぱ
	LD	E,$A2
	LD	A,(GRKEY5)
	CP	$06
	JR	Z,KKIMV12
	LD	E,$E8
	CP	$05
	JR	NZ,KKIMV12
	INC	E	;さいごの１枚
KKIMV12
	LD	A,E
	CALL	MSGCHK
;
	XOR	A
KKIMV18
	DEC	A
	JR	NZ,KKIMV20
;
	JP	ENCLER
KKIMV20
	JP	PLJYAN
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
MGPOWCD
	DB	$8E,$16
;
MGPOWMV
		LD	A,(DJFLAG)
		AND	A		;地上？
		JR	Z,MGPOWMV_100	;	YES --> MGPOWMV_100
		LD	A,(DNJNNO)
		CP	NEWDJ		; 新ダンジョン？
		JR	Z,MGPOWMV_500	;	YES --> MGPOWMV_500
;
MGPOWMV_100
		LD	A,(KINOKFG)
		AND	A
		JP	NZ,ENCLER
;
MGPOWMV_500
		CALL	ITCLCK	; In data set see thruu
		CALL	ITTIMCK
;
		LD	DE,MGPOWCD
		CALL	EN1CST
;
		JP	ITEMSUB
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	ツボ等の下から出てくる矢				%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ALOW1CD
	DB	$2A,$41
	DB	$2A,$61
;
ALOW1MV
	CALL	ITCLCK	; In data set see thruu
	CALL	ITTIMCK
;
	LD	DE,ALOW1CD
	CALL	EN2CST
;
	JP	ITEMSUB
;======================================
ITTIMCK
;;	LD	HL,ENTIM3
;;	ADD	HL,BC
;;	LD	A,(HL)
	CALL	LDTIM3
	CP	$1C
		ret	NC
;;;;;;;;	JR	NC,HTM010
;
	AND	A
	JP	Z,ENCLER
	AND	$01
	DEC	A
		jp	ENPTST
;;;;;;;;	CALL	ENPTST
;;;;;;;;HTM010
;;;;;;;;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	ルピー							%
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
RUPY1CD
	DB	$A6,$15
;
RUPY1MV
	CALL	ITCLCK	; In data set see thruu
;
	CALL	ITTIMCK
;
	LD	DE,RUPY1CD
	CALL	EN1CST
ITEMSUB
R1M020
	CALL	ENSTCK
;
	CALL	BUMECK
	CALL	CRITPL
;
;------------------------------------------
ENBDCL
	CALL	ENMVCL
	CALL	ENGCLC
;
	CALL	ENBGCK
;
	LD	A,(YKFLAG)
	AND	A
	JR	Z,EBD010
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	%00001000
	JP	Z,RP1M10
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	$F0
	ADD	A,$5
	LD	(HL),A
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	CPL
	SRA	A
	CP	$F8
	JR	C,RP1M08
	JR	EBD012
;
EBD010
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	$80
	JR	Z,RP1M10
;
	XOR	A
	LD	(HL),A
;
	LD	HL,ENWATR
	ADD	HL,BC
	LD	A,(HL)
;
	LD	HL,ENZSPD
	ADD	HL,BC
	CP	$02
	JR	Z,EBD012	; Asase in -> Not bounds !
	LD	A,(HL)
	SRA	A
	CPL
	CP	$07
	JR	NC,RP1M08
;
EBD012
	XOR	A
;
	PUSH	HL
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
;
	POP	HL
	JR	RP1M081
RP1M08
	PUSH	AF
	PUSH	HL
;
	LD	A,(ENMYNO2)
	CP	KEYSM
	JR	NZ,KYBD10
;
	LD	A,$17
	LD	(SOUND3),A	;(S)
	JR	RP1M080	
KYBD10
	CP	BOMBR
	JR	NZ,RP1M080
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,RP1M080
	CP	EFOLE
	JR	Z,RP1M080
;
	LD	A,$09
	LD	(SOUND1),A	;(S)バウンド音！
RP1M080
	POP	HL
	POP	AF
RP1M081
	LD	(HL),A
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	SRA	A
	CP	$FF
	JR	NZ,RP1M09
	XOR	A
RP1M09
	LD	(HL),A
;
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,RP1M10
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	SRA	A
	CP	$FF
	JR	NZ,RP1M0B
	XOR	A
RP1M0B
	LD	(HL),A
;
RP1M10
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
YOSEICD
	DB	$20,$21
	DB	$20,$01
;;	DB	$22,$00
;----------------------------
YOSEIMV
	CALL	ITCLCK	; In data set see thruu
;
	CALL	ITTIMCK
;
	LD	DE,YOSEICD
	CALL	EN1CST
YOM020
	CALL	ENSTCK
;
	CALL	BUMECK
	CALL	CRITPL
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	RLCA
	AND	$01
	CALL	ENPTST
;
	CALL	ENMVCL
	CALL	YOZCLC
	CALL	ENBGCK
;---------------------------
	CALL	EPXCHK
	LD	A,D
	BIT	7,A
	JR	Z,YI010
;	CPL
;	INC	A
YI010
	CP	$20
	JR	C,YMAIN
;
	CALL	EPYCHK
	LD	A,D
	BIT 	7,A
	JR	Z,YI020
;	CPL
;	INC	A
YI020
	CP	$20
	JR	NC,YEXIT
;---------------------------------------
YMAIN
;;	LD	HL,ENTIM0
;;	ADD	HL,BC
;;	LD	A,(HL)
	CALL	LDTIM0
;;	AND	A
		ret	NZ
;;;;;;;;	JR	NZ,YFIN
;
;;	LD	A,$30
	LD	(HL),$30 ;A
;
	CALL	RNDSUB
	AND	$0F
	SUB	$08
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
;
	CALL	RNDSUB
	AND	$0F
	SUB	$08
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
		ret
;;;;;;;;	JR	YFIN
;----Nigeru----------------------
YEXIT
	LD	A,$09
		jp	PSERCH ;2
;;;;;;;;	CALL	PSERCH ;2
;;;;;;;;YFIN
;;;;;;;;	RET
;============================================
YOZC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E,A
	LD	D,B ;$00
;
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	Z,ITEMGT ;RP1GET
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	BUMER
	JR	Z,BUCK10
	CP	FUCKS
	JR	NZ,ITEMGT
;
BUCK10
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	(HL),A
;
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	(HL),A
;
	XOR	A
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	(HL),A
;
RP1M06
	RET
;======================================
CRITPL
	CALL	LDTIM1
	JR	NZ,RP1M06
;
	LD	A,(ENMYNO2)
	SUB	HART1
	LD	E,A
	LD	D,B
	LD	HL,ITKNHIT
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	Z,CIP1000	;Item ken hit check ?
;				;Yes !
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	PUSH	AF
	PUSH	HL
	LD	(HL),B
	CALL	CRKNEN
	POP	HL
	POP	AF
	LD	(HL),A
;
CIP1000
	CALL	CRENPL
	JR	NC,RP1M06
;-------------------------------------------
ITEMGT		; Item get sub 
	LD	HL,ENJYUN
	ADD	HL,BC
	LD	A,(HL)
;
	CALL	ENDTON		;Bit on !
;
	LD	A,(ENMYNO2)
	SUB	HART1
;
	CP	$02
	JR	NC,ITGT00
;
	LD	HL,SOUND1	;(S)
	LD	(HL),$14
	JR	ITGT01
ITGT00
	LD	HL,SOUND2	;(S)
	LD	(HL),$01
ITGT01
	RST	00
itemgt_tbl
	DW	HART1GT
	DW	COIN1GT
	DW	YOSEIGT
	DW	KEYSMGT
	DW	PLTATGT
	DW	HMASKGT
	DW	POWERGT
	DW	KINOMGT
	DW	KAKERGT
	DW	HARTBGT
	DW	ALOW1GT
	DW	BOMB1GT
	DW	GAKKIGT
	DW	KINOKGT
	DW	MGPOWGT
	DW	KAKINGT 	;KAKIN->KAKERGT!!
	DW	KAIINGT
itemgt_end
;
itover		equ	(itemgt_end-itemgt_tbl)/2
;
;===========================
MGPOWGT
	LD	A,$0B
	LD	(CHTRF2),A
;
	LD	D,PMGIC
	CALL	ITEMGET
;
	LD	HL,PWMAX
	LD	DE,TUBOCT
;=======================================
MAXSUB
	LD	A,(DE)
	CP	(HL)
	JR	NC,MAXS10
	ADD	A,$01
	DAA
	LD	(DE),A
MAXS10
	RET
;
;===========================
KAIINGT	;貝殻
	LD	A,$EF
	CALL	MSGCHK
KAIINC
	CALL	SVDTST	; BIT ON !
;
	LD	HL,CLC20	;かいがら
;-----------------------------
IUPSUB
	LD	A,(HL)
	CP	$99
	JR	Z,IUP010
	ADD	A,$01
	DAA
	LD	(HL),A
IUP010
	RET
;===========================
ALOW1GT
	LD	HL,YAMAX
	LD	DE,YAAACT
	JR	MAXSUB
;
;===========================
BOMB1GT
	LD	D,PBOMB
	CALL	ITEMGET
;
	LD	HL,BOMAX
	LD	DE,BOMBCT
	JR	MAXSUB
;
;===========================
GAKKIGT
	XOR	A
	LD	(BSFLFG2),A
	LD	(FADEON),A
;
	LD	A,$1B
	LD	(SOUND4),A	;(S)
	LD	(ITEMNOT),A
;
GKFLSHST
	LD	A,(PLXPSL)
	PUSH	AF
	ADD	A,$04
	LD	(PLXPSL),A
	CALL	DEMOFLST
	POP	AF
	LD	(PLXPSL),A
	JR	JG0010
HARTBGT
	XOR	A
	LD	(POWRFG),A
;
	LD	A,$25
	LD	(SOUND4),A	;(S)
	LD	(BSFLFG2),A
	CALL	LDTIM0
;
	LD	A,$70
	LD	(HL),A
	LD	(ENSTTM),A
	JR	GTNEXT
KINOKGT	;キノコ
KAKINGT	;はっぱ
	LD	A,$10
	LD	(SOUND4),A	;(S)
	JR	JG0010
;- - - - -
JYANGET
	LD	A,$01
	LD	(SOUND1),A	;(S)
;
JG0010
	CALL	LDTIM0
;
	LD	A,$68
	LD	(HL),A
	LD	(ENSTTM),A
GTNEXT
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EMOVE
;
	JP	DUSHCL
;===========================
KAKERGT
	LD	A,$10
	LD	(SOUND4),A	;(S)
;
	CALL	STATINC
	JR	GTNEXT
;===========================
KPWFSXD
	DB	$E4,$14,$E4,$14
KPWFSYD
	DB	$D4,$D4,$04,$04
;- - - - - - - - - - - - - - -
KINOMGT
	LD	A,$02	;デフェンスアップ
	LD	E,$05
	JR	PWGT10
;- - - - - - - - - - - - - - -
POWERGT
	LD	A,$01	;剣パワーアップ
	LD	E,$01
PWGT10
	LD	(POWRFG),A
;;	LD	A,$01
	LD	A,E
	LD	(DEMOFG),A
	LD	A,$30
	LD	(DEMOTM),A
	LD	(ENSTTM),A
	XOR	A
	LD	(POWRCT),A
;
	LD	A,$27		;早く持ってきやがれ！
	LD	(SOUND4),A	;(S)
	LD	A,$49
	LD	(BGMNO2),A	;(S)
	LD	(TODYFG),A	;(S)
;-------------------------------------
DEMOFLST
	LD	E,$3
	LD	D,$00
PT0090
	PUSH	DE
;
	LD	HL,KPWFSXD
	ADD	HL,DE
	LD	A,(PLXPSL)
	ADD	A,(HL)
	LD	(WORK0),A
;
	LD	HL,KPWFSYD
	ADD	HL,DE
	LD	A,(PLYPSL)
	ADD	A,(HL)
	LD	(WORK1),A
;
	LD	A,KPWF
	CALL	EXIDSH
;
	LD	HL,EXTIM0
	ADD	HL,DE
	LD	(HL),$18+$A
;
	LD	HL,EXSTAT
	ADD	HL,DE
	POP	DE
	LD	(HL),E
;
	DEC	E
	LD	A,E
	CP	$FF
	JR	NZ,PT0090
;
HMASKGT
	RET
;===========================
PLTATGT
	LD	A,(KENLEV)
	AND	A
	JR	NZ,PTG0120	; 剣まだ持ってない？
;				； はい
;;	LD	A,$01
;;	LD	(SOUND1),A	;(S)
	LD	A,$0F
	LD	(SOUND4),A	;(S)
	LD	(ITEMNOT),A
;;	LD	(MSSDWT),A
	CALL  	GKFLSHST
	CALL	LDTIM0
	LD	(HL),$A0
;
	LD	A,$FF
	LD	(TODYFG),A	;(S)BGM復帰無し！
	RET
;
PTG0120
	LD	HL,ENWRK0	; ライクライクから返却！
	ADD	HL,BC
	LD	A,(HL)
	LD	(TATLEV),A
;
	LD	D,PTATE
;=====================================
ITEMGET
	LD	HL,ITEMB
	LD	E,$0C
PTG0E0
	LD	A,(HLI)
	CP	D
	JR	Z,PTG030	; Allready have ?
	DEC	E		
	JR	NZ,PTG0E0
;				; no
	LD	HL,ITEMB
PTG010
	LD	A,(HL)
	AND	A
	JR	NZ,PTG020
;
	LD	(HL),D  ;$4
	RET
PTG020
	INC	HL
	INC	E
	LD	A,E
	CP	$0C
	JR	NZ,PTG010
PTG030
	RET
;===========================
;- - - - - - - - - - - - - - - - - - -
KEYSMGT
	LD	A,(GRNDPT)
	CP	$80
		jr	z,KSG008_050	; ガイコツボス フックショット！
;;;11/06	JR	NZ,KSGT90	;ガイコツボス フックショット！
;;;11/06;
;;;11/06	LD	A,$10
;;;11/06	LD	(SOUND4),A	;(S)
;;;11/06	JP	JG0010
KSGT90
	LD	A,(GRNDPT)
	CP	$7C
	JR	NZ,KSG008
;
	LD	HL,DJRMSV+$69
	SET	4,(HL)
KSG008
	LD	A,(ENCHPT2)
	AND	A
	JR	Z,KSG010
;
KSG008_050
	LD	A,$10
	LD	(SOUND4),A	;(S)
	JP	JG0010
;
KSG010
	CALL	SVDTST	; Save bit on !
;
	LD	HL,SKEYF
	INC	(HL)	;Display count inc !
;
		jp	DJITRV	;Display buffer->Main buffer
;;;;;;;;	CALL	DJITRV	;Display buffer->Main buffer
;;;;;;;;;
;;;;;;;;	RET
;===========================
HART1GT
	LD	A,$8
HTUPSUB
	LD	HL,HARTUP
ADDHL
	ADD	A,(HL)  ;$8
	LD	(HL),A
	RET
;===========================
COIN1GT
	LD	A,$1
	LD	HL,COINU2
	JR	ADDHL
;===========================
YOSEIGT
	LD	A,48
	JR	HTUPSUB
;###############################################
;#					       #
;###############################################
ENIDSH
	LD	E,<ENNO-1
ENIDSH2
	PUSH	AF
;
	LD	D,$00
EISH10
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	Z,EISH20
	DEC	E
	LD	A,E
	CP	$FF
	JR	NZ,EISH10
;
	POP	AF
	SCF	; SEC
	RET
;
EISH20
;;;	LD	A,EMOVE
	LD	(HL),EMOVE ;A
	POP	AF
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK0),A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK1),A
;
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK2),A
;
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK3),A
;
	CALL	ENMDST2
;
	LD	HL,ENHNFG
	ADD	HL,DE
	LD	(HL),$01	; Fole check !
;
	LD	HL,ENXPSH
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENXPSH
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENYPSH
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENYPSH
	ADD	HL,DE
	LD	(HL),A
;
	SCF
	CCF	; CLC
	RET
;
;======================================
ENMDST2
	PUSH	BC
	PUSH	DE
;;10/31;	PUSH	DE
;;10/31;	POP	BC
		ld	c,e
		ld	b,d
	CALL	ENMDST
	POP	DE
	POP	BC
	RET
;==============================================
;###############################################
;#	PLAYER BOMBER			       #
;###############################################
BOMBRCD
	DB	$80,$15
BOMBKCD
;- -0 - -
	DB	$F8,$F8,$32,$01
	DB	$F8,$00,$32,$21
;
	DB	$F8,$08,$32,$01
	DB	$F8,$10,$32,$21
;
	DB	$08,$F8,$32,$01
	DB	$08,$00,$32,$21
;
	DB	$08,$08,$32,$01
	DB	$08,$10,$32,$21
;- -1 - -
	DB	$F8,$F8,$10,$02
	DB	$F8,$00,$12,$02
;
	DB	$F8,$08,$12,$22
	DB	$F8,$10,$10,$22
;
	DB	$08,$F8,$10,$42
	DB	$08,$00,$12,$42
;
	DB	$08,$08,$12,$62
	DB	$08,$10,$10,$62
;- -2 - -
	DB	$FC,$FC,$30,$11
	DB	$FC,$04,$30,$31
;
	DB	$FC,$04,$30,$11
	DB	$FC,$0C,$30,$31
;
	DB	$04,$FC,$30,$11
	DB	$04,$04,$30,$31
;
	DB	$04,$04,$30,$11
	DB	$04,$0C,$30,$31
;- -3 - -
	DB	$FC,$FC,$30,$01
	DB	$FC,$04,$30,$21
;
	DB	$FC,$04,$30,$01
	DB	$FC,$0C,$30,$21
;
	DB	$04,$FC,$30,$01
	DB	$04,$04,$30,$21
;
	DB	$04,$04,$30,$01
	DB	$04,$0C,$30,$21
;------------------------------------------
BOMBKCS
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	A,(HL)  ;ENCHPT2) ;HL)
	SLA	A
	SLA	A
	SLA	A
	SLA	A
	SLA	A
	LD	E,A
	LD	D,B ;$0
	LD	HL,BOMBKCD
	ADD	HL,DE
	LD	C,$8
;
		jp	ENOMST
;;;;;;;;	CALL	ENOMST
;;;;;;;;	RET
;;;;;;;;;
;=======================================
BBRCMD
	DB	0,0,0,0
	DB	0,0,0,0
	DB	1,1,1,1
	DB	1,1,1,1
	DB	2,2,2,2
	DB	3,3,3,3
;
BOMBRBK
	CALL	BBRCS
;
	CALL	ENSTCK
;
	CALL	LDTIM0
	AND	A
	JP	NZ,BBRK10
;
	JP	ENCLER
BBRK10
	LD	E,A
	LD	HL,ENWRK3
	ADD	HL,BC
	LD	A,(HL)
	CP	$4C
	LD	A,E
	JP	Z,BBRK20
;
	CP	$0E
	JR	C,BBRK11
;
	CP	$17
	JR	NC,BBRK11
;
	PUSH	AF
	SUB	$0E
	LD	E,A
	LD	D,B
;
	PUSH	DE
	CALL	BOBGCK2	; KUSA BREAK CHECK 
	POP	DE
	CALL	BOBGCK	; Kabe !!
	POP	AF
BBRK11
	CP	$12
	JR	NZ,BBRK20
;
	LD	HL,ENWRK3
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,BBRK111
;
	CALL	CRBOEN
	JR	BBRK12
;
BBRK111
	LD	A,(ENSVXL)
	LD	HL,PLXPSL
	SUB	(HL)
	ADD	A,$18
	CP	$30
	JR	NC,BBRK12
;
	LD	A,(ENSVYL)
	LD	HL,PLYPSL
	SUB	(HL)
	ADD	A,$18
	CP	$30
	JR	NC,BBRK12
;
	CALL	PLDMST2
;
	LD	HL,PLXSPD
	SLA	(HL)
	LD	HL,PLYSPD
	SLA	(HL)
BBRK12
	LD	A,$4
	LD	(OTOFLG),A	; Oto flag !
;
BBRK20
	RET
;============================================
BBRCS
	CALL	LDTIM0
	LD	E,A
	LD	D,B ;$0
	LD	HL,BBRCMD
	ADD	HL,DE
	LD	A,(HL)
	CALL	ENPTST
;
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	A,(HL)
	AND	%11110000
	OR	%00001000
	LD	(HL),A
;
	CALL	BOMBKCS
;
	LD	A,(DJFLAG)
	AND	A
	JR	Z,BRK100
;
		LD	A,(SBHR)
		CP	$4		; フェード中？
		RET	NZ		; ＹＥＳ
;
	LD	E,$E4
;
	LD	A,(SCRLFG)
	AND	A
	JR	NZ,BRK088
;
	CALL	LDTIM0
	AND	%00000100
	JR	Z,BRK088
;
	LD	E,$84
BRK088
	LD	HL,BGPFG
	LD	(HL),E
;
BRK100
	RET
;==============================================
BOMBRB1
	LD	DE,KEMRICD
	CALL	EN2CST
	CALL	ENSTCK
	RET
;==============================================
;	バクダン
;==============================================
BOMBRMV
	LD	A,(ENDSYP)
	ADD	A,$10
	CP	$90+$10
	JP	NC,ENCLER
;
	CALL	LDTIM0
	CP	$18
	JP	C,BOMBRBK
	JR	NZ,BBBB0
;
	DEC	(HL)
	CALL	BBSDST	;(S)
BBBB0
	LD	HL,BOMBFG
	INC	(HL)		; Bomb use count inc !
;
	CP	$22
	JR	C,BOMBRB1
;
	CP	$48
	JR	NZ,BBRM08
;
	LD	HL,ENFLSH
	ADD	HL,BC
;
	LD	(HL),$30 ;A
BBRM08
	CALL	BOMBRCS
;
	CALL	ERCHK	;りゅうさ？
;
	CALL	ENSTCK
;
	CALL	ENBDCL
;
	LD	HL,ENTIM2
	ADD	HL,BC
	LD	(HL),$FF
;- - Cach check - -
	CALL	LDTIM1
;
	LD	HL,ENWRK3
	ADD	HL,BC
	OR	(HL)
	JR	NZ,BSTP10
;
	LD	A,(ITEMB)
	CP	PBOMB
	JR	NZ,BST900	; Bulesret check !
;
	LD	A,(KEYA2)
	AND	%00100000
	JR	NZ,BST910
	JR	BSTP10
BST900
	LD	A,(ITEMA)
	CP	PBOMB
	JR	NZ,BSTP10
;
	LD	A,(KEYA2)
	AND	%00010000
	JR	Z,BSTP10
;
BST910
	CALL	CACHCK
BSTP10
TURCHK
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	%00000011
	JR	Z,BBRM80
;
	CALL	ENXTUR
BBRM80
	LD	A,(YKFLAG)
	AND	A
		ret	NZ
;;;;;;;;	JR	NZ,BBRM90
;
	LD	A,(HL)
	AND	%00001100
		ret	Z
;;;;;;;;	JR	Z,BBRM90
;
		jp	ENYTUR
;;;;;;;;	CALL	ENYTUR
;;;;;;;;BBRM90
;;;;;;;;	RET
;============================================
BOMBRCS
	LD	HL,ENDSYP
	INC	(HL)
	INC	(HL)
;
	LD	DE,BOMBRCD
	CALL	EN1CST
;
	JP	ENPSSV
;============================================
BBCKXD
	DB	$F8,$08,$18
	DB	$F8,$08,$18
	DB	$F8,$08,$18
BBCKYD
	DB	$F8,$F8,$F8
	DB	$08,$08,$08
	DB	$18,$18,$18
;
BBBRXP
	DB	$48,$48,$00,$90
BBBRYP
	DB	$00,$70,$38,$38
;	
BBBRUN
	DB	DBMUD 
	DB	DBMUD
	DB	DBMLR
	DB	DBMLR 
BBBRCD	; For danjyon
	DB	$72,$72,$73,$73
	DB	$04,$04,$04,$04		;壊れる縦の壁アトリビュート
	DB	$69,$79,$69,$79
	DB	$04,$04,$04,$04		;壊れる横の壁アトリビュート
BBBRCG	; For ground
	DB	$64,$66,$65,$67
BBBRCG_CGB	; For ground (CGB：フリップ使用)
		DB	$64,$66,$64,$66
BBBRSV
	DB	%00000100
	DB	%00001000
	DB	%00000010
	DB	%00000001
BBBRSV2
	DB	%00001000
	DB	%00000100
	DB	%00000001
	DB	%00000010
BBBRAD
	DB	$F8
	DB	$08
	DB	$FF
	DB	$01
BBGCDT
	DB	$72,$73,$73,$72
	DB	$00,$00,$00,$00		;アトリビュート
BBGXAD
	DB	$00,$10,$F0,$10
BBGYAD
	DB	$00,$00,$10,$00
;------------------------------------------
BOBGCK
	LD	A,(YKFLAG)
	AND	A
	JP	NZ,BOBCRT
;
;-- KABE BREAK CHECK - -
	PUSH	BC
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$08
;
	LD	HL,BBCKXD
	ADD	HL,DE
	ADD	A,(HL)
	AND	$F0
	LD	(OBJXP),A
	SWAP	A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	C,A
	LD	A,(HL)
	SUB	$10
	LD	HL,BBCKYD
	ADD	HL,DE
	ADD	A,(HL)
	AND	$F0
	LD	(OBJYP),A
	OR	C
	LD	C,A
;---------------------------------
	LD	B,$0
	LD	HL,BGUNDT+$11
	LD	A,H
	ADD	HL,BC
	LD	H,A
	LD	A,C
	LD	(ENHELP2),A
	LD	A,(HL)
	LD	(UNITNO),A
	LD	E,A
;
	CP	BOMG0
	JR	C,BBG310
	CP	BOMG3+1
	JR	NC,BBG310	; Big sekizoo ?
;				; yes !
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,BBG310
;
	LD	A,$02
	LD	(SOUND1),A	;(S)
;
	LD	A,(OBJYP)
	AND	$E0
	LD	(OBJYP),A
	LD	A,(OBJXP)
	AND	$E0
	LD	(OBJXP),A
;
		LD	A,:BOBGCK
		CALL	BBGBRST_SUB
;;;KK;;;	CALL	BBGBRST
;
	LD	A,C
	AND	$EE
	LD	C,A
;
	LD	HL,BGUNDT+$11
	ADD	HL,BC
	LD	A,STON2
	LD	(HLI),A
	LD	(HLD),A
;--------------------------------------------
;	らいおん岩（出現時：上）
;--------------------------------------------
		LD	A,$03|UNIT_TRAN_BIT
		CALL	Unit_change	; バンク２ユニット書き換え
		INC	HL
		LD	A,$03|UNIT_TRAN_BIT
		CALL	Unit_change	; バンク２ユニット書き換え
		DEC	HL
;--------------------------------------------
	LD	A,L
	ADD	A,$10
	LD	L,A
	LD	A,STON2
	LD	(HLI),A
	LD	(HL),A
	LD	(UNTATR),A
;--------------------------------------------
;	らいおん岩（出現時：下）
;--------------------------------------------
		LD	A,$03|UNIT_TRAN_BIT
		CALL	Unit_change	; バンク２ユニット書き換え
		DEC	HL
		LD	A,$03|UNIT_TRAN_BIT
		CALL	Unit_change	; バンク２ユニット書き換え
		INC	HL
;--------------------------------------------
;
	LD	C,$3
	LD	B,$00
BBG110
	CALL	BBBGSB
;
	LD	HL,BBGXAD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,OBJXP
	ADD	A,(HL)
	LD	(HL),A
	LD	HL,BBGYAD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,OBJYP
	ADD	A,(HL)
	LD	(HL),A
;
	DEC	C
	LD	A,C
	CP	$FF
	JR	NZ,BBG110
;
	JP	BBCK90
;- - - - - - - - - - - - - - - - - - - - -
BBBGSB
	LD	DE,BBGCDT
	JP	BBBGSV
;- - - - - - - - - - - - - - - - - - - - -
BBG310
	LD	A,(DJFLAG)
	LD	D,A
	CALL	BGCRRD
;-----------------------------------
	SUB	$99
	JP	C,BBCK90
	CP	$9D-$99
	JP	NC,BBCK90	; Hibi ware BG ?
;				; yes !
	LD	C,A
;
	LD	A,$02
	LD	(SOUND1),A	;(S)
;
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,BBGGRD	; Danjyon ?
;- - - -			; Yes !
	POP	BC
;
	LD	A,(ENHELP2)
	LD	E,A
	LD	D,B
	LD	HL,BGUNDT+$11
	ADD	HL,DE
	LD	A,ANA00
	LD	(HL),A
	LD	(UNTATR),A
;
;--------------------------------------------
;	爆弾壁壊れ＆入り口出現（出現時）
;--------------------------------------------
		LD	A,$03|UNIT_TRAN_BIT
		CALL	Unit_change	; バンク２ユニット書き換え
;--------------------------------------------
;
		LD	A,(CGBFLG)
		AND	A
		JR	Z,BBBGSB_100

		LD	DE,BBBRCG_CGB
		JR	BBBGSV
BBBGSB_100
	LD	DE,BBBRCG
;
BBBGSV
	PUSH	DE
;
	LD	HL,GRRMSV
	LD	A,(GRNDPT)
	LD	E,A
	LD	D,$00
	ADD	HL,DE
;
	LD	A,(HL)
	OR	%00000100
	LD	(HL),A
	LD	(DJSVBF),A	; Save data buffer set !
;
	JP	UNBGWT
;----------------------------------------
BBGGRD
	LD	HL,DJRMSV
	LD	A,(GRNDPT)
	LD	E,A
	LD	D,$00
	LD	A,(DNJNNO)
;
		CP	NEWDJ		;新ダンジョン？
		JR	NZ,BGBR10_PASS	;	NO --> BGBR10_PASS
		LD	HL,NEWDJRM	;新ダンジョンのセーブＲＡＭ
		JR	BGBR10
BGBR10_PASS
;
	CP	DJROOM2
	JR	NC,BGBR10
	CP	DJROOM
	JR	C,BGBR10
	INC	D
BGBR10
	ADD	HL,DE
		ld	e,l
		ld	d,h
;;10/31;	PUSH	HL
;;10/31;	POP	DE
;
	LD	HL,BBBRSV
	ADD	HL,BC
;
	LD	A,(DE)
	OR	(HL)
	LD	(DE),A
	LD	(DJSVBF),A	; Save data buffer set !
;- -For next room open - -
	LD	HL,BBBRAD
	ADD	HL,BC
	LD	A,(DNJNPT)
	ADD	A,(HL)
	LD	E,A
	LD	D,$0
	CALL	DJRMRD	; In bank 0 FOR BANK 9 DATA READ !
		ld	e,l
		ld	d,h
;;10/31;	PUSH	HL
;;10/31;	POP	DE
;
	LD	HL,BBBRSV2
	ADD	HL,BC
;
	LD	A,(DE)
	OR	(HL)
	LD	(DE),A
;====ダンジョン内部爆弾壊れる壁書き換え======
	LD	A,(OBJXP)
	SWAP	A
	AND	$0F
	LD	E,A
	LD	A,(OBJYP)
	AND	$F0
	OR	E
	LD	E,A
	LD	D,$00
;
	LD	HL,BGUNDT+$11
	ADD	HL,DE
;
		ld	e,l
		ld	d,h
;;10/31;	PUSH	HL
;;10/31;	POP	DE
;
	LD	HL,BBBRUN
	ADD	HL,BC
	LD	A,(HL)
	LD	(DE),A
	LD	(UNTATR),A
;
	LD	A,C
	AND	%00000010
	RLA
	RLA			;CGBで追加
	LD	C,A
	LD	HL,BBBRCD
	ADD	HL,BC
	POP	BC
	PUSH	HL
;
	JP	UNBGWT
;-----------------------------------
BBCK90
	POP	BC
;
BOBCRT
	RET
;
;;;KK;;;;==============================================
;;;KK;;;BSBXAD
;;;KK;;;	DB	$08,$18 ;,$18
;;;KK;;;	DB	$08,$18 ;,$18
;;;KK;;;BSBYAD
;;;KK;;;	DB	$10,$10 ;,$10
;;;KK;;;	DB	$20,$20 ;,$20
;;;KK;;;;- - - - - - - - - - - - - - - - - - - - -
;;;KK;;;BBGBRST
;;;KK;;;	PUSH	BC
;;;KK;;;;
;;;KK;;;	LD	C,$3
;;;KK;;;	LD	B,$0
;;;KK;;;BSB010
;;;KK;;;	LD	A,KTOBJ
;;;KK;;;	CALL	ENIDSH
;;;KK;;;	JR	C,BSB090
;;;KK;;;;
;;;KK;;;	LD	HL,ENTIM1
;;;KK;;;	ADD	HL,DE
;;;KK;;;	LD	(HL),$0F
;;;KK;;;;
;;;KK;;;	LD	A,(OBJXP)
;;;KK;;;	LD	HL,BSBXAD
;;;KK;;;	ADD	HL,BC
;;;KK;;;	ADD	A,(HL)
;;;KK;;;	LD	HL,ENXPSL
;;;KK;;;	ADD	HL,DE
;;;KK;;;	LD	(HL),A
;;;KK;;;;
;;;KK;;;	LD	A,(OBJYP)
;;;KK;;;	LD	HL,BSBYAD
;;;KK;;;	ADD	HL,BC
;;;KK;;;	ADD	A,(HL)
;;;KK;;;	LD	HL,WORK3
;;;KK;;;	SUB	(HL)
;;;KK;;;	LD	HL,ENYPSL
;;;KK;;;	ADD	HL,DE
;;;KK;;;	LD	(HL),A
;;;KK;;;;
;;;KK;;;	LD	HL,ENMOD0
;;;KK;;;	ADD	HL,DE
;;;KK;;;	LD	(HL),%11000100
;;;KK;;;;
;;;KK;;;BSB090
;;;KK;;;	DEC	C
;;;KK;;;	LD	A,C
;;;KK;;;	CP	$FF
;;;KK;;;	JR	NZ,BSB010
;;;KK;;;;
;;;KK;;;	POP	BC
;;;KK;;;;
;;;KK;;;	RET
;
;==============================================
BOBGXD
	DB	$F8,$08,$18
	DB	$F8,$08,$18
	DB	$F8,$08,$18
BOBGYD
	DB	$F8,$F8,$F8
	DB	$08,$08,$08
	DB	$18,$18,$18
;- - - - - - - - - - - - - - - - - - - -
BOBGCK2
	PUSH	BC
;
	LD	HL,BOBGXD
	ADD	HL,DE
	LD	A,(ENSVXL)
	ADD	A,(HL)
	SUB	$08
	AND	$F0
	LD	(OBJXP),A
;
	SWAP	A
	LD	C,A
;
	LD	HL,BOBGYD
	ADD	HL,DE
	LD	A,(ENDSYP)
	ADD	A,(HL)
	SUB	$10
	AND	$F0
	LD	(OBJYP),A
;
	OR	C
	LD	E,A
	LD	HL,BGUNDT+$11
	ADD	HL,DE
	LD	A,H
	CP	$D7
	JP	NZ,B2CK80
;
	LD	A,(DJFLAG)
	AND	A
	LD	A,(HL)
	LD	(UNITNO),A
	JR	NZ,B2CK033
;
	LD	(ENHELP2),A
	CP	KUSA2
	JR	Z,B2CK05
	CP	ANFLW
	JR	Z,B2CK05
	CP	FLW00
	JR	Z,B2CK05
	JP	B2CK80
B2CK033
	CP	DBOMB
	JP	NZ,B2CK80
;
	LD	HL,DJRMSV
	LD	A,(GRNDPT)
	LD	C,A
	LD	B,$00
	LD	A,(DNJNNO)
;
		CP	NEWDJ		;新ダンジョン？
		JR	NZ,B2CK334_PASS	;	NO --> B2CK334_PASS
		LD	HL,NEWDJRM	;新ダンジョンのセーブＲＡＭ
		JR	B2CK334
B2CK334_PASS
;
	CP	DJROOM2
	JR	NC,B2CK334
	CP	DJROOM
	JR	C,B2CK334
;
	INC	B
B2CK334
	ADD	HL,BC
	LD	A,(HL)
	OR	%01000000
	LD	(HL),A
	LD	(DJSVBF),A
B2CK05
	CALL	BG1CHG
;
;-- Kusa break --
	LD	A,KTOBJ
	CALL	ENIDSH
	JR	C,B2CK80
;
	XOR	A
	LD	(POWDRTM),A
;
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	A,(OBJXP)
	ADD	A,$8
	LD	(HL),A
;
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	A,(OBJYP)
	ADD	A,$10
	LD	(HL),A
;
	LD	HL,ENCHPT
	ADD	HL,DE
	LD	A,(DJFLAG)
	XOR	$01
	LD	(HL),A  ;$01  ;A
	LD	(ENCHPT2),A
;
	LD	A,(ENHELP2)
	CP	KUSA2
	JR	NZ,B2CK78
;
	LD	A,$FF
	LD	(HL),A  ;$01  ;A
	LD	(ENCHPT2),A
B2CK78
		ld	c,e
		ld	b,d
;;10/31;	PUSH	DE
;;10/31;	POP	BC
	CALL	KTFLST	
B2CK80
	POP	BC
B2CKF0
	RET
;###############################################
;#					       #
;###############################################
;===============================================
;=					       =
;===============================================
POWDRBD2
	DB	$6C,$74,$6D,$75
	DB	$00,$00,$00,$00
;TONDT2	
;	DB	$07,$06,$05
;;- - - - - - - - - - - - - -
;TOUROUOF2
;	LD	A,(TOURCT)
;	DEC	A
;	JR	TON0102
;TOUROUON2
;	LD	A,(TOURCT)
;	INC	A
;TON0102
;	LD	(TOURCT),A
;TRONSUB2
;	LD	E,A
;	LD	D,B
;	LD	HL,TONDT2
;	ADD	HL,DE
;	LD	A,(HL)
;
;	PUSH	BC
;;
;	CALL	TOURST
;;
;	POP	BC
;	RET
;==============================================
;	フックショットの頭
;==============================================
PRTBMCD
;;	DB	$A4,$00,$A4,$20
;;	DB	$A4,$10,$A4,$30
	DB	$36,$02,$36,$22
	DB	$36,$12,$36,$32
;- - - - - - - - - - - - - - - - - - - - -
PRTBMMV
	LD	HL,BUMEFG
	INC	(HL)
;
	LD	A,$A
	LD	(ATCKNO),A
	CALL	CRENEN
;
	LD	A,(FRCNT)
	RRA
	RRA
	RRA
	AND	%00000001
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	(HL),A
;
	CALL	LDTIM1
	JR	Z,PRT010
;
	DEC	A
	JP	Z,ENCLER
;
	LD	DE,ENFIRECD
	JP	EN2CST
PRT010
	LD	DE,PRTBMCD
	CALL	MYM002
;
	CALL	ENSTCK
;-----------------------------------
RODSUB
	LD	A,(DJFLAG)
	AND	A
	LD	A,(UNITNO)
	JR	Z,PRT076
;
	CP	DHIMI	;氷！
	JR	Z,PRT088
	JR	PRT090
;
PRT076
	CP	ANFLW
	JR	Z,PRT088
	CP	FLW00
	JR	NZ,PRT090
;
PRT088
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	(HL),B
;
;;	LD	HL,ENTIM1
;;	ADD	HL,BC
	CALL	LDTIM1
	LD	(HL),B
;
	LD	A,(ENHELP2)
	LD	E,A
	LD	D,B
;
	CALL	BG1CHG
;
	LD	A,(OBJXP)
	ADD	A,$08
	LD	(WORK0),A
	LD	A,(OBJYP)
	ADD	A,$10
	LD	(WORK1),A
;
	LD	A,HNSM
	CALL	EXIDSH
;
	LD	A,$13
	LD	(SOUND3),A	;(S)
;;	LD	A,$06
;;	LD	(SOUND1),A	;(S)
PRT090
	RET
;==============================================
;	オクタロックのタマ
;==============================================
OCTAMCD
	DB	$6C,$01,$6C,$21
	DB	$5C,$01,$5C,$21
OCTAMMV
	CALL	LDTIM0
	JR	NZ,OCTM01
;
	CALL	CRENPL2
OCTM01
	LD	DE,OCTAMCD
	JP	MYM002
;==============================================
;	矢じゃねーか！
;==============================================
PYAAAMV
	LD	HL,BUMEFG
	INC	(HL)
;
	LD	A,(ENSTAT2)
	AND	A
	JR	NZ,BMYAAMV	; Bomber alow ?
;				; No
	CALL	LDTIM0
	JP	NZ,MYM001
;
	LD	A,$5
	LD	(ATCKNO),A
	CALL	CRENEN
	CALL	MYM001
;
	LD	A,(ENCHPT2)
	CP	$02
		ret	NZ		;上向き？
;;;;;;;;	JR	NZ,PYAM10	;上向き？
;				;YES !
	LD	A,(NAZOFG)
	AND	$1F
	CP	$0F
		ret	NZ		;メダマンは矢に弱い謎？
;;;;;;;;	JR	NZ,PYAM10	;メダマンは矢に弱い謎？
;				;YES !
	LD	A,(UNITNO)
	CP	DKNHT
		ret	NZ
;;;;;;;;	JR	NZ,PYAM10
;
	CALL	NAZOCLR	;(S)
;
		jp	ENCLER
;;;;;;;;	CALL	ENCLER
;;;;;;;;PYAM10
;;;;;;;;	RET
;==============================================
BMYAACD
	DB	$80,$15
BMYAXD
	DB	$04,$FC,$00,$00
BMYAYD
	DB	$FE,$FE,$FA,$04
;
BMYAAMV
	CALL	LDTIM0
	JR	Z,BMYA70
;
	LD	A,BOMBR
	CALL	ENIDSH
	JR	C,BMYA68
;
	LD	A,(WORK0)
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENTIM0
	ADD	HL,DE
	LD	(HL),$17
;
;;	LD	A,$0C
;;	LD	(SOUND3),A	;(S)
	CALL	BBSDST	;(S)
BMYA68
	JP	ENCLER
;
BMYA70
	LD	A,(ENCHPT2)
	PUSH	AF
	LD	E,A
	LD	D,B
	XOR	A
	LD	(ENCHPT2),A
;
	LD	HL,BMYAXD
	ADD	HL,DE
	LD	A,(ENSVXL)
	ADD	A,(HL)
	LD	(ENSVXL),A
	LD	HL,BMYAYD
	ADD	HL,DE
	LD	A,(ENDSYP)
	ADD	A,(HL)
	LD	(ENDSYP),A
;
	LD	DE,BMYAACD
	CALL	EN1CST
;
	CALL	ENPSSV
;
	POP	AF
	LD	(ENCHPT2),A
;
	LD	DE,MORYACD
	CALL	EN2CST
;
	LD	A,$C
	LD	(ATCKNO),A
	CALL	CRENEN
;
	JR	MYM003
;==============================================
MORYAMV
	CALL	LDTIM0
	JR	NZ,MYM001
;
	CALL	CRENPL2
MYM001
	LD	DE,MORYACD
MYM002
	CALL	EN2CST
;
MYM003
	CALL	ENSTCK
;
	CALL	LDTIM0
	JR	NZ,MYM030
;
	CALL	ENMVCL
	CALL	ENBGCK2
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,MYM010
;
	CALL	LDTIM0
;
	LD	A,(ENMYNO2)
	CP	PRTBM
	JR	NZ,MYM012
;========================================
PRTBMED
	CALL	LDTIM1
	LD	(HL),$30  ;50
	RET
;========================================
MYM012
	LD	(HL),$18 ;A
;
	LD	HL,ENZSPD
	ADD	HL,BC
	LD	(HL),$10 ;A
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	INC	A
	JR	Z,MYM1112	;FF:Tate hit !!
;				
	LD	A,$07		; BG hit !!
	LD	(SOUND1),A	;(S)
MYM1112
	CALL	OTOSET
;
	LD	A,(ENMYNO2)
	CP	PYAAA
	JR	NZ,ENXYTR
;-----------------------------------
ENXYT2
	CALL	ENYTU2
ENXTU2
	LD	HL,ENXSPD
TRSUB2
	ADD	HL,BC
	LD	A,(HL)
	CPL
	INC	A
	SRA	A
	SRA	A
	LD	(HL),A
	RET
;------------------------------------
ENYTU2
	LD	HL,ENYSPD
	JR	TRSUB2
;------------------------------------
ENXYTR
	CALL	ENYTUR
ENXTUR
	LD	HL,ENXSPD
TRSUB
	ADD	HL,BC
	LD	A,(HL)
	CPL
	INC	A
	SRA	A
	SRA	A
	SRA	A
	LD	(HL),A
MYM010
	RET
;------------------------------------
ENYTUR
	LD	HL,ENYSPD
	JR	TRSUB
;------------------------------------
MYSPDT
	DB	0,3,1,2
;
MYM030
	CP	$01
	JR	NZ,MYM035
MYM033
	JP	ENCLER
MYM035
	LD	A,(ENMYNO2)
	CP	OCTAM
	JR	Z,MYM037
;
	CALL	LDTIM0
	SRL	A
	SRL	A
	SRL	A
	AND	$03
	LD	E,A
	LD	D,B ;$00
	LD	HL,MYSPDT
	ADD	HL,DE
	LD	A,(HL)
	CALL	ENPTST
MYM037
	CALL	ENMVCL
	JR	ENGCLC
;=====================================
ENGDAT
;;		Nrm Dep Srw Ksa
	DB	$02,$01,$02,$02
ENGMXD
	DB	$40,$08,$40,$40
;--------------------------------------
ENGCLC
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,EGC010
;
	CALL	ENZCLC
;
	LD	HL,ENZSPD
	ADD	HL,BC
	LD	A,(HL)
	SUB	$2
	LD	(HL),A
	RET
EGC010
	LD	HL,ENWATR
	ADD	HL,BC
	LD	A,(HL)
	LD	E,A
	LD	D,B
;
	AND	A
	JR	Z,EGC012
;
	LD	A,(FRCNT)
	AND	$07
	JR	NZ,EGC012
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,EGC012
;
	AND	%10000000
	JR	Z,EGC011
;
	INC	(HL)
	INC	(HL)
EGC011
	DEC	(HL)
EGC012
	LD	HL,ENGDAT
	ADD	HL,DE
	LD	A,(HL)
;
	LD	HL,ENYSPD
	ADD	HL,BC
	ADD	A,(HL)
	LD	(HL),A
;
	LD	HL,ENGMXD
	ADD	HL,DE
	SUB	(HL)
	AND	%10000000
	JR	NZ,EGC020
;
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
EGC020
	RET
;===============================================
MORYACD
	DB	$2E,$21,$2C,$21
	DB	$2C,$01,$2E,$01
	DB	$2A,$41,$2A,$61
	DB	$2A,$01,$2A,$21
;
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CPMKCK
	DB	$1,$0,$3,$2
R7BCKD
	DB	$2 ;,$3,$4,$5,$6
	DB	$A ;,$B,$C,$D,$E
	DB	$E ;,$F,$0,$1,$2
	DB	$6 ;,$7,$8,$9,$A
;----------------------------------------
CRENPL2		; Small size hit 
	LD	A,(PLMODE)
	CP	PTOBI
	JR	NC,CEPRET
;
	LD	A,(PLZPSL)
	AND	A
	JR	NZ,CEPRET
;
	LD	HL,ENSVXL
	LD	A,(PLXPSL)
	SUB	(HL)
	ADD	A,$06
	CP	$0C
	JR	NC,CEPRET
;
	LD	HL,ENDSYP
	LD	A,(PLYPSL)
	SUB	(HL)
	ADD	A,$06
	CP	$0C
	JR	NC,CEPRET
;
	LD	A,(TATEON)
	AND	A
	JR	Z,CEP0E0	; Seeld with ?
;				; yes !
	LD	A,(ENMYNO2)
	CP	R7BEM
	JR	NZ,CEP0D2
;
	LD	A,(TATLEV)
	CP	$02
	JR	C,CEP0E0
;
	LD	A,(PLCMKI)
	LD	E,A
	LD	D,B
	LD	HL,R7BCKD
	ADD	HL,DE
	LD	E,(HL)
;
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	A,(HL)
	SUB	E
	AND	$0F
	CP	$05
	JR	NC,CEP0E0
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	(HL),$02 ;Hanekairi
;
	LD	A,$07
	LD	(SOUND1),A	;(S)
;
	LD	A,(ENSVYL)
EKFLSHS
	LD	(WORK1),A
;
	LD	A,(ENSVXL)
	LD	(WORK0),A
;
	LD	A,FLSH
		jp	EXIDSH
;;;;;;;;	CALL	EXIDSH
;;;;;;;;;
;;;;;;;;	RET
;
CEP0D2
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	E,(HL)
	LD	D,B ;$00
;
	LD	HL,CPMKCK
	ADD	HL,DE
	LD	A,(PLCMKI)
	CP	(HL)
	JR	NZ,CEP0E0	; muki -> seeld ?
;				; yes !
	LD	A,$16
	LD	(SOUND1),A	;(S)
CEP0D8
CBFGON
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	(HL),$FF ;A
CEPRET
	RET
CEP0E0
	CALL	CEP000
;
	LD	A,(ENMYNO2)
	CP	R7BEM
	JR	Z,CEP0EC
	CP	MORYA
	JR	NZ,CEP0D8
CEP0EC
	JP	ENCLER
;=====================================
CRENPL
	LD	A,(FRCNT)
	XOR	C
	RRA
	JP	NC,CEP010
;
CRENPLF
	LD	A,(PLZPSL)
	AND	A
	JR	NZ,CEPRET
;
CRENPS
	LD	A,(PLMODE)
	CP	PTOBI
	JR	NC,CEPRET
;- - X check - -
	PUSH	BC
;
	SLA	C
	SLA	C
	LD	HL,ENOJSZ
	ADD	HL,BC
;
	POP	BC
;
	LD	A,(ENSVXL)
	ADD	A,(HL)
	PUSH	HL
	LD	HL,PLXPSL
	SUB	(HL)
	SUB	$08
	CP	$80
	JR	C,CEP00C
;
	CPL
	INC	A
CEP00C
	POP	HL
	PUSH	AF
;
	INC	HL
	LD	A,$04
	ADD	A,(HL)
	LD	E,A
	POP	AF
	CP	E
	JP	NC,CEP010
;
	INC	HL
;- - Y check - -
	LD	A,(ENDSYP)
	ADD	A,(HL)
	PUSH	HL
	LD	HL,PLYPSL
	SUB	(HL)
	SUB	$08
	CP	$80
	JR	C,CEP00E
;
	CPL
	INC	A
CEP00E
	POP	HL
	PUSH	AF
;
	INC	HL
	LD	A,$04
	ADD	A,(HL)
	LD	E,A
	POP	AF
	CP	E
	JR	NC,CEP010
;;----------------------------------------
CEP000
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	A,(HL)
	AND	%10000000
	JR	Z,CEP008	; Only hit ?
;				; yes !
CEPSCF
	SCF
	RET
CEP010
	AND	A	;CLC
	RET
CEP008
	LD	A,(PLCHPT)
	SUB	$4E
	CP	$4F-$4E+1
	JR	C,CEPSCF
;- - - - - - - - - - - - - - - - - - - - - - -
PLDMST2
	LD	A,(ENMYNO2)
	CP	PUKPJ
	JR	NZ,PDS2100
;
	CALL	EPYCHK
	LD	A,E
	CP	$02
	JR	NZ,PLD201
;
	CALL	STATINC
	LD	(HL),$05
;
	LD	A,$02
	LD	(PLJPFG),A
	LD	A,$F0
	LD	(PLYSPD),A
;
	CALL	ENSDCL
;
	LD	A,$0E
	LD	(SOUND2),A	;(S)
	RET
;- - - - - - - - - - - - - - - - - - - - - - - - -
PDS2100
	LD	A,(ENMYNO2)
	CP	KURI0
	JR	NZ,PLD201	;クリボー上から踏む！
;
	LD	A,(PLJPFG)
	AND	A
	JR	Z,PLD201
;
	LD	A,(PLTIM0)
	AND	A
	JR	NZ,KURCR0C	;踏んだ瞬間？
;				;NO!
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,KURCR08
;
	LD	A,(PLZSPD)
	XOR	%10000000
	JR	KURCR0A
;
KURCR08
	LD	A,(PLYSPD)
KURCR0A
	AND	%10000000
	JR	NZ,PLD201
;
KURCR0C
	LD	A,$02
	LD	(PLTIM0),A
;
	LD	HL,ENSTAT
	ADD	HL,BC
	LD	(HL),$02
;
	CALL	LDTIM0
	LD	(HL),$30
;
	LD	A,$0E
	LD	(SOUND2),A	;(S)
;
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,KURCR10
;
	LD	A,$10
	LD	(PLZSPD),A
	RET
;
KURCR10
	LD	A,$F0
	LD	(PLYSPD),A
	RET
PLD201
	LD	A,(ENMYNO2)
	CP	SLIMS
	JR	NZ,PLD210	;小スライム？
;				;yes !
	CALL	LDTIM0		;ひっつき！
	LD	(HL),$80
;
	CALL	STATINC
	LD	(HL),$04
	RET
PLD210
	CP	MIZUB
	JR	Z,PDS0112	;オバＱバーは
	CP	OBQBAR
	JR	Z,PDS0112	;オバＱバーは
;				;楯にめりこんでもダメージ！
	LD	A,(HANEFG)
	AND	A
	JP	NZ,CEP010F
;
PDS0112
	LD	A,(ENMYNO2)
	CP	MBOSS
	JR	NZ,PDS0113
;
	LD	A,(ENSTAT2)
	CP	$04	;突撃？
	JR	NZ,PDS0113
;
	CALL	STATINC
	LD	(HL),$08
;
	LD	A,$03
	LD	(SOUND2),A	;(S)
	RET
;
PDS0113
	LD	A,(PLFLSH)
	LD	HL,MUTEKI
	OR	(HL)
	LD	HL,OKARFG
	OR	(HL)
	LD	HL,DEMOFG
	OR	(HL)
	JP	NZ,CEP010F
;===========================================
PLDMST
	LD	A,$03
	LD	(SOUND2),A	;(S)
;
	LD	HL,ENMOD2
	ADD	HL,BC
	LD	D,B
	LD	E,(HL)
;
	LD	HL,ATCKDT
	ADD	HL,DE
	LD	E,(HL)
;
		LD	A,(CLOTHFG)
		CP	$002		;ダメージ軽減？
		JR	Z,HTDS08	;	YES --> HTDS08
;
	LD	A,(POWRFG)
	CP	$02
	JR	NZ,HTDS10
;
	LD	A,E
	CP	$04
	JR	NZ,HTDS08
;
	LD	E,$00
HTDS08
	SRL	E	; 1/2
HTDS10
	LD	A,(HARTDW)
	ADD	A,E
	LD	(HARTDW),A
;
	LD	A,$50
	LD	(PLFLSH),A
;
	XOR	A
	LD	(ENFLCT2),A	;守りの木のみセットカウントリセット！
;
	LD	A,(POWRFG)
	AND	A
	JR	Z,PDSS12
;
	LD	HL,POWRCT
	INC	(HL)
	LD	A,(HL)
	CP	$03
	JR	C,PDSS12	; Power up cip count !
;				; 3 times fail ?
	XOR	A		; yes ! Power up reset
	LD	(POWRFG),A
;
	LD	A,(BOSSFG)
	AND	A
	JR	NZ,PDSS12	;ボス部屋？
;				;No!
	LD	A,(BGMNO)	;BGM復帰！
	CP	$22
	JR	Z,PDSS11	;フクロウBGM?
;				;NO!
	LD	(SOUND4),A	;(S)
PDSS11
	LD	(TODYFG),A	;(S)
PDSS12
;------------------------------
PLHNST
	CALL	DUSHCL2
;
	LD	A,$10
	LD	(HANEFG),A
;
	LD	A,(ENMYNO2)
	LD	E,$18
	CP	OBQBAR
	JP	Z,OBQHNST
	CP	BGKAO
	JR	NZ,PHS002
;
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	(HL),$1
PHS002
	CP	HAYAB
	LD	A,$14
	JR	NZ,PDS010
;
	LD	A,$18
PDS010
	CALL	PSHST
;
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,CEP00F
;
CEP010F
	SCF
	RET
;----------------------------
PLYKHX
	DB	$0C,$F4
;- - - - - - - - - - - - - - -
CEP00F
	LD	A,(PLSTAT)
	CP	$02
	JR	Z,CEP010F	; In water -> Normal hanekairi
;
	CALL	EPXCHK
	LD	D,B
	LD	HL,PLYKHX
	ADD	HL,DE
	LD	A,(HL)
	LD	(PLXSPD),A
;
	LD	A,$F4
	LD	(PLYSPD),A
;
	XOR	A
	LD	(PLSTAT),A
;
	SCF
	RET
;================================================
CREPKE
	CALL	CRENPL
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;- - - - - - - - - - - - - - - - - -
CRKNEN
	LD	A,(PKCRX1)
	CP	$00
	JP	Z,CKP090
;
	LD	HL,ENFLSH
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,CKP0010
;
	CP	$18
	JP	C,CKP090
CKP0010
	LD	A,(KENOFF)
	AND	A
	JR	Z,CKP0020
;
	DEC	A
	CP	C
	JP	Z,CKP090	; Renzoku Hit?
;				; no
CKP0020
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JP	NZ,CKP090
;- - X check - -
	LD	DE,ENSVXL
;
	PUSH	BC
;
	SLA	C
	SLA	C
	LD	HL,ENOJSZ
	ADD	HL,BC
;
	POP	BC
;
	LD	A,(DE)
	ADD	A,(HL)
	PUSH	HL
	LD	HL,PKCRX1
	SUB	(HL)
	CP	$80
	JR	C,CKP020
;
	CPL
	INC	A
CKP020
	POP	HL
	PUSH	AF
;
	INC	HL
	LD	A,(PKCRX2)
	ADD	A,(HL)
	LD	E,A
	POP	AF
	CP	E
	JP	NC,CKP090
;
	INC	HL
;- - Y check - -
	PUSH	HL
;
	LD	DE,ENDSYP
;
	POP	HL
;
	LD	A,(DE)
	ADD	A,(HL)
	PUSH	HL
	LD	HL,PKCRY1
	SUB	(HL)
	CP	$80
	JR	C,CKP030
;
	CPL
	INC	A
CKP030
	POP	HL
	PUSH	AF
;
	INC	HL
	LD	A,(PKCRY2)
	ADD	A,(HL)
	LD	E,A
	POP	AF
	CP	E
	JP	NC,CKP090
;
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	A,(HL)
	AND	%00100000
	JP	NZ,ITEMGT
;
	LD	A,(KENTAT)
	AND	A
	JP	NZ,KNCROS
;- - Tate atack ----
ENHNST2
	LD	A,(DUSHFG)
	LD	(ENHELP2),A
	CALL	DUSHCL2
;
	LD	A,(ENMYNO2)
	CP	HODAI
	JR	NZ,EHS21010
;
	LD	A,(TATLEV)
	CP	$02
	RET	NZ
;
	LD	A,(PLCMKI)
	CP	$02
	RET	NZ
;
	LD	A,$04
	LD	(PLYSPD),A
;
	LD	A,$08
	LD	(HANEFG),A
;
	JP	STATINC
EHS21010
	CP	SBOMB
	JR	NZ,SBCR10
;
	LD	A,(ENSTAT2)
	CP	$02
	JP	NZ,EHS210
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	CPL
	INC	A
	LD	(HL),A
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	CPL
	INC	A
	LD	(HL),A
;
	CALL	LDTIM0
	LD	(HL),$40
;
	CALL	LDTIM1
	LD	(HL),$08
;
	RET
;- - - - - - - - - - - - - - - - -
SBCR10
	CP	TEKYU
	JR	NZ,TYCR10
;
	LD	HL,ENMOD3
	ADD	HL,BC
	AND	%01000000
	JP	Z,EHS210  ; Tekkyu hit ?
;				; yes !
TYCR90
	LD	HL,ENWRK0	; Chane speed turn !
	ADD	HL,BC
	LD	A,(HL)
	CPL
	INC	A
	LD	(HL),A
;
	CALL	EHS201 ; Only player hanekairi !
;
	CALL	LDTIM1
	LD	(HL),$0C
;
	LD	A,$1
	LD	(PCUTOF),A
;
	XOR	A
	LD	(SPCTWT),A
;
	JP	EFLSST
;=============================================
TYCR10
	CP	NINTM
	JR	NZ,NTCR11
;
TYCR11
	CALL	EHS210
	JP	CBFGON
;
NTCR11
	CP	INOSI
	JR	NZ,EHS200
;
	LD	HL,ENSTAT
	ADD	HL,BC
	LD	A,(HL)
	CP	$03
	JR	Z,EHS201
;
	LD	(HL),$03
;
	LD	HL,ENZSPD
	ADD	HL,BC
	LD	(HL),$20
;
	CALL	LDTIM0
	LD	(HL),$FF
;
	LD	A,(PLCMKI)
	LD	E,A
	LD	D,B
	LD	HL,INHNXS
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
	LD	HL,INHNYS
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
EHS201
	CALL	EHS210
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),B
	RET
;=====================================
INHNXS
	DB	$10,$F0,$00,$00
INHNYS
	DB	$00,$00,$F0,$10
;- - - - - - - - - - - - - - - - - - - - -
EHS200	
	CP	BALEE
	JR	Z,TATMKT	; Balelina !!
	CP	BABUL
	JR	NZ,EHS208	; Babul !!
TATMKT
;-------楯はねかえり向き反転------
;
	LD	A,(PLCMKI)
	AND	$02
	JR	NZ,BAC008
;
	LD	HL,ENXSPD
	ADD	HL,BC
	JR	BAC010
BAC008
	LD	HL,ENYSPD
	ADD	HL,BC
BAC010
	LD	A,(HL)
	CPL	
	INC	A
	LD	(HL),A
;
	CALL	EHS210
;
	LD	(HL),B
	RET
;
;====================================
EHS208
	CP	BGKAO
	JP	Z,TYCR11
;
EHS210
	LD	A,$09
	LD	(SOUND1),A	;(S)
;
	CALL	DUSHCL2
;
	LD	A,$0C
	LD	(HANEFG),A
;
	LD	A,(ENMYNO2)
	CP	OBQBAR
	JR	NZ,EHS180
;
	LD	E,$10
;---------------------------------
OBQHNST
	PUSH	DE
	CALL	EPXCHK
	LD	A,E
	AND	A
	POP	DE
	LD	A,E
	JR	Z,EHS170
	CPL
	INC	A
EHS170
	LD	(PLXSPD),A
	XOR	A
	LD	(PLYSPD),A
	RET
;
EHS180
	LD	A,$12
	CALL	PSHST
;
	LD	HL,ENHELP2	;DUSHFG save!
;
	LD	A,(KEYA1)
	AND	$0F
	LD	A,$08
	OR	(HL)
	JR	Z,EHS181	;キーが入ってれば強く跳ね返る！
	LD	A,$20
EHS181
;---------------------------------
ENHNST
	CALL	PSERCH2
;
	LD	A,(WORK0)
	CPL
	INC	A
	LD	HL,ENHNYS
	ADD	HL,BC
	LD	(HL),A
;
	LD	A,(WORK1)
	CPL
	INC	A
	LD	HL,ENHNXS
	ADD	HL,BC
	LD	(HL),A
;
		jp	ENDMST4
;;;;;;;;	CALL	ENDMST4
;;;;;;;;KNCRRT
;;;;;;;;	RET
;-------------------------------------
HPMKCK
	DB	$00,$01,$02,$03
;;	DB	$01,$00,$03,$02
KNCROS
	LD	A,(ENMYNO2)
	CP	HODAI
	RET	Z
	CP	BOSS	;ラストボス！
	JR	NZ,KCR0B90
;
	LD	A,(BOSSNO)
	RST	00
	DW	ENRET2
	DW	AMBCR	;アメーバ？
	DW	AGNCR	;アグニム
	DW	BHBCR	;ハヤムシ
	DW	GANCR	;ガノン
	DW	KCR0S00 ;BGRCR	;ゴーマ
;===============================================
AMBCR
	CALL	STATINC		;YES !
	LD	(HL),$06
	RET
;===============================================
AGNCR
	LD	A,(SPCTTM)
	AND	A
	JR	NZ,AGNCR10
;
	LD	A,(WCUTFG)
	CP	$04
	RET	NC
;
AGNCR10
		jp	STATINC
;;;;;;;;	CALL	STATINC
;;;;;;;;	RET
;===============================================
GANCR
;===============================================
BHBCR
	LD	A,(ENMYNO2)
;================================================
KCR0B90
	CP	NYOROO
	JR	NZ,KCR0S00
;
	LD	A,(ENMODE2)
	CP	EMOVE
	JR	NZ,KCR0S00
;
	CALL	STATINC
	LD	(HL),$01
;
	CALL	LDTIM0
	LD	(HL),$40
	LD	A,$40
	LD	(NYOTIM),A
;
	XOR	A
	LD	(PCUTFG),A
	LD	(WCUTFG),A
	LD	(SPCTTM),A
;
	LD	A,$1C
	LD	(SOUND3),A	;(S)
;
	JP	PLDMST2	
;
KCR0S00
	LD	A,(ENMYNO2)
	CP	SBOMB
	JR	NZ,KCR0F0
;
	LD	A,$30
	CALL	PSERCH2
;
	LD	A,(WORK0)
	CPL
	INC	A
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
;
	LD	A,(WORK1)
	CPL
	INC	A
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
;
	CALL	STATINC
	LD	(HL),$02
;
	CALL	LDTIM0
	LD	(HL),$40
;
	CALL	LDTIM1
	LD	(HL),$08
;
	RET
;=======================================
KCR0F0
	CP	BFISH
	JR	NZ,KCRF01
;
	CALL	PLHNST
;
	LD	A,$08
	LD	(HANEFG),A	; 1/2 power 
	JR	KCR0F1
KCRF01
	CP	BSLIM
	JR	NZ,KCR0F1
;
	LD	A,(ENHELP)
	AND	A
	JR	NZ,KCR0F2	; Body hit ?
;
	LD	HL,ENWRK0
	ADD	HL,BC
	LD	A,(HL)
	CP	$04
	JP	NZ,KCR0F3	; Chance ?
;				; yes !
	LD	A,(DUSHFG)
	AND	A
	JR	Z,KCR000	; Player dush ?
;				; yes !
	LD	HL,ENTIM2	; 分身
	ADD	HL,BC
	LD	(HL),$0C
	RET
;
KCR0F3
	LD	A,(DUSHFG)
	AND	A
	JR	Z,KCRF33	; Player dush ?
;
	CALL	PLHNST
	JP	KCR000
;
KCR0F2
		jp	PLHNST
;;;;;;;;	CALL	PLHNST
;;;;;;;;	RET
KCRF33
	LD	A,$04
	LD	(HANEFG),A
;
	LD	A,$10
	CALL	PSHST
	JP	KCR000
;
;				; 
KCR0F1
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%01000000
	JR	Z,KCR000	; Ken hanekairi ?
;				; yes !
	LD	A,(ENMYNO2)
	CP	TEKYU
	JP	Z,TYCR90
;
	CP	TBOSS
	JR	NZ,KCR0F21
;
		LD	A,(CLOTHFG)
		CP	$001		;攻撃力ＵＰ？
		JR	Z,KCR0F18	;	YES --> KCR0F18
;
	LD	A,(POWRFG)
	CP	$01
	LD	A,$20
	JR	NZ,KCR0F20
KCR0F18
	LD	A,$30
KCR0F20
	CALL	ENHNST
;
	LD	HL,ENFLSH
	ADD	HL,BC
	LD	(HL),B
KCR0F21
	LD	A,C
	INC	A
	LD	(KENOFF),A	; ONLY 1 COUNT CHECK !!
;
	CALL	KNFLSH
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),$10	; Ken protect !!
;
	LD	HL,ENHNXS
	ADD	HL,BC
	LD	(HL),B
	LD	HL,ENHNYS
	ADD	HL,BC
	LD	(HL),B
;
	JP	PLHNST
;
;- - - - - - - - - - - - - - -
KCR000
;- - Ken Enemy damege - - 
	LD	A,(ENMYNO2)
	CP	MIZUB
	JR	NZ,CKPMIZ
;
	CALL	DUSHCL2
	JR	CKP012
CKPMIZ
	CP	HIPLP
	JR	NZ,CKP011
;
	LD	HL,ENWRK1
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,CKP011
;
	LD	A,(PLCMKI)
	LD	E,A
	LD	D,B
	LD	HL,HPMKCK
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENMUKI
	ADD	HL,BC
	CP	(HL)
	JR	Z,CKP012	; Mukai awase ?
;				; yes !
	CALL	DUSHCL2
	LD	A,$10
	LD	(HANEFG),A
;
	LD	A,$10
	CALL	PSHST
;
	LD	A,$10
	CALL	ENHNST
;
EFLSST
	LD	A,(ENSVXL)
	LD	(WORK0),A
	LD	A,(ENDSYP)
	LD	(WORK1),A
		jp	FLASHST
;;;;;;;;	CALL	FLASHST
;;;;;;;;	RET
;- - - - - - - - - - - - - - - - - - - - -
CKP011
	LD	A,(ENMYNO2)
	CP	BABUL
	JP	Z,CKP090
;
CKP012
	LD	A,$1
	LD	(PCUTOF),A
;
	LD	A,(WCUTFG)
	CP	$04+1
	JR	NZ,KNCR09	; Kamae ?
;
	LD	A,CARITMD
	LD	(CARITM),A	; ken chari time set !
KNCR09
	XOR	A
	LD	(SPCTWT),A
;
	LD	A,$30
	CALL	ENHNST
;
	LD	HL,SOUND1	;(S)
	LD	(HL),$09	;ダメージがないときのための音！
;
		LD	A,(CLOTHFG)
		CP	$001		;攻撃力ＵＰ？
		JR	Z,KNCR10	;	YES --> KNCR10
;
	LD	A,(POWRFG)
	CP	$01
	JR	NZ,KNCR019	; Ken power up ?
;				; yes !
KNCR10
	CALL	KNCR019
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),$20
;
	LD	HL,ENHNMD
	ADD	HL,BC
	LD	(HL),$01
;
	LD	A,$11
	LD	(SOUND2),A	;(S)
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	A,(HL)
	CP	EFAIL
	JR	NZ,KNCR0A
;
	LD	HL,ENTIM4
	ADD	HL,BC
	LD	(HL),$40
KNCR0A
	RET
;----------------------------------
KNCR019
	LD	A,C
	INC	A
	LD	(KENOFF),A
;
		LD	A,(CLOTHFG)
		AND	$001		;攻撃力ＵＰ？
		JR	NZ,KNCR0195	;	YES --> KNCR0195
;
	LD	A,(POWRFG)
	AND	$01
KNCR0195
	LD	HL,SPCTTM
	OR	(HL)
	LD	HL,DUSHFG
	OR	(HL)
	LD	A,(KENLEV)
	JR	Z,KNCR1A
	INC	A
KNCR1A
	DEC	A
	LD	(ATCKNO),A
;- - - - - - - - - - - - - - - - - - - -
ENDMST2
	LD	HL,ENMOD2
	ADD	HL,BC
	LD	E,(HL)
	LD	D,B
;
	SLA	E
	RL	D
	SLA	E
	RL	D
	SLA	E
	RL	D
	SLA	E
	RL	D
;
	LD	HL,ITMHITD
	ADD	HL,DE
	LD	A,(ATCKNO)
	LD	E,A
	LD	D,B
	ADD	HL,DE
	LD	E,(HL)
	PUSH	DE
;
	LD	A,(ATCKNO)
	RLA
	RLA
	RLA
	AND	%11111000
	LD	E,A
;
	LD	HL,ITMHITP
	ADD	HL,DE
	POP	DE
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	RET	Z
;				; YES 
	PUSH	AF
;
	LD	A,(ENMYNO2)
	CP	BOSS
	JR	NZ,CKP0BA
;
	LD	A,(BOSSNO)
	CP	$04	;ガノン
	JR	NZ,CKP0BA
;
	LD	A,(DUSHFG)
	PUSH	AF
	CALL	PLHNST
;
	POP	AF
	AND	A
	JR	NZ,CKP0BA
;
	LD	A,(SPCTTM)
	AND	A
	JR	NZ,CKP0BA
;
	POP	AF
	RET
CKP0BA
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
;
	LD	HL,SOUND1	;(S)
	LD	(HL),$03
;
	AND	%10000000
	JR	Z,ED2210
;
	LD	HL,SOUND2	;(S)
	LD	(HL),$07
ED2210
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	A,(HL)
	CP	NIWAT		;ニワトリ？
	JR	NZ,ED22101	;	NO --> ED22101
;
	LD	A,$13
	LD	(SOUND2),A	;(S)
ED22101
	POP	AF
;
	CP	$F0
	JR	C,CKP069	; Special atack ?
;;	 FF:Stop  FE:Fire  FD:Fairy
;				; yes !
	CP	$FE		;火がつく？
	JR	NZ,CKP066	;	NO --> CKP066
;
	LD	HL,SOUND3	;(S)
	LD	(HL),$12 ;(S)
;
	CALL	ENDMST4
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EFIRE
;
	CALL	LDTIM0
	LD	(HL),$60
;
	LD	HL,ENMOD0
	ADD	HL,BC
	INC	(HL)
	INC	(HL)
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%11000010
	LD	(HL),A
;
	RET
CKP066
	CP	$FF
	JR	NZ,CKP060	; Stop ?
;				; yes !
	CALL	ENDMST4
;
;======================================
ESTOPST
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),ESTOP ;A
	LD	HL,ENTIM2
	ADD	HL,BC
	LD	(HL),$FF ;A
;
	LD	HL,ENZSPD
	ADD	HL,BC
	LD	(HL),B
;
	RET
CKP060
	CP	$FD
		ret	NZ		; 妖精 変身？
;;;;;;;;	JR	NZ,CKP062	; 妖精 変身？
;				; YES !
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	A,(HL)
	CP	NYO_SLM		;ニョロスライムボス？
	JR	Z,SONOTOURI	;	YES --> SONOTOURI
	CP	NYOROO		;ニョロニョロ？
	JR	NZ,CKP061	;	NO --> CKP061
;
SONOTOURI
	LD	HL,ENWRK0
	ADD	HL,BC
	LD	A,(HL)
	AND	A
		ret	NZ
;;;;;;;;	JR	NZ,CKP062
;
	INC	(HL)
	JR	CKP0611
;
CKP061
	LD	(HL),YOSEI
	CALL	ENMDST
;
	CALL	LDTIM3
	LD	(HL),$80 ;A
;
CKP0611
;- - - Kemri set - - - -
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK0),A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
;
	LD	HL,ENZPSL
	ADD	HL,BC
	SUB	(HL)
	LD	(WORK1),A
;
	LD	A,SMK1
		jp	EXIDSH
;;;;;;;;	CALL	EXIDSH
;;;;;;;;;
;;;;;;;;	RET
;;;;;;;;CKP062
;;;;;;;;;--- Another - -
;;;;;;;;	RET
;
;==== 普通のダメージ========
CKP069
	LD	E,A
;
	LD	HL,ENLIFE
	ADD	HL,BC
	LD	A,(HL)
	SUB	E
	LD	(HL),A
	JR	C,CKP077
	JP	NZ,CKP088
;
CKP077
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EFAIL ;A
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	BIT	7,A
	JR	Z,CKP078
;
	BIT	2,A
	JR	NZ,BSFS101
;
	LD	E,ENNO-1
	LD	D,B
BSFS0F0
	LD	A,E
	CP	C
	JR	Z,BSFS100
;
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	CP	EMOVE
	JR	NZ,BSFS100
;
	LD	HL,ENMOD3
	ADD	HL,DE
	LD	A,(HL)
	AND	%10000000
	JR	NZ,BSFS101
BSFS100
	DEC	E
	LD	A,E
	CP	$FF
	JR	NZ,BSFS0F0	;ボス全滅？
;				;YES !
	LD	A,(PBANK)
	PUSH	AF
	LD	A,$03
	CALL	PBSET
	CALL	SOUNDCLR	;(S)
	POP	AF
	LD	(PBANK),A
BSFS101
	LD	A,$03
	LD	(BSFLSD),A	;(S) やられ音用！
;
	LD	HL,ENWRK1
	ADD	HL,BC
	LD	(HL),B	;やられ処理用！
;
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	A,(HL)
	LD	E,$B7
	CP	BGKAO	; L.6	
	JR	Z,CKP777
	LD	E,$B9
	CP	BBIRD	; L.7
	JR	Z,CKP7771
	LD	E,$BD
	CP	BFIRE	; L.8
	JR	NZ,CKP078
CKP777
	LD	A,E
	CALL	MSGCHK	;最後のあげきメッセージ
;
	LD	A,$5E
	LD	(SOUND4),A	;(S)
	JR	CKP078
CKP7771
	LD	A,(PLYPSL)
	PUSH	AF
;
	LD	A,$10
	LD	(PLYPSL),A
;
	LD	A,E
	CALL	MSGCHK	;最後のあげきメッセージ(むりやり下に出す！）
	POP	AF
	LD	(PLYPSL),A
CKP078
	CALL	STATINC
	LD	(HL),B
;
	LD	HL,ENTIM4
	ADD	HL,BC
	LD	(HL),$2F
;
	LD	HL,ENFLSH
	ADD	HL,BC
	XOR	A
	LD	(HL),A
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%10000000
	JR	NZ,CKP079	; Normal fail ?(Boss not?)
;				; yes !
	LD	HL,ENMOD0
	ADD	HL,BC
	LD	A,(HL)
	AND	%11110000
	OR	$4
	LD	(HL),A		; OAM use count 4 of set !
CKP079
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	A,(HL)
	CP	GHOSS
	JR	NZ,CKP088
;
	LD	E,ENNO-1	; Zenmetsu !!
	LD	D,B
CKP087
	LD	A,E
	CP	C
	JR	Z,CKP0888
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	GHOST
	JR	Z,CKP0887
	CP	GHOSB
	JR	NZ,CKP0888
CKP0887
	LD	HL,ENSTAT
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	NZ,CKP0888
;
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	Z,CKP0888
;
	LD	(HL),EFAIL
;
	LD	HL,ENTIM4
	ADD	HL,DE
	LD	(HL),$1F
;
	CALL	RNDSUB
	AND	$03
	PUSH	BC
	LD	C,A
	LD	B,$00
	LD	HL,GHITDT
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENITMF
	ADD	HL,DE
	LD	(HL),A
	POP	BC
CKP0888
	DEC	E
	LD	A,E
	CP	$FF
	JR	NZ,CKP087
;
	LD	HL,ENITMF
	ADD	HL,BC
	LD	(HL),RUPY1
CKP088
;----------------------------------
ENDMST3
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENFLSH
	ADD	HL,BC
	CP	BOSS
	JR	NZ,EDS30120
;
	LD	A,(BOSSNO)
	CP	$03
	JR	Z,EDS30130	;ラスト早MUSI？
	JR	EDS310
;
EDS30120
	CP	HAYAB
	JR	NZ,EDS310
;
EDS30130
	LD	(HL),$28
;
EDS3020
	LD	HL,ENTIM2
	ADD	HL,BC
	LD	(HL),$A0+$28
	RET
EDS310
	LD	(HL),$18 ;A
;
ENDMST4
	LD	HL,ENHNMD
	ADD	HL,BC
	LD	(HL),B
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	(HL),$0A ;A
CKP090
	RET
;=================================
GHITDT	; ゴースト全滅アイテムセット
	DB	HART1,RUPY1,BOMB1,ALOW1
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%	剣と剣			 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CRKNKN
	LD	HL,KENOFF
	LD	A,(HANEFG)
	OR	(HL)
	LD	HL,KNKNTM
	OR	(HL)
	LD	HL,SPCTTM
	OR	(HL)
	JP	NZ,CKK090
;
	LD	A,(PKCRX1)
	CP	$00
	JP	Z,CKK090
;- - X check - -
	LD	HL,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SHST
	JR	CKK08A
;- - - - - - - - - - - - -
CBX030
	LD	A,$10
	LD	(HANEFG),A
	LD	A,$20
	CALL	PSHST
CBX080
	JR	CKK08A
CKK089
	LD	A,(PLCMKI)
	LD	E,A
	LD	D,B
	LD	HL,KKFLXD
	ADD	HL,DE
	LD	A,(PKCRX1)
	ADD	A,(HL)
	LD	(WORK0),A
;
	LD	HL,KKFLYD
	ADD	HL,DE
	LD	A,(PKCRY1)
	ADD	A,(HL)
	LD	(WORK1),A
;
	CALL	FLASHST
;
CKK08A
	LD	A,$0C
	LD	(KNKNTM),A	; Protect time !
	RET
CKK090
	JP  	CRKNPL
;-------------------------------------
KKFLXD
	DB	$00,$F0,$F8,$FC
KKFLYD
	DB	$FC,$FC,$F0,$00
;=============================================
CRKNPL
	LD	A,(FRCNT)
	XOR	C
	RRA
	JR	NC,CKPL090
;
	LD	A,(PLXPSL)
	ADD	A,$08
	LD	(WORK0),A
	LD	A,(PLYPSL)
	ADD	A,$08
	LD	(WORK2),A
;
	LD	DE,ENSVXL
	LD	HL,ENKNSZ
;
	LD	A,(DE)
	ADD	A,(HL)
	PUSH	HL
	LD	HL,WORK0
	SUB	(HL)
	CP	$80
	JR	C,CKPL020
;
	CPL
	INC	A
CKPL020
	POP	HL
	PUSH	AF
;
	INC	HL
	LD	A,$04 ;(WORK1)
	ADD	A,(HL)
	LD	E,A
	POP	AF
	CP	E
	JR	NC,CKPL090
;
	INC	HL
;- - Y check - -
	LD	DE,ENDSYP
;
	LD	A,(DE)
	ADD	A,(HL)
	PUSH	HL
	LD	HL,WORK2
	SUB	(HL)
	CP	$80
	JR	C,CKPL030
;
	CPL
	INC	A
CKPL030
	POP	HL
	PUSH	AF
;
	INC	HL
	LD	A,$05 ;(WORK3)
	ADD	A,(HL)
	LD	E,A
	POP	AF
	CP	E
	JR	NC,CKPL090
;
	LD	A,(PLFLSH)
	AND	A
	JR	NZ,CKPL090
;
	CALL	PLDMST2
;
	LD	A,(ENMYNO2)
	CP	BOXER
	JR	NZ,CKPL090
;
	LD	A,(BDATNO)
	AND	A
	JR	Z,CKPL090
;
	CP	$01
	JR	Z,CKPL090
	CP	$04
	JR	Z,CKPL090
;
	CP	$02
	JR	NZ,CKPL080
;
	CALL	LDTIM1
	LD	(HL),$A0	;ピヨリ！
;
	LD	A,$20
	LD	(HANEFG),A
;
	LD	A,$30
PSHST
	CALL	PSERCH2
;
	LD	A,(WORK0)
	LD	(PLYSPD),A
	LD	A,(WORK1)
	LD	(PLXSPD),A
CKPL090
	RET
CKPL080
;---------------------------------------
PBOXST
	LD	HL,ENCONT
	ADD	HL,BC
	LD	A,(HL)
	CP	$22
	JR	C,CKPL090	;パワー？
;				;OK!
	LD	A,PBOXER
	LD	(PLMODE),A	;ぶっとび！
;
	LD	HL,ENMUKI
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	LD	A,$30
	JR	Z,CKPL088
	LD	A,$D0
CKPL088
	LD	(PLXSPD),A
;
	XOR	A
	LD	(PLYSPD),A
;
	LD	A,$30
	LD	(PLZSPD),A
;
	LD	A,$0B
	LD	(SOUND1),A	;(S)
	RET
;-----------------------------------------
CKPL0A0
	LD	A,$20
	LD	(HANEFG),A
;
	LD	A,$20
	JR	PSHST
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				      %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CRENEN
	LD	E,ENNO-1
	LD	D,$00
CEE000
	LD	A,E
	CP	C
	JP	Z,CEE010
;
	LD	A,(FRCNT)
	XOR	E
	AND	$01
	JP	NZ,CEE010
;
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	CP	EMOVE
	JP	C,CEE010
;
	LD	HL,ENMOD0
	ADD	HL,DE
	LD	A,(HL)
	AND	%01000000
	JP	NZ,CEE010
;
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	A,(ENSVXL)
	SUB	(HL)
	ADD	A,$0C
	CP	$18
	JP	NC,CEE010
;
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENZPSL
	ADD	HL,DE
	SUB	(HL)
;
	LD	HL,ENDSYP
	SUB	(HL)
	ADD	A,$0C
	CP	$18
	JP	NC,CEE010
;----------------------------------------
	LD	HL,ENCHPT
	ADD	HL,DE
	LD	A,(HL)
	CP	$FF
	JP	Z,CEE010	; Not display ?
;				; yes !
	LD	A,(ENMYNO2)
	CP	SBOMB		;爆弾兵？
	JR	NZ,CEE001	;	NO --> CEE001
;
	CALL	LDTIM0
	LD	(HL),B
CEE001
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	SBOMB		;爆弾兵？
	JR	NZ,CEE002	;	NO --> CEE002
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENXSPD
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENYSPD
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENTIM0
	ADD	HL,DE
	LD	(HL),$40
;
	LD	HL,ENSTAT
	ADD	HL,DE
	LD	(HL),$02
;
	LD	HL,ENTIM1
	ADD	HL,DE
	LD	(HL),$08
;
	JP	CEE010
;
;----------------------------------------
CEE002
	LD	HL,ENMOD0
	ADD	HL,DE
	LD	A,(HL)		;ブーメランや
	AND	%00100000	;	フックショット等にあたるか？
	JP	NZ,CEE00A	;	NO --> CEE00A
;
	LD	A,(ENMYNO2)
	CP	POWDR		;魔法の粉？
	JR	Z,CEE009	;	YES --> CEE009
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	BOSS
	JR	NZ,CEE0BS
;
	LD	A,(BOSSNO)
	CP	$05
	JR	NZ,CEE0BS	;ラストゴーマ？
;				;YES !
	LD	A,(ENCHPT2)
	CP	$02
	JR	NZ,CEE0082	;上むき？
;
CEE0BS				;YES!
	LD	HL,ENMOD1
	ADD	HL,DE
	LD	A,(HL)
	AND	%10000000
	JR	Z,CEE009	;Hanekairi ?
;				;Yes 
CEE0082
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	(HL),$01 ;A
	JP	CEE0B8
;
CEE009
	LD	A,(ENMYNO2)
	CP	POWDR		;魔法の粉？
	JR	NZ,EECRE0	;	NO --> EECRE0
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	AKUMA		;小悪魔？
	JR	NZ,CAK100	;	NO --> CAK100
;
	LD	HL,ENSTAT
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	NZ,EECRE0
;
	INC	(HL)
CAK100
	CP	PAPA0		;狸タリン！
	JR	NZ,EECRE0	;	NO --> EECRE0
;
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,EECRE0	; タヌキ？
;				; いぇす！
	LD	HL,ENSTAT
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	NZ,EECRE0
;
	INC	(HL)		; おやじに変身！
;
	LD	HL,ENTIM3
	ADD	HL,DE
	LD	(HL),$7F
;
	LD	HL,ENFLSH
	ADD	HL,DE
	LD	(HL),$10
;
	LD	A,$03
	LD	(PBANK),A
	CALL	SOUNDCLR	;(S)
	LD	A,$18
	LD	(PBANK),A
;
EECRE0
	LD	HL,ENMOD1	;For magic powder
	ADD	HL,DE
	LD	A,(HL)
	AND	%10000000	;飛び道具跳ね返り？
	JP	NZ,CEE010	;	NO --> CEE010
;
	LD	HL,ENHNFG
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JP	NZ,CEE010
;
	LD	HL,ENMYNO
	ADD	HL,DE
	LD	A,(HL)
	CP	HIPLP		;ヒップループ？
	JR	NZ,CEE0092	;	NO --> CEE0092
;
	LD	HL,ENMUKI
	ADD	HL,DE
	LD	A,(HL)
	XOR	$01
	LD	HL,ENMUKI
	ADD	HL,BC
	CP	(HL)
	JR	NZ,CEE0092	; Mask hit ?
;				; yes !
	LD	HL,ENWRK1
	ADD	HL,DE
	LD	A,(HL)
	AND	A
	JR	NZ,C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
	LD	HL,ENYSPD
	ADD	HL,BC
	SRA	(HL)
	SRA	(HL)
	LD	A,(HL)
	CPL
	LD	(HL),A
;
	LD	HL,ENSHMK
	ADD	HL,BC
	LD	(HL),%11111111	;段差チェック無し！
;
	JR	CEE00C
CEE0BA
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,CEE00C	;Hanekairi ?
;				;NO 
	LD	A,(ENMYNO2)
	CP	PYAAA
	JR	NZ,CEE00DD
;
	LD	A,(ENSTAT2)
	AND	A
	JR	NZ,CEE00DE	; Bombr alow -> Not clear
CEE00DD
	CALL	ENCLER
CEE00DE
	JR	CEE010
CEE00C
	CALL	LDTIM0
	XOR	A
	LD	(HL),A
;
CEE010
	DEC	E
	LD	A,E
	CP	$FF
	JP	NZ,CEE000
	RET
;==============================================
ENENCR
	LD	A,(ENMYNO2)
	CP	PYAAA		;矢？
	JR	NZ,EECRF1	;	NO --> EECRF1
;
	LD	A,(ENSTAT2)
	AND	A
	JR	Z,EECRF1	; Bomber alow ?
;				; yes !
	CALL	LDTIM0
	LD	(HL),$03	; Bomb !!!!
	RET
;
EECRF1
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENHNXS
	ADD	HL,DE
	LD	(HL),A
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	LD	HL,ENHNYS
	ADD	HL,DE
	LD	(HL),A
;- - - - - - - - - - - - - -
	PUSH	BC
		ld	c,e
		ld	b,d
;;10/31;	PUSH	DE
;;10/31;	POP	BC
;
	PUSH	DE
	CALL	ENDMST22
	POP	DE
;
	POP	BC
;
EECR30
	RET
;=============================
ENDMST22
		jp	ENDMST2
;;;;;;;;	CALL	ENDMST2
;;;;;;;;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				      %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CRBOEN
	LD	E,ENNO-1
	LD	D,$00
CBE000
	LD	HL,ENMODE
	ADD	HL,DE
	LD	A,(HL)
	CP	EMOVE
	JR	C,CBE010
;
	LD	HL,ENMOD0
	ADD	HL,DE
	LD	A,(HL)
	AND	%01100000
	JR	NZ,CBE010
;
	LD	HL,ENMOD1
	ADD	HL,DE
	LD	A,(HL)
	AND	%10000000
	JR	NZ,CBE010
;
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	A,(ENSVXL)
	SUB	(HL)
	ADD	A,$18
	CP	$30
	JR	NC,CBE010
;
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENZPSL
	ADD	HL,DE
	SUB	(HL)
;
	LD	HL,ENDSYP
	SUB	(HL)
	ADD	A,$18
	CP	$30
	JR	NC,CBE010
;----------------------------------------
	LD	A,$07
	LD	(ATCKNO),A
	CALL	ENENCR	; Enemy damege !
;
	LD	A,$30
	CALL	ESERCH
;
	LD	HL,ENHNYS
	ADD	HL,DE
	LD	A,(WORK0)
	LD	(HL),A
;
	LD	HL,ENHNXS
	ADD	HL,DE
	LD	A,(WORK1)
	LD	(HL),A
CBE010
	DEC	E
	LD	A,E
	CP	$FF
	JR	NZ,CBE000
	RET
;===============================
ESERCH
	LD	(WORK0),A
;
	LD	A,(PLXPSL)
	PUSH	AF
;
	LD	HL,ENXPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	(PLXPSL),A
;
	LD	A,(PLYPSL)
	PUSH	AF
;
	LD	HL,ENYPSL
	ADD	HL,DE
	LD	A,(HL)
	LD	(PLYPSL),A
;
	PUSH	DE
	LD	A,(WORK0)
	CALL	PSERCH2
	POP	DE
;
	POP	AF
	LD	(PLYPSL),A
	POP	AF
	LD	(PLXPSL),A
;
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;---------------------------------
EBCKXD
	DB	$0D,$02,$08,$08	; Normal 
;
	DB	$0A,$06,$08,$08	; small
	DB	$10,$FF,$08,$08 ; BLOCK
;
	DB	$0D,$02,$08,$08	; Spark
;
;
EBCKYD
	DB	$08,$08,$02,$0D
;
	DB	$08,$08,$06,$0A
	DB	$08,$08,$FF,$10
;
	DB	$08,$08,$02,$0D	; Spark
;
;
ENCBBT
	DB	%00000001
	DB	%00000010
	DB	%00000100
	DB	%00001000
;
EBLTXD	; Belt revise data
	DB	$00,$00,$FF,$01
	DB	$01,$FF,$01,$FF
EBLTYD
	DB	$01,$FF,$00,$00
	DB	$01,$01,$FF,$FF
;---------------------------------
ENBGCK
	LD	HL,ENWATR
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK0),A
	XOR	A
	LD	(HL),A
	LD	(WORK1),A
	LD	(ENBGLR),A
	LD	(ENBGUD),A
;
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	BIT	7,A
	JR	NZ,EFLD055
	AND	A
	JP	NZ,EFLD070
;
EFLD055
	LD	HL,ENBCOF
	ADD	HL,BC
	LD	(HL),B
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	BIT	4,A
	JP	NZ,EFLD070	; Center check ok ?
;- - - Center check - -
	CALL	ENCTBC  ;ENBGCK2	; Water & fole check !
;--------------------------------------------
	JR	EBCF00
EBCE80				; Yes !
	LD	E,$02
	LD	A,(ENMYNO2)
	CP	BLANKA
	JR	Z,MCK010
	CP	PIHAT 
	JR	Z,MCK010
	CP	NIWAX 
	JR	Z,MCK010
	CP	WANWAN
	JR	Z,MCK010
	CP	GIRL1 	;マリン！
	JR	Z,MCK010
;
	CALL	ENCLER		; Clear 
	JP	EWPSET		; Water up set !
;
EBCF00
	LD	E,$01
;
	LD	A,(UNITNO)
	CP	DYKH2
	JR	Z,MCK010
;
	LD	A,(WORK3)
	AND	A
	JP	Z,EFLD070
	CP	$0B	; 溶岩！　
	JR	Z,EBCE80
	CP	$07	; Deep water !
	JR	Z,EBCE80
	CP	$B0
	JR	Z,MCK010
	INC	E
	CP	$05
	JR	Z,MCK010	; Asase
	CP	$06
	JR	NZ,MCK020	; Kusamura ?
;				; yes !
	INC	E
MCK010
	LD	HL,ENWATR
	ADD	HL,BC
	LD	(HL),E  ;$1
;
MCK020
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%00001000
	JR	Z,EBCK02	; Water up set ?
;				; yes!
	LD	HL,ENWATR
	ADD	HL,BC
	LD	A,(WORK0)
	CP	(HL)
	JR	Z,EBCK02
;
	LD	A,(HL)
	CP	$03
	JR	Z,EBCK02	; Kusa -> not water up !
	LD	A,(WORK0)
	CP	$03
	JR	Z,EBCK02
;
	LD	A,(YKFLAG)
	AND	A
	JR	NZ,EWCK10
;
	LD	HL,ENZSPD
	ADD	HL,BC
	LD	A,(HL)
	BIT	7,A
	JR	Z,EBCK02
;
	CP	$E7
	JR	NC,EBCK02	; High down ?
;				; yes !
	JR	EBCK01	
;
EWCK10
	LD	A,(ENMYNO2)
	CP	PUKPJ
	JR	Z,EBCK01
;
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	BIT	7,A
	JR	NZ,EBCK01
;
	LD	(HL),$0
;
	LD	HL,ENXSPD
	ADD	HL,BC
	SRA	(HL)
;
EBCK01
	LD	HL,ENTIM4
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,EBCK02
;
EWPSET
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK0),A
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(WORK1),A
;
	LD	A,$0E
	LD	(SOUND1),A	;(S)
;
	LD	A,WTUP
	CALL	EXIDSH
EBCK02
	LD	A,(WORK3)
	INC	A
	CP	$F1
	JR	C,EBLC10	; Beltconv ?
;				; yes !
	SUB	$F1		; Move !!
	LD	E,A
	LD	D,B
;
	LD	A,(FRCNT)
	AND	$03
	JR	NZ,EFLD008
;
	LD	HL,EBLTXD
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENXPSL
	ADD	HL,BC
	ADD	A,(HL)
	LD	(HL),A
;
	LD	HL,EBLTYD
	ADD	HL,DE
	LD	A,(HL)
	LD	HL,ENYPSL
	ADD	HL,BC
	ADD	A,(HL)
	LD	(HL),A
EFLD008
	JR	EFLD070
;--------------------------------------
EBLC10
	LD	A,(UNITNO)
	CP	IDO00
	JR	Z,EFLD010
	LD	A,(WORK3)
	CP	$50
	JR	Z,EFLD010
	CP	$51
	JR	NZ,EFLD070	; Fole ?
EFLD010				; yes !
	LD	A,(ENMYNO2)
	CP	WANWAN
	JR	Z,EFLD070
	CP	NIWAX 
	JR	Z,EFLD070
	CP	HARTB 
	JR	Z,EFLD070
	CP	GIRL1 	;マリン！
	JR	NZ,EFLD011
;
	LD	A,(PLMODE)
	CP	PFOLE
	JR	NZ,EFLD070	;一緒に落ちよう！
;
	LD	A,(UNITNO)
	CP	IDO00
	JR	NZ,EFLD070
;
EFLD011				; yes !
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,EFLD070
;
	DEC	(HL)
;
	LD	HL,ENFLSH
	ADD	HL,BC
	LD	(HL),$00
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),EFOLE
;
	LD	A,(OBJXP)
	ADD	A,$08
	LD	HL,ENFLXP
	ADD	HL,BC
	LD	(HL),A
	LD	A,(OBJYP)
	ADD	A,$10
	LD	HL,ENFLYP
	ADD	HL,BC
	LD	(HL),A
;
	CALL	LDTIM0
	LD	(HL),$6F
;
	LD	A,(ENMYNO2)
	CP	HEIS0
	JR	Z,EFLD070
	CP	MORI1
	JR	Z,EFLD070
	CP	OCTA1
	JR	Z,EFLD070
;
	LD	(HL),$48
EFLD060
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,EFLD070
;
	CALL	LDTIM0
	LD	(HL),$2F
;
	LD	A,$18
	LD	(SOUND1),A	;(S)
;===== MAIN CHECK ============
EFLD070
	LD	A,(ENMYNO2)
	CP	WANWAN
	JP	Z,EBCK50
;
	XOR	A
	LD	(ENBGLR),A
;
	LD	HL,ENMOD1
	ADD	HL,BC
	LD	A,(HL)
	AND	%00000011
	SLA	A
	SLA	A
	LD	(WORK0),A
;
	LD	HL,ENCBFG
	ADD	HL,BC
	XOR	A
	LD	(HL),A
;
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	A,(HL)
	CP	$00
	JR	Z,EBCK30
;
	LD	DE,$0000
;
	AND	%10000000
	JR	Z,EBCK10
;
	INC	E
EBCK10
	CALL	ENUNRD
	JR	C,EBCK30
;
	LD	A,(UNITNO)
	LD	(ENBGLR),A
;
	LD	A,(ENBGRV)
	AND	A
	JR	NZ,EBCK30	;
;				; yes !
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(ENSVXL)
	LD	(HL),A
EBCK30
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	A,(HL)
	CP	$00
	JR	Z,EBCK50
;
	LD	DE,$0002
;
	AND	%10000000
	JR	NZ,EBCK40
;
	INC	E
EBCK40
	CALL	ENUNRD
	JR	C,EBCK50
;
	LD	A,(UNITNO)
	LD	(ENBGUD),A
;
	LD	A,(ENBGRV)
	AND	A
	JR	NZ,EBCK50
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(ENSVYL)
	LD	(HL),A
EBCK50
	RET
;==========================================
;====== BG check  特殊CHECK DATA ==
SPUNDT2
;7C
	DB	1,0
	DB	1,0
;7D
	DB	0,1
	DB	0,1
;E
	DB	1,1
	DB	0,0
;F
	DB	0,0
	DB	1,1
;80
	DB	1,0
	DB	1,0
;1
	DB	0,1
	DB	0,1
;2
	DB	1,1
	DB	0,0
;3
	DB	0,0
	DB	1,1
;4
	DB	0,1
	DB	1,1
;5
	DB	1,0
	DB	1,1
;6
	DB	1,1
	DB	0,1
;7
	DB	1,1
	DB	1,0
;8
	DB	1,0
	DB	0,0
;9
	DB	0,1
	DB	0,0
;A
	DB	0,0
	DB	1,0
;B
	DB	0,0
	DB	0,1
;C
	DB	0,1
	DB	1,0
;D
	DB	1,0
	DB	0,1
;==================================
ENUNRD
	PUSH	BC
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$08
;
	PUSH	AF
;
	LD	A,(WORK0)
	LD	C,A
;
	POP	AF
	LD	HL,EBCKXD
	ADD	HL,BC
	ADD	HL,DE
	ADD	A,(HL)
	LD	(WORK4),A
	SWAP	A
	AND	$0F
;
	LD	(WORK1),A
;
	POP	BC
	PUSH	BC
;
	LD	A,E
	CP	$03
	JR	NZ,EUZ001	; Down muki ?
;				; Yes !
	LD	A,(ENMYNO2)
	CP	TAMA0
	JR	Z,EUZ0FF
	CP	KTOBJ
	JR	NZ,EUZ001
;
EUZ0FF
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
;
	LD	HL,ENZPSL	; BG check point revise !
	ADD	HL,BC
	LD	C,(HL)
	BIT	7,C
	JR	Z,EUZ000
	LD	C,$00
EUZ000
	SRL	C
	SUB	C
	JR	EUZ002
EUZ001
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
EUZ002
	SUB	$10
;
	PUSH	AF
	LD	A,(WORK0)
	LD	C,A
;
	POP	AF
	LD	HL,EBCKYD
	ADD	HL,BC
	ADD	HL,DE
	ADD	A,(HL)
	LD	(WORK5),A
	AND	$F0
	LD	HL,WORK1
	OR	(HL)
	LD	C,A
	LD	HL,BGUNDT+$11
	LD	A,H
	ADD	HL,BC
	LD	H,A
	POP	BC
	LD	A,(HL)
	LD	(UNITNO),A
	CP	IWA00
	JP	Z,EFUCKON
	PUSH	DE
	LD	E,A
	LD	A,(DJFLAG)
	LD	D,A
	CALL	BGCRRD2
	POP	DE
;
	LD	(WORK3),A
;
	LD	A,(ENMYNO2)
	CP	BLANKA
	JR	Z,BLABCK	;ピラニアは水のみ
	CP	AMENB
	JR	NZ,EFOC0E	;あめんぼは水のみ!
;
BLABCK
	LD	A,(WORK3) ;BGCRNO) ;HL)
	CP	$05
	JP	Z,BUR010
	CP	$07
	JP	Z,BUR010
	JP	BUR00E
;
EFOC0E
	LD	A,(WORK3) ;BGCRNO) ;HL)
	AND	A
	JP	Z,BUR010
	CP	$0B
	JR	Z,EFOC010	;溶岩！
	CP	$50
	JR	Z,EFOC010
	CP	$51
	JR	NZ,EFOC020	; Fole kabe ?
EFOC010				; yes !
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JP	NZ,BUR010
;
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JP	Z,BUR00E	; Hanekaeri not check !
;
	LD	A,(ENMYNO2)
	CP	HAYAB
	JP	Z,BUR00E
;
	JP	BUR010
EFOC020
	CP	$7C  ;80
	JP	C,EUR0FF	; Special BG ?
;				; yes !
	CP	$90
	JP	NC,EUR0FF
;
	CP	$80
	LD	A,(ENMYNO2)
	JR	C,EFOC022	;半当たり？
;				;YES !
	CP	TAMA0
	JP	Z,ENBGOFF
	CP	BOMBR
	JP	Z,ENBGOFF
	JR	EFOC023
;
EFOC022		;通路当たり！
	CP	SPARK
	JP	Z,ENBGON 
	CP	SPAR2
	JP	Z,ENBGON 
;
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%10000000
	JP	NZ,ENBGON 	;ボス！
EFOC023
	PUSH	DE
;
	LD	A,(WORK3)
	SUB	$7C ;80
	SLA	A
	SLA	A
	LD	E,A
	LD	D,$0
	LD	HL,SPUNDT2	
	ADD	HL,DE
;
	LD	A,(WORK4)
	RRA
	RRA
	RRA
	AND	$01
	LD	E,A
	LD	A,(WORK5)
	RRA
	RRA
	AND	$02
	OR	E
	LD	E,A
	LD	D,$0
	ADD	HL,DE
	LD	A,(HL)
	POP	DE
	AND	A
	JP	Z,BUR010
;
EUR0FF
	LD	A,(WORK3)
	CP	$D0
	JR	C,ETOC90
	CP	$D3+1
	JR	NC,ETOC90
;
	SUB	$D0
;
	LD	HL,ENSHMK
	ADD	HL,BC
	CP	(HL)
	JR	Z,ETOC88
;
	LD	A,(ENMYNO2)
	CP	TAMA0
	JR	Z,BUR00E
;
	LD	HL,ENBCOF
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,BUR00E
;
	LD	A,(FRCNT)
	AND	$03
	JR	Z,ETOC8A	;ヘルプ！
;
	LD	A,(DJFLAG)
	AND	A
	JR	NZ,ETOC87
;
	LD	A,(FRCNT)
	AND	$01
	JR	Z,ETOC8A	;ヘルプ！
ETOC87
	DEC	(HL)
	JR	ETOC8A
ETOC88
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JP	Z,BUR00E
;
	LD	HL,ENBCOF
	ADD	HL,BC
	INC	(HL)
ETOC8A
	JP	BUR010	
ETOC90
	CP	$FF
	JR	Z,EUR010	; Unit hit ?
	CP	$A0
	JR	NC,BUR010	; hit ?
	CP	$10
	JR	NC,BUR00E
	CP	$01
	JR	Z,EUR00F
	CP	$03
	JR	Z,EUR00F
	CP	$04
	JR	NZ,BUR010	; On block ?	
;
	LD	A,(ENMYNO2)
	CP	TAMA0
	JP	Z,ENBGOFF
	CP	BOMBR
	JP	Z,ENBGOFF
	CP	FUCKS
	JR	NZ,ENBGFK
;
	LD	A,(ONBGFG)
	AND	A
	JP	NZ,ENBGOFF
;
ENBGFK
	LD	A,(UNITNO)
	CP	DBL01
	JR	C,ENBGON
	CP	DBL02+1
	JR	NC,ENBGON
;				; yes !
	PUSH	DE
	SUB	DBL01
	LD	E,A
	LD	D,$00
	LD	HL,ONOFBDE
	ADD	HL,DE
	POP	DE
	LD	A,(ONOFFG)	; Swich on hit check !!
	XOR	(HL)
	JR	Z,BUR010	; which check !
BUR00E
	LD	A,(WORK3)
	CP	$60
	JR	NZ,EUR00F	; Fuck shot check ?
;				; yes!
EFUCKON
	LD	A,(ENMYNO2)
	CP	FUCKS
	JR	NZ,EUR00F	; Fuck ?
;				; yes !
	CALL	LDTIM0
	CP	$26
	JR	C,EUR0E0	; First time hit ?
;				; yes ! clear !
	CALL	ENCLER
EUR0E0
	LD	HL,ENSTAT
	ADD	HL,BC
	LD	(HL),$01 ;A
EUR00F
	LD	HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%00000001	; Unit hit ok ?
	JR	NZ,BUR010
;				; yes !
ENBGON
EUR010
	LD	HL,ENCBBT
	ADD	HL,DE
	LD	A,(HL)
;
	LD	HL,ENCBFG
	ADD	HL,BC
;
	OR	(HL)
	LD	(HL),A
;
	AND	A	; CF claer !
	RET
ENBGOFF
BUR010
	SCF
	RET
;==========================================
ONOFBDE
	DB	$00,$02
;==========================================
;EBCKXD2
;	DB	$07
;EBCKYD2
;	DB	$07
;
ENBGCK2	; Only 1 point 
	LD	DE,$0000
;
	PUSH	BC
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
;
	LD	(WORK4),A
	AND	$F0
	LD	(OBJXP),A
	SWAP	A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	C,A
	LD	A,(HL)
	SUB	$10-8
;
	LD	(WORK5),A
	AND	$F0
	LD	(OBJYP),A
	OR	C
	LD	C,A
	LD	(ENHELP2),A
	LD	B,$0
	LD	HL,BGUNDT+$11
	LD	A,H
	ADD	HL,BC
	LD	H,A
	POP	BC
	LD	A,(HL)
	LD	(UNITNO),A
	CP	DSOK1		; 明るいトウロウ？
	JP	Z,BU2010	; ＹＥＳ
	CP	DSOK0		; 暗いトウロウ？
	JP	NZ,EUR123	; ＮＯ
;				; ＹＥＳ

		LD	A,(CGBFLG)
		AND	A
		JR	Z,ENBGCK2_100
		LD	A,(PLMODE)
		CP	KURUD		; くるりんドア？
		RET	Z		; ＹＥＳ
		LD	A,(DARKFLG)
		AND	A		; フェード中？
		JP	NZ,BU2010	; ＹＥＳ
		LD	A,(SCRLFG)
		AND	A		; スクロール中？
		JP	NZ,BU2010	; ＹＥＳ
ENBGCK2_100

	LD	A,(ENMYNO2)
	CP	PRTBM
	JR	NZ,EUR123
;
	LD	A,(DJFLAG)
	AND	A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G)
	AND	A
	JR	NZ,ETO2119
;
	LD	A,(FRCNT)
	AND	$01
	JR	Z,BU2010
ETO2119
	DEC	(HL)
	JP	BU2010	
ETO2120
	LD	HL,ENZPSL
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,BU2008
;
	LD	HL,ENBCOF
	ADD	HL,BC
	INC	(HL)
;
	JP	BU2010	
;
ETO2190
	CP	$7C
	JP	C,BU2003	; Special BG ?
;				; yes !
	CP	$90
	JP	NC,BU2003
;
	JP	BU2010
;
BU2003
	LD	A,(WORK3)
	CP	$A0
	JR	NC,BU2010
	CP	$50
	JR	Z,BU2010
	CP	$51
	JR	Z,BU2010
	CP	$10
	JR	NC,BU2008
	CP	$1
	JR	NZ,BU2010	; hit ?
;				; yes !
;				; NO.
BU2008
	LD	HL,ENCBFG
	ADD	HL,BC
	LD	(HL),$01 ;A
;
	LD	A,(ENMYNO2)
	CP	BUMER
	JR	NZ,ENPSRV
;
	CALL	LDTIM0
	RET	Z
;-------------------------------------------
ENPSRV
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(ENSVXL)
	LD	(HL),A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(ENSVYL)
	LD	(HL),A
BU2099
	SCF
	RET
BU2010
	AND	A	; (CLC)
	RET
BU2020
	LD	A,(ENMYNO2)
	CP	BUMER
	JR	Z,BU2008
;
	JP  	ENCLER
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;==========================================
ENCTBC	; Center check  
	PUSH	BC
;
	LD	HL,ENXPSL
	ADD	HL,BC
	LD	A,(HL)
	SUB	$08-$07
;
	LD	(WORK4),A
	AND	$F0
	LD	(OBJXP),A
	SWAP	A
;
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	C,A
	LD	A,(HL)
	SUB	$10-$09
;
	LD	(WORK5),A
	AND	$F0
	LD	(OBJYP),A
	OR	C
	LD	C,A
	LD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	RET
PS90
	XOR	A
	LD	(WORK0),A
	RET
;=======================================
PSERCH
	CALL	PSERCH2
;
	LD	A,(WORK0)
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),A
;
	LD	A,(WORK1)
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),A
	RET
;====================================
EPXCHK
	LD	E,$0
;
	LD	A,(PLXPSL)
	LD	HL,ENXPSL
	ADD	HL,BC
	SUB	(HL)
	BIT	7,A
	JR	Z,EPX010
	INC	E
EPX010
	LD	D,A
	RET
;====================================
EPYCHK
	LD	E,$2
;
	LD	A,(PLYPSL)
	LD	HL,ENYPSL
	ADD	HL,BC
	SUB	(HL)
	LD	HL,ENZPSL
	ADD	HL,BC
	ADD	A,(HL)
	BIT	7,A
	JR	NZ,EPY010
	INC	E
EPY010
	LD	D,A
	RET
;====================================
EPXYCK
	CALL	EPXCHK
	LD	A,E
	LD	(WORK0),A
;
	LD	A,D
	BIT	7,A
	JR	Z,EXY010
	CPL
	INC	A
EXY010
	PUSH	AF
;
	CALL	EPYCHK
	LD	A,E
	LD	(WORK1),A
;
	LD	A,D
	BIT	7,A
	JR	Z,EXY020
	CPL
	INC	A
EXY020
	POP	DE
	CP	D
	JR	NC,EXY030
;
	LD	A,(WORK0)
	JR	EXY050
EXY030
	LD	A,(WORK1)
EXY050
	LD	E,A
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENMVCL	
;
	CALL	ENXCLC 		; X calc
;
ENYCLC
	PUSH	BC
	LD	A,C
	ADD	A,<ENNO
	LD	C,A
	
	CALL	ENXCLC		; Y calc
	POP	BC
	RET
;-----------------------------------------
ENXCLC
	LD	HL,ENXSPD
	ADD	HL,BC 
;
	LD	A,(HL)
	AND	A
	JR	Z,ECL090
;
	PUSH	AF
	SWAP	A
	AND	$F0
	LD	HL,ENXSDR
	ADD	HL,BC 
	ADD	A,(HL)
	LD	(HL),A
	RL	D
;
	LD	HL,ENXPSL
ECL00
	ADD	HL,BC 
;
	POP	AF
;
	LD	E,$0
	BIT	7,A
	JR	Z,EXC00
	LD	E,$F0
EXC00
	SWAP	A
	AND	$0F
	OR	E
	RR	D
	ADC	A,(HL)
	LD	(HL),A
ECL090
	RET
;====================================================
ENZCLC
	LD	HL,ENZSPD
	ADD	HL,BC 
;
	LD	A,(HL)
	AND	A
	JR	Z,ECL090
;
	PUSH	AF
	SWAP	A
	AND	$F0
	LD	HL,ENZSDR
	ADD	HL,BC 
	ADD	A,(HL)
	LD	(HL),A
	RL	D
;
	LD	HL,ENZPSL
	JR	ECL00
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;---------------------------------
ENSTCK
	LD	A,(ENMODE2)
	CP	EMOVE
	JR	NZ,ESTC12
;
ENSTCK2
	LD	A,(GMMODE)
	CP	GMAP
	JR	Z,ESTC12
;
		CP	ENDG
		JR	Z,ENSTCK2_100	; エンディング？
;					; Ｎｏ
		cp	GPLAY
		jr	nz,ESTC12	; ゲームモード　？
;					; Yes !!
		ld	a,(SBHR)
		cp	004
		jr	nz,ESTC12	; フェード中　？
;					; No !!
ENSTCK2_100
	LD	A,(MSGEFG)
	LD	HL,ENSTFG
	OR	(HL)
	LD	HL,WNDFLG
	OR	(HL)
	JR	NZ,ESTC12
;
	LD	A,(SCRLFG)
	AND	A
	JR	Z,ESTCF0
ESTC12
	POP	AF
ESTCF0
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%						    %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;ENHNSD
;	DB	$0,$0,$0,$0,$0
;;	DB	$7,$3,$1,$0,$0
ENHNSB
	LD	HL,ENHNFG
	ADD	HL,BC
	LD	A,(HL)
	AND	A
		ret	Z
;;;;;;;;	JR	Z,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