If you appreciate the work done within the wiki, please consider supporting The Cutting Room Floor on Patreon. Thanks for all your support!

Huge Insect

From The Cutting Room Floor
Jump to navigation Jump to search

Title Screen

Huge Insect

Developer: Sachen
Publisher: Sachen
Platform: Unlicensed NES
Released in AS: 1993


SourceIcon.png This game has uncompiled source code.


No, Huge Insect isn't some weird euphemism for reproductive organs, but rather a bit of a clone of Galaga.

Uncompiled Source Code

Starting at 0x5213 in the ROM is a huge amount of assembler code.

	DB	100,100,20,0,100,100
	DB	100,100,20,0,100,100,30
	DB	100,100,20,0,70,100,30
	DB	100,100,20,0,70,100,30
	DB	100,100,20,0,100
	DB	100,100,20,0,100
	DB	100,100,20,0,100
	DB	100,100,20,0
	DB	100,100,20,0
	DB	100,100,20,0
	DB	100,100,20,0,100,100
	DB	100,100,20,0,100,100
	DB	100,100,20,0,100,100
	DB	100,100,20,0,100
	DB	100,100,20,0,100
	DB	100,100,20,0,100
;;=====================================================================================================================================
P1X   DW	P_A,P_B,P_A,P_A,P_B,P_B,P_A,P_C,P_A,P_A,P_B,P_B,P_C,P_C,P_B,P_B,P_A,P_A,P_C,P_C,P_B,P_B,P_C,P_C,P_A,P_C,P_C,P_B,P_C,P_C
P1Y   DW	P_A,P_B,P_A,P_A,P_B,P_B,P_A,P_C,P_A,P_A,P_B,P_B,P_C,P_C,P_B,P_B,P_A,P_A,P_C,P_C,P_B,P_B,P_C,P_C,P_A,P_C,P_C,P_B,P_C,P_C
P2X   DW	P_A,P_M,P_M,P_M,P_M,P_M,P_M,P_M,P_N,P_M,P_M,P_M,P_M,P_M,P_N,P_M,P_N,P_M,P_M,P_M,P_N,P_M,P_N,P_M,P_N,P_N,P_M,P_N,P_N,P_N
P2Y   DW	P_M,P_M,P_M,P_M,P_M,P_M,P_M,P_M,P_N,P_M,P_M,P_M,P_M,P_M,P_N,P_M,P_N,P_M,P_M,P_M,P_N,P_M,P_N,P_M,P_N,P_N,P_M,P_N,P_N,P_N
P3X   DW	P_A,P_B,P_A,P_A,P_B,P_B,P_A,P_C,P_A,P_A,P_B,P_B,P_C,P_C,P_B,P_B,P_A,P_A,P_C,P_C,P_B,P_B,P_C,P_C,P_A,P_C,P_C,P_B,P_C,P_C
P3Y   DW	P_X,P_X,P_X,P_Y,P_X,P_Y,P_Y,P_X,P_X,P_Z,P_Y,P_Y,P_X,P_Y,P_X,P_Z,P_Y,P_Z,P_Y,P_Y,P_Y,P_Z,P_X,P_Z,P_Z,P_Y,P_Z,P_Z,P_Z,P_Z
P4X   DW	P_M,P_M,P_M,P_M,P_M,P_M,P_M,P_M,P_N,P_M,P_M,P_M,P_M,P_M,P_N,P_M,P_N,P_M,P_M,P_M,P_N,P_M,P_N,P_M,P_N,P_N,P_M,P_N,P_N,P_N
P4Y   DW	P_X,P_X,P_X,P_Y,P_X,P_Y,P_Y,P_X,P_X,P_Z,P_Y,P_Y,P_X,P_Y,P_X,P_Z,P_Y,P_Z,P_Y,P_Y,P_Y,P_Z,P_X,P_Z,P_Z,P_Y,P_Z,P_Z,P_Z,P_Z
;;=====================================================================================================================================
P_A	INCLUDE  PATH.A 	;; O
P_B	INCLUDE  PATH.B 	;; OO
P_C	INCLUDE  PATH.C 	;; OOC	->
P_M	INCLUDE  PATH.M 	;; @@
P_N	INCLUDE  PATH.N 	;; @@@
P_X	INCLUDE  PATH.X 	;; \
P_Y	INCLUDE  PATH.Y 	;; \..
P_Z	INCLUDE  PATH.Z 	;; \\
;;=============================================================================
PATHFG: INCLUDE PATH.FG
PATHWY: INCLUDE PATH.YW
;;=============================================================================
MAP_TAB DW	G4_1_MP,G3_1_MP,G1_6_MP,G2_1_MP,G5_1_MP
DAT_TAB DW	G4_1_DAT,G3_1_DAT,G1_6_DAT,G2_1_DAT,G5_1_DAT
COL_TAB DW	G4_COL,G3_COL,G1_COL,G2_COL,G5_COL
XXX_TAB DW	G4X_COL,G3X_COL,G1X_COL,G2X_COL,G5X_COL
COLSTAB DW	G4S_COL,G3S_COL,G1S_COL,G2S_COL,G5S_COL
BANKTAB DB	1,1,0,0,2
;;=============================================================================
G1_6_MP:
	INCLUDE  333.MP
