Jump to content

Possession-Style Overtime


jstout

Recommended Posts

Notes from working on a possession-style overtime (still in final thorough testing). Each team will have the same chance to score during overtime. Unlike NCAA, kickoffs will start possessions after scores and play will continue as normal.

.define P1_BALL       #$00
.define P2_BALL #$01

.define PLAY_SCREEN #$05
.define XP_PTS #$01
.define SAFETY_PTS #$02
.define FG_PTS #$03
.define TD_PTS #$06

.define SCORE1 $0395
.defien FSCORE1 $0399
.define SCORE2 $039A
.define FSCORE2 $039E

.define RESET $7FC6
.define RETURN_ADDR $7FC7
.define FIX_ADDR $7FC9
.define DATA_ADDR $7FCB
.define PLAYER1 $7FCD
.define PLAYER2 $7FCE
.define BALL $7FCF
.define BALL_STORE $039B
.define KNOWN_RTS $9FFC
--------------------
x22DFB:
; Reverse Coin Toss Receiver
LDA $3D
AND #$08
BEQ :+
; Player 1 Won Toss
LDA #$83
STA $70
LDA #$01
STA $72
LDA #$31
LDX #$07
JMP $B472
; Player 2 Won Toss
: LDA #$00
STA $70
STA $72
LDA #$32
LDX #$07
JMP $B472

; Flip KICK and RETURN text
xEC97: .BYTE $8B,$43,"KICK SIDE",$8B,$52,"RETURN SIDE"
xECD8: .BYTE $8B,$42,"RETURN SIDE",$8B,$53,"KICK SIDE"

x2216F:
; Always This Overtime
; Set Overtime Receiver
LDA $72
STA BALL_STORE
LDY #$85
LDX #$BB
JSR $C481
; Reset for Overtime
LDA #$00
STA PLAYER1 ; CAN REMOVE
STA PLAYER2 ; CAN REMOVE
STA $8C
STA $8D
; Set Time to 1 Minute for CPU AI
LDA #$01
STA $6B
NOP

x221AE:
; Check Possessions and Score For Win
JMP WIN_CHECK
CMP SCORE2
BEQ $A199

WIN_CHECK:
LDA PLAYER1
CMP PLAYER2
BEQ :+
; Can't be a Win
JMP $A199
; Check Scores
: LDA SCORE1
JMP $A1A1
--------------------
x220EF:
; Record who won opening coin toss
JSR RECEIVE
NOP

RECEIVE:
STA $72
STA BALL_STORE
LDA #$03
RTS
--------------------
; Locations for tracking possession
x24133:
; Player 1 Play Screen
LDX #$00
JMP POSS_START
x2434B:
; Player 2 Safety
LDX #$16
JMP POSS_START
x244D3:
; Player 1 Field Goal
LDX #$0C
JMP POSS_START
x245DC:
; Player 2 Safety
LDX #$0A
JMP POSS_START
x24625:
; Player 1 Touchdown
LDX #$10
JMP POSS_START
x24712:
; Player 1 Extra Point
LDX #$04
JMP POSS_START
x248BB:
; Player 2 Play Screen
LDX #$02
JMP POSS_START
x24AD3:
; Player 1 Safety
LDX #$14
JMP POSS_START
x24C5B:
; Player 2 Field Goal
LDX #$0E
JMP POSS_START
x24D64:
; Player 1 Safety
LDX #$08
JMP POSS_START
x24DAD:
; Player 2 Touchdown
LDX #$12
JMP POSS_START
x24E9A:
; Player 2 Extra Point
LDX #$06
JMP POSS_START
x2471A:
; Check Player 1 for Missed Extra Point
JMP XP1_CHECK
XP1_CHECK:
LDX #$18
JMP POSS_START
x24EA2:
; Check Player 2 for Missed Extra Point
JMP XP2_CHECK
XP2_CHECK:
LDX #$1A
JMP POSS_START

; Track Possessions
POSS_START:
LDA #$07
STA $8000
LDA #$07
STA $8001
JSR POSSESSIONS
LDA #$07
STA $8000
LDA $2F
STA $8001
TXA
JSR :+
JMP (RETURN_ADDR)
: JMP (FIX_ADDR)

