konForce Posted January 2, 2005 Share Posted January 2, 2005 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 * ' for LEFT side 2448 - (YL * ' 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. Tunnelrunner 1 Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.