;
		onbankgroup
;
;==============	バンク０ ================================================
BANK0		GROUP	0
;-------------<	ZCO >-------------
		extern	RNDSUB,OBJBG,DATA_MOV
;
;-------------<	ZPL >-------------
		extern	PLPSRV,MSGCHK,MSGCHK2,DUSHCL,KNCSET,KNFLSH,PLSHST
		extern	MVCALC,FLASHST,EXIDSH,NXGOTO,PLCSET,LDTIM0,CARITMD
		extern	PTOBI,PBULE,PINDR1,POVER,PKEN
;
;-------------<	ZBS >-------------
		extern	DJRMRD
;
;-------------<	ZMA >-------------
		extern	PBSET,PBRETN
;
;==============	バンク１ ================================================
BANK1		GROUP	1
;-------------<	ZS1 >-------------
		extern	WANWANCK
;
;==============	バンク２ ================================================
BANK2		GROUP	2
;-------------<	ZEX >-------------
		extern	SPUNDT,PLBGCK,COINIT,HARTIT,ITEMDP,PWKEND2,PLDMST00
		extern	TAKARST,WTUP,SMK1,HNSM
;
;==============	バンク３ ================================================
BANK3		GROUP	3
;-------------<	ZEN >-------------
		extern	ISIBRK,ENIDSH2,PSERCH,PSERCH2,ENIDSH,CRENEN,ENFAIL
		extern	ENFOLE,ENFIRE,ENINIT,ENSTOP,ENCACH,ENSHOT,CRENPS
		extern	ENBGCK,ENBGCK2,CREPKE,CRENPL,CRENPL2,CRKNKN,CRKNEN
		extern	ENITMS,ENMDSTS,ITEMGET,ENMDST,KTFLST,EPBANK,KWUSO
		extern	IKADA,TUKAI,RANEM,HASIR,PYAAAMV,BOMBRMV,PRTBMMV
		extern	KTOBJMV,BLOCKMV,OCTA1MV,OCTAMMV,MORI1MV,MORYAMV
		extern	BOMBOMV,HIPLPMV,BOSS1MV,KWUSOMV,HART1MV,RUPY1MV
		extern	YOSEIMV,KEYSMMV,PLTATMV,HMASKMV,POWERMV,KINOMMV
		extern	KAKERMV,HARTBMV,ALOW1MV,BOMB1MV,GAKKIMV,KINOKMV
		extern	MGPOWMV,KAKINMV,KAIINMV,MSTESFMV
;
;==============	バンク４ ================================================
BANK4		GROUP	4
;-------------<	ZE2 >-------------
		extern	YMVSUB,HAYAMIT,HAYABIT,BGKAOIT,BSLIMIT,TBOSSIT
		extern	RIVERMV,GHOSTMV,GHOSBMV,GHOSSMV,HAYAMMV,RENO7MV
		extern	NYAMAMV,CHUNLIMV,UFOCHMV,TEKYUMV,BHOLEMV,BHOL2MV
		extern	FISHGMV,SBOMBMV,OBOMBMV,NINJAMV,NINTMMV,HAYABMV
		extern	BGKAOMV,BSLIMMV,TBOSSMV
;
;==============	バンク５ ================================================
BANK5		GROUP	5
;-------------<	ZE3 >-------------
		extern	BSNAKIT,BFIREIT,DDNGOIT,BBIRDIT,BFISHIT,BDCHD10
		extern	BDCHD11,BDCHD20,BDCHD21,GIRL0MV,PAPA0MV,BABA0MV
		extern	BSNAKMV,GORMAMV,DDNGOMV,BFIREMV,BBIRDMV,BFISHMV
		extern	SWTRPMV,IKADAMV,NIWATMV,WANWANMV
;
;==============	バンク６ ================================================
BANK6		GROUP	6
;-------------<	ZE4 >-------------
		extern	GKFLSHL,TEKTAMV,KUZUHMV,BABULMV,SPARKMV,SPAR2MV
		extern	PORUSMV,BLBATMV,SKEL0MV,SLIMBMV,SLIMSMV,MUMMYMV
		extern	MOTOSMV,MAGE0MV,SONICMV,LAIKUMV,TRAP0MV,FUKUROMV
		extern	TERSAMV,BTFLYMV,KODOMAMV,KODOMBMV,KODOMCMV,KODOMDMV
		extern	URURIMV,OZWANMV,MSWANMV,KARASMV,TRYCYMV,BHANAMV
		extern	BHFIRMV,SHANAMV,DENWAMV,OBAQMV,OBQBARMV,BEDINMV
		extern	IZUMIMV,HATO0MV,FLYITMV,RANEMMV,NOMOSMV,HINO0MV
		extern	PANELMV,PANEL2MV,SWBLKMV,SWBLK2MV,MIZUBMV,SLOTMV
		extern	KARBYMV,OCHANMV,HEISMMV,RICHDMV,FLYIT2MV