G2_1_MP:
	INCLUDE  444.MP
G3_1_MP:
	INCLUDE  222.MP
G4_1_MP:
	INCLUDE  111.MP
G5_1_MP:
	INCLUDE  555.MP
G1_6_DAT:
	INCLUDE  333.DAT
G2_1_DAT:
	INCLUDE  444.DAT
G3_1_DAT:
	INCLUDE  222.DAT
G4_1_DAT:
	INCLUDE  111.DAT
G5_1_DAT:
	INCLUDE  555.DAT
G1_COL:
	INCLUDE  G1.COL
G1S_COL:
	INCLUDE  G1S.COL
G1X_COL:
	INCLUDE  G1X.COL
G2_COL:
	INCLUDE  G2.COL
G2S_COL:
	INCLUDE  G2S.COL
G2X_COL:
	INCLUDE  G2X.COL
G3_COL:
	INCLUDE  G3.COL
G3S_COL:
	INCLUDE  G3S.COL
G3X_COL:
	INCLUDE  G3X.COL
G4_COL:
	INCLUDE  G4.COL
G4S_COL:
	INCLUDE  G4S.COL
G4X_COL:
	INCLUDE  G4X.COL
G5_COL:
	INCLUDE  G5.COL
G5S_COL:
	INCLUDE  G5S.COL
G5X_COL:
	INCLUDE  G5X.COL
;;=============================================================================
PAGE0_MP:
	INCLUDE  PAGE0.MP
PAGE0_DATA:
	INCLUDE  PAGE0.DAT
PAGE0_COL:
	INCLUDE  PAGE0.COL
PAGE0SCOL:
	INCLUDE  PAGE0S.COL
PAGEF_DATA:
	INCLUDE  PAGEF.DAT
PAGEF_MP:
	INCLUDE  PAGEF.MP
PAGEF_COL:
	INCLUDE  PAGEF.COL
PAGES_DATA:
	INCLUDE  PAGES.DAT
PAGES_MP:
	INCLUDE  PAGES.MP
PAGEW_DATA:
	INCLUDE  PAGEW.DAT
PAGEW_MP:
	INCLUDE  PAGEW.MP
PAGEW_COL:
	INCLUDE  PAGEW.COL
PAGEV_DATA:
	INCLUDE  PAGEV.DAT
PAGEV_MP:
	INCLUDE  PAGEV.MP
PAGEV_COL:
	INCLUDE  PAGEV.COL
;;=============================================================================
PAGE0BEEL DB	 00H,4EH,48H,42H,0FEH
	  DB	 74H,50H,4AH,44H,0FEH
	  DB	 00H,52H,4CH,46H,0FDH
PAGE0BEER DB	 3CH,36H,0FEH
	  DB	 3EH,38H,32H,6EH,0FEH
	  DB	 40H,3AH,34H,0FDH
SHOTER	  DB	  06AH,0FEH,06CH,0FDH
SHOTER_   DB	  06AH,0FEH,066H,0FDH
SPACE_	  DB	  0,0,0,0,0FDH
SHOTLSUB  DB	 10H,0FDH
SHOTRSUB  DB	 26H,0FDH
BOM_SHOT  DB	 1CH,01EH,0,0,0FDH
BIGBBB	DB	34H,36H,0FDH
BBB	DB	20H,0FDH
LASER	DB	0EH,0FDH
BOM_S	DB	01CH,01EH,0FDH
KIND1S	DB	42H,44H,0FDH,0
	DB	6EH,70H,0FDH,0
