12122 lines
227 KiB
NASM
Executable File
12122 lines
227 KiB
NASM
Executable File
**************************************************************
|
||
;To Do for MARK:
|
||
|
||
|
||
;snd on ddunk start
|
||
;rndper combat
|
||
;fix spear ball
|
||
;fix spear ball z
|
||
;show hidden pass rating
|
||
;show hidden clutch rating
|
||
;Jordan layup from in too close
|
||
;Do dunks...
|
||
;Check all dunk_b code for lack of ball!!!!!!!!!!!!
|
||
;Give reasons to pick some teams...
|
||
|
||
;pick up ball, along sideline
|
||
|
||
|
||
;1 ally opp jump up attempt per inbound for drone playing with a human
|
||
;3 successful drone ally oops per period - then stop
|
||
;If human goes up for an alley oop and is denied, don't have drone shoot.
|
||
|
||
|
||
|
||
;done: Timer runs out on layup from dunk and ball doesn't continue!
|
||
;done: Slow down run tick cnt
|
||
;done: Turn smoke off when tvpanel is on screen
|
||
;done: Midway copyright info - hang logo on top
|
||
;done: Chk colors of ABA ball
|
||
;done: DDunk white-flash bug
|
||
;done: Get rid of all 0,0 ani pts - ball ani pts!!
|
||
;done: Chk Vancouver heads - one seemed to be facing down
|
||
;done: Better goaltend esp. on-fire
|
||
;done: Match make player tables to plyrat tables
|
||
;done: Less CPU assist
|
||
;done: Less intercepts! Ddunks harder to block!
|
||
;done: Lineup #5 swat
|
||
;done: Gill/Gilliam
|
||
;done: Turn off arrows on top of head more...
|
||
;done: Fewer intercepts
|
||
;done: Get Sean head darkened (small heads also?)
|
||
;done: Look at missed dunk offsets....
|
||
;done: Layups more blockable
|
||
;done: Alley oop passes should be intercepted more!
|
||
;done: Radja head points
|
||
;done: New rules for when we flash white on a dunk... - Height!
|
||
;done: Don't let knock-downs keep the ball as often
|
||
;done: don't swat rebound
|
||
;done: don't grab off rim if rim hit time is less than 4 ticks?
|
||
;done: One-handed snag blocks = rebound
|
||
;done: Do shot delay at end of swats! In seq!
|
||
;done: No feet fire when jumping on defense
|
||
;done: Debounce shoot on drone dunk - he always laysup
|
||
|
||
;MARK: Blocking drift? which way?
|
||
;MARK: Eldon Campbell was pushed out of a mini-dunk : CRASH!!
|
||
;MARK: Random Y vel on big guy pushdowns
|
||
|
||
;MARK: Turn off falling down pass to alley ooper
|
||
;MARK: Ball hits glass wall on blocks! What art?
|
||
; Wierd collision on #5 type block
|
||
;MARK: Off-screen speed rules: Speed up offense, but slow'em dwn if passed 2
|
||
;MARK: Slow down long passes!
|
||
;MARK: Better dunk flail
|
||
;MARK: In middle of dunk, 2 taps send drone teammate up for double dunk
|
||
;MARK: In middle of dunk, 1 tap sends drone teammate out to 3 pt range
|
||
;MARK: All three butns send flag to drones to jmp up for alley oop
|
||
; All three at once, no effect on passer...
|
||
;MARK: Other layups out of dunk... IE the old one!
|
||
;MARK: Fall down seqs
|
||
;MARK: Home game has expanded create player sfx, etc
|
||
;MARK: Ultimate title page
|
||
;MARK: Cannonball dunk
|
||
;MARK: Chk all img size bits
|
||
;MARK: Pushing a jump shooter problem
|
||
;MARK: Chk plyr push detect/accuracy
|
||
;MARK: Pick up ball bug
|
||
;MARK: Add weight att. to gameplay
|
||
;MARK: Plyr trails for team fire dunks - outdoor only?!?
|
||
;MARK: Perhaps do an extra check at 3pt shot to cause weak 3pt shooters to
|
||
; fail!
|
||
;MARK: Don't float toward teammate shot, (for put back---alley oop)
|
||
;MARK: Get Jordan, Barkley, Shaq look alike heads
|
||
;MARK: During HEADCK, also listen for correct name speech!
|
||
;MARK: No look into wrong dir
|
||
;MARK: jazz up dunks...some how ?
|
||
;MARK: Dunks - shadow trails, smoke from body, etc.
|
||
;MARK: At end, check all dunk header tables for flip angle correctness!
|
||
;MARK: Fix Utah, Golden State, Lakers, court pals
|
||
;MARK: Could get rid of pals on all player images!
|
||
;MARK: Get Ed paper debris for outdoor court
|
||
;MARK: allow drone circus mode in some cases...
|
||
; #noalyo is the label in DRONE2.ASM
|
||
;MARK: don't attach to ball at block time if ball near grnd
|
||
;MARK: Shot clock big bug!
|
||
;MARK: Shot clock text on top of G.T. text!
|
||
;MARK: Inbound on the run - powerup?
|
||
;MARK: Drone big head.
|
||
;MARK: Running pass
|
||
;MARK: Cut back defender off-screen-back-to-on-screen speed
|
||
;MARK: Consider other seqs for ddunks/alleys - careful of range checks
|
||
;MARK: Chk Cebalis mug shot
|
||
;MARK: Gambling option
|
||
;MARK: Fix mug shot Y anim
|
||
;MARK: Chk block skill attribute/jump a little higher?
|
||
;MARK: Line up trivia question text
|
||
;MARK: Attract show create a player
|
||
;MARK: Hide some heads in create player
|
||
;MARK: Hide some privileges in create player
|
||
;MARK: Robotron after 10 consecutive wins... Shoot head in Robotron...
|
||
;MARK: NBA dudes in credits... Joe Amati, Greg Lassen, etc.
|
||
;MARK: Reuse previous initials at start of next game? Jamie!!!
|
||
|
||
|
||
**************************************************************
|
||
;To Do for SHAWN:
|
||
|
||
;SHAWN: Have drones call for a pass when at positions where the art
|
||
; looks good... I can tell you...
|
||
;
|
||
; Tell drone to be aggressive like at end of qrtr
|
||
; or different d coverage - this could be a powerup type move or swirl!
|
||
;SHAWN: Don't swat while running @ loose ball
|
||
;SHAWN: Have dunking drone glitch to layup in final seconds
|
||
;SHAWN: On fire drones didn't even bother with a loose ball
|
||
;SHAWN: Drones shouldn't do the same thing @ the same time! They do!!
|
||
;SHAWN: Drones do spin move followed immediately by full-court shot
|
||
;SHAWN: Make sure smarter drone privilege works!
|
||
;SHAWN: Major jitter! Send drone out looking for an alley-oop - jitter city!
|
||
;SHAWN: I pass to drone, he shoots!
|
||
|
||
;SHAWN: Drones have problem picking up loose ball esp. in Z
|
||
;SHAWN: Drone did elbows in backcourt, then threw up a full court shot!
|
||
;SHAWN: Have drones try to block alley oop passes/dunks
|
||
|
||
|
||
**************************************************************
|
||
;To Do for JEFF: (Put DONE in place of your name when complete)
|
||
|
||
;done: Don't speed thru wipes at buyin scrns and coaching tips
|
||
; it is too fast - regular speed will do...
|
||
;done: Flash halftime/final stats leader
|
||
;done: Add nickname text
|
||
;done: Lineup ball/hand for #1 ddunk on right side of court
|
||
;done: Take out 2-press ddunk stuff
|
||
;done: Check 2PLYR KIT stuff
|
||
;done: Make sure bozo on final game stats stays long enough - too fast now?
|
||
;done: Don't default to chicken head!! Center head = highest priority!
|
||
;done: Player stat screen bullet next to shoulder on create player
|
||
;done: Verify next opponent page on team select plyr stat (PHILLY?)
|
||
;done: No air ball from ddunk layup!
|
||
;done: Make created players go even a little heavier (300 max)
|
||
;done: Have Jon turn up speech call vol - "Block it!"
|
||
;done: Get rid of "ooohhhhh" on ddunks
|
||
|
||
;done: Keep putting in sounds
|
||
;done: Finish create a player shit
|
||
;done: Create player heads on final res. page
|
||
;done: Sound calls in diagnostics test mode
|
||
;done: Priviliges text/functions
|
||
;done: Fix alley-oop speech when it really wasn't one
|
||
;done: Get more custom pals for create player
|
||
;done: More grunts (on elbows, dunks, in-air flail)
|
||
;done: Make rejected speech more intelligent
|
||
;done: Rank stuff doesn't work!! Resolve ties on plates
|
||
;done: when teammate shoots for 3 and im in alleyoop & catch ball -> 3 pts.
|
||
;done: 2 for 1 on 3-ptrs at stats page
|
||
;done: Fix 3 pts flashing for 2 point alley oop put in
|
||
;done: Put name & trivia pts on prize page (Before question)
|
||
;done: Softly off of glass speech happened on pure swish
|
||
;done: Names at botm of scrn on stats pages need to go dwn 1 line - not the
|
||
; CPU word however!
|
||
;done: Too many pixels in between letters for small name in lower attribute
|
||
; box. F A G B O Y should look like FAGBOY!
|
||
;done: "Player of the game..." at half doesn't always come up
|
||
;done: Pump up Hot dog sound priority
|
||
;done: Check rules on same-time use of a plyr record -
|
||
; gives undefeated record, doubles world record score (?)
|
||
;done: World record page needs "Individual stats" displayed
|
||
;done: Record stats pages needs "... Team ..." displayed
|
||
;done: "Switches hands" when there is a layup out of a dunk
|
||
;done: Higher priority for layups-out-of-dunks
|
||
;done: No music on start out of attract mode!!
|
||
;chkd: Snd system volume reset problem
|
||
;done: Fix favored by points on vs. screen
|
||
;JEFF: Scroller WORLDTLY when plaques come down
|
||
;JEFF: Halftime team swap
|
||
;JEFF: Score plate clock digits glitch @ halftime fade
|
||
;JEFF: What happens when you go grand champ
|
||
;JEFF: Put in secret players
|
||
;JEFF: Do attract mode/sound volume
|
||
;JEFF: Fix white pix (IRQSKYE?) on stat screen fade down
|
||
;JEFF: Cannonball sound effect
|
||
;JEFF: Get rid of long delay on sound board reset (at reset game time)
|
||
|
||
|
||
;JEFF: Put in extra trivia questions
|
||
;JEFF: Check all secret players, check audio for them as well...
|
||
;JEFF: Don't fade down chick singing at end of game....
|
||
;JEFF: Put back missed shot with alley oop dunk speech call
|
||
; Check variable must_rebound
|
||
|
||
;JEFF: put grunts on push downs!!!
|
||
;JEFF: put noise on big dunks!!!
|
||
|
||
**************************************************************
|
||
;To Do for DAN: (Put DONE in place of your name when complete)
|
||
|
||
;done: Reduce huge heads
|
||
;done: ABA ball off-fire after bucket (other too?)
|
||
;done: Legal text - attn New York text
|
||
;done: Paul & Cary shit
|
||
;done: Flash red/white on player win award text
|
||
;done: Make shots always go for adjusting %
|
||
;done: Team fire wants to adjust per CMOS timer setting
|
||
;done: Outdoor court fade up
|
||
;done: Trivia instructions screen & victory page
|
||
;done: attract whopper sounds
|
||
;done: Dress up board/eprom test
|
||
;done: Powerup nodrift...
|
||
;done: Power-up stuff
|
||
; plyr button moves
|
||
; head size(s)
|
||
; court
|
||
; ABA ball (hidden - not default!)
|
||
; Shot perc
|
||
|
||
;DAN: Tournament ladder! Not! See Jamie in a month...
|
||
;DAN: Sound script remaining after game demo
|
||
;DAN: Do another powerup for regular sized guys! 80% of what they are now.
|
||
;DAN: Team on-fire backboard effects
|
||
;DAN: GT inbounding bug - no one picked up the ball
|
||
;DAN: Play with scale tables for better range
|
||
;DAN: Link in Robotron
|
||
|
||
;DAN: Do alternate head scale tables
|
||
;DAN: Hot spot, 3 from any of many regions (3pt only?), non-consecutive
|
||
;DAN: DCS page
|
||
;DAN: PIC chip/diagnostics/sound chksums
|
||
;DAN: Proof text
|
||
;DAN: Games played wants to be in the trivia password
|
||
;DAN: TGA unzipper
|
||
;DAN: Out of position drifting plyr arrows @ start of qrtrs
|
||
;DAN: Chk for bog on release version
|
||
;DAN: Verify team fire & valid shot seqs
|
||
;DAN: TV Plate for individual players
|
||
;DAN: Operator message stuff
|
||
;DAN: New imgs (cheer, nba, etc)
|
||
;DAN: Design team,thanks screens
|
||
|
||
;DAN: MDoc credits
|
||
;DAN: Press button bozo for team select
|
||
;DAN: Put cheerleaders on court - outside perhaps
|
||
;DAN: Put in ZIP screens
|
||
;DAN: Sound after trivia rules screen
|
||
;DAN: Sound after credit screen
|
||
|
||
;DAN: Implement drone smart
|
||
;DAN: Floating in from behind hoop #2 or #1 arrow at start of periods
|
||
|
||
**************************************************************
|
||
*
|
||
* Owner: TURMELL
|
||
*
|
||
* Software: Shawn Liptak, Mark Turmell
|
||
* Initiated: 9/17/92
|
||
*
|
||
* Modified: Shawn Liptak, 9/17/92 -Split from BB.asm
|
||
*
|
||
* COPYRIGHT (C) 1992 WILLIAMS ELECTRONICS GAMES, INC.
|
||
*
|
||
*.Last mod - 3/24/93 16:21
|
||
**************************************************************
|
||
|
||
.file "plyr.asm"
|
||
.title "basketball player code"
|
||
.width 132
|
||
.option b,d,l,t
|
||
.mnolist
|
||
|
||
|
||
.include "mproc.equ" ;Mproc equates
|
||
.include "disp.equ" ;Display proc equates
|
||
.include "gsp.equ" ;Gsp asm equates
|
||
.include "sys.equ"
|
||
.include "audit.equ"
|
||
.include "world.equ" ;Court-world defs
|
||
.include "game.equ"
|
||
.include "macros.hdr" ;Macros
|
||
|
||
.include "imgtbl.glo"
|
||
.include "imgtbl7.glo"
|
||
.include "credturb.glo"
|
||
|
||
.asg 0,SEQT
|
||
.include "plyr.equ"
|
||
|
||
|
||
;sounds external
|
||
|
||
.ref tunehalf_snd
|
||
.ref brush20_ascii
|
||
.ref swat_snd,sqk1_snd,sqk2_snd,sqk3_snd,sqk4_snd
|
||
.ref airball_sp,sht_stunk_sp,misd_mile_sp,way_shrt_sp,misd_evry_sp
|
||
.ref scuf1_snd,scuf2_snd,scuf3_snd,scuf4_snd
|
||
.ref sqk5_snd,sqk6_snd,pass_snd,fpass_snd
|
||
.ref fball_snd,overtime_sp,rainbow_sp
|
||
.ref whitsle_snd,baddec_sp,tuneend_snd
|
||
|
||
|
||
;symbols externally defined
|
||
|
||
.ref print_string2b,kern_chars,mess_justify,mess_cursx,mess_cursy
|
||
.ref mess_cursx2
|
||
.ref shadow1,shadow2,shadow3,shadow4,shadow5,shadow6
|
||
.ref shadow7,shadow8,shadow9,shadow10,shadow11,shadow12
|
||
.ref shadow13,shadow14,shadow15,shadow16,shadow17,shadow18
|
||
.ref ballshad2,ballshad4,ballshad5,ballshad7
|
||
|
||
; .ref p1taps
|
||
; .ref fatality
|
||
; .ref seq_stopfire
|
||
.ref brick_count
|
||
.ref last_power
|
||
.ref qtr_purchased
|
||
.ref call_scores
|
||
.ref last_name_time
|
||
.ref bast18_ascii
|
||
.ref player1_data
|
||
.ref player2_data
|
||
.ref player3_data
|
||
.ref player4_data
|
||
.if DRONES_2MORE
|
||
.ref player5_data
|
||
.ref player6_data
|
||
.endif
|
||
|
||
.ref plyr_onfire
|
||
.ref pushed_speech
|
||
|
||
.ref grand_champs_screen
|
||
.ref show_hiscore
|
||
|
||
.ref rebound_delay
|
||
.ref def_play_reward,flash_reward,sinecos_get,slamming
|
||
.ref start_animate,pass_off,steals_off,idiot_box
|
||
|
||
.ref GET_ADJ
|
||
.ref HANGF_R_P,HANGF_W_P
|
||
|
||
.ref pass_to_speech
|
||
.ref shoots_speech
|
||
.ref shot_type,shot_percentage,shot_distance
|
||
|
||
.ref plyr_getattributes,snd_play1ovr
|
||
|
||
.ref scores,prt_top_scores
|
||
.ref score_add,score_showtvpanel2
|
||
.ref score_showtvpanel,tvpanelon
|
||
.ref gmqrtr
|
||
.ref clock_active
|
||
.ref crplate_ptr
|
||
.ref shot_clock,shotimer
|
||
.ref arw_on1plyr
|
||
.ref pushing_delay
|
||
.ref cntrs_delay
|
||
.ref game_time
|
||
.ref sc_proc
|
||
.ref stick_number
|
||
.ref doalert_snd
|
||
.ref flash_bigtxt
|
||
|
||
.ref player_data
|
||
.ref inc_player_stat
|
||
.ref stats_page,hint_page
|
||
.ref stats_page2
|
||
.ref rank_screen
|
||
; .ref result_screen
|
||
.ref save_player_records
|
||
.ref game_purchased
|
||
.ref team1,team2
|
||
.ref show_ot_msg,scr1
|
||
|
||
.ref winner_stays_on
|
||
.ref print_string_C2
|
||
.ref mess_objid
|
||
.ref setup_message
|
||
; .ref omlgmd_ascii
|
||
|
||
.ref pal_clean
|
||
.ref pal_getf,pal_set
|
||
.ref fade_down_half,fade_up_half
|
||
|
||
.ref SCRTST
|
||
.ref IRQSKYE
|
||
.ref PCNT
|
||
.ref GAMSTATE,HALT
|
||
.ref gndx
|
||
.ref AUD,AUD1,GET_AUD,STORE_AUDIT
|
||
.ref PSTATUS2
|
||
.ref RNDPER
|
||
.ref game_over
|
||
.ref TWOPLAYERS
|
||
|
||
.ref scalebaby_t,scalehead_t,scalebighead_t,scalehugehead_t
|
||
.ref scale63_t,scale66_t
|
||
|
||
.ref ball_convfmprel
|
||
.ref ballobj_p
|
||
.ref ballpnum,ballpnumlast,ballpnumshot,ballfree
|
||
.ref my_ballpnumlast
|
||
.ref ballrimhitcnt,ballbbhitcnt
|
||
.ref ballpasstime
|
||
.ref ballscorezhit
|
||
.ref ballptsforshot
|
||
.ref ballprcv_p
|
||
.ref ballgoaltcnt
|
||
.ref ballsclastp
|
||
.ref ballshotinair ;Shooter # if shot in air, else -1
|
||
.ref inbound
|
||
.ref ballflash
|
||
.ref t1dunkcnt
|
||
.ref plyr_setptsdown
|
||
|
||
.ref halftime_showclips
|
||
|
||
; .ref plyr_smoketrail
|
||
|
||
.ref drone_main,drone_adjskill
|
||
; .ref drone2on
|
||
.ref w3run1
|
||
.ref w3stand1,w4stand1,w5stand1
|
||
|
||
.ref _switch_addr
|
||
.ref _switch2_addr
|
||
|
||
.ref SHOTPER
|
||
.ref scale_t_size
|
||
.ref hangfnt38_ascii
|
||
.ref mess_line_spacing
|
||
.ref aly_pass_snd
|
||
.ref swith_hnd_sp,spn_shtup_sp
|
||
.ref dronesmrt
|
||
;symbols defined in this file
|
||
|
||
|
||
;uninitialized ram definitions
|
||
BSSX reduce_3ptr,16
|
||
BSSX kp_scores ,32
|
||
BSSX kp_team1 ,16
|
||
BSSX kp_team2 ,16
|
||
|
||
BSSX pleasewt ,16
|
||
BSSX PSTATUS ,16 ;Player in game bits (0-3)
|
||
;/Must be in order!
|
||
BSSX P1CTRL ,16 ;P1 joy/but bits (0-3=UDLR, 4-6=B1-B3)
|
||
BSSX P2CTRL ,16 ;P2 (^ 8-14 are on for a on transition
|
||
BSSX P3CTRL ,16 ;P3 of 0-6)
|
||
BSSX P4CTRL ,16 ;P4
|
||
.if DRONES_2MORE
|
||
BSSX P5CTRL ,16 ;P5
|
||
BSSX P6CTRL ,16 ;P6
|
||
.endif
|
||
|
||
BSSX P1DATA ,PDSIZE ;Player 1 data
|
||
BSSX P2DATA ,PDSIZE ;P2
|
||
BSSX P3DATA ,PDSIZE ;P3
|
||
BSSX P4DATA ,PDSIZE ;P4
|
||
.if DRONES_2MORE
|
||
BSSX P5DATA ,PDSIZE ;D5 ;always a drone
|
||
BSSX P6DATA ,PDSIZE ;D6 ;always a drone
|
||
.endif
|
||
|
||
.bss pld ,PLDSZ*NUMPLYRS ;Plyr secondary data
|
||
BSSX plyrobj_t ,32*NUMPLYRS ;*player obj
|
||
BSSX plyrproc_t ,32*NUMPLYRS ;*player process
|
||
|
||
BSSX plyrcharge ,16 ;!0=Dunker rammed an opponent
|
||
BSSX plyrpasstype ,16 ;!0=Turbo pass
|
||
BSSX plyrairballoff ,16 ;!0=No airball sound
|
||
|
||
.bss plyrinautorbnd ,16 ;!0=A plyr is in auto rebound
|
||
; .bss drnzzcnt ,16 ;Drone zigzag mode cntdn
|
||
; .bss drnzzmode ,16 ;Drone zigzag mode (0-?)
|
||
|
||
BSSX plyrpals_t ,256*16*NUMPLYRS ;Assembled palette for each plyr
|
||
BSSX assist_delay ,16
|
||
BSSX assist_plyr ,16
|
||
BSSX kp_qscrs ,(2*16)*7 ;Keep scores during game play
|
||
BSSX kp_qscrs2 ,(2*16)*7 ;Keep scores for attract mode
|
||
;
|
||
;Ram for secret power-ups (if add any, also add to 'clear_secret_powerup_ram')
|
||
;
|
||
BSSX pup_lockcombo ,16 ;Flag for locking power-up combos
|
||
|
||
BSSX pup_bighead ,16 ;Bit 0-3 on = plyr 0-3 has big head
|
||
BSSX pup_hugehead ,16 ;Bit 0-3 on = plyr 0-3 has huge head
|
||
BSSX pup_showshotper ,16
|
||
BSSX pup_notag ,16 ;Bit 0-3 on = dont show plyr 0-3 arrow
|
||
BSSX pup_nodrift ,16 ;Bit 0-3 on = no drift for block jumps
|
||
BSSX pup_noassistance,16 ;1=turn help off
|
||
BSSX pup_aba ,16 ;0=regular ball, !0=ABA ball
|
||
BSSX pup_court ,16 ;0=indoor, !0=outdoor
|
||
BSSX pup_showhotspots,16 ;Bit 0-3 on = show plyr 0-3 hotspots
|
||
|
||
BSSX pup_tournament ,16 ;*4
|
||
|
||
BSSX pup_baby ,16 ;Flag for baby size mode
|
||
BSSX pup_nomusic ,16 ;Flag for no game-time music
|
||
BSSX pup_goaltend ,16 ;Bit 0-3 on = plyr 0-3 has powerup g.t.
|
||
BSSX pup_maxblock ,16 ;Bit 0-3 on = plyr 0-3 has stl power
|
||
BSSX pup_maxsteal ,16 ;Bit 0-3 on = plyr 0-3 has stl power
|
||
BSSX pup_maxpower ,16 ;Powerup power - can't be pushed down
|
||
BSSX pup_maxspeed ,16 ;Bit 0-3 on = plyr 0-3 max runing speed
|
||
BSSX pup_hypspeed ,16 ;Bit 0-3 on = plyr 0-3 max runing speed
|
||
BSSX pup_trbstealth ,16 ;Bit 0-3 on = plyr 0-3 shoes dont change color
|
||
BSSX pup_trbinfinite ,16 ;Bit 0-3 on = plyr 0-3 always has turbo
|
||
BSSX pup_nopush ,16 ;Bit 0-3 on = plyr 0-3 can't push
|
||
BSSX pup_fastpass ,16 ;Bit 0-3 on = plyr 0-3 has fast passing
|
||
|
||
BSSX pup_strongmen ,16 ;Grnd champ flag 0,1 or 2 for team #
|
||
|
||
;For moving during inbound!
|
||
; .bss inbound_lead ,16 ;Leading inbound pass flag
|
||
.bss drone_attempt ,16 ;Alley oop jump up attempts
|
||
; BSSX drone_alley_cnt ,16 ;3 successful drone alley oops/period
|
||
|
||
|
||
;equates for this file
|
||
|
||
IBX_INB .equ 345
|
||
IBZ_INB .equ CZMID+10
|
||
IBX_OOB .equ 415
|
||
IBZ_OOB .equ CZMID-15
|
||
IBX_CRT .equ 395
|
||
IBZ_CRT .equ CZMID-15
|
||
|
||
IBX_DEF .equ 230
|
||
IBZ_DEF1 .equ CZMID-50
|
||
IBZ_DEF2 .equ CZMID+70
|
||
|
||
.if DEBUG
|
||
BSSX QUICK_TIP ,16 ;Set at game start. 1=quick
|
||
.if HEADCK
|
||
BSSX debug_plyr_num,16
|
||
.endif
|
||
.endif
|
||
|
||
.text
|
||
|
||
;-----------------------------------------------------------------------------
|
||
;-----------------------------------------------------------------------------
|
||
SUBR clear_secret_powerup_ram
|
||
|
||
clr a0
|
||
move a0,@pup_lockcombo
|
||
move a0,@pup_bighead
|
||
move a0,@pup_hugehead
|
||
move a0,@pup_showshotper
|
||
|
||
move a0,@pup_nomusic
|
||
|
||
SUBR clear_secret_powerup_tmode
|
||
|
||
clr a0
|
||
move a0,@pup_notag
|
||
move a0,@pup_nodrift
|
||
move a0,@pup_noassistance
|
||
|
||
move a0,@pup_baby
|
||
move a0,@pup_goaltend
|
||
move a0,@pup_maxblock
|
||
move a0,@pup_maxsteal
|
||
move a0,@pup_maxpower
|
||
move a0,@pup_maxspeed
|
||
move a0,@pup_hypspeed
|
||
move a0,@pup_trbstealth
|
||
move a0,@pup_trbinfinite
|
||
move a0,@pup_nopush
|
||
move a0,@pup_fastpass
|
||
|
||
move a0,@pup_showhotspots
|
||
move a0,@pup_strongmen
|
||
rets
|
||
|
||
;-----------------------------------------------------------------------------
|
||
;-----------------------------------------------------------------------------
|
||
; .if DRONES_2MORE
|
||
; SUBR add_drone_to_each_team
|
||
;;
|
||
;; First add a drone to team 1
|
||
;;
|
||
; move @PSTATUS,a1
|
||
; ori 4,a1 ;Set bit
|
||
; move a1,@PSTATUS
|
||
;
|
||
; move @PSTATUS2,a1
|
||
; ori 4,a1 ;Set bit saying this guy has started
|
||
; move a1,@PSTATUS2 ;and 50 cent buyin has happened!
|
||
;
|
||
;;
|
||
;; Now add a drone to team 2
|
||
;;
|
||
; move @PSTATUS,a1
|
||
; ori 5,a1 ;Set bit
|
||
; move a1,@PSTATUS
|
||
;
|
||
; move @PSTATUS2,a1
|
||
; ori 5,a1 ;Set bit saying this guy has started
|
||
; move a1,@PSTATUS2 ;and 50 cent buyin has happened!
|
||
; rets
|
||
; .endif
|
||
|
||
|
||
********************************
|
||
* Start player processes
|
||
|
||
SUBR plyr_start
|
||
|
||
; movk 1,a0
|
||
; move a0,@>fff80000,L
|
||
|
||
callr joy_read2
|
||
|
||
clr a0
|
||
move a0,@plyrinautorbnd
|
||
move a0,@plyrcharge
|
||
move a0,@plyrairballoff
|
||
; move a0,@pup_maxsteal
|
||
move a0,@pup_strongmen ;Grand champion playing flag
|
||
|
||
movk 1,a2
|
||
movk 1,a3
|
||
move @player1_data+PR_TEAMSDEF,a0,L
|
||
cmpi ALL_TMS_DEFEATD,a0
|
||
; cmpi >7ffffff,a0
|
||
jrz #easy0
|
||
move @player2_data+PR_TEAMSDEF,a0,L
|
||
cmpi ALL_TMS_DEFEATD,a0
|
||
; cmpi >7ffffff,a0
|
||
jrz #easy0
|
||
movk 2,a3
|
||
move @player3_data+PR_TEAMSDEF,a0,L
|
||
cmpi ALL_TMS_DEFEATD,a0
|
||
; cmpi >7ffffff,a0
|
||
jrz #easy0
|
||
move @player4_data+PR_TEAMSDEF,a0,L
|
||
cmpi ALL_TMS_DEFEATD,a0
|
||
; cmpi >7ffffff,a0
|
||
jrnz #nea
|
||
|
||
|
||
#easy0 move a3,@pup_strongmen ;Grand champion playing flag
|
||
; jruc #easy
|
||
|
||
|
||
#nea
|
||
|
||
|
||
; clr a2
|
||
; movk ADJDIFF,a0 ;Get difficulty level
|
||
; calla GET_ADJ
|
||
;;Which drone code do we use?
|
||
;;Level 1 uses old, above uses new shit...
|
||
; subk 1,a0 ;3
|
||
; jrle #regdrn
|
||
; movk 1,a2
|
||
;#regdrn
|
||
; move @PSTATUS,a0
|
||
; cmpi 1,a0
|
||
; jrz #hard
|
||
; cmpi 2,a0
|
||
; jrz #hard
|
||
; cmpi 4,a0
|
||
; jrz #hard
|
||
; cmpi 8,a0
|
||
; jrnz #easy
|
||
;#hard
|
||
; movi 200,a0
|
||
; calla RNDPER
|
||
; jrhi #easy
|
||
; movk 1,a2 ;Give hard drones 70% of time
|
||
;
|
||
;#easy move a2,@drone2on
|
||
|
||
|
||
|
||
; move @pup_bighead,a0
|
||
; zext a0
|
||
; cmpi >eaea,a0
|
||
; jrnz #no_3d
|
||
; movk >f,a2
|
||
; move a2,@pup_maxsteal
|
||
; jruc #adjoff
|
||
;#no_3d
|
||
|
||
movk ADJHEADSZ,a0 ;Get head size
|
||
calla GET_ADJ ;1-2
|
||
subk 1,a0
|
||
jrle #adjoff ;No big heads?
|
||
move @pup_bighead,a2
|
||
movk >f,a14
|
||
xor a14,a2
|
||
move a2,@pup_bighead
|
||
; clr a2
|
||
; move a2,@pup_hugehead
|
||
#adjoff
|
||
|
||
.if DEBUG
|
||
move @QUICK_TIP,a14
|
||
jrz #refon
|
||
clr a0
|
||
callr plyr_setac
|
||
jruc #refoff
|
||
#refon
|
||
CREATE0 plyr_referee
|
||
#refoff
|
||
.else
|
||
CREATE0 plyr_referee
|
||
.endif
|
||
|
||
movi plyrproc_t+32*NUMPLYRS,a2 ;Set ptrs & cnt to make plyrs
|
||
movi plyrobj_t+32*(NUMPLYRS-1),a9
|
||
movk NUMPLYRS-1,a8 ;-1 to fall thru for last one
|
||
#strtp
|
||
CREATE0 plyr_main
|
||
move a0,-*a2,L ;Save *proc
|
||
subk 32,a9
|
||
dsj a8,#strtp
|
||
|
||
move a13,-*a2,L
|
||
; jruc plyr_main ;#0
|
||
|
||
|
||
#*******************************
|
||
* Main player control code (Process)
|
||
* A8=Plyr # (0-3)
|
||
* A9=*plyrobj_t for plyr #
|
||
* A13=*PDATA for plyr #
|
||
|
||
|
||
SUBR plyr_main
|
||
|
||
move a13,a1 ;>Clr PDATA & PSDATA areas
|
||
addi PDATA,a1
|
||
movi (PRCSIZ-PDATA)/16,a2
|
||
clr a0
|
||
#clrpd move a0,*a1+
|
||
dsj a2,#clrpd
|
||
|
||
; .ref inmatchup
|
||
; move @inmatchup,a0
|
||
; jrnz #nohdcng ;br=no powerups on matchup screen
|
||
;
|
||
; move a8,a0 ;Chk powerup seqs
|
||
; sll 4,a0
|
||
; addi P1CTRL,a0
|
||
; move *a0,a0
|
||
; sll 32-7,a0 ;Mask to just stick & 3 buttons
|
||
; srl 32-7,a0
|
||
|
||
; cmpi BUT1_M|JOYD_M,a0 ;Shoot, Down
|
||
; jrne #nostl
|
||
; move a8,a0
|
||
; sll 4,a0
|
||
; addi p1taps,a0
|
||
; move *a0,a0
|
||
; cmpi 5,a0 ;At least 5 taps?
|
||
; jrlt #nostl
|
||
; move @pup_maxsteal,a0 ;Powerup intercepts (Quick hands)
|
||
; movk 1,a14
|
||
; sll a8,a14
|
||
; xor a14,a0 ;Flip bit
|
||
; move a0,@pup_maxsteal
|
||
;#nostl
|
||
; cmpi BUT3_M|BUT2_M|JOYU_M,a0 ;Turbo, Pass, Up
|
||
; jrne #nohdcng
|
||
; move @pup_bighead,a0 ;Headsize override
|
||
; movk 1,a14
|
||
; sll a8,a14
|
||
; xor a14,a0 ;Flip bit
|
||
; move a0,@pup_bighead
|
||
|
||
#nohdcng
|
||
movi -1,a1
|
||
move a1,*a13(plyr_newdir)
|
||
movk 1,a0
|
||
move a0,*a13(plyr_shtbutn)
|
||
|
||
movk 30,a0
|
||
move a0,*a13(plyr_turndelay)
|
||
|
||
move a8,*a13(plyr_num)
|
||
move a8,a11
|
||
|
||
movk 1,a7
|
||
xor a8,a7
|
||
sll 5,a7 ;*32
|
||
addi plyrproc_t,a7
|
||
move *a7,a7,L
|
||
move a7,*a13(plyr_tmproc_p),L
|
||
|
||
movi P2DATA-P1DATA,a7,W
|
||
mpyu a8,a7
|
||
addi P1DATA,a7
|
||
move a7,*a13(plyr_PDATA_p),L
|
||
|
||
calla plyr_getattributes ;Set attribute_p
|
||
;A10=*Uniform attr (ignores spechds)
|
||
;----------
|
||
; setup tip-off img
|
||
|
||
; move @inmatchup,a0
|
||
; jrz #nmtch_1
|
||
; movk 1,a14
|
||
; move a14,*a13(plyr_nojoy)
|
||
; move a14,*a13(plyr_autoctrl)
|
||
;
|
||
; movi #pm1-#pmatch_t,a7,W ;set ptr to tip-off init table for
|
||
; mpyu a8,a7 ; this plyr
|
||
; addi #pmatch_t,a7
|
||
; jruc #mtch_2
|
||
;#nmtch_1
|
||
|
||
movi #pd1-#pdat_t,a7,W ;set ptr to tip-off init table for
|
||
mpyu a8,a7 ; this plyr
|
||
addi #pdat_t,a7
|
||
|
||
#mtch_2
|
||
move *a7+,a0 ;Plyr PID
|
||
move a0,*a13(PROCID)
|
||
move *a7+,a1 ;Dir
|
||
move a1,*a13(plyr_dir)
|
||
move *a7+,a0 ;X offset
|
||
move @WORLDTLX+16,a1
|
||
add a1,a0
|
||
|
||
;LOOK!!!
|
||
move @gmqrtr,a3 ;if not 1st qrtr, push them all over
|
||
jrz #not2 ; to the rgt side inbound
|
||
addi 400,a0 ;!!!
|
||
#not2
|
||
sll 16,a0 ;X
|
||
clr a1 ;Y
|
||
move *a7+,a3 ;Z
|
||
move *a7,a2,L ;OIMG
|
||
movi DMAWNZ|M_3D,a4
|
||
; cmpi 1,a8
|
||
; jrnz #qkfix2
|
||
; movi DMAWNZ|M_3D|M_FLIPH,a4
|
||
;#qkfix2
|
||
movi CLSPLYR|TYPPLYR,a5
|
||
clr a6
|
||
clr a7
|
||
calla BEGINOBJ2
|
||
move a8,*a9,L ;Save *obj
|
||
|
||
movi scale63_t,a0 ;Temp size
|
||
move a0,*a8(ODATA_p),L
|
||
|
||
SLEEPK 2 ;Wait for other plyrs init
|
||
|
||
;----------
|
||
; set up player attribute
|
||
|
||
move a10,a6 ;A10=*Uniform attr (ignores spechds)
|
||
|
||
move *a13(plyr_attrib_p),a7,L
|
||
move *a7,a0,L ;*scale_t
|
||
move a0,*a8(ODATA_p),L
|
||
move *a7(PAT_BVEL),a0 ;speed
|
||
move a0,*a13(plyr_bvel)
|
||
move *a7(PAT_SKILL),a0 ;drone skill
|
||
;
|
||
; see if & how we might want to screw with PAT_SKILL
|
||
;
|
||
move @PSTATUS,a1 ;is plyr human or drone?
|
||
btst a11,a1
|
||
jrnz #hmn
|
||
|
||
movk 1,a14 ;Drone
|
||
xor a11,a14
|
||
btst a14,a1
|
||
jrz #tdrn ;Teammate is a drone?
|
||
#hmn
|
||
; movk 2,a14 ;Human
|
||
; xor a11,a14
|
||
; sll 5,a14 ;*32
|
||
; addi plyrproc_t,a14
|
||
; move *a14,a14,L
|
||
clr a0
|
||
jruc #setskl
|
||
#tdrn
|
||
movk 2,a14 ;We are drones
|
||
xor a11,a14
|
||
btst a14,a1 ;Human opponent?
|
||
jrnz #humop
|
||
movk 1,a2 ;at least one isn't
|
||
xor a2,a14
|
||
btst a14,a1 ;All drones? yes if 0
|
||
jrz #setskl
|
||
#humop
|
||
sll 5,a14
|
||
addi player_data,a14
|
||
move *a14,a14,L
|
||
movk 6,a2
|
||
move *a14(PR_COUNT),a1 ;- if no entry
|
||
jrn #wimp
|
||
move *a14(PR_NUMDEF),a2 ;# teams defeated
|
||
|
||
;If a player is real good, almost all teams beaten, give hime
|
||
;the in the zone spch call at game start
|
||
subk 5,a2
|
||
jrlt #few
|
||
|
||
PUSH a0,a1,a14
|
||
.ref thr_zone_sp
|
||
movi thr_zone_sp,a0
|
||
calla snd_play1
|
||
PULL a0,a1,a14
|
||
|
||
;Old tougher drones flag
|
||
; move a2,@drone2on
|
||
|
||
#few
|
||
movk 4,a2 ;3
|
||
subk 4,a1
|
||
jrle #wimp ;1st couple of games?
|
||
movk 1,a2
|
||
#wimp
|
||
sub a2,a0
|
||
move *a14(PR_WINSTREAK),a1 ;Won last game? yes if !0
|
||
jrnz #setskl
|
||
subk 4,a0 ;lower skill for 1st timers (no wins)
|
||
#setskl
|
||
move a0,*a13(plyr_d_skill)
|
||
|
||
;----------
|
||
; check for conflicting team pals
|
||
;
|
||
; dont check for conflicting pals when a created palyer
|
||
;
|
||
move a11,a14 ;player number
|
||
sll 5,a14
|
||
addi player_data,a14
|
||
move *a14,a14,L
|
||
move *a14(PR_CREATED_PLYR),a3
|
||
jrle #t1a ;br=not a created player
|
||
move *a14(PR_UNIFORM_NBR),a3
|
||
btst 6,a3
|
||
jrnz #altc ;br=home team pal.
|
||
jruc #keepc
|
||
#t1a
|
||
movi team1,a14
|
||
move *a14+,a3 ;get team #'s & determine which one
|
||
move *a14,a4 ; we are now
|
||
btst 1,a11
|
||
jrz #t1
|
||
SWAP a3,a4
|
||
#t1 sll 3,a3
|
||
sll 3,a4
|
||
addi teampal_t,a3
|
||
addi teampal_t,a4
|
||
movb *a3,a3
|
||
jrn #keepc ;I always keep? yes if neg
|
||
movb *a4,a4
|
||
move a4,a14
|
||
sll 32-4,a3
|
||
sll 32-4,a14
|
||
cmp a3,a14
|
||
jrne #keepc ;Different colors?
|
||
move a4,a4
|
||
jrn #altc ;Other team always keeps?
|
||
btst 1,a11
|
||
jrnz #keepc ;2nd team?
|
||
#altc addk 32,a6 ;use alternates
|
||
#keepc
|
||
|
||
;----------
|
||
; Build plyr palette
|
||
|
||
move a11,a2
|
||
sll 8+4,a2
|
||
addi plyrpals_t,a2
|
||
PUSH a2
|
||
|
||
; movi 255,a0
|
||
movi 128,a0
|
||
move a0,*a2+ ;Set # colors
|
||
|
||
.ref SHT11 ;MK SPECIAL FLAG
|
||
move *a7(PAT_SHOTSKILL),a1 ;Check for special pals
|
||
cmpi SHT11,a1
|
||
jrne #reg ;Stay with defined pals if !=
|
||
move a7,a6
|
||
#reg
|
||
|
||
move *a7(PAT_PALF_p),a1,L ;Copy flesh
|
||
; .ref NFL55_p
|
||
; movi NFL55_p,a1
|
||
|
||
move *a1+,a0
|
||
; addk 16,a1
|
||
; subk 1,a0
|
||
#plflp move *a1+,*a2+
|
||
dsjs a0,#plflp
|
||
|
||
|
||
move *a6(PAT_PALT_p),a1,L ;Copy trim
|
||
; .ref TR2_p
|
||
; movi TR2_p,a1
|
||
|
||
move *a1+,a0
|
||
addk 16,a1
|
||
subk 1,a0
|
||
#pltlp move *a1+,*a2+
|
||
dsjs a0,#pltlp
|
||
|
||
|
||
move *a6(PAT_PALU_p),a1,L ;Copy uniform
|
||
move *a1+,a0
|
||
addk 16,a1
|
||
subk 1,a0
|
||
#plulp move *a1+,*a2+
|
||
dsjs a0,#plulp
|
||
|
||
|
||
movi ltshoepal_t,a1 ;Copy shoes
|
||
movk 13,a0
|
||
#plslp move *a1+,*a2+
|
||
dsjs a0,#plslp
|
||
|
||
|
||
move *a6(PAT_PALSW_p),a1,L ;Copy trim
|
||
; .ref SW2_p
|
||
; movi SW2_p,a1
|
||
|
||
move *a1+,a0
|
||
addk 16,a1
|
||
subk 1,a0
|
||
#pltlpa move *a1+,*a2+
|
||
dsjs a0,#pltlpa
|
||
|
||
|
||
move *a6(PAT_PALVP_p),a1,L ;Copy trim
|
||
; .ref VP2_p
|
||
; movi VP2_p,a1
|
||
|
||
move *a1+,a0
|
||
addk 16,a1
|
||
subk 1,a0
|
||
#pltlpb move *a1+,*a2+
|
||
dsjs a0,#pltlpb
|
||
|
||
;
|
||
;;Use this color to flash player white
|
||
; movi 31<<10+31<<5+31,a0 ;White
|
||
; move a0,*a2+
|
||
;
|
||
;;Use this color to flash player black
|
||
; clr a0 ;Black
|
||
; move a0,*a2+
|
||
|
||
PULL a0
|
||
calla pal_getf
|
||
move a0,*a8(OPAL)
|
||
|
||
;----------
|
||
; Get head
|
||
|
||
PUSH a8 ;save plyr *obj
|
||
|
||
clr a0
|
||
clr a1
|
||
move *a7(PAT_HEADT_p),a2,L
|
||
addi 5*32,a2 ;POINT at 6th head (straight ahead)
|
||
move *a2,a2,L
|
||
|
||
movi CZMID,a3
|
||
movi DMAWNZ|M_3D|M_NOCOLL,a4
|
||
movi CLSDEAD,a5
|
||
clr a6
|
||
clr a7
|
||
calla BEGINOBJ2
|
||
|
||
;If Rodman, change hair color according to player choice!
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
move *a8(OIMG),a2,L
|
||
move *a2(ICMAP),a0,L ;Get *palette
|
||
.ref check_rodman2
|
||
calla check_rodman2
|
||
calla pal_getf
|
||
move a0,*a8(OPAL),L ;Set palette & constant
|
||
|
||
move a8,*a13(plyr_headobj_p),L
|
||
|
||
;----------
|
||
; setup head size
|
||
|
||
movi scalebighead_t,a0,L ;assume big
|
||
move *a13(plyr_num),a1
|
||
|
||
move @pup_bighead,a2
|
||
btst a1,a2
|
||
jrnz #chkhd
|
||
|
||
move a1,a3 ;plyr # to chk
|
||
movk 2,a2 ;privilege bit to chk
|
||
move @PSTATUS,a14
|
||
btst a1,a14
|
||
jrnz #ndrnh ;br=human
|
||
move *a13(plyr_tmproc_p),a3,L
|
||
move *a3(plyr_num),a3 ;plyr # to chk
|
||
movk 4,a2 ;privilege bit to chk
|
||
#ndrnh
|
||
sll 5,a3
|
||
addi player_data,a3,L
|
||
move *a3,a3,L
|
||
move *a3(PR_PRIVILEGES),a3
|
||
jrle #reghd ; br=not a created player
|
||
btst a2,a3 ;BIG HEAD privilege?
|
||
jrnz #sethd ; br=yes
|
||
#reghd
|
||
movi scalehead_t,a0,L ;set default *scale_t
|
||
#chkhd
|
||
move @pup_hugehead,a2
|
||
btst a1,a2
|
||
jrz #sethd
|
||
movi scalehugehead_t,a0,L ;really big!
|
||
#sethd
|
||
move a0,*a8(ODATA_p),L
|
||
|
||
move *a13(plyr_num),a1
|
||
sll 5,a1
|
||
addi player_data,a1,L
|
||
move *a1,a1,L
|
||
move *a1(PR_PRIVILEGES),a1
|
||
jrle #nsmrt ; br=not a created player
|
||
btst 6,a1 ;smarter drone ?
|
||
jrz #nsmrt ;br=no
|
||
|
||
move @dronesmrt,a0
|
||
move *a13(plyr_num),a1
|
||
movk 1,a14
|
||
xor a14,a1
|
||
movk 1,a14
|
||
sll a1,a14
|
||
or a14,a0
|
||
move a0,@dronesmrt
|
||
#nsmrt
|
||
|
||
|
||
;----------
|
||
; Get shadow
|
||
|
||
clr a0
|
||
clr a1
|
||
movi shadow1,a2
|
||
move *a8(OZPOS),a3
|
||
subi 50,a3 ;stupid K!!!
|
||
movi DMAWNZ|M_3D|M_SHAD|M_NOCOLL,a4
|
||
calla BEGINOBJ2
|
||
move a8,*a13(plyr_shadobj_p),L
|
||
movi 50,a0 ;stupid K!!!
|
||
move a0,*a8(OMISC) ;save Z offset
|
||
|
||
PULL a8 ;retrieve plyr *obj
|
||
|
||
; .if DEBUG
|
||
; callr plyr_getgndaligndot
|
||
; .endif
|
||
|
||
;----------
|
||
; init secondary data structure
|
||
|
||
clr a0
|
||
movi PLDSZ,a9
|
||
mpyu a11,a9
|
||
addi pld,a9 ;A9=*Plyr secondary data struc
|
||
move a9,a1
|
||
movi PLDSZ/16,b0
|
||
#cpldlp move a0,*a1+
|
||
dsj b0,#cpldlp
|
||
|
||
sll 4,a11 ;*16
|
||
addi P1CTRL,a11 ;A11=*PxCTRL
|
||
move a0,*a11
|
||
|
||
;----------
|
||
; set initial sequence
|
||
|
||
; move @inmatchup,a0
|
||
; jrz #pn02
|
||
; movk STND_SEQ,a0
|
||
; jruc #pn03
|
||
;
|
||
;#pn02
|
||
movk STND_SEQ,a0
|
||
move @gmqrtr,a14
|
||
jrnz #goa
|
||
movi TIPSTND_SEQ,a0
|
||
#goa
|
||
|
||
|
||
move *a13(plyr_num),a14 ;plyrs 0 & 3 will be standing
|
||
jrz #pn03
|
||
subk 3,a14
|
||
jrge #pn03
|
||
move @gmqrtr,a14 ;so will plyrs 1 & 2 if not 1st qrtr
|
||
jrnz #pn03
|
||
movi TIP_SEQ,a0 ;set game start tip-off seq
|
||
|
||
#pn03
|
||
|
||
.if DEBUG
|
||
move @QUICK_TIP,a14
|
||
jrz #skipq
|
||
movk STND_SEQ,a0
|
||
#skipq
|
||
.endif
|
||
|
||
move *a13(plyr_dir),a7
|
||
callr plyr_setseq ;Rets: A10=Ani cntdn
|
||
|
||
; move @inmatchup,a0
|
||
; jrz #pn03b
|
||
;#pn03a SLEEP 1
|
||
; dsj a10,#noa
|
||
; move *a13(plyr_ani_p),a14,L ;>Set new ani
|
||
; move *a14+,a10 ;Delay
|
||
; jrnz #moses
|
||
; move *a13(plyr_ani1st_p),a14,L ;Head of list
|
||
; move *a14+,a10
|
||
;
|
||
;#moses move *a14+,a0,L ;*Img
|
||
; move *a14+,a1 ;Flags (OCTRL)
|
||
; move a14,*a13(plyr_ani_p),L
|
||
; callr plyr_ani
|
||
;
|
||
; move *a13(plyr_aniy),a1
|
||
; neg a1
|
||
; move a1,*a8(OYPOS) ;Set on gnd
|
||
;
|
||
;#noa callr plyr_headalign
|
||
; jruc #pn03a
|
||
;
|
||
;#pn03b
|
||
|
||
;----------
|
||
; set appropriate team hoop target
|
||
|
||
movi HOOPLX,a0
|
||
movi HOOPRX,a1
|
||
move *a13(plyr_num),a14
|
||
subk 2,a14
|
||
jrlt #sethp
|
||
SWAP a0,a1
|
||
#sethp move a0,*a13(plyr_myhoopx)
|
||
move a1,*a13(plyr_ohoopx)
|
||
|
||
; move *a13(plyr_num),a0 ;DEBUG
|
||
; subk 2,a0
|
||
; jreq #num2
|
||
; SLEEP 30000
|
||
;#num2
|
||
|
||
SLEEPK 2 ;Wait for others to establish data
|
||
|
||
.bss plyr_main_initdone,16 ;Plyr init done flag (0=not, !0=is)
|
||
movk 1,a0
|
||
move a0,@plyr_main_initdone
|
||
;For moving during inbound!
|
||
; clr a14
|
||
; move a14,@inbound_lead
|
||
|
||
;------------------------------
|
||
; Top of main player proc loop
|
||
|
||
#lp
|
||
move @HALT,a0
|
||
jrnz #halted
|
||
|
||
; clr a9
|
||
|
||
.if IMGVIEW
|
||
move *a13(plyr_num),a0
|
||
cmpi 0,a0
|
||
jrz #yesx
|
||
cmpi 3,a0
|
||
jrne #halted
|
||
#yesx
|
||
movk 1,a2 ;+=Me
|
||
jruc #nobl2
|
||
.endif
|
||
;
|
||
;This could be a dipswitch setting for our home games
|
||
;FIX
|
||
; move @DIPSWITCH,a0
|
||
; btst 0,a0 ;UJ2 switch 8
|
||
; jrnz #notfair ;OFF?
|
||
; clr a0
|
||
; move a0,*a13(plyr_ptsdown)
|
||
;#notfair
|
||
;
|
||
|
||
;--------------------
|
||
; Plyr ball-ownership handling
|
||
|
||
clr a2 ;Clr owner flag (0=neither teammate)
|
||
move @ballpnum,a1
|
||
move *a13(plyr_num),a0
|
||
cmp a1,a0 ;Plyr have the ball?
|
||
jreq #has_ball ;br=yes
|
||
XORK 1,a0 ;No. Does his teammate?
|
||
cmp a1,a0
|
||
jrne #not_tm ;br=no, other team or free
|
||
subk 1,a2 ;-=Teammate
|
||
#not_tm
|
||
move a2,*a13(plyr_ownball) ;Save owner flag
|
||
jruc #hadball
|
||
|
||
#has_ball
|
||
move *a13(plyr_seqflgs),a14
|
||
btst NOBALL_B,a14 ;Can plyr current seq hold the ball?
|
||
jrz #can_hold ;br=yes
|
||
#no_hold
|
||
move a2,@ballbbhitcnt ;No. Drop the ball
|
||
move a2,*a13(plyr_ownball) ;Save owner flag (0=neither teammate)
|
||
subk 1,a2
|
||
move a2,@ballpnum ;Set to -1 for no plyr owner
|
||
move a2,@ballpnumlast
|
||
calla ball_convfmprel ;Yank ball from plyr-relative coord
|
||
jruc #hadball
|
||
|
||
#can_hold
|
||
move *a13(plyr_ownball),a0 ;Yes. Did plyr already have it?
|
||
jrgt #hadball ;br=yes
|
||
|
||
move @ballobj_p,a1,L ;No. Plyr just got the ball
|
||
move *a1(OYPOS),a0
|
||
cmpi -28,a0 ;!!!Ball above dribble Y vel flip pnt?
|
||
jrlt #chk_rbnd ;br=yes, chk if rebound
|
||
move *a1(OYVEL),a0,L ;No. Chk Y vel to see if rebound
|
||
abs a0
|
||
cmpi >c000,a0 ;!!!Ball rolling on the floor?
|
||
jrge #chk_rbnd ;br=no, chk if rebound
|
||
|
||
move *a13(plyr_jmpcnt),a0 ;Yes. Is plyr in the air?
|
||
jrnz #no_hold ;br=yes, don't pick-up rolling ball
|
||
; calla seq_stopfire
|
||
movi PICKUP_SEQ,a0 ;No. Pick-up ball
|
||
move *a13(plyr_dir),a7
|
||
callr plyr_setseq
|
||
jruc #own_ball
|
||
|
||
#chk_rbnd
|
||
move @rebound_delay,a0 ;Ball just come off the boards?
|
||
jrz #own_ball ;br=no
|
||
move a2,@rebound_delay ;Yes, but was it a basket?
|
||
move @inbound,a0
|
||
jrnn #own_ball ;br=yes, not a rebound
|
||
|
||
movi PS_OFF_REB,a0 ;Assume offensive rebound
|
||
move *a13(plyr_num),a1
|
||
move @ballpnumlast,a14 ;Plyr on the same team as plyr who
|
||
srl 1,a1 ; missed the basket?
|
||
srl 1,a14
|
||
cmp a1,a14
|
||
jrz #offrb ;br=yes
|
||
movi PS_DEF_REB,a0 ;No. Defensive rebound
|
||
#offrb
|
||
move *a13(plyr_num),a1 ;Inc plyr rebound stat
|
||
calla inc_player_stat
|
||
|
||
#own_ball
|
||
movk 1,a2
|
||
move a2,*a13(plyr_ownball) ;Save owner flag (+=plyr)
|
||
;added this to hopefully fix the ignoring of the pass button after pass
|
||
move a2,*a13(plyr_rcvpass)
|
||
move *a13(plyr_num),a14
|
||
move a14,@my_ballpnumlast
|
||
PUSH a10
|
||
move a13,a10
|
||
calla arw_on1plyr ;Guy who picks up ball gets arw
|
||
PULL a10
|
||
|
||
move *a13(plyr_num),a0
|
||
move @ballsclastp,a1
|
||
srl 1,a0 ;Do team #s for shot clock compare
|
||
srl 1,a1
|
||
cmp a0,a1 ;Need to reset the shot clock?
|
||
jreq #hadball ;br=no, same team has ball
|
||
|
||
calla shot_clock ;New 24
|
||
|
||
;--------------------
|
||
; Set turbo flag per button & availability
|
||
|
||
#hadball
|
||
clr a0 ;>Setup turbo flag
|
||
move *a13(plyr_nojoy),a6
|
||
jrn #newjoy ;Override plyr input?
|
||
move *a11,a6
|
||
#newjoy btst BUT3_B,a6 ;Turbo but
|
||
jrz #turboff
|
||
move *a13(plyr_PDATA_p),a1,L
|
||
move *a1(ply_turbo),a1
|
||
jrz #turboff ;No turbo left?
|
||
movk 1,a0
|
||
#turboff
|
||
move a0,*a13(plyr_turbon)
|
||
|
||
;--------------------
|
||
; Calc dirs/dists to plyrs/hoops/ball
|
||
|
||
move *a13(plyr_num),a4 ;>Do 1 in 4 ticks
|
||
move @PCNT,a0
|
||
move a4,a1
|
||
sll 32-2,a0
|
||
sll 32-2,a1
|
||
cmp a0,a1
|
||
jrne #skip
|
||
|
||
movk 1,a14 ;>Get teammates dir/dist
|
||
xor a4,a14
|
||
sll 5,a14 ;*32
|
||
addi plyrobj_t,a14
|
||
move *a14,a0,L
|
||
callr seekdirdist_obob128
|
||
move a0,*a13(plyr_tmdir)
|
||
move a1,*a13(plyr_tmdist)
|
||
|
||
srl 1,a4 ;>Get opponents dir/dist
|
||
movk 1,a14
|
||
xor a14,a4
|
||
sll 6,a4 ;*64
|
||
addi plyrobj_t,a4
|
||
move *a4+,a0,L
|
||
callr seekdirdist_obob128
|
||
move a0,*a13(plyr_o1dir)
|
||
move a1,*a13(plyr_o1dist)
|
||
|
||
move *a4+,a0,L
|
||
callr seekdirdist_obob128
|
||
move a0,*a13(plyr_o2dir)
|
||
move a1,*a13(plyr_o2dist)
|
||
|
||
move @ballobj_p,a0,L
|
||
callr seekdirdist_obob128
|
||
move a0,*a13(plyr_balldir)
|
||
move a1,*a13(plyr_balldist)
|
||
|
||
move *a13(plyr_myhoopx),a6
|
||
movi CZMID,a7
|
||
callr seekdirdist_obxz128
|
||
move a0,*a13(plyr_hpdir)
|
||
move a1,*a13(plyr_hpdist)
|
||
|
||
move *a13(plyr_ohoopx),a6
|
||
movi CZMID,a7
|
||
callr seekdirdist_obxz128
|
||
move a0,*a13(plyr_ohpdir)
|
||
move a1,*a13(plyr_ohpdist)
|
||
#skip
|
||
|
||
;--------------------
|
||
; Set plyr defensive flag
|
||
|
||
clr a14 ;>Setup defensive flag
|
||
move @ballpnum,a0
|
||
jrn #setdef ;No owner?
|
||
move *a13(plyr_ownball),a0
|
||
jrnz #setdef ;My team has?
|
||
|
||
move *a13(plyr_hpdist),a0
|
||
|
||
move *a13(plyr_num),a1
|
||
move @PSTATUS,a2
|
||
btst a1,a2
|
||
jrz #drn
|
||
cmpi 220*DIST_ADDITION,a0 ;stupid K!!!
|
||
jruc #ndrn
|
||
#drn
|
||
cmpi 310*DIST_ADDITION,a0 ;stupid K!!!
|
||
#ndrn jrge #setdef ;Too far from my hoop?
|
||
|
||
move *a13(plyr_hpdir),a0 ;Find dir difference
|
||
move *a13(plyr_balldir),a1
|
||
sub a1,a0
|
||
abs a0
|
||
cmpi >40,a0 ;stupid K!!!
|
||
jrle #dsml
|
||
subi >80,a0 ;stupid K!!!
|
||
abs a0
|
||
#dsml subk 24,a0 ;stupid K!!!
|
||
jrle #setdef ;Not between ball and hoop?
|
||
|
||
move *a13(plyr_seq),a2
|
||
cmpi RUNDRIBTURB_SEQ,a2
|
||
jrhi #setdef
|
||
move *a13(plyr_o1dist),a1
|
||
cmpi 7ch,a1
|
||
jrlt #defon
|
||
move *a13(plyr_o2dist),a1
|
||
cmpi 7ch,a1
|
||
jrge #setdef
|
||
#defon movk 1,a14
|
||
#setdef move a14,*a13(plyr_indef)
|
||
|
||
;--------------------
|
||
; Handle stagger/fall seqs
|
||
|
||
move *a13(plyr_autoctrl),a0
|
||
jrnz #tcc ;Temp computer control?
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst NOCOLLP_B,a0
|
||
jrnz #nocol ;No collide?
|
||
callr plyr_chkpcollide
|
||
#nocol
|
||
move *a13(plyr_stagcnt),a2
|
||
jrle #nostag
|
||
subk 1,a2
|
||
move a2,*a13(plyr_stagcnt)
|
||
subk 15,a2 ;stupid K!!!
|
||
jrle #nostag
|
||
|
||
move *a13(plyr_seq),a14
|
||
subk 30-15,a2 ;stupid K!!!
|
||
jrle #chkstag ;Chk stag?
|
||
|
||
; move @plyr_onfire,a1
|
||
; jrz #noflm1
|
||
; move @fatality,a2 ;bit 0=tm1, bit 1=tm2
|
||
; jrz #noflm1
|
||
; sll 3,a1
|
||
; addi pbit_tbit,a1,L
|
||
; movb *a1,a1 ;Assume valid plyr_onfire
|
||
; move *a13(plyr_num),a3
|
||
; srl 1,a3 ;make tm # 0 or 1
|
||
; btst a3,a1
|
||
; jrnz #noflm1 ;br=on the on-fire tm
|
||
; and a1,a2
|
||
; jrz #noflm1 ;br=on-fire tm fatality not set
|
||
; movi 500,a0 ;###
|
||
; calla RNDPER
|
||
; jrls #noflm1
|
||
;;Yes, this will be a flaming fall!
|
||
; movk 1,a9
|
||
;#noflm1
|
||
;
|
||
move *a13(plyr_seq),a14
|
||
|
||
movi FLYBACK_SEQ,a0
|
||
; move a9,a9
|
||
; jrz #noflm2
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm2
|
||
cmp a0,a14
|
||
jreq #cstag
|
||
|
||
; cmpi FALL_SEQ,a14
|
||
; jrge #cstag
|
||
; cmpi FFLYBACKWB2_SEQ,a14
|
||
; jrgt #cstag
|
||
|
||
cmpi FLYBACKWB_SEQ,a14
|
||
jreq #cstag
|
||
cmpi FLYBACKWB2_SEQ,a14
|
||
jreq #cstag
|
||
cmpi FLYBACK2_SEQ,a14
|
||
jreq #cstag
|
||
|
||
move *a13(plyr_ownball),a1
|
||
jrgt #haveball
|
||
|
||
move *a13(plyr_attrib_p),a1,L
|
||
move *a1(PAT_POWER),a1
|
||
move @last_power,a2 ;Player pushing has this power
|
||
sub a1,a2
|
||
abs a2
|
||
|
||
; movi FLYBACK_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm3
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm3
|
||
cmpi 1,a2
|
||
jrle #fall
|
||
|
||
sll 4,a1
|
||
PUSH a14
|
||
addi #noblflail_t,a1 ;Powerful guys flail more often
|
||
move *a1,a0
|
||
calla RNDPER
|
||
PULL a14
|
||
movi FLYBACK_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm4
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm4
|
||
|
||
; Will this work?
|
||
jrls #fall
|
||
jruc #flail
|
||
|
||
#haveball
|
||
|
||
;If toward rear edge of court and is being pushed back into crowd, always do
|
||
;normal flyback and never keep ball!
|
||
|
||
movi FLYBACK_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm5
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm5
|
||
|
||
move *a8(OZPOS),a1
|
||
cmpi CZMIN+40,a1 ;stupid K!!!
|
||
jrgt #not_rear
|
||
move *a8(OZVEL),a1,L
|
||
jrn #fall ;Heading over scores table?
|
||
|
||
#not_rear
|
||
move @pushing_delay,a1
|
||
jrnz #keepball
|
||
move @pup_strongmen,a1
|
||
jrz #notchamp
|
||
srl 1,a1
|
||
;A grand champion is playing!
|
||
move *a13(plyr_num),a0
|
||
srl 1,a0
|
||
cmp a0,a1
|
||
jrz #notchamp ;br=champ getting pushed
|
||
movi 900,a0 ;###
|
||
calla RNDPER
|
||
jrhi #keepball
|
||
|
||
#notchamp
|
||
|
||
; move *a13(plyr_ptsdown),a1
|
||
; jrle #fall ;I'm winning?
|
||
|
||
;If player is in elbo mode, have him keep ball more often!
|
||
|
||
movi 500,a0 ;### 40% chance of keeping ball if in
|
||
cmpi ELBO_SEQ,a14 ; ELBO; could also do ELBO2_SEQ
|
||
jrz #fbnorm
|
||
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_POWER),a0
|
||
|
||
move @last_power,a2 ;Player pushing has this power
|
||
sub a0,a2
|
||
abs a2
|
||
cmpi 1,a2
|
||
jrgt #norm
|
||
movi 200,a0
|
||
jruc #norm2
|
||
|
||
#norm
|
||
sll 4,a0
|
||
addi #kpball_t,a0 ;Powerful guys, keep ball more often
|
||
move *a0,a0
|
||
#norm2
|
||
move *a13(plyr_ptsdown),a1
|
||
jrle #fbnorm ;losing? no if <=
|
||
cmpi 15,a1 ;### < this many down?
|
||
jrle #fbmok
|
||
movk 15,a1 ;### no, set max
|
||
#fbmok sll 4,a1
|
||
addi #flyb_t,a1
|
||
move *a1,a14
|
||
add a14,a0
|
||
cmpi 1000,a0 ;###
|
||
jrge #keepball
|
||
#fbnorm
|
||
calla RNDPER
|
||
jrls #fb
|
||
|
||
#keepball
|
||
;Yes, keep ball even though I've been pushed.
|
||
|
||
clr a0
|
||
move a0,*a13(plyr_dribmode) ;Allow dribble when he gets up
|
||
|
||
;Rules for using short flyback/WITH BALL sequence:
|
||
;If in dunk, don't do short flybacks
|
||
;If in jump shot, 50%
|
||
;If losing, 50%
|
||
;What else?
|
||
|
||
calla pushed_speech
|
||
|
||
movi FLYBACKWB_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm6
|
||
; movi FFLYBACKWB_SEQ,a0
|
||
;#noflm6
|
||
|
||
move *a13(plyr_seqflgs),a14
|
||
btst DUNK_B,a14
|
||
jrnz #fall ;In dunk?
|
||
|
||
|
||
move *a13(plyr_seq),a14
|
||
subk SHOOT_SEQ,a14 ;Am I shooting?
|
||
jrz #_50_50
|
||
|
||
movi 50,a0 ;###
|
||
move *a13(plyr_ptsdown),a1
|
||
jrle #i5050
|
||
; jrle #fall ;I'm winning?
|
||
|
||
#_50_50
|
||
;I'm losing or shooting, 25% of time don't fly all the way back.
|
||
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_POWER),a0
|
||
|
||
move @last_power,a2 ;Player pushing has this power
|
||
sub a0,a2
|
||
abs a2
|
||
cmpi 1,a2
|
||
jrgt #norm3
|
||
movi 250,a0 ;###
|
||
jruc #i5050
|
||
|
||
#norm3
|
||
sll 4,a0
|
||
addi #shortfly_t,a0 ;Powerful guys keep ball more often
|
||
move *a0,a0
|
||
; movi 250,a0
|
||
#i5050
|
||
calla RNDPER
|
||
jrhi #nofall
|
||
|
||
movi FLYBACKWB_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm7
|
||
; movi FFLYBACKWB_SEQ,a0
|
||
;#noflm7
|
||
jruc #fall
|
||
#nofall
|
||
|
||
; move @HCOUNT,a1
|
||
; andi 3,a1 ;andi 1
|
||
; jrz #fall
|
||
|
||
;He lucked out, fly short distance
|
||
|
||
#flail move *a8(OZVEL),a0,L
|
||
; sra 2,a0
|
||
sra 1,a0
|
||
move a0,*a8(OZVEL),L
|
||
move *a8(OXVEL),a0,L
|
||
; sra 2,a0
|
||
sra 1,a0
|
||
move a0,*a8(OXVEL),L
|
||
|
||
movi FLYBACKWB2_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm8
|
||
; movi FFLYBACKWB2_SEQ,a0
|
||
;#noflm8
|
||
jruc #fall
|
||
|
||
#fb
|
||
;Rules for using short flyback/NO BALL sequence:
|
||
;If in dunk, don't do short flybacks
|
||
;If losing, 35%
|
||
;What else?
|
||
calla pushed_speech
|
||
movi FLYBACK_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm9
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm9
|
||
|
||
move *a13(plyr_seqflgs),a14
|
||
btst DUNK_B,a14
|
||
jrnz #fall ;In dunk?
|
||
|
||
;If big guy, do short flyback more often!
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_POWER),a0
|
||
|
||
move @last_power,a2 ;Player pushing has this power
|
||
sub a0,a2
|
||
abs a2
|
||
cmpi 1,a2
|
||
jrgt #norm5
|
||
|
||
movi FLYBACK_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm10
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm10
|
||
|
||
jruc #fall
|
||
#norm5
|
||
|
||
sll 4,a0
|
||
move *a13(plyr_ptsdown),a1
|
||
jrle #winshortfly ;Br= I'm winning!
|
||
;I'm losing
|
||
addi #shortfly_t,a0
|
||
move *a0,a0
|
||
jruc #flyout
|
||
#winshortfly ;Br= I'm winning!
|
||
addi #winshortfly_t,a0
|
||
move *a0,a0
|
||
|
||
|
||
#flyout
|
||
; move *a13(plyr_ptsdown),a1
|
||
; jrle #fall ;Br= I'm winning!
|
||
|
||
;I'm losing, 35% of time don't fly all the way back.
|
||
; addi 150,a0
|
||
;#fbnorm2
|
||
calla RNDPER
|
||
jrhi #fly_short
|
||
|
||
movi FLYBACK_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm11
|
||
; movi FFLYBACK_SEQ,a0
|
||
;#noflm11
|
||
jruc #fall
|
||
|
||
#fly_short
|
||
;He lucked out, make him fly short distance
|
||
move *a8(OZVEL),a0,L
|
||
; sra 2,a0
|
||
sra 1,a0
|
||
move a0,*a8(OZVEL),L
|
||
move *a8(OXVEL),a0,L
|
||
; sra 2,a0
|
||
sra 1,a0
|
||
move a0,*a8(OXVEL),L
|
||
|
||
movi FLYBACK2_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm12
|
||
; movi FFLYBACK2_SEQ,a0
|
||
;#noflm12
|
||
|
||
jruc #fall
|
||
|
||
#chkstag
|
||
move *a13(plyr_jmpcnt),a1
|
||
jrz #stag ;On gnd?
|
||
|
||
movi FALL_SEQ,a0 ;If similar power, always do flyback
|
||
; move a9,a9
|
||
; jrz #noflm13
|
||
; movi FFALL_SEQ,a0
|
||
;#noflm13
|
||
|
||
cmp a14,a0
|
||
jrne #fall
|
||
jruc #cstag
|
||
|
||
#stag subi STAGGER_SEQ,a14
|
||
jreq #nostag
|
||
subk FALL_SEQ-STAGGER_SEQ,a14
|
||
jreq #cstag
|
||
|
||
movk 3,a0
|
||
callr rnd
|
||
jrnz #nostag
|
||
movi STAGGER_SEQ,a0
|
||
|
||
#fall
|
||
move *a13(plyr_dir),a7
|
||
callr plyr_setseq
|
||
#cstag clr a2
|
||
move a2,*a13(plyr_stagcnt)
|
||
#nostag
|
||
|
||
;--------------------
|
||
; Eval plyr controls
|
||
|
||
move @PSTATUS,a0 ;Plyr start bits 0-3
|
||
move *a13(plyr_num),a1
|
||
btst a1,a0
|
||
jrnz #human
|
||
calla drone_main
|
||
#human
|
||
#tcc
|
||
move *a13(plyr_indef),a14
|
||
jrz #nodef
|
||
move *a13(plyr_balldir),*a13(plyr_newdir)
|
||
|
||
#nodef
|
||
move *a11,a6 ;A6=Ctrl bits
|
||
|
||
; move *a13(plyr_jmpcnt),a0
|
||
; jrnz #clrsb ;In air?
|
||
|
||
movb *a13(plyr_seqflgs+NOJOY_B-7),a0
|
||
jrn #clrsb ;Joy off?
|
||
|
||
move *a13(plyr_nojoy),a0
|
||
jrz #joyon ;Joystick on?
|
||
jrgt #clrsb
|
||
;dont allow a jump or steal when NOJOY is set, I expecting a pass!!
|
||
|
||
btst BUT1_B,a0
|
||
jrnz #lock
|
||
btst BUT2_B,a0
|
||
jrnz #lock
|
||
; andni BUT1_M|BUT2_M,a0
|
||
move a0,a6
|
||
jruc #joyon
|
||
|
||
#lock
|
||
.if DEBUG
|
||
LOCKUP
|
||
.endif
|
||
move a0,a6
|
||
jruc #joyon
|
||
|
||
#clrsb
|
||
srl 4,a6 ;Clr stick bits
|
||
sll 4,a6
|
||
|
||
#joyon
|
||
move *a13(plyr_dir),a7 ;A7=Dir
|
||
|
||
move *a13(plyr_newdir),a0
|
||
jrn #stick ;No forced dir?
|
||
sub a7,a0
|
||
jrnz #turn
|
||
movi -1,a0
|
||
move a0,*a13(plyr_newdir)
|
||
|
||
;--------------------
|
||
; Clr joy bits that make us go out of bounds
|
||
|
||
#stick
|
||
move *a13(plyr_autoctrl),a1 ;No chk if under auto ctrl
|
||
jrnz #chkturn
|
||
|
||
movk 1,a3 ;Generic K
|
||
move *a13(plyr_rcvpass),a1
|
||
move *a13(plyr_seq),a2
|
||
subi RUN_SEQ,a2 ;Set seq match (0) or nomatch (!0)
|
||
jrz #sldin
|
||
subi RUNTURB_SEQ-RUN_SEQ,a2
|
||
jrz #sldin
|
||
subi RUNDRIB_SEQ-RUNTURB_SEQ,a2
|
||
jrz #sldin
|
||
subi RUNDRIBTURB_SEQ-RUNDRIB_SEQ,a2
|
||
#sldin
|
||
move *a8(OZPOS),a0
|
||
|
||
cmpi CZMIN+8,a0 ;stupid K!!! ;Is Z ok? Yes if >
|
||
jrgt #upok
|
||
movk JOYU_M,a14 ;No. Clr stick UP bit
|
||
andn a14,a6
|
||
|
||
move a1,a1 ;Receiving a pass? No if 0
|
||
jrz #nowait
|
||
move a3,*a13(plyr_nojoy) ;Tell player recieving a leading pass
|
||
move a3,*a13(plyr_turndelay) ; to turn and wait for pass
|
||
#nowait
|
||
cmpi CZMIN+6,a0 ;stupid K!!!
|
||
jrgt #upok
|
||
|
||
move a2,a2 ;Match 1 of the seqs? No if !0
|
||
jrnz #upok
|
||
addk 1,a0 ;Yes
|
||
#upok
|
||
cmpi CZMAX-6,a0 ;stupid K!!! ;Is Z ok? Yes if <
|
||
jrlt #dnok
|
||
movk JOYD_M,a14 ;No. Clr stick DN bit
|
||
andn a14,a6
|
||
|
||
move a1,a1 ;Receiving a pass? No if 0
|
||
jrz #nowait1
|
||
move a3,*a13(plyr_nojoy) ;Tell player recieving a leading pass
|
||
move a3,*a13(plyr_turndelay) ; to turn and wait for pass
|
||
#nowait1
|
||
|
||
#dnok
|
||
move a0,*a8(OZPOS)
|
||
|
||
move *a8(OXPOS),a0
|
||
move *a8(OXANI+16),a14
|
||
add a14,a0
|
||
|
||
cmpi PLYRMINX,a0 ;Is X ok? Yes if >
|
||
jrgt #lok
|
||
movk JOYL_M,a14 ;No. Clr stick LF bit
|
||
andn a14,a6
|
||
|
||
move a1,a1 ;Receiving a pass? No if 0
|
||
jrz #nowait2
|
||
move a3,*a13(plyr_nojoy) ;Tell player recieving a leading pass
|
||
move a3,*a13(plyr_turndelay) ; to turn and wait for pass
|
||
#nowait2
|
||
cmpi PLYRMINX-15,a0
|
||
jrgt #lok
|
||
|
||
move a2,a2 ;Match 1 of the seqs? No if !0
|
||
jrnz #lok
|
||
addk 1,a0 ;Yes
|
||
#lok
|
||
cmpi PLYRMAXX,a0 ;Is X ok? Yes if <
|
||
jrlt #rok
|
||
movk JOYR_M,a14 ;No. Clr stick RG bit
|
||
andn a14,a6
|
||
|
||
move a1,a1 ;Receiving a pass? No if 0
|
||
jrz #nowait3
|
||
move a3,*a13(plyr_nojoy) ;Tell player recieving a leading pass
|
||
move a3,*a13(plyr_turndelay) ; to turn and wait for pass
|
||
#nowait3
|
||
cmpi PLYRMAXX+15,a0
|
||
jrlt #rok
|
||
|
||
move a2,a2 ;Match 1 of the seqs? No if !0
|
||
jrnz #rok
|
||
subk 1,a0 ;Yes
|
||
#rok
|
||
move *a8(OXANI+16),a14
|
||
sub a14,a0
|
||
move a0,*a8(OXPOS)
|
||
|
||
;--------------------
|
||
; Change dir plyr img is facing
|
||
|
||
#chkturn
|
||
move a6,a0
|
||
sll 32-4,a0
|
||
jrz #setdt ;No stick?
|
||
|
||
srl 32-4-3,a0 ;>Convert to dir 0-127
|
||
addi #dirc_t,a0
|
||
movb *a0,a0
|
||
|
||
sub a7,a0 ;A0=Difference
|
||
jrz #samedir
|
||
|
||
#turn move a0,a1 ;>Turn the shortest way
|
||
abs a0
|
||
|
||
; subk 6,a0
|
||
subk 8,a0 ;Turn faster
|
||
|
||
jrge #340 ;Far?
|
||
add a1,a7 ;Make exact
|
||
jruc #380
|
||
|
||
#340 cmpi 64-6,a0
|
||
jrle #350
|
||
neg a1
|
||
#350 move a1,a1
|
||
jrnn #360
|
||
; subk 12,a7 ;-6
|
||
subk 16,a7 ;-8
|
||
|
||
#360
|
||
; addk 6,a7 ;+6
|
||
addk 8,a7 ;+8
|
||
|
||
#380 sll 32-7,a7 ;Make 0-127
|
||
srl 32-7,a7
|
||
move a7,*a13(plyr_dir)
|
||
|
||
movk >1f,a0
|
||
callr rnd
|
||
jrnz #nosq ;No squeak?
|
||
move @PCNT,a0
|
||
movk 3,a1
|
||
and a1,a0
|
||
sll 5,a0
|
||
move @pup_court,a14
|
||
; jrnz #nosq0 ;br=outdoor court
|
||
addi #sqsnds,a0
|
||
jruc #nosq1
|
||
#nosq0
|
||
addi #sqsnds2,a0
|
||
#nosq1
|
||
move *a0,a0,L
|
||
calla snd_play1
|
||
#nosq
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst WALK_B,a0
|
||
jrnz #nodir
|
||
move *a13(plyr_seqdir),a0
|
||
move a7,a1 ;Dir
|
||
addk 8,a1
|
||
sll 32-7,a1
|
||
srl 32-7+4,a1 ;Kill frac
|
||
cmp a0,a1
|
||
jreq #nodir ;Already in this dir?
|
||
move *a13(plyr_seq),a0
|
||
callr plyr_setseq
|
||
#nodir clr a0
|
||
jruc #setdt
|
||
|
||
#samedir
|
||
move *a13(plyr_dirtime),a0
|
||
addk 1,a0
|
||
#setdt move a0,*a13(plyr_dirtime)
|
||
|
||
;----------
|
||
; Movement/boundary check
|
||
|
||
;LOOK!!!
|
||
move *a8(OXVEL),a2,L
|
||
move *a8(OZVEL),a3,L
|
||
|
||
move *a13(plyr_jmpcnt),a0
|
||
jrnz #drift ;Jumping?
|
||
|
||
move *a13(plyr_seqflgs),a4 ;No, but still on the way down?
|
||
btst DRIFT_B,a4
|
||
jrz #nodrift ;No if 0
|
||
|
||
#drift move *a8(OXPOS),a4 ;>Put drag on vel if we drift too far
|
||
move *a8(OXANI+16),a0
|
||
add a0,a4
|
||
move *a8(OZPOS),a5
|
||
|
||
move a3,a3
|
||
jrge #zvpos
|
||
cmpi CZMIN+8,a5
|
||
jrgt #chkx ;OK?
|
||
jruc #ydrag
|
||
|
||
#zvpos cmpi GZMAX-6,a5
|
||
jrlt #chkx ;OK?
|
||
#ydrag move a3,a0 ;-1/4 from vel
|
||
sra 2,a0
|
||
sub a0,a3
|
||
#chkx
|
||
move a2,a2
|
||
jrge #xvpos
|
||
cmpi PLYRMINX2,a4
|
||
jrgt #setvel ;OK?
|
||
jruc #xdrag
|
||
#xvpos
|
||
cmpi PLYRMAXX2,a4
|
||
jrlt #setvel ;OK?
|
||
#xdrag move a2,a0 ;-1/4 from vel
|
||
sra 2,a0
|
||
sub a0,a2
|
||
jruc #setvel
|
||
|
||
|
||
#nodrift
|
||
move a2,a0 ;>-1/4 from XZVEL
|
||
sra 2,a0
|
||
sub a0,a2
|
||
move a3,a0
|
||
sra 2,a0
|
||
sub a0,a3
|
||
|
||
btst NOMV_B,a4
|
||
jrnz #setvel ;No moving?
|
||
|
||
|
||
move *a13(plyr_autoctrl),a1
|
||
jrz #noautoc
|
||
movi >1a000,a14
|
||
jruc #noturb
|
||
|
||
#noautoc
|
||
move *a13(plyr_bvel),a14
|
||
sll 4,a14
|
||
|
||
move *a13(plyr_num),a0
|
||
move @pup_hypspeed,a1
|
||
btst a0,a1
|
||
jrz #nohyper
|
||
|
||
|
||
;Double turbo mode
|
||
addi >5800,a14
|
||
#nohyper
|
||
|
||
move *a13(plyr_ownball),a1
|
||
jrle #nobal ;Have ball?
|
||
|
||
;I own ball, if shot clock down to 10, and am over
|
||
;half court, slow down! I am trying to burn out the clock!
|
||
|
||
move *a13(plyr_ohpdist),a1
|
||
;This is approximately half court!
|
||
cmpi >174*DIST_ADDITION,a1
|
||
jrlt #nobal
|
||
move @shotimer,a1,L
|
||
jrz #nobal
|
||
cmpi [1,0],a1
|
||
jrz #nobal
|
||
|
||
move *a13(plyr_ptsdown),a1
|
||
jrgt #nobal ;If losing, don't slow down
|
||
|
||
;MJT Start
|
||
; subi >3000,a14 ;Slow him down
|
||
subi >6000,a14 ;Slow him down more!
|
||
;MJT End
|
||
|
||
#nobal
|
||
move @game_time,a1,L
|
||
cmpi 050000h,a1
|
||
jrge #noxtraspd
|
||
|
||
;Under 50 seconds, speed up losing players!
|
||
|
||
; move *a13(plyr_ptsdown),a1 ;>Adjust shot %
|
||
; jrle #noxtraspd
|
||
|
||
move *a13(plyr_num),a1
|
||
cmpi 2,a1
|
||
jrge #tm2
|
||
move @scores,a0
|
||
move @scores+16,a1
|
||
cmp a0,a1
|
||
jrle #noxtraspd
|
||
jruc #yes
|
||
|
||
#tm2 move @scores,a0
|
||
move @scores+16,a1
|
||
cmp a0,a1
|
||
jrge #noxtraspd
|
||
#yes
|
||
addi >1c00,a14
|
||
#noxtraspd
|
||
|
||
;This offscrn flag gets set only when on defense!
|
||
move *a13(plyr_offscrn),a1
|
||
jrz #onscrn
|
||
;We want to speed guy up when offscrn... But go even faster if he is trying
|
||
;to get back on the screen!
|
||
; addi >e000,a14 ;Speedup when offscrn
|
||
addi >8000,a14 ;Speedup when offscrn
|
||
|
||
;Trying to come back?
|
||
move @WORLDTLX+16,a0
|
||
addi 200,a0
|
||
move *a8(OXPOS),a1
|
||
cmp a1,a0
|
||
jrgt #offlft
|
||
;Player is off screen to right
|
||
btst JOYL_B,a6
|
||
jrz #cont
|
||
jruc #add
|
||
|
||
#offlft
|
||
btst JOYR_B,a6
|
||
jrz #cont
|
||
#add addi >8000,a14 ;Coming back!
|
||
#cont
|
||
|
||
|
||
clr a1
|
||
move a1,*a13(plyr_offscrn)
|
||
#onscrn
|
||
|
||
move *a13(plyr_ownball),a1
|
||
jrz #chkturb
|
||
; subi >e00,a14 ;Slow offense down
|
||
subi >e80,a14 ;Slow offense down
|
||
move a1,a1
|
||
jrn #chkturb ;Buddy has ball?
|
||
; subi >1000,a14 ;Slow him down
|
||
subi >1100,a14 ;Slow him down
|
||
#chkturb
|
||
move *a13(plyr_turbon),a0
|
||
jrz #noturb
|
||
; addi >3e00,a14
|
||
addi >3f00,a14
|
||
|
||
#noturb
|
||
movk 11b,a0
|
||
and a6,a0
|
||
jrz #nodiag ;Neither up or dn?
|
||
movk 1100b,a0
|
||
and a6,a0
|
||
jrz #nodiag ;Neither lft or rgt?
|
||
move a14,a0
|
||
sra 3,a0
|
||
sub a0,a14 ;-12%
|
||
#nodiag
|
||
|
||
; btst 4,a6 ;3point DEBUG
|
||
; jrz #DEBUG
|
||
; movi >2000,a14
|
||
;#DEBUG
|
||
|
||
move *a8(OXPOS),a4
|
||
move *a8(OXANI+16),a0
|
||
add a0,a4
|
||
move *a8(OZPOS),a5
|
||
|
||
btst JOYU_B,a6
|
||
jrz #noup
|
||
cmpi CZMIN+8,a5
|
||
jrle #noup ;Min?
|
||
sub a14,a3
|
||
#noup
|
||
btst JOYD_B,a6
|
||
jrz #nodn
|
||
cmpi GZMAX-6,a5
|
||
jrge #nodn ;Max?
|
||
add a14,a3
|
||
#nodn
|
||
btst JOYL_B,a6
|
||
jrz #chkr
|
||
sub a14,a2
|
||
cmpi PLYRMINX,a4
|
||
jrgt #setvel ;In bounds?
|
||
move *a13(plyr_autoctrl),a0
|
||
jrnz #setvel
|
||
add a14,a2
|
||
jruc #setvel
|
||
#chkr
|
||
btst JOYR_B,a6
|
||
jrz #setvel
|
||
add a14,a2
|
||
cmpi PLYRMAXX,a4
|
||
jrlt #setvel ;In bounds?
|
||
move *a13(plyr_autoctrl),a0
|
||
jrnz #setvel
|
||
sub a14,a2
|
||
|
||
#setvel move a2,*a8(OXVEL),L
|
||
move a3,*a8(OZVEL),L
|
||
#nomv
|
||
|
||
|
||
;-------
|
||
|
||
;>Do turbo meters
|
||
btst BUT3_B,a6 ;Turbo but
|
||
jrz #turdone
|
||
|
||
|
||
;Allow guy with ball to throw elbows if turbo button pressed twice quickly
|
||
btst BUT3_B+8,a6
|
||
jrz #noelbo
|
||
|
||
move *a13(plyr_tbutn),a14
|
||
clr a0
|
||
move a0,*a13(plyr_tbutn)
|
||
subk 1,a14
|
||
jrlt #noelbo ;Too quick?
|
||
subk 8-1,a14
|
||
jrgt #noelbo ;Too late?
|
||
|
||
move *a13(plyr_seq),a14
|
||
cmpi STNDWB_SEQ,a14
|
||
jreq #ok
|
||
cmpi STNDWB2_SEQ,a14
|
||
jreq #ok
|
||
cmpi STNDDRIB2_SEQ,a14
|
||
jreq #ok
|
||
cmpi RUNDRIB_SEQ,a14
|
||
jreq #ok
|
||
cmpi RUNDRIBTURB_SEQ,a14
|
||
jreq #ok
|
||
subk STNDDRIB_SEQ,a14
|
||
jrne #noelbo
|
||
#ok
|
||
; move *a13(plyr_num),a0
|
||
; move @PSTATUS,a2
|
||
; btst a0,a2
|
||
; jrz #notingame
|
||
|
||
move @gmqrtr,a0
|
||
jrnz #s1
|
||
|
||
move @game_time,a0,L
|
||
;This check is here because we don't want accidental elbows when people
|
||
;are trying to win jump ball!
|
||
cmpi >2040906,a0
|
||
jrge #noelbo
|
||
|
||
#s1
|
||
move *a13(plyr_PDATA_p),a2,L ;Shrink turbo meter for this plyr
|
||
move *a2(ply_turbo),a1
|
||
subk TURBO_CNT/7*2,a1 ;!!! Min cnt for elbow
|
||
jrle #noelbo ;Turbo too low?
|
||
move a1,*a2(ply_turbo)
|
||
sll 5,a1
|
||
addi TURBO_52,a1
|
||
move *a2(ply_meter_imgs+32),a0,L
|
||
move *a1(0),*a0(OSAG),L
|
||
|
||
; move *a2(ply_meter_imgs+40h),a0,L
|
||
; move *a0(OFSET),a1 ;Shrink meter
|
||
; addk 4,a1
|
||
; move a1,*a0(OFSET)
|
||
|
||
#notingame
|
||
movi 60,a0
|
||
move a0,@steals_off ;Don't allow steals for 60 ticks
|
||
|
||
movi ELBO2_SEQ,a0
|
||
move *a13(plyr_dribmode),a14
|
||
jrn #elbw ;br=cant dribble...do elbows
|
||
move *a13(PA8),a14,L
|
||
|
||
|
||
move *a14(OZVEL),a1
|
||
abs a1
|
||
cmpi 0000100h,a1
|
||
jrge #spin
|
||
move *a14(OXVEL),a14
|
||
abs a14
|
||
cmpi 00002700h,a14
|
||
jrle #elbw
|
||
#spin
|
||
|
||
;Don't allow consecutive spins
|
||
.ref last_spin
|
||
move @last_spin,a1
|
||
move @PCNT,a14
|
||
move a14,@last_spin
|
||
sub a1,a14
|
||
abs a14
|
||
cmpi 2*60,a14
|
||
jrgt #norms
|
||
|
||
;If spin, allow steals/pushes occasionally!
|
||
; movi 500,a0
|
||
; calla RNDPER
|
||
; jrls #norms
|
||
|
||
clr a0
|
||
move a0,@steals_off ;Don't allow steals for 10 ticks
|
||
#norms
|
||
movi SPIN_MOVE_SEQ,a0
|
||
#elbw
|
||
callr plyr_setseq
|
||
jruc #turdone
|
||
|
||
#noelbo
|
||
; move *a13(plyr_num),a0 ;Don't allow drones to mess with
|
||
; move @PSTATUS,a2 ;img ofsets!
|
||
; btst a0,a2
|
||
; jrz #turdone
|
||
|
||
move *a13(plyr_num),a0 ;If on fire, don't use turbo on run
|
||
move @plyr_onfire,a1
|
||
;; cmp a0,a1
|
||
;; jrz #turdone
|
||
btst a0,a1
|
||
jrnz #turdone ;br=on-fire
|
||
|
||
.ref refill_turbo
|
||
move @pup_trbinfinite,a1
|
||
btst a0,a1
|
||
jrz #doturb
|
||
move a11,a14
|
||
move *a13(plyr_PDATA_p),a11,L
|
||
calla refill_turbo
|
||
move a14,a11
|
||
jruc #turdone
|
||
#doturb
|
||
move *a13(plyr_PDATA_p),a0,L
|
||
move *a0(ply_turbo),a1 ;Turbo info in PxDATA (0...TURB_CNT-1)
|
||
jrz #turdone ;No turbo left?
|
||
move *a0(ply_turbo_dl),a2 ;Cnt for delaying dec of ply_turbo
|
||
subk 1,a2
|
||
move a2,*a0(ply_turbo_dl)
|
||
jrnz #turdone
|
||
|
||
subk 1,a1
|
||
move a1,*a0(ply_turbo) ;Turbo meter size to get smaller
|
||
|
||
movk 390/TURBO_CNT,a2 ;!!! Rate of decline
|
||
move a2,*a0(ply_turbo_dl)
|
||
movk 200/TURBO_CNT,a2 ;!!! Rate of replenish
|
||
move a2,*a0(used_turbo)
|
||
move *a0(ply_idiot_use),a2
|
||
inc a2
|
||
move a2,*a0(ply_idiot_use)
|
||
|
||
sll 5,a1
|
||
addi TURBO_52,a1
|
||
move *a0(ply_meter_imgs+32),a2,L
|
||
move *a1(0),*a2(OSAG),L
|
||
|
||
; move *a0(ply_meter_imgs+40h),a0,L ;LITUP img
|
||
; move *a0(OFSET),a1 ;Need to shrink LITUP img
|
||
; addk 1,a1
|
||
; move a1,*a0(OFSET)
|
||
|
||
#turdone
|
||
move *a13(plyr_tbutn),a0 ;Ticks since turbo button last hit
|
||
addk 1,a0
|
||
move a0,*a13(plyr_tbutn)
|
||
|
||
|
||
|
||
|
||
|
||
move *a13(plyr_shtdly),a0
|
||
jrle #nodly ;No delay?
|
||
|
||
;Is Ball near ground, and player has high shtdly?
|
||
.if DEBUG
|
||
cmpi 30,a0
|
||
jrlt #okz
|
||
|
||
move @ballobj_p,a14,L
|
||
|
||
move *a14(OYPOS),a14
|
||
cmpi -40,a14
|
||
jrle #okz ;Ball close to gnd?
|
||
move @inbound,a14
|
||
jrnn #okz
|
||
move @ballpnum,a14 ;Plyr # who owns (0-3) or Neg
|
||
jrnn #okz
|
||
;Ball without owner, can't pick it up!
|
||
; LOCKUP
|
||
#okz
|
||
.endif
|
||
|
||
subk 1,a0
|
||
move a0,*a13(plyr_shtdly)
|
||
#nodly
|
||
|
||
;----------
|
||
|
||
move *a13(plyr_rcvpass),a0 ;>Pass receiving
|
||
jrle #norcvp ;No pass?
|
||
subk 1,a0
|
||
move a0,*a13(plyr_rcvpass)
|
||
jrgt #norcvp ;Not yet?
|
||
; move *a13(plyr_nojoy),a1
|
||
move a0,*a13(plyr_nojoy)
|
||
; move @ballobj_p,a2,L
|
||
; move *a2(OYVEL+16),a0
|
||
; jrge #balllow
|
||
; move *a8(OYPOS),a0
|
||
; subk 10,a0
|
||
; move *a2(OYPOS),a1
|
||
; cmp a0,a1
|
||
; jrgt #balllow
|
||
; subk REBOUND_SEQ,a1
|
||
; jrne #noreb
|
||
; movk REBOUND_SEQ,a0
|
||
; callr plyr_setseq
|
||
;#noreb
|
||
|
||
#norcvp
|
||
move *a13(plyr_seq),a2
|
||
cmpi RUNDRIBTURB_SEQ,a2
|
||
jrhi #anicnt
|
||
|
||
move a6,a1 ;>Change ani if no joy
|
||
sll 32-4,a1
|
||
jrz #nojoy ;Joy neutral?
|
||
|
||
movi 38,a14 ;stupid K!!!Delay before auto zturn toward ball
|
||
move *a13(plyr_ownball),a0
|
||
jrz #indef
|
||
movi 60,a14 ;stupid K!!!^
|
||
#indef
|
||
move a14,*a13(plyr_turndelay)
|
||
|
||
move *a13(plyr_indef),a14
|
||
jrz #nodef2
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst WALK_B,a0
|
||
jrnz #anicnt
|
||
|
||
srl 32-4-3,a1 ;>Convert to dir 0-127
|
||
addi #dirc_t,a1
|
||
movb *a1,a1
|
||
|
||
sub a7,a1
|
||
move a1,a14 ;Calc dir dist
|
||
abs a14
|
||
cmpi >40,a14
|
||
jrle #diffsml
|
||
neg a1
|
||
subi >80,a14
|
||
abs a14
|
||
#diffsml
|
||
movk WALKFDEF_SEQ,a0
|
||
cmpi 16,a14
|
||
jrlt #setseq
|
||
movk WALKBDEF_SEQ,a0
|
||
cmpi >30,a14
|
||
jrgt #setseq
|
||
movk WALKLDEF_SEQ,a0
|
||
move a1,a1
|
||
jrn #setseq
|
||
movk WALKRDEF_SEQ,a0
|
||
jruc #setseq
|
||
|
||
#nodef2
|
||
;
|
||
; clr a0
|
||
; move a0,*a13(plyr_keeppal)
|
||
;
|
||
movk RUN_SEQ,a0 ;>Setup run sequence
|
||
move *a13(plyr_ownball),a14
|
||
jrle #nobl
|
||
move *a13(plyr_dribmode),a14
|
||
jrn #stndwb ;Can't drib?
|
||
movk RUNDRIB_SEQ,a0
|
||
#nobl
|
||
move a0,a1
|
||
move *a13(plyr_turbon),a14
|
||
jrz #slow
|
||
;This points to turbo runs
|
||
addk 1,a0 ;Turbo version
|
||
#slow
|
||
addk 1,a1
|
||
sub a2,a1
|
||
subk 1,a1
|
||
jrhi #setseq ;Different type?
|
||
|
||
move *a13(plyr_ani_p),a14,L
|
||
move *a14+,a14
|
||
jrnz #anicnt ;!At end?
|
||
jruc #setseq
|
||
|
||
#nojoy
|
||
move *a13(plyr_seqflgs),a0
|
||
btst WALK_B,a0
|
||
jrnz #anicnt
|
||
|
||
movk STNDDEF_SEQ,a0 ;>Setup stand sequence
|
||
movk STNDDRIBDEF_SEQ,a1
|
||
move *a13(plyr_indef),a14
|
||
jrnz #chkb
|
||
|
||
movk STND2_SEQ,a0
|
||
movk STNDDRIB_SEQ,a1
|
||
|
||
move *a13(plyr_turndelay),a14
|
||
jrz #turnok1
|
||
subk 1,a14
|
||
move a14,*a13(plyr_turndelay)
|
||
subk 20,a14
|
||
jrgt #chkb
|
||
#turnok1
|
||
move *a13(plyr_o1dist),a14
|
||
cmpi 155*DIST_REDUCTION,a14
|
||
jrlt #stnd0
|
||
move *a13(plyr_o2dist),a14
|
||
cmpi 155*DIST_REDUCTION,a14
|
||
jrgt #stnd1
|
||
#stnd0
|
||
movk STND_SEQ,a0
|
||
movk STNDDRIB2_SEQ,a1
|
||
#stnd1
|
||
|
||
move *a13(plyr_ownball),a14
|
||
jrle #chka
|
||
move *a13(plyr_turndelay),a14
|
||
jrz #turnok0
|
||
dec a14
|
||
move a14,*a13(plyr_turndelay)
|
||
jruc #chkb
|
||
|
||
#turnok0
|
||
move *a13(plyr_ohpdir),a14
|
||
move a14,*a13(plyr_newdir)
|
||
jruc #chkb
|
||
#chka
|
||
move *a13(plyr_turndelay),a14
|
||
jrz #turnok
|
||
dec a14
|
||
move a14,*a13(plyr_turndelay)
|
||
jruc #chkb
|
||
#turnok move *a13(plyr_balldir),a14
|
||
move a14,*a13(plyr_newdir)
|
||
|
||
|
||
|
||
#chkb move *a13(plyr_ownball),a14
|
||
jrle #setseq
|
||
move a1,a0
|
||
move *a13(plyr_dribmode),a14
|
||
jrgt #setseq ;Dribbling?
|
||
#stndwb movk STNDWB_SEQ,a0
|
||
move @inbound,a14
|
||
jrnn #setseq
|
||
move *a13(plyr_num),a14
|
||
btst 0,a14
|
||
jrnz #setseq
|
||
movk STNDWB2_SEQ,a0
|
||
|
||
#setseq cmp a0,a2
|
||
|
||
.if 1 ;0 for plyr anim patch temp
|
||
jreq #anicnt
|
||
|
||
.if IMGVIEW
|
||
movi debug_SEQ1,a0
|
||
.endif
|
||
|
||
callr plyr_setseq
|
||
|
||
|
||
;TEMP!!! anim patch temp
|
||
.else
|
||
movk STNDDRIB_SEQ,a0
|
||
move *a13(plyr_seq),a1
|
||
cmp a0,a1
|
||
jrne #tmp0
|
||
move *a13(plyr_seqdir),a1
|
||
cmpi 4,a1
|
||
jreq #anicnt
|
||
#tmp0 movi >40,a7
|
||
callr plyr_setseq
|
||
.endif
|
||
|
||
|
||
#anicnt dsj a10,#noani
|
||
|
||
move *a13(plyr_ani_p),a14,L ;>Set new ani
|
||
#getdel move *a14+,a10 ;Delay
|
||
jrnn #nocode ;Not code?
|
||
|
||
move *a14+,a0,L ;*Code
|
||
move a14,b4
|
||
call a0 ;Can trash scratch, A2-A5
|
||
move b4,a14
|
||
jruc #getdel
|
||
|
||
#nocode jrnz #100
|
||
move *a13(plyr_seqcode_p),a0,L
|
||
jrge #noendc
|
||
call a0 ;Can trash scratch, A2-A5
|
||
#noendc move *a13(plyr_ani1st_p),a14,L ;Head of list
|
||
|
||
#getdel2
|
||
move *a14+,a10
|
||
|
||
;Sequences can start with a command!
|
||
jrnn #100
|
||
;Not code?
|
||
move *a14+,a0,L ;*Code
|
||
move a14,b4
|
||
call a0 ;Can trash scratch, A2-A5
|
||
move b4,a14
|
||
jruc #getdel2
|
||
|
||
|
||
#100 move *a14+,a0,L ;*Img
|
||
move *a14+,a1 ;Flags (OCTRL)
|
||
move *a13(plyr_anirevff),a2 ;Get reverse flip flag
|
||
xor a2,a1
|
||
move a1,a4
|
||
|
||
move *a0(IANI2Z),*a13(plyr_ballzo)
|
||
|
||
move a14,*a13(plyr_ani_p),L
|
||
callr plyr_ani
|
||
|
||
callr anipt2_getsclxy
|
||
move a0,*a13(plyr_ballxo),L
|
||
sra 16,a1
|
||
move a4,a4
|
||
jrnn #ynorm ;!YFree flag?
|
||
movi -200,a1
|
||
#ynorm move a1,*a13(plyr_ballyo)
|
||
|
||
move *a13(plyr_jmpcnt),a14
|
||
jrnz #injmp ;Jumping?
|
||
|
||
move *a13(plyr_aniy),a1
|
||
neg a1
|
||
move a1,*a8(OYPOS) ;Set on gnd
|
||
|
||
;Don't allow long tick counts on the ground
|
||
cmpi 30,a10
|
||
jrlt #injmp
|
||
movk 4,a10
|
||
#injmp
|
||
|
||
move *a8(OIMG),a2,L ;>Set new head img
|
||
move *a2(IANI3ID),a1
|
||
sll 5,a1 ;*32
|
||
move *a2(IANI3Z),a14
|
||
neg a14
|
||
|
||
move *a13(plyr_attrib_p),a0,L
|
||
move *a0(PAT_HEADT_p),a0,L
|
||
add a1,a0
|
||
move *a0,a4,L
|
||
|
||
move *a13(plyr_headobj_p),a3,L
|
||
move a14,*a3(OMISC)
|
||
move a4,*a3(OIMG),L ;Set new img
|
||
move *a4,a14,L
|
||
move a14,*a3(OSIZE),L
|
||
move *a4(ISAG),*a3(OSAG),L
|
||
|
||
setf 1,0,0
|
||
move *a8(OCTRL+4),*a3(OCTRL+4) ;Copy HFlip bit
|
||
move *a2(IFLAGS+FLIPH_IFB),a14 ;Chk reverse bit
|
||
jrz #nohflip
|
||
move *a3(OCTRL+4),a14 ;Reverse hflip
|
||
addk 1,a14
|
||
move a14,*a3(OCTRL+4)
|
||
#nohflip
|
||
setf 16,1,0
|
||
#noani
|
||
|
||
;-------
|
||
|
||
|
||
move *a13(plyr_jmpcnt),a0 ;>Jumping
|
||
jrz #noj
|
||
addk 1,a0
|
||
move a0,*a13(plyr_jmpcnt)
|
||
|
||
move *a13(plyr_hangcnt),a0
|
||
jrle #nohang ;Not hanging?
|
||
subk 1,a0
|
||
move a0,*a13(plyr_hangcnt)
|
||
jruc #pass ;Skip grav
|
||
#nohang
|
||
move *a8(OYVEL),a0,L
|
||
|
||
; move *a13(plyr_ownball),a14
|
||
; jrgt #grav ;Have ball?
|
||
;; btst BUT1_B,a6 ;Mario like jump
|
||
;; jrnz #grav
|
||
;; addi GRAV/2,a0 ;+Grav/2
|
||
;#grav
|
||
addi GRAV,a0 ;+Gravity
|
||
jrn #200
|
||
move *a8(OYPOS),a1
|
||
move *a13(plyr_aniy),a14
|
||
add a14,a1 ;Ani pt position
|
||
jrlt #200 ;Above gnd
|
||
neg a14
|
||
move a14,*a8(OYPOS) ;Set on gnd
|
||
|
||
.if DEBUG
|
||
; clr a0
|
||
; move a0,@slowmotion
|
||
.endif
|
||
|
||
movk 1,a10 ;Run landing seq
|
||
clr a0
|
||
move a0,*a13(plyr_jmpcnt)
|
||
#200 move a0,*a8(OYVEL),L
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst DUNK_B,a0
|
||
jrnz #znubb ;In dunk?
|
||
|
||
move *a8(OZPOS),a1 ;Get SZ
|
||
subi CZMID,a1
|
||
abs a1
|
||
cmpi 40,a1
|
||
jrge #znubb
|
||
move *a8(OXPOS),a0 ;Get SX
|
||
move *a8(OXANI+16),a14
|
||
add a14,a0
|
||
subi WRLDMID,a0
|
||
abs a0
|
||
move a0,a3
|
||
movi >20000,a14
|
||
cmpi HOOPRX-WRLDMID+13,a0
|
||
jrge #undrbb ;Under backboard?
|
||
|
||
subk 10,a1
|
||
jrgt #znubb
|
||
cmpi HOOPRX-WRLDMID-8,a3
|
||
jrlt #znubb ;!Under rim?
|
||
; cmpi HOOPRX-WRLDMID+13,a3
|
||
; jrgt #znubb ;!Under rim?
|
||
|
||
movi >10000,a14
|
||
move *a8(OXVAL),a1,L
|
||
cmpi WRLDMID<<16,a1
|
||
jrlt #rhoop
|
||
neg a14
|
||
#rhoop add a14,a1
|
||
move a1,*a8(OXVAL),L
|
||
|
||
movi >10000,a14
|
||
#undrbb
|
||
move *a8(OZVAL),a1,L
|
||
cmpi CZMID<<16,a1
|
||
jrge #dzpos ;In front of?
|
||
neg a14
|
||
#dzpos add a14,a1
|
||
move a1,*a8(OZVAL),L
|
||
|
||
#znubb
|
||
|
||
move *a13(plyr_ownball),a1
|
||
jrz #pass ;No ball?
|
||
jrlt #sblk ;Teammate has ball?
|
||
|
||
;
|
||
move *a13(plyr_jmpcnt),a0
|
||
subk 12,a0
|
||
jrlt #pass ;Too soon?
|
||
move *a13(plyr_seq),a0
|
||
cmpi DDUNK_STRT2_SEQ,a0 ;already in seq. ?
|
||
jreq #znub3 ;br=yes
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst DUNK_B,a0
|
||
jrz #znub3
|
||
|
||
btst BUT2_B+8,a6 ;pressed PASS button?
|
||
jrnz #ddnk ;br=yes
|
||
|
||
btst BUT1_B+8,a6 ;pressed SHOOT button?
|
||
jrz #znub3 ;br=no
|
||
#ddnk
|
||
;FIX!!!
|
||
;this should really say something about 'lob pass' to teammate
|
||
|
||
|
||
;Need to "debounce" player shoot button so humans & drones don't do an
|
||
;automatic layup every time you dunk!
|
||
|
||
|
||
;Quick check: If Human is controlling drone, don't allow drone to layup
|
||
;as quickly as a human could. Wait longer before it falls into layup seq.
|
||
move *a13(plyr_num),a0
|
||
move @PSTATUS,a14
|
||
btst a0,a14
|
||
jrnz #norm1
|
||
xori 1,a0
|
||
btst a0,a14
|
||
jrz #norm1
|
||
move *a13(plyr_jmpcnt),a0
|
||
subi 40,a0
|
||
jrlt #pass ;Too soon?
|
||
#norm1
|
||
|
||
|
||
movk LAY_UP,a0
|
||
move a0,@shot_type
|
||
|
||
move *a13(plyr_slam_ticks),a14
|
||
subk 10,a14 ;close to rim ?
|
||
move *a13(plyr_jmpcnt),a0
|
||
sub a0,a14
|
||
jrn #znub3 ;br=too late
|
||
|
||
move *a13(plyr_dir),a7
|
||
movi DDUNK_STRT2_SEQ,a0
|
||
callr plyr_setseq
|
||
jruc #pass
|
||
|
||
#znub3
|
||
move *a8(OYPOS),a1
|
||
move *a13(plyr_aniy),a14
|
||
add a14,a1 ;Ani pt position
|
||
addk 15,a1
|
||
jrlt #chkb1 ;High enough?
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst DUNK_B,a0
|
||
jrnz #slp ;Already started?
|
||
|
||
; btst BUT2_B+8,a6
|
||
; jrnz #dopass ;Air dish off pass?
|
||
|
||
btst SHOOT_B,a0
|
||
jrz #slp
|
||
|
||
move @gmqrtr,a0
|
||
jrnz #shoot2
|
||
|
||
move *a13(plyr_seq),a0
|
||
cmpi QSHOOT_SEQ,a0
|
||
jrz #shoot2
|
||
;Force him to shoot
|
||
movk 5,a0
|
||
move *a13(plyr_num),a1
|
||
calla idiot_box ;Tell him to release ball at peak of jump
|
||
|
||
jruc #shoot2 ;Too low?
|
||
|
||
#chkb1
|
||
|
||
move *a13(plyr_seq),a0
|
||
subk REBOUND_SEQ,a0
|
||
jreq #reb
|
||
subk REBOUNDA_SEQ-REBOUND_SEQ,a0
|
||
jrne #noreb
|
||
#reb
|
||
btst BUT1_B+8,a6
|
||
jrz #noreb ;No press?
|
||
|
||
move *a13(plyr_ohpdist),a14
|
||
;This is for doing a layup out of a rebound
|
||
;He must be near, and be facing hoop
|
||
cmpi 150*DIST_ADDITION,a14
|
||
jrgt #pass ;Too far?
|
||
|
||
move *a13(plyr_ownball),a0
|
||
jrle #pass ;Don't have?
|
||
|
||
move *a13(plyr_ohpdir),a0
|
||
move *a13(plyr_dir),a1
|
||
sub a1,a0
|
||
abs a0
|
||
cmpi >40,a0
|
||
jrle #rdsml
|
||
subi >80,a0
|
||
abs a0
|
||
#rdsml subk 32,a0
|
||
jrgt #pass ;Not between ball and hoop?
|
||
|
||
movk 2,a0
|
||
move a0,@ballptsforshot
|
||
movk FINGER_ROLL,a0
|
||
move a0,@shot_type
|
||
movk LAYUPREB_SEQ,a0
|
||
callr plyr_setseq
|
||
jruc #pass
|
||
|
||
#noreb
|
||
|
||
btst BUT1_B,a6
|
||
jrnz #pass ;Holding shoot button?
|
||
|
||
btst BUT2_B+8,a6
|
||
jrnz #dopass ;Air dish off pass?
|
||
|
||
move *a13(plyr_seqflgs),a0
|
||
btst DUNK_B,a0
|
||
jrnz #slp ;Already started?
|
||
|
||
btst SHOOT_B,a0
|
||
jrz #slp
|
||
|
||
#shoot2
|
||
|
||
|
||
; move *a8(OIMG),a14,L
|
||
; move *a14(IANI2Y),a14
|
||
; jrz #ok_shoot
|
||
;;Player shot seq. has some animation left before we can release ball
|
||
; ANDK 3,a10
|
||
; jruc #pass
|
||
;#ok_shoot
|
||
|
||
|
||
callr plyr_shoot
|
||
movk 1,a10
|
||
jruc #pass
|
||
|
||
|
||
|
||
|
||
#noj move @ballpnum,a0
|
||
jrge #sblk ;Somebody has ball?
|
||
move *a13(plyr_seq),a0
|
||
cmpi RUNDRIBTURB_SEQ,a0
|
||
jrhi #sblk ;Doing something?
|
||
move @ballgoaltcnt,a0
|
||
jrgt #sblk ;Going towards rim?
|
||
move *a13(plyr_balldist),a0
|
||
cmpi 100*DIST_REDUCTION,a0
|
||
jrgt #sblk ;Too far?
|
||
move @ballprcv_p,a1,L
|
||
jrnz #sblk ;Pass in progress?
|
||
move *a13(plyr_seqflgs),a0
|
||
btst NOJUMP_B,a0
|
||
jrnz #sblk ;No jumping?
|
||
move *a13(plyr_autoctrl),a0
|
||
jrnz #sblk ;Temp computer control?
|
||
callr plyr_tryrebound
|
||
move *a13(plyr_seqflgs),a0
|
||
btst NOJUMP_B,a0
|
||
jrnz #slp ;No jumping?
|
||
|
||
|
||
|
||
#sblk
|
||
; move *a13(plyr_seq),a0
|
||
; cmpi LOB_PASS_SEQ,a0
|
||
; jreq #pass
|
||
; btst BUT1_B+8,a6 ;>Shoot/block (But1)
|
||
; jrz #sblk2
|
||
; btst BUT2_B+8,a6 ;pressing shoot and turbo ?
|
||
; jrz #sblk2
|
||
; move *a13(plyr_ownball),a0
|
||
; jrle #slp ;I don't have ball...
|
||
; movi LOB_PASS_SEQ,a0
|
||
; move *a13(plyr_dir),a7
|
||
; callr plyr_setseq ;lob ball to the net!!
|
||
; jruc #slp
|
||
;#sblk2
|
||
btst BUT1_B,a6 ;>Shoot/block (But1)
|
||
jrz #pass
|
||
move *a13(plyr_ownball),a1
|
||
jrn #drnshoot ;br=teammate has ball
|
||
|
||
movk 1,a0
|
||
move *a13(plyr_shtbutn),a14
|
||
cmpi 2,a14
|
||
jrle #scont
|
||
cmpi 9,a14
|
||
jrge #scont
|
||
move *a13(plyr_seq),a0
|
||
cmpi QSHOOT_SEQ,a0
|
||
jrz #dblhit
|
||
cmpi TIP_SEQ,a0
|
||
jrz #dblhit
|
||
cmpi TIPJ_SEQ,a0
|
||
jrz #dblhit
|
||
|
||
clr a0
|
||
; move a0,*a13(plyr_shtbutn)
|
||
; callr plyr_startjmp
|
||
; jruc #pass
|
||
|
||
#scont move a0,*a13(plyr_shtbutn)
|
||
|
||
#alyoop
|
||
move *a13(plyr_seqflgs),a0
|
||
btst NOJUMP_B,a0
|
||
jrnz #pass ;No jumping?
|
||
btst DUNK_B,a0
|
||
jrnz #pass ;Already in a dunk?
|
||
|
||
move *a13(plyr_rcvpass),a0
|
||
jrgt #slp ;Waiting on pass?
|
||
|
||
move *a13(plyr_tmproc_p),a0,L
|
||
move *a0(plyr_rcvpass),a0
|
||
jrgt #slp ;Teammate waiting on pass?
|
||
|
||
callr plyr_startjmp
|
||
jruc #pass
|
||
|
||
#drnshoot ;>Tell drone to shoot
|
||
|
||
;Only have drone shoot on down transition!
|
||
;This is ship day! Is this wise?... No...
|
||
btst BUT1_B+8,a6 ;>Shoot/block (But1)
|
||
jrz #pass
|
||
|
||
; btst BUT3_B,a6
|
||
; jrnz #tshoot ;Turbo override?
|
||
|
||
move *a13(plyr_turbon),a14
|
||
jrnz #alyoop ;br=turbo is on!!
|
||
|
||
;If human just let up on his turbo butn, don't have drone shoot just yet
|
||
;We need to debounce shoot button to avoid accidental drone shots
|
||
;Especially on full court shots!
|
||
|
||
; move *a13(plyr_turbon),a0
|
||
; cmpi 2,a0 ;Ticks sice last turbo button press
|
||
; jrle #pass
|
||
|
||
move @PSTATUS,a0 ;Plyr start bits 0-3
|
||
move *a13(plyr_num),a1
|
||
XORK 1,a1
|
||
btst a1,a0
|
||
jrnz #pass ;Teammate is a human?
|
||
|
||
|
||
;MJT Start
|
||
;Lets ignore button if this is a full court shot and the shot clock and game
|
||
;time are not low.
|
||
;If low, allow stupid full court shot
|
||
|
||
move *a13(plyr_tmproc_p),a0,L
|
||
move *a0(plyr_ohpdist),a14
|
||
cmpi 174h*DIST_ADDITION,a14
|
||
jrlt #cont_shot ;Drone is close enough?
|
||
|
||
|
||
move @game_time,a1,L
|
||
srl 8,a1 ;Remove tenths
|
||
subk 9,a1
|
||
jrlt #cont_shot ;Less than 9 secs?
|
||
;Shot timer 10 or >?
|
||
move @shotimer+16,a1 ;Tens
|
||
jrnz #pass
|
||
; move @shotimer,a1 ;Ones
|
||
; subk 7,a1
|
||
; jrge #pass
|
||
|
||
#cont_shot
|
||
;MJT End
|
||
|
||
|
||
move *a13(plyr_tmproc_p),a0,L
|
||
movk DRN_SHOOT_M,a1
|
||
move a1,*a0(plyr_d_cflgs)
|
||
|
||
move *a0(plyr_ohpdist),a14
|
||
cmpi 350*DIST_ADDITION,a14
|
||
jrlt #pass ;Drone is close enough?
|
||
|
||
move @gmqrtr,a14
|
||
jrnz #pass
|
||
|
||
move *a0(plyr_jmpcnt),a14
|
||
jrnz #pass
|
||
|
||
move *a13(plyr_idiotbit),a14
|
||
btst 1,a14
|
||
jrnz #pass
|
||
addk 2,a14
|
||
move a14,*a13(plyr_idiotbit)
|
||
|
||
movk 4,a0
|
||
move *a13(plyr_num),a1
|
||
calla idiot_box ;Tell drone to shoot ball
|
||
|
||
|
||
|
||
|
||
#pass ;>Pass/steal (But2)
|
||
move *a13(plyr_shtbutn),a0
|
||
jrz #dblhit
|
||
inc a0
|
||
move a0,*a13(plyr_shtbutn)
|
||
#dblhit
|
||
|
||
move *a13(plyr_ownball),a2
|
||
jrz #steal ;No ball?
|
||
|
||
move *a13(plyr_rcvpass),a0
|
||
jrgt #slp ;Waiting on pass?
|
||
|
||
btst BUT2_B+8,a6
|
||
jrz #slp
|
||
move *a13(plyr_seqflgs),a14
|
||
btst PASS_B,a14
|
||
jrnz #slp ;Passing?
|
||
|
||
move @pass_off,a14
|
||
jrnz #slp ;Lockout passing for now?
|
||
|
||
move a2,a2
|
||
jrlt #passtome
|
||
#dopass
|
||
|
||
callr plyr_startpass
|
||
jruc #slp
|
||
|
||
#passtome ;>Tell drone to pass
|
||
btst BUT3_B,a6
|
||
jrnz #steal ;Turbo?
|
||
|
||
move *a13(plyr_tmproc_p),a0,L
|
||
movk DRN_PASS_M,a1
|
||
; btst 6,a6
|
||
; jrz #regds ;No turbo?
|
||
; ori >8000,a1
|
||
#regds move a1,*a0(plyr_d_cflgs)
|
||
jruc #slp
|
||
|
||
|
||
|
||
|
||
#steal
|
||
btst BUT2_B,a6
|
||
jrz #slp ;No button?
|
||
move *a13(plyr_jmpcnt),a0
|
||
jrnz #slp
|
||
move *a13(plyr_seq),a0
|
||
move *a13(plyr_num),a14
|
||
move @pup_nopush,a1
|
||
btst a14,a1
|
||
jrnz #nopush
|
||
btst BUT3_B,a6
|
||
jrnz #push ;Turbo?
|
||
|
||
#nopush
|
||
; cmpi STEALUP_SEQ,a0
|
||
; jreq #slp
|
||
subi STEAL_SEQ,a0
|
||
jreq #slp
|
||
|
||
move *a13(plyr_rcvpass),a0
|
||
jrgt #slp ;Getting pass?
|
||
move *a13(plyr_tmproc_p),a1,L
|
||
move *a1(plyr_rcvpass),a0
|
||
jrgt #slp ;Getting pass?
|
||
|
||
; move *a13(plyr_keeppal),a0 ;Getting up while on fire, on butt
|
||
; jrz #noflames
|
||
; calla seq_stopfire
|
||
;#noflames
|
||
|
||
;FIX!!! Add STEALUP_SEQ here....
|
||
|
||
movi STEAL_SEQ,a0
|
||
; movi STEALUP_SEQ,a0
|
||
callr plyr_setseq
|
||
move *a13(plyr_balldir),*a13(plyr_newdir)
|
||
|
||
jruc #slp
|
||
|
||
#push
|
||
btst BUT2_B+8,a6
|
||
jrz #slp ;No button?
|
||
move *a13(plyr_PDATA_p),a2,L
|
||
move *a2(ply_turbo),a1
|
||
subk (TURBO_CNT*2)/13,a1 ;!!! Min cnt for push
|
||
jrle #slp ;Turbo too low?
|
||
subi PUSH_SEQ,a0
|
||
jreq #slp
|
||
|
||
move *a13(plyr_num),a0 ;If on fire, don't use turbo on push
|
||
move @plyr_onfire,a14
|
||
;; cmp a0,a14
|
||
;; jrz #notingame2
|
||
btst a0,a14
|
||
jrnz #notingame2 ;br=on-fire
|
||
|
||
move a1,*a2(ply_turbo)
|
||
sll 5,a1
|
||
.ref TURBO_52
|
||
addi TURBO_52,a1
|
||
move *a2(ply_meter_imgs+32),a0,L
|
||
move *a1(0),*a0(OSAG),L
|
||
|
||
; subk 8,a1
|
||
; move a1,*a2(ply_turbo)
|
||
; move *a2(ply_meter_imgs+40h),a0,L
|
||
; move *a0(OFSET),a1 ;Shrink meter
|
||
; addk 8,a1
|
||
; move a1,*a0(OFSET)
|
||
|
||
#notingame2
|
||
; calla seq_stopfire
|
||
movi PUSH_SEQ,a0
|
||
callr plyr_setseq
|
||
|
||
#slp
|
||
move *a13(plyr_ownball),a1
|
||
jrle #nob
|
||
callr plyr_setballxyz
|
||
#nob
|
||
|
||
#halted
|
||
callr plyr_headalign
|
||
callr plyr_setshadow
|
||
|
||
; .if DEBUG
|
||
; callr plyr_setgndaligndot
|
||
; .endif
|
||
|
||
SLOOP 1,#lp
|
||
|
||
;--------------------
|
||
; plyr # bit val (1,2,3 or 4,8,C) to tm # bit val (1 or 2)
|
||
|
||
.def pbit_tbit
|
||
.def pbit_tval
|
||
|
||
pbit_tbit
|
||
.byte 0,1,1,1,2,0,0,0
|
||
.byte 2,0,0,0,2,0,0,0
|
||
|
||
; plyr # bit val (1,2,3 or 4,8,C) to tm # val (0 or 1)
|
||
|
||
pbit_tval
|
||
.byte -1, 0, 0, 0, 1,-1,-1,-1
|
||
.byte 1,-1,-1,-1, 1,-1,-1,-1
|
||
|
||
;--------------------
|
||
|
||
; .ref W5ST1
|
||
;; matchup-screen player init
|
||
;; PID,Dir,TLXoff,Z
|
||
;; OIMG
|
||
;#pmatch_t
|
||
; .word P1_PID,3<<4,118,CZMID+106
|
||
; .long W5ST1
|
||
;#pm1 .word P2_PID,3<<4,168,CZMID+64
|
||
; .long W5ST1
|
||
; .word P3_PID,3<<4,242,CZMID+64
|
||
; .long W5ST1
|
||
; .word P4_PID,3<<4,289,CZMID+106
|
||
; .long W5ST1
|
||
; .if DRONES_2MORE
|
||
; .word P5_PID,3<<4,195,CZMID ;last drone on team1
|
||
; .long W5ST1
|
||
; .word P6_PID,3<<4,195,CZMID ;last drone on team2
|
||
; .long W5ST1
|
||
; .endif
|
||
|
||
; tip-off init
|
||
; PID,Dir,TLXoff,Z
|
||
; OIMG
|
||
|
||
#pdat_t .word P1_PID,3<<4,120,CZMID-50
|
||
.long w4stand1
|
||
; .long w3run1
|
||
#pd1 .word P2_PID,2<<4,180,CZMID-5
|
||
.long w3stand1
|
||
; .long w3run1
|
||
.word P3_PID,7<<4,235,CZMID+5
|
||
.long w5stand1
|
||
; .long w3run1
|
||
.word P4_PID,7<<4,280,CZMID+45
|
||
.long w5stand1
|
||
; .long w3run1
|
||
.if DRONES_2MORE
|
||
.word P5_PID,1<<4,120,CZMID+50 ;last drone on team1
|
||
.long w5stand1
|
||
; .long w3run1
|
||
.word P6_PID,5<<4,280,CZMID-50 ;last drone on team2
|
||
.long w5stand1
|
||
; .long w3run1
|
||
.endif
|
||
|
||
.def ltshoepal_t
|
||
ltshoepal_t
|
||
; COLORW 31,31,31, 27,27,27, 22,22,22, 18,18,18
|
||
; COLORW 14,14,14
|
||
.word 07fffh,077bdh,06f7bh
|
||
.word 06739h,05ef7h,05294h
|
||
.word 04a52h,04210h,039ceh
|
||
.word 0318ch,0294ah,02108h
|
||
; .word 018c6h,00c63h,00421h ;Shoes use only 13 colors
|
||
.word 00000h
|
||
;dkshoepal_t
|
||
; COLORW 8,8,8, 6,6,6, 5,5,5, 4,4,4
|
||
; COLORW 2,2,2
|
||
|
||
|
||
#dirc_t .byte 0,0,4<<4,0,6<<4,7<<4,5<<4,0,2<<4,1<<4,3<<4,0,0,0,0,0
|
||
|
||
;;pdta_l .long P1DATA,P2DATA,P3DATA,P4DATA,P5DATA,P6DATA
|
||
|
||
|
||
#sqsnds .long sqk1_snd,sqk2_snd,sqk3_snd,sqk4_snd,sqk5_snd,sqk6_snd
|
||
#sqsnds2
|
||
.long scuf1_snd,scuf2_snd,scuf3_snd,scuf4_snd,scuf2_snd,scuf3_snd
|
||
|
||
#kpball_t
|
||
; .word 100,130,160,190,200,220,280,300,450,550,850
|
||
; .word 190,200,220,280,300,450,550,600,650,650,650
|
||
|
||
.asg 80/100,#reduce
|
||
; .word 100,130,160,190,200,220,280,300,450,450,450
|
||
|
||
.word 100*#reduce,130*#reduce,160*#reduce,190*#reduce
|
||
.word 200*#reduce,220*#reduce,280*#reduce,300*#reduce
|
||
.word 450*#reduce,450*#reduce,450*#reduce
|
||
|
||
#noblflail_t
|
||
; .word 50,65,80,80,80,80,100,130,170,250,250
|
||
.word 85,100,105,110,115,120,150,190,250,250,300
|
||
|
||
#shortfly_t
|
||
.word 50,100,140,160,180,200,250,300,400,550,650
|
||
; .word 140,160,180,200,250,300,400,550,650,650,650
|
||
|
||
#winshortfly_t
|
||
.word 50/2,100/2,100/2,120/2,150/2,150/2,200/2,300/2,450/2,550/2,550/2
|
||
|
||
#flyb_t
|
||
;Extra % chance of allowing losing team to keep ball after being pushed
|
||
;1 pt down up to 15 & over down
|
||
; .word 250,275,300,325,350,375,400,425,450,475,500
|
||
; .word 500,500,500,500,500,500,500,500
|
||
|
||
; .word 25,50,75,100,125,150,175,200,225,250,275
|
||
; .word 275,275,275,275,275,275,275,275,275
|
||
|
||
.asg 80/100,#reduce2
|
||
.word 25*#reduce2,50*#reduce2,75*#reduce2,100*#reduce2,125*#reduce2
|
||
.word 150*#reduce2,175*#reduce2,200*#reduce2,225*#reduce2,250*#reduce2
|
||
.word 275*#reduce2,275*#reduce2,275*#reduce2,275*#reduce2,275*#reduce2
|
||
.word 275*#reduce2,275*#reduce2,275*#reduce2,275*#reduce2,275*#reduce2
|
||
|
||
RED_C .equ 3 ;0 ;No red with blu/blk/prp
|
||
GRN_C .equ 1
|
||
BLU_C .equ 3
|
||
PUR_C .equ 3 ;4 ;No blk/prp
|
||
BLK_C .equ 3
|
||
WHT_C .equ 6
|
||
;YEL_C .equ 7
|
||
.asg >80,I ;Always keeps home colors
|
||
;;;
|
||
;;; updated to account to 30 teams
|
||
;;;
|
||
;;; referenced in BB3 for bench palette build
|
||
;;;
|
||
.def teampal_t
|
||
; 0 ATLANTA
|
||
; 1 BOSTON
|
||
; 2 CHARLOTTE
|
||
; 3 CHICAGO
|
||
; 4 CLEVELAND
|
||
; 5 DALLAS
|
||
; 6 DENVER
|
||
; 7 DETROIT
|
||
; 8 GOLDEN STATE
|
||
; 9 HOUSTON
|
||
; 10 INDIANA
|
||
; 11 LOS ANGELES (CLIPPERS)
|
||
; 12 LOS ANGELES (LAKERS)
|
||
; 13 MIAMI
|
||
; 14 MILWAUKEE
|
||
; 15 MINNESOTA
|
||
; 16 NEW JERSEY
|
||
; 17 NEW YORK
|
||
; 18 ORLANDO
|
||
; 19 PHILADELPHIA
|
||
; 20 PHOENIX
|
||
; 21 PORTLAND
|
||
; 22 SACRAMENTO
|
||
; 23 SAN ANTONIO
|
||
; 24 SEATTLE
|
||
; 25 TORONTO
|
||
; 26 UTAH
|
||
; 27 VANCOUVER
|
||
; 28 WASHINGTON
|
||
|
||
teampal_t
|
||
.byte RED_C,GRN_C,BLU_C,RED_C,BLK_C
|
||
.byte BLU_C,BLK_C,BLU_C,BLU_C,RED_C
|
||
.byte BLK_C,RED_C,PUR_C,BLK_C,PUR_C
|
||
.byte BLU_C,BLU_C,BLU_C,BLK_C,RED_C
|
||
.byte PUR_C,BLK_C,BLK_C,BLK_C,GRN_C
|
||
.byte BLU_C,PUR_C,BLK_C,RED_C,BLK_C
|
||
|
||
|
||
********************************
|
||
* Setup player sequence data
|
||
* A0=Sequence #
|
||
* A7=Dir 0-127
|
||
* A13=*Player process
|
||
* >A10=New ani cnt
|
||
* Trashes scratch
|
||
|
||
SUBR plyr_setseq
|
||
|
||
cmpi TIP_SEQ,a0
|
||
jrnz #bugok
|
||
move @scores,a14,L
|
||
jrz #bugok ;Game start?
|
||
.if DEBUG
|
||
LOCKUP
|
||
.endif
|
||
movk STND_SEQ,a0
|
||
|
||
#bugok
|
||
move a0,*a13(plyr_seq)
|
||
|
||
sll 5,a0 ;*32
|
||
addi pseq_t,a0
|
||
move *a0,a0,L
|
||
move *a0+,a1 ;Get flags
|
||
move a1,*a13(plyr_seqflgs)
|
||
|
||
|
||
btst DRIBBLE_B,a1 ;>Calc new dribble mode
|
||
jrnz #d
|
||
|
||
move *a13(plyr_dribmode),a14
|
||
jrz #n
|
||
movi -1,a1
|
||
jruc #setd
|
||
|
||
#d move *a13(plyr_dribmode),a14
|
||
jrnz #n
|
||
movk 1,a1
|
||
|
||
#setd move a1,*a13(plyr_dribmode)
|
||
#n
|
||
|
||
move *a0+,a1,L ;Get *code
|
||
move a1,*a13(plyr_seqcode_p),L
|
||
move a7,a1 ;Dir
|
||
addk 8,a1 ;Round off
|
||
sll 32-7,a1
|
||
srl 32-7+4,a1 ;Kill frac
|
||
move a1,*a13(plyr_seqdir)
|
||
|
||
clr a14 ;Dir 5-7 have reversed FLIPH
|
||
cmpi 5,a1
|
||
jrlt #nohf
|
||
movi M_FLIPH,a14
|
||
#nohf move a14,*a13(plyr_anirevff)
|
||
|
||
sll 32-3,a1 ;Clr bits
|
||
srl 32-3-5,a1 ;*32
|
||
add a1,a0
|
||
move *a0,a0,L
|
||
move a0,*a13(plyr_ani1st_p),L
|
||
move a0,*a13(plyr_ani_p),L
|
||
|
||
movk 1,a10
|
||
|
||
rets
|
||
|
||
|
||
********************************
|
||
* Delete a players processes and objects
|
||
* A0=Plyr # (0-3)
|
||
|
||
; SUBRP plyr_del
|
||
;
|
||
; PUSH a2,a3
|
||
;
|
||
; move a0,a2
|
||
; move a0,a3
|
||
; sll 5,a3 ;*32
|
||
; addi pdel_t,a3
|
||
;
|
||
; move *a3+,a0
|
||
; calla KIL1C ;Kill process
|
||
;
|
||
; move *a3+,a0
|
||
; calla obj_del1c ;Kill plyr images
|
||
;
|
||
; clr a0
|
||
; sll 5,a2 ;*32
|
||
; movi plyrobj_t,a1
|
||
; add a2,a1
|
||
; move a0,*a1,L
|
||
;
|
||
; addi plyrproc_t,a2
|
||
; move a0,*a2,L
|
||
;
|
||
; PULL a2,a3
|
||
; rets
|
||
;
|
||
;
|
||
;pdel_t .word P1_PID,CLSPLYR|TYPPLYR|SUBPL1
|
||
; .word P2_PID,CLSPLYR|TYPPLYR|SUBPL2
|
||
; .word P3_PID,CLSPLYR|TYPPLYR|SUBPL3
|
||
; .word P4_PID,CLSPLYR|TYPPLYR|SUBPL4
|
||
|
||
|
||
|
||
|
||
#*******************************
|
||
* Update player controls (called by main loop)
|
||
|
||
SUBR joy_read
|
||
|
||
move @GAMSTATE,a0
|
||
subk INGAME,a0
|
||
jrne #x
|
||
move @HALT,a0
|
||
jrnz #x
|
||
move @plyrproc_t,a0,L ;Get 1st plyr proc
|
||
move *a0(plyr_autoctrl),a0
|
||
jrnz #x ;Temp computer control?
|
||
|
||
SUBR joy_read2 ;Called by reftip
|
||
|
||
move @PSTATUS,a0 ;Plyr start bits 0-3
|
||
|
||
.if TUNIT
|
||
|
||
move @TWOPLAYERS,a14 ;!0=2 plyr kit
|
||
jrz #4p
|
||
|
||
movi P2CTRL,a1 ;A1=*PxCTRL
|
||
; move @SWITCH,a2
|
||
move @_switch_addr,a2,L
|
||
move *a2,a2
|
||
|
||
not a2
|
||
|
||
srl 2,a0 ;P2
|
||
jrnc #no2p2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
move a2,a3
|
||
sll 32-8,a3
|
||
srl 32-8,a3
|
||
or a3,a14
|
||
move a14,*a1
|
||
|
||
#no2p2 addk 16,a1 ;P3
|
||
srl 1,a0
|
||
jrnc #x
|
||
zext a2
|
||
srl 8,a2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
or a2,a14
|
||
move a14,*a1
|
||
jruc #x
|
||
#4p ;>4 player version
|
||
movi P1CTRL,a1 ;A1=*PxCTRL
|
||
|
||
; move @SWITCH,a2
|
||
move @_switch_addr,a2,L
|
||
move *a2,a2
|
||
|
||
not a2
|
||
|
||
srl 1,a0 ;P1
|
||
jrnc #nop1
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
move a2,a3
|
||
sll 32-8,a3
|
||
srl 32-8,a3
|
||
or a3,a14
|
||
move a14,*a1
|
||
|
||
#nop1 addk 16,a1 ;P2
|
||
srl 1,a0
|
||
jrnc #nop2
|
||
zext a2
|
||
srl 8,a2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
or a2,a14
|
||
move a14,*a1
|
||
|
||
#nop2
|
||
; move @SWITCH2,a2
|
||
move @_switch2_addr,a2,L
|
||
move *a2,a2
|
||
|
||
not a2
|
||
|
||
addk 16,a1 ;P3
|
||
srl 1,a0
|
||
jrnc #nop3
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
move a2,a3
|
||
sll 32-8,a3
|
||
srl 32-8,a3
|
||
or a3,a14
|
||
move a14,*a1
|
||
|
||
#nop3 srl 1,a0 ;P4
|
||
jrnc #x
|
||
addk 16,a1
|
||
zext a2
|
||
srl 8,a2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
or a2,a14
|
||
move a14,*a1
|
||
|
||
.else ;>YUNIT
|
||
|
||
move @SWITCH,a2,L
|
||
not a2
|
||
|
||
srl 1,a0 ;P1
|
||
jrnc #nop1
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
move a2,a3
|
||
sll 32-8,a3
|
||
srl 32-8,a3
|
||
or a3,a14
|
||
move a14,*a1
|
||
|
||
#nop1 addk 16,a1 ;P2
|
||
srl 8,a2
|
||
srl 1,a0
|
||
jrnc #nop2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
move a2,a3
|
||
sll 32-8,a3
|
||
srl 32-8,a3
|
||
or a3,a14
|
||
move a14,*a1
|
||
|
||
#nop2 addk 16,a1 ;P3
|
||
srl 1,a0
|
||
jrnc #nop3
|
||
srl 16,a2
|
||
move a2,a14 ;>Move bit 7 to 6 (But 3)
|
||
sll 32-6,a2
|
||
srl 7,a14
|
||
or a14,a2
|
||
rl 6,a2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
or a2,a14
|
||
move a14,*a1
|
||
|
||
#nop3 srl 1,a0 ;P4
|
||
jrnc #x
|
||
move @SWITCH+>20,a2
|
||
not a2
|
||
addk 16,a1
|
||
sll 32-8,a2
|
||
srl 32-8,a2
|
||
move *a1,a14
|
||
xor a2,a14 ;New with old. Changed bits are now on
|
||
and a2,a14 ;Keep down transitions
|
||
sll 8,a14
|
||
or a2,a14
|
||
move a14,*a1
|
||
|
||
|
||
.endif
|
||
|
||
#x
|
||
rets
|
||
|
||
; .if 0
|
||
; move @GAMSTATE,a0
|
||
; subk INGAME,a0
|
||
; jrne #x
|
||
; move @HALT,a0
|
||
; jrnz #x
|
||
; move @plyrproc_t,a0,L ;Get 1st plyr proc
|
||
; move *a0(plyr_autoctrl),a0
|
||
; jrnz #x ;Temp computer control?
|
||
;
|
||
; SUBRP joy_read2 ;Called by reftip
|
||
;
|
||
; move @PSTATUS,a0 ;Plyr start bits 0-3
|
||
; movi P1CTRL,a1 ;A1=*PxCTRL
|
||
;
|
||
; .if TUNIT
|
||
;
|
||
; move @SWITCH,a2
|
||
; not a2
|
||
;
|
||
; srl 1,a0 ;P1
|
||
; jrnc #nop1
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; move a2,a3
|
||
; sll 32-8,a3
|
||
; srl 32-8,a3
|
||
; or a3,a14
|
||
; move a14,*a1
|
||
;
|
||
;#nop1 addk 16,a1 ;P2
|
||
; srl 1,a0
|
||
; jrnc #nop2
|
||
; zext a2
|
||
; srl 8,a2
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; or a2,a14
|
||
; move a14,*a1
|
||
;
|
||
;#nop2
|
||
; move @SWITCH2,a2
|
||
; not a2
|
||
;
|
||
; addk 16,a1 ;P3
|
||
; srl 1,a0
|
||
; jrnc #nop3
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; move a2,a3
|
||
; sll 32-8,a3
|
||
; srl 32-8,a3
|
||
; or a3,a14
|
||
; move a14,*a1
|
||
;
|
||
;#nop3 srl 1,a0 ;P4
|
||
; jrnc #x
|
||
; addk 16,a1
|
||
; zext a2
|
||
; srl 8,a2
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; or a2,a14
|
||
; move a14,*a1
|
||
;
|
||
; .else
|
||
;
|
||
; move @SWITCH,a2,L
|
||
; not a2
|
||
;
|
||
; srl 1,a0 ;P1
|
||
; jrnc #nop1
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; move a2,a3
|
||
; sll 32-8,a3
|
||
; srl 32-8,a3
|
||
; or a3,a14
|
||
; move a14,*a1
|
||
;
|
||
;#nop1 addk 16,a1 ;P2
|
||
; srl 8,a2
|
||
; srl 1,a0
|
||
; jrnc #nop2
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; move a2,a3
|
||
; sll 32-8,a3
|
||
; srl 32-8,a3
|
||
; or a3,a14
|
||
; move a14,*a1
|
||
;
|
||
;#nop2 addk 16,a1 ;P3
|
||
; srl 1,a0
|
||
; jrnc #nop3
|
||
; srl 16,a2
|
||
; move a2,a14 ;>Move bit 7 to 6 (But 3)
|
||
; sll 32-6,a2
|
||
; srl 7,a14
|
||
; or a14,a2
|
||
; rl 6,a2
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; or a2,a14
|
||
; move a14,*a1
|
||
;
|
||
;#nop3 srl 1,a0
|
||
; jrnc #x
|
||
; move @SWITCH+>20,a2
|
||
; not a2
|
||
; addk 16,a1
|
||
; sll 32-8,a2
|
||
; srl 32-8,a2
|
||
; move *a1,a14
|
||
; xor a2,a14 ;New with old. Changed bits are now on
|
||
; and a2,a14 ;Keep down transitions
|
||
; sll 8,a14
|
||
; or a2,a14
|
||
; move a14,*a1
|
||
;
|
||
;
|
||
; .endif
|
||
;
|
||
;#x
|
||
; rets
|
||
;
|
||
; .endif
|
||
|
||
#*******************************
|
||
* Check for collision with opponent players
|
||
* A8=*Obj
|
||
* A13=*Player process
|
||
* Trashes scratch
|
||
|
||
.asg 1,BABY_DETECT
|
||
|
||
SUBRP plyr_chkpcollide
|
||
|
||
PUSH a2,a3,a4,a5,a6,a7,a9,a10,a11
|
||
|
||
move *a8(OXPOS),a4
|
||
move *a8(OXANI+16),a5
|
||
add a5,a4 ;Img center X
|
||
move a4,a5 ;Copy for X box rgt
|
||
move *a8(OZPOS),a6 ;A6=my Z
|
||
|
||
move *a8(OSIZEX),a2 ;Get SIZEX & bump up if small img
|
||
move *a8(OIMG),a0,L
|
||
move *a0(IFLAGS),a14 ;Large img? Yes if !-
|
||
jrnn #pcc_1
|
||
move a2,a14 ;Small img
|
||
srl 2,a14
|
||
add a14,a2 ;=125%
|
||
#pcc_1
|
||
; move *a0(ICBZ),a11 ;A11=Z radius
|
||
; jrnz #pcc_2
|
||
; movk 13,a11 ;stupid K!!!A11=Z radius
|
||
movk 13*2,a11 ;stupid K!!!A11=Z radius (for both)
|
||
;#pcc_2
|
||
.if BABY_DETECT
|
||
move @pup_baby,a14 ;Plyr babies? No if 0
|
||
jrz #pcc_3
|
||
srl 1,a2 ;Yes. Half of X & Z ranges
|
||
srl 1,a11
|
||
#pcc_3
|
||
.endif
|
||
srl 1+1,a2 ;Half for lft/rgt, more to tighten up
|
||
sub a2,a4 ;A4=my box lft X
|
||
add a2,a5 ;A5=my box rgt X
|
||
|
||
movi plyrobj_t,a7 ;Set ptr to other team
|
||
move *a13(plyr_num),a0
|
||
subk 2,a0
|
||
jrge #pcc_4
|
||
addi 64,a7
|
||
#pcc_4
|
||
movk 2,b1 ;Lp cnt
|
||
|
||
;--------------------
|
||
; top of test loop
|
||
|
||
#lp move *a7+,a9,L
|
||
|
||
move *a9(OZPOS),a2 ;Chk Z
|
||
sub a6,a2
|
||
abs a2 ;A2=ABS(dZ)
|
||
; move *a9(OIMG),a0,L
|
||
; move *a0(ICBZ),a3 ;Get Z radius
|
||
; jrnz #pcc_l1
|
||
; movk 13,a3 ;stupid K!!!A11=Z radius
|
||
;#pcc_l1
|
||
; .if BABY_DETECT
|
||
; move @pup_baby,a14 ;Plyr babies? No if 0
|
||
; jrz #pcc_l2
|
||
; srl 1,a3 ;Yes. Half of Z range
|
||
;#pcc_l2
|
||
; .endif
|
||
; add a11,a3
|
||
move a11,a3 ;!!!Replaces previous comments
|
||
cmp a3,a2 ;Z in range? No if >=
|
||
jrge #next
|
||
|
||
move *a9(OXPOS),a1 ;Chk X
|
||
move *a9(OXANI+16),a2
|
||
add a2,a1 ;Img center X
|
||
move *a9(OSIZEX),a2 ;Get SIZEX & bump up if small img
|
||
move *a9(OIMG),a0,L
|
||
move *a0(IFLAGS),a14 ;Large img? Yes if !-
|
||
jrnn #pcc_l3
|
||
move a2,a14 ;Small img
|
||
srl 2,a14
|
||
add a14,a2 ;=125%
|
||
#pcc_l3
|
||
.if BABY_DETECT
|
||
move @pup_baby,a14 ;Plyr babies? No if 0
|
||
jrz #pcc_l4
|
||
srl 1,a2 ;Yes. Half of X range
|
||
#pcc_l4
|
||
.endif
|
||
srl 1+1,a2 ;Half for lft/rgt, more to tighten up
|
||
add a2,a1 ;A1=his box rgt
|
||
sub a4,a1 ;His rgt > my lft? No if <=
|
||
jrle #next
|
||
move a1,a10 ;A10=his rgt,my lft dX
|
||
add a4,a1
|
||
sub a2,a1
|
||
sub a2,a1 ;A1=his box lft
|
||
sub a5,a1 ;His lft < my rgt? No if >=
|
||
jrge #next
|
||
|
||
abs a1 ;Make A10=ABS(nearer dX)
|
||
cmp a1,a10
|
||
jrle #pcc_l5
|
||
move a1,a10
|
||
#pcc_l5
|
||
move *a8(OYPOS),a0 ;Chk Y
|
||
move *a9(OYPOS),a1
|
||
addi 75,a1 ;stupid K!!! Y difference
|
||
cmp a1,a0
|
||
jrgt #next ;Opponent much higher?
|
||
|
||
;---------- Detected
|
||
|
||
move *a8(OXVEL),a14,L ;>Outer box collision
|
||
abs a14
|
||
srl 15,a14
|
||
jrnz #otrbnc ;Moving in X? Yes if !0
|
||
move *a8(OZVEL),a2,L
|
||
abs a2
|
||
srl 15,a2
|
||
jrz #chkib ;Not moving in Z? Yes if 0
|
||
#otrbnc
|
||
PUSH a6,a7
|
||
clr a0
|
||
clr a1
|
||
move *a8(OXVEL),a6,L
|
||
move *a8(OZVEL),a7,L
|
||
callr seekdir_xyxy128 ;Customize?
|
||
PULL a6,a7
|
||
|
||
move *a13(plyr_num),a2
|
||
sll 2,a2 ;*4
|
||
move *a9(OPLINK),a1,L
|
||
move *a1(plyr_num),a1
|
||
add a1,a2
|
||
sll 4,a2 ;*16
|
||
addi #c_t,a2
|
||
move *a2,a2 ;Get my dir variable offset
|
||
add a13,a2
|
||
move *a2,a2 ;Get dir
|
||
|
||
sub a0,a2
|
||
move a2,a14
|
||
abs a14
|
||
cmpi >40,a14
|
||
jrle #dsml
|
||
neg a2
|
||
#dsml move a2,a2
|
||
jrge #angpos ;Positive angle?
|
||
addi >28+>28,a0
|
||
#angpos subi >28,a0
|
||
|
||
addk 4,a0
|
||
sll 32-7,a0
|
||
srl 32-7+3,a0 ;Leave 4 bits
|
||
sll 4,a0
|
||
addi #vel_t,a0
|
||
|
||
move *a0,a1
|
||
move *a0(16*4),a0
|
||
sll 1,a0
|
||
sll 1,a1
|
||
move *a8(OXVAL),a14,L
|
||
add a0,a14
|
||
move a14,*a8(OXVAL),L
|
||
move *a8(OZVAL),a14,L
|
||
add a1,a14
|
||
move a14,*a8(OZVAL),L
|
||
|
||
#chkib
|
||
movk 6,a2 ;stupid K!!!Inner box delta
|
||
.if BABY_DETECT
|
||
move @pup_baby,a14 ;Plyr babies? No if 0
|
||
jrz #pcc_ib1
|
||
srl 1,a2 ;Yes. Half of delta
|
||
#pcc_ib1
|
||
.endif
|
||
sub a2,a10 ;X touch only slight?
|
||
jrle #next
|
||
|
||
move *a9(OZPOS),a1
|
||
sub a6,a1
|
||
abs a1 ;Z distance
|
||
sub a2,a3
|
||
cmp a3,a1 ;Z touch only slight? Yes if >=
|
||
jrge #next
|
||
|
||
move *a8(OXVEL),a14,L ;>Inner box collision
|
||
move *a9(OXVEL),a2,L
|
||
move a2,a3
|
||
xor a14,a2
|
||
move a2,a2
|
||
jrn #xvdif ;XV different dir?
|
||
move a14,a0
|
||
abs a3
|
||
abs a0
|
||
cmp a3,a0
|
||
jrlt #skipxv ;My vel smaller?
|
||
xor a14,a2 ;Fix A2
|
||
sub a2,a14
|
||
#xvdif
|
||
move *a8(OXVAL),a1,L
|
||
sub a14,a1
|
||
move a1,*a8(OXVAL),L
|
||
#skipxv
|
||
move *a8(OZVEL),a14,L
|
||
move *a9(OZVEL),a2,L
|
||
move a2,a3
|
||
xor a14,a2
|
||
move a2,a2
|
||
jrn #zvdif ;ZV different dir?
|
||
move a14,a0
|
||
abs a3
|
||
abs a0
|
||
cmp a3,a0
|
||
jrlt #next ;My vel smaller?
|
||
xor a14,a2 ;Fix A2
|
||
sub a2,a14
|
||
#zvdif
|
||
move *a8(OZVAL),a1,L
|
||
sub a14,a1
|
||
move a1,*a8(OZVAL),L
|
||
|
||
|
||
move *a13(plyr_ownball),a0
|
||
jrgt #next ;I have ball?
|
||
|
||
move *a13(plyr_stagcnt),a10 ;>Add some stagger
|
||
move *a9(OPLINK),a14,L
|
||
|
||
move *a14(plyr_seqflgs),a0
|
||
btst DUNK_B,a0
|
||
jrz #nodunk ;!Dunking?
|
||
|
||
;This dunker may not have the ball! Do I own it?
|
||
move *a14(plyr_num),a2
|
||
move @ballpnum,a3
|
||
cmp a2,a3
|
||
jrnz #nodunk
|
||
|
||
btst LAYUP_B,a0
|
||
jrnz #nodunk ;Layup=don't disrupt ball
|
||
|
||
addk 1,a10
|
||
move *a13(plyr_num),a0
|
||
move *a14(plyr_num),a2
|
||
srl 1,a0
|
||
srl 1,a2
|
||
cmp a0,a2
|
||
jreq #nodunk ;Same team?
|
||
|
||
move *a13(plyr_jmpcnt),a0
|
||
jrz #nopop
|
||
move *a8(OYPOS),a0
|
||
move *a9(OYPOS),a1
|
||
addk 9,a1 ;15
|
||
|
||
cmp a1,a0
|
||
jrgt #nopop ;Dunker is higher?
|
||
|
||
|
||
move @slamming,a0 ;Ball already successfully into hoop
|
||
jrnz #nopop
|
||
|
||
move @HCOUNT,a0
|
||
sll 32-4,a0
|
||
jrnz #noflsh
|
||
|
||
calla flash_reward
|
||
|
||
#noflsh
|
||
;Shawn, this % should also key off from ptsdown. The % should never get
|
||
;higher, but maybe get a bit lower for the good team?
|
||
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_DEFSKILL),a0
|
||
sll 4,a0
|
||
addi tryblk_t,a0
|
||
move *a0,a0
|
||
|
||
; movk 22,a0 ;38,25,21,19
|
||
|
||
|
||
move *a13(plyr_num),a14
|
||
|
||
; move @plyr_onfire,a3
|
||
; btst a14,a3
|
||
; jrz #nofire ;br=not on-fire
|
||
;;This guy on fire
|
||
; movi 75,a0
|
||
;#nofire
|
||
|
||
move @PSTATUS,a3
|
||
btst a14,a3
|
||
jrnz #cont
|
||
movk 18,a0 ;Drone is less
|
||
#cont
|
||
|
||
calla RNDPER
|
||
jrls #nopop
|
||
|
||
; movk >1f,a0
|
||
; callr rnd
|
||
; jrnz #nopop
|
||
|
||
|
||
move a13,a3
|
||
calla def_play_reward ;Good defensive play reward snds, etc
|
||
|
||
;If player is still going up, give him ball, otherwise, maybe disrupt dunk
|
||
|
||
move *a13(plyr_seq),a0
|
||
cmpi BLOCKREJ_SEQ,a0
|
||
jreq #disrupt
|
||
cmpi FASTBLOCKREJ_SEQ,a0
|
||
jreq #disrupt
|
||
|
||
movi 200,a0
|
||
calla RNDPER
|
||
jrhi #disrupt
|
||
|
||
move *a8(OYVEL),a0,L
|
||
jrn #gvbl
|
||
|
||
#disrupt
|
||
;If coming down, disrupt ball
|
||
|
||
; movi 200,a0
|
||
; calla RNDPER
|
||
; jrhi #gvbl
|
||
|
||
;Probably want to give swatter the ball if this is a rebound!
|
||
;Check goaltcnt?
|
||
|
||
.ref deflected_speech
|
||
calla deflected_speech
|
||
|
||
move *a13(plyr_dir),a0
|
||
calla sinecos_get
|
||
|
||
move @ballobj_p,a2,L
|
||
|
||
sll 4,a0
|
||
sll 4,a1
|
||
move a0,*a2(OZVEL),L
|
||
move a1,*a2(OXVEL),L
|
||
movi -GRAV*21,a1 ;Towards roof
|
||
move a1,*a2(OYVEL),L
|
||
|
||
movi -1,a0
|
||
move a0,@ballpnum
|
||
move a0,@ballpnumlast
|
||
|
||
calla ball_convfmprel
|
||
|
||
move *a9(OPLINK),a14,L
|
||
|
||
clr a0
|
||
move a0,*a14(plyr_ownball)
|
||
move a0,@ballbbhitcnt
|
||
|
||
movk 15,a0
|
||
move a0,*a13(plyr_shtdly)
|
||
move a0,*a14(plyr_shtdly)
|
||
|
||
jruc #nopop
|
||
|
||
#gvbl
|
||
.ref in_air_steal_speech
|
||
calla in_air_steal_speech
|
||
|
||
move *a13(plyr_num),a0 ;Give defender the ball
|
||
move a0,@ballpnum
|
||
clr a0
|
||
move a0,*a13(plyr_dribmode)
|
||
move a0,@ballbbhitcnt
|
||
|
||
; movi steal_snd,a0
|
||
; calla snd_play1
|
||
|
||
#nopop
|
||
; move @plyrcharge,a0
|
||
; addk 1,a0
|
||
; move a0,@plyrcharge
|
||
|
||
#nodunk move *a14(plyr_jmpcnt),a3
|
||
jrz #ongnd
|
||
addk 1,a10 ;Collided with a jumper
|
||
#ongnd
|
||
move *a13(plyr_seqflgs),a2
|
||
btst EASYSTAG_B,a2
|
||
jrz #nesy ;!An easy stagger?
|
||
move *a13(plyr_num),a0
|
||
move *a14(plyr_num),a2
|
||
srl 1,a0
|
||
srl 1,a2
|
||
cmp a0,a2
|
||
jreq #setstg ;Same team?
|
||
addk 1,a10
|
||
#nesy
|
||
#setstg move a10,*a13(plyr_stagcnt)
|
||
|
||
#next dsj b1,#lp
|
||
|
||
|
||
#x PULL a2,a3,a4,a5,a6,a7,a9,a10,a11
|
||
rets
|
||
|
||
tryblk_t
|
||
.word 1,2,3,10,15,18,22,23,24,25,25
|
||
|
||
#c_t .word 0,plyr_tmdir,plyr_o1dir,plyr_o2dir
|
||
.word plyr_tmdir,0,plyr_o1dir,plyr_o2dir
|
||
.word plyr_o1dir,plyr_o2dir,0,plyr_tmdir
|
||
.word plyr_o1dir,plyr_o2dir,plyr_tmdir,0
|
||
|
||
#vel_t
|
||
.word -16384,-15137,-11585,-6270
|
||
.word 0,6270,11585,15137,16384,15137,11585,6270
|
||
.word 0,-6269,-11585,-15137,-16384,-15137,-11585,-6270
|
||
|
||
|
||
|
||
#*******************************
|
||
* Change the players image
|
||
* A0=*New image
|
||
* A1=New OCTRL (low 8 bits)
|
||
* A8=*Obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2,A3
|
||
|
||
SUBRP plyr_ani
|
||
|
||
cmpi ROM,a0
|
||
jrlo #anierr
|
||
|
||
move a0,a2
|
||
move a1,a3
|
||
callr anipt_getsclxy ;get old XY ani's
|
||
|
||
move a2,*a8(OIMG),L
|
||
movb a3,*a8(OCTRL)
|
||
move *a2(ISIZE),*a8(OSIZE),L
|
||
move *a2(ISAG),*a8(OSAG),L
|
||
|
||
move *a13(plyr_attrib_p),a3,L
|
||
move *a3,a3,L ;Get *scale_t
|
||
move @pup_baby,a14 ;Plyr babies? No if 0
|
||
jrz #pa_1
|
||
movi scalebaby_t,a3 ;Yes. Set baby *scale_t
|
||
#pa_1
|
||
move *a2(IFLAGS),a14 ;Large img? Yes if !-
|
||
jrnn #cont
|
||
addi scale_t_size,a3 ;No. Set small img *scale_t
|
||
#cont
|
||
move a3,*a8(ODATA_p),L ;Save *scale_t
|
||
|
||
move a0,a2 ;save old XY ani's
|
||
move a1,a3
|
||
callr anipt_getsclxy ;get new XY ani's
|
||
|
||
sub a0,a2 ;subtract new from old
|
||
sub a1,a3
|
||
|
||
move a0,*a8(OXANI),L ;save new X ani
|
||
sra 16,a1 ;Y ani int only
|
||
move a1,*a13(plyr_aniy) ;save new Y ani
|
||
|
||
move a8,a0 ;set XVAL base addr
|
||
addi OXVAL,a0
|
||
move *a0,a14,L ;mod XVAL with diff of old X ani to
|
||
add a2,a14 ; new X ani
|
||
move a14,*a0+,L
|
||
move *a0,a14,L ;mod YVAL with diff of old Y ani to
|
||
add a3,a14 ; new Y ani
|
||
move a14,*a0,L
|
||
|
||
#x rets
|
||
|
||
#anierr
|
||
.if DEBUG
|
||
LOCKUP
|
||
eint
|
||
.else
|
||
CALLERR 2,2
|
||
.endif
|
||
jruc #x
|
||
|
||
|
||
|
||
#*******************************
|
||
* Start player jumping (block, shoot, dunk)
|
||
* A1=Shot distance
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A5
|
||
|
||
SUBRP plyr_startjmp
|
||
|
||
PUSH a6,a7,a9
|
||
|
||
move *a13(plyr_ownball),a5
|
||
jrz #blk ;We don't have ball?
|
||
|
||
move *a13(plyr_ohoopx),a6
|
||
movi CZMID,a7
|
||
callr seekdirdist_obxz128
|
||
|
||
move *a13(plyr_newdir),a9 ;Get old
|
||
move a0,*a13(plyr_newdir) ;Turn toward basket
|
||
|
||
move a5,a5
|
||
jrn #tag1 ;trick shot shit
|
||
; jrlt #blkd ;Teammate has ball?
|
||
|
||
clr a14
|
||
move a14,@reduce_3ptr
|
||
|
||
cmpi 1b0h,a1 ;400+15%;!!!Desperation shot?
|
||
jrge #desp ; br=yes
|
||
|
||
cmpi 136h,a1 ;270+15%;!!!Long 3ptr?
|
||
jrge #3ptr ; br=yes
|
||
|
||
cmpi 0c0h,a1 ;200+15%;!!!Hook allowed?
|
||
jrge #tag1
|
||
|
||
;Attempt a hook from the top of scrn down toward hoop
|
||
;Must be near top of scrn, near baseline, and running in same dir
|
||
;for at least several ticks.
|
||
move *a8(OZPOS),a0
|
||
movi CZMID,a14
|
||
sub a0,a14
|
||
;Don't allow this hook from 3pt range
|
||
cmpi 110,a14
|
||
jrgt #tag1 ;Near 3 pt range?
|
||
cmpi 70,a14
|
||
jrgt #yes0
|
||
;Yes, I am near top of scrn
|
||
|
||
|
||
;Attempt a hook from the bottom of scrn up toward hoop
|
||
;Must be near bottom of scrn, near baseline, and running in same dir
|
||
;for at least several ticks.
|
||
; move *a8(OZPOS),a0
|
||
subi CZMID,a0
|
||
cmpi 70,a0
|
||
jrlt #tryhk2
|
||
;Don't allow this hook from 3pt range
|
||
cmpi 98h,a0
|
||
jrgt #tag1 ;Near 3 pt range?
|
||
;Yes, I am near bottom of scrn
|
||
|
||
#yes0
|
||
move *a13(plyr_seqdir),a14
|
||
cmpi 2,a14
|
||
jrz #tryhk1
|
||
cmpi 6,a14
|
||
jrnz #tryhk2
|
||
|
||
#tryhk1
|
||
;Player is running horizontally
|
||
;Is he near near baseline?
|
||
movi WRLDMID,a0
|
||
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrnz #reg ;Team1?
|
||
|
||
move *a8(OXPOS),a14
|
||
sub a0,a14
|
||
; abs a14
|
||
cmpi 110h,a14 ;160
|
||
jrlt #tryhk2
|
||
jruc #yes
|
||
#reg
|
||
move *a8(OXPOS),a14
|
||
sub a14,a0
|
||
; abs a0
|
||
cmpi 140h,a0 ;160
|
||
jrlt #tryhk2
|
||
#yes
|
||
;Yes, near baseline
|
||
move *a13(plyr_dirtime),a14
|
||
subk 5,a14
|
||
jrlt #tryhk2
|
||
;Yes, I've been running in this dir for awhile!
|
||
|
||
move a9,*a13(plyr_newdir) ;Turn toward basket
|
||
|
||
jruc #hs ;Hook shot
|
||
|
||
|
||
#tryhk2
|
||
|
||
;Attempt a running in #2 dir hook from near the top of scrn up toward hoop
|
||
;Must be past CRTMID, far away from baseline, and running in same #2 dir
|
||
;for at least several ticks.
|
||
move *a8(OZPOS),a0
|
||
cmpi CZMID,a0
|
||
jrgt #tryhk3
|
||
;Yes, I am above CRTMID
|
||
|
||
|
||
move *a13(plyr_seqdir),a14
|
||
cmpi 1,a14
|
||
jrz #tryhk2a
|
||
cmpi 7,a14
|
||
jrnz #tryhk3
|
||
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrnz #tryhk2a ;Team1?
|
||
;Yes team 1
|
||
movk 10h,a9 ;Fix wrong way hookshot!
|
||
|
||
#tryhk2a
|
||
;Player is running up at a diagonal
|
||
;Is he near near baseline?
|
||
move *a13(plyr_ohpdist),a14
|
||
cmpi 60h,a14 ;out farther...fade away
|
||
jrhs #tryhk3
|
||
movi WRLDMID,a0
|
||
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrnz #rega ;Team1?
|
||
|
||
move *a8(OXPOS),a14
|
||
sub a0,a14
|
||
cmpi 140h,a14 ;160
|
||
jrgt #tryhk3
|
||
jruc #yesa
|
||
#rega
|
||
move *a8(OXPOS),a14
|
||
sub a14,a0
|
||
cmpi 140h,a0 ;160
|
||
jrgt #tryhk3
|
||
#yesa
|
||
;Yes, far enough away from baseline
|
||
move *a13(plyr_dirtime),a14
|
||
subk 5,a14
|
||
jrlt #tryhk3
|
||
;Yes, I've been running in this dir for awhile!
|
||
|
||
move a9,*a13(plyr_newdir) ;Turn toward basket
|
||
|
||
jruc #hs ;Hook shot
|
||
|
||
|
||
#tryhk3
|
||
|
||
;Attempt a #1 or #5 dir hook (Running vertically)
|
||
move *a13(plyr_seqdir),a14
|
||
jrz #ahook
|
||
subk 4,a14
|
||
jrne #tag1
|
||
#ahook
|
||
move *a13(plyr_ohpdir),a14
|
||
addk 8,a14 ;Round off
|
||
sll 32-7,a14
|
||
srl 32-7+4,a14 ;Kill frac
|
||
jrz #tag1
|
||
cmpi 4,a14
|
||
jrz #tag1
|
||
|
||
|
||
|
||
move *a13(plyr_num),a2
|
||
srl 1,a2
|
||
jrz #tg1 ;Team1?
|
||
cmpi 5,a14
|
||
jrlt #tag1 ;Team 2 behind hoop
|
||
jruc #tgx
|
||
#tg1 cmpi 4,a14
|
||
jrge #tag1
|
||
#tgx
|
||
|
||
|
||
|
||
move *a13(plyr_ohpdist),a14
|
||
cmpi 40h,a14 ;48h
|
||
jrlt #tag1 ;Too close for hook?
|
||
move *a8(OZPOS),a14
|
||
cmpi >448,a14
|
||
jrlt #tag1
|
||
cmpi >4a8,a14
|
||
jrgt #tag1
|
||
;Okay to do hook!
|
||
|
||
move a9,*a13(plyr_newdir) ;Turn toward basket
|
||
jruc #hs ;Hook shot
|
||
|
||
#tag1
|
||
|
||
move *a13(plyr_newdir),a0
|
||
move a0,a3
|
||
move a1,a4 ;A1=Distance to hoop for shot
|
||
;>Skip dunks from behind the hoop
|
||
addk 8,a0 ;Round off
|
||
sll 32-7,a0
|
||
srl 32-3,a0 ;Kill frac
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrnz #lhoop ;Team2?
|
||
subk 5,a0
|
||
jrlt #trydunk
|
||
#tag1a
|
||
move *a13(plyr_ownball),a5
|
||
jrp #sj ;br=teammate doesn't have ball
|
||
#tag1b move a9,*a13(plyr_newdir) ;Turn toward basket
|
||
jruc #x
|
||
|
||
|
||
;If behind hoop, I will try to do a hook shot...
|
||
|
||
#lhoop move a0,a0
|
||
jrz #trydunk
|
||
subk 4,a0
|
||
jrlt #tag1a ;br=no dunk
|
||
; jrlt #sj
|
||
|
||
|
||
#trydunk ;>Try a dunk
|
||
move *a13(plyr_ownball),a5
|
||
jrnn #td2 ;br=teammate doesn't have ball
|
||
cmpi 65,a4 ;too close for alleyoop ?
|
||
jrle #tag1b ;br=yes...do nothing
|
||
jruc #td2a
|
||
|
||
#td2
|
||
cmpi 42,a4 ;ADJ'd for new COURT SIZE
|
||
; cmpi 53,a4 ;ADJ'd for new COURT SIZE
|
||
; cmpi 60,a4
|
||
jrle #velok ;Close to hoop, Allow dunk!! w/o turbo
|
||
|
||
#td2a
|
||
move *a13(plyr_dir),a14
|
||
sub a3,a14
|
||
abs a14
|
||
cmpi >40,a14
|
||
jrle #nodov
|
||
subi >80,a14
|
||
abs a14
|
||
#nodov
|
||
subk 24,a14
|
||
jrgt #sj ;!Facing basket?
|
||
|
||
move *a13(plyr_PDATA_p),a14,L
|
||
move *a14(ply_turbo),a14
|
||
subk 3,a14 ;!!! Min cnt for dunk
|
||
jrle #sj ;Turbo too low?
|
||
|
||
;Shawn, stop dunker if he just made a real quick move. Should we do this?
|
||
; move *a13(plyr_dirtime),a14
|
||
; subk 4,a14
|
||
; jrgt #dnk_ok
|
||
; nop
|
||
; jruc #sj
|
||
;
|
||
;#dnk_ok
|
||
|
||
cmpi 165,a4 ;Max dunk range (ADJ'd for new COURT)
|
||
; cmpi 170,a4 ;Max dunk range
|
||
jrge #sj ;Too far for dunk?
|
||
move *a8(OZPOS),a14 ;Chk Z range
|
||
cmpi CZMAX-34,a14
|
||
jrhs #sj
|
||
cmpi CZMIN+34,a14
|
||
jrls #sj
|
||
move *a8(OXVEL),a14,L ;>Chk velocity
|
||
abs a14
|
||
srl 16,a14
|
||
jrnz #velok
|
||
move *a8(OZVEL),a14,L
|
||
abs a14
|
||
srl 16,a14
|
||
jrz #sj
|
||
#velok
|
||
move *a13(plyr_ownball),a5
|
||
jrn #aly1 ;alleyoop
|
||
|
||
;Perhaps allow big guys to dunk through anybody!
|
||
move *a13(plyr_attrib_p),a0,L
|
||
move *a0(PAT_POWER),a0
|
||
sll 4,a0
|
||
addi dnkthru_t,a0
|
||
move *a0,a0
|
||
calla RNDPER
|
||
jrhi #dunk ;Yes, jump over anybody!
|
||
|
||
; movk 7,a0 ;12%
|
||
; callr rnd
|
||
; jrz #dunk ;Ignore opponents?
|
||
|
||
#aly1
|
||
;Get opponents defense of dunks info
|
||
movi 64,a7
|
||
move *a13(plyr_num),a14
|
||
cmpi 2,a14
|
||
jrlt #tm1
|
||
clr a7
|
||
#tm1
|
||
movi plyrproc_t,a14,L
|
||
add a7,a14
|
||
move *a14,a14,L
|
||
|
||
|
||
|
||
|
||
move *a14(plyr_num),a7
|
||
move @plyr_onfire,a0
|
||
;; cmp a0,a7
|
||
;; jrnz #nof1
|
||
btst a7,a0
|
||
jrz #nof1 ;br=not on-fire
|
||
;This defender is on fire! Make his defense of dunkers the best!
|
||
movk 11,a0
|
||
jruc #gdd
|
||
#nof1
|
||
move *a14(plyr_attrib_p),a14,L
|
||
move *a14(PAT_DEFSKILL),a0
|
||
#gdd
|
||
; jruc #temp
|
||
sll 4,a0
|
||
movi #dist_t,a14
|
||
add a0,a14
|
||
move *a14,a2 ;Distance check
|
||
movi #width_t,a14
|
||
add a0,a14
|
||
move *a14,a0 ;Get width of check ;Distance check
|
||
|
||
move *a13(plyr_ownball),a14
|
||
jrnn #norm ;br=not an alleyoop
|
||
move *a13(plyr_num),a7
|
||
move @PSTATUS,a14
|
||
btst a7,a14 ;drone ?
|
||
jrnz #nrm ;br=no
|
||
move *a13(plyr_dirtime),a14
|
||
subk 5,a14
|
||
jrle #o1dok
|
||
addk 15,a2 ;drone has to be more open
|
||
#nrm
|
||
move a2,a14
|
||
srl 1,a14
|
||
add a14,a2
|
||
#norm
|
||
move *a13(plyr_o1dist),a14
|
||
cmp a14,a4
|
||
jrlt #o1dok ;I'm closer?
|
||
|
||
; cmpi 50,a14
|
||
cmp a2,a14
|
||
|
||
jrgt #o1dok ;He's too far?
|
||
move *a13(plyr_o1dir),a2
|
||
sub a3,a2
|
||
abs a2
|
||
cmpi >40,a2
|
||
jrle #o1dsml
|
||
subi >80,a2
|
||
abs a2
|
||
#o1dsml
|
||
|
||
; subk 32,a2
|
||
sub a0,a2
|
||
|
||
jrlt #trylyup ;In front of me?
|
||
#o1dok
|
||
|
||
movi 64,a7
|
||
move *a13(plyr_num),a14
|
||
cmpi 2,a14
|
||
jrlt #tm1a
|
||
clr a7
|
||
#tm1a
|
||
movi plyrproc_t+32,a14,L
|
||
add a7,a14
|
||
move *a14,a14,L
|
||
|
||
move *a14(plyr_num),a7
|
||
move @plyr_onfire,a0
|
||
;; cmp a0,a7
|
||
;; jrnz #nof2
|
||
btst a7,a0
|
||
jrz #nof2 ;br=not on-fire
|
||
;This defender is on fire! Make his defense of dunkers the best!
|
||
movk 11,a0
|
||
jruc #gdd2
|
||
#nof2
|
||
|
||
move *a14(plyr_attrib_p),a14,L
|
||
move *a14(PAT_DEFSKILL),a0
|
||
#gdd2
|
||
sll 4,a0
|
||
movi #dist_t,a14
|
||
add a0,a14
|
||
move *a14,a2 ;Distance check
|
||
movi #width_t,a14
|
||
add a0,a14
|
||
move *a14,a0 ;Get width of check ;Distance check
|
||
|
||
move *a13(plyr_ownball),a14
|
||
jrnn #norm2 ;br=not an alleyoop
|
||
move *a13(plyr_num),a7
|
||
move @PSTATUS,a14
|
||
btst a7,a14 ;drone ?
|
||
jrnz #nrm2 ;br=no
|
||
move *a13(plyr_dirtime),a14
|
||
subk 5,a14
|
||
jrle #trylyup
|
||
addk 15,a2 ;drone has to be more open
|
||
#nrm2
|
||
move a2,a14
|
||
srl 1,a14
|
||
add a14,a2
|
||
|
||
#norm2
|
||
|
||
move *a13(plyr_o2dist),a14
|
||
cmp a14,a4
|
||
jrlt #o2dok ;I'm closer?
|
||
; cmpi 50,a14
|
||
cmp a2,a14
|
||
jrgt #o2dok ;He's too far?
|
||
move *a13(plyr_o2dir),a2
|
||
sub a3,a2
|
||
abs a2
|
||
cmpi >40,a2
|
||
jrle #o2dsml
|
||
subi >80,a2
|
||
abs a2
|
||
#o2dsml
|
||
; subk 32,a2
|
||
sub a0,a2
|
||
jrlt #trylyup ;In front of me?
|
||
#o2dok
|
||
|
||
#dunk move a3,*a13(plyr_dir)
|
||
movi -1,a14
|
||
move a14,*a13(plyr_newdir) ;Cancel turn
|
||
|
||
addk 8,a3 ;Round off
|
||
srl 4,a3 ;Kill frac
|
||
sll 5,a3 ;*32
|
||
|
||
|
||
move *a13(plyr_ownball),a5
|
||
jrp #noaly ;br=teammate doesn't have ball !!
|
||
|
||
move *a13(plyr_tmproc_p),a14,L
|
||
move *a14(plyr_seqflgs),a0
|
||
btst DUNK_B,a0 ;is teammate in dunk ?
|
||
jrnz #tmdnk ;br=yes
|
||
move *a14(plyr_ohpdist),a14 ;get teammates dist. from hoop
|
||
cmpi 375,a14 ;passer not in view of basket
|
||
|
||
;Passer can be at about half court! His teammates cursor will flash white
|
||
;to alert him of an offscrn alley oop jump!
|
||
; cmpi >1EB,a14 ;passer not in view of basket
|
||
jrhs #x ;br=teammate too far away!!
|
||
|
||
|
||
|
||
;Disallow alley oop jump if not good enough dunker!
|
||
; move *a13(plyr_attrib_p),a0,L
|
||
; move *a0(PAT_DUNKSKILL),a0
|
||
; cmpi 4,a0
|
||
; jrlt #x_red
|
||
|
||
;Disallow alley oop jump if not enough turbo - then reduce turbo correct
|
||
;amount if it is ok
|
||
move @PSTATUS,a0 ;Plyr start bits 0-3
|
||
move *a13(plyr_num),a1
|
||
btst a1,a0
|
||
jrz #I_drone
|
||
|
||
move *a13(plyr_PDATA_p),a2,L ;Shrink turbo meter for this plyr
|
||
move *a2(ply_turbo),a1
|
||
subk TURBO_CNT/7,a1 ;Min cnt for alley oop
|
||
|
||
;Flash him red if we are about to disallow alley oop!
|
||
|
||
jrle #x_red ;Turbo too low?
|
||
move a1,*a2(ply_turbo)
|
||
|
||
jruc #cont_aly
|
||
|
||
#I_drone
|
||
;I am a drone, check my teammate, if human, then make sure
|
||
;drone does only 1 jump up attempt per inbound...
|
||
xori 1,a1
|
||
btst a1,a0
|
||
jrz #cont_aly ;Br=2 drones on same team - allow it
|
||
|
||
;Has this drone already tried this jump 1 time?
|
||
|
||
.ref balltmshotcnt
|
||
move @balltmshotcnt,a0 ;Maybe. Chk shot cnt
|
||
subk TMFIRE_MINCNT,a0
|
||
jrnn #cont_aly ; br=a team is on-fire
|
||
|
||
move @drone_attempt,a0
|
||
jrnz #x
|
||
movk 1,a0
|
||
move a0,@drone_attempt
|
||
|
||
;Only allow drone teammates of a human to have scored 3 alley oops per period!
|
||
move *a13(plyr_alley_cnt),a0
|
||
cmpi 3,a0
|
||
jrge #x
|
||
|
||
|
||
#cont_aly
|
||
; move *a13(plyr_inflsh),a0
|
||
; jrnz #skip1
|
||
|
||
CREATE flashpid,flash_me
|
||
move a13,*a0(PDATA+32),L
|
||
;#skip1
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_DUNKSKILL),a14
|
||
; subk 4,a14 ;if less than 4 dunk rating do layup alley
|
||
subk 3,a14 ;if less than 3 dunk rating do layup alley
|
||
jrgt #nrmaly
|
||
|
||
movi ALLEYOOP10_SEQ,a0 ;dir 1
|
||
move *a13(plyr_seqdir),a14
|
||
jrz #qucklay2 ;br=direction 1
|
||
movi ALLEYOOP14_SEQ,a0 ;dir 5
|
||
cmpi 4,a14
|
||
jreq #qucklay2 ;br=direction 5
|
||
movi ALLEYOOP11_SEQ,a0 ;dir 2
|
||
cmpi 1,a14
|
||
jreq #qucklay2
|
||
cmpi 7,a14
|
||
jreq #qucklay2
|
||
movi ALLEYOOP13_SEQ,a0 ;dir 4
|
||
cmpi 3,a14 ;dir 4 or 8 ?
|
||
jreq #qucklay2 ;br=yes
|
||
cmpi 5,a14 ;dir 4 or 8 ?
|
||
jreq #qucklay2 ;br=yes
|
||
movi ALLEYOOP12_SEQ,a0 ;dir 3
|
||
jruc #qucklay2
|
||
#nrmaly
|
||
movi ALLEYOOP8_SEQ,a0
|
||
move *a13(plyr_seqdir),a14
|
||
jrz #qucklay2 ;br=direction 1
|
||
movi ALLEYOOP9_SEQ,a0
|
||
cmpi 4,a14
|
||
jreq #qucklay2 ;br=direction 5
|
||
movi ALLEYOOP7_SEQ,a0 ;br=yes
|
||
cmpi 1,a14
|
||
jreq #qucklay2
|
||
cmpi 7,a14
|
||
jreq #qucklay2
|
||
movi ALLEYOOP5_SEQ,a0 ;br=yes
|
||
cmpi 3,a14 ;dir 4 or 8 ?
|
||
jreq #qucklay2 ;br=yes
|
||
cmpi 5,a14 ;dir 4 or 8 ?
|
||
jreq #qucklay2 ;br=yes
|
||
callr get_rndm_alleyoop_seq ;ret. a0 = alleyoop seq.
|
||
jruc #qucklay2 ;br=not in direction 1
|
||
#tmdnk
|
||
|
||
;Make this double dunker flash white upon take off...
|
||
|
||
;At the very least, we should do this for the 1st period...
|
||
|
||
; move *a13(plyr_inflsh),a0
|
||
; jrnz #skip2
|
||
|
||
CREATE flashpid,flash_me
|
||
move a13,*a0(PDATA+32),L
|
||
;#skip2
|
||
|
||
movi DDUNK_RECV_SEQ,a0
|
||
jruc #qucklay
|
||
|
||
SUBRP flash_me
|
||
|
||
SLEEPK 3
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
|
||
move *a0(plyr_inflsh),a14
|
||
jrnz flash_me
|
||
|
||
SLEEPK 4
|
||
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
move *a0(plyr_jmpcnt),a0
|
||
jaz SUCIDE
|
||
movk 1,a14
|
||
move a14,*a0(plyr_inflsh)
|
||
|
||
;flash player white to alert him
|
||
move *a8(OPAL),a0
|
||
move a0,*a13(PDATA)
|
||
|
||
.ref white_pal
|
||
movi white_pal,a0
|
||
calla pal_getf
|
||
move a0,*a13(PDATA+16)
|
||
|
||
move *a8(OPLINK),a0,L
|
||
move *a0(plyr_headobj_p),a9,L
|
||
move *a9(OPAL),a11
|
||
|
||
movk 3,a10
|
||
#again
|
||
;If on, flash plyr off scrn arrow
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
move *a0(plyr_lost_ptr),a14,L
|
||
move *a14(PA8),a1,L ;a8=0 if no side arw on or arw obj ptr
|
||
jrz #no_arw
|
||
|
||
movi >0101,a2
|
||
move a2,*a1(OCONST)
|
||
setf 4,0,0
|
||
movk M_CONNON,a0 ;Replace non-zero data with constant
|
||
move a0,*a1(OCTRL) ;Write 4 low bits
|
||
setf 16,1,0
|
||
#no_arw
|
||
|
||
move *a13(PDATA+16),a0
|
||
move a0,*a8(OPAL)
|
||
move a0,*a9(OPAL)
|
||
|
||
SLEEPK 3
|
||
|
||
;If on, restore normal arrow const status
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
move *a0(plyr_lost_ptr),a14,L
|
||
move *a14(PA8),a1,L ;a8=0 if no side arw on or arw obj ptr
|
||
jrz #no_arw2
|
||
|
||
setf 4,0,0
|
||
movk M_WRNONZ,a0
|
||
move a0,*a1(OCTRL) ;Write 4 low bits
|
||
setf 16,1,0
|
||
|
||
#no_arw2
|
||
|
||
;Restore normal player pal
|
||
move *a13(PDATA),a0
|
||
move a0,*a8(OPAL)
|
||
move a11,*a9(OPAL)
|
||
|
||
SLEEPK 3
|
||
|
||
dsj a10,#again
|
||
|
||
clr a14
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
move a14,*a0(plyr_inflsh)
|
||
|
||
DIE
|
||
|
||
SUBRP flash_me_red
|
||
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
move *a0(plyr_jmpcnt),a14
|
||
janz SUCIDE
|
||
movk 2,a14
|
||
move a14,*a0(plyr_inflsh)
|
||
|
||
;flash player red to alert him
|
||
move *a8(OPAL),a0
|
||
move a0,*a13(PDATA)
|
||
|
||
.ref red_pal
|
||
movi red_pal,a0
|
||
calla pal_getf
|
||
move a0,*a13(PDATA+16)
|
||
|
||
move *a8(OPLINK),a0,L
|
||
move *a0(plyr_headobj_p),a9,L
|
||
move *a9(OPAL),a11
|
||
|
||
movk 2,a10
|
||
#again1
|
||
move *a13(PDATA+16),a0
|
||
move a0,*a8(OPAL)
|
||
move a0,*a9(OPAL)
|
||
|
||
SLEEPK 3
|
||
|
||
;Restore normal player pal
|
||
move *a13(PDATA),a0
|
||
move a0,*a8(OPAL)
|
||
move a11,*a9(OPAL)
|
||
|
||
SLEEPK 3
|
||
|
||
dsj a10,#again1
|
||
|
||
clr a14
|
||
move *a13(PDATA+32),a0,L ;Player proc ptr
|
||
move a14,*a0(plyr_inflsh)
|
||
|
||
DIE
|
||
|
||
#noaly
|
||
move *a13(plyr_tbutn),a14
|
||
cmpi 4,a14 ;just pressed turbo ?
|
||
jrgt #dodnk ;br=no, do a dunk
|
||
|
||
move *a13(plyr_ohpdist),a14
|
||
; cmpi 75,a14 ;too close for QUICK LAYUP ?
|
||
cmpi 95,a14 ;too close for QUICK LAYUP ?
|
||
jrlt #dodnk ;br=yes, do dunk
|
||
|
||
movk 2,a0
|
||
move a0,@ballptsforshot
|
||
|
||
movk LAY_UP,a0
|
||
move a0,@shot_type
|
||
|
||
movi QUICK_LAYUP_SEQ,a0
|
||
jruc #qucklay
|
||
#dodnk
|
||
|
||
.ref getdunkseq
|
||
calla getdunkseq
|
||
move a0,a0
|
||
jrnz #sj
|
||
|
||
|
||
clr a0
|
||
move a0,@shot_distance
|
||
|
||
movk DUNK_SHORT,a0
|
||
cmpi 80,a4
|
||
jrle #short
|
||
|
||
movk DUNK_MED,a0
|
||
cmpi 120,a4
|
||
jrle #med
|
||
|
||
movk DUNK_LONG,a0
|
||
#short
|
||
#med
|
||
move a0,@shot_type
|
||
|
||
.if DEBUG
|
||
movi DUNKA_SEQ,a0
|
||
movi DUNKA2_SEQ,a0
|
||
movi DUNKA3_SEQ,a0
|
||
movi DUNKB_SEQ,a0
|
||
movi DUNKB2_SEQ,a0
|
||
movi DUNKB3_SEQ,a0
|
||
movi DUNKC_SEQ,a0
|
||
movi DUNKD_SEQ,a0
|
||
movi DUNKD2_SEQ,a0
|
||
movi DUNKE_SEQ,a0
|
||
movi DUNKE2_SEQ,a0
|
||
movi DUNKF_SEQ,a0
|
||
movi DUNKG_SEQ,a0
|
||
movi DUNKG2_SEQ,a0
|
||
movi DUNKJ_SEQ,a0
|
||
movi DUNKJ2_SEQ,a0
|
||
movi DUNKK_SEQ,a0
|
||
movi DUNKK2_SEQ,a0
|
||
movi DUNKL_SEQ,a0
|
||
movi DUNKL2_SEQ,a0
|
||
movi DUNKL3_SEQ,a0
|
||
movi DUNKN_SEQ,a0
|
||
movi DUNKN2_SEQ,a0
|
||
movi DUNKN3_SEQ,a0
|
||
movi DUNKO_SEQ,a0
|
||
movi DUNKO2_SEQ,a0
|
||
movi DUNKP_SEQ,a0
|
||
movi DUNKP2_SEQ,a0
|
||
movi DUNKP3_SEQ,a0
|
||
movi DUNKQ_SEQ,a0
|
||
movi DUNKQ2_SEQ,a0
|
||
movi DUNKQ3_SEQ,a0
|
||
movi DUNKR_SEQ,a0
|
||
movi DUNKR2_SEQ,a0
|
||
movi DUNKS_SEQ,a0
|
||
movi DUNKS2_SEQ,a0
|
||
movi DUNKT_SEQ,a0
|
||
movi DUNKT2_SEQ,a0
|
||
movi DUNKT3_SEQ,a0
|
||
movi DUNKT4_SEQ,a0
|
||
movi DUNKT5_SEQ,a0
|
||
movi DUNKU_SEQ,a0
|
||
movi DUNKU2_SEQ,a0
|
||
movi DUNKU3_SEQ,a0
|
||
movi DUNKV_SEQ,a0
|
||
movi DUNKV2_SEQ,a0
|
||
movi DUNKV3_SEQ,a0
|
||
movi DUNKV4_SEQ,a0
|
||
movi DUNKW_SEQ,a0
|
||
movi DUNKW2_SEQ,a0
|
||
movi DUNKW3_SEQ,a0
|
||
movi DUNKX_SEQ,a0
|
||
movi DUNKX2_SEQ,a0
|
||
movi DUNKX3_SEQ,a0
|
||
movi DUNKY_SEQ,a0
|
||
movi DUNKY2_SEQ,a0
|
||
movi DUNKZ_SEQ,a0
|
||
movi DUNKZ2_SEQ,a0
|
||
movi DUNKZ3_SEQ,a0
|
||
movi DUNKLAY_SEQ,a0
|
||
movi DUNKLAY2_SEQ,a0
|
||
movi DUNKLAY3_SEQ,a0
|
||
movi DUNKLAY3A_SEQ,a0
|
||
movi DUNKLAY3B_SEQ,a0
|
||
movi DUNKLAY3C_SEQ,a0
|
||
movi DUNKLAY4_SEQ,a0
|
||
movi DUNKLAY5_SEQ,a0
|
||
movi DUNKLAY6_SEQ,a0
|
||
movi DUNKLAY7_SEQ,a0
|
||
movi DUNKLAY7A_SEQ,a0
|
||
movi DUNKLAY8_SEQ,a0
|
||
movi DUNKT4_SEQ,a0
|
||
|
||
movi 1,a2
|
||
; movi -1,a2
|
||
|
||
jrn #tstdnk
|
||
.endif
|
||
|
||
move *a3,a2,L
|
||
move *a2+,a0 ;#Entries-1
|
||
callr rndrng0
|
||
sll 4,a0 ;*16
|
||
add a2,a0
|
||
move *a0,a0
|
||
jrz #sj ;Null entry?
|
||
#tstdnk
|
||
|
||
|
||
.if DEBUG
|
||
;Shawn, I'm stuffing the dunk into ram so I can pause the game when someone
|
||
;has a problem with a dunk and I can jot down the dunk # and fix it.
|
||
.bss debug_dunk_num,16
|
||
.ref slowmotion
|
||
|
||
move a0,@debug_dunk_num
|
||
clr a1
|
||
move a1,@slowmotion
|
||
.endif
|
||
|
||
move a0,a2
|
||
CREATE0 start_animate
|
||
; cmpi DUNKX_SEQ,a2
|
||
; jreq #smk
|
||
; cmpi DUNKX2_SEQ,a2
|
||
; jreq #smk
|
||
; cmpi DUNKX3_SEQ,a2
|
||
; jrne #nosmk
|
||
;#smk CREATE0 plyr_smoketrail
|
||
; move a13,*a0(PA10),L
|
||
#nosmk move a2,a0
|
||
|
||
#qucklay
|
||
movk 2,a14
|
||
move a14,@ballptsforshot
|
||
#qucklay2
|
||
move *a13(plyr_dir),a7
|
||
callr plyr_setseq ;Dunk!
|
||
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrz #x ;Team1?
|
||
movi M_FLIPH,a14
|
||
move a14,*a13(plyr_anirevff)
|
||
jruc #x
|
||
|
||
|
||
;strtsnd SLEEP 40
|
||
; movi dnk_snd,a0
|
||
; calla snd_play1
|
||
; SLEEP 180
|
||
; movi push1_snd,a0
|
||
; calla snd_play1
|
||
; DIE
|
||
;
|
||
;push1_snd .word >fd85,15,>8160,0 ;Push ugh
|
||
;dnk_snd .word >fda9,120,>8167,0
|
||
|
||
dnkthru_t
|
||
.word 0,0,0,0,0,0,0,100,150,250,350
|
||
|
||
|
||
#dist_t .word 40*DIST_REDUCTION
|
||
.WORD 43*DIST_REDUCTION
|
||
.WORD 46*DIST_REDUCTION
|
||
.WORD 49*DIST_REDUCTION
|
||
.WORD 50*DIST_REDUCTION
|
||
.WORD 52*DIST_REDUCTION
|
||
.WORD 54*DIST_REDUCTION
|
||
.WORD 56*DIST_REDUCTION
|
||
.WORD 68*DIST_REDUCTION
|
||
.WORD 70*DIST_REDUCTION
|
||
.WORD 72*DIST_REDUCTION
|
||
.WORD 95*DIST_REDUCTION
|
||
#width_t
|
||
.word 27,29,31,33,36,37,38,39,40,43,45,70
|
||
|
||
#trylyup
|
||
move *a13(plyr_ownball),a14
|
||
jrn #sj_red ;alleyoop
|
||
move @HCOUNT,a14
|
||
btst 0,a14
|
||
jrnz #sj
|
||
move *a13(plyr_ohpdist),a14
|
||
cmpi 138*DIST_ADDITION,a14
|
||
jrgt #sj
|
||
cmpi 35*DIST_ADDITION,a14
|
||
jrlt #sj
|
||
|
||
;#temp
|
||
move a3,*a13(plyr_dir)
|
||
movi -1,a14
|
||
move a14,*a13(plyr_newdir) ;Cancel turn
|
||
movk 2,a0
|
||
move a0,@ballptsforshot
|
||
|
||
movk FINGER_ROLL,a0
|
||
move a0,@shot_type
|
||
|
||
movi LAYUP_SEQ,a0
|
||
jruc #sseq
|
||
|
||
#hs
|
||
movk 2,a4
|
||
move a4,@ballptsforshot
|
||
|
||
movk HOOK_SHOT,a0
|
||
move a0,@shot_type
|
||
|
||
movk HOOK_SEQ,a0
|
||
move *a13(plyr_turbon),a4
|
||
jrnz #hs1
|
||
movk HOOK2_SEQ,a0 ;Not a high arc
|
||
|
||
|
||
#hs1 move *a13(plyr_dir),a7
|
||
callr plyr_setseq
|
||
|
||
move *a13(plyr_seqdir),a14
|
||
subk 2,a14
|
||
jrz #x
|
||
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrz #x ;Team1?
|
||
movi M_FLIPH,a14
|
||
move a14,*a13(plyr_anirevff)
|
||
jruc #x
|
||
|
||
|
||
|
||
#sj ;>Start a jump shot seq
|
||
move *a13(plyr_ownball),a5
|
||
jrnn #sj2
|
||
move a9,*a13(plyr_newdir) ;Turn toward basket
|
||
jruc #x
|
||
|
||
#sj_red
|
||
move a9,*a13(plyr_newdir) ;Turn toward basket
|
||
jruc #x_red
|
||
|
||
|
||
|
||
|
||
#sj2
|
||
.asg CZMIN+18,PT3_TOPZ
|
||
|
||
movk 2,a4 ;Assume 2ptr
|
||
|
||
move *a8(OZPOS),a0
|
||
subi PT3_TOPZ,a0
|
||
jrlt #3ptra
|
||
cmpi PT3_CNT*4,a0,W
|
||
jrge #3ptra
|
||
|
||
.if 0 ;DEBUG code for 3pt line positioning
|
||
BSSX pt3_tval,16
|
||
srl 2,a0
|
||
move a0,a1
|
||
sll 4,a0
|
||
addi pt3_t,a0
|
||
move *a0,a0
|
||
move a0,@pt3_tval
|
||
dec a0
|
||
move *a13(plyr_num),a14
|
||
subk 2,a14
|
||
jrlt #3pt1
|
||
neg a0
|
||
#3pt1 addi WRLDMID,a0
|
||
move *a8(OXANI+16),a14
|
||
sub a14,a0
|
||
move a0,*a8(OXPOS)
|
||
sll 2,a1
|
||
addi PT3_TOPZ,a1
|
||
move a1,*a8(OZPOS)
|
||
clr a0
|
||
move a0,*a13(plyr_nojoy)
|
||
movk STNDDRIB_SEQ,a0
|
||
jruc #sseq
|
||
.endif ;DEBUG end
|
||
|
||
srl 2,a0 ;In 3pt arc Z range
|
||
sll 4,a0
|
||
addi pt3_t,a0
|
||
move *a0,a0
|
||
move *a8(OXANI+16),a14
|
||
move *a8(OXPOS),a2
|
||
add a14,a2
|
||
subi WRLDMID,a2
|
||
abs a2
|
||
sub a2,a0 ;Inside 3pt line?
|
||
jrle #2ptr ; br=yes
|
||
|
||
; LOCKUP ;>3ptr from just outside the arc
|
||
cmpi 25,a0 ;22+15%;!!!
|
||
jrlt #3ptrx
|
||
#3ptr
|
||
; LOCKUP ;>3ptr from further out but NOT a desperation
|
||
movk 1,a4
|
||
move a4,@reduce_3ptr
|
||
#3ptra
|
||
; LOCKUP ;>3ptr from top or bottom sideline
|
||
|
||
#3ptrx
|
||
movk 3,a4 ;Is 3ptr
|
||
|
||
movk _3_POINTS,a0
|
||
move *a13(plyr_ohpdist),a14
|
||
; cmpi 310*DIST_ADDITION,a0 ;!!!Chk distance from hoop (158 h)
|
||
cmpi 290*DIST_ADDITION,a14
|
||
jrle #contxy
|
||
|
||
movk LONG_RANGE,a0
|
||
jruc #contxy
|
||
#2ptr
|
||
movk _2_POINTS,a0
|
||
|
||
; move a4,@ballptsforshot
|
||
; move *a13(plyr_tbutn),a14
|
||
; cmpi 12,a14
|
||
; jrgt #contxy
|
||
; movk LAYUP_SEQ,a0
|
||
; jruc #sseq
|
||
|
||
#contxy
|
||
move a0,@shot_type
|
||
move a4,@ballptsforshot
|
||
|
||
movk UNDR_HOOP_SHT_SEQ,a0 ;for team 2
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
jrnz #tem2 ;br=team1
|
||
movk UNDR_HOOP_SHT_SEQ2,a0
|
||
#tem2
|
||
.ref chck_plyr_under_hoop
|
||
calla chck_plyr_under_hoop
|
||
jrc #sseq
|
||
|
||
movk SHOOT_SEQ,a0
|
||
move *a13(plyr_shtbutn),a14
|
||
jrnz #sseq
|
||
|
||
movk QSHOOT_SEQ,a0
|
||
movk 1,a14
|
||
move a14,*a13(plyr_shtbutn)
|
||
jruc #sseq
|
||
|
||
;--------------------
|
||
|
||
#desp
|
||
movi DESPERATION,a0
|
||
move a0,@shot_type
|
||
|
||
movk 3,a14
|
||
move a14,@ballptsforshot
|
||
|
||
;This is a heave grenade toss
|
||
;only do it if under 5 seconds in quarter
|
||
movk SHOOTDESP2_SEQ,a0 ;Heave
|
||
move @PCNT,a14
|
||
btst 0,a14
|
||
jrz #abc
|
||
movk SHOOTDESP_SEQ,a0 ;Heave
|
||
#abc
|
||
move @game_time,a14,L
|
||
cmpi >500,a14
|
||
jrlt #heave ;Do it
|
||
|
||
;FIX!! We need another desp shot
|
||
; move @PCNT,a0
|
||
; ANDK 1,a0
|
||
; sll 1,a0
|
||
; addk SHOOTDESP_SEQ,a0
|
||
|
||
movi SHOOTDESP3_SEQ,a0
|
||
|
||
#heave
|
||
move *a13(plyr_newdir),a14
|
||
move a14,*a13(plyr_dir)
|
||
movi -1,a14
|
||
move a14,*a13(plyr_newdir)
|
||
jruc #sseq
|
||
|
||
#blk
|
||
;Player has hit shoot/block button try to block shot or other...
|
||
|
||
;Am I about to get a pass?
|
||
move *a13(plyr_rcvpass),a0
|
||
jrgt #x ;Waiting on pass?
|
||
|
||
;FIX!!!
|
||
;Realize that no jumping can occur offscrn... Perhaps this is OK
|
||
;Maybe allow block attempt if ball is in air (shot)...
|
||
move *a13(plyr_offtime),a14
|
||
jrnz #x ;br=offscreen, dont jump
|
||
|
||
;Does anyone own ball
|
||
move @ballpnum,a14
|
||
jrn #inair ;br=no owner
|
||
|
||
sll 5,a14 ;*32
|
||
addi plyrproc_t,a14
|
||
move *a14,a14,L
|
||
move *a14(plyr_seqflgs),a0
|
||
btst SHOOT_B,a0
|
||
; jrz #faceb ;!Shooting?
|
||
jrnz #inair
|
||
|
||
;Slow down drift fr this blocker!
|
||
|
||
move *a8(OXVEL),a0,L
|
||
sra 1,a0
|
||
move a0,*a8(OXVEL),L
|
||
move *a8(OYVEL),a0,L
|
||
sra 1,a0
|
||
move a0,*a8(OYVEL),L
|
||
move *a8(OZVEL),a0,L
|
||
sra 1,a0
|
||
move a0,*a8(OZVEL),L
|
||
|
||
move @ballobj_p,a5,L
|
||
move *a5(OXPOS),a6
|
||
addk 6,a6
|
||
move *a5(OZPOS),a7
|
||
PUSH A0
|
||
callr seekdirdist_obxz128
|
||
move a0,*a13(plyr_newdir) ;Turn toward ball
|
||
PULL A0
|
||
btst DUNK_B,a0
|
||
jrz #blkd
|
||
movk 7,a0
|
||
calla rndrng0
|
||
sll 4,a0
|
||
addi blktype_t,a0
|
||
move *a0,a0
|
||
|
||
;What seq for trying to block a dunk?
|
||
;
|
||
; movi FASTBLOCKREJ_SEQ,a0
|
||
; movi BLOCK_SEQ,a0
|
||
; movi BLOCKREJ_SEQ,a0
|
||
; movi REBOUND_SEQ,A0
|
||
|
||
jruc #sseq
|
||
|
||
blktype_t
|
||
.word BLOCK_SEQ,BLOCK_SEQ,BLOCK_SEQ,BLOCK_SEQ
|
||
.word REBOUND_SEQ,BLOCKREJ_SEQ
|
||
.word REBOUND_SEQ,FASTBLOCKREJ_SEQ
|
||
|
||
#inair
|
||
|
||
;if teammate shot ball, dont swat at the ball, just do a rebound seq.
|
||
move @ballshotinair,a1
|
||
jrn #nstm ;br=ball hit something !!
|
||
move *a13(plyr_num),a14
|
||
srl 1,a14
|
||
srl 1,a1
|
||
cmp a14,a1
|
||
jreq #dorb ;br=plyrs, not on same team !!
|
||
#nstm
|
||
move @ballobj_p,a5,L
|
||
|
||
move *a5(OYPOS),a1
|
||
; cmpi -20,a1
|
||
cmpi -40,a1
|
||
jrge #faceb ;Ball close to gnd?
|
||
|
||
move *a5(OXVAL),a6,L
|
||
move *a5(OXANI),a14,L
|
||
add a14,a6
|
||
move *a5(OZVAL),a7,L
|
||
|
||
move @ballpnum,a14
|
||
jrge #chkdist ;Other team has ball?
|
||
|
||
;PUTBACK logic
|
||
; move *a13(plyr_num),a1
|
||
; move @ballpnumlast,a14 ;Plyr on the same team as plyr who
|
||
; srl 1,a1 ; missed the basket?
|
||
; srl 1,a14
|
||
; cmp a1,a14
|
||
; jrnz #noffreb ;br=no
|
||
;
|
||
; move *a13(plyr_ohpdist),a14
|
||
; cmpi 50,a14
|
||
; jrhs #dorb ;br=not close enough for put-back dunk
|
||
; movi PUTBACK_SEQ,a0
|
||
; jruc #sseq
|
||
;#noffreb
|
||
movk 20,a0
|
||
move *a5(OXVEL),a1,L
|
||
mpys a0,a1
|
||
add a1,a6
|
||
move *a5(OZVEL),a1,L
|
||
mpys a0,a1
|
||
add a1,a7
|
||
|
||
#chkdist
|
||
;TEMP!!!
|
||
; movi FASTBLOCKREJ_SEQ,a0
|
||
; movi BLOCK_SEQ,a0
|
||
; movk BLOCKREJ_SEQ,a0
|
||
; movk REBOUND_SEQ,a0
|
||
;
|
||
; jruc #sseq
|
||
;
|
||
sra 16,a6
|
||
sra 16,a7
|
||
callr seekdirdist_obxz128
|
||
move a0,*a13(plyr_newdir) ;Turn where ball is headed
|
||
cmpi 120,a1
|
||
jrge #blkd ;Too far to jump?
|
||
|
||
; movk 1,a0 ;50%
|
||
movi 650,a0
|
||
move @ballpnum,a1
|
||
jrge #dornd
|
||
|
||
move @ballgoaltcnt,a14
|
||
jrle #dorb ;Do rebound?
|
||
|
||
|
||
|
||
; movk 1,a0 ;50%
|
||
movi 650,a0
|
||
;Do more rejections!
|
||
#dornd calla RNDPER
|
||
; jrnz #dorej
|
||
jrhi #dorej
|
||
|
||
;Weak shot blockers will do swat, not grab!
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_DEFSKILL),a0
|
||
cmpi 5,a0
|
||
jrlt #dorej
|
||
|
||
#dorb movk REBOUND_SEQ,a0
|
||
jruc #sseq
|
||
#dorej
|
||
movk BLOCKREJ_SEQ,a0
|
||
jruc #sseq
|
||
|
||
|
||
#faceb move @ballobj_p,a5,L
|
||
move *a5(OXPOS),a6
|
||
addk 6,a6
|
||
move *a5(OZPOS),a7
|
||
callr seekdirdist_obxz128
|
||
move a0,*a13(plyr_newdir) ;Turn toward ball
|
||
;If near ball, and it's near ground, go ahead and try pickup
|
||
move *a13(plyr_balldist),a0
|
||
cmpi >24,a0
|
||
jrgt #blkd
|
||
;Pickup
|
||
movi PICKUP_SEQ,a0 ;No. Pick-up ball
|
||
jruc #sseq
|
||
|
||
#blkd movk BLOCK_SEQ,a0
|
||
|
||
|
||
#sseq move *a13(plyr_dir),a7
|
||
callr plyr_setseq
|
||
|
||
|
||
#x PULL a6,a7,a9
|
||
rets
|
||
|
||
|
||
#x_red
|
||
;Missed alley oop attempt
|
||
move *a13(plyr_inflsh),a0
|
||
jrnz #x
|
||
|
||
move @PSTATUS,a0 ;Plyr start bits 0-3
|
||
move *a13(plyr_num),a1
|
||
btst a1,a0
|
||
jrz #x
|
||
|
||
|
||
CREATE flashpid,flash_me_red
|
||
move a13,*a0(PDATA+32),L
|
||
|
||
PULL a6,a7,a9
|
||
rets
|
||
|
||
pt3_t
|
||
.word 336,276,248,235,222,213,204,196
|
||
.word 188,182,176,163,158,155,152,149
|
||
.word 146,143,141,140,139,138,137,137
|
||
.word 136,136,136,135,135,135,135,135
|
||
.word 136,137,137,138,138,139,140,141
|
||
.word 141,142,144,145,147,148,150,151
|
||
.word 153,155,158,161,164,168,171,174
|
||
.word 177,180,183,186,189,193,197,201
|
||
.word 205,210,215,220,226,231,238,245
|
||
.word 254,262,272,286,316
|
||
PT3_CNT .equ ($-pt3_t)/16
|
||
|
||
.if CRTALGN
|
||
.word -1
|
||
.endif
|
||
|
||
#*******************************
|
||
SUBRP get_rndm_alleyoop_seq
|
||
|
||
PUSH a1
|
||
movk 4,a0
|
||
calla rndrng0
|
||
sll 4,a0
|
||
addi alleyoop_seq_tbl,a0
|
||
move *a0,a0
|
||
PULL a1
|
||
rets
|
||
|
||
alleyoop_seq_tbl
|
||
.word ALLEYOOP1_SEQ
|
||
.word ALLEYOOP2_SEQ
|
||
.word ALLEYOOP3_SEQ
|
||
.word ALLEYOOP4_SEQ
|
||
.word ALLEYOOP6_SEQ
|
||
|
||
#*******************************
|
||
* Player takes a shot (also called by seq)
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A5
|
||
|
||
SUBR plyr_shoot
|
||
|
||
PUSH a6,a7,a9,a10,a11
|
||
|
||
.ref bkbrd_proc_flg
|
||
clr a14
|
||
move a14,@bkbrd_proc_flg ;just in case speech proc was killed
|
||
|
||
move *a13(plyr_num),a0 ;Exit if plyr doesn't have
|
||
move @ballpnum,a1 ; the ball
|
||
cmp a0,a1
|
||
jrne #x
|
||
|
||
; move @GAMSTATE,a0
|
||
; cmpi INAMODE,a0
|
||
; jrnz #nofake
|
||
; .ref do_ball_spark
|
||
; CREATE0 do_ball_spark
|
||
;#nofake
|
||
|
||
move @plyr_onfire,a14 ;Do on-fire shot snd
|
||
;; cmp a0,a14
|
||
;; jrne #cold
|
||
btst a0,a14
|
||
jrz #cold ;br=not on-fire
|
||
SOUND1 fball_snd
|
||
#cold
|
||
move @ballobj_p,a0,L
|
||
|
||
move *a13(plyr_ballyo),a1
|
||
cmpi -200,a1 ;Ball Y free?
|
||
jrne #notfree ; br=no
|
||
move @ballfree,a14 ;Yes. Was it already free?
|
||
jrnz #contv ; br=yes
|
||
|
||
.if DEBUG
|
||
LOCKUP ;Should not occur!
|
||
.endif
|
||
|
||
movk 1,a14
|
||
move a14,@ballfree ;!0=ball free
|
||
move *a0(OYPOS),a1
|
||
move *a0(OIMG),a14,L
|
||
move *a14(IANIOFFY),a14
|
||
add a14,a1 ;A1=ball ctr Y
|
||
movi ->a00,a14 ;Push it towards gnd
|
||
mpys a14,a1
|
||
addi >16000,a1
|
||
move a1,*a0(OYVEL),L
|
||
jruc #contv
|
||
|
||
#notfree
|
||
clr a1
|
||
move a1,*a0(OYVEL),L ;Clr vels
|
||
move a1,*a0(OXVEL),L
|
||
move a1,*a0(OZVEL),L
|
||
move a1,@ballfree ;0=ball not free
|
||
|
||
#contv
|
||
move *a13(plyr_ohoopx),a6
|
||
movi CZMID,a7
|
||
callr seekdirdist_obxz128
|
||
move a0,a10 ;A10=hoop dir
|
||
move a1,a11 ;A11=hoop distance
|
||
|
||
move *a13(plyr_attrib_p),a7,L ;Get plyr shot % attribute
|
||
move *a7(PAT_SHOTSKILL),a9
|
||
|
||
move @ballptsforshot,a0
|
||
cmpi 3,a0
|
||
jrnz #no3
|
||
|
||
|
||
;Fades, lean-ins are also reduced via reduce_3ptr flag
|
||
|
||
;Reduce 3-ptrs based on shoot attribute
|
||
;FIX!! This should also do an adjustment based on who it is and how good
|
||
;they are at 3 ptrs! Hill doesn't even shoot 'em! Rodman should be a 0!
|
||
;Store another flag for guys who don't even shoot them...
|
||
.ref SHT5
|
||
cmpi SHT5,a9
|
||
jrgt #oui
|
||
subi 200,a9 ;!!! ;Stat #0-4 reduce 3-ptrs
|
||
#oui
|
||
move @reduce_3ptr,a0
|
||
jrz #no3
|
||
subi 150,a9 ;!!!150?;Reduce 3-ptr
|
||
|
||
|
||
#no3
|
||
;FIX!!!
|
||
;Make sure these are good numbers....
|
||
cmpi 112,a11 ;!!! ;Close-in?
|
||
jrgt #notshort
|
||
addi 250,a9 ;!!! ;Improve for close-in
|
||
#notshort
|
||
cmpi 304,a11 ;!!! ;Far shot?
|
||
jrlt #notlong
|
||
subi 990,a9 ;!!! ;Reduce for far shot
|
||
|
||
#notlong
|
||
move *a13(plyr_num),a4 ;>Process opponents dir/dist
|
||
srl 2,a4
|
||
subb a4,a4
|
||
addk 1,a4
|
||
sll 1+5,a4
|
||
addi plyrobj_t,a4
|
||
|
||
movk 2,a5
|
||
#chkopp
|
||
move *a4+,a0,L
|
||
move *a0(OYPOS),a3
|
||
callr seekdirdist_obob128
|
||
|
||
cmpi 50,a1 ;40 ;!!! ;Opponent tight-in, any angle?
|
||
jrgt #1far ; br=no
|
||
subi 240,a9 ;!!!
|
||
#1far
|
||
cmpi 85,a1 ;75 ;!!! ;Opponent close-in?
|
||
jrgt #nxtopp ; br=no
|
||
sub a10,a0 ;Yes. Process my hoop angle with his
|
||
abs a0 ; angle on me
|
||
cmpi >40,a0
|
||
jrle #1dsml
|
||
subi >80,a0
|
||
abs a0
|
||
#1dsml
|
||
subk 20,a0 ;!!! ;Between me & hoop?
|
||
jrge #nxtopp ; br=no
|
||
sll 2,a1 ;!!! = 0 to 300
|
||
;Make shot% reduce greatly if someone is in his face...
|
||
subi 390,a1 ;!!! =-390 to -90 ;350
|
||
|
||
move *a8(OYPOS),a2
|
||
sub a3,a2 ;Shooter above opponent?
|
||
jrle #1above ; br=yes
|
||
addk 8,a2
|
||
mpys a2,a1
|
||
sra 3,a1
|
||
#1above
|
||
add a1,a9 ;Decrease accuracy
|
||
#nxtopp
|
||
dsj a5,#chkopp
|
||
|
||
move a11,a14 ;Decrease shot % per hoop distance
|
||
sll 1,a14 ;!!!
|
||
sub a14,a9
|
||
|
||
cmpi 50,a9 ;!!! ;Ensure valid minimun shot %
|
||
jrge #minok
|
||
movi 50,a9 ;!!!
|
||
#minok
|
||
|
||
move *a13(plyr_num),a0 ;Get plyr brick cnt
|
||
sll 4,a0
|
||
addi brick_count,a0
|
||
move *a0,a1
|
||
cmpi 3,a1 ;!!! ;If too many in a row, make this
|
||
jrlt #nobrick ; shot go in
|
||
; LOCKUP
|
||
|
||
;Too far to pump up this brick thrower?
|
||
cmpi 304,a11 ;!!! ;Far shot?
|
||
jrgt #nobrick
|
||
|
||
movi 990,a9 ;!!! ;Set best shot %
|
||
#nobrick
|
||
|
||
move *a13(plyr_ptsdown),a1 ;>Adjust shot % per score diff
|
||
move a1,a2 ;A2=plyr_ptsdown
|
||
; movk 20,a0 ;!!! ;% factor
|
||
movk 14,a0 ;15 ;!!! ;% factor
|
||
mpys a0,a1
|
||
add a1,a9
|
||
|
||
cmpi 50,a9
|
||
jrge #minok1
|
||
movi 50,a9
|
||
#minok1
|
||
|
||
move a2,a2 ;Is plyr losing?
|
||
jrgt #nomis ; br=yes
|
||
movi 55,a0 ;!!! ;Randomly knock down his %
|
||
calla RNDPER
|
||
jrls #nomis
|
||
movi 350,a9 ;!!!
|
||
#nomis
|
||
move @game_time,a1,L
|
||
cmpi >400,a1 ;!!! ;Last seconds of qrtr?
|
||
jrgt #nohelp ; br=no
|
||
|
||
*If end of qrtr/game, affect shots like this:
|
||
*
|
||
* 1. If 4th or overtime qrtr has 5 seconds or less remaining and
|
||
*
|
||
* a. If score is already tied or I am ahead, do nothing.
|
||
* b. This shot (2 or 3) would tie the score, then make it go in 75% of
|
||
* the time. (Regardless of shot distance)
|
||
* c. This shot (2 or 3) would win the game, then make it go in at
|
||
* least 30% of the time (Close in would be higher, but even bombs
|
||
* go in 30%)
|
||
* d. If this shot would pull me to within 1/2 points, then make it go
|
||
* in 90% of the time for max excitement without putting him ahead.
|
||
*
|
||
* 2. If 1/2/3rd qrtr has 5 seconds or less remaining and
|
||
*
|
||
* a. If score is already tied or I am ahead, do nothing.
|
||
* b. This shot (2 or 3) would tie the score, then make it go in 40% of
|
||
* the time at least. (Regardless of shot distance)
|
||
* c. If this shot would pull me to within or ahead by 1/2 points, then
|
||
* make it go in 50% of the time for max excitement)
|
||
* d. If I am losing by a larger margin than 4, then make it go in at
|
||
* least 60%. (Regardless of shot distance)
|
||
|
||
move @gmqrtr,a3
|
||
|
||
move a2,a0 ;Game tied?
|
||
jrnz #notie ; br=no
|
||
|
||
subk 3,a3 ;In 4th qrtr or OT?
|
||
jrlt #nohelp ; br=no
|
||
movi 50,a9 ;!!! ;Last second shot of a tie game
|
||
jruc #nohelp ; should almost never go in
|
||
#notie
|
||
jrgt #tryhelp ;Is plyr losing? br=yes
|
||
|
||
addk 5,a0 ;!!! ;Winning by 5 or more?
|
||
jrgt #nohelp ; br=no
|
||
subk 3,a3 ;In 4th qrtr or OT?
|
||
jrlt #nohelp ; br=no
|
||
cmpi >200,a1 ;How close to qrtr being over?
|
||
jrgt #endgbig ;Last few seconds
|
||
jruc #willtie ;At the buzzer
|
||
#tryhelp
|
||
move @ballptsforshot,a14
|
||
subk 3,a3 ;In 4th qrtr or OT?
|
||
jrge #endgame ; br=yes
|
||
|
||
subk 5,a0 ;!!! ;Losing by more than 5?
|
||
jrgt #losebig ; br=yes
|
||
|
||
cmp a2,a14 ;Will this shot tie the game?
|
||
jreq #willtie ; br=yes
|
||
|
||
movi 100,a3 ;!!! ;Min % down 1-5, no tie shot
|
||
jruc #chkper
|
||
#willtie
|
||
movi 120,a3 ;!!! ;Min % down 1-5, is tie shot
|
||
jruc #chkper
|
||
#losebig
|
||
movi 120,a3 ;!!! ;Min % down >5
|
||
jruc #chkper
|
||
|
||
#endgame
|
||
subk 4,a0 ;!!! ;Losing by 4 or more?
|
||
jrge #endgbig ; br=yes
|
||
|
||
cmp a2,a14 ;Will this shot tie the game?
|
||
jreq #endgtie ; br=yes
|
||
|
||
move *a13(plyr_num),a0
|
||
move @PSTATUS,a1
|
||
btst a0,a1 ;Is plyr a drone?
|
||
jrnz #endgnod ; br=no
|
||
movk 1,a14
|
||
xor a14,a0
|
||
btst a0,a1 ;Is team mate a drone too?
|
||
jrnz #endgnod ; br=no
|
||
|
||
movi 100,a3 ;!!! ;Min % drones down <4, no tie shot
|
||
jruc #chkper
|
||
#endgnod
|
||
movi 380,a3 ;!!! ;Min % down <4, no tie shot
|
||
jruc #chkper
|
||
#endgtie
|
||
movi 800,a3 ;!!! ;Min % for down <4, is tie shot
|
||
jruc #chkper
|
||
#endgbig
|
||
movi 300,a3 ;!!! ;Min % for down >3
|
||
|
||
#chkper
|
||
cmp a3,a9 ;Set min % if > current %
|
||
jrge #nohelp
|
||
move a3,a9
|
||
|
||
;--------------------
|
||
|
||
#nohelp
|
||
; movi 950,a9
|
||
|
||
move @ballobj_p,a7,L ;Is ball on fire?
|
||
move *a7(OPLINK),a0,L
|
||
move *a0(ball_onfire),a14
|
||
jrz #nofire ; br=no
|
||
|
||
addi 750,a9 ;!!! ;On-fire % increase
|
||
cmpi 328,a11
|
||
jrlt #nofire
|
||
movi 100,a9 ;!!! ;On-fire & close-in % increase
|
||
#nofire
|
||
|
||
calla ball_convfmprel
|
||
|
||
;--------------------
|
||
|
||
move *a13(plyr_seq),a0 ;>Adjust % per plyr seq
|
||
cmpi DDUNK_STRT2_SEQ,a0
|
||
jrnz #ntddnk2
|
||
movi 500,a9 ;!!!
|
||
jruc #fixperc
|
||
#ntddnk2
|
||
cmpi DUNKLAY5_SEQ,a0
|
||
jrnz #ck2
|
||
addi 760,a9 ;!!!
|
||
jruc #fixperc
|
||
#ck2
|
||
cmpi DUNKLAY4_SEQ,a0
|
||
jrnz #ck3
|
||
addi 760,a9 ;!!!
|
||
jruc #fixperc
|
||
#ck3
|
||
cmpi DUNKLAY3_SEQ,a0
|
||
jrnz #ck4
|
||
addi 760,a9 ;!!!
|
||
jruc #fixperc
|
||
#ck4
|
||
cmpi DUNKLAY2_SEQ,a0
|
||
jrnz #ck6
|
||
addi 760,a9 ;!!!
|
||
jruc #fixperc
|
||
#ck6
|
||
cmpi DUNKLAY3A_SEQ,a0
|
||
jrnz #ck6a
|
||
addi 760,a9 ;!!!
|
||
jruc #fixperc
|
||
#ck6a
|
||
cmpi DUNKLAY6_SEQ,a0
|
||
jrnz #ck7
|
||
addi 760,a9 ;!!!
|
||
#fixperc
|
||
; movi 750,a0 ;!!! ;Should layups be blockable?
|
||
|
||
|
||
; movi 800,a0 ;!!! ;Should layups be blockable?
|
||
; calla RNDPER
|
||
; jrhi #fixde
|
||
;FIX!! Maybe
|
||
;Should layups be unblockable - time will tell
|
||
;Allow layups to be blocked...
|
||
;Remove this for now... 4/2/96
|
||
; movi TSEC*2-20,a0 ;!!! ;Don't allow blocked layups
|
||
; callr plyr_setshtdly
|
||
jruc #fixde
|
||
|
||
#ck7
|
||
cmpi LAYUPREB_SEQ,a0
|
||
jreq #ly ;Layup?
|
||
cmpi DUNKLAY_SEQ,a0
|
||
jreq #ly ;Layup?
|
||
cmpi LAYUP_SEQ,a0 ;Put back layup
|
||
jreq #ly
|
||
move *a13(plyr_seqflgs),a14 ;Chk funky new layups
|
||
btst LAYUP_B,a14
|
||
jrz #noly
|
||
#ly
|
||
movi 850,a9 ;!!! ;Base shot % for layup
|
||
; movi 990,a9 ;!!! ;Base shot % for layup
|
||
|
||
move *a13(plyr_ptsdown),a1
|
||
subk 2,a0
|
||
jrge #noairb ;Losing by 2 or more? No airball
|
||
|
||
move *a13(plyr_ptsdown),a1 ;Is plyr losing?
|
||
jrgt #noms ; br=yes
|
||
|
||
movi 100,a0 ;!!! ;Pull down % sometimes
|
||
calla RNDPER
|
||
jrls #noms
|
||
movi 650,a9 ;!!!
|
||
#noms
|
||
;; movi 700,a0 ;!!! ;No blocked layups sometimes
|
||
; movi 800,a0 ;!!! ;No blocked layups sometimes
|
||
; calla RNDPER
|
||
; jrhi #fixde
|
||
;;FIX!!
|
||
;;Should layups be unblockable - time will tell
|
||
;;Remove this for now... 4/2/96
|
||
; movi TSEC*2-20,a0 ;!!! ;Don't allow blocked layups
|
||
; callr plyr_setshtdly
|
||
jruc #fixde
|
||
|
||
#noly
|
||
cmpi HOOK_SEQ,a0
|
||
jreq #hk
|
||
cmpi HOOK2_SEQ,a0
|
||
jrne #nohk
|
||
#hk
|
||
movi 700,a9 ;!!! ;Base shot % for hook
|
||
|
||
movi 120,a0 ;!!! ;Pull down % sometimes
|
||
calla RNDPER
|
||
jrls #fixde
|
||
movi 450,a9 ;!!!
|
||
; jruc #fixde
|
||
|
||
#nohk
|
||
#fixde
|
||
|
||
;--------------------
|
||
|
||
move a10,a3 ;A3=hoop dir (0-7F)
|
||
move a11,a1 ;A1=hoop dist
|
||
sll 32-6,a3 ;Throw out dir msb for range of (0-3F)
|
||
srl 32-6,a3
|
||
subk >20,a3 ;Make dir be just angle offset from
|
||
abs a3 ; dirs (0base) 2 or 6 (0-1F)
|
||
|
||
move *a13(plyr_ohpdist),a14 ;distance from hoop
|
||
move a14,@shot_distance
|
||
movk 1,a14
|
||
move a14,@shot_percentage ;start at 100%
|
||
|
||
|
||
;This flag disallows rejected rebounds for about 2 seconds after rim hit.
|
||
;Zero it upon new shot.
|
||
clr a0
|
||
.ref must_rebound
|
||
move a0,@must_rebound
|
||
|
||
|
||
.if DEBUG
|
||
;(FIX!!!)
|
||
movk 1,a14
|
||
move a14,@pup_showshotper
|
||
.endif
|
||
move @pup_showshotper,a14
|
||
jrz #nosp
|
||
|
||
PUSH a1,a2,a7,a8,a9,a10
|
||
|
||
move @crplate_ptr,a2,L
|
||
move *a2(ODATA_p),a7,L
|
||
jrz #makesp
|
||
|
||
callr make_ssp_ptrs
|
||
|
||
move *a7(PA10),a8,L
|
||
move *a8(OCTRL),a1
|
||
move *a10,a0,L
|
||
calla obj_aniq_cnoff
|
||
|
||
move *a7(PA8),a8,L
|
||
move *a8(OCTRL),a1
|
||
move *a9,a0,L
|
||
calla obj_aniq_cnoff
|
||
|
||
movi TSEC*2,a0
|
||
move a0,*a7(PTIME)
|
||
jruc #madesp
|
||
#makesp
|
||
CREATE >6000,plyr_showshotpercent
|
||
move a0,*a2(ODATA_p),L
|
||
#madesp
|
||
PULL a1,a2,a7,a8,a9,a10
|
||
#nosp
|
||
|
||
;--------------------
|
||
|
||
movk 1,a10 ;A10=normal shot arc
|
||
|
||
PUSH a1
|
||
movk 16,a0 ;!!! All shots chance of flat arc
|
||
calla RNDPER
|
||
jrls #noflat0
|
||
clr a10 ;A10=flat shot arc
|
||
#noflat0
|
||
move *a13(plyr_seqflgs),a14
|
||
btst LAYUP_B,a14 ;Doing a lay-up?
|
||
jrz #noflat ; br=no
|
||
movi 100,a0 ;!!! Lay-up chance of flat arc
|
||
calla RNDPER
|
||
jrls #noflat
|
||
clr a10 ;A10=flat shot arc
|
||
#noflat
|
||
PULL a1
|
||
|
||
; jruc #miss ;DEBUG
|
||
; jruc #good ;DEBUG
|
||
|
||
;--------------------
|
||
; See if we should do a bank shot
|
||
|
||
subk >18,a3 ;!!! Would bank angle be too steep?
|
||
jrge #athoop ; br=yes, don't bank
|
||
|
||
move @plyr_onfire,a0 ;Is someone on-fire?
|
||
jrnz #athoop ; br=yes, don't bank
|
||
|
||
;; move *a13(plyr_num),a14
|
||
;; move @plyr_onfire,a0
|
||
;; btst a14,a0 ;Is the shooter on-fire?
|
||
;; jrz #cont ; br=no
|
||
;; move @PSTATUS,a0
|
||
;; btst a14,a0 ;Is the shooter a human?
|
||
;; jrnz #athoop ; br=yes, don't bank
|
||
;;#cont
|
||
cmpi 100,a1 ;!!! Too far for short bank?
|
||
jrgt #longshot ; br=yes
|
||
|
||
;; movk 2,a0 ;33% chance
|
||
;; move *a13(plyr_seqflgs),a14
|
||
;; btst LAYUP_B,a14
|
||
;; jrnz #fmfront
|
||
|
||
move *a13(plyr_seq),a14
|
||
;FIX!!! Determine which seq(s) should always close bank
|
||
cmpi DUNKLAY5_SEQ,a14 ;In a seq that wants a short bank?
|
||
jrz #offbb ; br=yes
|
||
|
||
movk 4,a0 ;!!! 20% chance
|
||
addk 8,a3 ;More in front of board?
|
||
jrlt #fmfront ; br=yes
|
||
movk 3,a0 ;!!! 25% chance for steeper angles
|
||
#fmfront
|
||
callr rndrng0
|
||
move a0,a0 ;Beat the odds?
|
||
jrnz #athoop ; br=no, don't bank
|
||
|
||
#offbb ;>Close bank shot
|
||
movk 15,a10 ;!!! 1 in 16 chance of flat arc
|
||
|
||
movi -10,a4 ;!!! =X offset
|
||
movi -8,a5 ;!!! =Y offset
|
||
movk 2,a6 ;!!!
|
||
|
||
movi 999,a0
|
||
callr rndrng0
|
||
and a0,a10 ;A10=flat shot arc
|
||
cmp a0,a9 ;Beat shot % odds?
|
||
jrgt #cbgood ; br=yes
|
||
#cbbad
|
||
movk 3,a0 ;Randomize X offset for some misses
|
||
callr rndrng0
|
||
addk 1,a0
|
||
sll 1,a0
|
||
sub a0,a4
|
||
movk 1,a0 ;Randomize Z offset for some misses
|
||
callr rndrng0
|
||
sll 4,a0
|
||
subk 8,a0
|
||
move a0,a2
|
||
jruc #cbdxdy
|
||
|
||
#cbgood
|
||
move *a7(OZPOS),a3
|
||
subi CZMID,a3 ;=ball Z delta from hoop
|
||
sll 8,a3
|
||
|
||
move *a7(OXPOS),a14
|
||
move *a7(OIMG),a1,L
|
||
move *a1(IANIOFFX),a1
|
||
add a1,a14 ;=ball ctr X
|
||
move *a13(plyr_ohoopx),a1
|
||
sub a14,a1 ;=ball X delta from hoop
|
||
abs a1
|
||
jrz #cbnodiv ; br=delta X=0 (should never be)?
|
||
divs a1,a3
|
||
#cbnodiv
|
||
mpys a6,a3
|
||
sra 8,a3
|
||
move a3,a2 ;=Z offset
|
||
#cbdxdy
|
||
move a4,a0 ;=X offset
|
||
move a5,a1 ;=Y offset
|
||
jruc #calcshot
|
||
|
||
#longshot ;>Long bank shot
|
||
addk 8,a3 ;!!! Would bank angle be too steep?
|
||
jrge #athoop ; br=yes, don't bank
|
||
|
||
movk 3,a0 ;!!! 75% chance
|
||
callr rnd ;Beat the odds?
|
||
jrnz #athoop ; br=no, don't bank
|
||
|
||
movi -12,a4 ;!!! =X offset
|
||
movi -10,a5 ;!!! =Y offset
|
||
movk 2,a6 ;!!!
|
||
|
||
movi 999,a0
|
||
callr rndrng0
|
||
cmp a0,a9 ;Beat shot % odds?
|
||
jrgt #cbgood ; br=yes
|
||
jruc #cbbad ;Make shot miss
|
||
|
||
;--------------------
|
||
|
||
#athoop
|
||
cmpi 55,a9 ;25
|
||
jrge #notlng
|
||
cmpi >148,a11
|
||
jrlt #notlng
|
||
|
||
movi 120,a0 ;250
|
||
calla RNDPER
|
||
jrls #noairb
|
||
jruc #airok
|
||
#notlng
|
||
movk >1f,a0 ;3%
|
||
cmpi 55,a11
|
||
jrge #chkairb ;Not a close shot?
|
||
movi >7f,a0 ;1.5%
|
||
#chkairb
|
||
callr rnd
|
||
jrnz #noairb ;No air ball?
|
||
|
||
move *a13(plyr_ptsdown),a0
|
||
subk 2,a0
|
||
jrge #noairb ;Losing by 2 or more? No airball
|
||
|
||
move @plyr_onfire,a14 ;Is someone on-fire?
|
||
jrnz #noairb ; br=yes, don't do airball
|
||
|
||
; move *a13(plyr_num),a0
|
||
; btst a0,a14 ;Is the shooter on-fire?
|
||
; jrnz #noairb ; br=yes, don't do airball
|
||
|
||
move *a13(plyr_o1dist),a14 ;Totally open shot?
|
||
cmpi 50*DIST_REDUCTION,a14
|
||
jrlt #airok
|
||
move *a13(plyr_o2dist),a14
|
||
cmpi 50*DIST_REDUCTION,a14
|
||
jrgt #noairb
|
||
#airok
|
||
|
||
movi -1,a0
|
||
move a0,@plyrairballoff
|
||
|
||
move a7,a2
|
||
CREATE0 plyr_airballsnd
|
||
movi -1,a0
|
||
move a0,@shot_percentage ;miss
|
||
move a2,a7
|
||
|
||
movk 20,a2 ;>Air ball ;18
|
||
movk 1,a0
|
||
callr rnd
|
||
jrnz #airf
|
||
neg a2 ;-Z
|
||
#airf
|
||
clr a0 ;=X offset
|
||
clr a1 ;=Y offset
|
||
|
||
; movi -40,a0
|
||
; movi -30,a1 ;Y
|
||
jruc #calcshot
|
||
|
||
;--------------------
|
||
|
||
#noairb
|
||
movi 999,a0 ;>Shoot at hoop
|
||
callr rndrng0
|
||
addi 50,a9 ;Adj for better %
|
||
cmp a0,a9 ;Beat shot % odds?
|
||
jrgt #good ; br=yes, make shot score
|
||
|
||
#miss
|
||
clr a0
|
||
move a0,@shot_percentage ;miss
|
||
|
||
movk >1f,a0 ;Miss
|
||
callr rnd
|
||
sll 4,a0
|
||
addi #misszx_t,a0
|
||
move *a0,a5
|
||
move *a0(8*16),a3
|
||
|
||
movk 1,a0 ;50%
|
||
callr rnd
|
||
jrnz #miss2
|
||
|
||
movk 2,a0 ;More towards rim edge
|
||
callr rndrng0
|
||
addk 6,a0 ;7 ;Vel multiplier range
|
||
jruc #miss3
|
||
#miss2
|
||
movk 3,a0 ;Regular miss (they go in a fair amount)
|
||
callr rnd
|
||
addk 4,a0 ;6 ;Vel multiplier range
|
||
#miss3
|
||
mpys a0,a3
|
||
mpys a0,a5
|
||
move a3,a0
|
||
move a5,a2
|
||
sra 12,a0 ;=X offset
|
||
sra 12,a2 ;=Z offset
|
||
|
||
jruc #cyo
|
||
|
||
#good
|
||
movk 4,a0 ;>Make shot score
|
||
callr rndrng0
|
||
subk 2,a0
|
||
move a0,a2 ;=Z offset
|
||
|
||
movk 4,a0
|
||
callr rndrng0
|
||
subk 2,a0 ;=X offset
|
||
#cyo
|
||
movi -3,a1 ;=Y offset
|
||
|
||
;--------------------
|
||
; a0=shot X offset
|
||
; a1=shot Y offset
|
||
; a2=shot Z offset
|
||
; a7=ball *obj
|
||
; a10=!0 for normal shot arc, 0 for flat shot arc
|
||
;
|
||
;Dan, 5% shots go in about 50% of time, we need to make this more like 25%!
|
||
;I think... Maybe we should play a little longer....
|
||
|
||
#calcshot
|
||
move *a13(plyr_ohoopx),a3
|
||
cmpi WRLDMID,a3
|
||
jrlt #lhoop
|
||
neg a0
|
||
#lhoop
|
||
add a0,a3 ;Add X offset
|
||
move *a7(OXPOS),a14
|
||
move *a7(OIMG),a5,L
|
||
move *a5(IANIOFFX),a5
|
||
add a5,a14 ;=ball ctr X
|
||
sub a14,a3 ;X delta
|
||
|
||
movi CZMID,a5
|
||
add a2,a5
|
||
move *a7(OZPOS),a14
|
||
sub a14,a5 ;Z delta
|
||
|
||
move a1,a2
|
||
|
||
move a3,a4 ;>Calc distance (long+short/2.667)
|
||
move a5,a14
|
||
abs a4
|
||
abs a14
|
||
cmp a14,a4
|
||
jrhs #xbig
|
||
SWAP a14,a4
|
||
#xbig sra 1,a14 ;/2
|
||
add a14,a4
|
||
sra 2,a14 ;/8
|
||
sub a14,a4
|
||
|
||
cmpi 170,a4
|
||
jrls #distok
|
||
move a4,a14 ;>Reduce excess
|
||
movi 170,a4
|
||
sub a4,a14
|
||
sra 3,a14 ;/8
|
||
add a14,a4
|
||
#distok
|
||
move a4,a1
|
||
movi 110,a14 ;120
|
||
mpys a14,a1
|
||
move a1,a4
|
||
sra 8,a4 ;/256
|
||
|
||
movi 50,a14 ;!!! Min tick for normal shot arc
|
||
move a10,a10 ;Normal or flat shot arc?
|
||
jrnz #chkmin ; br=normal
|
||
movi 35,a14 ;!!! Min tick for flat shot arc
|
||
move a4,a1 ;Reduce tick cnt 25% to flatten shot
|
||
sra 2,a1
|
||
sub a1,a4
|
||
#chkmin
|
||
cmp a14,a4
|
||
jrge #divok
|
||
move a14,a4
|
||
|
||
#divok
|
||
move *a13(plyr_seq),a1
|
||
; move *a13(plyr_seqflgs),a14
|
||
; btst LAYUP_B,a14
|
||
; jrz #hkck
|
||
;
|
||
; jruc #hkck
|
||
;
|
||
; addk 2,a4 ;8
|
||
; move @HCOUNT,a14
|
||
; btst 0,a14
|
||
; jrz #hko
|
||
; subk 10,a4
|
||
; jruc #hko
|
||
;
|
||
;#hkck
|
||
cmpi HOOK_SEQ,a1
|
||
jrnz #hky
|
||
addk 15,a4 ;Make hook shot go a bit higher
|
||
jruc #hko
|
||
#hky
|
||
cmpi HOOK2_SEQ,a1
|
||
jrnz #hko
|
||
subk 10,a4
|
||
#hko
|
||
addk 2,a4
|
||
movk 10,a0
|
||
calla RNDPER
|
||
jrls #regshot
|
||
;Try a rainbow!
|
||
move @shot_distance,a0
|
||
|
||
;This is OK...
|
||
;Check to make sure a rainbow can happen from corners
|
||
cmpi >104,a0
|
||
jrgt #regshot
|
||
addk 20,a4
|
||
|
||
SOUND1 rainbow_sp
|
||
|
||
#regshot
|
||
sll 16,a3
|
||
sll 16,a5
|
||
divs a4,a3
|
||
divs a4,a5
|
||
|
||
; move *a8(OXVEL),a1,L
|
||
; sra 3,a1
|
||
; add a1,a3
|
||
|
||
move @plyrairballoff,a0
|
||
jrnn #nobrick1
|
||
clr a0
|
||
move a0,@plyrairballoff
|
||
|
||
clr a0
|
||
move a0,@ballgoaltcnt
|
||
|
||
move a3,a0
|
||
sra 2,a0
|
||
sub a0,a3
|
||
; move *a13(plyr_num),a14
|
||
; cmpi 2,a14
|
||
; jrge #nobrick1
|
||
; add a0,a3
|
||
; add a0,a3
|
||
#nobrick1
|
||
move a3,*a7(OXVEL),L
|
||
|
||
; move *a8(OZVEL),a1,L
|
||
; sra 3,a1 ;/8
|
||
; add a1,a5
|
||
move a5,*a7(OZVEL),L
|
||
|
||
movi -GRAVB/2,a1
|
||
mpys a4,a1
|
||
move *a7(OYVAL),a3,L ;Adjust for hgt difference
|
||
addi HOOPY-8,a2
|
||
sll 16,a2
|
||
sub a2,a3 ;- if above
|
||
divs a4,a3
|
||
sub a3,a1
|
||
|
||
move a1,*a7(OYVEL),L
|
||
|
||
addk 2,a4
|
||
; subk 1,a4 ;Allows goaltend of airballs
|
||
|
||
move a4,@ballgoaltcnt
|
||
|
||
move *a13(plyr_num),a1 ;A1=Plyr #
|
||
move a1,@ballpnumshot
|
||
move a1,@ballpnumlast
|
||
move a1,@ballsclastp
|
||
move a1,@ballshotinair ;Shooter # if shot in air, else -1
|
||
|
||
clr a0
|
||
move a0,@ballprcv_p,L
|
||
move a0,@ballscorezhit
|
||
move a0,@ballrimhitcnt
|
||
move a0,@ballbbhitcnt
|
||
move a0,@plyrcharge
|
||
move a0,*a13(plyr_ownball)
|
||
not a0 ;=-1
|
||
move a0,@ballpnum ;No owner
|
||
|
||
;FIX!!! Need yo look into this...
|
||
;Don't allow ball collisions for x ticks....
|
||
;This is for all shots!
|
||
; movi 50,a0 ;40
|
||
movi 45,a0 ;40
|
||
move a0,*a13(plyr_shtdly)
|
||
;>Inc try shot stat
|
||
;If a player shoots a three and his teammate is in an ALLEY-OOP seq.
|
||
; then dont let'em catch it (unless teammate is a drone)
|
||
|
||
move @ballptsforshot,a0
|
||
subk 2,a0
|
||
jrle #ignre
|
||
move *a13(plyr_tmproc_p),a0,L
|
||
move *a0(plyr_num),a14
|
||
move @PSTATUS,a9
|
||
btst a14,a9
|
||
jrnz #ignre ;br=a human teammate
|
||
move *a0(plyr_seq),a14
|
||
cmpi ALLEYOOP1_SEQ,a14
|
||
jrlo #ignre
|
||
cmpi ALLEYOOP14_SEQ,a14
|
||
jrhi #ignre
|
||
movi 2*TSEC,a14 ;roughly 2 seconds.
|
||
move a14,*a0(plyr_shtdly)
|
||
#ignre
|
||
move *a13(plyr_seqflgs),a0
|
||
btst LAYUP_B,a0
|
||
jrnz #x
|
||
|
||
movi PS_2PTS_TRY,a0
|
||
move @ballptsforshot,a14
|
||
subk 2,a14
|
||
jreq #2ptr
|
||
movk PS_3PTS_TRY,a0
|
||
#2ptr calla inc_player_stat
|
||
|
||
#x
|
||
move *a13(plyr_num),a0 ;Plyr # shooting
|
||
calla shoots_speech
|
||
|
||
PULL a6,a7,a9,a10,a11
|
||
rets
|
||
|
||
|
||
#misszx_t
|
||
.word -4096,-4017,-3784,-3406,-2896,-2275,-1567,-799
|
||
.word 0,799,1567,2275,2896,3406,3784,4017
|
||
.word 4096,4017,3784,3406,2896,2275,1567,799
|
||
.word 0,-799,-1567,-2275,-2896,-3406,-3784,-4017
|
||
.word -4096,-4017,-3784,-3406,-2896,-2275,-1567,-799
|
||
|
||
|
||
#*******************************
|
||
* Make shot percentage digit ptrs
|
||
* A9=Percent (0-1000)
|
||
* >A10=*tens digit *img
|
||
* >A9=*ones digit *img
|
||
* Destroys A8
|
||
|
||
SUBR make_ssp_ptrs
|
||
|
||
movk 10,a10
|
||
divu a10,a9
|
||
|
||
cmpi 99,a9
|
||
jrls #maxok
|
||
movi 99,a9
|
||
#maxok
|
||
clr a8
|
||
divu a10,a8
|
||
sll 5,a8
|
||
sll 5,a9
|
||
movi #f_t,a10
|
||
add a10,a9
|
||
add a8,a10
|
||
|
||
rets
|
||
|
||
#f_t
|
||
.long font60,font61,font62,font63,font64
|
||
.long font65,font66,font67,font68,font69
|
||
|
||
|
||
#*******************************
|
||
* Show shot percentage (process)
|
||
* A9=Percent (0-1000)
|
||
|
||
SUBRP plyr_showshotpercent
|
||
|
||
;; PUSHP a11 ;Save hoop-2-plyr dist
|
||
|
||
.if DEBUG
|
||
cmpi 5700,a9
|
||
jrlo #pss
|
||
; LOCKUP
|
||
#pss
|
||
.endif
|
||
|
||
callr make_ssp_ptrs
|
||
|
||
move *a10,a2,L
|
||
movi [SCOREBRD_X+26,0],a0
|
||
movi [SCOREBRD_Y+13,0],a1
|
||
movi SCOREBRD_Z,a3
|
||
movi DMAWNZ|M_NOCOLL|M_SCRNREL,a4
|
||
movi CLSDEAD,a5
|
||
clr a6
|
||
clr a7
|
||
calla BEGINOBJ2
|
||
move a8,a10
|
||
|
||
move *a9,a2,L
|
||
movi [SCOREBRD_X+32,0],a0
|
||
movi [SCOREBRD_Y+13,0],a1
|
||
calla BEGINOBJ2
|
||
|
||
movi SHOTPER,a9,L ;Change credit plate
|
||
move @crplate_ptr,a11,L
|
||
move *a9(ISAG),*a11(OSAG),L
|
||
|
||
SLEEP TSEC*2
|
||
|
||
move *a11(OIMG),a9,L ;Restore previous credit plate
|
||
move *a9(ISAG),*a11(OSAG),L
|
||
clr a9
|
||
move a9,*a11(ODATA_p),L
|
||
|
||
;; PULLP a11 ;Retrieve hoop-2-plyr dist
|
||
|
||
move a10,a0
|
||
calla DELOBJ
|
||
jauc DELOBJDIE
|
||
|
||
|
||
|
||
#*******************************
|
||
* Make sound for airball (process)
|
||
|
||
SUBRP plyr_airballsnd
|
||
|
||
SLEEP 80
|
||
|
||
move @plyrairballoff,a0
|
||
jrnz #x
|
||
.ref crwd_arbl_sp
|
||
SOUND1 crwd_arbl_sp
|
||
|
||
movk 4,a0
|
||
calla rndrng0
|
||
sll 5,a0
|
||
addi #airbl_sp_tbl,a0
|
||
move *a0,a0,L
|
||
calla snd_play1
|
||
#x DIE
|
||
|
||
#airbl_sp_tbl
|
||
.long airball_sp
|
||
.long sht_stunk_sp
|
||
.long misd_mile_sp
|
||
.long way_shrt_sp
|
||
.long misd_evry_sp
|
||
|
||
|
||
#*******************************
|
||
* Start player pass to teammate
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A5
|
||
|
||
SUBRP plyr_startpass
|
||
|
||
PUSH a6,a7
|
||
|
||
move *a13(plyr_tmproc_p),a4,L
|
||
|
||
move *a4(plyr_seqflgs),a14
|
||
btst DUNK_B,a14
|
||
jrz #psp1a ;br=not dunk,in air = no pass
|
||
|
||
move *a13(plyr_seqflgs),a14
|
||
btst DUNK_B,a14
|
||
jrnz #x ;br=both in dunk = no pass
|
||
|
||
jruc #cont
|
||
#psp1a
|
||
move *a4(plyr_jmpcnt),a0
|
||
jrnz #x
|
||
#cont
|
||
move *a13(plyr_seqdir),a14
|
||
move a14,*a13(plyr_old_seqdir)
|
||
|
||
move *a13(plyr_num),a1
|
||
inc a1
|
||
move a1,@assist_plyr
|
||
movi 3*60+30,a0
|
||
move a0,@assist_delay
|
||
|
||
move a10,a2
|
||
move a4,a10
|
||
calla arw_on1plyr ;Guy who picks up ball gets arw
|
||
move a2,a10
|
||
move a4,@ballprcv_p,L
|
||
|
||
move *a4(PA8),a2,L ;Get teammates obj
|
||
move *a2(OXPOS),a6
|
||
move *a2(OXANI+16),a14
|
||
add a14,a6
|
||
move *a2(OZPOS),a7
|
||
|
||
move *a4(plyr_seqflgs),a14
|
||
btst DUNK_B,a14
|
||
jrz #psp2 ;br=teammate not in a dunk
|
||
|
||
; DONT worry about this, cause plyr_pass isn't called for nine ticks after
|
||
; the pass button was pushed...thus startdunk will have been called
|
||
; and velocities set!!
|
||
;
|
||
; move *a4(plyr_jmpcnt),a14
|
||
; jrz #x
|
||
move *a4(plyr_slam_ticks),a2
|
||
move *a4(plyr_jmpcnt),a14
|
||
sub a14,a2
|
||
jrle #x ;br=to late for pass
|
||
subk 20,a2 ;at least 20 ticks b4 slam ?
|
||
jrle #x ;br=no
|
||
|
||
callr seekdirdist_obxz128
|
||
move a0,*a13(plyr_newdir) ;Turn toward alley-ooper
|
||
|
||
clr a2
|
||
move *a13(plyr_ptsdown),a14
|
||
addk 3,a14
|
||
jrge #losing
|
||
movi 100,a0 ;Make alleys doink sometimes
|
||
calla RNDPER ; if plyr is ahead
|
||
jrls #losing
|
||
movi 500,a2
|
||
#losing
|
||
move a2,@shot_distance
|
||
movi ALLEYOOP_PAS_SEQ,a0
|
||
move *a13(plyr_jmpcnt),a14
|
||
jrz #reg
|
||
movi PASSDO_SEQ,a0
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 110*DIST_REDUCTION,a14
|
||
jrgt #reg
|
||
movi PASSDO2_SEQ,a0
|
||
|
||
#reg
|
||
|
||
; move *a13(plyr_dir),a7
|
||
move *a13(plyr_newdir),a7 ;Turn toward alley-ooper
|
||
callr plyr_setseq
|
||
; jruc #end
|
||
movi -1,a3
|
||
jruc #bhin
|
||
|
||
#psp2
|
||
move @inbound,a0
|
||
jrnn #notnl4 ;Inbounding the ball?
|
||
|
||
;DEBUG - Check no look pass code/art
|
||
; jruc #nlcont
|
||
|
||
|
||
;How often do we try a no look pass?
|
||
movi 200,a0
|
||
calla RNDPER
|
||
jrls #notnl4 ;BR=nope
|
||
|
||
move *a13(plyr_jmpcnt),a14
|
||
jrnz #notnl4 ;In air?
|
||
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 90*DIST_REDUCTION,a14
|
||
jrlt #notnl4 ;Too short?
|
||
subi 320*DIST_REDUCTION,a14
|
||
jrgt #notnl4 ;Too far?
|
||
|
||
#nlcont
|
||
|
||
;Check to see if teammate is in an ok position to receive a no look
|
||
;pass based on what direction passer is facing and teammate is located.
|
||
|
||
;Directions are 0-7
|
||
;
|
||
;
|
||
; 0
|
||
; 7 1
|
||
; 6 2
|
||
; 5 3
|
||
; 4
|
||
;
|
||
;
|
||
|
||
callr seekdirdist_obxz128
|
||
move a1,a2
|
||
|
||
; move *a13(plyr_dir),a14
|
||
; sub a0,a14
|
||
; abs a14
|
||
; cmpi >20,a14
|
||
; jrhs #notbh
|
||
|
||
move a0,a14
|
||
addi >40,a14
|
||
sll 32-7,a14
|
||
srl 32-7,a14
|
||
|
||
addk 8,a0 ;Round off
|
||
sll 32-7,a0
|
||
srl 32-7+4,a0 ;Kill frac
|
||
|
||
move *a13(plyr_seqdir),a1
|
||
; move a1,*a13(plyr_old_seqdir)
|
||
|
||
;
|
||
; a0 = teammates dir
|
||
; a1 = passers seq. dir
|
||
;
|
||
;Facing up scrn
|
||
cmpi 0,a1
|
||
jrnz #nldir2
|
||
|
||
;Allow 2 angle
|
||
cmpi 2,a0
|
||
jrz #nldo1
|
||
|
||
;Allow 6 angle if I X flip passer
|
||
|
||
cmpi 6,a0
|
||
jrnz #notnl4
|
||
|
||
;X flip after seq starts
|
||
movi PASSNL_SEQ,a0
|
||
move a0,a3
|
||
callr plyr_setseq
|
||
|
||
movi M_FLIPH,a3
|
||
move a3,*a13(plyr_anirevff)
|
||
clr a3
|
||
dec a3
|
||
jruc #bhconta
|
||
#nldo1
|
||
movi PASSNL_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
|
||
#nldir2 ;2 direction possibility
|
||
;Facing up & right on scrn
|
||
cmpi 1,a1
|
||
jrnz #nldir2a
|
||
|
||
;Allow 2,3 angle
|
||
cmpi 2,a0
|
||
jrz #nldo2
|
||
cmpi 3,a0
|
||
jrnz #nldir2a
|
||
|
||
#nldo2
|
||
movi PASSNL_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
|
||
#nldir2a
|
||
;Facing up & left on scrn
|
||
cmpi 7,a1
|
||
jrnz #nldir3
|
||
|
||
;Allow 5,6 angle
|
||
cmpi 5,a0
|
||
jrz #nldo2
|
||
cmpi 6,a0
|
||
jrz #nldo2
|
||
|
||
#nldir3
|
||
;Facing right on scrn
|
||
cmpi 2,a1
|
||
jrnz #nldir3a
|
||
|
||
;Allow 4 angle
|
||
cmpi 4,a0
|
||
; jrz #nldo3
|
||
; cmpi 3,a0
|
||
jrnz #nldir3a
|
||
|
||
#nldo3
|
||
movi PASSNL_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
|
||
#nldir3a
|
||
;Facing left on scrn
|
||
cmpi 6,a1
|
||
jrnz #nldir4
|
||
|
||
;Allow 4 angle
|
||
cmpi 4,a0
|
||
jrz #nldo3
|
||
; cmpi 6,a0
|
||
; jrz #nldo3
|
||
|
||
|
||
#nldir4
|
||
;Facing down & right on scrn
|
||
cmpi 3,a1
|
||
jrnz #nldir4a
|
||
|
||
;Allow 5 angle
|
||
cmpi 5,a0
|
||
; jrz #nldo2
|
||
; cmpi 3,a0
|
||
jrnz #nldir4a
|
||
|
||
#nldo4
|
||
movi PASSNL_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
|
||
#nldir4a
|
||
;Facing down & left on scrn
|
||
cmpi 5,a1
|
||
jrnz #nldir5
|
||
|
||
;Allow 3 angle
|
||
cmpi 3,a0
|
||
jrz #nldo4
|
||
; cmpi 6,a0
|
||
; jrz #nldo2
|
||
|
||
#nldir5
|
||
;Facing down on scrn
|
||
cmpi 4,a1
|
||
jrnz #notnl4
|
||
|
||
;Allow 6 angle
|
||
cmpi 6,a0
|
||
; jrz #nldo5
|
||
; cmpi 3,a0
|
||
jrnz #nldir5a
|
||
|
||
#nldo5
|
||
movi PASSNL_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
|
||
#nldir5a
|
||
;Allow 2 angle if I X flip passer
|
||
|
||
cmpi 2,a0
|
||
jrnz #notnl4
|
||
|
||
;X flip after seq starts
|
||
movi PASSNL_SEQ,a0
|
||
move a0,a3
|
||
callr plyr_setseq
|
||
|
||
movi M_FLIPH,a3
|
||
move a3,*a13(plyr_anirevff)
|
||
clr a3
|
||
dec a3
|
||
jruc #bhconta
|
||
|
||
|
||
#notnl4
|
||
|
||
;DEBUG - Check behind the back pass code/art
|
||
; jruc #bhcont
|
||
|
||
|
||
movi 350,a0
|
||
calla RNDPER
|
||
jrls #notbh
|
||
|
||
move *a13(plyr_jmpcnt),a14
|
||
jrnz #notbh ;In air?
|
||
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 90*DIST_REDUCTION,a14
|
||
jrlt #notbh ;Too short?
|
||
subi 360*DIST_REDUCTION,a14
|
||
jrgt #notbh ;Too far?
|
||
|
||
;Only decent passers can do behind the back passes
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_PASS),a14
|
||
cmpi 5,a14
|
||
jrlt #notbh
|
||
|
||
move *a13(plyr_o1dist),a1
|
||
cmpi >78*DIST_REDUCTION,a1
|
||
jrlt #notbh
|
||
move *a13(plyr_o2dist),a1
|
||
cmpi >78*DIST_REDUCTION,a1
|
||
jrlt #notbh
|
||
|
||
;Want to stop ball from being inbounded using the BHPASS
|
||
|
||
move @inbound,a0
|
||
jrn #bhcont ;Inbounding the ball?
|
||
|
||
;I'm ahead, maybe still do cocky inbound
|
||
|
||
move *a13(plyr_ptsdown),a1
|
||
jrgt #notbh ;If losing, don't bhpass
|
||
addk 6,a1
|
||
jrge #notbh ;If ahead by 7 or more, allow attempt
|
||
#bhcont
|
||
|
||
;Check to see if teammate is in an ok position to receive a behind the back
|
||
;pass based on what direction passer is facing and teammate is located.
|
||
|
||
;Directions are 0-7
|
||
;
|
||
;
|
||
; 0
|
||
; 7 1
|
||
; 6 2
|
||
; 5 3
|
||
; 4
|
||
;
|
||
;
|
||
;Rules for T1HINDR10-6 art:
|
||
;
|
||
;If passer is facing 0 and teammate is in 1,2 then do it,
|
||
;or if passer is facing 0, but art is flipped, and teammate is in 7,8 then
|
||
;do it.
|
||
;
|
||
|
||
|
||
callr seekdirdist_obxz128
|
||
move a1,a2
|
||
|
||
; move *a13(plyr_dir),a14
|
||
; sub a0,a14
|
||
; abs a14
|
||
; cmpi >20,a14
|
||
; jrhs #notbh
|
||
|
||
move a0,a14
|
||
addi >40,a14
|
||
sll 32-7,a14
|
||
srl 32-7,a14
|
||
|
||
addk 8,a0 ;Round off
|
||
sll 32-7,a0
|
||
srl 32-7+4,a0 ;Kill frac
|
||
|
||
move *a13(plyr_seqdir),a1
|
||
; move a1,*a13(plyr_old_seqdir)
|
||
|
||
;
|
||
; a0 = teammates dir
|
||
; a1 = passers seq. dir
|
||
;
|
||
;Facing up scrn
|
||
cmpi 0,a1
|
||
jrnz #dir2
|
||
|
||
;Allow 1,2 angle
|
||
cmpi 1,a0
|
||
jrz #do1
|
||
cmpi 2,a0
|
||
jrz #do1
|
||
|
||
;Allow 6,7 angle if I X flip passer
|
||
|
||
cmpi 6,a0
|
||
jrz #do1a
|
||
cmpi 7,a0
|
||
jrnz #notbh
|
||
|
||
#do1a
|
||
;X flip after seq starts
|
||
movi PASSBH_SEQ,a0
|
||
move a0,a3
|
||
callr plyr_setseq
|
||
|
||
movi M_FLIPH,a3
|
||
move a3,*a13(plyr_anirevff)
|
||
clr a3
|
||
dec a3
|
||
jruc #bhconta
|
||
#do1
|
||
movi PASSBH_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
|
||
#dir2 ;2 direction possibility
|
||
;
|
||
; a0 = teammates dir
|
||
; a1 = passers seq. dir
|
||
;
|
||
;Facing up & right on scrn
|
||
cmpi 1,a1
|
||
jrnz #dir2a
|
||
|
||
;Allow 1,2 angle
|
||
cmpi 1,a0
|
||
jrz #do2
|
||
cmpi 2,a0
|
||
jrnz #dir2a
|
||
#do2
|
||
movi PASSBH_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
#dir2a
|
||
;
|
||
; a0 = teammates dir
|
||
; a1 = passers seq. dir
|
||
;
|
||
;Facing up & left on scrn
|
||
cmpi 7,a1
|
||
jrnz #dir3
|
||
|
||
;Allow 6,7 angle
|
||
cmpi 6,a0
|
||
jrz #do2
|
||
cmpi 7,a0
|
||
jrz #do2
|
||
|
||
|
||
#dir3
|
||
;Facing up & right on scrn
|
||
cmpi 1,a1
|
||
jrnz #dir3a
|
||
|
||
;Allow 0,7 angle also
|
||
cmpi 0,a0
|
||
jrz #do3
|
||
cmpi 7,a0
|
||
jrnz #dir3a
|
||
#do3
|
||
;Do PASSBH2 because we already have a #2 BHPASS!
|
||
movi PASSBH2_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
|
||
#dir3a
|
||
;Facing up & left on scrn
|
||
cmpi 7,a1
|
||
jrnz #dir4
|
||
|
||
;Allow 0,1 angle also
|
||
cmpi 0,a0
|
||
jrz #do3
|
||
cmpi 1,a0
|
||
jrz #do3
|
||
|
||
#dir4
|
||
;Do #3 horizontal facing behind the back passes
|
||
;Facing right on scrn
|
||
cmpi 2,a1
|
||
jrnz #dir4a
|
||
|
||
;Allow 2,3 angle
|
||
cmpi 2,a0
|
||
jrz #do4
|
||
cmpi 3,a0
|
||
jrnz #dir4a
|
||
#do4
|
||
movi PASSBH_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
#dir4a
|
||
;Facing left on scrn
|
||
cmpi 6,a1
|
||
jrnz #dir5
|
||
|
||
;Allow 5,6 angle
|
||
cmpi 5,a0
|
||
jrz #do4
|
||
cmpi 6,a0
|
||
jrz #do4
|
||
|
||
#dir5
|
||
;Do #3 horizontal facing behind the back passes
|
||
;Facing right on scrn
|
||
cmpi 2,a1
|
||
jrnz #dir5a
|
||
|
||
;Allow 0,1 angle
|
||
cmpi 0,a0
|
||
jrz #do5
|
||
cmpi 1,a0
|
||
jrnz #dir5a
|
||
#do5
|
||
movi PASSBH2_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
#dir5a
|
||
;Facing left on scrn
|
||
cmpi 6,a1
|
||
jrnz #dir6
|
||
|
||
;Allow 0,7 angle
|
||
cmpi 0,a0
|
||
jrz #do5
|
||
cmpi 7,a0
|
||
jrz #do5
|
||
|
||
#dir6
|
||
;Do #4 facing behind the back passes
|
||
;Facing down & right on scrn
|
||
cmpi 3,a1
|
||
jrnz #dir6a
|
||
|
||
;Allow 3,4,5 angle
|
||
cmpi 3,a0
|
||
jrz #do6
|
||
cmpi 4,a0
|
||
jrz #do6
|
||
cmpi 5,a0
|
||
jrnz #dir6a
|
||
#do6
|
||
movi PASSBH_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
#dir6a
|
||
;Facing down & left on scrn
|
||
cmpi 5,a1
|
||
jrnz #dir7
|
||
|
||
;Allow 3,4,5 angle
|
||
cmpi 3,a0
|
||
jrz #do6
|
||
cmpi 4,a0
|
||
jrz #do6
|
||
cmpi 5,a0
|
||
jrz #do5
|
||
#dir7
|
||
;Facing down & right on scrn
|
||
cmpi 3,a1
|
||
jrnz #dir7a
|
||
|
||
;Allow 2,3 angle
|
||
cmpi 2,a0
|
||
jrz #do7
|
||
cmpi 3,a0
|
||
jrnz #dir7a
|
||
#do7
|
||
movi PASSBH2_SEQ,a0
|
||
move a14,*a4(plyr_newdir)
|
||
move *a13(plyr_dir),a7
|
||
jruc #bhpas
|
||
#dir7a
|
||
;Facing down & left on scrn
|
||
cmpi 5,a1
|
||
jrnz #dir8
|
||
|
||
;Allow 5,6 angle
|
||
cmpi 5,a0
|
||
jrz #do7
|
||
cmpi 6,a0
|
||
jrz #do7
|
||
|
||
#dir8
|
||
#notbh
|
||
callr seekdirdist_obxz128 ;>Turn toward teammate
|
||
move a0,*a13(plyr_dir)
|
||
|
||
move a0,*a13(plyr_newdir)
|
||
|
||
move a0,a7
|
||
move a0,a3
|
||
|
||
addi >40,a0
|
||
sll 32-7,a0
|
||
srl 32-7,a0
|
||
move a0,*a4(plyr_newdir)
|
||
move a1,a2
|
||
|
||
movi PASSDO_SEQ,a0
|
||
|
||
move *a13(plyr_jmpcnt),a14
|
||
jrz #contpass
|
||
|
||
;Fix dunks attempted stat
|
||
|
||
move *a13(plyr_seqflgs),a14
|
||
btst DUNK_B,a14
|
||
jrz #nodnk
|
||
|
||
PUSH a0
|
||
|
||
movk PS_DUNKS_TRY,a0 ;>Dec dunk stats
|
||
move *a13(plyr_num),a1
|
||
.ref dec_player_stat
|
||
calla dec_player_stat
|
||
movi PS_2PTS_TRY,a0
|
||
move *a13(plyr_num),a1
|
||
calla dec_player_stat
|
||
|
||
PULL a0
|
||
|
||
#nodnk
|
||
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 110*DIST_REDUCTION,a14
|
||
jrgt #ss
|
||
movi PASSDO2_SEQ,a0
|
||
jrnz #ss ;Air dish off pass?
|
||
#contpass
|
||
|
||
movi PASSS_SEQ,a0
|
||
cmpi 170*DIST_ADDITION,a2 ;50
|
||
jrle #ss
|
||
|
||
;If a good passer...
|
||
|
||
movi PASSC_SEQ,a3
|
||
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_PASS),a5
|
||
cmpi 6,a5
|
||
jrlt #normp
|
||
movi FASTPASSC_SEQ,a3
|
||
#normp
|
||
movk 7,a0
|
||
callr rnd
|
||
jrnz #normchest ;12% regular chest?
|
||
movi PASSNEWOH_SEQ,a3
|
||
cmpi 6,a5
|
||
jrlt #normchest
|
||
movi FASTPASSNEWOH_SEQ,a3
|
||
#normchest
|
||
move a3,a0
|
||
|
||
#ss
|
||
#bhpas
|
||
.if DEBUG
|
||
;Test different types of passing
|
||
jruc #skipem
|
||
movi PASSS_SEQ,a0 ;Short pass
|
||
movi PASSC_SEQ,a0 ;Long chest pass
|
||
movi FASTPASSC_SEQ,a0 ;Fast long chest pass
|
||
movi PASSDO_SEQ,a0 ;Dish off
|
||
movi PASSDO2_SEQ,a0 ;Dish off no big arm extend
|
||
movi PASSNL_SEQ,a0 ;No look pass
|
||
; movi PASSNL2_SEQ,a0 ;
|
||
; movi PASSNL3_SEQ,a0 ;
|
||
movi PASSC_SEQ,a0 ;Long chest pass
|
||
movi FASTPASSNEWOH_SEQ,a0 ;Fast new overhead pass
|
||
movi PASSBH_SEQ,a0 ;Behind back pass
|
||
movi PASSNEWOH_SEQ,a0 ;New overhead pass
|
||
|
||
movi PASSC_SEQ,a0 ;Long chest pass
|
||
#skipem
|
||
.endif
|
||
|
||
move a0,a3
|
||
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 170,a14
|
||
jrgt #bhconta
|
||
;If close pass, rotate now instead of calculating where I should be
|
||
;if this is a leading pass...
|
||
|
||
callr plyr_setseq
|
||
|
||
#bhconta
|
||
; subk PASSOH_SEQ,a3
|
||
; jreq #nolead
|
||
|
||
cmpi PASSNL_SEQ,a3
|
||
jrnz #noleadnl
|
||
jrz #lead_nl
|
||
; cmpi PASSNL2_SEQ,a3
|
||
; jrnz #noleadnl
|
||
|
||
#lead_nl
|
||
;Try a leading pass even on a no look pass
|
||
move *a4(plyr_dirtime),a1
|
||
jrz #nolead_nl
|
||
subk 10,a1 ;10
|
||
jrlt #nolead_nl
|
||
|
||
#noleadnl
|
||
|
||
; cmpi 35,a2
|
||
; jrlt #nolead ;Too close?
|
||
|
||
move *a4(plyr_dirtime),a1
|
||
jrz #nolead_notm
|
||
|
||
;Shawn, I increased this because we were getting to many missed leading
|
||
;passes. Because the receiver would bump into a defender and get thrown
|
||
;off course.
|
||
|
||
subk 8,a1 ;8
|
||
jrgt #leadingpass
|
||
|
||
move *a4(plyr_o1dist),a0
|
||
|
||
cmpi 25*DIST_ADDITION,a0
|
||
; cmpi 35,a0
|
||
jrlt #nolead_ocls ;Opponent too close?
|
||
move *a4(plyr_o2dist),a0
|
||
cmpi 25*DIST_ADDITION,a0
|
||
; cmpi 35,a0
|
||
jrge #leadingpass
|
||
|
||
|
||
;Additional checks are required here to determine if this will cause the
|
||
;leading pass to fly off scrn and cause the receiver to become stuck
|
||
;against the glass wall.
|
||
|
||
; move *a13(plyr_tmdist),a2
|
||
cmpi 30*DIST_ADDITION,a2 ;30
|
||
jrlt #nolead_tm ;Too close?
|
||
move *a4(plyr_dirtime),a1
|
||
subk 4,a1
|
||
jrgt #leadingpass
|
||
|
||
#nolead_notm
|
||
; LOCKUP ;Not running long enough
|
||
move @PCNT,a0
|
||
|
||
ANDK 1,a0
|
||
; ANDK 3,a0
|
||
;TEMP!!!
|
||
; jrnz #nolead
|
||
jruc #nolead
|
||
jruc #leadingpass
|
||
|
||
#nolead_nl
|
||
; LOCKUP ;A no look pass
|
||
jruc #nolead
|
||
|
||
#nolead_ocls
|
||
; LOCKUP ;Opponent too close
|
||
jruc #nolead
|
||
|
||
#nolead_tm
|
||
; LOCKUP ;Teammate too close
|
||
|
||
|
||
#nolead
|
||
movk 1,a0
|
||
move a0,*a4(plyr_nojoy)
|
||
|
||
jruc #end
|
||
|
||
|
||
#leadingpass
|
||
move *a4(plyr_jmpcnt),a1
|
||
jrnz #nolead ;He's jumping?
|
||
|
||
|
||
;Disallow leading behind the back pass if using #4 or #2 behind back pass art
|
||
;and teammate is running toward passer
|
||
;At the moment, receiver must be running horizontally away from me! (2 or 6)
|
||
|
||
;FIX!!! Make new rules here for not allowing leading behind the back passes
|
||
|
||
; cmpi PASSBH2_SEQ,a3
|
||
; jrz #tst
|
||
; cmpi PASSBH_SEQ,a3
|
||
; jrne #notst
|
||
;
|
||
;#tst
|
||
;; move @PCNT,a14
|
||
;; ANDK 3,a14
|
||
;; jrnz #notst
|
||
;
|
||
;; move *a13(plyr_seqdir),a1
|
||
;; move *a4(plyr_seqdir),a0
|
||
;; cmpi 5,a1
|
||
;; jrge #ck1
|
||
;; cmpi 2,a0
|
||
;; jrz #bhin
|
||
;; jruc #nolead
|
||
;;#ck1 cmpi 6,a0
|
||
;; jrne #nolead
|
||
;; jruc #bhin
|
||
;#notst
|
||
|
||
;Will be a leading pass, rotate passer so that pass will go to where
|
||
;receiver will be when he receives the pass
|
||
|
||
|
||
move *a13(plyr_tmproc_p),a4,L
|
||
move *a4(PA8),a2,L ;Get teammates obj
|
||
move *a2(OXPOS),a6
|
||
move *a2(OXANI+16),a14
|
||
add a14,a6
|
||
move *a2(OZPOS),a7
|
||
|
||
;All passes are not 32 ticks however!
|
||
move *a2(OXVEL),a0,L ;Where will teammate be in 32 ticks?
|
||
sra 16-5,a0
|
||
|
||
;Subtract a few ticks
|
||
move *a2(OXVEL),a14,L
|
||
sra 15,a14
|
||
add a14,a0
|
||
|
||
|
||
add a0,a6
|
||
move *a2(OZVEL),a0,L
|
||
sra 16-5,a0
|
||
|
||
|
||
move *a2(OZVEL),a14,L
|
||
sra 15,a14
|
||
add a14,a0
|
||
|
||
|
||
add a0,a7
|
||
|
||
callr seekdirdist_obxz128 ;>Turn toward where teammate will be
|
||
move a0,*a13(plyr_dir)
|
||
move a0,*a13(plyr_newdir)
|
||
|
||
|
||
#bhin
|
||
move *a4(PA11),a0,L ;>Keep teammate moving in same dir
|
||
move *a0,a0
|
||
sll 32-4,a0
|
||
srl 32-4,a0
|
||
ori >8000,a0
|
||
move a0,*a4(plyr_nojoy) ;Neg
|
||
move a0,*a4(plyr_newdir)
|
||
|
||
#end
|
||
|
||
;Check teammates position along all boundaries
|
||
;and make sure he is set inside of buffer
|
||
|
||
;If teammate is running horizontally along the top or bottom of court,
|
||
;push him slightly toward center of screen and allow leading pass...
|
||
move *a4(PA8),a1,L ;>Keep teammate moving in same dir
|
||
move *a1(OZPOS),a0
|
||
cmpi CZMIN+8,a0
|
||
jrgt #upok
|
||
movi CZMIN+10,a0
|
||
move a0,*a1(OZPOS)
|
||
jruc #ck_ok
|
||
|
||
#upok cmpi CZMAX-6,a0 ;stupid K!!! ;Is Z ok? Yes if <
|
||
jrlt #dnok
|
||
movi CZMAX-8,a0 ;stupid K!!! ;Is Z ok? Yes if <
|
||
move a0,*a1(OZPOS)
|
||
jruc #ck_ok
|
||
|
||
#dnok
|
||
;Don't do a leading pass if teammate is running vertically against either
|
||
;court edge!
|
||
; move *a1(OXPOS),a0
|
||
; move *a1(OXANI+16),a14
|
||
; add a14,a0
|
||
; cmpi PLYRMINX,a0 ;Is X ok? Yes if >
|
||
; jrgt #lok
|
||
; movi PLYRMINX+2,a0 ;Is X ok? Yes if >
|
||
; move a0,*a1(OXPOS)
|
||
; jruc #ck_ok
|
||
;
|
||
;#lok cmpi PLYRMAXX,a0 ;Is X ok? Yes if <
|
||
; jrlt #ck_ok
|
||
; movi PLYRMAXX-2,a0 ;Is X ok? Yes if <
|
||
; move a0,*a1(OXPOS)
|
||
|
||
#ck_ok
|
||
|
||
;Player dir changes if a leading pass should happen...
|
||
;If alley oop, don't do this setseq
|
||
move a3,a3 ;Alley oop type pass?
|
||
jrn #no
|
||
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 170,a14
|
||
jrle #no
|
||
|
||
;I must have already done the setseq!
|
||
;Watch this for bugs...
|
||
move *a13(plyr_dir),a7
|
||
move a3,a0
|
||
callr plyr_setseq
|
||
|
||
#no
|
||
|
||
movk 30,a0
|
||
move a0,*a4(plyr_rcvpass)
|
||
|
||
move *a4(plyr_seqflgs),a0
|
||
btst SAMEDIR_B,a0
|
||
jrz #x
|
||
movi -1,a0
|
||
move a0,*a4(plyr_newdir) ;Kill dir change
|
||
|
||
|
||
#x PULL a6,a7
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Player lobs the ball from a dunk (called from seq)
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A5
|
||
|
||
SUBR plyr_lob_ball
|
||
|
||
PUSH a6,a9,a10,a11,a12
|
||
|
||
move *a13(plyr_tmproc_p),a6,L
|
||
move *a6(plyr_seq),a14
|
||
cmpi DDUNK_RECV_SEQ,a14
|
||
jrne #shtbl ;br=player not in correct seq.
|
||
;
|
||
; Get teammates distance from hoop, and time remaining before get to hoop
|
||
;
|
||
move *a6(plyr_slam_ticks),a4
|
||
move *a6(plyr_jmpcnt),a14
|
||
sub a14,a4 ;ticks before reach rim
|
||
jrn #shtbl ;br=player cant recv. pass
|
||
|
||
;this is a fudge factor...catch ball 10 ticks before slam ball
|
||
movk 10,a0
|
||
calla rndrng0
|
||
addk 10,a0
|
||
sub a0,a4
|
||
; subk 10,a4
|
||
jrn #shtbl ;br=not enough time...
|
||
|
||
calla ball_convfmprel
|
||
move @ballobj_p,a0,L
|
||
|
||
move *a6(PA8),a8,L ;Get * teammates obj
|
||
move *a8(OXVAL),a3,L
|
||
move *a8(OXANI),a14,L
|
||
add a14,a3
|
||
move *a8(OXVEL),a1,L
|
||
|
||
move *a8(OZVAL),a5,L
|
||
move *a8(OZVEL),a14,L
|
||
|
||
move *a8(OYVAL),a10,L
|
||
move *a8(OYVEL),a9,L
|
||
|
||
move a4,b0 ;>Calc where ball should go
|
||
|
||
#poslp add a1,a3 ;Walk through movements
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
|
||
subk 1,b0 ;1 step
|
||
jrgt #poslp
|
||
#outb
|
||
move *a0(OZVAL),a1,L
|
||
sub a1,a5 ;Z delta
|
||
|
||
move *a0(OXVAL),a1,L
|
||
; move *a0(OXANI+16),a14 ;ALWAYS A ZERO
|
||
; add a14,a1
|
||
sub a1,a3 ;X delta
|
||
|
||
divs a4,a3
|
||
divs a4,a5
|
||
|
||
move a3,*a0(OXVEL),L
|
||
move a5,*a0(OZVEL),L
|
||
|
||
move a10,a3 ;- if ball above dest
|
||
move *a0(OYVAL),a10,L ;Adjust for hgt difference
|
||
sub a10,a3 ;- if ball above dest
|
||
move a4,a5
|
||
|
||
movi -GRAVB/2,a1
|
||
mpys a4,a1
|
||
divs a4,a3
|
||
add a3,a1
|
||
move a1,*a0(OYVEL),L
|
||
|
||
move *a13(PA8),a8,L
|
||
|
||
clr a14
|
||
move a14,@plyrpasstype ;0=Normal, !0=Turbo
|
||
|
||
move *a13(plyr_num),a1
|
||
inc a1
|
||
move a1,@assist_plyr
|
||
movi 3*60+30,a0
|
||
move a0,@assist_delay
|
||
|
||
subk 3,a5
|
||
; subk 2,a5
|
||
move a5,*a6(plyr_shtdly)
|
||
|
||
move a6,@ballprcv_p,L
|
||
|
||
move *a13(plyr_num),a0
|
||
move a0,@ballpnumshot
|
||
move a0,@ballpnumlast
|
||
move a0,@ballsclastp
|
||
movi -1,a0
|
||
move a0,@ballpnum ;No owner
|
||
move a0,@ballshotinair ;Shooter # if shot in air, else -1
|
||
clr a0
|
||
move a0,@ballscorezhit
|
||
move a0,@ballbbhitcnt
|
||
move a0,@ballpasstime
|
||
move a0,*a13(plyr_ownball)
|
||
movk 30,a0
|
||
move a0,*a13(plyr_shtdly)
|
||
|
||
movk 2,a14 ;Make alley-oops always 2 ptrs
|
||
move a14,@ballptsforshot
|
||
movk DUNK_LONG,a14
|
||
move a14,@shot_type
|
||
|
||
move @plyr_onfire,a14
|
||
move *a13(plyr_num),a5
|
||
btst a5,a14
|
||
jrnz #npas ;br=plyr not on fire
|
||
|
||
.ref lob_ball_speech
|
||
calla lob_ball_speech
|
||
jruc #x
|
||
#npas
|
||
movi fpass_snd,a0,L
|
||
calla snd_play1
|
||
|
||
|
||
#x PULL a6,a9,a10,a11,a12
|
||
rets
|
||
|
||
#shtbl
|
||
callr plyr_shoot
|
||
|
||
movi swith_hnd_sp,a0,L
|
||
move @HCOUNT,a14
|
||
btst 0,a14
|
||
jrnz #shtbl2
|
||
;FIX!!
|
||
movi spn_shtup_sp,a0,L
|
||
; movi a_fngr_rl_sp,a0,L
|
||
#shtbl2
|
||
calla snd_play1
|
||
|
||
PULL a6,a9,a10,a11,a12
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Player passes to teammate (called from seq)
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A5
|
||
|
||
SUBR plyr_pass
|
||
|
||
PUSH a6,a9,a10,a11,a12
|
||
|
||
move @ballpnum,a0
|
||
move *a13(plyr_num),a1
|
||
cmp a0,a1
|
||
jrne #x ;I don't have ball?
|
||
|
||
calla ball_convfmprel
|
||
|
||
move @ballobj_p,a0,L
|
||
|
||
move *a13(plyr_tmproc_p),a6,L
|
||
move *a6(PA8),a2,L ;Get * teammates obj
|
||
|
||
move *a2(OXPOS),a3
|
||
move *a2(OXANI+16),a14
|
||
add a14,a3
|
||
move *a2(OZPOS),a5
|
||
|
||
move *a0(OXPOS),a1
|
||
move *a0(OXANI+16),a14
|
||
add a14,a1
|
||
sub a1,a3 ;X delta
|
||
move *a0(OZPOS),a1
|
||
sub a1,a5 ;Y delta
|
||
|
||
move a3,a4 ;>Calc distance (long+short/2.667)
|
||
move a5,a14
|
||
abs a4
|
||
abs a14
|
||
cmp a14,a4
|
||
jrhs #xbig
|
||
SWAP a14,a4
|
||
#xbig sra 1,a14 ;/2
|
||
add a14,a4
|
||
sra 2,a14 ;/8
|
||
sub a14,a4
|
||
|
||
PUSH a0
|
||
|
||
move @inbound,a0
|
||
jrnn #no_speech
|
||
|
||
cmpi 100,a4 ;too close to call
|
||
jrlt #no_speech
|
||
|
||
move *a13(plyr_num),a1
|
||
calla pass_to_speech
|
||
|
||
#no_speech
|
||
PULL a0
|
||
|
||
move *a13(plyr_attrib_p),a14,L
|
||
move *a14(PAT_PASS),a2
|
||
sll 4,a2
|
||
movi #longpas_t,a1
|
||
add a2,a1
|
||
move *a1,a1
|
||
|
||
; movi 95,a1 ;>Calc time
|
||
|
||
cmpi 300,a4
|
||
jrgt #ct
|
||
|
||
movi #shortpas_t,a1
|
||
add a2,a1
|
||
move *a1,a1
|
||
|
||
; movi 115,a1
|
||
|
||
|
||
#ct move *a13(plyr_turbon),a14
|
||
jrz #noturb ;No turbo?
|
||
addi #turbopas_t,a2
|
||
move *a2,a2
|
||
sub a2,a1
|
||
|
||
; subi 32,a1 ;Quicker
|
||
|
||
#noturb
|
||
move a14,@plyrpasstype ;0=Normal, !0=Turbo
|
||
|
||
mpys a4,a1
|
||
sra 10,a1 ;/1024
|
||
move a1,a4
|
||
subk 16,a1
|
||
jrge #nshrt ;!Short?
|
||
movk 16,a4 ;Min
|
||
#nshrt
|
||
|
||
move *a6(PA8),a2,L ;Get * teammates obj
|
||
|
||
move *a2(OYVAL),a10,L
|
||
move *a6(plyr_seq),a14
|
||
cmpi ALLEYOOP1_SEQ,a14 ;M1SPDU1-20 frames
|
||
jrlo #noaly
|
||
cmpi ALLEYOOP14_SEQ,a14
|
||
jrhi #noaly
|
||
movk 2,a14 ;Make alley-oops always 2 ptrs
|
||
move a14,@ballptsforshot
|
||
movk DUNK_LONG,a14
|
||
move a14,@shot_type
|
||
;this was added so that there is no out-of-bounds check on alley oops
|
||
move a4,b0 ;>Calc where ball should go
|
||
move *a2(OXVAL),a3,L
|
||
move *a2(OXANI),a14,L
|
||
add a14,a3
|
||
move *a2(OZVAL),a5,L
|
||
move *a2(OXVEL),a1,L
|
||
move *a2(OZVEL),a14,L
|
||
move *a2(OYVEL),a9,L
|
||
|
||
#vellp add a1,a3 ;Walk through movements
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
subk 1,b0 ;1 step
|
||
jrgt #vellp
|
||
jruc #outb
|
||
#noaly
|
||
;For moving during inbound!
|
||
; move @inbound_lead,a14
|
||
; jrnz #ledpas
|
||
|
||
|
||
move *a6(plyr_nojoy),a14
|
||
jrnn #nolead
|
||
#ledpas
|
||
move a4,b0 ;>Calc where ball should go
|
||
move *a2(OXVAL),a3,L
|
||
move *a2(OXANI),a14,L
|
||
add a14,a3
|
||
move *a2(OZVAL),a5,L
|
||
|
||
move *a2(OXVEL),a1,L
|
||
move *a2(OZVEL),a14,L
|
||
|
||
;Added yvel into calc
|
||
move *a2(OYVEL),a9,L
|
||
|
||
#bndlp add a1,a3 ;Walk through movements
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
cmpi (PLYRMINX)<<16,a3
|
||
jrle #outb2
|
||
cmpi (PLYRMAXX)<<16,a3
|
||
jrge #outb2
|
||
cmpi (CZMIN+8)<<16,a5
|
||
jrle #outb3
|
||
cmpi (GZMAX-6)<<16,a5
|
||
jrge #outb3
|
||
|
||
subk 1,b0 ;1 step
|
||
jrgt #bndlp
|
||
|
||
jruc #outb
|
||
|
||
#outb3
|
||
add a1,a3
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
|
||
add a1,a3
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
#outb2
|
||
add a1,a3
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
|
||
add a1,a3
|
||
add a14,a5
|
||
add a9,a10
|
||
addi GRAVB,a9
|
||
#outb
|
||
sra 16,a3
|
||
sra 16,a5
|
||
|
||
move *a6(plyr_jmpcnt),a14
|
||
jrnz #chkoop ;In jump?
|
||
move *a2(OYVAL),a10,L ;Not an alley-oop. Restore YVAL
|
||
jruc #nooff
|
||
|
||
#chkoop
|
||
clr a1
|
||
clr a11
|
||
clr a12
|
||
|
||
move *a6(plyr_seq),a14
|
||
cmpi ALLEYOOP1_SEQ,a14 ;M1SPDU1-20 frames
|
||
jrne #nxtd1
|
||
movi -9,a1 ;y pos additive
|
||
movk 22,a11
|
||
movi -33,a12
|
||
jruc #drevs
|
||
#nxtd1
|
||
cmpi ALLEYOOP2_SEQ,a14 ;W3FLDU1-13 frames
|
||
jrne #nxtd2
|
||
movi -48,a1 ;y pos additive
|
||
movi -18,a11
|
||
movk 3,a12
|
||
jruc #drevs
|
||
#nxtd2
|
||
cmpi ALLEYOOP3_SEQ,a14 ;W3CRZDU2-20 frames
|
||
jrne #nxtd3
|
||
movi -1,a1 ;y pos additive
|
||
movi -5,a11
|
||
movk 5,a12
|
||
jruc #drevs
|
||
#nxtd3
|
||
cmpi ALLEYOOP4_SEQ,a14 ;S3BKDU1-16
|
||
jrne #nxtd4
|
||
movi -37,a1 ;y pos additive
|
||
movk 5,a11
|
||
movi -5,a12
|
||
jruc #drevs
|
||
#nxtd4
|
||
cmpi ALLEYOOP5_SEQ,a14 ;M3SPRDU1-11 frames
|
||
jrne #nxtd5
|
||
movi -50,a1 ;y pos additive
|
||
movk 10,a11
|
||
movi -20,a12
|
||
jruc #drevs
|
||
#nxtd5
|
||
cmpi ALLEYOOP6_SEQ,a14 ;W3SPNDU1-21 frames
|
||
jrne #nxtd6
|
||
movi -35,a1 ;y pos additive
|
||
movk 5,a11
|
||
movi -10,a12
|
||
jruc #drevs
|
||
#nxtd6
|
||
cmpi ALLEYOOP7_SEQ,a14 ;W3SPNDU1-21 frames
|
||
jrne #nxtd7
|
||
movi -50,a1 ;y pos additive
|
||
movi -14,a11 ;norm. X additive
|
||
movk 5,a12 ;flip X additive
|
||
jruc #drevs
|
||
#nxtd7
|
||
cmpi ALLEYOOP8_SEQ,a14 ;only angle 1
|
||
jrne #nxtd8
|
||
movi -60,a1 ;y pos additive
|
||
movk 30,a11
|
||
movi -30,a12
|
||
jruc #drevs
|
||
|
||
#nxtd8
|
||
cmpi ALLEYOOP9_SEQ,a14 ;only angle 5
|
||
jrne #nxtd9
|
||
movi -33,a1 ;y pos additive
|
||
movk 25,a11 ;x pos additive
|
||
movi -25,a12
|
||
jruc #drevs
|
||
#nxtd9
|
||
cmpi ALLEYOOP10_SEQ,a14 ;only angle 1, <5 dnk rating
|
||
jrne #nxtd10
|
||
movi -47,a1 ;y pos additive
|
||
movk 25,a11 ;x pos additive
|
||
movi -25,a12
|
||
#nxtd10
|
||
cmpi ALLEYOOP11_SEQ,a14 ;only angle 2, <5 dnk rating
|
||
jrne #nxtd11
|
||
movi -23,a1 ;y pos additive
|
||
movk 2,a11 ;x pos additive
|
||
movi -2,a12
|
||
#nxtd11
|
||
cmpi ALLEYOOP12_SEQ,a14 ;only angle 3, <5 dnk rating
|
||
jrne #nxtd12
|
||
movi -17,a1 ;y pos additive
|
||
movi -15,a11 ;x pos additive
|
||
movi 15,a12
|
||
#nxtd12
|
||
cmpi ALLEYOOP13_SEQ,a14 ;only angle 4, <5 dnk rating
|
||
jrne #nxtd13
|
||
movi -26,a1 ;y pos additive
|
||
movk 5,a11 ;x pos additive
|
||
movi -5,a12
|
||
#nxtd13
|
||
cmpi ALLEYOOP14_SEQ,a14 ;only angle 5, <5 dnk rating
|
||
jrne #drevs
|
||
movi -34,a1 ;y pos additive
|
||
movk 1,a11 ;x pos additive
|
||
movi -1,a12
|
||
#drevs
|
||
sll 16,a1
|
||
add a1,a10
|
||
move *a6(plyr_anirevff),a1
|
||
jrnz #nooff
|
||
move a12,a11
|
||
|
||
#nooff
|
||
move *a0(OXPOS),a1
|
||
move *a0(OXANI+16),a14
|
||
add a14,a1
|
||
sub a1,a3 ;X delta
|
||
move *a0(OZPOS),a1
|
||
sub a1,a5 ;Y delta
|
||
|
||
move *a6(plyr_jmpcnt),a14
|
||
jrz #nolead ;In jump?
|
||
add a11,a3
|
||
|
||
#nolead
|
||
sll 16,a3
|
||
sll 16,a5
|
||
divs a4,a3
|
||
divs a4,a5
|
||
|
||
move a3,*a0(OXVEL),L
|
||
move a5,*a0(OZVEL),L
|
||
|
||
move *a0(OYVAL),a3,L ;get balls Y
|
||
;; move *a2(OYVAL),a14,L
|
||
; move a10,a14 ;teammates Y val
|
||
sub a10,a3 ;a3=delta Y
|
||
|
||
; move *a6(plyr_jmpcnt),a14
|
||
; jrnz #fine ;In jump?
|
||
; move a10,a14
|
||
;#fine
|
||
sra 2,a10
|
||
add a10,a3
|
||
|
||
move a4,a5
|
||
move *a6(plyr_nojoy),a2
|
||
jrn #nopoh ;Leading pass?
|
||
|
||
subk 4,a5 ;leading pass, get there a faster...
|
||
#nopoh
|
||
movi -GRAVB/2,a1
|
||
move *a13(plyr_jmpcnt),a2
|
||
jrnz #level ;In jump?
|
||
|
||
move *a6(plyr_jmpcnt),a2
|
||
jrnz #level ;In jump? No bounce pass
|
||
|
||
|
||
;Don't allow bnc pass in close!
|
||
move *a13(plyr_tmdist),a14
|
||
cmpi 130*DIST_REDUCTION,a14
|
||
jrlt #level
|
||
|
||
|
||
|
||
move @PCNT,a14
|
||
andi 0fh,a14
|
||
jrnz #level
|
||
|
||
;Try a bounce pass
|
||
;Desperation pass? If so, don't allow bounce pass
|
||
move *a8(OIMG),a14,L
|
||
.ref T4DESPA5
|
||
cmpi T4DESPA5,a14
|
||
jrz #level
|
||
|
||
move *a13(plyr_seq),a14 ;>Chk for overhead pass
|
||
cmpi PASSNEWOH_SEQ,a14
|
||
jrz #level
|
||
cmpi PASSNL_SEQ,a14
|
||
jrz #level
|
||
move *a13(plyr_seqdir),a14
|
||
cmpi 0,a14
|
||
jrz #level
|
||
cmpi 1,a14
|
||
jrz #level
|
||
cmpi 7,a14
|
||
jrz #level
|
||
|
||
move *a0(OYVAL),a3,L ;Adjust for hgt difference
|
||
movi -GRAVB/2,a1
|
||
srl 1,a4
|
||
#level
|
||
mpys a4,a1
|
||
divs a4,a3
|
||
sub a3,a1
|
||
move a1,*a0(OYVEL),L
|
||
|
||
move *a13(plyr_num),a0
|
||
move a0,@ballpnumshot
|
||
move a0,@ballpnumlast
|
||
move a0,@ballsclastp
|
||
|
||
movi -1,a0
|
||
move a0,@ballpnum ;No owner
|
||
; move a0,@ballshotinair ;Shooter # if shot in air, else -1
|
||
clr a0
|
||
move a0,@ballscorezhit
|
||
; move a0,@ballbbhitcnt
|
||
move a0,@ballpasstime
|
||
move a0,*a13(plyr_ownball)
|
||
move a0,*a6(plyr_shtdly) ;Tell teammate he can catch ball!!
|
||
movk 30,a0
|
||
move a0,*a13(plyr_shtdly)
|
||
|
||
addk 5,a5
|
||
; addk 32,a5
|
||
move a5,*a6(plyr_rcvpass) ;Tell teammate when to expect pass
|
||
|
||
|
||
movi pass_snd,a0,L
|
||
move *a6(plyr_seqflgs),a14 ;is teammate in dunk ?
|
||
btst DUNK_B,a14
|
||
jrz #rpas
|
||
movi aly_pass_snd,a0,L ;passing to alley-opper
|
||
#rpas move @plyr_onfire,a14
|
||
move *a13(plyr_num),a5
|
||
btst a5,a14
|
||
jrz #npas ;br=plyr not on fire
|
||
movi fpass_snd,a0,L
|
||
#npas calla snd_play1
|
||
|
||
|
||
|
||
#x PULL a6,a9,a10,a11,a12
|
||
rets
|
||
|
||
|
||
#longpas_t
|
||
.word 103,101,99,97,95,93
|
||
.word 91,89,87,85,83
|
||
#shortpas_t
|
||
.word 127,124,121,118,115,112
|
||
.word 109,106,103,100,97
|
||
#turbopas_t
|
||
.word 28,29,30,31,32,33
|
||
.word 35,38,41,44,44
|
||
|
||
|
||
#*******************************
|
||
* Try a rebound if possible
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A5
|
||
|
||
RTIME .equ 25
|
||
|
||
SUBRP plyr_tryrebound
|
||
|
||
PUSH a6,a7
|
||
|
||
move @plyrinautorbnd,a1
|
||
jrnz #x ;Someone else doing?
|
||
|
||
move @game_time,a14,L
|
||
cmpi >500,a14
|
||
jrge #heave ;Do it
|
||
|
||
move *a13(plyr_num),a0
|
||
move @ballpnumshot,a1
|
||
cmp a0,a1
|
||
jrz #x
|
||
XORI 1,a1
|
||
cmp a1,a0
|
||
jrz #x ;Br=teammate shot
|
||
|
||
#heave
|
||
;>Chk my start
|
||
move *a8(OZPOS),a1 ;Get SZ
|
||
subi CZMID,a1
|
||
abs a1
|
||
cmpi 40,a1
|
||
jrgt #posok
|
||
move *a8(OXPOS),a0 ;Get SX
|
||
move *a8(OXANI+16),a14
|
||
add a14,a0
|
||
subi WRLDMID,a0
|
||
abs a0
|
||
cmpi HOOPRX-WRLDMID+13,a0
|
||
jrge #x ;Under backboard?
|
||
|
||
subk 12,a1
|
||
jrgt #posok
|
||
cmpi HOOPRX-WRLDMID-8,a3
|
||
jrge #x ;Under rim?
|
||
|
||
|
||
#posok
|
||
move @ballobj_p,a5,L
|
||
|
||
|
||
movk RTIME,a0 ;>Find new Y pos in x ticks
|
||
move *a5(OYVAL),a4,L
|
||
move *a5(OYVEL),a2,L
|
||
movi GRAVB,a1
|
||
#newblp
|
||
add a2,a4
|
||
add a1,a2
|
||
dsj a0,#newblp
|
||
|
||
sra 16,a4
|
||
|
||
cmpi -140,a4
|
||
jrlt #x ;Too hi?
|
||
|
||
addk 30,a4
|
||
move *a8(OYPOS),a0
|
||
cmp a0,a4
|
||
jrge #x ;Ball lower than plyr?
|
||
|
||
|
||
|
||
move *a5(OXVAL),a6,L ;>Find new XZ pos in x ticks
|
||
move *a5(OXANI),a14,L
|
||
add a14,a6
|
||
move *a5(OZVAL),a7,L
|
||
|
||
move a6,a0 ;>Chk ball pos
|
||
move a7,a1
|
||
sra 16,a0
|
||
sra 16,a1
|
||
|
||
subi CZMID,a1
|
||
abs a1
|
||
subk 12,a1
|
||
jrgt #bposok
|
||
subi WRLDMID,a0
|
||
abs a0
|
||
cmpi HOOPRX-WRLDMID-10,a3
|
||
jrge #x ;Under rim or backboard?
|
||
#bposok
|
||
|
||
movk RTIME,a0
|
||
move *a5(OXVEL),a1,L
|
||
mpys a0,a1
|
||
add a1,a6
|
||
move *a5(OZVEL),a1,L
|
||
mpys a0,a1
|
||
add a1,a7
|
||
|
||
sra 16,a6
|
||
sra 16,a7
|
||
|
||
move a6,a0 ;>Chk my destination
|
||
move a7,a1
|
||
|
||
subi CZMID,a1
|
||
abs a1
|
||
cmpi 40,a1
|
||
jrgt #eposok
|
||
subi WRLDMID,a0
|
||
abs a0
|
||
cmpi HOOPRX-WRLDMID+13,a0
|
||
jrge #x ;Under backboard?
|
||
subk 14,a1
|
||
jrgt #eposok
|
||
cmpi HOOPRX-WRLDMID-10,a3
|
||
jrge #x ;Under rim?
|
||
#eposok
|
||
|
||
move *a13(plyr_num),a14
|
||
sll 5,a14
|
||
addi player_data,a14,L
|
||
move *a14,a14,L
|
||
move *a14(PR_PRIVILEGES),a14
|
||
jrle #eposok2 ;br=not a created player
|
||
btst 5,a0 ;SUPER AUTO-REBOUND privilege?
|
||
jrz #eposok2 ;br=no
|
||
|
||
callr seekdirdist_obxz128
|
||
cmpi 70,a1 ;close enough to jump?
|
||
jrlt #eposok3 ;br=yes
|
||
jruc #x
|
||
#eposok2
|
||
callr seekdirdist_obxz128
|
||
cmpi 60,a1
|
||
jrge #x ;Too far to jump?
|
||
|
||
#eposok3
|
||
move a0,*a13(plyr_newdir) ;Turn where ball is headed
|
||
|
||
movk REBOUNDA_SEQ,a0
|
||
move a0,@plyrinautorbnd
|
||
|
||
move *a13(plyr_dir),a7
|
||
callr plyr_setseq
|
||
|
||
|
||
#x PULL a6,a7
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Clear auto rebound flag - Called when SEQ_REBOUNDA lands
|
||
|
||
SUBR clr_autorbnd
|
||
|
||
clr a0
|
||
move a0,@plyrinautorbnd
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Set the ball xyz position from player
|
||
* A8=*Plyr obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch
|
||
|
||
SUBRP plyr_setballxyz
|
||
;LOOK!!!
|
||
move @ballobj_p,a0,L
|
||
|
||
move *a8(OZPOS),a1 ;>Set Z
|
||
move *a13(plyr_ballzo),a14
|
||
add a14,a1
|
||
move a1,*a0(OZPOS)
|
||
|
||
move *a8(OXVAL),a1,L ;>Set X
|
||
move a1,b0
|
||
move *a13(plyr_ballxo),a14,L
|
||
add a14,a1
|
||
move *a0(OIMG),a14,L
|
||
move *a14(IANIOFFX),a14
|
||
sll 16,a14
|
||
sub a14,a1
|
||
move a1,*a0(OXVAL),L
|
||
|
||
move *a8(OXANI),a14,L ;Make 3D ball X+ani = plyr X+ani
|
||
sub a14,a1
|
||
move b0,a14
|
||
sub a1,a14
|
||
move a14,*a0(OXANI),L
|
||
|
||
move *a13(plyr_ballyo),a1
|
||
cmpi -200,a1
|
||
jreq #bfree ;Ball Y free?
|
||
|
||
move *a0(OIMG),a14,L ;>Set Y
|
||
move *a14(IANIOFFY),a14
|
||
sub a14,a1
|
||
move *a8(OYPOS),a14
|
||
add a14,a1
|
||
move a1,*a0(OYPOS)
|
||
clr a1
|
||
move a1,*a0(OYVEL),L ;Stop grav from accumulating
|
||
move a1,*a0(OXVEL),L
|
||
move a1,*a0(OZVEL),L
|
||
move a1,@ballfree ;!Free
|
||
|
||
rets
|
||
|
||
#bfree
|
||
move @ballfree,a14
|
||
jrnz #x ;Already free?
|
||
movk 1,a14
|
||
move a14,@ballfree ;Free
|
||
move *a0(OYPOS),a1
|
||
move *a0(OIMG),a14,L
|
||
move *a14(IANIOFFY),a14
|
||
add a14,a1
|
||
movi ->a00,a14 ;Push it towards gnd
|
||
mpys a14,a1
|
||
addi >16000,a1
|
||
move a1,*a0(OYVEL),L
|
||
#x rets
|
||
|
||
|
||
#*******************************
|
||
* Get a scaled objects anipt XY
|
||
* A8=*Obj
|
||
* >A0=Scaled Ani X (16:16)
|
||
* >A1=Scaled Ani Y
|
||
* Trashes scratch
|
||
|
||
SUBR anipt_getsclxy
|
||
|
||
move a2,b0
|
||
|
||
move *a8(ODATA_p),a0,L
|
||
move *a8(OIMG),a2,L
|
||
|
||
move *a8(OZPOS),a14
|
||
subi GZBASE,a14
|
||
jrge #zok
|
||
clr a14
|
||
#zok srl 4,a14 ;/16
|
||
sll 6,a14 ;*64
|
||
add a14,a0
|
||
addk 32,a0
|
||
|
||
move *a0+,a14
|
||
sll 4,a14 ;*16
|
||
move *a2(IANIOFFX),a1
|
||
mpys a14,a1
|
||
|
||
move *a0,a14
|
||
sll 4,a14 ;*16
|
||
move a1,a0
|
||
move *a2(IANIOFFY),a1
|
||
mpys a14,a1
|
||
|
||
move *a8(OCTRL),a14
|
||
btst B_FLIPH,a14
|
||
jrz #x ;No flip?
|
||
|
||
move *a2,a2 ;ISIZEX
|
||
subk 1,a2
|
||
sll 16,a2 ;*64K
|
||
neg a0
|
||
add a2,a0 ;+size
|
||
|
||
#x move b0,a2
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Get a scaled objects 2nd anipt XY
|
||
* A8=*Obj
|
||
* >A0=Scaled Ani2 X (16:16)
|
||
* >A1=Scaled Ani2 Y
|
||
* Trashes scratch
|
||
|
||
SUBR anipt2_getsclxy
|
||
|
||
move a2,b0
|
||
|
||
move *a8(ODATA_p),a0,L
|
||
move *a8(OIMG),a2,L
|
||
|
||
move *a8(OZPOS),a14
|
||
subi GZBASE,a14
|
||
jrge #zok
|
||
clr a14
|
||
#zok srl 4,a14 ;/16
|
||
sll 6,a14 ;*64
|
||
add a14,a0
|
||
addk 32,a0
|
||
|
||
move *a0+,a14
|
||
sll 4,a14 ;*16
|
||
move *a2(IANI2X),a1
|
||
mpys a14,a1
|
||
|
||
move *a0,a14
|
||
sll 4,a14 ;*16
|
||
move a1,a0
|
||
move *a2(IANI2Y),a1
|
||
cmpi -200,a1 ;stupid K!!! alert!!!
|
||
jrne #ynorm
|
||
sll 16,a1
|
||
jruc #cflip
|
||
#ynorm mpys a14,a1
|
||
|
||
#cflip move *a8(OCTRL),a14
|
||
btst B_FLIPH,a14
|
||
jrz #x ;No flip?
|
||
|
||
move *a2,a2 ;ISIZEX
|
||
subk 1,a2
|
||
sll 16,a2 ;*64K
|
||
neg a0
|
||
add a2,a0 ;+size
|
||
|
||
#x move b0,a2
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Get a scaled objects 3rd anipt XY
|
||
* A8=*Obj
|
||
* >A0=Scaled Ani3 X (16:16)
|
||
* >A1=Scaled Ani3 Y
|
||
* Trashes scratch
|
||
|
||
SUBR anipt3_getsclxy
|
||
|
||
move a2,b0
|
||
|
||
move *a8(ODATA_p),a0,L
|
||
move *a8(OIMG),a2,L
|
||
|
||
move *a8(OZPOS),a14
|
||
subi GZBASE,a14
|
||
jrge #zok
|
||
clr a14
|
||
#zok srl 4,a14 ;/16
|
||
sll 6,a14 ;*64
|
||
addk 32,a0
|
||
add a14,a0
|
||
|
||
move *a0+,a14
|
||
sll 4,a14 ;*16
|
||
move *a2(IANI3X),a1
|
||
mpys a14,a1
|
||
|
||
move *a0,a14
|
||
sll 4,a14 ;*16
|
||
move a1,a0
|
||
move *a2(IANI3Y),a1
|
||
mpys a14,a1
|
||
|
||
move *a8(OCTRL),a14
|
||
btst B_FLIPH,a14
|
||
jrz #x ;No flip?
|
||
|
||
move *a2,a2 ;ISIZEX
|
||
subk 1,a2
|
||
sll 16,a2 ;*64K
|
||
neg a0
|
||
add a2,a0 ;+size
|
||
|
||
#x move b0,a2
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Align shadow obj with player obj and set ani
|
||
* A8=*Obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A4
|
||
|
||
SUBRP plyr_setshadow
|
||
|
||
move *a13(plyr_shadobj_p),a4,L
|
||
|
||
move *a8(OZPOS),a0
|
||
move a0,a1
|
||
subi 50,a1 ;Adjust
|
||
move a1,*a4(OZPOS)
|
||
|
||
subi CZMIN,a0 ;-Base
|
||
jrge #zok
|
||
clr a0
|
||
#zok srl 5,a0 ;/32
|
||
move *a8(OYPOS),a1
|
||
move *a13(plyr_aniy),a14
|
||
add a14,a1 ;Ani pt position
|
||
sra 4,a1 ;/16 (Neg)
|
||
add a1,a0
|
||
|
||
addk (#ani_t-#sani_t)/32,a0
|
||
jrnn #pss_0
|
||
clr a0
|
||
#pss_0
|
||
movk (#bani_t-#sani_t)/32-1,a14
|
||
cmp a0,a14
|
||
jrge #pss_1
|
||
move a14,a0
|
||
#pss_1
|
||
move @pup_baby,a14 ;Plyr babies? No if 0
|
||
jrz #pss_2
|
||
addk (#bani_t-#sani_t)/32,a0
|
||
#pss_2
|
||
sll 5,a0 ;*32
|
||
addi #sani_t,a0
|
||
|
||
move *a0,a2,L
|
||
move a2,*a4(OIMG),L ;Set new img
|
||
move *a2,a14,L
|
||
move a14,*a4(OSIZE),L
|
||
move *a2(ISAG),*a4(OSAG),L
|
||
|
||
callr anipt_getsclxy
|
||
|
||
move *a2(IANIOFFX),a3
|
||
sll 16,a3
|
||
move a3,*a4(OXANI),L
|
||
|
||
move *a8(OXVAL),a14,L
|
||
add a0,a14 ;Ani X
|
||
sub a3,a14
|
||
move a14,*a4(OXVAL),L
|
||
|
||
move *a2(IANIOFFY),a3
|
||
neg a3
|
||
move a3,*a4(OYPOS)
|
||
|
||
rets
|
||
|
||
|
||
#sani_t
|
||
.long shadow15,shadow15,shadow15,shadow15
|
||
.long shadow15,shadow15,shadow15,shadow15
|
||
.long shadow15,shadow14,shadow13,shadow12
|
||
#ani_t .long shadow11,shadow10,shadow9,shadow8
|
||
.long shadow7,shadow6,shadow5,shadow4
|
||
.long shadow3,shadow2,shadow1,shadow1
|
||
.long shadow1,shadow1,shadow1
|
||
|
||
#bani_t
|
||
.long ballshad7,ballshad7,ballshad7,ballshad7
|
||
.long ballshad7,ballshad7,ballshad7,ballshad7
|
||
.long ballshad7,ballshad5,ballshad4,ballshad2
|
||
.long shadow18,shadow18,shadow17,shadow17
|
||
.long shadow16,shadow16,shadow15,shadow15
|
||
.long shadow14,shadow14,shadow13,shadow13
|
||
.long shadow12,shadow12,shadow11
|
||
|
||
|
||
#*******************************
|
||
* Align head obj with player obj
|
||
* A8=*Obj
|
||
* A13=*Plyr process
|
||
* Trashes scratch, A2-A6
|
||
|
||
SUBR plyr_headalign
|
||
|
||
move *a13(plyr_headobj_p),a6,L ;>A6=*Head obj
|
||
|
||
SUBR plyr_headalign2
|
||
|
||
move *a8(OIMG),a0,L ;>Set Z
|
||
move *a8(OZPOS),a14
|
||
move *a0(IANI3Z),a1
|
||
add a1,a14
|
||
move a14,*a6(OZPOS)
|
||
sub a1,a14
|
||
neg a1
|
||
move a1,*a6(OMISC) ;Z offset
|
||
|
||
;>Calc head scale anixy (A3,A5)
|
||
subi GZBASE,a14 ;-Base
|
||
jrge #zok
|
||
clr a14
|
||
#zok srl 4,a14 ;/16
|
||
sll 6,a14 ;*64
|
||
move *a6(ODATA_p),a0,L
|
||
addk 32,a0
|
||
add a14,a0
|
||
|
||
move *a0+,a14
|
||
sll 4,a14 ;*16
|
||
move *a6(OIMG),a2,L
|
||
|
||
move *a2(IANIOFFX),a3
|
||
mpys a14,a3
|
||
|
||
move *a0,a14
|
||
sll 4,a14 ;*16
|
||
|
||
move *a2(IANIOFFY),a5
|
||
mpys a14,a5
|
||
|
||
move *a6(OCTRL),a14
|
||
btst B_FLIPH,a14
|
||
jrz #nohf ;No flip?
|
||
|
||
move *a2,a2 ;ISIZEX
|
||
subk 1,a2
|
||
sll 16,a2 ;*64K
|
||
neg a3
|
||
add a2,a3 ;+size
|
||
#nohf
|
||
|
||
callr anipt3_getsclxy
|
||
|
||
move *a8(OYVAL),a14,L
|
||
add a1,a14 ;Ani3 Y
|
||
sub a5,a14
|
||
move a14,*a6(OYVAL),L
|
||
|
||
move *a8(OXVAL),a14,L
|
||
move a14,a1
|
||
add a0,a14 ;Ani3 X
|
||
sub a3,a14
|
||
move a14,*a6(OXVAL),L
|
||
|
||
move *a8(OXANI),a0,L ;Make head X+ani = plyr X+ani
|
||
add a0,a1
|
||
sub a14,a1
|
||
move a1,*a6(OXANI),L
|
||
|
||
rets
|
||
|
||
;#*******************************
|
||
;* Align arw obj with player obj
|
||
;* A8=*Obj
|
||
;* a6=Arw Obj
|
||
;* Trashes scratch, A2-A6
|
||
;
|
||
; SUBR plyr_arwalign
|
||
;
|
||
;
|
||
; move *a8(OIMG),a0,L ;>Set Z
|
||
; move *a8(OZPOS),a14
|
||
; move *a0(IANI3Z),a1
|
||
; add a1,a14
|
||
; move a14,*a6(OZPOS)
|
||
; sub a1,a14
|
||
; neg a1
|
||
; move a1,*a6(OMISC) ;Z offset
|
||
;
|
||
; ;>Calc head scale anixy (A3,A5)
|
||
; subi GZBASE,a14 ;-Base
|
||
; jrge #zok
|
||
; clr a14
|
||
;#zok srl 4,a14 ;/16
|
||
; sll 6,a14 ;*64
|
||
; move *a6(ODATA_p),a0,L
|
||
; addk 32,a0
|
||
; add a14,a0
|
||
;
|
||
; move *a0+,a14
|
||
; sll 4,a14 ;*16
|
||
; move *a6(OIMG),a2,L
|
||
;
|
||
; move *a2(IANIOFFX),a3
|
||
; mpys a14,a3
|
||
;
|
||
; move *a0,a14
|
||
; sll 4,a14 ;*16
|
||
;
|
||
; move *a2(IANIOFFY),a5
|
||
; mpys a14,a5
|
||
;
|
||
;; move *a6(OCTRL),a14
|
||
;; btst B_FLIPH,a14
|
||
;; jrz #nohf ;No flip?
|
||
;;
|
||
;; move *a2,a2 ;ISIZEX
|
||
;; subk 1,a2
|
||
;; sll 16,a2 ;*64K
|
||
;; neg a3
|
||
;; add a2,a3 ;+size
|
||
;;#nohf
|
||
;
|
||
; callr anipt3_getsclxy
|
||
;
|
||
; move *a8(OYVAL),a14,L
|
||
; add a1,a14 ;Ani3 Y
|
||
; sub a5,a14
|
||
; move a14,*a6(OYVAL),L
|
||
;
|
||
; move *a8(OXVAL),a14,L
|
||
; move a14,a1
|
||
; add a0,a14 ;Ani3 X
|
||
; sub a3,a14
|
||
; move a14,*a6(OXVAL),L
|
||
;
|
||
;
|
||
; move *a8(OXANI),a0,L ;Make head X+ani = plyr X+ani
|
||
; add a0,a1
|
||
; sub a14,a1
|
||
; move a1,*a6(OXANI),L
|
||
;
|
||
;
|
||
; rets
|
||
;
|
||
|
||
|
||
|
||
|
||
#*******************************
|
||
* Referee tosses up ball (process)
|
||
|
||
SUBRP plyr_referee
|
||
|
||
|
||
.asg 12,REFCTR_OX ;Ref Xoff so toss to be centered
|
||
|
||
;Show player #0 pal to verify pal build
|
||
; .ref show_plyr_pal
|
||
; CREATE0 show_plyr_pal
|
||
|
||
clr a0
|
||
move a0,@ditch_meter
|
||
|
||
.if DEBUG
|
||
move @QUICK_TIP,a0
|
||
jrnz #skipq
|
||
.endif
|
||
|
||
clr a9
|
||
movk 1,a11
|
||
CREATE METER_PID,jumpball_meter
|
||
movk 1,a9
|
||
movk 2,a11
|
||
CREATE METER_PID,jumpball_meter
|
||
.ref jumpball_meter
|
||
.if DEBUG
|
||
#skipq
|
||
.endif
|
||
|
||
movk 1,a0
|
||
callr plyr_setac
|
||
|
||
movi [WRLDMID+REFCTR_OX,0],a0
|
||
clr a1
|
||
movi shadow7,a2
|
||
movi CZMID-30-1,a3
|
||
movi DMAWNZ|M_3D|M_SHAD|M_NOCOLL,a4
|
||
movi CLSDEAD,a5
|
||
clr a6
|
||
clr a7
|
||
calla BEGINOBJ2
|
||
; movi 50,a0
|
||
; move a0,*a8(OMISC) ;Z offset
|
||
move a8,a11 ;A11=ref shadow *obj
|
||
|
||
movi [WRLDMID+REFCTR_OX,0],a0
|
||
clr a1
|
||
movi REFWHS1,a2
|
||
movi CZMID-30,a3
|
||
movi DMAWNZ|M_3D|M_NOCOLL,a4
|
||
calla BEGINOBJ2
|
||
|
||
movi #att_t,a0,L
|
||
move a0,*a13(plyr_attrib_p),L
|
||
move *a0,a0,L
|
||
move a0,*a8(ODATA_p),L
|
||
|
||
SLEEPK 5
|
||
|
||
movk 1,a0
|
||
move a0,*a13(plyr_ownball) ;!0=Ref has ball
|
||
|
||
; clr a0
|
||
movk 25,a0
|
||
move a0,*a13(plyr_ballzo)
|
||
|
||
movi #ani_l,a9
|
||
.if DEBUG
|
||
move @QUICK_TIP,a14
|
||
jrz #skipq2
|
||
movi #ani_l_quick_tip,a9
|
||
#skipq2
|
||
.endif
|
||
movk 1,a10
|
||
#lp
|
||
dsj a10,#noani
|
||
|
||
#getwt move *a9+,a10
|
||
jrz #refdone
|
||
jrnn #nocode
|
||
|
||
move *a9+,a0,L ;Call function
|
||
call a0
|
||
jruc #getwt
|
||
#nocode
|
||
move *a9+,a0,L
|
||
movk M_WRNONZ,a1
|
||
callr plyr_ani
|
||
|
||
callr anipt2_getsclxy
|
||
move a0,*a13(plyr_ballxo),L
|
||
sra 16,a1
|
||
move a1,*a13(plyr_ballyo)
|
||
|
||
move *a13(plyr_aniy),a1
|
||
neg a1
|
||
move a1,*a8(OYPOS) ;Set on gnd
|
||
|
||
#noani
|
||
move *a13(plyr_ownball),a0
|
||
jrz #noball ;Tossed up?
|
||
|
||
callr plyr_setballxyz
|
||
#noball
|
||
callr joy_read2 ;Scan buttons since ac is on
|
||
|
||
clr a0
|
||
move a0,@P1CTRL
|
||
move a0,@P4CTRL
|
||
|
||
movi P1CTRL,a1 ;>Kill unwanted bits
|
||
movk 4,b0
|
||
#jlp move *a1,a0
|
||
andi BUT1_M<<8+BUT1_M,a0
|
||
move a0,*a1+
|
||
dsj b0,#jlp
|
||
|
||
SLEEPK 1
|
||
move @HALT,a0
|
||
jrnz #noball
|
||
jruc #lp
|
||
|
||
|
||
fix
|
||
|
||
|
||
#refdone
|
||
SLEEPK 5
|
||
calla SCRTST
|
||
jrz #refdone ;Still on screen?
|
||
move a11,a0
|
||
calla DELOBJ
|
||
jauc DELOBJDIE
|
||
|
||
|
||
#att_t .long scale66_t,REF_P
|
||
|
||
.if DEBUG
|
||
#ani_l_quick_tip
|
||
; Quick jump ball for debugging
|
||
WL -1,#tossball
|
||
WL -1,#step_back
|
||
WL -1,#ac_off
|
||
W0
|
||
.endif
|
||
|
||
#ani_l
|
||
|
||
WL TSEC,REFWHS1
|
||
WL 4,REFWHS2
|
||
WL 4,REFWHS3
|
||
WL 4,REFWHS4
|
||
WL 4,REFWHS5
|
||
WL 4,REFWHS6
|
||
WL 4,REFWHS7
|
||
WL 4,REFWHS8
|
||
WL -1,#do_whstle
|
||
WL 15,REFWHS9
|
||
WL 4,REFWHS8
|
||
WL 4,REFWHS7
|
||
WL 4,REFWHS6
|
||
WL 4,REFWHS5
|
||
WL 4,REFWHS4
|
||
WL 4,REFWHS3
|
||
WL 4,REFWHS2
|
||
WL 4,REFWHS1
|
||
|
||
WL 3,REFTOS1
|
||
WL 3,REFTOS2
|
||
WL 3,REFTOS3
|
||
WL 3,REFTOS4
|
||
WL 3,REFTOS5
|
||
WL 3,REFTOS6
|
||
WL 3,REFTOS7
|
||
WL 3,REFTOS8
|
||
WL 3,REFTOS9
|
||
WL 3,REFTOS10
|
||
WL 3,REFTOS11
|
||
WL 3,REFTOS12
|
||
WL 3,REFTOS13
|
||
|
||
WL -1,#tossball ;109 TICKS
|
||
|
||
|
||
WL 3,REFTOS14
|
||
WL 4,REFTOS15
|
||
WL -1,#start_jumps
|
||
WL 3,REFTOS16
|
||
WL 3,REFTOS17
|
||
WL 3,REFTOS18
|
||
WL 3,REFTOS19
|
||
WL -1,#step_back
|
||
|
||
|
||
WL 3,REFRUN1
|
||
WL 3,REFRUN2
|
||
WL 3,REFRUN3
|
||
WL 3,REFRUN4
|
||
WL 3,REFRUN5
|
||
WL 3,REFRUN6
|
||
WL 3,REFRUN7
|
||
WL 3,REFRUN8
|
||
WL 3,REFRUN9
|
||
WL 3,REFRUN10
|
||
WL 3,REFRUN11
|
||
WL 3,REFRUN1
|
||
WL 3,REFRUN2
|
||
WL 3,REFRUN3
|
||
WL 3,REFRUN4
|
||
WL 3,REFRUN5
|
||
WL 3,REFRUN6
|
||
WL 3,REFRUN7
|
||
WL 3,REFRUN8
|
||
WL 3,REFRUN9
|
||
WL 3,REFRUN10
|
||
WL 3,REFRUN11
|
||
WL -1,#ac_off ;85 AFTER TOSS
|
||
WL -1,#tip_off_spch
|
||
WL 3,REFRUN1
|
||
WL 3,REFRUN1
|
||
WL 3,REFRUN2
|
||
WL 3,REFRUN3
|
||
WL 3,REFRUN4
|
||
WL 3,REFRUN5
|
||
WL 3,REFRUN6
|
||
WL 3,REFRUN7
|
||
WL 3,REFRUN8
|
||
WL 3,REFRUN9
|
||
WL 3,REFRUN10
|
||
WL 3,REFRUN11
|
||
WL 3,REFRUN1
|
||
WL 3,REFRUN2
|
||
WL 3,REFRUN3
|
||
WL 3,REFRUN4
|
||
WL 3,REFRUN5
|
||
WL 2,REFRUN6
|
||
WL -1,#stop_back
|
||
WL 4,REFSTN1
|
||
WL 4,REFSTN2
|
||
WL 4,REFSTN4
|
||
;REFROT1
|
||
W0
|
||
|
||
#tip_off_spch
|
||
.ref tip_off_speech
|
||
CREATE0 tip_off_speech
|
||
rets
|
||
|
||
#do_whstle
|
||
movi whitsle_snd,a0
|
||
jauc snd_play1
|
||
|
||
|
||
#tossball
|
||
move @ballobj_p,a1,L
|
||
movi >fffa4800,a0
|
||
clr a2
|
||
|
||
.if DEBUG
|
||
; Quick jump ball for debugging
|
||
move @QUICK_TIP,a14
|
||
jrz #normq
|
||
movi -GRAVB,a0
|
||
movk 3,a2
|
||
#normq
|
||
.endif
|
||
|
||
move a0,*a1(OYVEL),L
|
||
clr a0
|
||
move a0,@clock_active ;Turn on clock
|
||
|
||
move a2,*a13(plyr_ownball) ;Let go
|
||
rets
|
||
|
||
|
||
#step_back
|
||
movi -11800h,a0 ;-14000h
|
||
move a0,*a8(OZVEL),L
|
||
move a0,*a11(OZVEL),L
|
||
|
||
rets
|
||
|
||
#start_jumps
|
||
|
||
move a11,a2
|
||
|
||
move @plyrproc_t+32,a11,L
|
||
CREATE TIPID,plyr_tip
|
||
|
||
move @plyrproc_t+32*2,a11,L
|
||
CREATE TIPID,plyr_tip
|
||
|
||
|
||
move a2,a11
|
||
|
||
rets
|
||
|
||
#ac_off
|
||
clr a0
|
||
jruc plyr_setac
|
||
|
||
|
||
#stop_back
|
||
clr a0
|
||
move a0,*a8(OZVEL),L
|
||
move a0,*a11(OZVEL),L
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Jump at ball for tip (Process)
|
||
* A11=*Plyr process
|
||
|
||
.bss t1bcnt ,16 ;Team1 (p1) # button hits
|
||
.bss t2bcnt ,16 ;Team2 (p2) ^
|
||
|
||
SUBRP plyr_tip
|
||
|
||
move *a11(PA8),a8,L
|
||
|
||
PUSH a13
|
||
move a11,a13
|
||
|
||
movi TIPJ_SEQ,a0
|
||
move *a13(plyr_dir),a7
|
||
callr plyr_setseq
|
||
move a10,*a13(PA10),L
|
||
|
||
PULL a13
|
||
|
||
|
||
|
||
.if DEBUG
|
||
; Quick jump ball for debugging
|
||
move @QUICK_TIP,a14
|
||
jrz #normq
|
||
SLEEPK 6
|
||
clr a0
|
||
jruc #cont
|
||
#normq
|
||
.endif
|
||
|
||
SLEEPK 15
|
||
movi -GRAVB*30-4000h,a0
|
||
#cont
|
||
move a0,*a8(OYVEL),L
|
||
|
||
|
||
movi 8800h,a0
|
||
move *a8(OCTRL),a14
|
||
btst B_FLIPH,a14
|
||
jrz #norm ;No flip?
|
||
neg a0
|
||
#norm
|
||
move a0,*a8(OXVEL),L
|
||
|
||
|
||
movk 1,a0 ;Start jump
|
||
move a0,*a11(plyr_jmpcnt)
|
||
|
||
movi t1bcnt,a9 ;>Count button1 down presses
|
||
move *a11(plyr_num),a1
|
||
btst 1,a1
|
||
jrz #t1
|
||
addk 16,a9
|
||
#t1 clr a0
|
||
move @PSTATUS,a14
|
||
btst a1,a14
|
||
jrnz #human ;Human opponent?
|
||
movk 3,a0 ;Drones # presses
|
||
#human move a0,*a9
|
||
|
||
.if DEBUG
|
||
;Quick jump ball for debugging
|
||
move @QUICK_TIP,a14
|
||
jrnz #skipq
|
||
.endif
|
||
SLEEPK 25
|
||
#skipq
|
||
|
||
move @plyrobj_t+32,a0,L
|
||
; move *a0(OXVEL),a14,L
|
||
; sra 2,a14
|
||
; neg a14
|
||
movi -2800h,a14
|
||
move a14,*a0(OXVEL),L
|
||
|
||
|
||
|
||
move @plyrobj_t+64,a0,L
|
||
; move *a0(OXVEL),a14,L
|
||
; sra 2,a14
|
||
; neg a14
|
||
|
||
movi 2800h,a14
|
||
move a14,*a0(OXVEL),L
|
||
|
||
; movk 1,a10 ;temp!!!
|
||
; movk 25,a10
|
||
;#lp
|
||
; move *a11(PA11),a0,L
|
||
; move *a0,a0
|
||
; btst BUT1_B+8,a0
|
||
; jrz #noprs ;No down transition?
|
||
; move *a9,a0 ;+1 cnt
|
||
; addk 1,a0
|
||
; move a0,*a9
|
||
;#noprs
|
||
; SLEEPK 1
|
||
; dsj a10,#lp
|
||
|
||
move *a11(plyr_num),a5
|
||
|
||
move @plyrproc_t+32,a0,L
|
||
move *a0(plyr_meter_time),a0
|
||
move @plyrproc_t+64,a1,L
|
||
move *a1(plyr_meter_time),a1
|
||
|
||
; movi t1bcnt,a2
|
||
; move *a2+,a0
|
||
; move *a2+,a1
|
||
|
||
btst 1,a5
|
||
jrnz #tm1
|
||
SWAP a0,a1
|
||
#tm1
|
||
.if DEBUG
|
||
move @QUICK_TIP,a14
|
||
jrnz #contq
|
||
.endif
|
||
cmp a1,a0
|
||
jrlt #x ;Less presses than opponent?
|
||
#contq
|
||
movi >fffea000,a0
|
||
movi >ffff1000,a1
|
||
movi -9,a3
|
||
btst 1,a5
|
||
jrz #tm1a
|
||
|
||
neg a0
|
||
neg a1
|
||
neg a3
|
||
#tm1a
|
||
move @ballobj_p,a2,L
|
||
|
||
move *a2(OXPOS),a4
|
||
add a3,a4
|
||
move a4,*a2(OXPOS)
|
||
move a0,*a2(OXVEL),L
|
||
move a1,*a2(OZVEL),L
|
||
|
||
movi -GRAVB*10,a0
|
||
move a0,*a2(OYVEL),L
|
||
|
||
movi TIPID,a0
|
||
calla KIL1C
|
||
|
||
movk 1,a0
|
||
.ref ditch_meter
|
||
move a0,@ditch_meter
|
||
|
||
#x
|
||
|
||
;call ball slap sound
|
||
SOUND1 swat_snd
|
||
|
||
DIE
|
||
|
||
|
||
#*******************************
|
||
* End of quarter (JSRP by score)
|
||
|
||
SUBR plyr_endofqrtr
|
||
|
||
movi 1000,a0
|
||
move a0,@cntrs_delay ;Delay credit timers
|
||
|
||
move @gmqrtr,a0 ;Next quarter
|
||
addk 1,a0
|
||
move a0,@gmqrtr
|
||
subk 1,a0
|
||
jrne #not1st
|
||
|
||
movi AUD_1STQUARTR,a0 ;>1st guarter
|
||
calla AUD1
|
||
|
||
JSRP plyr_endqfinishshot
|
||
|
||
clr a0
|
||
move a0,@kp_qscrs,L
|
||
move a0,@kp_qscrs+32,L
|
||
move a0,@kp_qscrs+64,L
|
||
move a0,@kp_qscrs+96,L
|
||
move a0,@kp_qscrs+128,L ;overtime 1
|
||
move a0,@kp_qscrs+160,L ;overtime 2
|
||
move a0,@kp_qscrs+192,L ;overtime 3
|
||
move @scores,a0
|
||
move a0,@kp_qscrs
|
||
move @scores+16,a0
|
||
move a0,@kp_qscrs+16
|
||
|
||
.ref tuneq1_snd
|
||
.ref tuneq1ed_snd
|
||
.ref crwdbed_kill
|
||
move @pup_nomusic,a14
|
||
jrz #play1
|
||
SOUND1 tuneq1_snd
|
||
#play1
|
||
SOUND1 tuneq1ed_snd
|
||
SOUND1 crwdbed_kill
|
||
|
||
JSRP hint_page
|
||
jruc #tob
|
||
|
||
#delay_spch
|
||
SLEEP 90
|
||
.ref at_hlftme_sp
|
||
SOUND1 at_hlftme_sp
|
||
DIE
|
||
|
||
#not1st
|
||
subk 1,a0
|
||
jrne #nothalf
|
||
|
||
movi AUD_HALFTIME,a0 ;>2nd quarter
|
||
calla AUD1
|
||
|
||
JSRP plyr_endqfinishshot
|
||
|
||
move @scores,a0
|
||
move @kp_qscrs,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+32
|
||
move @scores+16,a0
|
||
move @kp_qscrs+16,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+48
|
||
|
||
CREATE0 #delay_spch
|
||
; .ref at_hlftme_sp
|
||
; SOUND1 at_hlftme_sp
|
||
|
||
.ref tuneq2_snd
|
||
.ref tuneq2ed_snd
|
||
move @pup_nomusic,a14
|
||
jrz #play2
|
||
SOUND1 tuneq2_snd
|
||
#play2
|
||
SOUND1 tuneq2ed_snd
|
||
SOUND1 crwdbed_kill
|
||
JSRP halftime_showclips
|
||
|
||
; SUBR plyr_eoq_lockcont ;Continuation point after clip lockup
|
||
|
||
clr a0
|
||
JSRP stats_page2
|
||
|
||
movi t1dunkcnt,a2 ;>Setup most dunking team for board shatter
|
||
move *a2,a1
|
||
cmpi 3,a1
|
||
jrlt #nobrk ;!Enough dunks?
|
||
subk 2,a1
|
||
neg a1
|
||
move a1,*a2 ;New cnt
|
||
#nobrk
|
||
movi t1dunkcnt+16,a2 ;>Setup most dunking team for board shatter
|
||
move *a2,a1
|
||
cmpi 3,a1
|
||
jrlt #nobrk2 ;!Enough dunks?
|
||
subk 2,a1
|
||
neg a1
|
||
move a1,*a2 ;New cnt
|
||
#nobrk2
|
||
|
||
;LOOK!!! What's THIS?!?
|
||
;Restart players here?
|
||
|
||
move @plyrproc_t,a8,L
|
||
move *a8(plyr_headobj_p),a0,L
|
||
calla DELOBJ
|
||
move *a8(plyr_shadobj_p),a0,L
|
||
calla DELOBJ
|
||
move a8,a0
|
||
calla KILL
|
||
|
||
move @plyrproc_t+32,a8,L
|
||
move *a8(plyr_headobj_p),a0,L
|
||
calla DELOBJ
|
||
move *a8(plyr_shadobj_p),a0,L
|
||
calla DELOBJ
|
||
move a8,a0
|
||
calla KILL
|
||
|
||
move @plyrproc_t+64,a8,L
|
||
move *a8(plyr_headobj_p),a0,L
|
||
calla DELOBJ
|
||
move *a8(plyr_shadobj_p),a0,L
|
||
calla DELOBJ
|
||
move a8,a0
|
||
calla KILL
|
||
|
||
move @plyrproc_t+96,a8,L
|
||
move *a8(plyr_headobj_p),a0,L
|
||
calla DELOBJ
|
||
move *a8(plyr_shadobj_p),a0,L
|
||
calla DELOBJ
|
||
move a8,a0
|
||
calla KILL
|
||
|
||
|
||
.if DRONES_2MORE
|
||
move @plyrproc_t+128,a8,L
|
||
move *a8(plyr_headobj_p),a0,L
|
||
calla DELOBJ
|
||
move *a8(plyr_shadobj_p),a0,L
|
||
calla DELOBJ
|
||
move a8,a0
|
||
calla KILL
|
||
move @plyrproc_t+160,a8,L
|
||
move *a8(plyr_headobj_p),a0,L
|
||
calla DELOBJ
|
||
move *a8(plyr_shadobj_p),a0,L
|
||
calla DELOBJ
|
||
move a8,a0
|
||
calla KILL
|
||
.endif
|
||
|
||
|
||
move @plyrobj_t,a0,L
|
||
calla DELOBJ
|
||
move @plyrobj_t+32,a0,L
|
||
calla DELOBJ
|
||
move @plyrobj_t+64,a0,L
|
||
calla DELOBJ
|
||
move @plyrobj_t+96,a0,L
|
||
calla DELOBJ
|
||
|
||
|
||
.if DRONES_2MORE
|
||
move @plyrobj_t+128,a0,L
|
||
calla DELOBJ
|
||
move @plyrobj_t+160,a0,L
|
||
calla DELOBJ
|
||
.endif
|
||
|
||
|
||
movi P1_PID,a0
|
||
calla KIL1C
|
||
movi P2_PID,a0
|
||
calla KIL1C
|
||
movi P3_PID,a0
|
||
calla KIL1C
|
||
movi P4_PID,a0
|
||
calla KIL1C
|
||
|
||
|
||
.if DRONES_2MORE
|
||
movi P5_PID,a0
|
||
calla KIL1C
|
||
movi P6_PID,a0
|
||
calla KIL1C
|
||
.endif
|
||
|
||
|
||
movi P1_PID,a0
|
||
calla obj_del1c
|
||
movi P2_PID,a0
|
||
calla obj_del1c
|
||
movi P3_PID,a0
|
||
calla obj_del1c
|
||
movi P4_PID,a0
|
||
calla obj_del1c
|
||
|
||
|
||
.if DRONES_2MORE
|
||
movi P5_PID,a0
|
||
calla obj_del1c
|
||
movi P6_PID,a0
|
||
calla obj_del1c
|
||
.endif
|
||
|
||
CREATE0 doplyrs
|
||
|
||
calla pal_clean
|
||
|
||
clr a0
|
||
move a0,@plyr_main_initdone
|
||
move a0,@DISPLAYON
|
||
|
||
|
||
;LOOK!!!
|
||
movi ARWPID,a0
|
||
calla KIL1C
|
||
movi arwid,a0
|
||
calla obj_del1c
|
||
movi ARWPID,a0
|
||
calla obj_del1c
|
||
|
||
CREATE0 delay_arws
|
||
|
||
; movk 1,a0
|
||
; move a0,@HALT
|
||
|
||
; movi >1e0c3100,a0
|
||
; move a0,@WORLDTLX,L
|
||
; clr a0
|
||
; move a0,@WORLDTLY,L
|
||
; move @ballobj_p,a0,L
|
||
; movi >1e7d6caf,a1
|
||
; move a1,*a0(OXVAL),L
|
||
; movi >ffc265df,a1
|
||
; move a1,*a0(OYVAL),L
|
||
; movi >0476c52d,a1
|
||
; move a1,*a0(OZVAL),L
|
||
; movi >2500,a1
|
||
; move a1,*a0(OZVEL),L
|
||
; clr a1
|
||
; move a1,*a0(OXVEL),L
|
||
; move a1,*a0(OYVEL),L
|
||
|
||
; clr a0
|
||
; move a0,@HALT
|
||
#plyrwt
|
||
SLEEPK 1
|
||
move @plyr_main_initdone,a0 ;Wait for plyrs to init
|
||
jrz #plyrwt
|
||
|
||
SLEEPK 1
|
||
|
||
PUSH a8,a13
|
||
|
||
move @plyrproc_t,a13,L
|
||
move @plyrobj_t,a8,L
|
||
move *a8(OIMG),a2,L ;>Set new head img
|
||
move *a2(IANI3ID),a1
|
||
sll 5,a1 ;*32
|
||
move *a2(IANI3Z),a14
|
||
neg a14
|
||
|
||
move *a13(plyr_attrib_p),a0,L
|
||
move *a0(PAT_HEADT_p),a0,L
|
||
add a1,a0
|
||
move *a0,a4,L
|
||
|
||
move *a13(plyr_headobj_p),a3,L
|
||
move a14,*a3(OMISC)
|
||
move a4,*a3(OIMG),L ;Set new img
|
||
move *a4,a14,L
|
||
move a14,*a3(OSIZE),L
|
||
move *a4(ISAG),*a3(OSAG),L
|
||
|
||
setf 1,0,0
|
||
move *a8(OCTRL+4),*a3(OCTRL+4) ;Copy HFlip bit
|
||
move *a2(IFLAGS+FLIPH_IFB),a14 ;Chk reverse bit
|
||
jrz #nohflip
|
||
move *a3(OCTRL+4),a14 ;Reverse hflip
|
||
addk 1,a14
|
||
move a14,*a3(OCTRL+4)
|
||
#nohflip
|
||
setf 16,1,0
|
||
|
||
move @plyrproc_t+32,a13,L
|
||
move @plyrobj_t+32,a8,L
|
||
move *a8(OIMG),a2,L ;>Set new head img
|
||
move *a2(IANI3ID),a1
|
||
sll 5,a1 ;*32
|
||
move *a2(IANI3Z),a14
|
||
neg a14
|
||
|
||
move *a13(plyr_attrib_p),a0,L
|
||
move *a0(PAT_HEADT_p),a0,L
|
||
add a1,a0
|
||
move *a0,a4,L
|
||
|
||
move *a13(plyr_headobj_p),a3,L
|
||
move a14,*a3(OMISC)
|
||
move a4,*a3(OIMG),L ;Set new img
|
||
move *a4,a14,L
|
||
move a14,*a3(OSIZE),L
|
||
move *a4(ISAG),*a3(OSAG),L
|
||
|
||
setf 1,0,0
|
||
move *a8(OCTRL+4),*a3(OCTRL+4) ;Copy HFlip bit
|
||
move *a2(IFLAGS+FLIPH_IFB),a14 ;Chk reverse bit
|
||
jrz #nohflip2
|
||
move *a3(OCTRL+4),a14 ;Reverse hflip
|
||
addk 1,a14
|
||
move a14,*a3(OCTRL+4)
|
||
#nohflip2
|
||
setf 16,1,0
|
||
|
||
PULL a8,a13
|
||
|
||
movk 1,a0
|
||
move a0,@DISPLAYON
|
||
; movk 1,a0
|
||
; move a0,@HALT
|
||
jruc #tob
|
||
|
||
;--------------------
|
||
|
||
delay_arws
|
||
SLEEPK 10 ;Give players a chance to start
|
||
|
||
.ref start_arws
|
||
calla start_arws
|
||
|
||
; SLEEP 1*60
|
||
SLEEPK 8
|
||
|
||
clr a0
|
||
move a0,@HALT
|
||
|
||
DIE
|
||
|
||
;--------------------
|
||
|
||
doplyrs
|
||
; move @pup_bighead,a0
|
||
; zext a0
|
||
; cmpi >eaea,a0
|
||
; jrnz #no_3d
|
||
; movk >f,a2
|
||
; move a2,@pup_maxsteal
|
||
; jruc #adjoff
|
||
;#no_3d
|
||
; clr a2
|
||
; movk ADJHEADSZ,a0 ;Get head size
|
||
; calla GET_ADJ ;1-2
|
||
; subk 1,a0
|
||
; jrle #adjoff ;No big heads?
|
||
; movk >f,a2
|
||
;#adjoff
|
||
; move a2,@pup_bighead
|
||
|
||
movi plyrproc_t+32*NUMPLYRS,a2
|
||
movi plyrobj_t+32*(NUMPLYRS-1),a9
|
||
movk NUMPLYRS-1,a8
|
||
#strtp
|
||
CREATE0 plyr_main
|
||
move a0,-*a2,L ;Save *proc
|
||
subk 32,a9
|
||
dsj a8,#strtp
|
||
|
||
move a13,-*a2,L
|
||
jruc plyr_main ;#0
|
||
|
||
;--------------------
|
||
|
||
#nothalf
|
||
subk 1,a0
|
||
jrne #not3rd
|
||
|
||
movi AUD_3RDQUARTR,a0 ;>3rd quarter
|
||
calla AUD1
|
||
|
||
JSRP plyr_endqfinishshot
|
||
|
||
move @scores,a0
|
||
move @kp_qscrs,a14
|
||
move @kp_qscrs+32,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+64
|
||
move @scores+16,a0
|
||
move @kp_qscrs+16,a14
|
||
move @kp_qscrs+48,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+80
|
||
|
||
.ref tuneq3_snd
|
||
.ref tuneq3ed_snd
|
||
move @pup_nomusic,a14
|
||
jrz #play3
|
||
SOUND1 tuneq3_snd
|
||
#play3
|
||
SOUND1 tuneq3ed_snd
|
||
SOUND1 crwdbed_kill
|
||
|
||
JSRP hint_page
|
||
jruc #tob
|
||
|
||
|
||
#not3rd
|
||
|
||
;2/9/93
|
||
; clr a0
|
||
; move a0,@gmqrtr
|
||
; jruc mark
|
||
|
||
subk 1,a0
|
||
jrne #not4th
|
||
|
||
movi AUD_4THQUARTR,a0 ;>4th quarter
|
||
calla AUD1
|
||
|
||
JSRP plyr_endqfinishshot
|
||
|
||
move @scores,a0
|
||
move @kp_qscrs,a14
|
||
move @kp_qscrs+32,a1
|
||
move @kp_qscrs+64,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+96
|
||
move @scores+16,a0
|
||
move @kp_qscrs+16,a14
|
||
move @kp_qscrs+48,a1
|
||
move @kp_qscrs+80,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+112
|
||
|
||
.ref tuneq4_snd
|
||
move @pup_nomusic,a14
|
||
jrz #play4
|
||
SOUND1 tuneq4_snd
|
||
#play4
|
||
move @scores,a0
|
||
move @scores+16,a1
|
||
cmp a0,a1
|
||
jreq #tie
|
||
|
||
#endofg callr endgame_audits ;>End of game
|
||
|
||
.ref tune_wingame
|
||
SOUND1 tune_wingame
|
||
SOUND1 crwdbed_kill
|
||
|
||
SLEEP TSEC*2
|
||
|
||
.ref victory_speech
|
||
calla victory_speech
|
||
|
||
SLEEP TSEC*2+30
|
||
|
||
; JSRP result_screen
|
||
|
||
;The TRIVIA GAME is called within 'stats_page'
|
||
movk 1,a0
|
||
JSRP stats_page
|
||
|
||
clr a0
|
||
move a0,@IRQSKYE
|
||
|
||
calla display_blank
|
||
calla save_player_records
|
||
.ref update_team_stats_records
|
||
calla update_team_stats_records
|
||
.ref update_world_records
|
||
calla update_world_records
|
||
calla display_unblank
|
||
|
||
JSRP rank_screen
|
||
|
||
JSRP grand_champs_screen ;if a champ is found then
|
||
; move a10,a10 ;print the hiscore screen next
|
||
; jrz #no_champ
|
||
|
||
; JSRP show_hiscore
|
||
|
||
;#no_champ
|
||
|
||
clr a0
|
||
|
||
move a0,@qtr_purchased,L ;clr 4x16
|
||
move a0,@qtr_purchased+20h,L
|
||
|
||
move @team1,a0
|
||
move a0,@kp_team1
|
||
move @team2,a0
|
||
move a0,@kp_team2
|
||
move @scores,a0,L
|
||
move a0,@kp_scores,L
|
||
|
||
move @kp_qscrs,a0,L
|
||
move a0,@kp_qscrs2,L
|
||
move @kp_qscrs+32,a0,L
|
||
move a0,@kp_qscrs2+32,L
|
||
move @kp_qscrs+64,a0,L
|
||
move a0,@kp_qscrs2+64,L
|
||
move @kp_qscrs+96,a0,L
|
||
move a0,@kp_qscrs2+96,L
|
||
move @kp_qscrs+128,a0,L
|
||
move a0,@kp_qscrs2+128,L
|
||
move @kp_qscrs+160,a0,L
|
||
move a0,@kp_qscrs2+160,L
|
||
move @kp_qscrs+192,a0,L
|
||
move a0,@kp_qscrs2+192,L
|
||
|
||
JSRP winner_stays_on
|
||
|
||
; move @PSTATUS,a0
|
||
; jrz #x
|
||
; jruc game_start2
|
||
;#x
|
||
jauc game_over
|
||
|
||
|
||
#not4th
|
||
JSRP plyr_endqfinishshot ;>Overtime
|
||
|
||
move @gmqrtr,a0
|
||
subk 5,a0 ;which overtime ?
|
||
jrne #notot1 ;br=not 1st
|
||
|
||
move @scores,a0
|
||
move @kp_qscrs,a14
|
||
move @kp_qscrs+32,a1
|
||
move @kp_qscrs+64,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
move @kp_qscrs+96,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+128
|
||
move @scores+16,a0
|
||
move @kp_qscrs+16,a14
|
||
move @kp_qscrs+48,a1
|
||
move @kp_qscrs+80,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
move @kp_qscrs+112,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+144
|
||
jruc #otdne
|
||
#notot1
|
||
subk 1,a0
|
||
jrne #notot2
|
||
|
||
move @scores,a0
|
||
move @kp_qscrs,a14
|
||
move @kp_qscrs+32,a1
|
||
move @kp_qscrs+64,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
move @kp_qscrs+96,a1
|
||
add a1,a14
|
||
move @kp_qscrs+128,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+160
|
||
move @scores+16,a0
|
||
move @kp_qscrs+16,a14
|
||
move @kp_qscrs+48,a1
|
||
move @kp_qscrs+80,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
move @kp_qscrs+112,a1
|
||
add a1,a14
|
||
move @kp_qscrs+144,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+176
|
||
jruc #otdne
|
||
#notot2
|
||
subk 1,a0
|
||
jrne #otdne
|
||
|
||
move @scores,a0
|
||
move @kp_qscrs,a14
|
||
move @kp_qscrs+32,a1
|
||
move @kp_qscrs+64,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
move @kp_qscrs+96,a1
|
||
add a1,a14
|
||
move @kp_qscrs+128,a1
|
||
add a1,a14
|
||
move @kp_qscrs+160,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+192
|
||
move @scores+16,a0
|
||
move @kp_qscrs+16,a14
|
||
move @kp_qscrs+48,a1
|
||
move @kp_qscrs+80,a2
|
||
add a1,a14
|
||
add a2,a14
|
||
move @kp_qscrs+112,a1
|
||
add a1,a14
|
||
move @kp_qscrs+144,a1
|
||
add a1,a14
|
||
move @kp_qscrs+176,a1
|
||
add a1,a14
|
||
sub a14,a0
|
||
move a0,@kp_qscrs+208
|
||
|
||
#otdne
|
||
.ref tuneot_snd
|
||
move @pup_nomusic,a14
|
||
jrz #play5
|
||
SOUND1 tuneot_snd
|
||
#play5
|
||
move @scores,a0
|
||
move @scores+16,a1
|
||
cmp a0,a1
|
||
jrne #endofg
|
||
|
||
|
||
;Display Double or Triple OT message, keep going...
|
||
|
||
#tie ;>Tie
|
||
movi AUD_OVERTIME,a0
|
||
calla AUD1
|
||
|
||
.ref tuneoted_snd
|
||
SOUND1 tuneoted_snd
|
||
SOUND1 crwdbed_kill
|
||
|
||
movk 1,a0
|
||
move a0,@HALT
|
||
|
||
movi 6*TSEC+10-70+60-20,a11
|
||
CREATE0 scr1
|
||
CREATE0 show_ot_msg
|
||
|
||
SLEEP 120
|
||
|
||
SOUND1 overtime_sp
|
||
|
||
SLEEP 110
|
||
|
||
movk 12,a1 ;Free time into OT for
|
||
movi P1DATA,a2
|
||
|
||
move @game_purchased,a0
|
||
movk 4,b0
|
||
clr a3
|
||
|
||
#tlp btst a3,a0
|
||
jrz #nx ;No full game?
|
||
move a1,*a2(ply_time) ;Give xtra time
|
||
#nx addi PDSIZE,a2
|
||
addk 1,a3
|
||
dsj b0,#tlp
|
||
|
||
move b0,@game_purchased
|
||
|
||
move @team1,a0
|
||
move a0,@kp_team1
|
||
move @team2,a0
|
||
move a0,@kp_team2
|
||
move @scores,a0,L
|
||
move a0,@kp_scores,L
|
||
|
||
JSRP hint_page
|
||
|
||
; jruc #tob
|
||
;
|
||
; move @ballpnum,a11
|
||
; jrnn #ok1
|
||
; move @ballpnumshot,a11
|
||
;#ok1
|
||
; srl 1,a11
|
||
; subk 1,a11
|
||
; CREATE0 plyr_takeoutball3
|
||
; jruc #tob2
|
||
|
||
|
||
#tob
|
||
|
||
CREATE0 test
|
||
|
||
|
||
.ref random_ads
|
||
calla random_ads
|
||
|
||
calla pal_clean
|
||
movi nofade_t,a10
|
||
CREATE0 fade_up_half
|
||
|
||
CREATE0 fix_floor
|
||
|
||
;Take this out to stop ball being inbounded after score
|
||
;FIX!!! where'd this buggy hunk-o-junk come from?
|
||
|
||
; move @gmqrtr,a11
|
||
; sll 32-1,a11
|
||
; move @gmqrtr,a0
|
||
; cmpi 2,a0
|
||
; jrnz #not2
|
||
; CREATE0 plyr_takeoutball ;takepid(?)
|
||
; jruc #tob2
|
||
;#not2 CREATE0 plyr_takeoutball2
|
||
;#tob2
|
||
|
||
;What's up with this mod?
|
||
move @gmqrtr,a11
|
||
sll 32-1,a11
|
||
CREATE0 plyr_takeoutball2
|
||
|
||
clr a0
|
||
move a0,@cntrs_delay ;Delay credit timers
|
||
;LOOK!!!
|
||
move @gmqrtr,a14
|
||
cmpi 2,a14
|
||
jrz #skp
|
||
move a0,@HALT
|
||
#skp clr a0
|
||
;movi 2<<10+4<<5+9,a0
|
||
move a0,@IRQSKYE
|
||
|
||
move @gmqrtr,a14
|
||
cmpi 2,a14
|
||
jrnz #skpz
|
||
CREATE0 delay_numbs
|
||
RETP
|
||
|
||
|
||
|
||
test
|
||
;Del old side arrows for all players & in plyr_lost A8
|
||
movi plyrproc_t,a9
|
||
movk 4,a10
|
||
#lp move *a9+,a0,L
|
||
move *a0(plyr_lost_ptr),a2,L
|
||
move *a2(PA8),a0,L
|
||
jrz #nxt
|
||
clr a14
|
||
move *a2(PA9),a1,L
|
||
move a14,*a1(OSCALE)
|
||
movk 10,a14
|
||
move a14,*a2(PTIME)
|
||
calla DELOBJ
|
||
clr a0
|
||
move a0,*a2(PA8),L
|
||
#nxt dsj a10,#lp
|
||
|
||
DIE
|
||
|
||
#skpz
|
||
;Make sure #'s are on at start of qrtr
|
||
movi P1DATA,a10 ;Turn on #'s at start of qrtr
|
||
calla stick_number
|
||
movi P2DATA,a10
|
||
calla stick_number
|
||
movi P3DATA,a10
|
||
calla stick_number
|
||
movi P4DATA,a10
|
||
calla stick_number
|
||
|
||
RETP
|
||
|
||
delay_numbs
|
||
;Make sure #'s are on at start of qrtr
|
||
SLEEPK 20 ;Turn on #'s at start of 2nd half
|
||
movi P1DATA,a10
|
||
calla stick_number
|
||
movi P2DATA,a10
|
||
calla stick_number
|
||
movi P3DATA,a10
|
||
calla stick_number
|
||
movi P4DATA,a10
|
||
calla stick_number
|
||
DIE
|
||
|
||
fix_floor
|
||
SLEEPK 12
|
||
.ref fix_floorclr
|
||
calla fix_floorclr
|
||
DIE
|
||
|
||
#*******************************
|
||
|
||
SUBRP endgame_audits
|
||
|
||
; movi 0100b,a0
|
||
; move a0,@PSTATUS2
|
||
;
|
||
; movi 28,a0
|
||
; move a0,@scores
|
||
; movi 49,a0
|
||
; move a0,@scores+10h
|
||
|
||
|
||
movi AUD_COMPLETED,a0 ;>4th quarter
|
||
calla AUD1
|
||
|
||
move @scores,a0
|
||
move @scores+10h,a1
|
||
cmp a1,a0
|
||
jrhi #t1_wins
|
||
#t2_wins
|
||
movi AUD_LOS_SCORE,a0
|
||
move @scores,a1
|
||
calla AUD
|
||
|
||
movi AUD_WIN_SCORE,a0
|
||
move @scores+10h,a1
|
||
calla AUD
|
||
|
||
jruc #cont
|
||
|
||
#t1_wins
|
||
movi AUD_WIN_SCORE,a0
|
||
move @scores,a1
|
||
calla AUD
|
||
|
||
movi AUD_LOS_SCORE,a0
|
||
move @scores+10h,a1
|
||
calla AUD
|
||
#cont
|
||
|
||
move @PSTATUS2,a0
|
||
andi 011b,a0
|
||
jrnz #team1_human
|
||
;#team1_cpu
|
||
move @scores,a4 ;CPU SCORE
|
||
move @scores+10h,a5 ;HUMAN SCORE
|
||
|
||
movi AUD_CPUGAMES,a0 ;a cpu team
|
||
calla AUD1
|
||
movi AUD_CPUSCORES,a0
|
||
move a4,a1 ;cpu score
|
||
calla AUD
|
||
callr do_cpu_stats
|
||
jruc #cont2
|
||
|
||
#team1_human
|
||
movi AUD_HUMGAMES,a0 ;a human team
|
||
calla AUD1
|
||
movi AUD_HUMSCORES,a0
|
||
move @scores,a1 ;human score
|
||
calla AUD
|
||
|
||
|
||
#cont2
|
||
move @PSTATUS2,a0
|
||
andi 01100b,a0
|
||
jrnz #team2_human
|
||
;#team2_cpu
|
||
move @scores+10h,a4 ;CPU SCORE
|
||
move @scores,a5 ;HUMAN SCORE
|
||
|
||
|
||
movi AUD_CPUGAMES,a0 ;a cpu team
|
||
calla AUD1
|
||
movi AUD_CPUSCORES,a0
|
||
move a4,a1 ;cpu score
|
||
calla AUD
|
||
callr do_cpu_stats
|
||
rets
|
||
|
||
#team2_human
|
||
movi AUD_HUMGAMES,a0 ;a human team
|
||
calla AUD1
|
||
movi AUD_HUMSCORES,a0
|
||
move @scores+10h,a1 ;human score
|
||
calla AUD
|
||
|
||
|
||
;Now total all human vs. human games, and audit left side winners
|
||
|
||
move @PSTATUS2,a0
|
||
andi 011b,a0
|
||
jrz #novs
|
||
move @PSTATUS2,a0
|
||
andi 01100b,a0
|
||
jrz #novs
|
||
;Was a human vs. human game.
|
||
movi AUD_HUMANVSHUMAN,a0
|
||
calla AUD1
|
||
move @scores,a0
|
||
move @scores+10h,a1
|
||
cmp a1,a0
|
||
jrlo #tm2_wins
|
||
movi AUD_WINSONLEFT,a0
|
||
calla AUD1
|
||
#tm2_wins
|
||
#novs
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Update CPU stats
|
||
* A4=Cpu score
|
||
* A5=Human score
|
||
|
||
do_cpu_stats
|
||
|
||
cmp a4,a5
|
||
jrhi #cpu_loses
|
||
|
||
;cpu_wins
|
||
movi AUD_CPUWINS,a0 ;CPU victories + 1
|
||
calla AUD1
|
||
|
||
movi AUD_CPUWINMARG,a0
|
||
calla GET_AUD ;RET in A1
|
||
|
||
sub a5,a4
|
||
cmp a1,a4
|
||
jrls #not_higher
|
||
move a4,a1
|
||
movi AUD_CPUWINMARG,a0 ;new win margin
|
||
calla STORE_AUDIT
|
||
rets
|
||
|
||
#cpu_loses
|
||
movi AUD_CPULOSMARG,a0
|
||
calla GET_AUD ;RET in A1
|
||
|
||
sub a4,a5 ;HUMAN - CPU SCORE
|
||
cmp a1,a5
|
||
jrls #not_higher
|
||
move a5,a1
|
||
movi AUD_CPULOSMARG,a0 ;new loss margin
|
||
calla STORE_AUDIT
|
||
#not_higher
|
||
rets
|
||
|
||
|
||
|
||
#*******************************
|
||
* Let shot finish at end of quarter (JSRP)
|
||
|
||
SUBRP plyr_endqfinishshot
|
||
|
||
movi TSEC*5/2,a10
|
||
#lp
|
||
move @ballpnum,a0
|
||
jrnn #stop ;Somebody has ball?
|
||
move @ballobj_p,a2,L
|
||
move *a2(OYPOS),a0
|
||
cmpi -15,a0
|
||
jrgt #stop ;Ball near gnd?
|
||
|
||
SLEEPK 2
|
||
|
||
#gbcnt dsj a10,#lp
|
||
|
||
#stop
|
||
move @ballpnum,a0
|
||
jrn #no_owner
|
||
sll 5,a0 ;*32
|
||
addi plyrproc_t,a0
|
||
move *a0,a0,L
|
||
move *a0(plyr_seqflgs),a1
|
||
btst DUNK_B,a1
|
||
jrz #no_owner
|
||
move *a0(plyr_jmpcnt),a1
|
||
cmpi 15,a1
|
||
jrlt #no_owner
|
||
|
||
; jrnz #was_bad
|
||
; btst SHOOT_B,a1
|
||
; jrz #no_owner
|
||
;#was_bad
|
||
CREATE0 dobad
|
||
#no_owner
|
||
|
||
movk 1,a0
|
||
callr plyr_setac
|
||
|
||
clr a0
|
||
move a0,@P1CTRL,L ;Clr p1 & p2 &
|
||
move a0,@P3CTRL,L ; p3 & p4
|
||
.if DRONES_2MORE
|
||
move a0,@P5CTRL,L ; & p5 & p6
|
||
.endif
|
||
|
||
movi clockid,a0
|
||
calla KIL1C ;Kill existing shot clock proc
|
||
movi CLSDEAD|clockid,a0
|
||
calla obj_del1c ;Delete any 24 second shot clock imgs
|
||
clr a0
|
||
move a0,@sc_proc,L
|
||
move a0,@game_time,L
|
||
|
||
movk 1,a0
|
||
move a0,@HALT
|
||
|
||
move @tvpanelon,a0,L
|
||
jrz #turnon
|
||
|
||
movi CLSDEAD|tvid,a0
|
||
clr a1
|
||
calla EXISTOBJ
|
||
jrz #turnon
|
||
|
||
move @tvpanelon,a0,L
|
||
movi 6*TSEC,a1
|
||
move a1,*a0(PTIME)
|
||
#turnon
|
||
|
||
CREATE0 score_showtvpanel2
|
||
|
||
move @gmqrtr,a0 ;Ran out of time
|
||
subk 4,a0
|
||
jrlt #fade
|
||
move @scores,a0
|
||
move @scores+16,a1
|
||
cmp a0,a1
|
||
jreq #fade
|
||
|
||
SLEEP 90
|
||
|
||
; move @tvpanelon,a0,L
|
||
; jrz #turnon
|
||
; movi 6*TSEC,a1
|
||
; move a1,*a0(PTIME)
|
||
;#turnon
|
||
|
||
;Turn on winning team message
|
||
|
||
; SOUND1 tune_gmovr
|
||
|
||
.ref winning_msg
|
||
CREATE0 winning_msg
|
||
jruc #fade
|
||
|
||
#fade
|
||
SLEEPK 1
|
||
;Must wait for flash me routine to finish
|
||
movi flashpid,a0
|
||
clr a1
|
||
not a1
|
||
calla EXISTP
|
||
jrnz #fade
|
||
|
||
calla pal_clean
|
||
|
||
movi nofade_t,a10
|
||
CREATE0 fade_down_half
|
||
|
||
#x RETP
|
||
|
||
dobad SLEEP 100
|
||
SOUND1 baddec_sp
|
||
DIE
|
||
|
||
nofade_t ;Pals not to fade
|
||
.long scorep,NEWPLATPP
|
||
.long SGMD8RED,SGMD8WHT
|
||
.long textp,cred_p
|
||
.long ledw,ledr
|
||
.long NEWPLATPP,NBALOG_P
|
||
.long TURBO_B_P,TURBO_G_P,TURBO_Y_P,TURBO_R_P
|
||
.long BST18Y_P,BST18W_P,BST18R_P
|
||
.long BAST_W_P,BAST_Y_P
|
||
.long BRUSH_W_P,BRUSH_Y_P,BRUSH_R_P
|
||
.long HANGF_R_P,HANGF_W_P
|
||
.long LED_P,TIMPLT_P
|
||
.long HINT_B_P,HINT_B_P,HINT_B_P,HINT_B_P
|
||
.long BRSH_R_P
|
||
.long BALLBAK_P
|
||
.long FFRAM_B_P
|
||
.long LOG_ATLP
|
||
.long LOG_BOSP
|
||
.long LOG_CHAP
|
||
.long LOG_CHIP
|
||
.long LOG_CLEP
|
||
.long LOG_DALP
|
||
.long LOG_DENP
|
||
.long LOG_DETP
|
||
.long LOG_DETNP
|
||
.long LOG_GOLP
|
||
.long LOG_HOUP
|
||
.long LOG_INDP
|
||
.long LOG_LACP
|
||
.long LOG_LALP
|
||
.long LOG_MIAP
|
||
.long LOG_MILP
|
||
.long LOG_MINP
|
||
.long LOG_MINNP
|
||
.long LOG_NEJP
|
||
.long LOG_NEYP
|
||
.long LOG_ORLP
|
||
.long LOG_PHIP
|
||
.long LOG_PHXP
|
||
.long LOG_PORP
|
||
.long LOG_SACP
|
||
.long LOG_SANP
|
||
.long LOG_SEAP
|
||
.long LOG_TORP
|
||
.long LOG_UTAP
|
||
.long LOG_UTANP
|
||
.long LOG_VANP
|
||
.long LOG_WASP
|
||
.long 0
|
||
|
||
|
||
|
||
|
||
#*******************************
|
||
* Player goaltended (Process)
|
||
* A11=*Plyr obj
|
||
|
||
SUBR plyr_goaltending
|
||
|
||
move *a11(OPLINK),a11,L
|
||
move *a11(plyr_num),a0
|
||
|
||
srl 1,a0
|
||
move a0,a11
|
||
XORK 1,a0
|
||
sll 4,a0 ;0 or 16
|
||
|
||
addi scores,a0 ;+Base
|
||
move @ballptsforshot,a1
|
||
move a1,a3
|
||
calla score_add
|
||
|
||
calla plyr_setptsdown
|
||
|
||
|
||
movk PS_2PTS_MADE,a0 ;>Inc try shot stat
|
||
subk 2,a3
|
||
jreq #2ptr
|
||
movk PS_3PTS_MADE,a0
|
||
#2ptr move @ballpnumshot,a1
|
||
calla inc_player_stat
|
||
|
||
calla prt_top_scores ;Update scores at scrn top
|
||
|
||
movi TSEC*2,a0
|
||
callr plyr_setshtdly
|
||
|
||
CREATE0 goaltend_text
|
||
|
||
SOUND1 whitsle_snd
|
||
|
||
move @tvpanelon,a0,L
|
||
jrz #turnon
|
||
movi 4*TSEC+10-70,a1
|
||
move a1,*a0(PTIME)
|
||
jruc #alrdyon
|
||
#turnon
|
||
CREATE0 score_showtvpanel
|
||
#alrdyon
|
||
|
||
movi P1DATA,a10
|
||
calla stick_number
|
||
movi P2DATA,a10
|
||
calla stick_number
|
||
movi P3DATA,a10
|
||
calla stick_number
|
||
movi P4DATA,a10
|
||
calla stick_number
|
||
|
||
SLEEP 30
|
||
|
||
clr a0
|
||
move a0,@ballptsforshot
|
||
|
||
jruc plyr_takeoutball3
|
||
|
||
#*******************************
|
||
* Show goaltending message (JSRP)
|
||
|
||
SUBRP goaltend_text
|
||
|
||
; move @ballobj_p,a2,L ;clear out ball vels
|
||
; clr a0
|
||
; move a0,*a2(OXVEL),L
|
||
; move a0,*a2(OYVEL),L
|
||
; move a0,*a2(OZVEL),L
|
||
;
|
||
; movk 4,a3
|
||
; movi plyrobj_t,a2,L ;clear out player vels
|
||
;#velini_lp
|
||
; move *a2+,a1,L
|
||
; move a0,*a1(OXVEL),L
|
||
; move a0,*a1(OYVEL),L
|
||
; move a0,*a1(OZVEL),L
|
||
; dsj a3,#velini_lp
|
||
;
|
||
; SLEEPK 1
|
||
;
|
||
; movk 1,a0
|
||
; move a0,@HALT
|
||
|
||
movk 3,a10
|
||
CREATE0 doalert_snd
|
||
|
||
move @game_time,a0,L
|
||
jaz SUCIDE
|
||
|
||
movi #ln0_setup,a2
|
||
calla setup_message
|
||
move *a2,a0,L
|
||
move a0,@mess_justify,L ;justification method
|
||
move @mess_cursx,a0
|
||
move a0,@mess_cursx2
|
||
movi CLSDEAD|123,a0
|
||
move a0,@mess_objid
|
||
|
||
movi #str_goaltend,a4
|
||
calla print_string2b
|
||
|
||
movi 84,a0
|
||
move a0,@mess_cursx2
|
||
movi 127,a0
|
||
move a0,@mess_cursy
|
||
|
||
addk 8,a4
|
||
calla print_string2b
|
||
|
||
CREATE0 flash_bigtxt
|
||
move a0,a9
|
||
|
||
SLEEP 1*TSEC
|
||
|
||
.ref goal_tend_sp
|
||
SOUND1 goal_tend_sp
|
||
|
||
SLEEP 1*TSEC
|
||
|
||
move a9,a0
|
||
calla KILL
|
||
|
||
movi CLSDEAD|123,a0
|
||
calla obj_del1c ;delete text
|
||
|
||
; clr a0
|
||
; move a0,@HALT
|
||
|
||
DIE
|
||
|
||
|
||
#ln0_setup
|
||
PRINT_STR hangfnt38_ascii,9,0,131,77,HANGF_R_P,kern_chars
|
||
|
||
#str_goaltend
|
||
.string "G",1,-1,"O",1,-5,"A",1,3,"L",0
|
||
.string "T",1,-6,"E",1,-6,"N",1,-6,"D",1,-2,"I",1,-5,"N",1,-3,"G",0
|
||
.even
|
||
|
||
|
||
#*******************************
|
||
* Control players for taking the ball out (Process)
|
||
* A11=Team who gets ball (0=1, !0=2)
|
||
|
||
STRUCTPD
|
||
WORD ptob_pball ;Plyr # (0-3) who gets ball
|
||
WORD ptob_pball2 ;P# who gets ball passed to him
|
||
|
||
|
||
SUBR plyr_takeoutball
|
||
|
||
; move @ballpnumshot,@ballpnum ;DEBUG
|
||
; move @ballpnumshot,a2
|
||
; sll 5,a2 ;*32
|
||
; addi plyrproc_t,a2
|
||
; move *a2,a1,L
|
||
; clr a0
|
||
; move a0,*a1(plyr_dribmode) ;Reset dribble
|
||
; movi -1,a0
|
||
; move a0,@inbound
|
||
; DIE
|
||
|
||
|
||
movi TOB_PID,a0 ;Kill any other plyr_takeoutball
|
||
move a0,*a13(PROCID)
|
||
calla KIL1C
|
||
|
||
movi -1,a0
|
||
move a0,@ballsclastp
|
||
move a0,@ballshotinair ;Shooter # if shot in air, else -1
|
||
|
||
movi TSEC+20,a0
|
||
callr plyr_setshtdly
|
||
clr a0
|
||
move a0,@P1CTRL,L ;Clr p1 & p2 &
|
||
move a0,@P3CTRL,L ; p3 & p4
|
||
.if DRONES_2MORE
|
||
move a0,@P5CTRL,L ; & p5 & p6
|
||
.endif
|
||
|
||
SLEEPK 1
|
||
|
||
movi -1,a0
|
||
move a0,@ballpnum
|
||
move a0,@ballpnumlast
|
||
|
||
movk 1,a0
|
||
callr plyr_setac
|
||
|
||
clr a0 ;Clr staggers
|
||
movi plyr_stagcnt,a1
|
||
callr plyr_setprocword
|
||
|
||
movi plyrproc_t,a0 ;Assume team 1 is inbounding
|
||
clr a2
|
||
move @PSTATUS,a3
|
||
movk 2,a9
|
||
move a11,a11
|
||
jrz #t1
|
||
addk 32,a0 ;Team 2 is inbounding
|
||
addk 32,a0
|
||
movk 1,a2
|
||
srl 2,a3
|
||
clr a9
|
||
#t1
|
||
move *a0+,a8,L ;A8=*Proc of plyr who gets ball
|
||
move *a0+,a7,L
|
||
move a2,@inbound ;Inbounding team (0-1)
|
||
add a2,a2 ;Make 0 or 1 a 0 or 2
|
||
|
||
andi 3,a3 ;Only look @ selected team bits
|
||
jrz #two_same ;Closest inbounds if both drones
|
||
cmpi 010b,a3
|
||
jreq #1st ;If human/drone, drone always
|
||
jrlo #2nd ; inbounds
|
||
|
||
#two_same
|
||
move *a8(plyr_balldist),a0 ;Both drone or human. Plyr closest
|
||
move *a7(plyr_balldist),a1 ; to ball inbounds
|
||
cmp a1,a0
|
||
jrle #1st ;1st in team if <=
|
||
#2nd
|
||
move a7,a8 ;2nd in team
|
||
addk 1,a2
|
||
#1st
|
||
move a2,*a13(ptob_pball) ;=inbounding plyr #
|
||
XORK 1,a2
|
||
move a2,*a13(ptob_pball2) ;=inbound teammate plyr #
|
||
|
||
|
||
movi TSEC*3,a10 ;Max wait for ball to be gotten
|
||
#gblp1
|
||
movi -1,a0
|
||
move a0,@ballpnum
|
||
move a0,@ballpnumlast
|
||
|
||
SLEEPK 1
|
||
|
||
|
||
.if DEBUG
|
||
move @plyrproc_t,a0,L
|
||
move *a0(plyr_nojoy),a0
|
||
jrnz #lock
|
||
move @plyrproc_t+32,a0,L
|
||
move *a0(plyr_nojoy),a0
|
||
jrnz #lock
|
||
move @plyrproc_t+64,a0,L
|
||
move *a0(plyr_nojoy),a0
|
||
jrnz #lock
|
||
move @plyrproc_t+96,a0,L
|
||
move *a0(plyr_nojoy),a0
|
||
jrz #ok
|
||
#lock
|
||
.if DEBUG
|
||
LOCKUP
|
||
.endif
|
||
#ok
|
||
.endif
|
||
|
||
|
||
|
||
callr plyrtob_moveo3 ;Move other plyrs to their spots
|
||
|
||
move @ballobj_p,a3,L ;Figure ball coor for inbounder to
|
||
move *a3(OXPOS),a0 ; chase
|
||
addk 6,a0 ;stupid K!!!
|
||
move *a3(OZPOS),a1
|
||
move *a13(ptob_pball),a2
|
||
callr plyrtob_seekxy ;Move inbounder to the ball
|
||
jrz #atball
|
||
dsj a10,#gblp1 ;Don't wait longer then A10
|
||
jruc #atball2
|
||
#atball
|
||
move *a8(plyr_jmpcnt),a0 ;Wait for inbounder to land if still
|
||
jrnz #gblp1 ; in a jump but has the ball
|
||
#atball2
|
||
clr a0
|
||
move a0,*a8(plyr_shtdly)
|
||
|
||
|
||
movi TSEC*1,a10 ;Max wait for ball to be picked up
|
||
#gblp2
|
||
movi -1,a0 ;Make sure noone has it
|
||
move a0,@ballpnum
|
||
move a0,@ballpnumlast
|
||
SLEEPK 1
|
||
move @ballpnum,a0 ;Does anyone have it now?
|
||
jrn #gbcnt2
|
||
move *a13(ptob_pball),a2
|
||
cmp a0,a2 ;Is it the inbounding plyr? Yes if =
|
||
jreq #gotball
|
||
#gbcnt2
|
||
callr plyrtob_moveo3 ;Move other plyrs to their spots
|
||
|
||
move @ballobj_p,a3,L ;Figure ball coor for inbounder to
|
||
move *a3(OXPOS),a0 ; chase
|
||
addk 6,a0 ;stupid K!!!
|
||
move *a3(OZPOS),a1
|
||
move *a13(ptob_pball),a2
|
||
callr plyrtob_seekxy ;Move inbounder to the ball
|
||
dsj a10,#gblp2 ;Don't wait longer then A10
|
||
#gotball
|
||
move *a13(ptob_pball),a0 ;Grab the ball
|
||
move a0,@ballpnum
|
||
clr a0
|
||
move a0,*a8(plyr_dribmode)
|
||
|
||
|
||
movi TSEC*3,a10 ;Max wait for inbounder to get OOB
|
||
#outlp
|
||
SLEEPK 1
|
||
|
||
callr plyrtob_moveo3 ;Move other plyrs to their spots
|
||
|
||
movi -IBX_OOB,a0 ;Set X per team inbounding
|
||
move a11,a11
|
||
jrz #outl ;Team2 on def
|
||
neg a0
|
||
#outl addi WRLDMID,a0
|
||
movi IBZ_OOB,a1
|
||
move *a13(ptob_pball),a2
|
||
move a2,@ballpnum
|
||
callr plyrtob_seekxy ;Move inbounder to OOB spot
|
||
jrz #outofb ;He's there if 0
|
||
dsj a10,#outlp ;Don't wait longer then A10
|
||
#outofb
|
||
movi -1,a0
|
||
move a0,*a8(plyr_dribmode)
|
||
calla call_scores
|
||
|
||
|
||
movi TSEC*3,a10 ;Max wait for other 3 to get in place
|
||
#wtlp
|
||
SLEEPK 1
|
||
|
||
callr plyrtob_moveo3 ;Move other plyrs to their spots
|
||
jrz #inpos ;They're there if 0
|
||
dsj a10,#wtlp ;Don't wait longer then A10
|
||
; .if DEBUG
|
||
; LOCKUP
|
||
; .endif
|
||
#inpos
|
||
;
|
||
;
|
||
;FIX!!! Allow movement during inbounds
|
||
;
|
||
; clr a14
|
||
; movi plyrproc_t,a0,L ;Assume team 1 is inbounding
|
||
; move *a0+,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move *a0+,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move *a0+,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move *a0,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; movk 1,a14
|
||
; move a0,*a13(plyr_autoctrl)
|
||
;
|
||
;
|
||
;
|
||
;
|
||
SLEEPK 30 ;Pause before inbounding
|
||
|
||
move *a13(ptob_pball),a0 ;Set inbounder as ball owner
|
||
move a0,@ballpnum
|
||
|
||
movk 20,a0 ;Don't call pass on inbound
|
||
move a0,@last_name_time
|
||
|
||
|
||
plyrtob_dopass
|
||
move *a13(ptob_pball),a10 ;>Pass with turbo
|
||
sll 4,a10
|
||
addi P1CTRL,a10
|
||
movi (BUT2_M|BUT3_M)<<8|BUT2_M|BUT3_M,a0
|
||
move a0,*a10
|
||
|
||
movi TSEC*2,a2 ;Max wait for pass to start
|
||
#waitp
|
||
PUSHP a2
|
||
SLEEPK 1
|
||
PULLP a2
|
||
move *a8(plyr_seqflgs),a0
|
||
btst PASS_B,a0
|
||
jrnz #passing
|
||
dsj a2,#waitp ;Don't wait longer then A2
|
||
#passing
|
||
clr a0 ;Clr inbounder PxCRTL
|
||
|
||
move a0,@drone_attempt ;Alley oop jump up attempts
|
||
|
||
move a0,*a10
|
||
not a0 ;Inbounding off
|
||
move a0,@inbound
|
||
|
||
;Take out for moving during inbound!
|
||
|
||
SLEEPK 30
|
||
jruc #runinlp
|
||
;
|
||
;;Start here for moving during inbound!
|
||
;
|
||
; SLEEPK 1
|
||
;
|
||
; movk 1,a0
|
||
; move a0,@inbound_lead
|
||
;
|
||
; SLEEPK 1
|
||
;
|
||
; move *a13(ptob_pball),a0
|
||
; XORK 1,a0
|
||
; sll 5,a0
|
||
; addi plyrproc_t,a0,L
|
||
; move *a0+,a1,L
|
||
; clr a14
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move a14,*a1(plyr_nojoy)
|
||
;
|
||
; move *a13(ptob_pball),a0
|
||
; btst 1,a0
|
||
; jrz #tm1
|
||
;;Team 2 is inbounding
|
||
;
|
||
; movi plyrproc_t,a0,L
|
||
; move *a0+,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move a14,*a1(plyr_nojoy)
|
||
; move *a0,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move a14,*a1(plyr_nojoy)
|
||
; jruc #ext
|
||
;
|
||
;#tm1
|
||
;;Team 1 is inbounding
|
||
;
|
||
; movi plyrproc_t+64,a0,L
|
||
; move *a0+,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move a14,*a1(plyr_nojoy)
|
||
; move *a0,a1,L
|
||
; move a14,*a1(plyr_autoctrl)
|
||
; move a14,*a1(plyr_nojoy)
|
||
;
|
||
;#ext
|
||
; PUSHP a9
|
||
; movk 30,a9
|
||
;#lpit SLEEPK 1
|
||
; callr joy_read2
|
||
;
|
||
; move *a13(ptob_pball),a0
|
||
; sll 4,a0
|
||
; addi P1CTRL,a0
|
||
; clr a14
|
||
; move a14,*a0
|
||
;
|
||
; dsjs a9,#lpit
|
||
; PULLP a9
|
||
;
|
||
;
|
||
; clr a0
|
||
; move a0,@inbound_lead
|
||
|
||
|
||
|
||
#runinlp
|
||
SLEEPK 1 ;Wait till inbounder is back on court
|
||
movi -IBX_CRT,a0 ;Set X per team inbounding
|
||
move a11,a11
|
||
jrz #outl2 ;Team2 on def
|
||
neg a0
|
||
#outl2 addi WRLDMID,a0
|
||
movi IBZ_CRT,a1
|
||
move *a13(ptob_pball),a2
|
||
callr plyrtob_seekxy ;Move inbounder to court spot
|
||
jrz #cont ;Wait till he gets there
|
||
|
||
;For moving during inbound!
|
||
|
||
; PUSHP a9,a10,a11
|
||
; move a13,a11
|
||
; move a0,a9
|
||
; move @tmp_fix,a10,L
|
||
; CREATE0 fuck
|
||
; PULLP a9,a10,a11
|
||
|
||
jruc #runinlp ;Wait till he gets there
|
||
#cont
|
||
move a11,a0
|
||
calla shot_clock ;New 24
|
||
|
||
clr a0
|
||
move a0,@plyrinautorbnd ;In case seq didn't clr
|
||
move a0,@ballflash
|
||
move a0,@pass_off
|
||
move a0,@steals_off
|
||
move a0,@slamming
|
||
|
||
|
||
move *a13(ptob_pball),a0
|
||
sll 5,a0
|
||
addi plyrproc_t,a0
|
||
move *a0,a0,L
|
||
clr a14
|
||
move a14,*a0(plyr_nojoy)
|
||
|
||
clr a0
|
||
callr plyr_setac
|
||
|
||
clr a0 ;Clr staggers
|
||
movi plyr_stagcnt,a1
|
||
callr plyr_setprocword
|
||
|
||
clr a0
|
||
movi plyr_d_cflgs,a1
|
||
callr plyr_setprocword
|
||
|
||
.ref drone_setuptob
|
||
calla drone_setuptob
|
||
|
||
|
||
|
||
;This patch allows clock to be displayed at start of qrtrs and to not get
|
||
;an overlapped time when someone scores..
|
||
move @game_time,a14,L
|
||
cmpi >2040906,a14
|
||
jrlt #goclock
|
||
SLEEP 45
|
||
#goclock
|
||
clr a0
|
||
move a0,@clock_active ;Start game clock again
|
||
DIE
|
||
|
||
|
||
|
||
|
||
;For moving during inbound!
|
||
;fuck
|
||
; move *a11(ptob_pball),a0
|
||
; sll 5,a0
|
||
; addi plyrproc_t,a0
|
||
; move *a0,a0,L
|
||
; move a9,*a10
|
||
; ori 8000h,a9
|
||
; move a9,*a0(plyr_nojoy)
|
||
; DIE
|
||
|
||
|
||
#*****************************************************************************
|
||
* Control players for taking the ball out (Process)
|
||
* Teleport players to their positions
|
||
* A11=Team who gets ball (0=1, !0=2)
|
||
|
||
.asg 60h,FACE_LEFT
|
||
.asg 20h,FACE_RIGHT
|
||
|
||
SUBR plyr_takeoutball2
|
||
|
||
movi TOB_PID,a0 ;Kill any other plyr_takeoutball
|
||
move a0,*a13(PROCID)
|
||
calla KIL1C
|
||
|
||
movi -1,a0
|
||
move a0,@ballsclastp
|
||
move a0,@ballshotinair ;Shooter # if shot in air, else -1
|
||
|
||
movk 1,a0
|
||
callr plyr_setac
|
||
|
||
clr a0
|
||
move a0,@P1CTRL,L ;Clr p1 & p2 &
|
||
move a0,@P3CTRL,L ; p3 & p4
|
||
.if DRONES_2MORE
|
||
move a0,@P5CTRL,L ; & p5 & p6
|
||
.endif
|
||
|
||
move a0,@WORLDTLY,L ;Set for plyr 1 with the ball
|
||
movi [WRLDMID-200-MAX_VIEW1+15,0],a1
|
||
movk 1,a2 ;Plyr 2 receives
|
||
movi #t1_setup_table,a10
|
||
move a11,a11
|
||
jrz #setib
|
||
movk 1,a0 ;Set for plyr 4 with the ball
|
||
movi [WRLDMID-200+MAX_VIEW1-15,0],a1
|
||
movk 2,a2 ;Plyr 3 receives
|
||
movi #t2_setup_table,a10
|
||
#setib
|
||
move a0,@inbound ;Inbounding team
|
||
move a1,@WORLDTLX,L
|
||
subi [WRLDMID-200,0],a1
|
||
move a1,@gndx,L
|
||
movi -1,a0
|
||
move a0,@ballpnumlast
|
||
|
||
move a2,*a13(ptob_pball2) ;=1|2
|
||
XORK 1,a2
|
||
move a2,*a13(ptob_pball) ;=0|3
|
||
move a2,@ballpnum
|
||
|
||
PUSH a13
|
||
sll 5,a2
|
||
movi plyrobj_t,a8
|
||
add a2,a8
|
||
move *a8,a8,L ;*Plyr obj
|
||
addi plyrproc_t,a2
|
||
move *a2,a13,L ;*Plyr process
|
||
callr plyr_setballxyz
|
||
PULL a13
|
||
|
||
move @pup_court,a0
|
||
jrz #nootd
|
||
.ref otdscroller_wake,otdscroll_p ;fix no city on otd at half
|
||
move @otdscroll_p,a0,L
|
||
movi otdscroller_wake,a14
|
||
move a14,*a0(PWAKE),L
|
||
#nootd
|
||
movk NUMPLYRS,a14 ;>Teleport them
|
||
#init_loop
|
||
PUSH a14
|
||
move *a10+,a0 ;=Plyr # (0-3)
|
||
move *a10+,a4 ;=ZPOS
|
||
sll 16,a4 ;Make it ZVAL
|
||
move *a10+,a5 ;=XPOS
|
||
sll 16,a5 ;Make it XVAL
|
||
move *a10+,a7 ;Direction facing
|
||
callr plyr_init
|
||
PULL a14
|
||
dsj a14,#init_loop
|
||
|
||
; move @gmqrtr,a14
|
||
; subk 2,a14
|
||
; jrnz #qkfix
|
||
; clr a14
|
||
; move a14,@HALT
|
||
; SLEEPK 1
|
||
; movk 1,a14
|
||
; move a14,@HALT
|
||
;#qkfix
|
||
SLEEP 60
|
||
|
||
movk 20,a0
|
||
move a0,@last_name_time ;Don't call pass on inbound
|
||
|
||
jruc plyrtob_dopass
|
||
|
||
|
||
;normal setup (left)
|
||
#t1_setup_table
|
||
.word 0,IBZ_OOB, WRLDMID-IBX_OOB, 20h ;ply,z,x,face
|
||
.word 1,IBZ_INB, WRLDMID-IBX_INB, 60h ;ply,z,x,face
|
||
.word 2,IBZ_DEF1, WRLDMID-IBX_DEF, 60h ;ply,z,x,face
|
||
.word 3,IBZ_DEF2, WRLDMID-IBX_DEF, 60h ;ply,z,x,face
|
||
.if DRONES_2MORE
|
||
.word 4,IBZ_DEF1, WRLDMID-IBX_DEF, 60h ;ply,z,x,face
|
||
.word 5,IBZ_DEF2, WRLDMID-IBX_DEF, 60h ;ply,z,x,face
|
||
.endif
|
||
|
||
;normal setup (right)
|
||
#t2_setup_table
|
||
.word 3,IBZ_OOB, WRLDMID+IBX_OOB, 60h ;ply,z,x,face
|
||
.word 2,IBZ_INB, WRLDMID+IBX_INB, 20h ;ply,z,x,face
|
||
.word 0,IBZ_DEF1, WRLDMID+IBX_DEF, 20h ;ply,z,x,face
|
||
.word 1,IBZ_DEF2, WRLDMID+IBX_DEF, 20h ;ply,z,x,face
|
||
.if DRONES_2MORE
|
||
.word 4,IBZ_DEF1, WRLDMID+IBX_DEF, 20h ;ply,z,x,face
|
||
.word 5,IBZ_DEF2, WRLDMID+IBX_DEF, 20h ;ply,z,x,face
|
||
.endif
|
||
|
||
|
||
#*****************************************************************************
|
||
* Control players for taking the ball out (Process)
|
||
* Created by goaltending
|
||
* A11=Team who gets ball (0=1, !0=2)
|
||
|
||
SUBR plyr_takeoutball3
|
||
|
||
movi TOB_PID,a0 ;Kill any other plyr_takeoutball
|
||
move a0,*a13(PROCID)
|
||
calla KIL1C
|
||
|
||
movi -1,a0
|
||
move a0,@ballsclastp
|
||
move a0,@ballshotinair ;Shooter # if shot in air, else -1
|
||
|
||
movk 25,a0
|
||
callr plyr_setshtdly
|
||
|
||
SLEEPK 1
|
||
|
||
movi -1,a0
|
||
move a0,@ballpnum
|
||
move a0,@ballpnumlast
|
||
|
||
move a11,a0
|
||
jrz #setib
|
||
movk 1,a0
|
||
#setib
|
||
move a0,@inbound ;Inbounding team
|
||
|
||
movk 1,a0
|
||
callr plyr_setac
|
||
|
||
clr a0 ;Clr staggers
|
||
movi plyr_stagcnt,a1
|
||
callr plyr_setprocword
|
||
|
||
movk 2,a9 ;A9=1st p# of team on defense
|
||
movi plyrproc_t,a0
|
||
move a11,a2
|
||
jrz #t1
|
||
clr a9
|
||
addk 32,a0
|
||
addk 32,a0
|
||
movk 2,a2
|
||
#t1
|
||
move *a0+,a8,L ;A8=*Proc of plyr who gets ball
|
||
move *a0+,a7,L
|
||
move *a8(plyr_hpdist),a0
|
||
move *a7(plyr_hpdist),a1
|
||
cmp a1,a0
|
||
jrle #1st ;Closer?
|
||
move a7,a8
|
||
addk 1,a2 ;2nd in team
|
||
#1st
|
||
move a2,*a13(ptob_pball)
|
||
move a2,@ballpnum
|
||
XORK 1,a2
|
||
move a2,*a13(ptob_pball2)
|
||
movi -1,a0
|
||
move a0,@ballpnumlast
|
||
|
||
#outlp
|
||
SLEEPK 1
|
||
|
||
move *a13(ptob_pball),a0 ;Ensure goaltender has ball
|
||
move a0,@ballpnum
|
||
clr a0
|
||
move a0,*a8(plyr_dribmode)
|
||
|
||
callr plyrtob_moveo3 ;Move other plyrs to their spots
|
||
|
||
movi -IBX_OOB,a0 ;Set X per team inbounding
|
||
move a11,a11
|
||
jrz #outl ;Team2 on def
|
||
neg a0
|
||
#outl addi WRLDMID,a0
|
||
movi IBZ_OOB,a1
|
||
move *a13(ptob_pball),a2
|
||
callr plyrtob_seekxy ;Move inbounder to OOB spot
|
||
jrnz #outlp ;He's not there yet if !0
|
||
|
||
|
||
movi TSEC*3,a10 ;Max wait for other 3 to get in place
|
||
#wtlp
|
||
SLEEPK 1
|
||
|
||
callr plyrtob_moveo3 ;Move other plyrs to their spots
|
||
jrz #inpos ;They're there if 0
|
||
dsj a10,#wtlp ;Don't wait longer then A10
|
||
#inpos
|
||
SLEEP 60 ;Pause before inbounding
|
||
|
||
jruc plyrtob_dopass
|
||
|
||
|
||
#*****************************************************************************
|
||
* Clear out plyr variables
|
||
* a0 = player number in (0-3)
|
||
* a4 = player Z VAL
|
||
* a5 = player X VAL
|
||
* a7 = player direction (00h - 7fh)
|
||
|
||
SUBR plyr_init
|
||
|
||
PUSH a8,a10,a13
|
||
|
||
sll 5,a0 ;x 32 bits
|
||
movi plyrproc_t,a13
|
||
add a0,a13
|
||
move *a13,a13,L ;*plyr process
|
||
|
||
addi plyrobj_t,a0
|
||
move *a0,a8,L ;*plyr object
|
||
|
||
move a4,*a8(OZVAL),L
|
||
callr anipt_getsclxy ;a0 = anix, a1 = aniy
|
||
move a0,*a8(OXANI),L
|
||
neg a1
|
||
move a1,*a8(OYVAL),L
|
||
sub a0,a5
|
||
move a5,*a8(OXVAL),L
|
||
|
||
movk STND_SEQ,a0
|
||
callr plyr_setseq
|
||
|
||
clr a0
|
||
|
||
move a0,*a8(OXVEL),L
|
||
move a0,*a8(OYVEL),L
|
||
move a0,*a8(OZVEL),L
|
||
|
||
move a0,*a13(plyr_jmpcnt)
|
||
move a0,*a13(plyr_dribmode)
|
||
move a0,*a13(plyr_offscrn)
|
||
move a0,*a13(plyr_d_cflgs)
|
||
move a0,*a13(plyr_hangcnt)
|
||
move a0,*a13(plyr_nojoy)
|
||
move a0,*a13(plyr_shtdly)
|
||
; move a0,*a13(plyr_passbtime)
|
||
move a0,*a13(plyr_slam_ticks)
|
||
move a0,*a13(plyr_rcvpass)
|
||
move a0,*a13(plyr_ownball)
|
||
move a0,*a13(plyr_stagcnt)
|
||
|
||
movi -1,a0
|
||
move a0,*a13(plyr_newdir)
|
||
|
||
movk 1,a0
|
||
move a0,*a13(PA10),L ;reset sequence wake count
|
||
|
||
PULL a8,a10,a13
|
||
rets
|
||
|
||
|
||
********************************
|
||
* Set new autoctrl value
|
||
* A0=autoctrl #
|
||
* Trashes scratch
|
||
|
||
SUBRP plyr_setac
|
||
|
||
movi plyrproc_t,a14
|
||
movk NUMPLYRS,b0
|
||
#aclp
|
||
move *a14+,a1,L
|
||
move a0,*a1(plyr_autoctrl)
|
||
dsj b0,#aclp
|
||
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Set new shtdly value
|
||
* A0=shtdly #
|
||
* Trashes scratch
|
||
|
||
SUBR plyr_setshtdly
|
||
|
||
movi plyrproc_t,a14
|
||
movk NUMPLYRS,b0
|
||
#aclp
|
||
move *a14+,a1,L
|
||
move a0,*a1(plyr_shtdly)
|
||
dsj b0,#aclp
|
||
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Set word in plyr's proc
|
||
* A0=#
|
||
* A1=Proc offset
|
||
* Trashes scratch
|
||
|
||
SUBRP plyr_setprocword
|
||
|
||
move a2,b1
|
||
movi plyrproc_t,a14
|
||
movk NUMPLYRS,b0
|
||
#aclp
|
||
move *a14+,a2,L
|
||
add a1,a2
|
||
move a0,*a2
|
||
dsj b0,#aclp
|
||
|
||
move b1,a2
|
||
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Move the other 3 guys who aren't getting the ball
|
||
* A9=1st pnum of team on defense (0/2)
|
||
* A11=Team who gets ball (0=1, !0=2)
|
||
* >A0=0 if all players in position (Pass CC)
|
||
* Trashes scratch, A1-A4
|
||
|
||
SUBRP plyrtob_moveo3
|
||
|
||
movi -IBX_DEF,a0 ;Set X's per team inbounding
|
||
movi -IBX_INB,a4
|
||
move a11,a11
|
||
jrz #t2 ;Team1 gets?
|
||
neg a0
|
||
neg a4
|
||
#t2 addi WRLDMID,a0
|
||
addi WRLDMID,a4
|
||
|
||
move a0,a3 ;>Send defenders to their spots
|
||
movi IBZ_DEF1,a1
|
||
move a9,a2
|
||
callr plyrtob_seekxy
|
||
PUSH a0
|
||
|
||
move a3,a0
|
||
movi IBZ_DEF2,a1
|
||
addk 1,a2
|
||
callr plyrtob_seekxy
|
||
PUSH a0
|
||
|
||
move a4,a0 ;>Send teammate to spot
|
||
movi IBZ_INB,a1
|
||
move *a13(ptob_pball2),a2
|
||
callr plyrtob_seekxy
|
||
PULL a1
|
||
or a1,a0
|
||
PULL a1
|
||
or a1,a0
|
||
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Push stick to move plyr towards an XZ location
|
||
* A0=X to seek
|
||
* A1=Z
|
||
* A2=Player # (0-3)
|
||
* >A0=Joy bits set or 0 (Pass CC)
|
||
* Trashes scratch
|
||
|
||
SUBRP plyrtob_seekxy
|
||
|
||
PUSH a2,a8,a11
|
||
|
||
move a0,b0
|
||
|
||
sll 4,a2 ;*16
|
||
move a2,a11
|
||
addi P1CTRL,a11
|
||
sll 1,a2
|
||
addi plyrobj_t,a2
|
||
move *a2,a8,L
|
||
|
||
|
||
move *a8(OXPOS),a2
|
||
move *a8(OXANI+16),a14
|
||
add a14,a2
|
||
|
||
;MJT Start
|
||
; .if DEBUG
|
||
; cmpi WRLDMID-IBX_OOB-15,a2
|
||
; jrle #bugout
|
||
; cmpi WRLDMID+IBX_OOB+15,a2
|
||
; jrlt #nobug
|
||
;#bugout
|
||
; LOCKUP
|
||
;#nobug
|
||
; .endif
|
||
;MJT End
|
||
|
||
|
||
sub a0,a2
|
||
|
||
clr a0
|
||
|
||
move a2,a14
|
||
abs a2
|
||
subk 10,a2
|
||
jrle #onx
|
||
move a14,a14
|
||
jrlt #nolft
|
||
subk 4,a0 ;Left
|
||
|
||
#nolft addk 8,a0 ;Rgt
|
||
#onx
|
||
move *a8(OZPOS),a2
|
||
|
||
;MJT Start
|
||
; .if DEBUG
|
||
; cmpi CZMIN-17,a2
|
||
; jrle #bugout1
|
||
; cmpi CZMAX+17,a2
|
||
; jrlt #nobug1
|
||
;#bugout1
|
||
; LOCKUP
|
||
;#nobug1
|
||
; .endif
|
||
;MJT End
|
||
|
||
sub a1,a2
|
||
move a2,a14
|
||
abs a2
|
||
subk 10,a2
|
||
jrle #onz
|
||
move a14,a14
|
||
jrlt #noup
|
||
subk 1,a0 ;Up
|
||
|
||
#noup addk 2,a0 ;Dn
|
||
#onz
|
||
|
||
move a0,*a11
|
||
;For moving during inbound!
|
||
; .bss tmp_fix,16
|
||
; move a11,@tmp_fix,L
|
||
move a0,a0
|
||
jrnz #x
|
||
|
||
move b0,a14
|
||
move *a8(OXANI+16),a2
|
||
sub a2,a14
|
||
move a14,*a8(OXPOS)
|
||
|
||
move a1,*a8(OZPOS)
|
||
|
||
move *a8(OXVEL),a1,L
|
||
sra 1,a1
|
||
move a1,*a8(OXVEL),L
|
||
move *a8(OZVEL),a1,L
|
||
sra 1,a1
|
||
move a1,*a8(OZVEL),L
|
||
|
||
#x PULL a2,a8,a11
|
||
move a0,a0
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Get dir for object to face an XZ
|
||
* A6=Dest X
|
||
* A7=Dest Z
|
||
* A8=*Source obj
|
||
* >A0=0-127
|
||
* Trashes A0-A2,A14
|
||
|
||
SUBRP seekdir_obxz128
|
||
|
||
move *a8(OXPOS),a0 ;Get SX
|
||
move *a8(OXANI+16),a14
|
||
add a14,a0
|
||
move *a8(OZPOS),a1 ;Get SZ
|
||
|
||
********************************
|
||
* Get dir for src XY to face an XY
|
||
* A0=Src X
|
||
* A1=Src Y
|
||
* A6=Dest X
|
||
* A7=Dest Y
|
||
* >A0=0-127
|
||
* Trashes A0-A2,A14
|
||
|
||
SUBR seekdir_xyxy128
|
||
|
||
clr a2 ;Octant 0-1
|
||
sub a6,a0 ;A0=SrcX-DestX
|
||
jrgt #o45_67
|
||
abs a0
|
||
sub a7,a1 ;A1=SrcY-DestY
|
||
jrnn #gotoct
|
||
movk 2,a2 ;Oct 2-3
|
||
abs a1
|
||
jruc #d_sw
|
||
#o45_67
|
||
movk 4,a2 ;Oct 4-5
|
||
sub a7,a1 ;A1=SrcY-DestX
|
||
abs a1
|
||
jrnn #o_up
|
||
movk 6,a2 ;Oct 6-7
|
||
#d_sw
|
||
SWAP a0,a1 ;Swap XY delts for oct 23 & 67
|
||
#o_up
|
||
sll 4,a2 ;Oct*16
|
||
|
||
#gotoct
|
||
clr a14
|
||
cmp a1,a0 ;>Cmp slope
|
||
jrhs #300
|
||
|
||
srl 4,a1 ;Bigger/16
|
||
jrnz #250
|
||
jruc #x
|
||
#lp1
|
||
addk 1,a2 ;Next 1/16 oct
|
||
add a1,a14 ;+1/16
|
||
#250
|
||
cmp a0,a14
|
||
jrlo #lp1
|
||
jruc #x
|
||
|
||
#300
|
||
addk 31,a2 ;End of next octant
|
||
|
||
srl 4,a0 ;Bigger/16
|
||
jrnz #350
|
||
jruc #x
|
||
#lp2
|
||
subk 1,a2 ;Next 1/16 oct
|
||
add a0,a14 ;+1/16
|
||
#350
|
||
cmp a1,a14
|
||
jrlo #lp2
|
||
|
||
#x
|
||
movi >7f,a0
|
||
and a2,a0
|
||
rets
|
||
|
||
|
||
#*******************************
|
||
* Get dir and distance from object to object
|
||
* A0=*Dest obj
|
||
* A8=*Source obj
|
||
* >A0=0-127
|
||
* >A1=Distance
|
||
* Trashes scratch, A2,A6,A7
|
||
|
||
SUBRP seekdirdist_obob128
|
||
|
||
move *a0(OXPOS),a6 ;Get SX
|
||
move *a0(OXANI+16),a14
|
||
add a14,a6
|
||
move *a0(OZPOS),a7 ;Get SZ
|
||
|
||
#*******************************
|
||
* Get dir and distance from object to XZ
|
||
* A6=Dest X
|
||
* A7=Dest Z
|
||
* A8=*Source obj
|
||
* >A0=0-127
|
||
* >A1=Distance
|
||
* Trashes scratch, A2
|
||
|
||
SUBR seekdirdist_obxz128
|
||
|
||
move *a8(OXPOS),a0 ;Get SX
|
||
move *a8(OXANI+16),a14
|
||
add a14,a0
|
||
move *a8(OZPOS),a1 ;Get SZ
|
||
|
||
clr a2 ;Octant 0-1
|
||
sub a6,a0 ;A0=SrcX-DestX
|
||
jrgt #o45_67
|
||
abs a0
|
||
sub a7,a1 ;A1=SrcY-DestY
|
||
jrnn #gotoct
|
||
movk 2,a2 ;Oct 2-3
|
||
abs a1
|
||
jruc #d_sw
|
||
#o45_67
|
||
movk 4,a2 ;Oct 4-5
|
||
sub a7,a1 ;A1=SrcY-DestX
|
||
abs a1
|
||
jrnn #o_up
|
||
movk 6,a2 ;Oct 6-7
|
||
#d_sw
|
||
SWAP a0,a1 ;Swap XY delts for oct 23 & 67
|
||
#o_up
|
||
sll 4,a2 ;Oct*16
|
||
|
||
#gotoct
|
||
clr a14
|
||
cmp a1,a0 ;>Cmp slope
|
||
jrhs #300
|
||
|
||
move a0,b0 ;Save distance
|
||
move a1,b1
|
||
|
||
srl 4,a1 ;Bigger/16
|
||
jrnz #250
|
||
jruc #x
|
||
#lp1
|
||
addk 1,a2 ;Next 1/16 oct
|
||
add a1,a14 ;+1/16
|
||
#250
|
||
cmp a0,a14
|
||
jrlo #lp1
|
||
jruc #x
|
||
|
||
#300
|
||
move a0,b1 ;Save distance
|
||
move a1,b0
|
||
|
||
addk 31,a2 ;End of next octant
|
||
|
||
srl 4,a0 ;Bigger/16
|
||
jrnz #350
|
||
jruc #x
|
||
#lp2
|
||
subk 1,a2 ;Next 1/16 oct
|
||
add a0,a14 ;+1/16
|
||
#350
|
||
cmp a1,a14
|
||
jrlo #lp2
|
||
|
||
#x ;>Calc distance (long+short/2.667)
|
||
srl 1,b0 ;Shorter/2
|
||
add b0,b1
|
||
srl 2,b0 ;Shorter/8
|
||
sub b0,b1
|
||
move b1,a1
|
||
|
||
movi >7f,a0
|
||
and a2,a0
|
||
rets
|
||
|
||
|
||
********************************
|
||
* Get random # with mask
|
||
* A0=Mask
|
||
* >A0=Rnd # (Pass CC)
|
||
* Trashes scratch
|
||
|
||
SUBRP rnd
|
||
|
||
move @RAND,a1,L
|
||
rl a1,a1
|
||
move @HCOUNT,a14
|
||
rl a14,a1
|
||
add sp,a1
|
||
move a1,@RAND,L
|
||
|
||
and a1,a0
|
||
rets
|
||
|
||
|
||
********************************
|
||
* Quickly produce a random # in range 0-X
|
||
* A0=X
|
||
* >A0=Random # (0 to A0) (No CC)
|
||
* Trashes scratch
|
||
|
||
SUBR rndrng0
|
||
|
||
move @RAND,a1,L
|
||
rl a1,a1
|
||
move @HCOUNT,a14
|
||
rl a14,a1
|
||
add sp,a1
|
||
move a1,@RAND,L
|
||
|
||
addk 1,a0
|
||
mpyu a1,a0 ;Condition codes not valid!
|
||
|
||
rets
|
||
|
||
;---------------------------------------
|
||
|
||
.if CRTALGN
|
||
|
||
#*******************************
|
||
* Create ground alignment dots for debugging (Process)
|
||
|
||
SUBR gnd_aligndots
|
||
|
||
.ref hoopl_t,hoopr_t
|
||
|
||
movi #alignimg_t,a2
|
||
movi >800c|M_NOCOLL|M_3D|M_NOSCALE,a4
|
||
movi CLSDEAD,a5
|
||
clr a6
|
||
clr a7
|
||
|
||
|
||
.if 0 ;1=SHOW 3PT DOTS, 0=DON'T
|
||
movi pt3_t,a11
|
||
movi PT3_TOPZ,a3
|
||
jruc #3pstrt
|
||
#3plp
|
||
neg a0
|
||
addi 200,a0
|
||
sll 16,a0
|
||
clr a1 ;Y lft
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
move *a11+,a0 ;X rgt
|
||
addi 200,a0
|
||
sll 16,a0
|
||
clr a1 ;Y rgt
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
addk 4,a3 ;Z inc
|
||
#3pstrt move *a11,a0 ;X lft
|
||
jrnn #3plp
|
||
.endif
|
||
|
||
|
||
.if 0 ;1=SHOW HOOP DOTS, 0=DON'T
|
||
movi hoopl_t,a11 ;>Setup left hoop dots
|
||
jruc #hlstrt
|
||
#hllp
|
||
sll 16,a0
|
||
move *a11+,a1 ;Y
|
||
sll 16,a1
|
||
move *a11+,a3 ;Z
|
||
move *a11+,a14
|
||
jrn #hlstrt ;Keep in to not show score pts!
|
||
addi 300,a3
|
||
calla BEGINOBJ2
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
movi -300,a0
|
||
move a0,*a8(OMISC) ;Z offset
|
||
#hlstrt move *a11+,a0 ;X
|
||
jrnz #hllp ;!End?
|
||
|
||
movi hoopr_t,a11 ;>Setup rgt hoop dots
|
||
jruc #hrstrt
|
||
#hrlp
|
||
sll 16,a0
|
||
move *a11+,a1 ;Y
|
||
sll 16,a1
|
||
move *a11+,a3 ;Z
|
||
move *a11+,a14
|
||
jrn #hrstrt ;Keep in to not show score pts!
|
||
addi 300,a3
|
||
calla BEGINOBJ2
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
movi -300,a0
|
||
move a0,*a8(OMISC) ;Z offset
|
||
#hrstrt move *a11+,a0 ;X
|
||
jrnz #hrlp ;!End?
|
||
.endif
|
||
|
||
|
||
.if 0 ;1=SHOW BACKBOARD DOTS, 0=DON'T
|
||
.asg ((BBRD_ZWID/2)*3/32),FC8 ;Fudge cnt X offset
|
||
|
||
movi (-BBRD_X+200-FC8) << 16,a0
|
||
movi (BBRD_Y) << 16,a1
|
||
movi BBRD_Z+BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (-BBRD_X+200+FC8) << 16,a0
|
||
movi (BBRD_Y) << 16,a1
|
||
movi BBRD_Z-BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (-BBRD_X+200-FC8) << 16,a0
|
||
movi (BBRD_Y-BBRD_YWID) << 16,a1
|
||
movi BBRD_Z+BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (-BBRD_X+200+FC8) << 16,a0
|
||
movi (BBRD_Y-BBRD_YWID) << 16,a1
|
||
movi BBRD_Z-BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (BBRD_X+200+FC8) << 16,a0
|
||
movi (BBRD_Y) << 16,a1
|
||
movi BBRD_Z+BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (BBRD_X+200-FC8) << 16,a0
|
||
movi (BBRD_Y) << 16,a1
|
||
movi BBRD_Z-BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (BBRD_X+200+FC8) << 16,a0
|
||
movi (BBRD_Y-BBRD_YWID) << 16,a1
|
||
movi BBRD_Z+BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
|
||
movi (BBRD_X+200-FC8) << 16,a0
|
||
movi (BBRD_Y-BBRD_YWID) << 16,a1
|
||
movi BBRD_Z-BBRD_ZWID/2,a3
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
.endif
|
||
|
||
|
||
.if 0 ;1=SHOW COURT DOTS, 0=DON'T
|
||
movi #init_t,a11 ;>Setup gnd dot images
|
||
jruc #5
|
||
#lp
|
||
addi 200,a0
|
||
sll 16,a0
|
||
clr a1 ;Y
|
||
move *a11+,a3 ;Z
|
||
calla BEGINOBJ
|
||
movi >101,a0
|
||
move a0,*a8(OCONST)
|
||
#5 move *a11+,a0 ;X
|
||
cmpi 4000,a0
|
||
jrne #lp ;!End?
|
||
.endif
|
||
|
||
|
||
;--------------------
|
||
; Cycle dot color
|
||
|
||
move *a8(OPAL),a9
|
||
sll 8,a9
|
||
addk 1,a9 ;Color 1
|
||
clr a10
|
||
#plp
|
||
move a10,a0
|
||
addi #color_t,a0
|
||
move a9,a1
|
||
movk 1,a2 ;#Colors
|
||
calla pal_set
|
||
SLEEPK 10
|
||
addk 16,a10
|
||
sll 32-6,a10 ;0-3 color #
|
||
srl 32-6,a10
|
||
jruc #plp
|
||
|
||
|
||
#x0 .equ LFTCRT_X-WRLDMID ;-350
|
||
#x1 .equ RGTCRT_X-WRLDMID ;350
|
||
|
||
#z0 .equ GZMIN
|
||
#z0a .equ GZMIN+(CZMIN-GZMIN)/4
|
||
#z0b .equ GZMIN+(CZMIN-GZMIN)/2
|
||
#z0c .equ GZMIN+(CZMIN-GZMIN)*3/4
|
||
#z1 .equ CZMIN ;1000
|
||
#z1a .equ CZMIN+(CZMAX-CZMIN)/16
|
||
#z1b .equ CZMIN+(CZMAX-CZMIN)/8
|
||
#z1c .equ CZMIN+(CZMAX-CZMIN)*3/16
|
||
#z2 .equ CZMIN+(CZMAX-CZMIN)/4 ;1095
|
||
#z2a .equ CZMIN+(CZMAX-CZMIN)*5/16
|
||
#z2b .equ CZMIN+(CZMAX-CZMIN)*3/8
|
||
#z2c .equ CZMIN+(CZMAX-CZMIN)*7/16
|
||
#z3 .equ CZMIN+(CZMAX-CZMIN)/2 ;1190
|
||
#z3a .equ CZMIN+(CZMAX-CZMIN)*9/16
|
||
#z3b .equ CZMIN+(CZMAX-CZMIN)*5/8
|
||
#z3c .equ CZMIN+(CZMAX-CZMIN)*11/16
|
||
#z4 .equ CZMIN+(CZMAX-CZMIN)*3/4 ;1284
|
||
#z4a .equ CZMIN+(CZMAX-CZMIN)*13/16
|
||
#z4b .equ CZMIN+(CZMAX-CZMIN)*7/8
|
||
#z4c .equ CZMIN+(CZMAX-CZMIN)*15/16
|
||
#z5 .equ CZMAX
|
||
|
||
#init_t
|
||
.word 4000 ;TEMP!!!
|
||
.word #x0,#z0, 0,#z0, #x1,#z0
|
||
.word #x0,#z0a, 0,#z0a, #x1,#z0a
|
||
.word #x0,#z0b, 0,#z0b, #x1,#z0b
|
||
.word #x0,#z0c, 0,#z0c, #x1,#z0c
|
||
.word #x0,#z1, 0,#z1, #x1,#z1
|
||
.word #x0,#z1a, 0,#z1a, #x1,#z1a
|
||
.word #x0,#z1b, 0,#z1b, #x1,#z1b
|
||
.word #x0,#z1c, 0,#z1c, #x1,#z1c
|
||
.word #x0,#z2, 0,#z2, #x1,#z2
|
||
.word #x0,#z2a, 0,#z2a, #x1,#z2a
|
||
.word #x0,#z2b, 0,#z2b, #x1,#z2b
|
||
.word #x0,#z2c, 0,#z2c, #x1,#z2c
|
||
.word #x0,#z3, 0,#z3, #x1,#z3
|
||
.word #x0,#z3a, 0,#z3a, #x1,#z3a
|
||
.word #x0,#z3b, 0,#z3b, #x1,#z3b
|
||
.word #x0,#z3c, 0,#z3c, #x1,#z3c
|
||
.word #x0,#z4, 0,#z4, #x1,#z4
|
||
.word #x0,#z4a, 0,#z4a, #x1,#z4a
|
||
.word #x0,#z4b, 0,#z4b, #x1,#z4b
|
||
.word #x0,#z4c, 0,#z4c, #x1,#z4c
|
||
.word #x0,#z5, 0,#z5, #x1,#z5
|
||
.word 4000
|
||
|
||
#color_t
|
||
COLORW 0,0,0, 0,16,0, 0,31,0, 0,16,0
|
||
|
||
#alignimg_t
|
||
.word 1,1,0,0
|
||
.long 0
|
||
.word >1000
|
||
.long #test_p
|
||
|
||
#test_p .word 1, 0
|
||
|
||
.endif
|
||
|
||
.end
|
||
|
||
|
||
|
||
|
||
|