;
;==============	バンク７ ================================================
BANK7		GROUP	7
;-------------<	ZE5 >-------------
		extern	TAKARMV,HEIS0MV,INOSIMV,BSKELMV,HEISBMV,DAISUMV
		extern	AMENBMV,YUKABMV,YSLIMMV,BALEEMV,TBEAMMV,KURI0MV
		extern	PIHATMV,LOPEMV,PACKNMV,LIFTXMV,LIFTYMV,LIFTDMV
		extern	LIFTTMV,HASIRMV,TAMA0MV,GESSOMV,MONKYMV,OCTAJMV
		extern	YOSSIMV,AMUSIMV,YUKASMV,HANNYMV,PAPA2MV,KUMA0MV
		extern	PAPALMV,MAMADMV,TURIMV,SHIGEMV
;
;==============	バンク８ ================================================
BANK8		GROUP	8
;-------------<	ZBD >-------------
		extern	GRBGCR,DJBGCR
;
;==============	バンク１４ ==============================================
BANK14		GROUP	14H
;-------------<	ZEX >-------------
		extern	ENSUB0,SHRVSES,CAOFCKS,ENWAN
;
;==============	バンク１５ ==============================================
BANK15		GROUP	15H
;-------------<	ZE8 >-------------
		extern	NXOMSB,SADWST,NXOMCL,ENRMCLL,SKEL1MV,R7BEMMV,EWOODMV
		extern	MSPNTMV,IWAGOMV,SWBLKUMV,SWBLKDMV,SWBLKLMV,SWBLKRMV
		extern	ONOFSMV,MVHASMV,AMUSTMV,UNIUNIMV,KANIMV,BLANKAMV
		extern	SARUKMV,MOUSEMV,HODAIMV,SANBOMV,MBOSSMV,BOSSMV
		extern	SIROSMV
;
;==============	バンク１７ ==============================================
BANK17		GROUP	17H
;-------------<	ZEND >-------------
		extern	EDAIMV
;
;==============	バンク１８ ==============================================
BANK18		GROUP	18H
;-------------<	ZE6 >-------------
		extern	FUCKSMV,POWDRMV,HINTOMV,PSCRLMV,HIKUSMV,TANABEMV
		extern	MAMA0MV,MAMA1MV,PAPA1MV,KAMEIMV,NYOROMV,PKURIMV
		extern	TUKAIMV,ARIMAMV,BOXERMV,ZONBIMV,KHIMIMV,GIRL1MV
		extern	GIRL2MV,MAMUUMV,TODDMV,MANBOMV,USAGIMV,ONPUMV
		extern	AKUMAMV,ZORAMV,MAMAD2MV,USAG2MV,KUMASMV,NTORIMV
		extern	GMUSIMV
;
;==============	バンク１９ ==============================================
BANK19		GROUP	19H
;-------------<	ZE7 >-------------
		extern	ENSCRL,KTFLCS,BUMERMV,COPYAMV,WARPMV,FOXDOGMV
		extern	HEIHOMV,KAERUMV,SWIMPMV,MOAIMV,PUKPKMV,PUKPVMV
		extern	PUKPJMV,WANIMV,GAGEMV,OBAKEMV,NIWAXMV,YTUBOMV
		extern	DOSNSMV,DOSNBMV,TAIATMV,FIREBMV,BABUBMV,KAZAMMV
		extern	BOOKMV,SEIRENMV,KENBMMV
;
;========================================================================
	PUBALL
BANK0	GROUP	00

	LIB	ZRAM
	LIB	ZBN
;
;;;;;;;;	EXTERN	RNDSUB,PLPSRV,MSGCHK,MSGCHK2,DUSHCL,OBJBG,KNCSET,KNFLSH,ISIBRK
;;;;;;;;	EXTERN	PLSHST,MVCALC,FLASHST,DJRMRD,EXIDSH,ENIDSH2,SPUNDT,NXGOTO,DATA_MOV
;;;;;;;;	EXTERN	PBSET,ENSCRL,ENSUB0,PBRETN,PSERCH,PSERCH2,ENIDSH,PLBGCK,CRENEN
;;;;;;;;	EXTERN	ENFAIL,ENFOLE,ENFIRE,ENINIT,ENSTOP,ENCACH,ENSHOT,CRENPS,NXOMSB
;;;;;;;;	EXTERN	ENBGCK,ENBGCK2,CREPKE,CRENPL,CRENPL2,CRKNKN,CRKNEN,SADWST,NXOMCL
;;;;;;;;	EXTERN	YMVSUB,HAYAMIT,HAYABIT,BGKAOIT,BSLIMIT,TBOSSIT,BSNAKIT,BFIREIT,PLCSET
;;;;;;;;	EXTERN	COINIT,HARTIT,ITEMDP,PWKEND2,DDNGOIT,ENITMS,ENMDSTS,ITEMGET,BBIRDIT
;;;;;;;;	EXTERN	BFISHIT,ENMDST,KTFLST,WANWANCK,LDTIM0
;;;;;;;;	EXTERN	SHRVSES,GKFLSHL,PLDMST00,TAKARST,KTFLCS
;;;;;;;;	EXTERN	CAOFCKS,ENRMCLL
;;;;;;;;;
;;;;;;;;	EXTERN	CARITMD,GRBGCR,DJBGCR,PTOBI,WTUP,PBULE,SMK1,PINDR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IMV
;;;;;;;;	EXTERN	OBAKEMV
;;;;;;;;	EXTERN	NIWAXMV
;;;;;;;;	EXTERN	YTUBOMV
;;;;;;;;	EXTERN	DOSNSMV
;;;;;;;;	EXTERN	DOSNBMV
;;;;;;;;	EXTERN	TAIATMV
;;;;;;;;	EXTERN	FIREBMV
;;;;;;;;	EXTERN	BABUBMV
;;;;;;;;	EXTERN	KAZAMMV
;;;;;;;;	EXTERN  BOOKMV 
;;;;;;;;	EXTERN  SEIRENMV 
;;;;;;;;	EXTERN	KENBMMV
;;;;;;;;	EXTERN	SARUKMV
;;;;;;;;	EXTERN	MOUSEMV
;;;;;;;;	EXTERN	HODAIMV
;;;;;;;;	EXTERN	SANBOMV
;;;;;;;;	EXTERN	MBOSSMV
;;;;;;;;	EXTERN	FLYIT2MV 
;;;;;;;;	EXTERN  BOSSMV 
;;;;;;;;	EXTERN  SIROSMV 
;;;;;;;;	EXTERN  EDAIMV 
;------------------------------
;------------------------------------------------
	KANJI
	PAGE
	isdmg
