123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697 |
- ************************************************************************
- * *
- * 044 [RYUUKO NO KEN] *
- * PHASE CONTROL PROGRAM *
- * by S.OKADA from 92/05/26 Tue 10:25 *
- * *
- ************************************************************************
- XDEF PHASE_CTRL,PHASE_ALL_INIT
- XDEF PLAYER_START
- XDEF ACTIVE_TRIGER
- XDEF PLAYER_INIT_VS
- XREF ?A5
- ;by DEMO_CML
- XREF DEMO_GAME,INIT_DEMO_GAME
- XREF TITLE,INIT_TITLE,TITLE_ONLY,INIT_TITLE_ONLY
- XREF INIT_HOW_TO_STORY,HOW_TO_STORY
- XREF INIT_HOW_TO_VS,HOW_TO_VS
- ;by MOVE
- XREF INIT_MOVING_DEMO,MOVING_DEMO
- ;by SELECT
- XREF INIT_GAME_SELECT,GAME_SELECT
- XREF INIT_STORY_SELECT,STORY_SELECT
- XREF INIT_VS_SELECT,VS_SELECT
- ;by CARD
- XREF INIT_STORY_SAVE,STORY_SAVE
- XREF INIT_STORY_LOAD,STORY_LOAD
- ;by MAIN
- XREF LP_MAIN,DEMO_END
- ;by STORY
- XREF INIT_STORY_GAME,STORY_GAME
- ;by BONUS
- XREF INIT_BONUS_STG,BONUS_STG
- ;by GAME_DSP
- XREF INIT_STORY_CONTINUE,STORY_CONTINUE
- XREF INIT_VS_CONTINUE,VS_CONTINUE
- XREF INIT_GAME_OVER,GAME_OVER
- SECT GAME,,C
- INCLUDE SYS.INC
- INCLUDE NEO_GEO.INC
- INCLUDE LABEL.INC
- INCLUDE HFLAG.INC
- INCLUDE MACRO.INC
- INCLUDE EASY_MAC.INC
- INCLUDE SMACRO.INC
- INCLUDE SCODE.INC
- IFNE 0
- PHASE work format
- /----------d9 player 2 active
- l/---------d8 player 1 active
- ll /-------d7 initialize phase
- ll l/------d6 demo,title
- ll ll/-----d5 game mode 0:rannyuu ari 1:nasi
- ll lll/----d4 game type 0:story 1:vs
- ll llll/---d3
- ll lllll/--d2 d3-0 status
- ll llllll/-d1
- ll lllllll/d0
- 00000000 00000000
- ENDC
- PHASE_DEMO EQU 6
- PHASE_RANNYUU EQU 5
- PHASE_STORY EQU 4
- IFNE 0
- PHASE status number
- 0: in game (with game scroll display)
- 1: how to play or title demo
- 2: player select or title only
- 3: continue or entry or system return
- 4: game over
- 5: memory card save
- 6: memory card load
- 7: stage moving demo
- 8: game mode select
- 9: bonus game
- ENDC
- ;
- ; *** PLAYER_START called in SYSTEM_IO ***
- ;
- PLAYER_START:
- LEA.L ?A5,A5
- MOVEQ.L #0,D0
- TST.B START_FLAG2(A5)
- BNE PS_3
- BTST.B #0,START_FLAG(A5)
- BEQ.S PS_1
- MOVE.B PLAYER1+PLAYER_STATE(A5),D1
- AND.B #PS_START_DI+PS_IN_GAME,D1
- BNE.S PS_1
- BSET.B #0,START_FLAG2(A5)
- PS_1:
- BTST.B #1,START_FLAG(A5)
- BEQ.S PS_2
- MOVE.B PLAYER2+PLAYER_STATE(A5),D1
- AND.B #PS_START_DI+PS_IN_GAME,D1
- BNE.S PS_2
- BSET.B #1,START_FLAG2(A5)
- PS_2:
- MOVEQ.L #0,D0
- MOVE.B START_FLAG2(A5),D0
- BTST.B #PHASE_DEMO,PHASE+1(A5)
- BEQ.S PS_3
- BTST.B #PHASE_RANNYUU,PHASE+1(A5)
- BEQ.S PS_3
- MOVE.B CREDIT1_START(PC,D0.W),D0
- PS_3:
- AND.B #00000011B,D0
- MOVE.B D0,START_FLAG(A5)
- BEQ.S PS_4
- MOVE.B #2,USER_MODE(A5) game mode
- MOVE.W LSPC_MODE_STORE(A5),D0
- AND.B #00001111B,D0
- MOVE.W D0,LSPC_MODE
- MOVE.W D0,LSPC_MODE_STORE(A5)
- PS_4:
- RTS
- CREDIT1_START:
- DC.B 00B,01B,10B,01B
- ;
- ; *** player intialize ***
- ;
- PLAYER_1st_INIT:
- ; system 1st initialize
- LEA.L PLAYER1(A5),A6
- MOVE.W #SYS_PLAYER1,TYPE(A6)
- MOVE.W #SYS_HERO1,TYPE+HERO_OFFSET(A6)
- MOVE.L A6,PLAYER2+ANOTHER_PLAYER(A5)
- MOVE.L #HERO2,HERO1+ANOTHER_PLAYER(A5)
- MOVE.W #0,PLAYER_No(A6)
- MOVE.B #HERO1_OBJ_START/100H,HERO_OBJ_START+HERO_OFFSET(A6)
- BSR PLAYER_1stI_SUB
- LEA.L PLAYER2(A5),A6
- MOVE.W #SYS_PLAYER2,TYPE(A6)
- MOVE.W #SYS_HERO2,TYPE+HERO_OFFSET(A6)
- MOVE.L A6,PLAYER1+ANOTHER_PLAYER(A5)
- MOVE.L #HERO1,HERO2+ANOTHER_PLAYER(A5)
- MOVE.B #HERO2_OBJ_START/100H,HERO_OBJ_START+HERO_OFFSET(A6)
- MOVE.W #1,PLAYER_No(A6)
- PLAYER_1stI_SUB:
- CLR.B PLAYER_STATE(A6)
- CLR.L HERO_SCORE+HERO_OFFSET(A6)
- CLR.B HERO_BEAT+HERO_OFFSET(A6)
- MOVE.W #-1,HERO_TYPE2+HERO_OFFSET(A6)
- RTS
- PLAYER_INIT_STORY:
- CLR.L HERO_SCORE+HERO_OFFSET(A6)
- MOVE.W PLAYER_No(A6),D0
- BTST.L D0,D4
- BEQ.S PIS_COM
- MOVE.W D0,STORY_PLAYER(A5)
- MOVE.B #1,0(A1,D0.W) player mode set
- MOVE.B #PS_IN_GAME,PLAYER_STATE(A6)
- MOVE.W HERO_TYPE2+HERO_OFFSET(A6),D1
- CMP.W #2,D1
- BCS.S PIS_2
- MOVE.W D0,D1
- PIS_2:
- MOVE.W D1,HERO_TYPE3+HERO_OFFSET(A6)
- RTS
- PIS_COM:
- BCLR.B #BPS_START_DI,PLAYER_STATE(A6)
- BSR HOME_IN_CHECK
- BTST.B #PHASE_RANNYUU,PHASE+1(A5)
- BEQ.S PIS_COM_1
- BSET.B #BPS_START_DI,PLAYER_STATE(A6)
- PIS_COM_1:
- RTS
- XDEF HOME_IN_CHECK
- HOME_IN_CHECK:
- TST.B MVS_FLAG(A5)
- BNE.S HIC_1
- MOVE.W PLAYER_No(A6),D0
- LEA.L HOME_CREDIT(A5),A0
- TST.B 0(A0,D0.W)
- BNE.S HIC_1
- BSET.B #BPS_START_DI,PLAYER_STATE(A6)
- HIC_1:
- RTS
- PLAYER_INIT_VS:
- MOVE.W PLAYER_No(A6),D0
- BTST.L D0,D4
- BEQ.S PIV_OLD
- MOVE.B #1,0(A1,D0.W) player mode set
- MOVE.B #PS_IN_GAME,PLAYER_STATE(A6)
- MOVE.L ANOTHER_PLAYER(A6),A0
- MOVE.W D0,D1
- CMP.W HERO_TYPE+HERO_OFFSET(A0),D1
- BNE.S PIV_NEW_1
- EOR.W #1,D1
- PIV_NEW_1:
- MOVE.W D1,HERO_TYPE3+HERO_OFFSET(A6)
- CMP.W STORY_PLAYER(A5),D0
- BNE.S PIV_NEW_2
- MOVE.W #-1,STORY_PLAYER(A5)
- PIV_NEW_2:
- RTS
- PIV_OLD:
- MOVE.W HERO_TYPE+HERO_OFFSET(A6),HERO_TYPE3+HERO_OFFSET(A6)
- MOVE.W PLAYER_No(A6),OLD_VS(A5)
- RTS
- ;
- ; *** phase 1st initialize ***
- ;
- PHASE_ALL_INIT:
- MOVE.W #11000001B,PHASE(A5) title demo init
- TST.B MVS_FLAG(A5)
- BEQ.S FAI_1
- TST.B GAME_DIP+SD_RANNYUU(A5)
- BEQ.S FAI_1
- BSET.B #PHASE_RANNYUU,PHASE+1(A5) rannyuu nasi
- FAI_1:
- MOVEQ.L #0,D0
- MOVE.B D0,DEMO_OVER_FLAG(A5)
- MOVE.B D0,MAKE_DEMO_CUT(A5)
- MOVE.W D0,HAOH_USE(A5)
- MOVE.B D0,HOW_TO_FLAG(A5)
- MOVE.B #1,ST_DEMO_ON(A5)
- MOVE.B #12,STORY_LIFE(A5)
- MOVE.B #12,STORY_SPIRIT(A5)
- MOVE.W #1,STORY_STAGE(A5)
- MOVE.W #-1,STORY_PLAYER(A5)
- MOVE.W #-1,OLD_VS(A5)
- MOVE.W #0404H,HOME_CREDIT(A5)
- CMP.B #3,USER_REQUEST(A5)
- BNE.S FAI_2
- ADDQ.W #1,PHASE(A5) mvs title only
- FAI_2:
- BSR LANGUAGE_1st
- BSR PLAYER_1st_INIT
- RTS
- LANGUAGE_1st:
- TST.B MVS_FLAG(A5)
- BEQ HOME_LANGUAGE
- MOVE.B LANGUAGE_SD(A5),LANGUAGE(A5)
- RTS
- HOME_LANGUAGE:
- MOVEQ.L #0,D0
- MOVE.B COUNTRY_CODE(A5),D0
- MOVE.B HL_DATA(PC,D0.W),LANGUAGE(A5)
- RTS
- HL_DATA:
- DC.B 0,1,1,2
- ;
- ;
- ; *** phase main control ***
- ;
- ;
- PHASE_CTRL:
- JSR GAME_START(PC)
- BSR PHASE_CTRL_SUB
- JSR LP_MAIN(PC)
- RTS
- PHASE_CTRL_SUB:
- MOVE.B #1,PAUSE_DI(A5)
- MOVEQ.L #0,D0
- MOVE.B PHASE+1(A5),D0
- BTST.L #PHASE_DEMO,D0
- BNE DEMO_PHASE
- BTST.L #PHASE_STORY,D0
- BNE VS_PHASE
- BEQ STORY_PHASE
- ;
- ; *** phase change by start button ***
- ;
- ;old phase new phase sub_step phase name attention
- ;x1x0xxxx 10001000 0 level slect home use
- ;x1x0xxxx 10x10001 how to play mvs double start
- ;x110xxxx 10101000 1 mode select mvs single,rannyuu nasi
- ;x100xxxx 10000001 how to play mvs single,rannyuu ari
- ;x00x0000 10010010 vs.player select
- GAME_START:
- OR.B #00100000B,START_FLAG2(A5)
- MOVEQ.L #00000011B,D4
- AND.B START_FLAG2(A5),D4
- BNE.S GAME_START_1
- RTS
- GAME_START_1:
- OR.B D4,PHASE(A5) active player set
- BSR HOME_CREDIT_DOWN
- LEA.L PLAYER_MODE(A5),A1
- MOVEQ.L #01110000B,D0
- AND.W PHASE(A5),D0
- LSR.W #2,D0
- MOVE.L GAME_START_VECTOR(PC,D0.W),A0
- JMP (A0)
- GAME_START_VECTOR:
- DC.L STORY_START 000
- DC.L VS_ENTORY 001
- DC.L STORY_START 010
- DC.L VS_ENTORY 011
- DC.L TO_GAME_RA 100
- DC.L TO_GAME_RA 101
- DC.L TO_GAME_RN 110
- DC.L TO_GAME_RN 111
- ; demo,type,mode
- HOME_CREDIT_DOWN:
- TST.B MVS_FLAG(A5)
- BNE HCD_2
- MOVEQ.L #01010000B,D0
- AND.B PHASE+1(A5),D0
- CMP.B #00010000B,D0
- BEQ HCD_2
- BTST.L #0,D4
- BEQ.S HCD_1
- SUBQ.B #1,HOME_CREDIT(A5)
- BNE.S HCD_1
- BSET.B #BPS_START_DI,PLAYER1+PLAYER_STATE(A5)
- HCD_1:
- BTST.L #1,D4
- BEQ.S HCD_2
- SUBQ.B #1,HOME_CREDIT+1(A5)
- BNE.S HCD_2
- BSET.B #BPS_START_DI,PLAYER2+PLAYER_STATE(A5)
- HCD_2:
- RTS
- STORY_START:
- MOVE.W D4,D0
- SUBQ.W #1,D0
- CMP.W STORY_PLAYER(A5),D0
- BNE STORY_TO_VS
- STORY_CONT_PLAY:
- MOVEQ.L #00100000B,D0
- AND.B PHASE+1(A5),D0
- OR.B #10000010B,D0
- MOVE.B D0,PHASE+1(A5) story player select
- LEA.L PLAYER1(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- LEA.L PLAYER2(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- BTST.B #PHASE_RANNYUU,PHASE+1(A5)
- BNE.S SCP_1
- MOVE.B #00100000B,START_FLAG2(A5)
- RTS
- SCP_1:
- MOVE.B #01100000B,START_FLAG2(A5)
- RTS
- STORY_TO_VS:
- MOVE.W #0,SUB_STEP(A5)
- BRA.S VS_ENTORY_1
- VS_ENTORY:
- MOVE.W #1,SUB_STEP(A5)
- VS_ENTORY_1:
- MOVE.B #10010010B,PHASE+1(A5) vs.player select
- LEA.L PLAYER1(A5),A6
- JSR PLAYER_INIT_VS(PC)
- LEA.L PLAYER2(A5),A6
- JSR PLAYER_INIT_VS(PC)
- MOVE.B #01000000B,START_FLAG2(A5)
- RTS
- TO_GAME_RA:
- BSR DEMO_START_INIT
- TST.B MVS_FLAG(A5)
- BEQ HOME_START
- CMP.B #11B,D4
- BEQ MVS_DOUBLE_START
- MOVE.B #10000110B,PHASE+1(A5) story card load
- LEA.L PLAYER1(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- LEA.L PLAYER2(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- MOVE.B #00100000B,START_FLAG2(A5)
- RTS
- TO_GAME_RN:
- BSR DEMO_START_INIT
- TST.B MVS_FLAG(A5)
- BEQ HOME_START
- CMP.B #11B,D4
- BEQ MVS_DOUBLE_START
- MOVE.B #10111000B,PHASE+1(A5) mode select
- MOVE.W #1,SUB_STEP(A5)
- LEA.L PLAYER1(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- LEA.L PLAYER2(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- MOVE.B #01000000B,START_FLAG2(A5)
- RTS
- MVS_DOUBLE_START:
- MOVEQ.L #00100000B,D0
- AND.B PHASE+1(A5),D0
- OR.B #10010001B,D0
- MOVE.B D0,PHASE+1(A5)
- LEA.L PLAYER1(A5),A6
- JSR PLAYER_INIT_VS(PC)
- LEA.L PLAYER2(A5),A6
- JSR PLAYER_INIT_VS(PC)
- MOVE.B #01000000B,START_FLAG2(A5)
- RTS
- HOME_START
- MOVE.B #10011000B,PHASE+1(A5) level select
- MOVE.W #0,SUB_STEP(A5)
- LEA.L PLAYER1(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- LEA.L PLAYER2(A5),A6
- JSR PLAYER_INIT_STORY(PC)
- MOVE.B #00100000B,START_FLAG2(A5)
- RTS
- DEMO_START_INIT:
- MOVE.W #1,STORY_STAGE(A5)
- CLR.B PLAYER1+PLAYER_STATE(A5)
- CLR.B PLAYER2+PLAYER_STATE(A5)
- CLR.L HERO1+HERO_SCORE(A5)
- CLR.L HERO2+HERO_SCORE(A5)
- MOVE.B #0,ST_DEMO_ON(A5)
- BSR GAME_SOUND_FIRST
- BSR HERO_TYPE_INIT
- RTS
- HERO_TYPE_INIT:
- MOVE.W #0,HERO1+HERO_TYPE(A5)
- MOVE.W #1,HERO2+HERO_TYPE(A5)
- RTS
- GAME_SOUND_FIRST:
- SOUND #S_RESET
- SOUND #S_WAIT2
- SOUND #S_WAIT2
- SOUND #S_ALL_EI
- RTS
- STORY_RETURN:
- ; inner phase change (vs.mode no entry)
- ;
- ; *** story mode ***
- ;
- STORY_PHASE:
- MOVE.W STORY_STAGE(A5),AREA_No(A5)
- AND.W #10001111B,D0
- ROL.B #3,D0
- MOVE.L STORY_VECTOR(PC,D0.W),A0
- JMP (A0)
- STORY_VECTOR:
- DC.L STORY_GAME
- DC.L INIT_STORY_GAME
- DC.L HOW_TO_STORY
- DC.L INIT_HOW_TO_STORY
- DC.L STORY_SELECT
- DC.L INIT_STORY_SELECT
- DC.L STORY_CONTINUE
- DC.L INIT_STORY_CONTINUE
- DC.L GAME_OVER
- DC.L INIT_GAME_OVER
- DC.L STORY_SAVE
- DC.L INIT_STORY_SAVE
- DC.L STORY_LOAD
- DC.L INIT_STORY_LOAD
- DC.L MOVING_DEMO
- DC.L INIT_MOVING_DEMO
- DC.L GAME_SELECT
- DC.L INIT_GAME_SELECT
- DC.L BONUS_STG
- DC.L INIT_BONUS_STG
- RTS
- ;
- ; *** vs.phase ***
- ;
- VS_PHASE:
- ; MOVE.W STORY_STAGE(A5),AREA_No(A5) @@@@
- AND.W #10001111B,D0
- ROL.B #3,D0
- MOVE.L VS_VECTOR(PC,D0.W),A0
- JMP (A0)
- VS_VECTOR:
- DC.L STORY_GAME
- DC.L INIT_STORY_GAME
- ; DC.L VS_GAME
- ; DC.L INIT_VS_GAME
- DC.L HOW_TO_VS
- DC.L INIT_HOW_TO_VS
- DC.L VS_SELECT
- DC.L INIT_VS_SELECT
- DC.L VS_CONTINUE
- DC.L INIT_VS_CONTINUE
- DC.L GAME_OVER
- DC.L INIT_GAME_OVER
- DC.L STORY_SAVE
- DC.L INIT_STORY_SAVE
- DC.L STORY_LOAD
- DC.L INIT_STORY_LOAD
- DC.L MOVING_DEMO
- DC.L INIT_MOVING_DEMO
- DC.L GAME_SELECT
- DC.L INIT_GAME_SELECT
- INIT_VS_GAME:
- VS_GAME:
- RTS
- ;
- ; *** demo and 1st game start ***
- ;
- DEMO_PHASE:
- AND.B #11011111B,START_FLAG2(A5)
- AND.W #10001111B,D0
- ROL.B #3,D0
- MOVE.L DEMO_VECTOR(PC,D0.W),A0
- JMP (A0)
- DEMO_VECTOR:
- DC.L DEMO_GAME
- DC.L INIT_DEMO_GAME
- DC.L TITLE
- DC.L INIT_TITLE
- DC.L TITLE_ONLY
- DC.L INIT_TITLE_ONLY
- DC.L SYS_RET
- DC.L SYS_RET
- SYS_RET:
- JSR DEMO_END(PC) work clear for NUM
- JMP SYSTEM_RETURN
- ;
- ;
- ; *** sub routines ***
- ;
- ;
- ACTIVE_TRIGER:
- ; active players lever triger get
- ; out) D2 = active triger
- MOVEQ.L #0,D2
- BTST.B #0,PHASE(A5)
- BEQ.S ACTIVE_TRIGER_1
- MOVE.B INPUT_1+3(A5),D2
- ACTIVE_TRIGER_1:
- BTST.B #1,PHASE(A5)
- BEQ.S ACTIVE_TRIGER_2
- OR.B INPUT_2+3(A5),D2
- ACTIVE_TRIGER_2:
- RTS
- INCLUDE WORK.INC
|