************************************************************** * * Software: Jamie Rivett * Initiated: 5/20/94 * * COPYRIGHT (C) 1992 WILLIAMS ELECTRONICS GAMES, INC. * ************************************************************** .file "wrestle2.asm" .title "wrestling game program cont..." .width 132 .option b,d,l,t .mnolist .include "macros.h" .include "mproc.equ" ;Mproc equates .include "display.equ" ;Display proc equates .include "gsp.equ" ;Gsp asm equates .include "sys.equ" .include "game.equ" .include "audit.equ" .include "plyr.equ" .include "anim.equ" .include "sound.h" .include "sound.equ" .include "ring.equ" .include "imgtbl.glo" .include "fontsimg.glo" .include "bgndtbl.glo" .include "miscimg.glo" .include "jjxm.h" ;temp! - 314 .if DEBUG .include "tmpdebug.h" .endif ****************************************************************************** * EXTERNAL REFERENCES .ref PSTATUS,triple_sound,change_anim1a,set_rotate_anim .ref get_rope_x,round_tickcount,get_process_ptr,NUM_OPPS .ref PALFRAM,HALT,dma_bog,GAMSTATE,pal_getf,process_ptrs .ref change_anim2a,announce_rnd_winner,GET_ADJ,pin_prompt .ref change_image,match_time,is_final_match,is_8_on_1 .ref ADD_VOICE,p1oldwinstreak,match_winner,RNDRNG0 .ref calc_line_x,PCNT,drone_meters_on,FINAL_PTR .ref dnk_climbthru_side_anim,dnk_climbthru_bot_anim .ref dnk_climbthru_top_anim,dnk_climbin_bot_anim .ref dnk_climbin_top_anim,dnk_climbin_side_anim .ref get_opp_process,adjust_health,init_wres_life_data .ref HRTPNK_P,HRTBLU_P,UNDBLK_P,DNKPRP_P,YOKPRP_P .ref LEXPRP_P,RZRPRP_P,BAMYLW_P,SHNPRP_P .ref wrestler_x,wrestler_y,wrestler_z,index1,index2 .ref dnk_climb_up_anim,shn_climb_up_anim,bam_climb_up_anim .ref hrt_climb_up_anim,lex_climb_up_anim,und_climb_up_anim .ref yok_climb_up_anim,rzr_climb_up_anim .ref bam_climbin_side_anim,bam_climbthru_side_anim .ref bam_climbin_top_anim,bam_climbthru_top_anim .ref bam_climbin_bot_anim,bam_climbthru_bot_anim .ref und_climbin_side_anim,und_climbthru_side_anim .ref und_climbin_top_anim,und_climbthru_top_anim .ref und_climbin_bot_anim,und_climbthru_bot_anim .ref rzr_climbin_side_anim,rzr_climbthru_side_anim .ref rzr_climbin_top_anim,rzr_climbthru_top_anim .ref rzr_climbin_bot_anim,rzr_climbthru_bot_anim .ref hrt_climbin_side_anim,hrt_climbthru_side_anim .ref hrt_climbin_top_anim,hrt_climbthru_top_anim .ref hrt_climbin_bot_anim,hrt_climbthru_bot_anim .ref yok_climbin_side_anim,yok_climbthru_side_anim .ref yok_climbin_top_anim,yok_climbthru_top_anim .ref yok_climbin_bot_anim,yok_climbthru_bot_anim .ref lex_climbin_side_anim,lex_climbthru_side_anim .ref lex_climbin_top_anim,lex_climbthru_top_anim .ref lex_climbin_bot_anim,lex_climbthru_bot_anim .ref shn_climbin_side_anim,shn_climbthru_side_anim .ref shn_climbin_top_anim,shn_climbthru_top_anim .ref shn_climbin_bot_anim,shn_climbthru_bot_anim .ref switches_cur,switches_down,switches_up .ref dufus_msg_off,get_rnd_wrestler,royal_rumble .ref START_HI_FLASHES,wrestler_count,buddy_mode_on .ref reduce_bog,player_pal_pref,crowd_process .ref wrestler_count,wrestler_count_proc,get_opp_plyrmode .ref THIS_GAME_TIME,STORE_AUDIT,GET_AUD,CURRENT_LADDER .ref AUD,match_start_time,PSTARTS,match_realtime .ref wrestler_audits,current_round,AUD1 ****************************************************************************** * SYMBOLS DEFINED IN THIS FILE #****************************************************************************** * * a13 = * wrestler process * a0 = stick_val_cur SUBR climb_turnbuckle move a0,a4 btst MOVE_UP_BIT,a4 ;check if player should climb jrz #not_top ;up the turnbuckle move *a13(INRING),a0 jrnz #no_climb move *a13(OBJ_ZPOSINT),a0 cmpi RING_TOP+5,a0 ;give 'em 5 pixels of leeway jrgt #not_top move *a13(OBJ_XPOSINT),a0 cmpi RING_X_CENTER,a0 jrgt #right ;#left calla get_rope_x move *a13(OBJ_COLLX1),a1 subk 5,a1 ;give 'em 5 cmp a0,a1 ;a1-a0 jrgt #no_climb movk MOVE_UP_LEFT,a3 ;face top left turnbuckle cmp a3,a4 ;Make sure UP/LEFT is pressed jreq #climbit jruc #no_climb #right calla get_rope_x move *a13(OBJ_COLLX2),a1 addk 5,a1 ;give 'em 5 cmp a0,a1 ;a1-a0 jrlt #no_climb movk MOVE_UP_RIGHT,a3 ;face top right turnbuckle cmp a3,a4 ;Make sure UP/RIGHT is pressed jrne #no_climb #climbit ;If anybody is already on turnbuckles, ignore this movi process_ptrs,a4 movi NUM_WRES,a5 #loop move *a4+,a0,L jrz #nxt ;skip inactive move *a0(PLYRMODE),a14 cmpi MODE_ONTURNBKL,a14 jrz #found_climber cmpi MODE_CLIMBTURNBKL,a14 jrz #found_climber jruc #nxt #found_climber ;check to see if we're trying to climb the one he's on move *a13(OBJ_XPOSINT),a14 move *a0(OBJ_XPOSINT),a10 cmpi RING_X_CENTER,a14 jrgt #ck_rt ;left tbukl cmpi RING_X_CENTER,a10 jrlt #no_climb jruc #nxt #ck_rt ;right tbukl cmpi RING_X_CENTER,a10 jrgt #no_climb #nxt dsj a5,#loop ;we're going to climb - because we allow 'near misses' to climb, ; we may have to glitch the guy to the corner. do it here. movi RING_TOP,a14 move a14,*a13(OBJ_ZPOSINT) move *a13(WRESTLERNUM),a0 X16 a0 addi #face_turnbuckle,a0 move *a0,a0 ;flip facing? jrz #no_flip xori MOVE_UP|MOVE_DOWN|MOVE_LEFT|MOVE_RIGHT,a3 ;opposite #no_flip move a3,*a13(NEW_FACING_DIR) move *a13(FACING_DIR),a0 cmp a0,a3 jreq #climb calla set_rotate_anim calla change_anim1a movi #climb,a0 ;this routine gets executed move a0,*a13(CODE_ADDR),L ;when the rotate anim SETMODE WAITANIM ;finishes setc rets #climb move *a13(WRESTLERNUM),a0 X32 a0 addi #climb_anims,a0 move *a0,a0,L calla change_anim1a SETMODE CLIMBTURNBKL setc rets #not_top #no_climb clrc rets ;0 = face turnbuckle before climb ;1 = back to turnbuckle #face_turnbuckle .word 1 ;0 Bret Hart .word 1 ;1 Razor Ramon .word 1 ;2 Undertaker .word 0 ;3 Yokozuna .word 0 ;4 Shawn Michaels .word 1 ;5 Bam Bam .word 0 ;6 Doink .word 0 ;7 Adam Bomb .word 1 ;8 Lex Luger .word 0 ;9 Referee #climb_anims .long hrt_climb_up_anim ;0 Bret Hart .long rzr_climb_up_anim ;1 Razor Ramon .long und_climb_up_anim ;2 Undertaker .long yok_climb_up_anim ;3 Yokozuna .long shn_climb_up_anim ;4 Shawn Michaels .long bam_climb_up_anim ;5 Bam Bam .long dnk_climb_up_anim ;6 Doink .long dnk_climb_up_anim ;7 Adam Bomb .long lex_climb_up_anim ;8 Lex Luger .long dnk_climb_up_anim ;9 Referee #***************************************************************************** * * CLIMB-INS/OUTS * SUBR ck_climb_out_bot move *a13(PLYRMODE),a14 cmpi MODE_ATTACHED,a14 jreq #done cmpi MODE_RUNNING,a14 jreq #done cmpi MODE_OPPOVERHEAD,a14 jreq #done ; calla get_opp_process ; move *a0(INRING),a0 ; jrz #done callr any_opp_outside jrnc #done ;Far enough away from posts? move *a13(OBJ_XPOSINT),a0 subi RING_X_CENTER,a0 abs a0 cmpi 10Dh,a0 jrgt #done move *a13(ANIMODE),a0 btst MODE_UNINT_BIT,a0 jrnz #done ;make sure we're at the bottom edge of the ring. move *a13(OBJ_ZPOS),a0,L cmpi [RING_BOT,0],a0 jrne #done ;dummy check callr idiot_check jrc #climb ;button press move *a13(BUT_VAL_CUR),a0 move a0,a0 jrz #done #climb move *a13(WRESTLERNUM),a0 X32 a0 addi climbthru_bot_anims,a0 move *a0,a0,L calla change_anim1a movk 2,a0 move a0,*a13(CLIMBING_THRU) #done rets #******** SUBR ck_climb_in_top move *a13(PLYRMODE),a14 cmpi MODE_ATTACHED,a14 jreq #done cmpi MODE_DEAD,a14 jreq #done cmpi MODE_RUNNING,a14 jreq #done cmpi MODE_INAIR,a14 jreq #done cmpi MODE_INAIR2,a14 jreq #done cmpi MODE_OPPOVERHEAD,a14 jreq #done move *a13(CLIMBING_THRU),a0 ;1=Climbing thru ropes flag jrnz #done move *a13(OBJ_XPOSINT),a0 subi RING_X_CENTER,a0 abs a0 ;Far enough away from posts? cmpi 0C0h,a0 ;48h jrgt #done move *a13(ANIMODE),a0 btst MODE_UNINT_BIT,a0 jrnz #done ;make sure we're at the top edge of the mat. move *a13(OBJ_ZPOS),a0,L cmpi [MAT_TOP-5,0],a0 jrne #done move *a13(MOVE_DIR),a0 btst MOVE_DOWN_BIT,a0 jrz #done callr idiot_check jrc #climb move *a13(BUT_VAL_CUR),a0 move a0,a0 jrz #done #climb move *a13(WRESTLERNUM),a0 X32 a0 addi climbin_top_anims,a0 move *a0,a0,L calla change_anim1a movk 2,a0 move a0,*a13(CLIMBING_THRU) #done rets #******** SUBR ck_climb_out_top ;roll right on through if we're a zombie. move *a13(STATUS_FLAGS),a14 btst B_ZOMBIE,a14 jrnz #zombie move *a13(PLYRMODE),a14 cmpi MODE_ATTACHED,a14 jreq #done cmpi MODE_RUNNING,a14 jreq #done cmpi MODE_OPPOVERHEAD,a14 jreq #done ; calla get_opp_process ; move *a0(INRING),a0 ; jrz #done callr any_opp_outside jrnc #done ;Far enough away from posts? move *a13(OBJ_XPOSINT),a0 subi RING_X_CENTER,a0 abs a0 cmpi 0C0h,a0 jrgt #done move *a13(ANIMODE),a0 btst MODE_UNINT_BIT,a0 jrnz #done ;make sure we're at the top edge of the ring. move *a13(OBJ_ZPOS),a0,L cmpi [RING_TOP,0],a0 jrne #done ;dummy check callr idiot_check jrc #climb ;button press move *a13(BUT_VAL_CUR),a0 move a0,a0 jrz #done #climb move *a13(WRESTLERNUM),a0 X32 a0 addi climbthru_top_anims,a0 move *a0,a0,L calla change_anim1a movk 2,a0 move a0,*a13(CLIMBING_THRU) #done rets #zombie move *a13(WRESTLERNUM),a0 X32 a0 addi rollthru_top_anims,a0 move *a0,a0,L move *a13(ANIBASE),a14,L cmp a0,a14 jreq #skp ;skip if we're already doing it. calla change_anim1a movk 2,a0 move a0,*a13(CLIMBING_THRU) #skp rets #******** SUBR ck_climb_in_bot move *a13(PLYRMODE),a14 cmpi MODE_ATTACHED,a14 jreq #done cmpi MODE_DEAD,a14 jreq #done cmpi MODE_RUNNING,a14 jreq #done cmpi MODE_INAIR,a14 jreq #done cmpi MODE_INAIR2,a14 jreq #done cmpi MODE_OPPOVERHEAD,a14 jreq #done move *a13(CLIMBING_THRU),a0 ;1=Climbing thru ropes flag jrnz #done ;Far enough away from posts? move *a13(OBJ_XPOSINT),a0 subi RING_X_CENTER,a0 abs a0 cmpi 10Dh,a0 jrgt #done move *a13(ANIMODE),a0 btst MODE_UNINT_BIT,a0 jrnz #done ;make sure we're up against the bottom of the ring move *a13(OBJ_ZPOS),a0,L cmpi [MAT_BOT+5,0],a0 jrne #done move *a13(MOVE_DIR),a0 btst MOVE_UP_BIT,a0 jrz #done ;dummy check callr idiot_check jrc #climb ;button press move *a13(BUT_VAL_CUR),a0 move a0,a0 jrz #done #climb move *a13(WRESTLERNUM),a0 X32 a0 addi climbin_bot_anims,a0 move *a0,a0,L calla change_anim1a movk 2,a0 move a0,*a13(CLIMBING_THRU) #done rets #******** SUBR ck_climb_out_side move *a13(PLYRMODE),a14 cmpi MODE_ATTACHED,a14 jreq #done cmpi MODE_RUNNING,a14 jreq #done cmpi MODE_OPPOVERHEAD,a14 jreq #done ; calla get_opp_process ; move *a0(INRING),a1 ; jrz #done callr any_opp_outside jrnc #done move *a0(CLIMBING_THRU),a0 CMPI 1,A0 JREQ #done ;Far enough away from posts? move *a13(OBJ_ZPOSINT),a0 subi RING_Z_CENTER,a0 abs a0 cmpi 48h,a0 jrgt #done move *a13(ANIMODE),a0 btst MODE_UNINT_BIT,a0 jrnz #done ;make sure we're up against one of the sides calla get_rope_x move a0,a4 cmpi RING_X_CENTER,a0 jrgt #rt #lf move *a13(STICK_VAL_CUR),a0 btst MOVE_LEFT_BIT,a0 jrz #done move a4,a0 move *a13(OBJ_COLLX1),a1 cmp a0,a1 jrle #out_lf jruc #done #rt move *a13(STICK_VAL_CUR),a0 btst MOVE_RIGHT_BIT,a0 jrz #done move a4,a0 move *a13(OBJ_COLLX2),a1 cmp a0,a1 jrge #out_rt jruc #done #out_lf movk MOVE_DOWN_LEFT,a2 jruc #dummy #out_rt movk MOVE_DOWN_RIGHT,a2 #dummy ;dummy check callr idiot_check jrc #special_face ;button press move *a13(BUT_VAL_CUR),a0 move a0,a0 jrz #done #face move *a13(FACING_DIR),a1 cmp a2,a1 jreq #climb move a2,*a13(NEW_FACING_DIR) calla set_rotate_anim calla change_anim1a movi #climb,a0 move a0,*a13(CODE_ADDR),L SETMODE WAITANIM movk 1,a0 move a0,*a13(CLIMBING_THRU) rets #climb move *a13(WRESTLERNUM),a0 X32 a0 addi climbthru_side_anims,a0 move *a0,a0,L calla change_anim1a SETMODE NORMAL movk 1,a0 move a0,*a13(CLIMBING_THRU) #done rets #special_face move *a13(PLYRMODE),A1 CMPI MODE_WAITANIM,a1 JREQ #done jruc #face #******** SUBR ck_climb_in_side move *a13(PLYRMODE),a14 cmpi MODE_ATTACHED,a14 jreq #done cmpi MODE_DEAD,a14 jreq #done cmpi MODE_OPPOVERHEAD,a14 jreq #done move *a13(CLIMBING_THRU),a0 ;1=Climbing thru ropes flag jrnz #done ;Far enough away from posts? move *a13(OBJ_ZPOSINT),a0 subi RING_Z_CENTER,a0 abs a0 cmpi 0D8h,a0 jrgt #done ;is he close enough to the ring? move *a13(OBJ_XPOSINT),a0 cmpi RING_X_CENTER,a0 jrlt #on_left ;he's right of center movk MOVE_LEFT_BIT,A2 movi vln_right_matedge2,a6 movk MOVE_DOWN_LEFT,a7 move *a13(OBJ_COLLX1),a14 jruc #d_set #on_left ;he's left of center movk MOVE_RIGHT_BIT,A2 movi vln_left_matedge2,a6 movk MOVE_DOWN_RIGHT,a7 move *a13(OBJ_COLLX2),a14 #d_set move *a13(PLYRMODE),a0 cmpi MODE_RUNNING,a0 jrne no_special_check move *a13(GETUP_TIME),a0 jrnz #done jruc running_back_in_here no_special_check move *a13(ANIMODE),a0 btst MODE_UNINT_BIT,a0 jrnz #done move *a13(PLYRMODE),a0 cmpi MODE_HEADHELD,a0 jreq #done cmpi MODE_HEADHOLD,a0 jreq #done cmpi MODE_INAIR,a0 jreq #done cmpi MODE_INAIR2,a0 jreq #done running_back_in_here calla calc_line_x sub a14,a0 abs a0 cmpi 10,a0 jrgt #done move *a13(MOVE_DIR),a0 btst A2,a0 jrz #done ;idiot check callr idiot_check jrc #climb move *a13(PLYRMODE),a0 cmpi MODE_RUNNING,a0 jrz #climb ;button press move *a13(BUT_VAL_CUR),a0 move a0,a0 jrz #done #climb ;he's within five pixels of his mat edge. face the ring move *a13(FACING_DIR),a1 cmp a7,a1 jreq #jump_in move a7,*a13(NEW_FACING_DIR) calla set_rotate_anim calla change_anim1a movi #jump_in,a0 move a0,*a13(CODE_ADDR),L SETMODE WAITANIM movk 1,a0 move a0,*a13(CLIMBING_THRU) rets #jump_in move *a13(WRESTLERNUM),a0 X32 a0 addi climbin_side_anims,a0 move *a0,a0,L calla change_anim1a SETMODE NORMAL movk 1,a0 move a0,*a13(CLIMBING_THRU) #done rets climbthru_bot_anims .long hrt_climbthru_bot_anim ;0 Bret Hart .long rzr_climbthru_bot_anim ;1 Razor Ramon .long und_climbthru_bot_anim ;2 Undertaker .long yok_climbthru_bot_anim ;3 Yokozuna .long shn_climbthru_bot_anim ;4 Shawn Michaels .long bam_climbthru_bot_anim ;5 Bam Bam .long dnk_climbthru_bot_anim ;6 Doink .long dnk_climbthru_bot_anim ;7 Adam Bomb .long lex_climbthru_bot_anim ;8 Lex Luger .long dnk_climbthru_bot_anim ;9 Referee climbthru_top_anims .long hrt_climbthru_top_anim ;0 Bret Hart .long rzr_climbthru_top_anim ;1 Razor Ramon .long und_climbthru_top_anim ;2 Undertaker .long yok_climbthru_top_anim ;3 Yokozuna .long shn_climbthru_top_anim ;4 Shawn Michaels .long bam_climbthru_top_anim ;5 Bam Bam .long dnk_climbthru_top_anim ;6 Doink .long dnk_climbthru_top_anim ;7 Adam Bomb .long lex_climbthru_top_anim ;8 Lex Luger .long dnk_climbthru_top_anim ;9 Referee climbin_bot_anims .long hrt_climbin_bot_anim ;0 Bret Hart .long rzr_climbin_bot_anim ;1 Razor Ramon .long und_climbin_bot_anim ;2 Undertaker .long yok_climbin_bot_anim ;3 Yokozuna .long shn_climbin_bot_anim ;4 Shawn Michaels .long bam_climbin_bot_anim ;5 Bam Bam .long dnk_climbin_bot_anim ;6 Doink .long dnk_climbin_bot_anim ;7 Adam Bomb .long lex_climbin_bot_anim ;8 Lex Luger .long dnk_climbin_bot_anim ;9 Referee climbin_top_anims .long hrt_climbin_top_anim ;0 Bret Hart .long rzr_climbin_top_anim ;1 Razor Ramon .long und_climbin_top_anim ;2 Undertaker .long yok_climbin_top_anim ;3 Yokozuna .long shn_climbin_top_anim ;4 Shawn Michaels .long bam_climbin_top_anim ;5 Bam Bam .long dnk_climbin_top_anim ;6 Doink .long dnk_climbin_top_anim ;7 Adam Bomb .long lex_climbin_top_anim ;8 Lex Luger .long dnk_climbin_top_anim ;9 Referee climbthru_side_anims .long hrt_climbthru_side_anim ;0 Bret Hart .long rzr_climbthru_side_anim ;1 Razor Ramon .long und_climbthru_side_anim ;2 Undertaker .long yok_climbthru_side_anim ;3 Yokozuna .long shn_climbthru_side_anim ;4 Shawn Michaels .long bam_climbthru_side_anim ;5 Bam Bam .long dnk_climbthru_side_anim ;6 Doink .long dnk_climbthru_side_anim ;7 Adam Bomb .long lex_climbthru_side_anim ;8 Lex Luger .long dnk_climbthru_side_anim ;9 Referee climbin_side_anims .long hrt_climbin_side_anim ;0 Bret Hart .long rzr_climbin_side_anim ;1 Razor Ramon .long und_climbin_side_anim ;2 Undertaker .long yok_climbin_side_anim ;3 Yokozuna .long shn_climbin_side_anim ;4 Shawn Michaels .long bam_climbin_side_anim ;5 Bam Bam .long dnk_climbin_side_anim ;6 Doink .long dnk_climbin_side_anim ;7 Adam Bomb .long lex_climbin_side_anim ;8 Lex Luger .long dnk_climbin_side_anim ;9 Referee rollthru_top_anims REFLONG hrt_rollthru_top_anim ;0 Bret Hart REFLONG rzr_rollthru_top_anim ;1 Razor Ramon REFLONG und_rollthru_top_anim ;2 Undertaker REFLONG yok_rollthru_top_anim ;3 Yokozuna REFLONG shn_rollthru_top_anim ;4 Shawn Michaels REFLONG bam_rollthru_top_anim ;5 Bam Bam REFLONG dnk_rollthru_top_anim ;6 Doink .long 0 ;7 unused REFLONG lex_rollthru_top_anim ;8 Lex Luger #***************************************************************************** * * Updates CLIMB_START and CLIMB_LAST, and returns carry if it's time to * climb. Note that we can't count on idiot_check being called only once * per tick. As of this writing (28 Feb) it's at least two, and sometimes * three. If CLIMB_LAST == PCNT, quit. If CLIMB_LAST == PCNT - 1, set * CLIMB_LAST = PCNT, and compare CLIMB_LAST - CLIMB_START against * IDIOT_COUNT. On GE, setc and return, else clrc and return. If CLIMB_LAST * isn't PCNT or PCNT-1, set it and CLIMB_START to PCNT, clrc, and rets. * #IDIOT_COUNT .equ 21 SUBRP idiot_check move *a13(CLIMB_LAST),a14 move @PCNT,a0 cmp a0,a14 jreq #no inc a14 cmp a0,a14 jreq #cont ;new stick. move a0,*a13(CLIMB_START) move a0,*a13(CLIMB_LAST) #no clrc rets #cont move a0,*a13(CLIMB_LAST) move *a13(CLIMB_START),a14 sub a14,a0 cmpi #IDIOT_COUNT,a0 jrlt #no ;climb! setc rets ;#***************************************************************************** ;* ;* a13 = wrestler process ; ; SUBR clear_damage_log ; ; move a13,a2 ; addi DAMAGE_HIST,a2 ;start of damage stucture ; ; clr a0 ; movk 20,a1 ;8 longs ;#clr_loop ; move a0,*a2+,L ; dsj a1,#clr_loop ; ; rets ; ; ;#***************************************************************************** ;* ;* a13 = wrestler process ;* a0 = damage amount (only if negative) ; ; SUBR log_damage ; ; move a0,a0 ; jrnn #not_damage ; ; PUSH a1,a2,a3 ; ; move a13,a1 ; move a13,a2 ; ; addi DAMAGE_HIST+19*32,a1 ;start at end of structure and ; addi DAMAGE_HIST+20*32,a2 ;move everything down 1 long ; ; movk 19,a3 ;#lp move -*a1,-*a2,L ; dsjs a3,#lp ; ; move a0,a1 ;damage amount ; neg a1 ; sll 16,a1 ; move @round_tickcount,a2 ;ticks since match started ; andi 0ffffh,a2 ; or a1,a2 ; move a2,*a13(DAMAGE_HIST),L ; ; PULL a1,a2,a3 ; ;#not_damage ; rets ; ; ;#***************************************************************************** ;* ;* ARGS: a13 = wrestler process ;* a0 = timespan (in ticks) ;* ;* RETURNS: a0 = damage total ;* ;* TRASHES: a1-a6,a14 ;* ; ; SUBR tally_damage ; ; move @round_tickcount,a4 ;ticks since match started ; clr a5 ;damage tally ; ; move a13,a1 ; addi DAMAGE_HIST,a1 ;start of damage stucture ; ; movk 20,a6 ;#loop ; move *a1+,a2 ;tick count ; jrz #exit ;can't have a 0 tick count ; move *a1+,a3 ;damage ; ; move a4,a14 ; sub a2,a14 ; cmp a0,a14 ;> timespan? ; jrgt #exit ; ; add a3,a5 ; dsj a6,#loop ; ;#exit ; move a5,a0 ; rets ; #***************************************************************************** * * a10 = player number (0 to NUM_WRES-1) GETUP_SIZE equ 80 ;102 ;174 ;99 MAX_TIME equ 6*TSEC INV_MULT equ 256*GETUP_SIZE/MAX_TIME ONSCR_X equ 173 OFFSCR_X equ 221 STRUCTPD LONG IPTR_FRAME LONG IPTR_GREEN WORD DISPLAY_VAL SUBR getup_meter ;HACK ALERT: In royal rumble mode, player 1 is on PLAYER 0's TEAM, ; so this code is gonna want to put his getup meter on the left. ; To get it over on the right where it belongs, we temporarily put ; him on the other team. This shouldn't break anything. move @royal_rumble,a14 jrz #norum cmpi 1,a10 ;(plyrnum) jrne #norum movk 1,a9 ;act like plyr 1 is on team 1. #norum move a10,a11 ;a11 is PLYRNUM move a10,a1 calla get_process_ptr move a0,a10 ;a10 is our wrestler process SLEEPK 2 ;first off, figure out if this guy is even allowed to have a getup ; meter. Humans always get them. A drone teammate of a human ; doesn't get one. Otherwise, drones only get them if the GETUP ; powerup is set and they're the only drone on their team. move *a10(PLYR_TYPE),a14 cmpi PTYPE_PLAYER,a14 jreq #yes ;humans get getup meters movk NUM_WRES,a0 movi process_ptrs,a1 move *a10(PLYR_SIDE),a2 ;we'll need that later anyway. #lp0 move *a1+,a3,L jrz #nxt0 ;skip inactive cmp a3,a10 jreq #nxt0 ;skip self move *a3(PLYR_SIDE),a14 cmp a14,a2 jrne #nxt0 ;skip other team move *a3(PLYR_TYPE),a14 cmpi PTYPE_PLAYER,a14 jreq #die ;we have a human teammate so we don't get one jruc #nxt0 #die clr a14 move a14,*a10(METER_PROC),L DIE ;multi-drone team--no meters #nxt0 dsjs a0,#lp0 ;we got through the loop and found no teammates, so we're a lone ; drone and we get a meter only if GETUP_POWER is set. ; move @GETUP_POWER,a14 move @drone_meters_on,a14 jrz #die ;no GETUP_POWER--no meter move @NUM_OPPS,a1 cmpi 2,a1 jrge #die #yes clr a0 move a0,*a13(DISPLAY_VAL) ;set our x-position based on PLYR_SIDE movi [OFFSCR_X,0],a10 move a9,a9 jrnz #p2 dec a10 neg a10 #p2 movi RECVRBLK,a2 ;* image (green bar) movi [109,0],a1 ;y pos movi 1801h,a3 ;z pos callr #begin_obj move a8,*a13(IPTR_GREEN),L movi RECVR_R,a2 ;* image (frame) move a9,a9 jrnz #p2_meter movi RECVR_L,a2 ;* image (frame) #p2_meter movi [189,0],a1 ;y pos movi 1800h,a3 ;z pos callr #begin_obj move a8,*a13(IPTR_FRAME),L move a11,a1 calla get_process_ptr move a0,a10 move a13,*a10(METER_PROC),L SUBR slide_offscr ;Don't allow a meter to come out for awhile (unless flung) movi 18*60,a0 ;13 move a0,*a10(DELAY_METER) movk 10,a11 #offscr_loop move a11,a11 jrz #update dec a11 jruc #cont #update movi [OFFSCR_X,0],a0 callr #set_x move *a10(WHOHITME),A0,L move *a0(COMBO_COUNT),A14 jrnz #cont move *a10(DELAY_METER),a14 jrnz #cont move *a10(PLYRMODE),a14 cmpi MODE_DEAD,a14 jrz #cont ;If health meter is down low, don't have getup meter come out. ;Unless it was a fling! move *a10(PLYRNUM),a1 .ref get_health calla get_health cmpi 20,a0 jrgt #norm move *a10(GETUP_TIME),a14 cmpi FLUNG_TIME,a14 jrz #onscr #norm move *a10(GETUP_TIME),a14 jrnz #onscr #cont SLEEPK 1 jruc #offscr_loop #onscr move a14,a11 movi GETUP_SIZE,a0 move a0,*a13(DISPLAY_VAL) MOVI 0BDH,A0 ;Meter announce sound CALLA triple_sound movi 120,a6 move *a10(GETUP_TIME),a5 #onscr_loop movi [ONSCR_X,0],a0 callr #set_x move *a10(GETUP_TIME),a7 ;if a7 (current getup) is greater than a11 (starting getup), our ; scale will be messed up. In this case, just move a7 into a11. cmp a11,a7 jrle #rescale move a7,a11 #rescale movi GETUP_SIZE,a0 mpyu a0,a7 ;* GETUP_SIZE divu a11,a7 ;/ INITIAL GETUP TIME move *a13(DISPLAY_VAL),a0 cmp a0,a7 ;has getup been incremented? jrle #ok1 move a7,a11 movi GETUP_SIZE,a0 mpyu a0,a7 ;* GETUP_SIZE divu a11,a7 ;/ INITIAL GETUP TIME #ok1 .ref dufus_msg_on subk 1,a6 jrnz #dont_bother move *a10(GETUP_TIME),a0 sub a0,a5 cmpi 175,a5 jrgt #dont_bother PUSH a2,a7,a9 movk 2,a9 CREATE 4000h|AWARD_PID,dufus_msg_on PULL a2,a7,a9 #dont_bother PUSH a5,a6 callr #update_meter PULL a5,a6 move a7,a7 jrz slide_offscr move *a10(PLYRMODE),a0 cmpi MODE_DEAD,a0 jrz slide_offscr PUSHP a5,a6 SLEEPK 1 PULLP a5,a6 jruc #onscr_loop ********** SUBRP #set_x move a9,a9 jrnz #p22 neg a0 #p22 addi [200-1,0],a0 ;center of screen move a13,a14 addi IPTR_FRAME,a14 move *a14,a8,L move *a8(OXVAL),a1,L sub a1,a0 sra 2,a0 movk 3-1,a1 #lp move *a14+,a8,L move *a8(OXVAL),a2,L add a0,a2 move a2,*a8(OXVAL),L dsj a1,#lp rets ********** SUBRP #begin_obj movi [200-1,0],a0 ;x pos add a10,a0 movi DMAWNZ|M_SCRNREL,a4 ;DMA flags clr a5 ;object ID clr a6 ;x vel clr a7 ;y vel calla BEGINOBJ rets ********** SUBRP #update_meter move *a13(DISPLAY_VAL),a0 add a0,a7 srl 1,a7 move a7,*a13(DISPLAY_VAL) move a7,a1 neg a1 addi GETUP_SIZE,a1 jrp #ok clr a1 #ok movi GETUP_SIZE,a0 cmp a0,a1 ;meter can't be taller jrle #ok2 ;than GETUP_SIZE pixels move a0,a1 #ok2 move *a13(IPTR_GREEN),a8,L MOVI GETUP_SIZE,A2 SUB A1,A2 MOVE A2,*A8(OSIZEY) MOVI RECVRBLK,A0 MOVE *A0(ICTRL),A5 SRL 12,A5 MOVE A1,A3 MPYU A5,A3 MOVE *A0(ISIZEX),A5 MPYU A5,A3 MOVE *A0(ISAG),A0,L ADD A3,A0 MOVE A0,*A8(OSAG),L rets #***************************************************************************** * * makes your getup meter go away if you've got one out. SUBR ditch_getup_meter_a9 PUSH a13 move a9,a13 callr ditch_getup_meter PULL a13 rets SUBR ditch_getup_meter move *a13(GETUP_TIME),a0 jrz #cont move *a13(PLYR_DIZZY),a0 jrnz #cont ;This guy has a getup meter on screen and is running out of control! ;Cause getup meter to slide off screen. move *a13(METER_PROC),a0,L jrz #cont ;skip if we don't have a meter. PUSH a8,a9,a10 move *a0(PA8),a8,L move *a0(PA9),a9,L move *a0(PA10),a10,L movi GETUP_PID,a1 movi slide_offscr,a7 calla XFERPROC PULL a8,a9,a10 #cont rets #***************************************************************************** * * a0 = # ticks to add * a13 = * wrestler process SUBR inc_getup_time PUSH a14 move *a13(GETUP_TIME),a14 cmpi 20,a14 jrlt #exit add a0,a14 move a14,*a13(GETUP_TIME) #exit PULL a14 rets #***************************************************************************** * * do rolls for any wrestler * * args : a13 = * wrestler process * * returns : Z=1 if didn't roll SUBR do_roll move *a13(OBJ_ZPOSINT),a0 move *a13(Z_BOUND),a14 jrz #reg sub a0,a14 abs a14 ;<-new! cmpi 6,a14 jrle #no_roll #reg move *a13(STICK_VAL_CUR),a0 andi MOVE_UP|MOVE_DOWN,a0 jrz #no_roll move *a13(WRESTLERNUM),a14 X32 a14 addi #roll_table,a14 move *a14,a14,L move *a14+,a1 ;roll speed move *a14+,a2,L ;z velocity btst MOVE_DOWN_BIT,a0 jrnz #down neg a1 ;must be up neg a2 #down move a2,*a13(OBJ_ZVEL),L move *a13(ROLL_POS),a0 add a0,a1 andi 0ffh,a1 move a1,*a13(ROLL_POS) move *a14+,a0,L ;inv multiplier mpyu a0,a1 srl 16,a1 ;/65536 X32 a1 add a1,a14 move *a14,a0,L .if DEBUG jrnz #ok LOCKUP #ok .endif move *a0,a0,L .if DEBUG jrnz #ok2 LOCKUP #ok2 .endif move a0,*a13(CUR_FRAME),L rets #no_roll clr a0 move a0,*a13(OBJ_ZVEL),L rets #roll_table REFLONG hrt_roll_frames ;0 Bret Hart REFLONG rzr_roll_frames ;1 Razor Ramon REFLONG und_roll_frames ;2 Undertaker REFLONG yok_roll_frames ;3 Yokozuna REFLONG shn_roll_frames ;4 Shawn Michaels REFLONG bam_roll_frames ;5 Bam Bam REFLONG dnk_roll_frames ;6 Doink .long 0 ;7 unused REFLONG lex_roll_frames ;8 Lex Luger ; ;#***************************************************************************** ; ; SUBR check_dizzy ; ; movi 4*TSEC,a0 ; calla tally_damage ; ;;Is this the right way to causes dizzies? ;;If one move is super powerful, we will tend to get dizzies when we don't want ;;them. Maybe it should be based on hits over time, not damage. ; ;;A combination of the two is needed here! 10/5/94 ; ;;We need less resolution on the damage that is recorded! ;;Perhaps 1-3? ; ;;We should allow this to happen only once per round! ; ; cmpi 65,a0 ; ; jrlt #no_dizzy ; ; jruc #no_dizzy ; ; ; calla clear_damage_log ; ;;Don't allow dizzies if your health meter is real low! ;;Killer Instinct sucks.... ; move *a13(PLYRNUM),a1 ; .ref get_health ; calla get_health ; cmpi 30,a0 ; jrlt #no_dizzy ; ;;Too many dizzies this round? ; move *a13(PLYR_DIZZY_CNT),a0 ; cmpi 1,a0 ;Max dizzies per round ; jrge #no_dizzy ; ; inc a0 ; move a0,*a13(PLYR_DIZZY_CNT) ; ; ; movk 1,a0 ;return TRUE ; move a0,*a13(PLYR_DIZZY) ; rets ; ;#no_dizzy ; clr a0 ;return FALSE ; rets #***************************************************************************** SUBR form_button_value ;Combine the val_cur of the block bit with the val_down of the rest. move *a13(BUT_VAL_CUR),a0 andi PLAYER_BLOCK_VAL,a0 move a0,a1 move *a13(BUT_VAL_DOWN),a0 or a1,a0 rets ; ;#***************************************************************************** ; ; SUBR start_whack ; ;;a10=plyr proc ;;Turn on whack button graphic, animate it for a bit ; ;frame_z .equ 202 ; ; movk 1,a0 ; move a0,*a10(WHACK_CNT) ; ; movi [0f6h,0],a1 ; movi [44h,0],a0 ; move *a10(PLYRNUM),a2 ; jrz #ok ; movi [401-44h,0],a0 ;#ok ; movi WHAK0001,a2 ; movi frame_z+2,a3 ;Z ; movi DMAWNZ|M_3D|M_SCRNREL,a4 ;DMA flags ; movi OVRHED_PID,a5 ; clr a6 ; clr a7 ; calla BEGINOBJ ; move a8,a11 ; ; movi [0f6h,0],a1 ; movi [44h,0],a0 ; move *a10(PLYRNUM),a2 ; jrz #ok2 ; movi [401-44h,0],a0 ;#ok2 ; movi WKBUTT01,a2 ; movi frame_z+3,a3 ;Z ; movi DMAWNZ|M_3D|M_SCRNREL,a4 ;DMA flags ; movi OVRHED_PID,a5 ; clr a6 ; clr a7 ; calla BEGINOBJ ; ;#start ; movi butn_l,a9 ; ;#lp move *a10(GETUP_TIME),a0 ; jrz #die ; ; move *a9+,a0,L ; jrz #start ; move *a8(OCTRL),a1 ; calla obj_aniq ;#noani ; SLEEPK 3 ; jruc #lp ;Going up? ; ;#die ; SLEEPK 10 ; ; move a11,a0 ; calla DELOBJ ; jauc DELOBJDIE ; ; ;butn_l ; .long WKBUTT01 ; .long WKBUTT02 ; .long WKBUTT03 ; .long WKBUTT02 ; ; .long 0 #***************************************************************************** * * Gets the animation point of a multipart object. Find the highest x and y * offset values among all the pieces. * * >a0 = object table pointer * a0 = object table pointer * 0E0E0000,a1 movi [1,400],a2 move @dma_bog,a3 sll 16,a3 clr a4 movi DMACAL,a5 calla QDMAN rets #***************************************************************************** SUBR draw_cpu_meter movi DIAGP,a0 calla pal_getf move a0,a1 ori >0D0D0000,a1 movi [1,400],a2 move @CPUAVG,a3 sll 14,a3 clr a4 movi DMACAL,a5 calla QDMAN rets .endif #***************************************************************************** SUBR COLRPRC movi COLRPID,a0 calla KIL1C ;KILL ALL COLOR UPDATE PROCESSES clr a0 move a0,@PALFRAM,L ; movi scorep,a0 ;Score area palette jauc pal_getf #***************************************************************************** * * call this at the top of any anim sequence that requires that you be * attached before you get there, like any of the pile-drivers, vertical * suplexes, and so forth. This checks for a good link, and bitches up * a storm if it doesn't find one. SUBR link_check .if DEBUG move *a13(ATTACH_PROC),a14,L jrnz #ok1 LOCKUP ;I'm not attached! nop #ok1 move *a14(ATTACH_PROC),a14,L jrnz #ok2 LOCKUP ;I'm attached, but he's not attached to me! nop #ok2 cmp a14,a13 jreq #ok3 LOCKUP ;We're both attached, but not to each other! nop .endif #ok3 rets #***************************************************************************** * * clears CLIMBING_THRU flag and sets SAFE_TIME to 1, which won't do you * any good unless you're holding block. Call this at the end of any * rope climb-through anim. SUBR clr_climb clr a0 move a0,*a13(CLIMBING_THRU) ;1=Climbing thru ropes flag inc a0 move a0,*a13(SAFE_TIME) rets #***************************************************************************** * * returns carry set if one of a13's teammates has done a pin this round. * * trashes scratch SUBR ck_teammate_pin PUSH a2,a3 movk NUM_WRES,a0 movi process_ptrs,a1 move *a13(PLYR_SIDE),a2 #lp move *a1+,a3,L jrz #nxt ;skip inactive cmp a3,a13 jreq #nxt ;skip self move *a3(PLYR_SIDE),a14 cmp a14,a2 jrne #nxt ;skip enemies move *a3(STATUS_FLAGS),a14 btst B_DID_PIN,a14 jrz #nxt ;skip guys who didn't pin ;got a pinning teammate PULL a2,a3 setc rets #nxt dsj a0,#lp ;no pinning teammates PULL a2,a3 clrc rets #***************************************************************************** * * rummage through process_ptrs and decide which pal this wrestler should * get. return pal ptr in b0 * * trashes a0,a1,a2,a3, and a14. SUBR choose_pal ;assign pals in PLYRNUM order. There's four in the table for ; each wrestler. .if 1 ; First check to see if there are 2 human players and they are ; playing the same wrestler move @PSTATUS,a14 ; Get status cmpi 3,a14 ; Do we have 2 humans playing ? jrnz #pp_go ; br = no ;if buddy mode, choose special pals move @buddy_mode_on,a14 jrnz #buddy_mode clr a2 clr a14 neg a14 movi process_ptrs,a0 #f_loop move *a0+,a3,L jrz #f_done move *a3(PLYRNUM),a4 jrnz #not_p1 move *a3(WRESTLERNUM),a2 #not_p1 cmpi 1,a4 jrnz #not_p2 move *a3(WRESTLERNUM),a14 #not_p2 jruc #f_loop #f_done move a14,a14 ; Does player 2 exist ? jrn #pp_go ; br = no cmp a2,a14 ; Are player 1 and 2 same wrestler ? jrnz #pp_go ; br = no (no need to adjust pals) move @player_pal_pref,a0 ; Get player 1 palette preference cmpi 7,a0 ; Is it last palette ? jrnz #set_pal ; br = no movk 2,a0 ; force a palette above what'll be used by drones #set_pal move a0,@player_pal_pref+10h ; Set player 2 palette #pp_go .endif ;count identical wrestlers with lower PLYRNUMs. movi process_ptrs,a0 clr a4 ; match count move *a13(PLYRNUM),a2 ; Get player number cmpi 2,a2 ; Are we human ? jrge #not_player ; br = no X16 a2 ; Get playre palette preference addi player_pal_pref,a2 move *a2,a4 ; Init the counter to preference #not_player move *a13(WRESTLERNUM),a1 ;loop from 0 to our PLYRNUM looking for matches, UNLESS we're a ; drone doink, in which case we just check 0 and 1. move *a13(PLYRNUM),a2 jrz #end0 cmpi 2,a2 ;first drone is okay too. jrle #lp0 cmpi W_DOINK,a1 jrne #lp0 movk 2,a2 #lp0 move *a0+,a3,L jrz #nxt0 ;skip inactive move *a3(WRESTLERNUM),a14 cmp a1,a14 jrne #nxt0 inc a4 ;got a match--inc count #nxt0 dsj a2,#lp0 #end0 andi 7,a4 X32 a4 X256 a1 add a1,a4 addi #wrestler_pal_table,a4 move *a4,a14,L move a14,b0 rets #buddy_mode move *a13(WRESTLERNUM),a0 X64 a0 move *a13(PLYR_SIDE),a14 X32 a14 add a14,a0 addi #buddy_mode_pals,a0 move *a0,a14,L move a14,b0 rets #wrestler_pal_table ; pnch ppnch kick pkick REFLONG HRTPNK_P,HRTBLU_P,HRTORG_P,HRTYEL_P,HRTRED_P,HRTGRN_P,HRTPRP_P,HRTGRY_P ;(Bret) REFLONG RZRGRN_P,RZRPRP_P,RZRYEL_P,RZRORG_P,RZRPNK_P,RZRBLU_P,RZRRED_P,RZRGRY_P ;(Razor) REFLONG UNDPRP_P,UNDBLK_P,UNDGRN_P,UNDORG_P,UNDPNK_P,UNDBLU_P,UNDYEL_P,UNDRED_P ;(Taker) REFLONG YOKRED_P,YOKPRP_P,YOKYEL_P,YOKORG_P,YOKPNK_P,YOKBLU_P,YOKGRN_P,YOKGRY_P ;(Yoko) REFLONG SHNRED_P,SHNPRP_P,SHNORG_P,SHNGRN_P,SHNPNK_P,SHNBLU_P,SHNYEL_P,SHNGRY_P ;(Shawn) REFLONG BAMBLU_P,BAMYLW_P,BAMPRP_P,BAMORG_P,BAMPNK_P,BAMRED_P,BAMGRN_P,BAMGRY_P ;(Bam Bam) REFLONG DNKBLU_P,DNKPRP_P,DNKORG_P,DNKRED_P,DNKPNK_P,DNKGRN_P,DNKYEL_P,DNKGRY_P ;(Doink) .long 0,0,0,0,0,0,0,0 REFLONG LEXWHT_P,LEXPRP_P,LEXRED_P,LEXYEL_P,LEXGRN_P,LEXPNK_P,LEXORG_P,LEXGRY_P ;(Lex) #buddy_mode_pals .long HRTBLU_P,HRTRED_P .long RZRBLU_P,RZRRED_P .long UNDBLU_P,UNDRED_P .long YOKBLU_P,YOKRED_P .long SHNBLU_P,SHNRED_P .long BAMBLU_P,BAMRED_P .long DNKBLU_P,DNKRED_P .long 0,0 .long LEXPRP_P,LEXRED_P #***************************************************************************** * Sets PLYR_TYPE to PTYPE_PLAYER if PLYRNUM < 2. * * >a13 = process * SUBR drone_change_back move *a13(PLYRNUM),a14 cmpi 2,a14 jrge #done ;don't check real drones ;don't bother checking if they're a drone or not. In either case, ; turning them human again won't hurt. movi PTYPE_PLAYER,a14 move a14,*a13(PLYR_TYPE) #done rets #***************************************************************************** * (called by animation system) * SUBR start_run_flung .word ANI_SETMODE,MODE_UNINT|MODE_NOAUTOFLIP .word ANI_SETFACING ;so the offset works properly WL ANI_CODE,#x_flip .word ANI_OFFSET,20,0,0 WL ANI_CODE,#ok2 .word ANI_GETUP,FLUNG_TIME ;Flung time .word ANI_END SUBR start_run_anim .word ANI_SETMODE,MODE_UNINT|MODE_NOAUTOFLIP ;Is this a good idea? .word ANI_DETACH WL ANI_CODE,#setup_run .word ANI_END #setup_run ; move a13,a0 ; calla wres_get_stick_val_cur PUSH a1 ; movk 4,a1 movk 1,a1 calla dufus_msg_off PULL a1 move *a13(STICK_VAL_CUR),a0 andi MOVE_LEFT+MOVE_RIGHT,a0 jrnz #use_joy1 move *a13(FACING_DIR),a0 ;use facing andi MOVE_LEFT+MOVE_RIGHT,a0 #use_joy1 move *a13(FACING_DIR),a1 andi MOVE_LEFT+MOVE_RIGHT,a1 cmp a0,a1 jrz #ok1 ;He wants to run in the opposite direction than he is facing ;Rotate him around first. move *a13(FACING_DIR),a1 andi MOVE_UP+MOVE_DOWN,a1 or a1,a0 move a0,*a13(NEW_FACING_DIR) move a0,*a13(FACING_DIR) ; callr set_rotate_anim ; move a13,a2 ;a2 = * process ; calla change_anim_anim #ok1 ; movi #dorun,a0 ;this routine gets executed jruc #dorun jruc #contx #ok2 ;Whenever you fling someone, a meter can & will appear clr a0 move a0,*a13(DELAY_METER) movi #dorun_flung,a0 ;this routine gets executed #contx move a0,*a13(CODE_ADDR),L ;when the rotate anim SETMODE WAITANIM ;finishes move *a13(OBJ_XVEL),a0,L sra 1,a0 move a0,*a13(OBJ_XVEL),L clr a0 move a0,*a13(OBJ_ZVEL),L rets #x_flip move *a13(FACING_DIR),a14 xori >0C,a14 move a14,*a13(FACING_DIR) rets #dorun clr a0 move a0,*a13(GETUP_TIME) ;in control #dorun_flung clr a0 move a0,*a13(USR_VAR1) ;with x-xel move a0,*a13(RUN_TIME) ;Bogosity.. move *a13(FACING_DIR),a0 ;use facing ;; move *a13(NEW_FACING_DIR),a0 ;use facing ; move *a13(WHOHITME),a14,L ; move *a14(FACING_DIR),a0 ; andi MOVE_LEFT+MOVE_RIGHT,a0 ; xori 0ch,a0 #ok move a0,*a13(MOVE_DIR) move *a13(NEW_FACING_DIR),a1 andi MOVE_UP+MOVE_DOWN,a1 or a0,a1 ;LEFT or RIGHT move a1,*a13(FACING_DIR) ;face same dir as run move *a13(WRESTLERNUM),a0 X32 a0 addi #run_anims,a0 move *a0,a0,L ;run anim calla change_anim1a SETMODE RUNNING movk 1,a0 move a0,*a13(DELAY_BUTNS) rets .ref bam_run_anim .ref dnk_run_anim .ref hrt_run_anim .ref lex_run_anim .ref rzr_run_anim .ref shn_run_anim .ref und_run_anim .ref yok_run_anim #run_anims .long hrt_run_anim ;0 Bret Hart .long rzr_run_anim ;1 Razor Ramon .long und_run_anim ;2 Undertaker .long yok_run_anim ;3 Yokozuna .long shn_run_anim ;4 Shawn Michaels .long bam_run_anim ;5 Bam Bam .long dnk_run_anim ;6 Doink .long dnk_run_anim ;7 spare .long lex_run_anim ;8 Lex Luger .long dnk_run_anim ;9 Referee #***************************************************************************** SUBR flash_white movi [1111h,0000h],a1 ;[color,pal] movi [256,400],a2 ;[Ysz,Xsz] clr a3 ;[Ypos,Xpos] clr a4 ;SAG movi DMACAL,a5 ;[offset,ctrl] calla QDMAN rets SUBR flash_red movi [1b1bh,0000h],a1 ;[color,pal] movi [256,400],a2 ;[Ysz,Xsz] clr a3 ;[Ypos,Xpos] clr a4 ;SAG movi DMACAL,a5 ;[offset,ctrl] calla QDMAN rets #***************************************************************************** * * return carry set if wrestler a0 has any living teammates. (excluding self) * * trashes scratch SUBR ck_live_teammates PUSH a2,a3,a4 move *a0(PLYR_SIDE),a1 movi process_ptrs,a2 movk NUM_WRES,a3 #lp move *a2+,a4,L jrz #nxt ;skip inactive cmp a4,a0 jreq #nxt ;skip self move *a4(PLYR_SIDE),a14 cmp a14,a1 jrne #nxt ;skip other team move *a4(PLYRMODE),a14 cmpi MODE_DEAD,a14 jreq #nxt ;skip dead ;found live teammate. PULL a2,a3,a4 setc rets #nxt dsj a3,#lp PULL a2,a3,a4 clrc rets #***************************************************************************** * * return carry set if wrestler a0 has any teammates, living or dead. * * trashes scratch SUBR ck_any_teammates PUSH a2,a3,a4 move *a0(PLYR_SIDE),a1 movi process_ptrs,a2 movk NUM_WRES,a3 #lp move *a2+,a4,L jrz #nxt ;skip inactive cmp a4,a0 jreq #nxt ;skip self move *a4(PLYR_SIDE),a14 cmp a14,a1 jrne #nxt ;skip other team ;found a teammate. PULL a2,a3,a4 setc rets #nxt dsj a3,#lp PULL a2,a3,a4 clrc rets #***************************************************************************** * * set smart_attack bit and set smart_target to *a13(WHOIHIT). * SUBR target_whoihit move *a13(STATUS_FLAGS),a14 ori M_SMART_ATTACK,a14 move a14,*a13(STATUS_FLAGS) move *a13(WHOIHIT),*a13(SMART_TARGET),L rets #***************************************************************************** * * If all of a13's opponents are dead and !zombie, and a13 is either outside * or all his opponents are outside, setc and rets. else clrc and rets. SUBR raisearm_check ;if a13 is human and this is a royal rumble, make sure @FINAL_PTR is ;FFh. If it isn't, don't raise arm. move @royal_rumble,a14 jrz #hack_done move *a13(PLYR_TYPE),a14 jrnz #hack_done ;PLAYER=0 move @FINAL_PTR,a14,L move *a14,a14 jrn #hack_done jruc #clrc ;no good #hack_done move *a13(PLYR_SIDE),a0 movk NUM_WRES,a1 movi process_ptrs,a2 clr a4 ;'is any opponent inside' flag. #lp move *a2+,a3,L jrz #nxt ;skip inactive move *a3(PLYR_SIDE),a14 cmp a14,a0 jreq #nxt ;skip a13 and teammates move *a3(PLYRMODE),a14 cmpi MODE_DEAD,a14 jrne #clrc ;opp dead? move *a3(STATUS_FLAGS),a14,L btst B_ZOMBIE,a14 jrnz #clrc ;zombie? move *a3(INRING),a3 jrnz #nxt ;dead !zombie bad guy is inside. set a4 inc a4 #nxt dsj a1,#lp ;okay, all our opponents are dead and staying that way. now check ; the inside/outside stuff. move *a13(INRING),a14 jrnz #setc ;am I outside? TEST a4 jrnz #clrc ;is any opponent inside? #setc setc rets #clrc clrc rets #***************************************************************************** * * Set WHOIHIT to closest opponent. Call this after you do a LEAPAT in your * pin. Since pins don't actually attack, we need to do this so that WHOIHIT * is correct when we call grnd_hit. We can't use CLOSEST in grnd_hit, since * it's possible to land closer to someone else than the guy you meant to pin. * ONLY USE THIS IN PINS!!!!!!!!!!!!!! Cuz it also sets the PINNED bit. * SUBR hit_nearest ;set WHOIHIT and victim WHOPINNEDME move *a13(CLOSEST_NUM),a0 X32 a0 addi process_ptrs,a0 move *a0,a0,L move a0,*a13(WHOIHIT),L move a13,*a0(WHOPINNEDME),L ;set victim's PINNED bit. move *a0(STATUS_FLAGS),a14 ori M_PINNED,a14 move a14,*a0(STATUS_FLAGS) rets #***************************************************************************** * * Change into another wrestler and re-enter the battle. This should probably * only be used in the king of the ring match. * * >a13 = pointer to process to change * SUBR change_wrestler **** ;change wrestlernum move *a13(NEW_WRESTLERNUM),*a13(WRESTLERNUM) **** ;make the new special move processes callr init_smoves **** ;change palette calla choose_pal move b0,a0 calla pal_getf move a0,*a13(OBJ_PAL) move a0,*a13(MY_PAL) movk MAX_PIECES-1,a9 move *a13(OBJ_BASE),a1,L addk 20h,a1 ;skip shadow #nxt move *a1+,a8,L move a0,*a8(OPAL) dsj a9,#nxt **** ;re-initialize animation movi MODE_NORMAL,a14 move a14,*a13(PLYRMODE) move *a13(WRESTLERNUM),a9 X64 a9 addi #init_anims,a9 move *a9+,a0,L calla change_anim1a move *a9,a0,L calla change_anim2a **** ;reset STATUS_FLAGS clr a14 move a14,*a13(STATUS_FLAGS),L **** ;reset life and combo data calla init_wres_life_data **** ;clear I_WILL_DIE clr a14 move a14,*a13(I_WILL_DIE) **** ;set new position movi #init_positions,a0 #lp1 move *a0(#NXT),a14,W jrn #usea0 ;if last entry, use by default. ;use current entry if: ; X <= WORLDTLX-30 or ; X >= WORLDTLX+400+30 move *a0(#XPOS),a1 move @WORLDTLX,a14,L sra 16,a14 subk 30,a14 cmp a14,a1 jrle #usea0 addi 460,a14 cmp a14,a1 jrge #usea0 #nxt1 addi #SIZE,a0 jruc #lp1 #usea0 move *a0(#XPOS),*a13(OBJ_XPOSINT) move *a0(#ZPOS),*a13(OBJ_ZPOSINT) move *a0(#YPOS),*a13(OBJ_YPOSINT) move *a0(#YPOS),*a13(GROUND_Y) move *a0(#INRING),*a13(INRING) **** ;clear old velocities clr a14 move a14,*a13(OBJ_XVEL),L move a14,*a13(OBJ_YVEL),L move a14,*a13(OBJ_ZVEL),L rets #init_anims REFLONG hrt_stand4_anim,hrt_torso4_anim REFLONG rzr_stand4_anim,rzr_torso4_anim REFLONG und_stand4_anim,und_torso4_anim REFLONG yok_stand4_anim,yok_torso4_anim REFLONG shn_stand4_anim,shn_torso4_anim REFLONG bam_stand4_anim,bam_torso4_anim REFLONG dnk_stand4_anim,dnk_torso4_anim .long 0,0 REFLONG lex_stand4_anim,lex_torso4_anim ;possible starting positions. hunt until you find one that's ; offscreen, then use it. If none of them are offscreen (should ; never happen,) use the last entry in the table. STRUCT 0 WORD #XPOS WORD #ZPOS WORD #YPOS WORD #INRING LABEL #SIZE WORD #NXT ;first element of NEXT entry. check for -1. ;XPOSINT, ZPOSINT, YPOSINT/GROUND_Y, INRING #init_positions .word RING_X_CENTER,RING_Z_CENTER,MAT_Y,0 ;center .word RING_TOP_LEFT,RING_Z_CENTER,MAT_Y,0 ;center left .word RING_TOP_RIGHT,RING_Z_CENTER,MAT_Y,0 ;center right .word RING_BOT_LEFT,RING_BOT,MAT_Y,0 ;bottom left .word RING_BOT_RIGHT,RING_BOT,MAT_Y,0 ;bottom right .word 024Fh,060Eh,0,1 ;outside left .word 060Eh,04ABh,0,1 ;outside right .word -1 #***************************************************************************** * * Kill all my special move processes. * SUBR kill_smove_procs PUSH a2,a3 ;loop through the processes. Anything with a PID of SMOVE_PID, and ; a PA8 that matches our a13 must go. move @ACTIVE,a3,L #lp0 move a3,a2 ;a2 = p->this jrz #done0 move *a2,a3,L ;a3 = p->next move *a2(PROCID),a14 cmpi SMOVE_PID,a14 jrne #lp0 move *a2(PA8),a14,L cmp a14,a13 jrne #lp0 ;match. kill this one move a2,a0 calla KILL jruc #lp0 #done0 PULL a2,a3 rets #***************************************************************************** * * Check to make sure your opponent is at rest and staying that way. Check * to see if he's in the xxx_dead_anim. And make sure he's in range. * Oh, and make sure there aren't any zombies either. * SUBR can_pin ;no pin if there are any zombies or live wrestler on other team movi process_ptrs,a0 movk NUM_WRES,a1 move *a13(PLYR_SIDE),a3 #lp0 move *a0+,a2,L jrz #nxt0 ;skip inactive move *a2(PLYR_SIDE),a14 cmp a14,a3 jreq #nxt0 ;skip teammates move *a2(PLYRMODE),a14 cmpi MODE_DEAD,a14 jrne #clrc move *a2(STATUS_FLAGS),a14 btst B_ZOMBIE,a14 jrnz #clrc #nxt0 dsjs a1,#lp0 ;check range move *a13(CLOSEST_DIST),a0 cmpi 70h,a0 jrgt #clrc move *a13(CLOSEST_ZDIST),a0 cmpi 50h,a0 jrgt #clrc calla get_opp_process move *a0(STATUS_FLAGS),a14 btst B_PINABLE,a14 jrz #clrc #setc ;just to be safe, set the PINNED bit on the guy move *a0(STATUS_FLAGS),a14 ori M_PINNED,a14 move a14,*a0(STATUS_FLAGS) ;and set his WHOPINNEDME move a13,*a0(WHOPINNEDME),L ;and zero his velocities clr a14 move a14,*a0(OBJ_XVEL),L move a14,*a0(OBJ_YVEL),L move a14,*a0(OBJ_ZVEL),L ;and set his PTIME to one and clear his KOD bit, 'cuz he's probably ; been KO'd if he's a drone. movk 1,a14 move a14,*a0(PTIME) move *a0(STATUS_FLAGS),a14 andni M_KOD,a14 move a14,*a0(STATUS_FLAGS) setc rets #clrc clrc rets #***************************************************************************** * * Dead wrestlers sit here. SUBR xxx_dead_anim .word ANI_SETMODE,MODE_NOAUTOFLIP|MODE_UNINT .word ANI_SETPLYRMODE,MODE_DEAD WL ANI_CODE,#set_pinable_bit WL ANI_CODE,#ko_if_drone .word ANI_ROT ;just sit and do nothing ***** * KO my process if I'm a drone. SUBRP #ko_if_drone ;don't go to sleep if this is an 8-on-1 or 8-on-2 match, UNLESS ; wrestler_count is 0, which means there's no hope of becoming ; a zombie. move @royal_rumble,a14 jrnz #is8 calla is_8_on_1 jrnc #not8 #is8 move @wrestler_count,a14 jrnz #rets #not8 move *a13(PLYR_TYPE),a14 cmpi PTYPE_DRONE,a14 jrne #rets ;don't KO if I've been pinned move *a13(STATUS_FLAGS),a14 btst B_PINNED,a14 jrnz #rets ;don't KO if our NO_KO bit is set. btst B_NO_KO,a14 jrnz #rets ori M_KOD,a14 move a14,*a13(STATUS_FLAGS) #rets rets ***** * set the PINABLE bit in STATUS_FLAGS SUBRP #set_pinable_bit move *a13(STATUS_FLAGS),a14 ori M_PINABLE,a14 move a14,*a13(STATUS_FLAGS) rets #***************************************************************************** * * This gets called once each MATCH for every wrestler, not each round. * It creates the set of 'watchdog' processes that look out for special * moves that the usual method can't handle; specifically, stuff that * involves charging up with a stick, detailed control over timing, or * proximity to the bad guy. * SUBR init_smoves move *a13(WRESTLERNUM),a2,W X32 a2 addi #special_moves,a2 move *a2,a2,L jrz #done #loop move *a2+,a7,L jrz #done movi SMOVE_PID,a1 move a13,a8 calla GETPRC_INSERT ;store reset address move *a0(PWAKE),*a0(SM_RESET_ADDRESS),L jruc #loop #done rets #special_moves REFLONG hrt_smove_table ;Bret REFLONG rzr_smove_table ;Razor REFLONG und_smove_table ;Taker REFLONG yok_smove_table ;Yoko REFLONG shn_smove_table ;Shawn REFLONG bam_smove_table ;Bam Bam REFLONG dnk_smove_table ;Doink .long 0 ;spare REFLONG lex_smove_table ;Lex #***************************************************************************** .bss #pin_timeout,16 ;pin idiot check cntdown .bss #last_dead,16 ;PCNT last time we had a one-team ; dead condition. SUBR match_timer movk 9,a0 move a0,@match_time ;10's move a0,@match_time+10h ;1's clr a0 move a0,@match_time+20h ;fractional callr #create_timer SLEEP TSEC*2 movk ADJSPEED,a0 ;game timer speed (1-5) calla GET_ADJ BADCHK a0,1,5,3 ;reg,lo,hi,val X16 a0 ;x 16 bits addi timer_table-10h,a0 move *a0,a1 ;slow the clock to 1/3 speed if this is the royal rumble move @royal_rumble,a14 jrnz #isrum ;slow the clock (2/3 speed) if it's 1v3. move @PSTATUS,a14 jrz #nfin cmpi 3,a14 jreq #nfin move @NUM_OPPS,a14 cmpi 3,a14 jrne #nfin #isrum movi >AAAA,a14 mpyu a14,a1 srl 16,a1 ;slow it yet again (down to 1/3 speed) if this is the final battle, calla is_final_match jrc #isfin move @royal_rumble,a14 jrz #nfin #isfin sra 1,a1 #nfin move a1,a10 ;initialize #last_dead clr a14 move a14,@#last_dead ;initialize #pin_timeout - we need to do this because one time in ; 2^16, when we hit our first all-dead condition, PCNT will be 1, ; and the code will think that this isn't a new condition and it ; won't reset this value. Hey, it could happen. movi 4*TSEC,a14 move a14,@#pin_timeout #loop SLEEPK 1 move @HALT,a0 jrnz #loop move @match_time,a0,L jrz #loop ;call #dec_timer and update_timer only if there's a live member ; of every team. (for this purpose, zombies count as live members) callr get_live_bits move a0,a3 cmpi 3,a3 jrne #1tmded ;a team is completely dead callr #dec_timer callr update_timer jruc #loop #1tmded ;one team is completely dead - wait five seconds, and if there's ; no pin by then, award the round to the team that's sitting on ; it's silly drone ass instead of pinning. ;check #last_dead to see if this is a new all-dead condition or ; an old one. if it's a new one, we need to reset #pin_timeout. move @PCNT,a14 move @#last_dead,a0 sub a0,a14 dec a14 jrz #old ;new dead condition. reset #pin_timeout. ;temp! - 314 .if DEBUG DBEVENT BDE_ALL_DEAD,a13,L,a13,L,a13,L .endif movi 5*TSEC,a14 move a14,@#pin_timeout ;clear reduce_bog. if we're in 8-on-1 or 8-on-2 mode, clear this ; only if the human team is dead, or the drones are dead and no ; more are coming. move @royal_rumble,a14 jrnz #ck8_2 calla is_8_on_1 jrnc #crb #ck8_1 ;check the 8-on-1 case move @PSTATUS,a14 and a3,a14 ;a3 is bit of live team jrz #crb ;on z, human team is dead jruc #dtd ;else dead team is drones #ck8_2 ;check the 8-on-2 case btst 0,a3 ;team 0 is always humans in 8 on 2 jrz #crb ;on z, human team is dead #dtd ;dead team is drones move @wrestler_count,a14 cmpi 1,a14 jrge #ncrb #crb clr a14 move a14,@reduce_bog ;wake the crowd move @crowd_process,a0,L movk 1,a14 move a14,*a0(PTIME) #ncrb ;create the PIN HIM message process. move a3,a9 xori 3,a9 srl 1,a9 ;a8 is dead team (0 or 1) CREATE PINHIM_ANIM_PID,pin_prompt #old ;update #last_dead move @PCNT,a14 move a14,@#last_dead ;dec pin_timeout and call the round if time's up. move @#pin_timeout,a14 jrz #loop ;we've already called this round dec a14 jrz #end ;time's up - do it. move a14,@#pin_timeout jruc #loop #end CREATE ANNC_PID,announce_rnd_winner .if DEBUG move a13,*a0(PDATA),L ;#CREATOR (pdata) movi $,a14 move a14,*a0(PDATA+20h),L ;#ORIGIN .endif ;stuff a 0 in #pin_timeout so we'll know that there's no further ; action to be taken on this all-dead condition. clr a14 move a14,@#pin_timeout jruc #loop ******************** #create_timer ;set pal movi WGFS_W_P,b0 calla is_8_on_1 jrnc #nfin2 movi WGSF_Y_P,b0 #nfin2 movi [186,0],a0 ;x pos movi [21,0],a1 ;y pos movi WGSF20_9,a2 movi 200,a3 ;z pos movi DMAWNZ|M_3D|M_SCRNREL,a4 ;DMA flags movi TYPTIMERDIGIT,a5 clr a6 ;x vel clr a7 ;y vel PUSH b0 calla BEGINOBJP PULL b0 move a8,*a13(PDATA+20h),L ;10's image pointer movi [200+2,0],a0 ;x pos movi [21,0],a1 ;y pos movi WGSF20_9,a2 calla BEGINOBJP move a8,*a13(PDATA),L ;1's image pointer rets ******************** #dec_timer move @match_time,a0,L cmpi 090009h,a0 jrne #no_reset_pal movi WGFS_W_P,a0 calla is_8_on_1 jrnc #nfin3 movi WGSF_Y_P,a0 #nfin3 calla pal_getf move *a13(PDATA+20h),a8,L ;10's image pointer move a0,*a8(OPAL) move *a13(PDATA),a8,L ;10's image pointer move a0,*a8(OPAL) #no_reset_pal move @match_time+20h,a0 ;fractional sub a10,a0 move a0,@match_time+20h jrnc #no_change move @match_time+10h,a0 ;1's dec a0 move a0,@match_time+10h jrnc #no_borrow movk 9,a0 move a0,@match_time+10h move @match_time,a0 ;10's dec a0 move a0,@match_time cmpi 0,a0 jrne #no_borrow movi WGSF_R_P,a0 calla pal_getf move *a13(PDATA+20h),a8,L ;10's image pointer move a0,*a8(OPAL) move *a13(PDATA),a8,L ;10's image pointer move a0,*a8(OPAL) #no_borrow ;if time is less than 15, make noise move @match_time,a0,L move a0,a1 sra 16,a0 andi 0Fh,a1 sla 4,a1 or a1,a0 cmpi 10h,a0 jrgt #no_change movk 10,a0 ;Time warning sound calla triple_sound #no_change rets timer_table .asg 1500,BASETM ;2100 ;16 .word BASETM-BASETM*30/100 ;1 (slowest) ;76.6 seconds/round .word BASETM-BASETM*15/100 ;2 (slower) .word BASETM ;3 (default) ;53.6 seconds/round .word BASETM+BASETM*15/100 ;4 (faster) .word BASETM+BASETM*30/100 ;5 (fastest) ;41.2 seconds/round ******************** SUBR update_timer move @match_time,a0 ;10's .if DEBUG cmpi 10,a0 jrlt #ok1 ;clock digit out of range! LOCKUP #ok1 .endif X32 a0 addi digit_tbl,a0 move *a0,a0,L ;* image move *a13(PDATA+20h),a8,L ;10's image pointer move *a8(OCTRL),a1 ;DMA flags calla change_image move @match_time+10h,a0 ;1's .if DEBUG cmpi 10,a0 jrlt #ok2 ;clock digit out of range! LOCKUP .endif #ok2 X32 a0 addi digit_tbl,a0 move *a0,a0,L ;* image move *a13(PDATA),a8,L ;1's image pointer move *a8(OCTRL),a1 ;DMA flags calla change_image rets #********************************************** * * SUBR wrestler_counter movk 8,a9 ; Initial wrestler count move a9,@wrestler_count ; Initialize the count ;Turn on remaining word movi [126h,0],a0 clr a11 move @PSTATUS,a14 cmpi 3,a14 jrz #no_adj btst 1,a14 jrz #no_adj movi [11ah,0],a11 #no_adj sub a11,a0 movi [32h,0],a1 movi remaining,a2 name_z equ 9 movi name_z,a3 ;Z movi DMAWNZ|M_SCRNREL,a4 ;DMA flags movi TYPWCCOUNT,a5 ;Delete the last string clr a6 clr a7 movi WSF_Y_P,b0 calla BEGINOBJP move a8,a10 movi [17eh,0],a0 sub a11,a0 movi [32h,0],a1 movi WSF10_8,a2 movi name_z,a3 ;Z movi DMAWNZ|M_SCRNREL,a4 ;DMA flags movi TYPWCCOUNT,a5 ;Delete the last string clr a6 clr a7 movi WSF_Y_P,b0 calla BEGINOBJP #wc_loop SLEEP 07fffh ; Sleep until woken up move @wrestler_count,a14 ; Get current count jrz #wc_exit ; Is it 0 ? - br = yes cmp a9,a14 ; Has it changed from last time ? jrz #wc_loop move a14,a9 ; Save for reprint move @wrestler_count,a0 ; Get current count X32 a0 addi #digit10_tbl,a0 move *a0,a0,L ;* image move *a8(OCTRL),a1 ;DMA flags calla change_image jruc #wc_loop ; Go redo it #wc_exit clr a0 move a0,@wrestler_count_proc,L calla DELOBJA8 move a10,a8 jauc DELOBJDIE #digit10_tbl .long WSF10_0 .long WSF10_1 .long WSF10_2 .long WSF10_3 .long WSF10_4 .long WSF10_5 .long WSF10_6 .long WSF10_7 .long WSF10_8 .long WSF10_9 digit_tbl .long WGSF20_0,WGSF20_1,WGSF20_2,WGSF20_3,WGSF20_4 .long WGSF20_5,WGSF20_6,WGSF20_7,WGSF20_8,WGSF20_9 #***************************************************************************** SUBR maybe_do_flashes #top SLEEPK 5 move @reduce_bog,a1 jrnz #die MOVE @WORLDTLY,A0,L CMPI [>ff97,0],A0 JRGT #top CALLA START_HI_FLASHES SLEEPK 30 JRUC #top #die DIE #***************************************************************************** * * sets our DID_RAISEARM bit. SUBR set_raisearm_bit move *a13(STATUS_FLAGS),a14,L ori M_DID_RAISEARM,a14 move a14,*a13(STATUS_FLAGS),L rets #***************************************************************************** * * check our DID_RAISEARM bit--set MODE_STATUS bit if it's clear (ANI_CODE) SUBR check_raisearm_bit move *a13(STATUS_FLAGS),a14,L btst B_DID_RAISEARM,a14 jrz #set #clr move *a13(ANIMODE),a14 andni MODE_STATUS,a14 move a14,*a13(ANIMODE) rets #set move *a13(ANIMODE),a14 ori MODE_STATUS,a14 move a14,*a13(ANIMODE) rets #***************************************************************************** * * choose buddies for buddy mode. return the wrestlernums in a0 and a1. SUBR choose_buddies ;prepare an exclusion mask clr a7 movk 1,a0 move @index1,a14 sll a14,a0 or a0,a7 movk 1,a0 move @index2,a14 sll a14,a0 or a0,a7 ;count excluded wrestlers move a7,a14 clr a8 movk 8,a0 #lp1 srl 1,a14 jrnc #nxt1 inc a8 #nxt1 dsj a0,#lp1 ;get the first one calla get_rnd_wrestler PUSH a0 ;store first WRESTLERNUM ;now exclude him and get another one. inc a8 ;inc exclusion count movk 1,a14 sll a0,a14 or a14,a7 calla get_rnd_wrestler PULL a1 ;retrieve first WRESTLERNUM rets #***************************************************************************** * * Return carry set if wrestler *a14 is behind wrestler *a13, clear otherwise. * * trashes a14 (isn't allowed to trash a0 or a1!) SUBR is_a14_behind PUSH a1 move *a14(OBJ_XPOSINT),a1 move *a13(OBJ_XPOSINT),a14 sub a1,a14 jrn #onrt #onlt ;opponent on my left move *a13(FACING_DIR),a14 btst MOVE_LEFT_BIT,a14 jrz #behind ; jruc #ahead #ahead PULL a1 clrc rets #onrt ;opponent on my right move *a13(FACING_DIR),a14 btst MOVE_RIGHT_BIT,a14 jrnz #ahead ; jruc #behind #behind PULL a1 setc rets #***************************************************************************** * * Call this when a match has just ended. Does an appropriate sound if * someone's winning streak has just ended. SUBR loser_snd move @PSTATUS,a14 cmpi 3,a14 jrne #rets move @match_winner,a1 NOT A1 ANDI 3,A1 DEC A1 X16 A1 ADDI p1oldwinstreak,A1 MOVE *A1,A1 jrz #rets MOVK 2,A0 CALLA RNDRNG0 SLL 4,A0 ADDI #speech,A0 MOVE *A0,A0 CALLA ADD_VOICE #rets rets #speech ;.word CONGRATULATIONS .word SOMEHOW_I_DONT_THINK ; .word L_CONGRATS .word L_BACK_TO_SANDBOX .word ARE_YOU_TOUGH_ENOUGH ; .WORD L_SIGN_YOUR_NAME ; .WORD THIS_IS_FOR_ALL ; .WORD SIGN_HERE_PLEASE #***************************************************************************** * SUBR postgame_audits ;battle over accounting. ;compute match_realtime move @match_start_time,a14,L move @PCNT,a1,L sub a14,a1 movi 55,a14 divu a14,a1 move a1,@match_realtime ;skip all this crap after a royal_rumble move @royal_rumble,a14 jrnz #rets ;increment AUD_VSHUMF or AUD_VSCPUF (and AUD_CPUWIN) movi AUD_VSHUMF,a0 move @PSTATUS,a14 cmpi 03h,a14 jreq #vshum movi AUD_VSCPUF,a0 #vshum calla AUD1 ;add to AUD_2PBTIME, AUD_CPUWINTIME, or AUD_CPULOSETIME move @PSTATUS,a14 cmpi 03h,a14 jreq #2pbtime move @match_winner,a0 and a0,a14 jrnz #cpulosetime jruc #cpuwintime #2pbtime movi AUD_2PBTIME,a0 jruc #addtime #cpuwintime MOVE @PSTARTS,A0 JRZ NO_UPDATE_ANYTHING MOVI AUD_CREDLEN,A0 MOVE @THIS_GAME_TIME,A1 CALLA AUD MOVI AUD_CREDLENNUM,A0 CALLA AUD1 CLR A0 MOVE A0,@THIS_GAME_TIME MOVE A0,@PSTARTS NO_UPDATE_ANYTHING movi AUD_CPUWIN,a0 calla AUD1 movi AUD_CPUWINTIME,a0 jruc #addtime #cpulosetime movi AUD_CPULOSETIME,a0 jruc #addtime #addtime move @match_realtime,a1 calla AUD ;update record speeds move @PSTATUS,a14 cmpi 03h,a14 jreq #fast_2p move @match_winner,a0 and a0,a14 jrnz #fast_cpulose jruc #fast_cpuwin #fast_2p movi AUD_FASTHDH,a0 calla GET_AUD jrz #no_prior_hdh move @match_realtime,a2 cmp a1,a2 jrge #recordspeed_done #no_prior_hdh movi AUD_FASTHDH,a0 move @match_realtime,a1 calla STORE_AUDIT jruc #recordspeed_done #fast_cpulose movi AUD_FASTHDC,a0 calla GET_AUD jrz #no_prior_hdc move @match_realtime,a2 cmp a1,a2 jrge #recordspeed_done #no_prior_hdc movi AUD_FASTHDC,a0 move @match_realtime,a1 calla STORE_AUDIT jruc #recordspeed_done #fast_cpuwin movi AUD_FASTCDH,a0 calla GET_AUD jrz #no_prior_cdh move @match_realtime,a2 cmp a1,a2 jrge #recordspeed_done #no_prior_cdh movi AUD_FASTCDH,a0 move @match_realtime,a1 calla STORE_AUDIT #recordspeed_done ;No speedy victories in 3 rnd matches! move @current_round,a0 cmpi 3,a0 jrz #rets ;increment the proper wrestler use thingies MOVE @PSTATUS,A0 CMPI 3,A0 JREQ #2pmatch ;it's a one-player match. move @index1,a2 CLR A1 SRL 1,A0 JRC AUDIT_THE_HUMAN move @index2,a2 MOVK 1,A1 AUDIT_THE_HUMAN CALLR #audit_wrestler move @NUM_OPPS,a14 cmpi 1,a14 jrne #rets ;don't audit 1-vs-many matches ;audit the computer move @CURRENT_LADDER,a0,L move *a0,a2,L sll 24,a2 srl 24,a2 ;CPU wrestlernum in a2 ;convert 7 to 8. cmpi 7,a2 jrne #vok0 inc a2 #vok0 move @PSTATUS,a1 xori 3,a1 srl 1,a1 ;CPU side in a3 (!PSTATUS >> 1) callr #audit_wrestler rets ;human vs. human match #2pmatch ;player 1 move @index1,a2 CLR A1 CALLR #audit_wrestler ;player 2 move @index2,a2 MOVK 1,A1 CALLR #audit_wrestler #rets RETS ****************** * a2 = WRESTLERNUM * a1 = PLYR_SIDE SUBRP #audit_wrestler TEST a2 jrnn #ok .if DEBUG LOCKUP .endif rets #ok X64 a2 ;x 4 words addi wrestler_audits,a2 move @PSTATUS,a0 btst A1,a0 jrnz #p1hum addi 20h,a2 ;skip 2 words #p1hum move *a2+,a0,W ;increment uses calla AUD1 move @match_winner,a0 btst A1,a0 jrz #p1_audited move *a2+,a0,W ;increment wins calla AUD1 #p1_audited RETS #**************************************************************************** * * Returns bits of teams with live members in a0. * SUBR get_live_bits PUSH a1,a2,a3 movk NUM_WRES,a0 movi process_ptrs,a1 clr a3 #lp1 move *a1+,a2,L jrz #nxt1 ;skip inactive move *a2(PLYRMODE),a14 cmpi MODE_DEAD,a14 jrne #live move *a2(STATUS_FLAGS),a14 btst B_ZOMBIE,a14 jrz #nxt1 ;skip dead &! zombie #live ;live wrestler. flag his team move *a2(PLYR_SIDE),a14 jrnz #t2 ;member of team 1 ori 01h,a3 jruc #nxt1 #t2 ;member of team 2 ori 02h,a3 #nxt1 dsj a0,#lp1 move a3,a0 PULL a1,a2,a3 rets #***************************************************************************** * * Returns carry set if any of a13's live opponents are outside the ring. * Trashes a0, a1, a14 * SUBRP any_opp_outside PUSH a3 movi process_ptrs,a0 movi NUM_WRES,a1 move *a13(PLYR_SIDE),a2 #lp0 move *a0+,a3,L jrz #nxt0 ;skip inactive move *a3(PLYR_SIDE),a14 cmp a14,a2 jreq #nxt0 ;skip teammates move *a3(PLYRMODE),a14 cmpi MODE_DEAD,a14 jreq #nxt0 ;skip dead guys move *a3(INRING),a14 jrnz #setc ;is outside? #nxt0 dsj a1,#lp0 PULL a3 clrc rets #setc PULL a3 setc rets #***************************************************************************** * * Sets a13's PLYRMODE to INAIR2 if his nearest opponent is dead, INAIR * otherwise. * SUBR set_tbukl_airmode calla get_opp_plyrmode cmpi MODE_DEAD,a0 jreq #dead movi MODE_INAIR2,a0 jruc #go #dead movi MODE_INAIR,a0 #go move a0,*a13(PLYRMODE) rets #***************************************************************************** * * set MODE_STATUS bit if switches are AWAY & PUNCH. SUBR free_toss_check move *a13(ANIMODE),a0 ori MODE_STATUS,a0 move *a13(CLOSEST_NUM),a14 X32 a14 addi process_ptrs,a14 move *a14,a14,L move *a14(OBJ_ZPOS),a14,L move *a13(OBJ_ZPOS),a1,L sub a1,a14 abs a14 srl 16,a14 cmpi 15,a14 jrlt #set ; move *a13(STICK_REL_CUR),a14 ; btst MOVE_AWAY_BIT,a14 ; jrz #clr move *a13(BUT_VAL_CUR),a14 cmpi PLAYER_BLOCK_VAL,a14 jreq #set ;#clr andni MODE_STATUS,a0 #set move a0,*a13(ANIMODE) rets #***************************************************************************** * * We're gonna do a free hiptoss. Do all the neccesary setup here. Set our * PLYRMODE to normal, IMMOBILIZE the bad guy, clear velocities, etc. SUBR setup_freetoss ;mode normal SETMODE NORMAL ;immobilize bad guy move *a13(WHOIHIT),a0,L movk 20,a14 move a14,*a0(IMMOBILIZE_TIME) ;smart-target bad guy SMRTTGT a13,WHOIHIT rets ****************************************************************************** .end