POSSESSIONS:
; Enable SRAM
LDA #$80
STA $A001
; Reset Possession Numbers
LDA $76
CMP #$00
BNE :+
; 1st Quarter
LDA RESET
CMP #$00
BNE :++
; 1st Quarter Reset
JSR STORE_1ST
: LDA $76
CMP #$04
BNE :+
; Overtime
LDA RESET
CMP #$01
BNE :+
; Overtime Reset
JSR STORE_OT
; Get Addresses
: LDA FIX,X
STA FIX_ADDR
LDA FIX+1,X
STA FIX_ADDR+1
LDA RETURN,X
STA RETURN_ADDR
LDA RETURN+1,X
STA RETURN_ADDR+1
LDA DATA,X
STA DATA_ADDR
LDA DATA+1,X
STA DATA_ADDR+1
; Disable SRAM
LDA #$C0
STA $A001
JMP (DATA_ADDR)
FIX: .WORD $9332, $9332, $9342, $9363, $9342, $9363, $9342, $9363, $9342, $9363, $9342, $9363, KNOWN_RTS, KNOWN_RTS
RETURN: .WORD $8128, $88B0, $8707, $8E8F, $8D59, $85D1, $84C8, $8C50, $861A, $8DA2, $8AC8, $8340, $8775, $8EFD
DATA: .WORD PLAY1, PLAY2, XP1, XP2, SAFETY1, SAFETY2, FG1, FG2, TD1, TD2, SAFETY1, SAFETY2, XP1, XP2
; Play Screen Player 1 (Checks for turnover)
PLAY1: LDX PLAY_SCREEN
LDA BALL
CMP P1_BALL
BEQ :+
JSR ADD_POSSESSION_2
JSR SET_POSSESSION_1
: RTS
; Play Screen Player 2 (Checks for turnover)
PLAY2: LDX PLAY_SCREEN
LDA BALL
CMP P2_BALL
BEQ :+
JSR ADD_POSSESSION_1
JSR SET_POSSESSION_2
: RTS
; Extra Point by Player 1
XP1: LDX XP_PTS
LDA BALL
CMP P2_BALL
BEQ :+
JSR ADD_POSSESSION_1
JSR SET_POSSESSION_2
: RTS
; Extra Point by Player 2
XP2: LDX XP_PTS
LDA BALL
CMP P1_BALL
BEQ :+
JSR ADD_POSSESSION_2
JSR SET_POSSESSION_1
: RTS
; Safety by Player 1
SAFETY1: LDX SAFETY_PTS
LDA PLAYER1
CMP PLAYER2
BEQ :+
JSR ADD_POSSESSION_2
JSR SET_POSSESSION_1
: RTS
; Safety by Player 2
SAFETY2: LDX SAFETY_PTS
LDA PLAYER2
CMP PLAYER1
BEQ :+
JSR ADD_POSSESSION_1
JSR SET_POSSESSION_2
: RTS
; Field Goal by Player 1
FG1: LDX FG_PTS
JSR ADD_POSSESSION_1
JSR SET_POSSESSION_2
RTS
; Field Goal by Player 2
FG2: LDX FG_PTS
JSR ADD_POSSESSION_2
JSR SET_POSSESSION_1
RTS
; Touchdown by Player 1
TD1: LDX TD_PTS
LDA BALL
CMP P1_BALL
BEQ :++
; Defense Scored
LDA PLAYER1
CMP PLAYER2
BEQ :+
JSR ADD_POSSESSION_2
: RTS
; Offense Scored
: LDA SCORE1
JSR DECIMAL_SCORE
CMP SCORE2
BCC :+
JSR ADD_POSSESSION_1
JSR SET_POSSESSION_2
: RTS
; Touchdown by Player 2
TD2: LDX TD_PTS
LDA BALL
CMP P2_BALL
BEQ :++
; Defense Scored
LDA PLAYER2
CMP PLAYER1
BEQ :+
JSR ADD_POSSESSION_1
: RTS
; Offense Scored
: LDA SCORE2
JSR DECIMAL_SCORE
CMP SCORE1
BCC :+
JSR ADD_POSSESSION_2
JSR SET_POSSESSION_1
: RTS
ADD_POSSESSION_1:
; Enable SRAM
LDA #$80
STA $A001
INC PLAYER1
; Disable SRAM
LDA #$C0
STA $A001
RTS
ADD_POSSESSION_2:
; Enable SRAM
LDA #$80
STA $A001
INC PLAYER2
; Disable SRAM
LDA #$C0
STA $A001
RTS
SET_POSSESSION_1:
; Enable SRAM
LDA #$80
STA $A001
LDA P1_BALL
STA BALL
; Disable SRAM
LDA #$C0
STA $A001
RTS
SET_POSSESSION_2:
; Enable SRAM
LDA #$80
STA $A001
LDA P2_BALL
STA BALL
; Disable SRAM
LDA #$C0
STA $A001
RTS
DECIMAL_SCORE:
TAY
AND #$F0
STA $45
TYA
AND #$0F
STA $44
TXA
AND #$0F
CLC
ADC $44
STA $44
CMP #$0A
BCC :+
SBC #$0A
STA $44
LDA $45
CLC
ADC #$10
STA $45
: TXA
AND #$F0
CLC
ADC $45
ORA $44
CMP #$9A
BCC :+
LDA #$9A
: RTS
STORE_1ST:
LDA #$01
STA RESET
LDA BALL_STORE
STA BALL
LDA #$00
STA BALL_STORE
STA PLAYER1
STA PLAYER2
RTS
STORE_OT:
LDA #$00
STA RESET
LDA BALL_STORE
STA BALL
LDA #$00
STA BALL_STORE
STA PLAYER1
STA PLAYER2
RTS