KINDAS	DB	4EH,50H,0FDH,0
	DB	7AH,7CH,0FDH,0
TREAS1	DB	10H,10H,0FDH
TREAS2	DB	02H,04H,0FDH
TREAS3	DB	06H,08H,0FDH
TREAS4	DB	0AH,0CH,0FDH
TREAS5	DB	18H,1AH,0FDH
TREAS6	DB	14H,16H,0FDH
FROG1A	DB	02AH,02CH,0FDH
FROG2A	DB	02EH,030H,0FDH
;;=============================================================================
NOTHING DB	000H,000H,0FEH,000H,000H,0FDH
KIND1	DB	01CH,01DH,0FEH,064H,065H,0FDH,0,0
	DB	002H,003H,0FEH,008H,009H,0FDH,0,0
	DB	019H,01AH,0FEH,01FH,040H,0FDH,0,0
	DB	0AFH,0B0H,0FEH,0B5H,0B6H,0FDH,0,0
	DB	01AH,01BH,0FEH,060H,061H,0FDH
KINDA	DB	06AH,06BH,0FEH,09FH,0B8H,0FDH,0,0
	DB	00EH,00FH,0FEH,014H,015H,0FDH,0,0
	DB	063H,064H,0FEH,069H,06AH,0FDH,0,0
	DB	0BBH,0BCH,0FEH,0C1H,0C2H,0FDH,0,0
	DB	066H,067H,0FEH,06CH,06DH,0FDH
P_UP	DB	22H,0FEH,0,0FEH,0,0FDH
P_DOWN	DB	0,0FEH,0,0FEH,22H,0FDH
P_STAGE DB	'STAGE:   -  ',0FDH
C_STAGE DB	'            ',0FDH
TEXTA	DB	'123456'
;;=============================================================================
;;=============================================================================
JNMI:
	SEI
	STA	NMIA
	STX	NMIX
	STY	NMIY

	LDA	TEMP0
	PHA
	LDA	TEMP1
	PHA
	LDA	TEMP2
	PHA
	LDA	TEMP3
	PHA
	LDA	TEMP4
	PHA
	LDA	TEMP5
	PHA

	LDA	COUNTER
	PHA
	LDA	HB_P
	PHA

	JSR	PRTX

	INC	BLKSPR
	LDA	BLKSPR
	AND	#1
	TAY
	LDA	BLKTAB,Y
	STA	IO3
	LDA	#2
	STA	4014H

	LDA	PDS_REG
	STA	PDS_IO
	LDA	IO1_REG
	STA	IO1

	LDA	#0
	STA	IO5
	STA	IO5
	LDX	#4
	LDY	DELAY_T
LOOP:	=	*
	DEY
	BNE	LOOP
	DEX
	BNE	LOOP

	LDA	CUTFLAG
	BEQ	CUT_END

	LDA	BG_POINT
	STA	IO5
	LDA	#0
	STA	IO5
;;=============================================================================
;;=============================================================================
	JSR	PR_SCORE
	LDA	PLAY_F
	BEQ	DONTPLAY
	LDA	CUTFLAG
	CMP	#10
	BCS	MOV_STAY
	JSR	MOV_L_R
	JSR	FLY_FLY
	JMP	MOV_ED
MOV_STAY:
	LDA	#0
	STA	BG_POINT
MOV_ED:
	JSR	PR_FROGA
	JSR	CONTROLER
	JSR	YOURBB
	JSR	BEE_CHK
	JSR	CHK_TOUCH
	JSR	BOMXX
	LDA	OFF_TIME
	BNE	SHOT_NOP
	JSR	SHOT_BOM
	LDY	#0
	STY	HB_P
	JSR	CHKHISBB
	INC	OFF_TIME
SHOT_NOP:
	DEC	OFF_TIME
	INC	BOM_TTT
	LDA	BOM_TTT
	CMP	#75
	BNE	DOXXPLAY
	JSR	CLSPR52
DOXXPLAY:
	LDA	#80
	STA	DELAY_T
DONTPLAY:
;;=============================================================================
;;=============================================================================
	LDX	#8
	LDY	#80H
LOOP	=	*
	DEY
	BNE	POJ0
	DEX
	BEQ	CUT_END
POJ0:	BIT	2002H
	BVS	LOOP
LOOP	=	*
	DEY
	BNE	POJ1
	DEX
	BEQ	CUT_END
