123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- ************************************************************************
- * *
- * 044 COMMON SUBROUTINES *
- * by S.OKADA from 91/10/24 Thu 09:47 *
- * *
- ************************************************************************
- XDEF FREE_OBJ_WORK
- XDEF FREE_OBJ_WORK_SUB
- XDEF FREE_HERO_PWORK
- XDEF LWORK_DEAD
- XDEF GET_OBJ_BACK_ADRS
- XDEF MESS_SET,MESS_SET_INNER,FLAME_WRITE,FLAME_CLR
- XDEF FLAME_WRITED,FLAME_CLRD
- XDEF LANG_SET,LANG_SET_INNER
- XDEF RANDOM_EFFECT,RANDOM_EFFECT_ACT
- XDEF LANG_SOUND,DEAD_BAN
- XREF ?A5
- ;by MESSAGE
- XREF MESS_SETP,MESS_SET_INNERP,FLAME_WRITEP,FLAME_CLRP
- XREF FLAME_WRITEPD,FLAME_CLRPD
- ;by LANG
- XREF LANG_SETP,LANG_SET_INNERP
- SECT GAMES,,C
- INCLUDE SYS.INC
- INCLUDE NEO_GEO.INC
- INCLUDE LABEL.INC
- FREE_HERO_PWORK:
- MOVEP.W HERO_OBJ_START(A6),D0
- CLR.B D0
- JMP FREE_OBJ_WORK_SUB(PC)
- FREE_OBJ_WORK:
- ; search free PWORK for non player
- ; out) NE (D0(.b)<>0)
- ; find free work A0
- ; EQ (D0(.b)=0)
- ; not find free work
- ; use) D0,A0
- MOVE.W #FREE_OBJ_START,D0
- FREE_OBJ_WORK_SUB:
- LEA.L 0(A5,D0.W),A0
- MOVE.B WORK_No(A0),D0
- AFW_1:
- TST.W TYPE(A0)
- BEQ AFW_2
- LEA.L 100H(A0),A0
- ADDQ.B #1,D0
- CMP.B #70H,D0
- BCS.S AFW_1
- AFW_2:
- SUB.B #6FH,D0
- RTS
- LWORK_DEAD:
- LEA.L LWORK_START+1000H(A5),A6
- LWORK_DEAD_1:
- CLR.W TYPE(A6)
- CMP.B #70H,WORK_No(A6)
- LEA.L 100H(A6),A6
- BCS.S LWORK_DEAD_1
- RTS
- GET_OBJ_BACK_ADRS:
- ; caluculate obj_back addres by hit left-lower
- ; and area size
- ; in) A0 master work address
- ; out) A1 obj back address
- ; D6 y size-1
- ; D5 x size-1
- ; use) D0,D1,D2
- MOVE.W Y_POSITION(A0),D0
- MOVE.W D0,D6
- ADD.W HIT_LOWER(A0),D0
- BPL.S GOBA_1
- MOVEQ.L #0,D0
- GOBA_1:
- LSR.W #4,D0
- ADD.W HIT_UPPER(A0),D6
- BPL.S GOBA_2
- MOVEQ.L #0,D6
- GOBA_2:
- LSR.W #4,D6
- SUB.W D0,D6
- MOVE.W HIT_RIGHT(A0),D5
- BPL.S GOBA_3
- MOVEQ.L #0,D5
- GOBA_3:
- LSR.W #4,D5
- MOVE.W HIT_LEFT(A0),D1
- BPL.S GOBA_4
- MOVEQ.L #0,D1
- GOBA_4:
- MOVE.W D1,D2
- LSR.W #4,D2
- SUB.W D2,D5
- AND.W #0FFF0H,D1
- ADD.W D1,D1
- ADD.W D1,D0
- LEA.L BACK1_BUFFER(A5),A1
- LEA.L 0(A1,D0.W),A1
- RTS
- MESS_SET JMP MESS_SETP
- MESS_SET_INNER JMP MESS_SET_INNERP
- FLAME_WRITE JMP FLAME_WRITEP
- FLAME_CLR JMP FLAME_CLRP
- FLAME_WRITED JMP FLAME_WRITEPD
- FLAME_CLRD JMP FLAME_CLRPD
- LANG_SET JMP LANG_SETP
- LANG_SET_INNER JMP LANG_SET_INNERP
- RANDOM_EFFECT_ACT:
- MOVE.L (A0)+,D4
- RANDOM_EFFECT:
- MOVEQ.L #RND_STOP,D0
- AND.B DEBUG_DIP1(A5),D0
- EOR.B #RND_STOP,D0
- BEQ.S RE_1
- JSR.S RAND8
- RE_1:
- CMP.B #80H,D0
- BCS.S RE_3
- CMP.B #0E0H,D0
- BCC.S RE_2
- SWAP D4
- RE_2:
- MOVE.W D4,D0
- JSR.S SET_SOUND
- RE_3:
- RTS
- LANG_SOUND:
- MOVE.L (A0)+,D0
- TST.B LANGUAGE(A5)
- BNE.S LANG_SOUND_1
- SWAP D0
- LANG_SOUND_1:
- JSR.S SET_SOUND
- RTS
- DEAD_BAN:
- MOVE.L A1,-(SP)
- MOVEP.W MASTER_No(A6),D0
- CLR.B D0
- LEA.L -LOG(A5,D0.W),A1
- MOVE.L (A0)+,D0
- TST.W HERO_LIFE(A1)
- BEQ.S DEAD_BAN_1
- SWAP D0
- DEAD_BAN_1:
- JSR.S SET_SOUND
- MOVE.L (SP)+,A1
- RTS
- INCLUDE WORK.INC
|