(by Codex) Restore original startup screens and edition runtime defaults

This commit is contained in:
Codex committed 2026-11-01 17:37:48 +01:00
1 parent db56c323aa
commit c8ae7a31d2
11 files changed
+136 -7

No files matched your search

+9 -6
View File
@@ -549,9 +549,9 @@ static void install_league_sizes(const LeImage& exe) {
}
CareerSession::CareerSession(const std::filesystem::path& data, uint32_t watcom_seed)
: data_directory_(data), exe_(load_le(data / "BMH.exe")),
db_(load_database(data / "M3D.MAN")),
texts_(load_textd(data / "TEXTD.BLK")),
: data_directory_(data), exe_(load_le(ui::asset_path(data, "BMH.exe"))),
db_(load_database(ui::asset_path(data, "M3D.MAN"))),
texts_(load_textd(ui::asset_path(data, "TEXTD.BLK"))),
rand_(watcom_seed) {
install_league_sizes(exe_);
turn_driver_.alternate_match_event_roll = exe_.u8(::bmh::layout::AlternateEventRoll) != 0;
@@ -560,7 +560,7 @@ CareerSession::CareerSession(const std::filesystem::path& data, uint32_t watcom_
? TransferAllocatorContext::zero : TransferAllocatorContext::blocked;
session_id_ = next_session_id.fetch_add(1, std::memory_order_relaxed);
initialize_club_modal_runtime();
g_ = startup_state(exe_, db_, read_file(data / "M3.MEN"), read_file(data / "M3.DAT"));
g_ = startup_state(exe_, db_, read_file(ui::asset_path(data, "M3.MEN")), read_file(ui::asset_path(data, "M3.DAT")));
g_.texts = &texts_;
g_.currency_suffix = exe_.cstring(::bmh::layout::CurrencySuffixText); // CurrencySuffixText
configure_training_camp_data(g_, exe_);
@@ -576,8 +576,8 @@ CareerSession::CareerSession(const std::filesystem::path& data, uint32_t watcom_
CareerSession::CareerSession(const std::filesystem::path& data, uint32_t watcom_seed,
const std::filesystem::path& save_path)
: data_directory_(data), exe_(load_le(data / "BMH.exe")), db_(load_database(data / "M3D.MAN")),
texts_(load_textd(data / "TEXTD.BLK")), rand_(watcom_seed) {
: data_directory_(data), exe_(load_le(ui::asset_path(data, "BMH.exe"))), db_(load_database(ui::asset_path(data, "M3D.MAN"))),
texts_(load_textd(ui::asset_path(data, "TEXTD.BLK"))), rand_(watcom_seed) {
install_league_sizes(exe_);
turn_driver_.alternate_match_event_roll = exe_.u8(::bmh::layout::AlternateEventRoll) != 0;
turn_driver_.disable_match_events = exe_.u8(::bmh::layout::MatchEventsDisabled) != 0;
@@ -926,6 +926,9 @@ std::optional<PendingOfferResult> CareerSession::dispatch_club_player_pending_of
}
void CareerSession::initialize_club_modal_runtime() {
// Setup clears the boot-only dialog mode before either creating or loading
// a career. This process flag is deliberately absent from native saves.
club_modal_runtime_.emplace(layout::CompactDialogFrame, 0);
// LE object4 has bb cdd/de/e1 in its zero-initialized virtual tail;
// CareerSession_InitializeClubModalRuntime_ExecutableField is file-backed zero. These are explicit process-start values,
// carried by this runtime owner across modal entry/return, not FBM bytes.
+26
View File
@@ -3599,6 +3599,32 @@ int main(int argc, char** argv) {
if (expired.request != ui::FlowRequest::none || expired.changed) handle(expired);
}
};
// Original boot order: publisher, credits, then the game's title. Keep
// these in the graphical frontend; creating a session starts at options.
// OpenBMH deviates from the original: keep the title visible for 1.5s
// instead of relying on the duration of DOS database initialization.
bool skip_opening = false;
for (const auto [picture, milliseconds] :
std::array<std::pair<int, Uint64>, 3>{{{138, 3000}, {139, 1000}, {137, 1500}}}) {
if (!running || skip_opening) break;
present_season(load_vga(ui::asset_path(data / "KB", std::to_string(picture) + ".VGA")),
window_title.c_str());
const auto until = SDL_GetTicks64() + milliseconds;
while (running && !skip_opening && SDL_GetTicks64() < until) {
SDL_Event opening_event;
while (SDL_PollEvent(&opening_event)) {
if (opening_event.type == SDL_QUIT) running = false;
if (opening_event.type == SDL_KEYDOWN || opening_event.type == SDL_MOUSEBUTTONUP)
skip_opening = true;
}
SDL_Delay(10);
}
}
// Opening input must not also change an option on the first setup frame.
SDL_FlushEvents(SDL_KEYDOWN, SDL_KEYUP);
SDL_FlushEvents(SDL_MOUSEBUTTONDOWN, SDL_MOUSEBUTTONUP);
season_backdrop.reset();
dirty = true;
SDL_StartTextInput();
bool filename_input_active = false;
std::array<bool, 2> setup_button_down{};