POJ1:	BIT	2002H
	BVC	LOOP
CUT_END:
	LDA	#0
	STA	IO5
	STA	IO5

	INC	FLY_CLOCK
	INC	HBCLOCK
	BNE	HB__0
	DEC	HBCLOCK
HB__0:
	INC	CLOCK
	BNE	JCK
	INC	CLOCK+1
JCK:
	JSR	READKEYX
	JSR	MUSIC

	PLA
	STA	HB_P
	PLA
	STA	COUNTER
	PLA
	STA	TEMP5
	PLA
	STA	TEMP4
	PLA
	STA	TEMP3
	PLA
	STA	TEMP2
	PLA
	STA	TEMP1
	PLA
	STA	TEMP0

	LDA	NMIA
	ADC	KEY1
	EOR	RNDBUF
	STA	RNDBUF
	LDA	NMIX
	TAX
	ADC	KEY2
	ADC	RNDBUF+1
	STA	RNDBUF+1
	LDA	NMIY
	TAY
	EOR	RNDBUF+2
	ROL A
	STA	RNDBUF+2
	LDA	NMIA
	RTI
;;=============================================================================
START:
	SEI
	CLD
	LDX	#-2  ;0FEH
	TXS	     ;SP

	LDA	PRT_S
	STA	PRT_E
	STA	PRT_EO

	LDA	#0
	TAY
	STA	ADDR+0
	STA	ADDR+1
LOOP:	=	*
	STA	(ADDR),Y
	INY
	BNE	LOOP

	LDX	#5
	LDY	#0
	LDA	#02H
	STA	ADDR+1
	LDA	#00H
	STA	ADDR+0
LOOP	=	*
	STA	(ADDR),Y
	INY
	BNE	LOOP
	INC	ADDR+1
	DEX
	BNE	LOOP

	LDA	#80
	STA	DELAY_T
	LDA	#8
	STA	PLAY_F
	STA	PAGE
	CLSPR
	JSR	HOME
	LDA	#0
	STA	PAGE
	STA	BG_POINT
	STA	BG_POINT+1
	STA	POINT_XX
	STA	CUTFLAG
	STA	CLOCK
	STA	CLOCK+1
	STA	OLD_CLOCK
	LDA	#10100000B
	STA	PDS_IO
	STA	PDS_REG
	LDA	#01EH
	STA	IO1
	STA	IO1_REG
	LDA	#16
	STA	SPRSIZE
	CLSPR
	JSR	HOME
	LDA	#52
	STA	BOM_NUM
	JSR	PR_PAGE0
	JSR	CCR_WAIT
;;=============================================================================
;;=============================================================================
BEGIN:
	LDA	#0
	STA	LEVEL
	STA	STAGE
	STA	PATH_CNT
	JSR	RE_NUM
	JSR	CCR_C_OFF
GWAN_1:
	LDA	#low	GWAN_1
	STA	HERE
	LDA	#high	GWAN_1
	STA	HERE+1
	LDA	PATH_CNT
	STA	PATH_TMP
	JSR	ALL_NEW
	LDA	M_WRONG
	LDX	M_WRONG+1
	JSR	PLAYMUSIC
	LDA	#11
	STA	CUTFLAG
	LDX	#45
	JSR	WAITSEC_X
	JSR	PR_STAGE
MAINLOOP:
	LDA	BEE_BOM_C
	CMP	TOPBEE
	BCS	PART_2
	JSR	MUST1
	JSR	AAAAA
	JMP	MAINLOOP
PART_2:
	JSR	WAIT_GW
	INC	LEVEL
GWAN_2:
	LDA	#low	GWAN_2
	STA	HERE
	LDA	#high	GWAN_2
	STA	HERE+1
	LDA	PATH_CNT
	STA	PATH_TMP
	JSR	NEWSUB
	JSR	SET_PAGE1
	LDA	M_BOSS
	LDX	M_BOSS+1
	JSR	PLAYMUSIC
	LDX	#124
	STX	FROGSTEP
	LDA	PATHFG,X
	STA	FROG_XX
	LDA	#132
	STA	FROG_YY
	LDA	#1
	STA	DDFLAG
	JSR	PR_STAGE
PART2LOOP:
	LDA	BEE_BOM_C
	CMP	TOPBEE
	BCS	PART_3
	JSR	MUST1
	JSR	AAAAA
	JSR	FROGMOVALR
	JSR	CHK_FROGA
	JMP	PART2LOOP
