123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680 |
- ************************************************************************
- * *
- * 044 [ART OF FIGHT] *
- * MAIN PROGRAM *
- * by S.OKADA from 91/09/03 Tue 11:55 *
- * *
- ************************************************************************
- XDEF USER,DEMO_END,COIN_SOUND
- XDEF INT1,INT2
- XDEF MAIN
- XDEF BEFOR_MAIN,AFTER_MAIN
- XDEF FIRST_WORK_INIT,SECOND_WORK_INIT
- XDEF LP_MAIN
- XREF ?A5
- ;by PAUSE
- XREF PAUSE
- ;by BACK
- XREF BACK2_SCROLL_WRITE
- ;by PHASE
- XREF PHASE_CTRL,PHASE_ALL_INIT
- ;by HERO
- INCLUDE HERO_TBL.INC
- ;by DUMMY
- XREF LM_AHO,PM_AHO,PM_HAKO,PM_MAN
- XREF LM_HAKO,PM_HAHEN,LM_HAHEN,PM_F_TREE
- XREF PM_F_TREE,LM_AHO,PM_AHO,LM_KUBIFURI
- XREF PM_KUBIFURI
- ;by DEMO_CML
- XREF PM_EASY,LM_EASY,MASTER_CHECK
- ;by BONUS
- XREF PM_ICE,PM_BEER
- ;by STORY
- XREF LM_PAL_ACT
- ;by GAME_DSP
- XREF PM_HERO_DISP,PM_FIGHT
- XREF LM_HITAREA,PM_HITAREA
- ;by BSEL
- XREF PM_MATO
- SECT GAME,,C
- INCLUDE SYS.INC
- INCLUDE MACRO.INC
- INCLUDE NEO_GEO.INC
- INCLUDE LABEL.INC
- INCLUDE EASY_MAC.INC
- INCLUDE SMACRO.INC
- INCLUDE SCODE.INC
- ;
- ; *** MAIN PROGRAM START ***
- ;
- ; system program user entry
- USER:
- LEA.L ?A5,A5
- MOVEQ.L #0,D0
- MOVE.B USER_REQUEST(A5),D0
- ADD.W D0,D0
- ADD.W D0,D0
- MOVE.L REQUEST_TABLE(PC,D0.W),A0
- JMP (A0)
- REQUEST_TABLE:
- DC.L POWER_ON
- DC.L SYSTEM_RETURN
- DC.L MAIN_INIT
- DC.L MAIN_INIT
- MAIN_INIT:
- JSR FIRST_WORK_INIT(PC)
- JSR PHASE_ALL_INIT(PC)
- JSR SECOND_WORK_INIT(PC)
- ;
- ; *** GAME MAIN LOOP ***
- ;
- MAIN:
- ADDQ.W #7,RANDOM_COUNT(A5)
- TST.B STOPPER(A5)
- BNE.S MAIN
- MOVE.B #1,STOPPER(A5)
- ADDQ.L #1,MAIN_COUNT(A5)
- CLR.L (A5)
- JSR PAUSE(PC)
- TST.W STOP_STEP(A5)
- BNE.S MAIN
- CLR.B LP_MAIN_RUN(A5)
- JSR BEFOR_MAIN(PC)
- JSR PHASE_CTRL(PC)
- JSR LP_MAIN(PC)
- JSR AFTER_MAIN(PC)
- JMP MAIN(PC)
- BEFOR_MAIN:
- BSR MAIN_SHADOW_ON
- BSR COIN_CHECK
- BSR RANDOM_LIST_MAKE
- RTS
- AFTER_MAIN:
- JSR.S COLOR_COMMAND
- BSR MAIN_SHADOW_OFF
- RTS
- CREDIT_DISP:
- TST.B MVS_FLAG(A5)
- BNE CREDIT_DISP_1
- MOVEQ.L #01010000B,D0
- AND.W PHASE(A5),D0
- BNE CREDIT_DISP_8
- LEA.L HOME_CREDIT(A5),A0
- MOVEQ.L #1,D1
- BRA CREDIT_DISP_3
- CREDIT_DISP_1:
- TST.B GAME_DIP+SD_CREDIT(A5) soft dip
- BNE CREDIT_DISP_8
- LEA.L CREDIT(A5),A0
- TST.W POWER_ON_ID(A5)
- BNE.S CREDIT_DISP_2 dev. rom
- LEA.L MVS_CREDIT,A0 mvs
- CREDIT_DISP_2:
- MOVEQ.L #0,D1
- CMP.B #1,COUNTRY_CODE(A5)
- BNE.S CREDIT_DISP_3
- MOVEQ.L #1,D1
- CREDIT_DISP_3:
- LEA.L LSPC_DATA,A2
- MOVE.W #20H,2(A2)
- MOVE.W #2F00H,D2
- TST.W D1
- BEQ CREDIT_DISP_4
- MOVE.W #7000H+20H*3+29,-2(A2)
- BSR CREDIT_DISP_5
- CREDIT_DISP_4:
- MOVE.W #7000H+20H*27+29,-2(A2)
- CREDIT_DISP_5:
- MOVEQ.L #8-1,D7
- LEA.L M_CREDIT(PC),A1
- CMP.B #2,(A0)
- BCS.S CREDIT_DISP_6
- LEA.L M_CREDITS(PC),A1
- CREDIT_DISP_6:
- MOVE.B (A1)+,D2
- MOVE.W D2,(A2)
- DBRA D7,CREDIT_DISP_6
- MOVE.B (A0),D0
- LSR.W #4,D0
- BSR CREDIT_DISP_7
- MOVE.B (A0)+,D0
- CREDIT_DISP_7:
- AND.W #0FH,D0
- MOVE.B CREDIT_BCD(PC,D0.W),D2
- MOVE.W D2,(A2)
- CREDIT_DISP_8:
- RTS
- CREDIT_BCD:
- DC.B 0F0H,0F1H,0F2H,0F3H,0F4H,0F5H,0F6H,0F7H,0F8H,0F9H
- M_CREDIT:
- DC.B 0E0H,0E1H,0E2H,0E3H,0E4H,0EBH,0EBH,0EBH
- M_CREDITS:
- DC.B 0E5H,0E6H,0E7H,0E8H,0E9H,0EAH,0EBH,0EBH
- RANDOM_LIST_MAKE:
- MOVEQ.L #2,D0
- ADD.B MAKE_RANDOM(A5),D0
- LEA.L RANDOM_BUFFER(A5),A0
- MOVE.W RANDOM_COUNT(A5),0(A0,D0.W)
- MOVE.B D0,MAKE_RANDOM(A5)
- RTS
- COIN_SOUND:
- ADDQ.W #1,COIN_COUNT
- RTS
- COIN_CHECK:
- TST.W COIN_COUNT(A5)
- BEQ.S COIN_CHECK_1
- CLR.W COIN_COUNT(A5)
- SOUND #S_COIN coin sound code
- COIN_CHECK_1:
- RTS
- MAIN_SHADOW_ON:
- BTST.B #MAIN_SHADOW,DEBUG_DIP2(A5)
- BEQ.S MAIN_SHADOW_ON_1
- MOVE.B D0,SHADOW_ON
- MAIN_SHADOW_ON_1:
- RTS
- MAIN_SHADOW_OFF:
- BTST.B #MAIN_SHADOW,DEBUG_DIP2(A5)
- BEQ.S MAIN_SHADOW_OFF_1
- MOVE.B D0,SHADOW_OFF
- MAIN_SHADOW_OFF_1:
- RTS
- SYS_RET:
- JMP SYSTEM_RETURN
- DEBUG_VALUE EQU 0F2H
- VERSION_VALUE EQU 0F0H
- POWER_ON:
- BSR POWER_ON_SUB
- JMP SYSTEM_RETURN
- POWER_ON_SUB:
- MOVE.W DEBUG_VALUE,DEBUG_DIP1(A5)
- MOVE.W VERSION_VALUE,VERSION(A5)
- CLR.W COIN_COUNT(A5)
- CLR.B DEMO_NUMBER(A5)
- BSR ALL_RANKING_INIT
- BSR TODAY_SET
- RTS
- TODAY_SET:
- TST.B MVS_FLAG(A5)
- BEQ.S TODAY_SET_HOME
- MOVE.L RANK_TL_S(A5),HI_SCORE(A5)
- JSR READ_CALENDAR
- LEA.L ?A5,A5
- MOVE.L DATE_TIME(A5),TODAY(A5)
- RTS
- TODAY_SET_HOME:
- MOVE.L RANK_TD_S(A5),HI_SCORE(A5)
- RTS
- TODAY_CHECK:
- TST.B MVS_FLAG(A5)
- BEQ.S TODAY_CHECK_1
- MOVE.L TODAY(A5),-(SP)
- JSR READ_CALENDAR
- LEA.L ?A5,A5
- MOVE.L (SP)+,D0
- CMP.L DATE_TIME(A5),D0
- BEQ.S TODAY_CHECK_1
- MOVE.L DATE_TIME(A5),TODAY(A5)
- BSR TODAY_RANKING_INIT
- TODAY_CHECK_1:
- RTS
- ALL_RANKING_INIT:
- LEA.L RANKING_DATA(PC),A0
- LEA.L RANK_TL_S(A5),A1
- MOVEQ.L #2*5*4-1,D7
- ARI_1:
- MOVE.L (A0)+,(A1)+
- DBRA D7,ARI_1
- RTS
- TODAY_RANKING_INIT:
- LEA.L RANKING_DATA_TODAY(PC),A0
- LEA.L RANK_TD_S(A5),A1
- MOVEQ.L #2*5*2-1,D7
- TRI_1:
- MOVE.L (A0)+,(A1)+
- DBRA D7,TRI_1
- RTS
- RANKING_DATA:
- ;story total
- DC.L 199200H,'AGT '
- DC.L 173200H,'SQ3 '
- DC.L 141400H,'SQ2 '
- DC.L 101010H,'42D '
- DC.L 081880H,'NEO '
- RANKING_DATA_TODAY:
- ;story today
- DC.L 141400H,'SQ2 '
- DC.L 101010H,'42D '
- DC.L 081880H,'NEO '
- DC.L 068000H,'12M '
- DC.L 040010H,'CPU '
- ;vs today
- DC.L 000008H,'SNK '
- DC.L 000007H,'E#K '
- DC.L 000006H,'GUS '
- DC.L 000005H,'H#M '
- DC.L 000004H,'A#G '
- ;vs total
- DC.L 000010H,'TEN '
- DC.L 000009H,'NIN '
- DC.L 000008H,'SNK '
- DC.L 000007H,'E#K '
- DC.L 000006H,'GUS '
- DEMO_END:
- BCLR.B #7,SYSTEM_MODE
- MOVEQ.L #0,D0
- LEA.L 100000H,A0
- MOVE.W #8800H/(4*4)-1,D7
- DEMO_END_1:
- MOVE.L D0,(A0)+
- MOVE.L D0,(A0)+
- MOVE.L D0,(A0)+
- MOVE.L D0,(A0)+
- DBRA D7,DEMO_END_1
- LEA.L 109000H,A0
- MOVE.W #6200H/(4*4)-1,D7
- DEMO_END_2:
- MOVE.L D0,(A0)+
- MOVE.L D0,(A0)+
- MOVE.L D0,(A0)+
- MOVE.L D0,(A0)+
- DBRA D7,DEMO_END_2
- RTS
- ;
- ; *** INTERRUPT 1 (v blanking) ***
- ;
- INT1:
- TST.B SYSTEM_MODE
- BPL SYSINT
- MOVEM.L D0-D7/A0-A6,-(SP)
- MOVE.B D0,WATCH_DOG
- LEA.L ?A5,A5
- MOVE.L (A5),-(SP)
- CLR.L (A5)
- ADDQ.L #1,INT1_COUNT(A5)
- MOVEQ.L #SLOW_MODE,D0
- MOVEQ.L #SLOW_MODE,D1
- AND.W INT1_COUNT+2(A5),D0
- AND.B DEBUG_DIP2(A5),D1
- CMP.B D1,D0
- BCS.S INT1_END
- JSR.S COLOR_SET
- MOVE.B LSPC_BUSY(A5),STOPPER(A5)
- BNE.S INT1_1 LSPC access skip
- MOVE.B #1,LSPC_BUSY(A5)
- JSR BACK2_SCROLL_WRITE(PC)
- JSR.S ACTION
- JSR.S NOP_MESS_OUT
- JSR CREDIT_DISP(PC)
- CLR.B LSPC_BUSY(A5)
- INT1_1:
- JSR.S SOUND_SEND
- CLR.B STOPPER(A5)
- JSR SYSTEM_IO
- INT1_END:
- LEA.L ?A5,A5
- MOVE.W LSPC_TIMER2(A5),TIMER_HI
- MOVE.W LSPC_TIMER2+2(A5),TIMER_LOW
- MOVE.L #BACK1_BUFFER,INT2_START(A5)
- MOVE.W INT2_COUNT_BASE(A5),INT2_COUNT(A5)
- MOVE.W LSPC_MODE_STORE(A5),D0
- BSET.L #7,D0
- BCLR.L #6,D0
- MOVE.W D0,LSPC_MODE
- MOVE.L (SP)+,(A5)
- MOVEM.L (SP)+,D0-D7/A0-A6
- MOVE.W #4,INT_CLEAR
- RTE
- SYSINT:
- TRAP #0
- BTST.B #0,ERROR_LEVER
- BEQ SYSINT_1
- ; controller 1 input clear
- CLR.B INPUT_1+3
- CLR.B INPUT_1+4
- CLR.B INPUT_5+3
- CLR.B INPUT_5+4
- SYSINT_1:
- BTST.B #1,ERROR_LEVER
- BEQ SYSINT_2
- ; controller 2 input clear
- CLR.B INPUT_2+3
- CLR.B INPUT_2+4
- CLR.B INPUT_6+3
- CLR.B INPUT_6+4
- SYSINT_2:
- RTE
- INT2:
- MOVEM.L D0/A0,-(SP)
- TST.W INT2_COUNT
- BEQ.S INT2_2
- ; MOVE.B D0,SHADOW_ON
- MOVE.L INT2_START,A0
- TST.B LSPC_BUSY
- BNE.S INT2_1
- MOVE.W (A0),LSPC_ADRS
- MOVE.W 2(A0),LSPC_DATA
- INT2_1:
- ADDQ.L #4,A0
- MOVE.L A0,INT2_START
- SUBQ.W #1,INT2_COUNT
- BNE.S INT2_2
- ; MOVE.B D0,SHADOW_OFF
- MOVE.W LSPC_TIMER1(A5),TIMER_HI
- MOVE.W LSPC_TIMER1+2(A5),TIMER_LOW
- MOVE.W LSPC_MODE_STORE,D0
- BCLR.L #7,D0
- BSET.L #6,D0
- ; MOVE.W D0,LSPC_MODE_STORE
- MOVE.W D0,LSPC_MODE
- INT2_2:
- MOVEM.L (SP)+,D0/A0
- MOVE.W #2,INT_CLEAR
- RTE
- ;
- ; *** WORK INITIALIZE ***
- ;
- FIRST_WORK_INIT:
- ; initialize for interrupt enable
- MOVE.W #4000H,D0
- MOVE.W D0,LSPC_MODE_STORE(A5)
- MOVE.W D0,LSPC_MODE
- JSR.S SYS_FIRST_INIT
- JSR VERSION_CHECK(PC)
- JSR DIP_CHECK(PC)
- MOVEQ.L #0,D0
- MOVE.B D0,BACK2+STEP1(A5)
- MOVE.W #4,INT_CLEAR
- MOVE.W #2000H,SR
- MOVE.B GAME_DIP+SD_LANGUAGE(A5),D1
- MOVE.B COUNTRY_CODE(A5),D0
- CMP.B #2,D0
- BEQ.S FWI_1
- MOVE.B D0,D1
- FWI_1:
- MOVE.B D1,LANGUAGE_SD(A5)
- RTS
- DIP_CHECK:
- TST.L POWER_ON_ID(A5)
- BNE.S DIP_CHECK_1
- CLR.W DEBUG_DIP1(A5)
- DIP_CHECK_1:
- RTS
- VERSION_CHECK:
- MOVE.W VERSION_VALUE,D0
- CMP.W VERSION(A5),D0
- BEQ.S VERSION_CHECK_1
- BSR POWER_ON_SUB
- VERSION_CHECK_1:
- RTS
- SECOND_WORK_INIT:
- ; intialize for all program
- JSR.S SYS_SECOND_INIT
- JSR DEMO_SOUND_SET(PC)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0200H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0300H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0400H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0500H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0600H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0700H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0800H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0900H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0A00H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0B00H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0C00H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0D00H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0E00H(A5)
- MOVE.W #SYS_RESERV,LWORK_START+TYPE+0F00H(A5)
- MOVEQ.L #0,D0
- MOVE.W D0,LEVEL_ADD(A5)
- LEA.L COLOR_BUFFER(A5),A0
- MOVE.W #256-1,D7
- SWI_1:
- MOVE.W D0,(A0)
- LEA.L 20H(A0),A0
- DBRA D7,SWI_1
- BSR TODAY_CHECK
- RTS
- DEMO_SOUND_SET:
- TST.B MVS_FLAG(A5)
- BEQ.S DEMO_SOUND_ON
- MOVE.B SOUND_STOP,D0
- OR.B GAME_DIP+SD_DEMO_SOUND(A5),D0 soft dip
- BNE.S DEMO_SOUND_SET_1
- DEMO_SOUND_ON:
- SOUND #S_ALL_EI
- DEMO_SOUND_SET_1:
- RTS
- LP_MAIN:
- TST.B LP_MAIN_RUN(A5)
- BNE LP_MAIN_END
- JSR.S INIT_SORT
- LEA.L LWORK_START+1000H(A5),A6
- LWORK_LOOP:
- MOVE.W TYPE(A6),D0
- BEQ.S LWORK_LOOP_1
- JSR LWORK_MAIN(PC)
- LWORK_LOOP_1:
- CMP.B #70H,WORK_No(A6)
- LEA.L 100H(A6),A6
- BCS.S LWORK_LOOP
- LEA.L PWORK_START(A5),A6
- MOVE_LOOP:
- MOVE.W TYPE(A6),D0
- BEQ MOVE_LOOP_1
- JSR PWORK_MAIN(PC)
- MOVE_LOOP_1:
- CMP.B #6FH,WORK_No(A6)
- LEA.L 100H(A6),A6
- BCS.S MOVE_LOOP
- JSR.S ORDER_SET
- MOVE.B #1,LP_MAIN_RUN(A5)
- LP_MAIN_END:
- RTS
- LWORK_MAIN_0:
- MOVE.W TYPE(A6),D0
- LWORK_MAIN:
- ADD.W D0,D0
- ADD.W D0,D0
- MOVE.L LMAIN_TBL(PC,D0.W),A0
- JMP (A0)
- LMAIN_TBL:
- DC.L NON_USE 00
- DC.L NON_USE 01 NOP LOGIC
- DC.L NON_USE 02
- DC.L NON_USE 03
- DC.L NON_USE 04
- DC.L NON_USE 05
- DC.L NON_USE 06
- DC.L NON_USE 07
- DC.L NON_USE 08
- DC.L NON_USE 09
- DC.L NON_USE 0A
- DC.L LM_AHO 0B;<*******
- DC.L LM_HAKO 0C
- DC.L LM_HAHEN 0D
- DC.L LM_HAHEN 0E
- DC.L LM_EASY 0F
- DC.L LM_KUBIFURI 10
- DC.L LM_PAL_ACT 11
- DC.L LM_HITAREA 12
- PWORK_MAIN:
- ADD.W D0,D0
- ADD.W D0,D0
- MOVE.L MAIN_TBL(PC,D0.W),A0
- JMP (A0)
- MAIN_TBL:
- DC.L NON_USE ;00
- DC.L NON_USE ;01 PWORK_LOGIC
- DC.L PM_HERO ;02
- DC.L PM_MAN ;03
- DC.L PM_F_TREE ;04
- DC.L PM_AHO ;05 <*****
- DC.L PM_HAKO ;06
- DC.L PM_HERO_HEAD ;07
- DC.L PM_HERO_ATTACK ;08
- DC.L PM_HAHEN ;09
- DC.L PM_F_TREE ;0A
- DC.L PM_STAR ;0B
- DC.L PM_HERO_BODY ;0C
- DC.L PM_HERO_SHADOW ;0D
- DC.L PM_SP2 ;0E
- DC.L PM_SP3 ;0F
- DC.L PM_HERO_WEAK ;10
- DC.L PM_EASY ;11
- DC.L PM_KUBIFURI ;12
- DC.L PM_ICE ;13
- DC.L PM_BEER ;14
- DC.L PM_HERO_AREA ;15
- DC.L PM_HERO_DISP ;16
- DC.L PM_MATO ;17
- DC.L PM_FIGHT ;18
- DC.L PM_HITAREA ;19
- DC.L PM_GETA ;1A
- DC.L PM_DESI ;1B
- NON_USE:
- RTS
- INCLUDE WORK.INC
|