[16:05] xfr: ok
[16:05] xfr: speed room has a very simple effect
[16:06] xfr: in the comparison value for turn action sorting, the speed is replaced with 0x710-speed
[16:06] xfr: so if your speed is over 1808 it overflows
[16:06] Cathy: cool
[16:07] Cathy: thanks a lot for that information
[16:07] xfr: the turn is determined by applying insertion sort on these turn action values
[16:08] Cathy: just for avoiding any doubt -- what does it overflow to?
[16:08] Cathy: what is 0x710-(0x710+1)
[16:08] xfr: the 0x10000 value depends on action type, 0x1000 is priority, then subpriority (like lagging tail or that berry), then the actual speed
[16:09] xfr: it will overflow to 1 apparently
[16:10] Cathy: that system is actually pretty clever
[16:10] Cathy: it's more optimised than our series of comparisons
[16:14] xfr: to be precise the exact calculation is 0x2710-speed but possibly due to an error
[16:14] xfr: the precision is truncated to 12 bits for the speed action sorting
[16:15] xfr: however, the real speed value is in fact 0x2710-speed because it would overflow the sub-priority value otherwise
[16:16] xfr: even without trick room speed precision is only up to 4095
[16:16] Cathy: interesting
[16:16] Cathy: is there any way to overflow that other than via trick room
[16:16] Cathy: ?
[16:17] xfr: I don't think so
[16:18] xfr: heh actually...
[16:18] Marty: oh, that explains why the 2012 Speed Deoxys still 'outsped' two Pokemon with no more than 6 Speed in Trick Room
[16:18] xfr: I think with tailwind and scarf Ninjask might hit 4140 at +6
[16:19] Marty: that's very interesting
[16:20] Marty: thanks xfr
[16:20] Marty: I'll go tack on Tailwind to this Swift Swim Agility Deoxys
[16:21] xfr: once again the precision problem only applies to the action order decision
[16:22] xfr: the end of turn effects also are speed sorted, but they do not have priority or subpriority and thus use the full precision
[16:22] xfr: so you if you have an overflow the speed will still be correct for the end of turn effects
[16:25] xfr: ok correction the precision is actually 13 bits
[16:25] xfr: so without trick room the overflow is at 8191
[16:25] xfr: still possible to hit with swift speed I think
[16:26] xfr: Game Freak mistake was to use 0x2710-speed when they should have used 0x1FFF-speed
[16:26] Cathy: so is the effective speed in trick room (0x2710 - speed) & 8191
[16:26] xfr: yes exactly
[16:27] xfr: &8191 is at 021BC7E6 for the action sort
[16:27] xfr: and 0x2710-speed is at 21BCA0C
[16:27] xfr: it simply does LDR R0, =0x2710, SUBS R4, R0, R4
[16:30] Cathy: mm
[16:30] Cathy: interesting mechanics
[16:31] Marty: hmm, I can hit 12096 Speed, let's see how this goes
[16:33] xfr: 12096 will be treated as 3904, try with 8192
[16:33] xfr: and you'll move last against anything
[16:34] Marty: well, I'll also have a second Deoxys at just under 8192
[16:35] xfr: what are you using for making all your tests?
[16:35] Marty: PokeGen and an R4
[16:35] xfr: tedious, tedious
[16:40] xfr: pokecheck has a built in battle video editor for creating test videos instantly loaded into desmume but it's unfortunately incomplete and very difficult to use
[16:48] Marty:
http://hastebin.com/raw/texuseqimu [ long expired; see
https://pastebin.com/5DeZgAYs instead]
[16:48] Marty: it makes so much more sense now
[16:49] Marty: thanks for the info xfr