The score calculations for the 100m race are based on 3 tiers.
No score awarded for times of 15.00 or above
For times between 11.00 and 14.99 : ((14 - number of whole seconds) * 2000) + ((100 - subseconds) * 20)
For times between 10.00 and 10.99 : (4 * 2000) + ((100 - subseconds) * 30)
For times less than 10.00 : (whole seconds less than 10 * 3000) + (4 * 2000) + ((100 - subseconds) * 30)
Of course you're probably already familiar with the Easter Egg in the 100m and 110m hurdles whereby if you finish with exactly the same time as the opponent you will receive a 1000 point bonus. If you're playing against another human, rather than the CPU, then both players will receive the bonus.
[font="Courier New, Courier, mono"]; score calculating routine for the 100m race[/font]
[font="Courier New, Courier, mono"];[/font]
[font="Courier New, Courier, mono"]; score is calculated as follows :-[/font]
[font="Courier New, Courier, mono"]; no score for times of 15.00 or above[/font]
[font="Courier New, Courier, mono"]; for times between 11.00 and 14.99 : ((14 - number of whole seconds) * 2000) + ((100 - subseconds) * 20)[/font]
[font="Courier New, Courier, mono"]; for times between 10.00 and 10.99 : (4 * 2000) + ((100 - subseconds) * 30)[/font]
[font="Courier New, Courier, mono"]; for times less than 10.00 : (whole seconds less than 10 * 3000) + (4 * 2000) + ((100 - subseconds) * 30)[/font]
[font="Courier New, Courier, mono"];[/font]
[font="Courier New, Courier, mono"]D3CE: A6 2C LDA ,Y ; get tens of seconds (BCD value)[/font]
[font="Courier New, Courier, mono"]D3D0: C6 28 LDB #$0A[/font]
[font="Courier New, Courier, mono"]D3D2: 3D MUL ; multiply by 10 and store result in B[/font]
[font="Courier New, Courier, mono"]D3D3: EB 03 ADDB $1,Y ; add BCD seconds value to B[/font]
[font="Courier New, Courier, mono"]D3D5: D7 D3 STB $51 ; store whole seconds result at $2851[/font]
[font="Courier New, Courier, mono"]D3D7: C1 27 CMPB #$0F ; compare B with 15[/font]
[font="Courier New, Courier, mono"]D3D9: 24 C2 BCC $D425 ; branch if B >= 15 (no score if time is greater than 15.00)[/font]
[font="Courier New, Courier, mono"]D3DB: C6 26 LDB #$0E ; B = 14[/font]
[font="Courier New, Courier, mono"]D3DD: D0 D9 SUBB $51 ; subtract player's whole seconds from 14, storing result in B[/font]
[font="Courier New, Courier, mono"]D3DF: C1 26 CMPB #$04 ; compare result with a value of 4[/font]
[font="Courier New, Courier, mono"]D3E1: 25 88 BCS $D3ED ; branch if whole seconds are > 11[/font]
[font="Courier New, Courier, mono"]
[/font]
[font="Courier New, Courier, mono"]; player's time is less than 11.00 seconds[/font]
[font="Courier New, Courier, mono"]D3E3: 86 26 LDA #$04 ; A = 4[/font]
[font="Courier New, Courier, mono"]D3E5: 97 D0 STA $52 ; store at $2852 (init the loop counter)[/font]
[font="Courier New, Courier, mono"]D3E7: C0 2C SUBB #$04 ; subtract 4 from B[/font]
[font="Courier New, Courier, mono"]D3E9: D7 DB STB $53 ; store result at $2853 (number of whole seconds less than 10)[/font]
[font="Courier New, Courier, mono"]D3EB: 20 2C BRA $D3F1 ; unconditional branch[/font]
[font="Courier New, Courier, mono"]
[/font]
[font="Courier New, Courier, mono"]; player's time is between 11.00 and 14.99 [/font]
[font="Courier New, Courier, mono"]D3ED: D7 DA STB $52 ; store 14 - player's seconds at $2852 (init the loop counter)[/font]
[font="Courier New, Courier, mono"]D3EF: 0F 71 CLR $53 ; clear $2853 to zero[/font]
[font="Courier New, Courier, mono"]
[/font]
[font="Courier New, Courier, mono"]D3F1: 96 D0 LDA $52 ; get 14 - player's seconds[/font]
[font="Courier New, Courier, mono"]D3F3: 27 30 BEQ $D407 ; branch if zero (no whole second multiplier for times between 14.00 and 14.99)[/font]
[font="Courier New, Courier, mono"]D3F5: CE 5E FC LDU #$DC7E ; point U at the score lookup table (2000 points)[/font]
[font="Courier New, Courier, mono"]D3F8: BD FD 9C JSR $D514 ; calculate score for (14 - whole seconds)[/font]
[font="Courier New, Courier, mono"]D3FB: 96 7B LDA $53 ; get contents of $2853 into A (number of whole seconds under 10 seconds)[/font]
[font="Courier New, Courier, mono"]D3FD: 97 DA STA $52 ; store at $2852 (init the loop counter)[/font]
[font="Courier New, Courier, mono"]D3FF: 27 24 BEQ $D407 ; branch if zero (no enhanced multiplier if time was not under 10 seconds)[/font]
[font="Courier New, Courier, mono"]D401: CE 5E 02 LDU #$DC80 ; point U at the score lookup table (3000 points)[/font]
[font="Courier New, Courier, mono"]D404: BD F7 96 JSR $D514 ; calculate score for whole seconds under 10[/font]
[font="Courier New, Courier, mono"]
[/font]
[font="Courier New, Courier, mono"]; now calculate score for subseconds (tenths/hundredths of seconds)[/font]
[font="Courier New, Courier, mono"]D407: A6 0A LDA $2,Y ; get tenths of seconds (BCD value)[/font]
[font="Courier New, Courier, mono"]D409: C6 82 LDB #$0A [/font]
[font="Courier New, Courier, mono"]D40B: 3D MUL ; multiply by 10 and store result in B[/font]
[font="Courier New, Courier, mono"]D40C: EB 0B ADDB $3,Y ; add BCD hundredths of seconds to B[/font]
[font="Courier New, Courier, mono"]D40E: D7 D8 STB $50 ; store at $2850[/font]
[font="Courier New, Courier, mono"]D410: 86 46 LDA #$64 ; A = 100[/font]
[font="Courier New, Courier, mono"]D412: 90 D2 SUBA $50 ; subtract subseconds from 100 and store result in A[/font]
[font="Courier New, Courier, mono"]D414: 97 70 STA $52 ; store that result at $2852 (init the loop counter)[/font]
[font="Courier New, Courier, mono"]D416: CE 5E 5C LDU #$DC74 ; point U at the score lookup table (30 points)[/font]
[font="Courier New, Courier, mono"]D419: 96 D9 LDA $51 ; get whole seconds from player's finishing time[/font]
[font="Courier New, Courier, mono"]D41B: 81 23 CMPA #$0B ; compare with 11[/font]
[font="Courier New, Courier, mono"]D41D: 25 8B BCS $D422 ; branch if player's finishing time was less than 11.00 seconds[/font]
[font="Courier New, Courier, mono"]D41F: CE FE 50 LDU #$DC72 ; else point U at the score lookup table (20 points)[/font]
[font="Courier New, Courier, mono"]D422: BD 57 36 JSR $D514 ; calculate the score for the subseconds [/font]
[font="Courier New, Courier, mono"]D425: 39 RTS [/font]
[font="Courier New, Courier, mono"]
[/font]
[font="Courier New, Courier, mono"]
[/font]