; CODE WAS ALREADY WRITTEN FOR CLEANING SRAM BEFORE A GAME AND ALL-STAR GAME
---------------
x253BF:
; Score is above 99 so adjust (TECMO POOR CODING)
BCC $93DE ; 2D and sent to the first RTS found
JMP SCORE_FIX_START

SCORE_FIX_START:
TAX
LDA #$07
STA $8000
LDA #$01
STA $8001
JSR SCORE_FIX
LDA #$07
STA $8000
LDA $002F
STA $8001
; New Fixed Value
TXA
SBC #$10
RTS

SCORE_FIX:
LDA $76
CMP #$04
BNE :++
; Fix during Overtime
LDA SCORE1
CMP #$0A
BCC :+
LDA SCORE2
CMP #$0A
BCC :+
LDA SCORE1
SBC #$10
STA SCORE1
LDA SCORE2
SBC #$10
STA SCORE2
: LDA FSCORE1
SBC #$10
STA FSCORE1
LDA FSCORE2
SBC #$10
STA FSCORE2
: RTS
--------------------
; Change QTR compare to remove Old Overtime AI
x189A2: #$05
x18B9A: #$05

x18870:
; CPU AI for FG Attempt or Go For It
JMP 4TH_AI_CHECK
NOP
NOP
NOP

4TH_AI_CHECK:
LDA $76
CMP #$03
BEQ :+
LDA $76
CMP #$04
BEQ :+
; 1st-3rd Qtr so FG Attempt
JMP $A8B2
; 4th Qtr or Overtime so Check Score First
: JMP $A866

Link to comment
Share on other sites

  • 1 year later...
  • 7 months later...
  • 6 months later...
  • 4 weeks later...

A question on this - how would OT stats be handled by dynastyphile? We have implemented this for the upcoming season of ITL but it would be very nice to be able to differentiate, or even just ignore OT stats so that they did not dilute the regular stats. An OT with several matching TD's could really throw the season stats out of whack.

Any input would be greatly appreciated!

Link to comment
Share on other sites

the game isn't designed to seperate OT from 4th quarter

The game isn't designed to have 32 teams, in game playbook changing, custom defenses...

I'm just hoping there's a way to hack the rom so that it stops recording stats in OT. Show of hands, anyone know if this is possible/where it is found?

Link to comment
Share on other sites

the game isn't designed to seperate OT from 4th quarter

The game isn't designed to have 32 teams, in game playbook changing, custom defenses...

I'm just hoping there's a way to hack the rom so that it stops recording stats in OT. Show of hands, anyone know if this is possible/where it is found?

No stats for OT

Also no score or would you want that to update?

I don't think the game separates stats by half so having dynastyphile do this wouldn't be an option.

I remember when the tackle code was added that a loop-counter was added. I would assume that there is a similar thing for all stats. Basically this statement would be modded into a "if OT skip this". This might be documented in the tackle add code

