Jump to content
konForce

adjusting kick-off positions

Recommended Posts

This may be old news, but anyway:

TSB stores yards via two bytes, with 0x800 being midfield. Each yard is divided into 8 units. To move left 1 yard, subtract 8 pixels. To move right 1 yard, add 8 pixels.

This is stored in RAM at 0x7F (current line of scrimage) and 0x82 (original line of scrimage), with the low byte first. (0x0800 would be stored as 0x00 0x08.) During a play, the current yard line is stored in 0x93.

Yardlines do not swap automatically depending on which way you drive; instead they are hardcoded in two places, once for P1 and once for P2.

When setting the kick-off positions, TSB either loads the hardcoded bytes into the Y,X registers, loads the hardcoded bytes into the A register and then updates the RAM, or loads the bytes from the previous play into the A register and then updates the RAM.

The kick-off positions are set via Y,X registers at offsets 0x247B9 and 0x24031 for the first player and second player.

To change the position, simply modify the 2nd and 4th bytes. (They follow the a0 and a2 opcodes.)

The left 30 yard line is $760.

The right 30 yard line is $8A0.

To change player 1 to the 30:

0x247B9: a0 60

0x247BB: a2 07

To change player 2 to the 30:

0x24031: a0 A0

0x24033: a2 08

A simple formula for figuring out a yard's value:

1648 + (YL * 8) ' for LEFT side

2448 - (YL * 8) ' for RIGHT side

Then convert that decimal value into hex.

Note that if the kicker is able to boot the ball through the endzone, it counts as a safety.

Share this post


Link to post
Share on other sites
2 hours ago, fgqb#19nyj said:

Could anyone post an original TSB rom with the kickoff position at the 30. I'm trying to complete a 94 rom and this is one thing I need added.

 

get a hex editor and do the following at the four locations:

 

To change player 1 to the 30:

 

at 0x247B9 type in A060

at 0x247BB type in A207

 

To change player 2 to the 30:

 

at 0x24031 type in A0A0

at 0x24033 type in A208

 

 

Share this post


Link to post
Share on other sites

Hey, Buck. Thanks for the reply. I'm a newbie here and don't quite know how to look for something like that. I have the FCEUXDSP program and have opened up the rom, but for the life of me, I can't see what you mean by replacing the script that you've listed. Please, if you can, advise me how to do this. If it's too complicated, then could you instead post a rom where this already done. I would appreciate it.

Share this post


Link to post
Share on other sites

Never mind, Buck, I got it. Thanks for the code. It worked like a charm. :) 

 

(changing the kickoff location to the 30 or 40 yard line)

 

-30 yard-
To change player 1 to the 30: 0x247B9: A0 60; 0x247BB: A2 07

To change player 2 to the 30: 0x24031: A0 A0; 0x24033: A2 08

 

-40 yard-
To change player 1 to the 40: 0x247B9: A0 B0; 0x247BB: A2 07

To change player 2 to the 40: 0x24031: A0 50; 0x24033: A2 08

 

Note: must use the 20 yard line to middle of end zone option otherwise the kickoff could go out of the end zone and award the opposing team a safety.

 

(kickoff lengths)

 

#ALL KICKOFFS RANGE FROM 16YD-LINE TO BACK OF ENDZONE

SET(0x2A534, 0x4C83BF)

SET(0x2BF93, 0xA5454AA5446A186992A8A9016900AA4C2FA5)

 

#ALL KICKOFFS RANGE FROM 20YD-LINE TO MIDDLE OF ENDZONE (2nd option is needed for 40y ko)

SET(0x2A534, 0x4C83BF)

SET(0x2BF93, 0xA5454AA5446A186972A8A9016900AA4C2FA5)

 

I got all this from Buck and the Raja by the way. I just wanted them in one place is all.

Edited by fgqb#19nyj

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


  • Recently Browsing   0 members

    No registered users viewing this page.

×