Jump to content
Sign in to follow this  
TheRaja

TSB - Clinching Division Cutsceen

Recommended Posts

Hey all;


 


I am working on my TFO rom and have each team playing 11 games in the season over 17 weeks. I notice that since I am not playing 16 games that the Clinching Division Cutscenedoesn't usually appear until after all games have been played (end of week 17).


 


Even though they are only playing 11 games the cutscene is still looking at it like they have 16 games total, and only when all weeks are over it just spits out the top teams like it normally does. I know this is true because if a team is 10-0 and the next team in their division is 3-7 then it will show the cutscene during the season because even if the 2nd team was to win the remaining "6" games they still wouldn't be able to overtake the team at 10-0.


 


I'm wondering where the algorithm for the Clinching Division is as I'm fairly sure their has to be a variable that takes 16 (number of original games played) into the equation and I'd like to change it to 11 (how many games my teams will play) so that when a team clinches their division with say 7-2 that it appears right away and not at the end of the season.


 


Thanks for any help :)


Share this post


Link to post
Share on other sites

Found that 0x022e4b determines what week to start checking for Divisional Champs, but changing it just has it check earlier in the season. Not even sure why they had to place a "when to start" variable and why that variable was set to Week 10 but oh well closer to finding that variable :)


Share this post


Link to post
Share on other sites

Found some info while searching the boards. Quote comes from http://tecmobowl.org/topic/3569-editing-playoff-schedule-for-tsb-nes/?hl=x22e47#entry80324

 


firgured i'd post this here as well. all code is executed after a cmp #$09 at 0x22E4B if the week# > #$09. thanks to jstout for pointing me to the starting point.
 

$AE64:85 8E     STA $008E = #$02
$AE66:0A        ASL
$AE67:A8        TAY
$AE68:B9 5D BF  LDA $BF5D,Y @ $BF61 = #$08
$AE6B:85 8F     STA $008F = #$08
$AE6D:85 90     STA $0090 = #$08
$AE6F:B9 5E BF  LDA $BF5E,Y @ $BF62 = #$04
$AE72:85 91     STA $0091 = #$04
$AE74:85 92     STA $0092 = #$00
$AE76:A9 00     LDA #$00
$AE78:85 93     STA $0093 = #$08



this code gets the starting index of the division and the number of teams in that division based on what A is at $AE64.


$AE7A:A5 8F     LDA $008F = #$08
$AE7C:20 DE DE  JSR $DEDE
$AE7F:A0 B3     LDY #$B3
$AE81:B1 3E     LDA ($3E),Y @ $6D62 = #$3F
$AE83:85 44     STA $0044 = #$50
$AE85:A0 B2     LDY #$B2
$AE87:18        CLC
$AE88:71 3E     ADC ($3E),Y @ $6D62 = #$3F
$AE8A:A0 B4     LDY #$B4
$AE8C:18        CLC
$AE8D:71 3E     ADC ($3E),Y @ $6D62 = #$3F
$AE8F:85 45     STA $0045 = #$00
$AE91:A9 10     LDA #$10
$AE93:38        SEC
$AE94:E5 45     SBC $0045 = #$00
$AE96:A0 B2     LDY #$B2
$AE98:18        CLC
$AE99:71 3E     ADC ($3E),Y @ $6D62 = #$3F
$AE9B:85 45     STA $0045 = #$00
$AE9D:20 1B B4  JSR $B41B
$AEA0:A6 93     LDX $0093 = #$08
$AEA2:95 9E     STA $9E,X @ $019D = #$00
$AEA4:A5 8F     LDA $008F = #$08
$AEA6:95 9F     STA $9F,X @ $019E = #$10
$AEA8:E6 93     INC $0093 = #$08
$AEAA:E6 93     INC $0093 = #$08
$AEAC:E6 8F     INC $008F = #$08
$AEAE:C6 91     DEC $0091 = #$04
$AEB0:D0 C8     BNE $AE7A



this code calculates a rating based on the highest possible win percentage for each team in the division and stores it to an array starting at $9E that goes  .


$AEB2:A5 92     LDA $0092 = #$00
$AEB4:85 91     STA $0091 = #$04
$AEB6:A5 90     LDA $0090 = #$08
$AEB8:20 DE DE  JSR $DEDE
$AEBB:A0 B2     LDY #$B2
$AEBD:B1 3E     LDA ($3E),Y @ $6D62 = #$3F
$AEBF:85 45     STA $0045 = #$00
$AEC1:A0 B4     LDY #$B4
$AEC3:18        CLC
$AEC4:71 3E     ADC ($3E),Y @ $6D62 = #$3F
$AEC6:A0 B3     LDY #$B3
$AEC8:18        CLC
$AEC9:71 3E     ADC ($3E),Y @ $6D62 = #$3F
$AECB:85 44     STA $0044 = #$50
$AECD:A9 10     LDA #$10
$AECF:38        SEC
$AED0:E5 44     SBC $0044 = #$50
$AED2:18        CLC
$AED3:71 3E     ADC ($3E),Y @ $6D62 = #$3F
$AED5:85 44     STA $0044 = #$50
$AED7:20 1B B4  JSR $B41B



this code calculates the same rating from above, but for the current team (index @ $90). this rating reflects the team if they lose the rest of their games.


$AEDA:85 44     STA $0044 = #$50
$AEDC:A4 91     LDY $0091 = #$04
$AEDE:A2 00     LDX #$00
$AEE0:A5 90     LDA $0090 = #$08
$AEE2:D5 9F     CMP $9F,X @ $019E = #$10
$AEE4:F0 06     BEQ $AEEC
$AEE6:B5 9E     LDA $9E,X @ $019D = #$00
$AEE8:C5 44     CMP $0044 = #$50
$AEEA:B0 25     BCS $AF11
$AEEC:E8        INX
$AEED:E8        INX
$AEEE:88        DEY
$AEEF:D0 EF     BNE $AEE0



