Layout constants of the world and league tables named by meaning

Ten constants with generated names (CareerSession_InstallLeagueSizes_RuntimeField*,
CareerSession_DispatchLineup_RuntimeField, CupDraw_FormatError_RuntimeField2/3, ...)
are LeagueClubCount, LeagueEuropeanPlaces, LeagueRelegationPlaces, LeagueNameSuffixes,
PromotionGroupBelowCounts/Leagues, NewcomerClubCount, ForeignCupClubCount and
ManagerRecord0Club/4Club. Values unchanged; the layout reference is regenerated.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude committed 2026-11-11 12:10:30 +01:00
1 parent 33566566ac
commit 205a543b40
44 files changed
+117 -109

No files matched your search

+1 -1
View File
@@ -1987,7 +1987,7 @@ int main(int argc, char** argv) {
observe_last_week(sparse_bidder, buy_entry, false, true);
GameState coach_bidder = human_bidder;
coach_bidder.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, uint16_t(coach_bidder.manager_teams.at(0)));
coach_bidder.memory.set16(::bmh::layout::ManagerRecord4Club, uint16_t(coach_bidder.manager_teams.at(0)));
coach_bidder.manager_teams = {0x165};
observe_last_week(coach_bidder, buy_entry, false, true);
+1 -1
View File
@@ -52,7 +52,7 @@ void check_original_score(const std::filesystem::path& data, const std::filesyst
constexpr uint8_t weights[] = {3,5,4,30,20,10,5,40,30,50};
for (uint32_t k = 0; k < sizeof weights; ++k)
require(exe.u8(::bmh::layout::HighscoreRuntimeField + k) == weights[k], "Source score weights changed");
require(exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField) + exe.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6) + exe.u16(::bmh::layout::ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3) == kNoTeam,
require(exe.u16(::bmh::layout::LeagueClubCount) + exe.u16(::bmh::layout::NewcomerClubCount) + exe.u16(::bmh::layout::ForeignCupClubCount) == kNoTeam,
"national honours base changed");
auto g = post7(fixture);
const auto before = save_stream(g);
+3 -3
View File
@@ -42,7 +42,7 @@ GameState fixture() {
g.memory.add_block(kPlannerTeams, 30 * 4);
g.memory.add_block(kCalendar, 0x16e * 2);
g.memory.add_block(::bmh::layout::DaysIntoSeason, 2);
g.memory.add_block(::bmh::layout::CupDraw_FormatError_RuntimeField3, 2);
g.memory.add_block(::bmh::layout::ManagerRecord4Club, 2);
g.date = 50;
g.season_start = 0;
g.level = 1;
@@ -219,7 +219,7 @@ void check_stale_and_source_association_payer() {
"unowned away side is not charged to the national coach");
GameState home_association = fixture();
home_association.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, 0x16c);
home_association.memory.set16(::bmh::layout::ManagerRecord4Club, 0x16c);
WatcomRandom home_rand(0xabcdef01);
auto home_quote = accepted_quote(home_association, home_rand, 0x16c, true);
NationalFriendlyBookingRequest home_request;
@@ -237,7 +237,7 @@ void check_stale_and_source_association_payer() {
home_game.calls() == home_before.calls(), "opponent refusal changes neither Native nor G");
GameState association = fixture();
association.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, 0x16c);
association.memory.set16(::bmh::layout::ManagerRecord4Club, 0x16c);
WatcomRandom association_rand(0xabcdef01);
auto association_quote = accepted_quote(association, association_rand, 0x16c, false);
check(association_quote.terms.opponent_manager == 4 &&
+1 -1
View File
@@ -178,7 +178,7 @@ int main() {
constexpr size_t national_backup = 4 * 0xb0c + 0x290;
game.manager_records[national_backup] = 200;
game.manager_records[national_backup + 1] = 0;
game.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, 199); // stale raw cache deliberately disagrees with typed slot4.
game.memory.set16(::bmh::layout::ManagerRecord4Club, 199); // stale raw cache deliberately disagrees with typed slot4.
game.memory.set16(::bmh::layout::SyntheticCupParticipantsBegin, 200);
bool owned_foreign_rejected = false;
try { (void)bmh::other_games_from_game(game, db, 0, 0, 0); }
@@ -138,8 +138,8 @@ int main(int argc,char**argv){try{
actual=show(p);
const std::array<int,3> ranks{31,18,0};
for(int n=0;n<3;++n){int rank=ranks[size_t(n)],kind=1;
if(rank<int(exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField))+int(exe.u8(::bmh::layout::DeskDrawers_Curve_RuntimeField))||rank==0)kind=0;
if(int(exe.u8(::bmh::layout::LeagueSizes))-int(exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField2))<=rank)++kind;
if(rank<int(exe.u8(::bmh::layout::LeagueEuropeanPlaces))+int(exe.u8(::bmh::layout::DeskDrawers_Curve_RuntimeField))||rank==0)kind=0;
if(int(exe.u8(::bmh::layout::LeagueSizes))-int(exe.u8(::bmh::layout::LeagueRelegationPlaces))<=rank)++kind;
int start=uint8_t(193-2*(int(exe.u8(::bmh::layout::LeagueSizes))-rank));
for(int stripe=0;stripe<2;++stripe){bool equal=true;
for(int y=std::min(start,191);y<=std::max(start,191);++y)
+6 -6
View File
@@ -31,8 +31,8 @@ GameState empty_game(std::vector<int> managers = {0}) {
GameState g;
g.memory.add_block(::bmh::layout::ManagerCount, 1);
g.memory.set8(::bmh::layout::ManagerCount, uint8_t(managers.size()));
g.memory.add_block(::bmh::layout::CupDraw_FormatError_RuntimeField3, 2);
g.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, 0);
g.memory.add_block(::bmh::layout::ManagerRecord4Club, 2);
g.memory.set16(::bmh::layout::ManagerRecord4Club, 0);
g.manager_teams = std::move(managers);
g.club_ids.assign(138, 0);
g.club_names = {0};
@@ -127,10 +127,10 @@ void test_manager_and_national_original_club_scope() {
managers.rows[1].player == second, "manager scope includes every active manager's club only");
auto national = empty_game({kNoTeam, 1});
// Source's live ManagerCount/CupDraw_FormatError_RuntimeField3 counterparts can diverge from these loaded
// Source's live ManagerCount/ManagerRecord4Club counterparts can diverge from these loaded
// StaticMemory bytes after the typed national-coach handoff.
national.memory.set8(::bmh::layout::ManagerCount, 1);
national.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, 2);
national.memory.set16(::bmh::layout::ManagerRecord4Club, 2);
national.manager_records.assign(5 * 0xb0c, 0);
national.manager_records[4 * 0xb0c + 0x290] = 0;
national.manager_records[4 * 0xb0c + 0x291] = 0;
@@ -345,8 +345,8 @@ void test_live_national_takeover_projection(const std::filesystem::path& data) {
// Deliberately make the loaded StaticMemory copy disagree with the live
// Source global; the native manager-record swap is authoritative.
if (!live.memory.has(::bmh::layout::CupDraw_FormatError_RuntimeField3)) live.memory.add_block(::bmh::layout::CupDraw_FormatError_RuntimeField3, 2);
live.memory.set16(::bmh::layout::CupDraw_FormatError_RuntimeField3, uint16_t((home + 1) % 138));
if (!live.memory.has(::bmh::layout::ManagerRecord4Club)) live.memory.add_block(::bmh::layout::ManagerRecord4Club, 2);
live.memory.set16(::bmh::layout::ManagerRecord4Club, uint16_t((home + 1) % 138));
const auto native = save_stream(live);
const auto w = session->rand(); const auto g = session->game();
const auto page = game::top_scorers_from_game(live, 0, game::TopScorersMetric::goals,