Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests
10-10-2013, 03:14 AM (This post was last modified: 10-10-2013 03:24 AM by dlanor.)
Post: #1
Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests
As stated in the title, I've found a bug in CwCheat.cpp of the latest master repository (downloaded 2013-10-10 05:57 AM).
It isn't a new bug, but has been with us for many beta builds.
(I'm not sure exactly how far back it goes.)

The bug causes all Exxxxxxx codes to be interpreted as 16-bit tests, even when it is in fact an E1xxxxxx code, which should be interpreted as 8-bit.

The significant section of the code is:
Code:
            case 0xE: // Test commands, multiple skip
                {
                    bool is8Bit = (comm >> 24) == 0x1;

The problem with this is that (comm >> 24) will be 0xE1 for 8-bit usage, not 0x1 as the code above assumes.

As I see it this needs to be changed into either one of two forms:
Code:
            case 0xE: // Test commands, multiple skip
                {
                    bool is8Bit = ((comm >> 24) & 0x0F) == 0x1;

Or achieving the same result by a different method:
Code:
            case 0xE: // Test commands, multiple skip
                {
                    bool is8Bit = (comm >> 24) == 0xE1;

The latter form may be marginally faster, but only by a very tiny amount.

Best regards: dlanor
Find all posts by this user
10-11-2013, 01:12 PM
Post: #2
RE: Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests
Just for the record, the fix for this has been merged. Closing.
Find all posts by this user
Thread Closed 


Forum Jump: