1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276 |
- ;************************************************************************
- ;* *
- ;* *HK3 DATA ADDRESS SETTING PROGRAM *
- ;* presented by k.morikawa *
- ;* 1992/4/3~ *
- ;************************************************************************
- SECT HK3,,C
- ;by STATE_CHK
- XREF SPECIAL_STATE_CHK,ATTACK_STATE_CHK
- XREF SCREEN_LIM_CHECK,AT_BIT_CHK
- ;by COM_OPE
- XREF COMMAND_OPERATION
- XREF LEVER_SET
- XREF DAMAGE_CUT
- ;by HK3_SUB
- XREF SET_RD16,SET_RD32,ACTION_TIMER_SET
- XREF ACT_TYPE_READ,DISTANCE_SEARCH
- XREF TYPE1_SET,TYPE2_SET,TYPE3_SET
- ;by EM_DATA
- XREF DIS_SEQ_TBL,DEF_SEQ_TBL,SPECIAL_TBL
- XREF SRCH_INIT_TBL,ACTION_TABLE
- XREF REST_TIME_TBL
- XREF FORCE_TBL,LIFE_TBL,TBLNO_TBL
- XREF NML_SEQ_TBL,SP_SEQ_TBL
- XREF SELECT_DISTANCE,STATE_DATA_TBL
- XREF AF_WAIT_TBL
- ;by EM_DATA
- XREF DEFENCE_TBL
- ;by EM_PACK
- XREF PACK_TYPE,PACK_CHG
- ;by EM_FRONT
- XREF DIS_FRNT_TBL
- ;by EM_BACK
- XREF DIS_BACK_TBL
- ;by GAME_SYM
- XREF RAND8
- XREF COM_INT
- INCLUDE LABEL.INC
- INCLUDE HFLAG.INC
- INCLUDE EM_MAC2.INC
- PLAY_ATTACK_CHECK:
- BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
- BNE.S PAC_OFF
- CMP.W #20H,ACT_CTRL+HERO_OFFSET(A6)
- BCC.S PAC_OFF
- TST.B TARGET_Y(A6)
- RTS
- PAC_OFF:
- MOVEQ.L #0,D0
- RTS
- NEAR_CHECK:
- CMP.W #64,X_DIS_NEG(A6)
- BLS.S NEAR_AT
- MOVEQ.L #0,D0
- RTS
- NEAR_AT:
- MOVEQ.L #1,D0
- RTS
- ;************************************************************************
- XDEF INIT_DIS_SET
- XDEF DIS_SRCH_CHK
- ;
- ; *initial_search_distance_setting program
- ;
- ; 1992/6/2
- ;
- INIT_DIS_SET:
- BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
- BNE COMMAND_CHECK
- JSR SPECIAL_STATE_CHK
- BNE SPECIAL_MODE_SET
- JSR NEAR_CHECK(PC)
- BNE NEXT_ACTION_SET
- JSR.S PLAY_ATTACK_CHECK(PC)
- BNE DEFENCE_SET
- ;
- ; JSR AT_BIT_CHK
- ; BEQ DIS_SRCH_1
- ;
- ; JSR AT_CHK_SET(PC)
- ; BNE DEFENCE_SET
- DIS_SRCH_1:
- JSR SCREEN_LIM_CHECK
- BNE SC_LIM_SET
- MOVE.B DIS_MODE(A6),D1
- CMP.B MOVE_MODE(A6),D1
- ; BTST.B #DIS_SRCH_MODE,PLAYER_CONTROL(A6)
- BEQ.L NEXT_ACTION_SET
- BSR COMMAND_CHECK
- MOVE.B PLAY_LEVER+HERO_OFFSET(A6),D0
- BEQ.S DSCC_0
- AND.B #00001100B,D0
- CMP.B LIMIT_STOP(A6),D0
- BNE DSCC_0
- CLR.W PLAY_LEVER+HERO_OFFSET(A6)
- CLR.B ACT_ON(A6)
- JMP NEXT_ACTION_SET(PC)
- DSCC_0:
- TST.B ACT_ON(A6)
- BNE.S DIS_SRCH_CHK_CONT
- MOVEQ.L #0,D1
- MOVE.B MOVE_MODE(A6),D1
- BRA DIS_SRCH_CHK_111
- DIS_SRCH_CHK_CONT:
- RTS
- DIS_SRCH_CHK:
- ; JSR ACTION_TIMER_SET
- MOVE.W #1,EM_STEP(A6)
- LEA.L SRCH_INIT_TBL,A0
- MOVE HERO_TYPE+HERO_OFFSET(A6),D0
- ADD.W D0,D0
- ADD.W D0,D0
- MOVE.W LEVEL_TEMP(A5),D1
- LSR.W #1,D1
- ADD.W D1,D0
- LSL.W #4,D0
- ADD.W D0,A0
- JSR SET_RD16 ;D0 = random_data
- MOVEQ.L #0,D1
- MOVE.B (A0,D0),D1
- ; CMP.B DIS_MODE(A6),D1
- ; BEQ.L NEXT_ACTION_SET
- ;
- DIS_SRCH_CHK_111:
- ADD D1,D1
- ;
- ; checker front_move or back_move
- ;
- MOVE.L ANOTHER_PLAYER(A6),A0
- MOVE X_POSITION+HERO_OFFSET(A0),D0
- LEA.L DIS_SHORT(A6),A1 ;searching distance adrs
- MOVE (A1,D1),D1
- MOVEQ.L #1,D3
- BTST.B #ACTAT_FLIP,ACT_ATTR(A3)
- BNE ID_SET_1
- SUBQ #1,D3
- NEG D1
- ID_SET_1:
- ADD D1,D0 ;distance_mode v_ram_address_set
- ADDQ #2,D3
- SUB X_POSITION+HERO_OFFSET(A6),D0
- BPL ID_SET_2
- SUBQ #2,D3
- NEG D0
- ID_SET_2:
- LEA.L ACTION_SET(PC),A0
- D3R_ADD
- JMP (A0,D3)
- ACTION_SET:
- BRA BACK_ACTION ;0
- BRA FRONT_ACTION ;1
- BRA FRONT_ACTION ;2
- BRA BACK_ACTION ;3
- ;
- ; front_action_set
- ;
- FRONT_ACTION:
- LEA.L DIS_FRNT_TBL,A1
- JMP MOVE_SELECT
- ;
- ; back_action_set
- ;
- BACK_ACTION:
- ; NEG D0
- LEA.L DIS_BACK_TBL,A1
- MOVE_SELECT:
- LEA.L SELECT_DISTANCE,A0
- MOVE HERO_TYPE+HERO_OFFSET(A6),D3
- SUBQ #2,D3
- ADD D3,D3
- ADD D3,D3
- ADDA D3,A0
- ;D3 keep
- MOVEQ.L #0,D1
- MOVEQ.L #3-1,D7
- MVSEL_1:
- CMP (A0)+,D0
- BLT.S MVSEL_2
- ADDQ #1,D1
- MVSEL_2:
- DBRA D7,MVSEL_1
- TST.B D1
- BEQ.L NEXT_MODE_SET
- CLR.B DEF_IN_COUNT(A6)
- SUBQ.B #1,D1
- MOVE.B D1,MOVE_MODE(A6)
- MOVEQ.L #0,D1
- MOVE.B DIS_MODE(A6),D1
- ADDQ.B #1,D1
- ADD D1,D1
- ADD D3,D3
- ADD D3,D1
- ADDA (A1,D1),A1
- ADDA D1,A1
- MOVE (A1),D0
- ADDA #2,A1
- LEA.L PACK_TYPE,A0
- ADD D0,D0
- ADDA (A0,D0),A0
- ADDA D0,A0
- MOVEQ.L #0,D1
- MOVE.B (A0)+,D1 ;max_num(data size)
- JSR SET_RD16 ;0~15(D0)
- JSR PACK_CONV(PC)
- AND D1,D0
- MOVE.B (A0,D0),D0 ;from pack_number to act_tbl_num
- SUBQ.B #1,D0
- D0R_ADD
- ADD.B MOVE_MODE(A6),D0
- ANDI #00FFH,D0
- MOVE.B (A1,D0),D0 ;action_type_set
- MOVE.B D0,DG_TBLNO(A6)
- JSR ATT_SET(PC)
- CLR ACT_COM(A6)
- MOVE.B #1,ACT_ON(A6)
- BRA COMMAND_CHECK
- NEXT_MODE_SET:
- ; MOVE.B SEARCH_MODE(A6),DIS_MODE(A6)
- NEXT_ACTION_SET:
- CLR.B STATE_MODE(A6)
- ; JSR ACTION_TIMER_SET
- MOVE.B NOW_STATE(A6),STATE_MODE(A6)
- JSR ACT_DATA_SET
- CLR ACT_COM(A6)
- CLR.B PLAYER_CONTROL(A6)
- CLR.B NON_DEF_TIME(A6)
- BRA ATTACK_SET
- ;************************************************************************
- XDEF ACT_DATA_SET
- STATE_GET:
- MOVE.L A0,-(SP)
- MOVE.L ANOTHER_PLAYER+HERO_OFFSET(A6),A0
- MOVE.W ACT_CTRL(A0),D0
- MOVE.B STATE_CONV(PC,D0.W),D1
- MOVE.L (SP)+,A0
- RTS
- STATE_CONV:
- DC.B 0,0,0,0,0,0,1,1
- DC.B 1,0,2,2,0,0,0,0
- DC.B 0,0,0,0,0,3,4,0
- DC.B 0,0,0,0,0,0,0,0
- DC.B 0,0,0,0,0,0,3,1
- DC.B 3,0,0,0,0,0,0,0
- DC.B 0,0,0,0,0,0,0,1
- DC.B 3,3,3,0,0,0,0,0
- DC.B 0,3,0,0,0,0,0,0
- DC.B 0,0,0,0,0,0,0,0
- ;
- ; 1992/5/25
- ACT_DATA_SET:
- LEA.L ACTION_TABLE,A0
- MOVEQ.L #0,D0
- MOVEQ.L #0,D1
- MOVE.B NML_SEQ_LV(A6),D0 ;patern_no state
- ADD D0,D0
- ADD D0,D0
- MOVE.L (A0,D0),A0
- BSR STATE_GET
- ; MOVEQ.L #0,D1
- ; MOVE.B STATE_MODE(A6),D1 ;player_state
- ; CMP #6,D1
- ; BLT STATE_SKIP
- ;
- ; MOVEQ.L #0,D1
- STATE_SKIP:
- CLR.B STATE_MODE(A6)
- MOVE.B D1,ATTACK_STATE(A6)
- D1R_ADD
- MOVE.L (A0,D1),A0
- MOVEQ.L #0,D0
- MOVE.B MINE_STATE(A6),D0 ;enemy_mine_state
- MOVE.B D0,ATTACK_STATE2(A6)
- D0R_ADD
- MOVE.L (A0,D0),A0
- ;
- ; top_address setting
- ;
- MOVEQ.L #3,D0 ;data_address top_set
- MOVEQ.L #0,D1
- MOVE.B ATTACK_STATE(A6),D1
- OR.B ATTACK_STATE2(A6),D1
- BNE.S ATS_0001
- CMP.W #72,X_DIS_NEG(A6)
- BLS.S ATS_0000
- ATS_0001:
- MOVE.B DIS_MODE(A6),D0
- ATS_0000:
- ADD D0,D0
- MOVE HERO_TYPE+HERO_OFFSET(A6),D1
- LSL #3,D1
- ADD D1,D0
- ADDA (A0,D0),A0
- ADDA D0,A0
- MOVE.L A0,ACTION_ADRS(A6)
- JSR TBL_ADRS_SET(PC)
- MOVE.W #0,ACT_COM(A6)
- MOVE.B #1,ATTACK_ON(A6)
- MOVE.B #1,ACT_ON(A5)
- RTS
- ;************************************************************************
- XDEF FORCE_DATA_SET
- ;
- ;
- ;
- FORCE_DATA_SET:
- LEA.L FORCE_TBL,A0
- MOVE HERO_TYPE+HERO_OFFSET(A6),D3
- ADD D3,D3
- ADD D3,D3
- MOVEQ.L #0,D1
- MOVE.B HERO_SPIRIT+HERO_OFFSET(A6),D1
- MOVE #-1,D0
- FORCE_LV_SET:
- ADDQ #1,D0
- CMP.B (A0,D0),D1
- BCS FORCE_LV_SET
- ADD.B D0,D0
- ADD.B D0,D0
- MOVE.B D0,FORCE_MODE(A6) ;now_select_mode(force)
- LIFE_DATA_SET:
- LEA.L LIFE_TBL,A0
- ADDA D3,A0
- MOVEQ.L #0,D1
- MOVE HERO_LIFE+HERO_OFFSET(A6),D1
- MOVE #-1,D0
- LIFE_LV_SET:
- ADDQ #1,D0
- CMP.B (A0,D0),D1
- BCS LIFE_LV_SET
- MOVE.B D0,LIFE_MODE(A6)
- REST_TIME_SRCH:
- LEA.L REST_TIME_TBL(PC),A0
- ADDA D3,A0
- JSR STAGE_TIME_RET(PC)
- MOVE #-15,D1
- RT_LV_SET:
- ADD #15,D1
- CMP.B (A0,D1),D0
- BCS RT_LV_SET
- CMP #16,D1
- BLT RT_MODE_SET
- MOVE #15,D1
- RT_MODE_SET
- MOVE.B D1,TIME_MODE(A6)
- LEVEL_SELECT:
- MOVEQ.L #0,D0
- MOVE.B LIFE_MODE(A6),D0
- ADD.B FORCE_MODE(A6),D0
- ADD.B TIME_MODE(A6),D0
- CMP #16,D0
- BLE NORMAL_SET
- MOVEQ.L #15,D0
- NORMAL_SET:
- LEA.L NML_SEQ_TBL,A0
- MOVE HERO_TYPE+HERO_OFFSET(A6),D3
- SUBQ #2,D3
- LSL #4,D3
- ADDA D3,A0
- MOVE.B (A0,D0),NML_SEQ_LV(A6)
- SPECIAL_SET:
- LEA.L SP_SEQ_TBL,A0
- ADDA D3,A0
- MOVE.B (A0,D0),SP_SEQ_LV(A6)
- DISTANCE_SET:
- LEA.L DIS_SEQ_TBL,A0
- ADDA D3,A0
- MOVE.B (A0,D0),DIS_SEQ_LV(A6)
- LEA.L DEF_SEQ_TBL,A0
- ADDA D3,A0
- MOVE.B (A0,D0),DEF_SEQ_LV(A6)
- RTS
- ;************************************************************************
- XDEF TBL_ADRS_SET
- ;
- ;
- ;
- ; *receive_resista:A1(action_table_top)
- ;
- TBL_ADRS_SET:
- MOVE.L ACTION_ADRS(A6),A1
- MOVE.W (A1),D0
- ;
- ; soft_dip_level setting
- ;
- ADDA.W #2,A1 ;pack_data size skip
- LEA.L PACK_TYPE,A0
- ADD.W D0,D0
- ADDA.W (A0,D0),A0
- ADDA.W D0,A0
- MOVEQ.L #0,D1
- MOVE.B (A0)+,D1 ;max_num(data size)
- JSR SET_RD16 ;0~15(D0)
- JSR PACK_CONV(PC)
- AND.W D1,D0
- MOVE.B (A0,D0),D0 ;from pack_number to act_tbl_num
- SUBQ.B #1,D0
- ANDI.W #00FFH,D0
- MOVE.B (A1,D0),D0
- MOVE.B D0,DG_TBLNO(A6)
- ATT_SET:
- LEA.L TBLNO_TBL,A0
- JSR TYPE1_SET
- CMP.W -2(A0),D0
- BLS.S ATT_SET_1
- MOVEQ.L #2BH,D0
- ATT_SET_1:
- SUBQ.W #1,D0
- ADD.W D0,D0
- ADDA.W (A0,D0),A0
- ADDA.W D0,A0
- MOVE.L A0,ACTION_ADRS(A6)
- RTS
- PACK_CONV:
- MOVEM.L D2-D3/A0,-(SP)
- MOVEQ.L #0,D2
- CMP.B #7,D1
- BCS.S PACK_NO_CONV
- BEQ.S PACK_CONV_1
- MOVEQ.L #64,D2
- PACK_CONV_1:
- MOVE.W LEVEL_TEMP(A5),D3
- ADD.W D3,D3
- MOVE.W PACK_LEVEL(PC,D3.W),D3
- BMI.S PACK_NO_CONV
- ADD.W D3,D2
- LEA.L PACK_CHG,A0
- LEA.L 0(A0,D2.W),A0
- JSR.S RAND8
- AND.W #3FH,D0
- MOVE.B 0(A0,D0.W),D0
- PACK_NO_CONV:
- MOVEM.L (SP)+,D2-D3/A0
- RTS
- PACK_LEVEL:
- DC.W 0,0,-1,-1,128,128,256,256
- ;************************************************************************
- XDEF SPECIAL_ADRS_SET
- ;
- ;
- ;
- SPECIAL_ADRS_SET:
- MOVE.L ANOTHER_PLAYER(A6),A1
- JSR ACT_TYPE_READ(PC)
- ; MOVEQ.L #0,D0
- ; MOVE.B STATE_MODE(A6),D0
- ; SUBQ.B #1,D0
- MOVE.B D4,D0
- BPL NEXT_ACTION_SET
- AND.W #7FH,D0
- SUBQ.B #1,D0
- D0R_ADD
- LEA.L SPECIAL_TBL,A0
- TST.B SP_SEQ_LV(A6)
- BEQ.S SPAS_00
- LEA.L 44(A0),A0
- SPAS_00:
- MOVE.L (A0,D0),A0
- ;
- ; top_address setting
- ;
- MOVEQ.L #0,D0 ;data_address top_set
- MOVE.B DIS_MODE(A6),D0
- ADD.W D0,D0
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),D1
- LSL.W #3,D1
- ADD.W D0,D1
- ADDA.W (A0,D1),A0
- ADDA.W D1,A0
- MOVE.L A0,ACTION_ADRS(A6)
- JSR TBL_ADRS_SET(PC)
- RTS
- ;************************************************************************
- ;
- ;
- ;
- STAGE_TIME_RET:
- MOVEQ.L #0,D0
- MOVE.B STAGE_TIME(A5),D0
- MOVE.W D0,D1
- ANDI.W #0FH,D0
- LSR.W #4,D1
- ADD.B BCD_EXCHG_DATA(PC,D1),D0
- RTS
- BCD_EXCHG_DATA:; 0: 10: 20: 30: 40: 50: 60: 70: 80: 90
- DC.B 00H,0AH,14H,1EH,28H,32H,3CH,46H,50H,5AH
- ;
- ;************************************************************************
- XDEF SPECIAL_CHECK
- ;
- ;
- ;
- SPECIAL_MODE_SET:
- MOVE #EM_SPECIAL,EM_STEP(A6)
- CLR.B PLAYER_CONTROL(A6)
- CLR.B STATE_CNT(A6)
- CLR ACT_COM(A6)
- MOVE.L ACTION_ADRS(A6),A0
- CMP.B #6,(A0)
- BEQ DEF_SET_000
- BSET.B #SPECIAL_MODE,PLAYER_CONTROL(A6)
- BRA COMMAND_CHECK
- SPECIAL_CHECK:
- ; MOVE.L ANOTHER_PLAYER(A6),A0
- ; TST.B SPECIAL_USE(A0)
- ; BEQ COMMAND_CHECK
- JSR SPECIAL_STATE_CHK
- BNE SPECIAL_MODE_SET
- CMP.B #8,SPEED_RANK(A6)
- BCC COMMAND_CHECK
- JSR.S PLAY_ATTACK_CHECK(PC)
- BEQ COMMAND_CHECK
- CLR.B SPEED_RANK(A6)
- JMP DEFENCE_SET(PC)
- ; CLR ACT_COM(A6)
- MOVE.W #00001110B,D0
- AND.B HERO_STATE+HERO_OFFSET(A6),D0
- BNE SP_CHK_1
- BSR COMMAND_OPERATION
- TST.B ACT_ON(A6)
- BNE.S SP_CHK_1
- CLR.B SPEED_RANK(A6)
- TST.B NOW_STATE(A6)
- BPL.S SP_CHK_1
- MOVE.W #12,EM_STEP(A6)
- SP_CHK_1:
- RTS
- ;************************************************************************
- XDEF ATTACK_CHECK
- ;
- ;
- ;
- ATTACK_SET:
- MOVE #EM_ATTACK,EM_STEP(A6)
- CLR.B PLAYER_CONTROL(A6)
- CLR.B STATE_CNT(A6)
- BSET.B #ATTACK_MODE,PLAYER_CONTROL(A6)
- CLR.B DEF_IN_COUNT(A6)
- CLR ACT_COM(A6)
- BRA COMMAND_CHECK
- ATTACK_CHECK:
- CMP.B #5,STEP2+HERO_OFFSET(A6)
- BEQ.S DM_NON
- BTST.B #BHS_DAMAGE,HERO_STATE+HERO_OFFSET(A6)
- BNE DAMAGE_CUT
- DM_NON:
- JSR SPECIAL_STATE_CHK
- BNE SPECIAL_MODE_SET
- ; TST.B NON_DEF_TIME(A6)
- ; BNE.S ATC_000
- JSR.S PLAY_ATTACK_CHECK(PC)
- BNE DEFENCE_SET
- ; BRA AT_CHK_1
- ATC_000:
- ; SUBQ.B #1,NON_DEF_TIME(A6)
- AT_CHK_1:
- JSR SCREEN_LIM_CHECK
- BNE SC_LIM_SET
- ; MOVE.W #00001110B,D0
- ; AND.B HERO_STATE+HERO_OFFSET(A6),D0
- ; BNE AT_CHK_2
- MOVE.B LIMIT_STOP(A6),D0
- BEQ.S AT_CHK_101
- CMP.B PLAY_LEVER+HERO_OFFSET(A6),D0
- BNE.S AT_CHK_101
- CLR.W PLAY_LEVER+HERO_OFFSET(A6)
- MOVE.W #1,EM_STEP(A6)
- MOVEQ.L #0,D1
- JMP DIS_SRCH_CHK_111(PC)
- AT_CHK_101:
- MOVE.W #00011110B,D0
- AND.B HERO_STATE+HERO_OFFSET(A6),D0
- BNE AT_CHK_102
- CMP.W #19H,ACT_CTRL+HERO_OFFSET(A6)
- BEQ.S AT_CHK_102
- CMP.B #1,ATTACK_STATE2(A6)
- BEQ.S AT_CHK_102
- BSR STATE_GET
- CMP.B ATTACK_STATE(A6),D1
- BNE NEXT_ACTION_SET
- AT_CHK_102:
- BSR COMMAND_CHECK
- TST.B ATTACK_ON(A6)
- BNE AT_CHK_2
- JSR.S RAND8
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),D1
- ADD.W D1,D1
- ADD.W D1,D1
- ADD.W D1,D1
- ADD.W LEVEL_TEMP(A5),D1
- MOVE.B NEXT_ATTACK_PER(PC,D1.W),D1
- CMP.B D1,D0
- BCS NEXT_ACTION_SET
- MOVE.W #1,EM_STEP(A6)
- MOVEQ.L #0,D1
- MOVE.B DIS_MODE(A6),D1
- MOVE.B NEXT_AT_DIS(PC,D1.W),D1
- JMP DIS_SRCH_CHK_111(PC)
- AT_CHK_2:
- RTS
- NEXT_AT_DIS:
- DC.B 2,2,0,0
- NEXT_ATTACK_PER:
- DC.B 060H,068H,070H,080H,090H,0A0H,0B0H,0C0H
- DC.B 060H,068H,070H,080H,090H,0A0H,0B0H,0C0H
- ; DC.B 040H,048H,050H,060H,070H,080H,0A0H,0C0H 1
- DC.B 030H,038H,040H,050H,060H,080H,0A0H,0C0H 1
- DC.B 040H,048H,050H,060H,070H,080H,0A0H,0C0H 2
- DC.B 050H,060H,070H,080H,090H,0B0H,0D0H,0F0H 3
- DC.B 050H,060H,070H,080H,090H,0B0H,0D0H,0D0H 4
- DC.B 030H,038H,048H,058H,060H,068H,070H,078H 5
- DC.B 050H,058H,060H,070H,080H,0A0H,0B0H,0C0H 6
- DC.B 080H,088H,090H,098H,0A0H,0B0H,0C0H,0D0H 7
- DC.B 0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H,0F0H 8
- ;************************************************************************
- ;
- ;
- ;
- XDEF SCLIM_CHECK
- SC_LIM_SET:
- MOVE #EM_SCLIM,EM_STEP(A6)
- CLR.B PLAYER_CONTROL(A6)
- CLR.B STATE_CNT(A6)
- CLR ACT_COM(A6)
- SCLIM_CHECK:
- JSR SPECIAL_STATE_CHK
- BNE SPECIAL_MODE_SET
- JSR.S PLAY_ATTACK_CHECK(PC)
- BNE DEFENCE_SET
- ; JSR AT_BIT_CHK
- ; BEQ SCLIM_CHK_1
- ;
- ; JSR AT_CHK_SET(PC)
- ; BNE DEFENCE_SET
- SCLIM_CHK_1:
- MOVE.W #00001110B,D0
- AND.B HERO_STATE+HERO_OFFSET(A6),D0
- BNE SCLIM_CHK_2
- BRA COMMAND_CHECK
- SCLIM_CHK_2:
- RTS
- ;************************************************************************
- ;
- ;
- ;
- COMMAND_CHECK:
- TST EM_INT(A6)
- BEQ COM_CHK_1
- JSR COM_INT
- COM_CHK_1:
- JSR COMMAND_OPERATION
- BTST.B #COM_RESULT_END,PLAYER_CONTROL(A6)
- BEQ COM_CHECK_NEXT
- CLR.B STATE_MODE(A6)
- MOVE #EM_INIT,EM_STEP(A6)
- BTST.B #DAMAGE_END,PLAYER_CONTROL(A6)
- BEQ COM_CHECK_NEXT
- MOVE #EM_ATTACK,EM_STEP(A6)
- COM_CHECK_NEXT:
- RTS
- ;************************************************************************
- XDEF AT_CHK_SET
- ;
- ;
- ;
- AT_CHK_SET:
- MOVE.L ANOTHER_PLAYER(A6),A2
- MOVE #00000110B,D0
- AND.B HERO_STATE+HERO_OFFSET(A2),D0
- LSR #1,D0
- MOVE.B AT_EXG_DATA1(PC,D0),D0
- MOVE #00110000B,D1
- AND.B HERO_STATE+HERO_OFFSET(A2),D1
- LSR.B #4,D1
- CMP #34h,ACT_CTRL+HERO_OFFSET(A2)
- BNE ATCHK_S1
- ADDQ.B #2,D1
- ATCHK_S1:
- MOVE.B AT_EXG_DATA2(PC,D1),D1
- ADD.B D1,D0
- MOVE HERO_TYPE+HERO_OFFSET(A2),D2
- LSL #4,D2
- ADD D2,D0
- MOVE AT_DEF_DATA(PC,D0),D0
- CMP X_DIS_NEG(A6),D0
- BGE AT_BF_SET
- MOVEQ.L #0,D0
- RTS
- AT_BF_SET:
- MOVEQ.L #1,D0
- RTS
- AT_EXG_DATA1:
- DC.B 0,4,6,0
- AT_EXG_DATA2:
- DC.B 0,4,8,0
- AT_DEF_DATA
- ;1p
- DC.W 0,0
- DC.W 140 ;punch
- DC.W 120 ;kick
- DC.W 185 ;jump_punch
- DC.W 185 ;jump_kick
- DC.W 165 ;down_punch
- DC.W 165 ;down_kick
- ;2p
- DC.W 0,0
- DC.W 140 ;punch
- DC.W 120 ;kick
- DC.W 185 ;jump_punch
- DC.W 185 ;jump_kick
- DC.W 165 ;down_punch
- DC.W 165 ;down_kick
- XDEF AT_BF_CHECK
- ;
- ;
- ;
- AT_BF_CHECK
- MOVEQ.L #0,D0
- MOVE.L ACTION_ADRS(A6),A0
- BRA LEVER_SET
- ;************************************************************************
- UP_GARD EQU 14h+80h
- DOWN_GARD EQU 08h+80h
- DEFENCE_SET:
- MOVE #EM_DEF_WAIT,EM_STEP(A6)
- MOVE.L A1,-(SP)
- MOVE.L ANOTHER_PLAYER(A6),A1
- MOVE HERO_TYPE+HERO_OFFSET(A1),D0
- MOVE.L (SP)+,A1
- ADD.W D0,D0
- ADD.W D0,D0
- ADD.W D0,D0
- MOVEQ.L #0,D1
- MOVE.B DEF_SEQ_LV(A6),D1
- ADD D1,D1
- ADD D1,D1
- ADD D1,D0
- LEA DEFENCE_TBL,A0
- MOVE.L (A0,D0),A0
- MOVE HERO_TYPE+HERO_OFFSET(A6),D0
- SUB.B #2,D0
- LSL #5,D0 ;defence_tbl top_address
- MOVEQ.L #0,D1
- MOVE.B NOW_STATE(A6),D1
- BPL.S DDD000
- MOVEQ.L #0,D1
- DDD000:
- MOVE.B D1,STATE_MODE(A6)
- MOVE.B D1,TEST_R+1(A5)
- CMP.B #7,D1
- BCS.S DDDOOO
- MOVE.B D1,STATE_MODE(A6)
- MOVE.B D1,TEST_R+1(A5)
- SUB #7,D1
- DDDOOO:
- ADD D1,D1
- ADD D1,D0
- ADDA (A0,D0),A0
- ADDA D0,A0
- MOVE.L A0,ACTION_ADRS(A6)
- JSR TBL_ADRS_SET
- MOVE.W #0,ACT_COM(A6)
- ANDI.B #11000111B,PLAYER_CONTROL(A6)
- CMP.B #6,(A0)
- BNE CHG_ATTACK
- DEF_SET_000:
- ; MOVE.B 1(A0),SEARCH_WAIT(A6)
- MOVE #EM_DEF_WAIT,EM_STEP(A6)
- CLR.B ATTACK_ON(A6)
- CMP.B #4,2(A0)
- BEQ DEF_SET_1
- MOVEQ.L #0,D0
- MOVE.B #DOWN_GARD,D0
- JSR LEVER_SET
- MOVE.B #6,BEFORE_LEVER(A6)
- RTS
- DEF_SET_1:
- MOVEQ.L #0,D0
- MOVE.B #UP_GARD,D0
- JSR LEVER_SET
- MOVE.B #4,BEFORE_LEVER(A6)
- RTS
- CHG_ATTACK:
- CLR.B SPEED_RANK(A6)
- MOVE.B #30,NON_DEF_TIME(A6)
- BRA ATTACK_SET
- ;************************************************************************
- XDEF DEFENCE_WAIT
- ;
- ;
- ;
- DEFENCE_WAIT:
- BTST.B #BHS_DAMAGE,HERO_STATE+HERO_OFFSET(A6)
- BNE DEF_NEXT_DMG ;damage_check
- ; TST.B SEARCH_WAIT(A6)
- ; BNE DEF_WAIT_10
- AF_DEF:
- MOVE.L ANOTHER_PLAYER+HERO_OFFSET(A6),A0
- TST.B SPECIAL_USE(A0)
- BNE.S DEF_WAIT_11
- TST.B TARGET_Y(A6)
- BNE.S DEF_WAIT_11
- JMP DEFENCE_SET(PC)
- DEF_WAIT_10:
- SUBQ.B #1,SEARCH_WAIT(A6)
- DEF_WAIT_11:
- MOVEQ.L #0,D0
- ; MOVE.B BEFORE_LEVER(A6),D0
- MOVE.L ACTION_ADRS(A6),A0
- MOVE.B 2(A0),D0
- BRA LEVER_SET
- XDEF HK3_DMG,HK3_JUMP_DMG
- DEF_NEXT_DMG:
- MOVE.W #15,EM_STEP(A6)
- HK3_DMG:
- BTST.B #BHS_JUMP,HERO_STATE+HERO_OFFSET(A6)
- BEQ.S HK3_DMG_1
- MOVE.W #16,EM_STEP(A6)
- HK3_DMG_1:
- CMP.W #0DH,ACT_CTRL+HERO_OFFSET(A6)
- BEQ.S HK3_DMG_2
- CMP.W #13H,ACT_CTRL+HERO_OFFSET(A6)
- BNE OFF_DMG
- HK3_DMG_2:
- MOVEQ.L #0,D0
- ; MOVE.B BEFORE_LEVER(A6),D0
- MOVE.L ACTION_ADRS(A6),A0
- MOVE.B (A0),D0
- BRA LEVER_SET
- OFF_DMG:
- MOVE #EM_DEF_WAIT,EM_STEP(A6)
- JMP AF_DEF(PC)
- HK3_JUMP_DMG:
- CMP.B #5,STEP2+HERO_OFFSET(A6)
- BEQ OFF_JDMG
- CMP.W #0DH,ACT_CTRL+HERO_OFFSET(A6)
- BEQ.S HK3_JDMG_2
- CMP.W #13H,ACT_CTRL+HERO_OFFSET(A6)
- BNE OFF_JDMG
- HK3_JDMG_2:
- MOVEQ.L #0,D0
- ; MOVE.B BEFORE_LEVER(A6),D0
- MOVE.L ACTION_ADRS(A6),A0
- MOVE.B (A0),D0
- BRA LEVER_SET
- OFF_JDMG:
- JSR NEAR_CHECK(PC)
- BEQ.S OFF_JDMG_1
- CLR.B DEF_IN_COUNT(A6)
- CLR.B SPEED_RANK(A6)
- JMP NEXT_ACTION_SET(PC)
- OFF_JDMG_1:
- TST.B TARGET_Y(A6)
- BNE OFF_DMG
- CLR.B DEF_IN_COUNT(A6)
- CLR.B SPEED_RANK(A6)
- MOVE.W #1,EM_STEP(A6)
- JMP DIS_SRCH_CHK(PC)
- ;************************************************************************
- DEF_NEXT_CHECK:
- MOVE HERO_TYPE+HERO_OFFSET(A6),D1
- SUBQ #2,D1
- ADD D1,D1
- LEA.L AF_WAIT_TBL,A2
- ADDA (A2,D1),A2
- MOVEQ.L #0,D1
- MOVE.B STATE_MODE(A6),D1
- CLR.B STATE_MODE(A6)
- ; SUBQ.B #7,D1
- MOVE.B (A2,D1),SRCH_TIMER(A6)
- MOVE #EM_DEF_NEXT,EM_STEP(A6)
- MOVEQ.L #0,D0
- MOVE.B #UP_GARD,D0
- JSR DEF_STATE_READ(PC)
- BEQ DEF_UP_1
- MOVE.B #DOWN_GARD,D0
- DEF_UP_1:
- MOVE.L ACTION_ADRS(A6),A0
- BRA LEVER_SET
- ;************************************************************************
- XDEF DEFENCE_NEXT
- DEFENCE_NEXT:
- BTST.B #BHS_DAMAGE,HERO_STATE+HERO_OFFSET(A6)
- BNE SEARCH_SEND ;damage_check
- TST.B SRCH_TIMER(A6)
- BEQ DEFENCE_END
- SUB.B #1,SRCH_TIMER(A6)
- MOVE X_DIS_NEG(A6),D0
- CMP #190,D0
- BGT DEFENCE_END
- JSR REPEAT_STATE_CHK(PC)
- BNE SEARCH_SEND OKADA
- JSR DEF_STATE_READ(PC)
- BEQ DEF_UP
- DEF_DOWN:
- MOVE.B #30,SEARCH_WAIT(A6)
- MOVE #EM_DEF_DOWN,EM_STEP(A6)
- MOVE.B #0,BEFORE_STATE(A6)
- MOVE #DOWN_GARD,D0
- MOVE.L ACTION_ADRS(A6),A0
- JSR LEVER_SET
- BRA DOWN_DEFENCE
- DEF_UP:
- MOVE.B #30,SEARCH_WAIT(A6)
- MOVE #EM_DEF_UP,EM_STEP(A6)
- MOVE.B #0,BEFORE_STATE(A6)
- MOVE #UP_GARD,D0
- MOVE.L ACTION_ADRS(A6),A0
- JSR LEVER_SET
- ;************************************************************************
- XDEF UP_DEFENCE
- ;
- ;
- UP_DEFENCE:
- TST.B SEARCH_WAIT(A6)
- BEQ CHG_DEF_NEXT
- SUB.B #1,SEARCH_WAIT(A6)
- JSR REPEAT_STATE_CHK(PC)
- BNE CHG_DEF_NEXT
- MOVE #4,D0
- MOVE.L ACTION_ADRS(A6),A0
- BRA LEVER_SET
- ;************************************************************************
- XDEF DOWN_DEFENCE
- ;
- ;
- ;
- DOWN_DEFENCE:
- TST.B SEARCH_WAIT(A6)
- BEQ CHG_DEF_NEXT
- SUB.B #1,SEARCH_WAIT(A6)
- JSR REPEAT_STATE_CHK(PC)
- BNE CHG_DEF_NEXT
- MOVE #4+2,D0
- MOVE.L ACTION_ADRS(A6),A0
- BRA LEVER_SET
- ;************************************************************************
- CHG_DEF_NEXT:
- MOVE.B #0,NOW_STATE(A6)
- MOVE #EM_DEF_NEXT,EM_STEP(A6)
- SEARCH_SEND:
- MOVE.L ACTION_ADRS(A6),A0
- MOVEQ.L #00000010B,D0
- AND.B BEFORE_LEVER(A6),D0
- MOVE.L ANOTHER_PLAYER(A6),A2
- MOVE.B HERO_STATE+HERO_OFFSET(A2),D1
- ANDI.B #00000110B,D1
- BEQ S_SEND_END ;now_attack ?
- ORI.B #00000100B,D0
- S_SEND_END:
- MOVE.L ACTION_ADRS(A6),A0
- BRA LEVER_SET
- ;************************************************************************
- ; *return_resista :D0(not_equal => SEARCH_SEND)
- ; ( equal => defence_mode)
- REPEAT_STATE_CHK:
- MOVEQ.L #0,D0
- MOVE.L ANOTHER_PLAYER(A6),A2
- CLR.W (A5)
- MOVE.B WORK_N0+HERO_OFFSET(A2),(A5)
- MOVE.W (A5),D0
- CLR.W (A5)
- BTST.B #4,ACT_FLAG(A5,D0)
- BEQ REP_NON_SET ;now_attack ?
- MOVEQ.L #0,D0
- RTS
- MOVEQ.L #0,D1
- MOVE.B NOW_STATE(A6),D1
- CMP.B #7,D1
- BLT REP_STA_NEXT
- CMP.B BEFORE_STATE(A6),D1
- SEQ D0
- REP_NON_SET
- ADDQ.B #1,D0
- RTS
- REP_STA_NEXT:
- MOVEQ.L #0,D0
- RTS
- ;************************************************************************
- ; *return_resista :D0
- DEF_STATE_READ:
- MOVEQ.L #0,D0
- CMP.B #7,NOW_STATE(A6)
- BLT DEF_READ_END
- MOVEQ.L #0,D1
- MOVE.B NOW_STATE(A6),D1
- SUB.B #7,D1
- MOVE.B EXCHG_ATLV_DATA(PC,D1),D1
- SEQ D0
- ADDQ.B #1,D0
- DEF_READ_END:
- RTS
- EXCHG_ATLV_DATA:
- DC.B 0 ;ËÀÞØ ½ÄÚ°Ä ;1
- DC.B 0 ;Ð·Þ ½ÄÚ°Ä ;2
- DC.B 0 ;Ð·Þ Ì¯¸ ;3
- DC.B 0 ;ÎÞÃÞ¨ÌÞÛ° ;4
- DC.B 0 ;ËÀÞØ¥Öº¹ÞØ ;5
- DC.B 0 ;³¼Û¥Ïܼ¹ÞØ ;6
- DC.B 0 ;ÄËÞ¥Ïܼ¹ÞØ ;7
- DC.B 1 ;Û°·¯¸ ;8
- DC.B 1 ;¶¶ÞÐ ¾²¹Ý½Þ· ;9
- DC.B 1 ;¶¶ÞÐ¥±¼ÊÞײ ;10
- DC.B 0 ;ÄËÞ¹ÞÀÞÝ ¾²¹Ý ;11
- DC.B 0 ;ÄËÞ¥Öº¹ÞØ ;12
- DC.B 0 ;ËÞÙÄ¥±¯Êß° ;13
- DC.B 0
- ;************************************************************************
- DEFENCE_END:
- CLR ACT_COM(A6)
- CLR.B STATE_MODE(A6)
- CLR.B PLAYER_CONTROL(A6)
- MOVE.B NOW_STATE(A6),STATE_MODE(A6)
- JSR ACT_DATA_SET
- MOVE #EM_ATTACK,EM_STEP(A6)
- BRA ATTACK_CHECK
- ;************************************************************************
- INCLUDE WORK.INC
- ;************************************************************************
|