mirror of
https://github.com/kichikuou/xsystem35-sdl2.git
synced 2026-09-30 10:48:21 +03:00
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:
+3
-1
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user