;
	LIST
	ORG	$37E6
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WAENCK
	LD	A,$14
	LD	($2100),A
;
	LD	HL,ENWAN
	ADD	HL,DE
	LD	A,(HL)
;
	LD	HL,$2100
	LD	(HL),$05
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KTFLCSL
	LD	A,$19
	CALL	PBSET
	CALL	KTFLCS
	LD	A,$03
	JP	PBSET
;;	JP	PBRETN
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
KTFLSTL
	LD	A,$03
	LD	($2100),A
	CALL	KTFLST
	JP	PBRETN
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
SHRVSE
	LD	A,$14
	LD	($2100),A
;
	CALL	SHRVSES
;
	JP	PBRETN
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
WANWANCKL
	LD	A,$01
	CALL	PBSET
;
	CALL	WANWANCK
;
	LD	A,$02
	JP  	PBSET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENMDSTL
	LD	A,$03
	LD	($2100),A
	CALL	ENMDST
	JP	PBRETN
;============================
CAOFCKL
	LD	A,$14
	LD	($2100),A
	CALL	CAOFCKS
	LD	A,$03
	LD	($2100),A
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENOMDT
	DB	$00,$08,$10,$18
;	DB	$00,$08,$10,$18
;	DB	$00,$08,$10,$18
;	DB	$00,$08,$10,$18
;
;	DB	$00,$10,$20,$30
;	DB	$08,$18,$28,$38
;	DB	$28,$18,$38,$08
;	DB	$18,$28,$38,$18
;
ENEMY
	LD	HL,BSFLSD
	LD	A,(HL)
	AND	A
	JR	Z,ENBOS10
;
	DEC	(HL)
	JR	NZ,ENBOS10
;
	LD	A,$10
	LD	(SOUND2),A	;(S)	ボスやられ音！
ENBOS10
	LD	A,(MSGEFG)
	AND	A
	JR	NZ,EN10E0
;
	LD	A,(ENSTTM)
	LD	(ENSTFG),A
	AND	A
	JR	Z,EN10E0
;
	DEC	A
	LD	(ENSTTM),A
EN10E0
;;	LD	A,$03
;;	CALL	PBSET
;
	LD	A,(PLMODE)
	CP	POVER
	RET	Z
;;	JR	Z,EN1000
;
	XOR	A
	LD	(ENOMIS),A	; OAM set count reset !
;
	LD	A,(DNJNNO)
	CP	DJMAX ;$20
;
	LD	A,(FRCNT)
	JR	C,E00010
	XOR	A
E00010
	AND	$03
;;	AND	$0F
	LD	E,A
	LD	D,$00
	LD	HL,ENOMDT
	ADD	HL,DE
	LD	A,(HL)		; Enemy OAM index set !
	LD	(ENOMID),A	; For 10's over calc !!
;
	LD	A,(FIREBFG)
	LD	(WFIREBFG),A
	XOR	A
	LD	(FIREBFG),A
;;	LD	(SHOPFG),A	; Shop in flag (Not item use)
	LD	(DAMASI),A	; たぬきだましフラグ！
	LD	(IKADAON),A	; Player Ikada on flag !
	LD	(SLIMFG),A	;スライムヒッツキ!
	LD	(WARPFG),A	
	LD	(ONLFFG),A	;リフト載りフラグ！
	LD	(PLCANO),A
	LD	(TOBIOF),A
;
	LD	A,(MSGEFG)
	AND	A
	JR	NZ,ENFF00
;
;;	XOR	A
	LD	(MSCRFG),A	; Peaple cros flag (Not item set)
ENFF00
	LD	A,$02
	CALL	PBSET
;
	CALL	PWKEND2  ; Meter ken flashing
;
;
	LD	B,$0
	LD	C,<ENNO-1
EN0000
	LD	A,C
	LD	(INDEX),A
;
	LD	HL,ENMODE
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,EN0001
;
	LD	(ENMODE2),A
;
	CALL	ENMAIN
EN0001
	DEC	C
	LD	A,C
	CP	$FF
	JR	NZ,EN0000
ENNOTH
	RET
;==============================
ENRMCL
	LD	A,$15
	LD	($2100),A
	CALL	ENRMCLL
	LD	A,$03
	LD	($2100),A
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENMAIN
	LD	HL,ENMYNO
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENMYNO2),A
	LD	HL,ENSTAT
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENSTAT2),A
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENCHPT2),A
;
	LD	A,$19
	CALL	PBSET
