|
| 1 | +Targets = %q( |
| 2 | + .byte $0,$0,$0,$0 |
| 3 | + .byte $68,$1,$4B,$0 ; 1 |
| 4 | + .byte $F8,$2,$6E,$0 ; 2 |
| 5 | + .byte $7E,$4,$9A,$0 ; 3 |
| 6 | + .byte $E6,$5,$E5,$0 ; 4 |
| 7 | + .byte $6C,$7,$12,$1 ; 5 |
| 8 | + .byte $CA,$8,$67,$1 ; 6 |
| 9 | + .byte $5A,$A,$89,$1 ; 7 |
| 10 | + .byte $B8,$B,$DE,$1 ; 8 |
| 11 | + .byte $3E,$D,$B,$2 ; 9 |
| 12 | + .byte $F2,$E,$A,$2 ; A |
| 13 | + .byte $2C,$10,$83,$2 ; B |
| 14 | + .byte $94,$11,$CD,$2 ; C |
| 15 | + .byte $38,$13,$DC,$2 ; D |
| 16 | + .byte $B4,$14,$13,$3 ; E |
| 17 | + .byte $08,$16,$72,$3 |
| 18 | +) |
| 19 | + .scan(/\$(.+),\$(.+),\$(.+),\$([0-9A-F]+)( |$)/i) |
| 20 | + .map.with_index { |a, i| |
| 21 | + [ |
| 22 | + i.to_s(16).upcase, |
| 23 | + (a[1].to_i(16) << 8) + a[0].to_i(16), |
| 24 | + (a[3].to_i(16) << 8) + a[2].to_i(16) |
| 25 | + ] |
| 26 | + } |
| 27 | + |
| 28 | +def print_pace(threshold, target, range, step = 1) |
| 29 | + _, base, mult = Targets[target] |
| 30 | + |
| 31 | + for i in range |
| 32 | + index = i * step |
| 33 | + if index <= threshold |
| 34 | + points = base |
| 35 | + else |
| 36 | + points = base + (((index-threshold) / (230.0-threshold)) * mult) |
| 37 | + end |
| 38 | + |
| 39 | + # print " |
| 40 | + # T: #{target.to_s(16).upcase}\ |
| 41 | + # L: #{index}\ |
| 42 | + # M: #{points.floor}\ |
| 43 | + # P: #{(points * index).floor}\ |
| 44 | + # " |
| 45 | + |
| 46 | + print "| #{target.to_s(16).upcase} | #{(points * index).floor} |\n" |
| 47 | + end |
| 48 | +end |
| 49 | + |
| 50 | +# pp targets |
| 51 | + |
| 52 | +for target in 0..0xF |
| 53 | + print_pace 110, target, 130..130, 1 |
| 54 | +end |
| 55 | + |
| 56 | +# print_pace 110, 0xA, 1..23, 10 |
0 commit comments