Derive default patchEC value from scenario signature

The EC bug exists only in System 3.8 and later. System 3.5 / 3.6 games
(e.g. Atlach=Nacha) need the patched behavior.

This deviates from System39.exe, which has the buggy behavior for older
scenarios too.
This commit is contained in:
kichikuou
2026-09-06 13:03:51 +09:00
parent 5ce1494b59
commit 6820bcfcb8
4 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -167,7 +167,9 @@ void nact_init() {
sel_init();
nact->patch_ec = false;
// The EC bug was introduced in System 3.8. Older games expect the
// patch_ec=true behavior.
nact->patch_ec = !sl_is_s380;
nact->patch_emen = false;
nact->patch_g0 = false;
+2
View File
@@ -36,6 +36,7 @@
const uint8_t *sl_sco;
int sl_page;
int sl_index;
bool sl_is_s380;
static void pop_state(uint8_t tag);
@@ -102,6 +103,7 @@ bool sl_init(void) {
stack_top = stack_buf;
sl_jmpFar(0);
sl_is_s380 = !memcmp(sl_sco, "S380", 4);
return true;
}
+2
View File
@@ -54,6 +54,8 @@ struct stack_frame_info {
uint8_t *p; // for internal use
};
extern bool sl_is_s380;
// Use functions below instead of accessing these variables directly.
extern const uint8_t *sl_sco; // scenario page buffer
extern int sl_page; // current scenario page (0-based)
+2 -2
View File
@@ -147,10 +147,10 @@ static void sys35_usage(bool verbose) {
static void sys35_init() {
int i;
nact_init();
sl_init();
nact_init();
v_init();
ags_init(render_driver, enable_zb);