;
	LD	A,(ENMYNO2)
	CP	IKADA
	JR	NZ,ENMA01
;
	LD	A,(IKADAON)
	AND	A
	JR	NZ,ENMA03
ENMA01	
	LD	A,(ENMODE2)
	CP	ECACH
	JR	NZ,ENMA10
;
ENMA03
	CALL	ENSCRL
	CALL	ENPSSV
	JR	ENMA20
ENMA10
	CALL	ENPSSV
	CALL	ENSCRL
ENMA20
	LD	A,$14
	CALL	PBSET
;
	CALL	ENSUB0
;
	LD	A,$03
	CALL	PBSET
;	LD	HL,ENMODE
;	ADD	HL,BC
;	LD	A,(HL)
;	LD	(ENMODE2),A
;	AND	A
;	JP	Z,ENNOTH
	LD	A,(ENMODE2)
	CP	EMOVE
	JP	Z,ENMOVE
	RST	0
	DW	ENNOTH
	DW	ENFAIL
	DW	ENFOLE
	DW	ENFIRE
	DW	ENINIT
	DW	ENMOVE ; Dammy
	DW	ENSTOP
	DW	ENCACH
	DW	ENSHOT
;- - - - - - - - - - - -
EFAIL	EQU	1
EFOLE	EQU	2
EFIRE	EQU	3
EINIT	EQU	4
EMOVE	EQU	5
ESTOP	EQU	6
ECACH	EQU	7
ESHOT	EQU	8
;----------------------------
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				   %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ENMOVEL
	CALL	ENMOVE
;
	LD	A,$03
	JP	PBSET
;- - - - - - - - - - - - - - - - - - - -
ENMOVE
	LD	A,(ENMYNO2)
	LD	E,A
	LD	D,B
	LD	HL,EPBANK
	ADD	HL,DE
	LD	A,(HL)
	CALL	PBSET
;
;;	LD	A,(ENMYNO2)
	LD	A,E
	RST	0
	DW	PYAAAMV
	DW	BUMERMV
	DW	BOMBRMV
	DW	FUCKSMV
	DW	PRTBMMV
;
	DW	KTOBJMV
	DW	BLOCKMV
	DW	TAKARMV
	DW	POWDRMV
;
	DW	OCTA1MV
	DW	OCTAMMV
	DW	MORI1MV
	DW	MORYAMV
	DW	TEKTAMV
	DW	RIVERMV
	DW	K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
	DW	BFIREMV
	DW	BBIRDMV
	DW	PSCRLMV
	DW	BFISHMV
	DW	ONOFSMV
	DW	SWTRPMV
	DW	MVHASMV
	DW	HIKUSMV
	DW	IKADAMV
	DW	TANABEMV
	DW	NIWATMV
	DW	WANWANMV
	DW    	BTFLYMV
	DW    	FOXDOGMV
	DW    	KODOMAMV
	DW    	KODOMBMV
	DW    	KODOMCMV
	DW    	KODOMDMV
	DW    	MAMA0MV
	DW    	MAMA1MV
	DW    	PAPA1MV
	DW    	URURIMV
	DW      OZWANMV
	DW    	MSWANMV
	DW    	KARASMV
	DW    	TRYCYMV
	DW    	BHANAMV
	DW    	BHFIRMV
	DW    	SHANAMV
	DW    	KAMEIMV
	DW    	DENWAMV
	DW    	OBAQMV
	DW    	OBQBARMV
	DW    	BEDINMV   
	DW    	IZUMIMV   
	DW    	HATO0MV   
	DW    	FLYITMV   
	DW    	RANEMMV   
	DW    	NOMOSMV   
	DW    	HINO0MV   
	DW    	PANELMV   
	DW    	PANEL2MV   
	DW    	SWBLKMV   
	DW    	SWBLK2MV   
	DW    	MIZUBMV   
	DW    	HEIHOMV   
	DW    	SLOTMV   
	DW    	KARBYMV   
	DW    	OCHANMV   
	DW    	HEISMMV   
	DW    	HEISBMV   
	DW    	RICHDMV   
	DW    	KAERUMV   
	DW    	SWIMPMV   
	DW    	DAISUMV   
	DW    	AMENBMV   
	DW    	YUKABMV   
	DW    	YSLIMMV   
	DW    	BALEEMV   
	DW    	MOAIMV   
	DW    	TBEAMMV   
	DW    	KURI0MV   
	DW    	PIHATMV   
	DW    	LOPEMV   
	DW    	PACKNMV   
	DW    	LIFTXMV 
	DW    	LIFTYMV 
	DW    	LIFTDMV 
	DW    	LIFTTMV 
	DW    	HASIRMV 
	DW    	TAMA0MV 
	DW    	GESSOMV 
	DW    	PUKPKMV 
	DW    	PUKPVMV 
	DW    	PUKPJMV 
	DW    	MONKYMV 
	DW    	OCTAJMV 
	DW    	YOSSIMV 
	DW    	AMUSIMV 
	DW    	YUKASMV 
	DW    	AMUSTMV 
	DW    	HANNYMV 
	DW    	PAPA2MV 
	DW    	KUMA0MV 
	DW    	PAPALMV 
	DW    	MAMADMV 
	DW    	TURIMV 
	DW    	NYOROMV 
	DW    	PKURIMV 
	DW    	SHIGEMV 
	DW    	TUKAIMV 
	DW    	ARIMAMV 
	DW    	BOXERMV 
	DW    	ZONBIMV 
	DW    	KHIMIMV 
	DW    	GIRL1MV 
	DW    	GIRL2MV 
	DW    	MAMUUMV 
	DW    	TODDMV 
	DW    	UNIUNIMV 
	DW    	KANIMV 
	DW    	MANBOMV 
	DW    	USAGIMV 
	DW    	ONPUMV 
	DW    	AKUMAMV 
	DW    	ZORAMV 
	DW    	BLANKAMV 
	DW    	WANIMV 
	DW    	MAMAD2MV 
	DW    	GAGEMV 
	DW    	USAG2MV
	DW    	KUMASMV
	DW    	NTORIMV
	DW    	GMUSIMV
	DW    	OBAKEMV
	DW    	NIWAXMV
	DW    	YTUBOMV
	DW    	DOSNSMV
	DW    	DOSNBMV
	DW    	TAIATMV
	DW    	FIREBMV
	DW    	BABUBMV
	DW    	KAZAMMV
	DW    	BOOKMV 
	DW    	SEIRENMV 
	DW    	KENBMMV
