IntelOrca/OpenRCT2 — pull request #397 by jcdavis (2014-09-02 17:18:06+00:00)
Title: Decompile 6CB70A

I've thrown this in viewport.c since it seems to be used in lots of places.
This code fixes what I believe to be a bug in the assembly:

?_51983:xor ax, ax ; 006CB79D _ 66: 33. C0
bts word ptr [edi+12H], 0 ; 006CB7A0 _ 66: 0F BA. 6F, 12, 00
rcl ax, 1 ; 006CB7A6 _ 66: D1. D0
cmp ax, 3 ; 006CB7A9 _ 66: 83. F8, 03
jnz ?_51988 ; 006CB7AD _ 75, 44
jmp ?_51989 ; 006CB7AF _ EB, 47

the rcl will make ax either 0 or 1, meaning that the cmp always goes one direction. This is contrasted with nearly identical code below, which does `or ax, ax` as the conditional, so can go either way (I've put the 2 cases together)