PART_3:
	JSR	WAIT_GW
	INC	LEVEL
GWAN_3:
	LDA	#low	GWAN_3
	STA	HERE
	LDA	#high	GWAN_3
	STA	HERE+1
	LDA	PATH_CNT
	STA	PATH_TMP
	JSR	NEWSUB
	JSR	SET_PAGE1
	LDA	M_WRONG
	LDX	M_WRONG+1
	JSR	PLAYMUSIC
	LDA	FROGSTEP
	ADC	#128
	STA	FROGSTEP+1
	TAX
	LDA	PATHFG,X
	STA	FROG_XX+1
	LDA	#132
	STA	FROG_YY+1
	LDA	#2
	STA	DDFLAG
	JSR	PR_STAGE
PART3LOOP:
	LDA	BEE_BOM_C
	CMP	TOPBEE
	BCS	PART_4
	JSR	MUST1
	JSR	AAAAA
	JSR	FROGMOVALR
	JSR	CHK_FROGA
	JMP	PART3LOOP
PART_4:
	JSR	WAIT_GW
	INC	LEVEL
GWAN_4:
	LDA	#low	GWAN_4
	STA	HERE
	LDA	#high	GWAN_4
	STA	HERE+1
	LDA	PATH_CNT
	STA	PATH_TMP
	JSR	NEWSUB
	JSR	SET_PAGE1
	LDA	M_BOSS
	LDX	M_BOSS+1
	JSR	PLAYMUSIC
	LDA	FROGSTEP
	ADC	#64
	STA	FROGSTEP+2
	TAX
	LDA	PATHFG,X
	STA	FROG_XX+2
	LDA	#116
	STA	FROG_YY+2
	LDA	#3
	STA	DDFLAG
	JSR	PR_STAGE
PART4LOOP:
	LDA	BEE_BOM_C
	CMP	TOPBEE
	BCS	PART_5
	JSR	MUST1
	JSR	AAAAA
	JSR	FROGMOVALR
	JSR	CHK_FROGA
	JMP	PART4LOOP
PART_5:
	JSR	WAIT_GW
	INC	LEVEL
GWAN_5:
	LDA	#low	GWAN_5
	STA	HERE
	LDA	#high	GWAN_5
	STA	HERE+1
	LDA	PATH_CNT
	STA	PATH_TMP
	JSR	NEWSUB
	JSR	SET_PAGE1
	LDA	M_WRONG
	LDX	M_WRONG+1
	JSR	PLAYMUSIC
	LDA	FROGSTEP
	ADC	#192
	STA	FROGSTEP+3
	TAX
	LDA	PATHFG,X
	STA	FROG_XX+3
	LDA	#116
	STA	FROG_YY+3
	LDA	#4
	STA	DDFLAG
	JSR	PR_STAGE
PART5LOOP:
	LDA	BEE_BOM_C
	CMP	TOPBEE
	BCS	PART_6
	JSR	MUST1
	JSR	AAAAA
	JSR	FROGMOVALR
	JSR	CHK_FROGA
	JMP	PART5LOOP
PART_6:
	JSR	WAIT_GW
	INC	LEVEL
GWAN_6:
	LDA	#low	GWAN_6
	STA	HERE
	LDA	#high	GWAN_6
	STA	HERE+1
	LDA	PATH_CNT
	STA	PATH_TMP
	JSR	NEWSUB
	JSR	SET_PAGE1
	LDA	M_BOSS
	LDX	M_BOSS+1
	JSR	PLAYMUSIC
	LDA	#4
	STA	DDFLAG
	JSR	PR_STAGE
PART6LOOP:
	LDA	BEE_BOM_C
	CMP	TOPBEE
	BCS	PART_N
	JSR	MUST1
	JSR	AAAAA
	JSR	FROGMOVALR
	JSR	CHK_FROGA
	JMP	PART6LOOP
PART_N:
	JSR	WAIT_WON
	LDY	STAGE
	LDA	BITWONT,Y
	STA	BITWONC
	JSR	BIT_WON
	INC	LEVEL
	INC	STAGE
	LDA	LEVEL
	CMP	#30
	BCS	J_PAGEV
	JMP	PR_PAGEW
J_PAGEV:
	JMP	PR_PAGEV
;;======================================================