;-
	DW	SARUKMV
	DW 	MOUSEMV
	DW 	HODAIMV
	DW 	SANBOMV
	DW 	MBOSSMV
	DW    	FLYIT2MV   
	DW    	BOSSMV 
	DW    	SIROSMV 
;-
	DW    	EDAIMV 
;------------------------------
ENOJSD
;;		Cnt Lng C   L
;;		 x   x   y   y
	DB	$08,$05,$08,$05 ;0 Normal
	DB	$08,$0A,$08,$0A ;1 BLOCK
	DB	$08,$0A,$08,$0A	;2 GHOSB,HAYAB
	DB	$08,$10,$04,$0A	;3 OYAJI
	DB	$08,$02,$08,$02	;4 SLIMS ; Small size
	DB	$08,$13,$08,$13	;5 BFISH body
	DB	$08,$06,$06,$08	;6 Speaking people
 	DB	$08,$07,$06,$0A	;7 Item
 	DB	$08,$06,$10,$30	;8 OBQBAR
 	DB	$08,$07,$04,$0A	;9 MOAI
 	DB	$0C,$07,$FC,$04	;A BSKEL
 	DB	$10,$10,$0C,$12	;B LIFT?
 	DB	$08,$08,$02,$08	;C LIFT短い！
 	DB	$10,$0C,$08,$10	;D クマコック
 	DB	$08,$07,$0C,$08	;E FLYIT
 	DB	$08,$08,$02,$08	;F YTUBO
; - - - - - - - - - - - - -
ENSZST	; Size set !
	LD	HL,ENMOD1
	ADD	HL,BC
	LD	A,(HL)
	AND	%01111100  ;$1F
	LD	E,A
	LD	D,B
	LD	HL,ENOJSD
	ADD	HL,DE
	PUSH	HL
	POP	DE
;
	PUSH	BC
	SLA	C
	SLA	C
	LD	HL,ENOJSZ
	ADD	HL,BC
;- - Obj cross size set ! - -
	LD	C,$4
ENMS02
	LD	A,(DE)
	INC	DE
	LD	(HLI),A
	DEC	C
	JR	NZ,ENMS02
;
	POP	BC
	RET
;-------------------------------------------
;-------------------------------------------
ENPTST
	LD	HL,ENCHPT
	ADD	HL,BC
	LD	(HL),A
	RET
;-------------------------------------------
STATINC
	LD	HL,ENSTAT
	ADD	HL,BC
	INC	(HL)
	RET
;============================
PLDMST0	;プレイヤーダメージセット
	LD	A,$02
	LD	($2100),A
;
	CALL	PLDMST00
	JP	PBRETN
;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;;%						  %
;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;EN1CSTL
;	LD	A,$03
;	LD	($2100),A
;	CALL	EN1CST
;	CALL	PBRETN
;	RET
;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;;%						  %
;;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;EN2CSTL
;	LD	A,$03
;	LD	($2100),A
;	CALL	EN2CST
;	CALL	PBRETN
;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%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%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PSERCH2L
	LD	HL,$2100
	LD	(HL),$03
	CALL	PSERCH2
	JP	PBRETN
;;	RET
;- - - - - - - - - - - - - - - - - - - - - - - - -
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%						  %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;E2CSRT
;	RET
EN2CST
;	LD	HL,ENWATR
;	ADD	HL,BC
;	LD	A,(HL)
;	CP	$02
;	JR	NZ,E2C100	;水浅瀬？
;;				;yes !
;	LD	A,(ENDSYP)
;	ADD	A,$02
;	LD	(ENDSYP),A
;E2C100
	LD	A,(ENCHPT2)
	INC	A
	RET	Z
;;	CP	$FF
;;	JR	Z,E2CSRT
;
	CALL	O2MCHK
;
	PUSH	DE	; Chr data addr push !
