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

+18 -10
View File
@@ -250,7 +250,7 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `CareerSession_DispatchDesktopLayout_RuntimeField2` | `0xa2517` | German-compatible image / runtime field |
| `CareerSession_DispatchLeagueTableControl_RuntimeField` | `0xa454d` | German-compatible image / runtime field |
| `CareerSession_DispatchLeagueTableControl_RuntimeField2` | `0xbb834` | German-compatible image / runtime field |
| `CareerSession_DispatchLineup_RuntimeField` | `0xa2c30` | German-compatible image / runtime field |
| `LeagueClubCount` | `0xa2c30` | German-compatible image / runtime field |
| `CareerSession_DispatchLiveSubstitution_ExecutableField` | `0xa366c` | German-compatible image / runtime field |
| `CareerSession_DispatchLiveTactic_RuntimeField` | `0xa20eb` | German-compatible image / runtime field |
| `CareerSession_DispatchLiveTactic_RuntimeField2` | `0xa20f3` | German-compatible image / runtime field |
@@ -307,12 +307,12 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `CareerSession_FormatNumber_TextPointer` | `0xa137e` | German-compatible image / runtime field |
| `CareerSession_InitializeClubModalRuntime_ExecutableField` | `0xa25c0` | German-compatible image / runtime field |
| `CareerSession_InitializeClubModalRuntime_ExecutableFieldUnsigned` | `0xa25c0u` | German-compatible image / runtime field |
| `CareerSession_InstallLeagueSizes_RuntimeField` | `0xa2be9` | German-compatible image / runtime field |
| `CareerSession_InstallLeagueSizes_RuntimeField2` | `0xa2bf2` | German-compatible image / runtime field |
| `CareerSession_InstallLeagueSizes_RuntimeField3` | `0xa2c00` | German-compatible image / runtime field |
| `CareerSession_InstallLeagueSizes_RuntimeField4` | `0xa2c0b` | German-compatible image / runtime field |
| `CareerSession_InstallLeagueSizes_RuntimeField5` | `0xa2c13` | German-compatible image / runtime field |
| `CareerSession_InstallLeagueSizes_RuntimeField6` | `0xa2c34` | German-compatible image / runtime field |
| `LeagueEuropeanPlaces` | `0xa2be9` | German-compatible image / runtime field |
| `LeagueRelegationPlaces` | `0xa2bf2` | German-compatible image / runtime field |
| `LeagueNameSuffixes` | `0xa2c00` | German-compatible image / runtime field |
| `PromotionGroupBelowCounts` | `0xa2c0b` | German-compatible image / runtime field |
| `PromotionGroupBelowLeagues` | `0xa2c13` | German-compatible image / runtime field |
| `NewcomerClubCount` | `0xa2c34` | German-compatible image / runtime field |
| `CareerSession_Int32T_TextPointer` | `0xaeffc` | German-compatible image / runtime field |
| `CareerSession_Int32T_TextPointer2` | `0xaf21c` | German-compatible image / runtime field |
| `CareerSession_Int32T_TextPointer3` | `0xaf228` | German-compatible image / runtime field |
@@ -462,7 +462,7 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `ClubKitSelectorsUnsigned` | `0xbb68bu` | German-compatible image / runtime field |
| `ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField` | `0xa25bb` | German-compatible image / runtime field |
| `ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField2` | `0xa25bf` | German-compatible image / runtime field |
| `ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3` | `0xa2c36` | German-compatible image / runtime field |
| `ForeignCupClubCount` | `0xa2c36` | German-compatible image / runtime field |
| `ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField4` | `0xa364a` | German-compatible image / runtime field |
| `ClubPlayerDetail_ClubPlayerDetailRedraw_RuntimeField` | `0xa2c4e` | German-compatible image / runtime field |
| `ClubPlayerDetail_ClubPlayerDetailRedraw_RuntimeField2` | `0xa3c9b` | German-compatible image / runtime field |
@@ -591,8 +591,8 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `CupDraw_FormatError_ExecutableField5` | `0xae704` | German-compatible image / runtime field |
| `CupDraw_FormatError_ExecutableField6` | `0xae70c` | German-compatible image / runtime field |
| `CupDraw_FormatError_RuntimeField` | `0xa2547` | German-compatible image / runtime field |
| `CupDraw_FormatError_RuntimeField2` | `0xb6ea8` | German-compatible image / runtime field |
| `CupDraw_FormatError_RuntimeField3` | `0xb9ad8` | German-compatible image / runtime field |
| `ManagerRecord0Club` | `0xb6ea8` | German-compatible image / runtime field |
| `ManagerRecord4Club` | `0xb9ad8` | German-compatible image / runtime field |
| `CupDraw_FormatError_TextPointer` | `0xa1612` | German-compatible image / runtime field |
| `CupDraw_FormatError_TextPointer2` | `0xa1619` | German-compatible image / runtime field |
| `CupDraw_FormatError_TextPointer3` | `0xa161e` | German-compatible image / runtime field |
@@ -893,6 +893,12 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `EnglishLayoutTranslation256` | `0x6f2ae` | English image adapter |
| `EnglishLayoutTranslation257` | `0x6f2d4` | English image adapter |
| `EnglishLayoutTranslation258` | `0x6f2e0` | English image adapter |
| `EnglishEnvironmentTileX` | `0x6d230` | English image adapter |
| `EnglishEnvironmentTileY` | `0x6d238` | English image adapter |
| `EnglishEnvironmentYouthColors` | `0x6d240` | English image adapter |
| `EnglishEnvironmentBudgetSteps` | `0x6d244` | English image adapter |
| `EnglishEnvironmentYouthPositionSuffix` | `0x6d24a` | English image adapter |
| `EnglishEnvironmentCostSuffix` | `0x6d24f` | English image adapter |
| `EnglishLayoutTranslation259` | `0x6f2fc` | English image adapter |
| `EnglishLayoutTranslation26` | `0x6bf2c` | English image adapter |
| `EnglishLayoutTranslation260` | `0x6f300` | English image adapter |
@@ -1927,6 +1933,8 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `TransferMarket_Rect_TextPointer3` | `0xae148` | German-compatible image / runtime field |
| `TransferMarket_Rect_TextPointer4` | `0xae14c` | German-compatible image / runtime field |
| `TransferMarket_Rect_TextPointer5` | `0xae150` | German-compatible image / runtime field |
| `TransferMarket_SearchRows_RuntimeField` | `0xa20fb` | German-compatible image / runtime field |
| `TransferMarket_SearchButton_TextPointer` | `0xae144` | German-compatible image / runtime field |
| `TransferMarket_Rect_TextPointer6` | `0xaecac` | German-compatible image / runtime field |
| `TransferMarket_Rect_TextPointer7` | `0xaf250` | German-compatible image / runtime field |
| `TransferMarket_Render_TextPointer` | `0xaf264` | German-compatible image / runtime field |
+1 -1
View File
@@ -30,7 +30,7 @@ auto App::club_information_dialog(app::ClubModalServices& services, int team) ->
const auto redraw = [&] {
std::string error;
ClubInfoEntry snapshot;
if (team == kNoTeam || team < season_exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) {
if (team == kNoTeam || team < season_exe.u16(::bmh::layout::LeagueClubCount)) {
snapshot = services.enter_club(team);
}
auto projection = ui::club_info_from_game(services.state(), team, snapshot,
+6 -6
View File
@@ -497,13 +497,13 @@ static void install_league_sizes(const LeImage& exe) {
set_league_groups(first, count);
// the promotion ladder (schedule.hpp)
for (uint32_t l = 0; l < uint32_t(kLeagueCount); ++l) {
installed_league_system().relegation[l] = exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField2 + l);
installed_league_system().europe[l] = exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField + l);
installed_league_system().suffix[l] = char(l < 5 ? exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField3 + l * 2) : 0);
installed_league_system().relegation[l] = exe.u8(::bmh::layout::LeagueRelegationPlaces + l);
installed_league_system().europe[l] = exe.u8(::bmh::layout::LeagueEuropeanPlaces + l);
installed_league_system().suffix[l] = char(l < 5 ? exe.u8(::bmh::layout::LeagueNameSuffixes + l * 2) : 0);
}
for (uint32_t g = 0; g < 8; ++g) installed_league_system().below_first[g] = exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField5 + g), installed_league_system().below_count[g] = exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField4 + g);
installed_league_system().newcomer_first = exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField);
installed_league_system().newcomer_count = exe.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6);
for (uint32_t g = 0; g < 8; ++g) installed_league_system().below_first[g] = exe.u8(::bmh::layout::PromotionGroupBelowLeagues + g), installed_league_system().below_count[g] = exe.u8(::bmh::layout::PromotionGroupBelowCounts + g);
installed_league_system().newcomer_first = exe.u16(::bmh::layout::LeagueClubCount);
installed_league_system().newcomer_count = exe.u16(::bmh::layout::NewcomerClubCount);
// EXE strings the engine posts (messages.hpp)
install_message_texts(exe);
install_career_rules(exe);
+4 -4
View File
@@ -1004,7 +1004,7 @@ bool CareerSession::dispatch_pitch(const ui::PitchRequest& request, uint64_t& re
} else if (!validate_desk_setting_owner(identity, revision, error, false)) return false;
const size_t badge = size_t(request.runtime_club) * 2;
const int mode = g_.memory.has(::bmh::layout::GameMode) ? int(g_.memory.u8(::bmh::layout::GameMode)) : int(exe_.u8(::bmh::layout::GameMode));
if (request.runtime_club >= int(exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) || g_.lineups_frozen ||
if (request.runtime_club >= int(exe_.u16(::bmh::layout::LeagueClubCount)) || g_.lineups_frozen ||
mode < 1 || mode > 3 || g_.manager_options[size_t(request.manager_slot) * 5] > 8 ||
request.indoor != g_.indoor ||
(!live_context && (lineup_entry_manager_ != request.manager_slot ||
@@ -1018,7 +1018,7 @@ bool CareerSession::dispatch_pitch(const ui::PitchRequest& request, uint64_t& re
return false;
}
const auto selected_live_opponent = [&](int opponent) {
if (!live_context || opponent < 0 || opponent >= int(exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField))) return false;
if (!live_context || opponent < 0 || opponent >= int(exe_.u16(::bmh::layout::LeagueClubCount))) return false;
return std::any_of(live_intervention_->groups.begin(), live_intervention_->groups.end(),
[&](const MatchGroup& group) {
for (int match = 0; match < group.matches(); ++match) {
@@ -1331,13 +1331,13 @@ std::optional<int> CareerSession::prepared_lineup_opponent(int manager_slot, int
int(g_.memory.u8(::bmh::layout::ActiveManager)) != manager_slot ||
g_.manager_teams[size_t(manager_slot)] != runtime_club ||
runtime_club == kNoTeam || runtime_club < 0 ||
runtime_club >= int(exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) || g_.manager_of(runtime_club) != manager_slot ||
runtime_club >= int(exe_.u16(::bmh::layout::LeagueClubCount)) || g_.manager_of(runtime_club) != manager_slot ||
size_t(manager_slot) >= source_desk_callargs_.size())
return std::nullopt;
const ui::DeskMatchCallargs& source = source_desk_callargs_[size_t(manager_slot)];
const int opponent = source.opponent;
if (opponent < 0 || opponent == runtime_club || opponent >= int(exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) ||
if (opponent < 0 || opponent == runtime_club || opponent >= int(exe_.u16(::bmh::layout::LeagueClubCount)) ||
source.competition == 32 || source.competition == 33 || source.competition == 34)
return std::nullopt;
uint32_t competitions = day_competitions(g_, turn_driver_.calendar_entry);
+1 -1
View File
@@ -366,7 +366,7 @@ std::optional<ui::TopScorersState> CareerSession::open_top_scorers(
throw FormatError("top scorers: manager record does not own the active team");
int stable_team = team;
if (team == kNoTeam) {
// The live CupDraw_FormatError_RuntimeField3 owner is mirrored by the typed spare manager record 4.
// The live ManagerRecord4Club owner is mirrored by the typed spare manager record 4.
const size_t backup = 4 * 0xb0c + 0x290;
if (manager != 0 || backup + 2 > g_.manager_records.size())
throw FormatError("top scorers: unsupported national-coach owner");
+1 -1
View File
@@ -133,7 +133,7 @@ void Console::register_info_commands() {
if (window_ == "Fixtures" && pairings_) fixtures_action(LeaguePairingsAction::close);
std::string error;
ClubInfoEntry entry;
if (team < int(exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField))) { // league teams get the entry step (as the app does)
if (team < int(exe_.u16(::bmh::layout::LeagueClubCount))) { // league teams get the entry step (as the app does)
const auto prepared = session_->enter_club_information(team, error);
if (!prepared) fail("E_RULE", "club information: " + error);
entry = *prepared;
+10 -10
View File
@@ -231,7 +231,7 @@ inline constexpr auto CareerSession_DispatchDesktopLayout_RuntimeField = 0xa250e
inline constexpr auto CareerSession_DispatchDesktopLayout_RuntimeField2 = 0xa2517;
inline constexpr auto CareerSession_DispatchLeagueTableControl_RuntimeField = 0xa454d;
inline constexpr auto CareerSession_DispatchLeagueTableControl_RuntimeField2 = 0xbb834;
inline constexpr auto CareerSession_DispatchLineup_RuntimeField = 0xa2c30;
inline constexpr auto LeagueClubCount = 0xa2c30;
inline constexpr auto CareerSession_DispatchLiveSubstitution_ExecutableField = 0xa366c;
inline constexpr auto CareerSession_DispatchLiveTactic_RuntimeField = 0xa20eb;
inline constexpr auto CareerSession_DispatchLiveTactic_RuntimeField2 = 0xa20f3;
@@ -288,12 +288,12 @@ inline constexpr auto CareerSession_FormatNumber_ExecutableField2 = 0xa1380;
inline constexpr auto CareerSession_FormatNumber_TextPointer = 0xa137e;
inline constexpr auto CareerSession_InitializeClubModalRuntime_ExecutableField = 0xa25c0;
inline constexpr auto CareerSession_InitializeClubModalRuntime_ExecutableFieldUnsigned = 0xa25c0u;
inline constexpr auto CareerSession_InstallLeagueSizes_RuntimeField = 0xa2be9;
inline constexpr auto CareerSession_InstallLeagueSizes_RuntimeField2 = 0xa2bf2;
inline constexpr auto CareerSession_InstallLeagueSizes_RuntimeField3 = 0xa2c00;
inline constexpr auto CareerSession_InstallLeagueSizes_RuntimeField4 = 0xa2c0b;
inline constexpr auto CareerSession_InstallLeagueSizes_RuntimeField5 = 0xa2c13;
inline constexpr auto CareerSession_InstallLeagueSizes_RuntimeField6 = 0xa2c34;
inline constexpr auto LeagueEuropeanPlaces = 0xa2be9;
inline constexpr auto LeagueRelegationPlaces = 0xa2bf2;
inline constexpr auto LeagueNameSuffixes = 0xa2c00;
inline constexpr auto PromotionGroupBelowCounts = 0xa2c0b;
inline constexpr auto PromotionGroupBelowLeagues = 0xa2c13;
inline constexpr auto NewcomerClubCount = 0xa2c34;
inline constexpr auto CareerSession_Int32T_TextPointer = 0xaeffc;
inline constexpr auto CareerSession_Int32T_TextPointer2 = 0xaf21c;
inline constexpr auto CareerSession_Int32T_TextPointer3 = 0xaf228;
@@ -443,7 +443,7 @@ inline constexpr auto ClubKitSelectors = 0xbb68b;
inline constexpr auto ClubKitSelectorsUnsigned = 0xbb68bu;
inline constexpr auto ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField = 0xa25bb;
inline constexpr auto ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField2 = 0xa25bf;
inline constexpr auto ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3 = 0xa2c36;
inline constexpr auto ForeignCupClubCount = 0xa2c36;
inline constexpr auto ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField4 = 0xa364a;
inline constexpr auto ClubPlayerDetail_ClubPlayerDetailRedraw_RuntimeField = 0xa2c4e;
inline constexpr auto ClubPlayerDetail_ClubPlayerDetailRedraw_RuntimeField2 = 0xa3c9b;
@@ -572,8 +572,8 @@ inline constexpr auto CupDraw_FormatError_ExecutableField4 = 0xae6dc;
inline constexpr auto CupDraw_FormatError_ExecutableField5 = 0xae704;
inline constexpr auto CupDraw_FormatError_ExecutableField6 = 0xae70c;
inline constexpr auto CupDraw_FormatError_RuntimeField = 0xa2547;
inline constexpr auto CupDraw_FormatError_RuntimeField2 = 0xb6ea8;
inline constexpr auto CupDraw_FormatError_RuntimeField3 = 0xb9ad8;
inline constexpr auto ManagerRecord0Club = 0xb6ea8;
inline constexpr auto ManagerRecord4Club = 0xb9ad8;
inline constexpr auto CupDraw_FormatError_TextPointer = 0xa1612;
inline constexpr auto CupDraw_FormatError_TextPointer2 = 0xa1619;
inline constexpr auto CupDraw_FormatError_TextPointer3 = 0xa161e;
+3 -3
View File
@@ -30,8 +30,8 @@ struct BlockDef {
// Sizes marked with a Count depend on the master database:
// Clubs = CareerSession_DataDirectory_RuntimeField (419) Players = CareerSession_DataDirectory_RuntimeField3 (2574)
// N42 = CareerSession_DataDirectory_RuntimeField2 (168) N66 = CareerSession_DataDirectory_RuntimeField4 (3096)
// Teams = CareerSession_DispatchLineup_RuntimeField (138, teams in league play)
// TeamsPlusCups = CareerSession_DispatchLineup_RuntimeField + CareerSession_InstallLeagueSizes_RuntimeField6 (138 + 30)
// Teams = LeagueClubCount (138, teams in league play)
// TeamsPlusCups = LeagueClubCount + NewcomerClubCount (138 + 30)
constexpr BlockDef kBlocks[] = {
{::bmh::layout::Cup_AdvanceCup_RuntimeField3, false, 1, Count::None, 0, false}, {::bmh::layout::LiveMatchday_FormatError_RuntimeField14, false, 6, Count::None, 0, false},
{::bmh::layout::ManagerRecords, false, 0x373c, Count::None, 0, false}, // 5 manager records of 0xB0C bytes
@@ -110,7 +110,7 @@ constexpr BlockDef kBlocks[] = {
SaveState::SaveState(const Bytes& stream, const DbCounts& c) : stream_(stream) {
// Teams in league play and cup-only teams are not part of DbCounts yet;
// these are the V2.24 values (CareerSession_DispatchLineup_RuntimeField, CareerSession_InstallLeagueSizes_RuntimeField6).
// these are the V2.24 values (LeagueClubCount, NewcomerClubCount).
constexpr uint32_t kTeams = 138, kCupTeams = 30;
size_t pos = 0;
uint32_t last_pointer = 0;
+1 -1
View File
@@ -443,7 +443,7 @@ void national_tournament_end(GameState& g) {
if (coach) book_money(g, 0, -400000, true, true);
for (int i = 0; i < 4; i++) {
if (teams[i] == kNoTeam && coach) book_money(g, 0, -kPremium[i], true, true);
// (0x8a + 0x1e + 0xbd = 0x165: CareerSession_DispatchLineup_RuntimeField + CareerSession_InstallLeagueSizes_RuntimeField6 + ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3)
// (0x8a + 0x1e + 0xbd = 0x165: LeagueClubCount + NewcomerClubCount + ForeignCupClubCount)
if (mem.has(::bmh::layout::Placements)) mem.set8(::bmh::layout::Placements + uint32_t(i), uint8_t((teams[i] - kNoTeam) | 0x80));
}
}
+1 -1
View File
@@ -101,7 +101,7 @@ int national_opponent_manager(const GameState& g, const NationalFriendlyOwner& o
// FindManagerForClub's second lookup: spare manager record 4 represents the
// Bundestrainer's own association only for the first human national coach.
if (owner.manager == 0 && !g.manager_teams.empty() && g.manager_teams[0] == kNoTeam &&
g.memory.has(::bmh::layout::DeskActions_NationalOpponentManager_RuntimeField) && int(g.memory.u16(::bmh::layout::CupDraw_FormatError_RuntimeField3)) == opponent &&
g.memory.has(::bmh::layout::DeskActions_NationalOpponentManager_RuntimeField) && int(g.memory.u16(::bmh::layout::ManagerRecord4Club)) == opponent &&
5 * kRecordSize <= g.manager_records.size()) return 4;
return -1;
}
+1 -1
View File
@@ -86,7 +86,7 @@ HighscoreScore highscore_score(const GameState& g, int manager, HighscoreContext
HighscoreScore result;
const int team = g.manager_teams.at(size_t(manager));
if (team == kNoTeam) {
// CareerSession_DispatchLineup_RuntimeField+CareerSession_InstallLeagueSizes_RuntimeField6+ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3 == kNoTeam in the supported Original database;
// LeagueClubCount+NewcomerClubCount+ForeignCupClubCount == kNoTeam in the supported Original database;
// national honours store (team-kNoTeam)|0x80, so Germany's index is0.
for (uint32_t year = 0; year < 20; ++year)
for (uint32_t place = 0; place < 4; ++place) {
+1 -1
View File
@@ -30,7 +30,7 @@ constexpr int8_t kRegionTemperature[48] = {0, -1, 5, 0, 0, 5, 0, -1, -5, -4,
constexpr uint8_t kLeagueCrowd[10] = {27, 12, 7, 7, 3, 27, 27, 27, 27, 27};
// First league that counts as a regional league (LeaguePairings_LeaguePairingsConstants_RuntimeField).
constexpr int kFirstRegionalLeague = 5;
// Number of cup-only teams before the amateur blocks (CareerSession_InstallLeagueSizes_RuntimeField6).
// Number of cup-only teams before the amateur blocks (NewcomerClubCount).
constexpr int kCupTeams = 30;
int clamp(int v, int lo, int hi) { return v < lo ? lo : v > hi ? hi : v; }
+2 -2
View File
@@ -532,7 +532,7 @@ ForcedMatchEvent MatchEngine::event_impl(MatchGroup& g, int m, int s, int minute
int opp_team = g.fixtures.at(m * 2 + 1 - s); // MatchEngineRuntimeField11
// Small-squad teams (id >= 90) only half of the time; teams without squads never. The
// national team (0x165, squad nominated on the national team days) only while manager
// slot 0 holds it (CupDraw_FormatError_RuntimeField2 == 0x165: a Bundestrainer's match).
// slot 0 holds it (ManagerRecord0Club == 0x165: a Bundestrainer's match).
if (!(team < 90 || rand.range(0, 1) == 0)) return result;
if (!(team < world_layout().league_teams || team == kNoTeam)) return result;
if (team == kNoTeam && (state.manager_teams.empty() || state.manager_teams[0] != kNoTeam)) return result;
@@ -854,7 +854,7 @@ void MatchEngine::side(MatchGroup& g, int m, int& s, int minute, int& own_att, i
return;
}
const auto& exe = *reality_rules;
if (team < exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField) && opp_team < exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) {
if (team < exe.u16(::bmh::layout::LeagueClubCount) && opp_team < exe.u16(::bmh::layout::LeagueClubCount)) {
const int displacement = (1 - s * 2) * rand.range(21, 45);
if (live_ball && button(::bmh::layout::MatchEngine_Side_ExecutableField3) == 0)
live_ball({minute, show_group, m, displacement});
+1 -1
View File
@@ -40,7 +40,7 @@ constexpr uint8_t kCompetitionClass[24] = {0, 1, 2, 2, 2, 3, 3, 3, 3, 255, 0, 25
// (league_system().group_first / league_system().group_count: schedule.hpp, the calendar groups of the loaded game)
// Crowd interest per descriptor type (MatchdaySetupRuntimeField).
constexpr uint8_t kTypeInterest[24] = {5, 5, 10, 15, 12, 10, 5, 10, 5, 10, 5, 31, 10, 10, 10, 0, 0, 1, 0, 0, 0, 12, 0, 0};
// Number of clubs taking part in league play (CareerSession_DispatchLineup_RuntimeField).
// Number of clubs taking part in league play (LeagueClubCount).
// Squad slots checked by the driver (CareerRuntimeField).
constexpr size_t kSquadSlotCount = 0xb70;
+1 -1
View File
@@ -205,7 +205,7 @@ void national_coach_take_over(GameState& g, int active_manager, uint16_t source_
set_manager_count(g, 1);
swap_manager_slots(g, 4, 0); // SwapManagerSlots(4, 0)
uint8_t* coach = &g.manager_records.at(0);
coach[0x290] = uint8_t(kNoTeam & 0xff), coach[0x291] = uint8_t(kNoTeam >> 8); // CupDraw_FormatError_RuntimeField2 = 0x165
coach[0x290] = uint8_t(kNoTeam & 0xff), coach[0x291] = uint8_t(kNoTeam >> 8); // ManagerRecord0Club = 0x165
coach[0x218] = g.manager_records.at(4 * kManagerRecord + 0x218); // NationalRuntimeField2 = NationalRuntimeField3
g.manager_teams.at(0) = kNoTeam;
auto_lineup(g, kNoTeam, 0xe4); // Int2(0x165, 0xe4)
+1 -1
View File
@@ -54,7 +54,7 @@ void national_coach_take_over(GameState& g, int active_manager, uint16_t source_
// NationalCoachHandBack: with CoachActive set the slots change places again, the number of managers
// is restored from OriginalManagerCount and CoachActive cleared.
void national_coach_hand_back(GameState& g);
// CupDraw_FormatError_RuntimeField2 == 0x165: slot 0 manages the national team.
// ManagerRecord0Club == 0x165: slot 0 manages the national team.
bool national_coach_active(const GameState& g);
// NationalCoachAfterLoad (saving and loading): the savegame holds the slots swapped back with
// CoachActive still 1; afterwards (and so after loading) SwapManagerSlots2 takes over again.
+2 -2
View File
@@ -23,8 +23,8 @@ constexpr size_t kBoard = kTacticsBoardSize; // tactics board of a manager
constexpr size_t kBoardSlot = kTacticsBoardSlotSize; // one slot of the board
// Static league tables of V2.24 (not part of the savegame):
// (European places per league, CareerSession_InstallLeagueSizes_RuntimeField, are league_system().europe of the loaded game; league 0 uses 4)
// (the relegation places per league, CareerSession_InstallLeagueSizes_RuntimeField2, are league_system().relegation of the loaded game)
// (European places per league, LeagueEuropeanPlaces, are league_system().europe of the loaded game; league 0 uses 4)
// (the relegation places per league, LeagueRelegationPlaces, are league_system().relegation of the loaded game)
// Text of a pointer variable of the text table TextPointerTable.
} // namespace
+2 -2
View File
@@ -89,7 +89,7 @@ int team_replay_on(const GameState& g, int day, int team, int league) {
// (bit 15) when it is free (0, 0x4001 or a calendar event 0x1c0), neither it nor its two
// neighbours conflict for the club (the neighbours before it may already be marked), the
// day after it lies in 0x15 .. 0x11e and it is not in the winter break. The national team
// (manager 0 coaching team 0x165) also checks the club of the Bundestrainer, CupDraw_FormatError_RuntimeField3.
// (manager 0 coaching team 0x165) also checks the club of the Bundestrainer, ManagerRecord4Club.
std::vector<uint16_t> marked_calendar(const GameState& g, int team) {
std::vector<uint16_t> cal(kCalendarDays);
for (int d = 0; d < kCalendarDays; d++) cal[size_t(d)] = g.memory.u16(kCalendar + uint32_t(d) * 2);
@@ -102,7 +102,7 @@ std::vector<uint16_t> marked_calendar(const GameState& g, int team) {
bool ok = true;
for (int i = std::max(0, d - 1); i <= std::min(kCalendarDays - 1, d + 1); i++) {
if (day_conflict(g, team, -1, cal[size_t(i)], i)) ok = false;
if (national && day_conflict(g, int16_t(g.memory.u16(::bmh::layout::CupDraw_FormatError_RuntimeField3)), -1, cal[size_t(i)], i)) ok = false;
if (national && day_conflict(g, int16_t(g.memory.u16(::bmh::layout::ManagerRecord4Club)), -1, cal[size_t(i)], i)) ok = false;
}
if (d + 1 > kLastReplayDay || d + 1 < kFirstDayAfter) ok = false;
if (d >= kWinterBreakFirst && d <= kWinterBreakLast) ok = false;
+9 -9
View File
@@ -283,8 +283,8 @@ void observe_initial_international_groups(GameState& g, WatcomRandom& rand, int
for(const Fixture& fixture:generate_fixtures(schedule_teams,event.round+1,rounds,0)) {
for(int position:{fixture.home,fixture.away}) {
const int team=mem.u16(teams+uint32_t(position)*2);
const bool manager_national=mem.has(::bmh::layout::CupDraw_FormatError_RuntimeField2)&&mem.has(::bmh::layout::CupDraw_FormatError_RuntimeField3)&&
mem.u16(::bmh::layout::CupDraw_FormatError_RuntimeField2)==kNoTeam&&mem.u16(::bmh::layout::CupDraw_FormatError_RuntimeField3)==team;
const bool manager_national=mem.has(::bmh::layout::ManagerRecord0Club)&&mem.has(::bmh::layout::ManagerRecord4Club)&&
mem.u16(::bmh::layout::ManagerRecord0Club)==kNoTeam&&mem.u16(::bmh::layout::ManagerRecord4Club)==team;
const bool human_owned=g.manager_of(team)>=0||manager_national;
if(team<world_layout().first_foreign_cup()||team==kNoTeam||!human_owned)continue;
SeasonCupDrawEvent::GroupAverageSnapshot snapshot;
@@ -325,7 +325,7 @@ void european_setup(GameState& g, GameRandom& game, WatcomRandom& rand, const Se
constexpr uint32_t kField0 = ::bmh::layout::Field0;
if (!mem.has(kField0)) mem.add_block(kField0, 0x30);
const int s = g.season % 4;
const int base = world_layout().no_team(); // ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3 + CareerSession_DispatchLineup_RuntimeField + CareerSession_InstallLeagueSizes_RuntimeField6
const int base = world_layout().no_team(); // ForeignCupClubCount + LeagueClubCount + NewcomerClubCount
int n = 1;
std::vector<uint16_t> last;
if (s % 2 == 0) {
@@ -395,7 +395,7 @@ void european_setup(GameState& g, GameRandom& game, WatcomRandom& rand, const Se
void european_fields(GameState& g, GameRandom& game, WatcomRandom& rand) {
StaticMemory& mem = g.memory;
Entrants en{mem};
const int pool = world_layout().first_foreign_cup(); // CareerSession_DispatchLineup_RuntimeField + CareerSession_InstallLeagueSizes_RuntimeField6: the first foreign club
const int pool = world_layout().first_foreign_cup(); // LeagueClubCount + NewcomerClubCount: the first foreign club
auto pick = [&](int from) {
int t;
do t = rand.range(from, from + 6); while (en.find(t) != 0);
@@ -1359,7 +1359,7 @@ void licence_withdrawals(GameState& g, int league, std::vector<uint16_t>& down,
for (size_t m = 0; m < g.manager_teams.size(); m++) {
const int team = g.manager_teams[m];
if (team < first || team >= first + league_system().sizes[league] || ranks[team - first] <= 5) continue;
static const uint8_t kDownPlaces[kLeagueCount] = {3, 4, 2, 2, 3, 0, 0, 0, 0}; // CareerSession_InstallLeagueSizes_RuntimeField2
static const uint8_t kDownPlaces[kLeagueCount] = {3, 4, 2, 2, 3, 0, 0, 0, 0}; // LeagueRelegationPlaces
if (kDownPlaces[league] == 0) continue;
const uint8_t cut = rec8(g, int(m), 0x220);
const int32_t total = int32_t(rec8(g, int(m), 0x26f)) * 80000 + (assets(g, int(m), 0xf) - assets(g, int(m), 0x10));
@@ -1417,7 +1417,7 @@ void promotion(GameState& g, GameRandom& game, WatcomRandom& rand, MinuteReport&
const uint8_t* kBelowCount = league_system().below_count;
// The clubs that refill the lowest league: league_system().newcomer_count clubs from league_system().newcomer_first
// (German: the 30 amateur clubs 138-167). The English game draws from its 12 further
// English clubs (ClubName: range(CareerSession_DispatchLineup_RuntimeField, CareerSession_DispatchLineup_RuntimeField + 11)); its later ids have no name.
// English clubs (ClubName: range(LeagueClubCount, LeagueClubCount + 11)); its later ids have no name.
// The span ends at the last named club, which keeps the German draws unchanged.
// (OpenBMH deviates from the English original here: its extra coin flip per draw is not
// ported.)
@@ -1509,10 +1509,10 @@ void promotion(GameState& g, GameRandom& game, WatcomRandom& rand, MinuteReport&
} // namespace
// LeagueName(buf, league): the name of a league (< 5): the texts from Achievements_FormatError_TextPointer3 on - a
// league whose suffix letter (CareerSession_InstallLeagueSizes_RuntimeField3, two bytes per league) is set shares the text of
// league whose suffix letter (LeagueNameSuffixes, two bytes per league) is set shares the text of
// the one before when its letter is from 'B' on (LeagueName2) - with " " + the letter.
std::string league_name(const GameState& g, int league) {
// CareerSession_InstallLeagueSizes_RuntimeField3 of the loaded game (schedule.hpp: German A/B for the two Regionalligen,
// LeagueNameSuffixes of the loaded game (schedule.hpp: German A/B for the two Regionalligen,
// English none - its four divisions are one ladder)
const char* kSuffix = league_system().suffix;
int index = 0;
@@ -1679,7 +1679,7 @@ bool career_season_setup(GameState& g, GameRandom& game, WatcomRandom& rand, Min
}
// the title holders of the cup entries (+0x22): none yet, the placeholder clubs
const uint16_t first_small = 90; // TeamsWithSquads
const uint16_t foreign = uint16_t(world_layout().no_team()); // ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3 + CareerSession_DispatchLineup_RuntimeField + CareerSession_InstallLeagueSizes_RuntimeField6 (0x165)
const uint16_t foreign = uint16_t(world_layout().no_team()); // ForeignCupClubCount + LeagueClubCount + NewcomerClubCount (0x165)
mem.set16(::bmh::layout::Season_CareerSeasonSetup_RuntimeField2, foreign);
mem.set16(::bmh::layout::Season_CareerSeasonSetup_RuntimeField6, uint16_t(first_small + 7));
mem.set16(::bmh::layout::Season_CareerSeasonSetup_RuntimeField, 7);
+1 -1
View File
@@ -15,7 +15,7 @@ namespace bmh {
SportschauRatingTables sportschau_rating_tables(const LeImage& exe) {
SportschauRatingTables t;
t.domestic_teams = exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField);
t.domestic_teams = exe.u16(::bmh::layout::LeagueClubCount);
for (size_t i = 0; i < 4; ++i) {
const auto offset = uint32_t(i);
t.position_limit[i] = std::bit_cast<int8_t>(exe.u8(::bmh::layout::SportschauRating_SportschauRatingTables_RuntimeField + offset));
+1 -1
View File
@@ -53,7 +53,7 @@ struct GameState {
// Block Formations = contents of M3.DAT: formation tables, 2 sets (outdoor, indoor) of
// 0xB0 bytes = 8 formations x (11 x positions, 11 y positions). The engine uses 4.
std::vector<uint8_t> formations;
// Team id managed by each human manager (manager record +0x290, CupDraw_FormatError_RuntimeField2), one entry
// Team id managed by each human manager (manager record +0x290, ManagerRecord0Club), one entry
// per human manager (ManagerCount).
std::vector<int> manager_teams;
bool indoor = false; // OpenBMH deviates from the original: retains designated set-piece selections in the supported manager-record extension.
+1 -1
View File
@@ -2710,7 +2710,7 @@ void transfer_list_countdown(GameState& g, GameRandom& game, WatcomRandom& rand,
// club as owner 4 while manager 0 runs the national team.
return g.manager_of(club) >= 0 || (!g.manager_teams.empty() &&
g.manager_teams[0] == kNoTeam && mem.has(::bmh::layout::DeskActions_NationalOpponentManager_RuntimeField) &&
int(mem.u16(::bmh::layout::CupDraw_FormatError_RuntimeField3)) == club);
int(mem.u16(::bmh::layout::ManagerRecord4Club)) == club);
};
bool human_involved = human_participant(seller);
for (int bid = 0; bid < 4 && !human_involved; ++bid) {
+5 -5
View File
@@ -86,19 +86,19 @@ struct LeagueSystem {
uint8_t calendar_bit[kLeagueCount] = {0, 1, 2, 2, 3, 4, 4, 4, 4};
// The promotion ladder (Void / English ClubName):
// - relegation[league]: relegation places (CareerSession_InstallLeagueSizes_RuntimeField2; German 3 4 2 2 3,
// - relegation[league]: relegation places (LeagueRelegationPlaces; German 3 4 2 2 3,
// English 4 4 4 4 4),
// - below_first[group] .. + below_count[group] - 1: the league(s) a promotion group takes its promoted
// clubs from (CareerSession_InstallLeagueSizes_RuntimeField5 / CareerSession_InstallLeagueSizes_RuntimeField4;
// clubs from (PromotionGroupBelowLeagues / PromotionGroupBelowCounts;
// German 1 | 2 | 4 with the two Regionalligen in one group, English 1 | 2 | 3),
// - suffix[league]: the letter after a league's name (CareerSession_InstallLeagueSizes_RuntimeField3, two
// - suffix[league]: the letter after a league's name (LeagueNameSuffixes, two
// bytes per league; German A/B for the Regionalligen, English none),
// - newcomer_first / newcomer_count: the clubs the lowest league is refilled from
// (CareerSession_DispatchLineup_RuntimeField / CareerSession_InstallLeagueSizes_RuntimeField6; German the 30
// (LeagueClubCount / NewcomerClubCount; German the 30
// amateur clubs 138-167; the English game draws from its 12 further English clubs 138-149 - its later
// ids have no name - so the session counts only named clubs).
uint8_t relegation[kLeagueCount] = {3, 4, 2, 2, 3, 0, 0, 0, 0};
// European places per league for the table prediction (CareerSession_InstallLeagueSizes_RuntimeField;
// European places per league for the table prediction (LeagueEuropeanPlaces;
// German 0 3 2 2 4 - league 0 uses 4 in the prediction -, English 0 4 4 4 4)
uint8_t europe[kLeagueCount] = {0, 3, 2, 2, 4, 0, 0, 0, 0};
uint8_t below_first[8] = {1, 2, 4, 5, 6, 7, 8, 0};
+6 -6
View File
@@ -159,10 +159,10 @@
{::bmh::layout::CareerSession_BeginFriendlyOpponentTable_RuntimeField, 9, Kind::copy, ::bmh::layout::EnglishLayoutTranslation257, {}},
{::bmh::layout::LeagueSizes, 1, Kind::copy, ::bmh::layout::EnglishLayoutTranslation258, {}},
{::bmh::layout::LeaguePairings_LeaguePairingsConstants_RuntimeField, 3, Kind::copy, ::bmh::layout::EnglishLayoutTranslation259, {}},
{::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField, 9, Kind::copy, ::bmh::layout::EnglishLayoutTranslation260, {}},
{::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField2, 9, Kind::copy, ::bmh::layout::EnglishLayoutTranslation261, {}},
{::bmh::layout::LeagueEuropeanPlaces, 9, Kind::copy, ::bmh::layout::EnglishLayoutTranslation260, {}},
{::bmh::layout::LeagueRelegationPlaces, 9, Kind::copy, ::bmh::layout::EnglishLayoutTranslation261, {}},
{::bmh::layout::DeskDrawers_Curve_RuntimeField, 5, Kind::copy, ::bmh::layout::EnglishLayoutTranslation262, {}},
{::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField3, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation264, {}},
{::bmh::layout::LeagueNameSuffixes, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation264, {}},
{::bmh::layout::Manager_FormatError_RuntimeField, 8, Kind::copy, ::bmh::layout::EnglishLayoutTranslation263, {}},
{::bmh::layout::CalendarLeagueCounts, 1, Kind::copy, ::bmh::layout::EnglishLayoutTranslation265, {}},
{::bmh::layout::LeaguePairings_SelectorEvent_RuntimeField, 4, Kind::copy, ::bmh::layout::EnglishLayoutTranslation266, {}},
@@ -171,9 +171,9 @@
{::bmh::layout::GermanLayoutTranslation2, 8, Kind::copy, ::bmh::layout::EnglishLayoutTranslation269, {}},
{::bmh::layout::GermanLayoutTranslation3, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation270, {}},
{::bmh::layout::TeamsWithSquads, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation271, {}},
{::bmh::layout::CareerSession_DispatchLineup_RuntimeField, 4, Kind::copy, ::bmh::layout::EnglishLayoutTranslation272, {}},
{::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation273, {}},
{::bmh::layout::ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation274, {}},
{::bmh::layout::LeagueClubCount, 4, Kind::copy, ::bmh::layout::EnglishLayoutTranslation272, {}},
{::bmh::layout::NewcomerClubCount, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation273, {}},
{::bmh::layout::ForeignCupClubCount, 2, Kind::copy, ::bmh::layout::EnglishLayoutTranslation274, {}},
{::bmh::layout::NoTeamSquadStart, 6, Kind::copy, ::bmh::layout::EnglishLayoutTranslation275, {}},
{::bmh::layout::CareerSession_DataDirectory_RuntimeField, 4, Kind::copy, ::bmh::layout::EnglishLayoutTranslation276, {}},
{::bmh::layout::CareerSession_DataDirectory_RuntimeField2, 12, Kind::copy, ::bmh::layout::EnglishLayoutTranslation277, {}},
+2 -2
View File
@@ -65,8 +65,8 @@ ClubInfoProjection club_info_from_game(const GameState& g, int team,
out.original_club_name = g.club_name(team);
out.gradient_text = g.memory.u8(::bmh::layout::TextGradientDisabled) == 0 && exe.u8(::bmh::layout::TextGradientMode) == 2;
out.decorated_background = g.memory.u8(::bmh::layout::PlainBackground) == 0;
out.has_squad = team == kNoTeam || team < exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField);
if (team != kNoTeam && team >= exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) {
out.has_squad = team == kNoTeam || team < exe.u16(::bmh::layout::LeagueClubCount);
if (team != kNoTeam && team >= exe.u16(::bmh::layout::LeagueClubCount)) {
out.has_squad = false;
out.category = team >= 0 && size_t(team) < g.team_morale.size()
? uint8_t((g.team_morale[size_t(team)] >> 6) & 3) : 0;
+1 -1
View File
@@ -46,7 +46,7 @@ ClubPlayerDetailProjection club_player_detail_from_game(const GameState& g,
ClubPlayerDetailProjection p;p.redraw=std::move(redraw);
const auto& c=p.redraw.context;
const int nation=c.attributes.nationality()+((c.bonus&0x80)?32:0);
p.original_nationality_name=g.club_name(exe.u16(::bmh::layout::ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3)+exe.u16(::bmh::layout::NoTeamSquadStart)+nation);
p.original_nationality_name=g.club_name(exe.u16(::bmh::layout::ForeignCupClubCount)+exe.u16(::bmh::layout::NoTeamSquadStart)+nation);
for(int i=0;i<2;++i){
const int id=i?c.secondary_club:c.primary_club;if(id<0||id==0xffff)continue;
ClubPlayerDetailClub club;club.runtime_team=id;club.original_full_name=g.club_name(id);club.original_short_name=club.original_full_name;
+1 -1
View File
@@ -144,7 +144,7 @@ CupDrawProjection cup_draw_from_game(const GameState& game,const SeasonCupDrawEv
std::string context;
if(event.group_stage&&event.phase==SeasonCupDrawPhase::overview) {
const bool human_national=game.manager_of(id)>=0||
(game.memory.has(::bmh::layout::CupDraw_FormatError_RuntimeField2)&&game.memory.has(::bmh::layout::CupDraw_FormatError_RuntimeField3)&&game.memory.u16(::bmh::layout::CupDraw_FormatError_RuntimeField2)==kNoTeam&&game.memory.u16(::bmh::layout::CupDraw_FormatError_RuntimeField3)==id);
(game.memory.has(::bmh::layout::ManagerRecord0Club)&&game.memory.has(::bmh::layout::ManagerRecord4Club)&&game.memory.u16(::bmh::layout::ManagerRecord0Club)==kNoTeam&&game.memory.u16(::bmh::layout::ManagerRecord4Club)==id);
if(id>=world_layout().first_foreign_cup()&&!human_national) {
if(size_t(id-168)>=game.foreign_strength.size())throw FormatError("cup draw: missing Source foreign-strength byte");
const uint8_t strength=game.foreign_strength[size_t(id-168)];
+2 -2
View File
@@ -150,8 +150,8 @@ void DeskDrawerRenderer::curve(Image& target, const DeskState& state, const Desk
}
const uint32_t league = uint32_t(curve->league);
const int teams = exe_.u8(::bmh::layout::LeagueSizes + league);
const int low_cut = exe_.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField + league) + exe_.u8(::bmh::layout::DeskDrawers_Curve_RuntimeField + league);
const int high_cut = teams - exe_.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField2 + league);
const int low_cut = exe_.u8(::bmh::layout::LeagueEuropeanPlaces + league) + exe_.u8(::bmh::layout::DeskDrawers_Curve_RuntimeField + league);
const int high_cut = teams - exe_.u8(::bmh::layout::LeagueRelegationPlaces + league);
const int left = item.x + 5, top = item.y + 1, bottom = top + 42;
line(target, left, top, left, bottom, 0x6a);
line(target, left, bottom, left + 80, bottom, 0x6a);
+2 -2
View File
@@ -127,7 +127,7 @@ void project_drawer_rows(DeskState& d, const LeImage& exe, const Bytes& managers
}
void project_table_position(DeskState& desk, const GameState& game) {
// SourceDrawerTeam permits league clubs and CupDraw_FormatError_RuntimeField2 (the Source 0x165
// SourceDrawerTeam permits league clubs and ManagerRecord0Club (the Source 0x165
// national-team slot) through its rank/strength path.
const int position = table_position(game, desk.runtime_club);
if (position >= 0) desk.table_position = position;
@@ -311,7 +311,7 @@ DeskState project(const StaticMemory& memory, const Tables& t, const LeImage& ex
uint8_t remaining = 18;
for (size_t kind = 6; kind < 13; ++kind) remaining = uint8_t(remaining - t.managers.at(base + 0xc5 + kind));
d.warnings[3] = remaining < 4;
const int max24 = exe.u16(::bmh::layout::TeamsWithSquads), league_teams = exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField);
const int max24 = exe.u16(::bmh::layout::TeamsWithSquads), league_teams = exe.u16(::bmh::layout::LeagueClubCount);
if (!d.national_team && d.runtime_club >= league_teams) throw FormatError("desk: cup-only squad projection not supported");
const size_t first = d.national_team ? 3072 : size_t(d.runtime_club < max24 ? d.runtime_club * 24 : d.runtime_club * 16 + max24 * 8);
const size_t count = d.national_team ? 24 : (d.runtime_club < max24 ? 24 : 16);
+1 -1
View File
@@ -42,7 +42,7 @@ std::string original_league_title(const GameState& game, const LeImage& exe, int
for (int previous = 0; previous < league; ++previous)
if (exe.u8(::bmh::layout::Manager_FormatError_RuntimeField + uint32_t(previous) * 2) < 'B') ++text;
std::string name = (*game.texts)[text];
const uint8_t suffix = exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField3 + uint32_t(league) * 2);
const uint8_t suffix = exe.u8(::bmh::layout::LeagueNameSuffixes + uint32_t(league) * 2);
if (suffix != 0) {
std::string tail = (*game.texts)[size_t((::bmh::layout::Manager_FormatError_TextPointer2 - ::bmh::layout::TextPointerTable) / 4)];
check(!tail.empty(), "Original TEXTD league suffix template is present");
+1 -1
View File
@@ -42,7 +42,7 @@ LineupState project(const StaticMemory& memory, const LeImage& exe, const std::v
if (out.manager_slot < 0 || out.manager_slot > 3 || size_t(out.manager_slot) >= teams.size())
throw FormatError("lineup: unsupported active manager");
out.runtime_club = teams.at(out.manager_slot);
const int split = exe.u16(::bmh::layout::TeamsWithSquads), limit = exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField);
const int split = exe.u16(::bmh::layout::TeamsWithSquads), limit = exe.u16(::bmh::layout::LeagueClubCount);
const bool national = out.runtime_club == kNoTeam && out.manager_slot == 0 && teams.size() == 1 &&
((memory.u32(::bmh::layout::CompetitionSelection) & 2) != 0 ||
(memory.has(::bmh::layout::CoachActive) && memory.u8(::bmh::layout::CoachActive) != 0));
+4 -4
View File
@@ -81,7 +81,7 @@ ManagerScreen::ManagerScreen(const std::filesystem::path& data, int slot, const
context_.club_order.resize(db_.club_names.size());
std::iota(context_.club_order.begin(), context_.club_order.end(), 0);
}
if (context_.club_order.size() < size_t(exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)) + exe_.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6))
if (context_.club_order.size() < size_t(exe_.u16(::bmh::layout::LeagueClubCount)) + exe_.u16(::bmh::layout::NewcomerClubCount))
throw FormatError("manager selection: club order does not cover all selectable groups");
std::set<int> unique;
for (int id : context_.club_order)
@@ -106,7 +106,7 @@ ManagerScreen::ManagerScreen(const std::filesystem::path& data, int slot, const
first_[i] = start; last_[i] = start + exe_.u8(::bmh::layout::LeagueSizes + i) - 1;
start = last_[i] + 1;
leagues_[i] = texts_[text_id];
if (auto suffix = exe_.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField3 + i * 2)) {
if (auto suffix = exe_.u8(::bmh::layout::LeagueNameSuffixes + i * 2)) {
auto tail = texts_[(::bmh::layout::Manager_FormatError_TextPointer2 - ::bmh::layout::TextPointerTable) / 4];
if (tail.empty()) throw FormatError("manager: missing league suffix");
tail.back() = char(suffix); leagues_[i] += tail;
@@ -115,8 +115,8 @@ ManagerScreen::ManagerScreen(const std::filesystem::path& data, int slot, const
if (last_[i] - first_[i] >= 20) throw FormatError("manager: league exceeds picker grid");
}
for(int i=player_league_count(exe_);i<5;++i){last_[i]=first_[i]-1;leagues_[i].clear();}
first_[5] = exe_.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField); last_[5] = first_[5] + 19;
first_[6] = first_[5] + 20; last_[6] = first_[5] + exe_.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6) - 1;
first_[5] = exe_.u16(::bmh::layout::LeagueClubCount); last_[5] = first_[5] + 19;
first_[6] = first_[5] + 20; last_[6] = first_[5] + exe_.u16(::bmh::layout::NewcomerClubCount) - 1;
leagues_[5] = texts_[(::bmh::layout::Manager_FormatError_TextPointer - ::bmh::layout::TextPointerTable) / 4]; leagues_[6] = leagues_[5];
if (leagues_[6].empty()) throw FormatError("manager: missing extra-team label");
leagues_[6].back() = 'B';
+1 -1
View File
@@ -46,7 +46,7 @@ std::string title_oracle(const GameState& game, const LeImage& exe, int league)
for (int previous = 0; previous < league; ++previous)
if (exe.u8(::bmh::layout::Manager_FormatError_RuntimeField + uint32_t(previous) * 2) < 'B') ++slot;
std::string title = game.texts->strings.at(slot);
if (const auto suffix = exe.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField3 + uint32_t(league) * 2)) {
if (const auto suffix = exe.u8(::bmh::layout::LeagueNameSuffixes + uint32_t(league) * 2)) {
std::string tail = game.texts->strings.at((::bmh::layout::Manager_FormatError_TextPointer2 - ::bmh::layout::TextPointerTable) / 4);
tail.back() = char(suffix);
title += tail;
+1 -1
View File
@@ -178,7 +178,7 @@ uint8_t source_country(const LeImage& exe, int team) {
return 0;
}
}
const int remainder = remaining - int16_t(exe.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6));
const int remainder = remaining - int16_t(exe.u16(::bmh::layout::NewcomerClubCount));
if (remainder >= 0) return uint8_t(remainder / 7 - domestic_cutoff + 10);
return 0;
}
+1 -1
View File
@@ -67,7 +67,7 @@ PitchExtras extras(const StaticMemory& memory,const Bytes& managers,const Bytes&
const bool national=e.runtime_club==kNoTeam&&e.manager_slot==0&&count==1&&
((memory.u32(::bmh::layout::CompetitionSelection)&2)!=0||
(memory.has(::bmh::layout::CoachActive)&&memory.u8(::bmh::layout::CoachActive)!=0));
if(e.runtime_club<0||(e.runtime_club>=exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField)&&!national))
if(e.runtime_club<0||(e.runtime_club>=exe.u16(::bmh::layout::LeagueClubCount)&&!national))
throw FormatError("pitch: unsupported club");
const size_t m=size_t(e.manager_slot)*0xb0c,f=size_t(e.manager_slot)*0x160;
if(managers.size()<m+0xb0c||formations.size()<f+0x160||
+1 -1
View File
@@ -50,7 +50,7 @@ PlayerCardState project(LineupState lineup,const LeImage& exe,int row,const Byte
const auto& p=out.lineup.players.at(size_t(row));
out.badge=le16(club_heap,size_t(out.lineup.runtime_club)*2)&511;
const int nation=p.attributes.nationality()+((p.bonus&0x80)?32:0);
const size_t nation_club=exe.u16(::bmh::layout::ClubPlayerDetail_ClubPlayerDetailFromGame_RuntimeField3)+exe.u16(::bmh::layout::NoTeamSquadStart)+nation;
const size_t nation_club=exe.u16(::bmh::layout::ForeignCupClubCount)+exe.u16(::bmh::layout::NoTeamSquadStart)+nation;
out.nationality_name=pool_name(names,offsets.at(nation_club));
if (out.lineup.runtime_club == kNoTeam) {
// The national runtime slot is absent from the ordinary short-name
+4 -4
View File
@@ -89,8 +89,8 @@ TeamStatisticsProjection team_statistics_from_game(const GameState& game, int te
if (league >= league_gate) out.flag_index = uint8_t(league - league_gate + 1);
break;
}
if (league == 8 && region_team >= int(exe.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6)))
out.flag_index = uint8_t((region_team - int(exe.u16(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField6))) / 7 - league_gate + 10);
if (league == 8 && region_team >= int(exe.u16(::bmh::layout::NewcomerClubCount)))
out.flag_index = uint8_t((region_team - int(exe.u16(::bmh::layout::NewcomerClubCount))) / 7 - league_gate + 10);
}
}
out.source_has_league_panel = team < world_layout().first_foreign_cup();
@@ -426,9 +426,9 @@ Image TeamStatisticsScreen::render() const {
uint16_t(projection_.position_history[word_index + 1]) << 8);
const int rank_value = (packed >> (5 * (round % 3))) & 0x1f;
int kind = 1;
if (rank_value < int(exe_.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField + league)) + int(exe_.u8(::bmh::layout::DeskDrawers_Curve_RuntimeField + league)) ||
if (rank_value < int(exe_.u8(::bmh::layout::LeagueEuropeanPlaces + league)) + int(exe_.u8(::bmh::layout::DeskDrawers_Curve_RuntimeField + league)) ||
(rank_value == 0 && league == 0)) kind = 0;
if (int(exe_.u8(::bmh::layout::LeagueSizes + league)) - int(exe_.u8(::bmh::layout::CareerSession_InstallLeagueSizes_RuntimeField2 + league)) <= rank_value) kind = 2;
if (int(exe_.u8(::bmh::layout::LeagueSizes + league)) - int(exe_.u8(::bmh::layout::LeagueRelegationPlaces + league)) <= rank_value) kind = 2;
for (int series = 0; series < 2; ++series) {
const int x = 226 + round * 2 + series;
if (x >= 306) continue;
+1 -1
View File
@@ -59,7 +59,7 @@ TrainingState project(const StaticMemory& memory, const Bytes& records, const By
if (manager_count < 1 || manager_count > 4 || s.manager_slot >= manager_count || teams.size() != size_t(manager_count))
throw FormatError("training: inconsistent active manager");
s.runtime_club = teams.at(s.manager_slot);
const int max24 = exe.u16(::bmh::layout::TeamsWithSquads), max16 = exe.u16(::bmh::layout::CareerSession_DispatchLineup_RuntimeField);
const int max24 = exe.u16(::bmh::layout::TeamsWithSquads), max16 = exe.u16(::bmh::layout::LeagueClubCount);
if (s.runtime_club < 0 || s.runtime_club >= max16) throw FormatError("training: national/cup-only squad unsupported");
s.squad_capacity = s.runtime_club < max24 ? 24 : 16;
const size_t first = size_t(s.runtime_club < max24 ? s.runtime_club * 24 : s.runtime_club * 16 + max24 * 8);
+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,