mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-22 22:48:08 +03:00
Breaking change: Fix ShArray.ChangeSecretArray
This breaks save file compatibility for Daiakuji and Kaeru nyo Kuni nyo Alice. Due to an incorrect encryption code in ShArray.ChangeSecretArray, save files were not interoperable with system3.9. (Even worse, this bug did not affect the checksum calculation and did not cause a "corrupt save file" error when a file saved with system3.9 was loaded with xsystem35 or vice versa.) Fixes #41.
This commit is contained in:
@@ -1306,7 +1306,7 @@ static void ChangeSecretArray(void) { /* 53 */
|
||||
(*vAry) ^= ax; ax = (key[i&3] ^ *vAry);
|
||||
j ^= ax;
|
||||
if (i & 2) {
|
||||
ax = !ax ^ (i*3);
|
||||
ax = ~ax ^ (i*3);
|
||||
}
|
||||
if (i & 4) {
|
||||
ax = (ax >> 4) | (ax << 12);
|
||||
@@ -1328,13 +1328,12 @@ static void ChangeSecretArray(void) { /* 53 */
|
||||
*vAry ^= ax; ax = (key[i&3] ^ k);
|
||||
j ^= ax;
|
||||
if (i & 2) {
|
||||
ax = !ax ^ (i*3);
|
||||
ax = ~ax ^ (i*3);
|
||||
}
|
||||
if (i & 4) {
|
||||
ax = (ax >> 4) | (ax << 12);
|
||||
}
|
||||
vAry++;
|
||||
|
||||
}
|
||||
*vResult = j;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user