123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536 |
- ************************************************************************
- * *
- * 044 [ART OF FIGHT] *
- * ENEMY MAIN PROGRAM *
- * by K.MORIKAWA *
- * from 91/11/29 Fri 10:37 *
- * *
- ************************************************************************
- XDEF INIT_HK3,HK3_SYSTEM
- XDEF ACTION_SYSTEM
- XREF ?A5
- SECT HK3,,C
- ;by HK3_SET
- XREF FORCE_DATA_SET,ACT_DATA_SET
- XREF INIT_DIS_SET,SPECIAL_ADRS_SET
- XREF MINE_STATE_SET
- XREF ATTACK_CHECK,SPECIAL_CHECK,SCLIM_CHECK
- XREF AT_BF_CHECK
- XREF DIS_SRCH_CHK
- ;by HK3_INT
- XREF SPECIAL_CHECKER
- XREF COM_INT1,COM_INT2,COM_INT3,COM_INT4
- ;by HK3_SUB
- XREF ACTION_TIMER_SET,DISTANCE_CHECK,DISTANCE_SEARCH
- XREF HK3_DMG,HK3_JUMP_DMG
- ;by COM_OPE
- XREF COMMAND_OPERATION,COMMAND_WAIT
- XREF OPERATION_STOP
- XREF DEFENCE_WAIT,SANKAKU_PROG
- XREF UP_DEFENCE,DOWN_DEFENCE
- XREF DEFENCE_NEXT
- ;by EM_DATA
- XREF FORCE_TBL
- ;by STATE_CHK
- XREF SPECIAL_STATE_CHK,ATTACK_STATE_CHK
- XREF SCREEN_LIM_CHECK
- ;by GAME_SYM
- XREF RAND8
- ;by NEWS
- XREF INIT_NEWS,NEWS
- INCLUDE MACRO.INC @@@
- INCLUDE NEO_GEO.INC @@@
- INCLUDE LABEL.INC
- INCLUDE HFLAG.INC
- INCLUDE EM_MAC2.INC
- INCLUDE CML.INC
- ;
- ; *** initialize ***
- ;
- INIT_HK3:
- ; BCLR.B #BPS_HK3_INIT,PLAYER_STATE(A6)
- ; RTS
- ;
- BCLR.B #BPS_HK3_INIT,PLAYER_STATE(A6)
- BEQ.S INIT_HK3_1
- RTS
- INIT_HK3_1:
- OR.B #PS_HK3_INIT,PLAYER_STATE(A6)
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),D0
- ADD.W D0,D0
- ADD.W D0,D0
- MOVE.L INIT_HK3_VECTOR(PC,D0.W),A0
- JMP (A0)
- INIT_HK3_VECTOR:
- DC.L INIT_PL1
- DC.L INIT_PL2
- DC.L INIT_M1
- DC.L INIT_M2
- DC.L INIT_M3
- DC.L INIT_M4
- DC.L INIT_M5
- DC.L INIT_M6
- DC.L INIT_M7
- DC.L INIT_M8
- ;
- ; *** system main ***
- ;
- ; receive_resista :A6(player_logical_work)
- HK3_SYSTEM:
- ; MOVE.W PLAY_LEVER(A6),PLAY_LEVER+HERO_OFFSET(A6)
- ; MOVE.B PLAY_LEVER+2(A6),PLAY_LEVER+2+HERO_OFFSET(A6)
- ; RTS
- ;
- BTST.B #BPS_COM_FLAG,PLAYER_STATE(A6)
- BNE.S HK3_1
- MOVEQ.L #3,D0
- AND.B DEBUG_DIP1(A5),D0
- BNE.S HK3_1
- HK3_2:
- BTST.B #BPS_HK3_INIT,PLAYER_STATE(A6)
- BNE.S HK3_3
- JSR INIT_HK3_1(PC)
- HK3_3:
- CLR.W PLAY_LEVER+HERO_OFFSET(A6)
- CLR.B PLAY_LEVER+2+HERO_OFFSET(A6)
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),D0
- ADD.W D0,D0
- ADD.W D0,D0
- MOVE.L HK3_VECTOR(PC,D0.W),A0
- JMP (A0)
- HK3_1:
- MOVE.W PLAY_LEVER(A6),PLAY_LEVER+HERO_OFFSET(A6)
- MOVE.B PLAY_LEVER+2(A6),PLAY_LEVER+2+HERO_OFFSET(A6)
- RTS
- HK3_VECTOR:
- DC.L HK3_PL1
- DC.L HK3_PL2
- DC.L HK3_M1
- DC.L HK3_M2
- DC.L HK3_M3
- DC.L HK3_M4
- DC.L HK3_M5
- DC.L HK3_M6
- DC.L HK3_M7
- DC.L HK3_M8
- INIT_PL1:
- INIT_PL2:
- MOVE.W #118H,DIS_LONG(A6)
- MOVE.W #0B0H,DIS_MID(A6)
- MOVE.W #231H-1C6H,DIS_SHORT(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M1:
- MOVE.W #78H,DIS_SHORT(A6)
- MOVE.W #0F8H,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M2:
- MOVE.W #0A0H,DIS_SHORT(A6)
- MOVE.W #10CH,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M3:
- MOVE.W #07DH,DIS_SHORT(A6)
- MOVE.W #0F3H,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M4:
- MOVE.W #70H,DIS_SHORT(A6)
- MOVE.W #0F0H,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M5:
- MOVE.W #80H,DIS_SHORT(A6)
- MOVE.W #0F8H,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M6:
- MOVE.W #78H,DIS_SHORT(A6)
- MOVE.W #0D0H,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M7:
- MOVE.W #0A8H,DIS_SHORT(A6)
- MOVE.W #0F0H,DIS_MID(A6)
- MOVE.W #150H,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- INIT_M8:
- MOVE.W #82H,DIS_SHORT(A6)
- MOVE.W #120H,DIS_MID(A6)
- MOVE.W #150h,DIS_LONG(A6)
- JSR INIT_SET(PC)
- RTS
- HK3_PL1:
- HK3_PL2:
- HK3_M1
- HK3_M2
- HK3_M3
- HK3_M4
- HK3_M5
- HK3_M6
- HK3_M7
- HK3_M8
- JSR ACTION_SYSTEM(PC)
- MOVE.B EM_STEP+1(A6),TEST_R+1(A5)
- JSR HK3_DIP1(PC)
- RTS
- ;************************************************************************
- INIT_SET:
- JSR INIT_NEWS
- MOVE.B MAIN_COUNT+3(A5),RANDOM_SEED(A5)
- MOVEQ.L #0,D0
- MOVE D0,DG_TBLNO(A6)
- MOVE D0,WIN_ROUND+2(A6)
- MOVE.B D0,PLAYER_CONTROL(A6)
- MOVE.B D0,DEF_IN_COUNT(A6)
- MOVE.L D0,EM_STEP(A6)
- MOVE.L D0,X_DIS(A6)
- MOVE.L D0,ACTION_ADRS(A6)
- MOVE.L D0,ACT_WAIT(A6)
- MOVE.L D0,TIME_MODE(A6)
- MOVE.L D0,STATE_CNT(A6)
- MOVE.L D0,SRCH_TIMER(A6)
- MOVE.L D0,SP_SEQ_LV(A6)
- MOVE.B D0,SPEED_RANK(A6)
- MOVE.B D0,ATTACK_ON(A6)
- MOVE.B D0,ACT_ON(A6)
- MOVE #17,EM_STEP(A6)
- ; JSR ACTION_TIMER_SET(PC)
- RTS
- ;************************************************************************
- HK3_DIP1:
- LEA.L EM_OUT,A1
- MOVEQ.L #DISP_HK3,D0
- AND.B DEBUG_DIP1(A5),D0
- BNE.S HKD_1
- ; LEA.L EM_CLEAR,A1
- RTS
- HKD_1:
- MOVE.B PLAYER1+DIS_MODE(A5),TEST_COLOR+1(A5)
- MOVE.B PLAYER1+DG_TBLNO(A5),TEST_PG+1(A5)
- MOVE.B PLAYER2+DIS_MODE(A5),TEST_G+1(A5)
- MOVE.B PLAYER2+DG_TBLNO(A5),TEST_B+1(A5)
- MESS_ON
- MOVE.L A1,(A0)+
- MESS_OFF
- RTS
- ;************************************************************************
- ;
- ; *enemy_action_control system
- ;
- ; presented by k.morikawa
- ; version 1.00 1992/4/27~
- ;
- ; *use_resista:A0(action_data_top or operation_command address)
- ; A3(player logical_data top_address)
- ; A4(job_operation top_address)
- ; A6(player physical_data top_address)
- ;
- ACTION_SYSTEM:
- MOVE.B WORK_N0+HERO_OFFSET(A6),(A5) ;logical_work_setting
- MOVE.W (A5),D0 ;
- LEA.L 0(A5,D0),A3
- JSR RAND8
- JSR NEWS
- MOVE.L ANOTHER_PLAYER(A6),A2
- MOVE X_POSITION+HERO_OFFSET(A2),D0
- SUB X_POSITION+HERO_OFFSET(A6),D0
- MOVE D0,X_DIS(A6)
- TST D0
- BPL ACT_SYS_1
- NEG D0
- ACT_SYS_1:
- MOVE X_DIS_NEG(A6),OLD_X_DIS(A6)
- MOVE D0,X_DIS_NEG(A6)
- JSR DISTANCE_SEARCH
- JSR FORCE_DATA_SET ;player_level_setting
- JSR MINE_STATE_SET
- MOVE EM_STEP(A6),D0
- D0R_ADD
- MOVE.L ACTION_PROG(PC,D0),A0
- JSR (A0)
- JSR TRI_MOVE(PC)
- JSR NEAR_ATTACK(PC)
- RTS
- XDEF ACTION_PROG
- ACTION_PROG:
- DC.L PROG_DUMMY ;0
- DC.L INIT_DIS_SET ;1
- DC.L COM_INT1 ;2 command_interrupt type 1 operation
- DC.L COM_INT2 ;3 command_interrupt type 2 operation
- DC.L COM_INT3 ;4 command_interrupt type 3 operation
- DC.L COM_INT4 ;5 command_interrupt type 4 operation
- DC.L DEFENCE_WAIT ;6
- DC.L DEFENCE_NEXT ;7
- DC.L SANKAKU_PROG ;8
- DC.L UP_DEFENCE ;9
- DC.L DOWN_DEFENCE ;10
- DC.L SPECIAL_CHECK ;11
- DC.L ATTACK_CHECK ;12
- DC.L SCLIM_CHECK ;13
- DC.L AT_BF_CHECK ;14
- DC.L HK3_DMG ;15
- DC.L HK3_JUMP_DMG ;16
- DC.L DIS_SRCH_CHK ;17
- PROG_DUMMY:
- RTS
- NEAR_ATTACK:
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),D1
- MOVE.L ANOTHER_PLAYER+HERO_OFFSET(A6),A0
- BTST.B #BHS_DAMAGE,HERO_STATE(A0)
- BNE.S NA_NON
- BTST.B #BHS_DOWN,HERO_STATE(A0)
- BEQ.S NA_1
- BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
- BNE.S NA_1
- BTST.B #BHS_DOWN,HERO_STATE+HERO_OFFSET(A6)
- BNE.S NA_1
- RTS
- NA_1:
- ADD.W D1,D1
- ADD.W D1,D1
- ADD.W D1,D1
- ADD.W LEVEL_TEMP(A5),D1
- ADD.W D1,D1
- MOVE.W NA_DIST(PC,D1.W),D0
- CMP.W X_DIS_NEG(A6),D0
- BCS.S NA_NON
- JSR.S RAND8
- AND.B #00110000B,D0
- OR.B D0,PLAY_LEVER+HERO_OFFSET+1(A6)
- NA_NON:
- RTS
- NA_DIST:
- DC.W 48,48,48,48,48,48,48,48 H1
- DC.W 48,48,48,48,48,48,48,48 H2
- DC.W 02,04,08,16,24,32,40,48 E1
- DC.W 02,04,08,16,24,32,40,48 E2
- DC.W 08,12,16,24,32,40,48,56 E3
- DC.W 16,32,48,48,50,52,54,54 E4
- DC.W 16,32,48,48,50,52,54,54 E5
- DC.W 02,04,08,16,24,32,40,48 E6
- DC.W 16,32,48,48,48,56,56,56 E7
- DC.W 32,48,56,56,56,56,56,56 E8
- TRI_MOVE:
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),D1
- BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
- BEQ.S TRI_NON
- CMP.W #20H,ACT_CTRL+HERO_OFFSET(A6)
- BCC.S TRI_NON
- ADD.W D1,D1
- ADD.W D1,D1
- ADD.W D1,D1
- ADD.W LEVEL_TEMP(A5),D1
- ADD.W D1,D1
- MOVE.W TRI_DIST(PC,D1.W),D0
- BEQ.S TRI_NON
- TST.B 0(A6,D0.W)
- ; TST.B AREA_POSITION+HERO_OFFSET(A6)
- ; TST.B LIMIT_STOP(A6)
- BEQ.S TRI_NON
- MOVE.L VZ+HERO_OFFSET(A6),D0
- BPL.S TRI_MOVE_1
- NEG.L D0
- TRI_MOVE_1:
- CMP.L #30000H,D0
- BCC.S TRI_NON
- OR.B #01000000B,PLAY_LEVER+1+HERO_OFFSET(A6)
- OR.B #01000010B,PLAY_LEVER+HERO_OFFSET(A6)
- TRI_NON:
- RTS
- TRI_EI:
- DC.B 1,1
- ; 1 2 3 4 5 6 7 8
- DC.B 1,0,1,1,0,1,0,1
- LS EQU LIMIT_STOP
- AP EQU AREA_POSITION+HERO_OFFSET
- TRI_DIST:
- DC.W 00,00,00,00,00,00,00,00 H1
- DC.W 00,00,00,00,00,00,00,00 H2
- DC.W 00,00,LS,LS,AP,AP,AP,AP E1
- DC.W 00,00,00,00,00,00,00,00 E2
- DC.W 00,00,LS,LS,AP,AP,AP,AP E3
- DC.W 00,LS,LS,LS,AP,AP,AP,AP E4
- DC.W 00,00,00,00,00,00,00,00 E5
- DC.W 00,LS,LS,AP,AP,AP,AP,AP E6
- DC.W 00,00,00,00,00,00,00,00 E7
- DC.W 00,LS,AP,AP,AP,AP,AP,AP E8
- ;************************************************************************
- ;
- ; parameter fix output
- ; 1991/12/17
- EM_OUT:
- FIX_FORMAT.B CODE,00FFH
- FIX_AUTO 20H
- FIX_ADRS 2,25
- FIX_PRINTF
- DC.B '1P-STA='
- PARM 2,TEST_PALETTE
- DC.B 0FFH
- FIX_ADRS 2,26
- FIX_PRINTF
- DC.B '1P-DIS='
- PARM 2,TEST_COLOR
- DC.B 0FFH
- FIX_ADRS 2,27
- FIX_PRINTF
- DC.B '1P-TBL='
- PARM 2,TEST_PG
- DC.B 0FFH
- FIX_AUTO 20H
- FIX_ADRS 29,25
- FIX_PRINTF
- DC.B '2P-STA='
- PARM 2,TEST_R
- DC.B 0FFH
- FIX_ADRS 29,26
- FIX_PRINTF
- DC.B '2P-DIS='
- PARM 2,TEST_G
- DC.B 0FFH
- FIX_ADRS 29,27
- FIX_PRINTF
- DC.B '2P-TBL='
- PARM 2,TEST_B
- DC.B 0FFH
- FIX_END
- EM_CLEAR:
- FIX_FORMAT.B CODE,03FFH
- FIX_AUTO 20H
- FIX_ADRS 2,25
- FIX_DIRECT_DATA
- DC.B ' '
- DC.B 0FFH
- FIX_ADRS 2,26
- FIX_DIRECT_DATA
- DC.B ' '
- DC.B 0FFH
- FIX_ADRS 2,27
- FIX_DIRECT_DATA
- DC.B ' '
- DC.B 0FFH
- FIX_ADRS 29,25
- FIX_DIRECT_DATA
- DC.B ' '
- DC.B 0FFH
- FIX_ADRS 29,26
- FIX_DIRECT_DATA
- DC.B ' '
- DC.B 0FFH
- FIX_ADRS 29,27
- FIX_DIRECT_DATA
- DC.B ' '
- DC.B 0FFH
- FIX_END
- ;************************************************************************
- INCLUDE WORK.INC
- ;************************************************************************
|