(by Codex) Restore original startup screens and edition runtime defaults
This commit is contained in:
1 parent
db56c323aa
commit
c8ae7a31d2
11 files changed
+136
-7
No files matched your search
@@ -10,6 +10,18 @@ CalendarEpoch calendar_epoch_from_executable(const LeImage& exe) {
|
||||
constexpr uint8_t month_and_year_prefix[] = {0xc6,0x44,0x24,0x0c,0x07,0xc7,0x04,0x24};
|
||||
if (!exe.contains(setup) || !exe.contains(setup + 16))
|
||||
throw FormatError("calendar: missing original date setup");
|
||||
constexpr uint8_t english_prefix[] = {0xc6,0x45,0xf6};
|
||||
constexpr uint8_t english_month_and_year[] = {0xc6,0x45,0xf7,0x07,0x66,0xc7,0x45,0xf8};
|
||||
bool english = true;
|
||||
for (uint32_t i=0;i<sizeof english_prefix;++i)
|
||||
english = english && exe.u8(setup+i)==english_prefix[i];
|
||||
for (uint32_t i=0;i<sizeof english_month_and_year;++i)
|
||||
english = english && exe.u8(setup+4+i)==english_month_and_year[i];
|
||||
if (english) {
|
||||
const auto year=exe.u16(setup+12); const int weekday=exe.u8(setup+3);
|
||||
if(year<1600||year>9999||weekday>6)throw FormatError("calendar: invalid original English epoch");
|
||||
return {int(year),weekday};
|
||||
}
|
||||
for (uint32_t i=0;i<sizeof weekday_prefix;++i)
|
||||
if(exe.u8(setup+i)!=weekday_prefix[i])throw FormatError("calendar: unverified weekday setup");
|
||||
for (uint32_t i=0;i<sizeof month_and_year_prefix;++i)
|
||||
|
||||
@@ -171,6 +171,10 @@ GameState startup_state(const LeImage& exe, const Database& db, const Bytes& m3_
|
||||
}
|
||||
const SaveState save(stream, counts);
|
||||
GameState g = GameState::from_save(save, counts);
|
||||
// The original options entry restores ordinary dialogs before any manager
|
||||
// confirmation. The executable's initial value belongs to its boot screens.
|
||||
g.memory.add_block(layout::CompactDialogFrame, 1);
|
||||
g.memory.set8(layout::CompactDialogFrame, 0);
|
||||
competition_pointers(g.memory, exe); // CompetitionPointers
|
||||
return g;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user