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:
kichikuou
2023-12-09 11:35:40 +09:00
parent f6583330de
commit f247495578
+2 -3
View File
@@ -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;
}