;
;;	LD	HL,ENOMID
;;	ADD	HL,BC
;;	LD	A,(HL)
	LD	A,(ENOMID)
	LD	E,A
	LD	D,B ;$0
	LD	HL,ENOAM
	ADD	HL,DE
	PUSH	HL
	POP	DE
;
;	LD	A,(INDEX)
;	LD	C,A
;	LD	B,$0
;
	LD	A,(ENDSYP)  ;(HL)
	LD	(DE),A		; Y L
	INC	DE
;
	LD	A,(TILTXD)
	LD	C,A
;
	LD	A,(ENFLCL)
	AND	%00100000
	RRA
	RRA
;
	LD	HL,ENSVXL
	ADD	A,(HL)
	SUB	C
	LD	(DE),A		; X L
	INC	DE
;
;;	LD	HL,ENCHPT
;;	ADD	HL,BC
	LD	A,(ENCHPT2)  ;HL)
	LD	C,A
	LD	B,$0
	SLA	C
	RL	B
	SLA	C
	RL	B
	POP	HL	; Chrs data addr. !
	ADD	HL,BC
	LD	A,(ENCHNO)
	LD	C,A
	LD	A,(HLI)
	ADD	A,C
	LD	(DE),A		; C L
	AND	$0F
	CP	$0F
	JR	NZ,E1C050	; Space ?
	DEC	DE		
	LD	A,$F0
	LD	(DE),A		; yes not set
	INC	DE
E1C050
	INC	DE
	LD	A,(HLI)
	PUSH	HL
;
	LD	HL,ENFLCL
	XOR	(HL)
	LD	(DE),A		; A L
	INC	DE
;
;- - Right - - - 
	LD	A,(ENDSYP)   ;(HL)
	LD	(DE),A		; Y R
	INC	DE
;
	LD	A,(TILTXD)
	LD	C,A
;
	LD	A,(ENFLCL)
	AND	%00100000
	XOR	%00100000
	RRA
	RRA
;
	LD	HL,ENSVXL
	SUB	C
	ADD	A,(HL)   ;$08  ;10
	LD	(DE),A		; X R
	INC	DE
;
	POP	HL
	LD	A,(ENCHNO)
	LD	C,A
	LD	A,(HLI)
	ADD	A,C
	LD	(DE),A		; C R
;
	AND	$0F
	CP	$0F
	JR	NZ,E1C070	; Space ?
	DEC	DE
	LD	A,$F0
	LD	(DE),A		; not set
	INC	DE
E1C070
	INC	DE
	LD	A,(HL)
	LD	HL,ENFLCL
	XOR	(HL)
	LD	(DE),A		; A R
;;	INC	DE
;
ECSSUB
	LD	A,(INDEX)
	LD	C,A
	LD	B,$0
;
	LD	A,$15
;;	LD	A,$03
	LD	($2100),A
;
	CALL	NXOMCL
SDSSB
	CALL	SADWST
;
	JP	PBRETN
;;	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EN1CST
	LD	A,(ENCHPT2)
	INC	A
	RET	Z
;;	CP	$FF
;;	JP	Z,E2CSRT
;
	CALL	O2MCHK
;
;;	PUSH	BC
	PUSH	DE	; Chr data addr push !
;
	LD	A,(ENOMID)
	LD	L,A
	LD	H,$0
	LD	BC,ENOAM
	ADD	HL,BC
	PUSH	HL
	POP	DE
;
	LD	A,(INDEX)
	LD	C,A
	LD	B,$0
;
	LD	A,(YKFLAG)
	AND	A
	LD	A,(ENDSYP)  ;(HL)
	JR	Z,E1C003
;
	SUB	$4
	LD	(ENDSYP),A
E1C003
	LD	(DE),A		; Y 
	INC	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LD	(DE),A
	INC	HL
	INC	DE
;
	LD	A,(ENCHNO)	; Chr bank revise !
	LD	C,A
	LD	A,(HLI)
	PUSH	AF
	ADD	A,C
	LD	(DE),A
;;	POP	BC
;
	POP	AF
;;	AND	$0F
	CP	$FF
	JR	NZ,EOS900
	DEC	DE
	XOR	A
	LD	(DE),A
	INC	DE
EOS900
	POP	BC
	INC	DE
;
	LD	A,(ENFLCL)
	XOR	(HL)
	INC	HL
	LD	(DE),A
	INC	DE
;
	DEC	C
	JR	NZ,ENOM10
;
	LD	A,(INDEX)
	LD	C,A
;
	LD	A,$15
;;	LD	A,$03
	LD	($2100),A
;
	CALL	NXOMCL
;
	JP  	PBRETN
EOS090
	LD	A,(INDEX)
	LD	C,A
;
	RET
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
;%				 %
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
O2MCHK
	PUSH	HL
;
	LD	A,(SCRLFG)
	AND	A
	JR	Z,O2CK10
;
;;	LD	A,(ENMYNO2)
;;	CP	HASIR
;;	JR	Z,O2CK10
;
	LD	A,(ENSVXL)
	DEC	A
	CP	$C0
	JR	NC,O2CK08
;
	LD	A,(ENDSYP)
	DEC	A
	CP	$88
;;	CP	$A0
	JR	NC,O2CK08
;
	LD	HL,ENXPSH
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	NZ,O2CK08
;
	LD	HL,ENYPSH
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	JR	Z,O2CK10
O2CK08
	POP	AF	; Display out not c set !
