forums.PPSSPP.org
Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests - Printable Version

+- forums.PPSSPP.org (https://forums.ppsspp.org)
+-- Forum: PPSSPP - Playstation Portable Simulator Suitable for Playing Portably (/forumdisplay.php?fid=1)
+--- Forum: Development (/forumdisplay.php?fid=3)
+--- Thread: Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests (/showthread.php?tid=6761)



Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests - dlanor - 10-10-2013 03:14 AM

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


RE: Bug found in CwCheat.cpp, messing up E1xxxxxx multiple skip tests - Henrik - 10-11-2013 01:12 PM

Just for the record, the fix for this has been merged. Closing.