#include "runtime_fixture_tables.hpp" // SPDX-License-Identifier: GPL-3.0-only #include "formats/executable_layout.hpp" #include "game/career.hpp" #include "formats/le.hpp" #include "game/save.hpp" #include #include using namespace bmh; namespace {void check(bool value,const char* why){if(!value)throw std::runtime_error(why);}} int main(int argc,char**argv){try{ if(argc<2||std::string(argv[1]).empty()){std::cout<<"SKIP: BMH_DATA unavailable\n";return 77;} const std::filesystem::path data=argv[1];auto exe=bmh::test::load_executable(data/"BMH.exe"); auto db=load_database(data/"M3D.MAN");auto texts=load_textd(data/"TEXTD.BLK"); auto before=startup_state(exe,db,read_file(data/"M3.MEN"),read_file(data/"M3.DAT")); before.texts=&texts; check(before.memory.has(layout::CompactDialogFrame)&&before.memory.u8(layout::CompactDialogFrame)==0, "options entry disables the boot-only black dialog frame"); for(unsigned i=0;i<4;++i)check(exe.u32(::bmh::layout::OfferSlots+i*4)==0&&before.memory.u32(::bmh::layout::OfferSlots+i*4)==0, "raw EXE BSS and startup_state carry zero, not empty pending offer sentinel"); // Use the existing exact6ba3e split helpers as unchanged baseline, with // identical full native state and both seeds. No fabricated RNG parity. auto expected=before,actual=before;GameRandom ge(123456),ga(123456); WatcomRandom we(987654321),wa(987654321);MinuteReport re,ra; new_career_markets_and_moods(expected,ge,we); check(new_career_players(expected,ge,we,re)&&!re.unsupported,"baseline6ba3e split completes"); check(new_career_before_dialog(actual,ga,wa,ra)&&!ra.unsupported,"fresh predecessor+6ba3e completes"); check(ge.seed()==ga.seed()&&ge.calls()==ga.calls()&&we.seed()==wa.seed()&&we.calls()==wa.calls(), "four offer sentinel writes consume neither RNG and preserve exact initialization draw sequence"); auto baseline_bytes=save_stream(expected),actual_bytes=save_stream(actual); check(baseline_bytes.size()==actual_bytes.size(),"native stream length unchanged"); const SaveState native(actual_bytes);const auto offset=native.block(::bmh::layout::OfferSlots).offset; unsigned differences=0; for(size_t i=0;i=offset&&i