O2CK10
	POP	HL
	RET
;===================================
ENSDCL
	LD	HL,ENXSPD
	ADD	HL,BC
	LD	(HL),B
	LD	HL,ENYSPD
	ADD	HL,BC
	LD	(HL),B
	RET
;===================================
ENPSSV
	LD	HL,ENXPSL	; Enemy old pos save
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENSVXL),A
	LD	HL,ENYPSL
	ADD	HL,BC
	LD	A,(HL)
	LD	(ENSVYL),A
;
	LD	HL,ENZPSL
	ADD	HL,BC
	SUB	(HL)
	LD	(ENDSYP),A
	RET
;------------------------------
NXOMSBL
	LD	HL,$2100
	LD	(HL),$15	
;
	CALL	NXOMSB
;
	JP	PBRETN
;;	RET
;------------------------------
HAYAMITL
	LD	HL,$2100
	LD	(HL),$04
;
	CALL	HAYAMIT
;
	JP	PBRETN
;;	RET
;------------------------------
HAYABITL
	LD	HL,$2100
	LD	(HL),$04
;
	CALL	HAYABIT
;
	JP	PBRETN
;;	RET
;------------------------------
BGKAOITL
	LD	HL,$2100
	LD	(HL),$04
;
	CALL	BGKAOIT
;
	JP	PBRETN
;;	RET
;------------------------------
BSLIMITL
	LD	HL,$2100
	LD	(HL),$04
;
	CALL	BSLIMIT
;
	JP	PBRETN
;;	RET
;------------------------------
TBOSSITL
	LD	HL,$2100
	LD	(HL),$04
;
	CALL	TBOSSIT
;
	JP	PBRETN
;;	RET
;------------------------------
BSNAKITL
	LD	HL,$2100
	LD	(HL),$05
;
	CALL	BSNAKIT
;
	JP	PBRETN
;;	RET
;------------------------------
DDNGOITL
	LD	HL,$2100
	LD	(HL),$05
;
	CALL	DDNGOIT
;
	JP	PBRETN
;;	RET
;------------------------------
BFIREITL
	LD	HL,$2100
	LD	(HL),$05
;
	CALL	BFIREIT
;
	JP	PBRETN
;;	RET
;------------------------------
BBIRDITL
	LD	HL,$2100
	LD	(HL),$05
;
	CALL	BBIRDIT
;
	JP	PBRETN
;------------------------------
BFISHITL
	LD	HL,$2100
	LD	(HL),$05
;
	CALL	BFISHIT
;
	JP	PBRETN
;;	RET
;------------------------------
PLBGCKL
;;	LD	HL,$2100
;;	LD	(HL),$02
;
	LD	A,(PBANK)
	PUSH	AF
;
	LD	A,$02
	CALL	PBSET
;
	CALL	PLBGCK
;
;;	LD	A,$04	;From ENMY2
	POP	AF
	JP	PBSET
;	JP	PBRETN
;;	RET
;------------------------------
YMVSUBL
	LD	HL,$2100
	LD	(HL),$04
;
	CALL	YMVSUB
;
	JP	PBRETN
;;;	RET
;------------------------------
ISIBRKL
	LD	HL,$2100
	LD	(HL),$03
;
	CALL	ISIBRK
;
	JP	PBRETN
;;	RET
;------------------------------
COHTITL
	LD	HL,$2100
	LD	(HL),$02
;
	CALL	COINIT
	CALL	HARTIT
;
	JP	PBRETN
;;	RET
;------------------------------
TAKARSTL
	LD	A,$02
	CALL	PBSET
;
	CALL	TAKARST
;
	LD	A,$03
	JP	PBSET
;------------------------------
ITEMDPL
	LD	HL,$2100
	LD	(HL),$02
;
	CALL	ITEMDP
;
	JP	PBRETN
;;;	RET
;------------------------------
ITEMGETS
	LD	HL,$2100
	LD	(HL),$03
;
	CALL	ITEMGET
;
	JP	PBRETN
;;	RET
;------------------------------
GKFLSH
	LD	A,$06
	CALL	PBSET
;
	CALL	GKFLSHL
;
	LD	A,$03
	JP	PBSET
;------------------------------
ENALCL
;;	LD	E,$00
	LD	E,ENNO
	LD	HL,ENMODE
EAL010
	XOR	A
	LD	(HLI),A
;
;	INC	E
;	LD	A,E
;	CP	ENNO
	DEC	E
	JR	NZ,EAL010
	RET
;------------------------------
HNSMST
	LD	HL,ENHNMD
	ADD	HL,BC
	LD	A,(HL)
	AND	A
	RET	Z
;;	JR	Z,HSS090
;
	LD	A,(FRCNT)
	XOR	C
	AND	$03
	RET	NZ
;;	JR	NZ,HSS090
;
	LD	A,(ENSVXL)
	LD	(WORK0),A
	LD	A,(ENDSYP)
	LD	(WORK1),A
;
	LD	A,HNSM
	CALL	EXIDSH
;
	LD	HL,EXTIM0
	ADD	HL,DE
	LD	(HL),$0F
HSS090
	RET
;------------------------------
ENHNBC
	LD	HL,ENHNXS
	ADD	HL,BC
	LD	A,(HL)
	BIT	7,A
	JR	Z,EHBC10
	CPL
	INC	A