this code compares the rating for the current team ($90 from above) to all the "ideal" ratings (array @ $9E) for each team in the division. execution drops to $AEF1 to make the current team their division leader.
 

 

So somewhere in there the calculation knows that the best record possible is 16-0, or else it compares Team X to the other teams in their division (like 4 games left in the season, but need 5 wins to be division champ so that team is dropped from the equations). Gonna dig more.

Share this post


Link to post
Share on other sites

And found out why they started to check for Divisional Champs after week 10; because week 10 is the last week of byes. So the program is checking what week it is in and then is able to find out how many games are left to be played.


Share this post


Link to post
Share on other sites

Found some info while searching the boards. Quote comes from http://tecmobowl.org/topic/3569-editing-playoff-schedule-for-tsb-nes/?hl=x22e47#entry80324

So somewhere in there the calculation knows that the best record possible is 16-0, or else it compares Team X to the other teams in their division (like 4 games left in the season, but need 5 wins to be division champ so that team is dropped from the equations). Gonna dig more.

And found out why they started to check for Divisional Champs after week 10; because week 10 is the last week of byes. So the program is checking what week it is in and then is able to find out how many games are left to be played.

Man I found something on this topic:

As you did find on jstout's notes, at offset x22E4B it is said :

$AE3A:C9 09      CMP #$09 ; Week to start checking (for DIVISION CHAMPS I guess..)

 

I know the CORRECT answer is within the notes posted by cxrom, but they are way over my head (seriously I dont understand a thing in there).

Anyway, in your rom you put a 04 (at that x22E4B offset), but if you input a 0E, ( or 0F worked ALMOST right for my rom) it will trigger that "search-week" later, it seems.. but you have to "trigger" it before the end of season (week 17). So, at offsets x22EDD-x22EDE , try the value A2 10 (I dont know why and I wish someone can tell me please what these bytes stand for?, it might seem that the 10 (HEX=16) is for the 16 you mentioned in your post, about the record but thats just guessing.

 

This will make SOME teams leading their division by 2 games or more, to play that CUTSCENE after the 0E ("X") week, because of "the maths" they're the "virtual" Division champs no matter next results. Making a "crushing" team even more "feared", (or making you believe that they've qualified with ease just because of that cutscene..)

NOW, I KNOW IT HAS A PROBLEM, and if I remember correctly, sometimes it "PRE-calculates", turning the champion into the second place of its division (because its record can still be tied...)  So you have to "play" with the value for the "start-checking-week" and with the "10", or you have to change another value somewhere (I haven't found where yet) for it to work correctly.

 

post-9389-0-26864700-1369299521_thumb.pn

when 0E is input at offset x22E4B it "precalculates" it wrong, cause as you can see, season has 2 games left,  for it to end.

If WESTEROS wins those 2, and if WOLVERINES loses both. the two teams would end up with a TIED record. and the winner, will not always be the "pre-selected-champ"

CUTSCENE has been already shown.

 

post-9389-0-02752400-1369299534_thumb.pn

But when 0F is the "X-week", this "calculation" will be correct ( I'm pretty sure it won't anyway. that´s why I removed it from my notes, but I checked and checked with your rom and it worked out right all the time...)

The problem is that CUTSCENE will appear until the last week ( kinda late), right after AXE lost their last game, but You can see The MAULERS have not played their last game yet .

**And when I say "0F is input (at offset x22E4B)" , also the offset x22EDD needs to be changed with A2. (or A7, or I dont remember..)

Edited by pambazos88

Share this post


Link to post
Share on other sites

Man I found something on this topic:

As you did find on jstout's notes, at offset x22E4B it is said :

$AE3A:C9 09      CMP #$09 ; Week to start checking (for DIVISION CHAMPS I guess..)

 

I know the CORRECT answer is within the notes posted by cxrom, but they are way over my head (seriously I dont understand a thing in there).

 

 

cxrom's post is just a list with 3 columns.  each row sequentially follows the previous row.

1. the left column is the address (location), followed by ":" for some reason.

2. the middle column is the actual "hex code" at the address (usually a byte or word)

3. the third column is just a "description" or hint at what the hex code is doing.

 

in example quoted here, it is saying:

 

starting at address xAE3A

"C909"

CMP #$09 is just a verbal description telling you that C9 is a "compare" function using value "09"

 

 

maybe you already knew that?  just thought it might help.  I have attached a text file which is a list of NES 6502 processor "op codes", which can be helpful to decipher the code, too.

6502 opcodes.txt

Edited by buck

Share this post


Link to post
Share on other sites

Thanks for these updates. My next version won't care cuz we expanded our league to 28 teams, but this stuff is still very interesting to me.


 


And the teams in my rom were created by my friends. They are a bunch of crazy guys and girls ;)http://tfofootball.weebly.com shows our season, with the "Super Bowl" taking place this Sunday (Cleveland Steamers vs Westeros Guardians).


Share this post


Link to post
Share on other sites

starting at address xAE3A

"C909"

CMP #$09 is just a verbal description telling you that C9 is a "compare" function using value "09"

 

maybe you already knew that?  just thought it might help.  I have attached a text file which is a list of NES 6502 processor "op codes", which can be helpful to decipher the code, too.

ALREADY KNEW THAT??? I knew SHIT!!..

Now, with this Document I can finally begin to understand what they are talking about (I dont know anything about this language either, but I can ask someone who does)

 

Thanks a lot man! I'll try to dig into it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×