Link to comment
Share on other sites

Yeah I assume score would have to update in order to decide the winner. Any tiebreakers could just use point differential to avoid the concern of a team getting a bunch of points from OT games.

So basically you nailed it knobbe, somehow have the rom stop updating the stats for OT.

...but how? (dun dun DUN!!!)

Link to comment
Share on other sites

Yeah I assume score would have to update in order to decide the winner. Any tiebreakers could just use point differential to avoid the concern of a team getting a bunch of points from OT games.

So basically you nailed it knobbe, somehow have the rom stop updating the stats for OT.

...but how? (dun dun DUN!!!)

I'm not up to date on source editing to answer this without a lot of research which i simply don't have the time for at the moment.

I didn't necessarily see a reference for this in the tackle code but if you can think of another hack that would also involve stats then that would make this easier to find by yourself.

BTW, is your league a performance based attribute league or is this about end of the year stats comparison. If the latter, while I understand the desire to make things "equal" it really doesn't matter nearly as much as who won the championship.

Link to comment
Share on other sites

BTW, is your league a performance based attribute league or is this about end of the year stats comparison. If the latter, while I understand the desire to make things "equal" it really doesn't matter nearly as much as who won the championship.

we are the latter.

tecmobo, if the integrity of our stats is indeed important, again, it might be easier just to snap 2 save states and upload the first to dynastyphile. (and if we need to we could easily edit the first save state to add a TD or FG or Saftey that ultimately won the game in OT, not all the scores from the OT, just the deciding score)

but i still think this may be way too much work since we are not a performance based attribute league.

if stats are still a concern and we don't want to mess with 2 save states and we don't find a way to hack the ROM by Wednesday... we could just not play OT games at all. maybe just let the game end in a Tie unless it's the playoffs.

since we already do Home/Away 18 game season, i'm not sure if guys are gonna want to play triple OT games (or quite possibly longer if no one is playing defense) in the regular season anyway like Rustedna1ls & i did recently in a preseason game. The only reason we continued our game was cuz we were excited to try out your new ROM. :lol:

Link to comment
Share on other sites

BTW, is your league a performance based attribute league or is this about end of the year stats comparison. If the latter, while I understand the desire to make things "equal" it really doesn't matter nearly as much as who won the championship.

tecmobo, if the integrity of our stats is indeed important, again, it might be easier just to snap 2 save states and upload the first to dynastyphile.

Yeah, I'm fine as is. I just asked about it because others in our league were concerned about it. Saving 2 states and all that other stuff isn't worth it in my opinion. I really don't think people are going to pass up a win just to keep an OT game going. And if it does happen I'll alternate between calling them idiots and booting them :lol:

Link to comment
Share on other sites

  • 1 year later...

I finally downloaded and tried this .... very weird starting with the kickoff. On my first possession I actually punted on 4th down and the returner fumbled and I picked up the ball and scored.

This is great effort!

What made you start with a kickoff of all things? Was it just not possible to start any other way? Does this effect sim games at all?

I am interested in this idea for college rom, and wondered if the following were possible.

1. Have a team start 1st and goal from the DEF 25 yard line. 4 downs to score and then the other team gets a shot.

2. Give a team the ball at the DEF 30 yardline 1-10 with x number of seconds to score. (maybe 45 seconds) Then the other team gets a shot.

3. Eliminate overtime in the regular season. Game just ends in a tie.

4. Play a whole fifth quarter like a normal quarter, if still a tie a sixth quarter, etc until a quarter does not end in a tie.

Just wonderings, from a guy who could in no way even attempt this.

Link to comment
Share on other sites

  • 3 months later...

Revisiting this for ETC...had two thoughts since nothing has been done to track OT stats.  I had two ideas to solve it:


 


1) Could number of possessions be tracked?


 


or


 


2) Could timer just start really high at 99:99 for example, then stat extraction could handle the rest?


Link to comment
Share on other sites

  • 3 years later...
  • 1 year later...
  • 5 years later...
On 10/14/2023 at 12:13 PM, furple73 said:

I'm struggling with how to apply this code to the rom itself. I think I've looked around enough and not found the answer. Can anyone point me in the right direction?

 

The entire code is in the rom from the following link. Its been a long long time but following the notes should help.

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...