EHBC10
	LD	(WORK0),A
;
	LD	HL,ENHNYS
	ADD	HL,BC
	LD	A,(HL)
	BIT	7,A
	JR	Z,EHBC20
	CPL
	INC	A
EHBC20
	LD	E,%00000011
	LD	HL,WORK0
	CP	(HL)
	JR	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HL,ENMOD3
	ADD	HL,BC
	LD	A,(HL)
	AND	%00000100
	JR	NZ,BSDCK10	;大ボス?
;				;yes !
	LD	A,(DNJNNO)
	CP	$05	;顔ボスメッセージは後で！
	JR	Z,BSDCK10
	LD	E,A
	LD	D,B
	LD	HL,DJBSMS
	ADD	HL,DE
	LD	A,(HL)
BSDCK0E
	CALL	MSGCHK	;戦闘メッセージ！
BSDCK10
	RET
;----------------------------------------------
ENONBT
	DB	%00000001
	DB	%00000010
	DB	%00000100
	DB	%00001000
	DB	%00010000
	DB	%00100000
	DB	%01000000
	DB	%10000000
;
ENFEND
;	LD	A,(ENMYNO2)
;	CP	KWUSO
;	JR	NZ,EFE00E
;;
;	LD	HL,ENMODE
;	ADD	HL,BC
;	LD	(HL),EMOVE
;;
;	CALL	LDTIM0
;	LD	(HL),$20
;;
;	LD	HL,ENSTAT
;	ADD	HL,BC
;	LD	(HL),$08
;;
;	LD	HL,ENCHPT
;	ADD	HL,BC
;	LD	(HL),$FF
;
;	LD	A,$03
;	LD	($2100),A
;	CALL	ENMDSTS
;;
;	JP	PBRETN
;;	RET
;
EFE00E
	LD	A,$03
	LD	(EFLFLG),A	; 全部穴落ちフラグ放棄！
	LD	($2100),A
	CALL	ENITMS
	CALL	PBRETN
;
;;	LD	A,$1
;;	LD	(TATLEV),A
;
ENBITON
	LD	HL,ENJYUN
	ADD	HL,BC
	LD	A,(HL)
	CP	$FF
	JR	Z,EFE090	; Data set enemy ?
;				; yes ! fail jyunban count set !(for nazo)
	PUSH	AF
;
	LD	A,(ENFLPT)
	LD	E,A
	LD	D,B
	INC	A
	LD	(ENFLPT),A
;
	LD	A,(HL)
	LD	HL,ENFLBF
	ADD	HL,DE
	LD	(HL),A
;- - - -Data save - - -
	POP	AF
ENDTON
	CP	$08
	JR	NC,EFE090	; Save ok ?
;				; yes !
	LD	E,A
	LD	D,B
	LD	HL,ENONBT
	ADD	HL,DE
;
	LD	A,(GRNDPT)
	LD	E,A
	LD	D,B
;
	LD	A,(HL)
	LD	HL,ENONOF
	ADD	HL,DE
	OR	(HL)
	LD	(HL),A	
EFE090
;	LD	E,30
;	LD	A,(HARTMX)
;	CP	07
;	JR	C,EFE091
;	LD	E,50
;	CP	11
;	JR	C,EFE091
;	LD	E,80
;EFE091
;	LD	HL,ENFLCT	; All fail counter for level up !
;	INC	(HL)
;	LD	A,(HL)
;;;	AND	$1F
;	CP	E
;	JR	C,EFE098
;;
;	LD	(HL),B
;;
;	LD	A,$08
;	CALL	MSGCHK
;;
;	LD	A,$01
;	LD	(POWRFG),A
;;
;	XOR	A
;	LD	(POWRCT),A
EFE098
ENCLER
;;	XOR	A
	LD	HL,ENMODE
	ADD	HL,BC
	LD	(HL),B
	RET
;=====================================================
;  Bired boss character chenge
;=====================================================
BDCHT1
	LD	A,$05
	LD	($2100),A
;
	LD	HL,BDCHD10	; 常ちゆうキャラクタ データ
	LD	DE,CHRRAM+$460	; キャラクタ ＲＡＭ ($8000 - $97FF)
	LD	BC,$010		; 個数 
	CALL	DATA_MOV	; キャラクタ 転送
;
	LD	HL,BDCHD11	; 常ちゆうキャラクタ データ
	JR	BDCHSB
; - - - - - - - - - - - - - -
BDCHT2
	LD	A,$05
	LD	($2100),A
;
	LD	HL,BDCHD20	; 常ちゆうキャラクタ データ
	LD	DE,CHRRAM+$460	; キャラクタ ＲＡＭ ($8000 - $97FF)
	LD	BC,$010		; 個数 
	CALL	DATA_MOV	; キャラクタ 転送
;
	LD	HL,BDCHD21	; 常ちゆうキャラクタ データ
BDCHSB
	LD	DE,CHRRAM+$480	; キャラクタ ＲＡＭ ($8000 - $97FF)
	LD	BC,$010		; 個数 
	CALL	DATA_MOV	; キャラクタ 転送
	XOR	A
;;	LD	(TOURFG),A
	LD	(CHTRF2),A
;
	LD	A,$0C
	LD	($2100),A
	JP	PLCSET
;=========================
	END
