Compare commits

..
178 Commits
Author SHA1 Message Date
ClaudeandClaude Sonnet 5.5 1ddce1dcc8 League table: show club names in full like the original
Prepare verified release / draft (push) Waiting to run
The name column was clipped at 78 pixels (about 17 characters). The real 3.7
shows 19 character names completely and the games column covers the overlap.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 20:28:44 +01:00
ClaudeandClaude Sonnet 5.5 748eb4df01 Transfer market: no status text in the footer (the original shows only the club name)
The footer replaced the club name by feedback texts; the original has no
such line. The text stays in state_json(), it is just not drawn.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 14:03:44 +01:00
ClaudeandClaude Sonnet 5.5 4c099a93b3 Start menu pressed +/-: 36x36 picture, drawn +2/+2 on the plain background
Compared pixel for pixel with the recording of the real game: the pressed
picture in the bottom rows of KB/20.VGA is 36x36 (minus x 0, plus x 36), not
38x38 at x 0/38, and it is drawn two pixels right/down of the raised button
over the clean background. Raised and pressed now match the recording except
for the mouse cursor.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 10:36:00 +01:00
ClaudeandClaude Sonnet 5.5 a426b209bf Final figures of the measurement against Diamond 3.7: 73 turns, season end, indoor tournament
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 06:52:28 +01:00
ClaudeandClaude Sonnet 5.5 bd3f11216a Extend the measurement against Diamond 3.7 to a season end and the second season
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-09 03:46:25 +01:00
ClaudeandClaude Sonnet 5.5 6e4c6f17c8 Verkaufen on an own listing chosen in the market list asks whether the player leaves the list
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 22:23:25 +01:00
ClaudeandClaude Sonnet 5.5 68f56f3d51 Document the measurement of the weekly processing and the month change against Diamond 3.7
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 22:05:44 +01:00
ClaudeandClaude Sonnet 5.5 e65bd27375 Minus and plus of the start menu show the original pressed picture
The buttons of the game setup (and of the joining manager's setup) use the darker
picture from the bottom of the setup atlas while the mouse button is held, as in a
recording of the real game; the release redraws even when the value is at its limit.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 20:09:07 +01:00
ClaudeandClaude Sonnet 5.5 09fcd8383f Prepare release 1.0.12
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:22:56 +01:00
ClaudeandClaude Sonnet 5.5 cafd6c1573 Share the calculator window and the dialog frame between the dialogs
The calculator panel and its keys (bank, offer editor, advertising, contracts, stadium,
balance plan, alternate game end) and the window frame (ten dialogs) are drawn by
ui/calculator_widgets.hpp and ui/dialog_frame.hpp; a test compares them with the former
drawings. The calculator keys of bank, offer editor, advertising and contracts now show
the pressed look while the mouse button is held.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:17:55 +01:00
ClaudeandClaude Sonnet 5.5 5b845fbab3 Share the drawing of the wide push button between the dialogs
Transfer market, pitch, lineup, bank, offer editor, advertising, manager, player card,
player detail, club info, league pairings, other games, top scorers, stadium,
training, game end and the contract tabs drew the same button frame with their own
copies. They now call draw_wide_button_frame (ui/button_frame.hpp), which a test
compares pixel for pixel with the former drawing. Buttons whose drawing differs by a
pixel (statistics rankings, team statistics, opportunities, analytics) are left alone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 19:04:28 +01:00
ClaudeandClaude Sonnet 5.5 23201fa637 The confirmation of a transfer decision shows OK pressed while held
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:54:57 +01:00
ClaudeandClaude Sonnet 5.5 551d564efb More buttons without a lasting state look pressed while held
Advertising offers and notices, the player card, the training camp booking and
notice, the file dialog (page button, overwrite question) and the bank notices
and credit fee question now draw the pressed look from the mouse press until
the release. Manager notices share source_dialog_button_at for their OK/Ja/Nein.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 18:36:48 +01:00
ClaudeandClaude Sonnet 5.5 b6bc17a381 Team premiums and the manager confirmation show pressed buttons
The back, send and switch buttons below the contract offer and team premium
panels and JA/NEIN of the manager confirmation are drawn pressed while the
mouse button is held, using the shared frame of ui/button_frame.hpp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 17:49:57 +01:00
ClaudeandClaude Sonnet 5.5 fb72de3895 Buttons without a lasting state look pressed while the mouse button is held
Bank (stocks, property, savings, credit), the offer editor footer, the lineup
bottom buttons and the pitch page buttons Daten and Kurz are drawn in the
pressed look from the mouse press until the release, like the friendly match
question. The frame drawing is shared in ui/button_frame.hpp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 17:28:40 +01:00
ClaudeandClaude Sonnet 5.5 f1f5fa523c A game needs the executable or openbmh.dat, the executable wins
Assets with openbmh.dat are a complete game; without that file the launcher asks
for BMH.EXE (FLTD.EXE) as before. With both present the executable is used.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 15:26:42 +01:00
ClaudeandClaude Sonnet 5.5 32b08e3799 Prepare release 1.0.11
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 15:02:51 +01:00
ClaudeandClaude Sonnet 5.5 20f5e4eb28 Package test knows openbmh.dat; week_check reports the distance of late day snapshots
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:43:15 +01:00
ClaudeandClaude Sonnet 5.5 9e593f921f Move the game texts out of the source into openbmh.dat
The numbers of the Diamond 3.7 executable and of Football Limited stay built in,
the game texts go into data/openbmh.dat, which the release ships next to the
programs (found in OPENBMH_DAT, the game folder, the program folder, the current
folder). Without the file those texts are empty. A replay of a recorded session
gives the same output as with the real BMH.exe when the file is there, and differs
only in the seven text lines when it is missing. week_check no longer counts its
probe re-rating of the team as draws of the port (the apparent deviation from
minute 10 of the DOSBox recording was this measuring error).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:32:27 +01:00
ClaudeandClaude Sonnet 5.5 524b9e4158 Run from the asset files alone: built-in numbers and texts for BMH and FLTD
The game no longer needs BMH.EXE or FLTD.EXE. The numbers and the game texts of
the Diamond 3.7 executable and of the English Football Limited are generated into
formats/diamond_constants.inc and formats/fltd_constants.inc (tools/diamond_constants).
A missing BMH.exe loads the embedded German image, an English installation without
FLTD.EXE gets the embedded English image; an executable that is present is used as
before. The default manager name is OpenBMH. The launcher accepts directories and
archives that hold only the asset files. Replays of a recorded session give identical
output with and without BMH.EXE, and the English image equals the translated one.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 14:04:34 +01:00
ClaudeandClaude Sonnet 5.5 6aa7c4f4a2 Ask whether to take a listed player off the market when selling him
VERKAUFEN on a player who stands on the transfer list only showed a message
when no offer had arrived yet. The original first asks whether the player
should be taken off the transfer market: yes frees the list slot (the player
stays in the squad), no continues to the offers. Controller and UI tests cover
both answers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 12:57:27 +01:00
ClaudeandClaude Sonnet 5.5 adcaa9b569 Keep vendored miniz byte-exact and complete
The source package verifies the pinned archive hashes, so the vendored files
must not be line-ending converted, and ChangeLog.md/readme.md are included.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 11:33:28 +01:00
ClaudeandClaude Sonnet 5.5 000ee20238 Fix order of the vendored miniz variable in CMakeLists
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 11:20:50 +01:00
ClaudeandClaude Sonnet 5.5 d2c5fade43 Vendor miniz 3.0.2 instead of downloading it
The release asset download returned HTTP 504 for hours and blocked the Windows
build. miniz (MIT) is two source files, so it now lives in third_party/miniz and
the public-tree check skips that unmodified third-party directory.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 11:19:02 +01:00
ClaudeandClaude Sonnet 5.5 e01ac929ac Release notes 1.0.10: pressed buttons, scouting message, poaching notice
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:29:55 +01:00
ClaudeandClaude Sonnet 5.5 9286428a5a Remove an executable address from a comment (public tree check)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:16:25 +01:00
ClaudeandClaude Sonnet 5.5 fbb2ab66b0 Transfer market review fixes: pressed buttons, scouting message, poaching agreement notice, visible refusal reasons
- The notice dialog refused Source notices it did not know, which silently refused the whole action: the agreement of a
  poached player ("Ihr erstes Angebot wird angenommen!") made the Angebot button of the Abwerben dialog fail, and the new
  search boxes never appeared. Both text families are known now; the test turns every notice of the transfer routes into
  its dialog like the graphical client does.
- Suchen/Vorschlag/Abwerben and the other market buttons are drawn pressed while the mouse button is held.
- Confirming the search dialog first reports "Ihre Scouting-Abteilung ..." (text 0xAF25C) as in the original, then the matches.
- A refused transfer or offer action shows its reason, writes it to stderr and the debug log.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 10:10:42 +01:00
ClaudeandClaude Sonnet 5.5 65df52ae2c Prepare Classic 1.0.10 release
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 08:25:58 +01:00
ClaudeandClaude Sonnet 5.5 0a95dbcba6 Transfer market: the search dialog behind Suchen and Vorschlag; asking fee display follows Diamond 3.7
TransferMarketScreen gets the dialog of the original (KB/69.VGA panel at 184,20, seven bar rows from the
EXE table, click rules of sub_19409, confirm button, price estimate). Suchen opens it with the stored
profile, Vorschlag with the suggestion the squad asks for (computed in the projection). Closing posts a
store_search_profile request; the controller stores it and announces the matching listings through the
notice presenter, like the original's message boxes. Right button or Esc leaves with the search switched
off. Controller test drives the whole route.

The market list showed the asking fee scaled by 0x30d4 (older Diamond); 3.7 rounds to 10000
(sub_3C940), now also in the projection. Four tests computed the old base and follow.

Fixes #79

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 22:04:33 +01:00
ClaudeandClaude Sonnet 5.5 933567232e Test the GUI route of the offer review and of relisting a player after a declined listing
Two controller tests: an own listing with a bid is reviewed from the roster, the offers reach the
presenter and accepting sells the player; a listing that expires with a declined offer leaves the
list and the player can be listed again from the roster. Both pass; the reported "cannot review
offers / cannot list again" could not be reproduced on this route. app_controller_tests gets a
--market-only switch.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 21:44:02 +01:00
ClaudeandClaude Sonnet 5.5 b2484350d9 Search profile: session API and console commands (ShowSearchProfile, SuggestSearchProfile, SetSearchProfile)
CareerSession gets search_profile, suggest_search_profile and dispatch_search_profile (owner and
modal-state checks, revision only when the stored profile changed). The console replaces the
OpenSearch placeholder with three commands and documents them; with apply the matching listings
are reported with the original's "Spieler ... ist interessant!" message. search_profile_valid
separates a refused profile from a switched-off one.

Part of #79 (the dialog in the graphical client is still open)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 21:35:02 +01:00
ClaudeandClaude Sonnet 5.5 ff4ad035a7 Search profile engine: closing rule, "Vorschlag" and matching shared with the market news
New game/search_profile.* holds the 18-byte search profile of a human manager (manager record
+0x1f6): the dialog's closing rule, the suggestion generated from the squad (original sub_18F06),
the position strengths (sub_19A38) and the listing match (sub_190B5). search_profile_news in
month.cpp now uses the same matching rule. Compared with the Diamond 3.7 routines in the
emulator harness on 10 savegames (306 runs, 406 matched listings, no difference; a deliberately
changed profile is detected).

Part of #79 (the dialog in the graphical client and the console commands follow)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 21:26:11 +01:00
ClaudeandClaude Sonnet 5.5 e9ba514a65 Graphical client: answer the poaching yes/no questions (ANGEBOT in the Abwerben dialog)
The engine asks the selling manager and the buyer a yes/no question when a poaching offer
is decided (hooks.confirm). The graphical client only supplied the notice presenter, so the
engine refused the offer, the controller swallowed the reason and the ANGEBOT button appeared
to do nothing. The client now shows the question with the existing yes/no dialog.

Fixes #80

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 21:22:00 +01:00
ClaudeandClaude Sonnet 5.5 93ca832c71 Hold back live chance statistics until the result of the chance
Prepare verified release / draft (push) Waiting to run
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 15:09:38 +01:00
ClaudeandClaude Sonnet 5.5 09b92c9b2a Prepare Classic 1.0.9 release
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 15:04:53 +01:00
ClaudeandClaude Sonnet 5.5 78118a6333 Youth academy follows Diamond 3.7 and recycles an older player
Strength of the new player is the youth-team strength setting, the academy is
skipped when the squad's youth average is more than 25 above it, up to two rounds
need W(0, 3) == 0, and the retirement/retire rules use the 3.7 slot range. The
age test was inverted: only a player older than the roll W(t, t + 3) is recycled
(found by comparing with the 3.7 programme in an emulator, 192 runs on whole
savegames, no difference). Removes the old strength-band deviation entries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 16:53:17 +01:00
ClaudeandClaude Sonnet 5.5 73ffd23dcb Facility values, per-visitor income and season-ticket price follow Diamond 3.7
kFacilityValue (entries 1, 2, 5), the per-visitor facility income table and the
season-ticket price of the first division. Checked against the 3.7 programme in
an emulator on whole savegames: weekly statistics now match without difference.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 15:49:59 +01:00
ClaudeandClaude Sonnet 5.5 96d52202fc Economy, weekly processing and side ratings follow Diamond 3.7
Credit limit 8 million, fee base 10000 per 10000 of value, DFB fee 150 %,
championship bonus 700000, club-popularity premiums 400000/850000/1000000/850000,
periphery prices, advertising base 0x87, start capital step 3 million, the
broke limit -4 million, the training-injury chance, retirement after an injury
of more than 20 matchdays (1 in 40), the contract-talk limit and the side
rhythm (human: no balance term, computers: at least 48). Values read from the
3.7 programme; the earlier build the engine was derived from used other numbers.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 14:21:10 +01:00
ClaudeandClaude Sonnet 5.5 f63c0217ef Match events and injuries follow Diamond 3.7
Injury chance 1 in 31 (was 1 in 39), no-booking roll W(0,3), straight red 1 in 34
(was 1 in 28), the injury type thresholds (match injuries now types 3-30), the
duration table, 1/4 longer for a player injured before (was 1/8) and the club
doctor's cut (/8, capped only for the heavy types 20-30). Values read from the
3.7 programme, measured against the earlier build the engine was derived from.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 11:38:17 +01:00
ClaudeandClaude Sonnet 5.5 73af2a657d Explain the stadium, transfer, contract and application code in comments
Function and section comments for ui/stadium, ui/preparation_flow, the
transfer market, contract, outgoing and incoming transfer screens, and for
app/main, app/window_actions and app/desktop_actions. Comment lines only;
full build and runnable tests unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 11:21:31 +01:00
ClaudeandClaude Sonnet 5.5 e088704dff Explain the UI flow, controller and career session in comments
Function and group comments for ui/flow, app/controller and app/career_session:
the request/acknowledge model, the revision and identity checks, staged copies
that are committed on success, and the national-coach desk identity. Comment
lines only; full build and runnable tests unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 10:11:48 +01:00
ClaudeandClaude Sonnet 5.5 287b5a9251 Add header comments to the source files
Every source file in ui, app, game, formats, cli, audio and launch that had none
now starts with a short English comment: what it implements, what state it owns
and how it relates to its neighbours (request/acknowledge flow, pairs of files,
random generator use). Comment lines only; the full build and the runnable
tests are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 09:15:23 +01:00
ClaudeandClaude Sonnet 5.5 aa6ec96305 Prepare Classic 1.0.8 patch release
Prepare verified release / draft (push) Waiting to run
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 22:05:19 +01:00
ClaudeandClaude Sonnet 5.5 e337c3c6b2 Bank credit annuity: evaluate the original's x87 rounding chain exactly
The original computes ((base / 100) * den) / 100 with 64-bit-mantissa x87
steps and one final store to a double. The host long double is only 64 bits
wide on MSVC and Apple silicon, so the annuity differed by 1 for roughly 0.2 %
of realistic loans (1-60 million) there. The chain is now evaluated with
integers, identical on every platform. Verified against the original routine
in an emulator: 5684 term/principal combinations, no difference.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 21:40:20 +01:00
ClaudeandClaude Sonnet 5.5 6cccbb01d3 Prepare Classic 1.0.7 patch release
Prepare verified release / draft (push) Waiting to run
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 21:12:49 +01:00
ClaudeandClaude Sonnet 5.5 8780d7b5a5 Show JA pushed in briefly when the manager selection is confirmed
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 21:11:01 +01:00
ClaudeandClaude Sonnet 5.5 a279bfb6df Ignore the computer tip button once a visible result is known
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 21:04:00 +01:00
ClaudeandClaude Sonnet 5.5 0535764834 Other Games and Top Scorers acknowledgement uses the home-club identity at the national desk
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 21:02:19 +01:00
ClaudeandClaude Sonnet 5.5 2f5303d9bd Prepare Classic 1.0.6 patch release
Prepare verified release / draft (push) Waiting to run
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 13:06:41 +01:00
ClaudeandClaude Sonnet 5.5 7cc7c3a7ea Fix Other Games and Top Scorers on the national-coach desk
Both screens are identified by the home club in the session; the desktop
check compared against the desk's own runtime club identity after the earlier
Table/Strengths fix, so the national desk was rejected as stale.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:27:29 +01:00
ClaudeandClaude Sonnet 5.5 f33b381f18 Hide ANNEHMEN in the advertising offer browser when the offer cannot be accepted
The original shows only ABBRECHEN while a running sponsor contract is not
terminable; the button was always drawn here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:17:30 +01:00
ClaudeandClaude Sonnet 5.5 39de3dc9d4 Allow the national-team desk in the pitch page so the live lineup opens
The live lineup of a national-team match failed with 'pitch: unsupported club'
because the pitch extras only accepted league club ids. The national desk
(runtime club 357, national squad pool) is now accepted under the same
condition as the lineup page, uses badge sheet 0 and its own roster base for
the marking lookup.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:05:00 +01:00
ClaudeandClaude Sonnet 5.5 fcd6eb9204 Club information may enter the club on every redraw
The table's club information (TeamInfo) enters the club again on each
redraw: view toggle, statistics, player card. The session required
exactly one entry and discarded the whole visit otherwise, also the
Nein/Radio/Video setting made in it, so a computer match could not be
set to Video. One entry is now the minimum.

Checked with a probe on a real savegame: table, club, two entries and
Video leave the category set.

Refs #75, #77.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 10:25:44 +01:00
ClaudeandClaude Sonnet 5.5 16ae7df7f8 Joined manager sees his next opponent; club detail error names the access
- Joining a manager: the next opponent of every manager is captured per
  day for that day's manager count, so the joined manager's desk showed
  "Spielfrei" until the next day was prepared. It is captured again when
  the join is committed.
- The club player detail's atlas error now names the access and the
  atlas size, so the debug log shows what failed.

Refs #76, #77.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 10:10:34 +01:00
ClaudeandClaude Sonnet 5.5 b8a37353cc Opponent badge follows the day; Table and Stärken at the national desk
- Desktop: the opponent's badge sheet was loaded once when the screen
  was built and kept while the state advanced, so the index of the new
  opponent picked a badge from the old sheet (a foreign club's logo, the
  wrong club for RB Leipzig). It is reloaded with every new state.
- National desk: the desk keeps the home club's key per manager (for
  the hand-back), while Table, Stärken, Other games and the other pages
  carry the identity of the runtime club (the national team). The
  controller and flow compared the two and refused ("invalid Table
  dispatch manager identity", "stale desktop identity"). DeskState now
  gives session_identity_key() and the comparisons use it.

Refs #74.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 09:50:22 +01:00
ClaudeandClaude Sonnet 5.5 7cfc8267b6 Calendar and results-page Stärken work during a running career
Found with the debug log and savegames of a real session:

- Calendar: it read the memory copies of the season origin and day,
  which hold only the day the game was loaded or saved, and refused
  from the first kickoff on ("saved native season cursor disagrees").
  It now uses the live values, as the reschedule code does. This also
  fixes "Spiel verlegen".
- Stärken: the guard of dispatch_strengths required a desk stage, but
  the turn driver marks the running turn as Failed (replay guard) for
  its whole duration, so Stärken could never open from the live
  overview or the end-of-phase results page; the failed handover then
  left the other pages with stale owners and the match stuck. The
  guard now accepts the running turn while a live overview is open.
- Tests: calendar after a kickoff; live overview handovers on the
  phase results page.

Refs #71, #73.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 08:28:45 +01:00
ClaudeandClaude Sonnet 5.5 f12857414e Table range calculator closes with the right button; no frame in the panorama
- The Von/Bis calculator of the league table is left with the right
  mouse button (as the Toto calculator), restoring the backdrop.
- The stadium panorama draws no hover frame (the original draws none);
  the yellow frames stay on the main page (seat blocks, investments).

Refs #64, #66.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 23:02:41 +01:00
ClaudeandClaude Sonnet 5.5 81ae6ad236 Stadium: yellow hover frame over seat blocks, investments and buildings
As on the advertising page, the target under the pointer gets a yellow
frame: a finished seat block and an available investment icon on the
main page, and the hit rectangle of a building in the panorama (next to
its information panel). The frame appears only where a click acts.

Refs #64.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 22:29:36 +01:00
ClaudeandClaude Sonnet 5.5 38f69fa37b Fix save loading at the national desk, calendar colours, pointer size; add -debug
- Loading: a single-manager desk saved with DeskPosition == ManagerCount
  (the completed loop) is read as the first desk again instead of being
  refused as "not a savegame".
- Calendar: text takes the original's six-row colour gradient (the flat
  colours were too dark next to the original).
- Pointer: sized in window points, so it is not doubled on Retina screens.
- Settings: the page names OpenBMH and shows the build version below.
- Desk: the opponent's badge is shown whenever the data has one
  (documented difference); cup-only teams keep the computer portrait.
- Live overview tests: Tabelle/Stärken/Spiele handovers, also with the
  Spiele page opened first.
- New command line option -debug: timestamped log, stderr captured in a
  file, and a savegame after every match day in <saves>/debug.

Refs #63, #65, #67, #68, #71, #73.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 22:22:30 +01:00
ClaudeandClaude Sonnet 5.5 1e7df751a0 Describe original routines in comments instead of naming them
The public-source check rejects decompiler symbol names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 20:44:58 +01:00
ClaudeandClaude Sonnet 5.5 af634ae8ff Fix settings switches, training skill bars, editor placement and pointer
- Settings: every unlocked switch is stored, as in the original; the
  whitelist of cells with a consumer is gone (J9, O3, ... no longer
  refused). Locks and 0/1 / numeric limits still apply.
- Training: the seven skill bars show the player row under the pointer
  (FUN_00049399).
- Line-up: the field stays editable inside the set-piece editor while no
  taker kind is chosen.
- Pointer: the original 11x11 bitmap is the default pointer on every
  page, not only on the pitch page.

Refs #57, #59, #60, #62.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 19:44:46 +01:00
Codex 04ff3b7656 Prepare Classic 1.0.5 patch release (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-11-02 23:38:24 +01:00
Codex f7d20dad9e Name English environment source layout fields (by Codex) 2026-11-02 23:38:24 +01:00
Codex d661ec5eb0 Honor Original visible league counts for fresh Classic managers (by Codex) 2026-11-02 23:28:05 +01:00
Codex 048f617395 Use the common 3.7 environment model and source-language contract tabs (by Codex) 2026-11-02 23:15:49 +01:00
Codex 249bdca1a8 Prepare Classic 1.0.4 patch release (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-11-02 21:03:19 +01:00
Codex b8904db92d Document original mouse behavior and verified layout mapping (by Codex) 2026-11-02 18:08:06 +01:00
Codex 9ec136a09f Check effective English translation neighbors (by Codex) 2026-11-02 18:08:02 +01:00
Codex a275ffa1a9 Preserve English overwrite question in translation (by Codex) 2026-11-02 18:03:04 +01:00
Codex fcb6ac14bb Refuse malformed widget formation before desktop projection (by Codex) 2026-11-02 17:47:49 +01:00
Codex acdc7d5c14 Isolate desktop pointer regressions from edition-specific mocks (by Codex) 2026-11-02 17:42:09 +01:00
Codex 0faad16148 Verify incoming transfer crests against installed edition profile (by Codex) 2026-11-02 17:37:26 +01:00
Codex f44de65e22 Handle unframed desktop admission and automation controls (by Codex) 2026-11-02 17:37:26 +01:00
Codex bea5478433 Run focused mouse input regressions in configured test suites (by Codex) 2026-11-02 17:37:26 +01:00
Codex 2d744e380c Align stadium UI fixtures with retained capacity policy (by Codex) 2026-11-02 17:30:07 +01:00
Codex 9140fb4b03 Run synthetic desktop input checks without private inventories (by Codex) 2026-11-02 16:59:52 +01:00
Codex 02f47f7972 Add mouse-operated overwrite confirmation (by Codex) 2026-11-02 16:26:29 +01:00
Codex 564af00d8d Add focused advertising input controller test route (by Codex) 2026-11-02 16:26:29 +01:00
Codex e8ba78e135 Verify folder corner removal and expose desktop input checks (by Codex) 2026-11-02 16:26:29 +01:00
Codex fcbe1ebc13 Refresh advertising hover when modal input returns (by Codex) 2026-11-02 16:23:10 +01:00
Codex 8b1dc16233 Fix unframed desktop date and folder input (by Codex) 2026-11-02 16:14:11 +01:00
Codex 9c10a2bfeb Restore original advertising hover outlines and help (by Codex) 2026-11-02 16:13:01 +01:00
Codex 6f33f9c155 Fix safe save overwrite activation by double-click (by Codex) 2026-11-02 16:13:01 +01:00
Codex 9c82cb16b5 Embed supplied high-resolution Classic start artwork (by Codex) 2026-11-02 02:24:56 +01:00
Codex 0bfa705ec5 Document verified Diamond 3.7 save import for Classic 1.0.3 (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-11-01 19:39:44 +01:00
Codex c6341aa4f9 (by Codex) Import verified Diamond 3.7 native save containers 2026-11-01 19:39:08 +01:00
Codex 8862bd4f89 Require an owned mouse release in transfer modals (by Codex)
Late or repeated releases from a post-match table cannot decline the immediately following transfer or acknowledge its confirmation. Track presses within each release-driven modal; keep semantic Source DOWN actions and fresh left/right gestures. Reproduced and verified through the real post-match table-to-transfer GUI flow.

Refs: #44
2026-11-01 19:19:21 +01:00
Codex a5aa4c6a08 Document Classic maintenance release and saved compatibility extensions (by Codex) 2026-11-01 19:07:27 +01:00
Codex 2a2fd17d07 Cover all named stadium table addresses in the synthetic fixture (by Codex) 2026-11-01 18:45:20 +01:00
Codex 0e8cfe5cd9 Finalize Classic 1.0.3 release notes and integrated stadium QA expectations (by Codex) 2026-11-01 18:33:08 +01:00
Codex feb6ca2717 Avoid overflowing dividend products before division (by Codex)
Use 64-bit products in actual monthly fund/property settlement, monthly and annual previews, and weekly dividend offers. Retain per-unit rounding, recipient policy and final native fields. Test representable high-value settlements against their forecasts. Full 32-bit money storage overflow remains unresolved.

Refs: #46
2026-11-01 18:20:05 +01:00
Codex 5caf23c452 (by Codex) Persist a per-manager monthly bank robbery limit 2026-11-01 18:17:14 +01:00
Codex 30843fc9f3 (by Codex) Preserve long-career player counts and title history 2026-11-01 18:15:55 +01:00
Codex 8e2f491d5e Prepare the Classic 1.0.3 bugfix version (by Codex) 2026-11-01 18:10:27 +01:00
Codex 4a93d9fd88 (by Codex) Initialize runtime currency fields in the bank display fixture 2026-11-01 18:03:53 +01:00
Codex 540178b264 Synchronize match reveals and restore pitch input feedback (by Codex)
Hold scoreboard digits through chance animations, retain overview gesture ownership through moved releases, and restore original affinity swatches and colored pointer from each edition. Preserve simulation and RNG boundaries; cover source observer and UI projections.

Refs: #43, #44, #45
2026-11-01 18:03:53 +01:00
Codex 86e2bfd32a (by Codex) Keep bank overview totals and currency display in 64 bits 2026-11-01 18:01:00 +01:00
Codex 8baf80564a (by Codex) Fix seller transfer review and fresh-arrival contract flags 2026-11-01 17:57:55 +01:00
Codex d57b6b5a96 (by Codex) Widen daily interest calculations before rate division 2026-11-01 17:55:56 +01:00
Codex 70082ef825 (by Codex) Keep static title responsive to window redraw and Escape 2026-11-01 17:55:16 +01:00
Codex f87d927c8d (by Codex) Resolve original CD executable casing in opening presenters 2026-11-01 17:55:16 +01:00
Codex 777039832d (by Codex) Wait for a complete mouse click on the static title 2026-11-01 17:55:16 +01:00
Codex fc07e45bbc (by Codex) Render opening artwork with its supplied embedded palette 2026-11-01 17:55:16 +01:00
Codex 7482697248 (by Codex) Preserve exit confirmation during original opening screens 2026-11-01 17:55:16 +01:00
Codex 7b5cd6988e Extend edition-aware stadium blocks to 144k with scaled build periods (by Codex) 2026-11-01 17:55:16 +01:00
Codex c8ae7a31d2 (by Codex) Restore original startup screens and edition runtime defaults 2026-11-01 17:37:48 +01:00
Codex db56c323aa Point extended development to the separate OpenBMH-Extended project (by Codex) 2026-11-01 17:22:19 +01:00
Codex b2a6300aad Separate widget close clicks from right-button desktop dragging (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-10-31 09:06:12 +01:00
Codex 12e3e52537 Use the SDL entry-point signature in the video lifetime test (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-10-30 23:33:15 +01:00
Codex 6d97b60ebc Initialize native Mac compiler rules before dependency configuration (by Codex) 2026-10-30 23:21:04 +01:00
Codex e3e2262e37 Keep native Mac keyboard regression on a supported ARM runner (by Codex) 2026-10-30 23:18:07 +01:00
Codex 184a421512 Fix automation preview, desktop drag highlight and macOS keyboard startup (by Codex) 2026-10-30 23:13:44 +01:00
Codex 998b037d3d Clarify stable release build and launch instructions [skip ci] (by Codex) 2026-10-30 18:31:57 +01:00
Codex d43d09a378 Read the original edition calendar for gameplay, desktop and saves (by Codex)
Prepare verified release / draft (push) Waiting to run
2026-10-30 18:02:52 +01:00
Codex f0ef79a119 Complete original edition rules, season safety and verified 1.0 releases (by Codex) 2026-10-30 17:14:28 +01:00
Codex e432f20ae7 Focus the community repository and documentation on the original game (by Codex) 2026-10-30 16:18:00 +01:00
Codex 6b942a2293 Retire ageing market players without age wrap or duplicate entries (by Codex) 2026-10-30 15:56:46 +01:00
Codex 3cce6465d0 Validate the Classic source export separately from retained Modern history (by Codex) 2026-10-30 15:50:36 +01:00
Codex 8ee062ea46 Prepare Classic 1.0 edition rules and Diamond 3.7 foreign crests (by Codex) 2026-10-30 15:39:56 +01:00
Codex c293a35f56 Backport original message installation for Classic standalone tools (by Codex) 2026-10-30 14:22:18 +01:00
Codex 81fc772a15 Preserve Classic reschedule targets after undo (by Codex) 2026-10-30 14:21:55 +01:00
Codex dcfb724ebe Confirm application exits in German and English (by Codex)
Route window-close events, animation polls, Escape and desktop exit through a native confirmation with Cancel selected by default. Preserve the current owner when cancelled. Refs #11.
2026-10-30 14:20:55 +01:00
Codex 17ac426039 Fix English desktop mapping and host file input issues (by Codex)
Correct setup sprites, balance colour and shortcut controls; restore native filename focus, normalize displayed directory separators and guard setup mouse releases. Refs #7, #8, #9, #10.
2026-10-30 14:20:55 +01:00
Codex c3704878d6 Restore direct-installation Classic baseline for OpenBMH 1.0 (by Codex) 2026-10-30 14:19:25 +01:00
ClaudeandClaude Opus 5.5 c8f04d0099 Reschedule undo clears the calendar replay bit (#16)
UndoReschedule of the original clears bit 0x4000 of the calendar day
(high byte & 0xbf) when no replay of another club stays on it; the
engine kept the bit, so the day and its neighbour were no longer offered
as targets after a move was taken back. The test checks the same target
days after the undo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-28 15:17:10 +01:00
ClaudeandClaude Opus 5.5 b879d5be00 Install the engine's message texts in standalone tools (fixes #14)
The six texts the engine posts from the game image (contract warning,
Masters, indoor entry bonus, league title bonus, friendly share) were
set only by the career sessions. week_check and the other standalone
tools left them empty, so the indoor entry bonus mail held only the
venue and the replays failed from the first public commit on.
install_message_texts(exe) now sets them for both sessions and in the
test executable loader.

Classic regression: the ten turns of #14 (game 1: 18, 21, 65, 88, 109,
201, 247; 2P: 24, 29, 34) pass again; no other turn changed against the
0.3 M0 baseline. The divergence the issue saw in the youth teams block
(bd4bc, since 310e3e2) is among the tolerated block differences.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 12:20:28 +02:00
Codex 6a3e51038c Correct large-window dropdown QA capture bounds (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run
2026-10-23 14:51:41 +02:00
Codex 354baf2e6f Center editor dropdown chevrons and release 0.5.5 (by Codex) 2026-10-23 14:49:13 +02:00
Codex fe307dea41 Add editor browser navigation, idle rendering and Modern pickers (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run
2026-10-23 13:48:32 +02:00
Codex 245e213cca Integrate current main with editor and Windows fixes (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run
Prepare release packages / build (push) Blocked by required conditions
Build without game data / build (linux-x64, ubuntu-24.04) (push) Blocked by required conditions
Build without game data / build (macos-arm64, macos-14) (push) Blocked by required conditions
Build without game data / build (windows-x64, windows-2022) (push) Blocked by required conditions
2026-10-23 11:03:38 +02:00
Codex f21247a244 Add read-only image previews and linked asset navigation (by Codex) 2026-10-23 11:03:32 +02:00
ClaudeandClaude Opus 5.5 59be8b0b21 List --export-midi in the openbmh_sound usage
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:43:44 +02:00
ClaudeandClaude Opus 5.5 814583e482 Export the Original music as MIDI for remastering
openbmh_sound --original DATA --export-midi 0..2 OUT.mid [--loops N] [--map FILE]
runs the sequencer offline and records every started note through a new note
observer. One MIDI track per song track (track 9 = samples on the GM drum
channel), sixteenth-note steps, tempo from the IRQ0 divisor, pitches from the
note table of the user's executable, loop markers. Programs and drum notes are
guessed from pitch range, chords and the samples' sound, and written to an
editable OUT.map.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:43:21 +02:00
Codex e306c2c4a2 Add league-to-squad navigation and preserve Windows CPU dispatch (by Codex) 2026-10-23 10:10:23 +02:00
Codex 06e846416a Keep stadium pixels intact with the Direct3D TGA loader (by Codex) 2026-10-23 10:01:44 +02:00
Codex 678fce47f6 Decode Windows WebP images without an AVX requirement (by Codex) 2026-10-23 09:55:01 +02:00
Codex a7aa1d3713 Show readable editor startup errors in native dialogs (by Codex) 2026-10-23 09:08:26 +02:00
Codex 500354cc39 Keep startup reporting independent of renderer headers (by Codex) 2026-10-23 08:52:10 +02:00
Codex 856d38cc0c Support Windows Server GUI startup with Direct3D and WARP (by Codex) 2026-10-23 08:52:10 +02:00
ClaudeandClaude Opus 5.5 d9d05f83b4 Engine split: OBW-only saves for all variants; backporting is a working idea
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:49:14 +02:00
ClaudeandClaude Opus 5.5 c1121da116 Engine split: Classic Extended backports Modern features into Classic
Classic Extended is the Classic season engine plus Modern features ported
back one at a time where the bitmap interface can present them. Modern
features are written against small ports in a shared feature library so
they can be backported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:39:30 +02:00
Codex 9f1928bd9e Add read-only game and league regulations to editor 0.5.2 (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run
2026-10-23 06:28:12 +02:00
Codex 221478b629 Add sortable editor ratings and payroll comparisons (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run
2026-10-23 05:26:10 +02:00
Codex a447d9282a Prepare game 0.2.0 and standalone editor 0.5.0 releases (by Codex)
OBW Editor / editor (linux-x64, ubuntu-24.04) (push) Waiting to run
OBW Editor / editor (macos-arm64, macos-14) (push) Waiting to run
OBW Editor / editor (windows-x64, windows-2022) (push) Waiting to run
Prepare release packages / build (push) Blocked by required conditions
Build without game data / build (linux-x64, ubuntu-24.04) (push) Waiting to run
Build without game data / build (macos-arm64, macos-14) (push) Waiting to run
Build without game data / build (windows-x64, windows-2022) (push) Waiting to run
2026-10-22 23:32:54 +02:00
Codex 6636308cad Integrate native OBW editor and three submenu themes (by Codex)
# Conflicts:
#	tools/public_release/check_public_tree.py
2026-10-22 23:06:59 +02:00
Codex b8183e4165 Integrate Classic 0.2 launcher and native runtime (by Codex)
# Conflicts:
#	tools/public_release/check_public_tree.py
#	tools/public_release/test_public_tree.py
2026-10-22 23:05:57 +02:00
Codex a475c1ba80 Match all editor themes to modern submenu palettes (by Codex) 2026-10-22 22:53:44 +02:00
Codex fcf6092063 Isolate entity image edits and retain shared fallbacks (by Codex) 2026-10-22 22:17:07 +02:00
Codex f128a46104 Keep editor QA out of game packages and retain dependency notices (by Codex) 2026-10-22 22:07:17 +02:00
Codex 056ac8ebea Bundle Windows CRT with standalone editor packages (by Codex) 2026-10-22 22:03:52 +02:00
Codex ef111342f9 Handle Unicode Windows profile paths in editor settings (by Codex) 2026-10-22 21:51:34 +02:00
Codex b199f67eec Scope editor CI audit to its branch and use UTF-8 tests on MSVC (by Codex) 2026-10-22 21:43:28 +02:00
Codex bde8b10762 Add native OBW editor POC with shared MCP session (by Codex) 2026-10-22 21:41:10 +02:00
Michael 56b91ddca0 Add OBW competition trophy references (by Codex)
Add optional OBW competition trophy references
2026-10-22 12:54:17 +02:00
Codex 4f8e296f86 Merge verified public source export guard (by Codex) 2026-10-22 12:12:42 +02:00
Michael b868a236ea Fix source export history checks (by Codex)
Fix public-source checks across launcher history
2026-10-22 12:12:03 +02:00
Codex 7ea00c7046 Fix source history checks for reviewed launcher artwork and edition names (by Codex) 2026-10-22 11:20:15 +02:00
Codex faaecf2eb2 Define competition trophy references and generic fallback (by Codex) 2026-10-22 09:02:10 +02:00
ClaudeandClaude Opus 5.5 906cce902d Add the engine split concept: shared match engine, three season engines
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 19:17:45 +02:00
Codex 6e5fa72ed5 Finish Classic 0.2 portability and release preparation (by Codex) 2026-10-18 20:51:39 +02:00
Codex 74ca973111 Correct launcher stadium skyline and football pitch details (by Codex) 2026-10-18 13:44:34 +02:00
Codex 8aa849e9fa Add RmlUI night-stadium launcher and shared theme (by Codex) 2026-10-18 13:30:24 +02:00
Codex 00f522c1f3 Resolve native replay and resume paths before mounting content (by Codex) 2026-10-18 12:21:35 +02:00
Codex 0b2354c979 Complete native GUI file flows and Football Limited audio data (by Codex) 2026-10-18 12:13:10 +02:00
Codex 978a014b87 Preserve prepared match groups and English save continuation (by Codex) 2026-10-18 11:40:04 +02:00
Codex 481b525582 Fix native launcher platform setup and executable discovery (by Codex) 2026-10-18 11:32:15 +02:00
Codex 2552528176 Build 0.2 native launcher and portable Classic runtime (by Codex) 2026-10-18 11:28:51 +02:00
Codex 3a021fc160 Complete Classic BMH and FLTD installation imports (by Codex) 2026-10-18 10:07:38 +02:00
ClaudeandClaude Opus 5.5 65b087c1d0 OBW: store composed player portraits as a frozen part recipe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 09:24:54 +02:00
Codex e1d17d8f81 Confirm application exits in German and English (by Codex)
Route window-close events, animation polls, Escape and desktop exit through a native confirmation with Cancel selected by default. Preserve the current owner when cancelled. Refs #11.
2026-10-17 22:52:11 +02:00
Codex 7eff8a34f8 Package versioned OBW schema documentation (by Codex) 2026-10-17 22:52:11 +02:00
Codex 8326a23274 Fix English desktop mapping and host file input issues (by Codex)
Correct setup sprites, balance colour and shortcut controls; restore native filename focus, normalize displayed directory separators and guard setup mouse releases. Refs #7, #8, #9, #10.
2026-10-17 22:36:58 +02:00
Codex 9bff07828a Add standalone BMH and FLTD to OBW converter (by Codex) 2026-10-17 22:21:17 +02:00
Codex 310e3e2464 Restore full environment controls and original match pacing for 0.1.2 (by Codex)
Prepare release packages / build (push) Blocked by required conditions
Build without game data / build (linux-x64, ubuntu-24.04) (push) Waiting to run
Build without game data / build (macos-arm64, macos-14) (push) Waiting to run
Build without game data / build (windows-x64, windows-2022) (push) Waiting to run
2026-10-17 21:09:38 +02:00
ClaudeandClaude Opus 5.5 4fb8b2f551 Point repository links to the renamed account
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:35:16 +02:00
ClaudeandClaude Opus 5.5 f1a31c9940 Add the OBW data format concept for roadmap 0.2-0.4
Versioned ZIP+JSON container for worlds, saves, content packs and RmlUi
themes: typed entities, generic competition stages (league phase, groups,
knockout, nations-league tiers), 32-league engine limit, BMH/FLTD import,
asset keys for high-resolution crests and photos, gettext languages and
TrueType/OpenType fonts. Match engine out of scope.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 12:34:54 +02:00
Codex aa53c6e2e2 Prepare 0.1.1 release with the UI corrections (by Codex)
Prepare release packages / build (push) Blocked by required conditions
Build without game data / build (linux-x64, ubuntu-24.04) (push) Waiting to run
Build without game data / build (macos-arm64, macos-14) (push) Waiting to run
Build without game data / build (windows-x64, windows-2022) (push) Waiting to run
2026-10-17 09:45:40 +02:00
Codex a3d1948fcd Fix live lineup navigation, instructions and desktop file dialogs (by Codex)
Address UI reports #1–#4: preserve the native live pitch page, acknowledge page controls on press, restore original instruction sprites and coverage, and allow file dialog cancellation and filename replacement. Keep graphical comparisons and save evidence in the private reference repository.
2026-10-16 23:26:09 +02:00
462 changed files with 35136 additions and 2316 deletions

No files matched your search

+1
View File
@@ -1,2 +1,3 @@
* text=auto eol=lf
*.bat text eol=crlf
third_party/** -text
+20 -5
View File
@@ -3,7 +3,7 @@ name: Build without game data
on:
push:
branches: [main]
branches: [main, release/1.0]
pull_request:
workflow_dispatch:
workflow_call:
@@ -21,7 +21,7 @@ jobs:
platform: linux-x64
- runner: windows-2022
platform: windows-x64
- runner: macos-14
- runner: macos-15
platform: macos-arm64
runs-on: ${{ matrix.runner }}
timeout-minutes: 90
@@ -36,8 +36,13 @@ jobs:
- name: Install Linux build dependencies
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y build-essential git cmake ninja-build pkg-config libgtk-3-dev libx11-dev libxext-dev libxrandr-dev libxcursor-dev libxi-dev libxfixes-dev libxss-dev libasound2-dev libpulse-dev libgl1-mesa-dev libudev-dev
# Audit the selected tree shipped in source archives. Full repository
# history auditing is available separately with --history.
- name: Verify source export
run: python3 tools/public_release/check_public_tree.py --root . --history
run: |
python3 tools/public_release/check_public_tree.py --root .
python3 tools/ci/test_build_runnable_tests.py
python3 tools/package/test_verify_ci_release.py
- name: Set up MSVC x64
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@a102174a2b586eec2ea151a69e6fd14404a8ce7c # v1.13.0
@@ -62,10 +67,20 @@ jobs:
run: |
test "$(uname -m)" = arm64
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 -DBMH_DATA= -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
- name: Build every target
run: cmake --build build --config Release --parallel 2
- name: Build products and every runnable test
run: python3 tools/ci/build_runnable_tests.py --build build --config Release --parallel 2
- name: Run synthetic tests and report data tests as skipped
run: ctest --test-dir build -C Release --output-on-failure --output-junit test-results.xml
- name: Verify product versions
shell: python
run: |
import pathlib, subprocess, sys
build = pathlib.Path('build').resolve()
version = (build / 'product-version.txt').read_text().strip()
suffix = '.exe' if sys.platform == 'win32' else ''
cli = subprocess.run([str(build / ('openbmh_cli' + suffix)), '--version'], check=True, capture_output=True, text=True)
assert cli.stdout.strip() == 'OpenBMH console ' + version
subprocess.run([str(build / ('OpenBMH' + suffix)), '--version'], check=True)
- name: Package products and licenses
run: python3 tools/package/make_package.py --build build --out dist --platform ${{ matrix.platform }}
- name: Package corresponding source and pinned dependencies
+36 -11
View File
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: GPL-3.0-only
name: Prepare release packages
name: Prepare verified release
on:
push:
@@ -7,34 +7,59 @@ on:
permissions:
contents: read
actions: read
jobs:
build:
uses: ./.github/workflows/ci.yml
draft:
needs: build
runs-on: ubuntu-24.04
permissions:
contents: write
actions: read
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
- name: Locate successful CI for this exact revision
id: ci
env:
GH_TOKEN: ${{ github.token }}
EXPECTED_SHA: ${{ github.sha }}
run: |
gh api "repos/$GITHUB_REPOSITORY/actions/workflows/ci.yml/runs?status=success&event=push&per_page=100" > ci-runs.json
python3 - <<'PY'
import json, os
runs = json.load(open('ci-runs.json'))['workflow_runs']
matches = [r for r in runs if r['head_sha'] == os.environ['EXPECTED_SHA'] and
r['conclusion'] == 'success' and r['event'] == 'push' and
r['head_repository']['full_name'].lower() == os.environ['GITHUB_REPOSITORY'].lower()]
if not matches:
raise SystemExit('Run the full CI successfully for this revision before tagging a release')
with open(os.environ['GITHUB_OUTPUT'], 'a') as output:
output.write('run_id=' + str(matches[0]['id']) + '\n')
PY
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
github-token: ${{ github.token }}
run-id: ${{ steps.ci.outputs.run_id }}
pattern: OpenBMH-*
path: dist
merge-multiple: true
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
github-token: ${{ github.token }}
run-id: ${{ steps.ci.outputs.run_id }}
pattern: tests-*
path: test-reports
- name: Verify archives, corresponding source and platform reports
env:
RELEASE_TAG: ${{ github.ref_name }}
CI_RUN: ${{ steps.ci.outputs.run_id }}
run: |
python3 tools/package/verify_ci_release.py --dist dist --reports test-reports --tag "$RELEASE_TAG" --source-sha "$GITHUB_SHA" --ci-run "$CI_RUN" --repository "$GITHUB_REPOSITORY"
- name: Create draft for review
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
for package in dist/*.zip; do
case "$(basename "$package")" in
OpenBMH-${RELEASE_TAG#v}-*.zip) ;;
*) echo "Release tag and package version differ" >&2; exit 1 ;;
esac
done
gh release create "$RELEASE_TAG" dist/*.zip --draft --verify-tag --title "OpenBMH $RELEASE_TAG" --notes-file docs/release/0.1/RELEASE_NOTES.md
gh release create "$RELEASE_TAG" dist/*.zip dist/SHA256SUMS dist/QA-REPORT.json --draft --verify-tag --title "OpenBMH $RELEASE_TAG" --notes-file docs/release/1.0.12/RELEASE_NOTES.md
+163 -16
View File
@@ -1,8 +1,19 @@
# SPDX-License-Identifier: GPL-3.0-only
cmake_minimum_required(VERSION 3.24)
project(OpenBMH VERSION 0.1.0 LANGUAGES CXX C)
project(OpenBMH VERSION 1.0.12 LANGUAGES CXX C)
if(APPLE)
# Enable native languages before dependencies/subdirectories inherit rules.
enable_language(OBJC OBJCXX)
endif()
set(OPENBMH_PRERELEASE "" CACHE STRING "Prerelease identifier; empty for final release")
set(OPENBMH_PRODUCT_VERSION "${PROJECT_VERSION}")
if(OPENBMH_PRERELEASE)
string(APPEND OPENBMH_PRODUCT_VERSION "-${OPENBMH_PRERELEASE}")
endif()
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/product-version.txt" CONTENT "${OPENBMH_PRODUCT_VERSION}\n")
# the one place of the version: --version of both programs and the window title (src/version.hpp)
add_compile_definitions(OPENBMH_VERSION="${PROJECT_VERSION}")
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/generated/openbmh_build_version.hpp"
CONTENT "// SPDX-License-Identifier: GPL-3.0-only\n#pragma once\n#define OPENBMH_VERSION \"${OPENBMH_PRODUCT_VERSION}\"\n")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -39,7 +50,7 @@ function(bmh_add_data_test)
set(T_DATA_DIR "${BMH_DATA}")
endif()
set(reason "")
set(external_text_tests season_transition_tests environment_tests cli_console_tests
set(external_text_tests season_transition_tests cli_console_tests
ui_desktop_tests ui_lineup_tests format_tests app_controller_tests bank_app_tests
cli_soak ui_cup_draw_tests league_pairings_tests ui_pending_offer_tests
reality_reporter_layout_tests season_cup_draw_app_tests
@@ -62,7 +73,7 @@ function(bmh_add_data_test)
message(FATAL_ERROR "Invalid game data directory for ${T_NAME}: ${T_DATA_DIR}")
endif()
foreach(option IN LISTS T_REQUIRED_OPTIONS)
if(NOT "${${option}}" OR NOT EXISTS "${${option}}")
if("${${option}}" STREQUAL "" OR NOT EXISTS "${${option}}")
set(reason "External test input not supplied: ${option}")
endif()
endforeach()
@@ -202,7 +213,7 @@ add_library(bmhcore STATIC
src/formats/textd.cpp
src/formats/fbm.cpp
src/formats/le.cpp
src/formats/rule_base.cpp
src/formats/diamond_image.cpp
src/formats/m3d.cpp
src/formats/savestate.cpp
src/game/schedule.cpp
@@ -222,6 +233,7 @@ add_library(bmhcore STATIC
src/game/reality_ball.cpp
src/game/reality_duel.cpp
src/game/reality_reporter.cpp
src/game/long_career.cpp
src/game/matchday.cpp
src/game/sportschau_replay.cpp
src/game/sportschau_rating.cpp
@@ -229,6 +241,7 @@ add_library(bmhcore STATIC
src/game/matchday_setup.cpp
src/game/prediction.cpp
src/game/month.cpp
src/game/search_profile.cpp
src/game/desk.cpp
src/game/cup.cpp
src/game/club_info.cpp
@@ -239,6 +252,7 @@ add_library(bmhcore STATIC
src/game/weekly.cpp
src/game/messages.cpp
src/game/table.cpp
src/game/calendar.cpp
src/game/week.cpp
src/game/lineup.cpp
src/game/national.cpp
@@ -271,12 +285,9 @@ if(MSVC)
endif()
# --- Game data launcher (src/launch): find, unpack and check the original game data ---------
# ZIP: miniz (MIT), 7z: the C decoder of the LZMA SDK (public domain), file dialog:
# ZIP: miniz 3.0.2 (MIT, vendored in third_party/miniz), 7z: the C decoder of the LZMA SDK (public domain), file dialog:
# nativefiledialog-extended (zlib). All pinned; fetched like SDL2.
include(FetchContent)
FetchContent_Declare(miniz
URL https://github.com/richgel999/miniz/releases/download/3.0.2/miniz-3.0.2.zip
URL_HASH SHA256=ada38db0b703a56d3dd6d57bf84a9c5d664921d870d8fea4db153979fb5332c5)
FetchContent_Declare(lzma_sdk
GIT_REPOSITORY https://github.com/ip7z/7zip.git
GIT_TAG 24.09
@@ -288,8 +299,9 @@ FetchContent_Declare(nfd
GIT_REPOSITORY https://github.com/btzy/nativefiledialog-extended.git
GIT_TAG v1.2.1
GIT_SHALLOW TRUE)
FetchContent_MakeAvailable(miniz lzma_sdk nfd)
FetchContent_MakeAvailable(lzma_sdk nfd)
set(miniz_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/miniz") # vendored: no download that can fail
add_library(bmh_miniz STATIC ${miniz_SOURCE_DIR}/miniz.c)
target_include_directories(bmh_miniz PUBLIC ${miniz_SOURCE_DIR})
set(BMH_LZMA_C ${lzma_sdk_SOURCE_DIR}/C)
@@ -329,6 +341,10 @@ bmh_add_data_test(NAME format_tests REQUIRED_OPTIONS BMH_TEST_INPUTS
REQUIRED_FILES expected-text.tsv format-players.tsv format-start.fbm
COMMAND format_tests "${BMH_DATA}" "${BMH_REFERENCE}")
add_executable(stadium_extended_limits_tests tests/stadium_extended_limits_tests.cpp)
target_link_libraries(stadium_extended_limits_tests PRIVATE bmhcore)
add_test(NAME stadium_extended_limits_tests COMMAND stadium_extended_limits_tests)
add_executable(stand_block_actions_tests tests/stand_block_actions_tests.cpp)
target_link_libraries(stand_block_actions_tests PRIVATE bmhcore)
add_test(NAME stand_block_actions_tests COMMAND stand_block_actions_tests)
@@ -365,9 +381,7 @@ bmh_add_data_test(NAME reschedule_tests REQUIRED_OPTIONS BMH_TEST_RESCHEDULE_TES
add_executable(environment_tests tests/environment_tests.cpp)
target_link_libraries(environment_tests PRIVATE bmhcore)
set(BMH_TEST_ENVIRONMENT_TESTS_INPUT_1 "" CACHE PATH "External input 1 for environment_tests; not distributed")
bmh_add_data_test(NAME environment_tests REQUIRED_OPTIONS BMH_TEST_ENVIRONMENT_TESTS_INPUT_1 COMMAND environment_tests "${BMH_DATA}"
"${BMH_TEST_ENVIRONMENT_TESTS_INPUT_1}")
add_test(NAME environment_tests COMMAND environment_tests)
add_executable(youth_academy_tests tests/youth_academy_tests.cpp)
target_link_libraries(youth_academy_tests PRIVATE bmhcore)
@@ -435,15 +449,33 @@ target_link_libraries(desk_check PRIVATE bmhcore)
add_executable(init_check tests/init_check.cpp)
target_link_libraries(init_check PRIVATE bmhcore)
# The approved compressed title is embedded: no install-time sidecar dependency.
set(BMH_START_SCREEN_DATA "${CMAKE_BINARY_DIR}/generated/start_screen_data.cpp")
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/generated")
add_custom_command(OUTPUT "${BMH_START_SCREEN_DATA}"
COMMAND "${CMAKE_COMMAND}" "-DINPUT=${CMAKE_SOURCE_DIR}/assets/start-screen.jpg"
"-DOUTPUT=${BMH_START_SCREEN_DATA}" -P "${CMAKE_SOURCE_DIR}/cmake/EmbedStartScreen.cmake"
DEPENDS assets/start-screen.jpg cmake/EmbedStartScreen.cmake
VERBATIM)
add_library(openbmh_start_screen STATIC src/app/start_screen.cpp "${BMH_START_SCREEN_DATA}")
target_include_directories(openbmh_start_screen PRIVATE "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(openbmh_start_screen PUBLIC ${BMH_SDL_TARGET})
add_executable(start_screen_tests tests/start_screen_tests.cpp)
target_include_directories(start_screen_tests PRIVATE "${CMAKE_SOURCE_DIR}/src")
target_link_libraries(start_screen_tests PRIVATE openbmh_start_screen)
add_test(NAME start_screen_tests COMMAND start_screen_tests)
# The playable program: the shared UI library connected to the engine by src/app.
add_executable(openbmh_play
src/app/main.cpp
${BMH_APP_CONTROLLER_SOURCE}
${BMH_APP_SESSION_SDL_SOURCE})
target_link_libraries(openbmh_play PRIVATE bmhui bmhlaunch_dialog openbmh_audio ${BMH_SDL_TARGET})
target_link_libraries(openbmh_play PRIVATE openbmh_start_screen)
# a game without a console window on double-click (SDL2main provides WinMain); started from a
# console it attaches to that one for --version, --help and start errors (src/app/main.cpp)
set_target_properties(openbmh_play PROPERTIES WIN32_EXECUTABLE TRUE)
set_target_properties(openbmh_play PROPERTIES WIN32_EXECUTABLE TRUE OUTPUT_NAME OpenBMH)
target_include_directories(openbmh_play PRIVATE "${CMAKE_BINARY_DIR}/generated")
if(MSVC)
target_compile_options(openbmh_play PRIVATE /utf-8)
# App sources also compile in headless tests/helpers without target /utf-8.
@@ -482,6 +514,9 @@ if(MSVC)
endif()
bmh_add_data_test(NAME app_controller_tests COMMAND app_controller_tests "${BMH_DATA}")
set(BMH_TEST_APP_DELAY_SETTINGS_TESTS_INPUT_1 "" CACHE PATH "External input 1 for app_delay_settings_tests; not distributed")
bmh_add_data_test(NAME app_desktop_input_tests COMMAND app_controller_tests "${BMH_DATA}" --desktop-input-only)
bmh_add_data_test(NAME app_advertising_input_tests COMMAND app_controller_tests "${BMH_DATA}" --advertising-input-only)
bmh_add_data_test(NAME app_environment_tests COMMAND app_controller_tests "${BMH_DATA}" --environment-only)
bmh_add_data_test(NAME app_delay_settings_tests REQUIRED_OPTIONS BMH_TEST_APP_DELAY_SETTINGS_TESTS_INPUT_1 COMMAND app_controller_tests "${BMH_DATA}"
--delay-settings-only "${BMH_TEST_APP_DELAY_SETTINGS_TESTS_INPUT_1}")
@@ -501,6 +536,10 @@ add_executable(national_friendly_actions_tests tests/national_friendly_actions_t
target_link_libraries(national_friendly_actions_tests PRIVATE bmhcore)
add_test(NAME national_friendly_actions_tests COMMAND national_friendly_actions_tests)
add_executable(edition_startup_app_tests tests/edition_startup_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE})
target_link_libraries(edition_startup_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET})
bmh_add_data_test(NAME edition_startup_app_tests COMMAND edition_startup_app_tests "${BMH_DATA}")
add_executable(manager_join_app_tests tests/manager_join_app_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE})
target_link_libraries(manager_join_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET})
if(MSVC)
@@ -622,6 +661,7 @@ add_executable(openbmh_cli
src/cli/seat_hub.cpp
src/cli/json.cpp
${BMH_APP_SESSION_SOURCE})
target_include_directories(openbmh_cli PRIVATE "${CMAKE_BINARY_DIR}/generated")
target_link_libraries(openbmh_cli PRIVATE bmhui bmhlaunch)
if(WIN32)
target_link_libraries(openbmh_cli PRIVATE ws2_32) # --listen (Winsock)
@@ -924,6 +964,8 @@ bmh_add_data_test(NAME league_views_data_tests COMMAND league_views_data_tests "
# FLTD is translated by launch_check/the launcher first. Do not point these
# tests at the raw DOS directory: the shared UI consumes the prepared image.
set(BMH_ENGLISH_DATA "" CACHE PATH "Prepared Football Limited game-data directory")
bmh_add_data_test(NAME english_environment_controller_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND app_controller_tests "${BMH_ENGLISH_DATA}" --environment-only)
bmh_add_data_test(NAME english_edition_startup_app_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND edition_startup_app_tests "${BMH_ENGLISH_DATA}")
bmh_add_data_test(NAME english_pairings_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND league_pairings_data_tests "${BMH_ENGLISH_DATA}")
bmh_add_data_test(NAME english_desktop_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND desktop_data_tests "${BMH_ENGLISH_DATA}" --english)
bmh_add_data_test(NAME english_league_views_data_tests DATA_DIR "${BMH_ENGLISH_DATA}" COMMAND league_views_data_tests "${BMH_ENGLISH_DATA}")
@@ -1045,9 +1087,16 @@ set(BMH_TEST_SPORTSCHAU_APP_TESTS_INPUT_1 "" CACHE PATH "External input 1 for sp
bmh_add_data_test(NAME sportschau_app_tests REQUIRED_OPTIONS BMH_TEST_SPORTSCHAU_APP_TESTS_INPUT_1 COMMAND sportschau_app_tests "${BMH_DATA}"
"${BMH_TEST_SPORTSCHAU_APP_TESTS_INPUT_1}")
# The runtime component deliberately contains only the two products and notices.
# openbmh.dat (the game texts of the original executables, tools/diamond_constants) ships next to the programs and is copied
# next to the built programs as well, where the game looks for it.
foreach(product IN ITEMS openbmh_play openbmh_cli)
add_custom_command(TARGET ${product} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/data/openbmh.dat" "$<TARGET_FILE_DIR:${product}>")
endforeach()
# The runtime component deliberately contains only the two products, openbmh.dat and notices.
install(TARGETS openbmh_play openbmh_cli RUNTIME DESTINATION . COMPONENT Runtime)
install(FILES README.md LICENSE THIRD_PARTY_NOTICES.md ACKNOWLEDGEMENTS.md CONTRIBUTING.md
install(FILES README.md LICENSE THIRD_PARTY_NOTICES.md ACKNOWLEDGEMENTS.md CONTRIBUTING.md data/openbmh.dat
DESTINATION . COMPONENT Runtime)
install(DIRECTORY docs/ DESTINATION docs COMPONENT Runtime)
if(MSVC)
@@ -1070,6 +1119,25 @@ if(MSVC)
endif()
add_test(NAME launch_unit_tests COMMAND launch_unit_tests)
add_executable(fltd_translation_unit_tests tests/fltd_translation_unit_tests.cpp)
target_link_libraries(fltd_translation_unit_tests PRIVATE bmhlaunch)
add_test(NAME fltd_translation_unit_tests COMMAND fltd_translation_unit_tests)
add_executable(host_path_display_unit_tests tests/host_path_display_unit_tests.cpp)
target_include_directories(host_path_display_unit_tests PRIVATE src)
if(MSVC)
target_compile_options(host_path_display_unit_tests PRIVATE /utf-8)
endif()
add_test(NAME host_path_display_unit_tests COMMAND host_path_display_unit_tests)
add_executable(quit_confirmation_unit_tests tests/quit_confirmation_unit_tests.cpp)
target_include_directories(quit_confirmation_unit_tests PRIVATE src)
target_link_libraries(quit_confirmation_unit_tests PRIVATE ${BMH_SDL_TARGET})
if(MSVC)
target_compile_options(quit_confirmation_unit_tests PRIVATE /utf-8)
endif()
add_test(NAME quit_confirmation_unit_tests COMMAND quit_confirmation_unit_tests)
add_executable(fixture_table_tests tests/fixture_table_tests.cpp)
target_link_libraries(fixture_table_tests PRIVATE bmhcore)
add_test(NAME fixture_table_unit_tests COMMAND fixture_table_tests)
@@ -1088,3 +1156,82 @@ foreach(dependency IN ITEMS SDL2 miniz lzma_sdk nfd)
string(JSON package_dependencies SET "${package_dependencies}" "${dependency}" "\"${dependency_path}\"")
endforeach()
file(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/package-dependencies.json" CONTENT "${package_dependencies}\n")
add_executable(environment_profile_tests tests/environment_profile_tests.cpp)
target_link_libraries(environment_profile_tests PRIVATE bmhcore)
add_test(NAME environment_profile_tests COMMAND environment_profile_tests)
add_executable(classic_rules_unit_tests tests/classic_rules_unit_tests.cpp)
target_link_libraries(classic_rules_unit_tests PRIVATE bmhcore)
add_test(NAME classic_rules_unit_tests COMMAND classic_rules_unit_tests)
add_executable(season_player_reset_tests tests/season_player_reset_tests.cpp)
target_link_libraries(season_player_reset_tests PRIVATE bmhcore)
add_test(NAME season_player_reset_tests COMMAND season_player_reset_tests)
set_tests_properties(season_player_reset_tests PROPERTIES TIMEOUT 10)
add_executable(lineup_foreign_limit_tests tests/lineup_foreign_limit_tests.cpp)
target_link_libraries(lineup_foreign_limit_tests PRIVATE bmhcore)
add_test(NAME lineup_foreign_limit_tests COMMAND lineup_foreign_limit_tests)
add_executable(calendar_epoch_tests tests/calendar_epoch_tests.cpp)
target_link_libraries(calendar_epoch_tests PRIVATE bmhui)
add_test(NAME calendar_epoch_tests COMMAND calendar_epoch_tests)
add_executable(video_session_tests tests/video_session_tests.cpp)
target_include_directories(video_session_tests PRIVATE src)
target_link_libraries(video_session_tests PRIVATE ${BMH_SDL_TARGET})
add_test(NAME video_session_tests COMMAND video_session_tests)
if(APPLE)
add_executable(mac_video_picker_tests tests/mac_video_picker_tests.mm)
set_target_properties(mac_video_picker_tests PROPERTIES OBJCXX_STANDARD 20 OBJCXX_STANDARD_REQUIRED YES)
target_include_directories(mac_video_picker_tests PRIVATE src)
target_link_libraries(mac_video_picker_tests PRIVATE ${BMH_SDL_TARGET} nfd::nfd "-framework Cocoa")
add_test(NAME mac_video_picker_tests COMMAND mac_video_picker_tests)
endif()
add_executable(desktop_feedback_tests tests/desktop_feedback_tests.cpp)
target_link_libraries(desktop_feedback_tests PRIVATE bmhui)
bmh_add_data_test(NAME desktop_feedback_tests COMMAND desktop_feedback_tests "${BMH_DATA}")
add_executable(daily_interest_unit_tests tests/daily_interest_unit_tests.cpp)
target_link_libraries(daily_interest_unit_tests PRIVATE bmhcore)
add_test(NAME daily_interest_unit_tests COMMAND daily_interest_unit_tests)
add_executable(transfer_seller_actions_tests tests/transfer_seller_actions_tests.cpp)
target_link_libraries(transfer_seller_actions_tests PRIVATE bmhcore)
add_test(NAME transfer_seller_actions_tests COMMAND transfer_seller_actions_tests)
add_executable(diamond_image_tests tests/diamond_image_tests.cpp)
target_link_libraries(diamond_image_tests PRIVATE bmhcore)
add_test(NAME diamond_image_tests COMMAND diamond_image_tests - "${CMAKE_CURRENT_SOURCE_DIR}/data/openbmh.dat")
bmh_add_data_test(NAME diamond_image_data_tests COMMAND diamond_image_tests "${BMH_DATA}" "${CMAKE_CURRENT_SOURCE_DIR}/data/openbmh.dat")
add_executable(search_profile_tests tests/search_profile_tests.cpp)
target_link_libraries(search_profile_tests PRIVATE bmhcore)
add_test(NAME search_profile_tests COMMAND search_profile_tests)
add_executable(transfer_seller_app_tests tests/transfer_seller_app_tests.cpp ${BMH_APP_SESSION_SDL_SOURCE})
target_link_libraries(transfer_seller_app_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET})
set(BMH_TEST_TRANSFER_SELLER_APP_SAVE "" CACHE FILEPATH "External career for seller-offer integration; not distributed")
bmh_add_data_test(NAME transfer_seller_app_tests REQUIRED_OPTIONS BMH_TEST_TRANSFER_SELLER_APP_SAVE
COMMAND transfer_seller_app_tests "${BMH_DATA}" "${BMH_TEST_TRANSFER_SELLER_APP_SAVE}")
add_executable(wide_number_unit_tests tests/wide_number_unit_tests.cpp)
target_link_libraries(wide_number_unit_tests PRIVATE bmhcore)
add_test(NAME wide_number_unit_tests COMMAND wide_number_unit_tests)
add_executable(long_career_tests tests/long_career_tests.cpp)
target_link_libraries(long_career_tests PRIVATE bmhcore)
add_test(NAME long_career_tests COMMAND long_career_tests)
add_executable(bank_robbery_month_tests tests/bank_robbery_month_tests.cpp)
target_link_libraries(bank_robbery_month_tests PRIVATE bmhcore)
add_test(NAME bank_robbery_month_tests COMMAND bank_robbery_month_tests)
add_executable(monthly_dividend_tests tests/monthly_dividend_tests.cpp)
target_link_libraries(monthly_dividend_tests PRIVATE bmhui)
add_test(NAME monthly_dividend_tests COMMAND monthly_dividend_tests)
add_executable(native_save_version_tests tests/native_save_version_tests.cpp)
target_link_libraries(native_save_version_tests PRIVATE bmhcore)
add_test(NAME native_save_version_tests COMMAND native_save_version_tests)
add_executable(native_save_import_tests tests/native_save_import_tests.cpp ${BMH_APP_CONTROLLER_SOURCE} ${BMH_APP_SESSION_SDL_SOURCE})
target_link_libraries(native_save_import_tests PRIVATE bmhui openbmh_audio ${BMH_SDL_TARGET})
set(BMH_TEST_NATIVE_SAVE_IMPORT_INPUT "" CACHE FILEPATH "External native save for import compatibility; not distributed")
bmh_add_data_test(NAME native_save_import_tests REQUIRED_OPTIONS BMH_TEST_NATIVE_SAVE_IMPORT_INPUT
COMMAND native_save_import_tests "${BMH_DATA}" "${BMH_TEST_NATIVE_SAVE_IMPORT_INPUT}")
+1 -1
View File
@@ -1,6 +1,6 @@
# Contributing to OpenBMH
Use [issues](https://github.com/rezmer/openbmh/issues) for reproducible bugs and proposals. For a bug, include the OpenBMH version, platform, game edition, expected behaviour and the smallest sequence of actions that shows the problem. Remove personal paths and account information from diagnostic text.
Use [issues](https://github.com/Weyoune/openbmh/issues) for reproducible bugs and proposals. For a bug, include the OpenBMH version, platform, game edition, expected behaviour and the smallest sequence of actions that shows the problem. Remove personal paths and account information from diagnostic text.
Keep proprietary game files out of public submissions: no executables, databases, manuals, extracted text, artwork, recordings or saved games. Prefer synthetic inputs and a short description. If an investigation requires privately owned data, coordinate an appropriate process with the maintainers instead of attaching it publicly.
+27 -18
View File
@@ -1,44 +1,51 @@
# OpenBMH
A modern and faithful open source rebuild of the *Bundesliga Manager Hattrick* engine.
**Classic-Version: 1.0.12.** Die originalgetreue Linie bleibt in diesem Repository.
Erweiterte Ligen, die gemeinsame deutsche/englische Karriere und der Dateneditor
werden separat als **[OpenBMH-Extended 1.0 Beta](https://github.com/Weyoune/OpenBMH-extended)** entwickelt.
OpenBMH is a standalone C++20 engine with an SDL2 interface for *Bundesliga Manager Hattrick* (1994/95) and its English edition, *Football Limited*. The project develops a playable reconstruction alongside a platform for new rules, content and interfaces. Keeping the familiar game enjoyable and making it easier to extend are equally important goals.
The engine reads a game installation supplied by the player. Game data, artwork, music, manuals and the original executable are not distributed with OpenBMH. Its aim is recognisable behaviour and plausible results; documented compatibility decisions and safety fixes take precedence over reproducing every original fault.
A faithful, standalone community reconstruction of *Bundesliga Manager Hattrick*, using the player's original installation and SDL2 interface.
OpenBMH 1.0 builds on v0.1.2 with reviewed bug fixes and starts directly with the original game data. Original game files, graphics, audio, texts and manuals are not distributed. German CD-compatible BMH and verified Diamond editions are the primary release targets. Football Limited remains experimental; the older floppy executable is not supported.
This is an independent community project, with no affiliation with or endorsement by the original rights holders, the DFL or the Bundesliga. It is an engine implementation, not an official source release or a remaster.
## Get started
Check the [releases page](https://github.com/rezmer/openbmh/releases) for available packages and their platform notes. A Windows package uses the name `OpenBMH-<version>-windows-x64.zip`. Availability and native validation are stated for each release; source build instructions do not establish platform support on their own.
Check the [releases page](https://github.com/Weyoune/openbmh/releases) for available packages and their platform notes. A Windows package uses the name `OpenBMH-<version>-windows-x64.zip`. Availability and native validation are stated for each release; source build instructions do not establish platform support on their own.
1. Have your own supported game installation available.
1. Have your own supported game installation available. OpenBMH needs its asset files (texts, master database, pictures, fonts, sounds) and **either** `BMH.EXE` (`FLTD.EXE` for the English game) **or** `openbmh.dat`, which ships next to the programs in the release package and holds the game texts of the original executables; the numbers of those executables are built into OpenBMH. If both are there, the executable is used. If neither is there, OpenBMH asks for the game directory or for `BMH.EXE`.
2. Extract the OpenBMH package into a separate directory, or alongside the game files.
3. Start `openbmh_play` (`openbmh_play.exe` on Windows). Select the game directory or executable when prompted. A ZIP or 7z containing one game installation can also be selected.
3. Start `OpenBMH` (`OpenBMH.exe` on Windows). Select the game directory (or `BMH.EXE`) when prompted. A ZIP or 7z containing one game installation can also be selected.
From a terminal:
From a terminal in the extracted package on Linux or macOS:
```sh
openbmh_play --data "path/to/game" --save-directory "path/to/saves"
openbmh_cli --console --data "path/to/game" --saves "path/to/saves"
./OpenBMH --data "path/to/game" --save-directory "path/to/saves"
./openbmh_cli --console --data "path/to/game" --saves "path/to/saves"
```
Use a writable save directory and keep backups of existing games. German editions are the primary compatibility target. **Football Limited / English data support is experimental**; original V2.20 save import and some edition-specific behaviour remain limited. See the [0.1 release notes](docs/release/0.1/RELEASE_NOTES.md).
In Windows PowerShell, use `.\OpenBMH.exe` and `.\openbmh_cli.exe` instead.
To report a problem, start the game with `-debug`. It then writes `openbmh-debug.log` (timestamped events, errors and refused actions) and `openbmh-stderr.log` into the `debug` sub folder of the save directory, and saves the game there after every match day (`DBG00001.FBM`, `DBG00002.FBM`, ...). Attach the log and the last save to the report.
Use a writable save directory and keep backups of existing games. German editions are the primary compatibility target. **Football Limited / English data support is experimental**; original V2.20 save import and some edition-specific behaviour remain limited. See the [release notes](docs/release/1.0.12/RELEASE_NOTES.md).
## Features and direction
The graphical client and console share career management, matches, transfers, contracts, finances, training, stadium management and save handling. The console supports command batches, structured views and multiple manager clients. Audio is decoded from the user's installation where supported.
Version 0.1 establishes the playable engine and development interfaces. Later milestones introduce an open data format and typed model, configurable rules, a scalable interface and independently distributable content. These are goals rather than delivery dates; the [roadmap](docs/ROADMAP.md) describes their dependencies.
OpenBMH focuses on original-game compatibility, stability and community contributions. See the [contribution guide](CONTRIBUTING.md) and [maintenance roadmap](docs/ROADMAP.md).
## Build from source
The following recipes target v0.1.0. They require Git, CMake 3.24 or newer and a C++20 compiler. The first configure fetches pinned open-source dependencies. Native build and package results are documented for each release; these instructions do not claim an untested platform result.
The following recipes build OpenBMH 1.0. They require Git, CMake 3.24 or newer and a C++20 compiler. The first configure fetches pinned open-source dependencies. Native build and package results are documented for each release; these instructions do not claim an untested platform result.
Clone the public repository, then run the commands for your system:
```sh
git clone https://github.com/rezmer/openbmh.git
git clone https://github.com/Weyoune/openbmh.git
cd openbmh
```
@@ -50,7 +57,7 @@ Install Visual Studio 2022 or its Build Tools with **Desktop development with C+
cmake -S . -B build-windows -G "Visual Studio 17 2022" -A x64
cmake --build build-windows --config Release
ctest --test-dir build-windows -C Release --output-on-failure
.\build-windows\Release\openbmh_play.exe --data "path/to/game" --save-directory "path/to/saves"
.\build-windows\Release\OpenBMH.exe --data "path/to/game" --save-directory "path/to/saves"
```
### Linux
@@ -62,7 +69,7 @@ sudo apt install build-essential git cmake ninja-build pkg-config libgtk-3-dev l
cmake -S . -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build-linux
ctest --test-dir build-linux --output-on-failure
./build-linux/openbmh_play --data "path/to/game" --save-directory "path/to/saves"
./build-linux/OpenBMH --data "path/to/game" --save-directory "path/to/saves"
```
Use a newer CMake if your distribution ships a version older than 3.24. A Linux binary can still require system libraries such as GTK3; a ZIP is not a guarantee of portability across distributions.
@@ -77,7 +84,7 @@ brew install cmake ninja
cmake -S . -B build-macos -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=arm64
cmake --build build-macos
ctest --test-dir build-macos --output-on-failure
./build-macos/openbmh_play --data "path/to/game" --save-directory "path/to/saves"
./build-macos/OpenBMH --data "path/to/game" --save-directory "path/to/saves"
```
On Intel Macs omit the arm64 setting or select `x86_64`. These commands build terminal executables; they do not create a signed application bundle.
@@ -97,12 +104,14 @@ Reports with reproducible steps, documentation corrections and focused patches a
## How the project was developed
The implementation grew from study of file formats and behaviour of a legally obtained game installation. The public repository contains independently written implementation and format documentation. It does not contain the proprietary implementation or its extracted resources.
The implementation grew from study of file formats and behaviour of a legally obtained game installation. The public repository contains independently written implementation and format documentation. It also contains the numeric tables and constants of the Diamond edition 3.7 executable (rates, positions, prices; `src/formats/diamond_constants.inc`, generated by `tools/diamond_constants`) so that the game runs from its asset files alone. It does not contain the executable's program code or any original game text, graphics, audio or master data.
## License and thanks
OpenBMH's own code and documentation are licensed under **GNU GPL version 3 only**, SPDX **GPL-3.0-only**. [LICENSE](LICENSE) contains the unchanged GPLv3 text; the example wording in its appendix does not change this project's version choice. Game content has separate ownership and is not covered by this license.
Release source is identified by the matching version tag: [v0.1.0](https://github.com/rezmer/openbmh/tree/v0.1.0) for this version. Binary releases must accompany or offer the corresponding source and build/relinking materials required by the applicable licenses. The tag identifies application source; it does not replace required materials for linked third-party components.
Every published binary release identifies its matching source tag and provides a corresponding source archive. Binary releases must accompany or offer the corresponding source and build/relinking materials required by the applicable licenses. The tag identifies application source; it does not replace required materials for linked third-party components.
Bundled components retain their own licenses, including Nuked OPL3 under LGPL-2.1-or-later. See [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md) and [ACKNOWLEDGEMENTS.md](ACKNOWLEDGEMENTS.md).
The supplied project start artwork is embedded at native resolution; see [start-screen artwork](docs/START_SCREEN.md). It replaces the original title image while the game continues to use your own original data and assets.
+1
View File
@@ -4,6 +4,7 @@ OpenBMH's own code and documentation use GPL-3.0-only. This does not replace the
| Component | Version used by the build | License | Included notice |
|---|---|---|---|
| [stb_image](https://github.com/nothings/stb/blob/013ac3beddff3dbffafd5177e7972067cd2b5083/stb_image.h) | 2.30, vendored header; JPEG decoder only | MIT or public-domain alternative | [stb_image.txt](docs/licenses/stb_image.txt) |
| [SDL2](https://github.com/libsdl-org/SDL/tree/release-2.32.10) | 2.32.10, or an explicitly selected system SDL2 | zlib license | [SDL2.txt](docs/licenses/SDL2.txt) |
| SDL2 HIDAPI code | Included with SDL2 | BSD-3-Clause option; upstream also offers GPL-3.0 and its original license | [license options](docs/licenses/SDL2-HIDAPI-options.txt), [BSD text](docs/licenses/SDL2-HIDAPI-BSD.txt), [original text](docs/licenses/SDL2-HIDAPI-original.txt) |
| SDL2 yuv2rgb code | Included with SDL2 | BSD-3-Clause | [SDL2-yuv2rgb.txt](docs/licenses/SDL2-yuv2rgb.txt) |
+18
View File
@@ -0,0 +1,18 @@
# OpenBMH Classic start artwork
The project maintainer supplied this new start-screen artwork for use and
repository distribution with this application. It is not extracted game content.
The repository license applies to project artwork; original game assets remain
external. The unmodified upstream decoder has its separate documented license.
`start-screen.jpg` retains the supplied image's native **1448 × 1086** pixels.
It is an optimized progressive JPEG at quality 92 with 4:4:4 chroma sampling,
without EXIF or other input metadata. It occupies 587,410 bytes.
The application embeds it at build time and decodes it once at startup, so
installed applications need no image sidecar or original title-screen VGA.
The SDL renderer uses the actual image dimensions while showing the title,
including high-DPI output and aspect-preserving side bars, then restores the
320 × 240 game/input canvas. A complete left or right mouse click continues;
there is no loading-ball animation. Changing the artwork also requires an
explicit review/update of its SHA256 in the public-source guard.
Binary file not shown.

After

Width:  |  Height:  |  Size: 574 KiB

+4
View File
@@ -0,0 +1,4 @@
# SPDX-License-Identifier: GPL-3.0-only
file(READ "${INPUT}" artwork HEX)
string(REGEX REPLACE "(..)" "0x\\1," artwork "${artwork}")
file(WRITE "${OUTPUT}" "// Generated from the repository-owned compressed start screen.\n#include \"app/start_screen_data.hpp\"\nnamespace bmh::app {\nconst unsigned char start_screen_jpeg[] = {${artwork}};\nconst std::size_t start_screen_jpeg_size=sizeof(start_screen_jpeg);\n}\n")
BIN
View File
Binary file not shown.
+13 -2
View File
@@ -10,7 +10,7 @@ ctest --test-dir build --output-on-failure
The public checkout does not include game data. Tests that require a game installation are conditional; configure with `-DBMH_DATA="path/to/game"` to make locally available data eligible. Private saved-game fixtures are not supplied by the project. Read the test output to distinguish executed and skipped checks.
Main programs are `openbmh_play` (graphical game) and `openbmh_cli` (console and protocol). Single-configuration generators put them in the build directory; multi-configuration generators normally add a configuration directory. On Windows they have the `.exe` suffix.
Main programs are `OpenBMH` (graphical game) and `openbmh_cli` (console and protocol). Single-configuration generators put them in the build directory; multi-configuration generators normally add a configuration directory. On Windows they have the `.exe` suffix.
## Windows
@@ -45,8 +45,19 @@ Use native toolchain/dependency architectures consistently. A terminal executabl
## Run with your data
```sh
build/openbmh_play --data "path/to/game" --save-directory "path/to/saves"
build/OpenBMH --data "path/to/game" --save-directory "path/to/saves"
build/openbmh_cli --console --data "path/to/game" --saves "path/to/saves" --seed 1
```
For redistribution, include [LICENSE](../LICENSE), [THIRD_PARTY_NOTICES.md](../THIRD_PARTY_NOTICES.md), the full texts in [licenses/](licenses/README.md), and the corresponding source and build information required by the applicable licenses. Inspect the actual libraries in each platform package; static SDL2 alone does not establish that every dependency is static.
## Build the data-free CI subset
`cmake --build build` compiles every development helper and test. With no private integration data configured, CI builds both products and every executable actually referenced by CTest instead:
```sh
python3 tools/ci/build_runnable_tests.py --build build --config Release --parallel 2
ctest --test-dir build -C Release --output-on-failure
```
Tests whose inputs are unavailable still report a skip through the normal optional-data helper; they are not counted as passes. Supplying integration data during configuration causes their real programs to enter this build subset automatically. Source-export and build-discovery checks run separately in CI.
+8 -3
View File
@@ -139,12 +139,16 @@ This index includes registered and reserved names. `ListOptions` and `Help` from
| `SetSquadSheet` | sheet:enum(A,B) | Set Squad Sheet. See current Help for behaviour and bounds. |
| `SetMarketVisible` | on:bool | Set Market Visible. See current Help for behaviour and bounds. |
| `ShowPlayer` | player:Player | Show Player. See current Help for behaviour and bounds. |
| `ShowOffers` | player:Player | existing bids for an owned listing; raw bid slots 0..3 |
| `AcceptOffer` | player:Player, bid:int(0..3) | accept an existing bid before weekly expiry |
| `SellPlayer` | player:Player | VER-KAUFEN: put an own player on the list |
| `LoanOutPlayer` | player:Player, months:int(12\|24) | VER-LEIHEN: offer an own player for loan |
| `BuyPlayer` | player:Player | VER-KAUFEN on a market player: the offer editor |
| `HirePlayer` | player:Player, months:int(12\|24) | VER-LEIHEN on a market player: the loan offer |
| `OpenOffers` | player:Player | Open Offers. See current Help for behaviour and bounds. |
| `OpenSearch` | – | Open Search. See current Help for behaviour and bounds. |
| `ShowSearchProfile` | – | SUCHEN: your search profile as 18 values (positions, age, strength, attributes, sides, price classes) |
| `SuggestSearchProfile` | [whole:bool], [apply:bool] | VORSCHLAG: the profile your squad asks for; `apply` stores it and lists the matching players |
| `SetSearchProfile` | values:[18 numbers], [apply:bool] | SUCHEN: store the profile; all values 0 or all 1 count as no search; `apply` lists the players on the transfer list that fit (the original's "Spieler ... ist interessant!" boxes) |
| `OpenPoach` | – | ABWERBEN: pick a player of another club (Transfer.Poach) |
| `ShowTransferNews` | [count:int] | Show Transfer News. See current Help for behaviour and bounds. |
| `ShowTeamInfo` | – | Show Team Info. See current Help for behaviour and bounds. |
@@ -308,9 +312,10 @@ This index includes registered and reserved names. `ListOptions` and `Help` from
| Command | Parameters | Purpose |
|---|---|---|
| `ShowEnvironment` | – | staff levels and the youth academy |
| `ShowEnvironment` | – | six monthly budgets and three youth tables |
| `SetStaffLevel` | role:enum(AssistantCoach,Doctor,Physio), level:int(0..6) | click a staff tile: level 0..6, 5 000 a month each |
| `SetYouthAcademy` | state:enum(On,Off) | start (July/August) or stop the youth academy |
| `SetYouthLevel` | team:enum(Youngest,Academy,Oldest), level:int(0..6) | set a youth team’s monthly budget |
| `SetYouthAcademy` | state:enum(On,Off) | compatibility alias: middle youth budget at level 6 or 0 |
### `Balance`
+1 -1
View File
@@ -1,6 +1,6 @@
# Text, encoding and editions
The installation supplies game text and names. The command vocabulary stays stable across editions; it is not translated into the selected game's display language. German and English installation data can have different text, league contents, executable layouts and currency presentation. English support remains experimental as described in the [release notes](../release/0.1/RELEASE_NOTES.md).
The installation supplies game text and names. The command vocabulary stays stable across editions; it is not translated into the selected game's display language. German and English installation data can have different text, league contents, executable layouts and currency presentation. English support remains experimental as described in the [release notes](../release/1.0/RELEASE_NOTES.md).
Legacy bytes are decoded at the display boundary. Client-facing text is intended to be UTF-8, while save and database offsets refer to legacy byte pools. Avoid using a displayed name as a persistent identifier: names may be edited, ambiguous or rendered differently. Prefer the ID domain required by the current command.
+3 -1
View File
@@ -209,7 +209,9 @@
"Transfer";"BuyPlayer";"player:Player";"VER-KAUFEN on a market player: the offer editor";"E_RULE";"";"";"partial";"06-verein.md"
"Transfer";"HirePlayer";"player:Player, months:int(12|24)";"VER-LEIHEN on a market player: the loan offer";"E_RULE";"";"";"ready";"06-verein.md"
"Transfer";"OpenOffers";"player:Player";"Open Offers. See current Help for behaviour and bounds.";"—";"";"";"partial";"06-verein.md"
"Transfer";"OpenSearch";"–";"Open Search. See current Help for behaviour and bounds.";"—";"";"";"partial";"06-verein.md"
"Transfer";"ShowSearchProfile";"–";"SUCHEN: your search profile as 18 values";"";"";"";"partial";"06-verein.md"
"Transfer";"SuggestSearchProfile";"[whole:bool], [apply:bool]";"VORSCHLAG: the profile your squad asks for; apply stores it and lists the matches";"E_RULE";"";"";"partial";"06-verein.md"
"Transfer";"SetSearchProfile";"values:[18 numbers], [apply:bool]";"SUCHEN: store the search profile; apply lists the matching players";"E_BAD_ARGUMENT";"";"";"partial";"06-verein.md"
"Transfer";"OpenPoach";"–";"ABWERBEN: pick a player of another club (Transfer.Poach)";"—";"";"";"ready";"06-verein.md"
"Transfer";"ShowTransferNews";"[count:int]";"Show Transfer News. See current Help for behaviour and bounds.";"—";"";"";"partial";"06-verein.md"
"Transfer";"ShowTeamInfo";"–";"Show Team Info. See current Help for behaviour and bounds.";"—";"";"";"partial";"06-verein.md"
1 window command parameters effect errors engine c4 status source
209 Transfer BuyPlayer player:Player VER-KAUFEN on a market player: the offer editor E_RULE partial 06-verein.md
210 Transfer HirePlayer player:Player, months:int(12|24) VER-LEIHEN on a market player: the loan offer E_RULE ready 06-verein.md
211 Transfer OpenOffers player:Player Open Offers. See current Help for behaviour and bounds. — partial 06-verein.md
212 Transfer OpenSearch ShowSearchProfile – Open Search. See current Help for behaviour and bounds. SUCHEN: your search profile as 18 values — partial 06-verein.md
213 Transfer SuggestSearchProfile [whole:bool], [apply:bool] VORSCHLAG: the profile your squad asks for; apply stores it and lists the matches E_RULE partial 06-verein.md
214 Transfer SetSearchProfile values:[18 numbers], [apply:bool] SUCHEN: store the search profile; apply lists the matching players E_BAD_ARGUMENT partial 06-verein.md
215 Transfer OpenPoach – ABWERBEN: pick a player of another club (Transfer.Poach) — ready 06-verein.md
216 Transfer ShowTransferNews [count:int] Show Transfer News. See current Help for behaviour and bounds. — partial 06-verein.md
217 Transfer ShowTeamInfo – Show Team Info. See current Help for behaviour and bounds. — partial 06-verein.md
+164 -1
View File
@@ -2,7 +2,7 @@
OpenBMH aims to preserve the familiar game while handling malformed input and unsafe edge cases explicitly. A reconstruction can remain faithful without reproducing a crash or pretending to implement an unknown path.
- Content such as names, text, graphics and edition-specific tables is loaded from the user's installation. OpenBMH's shared rule base supplies simulation values; selecting another data edition does not select a separate engine.
- Names, text, graphics and compatible data tables come from the user's installation. The common gameplay implementation follows the documented Diamond 3.7 engine policy; original programme instructions are not executed or selected as separate engines.
- Safety checks reject transactions that would exhaust required return capacity, use stale identities or lose a valid state. Unsupported operations report their limitation rather than inventing an outcome.
- Calendar progression handles boundary days and seasonal transitions without relying on unsafe fixed-day assumptions.
- Saves are written from the committed session state. Saving does not deliberately replay unrelated game actions.
@@ -11,3 +11,166 @@ OpenBMH aims to preserve the familiar game while handling malformed input and un
Intentional changes in code should use the marker `OpenBMH deviates from the original:` and explain their purpose. Adding a new behaviour or balance change requires a concrete description and relevant tests; this page is not permission to substitute guessed rules.
The [generated differences catalogue](DIFFERENCES.md) lists these markers with links to their source files.
## Application exit confirmation
Closing the window, exiting with Escape or confirming the desktop's exit control
opens a native confirmation dialog. BMH data uses German text and Football
Limited data uses English. Enter, Escape and closing the confirmation cancel the
exit; only the explicit Quit/Beenden button permits normal shutdown. Cancelling
keeps the current dialog or match owner alive without a turn or implicit save.
An unavailable native message box also cancels the request. This applies to
voluntary application exits, including quit events received during animations;
normal completed-career handling remains separate.
## Common engine and source data
Loaded executable images retain their own rule tables. Career strength ranges are read from all nine pairs of the supplied original table.
The common engine uses the Diamond 3.7 six-budget monthly environment model for every supported source-data edition, including Diamond 3.6 and Football Limited. Original programme instruction fingerprints do not select another engine or block compatible data. The six numeric budget increments are read from the supplied table and installed together only when all are present and nonzero; malformed layouts remain rejected. Existing saved lump-sum academy contracts retain their established accounting until edited. English translation supplies the actual English geometry, steps and suffixes for this common model. The old floppy executable remains unsupported, and Football Limited remains experimental.
Football Limited's data distinguishes five internal domestic slots from four
player-visible levels. Fresh manager selection cycles those four levels and
hides the internal fifth picker group; confirmation rejects hidden targets and
clubs before changing options or consuming RNG. Additional club pages remain
separate. Internal sizes, squads, rankings and fixtures are retained, and saved
internal league values do not cause a general load rejection.
Release acceptance of individual editions is recorded separately from their recognition. Source compatibility and automated tests do not establish full original-game or platform validation.
OpenBMH deviates from the original: graphical startup shows the supplied static
137.VGA title with its embedded palette, without the DOS loading animation.
It waits for a complete left or right mouse click before the game options.
The title does not advance on a timer; its confirming press and release are
consumed so they cannot also change a setup option.
Setup restores ordinary scene-backed manager dialogs before a career is created
or loaded. The executable's boot-only black dialog mode is process state and is
not restored from native save files. Football Limited's translated data includes
its own verified calendar year and weekday operands; German epochs are not used
as a substitute for the English edition.
## Diamond 3.7 foreign crests
The supplied edition controls whether foreign league clubs use individual
original crests or the original neutral crest. OpenBMH recognizes the verified
Diamond 3.7 drawing gate and uses its database/save selectors and W atlases.
Older drawing gates retain their own behaviour; no external crest pack is needed.
The automatic lineup installs the supplied foreign-player rule switch alongside the career tables. Where enabled, it restores the original three/two-player limit, reserve swaps with board-coordinate preservation and the short-lineup outcome when domestic reserves are unavailable. This does not consume additional random draws.
New careers correct the original all-zero EM qualification placeholders to the original national-team placeholders. Supplied nonzero seeds and restored savegame state are not rewritten by this initialization.
## Stadium extension in1.0.3
The user-requested stadium extension raises standard A–H maxima to14/24/14/20/
14/24/14/20thousand places (144,000total), keeping larger supplied custom limits
where the saved byte fields can represent them. Original unit prices remain
edition-owned. Each stand's base build period is at least two weeks per1,000
places of its expanded maximum and never shorter than the edition's original
period. Contractor shortening remains unchanged.
The original Diamond3.6/3.7 table's14k stands really used25weeks versus30weeks
for8k and37weeks for18k. That was original data, not a mistaken timer. Expanded
limits/time policy is an intentional improvement. The UI now validates quotes
against the actual edition and this shared policy rather than hardcoded Diamond
prices and sizes. Existing eight capacity/construction bytes and saves are retained.
## Daily interest at large native balances
OpenBMH deviates from the original: daily debt and deposit interest uses 64-bit
intermediate arithmetic before the original integer divisions. The balance-plan
preview uses the same calculation. Original rates, division order and random
consumption remain unchanged. Account balances and accumulated statistics retain
the native 32-bit save representation; this change does not add unlimited account
balances or change the original high-cash deduction policy.
OpenBMH deviates from the original: the legacy transfer market allows an owned
listing to open incoming offers before its weekly expiry. Select the player and
use the sale action (or Enter). Cancel keeps the listing and offers unchanged;
acceptance uses the existing buyer eligibility, player salary qualification and
transaction rules. Human-buyer loans still require their separate consent and
allocator context and are unavailable in this early review. Viewing/canceling
consumes no RNG. The weekly auction remains unchanged.
The transfer overview processes one selected player per action and renders action
feedback in its footer. A cleared unsuccessful listing can be listed again
immediately; there is no additional cooldown. The manager listing action refuses a full ordinary market
without allocating a reserved special-offer row. These are explicit
application outcomes instead of the Original's destructive overflow/dialog paths.
OpenBMH deviates from the original: a newly initialized squad board entry clears
retirement, refused-negotiation and month-processing flags left by its previous
occupant. The Original leaves that byte intact when reusing the row, so purchases
and academy arrivals can inherit a refusal to renew. Existing players' genuine
retirement/refusal flags remain effective. The initial academy contract remains
two years; a young arrival can immediately negotiate any supported renewal term.
This corrects the reused-row mechanism; it does not establish a fixed 200–300
season threshold or repair ambiguous refusal flags in existing saved careers.
Bank finance-overview totals and gains use 64-bit read-only projections and
currency formatting, including values beyond a signed native account word.
Saved cash, deposits, loan fields and holdings retain their original widths.
This prevents a positive combined portfolio from appearing negative; it does
not recover amounts that have already overflowed inside a native saved field.
Live ball, set-piece and shot animations retain
visible scoreboard digits at the chance-preview value until the result view.
The simulation still commits goals, statistics and random draws at their existing
boundaries. Post-match overview dismissal owns its full mouse gesture, including
release after pointer movement, before the following calendar decision can open.
The pitch uses each edition's original position-distance tables, atlas swatches
and pointer bitmap for placement feedback; this display state is not serialized.
OpenBMH deviates from the original: cumulative human-club appearances, goals and
assists have optional 64-bit counters. Original byte/word fields keep their
modulo representation for gameplay/layout compatibility; roster projections use
the wider values. Tracking begins with the surviving legacy values, so high bits
already lost in an imported save cannot be recovered. A new arrival clears the
previous squad occupant's totals. Club promotion remaps counter ownership.
Title-holder and cup-winner lists retain all observed seasons in the same optional
OpenBMH save extension. The Original nine-by-fifty table remains a rolling window.
The archive captures that window before it shifts, and the title list can page
through the archived rows. Late legacy imports start with their surviving fifty
seasons; earlier winners are unknown and are not fabricated. Stored winner names
are historical snapshots, so later renaming and promotion cannot change them.
The separate manager-achievements graph retains its Original fifty-season view.
These records use a versioned `OBMHEXT1` extension after the Original name pools;
see [save format](formats/LONG_CAREER.md). Original programs and older OpenBMH
writers do not preserve this archive. Keep an OpenBMH backup when exchanging
careers with those writers. The native calendar still has its existing signed
16-bit season limit; this patch does not claim an unlimited calendar.
## Monthly high-cash loss limit
OpenBMH deviates from the original: the high-cash bank robbery can occur at most
once per manager and calendar month. The original threshold above 100 million
and random loss of 10–20 million remain. A blocked repeat consumes no random
draw. Month boundaries follow the same source calendar used by daily processing,
and the guard is stored in the optional BRM1 section of OBMHEXT1 saves.
An older save has no record of past robberies. Its first qualifying high-cash month
receives a grace period without a loss or random draw; subsequent saves retain
that guard. The next calendar month can trigger the ordinary loss. Import cannot
infer whether an event already occurred before this feature. Fresh histories
receive the same initial grace month.
OpenBMH deviates from the original: monthly fund/property dividends multiply
unit price by the dividend factor in 64 bits before the existing integer division.
The monthly and annual previews and weekly offers use the same widened product.
Per-unit rounding and the selected legacy/typed recipient policy are unchanged.
This corrects intermediate overflow for representable dividends; account,
deposit, property book value and monthly totals still use their native 32-bit
storage and can overflow. It is not a complete large-balance finance fix.
Release-driven incoming-transfer presenters require a matching press observed
inside that modal. An orphan or repeated release from the preceding result table
cannot decline an offer or dismiss its confirmation. Repeated presses while a
button is held still form one gesture; fresh left/right clicks keep their actions.
## Host file overwrite confirmation
The file picker reuses the Original overwrite question and Ja/Nein button
layout. A separate Yes click or Enter confirms; repeated double-clicks do not.
OpenBMH deviates from the original: host file operations use the shared dialog's
system identity because the picker does not own a live manager portrait projection.
+19 -14
View File
@@ -6,32 +6,37 @@ See [Compatibility decisions](COMPATIBILITY.md) for the overall policy. These en
describe deliberate changes; they are not a list of every known compatibility limit.
- [src/app/career_session.cpp](../src/app/career_session.cpp): supports designated set-piece record initialization and validation.
- [src/cli/console/windows_environment.cpp](../src/cli/console/windows_environment.cpp): uses monthly staff levels in increments of five thousand and the supported youth-academy controls.
- [src/formats/le.hpp](../src/formats/le.hpp): applies a shared supported rule profile when loading editions with different rule-table values.
- [src/formats/rule_base.cpp](../src/formats/rule_base.cpp): normalizes live-scene defaults, league strength ranges, option defaults, stadium prices and capacities, betting limits, and the foreign-player limit across supported editions.
- [src/formats/rule_base.hpp](../src/formats/rule_base.hpp): normalizes live-scene options, league strength ranges, option defaults, stadium prices and capacities, betting limits, and the foreign-player limit.
- [src/game/balance_plan.cpp](../src/game/balance_plan.cpp): omits the discontinued youth-group cost categories and uses league-specific youth-academy limits.
- [src/game/balance_plan.hpp](../src/game/balance_plan.hpp): uses the supported staff and youth-academy cost categories.
- [src/app/main.cpp](../src/app/main.cpp): display the repository-owned title at its native resolution until a complete left/right click, without loading balls.
- [src/app/quit_confirmation.hpp](../src/app/quit_confirmation.hpp): confirms application exit with a localized native dialog, with cancellation selected by default.
- [src/game/career.cpp](../src/game/career.cpp): skips reserved calendar positions when assigning a joining manager to a club.
- [src/game/career.hpp](../src/game/career.hpp): uses the supported player-generation ranges and excludes reserved calendar positions when assigning managers.
- [src/game/desk_actions.cpp](../src/game/desk_actions.cpp): uses the supported transfer-fee arithmetic and designated set-piece fields.
- [src/game/desk_actions.hpp](../src/game/desk_actions.hpp): supports designated set-piece records and the supported transfer-editor rules.
- [src/game/environment.hpp](../src/game/environment.hpp): enables the supported youth academy and represents staff levels in monthly increments of five thousand.
- [src/game/desk_actions.hpp](../src/game/desk_actions.hpp): a seller may accept an existing bid before expiry.
- [src/game/environment.cpp](../src/game/environment.cpp): the common Diamond 3.7 monthly environment model applies to every supported source-data edition.
- [src/game/highscore.cpp](../src/game/highscore.cpp): reads the supported edition-specific high-score format from the loaded image.
- [src/game/lineup.cpp](../src/game/lineup.cpp): disables the foreign-player limit in the supported rule profile.
- [src/game/lineup.hpp](../src/game/lineup.hpp): disables the foreign-player limit and supports owner-bound designated set-piece selection.
- [src/game/lineup.hpp](../src/game/lineup.hpp): supports owner-bound designated set-piece selection.
- [src/game/match.hpp](../src/game/match.hpp): uses the enhanced injury selection and suspension rules.
- [src/game/match_engine.cpp](../src/game/match_engine.cpp): supports designated set-piece takers, the enhanced injury tables, and the extended suspension fields.
- [src/game/month.cpp](../src/game/month.cpp): omits the two discontinued youth-group cost categories from monthly accounts.
- [src/game/season.cpp](../src/game/season.cpp): uses the enhanced youth-academy season settlement and player-generation rules.
- [src/game/season.hpp](../src/game/season.hpp): uses the enhanced youth-academy season settlement and player-generation rules.
- [src/game/month.cpp](../src/game/month.cpp): keep the price product in 64 bits until division, retaining per-unit truncation and recipient policy.
- [src/game/national.cpp](../src/game/national.cpp): a new arrival must not inherit the previous occupant's retirement/refusal/month-processing flags.
- [src/game/season.cpp](../src/game/season.cpp): age/retire each player once, even when a temporary offer row references his club slot or regeneration moves him to a later free-agent slot.
- [src/game/season.cpp](../src/game/season.cpp): initializes the empty EM qualifier seeds with national teams, preventing club zero from entering the EM.
- [src/game/stadium_blocks.cpp](../src/game/stadium_blocks.cpp): allow 144,000 standard places and size-aware construction times while retaining edition-owned unit prices.
- [src/game/state.hpp](../src/game/state.hpp): retains designated set-piece selections in the supported manager-record extension.
- [src/game/week.cpp](../src/game/week.cpp): widen products before annual-rate division so valid native account amounts do not overflow intermediate sums.
- [src/game/week.cpp](../src/game/week.cpp): an unknown history receives a grace month; later losses occur at most once per source month.
- [src/game/week.cpp](../src/game/week.cpp): uses the enhanced training rules: focus strength is at least five below its target, and completed skills rotate to another focus.
- [src/game/week.hpp](../src/game/week.hpp): uses the enhanced assistant-training rules, retaining the selected skill until it reaches its maximum.
- [src/game/weekly.cpp](../src/game/weekly.cpp): uses the supported weekly-event configuration, with its rule switch disabled.
- [src/game/weekly.hpp](../src/game/weekly.hpp): uses the supported weekly processing and transfer rule profile.
- [src/ui/advertising.cpp](../src/ui/advertising.cpp): uses the supported youth-academy cap and its saved cost fields.
- [src/ui/environment.cpp](../src/ui/environment.cpp): omits the two discontinued youth groups from the environment screen.
- [src/ui/bank.cpp](../src/ui/bank.cpp): read-only totals use wide arithmetic; individual saved account, price, holding and paid fields are unchanged.
- [src/ui/desk_state.cpp](../src/ui/desk_state.cpp): the desk shows the opponent's badge whenever the data has one.
- [src/ui/league_pairings.cpp](../src/ui/league_pairings.cpp): the computer tip is ignored silently once a visible result is known, instead of raising an engine error.
- [src/ui/league_table.hpp](../src/ui/league_table.hpp): uses three points for a win in the supported rule profile.
- [src/ui/pitch.cpp](../src/ui/pitch.cpp): supports owner-bound designated set-piece selection in the extended manager record.
- [src/ui/save_load.cpp](../src/ui/save_load.cpp): focuses the host save filename on entry and selects an existing name for replacement.
- [src/ui/save_load.cpp](../src/ui/save_load.cpp): omits DOS drive and delete buttons in the directory-confined save/load view.
- [src/ui/save_load.cpp](../src/ui/save_load.cpp): the host file picker uses the shared dialog's system identity without a live manager portrait projection.
- [src/ui/save_load.cpp](../src/ui/save_load.cpp): permits cancelling host file dialogs with the right mouse button.
- [src/ui/settings.cpp](../src/ui/settings.cpp): the settings page names the product and its build version instead of the original's version text.
+75
View File
@@ -0,0 +1,75 @@
# Measurement against Diamond 3.7: matchdays, weekly processing, month change, season end
OpenBMH Classic follows the game and match engine of BMH 2026-27 DIAMOND Edition 3.7. Besides the routine-by-routine
comparisons (see the 1.0.9 release notes) the engine is checked against **recordings of the real 3.7** running in an
emulator (DOSBox-X). A recorder reads the emulator's memory without touching the game: at every match minute, at every
change of the calendar day and at every pause it stores the random number states (game and C library generator) and all
tables the engine reads (squads, player words, team flags, cards, managers, stock market, transfer list, mailbox, ...).
The port replays the same turn from the save game that precedes it and is compared at every one of these checkpoints.
The recorder and the automation that operates the original are not part of this repository (they need the original
program); the checker is `tests/week_check.cpp`.
## Scope of the November 2026 series
- 73 recorded "Weiter" turns of one career, from the first Saturday in August 2026 (game day 38) through the whole
first season, the season end on 1 July 2027 (day 365) and most of the second season up to April 2028 (day 645).
The human manager's club played every matchday (league, cup and the indoor tournament). Incoming transfer offers
were declined.
- **Match phase:** 7,642 recorded match minutes, every one inside the interval of random draws that the port passes
through, none outside. Final whistle, stoppage time and the first extra-time pass match in every turn, in the second
season as well.
- **Weekly processing:** 70 runs of the routine ported from the original (days 43 to 645). At the desk after each turn
the random states and **all tables are identical** to the recording.
- **Month change:** 17 runs (1 September 2026 to 1 April 2028, among them the change of the year and the summer break).
Identical at the desk afterwards.
- **Season end:** one run (day 365 with the last weekly processing and the month change, from the last matchday of the
season on 8 May 2027 to the desk of 1 July 2027). Identical, all tables.
- **Indoor tournament:** eleven rounds (see below).
- Training, the stock market, the matchday preparation and the kick-off of the next matchday are part of the same turns
and match as well (the match groups built by the port equal the first minute snapshot of the next matchday).
Of the 73 evaluated turns 71 are identical at the desk (random states and all tables; the transfer list is shown
separately, see below). The other two are explained:
- One differs in a single lineup flag of one player slot that the original clears when the manager's lineup page is
shown (a routine of the user interface, not of the engine); the recording passed through that page.
- The last round of the indoor tournament ends with the tournament processing of the original (prizes, next
fixtures); the checker replays only the playing part of an indoor round, so that part is not compared.
## Indoor tournament
All eleven recorded rounds play their 40 minutes with the same random draws as the original. At the kick-off, however,
the six strength values of the side records differ by 1 to 4 points in about half of the rounds (the port is mostly
higher); ordinary matches show no such difference. This is tracked as issue 82. The desk after the round is identical in
ten of eleven rounds (the eleventh is the tournament end above).
## How to read the "DIFF" lines of the checker
The recorder takes a day snapshot when the date changes, i.e. **inside** the original's processing of that day; the
port's state belongs to the end of the processing. The checker therefore prints such checkpoints as "late snapshot ...
draws ahead of the port's state, not counted". They are not differences of the engine: the checkpoint after them (and the
desk at the end of the turn) is identical in every counted turn. The transfer list is compared but not counted (the
amounts of new bids depend on stale data in the original, documented in the source); a few desks show a handful of
bytes there and the line says so.
## Recordings that were not used
Four turns of the series were dropped, none because of a difference of the engine: two were disturbed by the operation
of the original (a mouse click that listed two players for transfer; a turn that clicked through several matchdays
and did not keep the recorder running), two belong to the start of the second season before the first matchday
(the season start screens with the Super Cup; no minutes were recorded). A first recording of the season end failed
because the recorder gave up after 60 s of the long end-of-season processing; recorded again with a longer wait it
matches.
## Not covered
- Only one career and one human manager. Contract expiry on 1 July and the other manager decisions at the season end
were not driven by a human in this series.
- The start of the second season between the desk of 1 July and the first matchday (Super Cup, season start screens)
was played without recording.
- Offers made by the weekly processing to the human manager (new transfer bids): the amounts depend on a stale stack
value in the original and are not reproduced (documented in the source).
- Foul and card chances are derived from the constants of the 3.7 code and show no difference in the recorded
minutes, but a deliberate comparison of the single routine was not made.
- A second season end and later seasons; the end of the indoor tournament.
+12 -21
View File
@@ -1,29 +1,20 @@
# Roadmap
# Community maintenance roadmap
OpenBMH combines a playable reconstruction with a foundation for extension. These milestones describe direction and dependencies, not promised dates.
OpenBMH reconstructs the original Bundesliga Manager Hattrick experience using the player's own game data. Development priorities are compatibility, reliability and accessible community maintenance.
## 0.1: a usable engine
## 1.0 acceptance
Career management, matches, finances, transfers, original-style SDL2 screens, audio and a console share the same session logic. German game data is the primary target; Football Limited support is experimental. Compatibility and remaining limitations are documented in the [release notes](release/0.1/RELEASE_NOTES.md).
- Validate German CD-compatible BMH and supported Diamond installations, including career setup, management, matches and season transitions.
- Preserve original data and save layouts; document intentional bug corrections.
- Check Windows x64, macOS ARM64 and Linux x64 builds and publish matching source archives, licenses and checksums.
- Keep release limitations and reproducible defects visible in the issue tracker.
## 0.15: broader English compatibility
## Continued maintenance
Complete edition-specific loading, presentation, competitions and sound support. Imported content determines names, text, clubs and league organisation; a shared engine rule base defines the simulation.
Prioritize reproducible gameplay, save, rendering, input and platform bugs. Keep improvements focused and cover unsafe state transitions with regression tests. Contributions should preserve the familiar interface and the supplied edition's content and competition structure.
## 0.2: open data and typed state
Football Limited remains experimental. Improvements require independent checks of its original loading, presentation, competitions, audio and save compatibility; German acceptance does not establish English acceptance.
Introduce a documented import format and a native save format, retaining supported legacy import where practical. Replace fixed-layout state gradually with typed clubs, players, contracts and competitions. Keep each intermediate stage usable and cover transitions with tests.
The SDL2 graphical client and console share the game/session layer. Community clients and automation should use the documented [console interface](CONSOLE_CLIENTS.md) and retain its ownership and revision checks.
## 0.3: configurable rules
Expose rule values and balance choices as configuration, with reproducible simulations to assess changes. Improve tactical automation, transfer decisions and scoring distributions through documented changes rather than hidden edition-specific branches.
## 0.4: adaptable interfaces and competitions
Add a scalable interface through the shared application/protocol boundary. Make league sizes and competition structures data-driven. Define content-pack formats for independently licensed artwork, names and other resources; do not distribute third-party material without permission.
## 0.5: independently distributable content
Provide original or freely licensed graphics, sound and generated football worlds so that OpenBMH can be played without proprietary game data. Support editors, new competitions and multiplayer clients built on the same engine interfaces.
The typed model and open format are prerequisites for flexible competitions, configurable rules and new content. See [architecture](architecture.md) for the current boundaries and [compatibility decisions](COMPATIBILITY.md) for intentional departures.
See [architecture](architecture.md), [compatibility decisions](COMPATIBILITY.md) and [contributing](../CONTRIBUTING.md) before changing shared behaviour. No proprietary game content belongs in public code, tests or releases.
+18
View File
@@ -0,0 +1,18 @@
# OpenBMH Classic start artwork
The project maintainer supplied this new start-screen artwork for use and
repository distribution with this application. It is not extracted game content.
The repository license applies to project artwork; original game assets remain
external. The unmodified upstream decoder has its separate documented license.
`start-screen.jpg` retains the supplied image's native **1448 × 1086** pixels.
It is an optimized progressive JPEG at quality 92 with 4:4:4 chroma sampling,
without EXIF or other input metadata. It occupies 587,410 bytes.
The application embeds it at build time and decodes it once at startup, so
installed applications need no image sidecar or original title-screen VGA.
The SDL renderer uses the actual image dimensions while showing the title,
including high-DPI output and aspect-preserving side bars, then restores the
320 × 240 game/input canvas. A complete left or right mouse click continues;
there is no loading-ball animation. Changing the artwork also requires an
explicit review/update of its SHA256 in the public-source guard.
+51
View File
@@ -0,0 +1,51 @@
# Desktop and advertising mouse input fixes
The optional desktop frame bit controls decoration, not whether the visible
widget contents accept input. The corrections reuse the Original renderer,
coordinates, layout records and action dispatchers.
- The date widget activates the same owned advance action as Anstoß, with or
without a frame. In a multiplayer turn this first hands control to the next
manager. The separate calendar/rescheduling menu keeps its own behavior.
- Stored icons remain clickable and draggable from unframed folders. Extraction
restores the actual icon record to the visible chain; the folder stays put.
Hidden or unlinked owners remain invalid. Removal corners keep their separate
transaction and mouse-release barrier. The same frame-origin correction also
covers the existing admission scale and five automation controls.
- A true double-click on an existing save opens the shared Original-style
overwrite question. A separate single click on Ja confirms, Nein returns to
the picker, and repeated double-click releases cannot write. Enter and cancel
paths remain. FBM, EIN and MEN use the same confirmation boundary.
- Advertising follows all nineteen original hit rectangles with palette0x27
outlines and the installed edition's detail/help text. Motion alone does not
change the career, revision or either random stream. Offers/calculators retain
their input owner; returning from them reevaluates the actual pointer, avoiding
a stale highlight without requiring another mouse movement.
## Validation
The focused configured-data tests are `app_desktop_input_tests`,
`app_advertising_input_tests`, `ui_desktop_input_tests`, `ui_save_load_tests` and
`ui_advertising_tests`. They cover frame variants, exact field boundaries,
canonical actions, stale/hidden-owner refusal, cancellation, input release,
overwrite confirmation and unchanged game/random state for presentation-only
input. The desktop input test isolates these checks from unrelated private
text/badge inventories; the existing full test retains its additional checks.
Private Linux SDL before/after captures and actual saved games are maintained in
`bmh_4k_ui/docs/qa/classic-extended-ui-input`. The fixtures use actual club/player
data with a controlled desktop layout. No results are fabricated. A successful
compile or CI run alone is not native Windows/macOS UI verification.
Tracked reports: [#51](https://github.com/Weyoune/openbmh/issues/51), [#52](https://github.com/Weyoune/openbmh/issues/52), [#53](https://github.com/Weyoune/openbmh/issues/53), [#54](https://github.com/Weyoune/openbmh/issues/54).
The primary regression run uses the supplied Diamond 3.7 installation. Unrelated
historical rendering fixtures retain their declared reference requirements.
Two existing Classic test fixtures were aligned with the already implemented
stadium-capacity policy and verified edition-specific crest gate; product
validation was not relaxed to satisfy those tests.
The overwrite prompt also maps the actual Football Limited English pointer.
The translation copies exactly that four-byte pointer and preserves adjacent
empty slots. The launcher translation-cache revision is advanced, so an existing
cached English installation receives the newly supported prompt as well.
+27 -2
View File
@@ -783,7 +783,7 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `EnglishLayoutTranslation157` | `0x6e094` | English image adapter |
| `EnglishLayoutTranslation158` | `0x6e0b8` | English image adapter |
| `EnglishLayoutTranslation159` | `0x6e0bb` | English image adapter |
| `EnglishLayoutTranslation16` | `0x6be4f` | English image adapter |
| `EnglishLayoutTranslation16` | `0x6be50` | English image adapter |
| `EnglishLayoutTranslation160` | `0x6e0d8` | English image adapter |
| `EnglishLayoutTranslation161` | `0x6e110` | English image adapter |
| `EnglishLayoutTranslation162` | `0x6e11c` | English image adapter |
@@ -1005,7 +1005,7 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `EnglishLayoutTranslation70` | `0x6d270` | English image adapter |
| `EnglishLayoutTranslation71` | `0x6d272` | English image adapter |
| `EnglishLayoutTranslation72` | `0x6d274` | English image adapter |
| `EnglishLayoutTranslation73` | `0x6d29c` | English image adapter |
| `EnglishLayoutTranslation73` | `0x6d29d` | English image adapter |
| `EnglishLayoutTranslation74` | `0x6d3b4` | English image adapter |
| `EnglishLayoutTranslation75` | `0x6d404` | English image adapter |
| `EnglishLayoutTranslation76` | `0x6d408` | English image adapter |
@@ -1045,6 +1045,11 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `Environment_FormatError_RuntimeField` | `0xa50f0` | German-compatible image / runtime field |
| `Environment_FormatError_RuntimeField2` | `0xa50f6` | German-compatible image / runtime field |
| `Environment_Render_TextPointer` | `0xaeb74` | German-compatible image / runtime field |
| `EnvironmentYouthTeams` | `0xbd4bc` | German-compatible image / runtime field |
| `EnvironmentYouthPositionSuffix` | `0xa1698` | German-compatible image / runtime field |
| `EnvironmentCostSuffix` | `0xa169d` | German-compatible image / runtime field |
| `EnvironmentYouthLeagueTextPointer` | `0xaeb78` | German-compatible image / runtime field |
| `EnvironmentYouthColors` | `0xa50fc` | German-compatible image / runtime field |
| `Environment_SetEnvironment_ExecutableField` | `0xaf394` | German-compatible image / runtime field |
| `EuropeNameTable` | `0xae710` | German-compatible image / runtime field |
| `EventPasses` | `0xa2ba1` | German-compatible image / runtime field |
@@ -1490,6 +1495,17 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `Pitch_Render_TextPointer3` | `0xae0f0` | German-compatible image / runtime field |
| `Pitch_Render_TextPointer4` | `0xae0f4` | German-compatible image / runtime field |
| `Pitch_Render_TextPointer5` | `0xae0f8` | German-compatible image / runtime field |
| `PitchPreferenceDepthBases` | `0xa3cc3` | German-compatible image / runtime field |
| `PitchPreferenceRed` | `0xa3cc7` | German-compatible image / runtime field |
| `PitchPreferenceGreen` | `0xa3cd1` | German-compatible image / runtime field |
| `OriginalPointerPixels` | `0xa45b4` | German-compatible image / runtime field |
| `EnglishPitchPreferenceDepthBases` | `0x6e230` | English image adapter |
| `EnglishPitchPreferenceRed` | `0x6e234` | English image adapter |
| `EnglishPitchPreferenceGreen` | `0x6e240` | English image adapter |
| `EnglishOriginalPointerPixels` | `0x70554` | English image adapter |
| `PitchOrderPositionPointers` | `0xa2a37` | German-compatible image / runtime field |
| `PitchOrderZoneMasks` | `0xa2a4b` | German-compatible image / runtime field |
| `PitchOrderZoneTextPointers` | `0xae818` | German-compatible image / runtime field |
| `Placements` | `0xbd38c` | German-compatible image / runtime field |
| `PlainBackground` | `0xa2569` | German-compatible image / runtime field |
| `PlanTicketPrice` | `0xa4856` | German-compatible image / runtime field |
@@ -1562,6 +1578,7 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `SaveLoad_Render_RuntimeField` | `0xa2334` | German-compatible image / runtime field |
| `SaveLoad_Render_RuntimeField2` | `0xa233f` | German-compatible image / runtime field |
| `SaveLoad_Render_RuntimeField3` | `0xa234a` | German-compatible image / runtime field |
| `SaveLoad_OverwriteQuestionPointer` | `0xa21c4` | German-compatible image / runtime field |
| `SaveLoad_Render_TextPointer` | `0xa1512` | German-compatible image / runtime field |
| `SaveLoad_Render_TextPointer2` | `0xae5f0` | German-compatible image / runtime field |
| `SaveLoad_Render_TextPointer3` | `0xae620` | German-compatible image / runtime field |
@@ -1983,3 +2000,11 @@ declarations change. Game text, resort, image and audio fallbacks belong outside
| `EnglishSixTeamFixtureTable` | `0x6eed4` | English image adapter |
| `EnglishTwelveTeamFixtureTable` | `0x6f0bc` | English image adapter |
| `EnglishTwentyTeamFixtureTable` | `0x6ee40` | English image adapter |
| `EnglishDesktopBinSourceX` | `0x6e180` | English image adapter |
| `EnglishDesktopBinSourceY` | `0x6e182` | English image adapter |
| `EnglishDesktopSocketSourceX` | `0x6e184` | English image adapter |
| `EnvironmentBudgetSteps` | `0xa50ff` | German-compatible image / runtime field |
| `EnvironmentVerifiedCodeBegin` | `0x6c000` | English image adapter |
| `EnvironmentVerifiedCodeEnd` | `0x6cb40` | English image adapter |
| `EnvironmentVerifiedHookBegin` | `0x7af65` | English image adapter |
| `EnvironmentVerifiedHookEnd` | `0x7b020` | English image adapter |
+37 -1
View File
@@ -9,7 +9,7 @@
| Plain header | Variable | Manager/date information for the load list |
| Signature area | 10 bytes | Eight-byte `KRON_FBM` signature and two following bytes |
| First ID | u32 | Container identifier |
| Version | 6 bytes | NUL-terminated version field, normally `V2.24` for the supported state layout |
| Version | 6 bytes | NUL-terminated version field, `V2.24` or the verified Diamond `V3.7` marker for this state layout |
| Second ID | u32 | Save identifier |
| Random byte | u8 | Header value |
| Initial key | u8 | Rolling-cipher seed |
@@ -26,8 +26,44 @@ The supported layout contains a fixed ordered block table, followed by four name
Each name pool has a u16 byte length followed by that many bytes, in club, player, referee and stadium order. These pools preserve renamed entities. The splitter rejects missing/truncated blocks or pools and requires exact stream consumption. See [STATE](STATE.md) for interpreted records and [M3D](M3D.md) for pool references.
## Optional OpenBMH state
After the four name pools, OpenBMH can append `OBMHEXT1`, a u16 block count,
then each block as a u32 identifier, u32 byte length and payload. There is at
most one such container and the decoder requires exact consumption of it.
Original saves have no container. The entire extension is included in the outer
rolling cipher and checksum.
Known OpenBMH-owned sections include:
| Identifier | Payload | Purpose |
|---|---|---|
| `OBLC` (`0x4f424c43`) | Versioned variable-length archive | [Long-career player counters and title winners](LONG_CAREER.md) |
| `BRM1` (`0x314d5242`) | Four little-endian u32 month-start keys (16 bytes) | Per-manager monthly high-cash robbery guard |
A robbery key is the absolute first day of the last blocked source-calendar
month. `UINT32_MAX` means unknown. An unknown high-cash history receives a
first qualifying grace month; later deductions can occur at most once per
calendar month. Managers have independent keys. A truncated or duplicate BRM1
section is rejected before game state is published.
These identifiers describe OpenBMH-owned payloads, not original executable
addresses. The container can also hold explicitly supported compatibility blocks,
such as edition-specific cup state. Unrecognized payloads are not a general
persistence API. Original programs and older OpenBMH writers may reject or
discard optional information: keep a backup before opening a new save with them.
## Edition compatibility
Diamond 3.7 uses the `V3.7` container label with the verified German V2.24 state
layout. Career loading, saved-desktop/preparation import and browser information
accept that exact label as well as `V2.24`. The checksum, full block/pool structure
and installed edition's database dimensions are still required. An accepted
version label cannot make a malformed or mismatched state valid. Ordinary
OpenBMH native saves continue to use the canonical `V2.24` output marker.
Unknown labels are rejected separately from checksum failures.
Original Football Limited V2.20 saves use a different state block list despite sharing the signature and rolling cipher. They are not interchangeable with the V2.24 layout. Reading an English installation and importing its original saves are separate features; do not edit a version string to bypass the distinction. OpenBMH's own English careers use the session's supported save representation.
Keep a backup before using a save with another engine version. Unknown bytes retained for compatibility are not safe targets for direct client manipulation.
+34
View File
@@ -0,0 +1,34 @@
# Optional long-career statistics and title archive
The existing `OBMHEXT1` container can contain block `0x4f424c43` (OpenBMH-owned,
not a guest memory address). Original state blocks and all four name pools retain
their sizes and ordering. No extension is emitted until an archive is needed.
Payload integers use little-endian encoding:
| Field | Encoding |
|---|---|
| Payload version | u32, currently 1 |
| Player/club record count | u32 |
| Known season record count | u32 |
| Each player/club record | u32 key, then six u64 counters |
| Each season record | u32 absolute zero-based season, then nine names |
| Each name | u16 byte length followed by Original-encoding bytes |
The player key is `(runtime_club << 12) | player_id`. The six counters are league,
national-cup and European-cup appearances, total appearances, goals and assists.
Club swaps remap keys; fresh squad entry initialization resets the new player's
club record. The Original byte/word fields continue to update normally.
Season names follow the nine Original title categories. An empty name is a known
season with no holder for that category. Missing season records are unknown,
not an assertion that no competition was held. Names are owned snapshots at the
award/capture time, independent of future club-number and name-pool changes.
A legacy import contributes only its surviving window; no earlier information
is inferred. The title list uses the earliest known absolute season when paging
and compensates for the native rolling-window year offset.
The decoder rejects unknown versions, truncated payloads, invalid/duplicate
identities and seasons, duplicate blocks and trailing bytes before publishing
archive state. Season records remain within the native signed 16-bit calendar
range. The surrounding FBM checksum covers the extension. Older writers may
discard extensions; Original-game roundtrip preservation is not promised.
+2
View File
@@ -12,3 +12,5 @@ These files preserve upstream license and attribution wording. They are not a gr
- [LGPL version 2.1](LGPL-2.1.txt): full license supplied with Nuked OPL3. Its source notices permit version 2.1 or any later version.
[THIRD_PARTY_NOTICES.md](../../THIRD_PARTY_NOTICES.md) identifies the upstream versions and distribution requirements. Include this directory, that notice file and the root LICENSE with release packages. Preserve upstream attribution within these verbatim texts.
- [stb_image](stb_image.txt): complete upstream dual-license text from the vendored 2.30 header. JPEG-only decoding is used for the supplied project start screen.
+38
View File
@@ -0,0 +1,38 @@
This software is available under 2 licenses -- choose whichever you prefer.
------------------------------------------------------------------------------
ALTERNATIVE A - MIT License
Copyright (c) 2017 Sean Barrett
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
------------------------------------------------------------------------------
ALTERNATIVE B - Public Domain (www.unlicense.org)
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
software, either in source code form or as a compiled binary, for any purpose,
commercial or non-commercial, and by any means.
In jurisdictions that recognize copyright laws, the author or authors of this
software dedicate any and all copyright interest in the software to the public
domain. We make this dedication for the benefit of the public at large and to
the detriment of our heirs and successors. We intend this dedication to be an
overt act of relinquishment in perpetuity of all present and future rights to
this software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
------------------------------------------------------------------------------
-44
View File
@@ -1,44 +0,0 @@
OpenBMH v0.1.0
===============
OpenBMH ist eine eigenstaendige Neuumsetzung der Engine von Bundesliga Manager
Hattrick und der englischen Fassung Football Limited. Die englische Unterstuetzung
ist experimentell. Originale Spielinhalte sind nicht enthalten; du benoetigst eine
eigene unterstuetzte Installation. Originale V2.20-Spielstaende der englischen
Fassung sind nicht mit dem unterstuetzten Speicherlayout austauschbar.
Start
-----
Paket in einen eigenen Ordner oder neben die Installation entpacken.
openbmh_play starten (unter Windows openbmh_play.exe). Der Dateidialog nimmt einen
Spielordner, die Programmdatei oder ZIP/7z mit einer einzelnen Installation an.
Aus einem Terminal:
openbmh_play --data "path/to/game" --save-directory "path/to/saves"
openbmh_cli --console --data "path/to/game" --saves "path/to/saves"
Unter Windows den Programmnamen um .exe ergaenzen. Ein beschreibbarer separater
Spielstandordner wird empfohlen. Vorhandene Spielstaende vorher sichern.
Tonoptionen: --mute, --no-music, --volume 0.5. --version zeigt die Programmversion.
In der Konsole zeigt ListOptions die aktuellen Befehle; eine eigene Zeile go.
fuehrt den eingegebenen Block aus. Help beschreibt die Parameter.
Dokumentation und Rueckmeldungen
-------------------------------
README.md enthaelt die Bauanleitungen fuer Windows, Linux und macOS.
Die Releasehinweise beschreiben den Umfang und die bekannten Grenzen.
Linux benoetigt je nach Paket Systembibliotheken, insbesondere GTK3 fuer den
Standard-Dateidialog. Plattform-Bauhinweise sind kein Nachweis eines nativen Tests.
Fehler mit Programmversion, Spielfassung und kurzen eigenen Schritten melden.
Keine Originaldateien, Spielbilder, Aufnahmen, Textlisten oder Spielstaende in
oeffentliche Issues hochladen.
Lizenz
------
Eigener OpenBMH-Code und Dokumentation: GNU GPL Version 3 ausschliesslich
(GPL-3.0-only). LICENSE enthaelt den vollstaendigen Text. Drittanbieter behalten
ihre Lizenzen; siehe THIRD_PARTY_NOTICES.md und docs/licenses/.
Diese Lizenzen gelten nicht fuer die separat benoetigten Originalinhalte.
OpenBMH ist ein unabhaengiges Projekt ohne Verbindung oder Billigung durch die
urspruenglichen Rechteinhaber, DFL oder Bundesliga.
-32
View File
@@ -1,32 +0,0 @@
# OpenBMH v0.1.0
OpenBMH reconstructs the Bundesliga Manager Hattrick engine in C++20. The graphical client uses SDL2; the console provides command batches and local manager-client transports over the same career session. This release needs a supported game installation supplied by the player. No original executable, artwork, music, text database, manual or saved game is included.
## Scope
The engine includes career management, leagues and cups, transfers and contracts, finances, training and camps, stadium management, live match interventions, audio playback and normal saves. Supported actions remain subject to mode, manager and phase restrictions; an unimplemented path reports an explicit error rather than an invented result. The project aims for recognisable behaviour and plausible results, not a promise that every original version produces identical events.
German game editions are the primary compatibility target. **Football Limited support is experimental.** English installation loading and edition-specific text/layout data are supported paths, while original V2.20 save import, English audio and remaining competition/interface differences have limitations. Check current issues before relying on a particular English workflow.
## Compatibility decisions
OpenBMH uses shared rule values across supported German editions, with installation-specific content read from the selected data. It includes safety handling around invalid input, calendar boundaries, capacity checks and suspended operations. See [compatibility decisions](../../COMPATIBILITY.md) and [architecture](../../architecture.md). This is an independent reconstruction, not an official update to the original game.
## Running
Extract the package to a separate directory or alongside your installation. `openbmh_play` can select a game directory, executable or a ZIP/7z containing one supported installation. Use an explicit writable save directory when the original directory is read-only, and keep backups.
```sh
openbmh_play --data "path/to/game" --save-directory "path/to/saves"
openbmh_cli --console --data "path/to/game" --saves "path/to/saves"
```
Version 0.1 ships binary packages for Windows x64, macOS on Apple silicon (arm64, macOS 11 or later) and Linux x64. The Linux package passes the automated build and tests but has not yet been played natively; reports are welcome. The macOS package is not signed or notarized, so Gatekeeper asks for confirmation on first start: open it once via right-click → Open, or allow it under System Settings → Privacy & Security. Packages and their native platform results are listed with the release assets. The [build instructions](../../BUILDING.md) cover Windows, Linux and macOS source builds; an instruction is not a claim of native acceptance. Linux's default file dialog backend requires GTK3 system libraries. A macOS terminal executable is distinct from a signed application bundle.
## License
The matching application source tag is [v0.1.0](https://github.com/rezmer/openbmh/tree/v0.1.0). Source/build and relinking materials for linked components must also accompany or be offered with binary releases under their licenses.
OpenBMH-owned code and documentation use GPL-3.0-only. Third-party components retain their licenses; the full texts accompany the package. Read [LICENSE](../../../LICENSE) and [THIRD_PARTY_NOTICES](../../../THIRD_PARTY_NOTICES.md). These licenses do not grant rights to original game content.
For reports, include the OpenBMH version, data edition, independently written steps and the observed result. Do not upload original files, game screenshots, recordings, text collections or saved games to public issues.
+61
View File
@@ -0,0 +1,61 @@
# OpenBMH Classic 1.0.10
This release adds the transfer market search dialog, fixes the "Angebot" button
of the poaching dialog and corrects the asking price shown in the market. It
requires the player's own game installation. Extended development remains
separate in [OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes since 1.0.9
- **Suchen and Vorschlag in the transfer market.** Both buttons did nothing.
They now open the search profile dialog of the original (positions, age,
strength, attributes, sides, price classes). "Suchen" opens the stored
profile, "Vorschlag" the profile your squad asks for. Closing with the
confirm button stores the profile and announces the listed players that
fit, one message box each; the right mouse button or Esc closes it and
switches the search off. The rules (closing rule, matching, suggestion) were
compared with the Diamond 3.7 routines on ten savegames without a
difference. The console has the same steps: `ShowSearchProfile`,
`SuggestSearchProfile`, `SetSearchProfile`.
- **Abwerben: "Angebot" button.** Two causes. The engine asks the selling
manager and the buyer a yes/no question when a poaching offer is decided;
the graphical client did not provide the question dialog. And the agreement
of the poached player ("Ihr erstes Angebot wird angenommen!") had no message
dialog, which refused the whole offer. Both exist now. A refused offer or
transfer action also shows its reason (and writes it to the debug log)
instead of a dead button.
- **Verkaufen on a listed player.** Clicking a player who is already on the transfer
list and then VERKAUFEN did nothing when no offer had arrived yet. It now asks
the question of the original, "Wollen Sie ... vom Transfermarkt holen?": yes takes
the player off the list (he stays in the squad), no leads on to the offers.
- **Pressed buttons.** Suchen, Vorschlag, Abwerben and the other buttons of
the market are drawn pressed while the mouse button is held.
- **Scouting message.** Confirming the search dialog first shows the message
of the scouting department, then one box per fitting listing.
- **Asking price in the market list.** The list showed the asking fee scaled
by 1.25, the factor of an older Diamond build. Diamond 3.7 rounds to whole
10,000 (the offer editor and the weekly processing already did).
- **Tests.** The controller tests now drive the whole route of reviewing and
accepting offers on an own listing, of relisting a player after a declined
listing and of the search dialog.
## Open points
- **"Angebote prüfen" / listing again after a declined offer.** Reported by the
Diamond author. The console and the controller tests show the expected
behaviour (offers can be reviewed and accepted before expiry; a player who
left the list after a decline can be listed again). It could not be
reproduced, so a debug log (`-debug`) or exact steps are still needed.
- **Measurement against Diamond 3.7.** The match engine (minute, duels, shots)
and the whole weekly processing with the bid amounts are not yet compared
with the real 3.7. The bid amounts of new offers depend on stale data in the
original and cannot be reproduced exactly (documented in the source).
- Earlier open points remain: "player card: original atlas bounds" (#77), sporadic
double clicks (#58) and the macOS match scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+87
View File
@@ -0,0 +1,87 @@
# OpenBMH Classic 1.0.11
This release lets the game run from the asset files alone, adds the transfer
market search dialog, fixes the "Angebot" button of the poaching dialog and the
selling of a listed player, and corrects the asking price shown in the market.
Extended development remains separate in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## BMH.EXE or openbmh.dat
- A game needs its asset files and **either** the executable (`BMH.EXE`, or
`FLTD.EXE` for the English game) **or** the file **openbmh.dat**. If both are
there, the executable is used as before. If neither is there, OpenBMH asks for
a game directory or for `BMH.EXE`.
- The numbers of the Diamond 3.7 executable (tables, rates, positions, prices) and
of the English Football Limited are built into the program. `openbmh.dat` holds
the game texts of those executables (live commentary, messages). It ships next
to `OpenBMH` and `openbmh_cli` in the release package and is found in the
game folder, in the program folder and in the current folder (or where
`OPENBMH_DAT` points to). A folder, ZIP or 7z with only the asset files
(`TEXTD.BLK` and `M3D.MAN`, or `TEXTE.BLK` and `M3E.MAN`, plus the
picture, font and sound folders) is a complete game when `openbmh.dat` is
found.
- The default manager name is "OpenBMH" instead of "Nobody".
- A recorded session gives the same output as with the real `BMH.EXE`.
## Changes since 1.0.9 (1.0.10 was never published; its changes are part of this release)
- **Suchen and Vorschlag in the transfer market.** Both buttons did nothing.
They now open the search profile dialog of the original (positions, age,
strength, attributes, sides, price classes). "Suchen" opens the stored
profile, "Vorschlag" the profile your squad asks for. Closing with the
confirm button stores the profile and announces the listed players that
fit, one message box each; the right mouse button or Esc closes it and
switches the search off. The rules (closing rule, matching, suggestion) were
compared with the Diamond 3.7 routines on ten savegames without a
difference. The console has the same steps: `ShowSearchProfile`,
`SuggestSearchProfile`, `SetSearchProfile`.
- **Abwerben: "Angebot" button.** Two causes. The engine asks the selling
manager and the buyer a yes/no question when a poaching offer is decided;
the graphical client did not provide the question dialog. And the agreement
of the poached player ("Ihr erstes Angebot wird angenommen!") had no message
dialog, which refused the whole offer. Both exist now. A refused offer or
transfer action also shows its reason (and writes it to the debug log)
instead of a dead button.
- **Verkaufen on a listed player.** Clicking a player who is already on the transfer
list and then VERKAUFEN did nothing when no offer had arrived yet. It now asks
the question of the original, "Wollen Sie ... vom Transfermarkt holen?": yes takes
the player off the list (he stays in the squad), no leads on to the offers.
- **Pressed buttons.** Suchen, Vorschlag, Abwerben and the other buttons of
the market are drawn pressed while the mouse button is held.
- **Scouting message.** Confirming the search dialog first shows the message
of the scouting department, then one box per fitting listing.
- **Asking price in the market list.** The list showed the asking fee scaled
by 1.25, the factor of an older Diamond build. Diamond 3.7 rounds to whole
10,000 (the offer editor and the weekly processing already did).
- **Tests.** The controller tests now drive the whole route of reviewing and
accepting offers on an own listing, of relisting a player after a declined
listing and of the search dialog.
## Measurement against Diamond 3.7
- The match engine of a recorded matchday in the real 3.7 (DOSBox-X) matches the
port in all 94 minutes, with the random number state at kick-off, in every
minute, at the final whistle and at the next desk.
- Two apparent deviations (from minute 10, and on the days after the match) were
errors of the comparison tool, not of the engine, and are fixed or explained there.
## Open points
- **"Angebote prüfen" / listing again after a declined offer.** Reported by the
Diamond author. The console and the controller tests show the expected
behaviour. It could not be reproduced, so a debug log (`-debug`) or exact
steps are still needed.
- The bid amounts of new offers in the weekly processing depend on stale data in
the original and cannot be reproduced exactly (documented in the source).
- Only one matchday and the days after it were recorded from the real 3.7; the
weekly processing, month changes and transfers are not yet compared.
- The graphical client has not yet been tried with `openbmh.dat` and asset files only.
- Earlier open points remain: "player card: original atlas bounds" (#77), sporadic
double clicks (#58) and the macOS match scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+83
View File
@@ -0,0 +1,83 @@
# OpenBMH Classic 1.0.12
This release makes the buttons of the dialogs behave like the original: a button
without a lasting state is drawn pressed while the mouse button is held. It also
carries everything of [1.0.11](../1.0.11/RELEASE_NOTES.md) (the game from asset
files plus `openbmh.dat`, the transfer market search, the poaching and selling
fixes). Extended development remains separate in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Pressed buttons
Many dialogs drew their buttons raised at all times, the original shows them
pressed for as long as the mouse button is down (the friendly match question
already did). Now pressed while held:
- **Bank:** the two buttons of stocks, property, savings and credit, the OK of
its notices, Ja/Nein of the credit fee question and the keys of its calculator.
- **Spieler kaufen (offer editor):** Team-Info, Spieler-Info, Angebot, Abbruch and
the calculator keys.
- **Aufstellung:** Daten A/B and Spielfeld; **Spielfeld page:** Daten and Kurz
(the action starts after a short moment, as the pressed look has to be seen).
- **Contracts:** the buttons under the offer and the team premium panels
(Team-Prämien), OK of the answer and the calculator keys.
- **Advertising:** Abbrechen/Annehmen of an offer, OK of its notices and the keys of
its calculator.
- **Player card:** Schließen, Statistik and Zurück; **training camp:** the booking
button and OK; **file dialog:** Ja/Nein of the overwrite question and the page
button of a long list; **manager confirmation:** JA and NEIN; **transfer
decision:** OK of the confirmation.
- **Start menu (game setup):** the minus and plus buttons show the original's
darker pressed picture while the mouse button is held (also in the joining
manager's setup). It is a different picture (36x36 pixels, drawn two pixels right
and down of the raised button on the plain background), not a shifted copy of the
button, and was compared pixel for pixel with a recording of the real game.
- The notices that wait for any click (Sportschau, cup draw, game end screens) have
no button and are unchanged. Toggles that stay on (training, filters) keep their
lasting state.
## Transfer market
- **Verkaufen on a listed player chosen in the market list.** Choosing an own listed
player in the right-hand list and pressing VERKAUFEN gave "Noch keine Angebote"
(or went straight to the offers) instead of the question of the original,
"Wollen Sie ... vom Transfermarkt holen?". It now asks first, as it already did for
a player chosen in the squad list: yes takes him off the list, no leads on to the
offers.
- **No status text in the footer.** The transfer market replaced the club name in the
bottom row with status texts (rejections, hints). The original has no such line; the
club name now always stays there.
- **League table: club names in full.** Names were cut after about 17 characters
("EINTRACHT FRANKFU"); the original shows them completely ("EINTRACHT FRANKFURT",
"TSG 1899 HOFFENHEIM") and lets the games column cover what reaches into it.
## Internal
- The drawing of the wide push button, of the calculator window (panel and keys) and
of the dialog frame is now shared (`ui/button_frame.hpp`,
`ui/calculator_widgets.hpp`, `ui/dialog_frame.hpp`) instead of being copied in
about twenty dialogs. A test compares the shared drawing pixel for pixel with the
former one. A few buttons whose former drawing differs by one pixel (statistics
rankings, team statistics, opportunities, analytics) were left as they are.
## Open points
- The pressed look was checked by tests and by reading the drawing code, not yet
against a recording of the real Diamond 3.7; the exact timing of the short press on
the Spielfeld page is an estimate.
- **"Angebote prüfen" / listing again after a declined offer.** Could not be
reproduced; a debug log (`-debug`) or exact steps are still needed.
- The graphical client has not yet been tried with `openbmh.dat` and asset files only.
- The weekly processing, month changes and transfers are not yet compared with the
real 3.7 (only one matchday and the days after it were).
- Earlier open points remain: "player card: original atlas bounds" (#77), sporadic
double clicks (#58) and the macOS match scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+71
View File
@@ -0,0 +1,71 @@
# OpenBMH 1.0.3
This Classic maintenance release fixes startup, dialog and match presentation,
transfer handling and several long-career limits. It uses the player's own
supported game installation. Extended development lives separately in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes
- Football Limited startup reads its own calendar epoch and prepared-image
tables. Original CD assets are located without assuming filename case.
- Original Diamond 3.7 saves with the verified `V3.7` container marker load in
the career, browser information and preparation paths. Unknown versions and
checksum failures are reported separately; layout checks remain strict.
- The original title remains visible until a complete left or right mouse click,
without loading balls or automatic advancement.
- Career dialogs retain their scene background instead of inheriting the
executable's black boot-dialog mode.
- Goal scenes retain the previous visible score until the result is revealed.
- Closing a table or pairings overview owns the complete right-button gesture.
- Pitch placement again uses the edition's preferred-position colors and
original colored cursor.
- Select an owned transfer listing and use the sale action or Enter to inspect
existing offers before expiry. Cancel preserves the listing. Cleared listings
can be offered again; refusals receive visible feedback.
- A fresh squad arrival clears negotiation flags left by the previous occupant
of its row. This prevents inherited refusal of contract renewal.
- Optional saved archives preserve cumulative player counters and observed
title winners beyond the original byte/word and fifty-season windows.
- Daily interest and property/fund dividend products use wider intermediate
arithmetic; Bank portfolio totals use wide display values.
- The high-cash bank robbery remains, at most once per manager and calendar
month. Saving and loading preserves the limit. An older save with unknown
history receives a first qualifying month of grace.
- Standard stadium blocks now allow 144,000 places in total. Unit prices come
from the loaded edition; build periods increase with expanded block size.
## Validation
The release workflow requires successful builds, configured synthetic tests and
package checks for Windows x64, macOS ARM64 and Linux x64 at the tagged revision.
Reports and checksums accompany the downloads. Missing external-data tests are
reported as skipped, rather than counted as successful game tests.
Additional private Linux checks use Original CD, Diamond and Football Limited
assets for startup and setup, scene-backed dialogs, calendar/rescheduling,
transfer decisions, preferred-position feedback and score reveal. A 144,000-place
stadium was rendered after encrypted native save/load. These checks do not
constitute manual gameplay validation on Windows or macOS, or a full
200–300-season simulation.
## Known limits
- Individual native cash, deposit and financial-history fields remain 32-bit and
can still overflow. Wider calculations and aggregate display do not solve
multi-billion single-account storage; that issue remains open.
- Calendar and rescheduling opened in the checked Classic datasets; the reported
failure remains open because it could not be reproduced.
- Football Limited remains experimental. Its original V2.20 save layout is
different and is not enabled by the Diamond 3.7 import correction.
- Already lost counters and earlier title winners cannot be reconstructed. The
separate manager-achievements graph retains its original fifty-season window.
Original programs and older OpenBMH writers can discard optional archive and
monthly-robbery extensions; keep backups before exchanging saves.
- The row-initialization correction does not clear genuine retirement/refusal
flags in an existing career or establish a fixed 200–300-season threshold.
- Early acceptance of a human-buyer loan still needs its separate consent flow
and is unavailable from the early offer preview.
The public downloads contain implementation, corresponding source and notices;
original game content is not included.
+57
View File
@@ -0,0 +1,57 @@
# OpenBMH Classic 1.0.4
This Classic patch release includes the desktop, save and advertising fixes
added after 1.0.3. It requires the player's own supported game installation.
Extended development remains separate in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes since 1.0.3
- The supplied Classic start artwork is embedded at its native resolution and
displayed with correct proportions, including high-DPI output. A complete
left or right mouse click continues into the game.
- An unframed desktop calendar/date control now starts the next turn correctly.
Unframed admission-price and automation controls use their correct origins;
hidden controls and national-team restrictions remain enforced.
- Dragging an icon out of a stored desktop folder moves the selected icon while
keeping the folder in place. Folder-corner removal uses the original input
geometry.
- Double-clicking an occupied save slot opens the original overwrite question.
Its Yes/No buttons work entirely with the mouse. No preserves the existing
file; Yes writes the selected slot.
- Advertising choices use the original hover outlines and help areas. Returning
from a dialog refreshes the pointer state and removes stale highlighting.
- Malformed saved formation automation is rejected before desktop projection,
without changing the career state or random streams.
- Football Limited retains its original overwrite question during English-data
translation. The launcher rebuilds older translated caches automatically.
## Validation
The release workflow requires successful builds, configured tests, version and
package checks for Windows x64, macOS ARM64 and Linux x64 at the exact tagged
revision. Downloads include checksums, a platform test report and corresponding
source with pinned open-source dependencies.
Additional private Linux validation of the fixes used Diamond 3.7 data and real
mouse input. The 211-test configured suite executed 116 passing tests, skipped
95 checks needing other private fixtures, and reported no failures. Focused
save, desktop and advertising input checks executed. Native before/after checks
verified mouse-only overwrite refusal/acceptance, folder extraction and a real
two-manager calendar handoff, with saved-state verification. An original
Football Limited data probe verified the translated overwrite question.
These checks do not establish manual gameplay acceptance on Windows or macOS.
Issues [#51](https://github.com/Weyoune/openbmh/issues/51),
[#52](https://github.com/Weyoune/openbmh/issues/52),
[#53](https://github.com/Weyoune/openbmh/issues/53) and
[#54](https://github.com/Weyoune/openbmh/issues/54) remain open for human QA.
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
No original executables, databases, saves, graphics or audio are included.
+52
View File
@@ -0,0 +1,52 @@
# OpenBMH Classic 1.0.5
This patch fixes environment access with compatible older DIAMOND data and
English contract labels. It requires the player's own game installation.
Extended development remains separate in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes since 1.0.4
- Environment management uses the common Diamond 3.7 monthly model for supported
source-data editions. Different original programme instructions no longer
block compatible numeric data. Six budget steps are validated and installed
together; malformed layouts and artwork bounds remain guarded. Existing
saved lump-sum academy budgets retain their accounting until edited.
- Football Limited translation supplies its actual environment geometry,
numeric steps and suffixes. Selecting the original English installation
rebuilds older translated caches automatically.
- Contract tabs use the installation's original text and font path, including
English data, salary and team-bonus captions.
- English manager selection exposes the Original four starting levels. The
fifth internal data league remains in the model, squads, rankings and fixture
data. Hidden targets/clubs are rejected before fresh-manager mutation or RNG;
existing saved league values are not generally rejected.
## Validation and human QA
Release publication requires successful Windows x64, macOS ARM64 and Linux x64
builds, configured tests, product-version checks and package/source verification
for the exact tagged revision. Downloads include checksums, a platform test
report and corresponding source with pinned open-source dependencies.
Local checks use an older primary DIAMOND installation, separately identified
Diamond 3.6 and 3.7 data, German CD data and translated Football Limited data.
They cover all six environment controls, transaction ownership and unchanged RNG,
source-language contract glyphs, valid manager selection and hidden-level refusal.
Native Linux before/after checks reproduce the older DIAMOND menu block and
verify the corrected environment screen and English contract captions. The older
package's precise edition name remains unconfirmed; the separately supplied
3.6 installation also passed the original controller check.
Issues [#55](https://github.com/Weyoune/openbmh/issues/55) and
[#56](https://github.com/Weyoune/openbmh/issues/56) remain open for human QA.
Native Windows/macOS gameplay acceptance is not established by CI builds.
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
No original executables, databases, saves, graphics or audio are included.
+54
View File
@@ -0,0 +1,54 @@
# OpenBMH Classic 1.0.6
This patch fixes bugs reported by Windows and macOS testers and adds a `-debug`
mode. It requires the player's own game installation. Extended development
remains separate in [OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes since 1.0.5
- **Debug mode.** `-debug` writes a log and the redirected error output to a
`debug` folder inside the save directory and stores a savegame after every
kick-off, so a failing session can be reproduced from the files.
- **Settings.** Every unlocked switch of the settings screen is stored; only
locked rows stay fixed.
- **Training.** The skill bars per player and the hovered row are drawn.
- **Line-up.** Set-piece takers can be picked and players placed in the shooter
editor. The live line-up now also opens at the national-team desk.
- **Mouse pointer.** The original game pointer is used, at the correct size on
high-DPI displays (macOS).
- **Calendar.** The calendar works after a kick-off and at the end of the
season, shows the original colour gradient and uses the live season values.
- **Running matchday.** Table, Strengths and the results page no longer hang or
reject clicks while a matchday is running.
- **National-team desk.** Save loading, Table, Strengths, Other Games, Top
Scorers and the live line-up work for the national coach; the club badges on
the desk follow the opponent of the day.
- **Joined managers.** A manager who joins a running career sees his next
opponent instead of "no match".
- **Club information.** The Radio/Video setting of the club information screen
persists, so an AI match set to Video appears live.
- **Stadium.** The yellow hover frame appears over seat blocks, investments and
buildings; the panorama view is not framed.
- **Advertising.** ANNEHMEN is hidden when the offer cannot be accepted, as in
the original. Settings screen shows the product name and version.
- **Table calculator.** The right mouse button closes the From/To calculator.
## Validation and human QA
Release publication requires successful Windows x64, macOS ARM64 and Linux x64
builds, configured tests, product-version checks and package/source verification
for the exact tagged revision. Downloads include checksums, a platform test
report and corresponding source with pinned open-source dependencies.
Several fixes were reproduced on testers' savegames and checked with test
programmes; native Windows/macOS gameplay acceptance is not established by CI
builds. Open points: the "player card: original atlas bounds" error (#77),
KI-Tipp after a match (#69), sporadic double clicks (#58) and the macOS match
scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+35
View File
@@ -0,0 +1,35 @@
# OpenBMH Classic 1.0.7
This patch fixes national-team desk screens and two small interface details
reported by testers. It requires the player's own game installation. Extended
development remains separate in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes since 1.0.6
- **National-team desk.** Other Games and Top Scorers open again; both screens
are identified by the home club, so the desk is no longer rejected as stale
or as a mismatched acknowledgement.
- **Computer tip.** After the results of a round are known the button is only
pressed and released, as in the original, instead of raising an engine error.
- **Manager selection.** JA of the confirmation question is shown pushed in
briefly after it is clicked.
## Validation and human QA
Release publication requires successful Windows x64, macOS ARM64 and Linux x64
builds, configured tests, product-version checks and package/source verification
for the exact tagged revision. Downloads include checksums, a platform test
report and corresponding source with pinned open-source dependencies.
The fixes were checked with the desktop, controller and manager tests; native
Windows/macOS gameplay acceptance is not established by CI builds. Open points
from 1.0.6 remain: the "player card: original atlas bounds" error (#77),
sporadic double clicks (#58) and the macOS match scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+43
View File
@@ -0,0 +1,43 @@
# OpenBMH Classic 1.0.8
This patch makes the bank credit annuity identical on every platform. It
requires the player's own game installation. Extended development remains
separate in [OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Changes since 1.0.7
- **Bank credit annuity.** The original computes the monthly payment with
x87 floating point (64-bit mantissa at every step, one final store to a
double). The host `long double` is only 64 bits wide on Windows (MSVC) and
on Apple silicon, so the payment differed by 1 for roughly 0.2 % of loans of
one to sixty million. The chain is now evaluated with integer arithmetic and
gives the original's result on every platform.
## Validation and human QA
Release publication requires successful Windows x64, macOS ARM64 and Linux x64
builds, configured tests, product-version checks and package/source verification
for the exact tagged revision. Downloads include checksums, a platform test
report and corresponding source with pinned open-source dependencies.
This release follows a quality pass that ran single routines of the original
programme in an emulator and compared them with the engine on whole savegames,
with boundary values and a deliberately wrong result per rule that must fail.
Compared without a difference: the random generator, market value and salary,
the willingness of clubs to sell, the rating of transfer bids, club mood and
flags at the end of a season, the order of national cup ties, weekly advertising
offers, facility ageing and damage, offers to managers, weekly statistics,
familiarity decay, squad training and daily interest. The one difference found
is the annuity fixed above. Rules that depend on screens, dialogs or the master
database were not part of this pass.
Native Windows/macOS gameplay acceptance is not established by CI builds. Open
points from earlier releases remain: the "player card: original atlas bounds"
error (#77), sporadic double clicks (#58) and the macOS match scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+65
View File
@@ -0,0 +1,65 @@
# OpenBMH Classic 1.0.9
This release aligns the engine's hard-coded rules with BMH 2026-27 DIAMOND
Edition 3.7. It requires the player's own game installation. Extended
development remains separate in
[OpenBMH-Extended](https://github.com/Weyoune/OpenBMH-extended).
## Why
The engine had been checked against an older Diamond build whose executable
differs from 3.7 in about 2,700 bytes (50 code ranges, the Diamond patch area
and 64 data bytes). Rules from v2.24, an older Diamond and 3.7 were therefore
mixed. The routines of the real 3.7 executable were run in an emulator and
compared with the engine; every difference found was ported and documented.
## Changes since 1.0.8
- **Injuries and cards.** New injury tables (thresholds and durations), the
injury history factor 1.25, doctor and insurance caps, and the foul, booking
and red-card chances of 3.7.
- **Economy.** Credit limit 8,000,000, transfer fee base, DFB fee, advertising
base, start capital, bankruptcy limit, championship and cup premiums,
periphery prices, contract talk limit and training injury range.
- **Weekly processing.** Retirement chance, side rating rhythm for human and
computer managers, facility values, per-visitor income and the season
ticket price.
- **Youth academy.** 3.7 generation with its monthly budget gate. An age check
was inverted in the port (older players were recycled the wrong way round);
this is fixed.
- **Season end.** Retirement and leave rules for the player slots.
- **Live match statistics.** The chance counters at the bottom of the live
matchday screen counted a chance as soon as the engine logged it, before the
presentation started. They are now held back like the score and appear with
the result of the chance.
## What was measured, what was derived
Compared with the 3.7 executable without any difference (boundary values and a
deliberately wrong result per rule that must fail): random generator, market
value, bank annuity, club mood and flags, cup tie order, advertising offers,
bid rating, poaching, facility ageing and damage, manager offers, weekly
statistics, familiarity decay, squad training, daily interest, youth academy,
month change, new transfer list entries, and injuries including doctor and
insurance (932 runs).
Derived from the constants of the 3.7 code but **not** measured in the
emulator: foul and card chances in a match, and several economy numbers.
Not covered: the complete weekly processing routine, and the amounts of newly
created transfer bids (the original reads a stale stack value there; documented
in the source as a known gap).
## Open points
Reported by the Diamond author and not changed here: the bug in "fetch player
from transfer market / check offers" (exact steps still to be reproduced).
Earlier open points remain: the
"player card: original atlas bounds" error (#77), sporadic double clicks (#58)
and the macOS match scene speed (#70).
## Known limits
The compatibility and long-career limits documented for
[1.0.3](../1.0.3/RELEASE_NOTES.md) remain. Football Limited is experimental;
its original V2.20 save layout remains unsupported. Keep backups of saves.
macOS packages are unsigned terminal executables, not notarised app bundles.
+43
View File
@@ -0,0 +1,43 @@
# Classic 1.0 backport audit
Baseline: v0.1.2. The release branch keeps the existing public history; the baseline restoration is an ordinary commit, not a force reset of main.
| Later change | Decision |
|---|---|
| 8326a23: host filenames/path display, setup input guards | Included; direct-installation code, uses direct original-installation data |
| e1d17d8: explicit quit confirmation | Included; cancellation preserves current owner/state |
| c8f04d0: reschedule undo replay bit | Included; restores original target-day availability |
| b879d5b: standalone original message texts | Included as a focused adaptation; reads the original message table |
Version 1.0 no longer rewrites loaded rule tables to a shared profile. Original strength ranges and environment price steps are installed from the supplied edition. Environment implementations outside verified program fingerprints remain unverified, never silently enabled by a directory name.
This is an implementation audit, not a completed release acceptance report. Original-data, GUI, save compatibility and platform results must be recorded before the final tag.
## Diamond 3.7 foreign crests
The drawing policy is installed from the verified gate in the supplied executable.
Diamond 3.7 uses individual original W-sheet cells for the 48 foreign league clubs.
Earlier verified editions retain their neutral foreign-club crest. Database and
savegame selectors remain authoritative, including after club movement; no
high-resolution replacement pack or changed competition structure is required.
Unknown drawing gates retain the conservative legacy policy. National teams,
non-rostered clubs and missing-club tokens retain their existing treatment.
Private data verification decoded all 48 Diamond 3.7 selections and checked their
38-pixel cells against atlas bounds. This is an asset-path/contact-sheet check,
not a claim of completed interactive GUI acceptance.
## Author-supplied defect reference
The Diamond author supplied a private reference catalogue covering 33 original
bug corrections. The supplied original executable hash and all 1,084 documented
byte changes were independently checked against local original/Diamond files.
The archive and disassembly remain outside this public repository. Binary patch
caves are evidence of the old defect, not an implementation requirement.
Initial source review finds corrected camp field packing and separated card
save-back contexts already present. Their dedicated regression acceptance is
still pending. Transfer-market retirement is now corrected and covered by a
synthetic season-boundary regression test, including relocation uniqueness and
unchanged club-player random draws. The complete 33-item review is tracked privately; none of
the unreviewed entries is claimed complete.
+22
View File
@@ -0,0 +1,22 @@
OpenBMH 1.0
Eigenstaendige Community-Umsetzung von Bundesliga Manager Hattrick mit der
Original-Oberflaeche. Originaldateien werden nicht mitgeliefert.
Das Paket vollstaendig entpacken und OpenBMH starten (Windows: OpenBMH.exe).
Die eigene Spielinstallation oder deren ausfuehrbare Datei auswaehlen.
Ein gesondertes, beschreibbares Verzeichnis fuer Spielstaende wird empfohlen.
Beispiel:
OpenBMH --data "path/to/game" --save-directory "path/to/saves"
Deutsche CD-kompatible Versionen und gepruefte Diamond-Ausgaben sind die
primaeren Ziele. Football Limited ist experimentell; die alte Disketten-EXE
wird nicht unterstuetzt. Bestehende Spielstaende vorher sichern.
Quellen, Plattformhinweise und bekannte Einschraenkungen stehen in README.md
und docs/release/1.0/RELEASE_NOTES.md. Reproduzierbare Fehler bitte ueber den
Issue-Tracker des Repositorys melden; keine Originaldateien hochladen.
Eigener Programmcode: GPL-3.0-only. Lizenzen und Hinweise fuer eingebundene
Komponenten stehen in LICENSE und THIRD_PARTY_NOTICES.md.
+37
View File
@@ -0,0 +1,37 @@
# OpenBMH 1.0.2
A left click on an open desktop widget's upper-left close button now hides that widget through the normal validated layout transaction. The close button no longer starts a drag or shows the moving outline. Moving an element with the right mouse button remains available.
The close action consumes its matching mouse release even if the engine has already removed the widget, preventing an accidental click on an icon underneath. The automation and macOS keyboard fixes from 1.0.1 remain unchanged.
---
# OpenBMH 1.0.1
The automatic-lineup monitor now draws the selected formation from the actual manager formation table. Outdoor, indoor and custom formation slots retain their original coordinates and palette. Dragging a desktop element shows the original yellow outline, which disappears when the drag ends.
SDL video initialization now precedes the initial native file picker. On macOS this lets SDL establish the Cocoa application and keyboard activation policy before the picker creates or modifies NSApp. It addresses keyboard input missing throughout the game, including entering the manager name. A native macOS regression checks the activation policy after the picker initialization/shutdown lifecycle.
Native interactive Mac keyboard acceptance remains human QA; automated checks do not represent physical typing on a user's Mac.
---
# OpenBMH 1.0.0
Classic direct-installation runtime restored from v0.1.2. The game executable is OpenBMH / OpenBMH.exe; openbmh_cli remains available.
Reviewed backports include host filename/path handling, explicit quit confirmation, original message text installation in standalone tools, and clearing the calendar replay flag after undoing a reschedule. German CD-compatible BMH and verified Diamond editions are the release targets. Football Limited remains experimental; the old floppy executable is unsupported.
This community release focuses on the original game. See VALIDATION.md for the scope and limits of its checks. Build/test reports do not establish complete bit-for-bit parity with every original edition.
Diamond 3.7 foreign league crests use the supplied edition's original drawing gate, database selectors and W sheets. Older editions retain their original neutral foreign-club crest.
Transfer-market players now enter the season-boundary retirement process, preventing the five-bit age from wrapping from 47 to 16. Relocated free agents no longer leave a duplicate in their old market slot. Young club players retain their existing random-draw count.
The automatic lineup reads the original foreign-player limit switch: enabled editions enforce three foreign starters in domestic clubs and two in the foreign leagues, with original reserve replacement and partial-lineup handling. Editions that disable this rule retain unrestricted selection. New careers also initialize the original empty EM qualification placeholders with national-team IDs; existing nonzero seeds and loaded savegames are preserved.
Known limits: Football Limited remains experimental, the floppy executable is unsupported, and intentional implementation differences remain listed in docs/DIFFERENCES.md. The supplied original-defect catalogue is an ongoing compatibility reference, not a claim that all its entries have received independent runtime acceptance.
The season reset processes each player only once, including temporary offer references to an active club player. This prevents double ageing and regeneration of a still-owned player into a second club. The correction is covered by a synthetic cached-offer regression and long runs through eleven to twelve season-end desks.
The start year and weekday are read from the supplied edition for the desktop, engine and save-list headers. Original CD therefore starts in 1995 on Saturday; checked Diamond editions retain 2026 on Wednesday. The original date arithmetic remains intact.
+45
View File
@@ -0,0 +1,45 @@
# OpenBMH 1.0 validation
Scope: recorded automated/original-data checks. Exact final source revision and native platform build records accompany the published release.
- Linux x64 Release build: all targets compiled.
- Local Linux CTest: 35 passed, 157 skipped, zero failures (192 registered tests). Skips require separately configured original-data or save fixtures; they are not acceptance passes.
- Synthetic tests cover unchanged executable image loading, nine original strength ranges, atomic rejection of malformed ranges, unsupported environment guards, and legacy/extended/truncated crest gates.
- Public source scan: zero findings; generated differences catalogue matches source markers.
- Version output: both GUI and console identify 1.0.0-rc.1.
- Private crest probe: all 48 foreign league clubs in Diamond 3.7 resolve to original 38 × 38 W cells within atlas bounds. A native-size contact sheet was inspected; older Diamond data retain the neutral-crest gate.
- Author defect reference: original hash and all 1,084 listed original/changed bytes checked. All 33 defects are tracked privately; source inspection is not regression acceptance.
Still required: dedicated original-game/GUI/save roundtrips, completing the original-defect audit, per-edition gameplay review, Windows/macOS native checks and release-package acceptance. No final 1.0 tag is justified by these checks alone.
Source archives contain the audited current tree. The optional full-history audit is a separate check; published Git history has not been rewritten.
## Follow-up original-data checks
Twenty-six additional private-data checks passed across BMH CD and Diamond 3.6/3.7: exact loaded fixture tables, manager selection, standard dialogs, training camps, tactics, banking, settings and player cards. The Diamond 3.6 two-manager fixture also passed the human-buyer transfer and rescheduling suites. A currency-format fixture had assumed the Diamond resort price for all German editions; its fixed-price check now uses an explicit synthetic price, and the CD test passes without changing game data or product prices. These are automated render/interaction and engine checks, not a claim of complete interactive playthroughs.
The market-player retirement regression failed before the correction with an age wrap from 47 to 16 and passed afterward. It checks market boundaries, unique relocation, unaffected extra slots, new-career setup and unchanged random draw counts for a young club player.
## Additional edition rules
Targeted synthetic tests pass for the enabled/disabled foreign-player switch, domestic and foreign clubs, human assistant board and card-row movement, reserve shortages and switching back to an unrestricted edition. Separate season-boundary tests pass for zero EM placeholders becoming national teams and existing nonzero seeds remaining unchanged. Final full-build/platform acceptance for these additions is recorded with the release artifacts.
Long-run diagnostics with seed 4711 and the existing explicit contract-renewal policy reached 120 turns and two season-end desks in each of the three German data editions. Diamond 3.6/3.7 returned success. Original CD exceeded the simulator's statistical high-score threshold (two ordinary results above twelve goals); it is recorded as a QA finding, not hidden or counted as a successful simulation. The earlier no-presenter runs stopped at a contract expiry; enabling the existing opt-in presenter resolved that harness limitation without changing gameplay code.
## Extended season regression
After the final lineup, qualification and once-per-player season-reset corrections, each German edition completed 600 turns using seed 4711. Original CD reached twelve season-end desks; Diamond 3.6 and 3.7 reached eleven each. With the existing explicit contract-renewal and advertising policies enabled, all three simulator runs returned success, with no duplicate club players or other invariant failures. With contract renewals alone, all three still completed 600 turns without duplicate club players; only the test policy's excessive-debt warning remained. The latter is not presented as a successful financial strategy.
The duplicate-player defect was reproduced and captured before correction: a temporary offer referenced a player already owned by a club, then the extended market-retirement pass regenerated that player a second time. Frozen private before/after saves and a cached-reference regression support the correction. Save-envelope diagnostics use a separate RNG and do not consume either gameplay stream.
Calendar epoch regression covers the original CD and Diamond parameters, engine weekdays, desktop dates, save-header dates, year rollover and atomic rejection of invalid/unknown setup instructions. The original and checked Diamond date routines differ only in their weekday/year operands. After installing the original CD calendar parameters, the 600-turn run with contract and advertising policies completed eleven season-end desks without invariant failures.
## 1.0.1 desktop and macOS regressions
The desktop feedback test checks selected saved formations against their original table, compares changed miniature pixels, and checks the original yellow outline during a drag and its removal afterward. Private CD and Diamond render captures use the original assets. The SDL lifetime test checks initialization before the picker scope, normal destruction and failed initialization cleanup.
A macOS-only native Cocoa test initializes SDL before the native picker lifecycle, checks regular activation, creates a keyboard-focused window and verifies that a Cocoa key event produces both SDL key and text events. This automated native event test supplements human keyboard QA; it is not a claim of physical typing on the user's machine.
## 1.0.2 close-button regression
The desktop feedback test checks that the left corner requests removal instead of entering drag mode, that the remaining layout chain is intact, and that the release after acknowledgement does not activate an underlying icon. A subsequent independent click remains usable. Right-button movement and its temporary yellow outline remain covered. The user confirmed the 1.0.1 automation and Mac keyboard corrections.
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// All-or-nothing wrapper for one UI window action on a CareerSession (used by
// desktop_actions.cpp and window_actions.cpp). It snapshots the game state, the RNG and the
// revision counter, runs the action and, if the action returns false or throws, restores
// all three, so a rejected action leaves no half-applied change behind.
// apply_native() is the variant for owners that keep their state in CareerSession::state().
// Header-only; owns no state of its own.
#pragma once
#include "app/career_session.hpp"
+7
View File
@@ -1,4 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// Glue between the original-audio engine (src/audio/playback.hpp) and the app: builds the
// asset set from the game's sound containers and the frequency/operator tables read from the
// executable, derives the music/click/match-sound options from the saved settings bytes of
// the GameState, and sends sound commands only when the original sound path is ready.
// OriginalMouseSound is an SDL event watch that plays the click sound on each real mouse
// button press; it touches only the Playback object, never the GameState, because the
// watch can run on SDL's event thread. Header-only.
#include "formats/executable_layout.hpp"
#pragma once
File diff suppressed because it is too large. Load diff
+18 -1
View File
@@ -38,6 +38,7 @@
#include "game/pending_offer.hpp"
#include "game/poach.hpp"
#include "game/human_buyer_sale.hpp"
#include "game/search_profile.hpp"
#include "game/weekly.hpp"
#include "ui/flow.hpp"
#include "ui/desk_state.hpp"
@@ -175,7 +176,23 @@ public:
// result with valid dependent projections becomes the live state.
std::optional<TransferActionResult> dispatch_transfer_market(
const ui::TransferMarketRequest&, const HumanBuyerSaleHooks&,
uint64_t& revision, std::string& error);
uint64_t& revision, std::string& error,
const std::function<int(const GameState&, const TransferOfferListView&)>& review = {});
// The search profile of a human manager (transfer market buttons "Suchen" and "Vorschlag", game/search_profile.hpp).
// `search_profile` is the stored profile, `suggest_search_profile` the one the squad asks for (nothing is stored).
// `dispatch_search_profile` stores an edited profile the way the closing dialog does (`cancelled` = left by right
// click, which switches the profile off) and, with `apply`, lists the transfer-list entries that fit it right now.
// The revision rises only when the stored profile changed.
SearchProfile search_profile(int manager) const;
SearchProfile suggest_search_profile(int manager, bool whole_squad) const;
struct SearchProfileDispatch {
SearchProfile profile{};
bool active = false;
std::vector<SearchProfileHit> hits;
};
std::optional<SearchProfileDispatch> dispatch_search_profile(int manager, const SearchProfile& profile, bool cancelled,
bool apply, uint64_t& revision, std::string& error);
struct TransferMarketPreviewDispatch {
ui::PreparationState preparation;
+407 -15
View File
File diff suppressed because it is too large. Load diff
+7
View File
@@ -1,4 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// The controller: the one synchronous boundary between the UI flow (ui::StartupFlow) and
// the engine session (CareerSession). The flow turns a click or key into a ui::FlowResult
// that carries a request; serve_flow_request() validates it against the current revision,
// calls the session, and acknowledges the outcome back to the flow. Everything the engine
// needs from the front end (dialogs, live match presentation, notices) is passed in as
// std::function "presenter" hooks, so tests can drive the same code without a window.
// Pairs with controller.cpp; the real hooks are supplied by main.cpp.
#pragma once
#include "app/career_session.hpp"
+81
View File
@@ -0,0 +1,81 @@
// SPDX-License-Identifier: GPL-3.0-only
// Debug mode (command line -debug): a process-wide, mutex-protected log file plus numbered
// automatic savegames, both kept in one folder. State is a function-local static; every
// function is a no-op until init() has succeeded, so callers may log unconditionally.
// init() also redirects stderr into the same folder. Header-only.
#pragma once
#include <chrono>
#include <cstdio>
#include <ctime>
#include <filesystem>
#include <fstream>
#include <mutex>
#include <string>
#include <system_error>
namespace bmh::app::debug {
// The debug mode (command line -debug): a log with timestamps next to everything the game prints
// to stderr, and a savegame after every played match day, both in one sub folder of the save
// directory. Off by default; every function is a no-op until init() has run.
struct State {
bool enabled = false;
std::filesystem::path directory;
unsigned saves = 0;
std::mutex mutex;
};
inline State& state() { static State s; return s; }
inline bool enabled() { return state().enabled; }
inline const std::filesystem::path& directory() { return state().directory; }
inline std::string timestamp() {
const auto now = std::chrono::system_clock::now();
const std::time_t t = std::chrono::system_clock::to_time_t(now);
std::tm parts{};
#ifdef _WIN32
localtime_s(&parts, &t);
#else
localtime_r(&t, &parts);
#endif
const auto ms = std::chrono::duration_cast<std::chrono::milliseconds>(now.time_since_epoch()).count() % 1000;
char text[40];
std::snprintf(text, sizeof text, "%04d-%02d-%02d %02d:%02d:%02d.%03d", parts.tm_year + 1900, parts.tm_mon + 1,
parts.tm_mday, parts.tm_hour, parts.tm_min, parts.tm_sec, int(ms));
return text;
}
// One line, flushed at once so that a crash or a hang loses nothing.
inline void log(const std::string& line) {
auto& s = state();
if (!s.enabled) return;
std::lock_guard<std::mutex> lock(s.mutex);
std::ofstream out(s.directory / "openbmh-debug.log", std::ios::app);
if (out) out << timestamp() << " " << line << '\n';
}
// Creates the folder and redirects stderr into the same folder, so the messages the game
// prints on its own (for example the live overview errors) are kept as well.
inline bool init(const std::filesystem::path& directory) {
std::error_code ec;
std::filesystem::create_directories(directory, ec);
if (ec || !std::filesystem::is_directory(directory)) return false;
auto& s = state();
s.directory = directory;
s.enabled = true;
const auto errors = (directory / "openbmh-stderr.log").string();
if (std::FILE* redirected = std::freopen(errors.c_str(), "a", stderr)) std::setvbuf(redirected, nullptr, _IONBF, 0);
log("debug mode on, folder " + directory.string());
return true;
}
// The file name of the next automatic savegame: DBG00001.FBM, DBG00002.FBM, ... (8.3 like the original).
inline std::filesystem::path next_save_path() {
auto& s = state();
char name[16];
std::snprintf(name, sizeof name, "DBG%05u.FBM", ++s.saves);
return s.directory / name;
}
} // namespace bmh::app::debug
+83
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the desk-level action facades declared in desktop_actions.hpp. Each
// method checkpoints the relevant session owner, runs the request through CareerSession,
// lets the accept callback acknowledge the result to the UI, and rolls everything back via
// detail::apply_window if the callback returns false or throws. Errors are returned through
// the std::string& error parameter. The request/acknowledge flow as a whole is described
// at the top of controller.cpp.
#include "formats/executable_layout.hpp"
#include "app/desktop_actions.hpp"
#include "app/action_transaction.hpp"
@@ -7,6 +13,8 @@
namespace bmh::app {
// Builds the desk request that opens menu `kind` for the observed manager; the item id is
// taken from the desk item of that kind.
ui::DeskRequest DesktopActions::menu(const ui::DeskState& observed, int kind) {
ui::DeskRequest request;
request.kind = ui::DeskRequestKind::open_menu;
@@ -18,6 +26,8 @@ ui::DeskRequest DesktopActions::menu(const ui::DeskState& observed, int kind) {
return request;
}
// Runs `action` as a transaction on the desk settings owner; the checkpoint is restored
// if the action fails.
bool DeskSettingsActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_window(session_, revision, session_.desk_settings_checkpoint(revision),
[&](CareerSession::DeskSettingsCheckpoint before) {
@@ -25,6 +35,7 @@ bool DeskSettingsActions::apply(uint64_t& revision, const std::function<bool()>&
}, action);
}
// Opens the desk settings screen; `acknowledge` receives the projection on success.
std::optional<CareerSession::DeskSettingsProjection> DeskSettingsActions::open(
const ui::DeskRequest& request, uint64_t& revision, std::string& error, const OpenAccept& acknowledge) {
std::optional<CareerSession::DeskSettingsProjection> result;
@@ -37,6 +48,7 @@ std::optional<CareerSession::DeskSettingsProjection> DeskSettingsActions::open(
return result;
}
// Sends any settings action (write, file, close) to the session in one transaction.
std::optional<CareerSession::DeskSettingsDispatch> DeskSettingsActions::dispatch(
const CareerSession::DeskSettingsAction& request, uint64_t& revision, std::string& error,
const Accept& acknowledge) {
@@ -50,16 +62,19 @@ std::optional<CareerSession::DeskSettingsDispatch> DeskSettingsActions::dispatch
return result;
}
// Dispatches a settings write for the owner identified by `sequence`.
std::optional<CareerSession::DeskSettingsDispatch> DeskSettingsActions::write(uint64_t sequence,
const ui::SettingsWriteRequest& request, uint64_t& revision, std::string& error, const Accept& acknowledge) {
return dispatch(CareerSession::DeskSettingsWrite{sequence, request}, revision, error, acknowledge);
}
// Dispatches a settings file (save/load) request for the owner `sequence`.
std::optional<CareerSession::DeskSettingsDispatch> DeskSettingsActions::file(uint64_t sequence,
const ui::SaveLoadRequest& request, uint64_t& revision, std::string& error, const Accept& acknowledge) {
return dispatch(CareerSession::DeskSettingsFile{sequence, request}, revision, error, acknowledge);
}
// Dispatches the close of the settings owner, built from the observed desk request.
std::optional<CareerSession::DeskSettingsDispatch> DeskSettingsActions::close(uint64_t sequence,
uint64_t owner_revision, const ui::DeskRequest& observed, uint64_t& revision, std::string& error,
const Accept& acknowledge) {
@@ -67,6 +82,8 @@ std::optional<CareerSession::DeskSettingsDispatch> DeskSettingsActions::close(ui
return dispatch(CareerSession::DeskSettingsClose{owner}, revision, error, acknowledge);
}
// Applies one edit (row, column, operation) to the settings cells; the request carries
// the observed cells so that a stale view is detected.
bool DeskSettingsActions::edit(const ui::SettingsState& observed, int row, int column, ui::SettingsEdit operation,
uint64_t& revision, std::string& error) {
ui::SettingsWriteRequest request;
@@ -79,11 +96,13 @@ bool DeskSettingsActions::edit(const ui::SettingsState& observed, int row, int c
return apply(revision, [&] { return session_.dispatch_settings(request, revision, error); });
}
// Runs `action` as a transaction restoring the balance checkpoint on failure.
bool BalanceActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_window(session_, revision, session_.balance_checkpoint(),
[&](CareerSession::BalanceCheckpoint before) { session_.restore_balance_checkpoint(std::move(before)); }, action);
}
// Opens the balance (finance plan) screen over `underlay`.
std::optional<ui::BalanceState> BalanceActions::open(const ui::DeskRequest& request,
uint64_t& revision, const Image& underlay, std::string& error, const OpenAccept& acknowledge) {
std::optional<ui::BalanceState> result;
@@ -96,6 +115,7 @@ std::optional<ui::BalanceState> BalanceActions::open(const ui::DeskRequest& requ
return result;
}
// Sends a balance screen request to the session in one transaction.
std::optional<CareerSession::BalanceDispatch> BalanceActions::dispatch(const ui::BalanceRequest& request,
uint64_t& revision, std::string& error, const Accept& acknowledge) {
std::optional<CareerSession::BalanceDispatch> result;
@@ -108,13 +128,20 @@ std::optional<CareerSession::BalanceDispatch> BalanceActions::dispatch(const ui:
return result;
}
// Draft helpers for the console balance plan (thin wrappers around the game functions):
// open a draft for a manager,
BalancePlanDraft BalanceActions::open_draft(int manager) const { return bmh::open_balance_plan(session_.state(), manager); }
// switch its view,
void BalanceActions::cycle_draft(BalancePlanDraft& draft) const { cycle_balance_view(session_.state(), draft); }
// reset it,
void BalanceActions::reset_draft(BalancePlanDraft& draft) const { reset_balance_plan(session_.state(), draft); }
// and edit one row.
BalanceEditStatus BalanceActions::edit_draft(BalancePlanDraft& draft, int row, int32_t value) const {
return edit_balance_plan(session_.state(), draft, row, value);
}
// Closes the draft inside a transaction and always increases the revision. Returns the
// warning flag reported by the close.
bool BalanceActions::close_draft(const BalancePlanDraft& draft, uint64_t& revision) {
bool warning = false;
apply(revision, [&] {
@@ -125,11 +152,13 @@ bool BalanceActions::close_draft(const BalancePlanDraft& draft, uint64_t& revisi
return warning;
}
// Runs `action` as a transaction restoring the other-games checkpoint on failure.
bool OtherGamesActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_window(session_, revision, session_.other_games_checkpoint(),
[&](CareerSession::OtherGamesCheckpoint before) { session_.restore_other_games_checkpoint(std::move(before)); }, action);
}
// Opens the other-games screen over `underlay`.
std::optional<ui::OtherGamesState> OtherGamesActions::open(const ui::DeskRequest& request,
uint64_t& revision, const Image& underlay, std::string& error, const OpenAccept& acknowledge) {
std::optional<ui::OtherGamesState> result;
@@ -142,6 +171,8 @@ std::optional<ui::OtherGamesState> OtherGamesActions::open(const ui::DeskRequest
return result;
}
// Sends an other-games request to the session; `team_info` presents club information
// when the screen asks for it.
std::optional<CareerSession::OtherGamesDispatch> OtherGamesActions::dispatch(const ui::OtherGamesRequest& request,
uint64_t& revision, std::string& error, const TransferOfferTeamInfoPresenter& team_info, const Accept& acknowledge) {
std::optional<CareerSession::OtherGamesDispatch> result;
@@ -154,11 +185,13 @@ std::optional<CareerSession::OtherGamesDispatch> OtherGamesActions::dispatch(con
return result;
}
// Runs `action` as a transaction restoring the top scorers checkpoint on failure.
bool TopScorersActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_window(session_, revision, session_.top_scorers_checkpoint(),
[&](CareerSession::TopScorersCheckpoint before) { session_.restore_top_scorers_checkpoint(std::move(before)); }, action);
}
// Opens the top scorers screen over `underlay`; the revision is increased on opening.
std::optional<ui::TopScorersState> TopScorersActions::open(const ui::DeskRequest& request,
uint64_t& revision, const Image& underlay, std::string& error, const OpenAccept& acknowledge) {
std::optional<ui::TopScorersState> result;
@@ -172,6 +205,7 @@ std::optional<ui::TopScorersState> TopScorersActions::open(const ui::DeskRequest
return result;
}
// Sends a top scorers request to the session in one transaction.
std::optional<CareerSession::TopScorersDispatch> TopScorersActions::dispatch(const ui::TopScorersRequest& request,
uint64_t& revision, std::string& error, const Accept& acknowledge) {
std::optional<CareerSession::TopScorersDispatch> result;
@@ -184,11 +218,13 @@ std::optional<CareerSession::TopScorersDispatch> TopScorersActions::dispatch(con
return result;
}
// Runs `action` as a transaction restoring the opportunities checkpoint on failure.
bool OpportunitiesActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_window(session_, revision, session_.opportunities_checkpoint(),
[&](CareerSession::OpportunitiesCheckpoint before) { session_.restore_opportunities_checkpoint(std::move(before)); }, action);
}
// Opens the opportunities screen over `underlay`; the revision is increased on opening.
std::optional<ui::OpportunitiesState> OpportunitiesActions::open(const ui::DeskRequest& request,
uint64_t& revision, const Image& underlay, std::string& error, bool national_source_case,
int stable_identity, const OpenAccept& acknowledge) {
@@ -203,6 +239,7 @@ std::optional<ui::OpportunitiesState> OpportunitiesActions::open(const ui::DeskR
return result;
}
// Sends an opportunities request to the session in one transaction.
std::optional<CareerSession::OpportunitiesDispatch> OpportunitiesActions::dispatch(const ui::OpportunitiesRequest& request,
uint64_t& revision, std::string& error, const Accept& acknowledge) {
std::optional<CareerSession::OpportunitiesDispatch> result;
@@ -215,6 +252,8 @@ std::optional<CareerSession::OpportunitiesDispatch> OpportunitiesActions::dispat
return result;
}
// Stores a changed statistics display preference (expected flags to target flags) and
// increases the revision; throws if the revision counter is exhausted.
bool OpportunitiesActions::preference(const ui::AnalyticsRequest& request, uint64_t& revision,
std::string& error, const std::function<void()>& acknowledge) {
return apply(revision, [&] {
@@ -227,15 +266,18 @@ bool OpportunitiesActions::preference(const ui::AnalyticsRequest& request, uint6
});
}
// Builds the request that closes the observed opportunities screen.
ui::OpportunitiesRequest OpportunitiesActions::close_request(const ui::OpportunitiesState& observed) {
return {observed.identity, ui::OpportunitiesAction::close, observed.mode};
}
// Runs `action` as a transaction restoring the manager join checkpoint on failure.
bool ManagerJoinActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_window(session_, revision, session_.manager_join_checkpoint(),
[&](CareerSession::ManagerJoinCheckpoint before) { session_.restore_manager_join_checkpoint(std::move(before)); }, action);
}
// Commits a new manager joining the career; `acknowledge` receives the initialization result.
bool ManagerJoinActions::commit(uint64_t& revision, std::string& error,
const std::function<void(ui::CareerInitializationResult&)>& acknowledge) {
return apply(revision, [&] {
@@ -246,6 +288,7 @@ bool ManagerJoinActions::commit(uint64_t& revision, std::string& error,
});
}
// Sends a mailbox action (via the native transaction wrapper) and acknowledges it.
bool MailboxActions::dispatch(const ui::MailboxActionRequest& request, uint64_t& revision,
std::string& error, const std::function<void()>& acknowledge) {
return detail::apply_native(session_, revision, [&] {
@@ -255,6 +298,7 @@ bool MailboxActions::dispatch(const ui::MailboxActionRequest& request, uint64_t&
});
}
// Acknowledges the closing of the mailbox.
bool MailboxActions::close(const ui::MailboxCloseRequest& request, uint64_t& revision,
std::string& error, const std::function<void()>& acknowledge) {
return detail::apply_native(session_, revision, [&] {
@@ -264,6 +308,7 @@ bool MailboxActions::close(const ui::MailboxCloseRequest& request, uint64_t& rev
});
}
// Builds a mailbox action request for the observed message (entry index and raw entry).
ui::MailboxActionRequest MailboxActions::request(int manager, uint64_t revision,
ui::MailboxActionKind kind, const ui::MailboxMessage& observed) {
ui::MailboxActionRequest request;
@@ -275,6 +320,7 @@ ui::MailboxActionRequest MailboxActions::request(int manager, uint64_t revision,
return request;
}
// Sends a menu layout save/load request and acknowledges it.
bool MenuLayoutActions::dispatch(const ui::SaveLoadRequest& request, uint64_t& revision,
std::string& error, const std::function<void()>& acknowledge) {
return detail::apply_native(session_, revision, [&] {
@@ -284,16 +330,22 @@ bool MenuLayoutActions::dispatch(const ui::SaveLoadRequest& request, uint64_t& r
});
}
// Sets one environment item through set_impl (normal UI path).
std::optional<EnvironmentResult> EnvironmentActions::set(const ui::EnvironmentRequest& request,
uint64_t& revision, std::string& error, const Notice& notice, const std::function<void(bool)>& acknowledge) {
return set_impl(request, revision, error, notice, acknowledge, false);
}
// Console variant of set(): the staged state is published even if nothing changed.
std::optional<EnvironmentResult> EnvironmentActions::set_console(const ui::EnvironmentView& observed,
int item, int level, uint64_t& revision, std::string& error, const Notice& notice) {
return set_impl(request(observed, item, level), revision, error, notice, {}, true);
}
// Shared implementation. The request must match the current revision, manager slot
// (0..3), active manager and club, otherwise error is "stale_environment_owner". The change
// is made on a staged copy; a notice callback may abort it. The revision increases only
// when something changed. Returns nothing if the transaction was not accepted.
std::optional<EnvironmentResult> EnvironmentActions::set_impl(const ui::EnvironmentRequest& request,
uint64_t& revision, std::string& error, const Notice& notice, const std::function<void(bool)>& acknowledge,
bool publish_console_result) {
@@ -333,6 +385,7 @@ std::optional<EnvironmentResult> EnvironmentActions::set_impl(const ui::Environm
return result;
}
// Builds a set_item request for `item` and `level` bound to the observed view.
ui::EnvironmentRequest EnvironmentActions::request(const ui::EnvironmentView& observed, int item, int level) {
ui::EnvironmentRequest request;
request.kind = ui::EnvironmentRequestKind::set_item;
@@ -345,10 +398,12 @@ ui::EnvironmentRequest EnvironmentActions::request(const ui::EnvironmentView& ob
return request;
}
// Runs `action` through the native transaction wrapper.
bool RescheduleActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_native(session_, revision, action);
}
// Moves a league match to `day` or undoes a move; any other combination is invalid.
RescheduleStatus RescheduleActions::change(GameState& state, int manager, const LeagueMatchRef& match,
int day, ui::RescheduleActionKind kind) {
if (kind == ui::RescheduleActionKind::move) return reschedule_league_match(state, manager, match, day);
@@ -356,6 +411,9 @@ RescheduleStatus RescheduleActions::change(GameState& state, int manager, const
return RescheduleStatus::invalid_match;
}
// Handles a UI reschedule action: the owner must be the open menu 7 for the current
// revision and active manager, and the match must be among the eligible (or already moved)
// matches. The state changes only when the move succeeds.
RescheduleStatus RescheduleActions::dispatch(const ui::RescheduleAction& request, uint64_t& revision,
const std::function<void()>& acknowledge) {
auto status = RescheduleStatus::invalid_match;
@@ -379,6 +437,7 @@ RescheduleStatus RescheduleActions::dispatch(const ui::RescheduleAction& request
return status;
}
// Moves a match directly (console path); the revision increases on success.
RescheduleStatus RescheduleActions::move(int manager, const LeagueMatchRef& match, int day, uint64_t& revision) {
auto status = RescheduleStatus::invalid_match;
apply(revision, [&] {
@@ -390,6 +449,7 @@ RescheduleStatus RescheduleActions::move(int manager, const LeagueMatchRef& matc
return status;
}
// Console undo; the revision always increases, whatever the result of the undo.
void RescheduleActions::undo_console(int manager, int day, uint64_t& revision) {
apply(revision, [&] {
// Keep the Console's existing accepted-command revision after its own
@@ -400,6 +460,8 @@ void RescheduleActions::undo_console(int manager, int day, uint64_t& revision) {
});
}
// Sends a contract request to the session. If an exception follows an accepted request,
// the pending contract quote is cleared before rethrowing.
bool ContractActions::dispatch(const ui::ContractRequest& request, uint64_t& revision,
ui::ContractActionResult& result, std::string& error, const std::function<void()>& acknowledge) {
bool accepted = false;
@@ -417,6 +479,7 @@ bool ContractActions::dispatch(const ui::ContractRequest& request, uint64_t& rev
}
}
// Creates a contract request of `kind` bound to the observed manager, club and revision.
ui::ContractRequest ContractActions::bind(const ui::ContractsState& observed,
ui::ContractActionKind kind, uint64_t request_id) {
ui::ContractRequest request;
@@ -428,6 +491,7 @@ ui::ContractRequest ContractActions::bind(const ui::ContractsState& observed,
return request;
}
// Request for a player's contract demands (row and player id).
ui::ContractRequest ContractActions::demands(const ui::ContractsState& observed,
const ui::ContractPlayer& player, uint64_t request_id) {
auto request = bind(observed, ui::ContractActionKind::request_demands, request_id);
@@ -436,6 +500,7 @@ ui::ContractRequest ContractActions::demands(const ui::ContractsState& observed,
return request;
}
// Request that sets team bonus `index` to `percent`, keeping the other proposed premiums.
ui::ContractRequest ContractActions::team_bonus(const ui::ContractsState& observed,
int index, uint8_t percent, uint64_t request_id) {
auto request = bind(observed, ui::ContractActionKind::submit_bonuses, request_id);
@@ -444,6 +509,7 @@ ui::ContractRequest ContractActions::team_bonus(const ui::ContractsState& observ
return request;
}
// Request to insure a player (quote, insurance form in the term column, months).
ui::ContractRequest ContractActions::insurance(const ui::ContractsState& observed, int row,
int player, uint64_t quote, uint8_t form, uint8_t months, uint64_t request_id) {
auto request = bind(observed, ui::ContractActionKind::insure_player, request_id);
@@ -452,6 +518,8 @@ ui::ContractRequest ContractActions::insurance(const ui::ContractsState& observe
return request;
}
// Request for a contract offer. With years > 0 it is an offer for that term (salary and
// the matching demand); with 0 years only the bonuses are submitted.
ui::ContractRequest ContractActions::offer(const ui::ContractsState& observed, int row,
int player, uint64_t quote, const std::array<uint8_t,7>& bonuses, int years, uint32_t salary,
const std::array<uint32_t,4>& demands, uint64_t request_id) {
@@ -466,10 +534,12 @@ ui::ContractRequest ContractActions::offer(const ui::ContractsState& observed, i
return request;
}
// Runs `action` through the native transaction wrapper.
bool FriendlyActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return detail::apply_native(session_, revision, action);
}
// Converts the UI's friendly match request into the engine's booking request.
FriendlyBookingRequest FriendlyActions::booking_request(const ui::FriendlyMatchRequest& observed) {
FriendlyBookingQuote quote;
quote.status = FriendlyQuoteStatus::quoted;
@@ -487,6 +557,7 @@ FriendlyBookingRequest FriendlyActions::booking_request(const ui::FriendlyMatchR
observed.accept_cost, observed.approving_manager};
}
// Builds the acknowledgement for the UI from the booking outcome and the new revision.
ui::FriendlyBookingAck FriendlyActions::acknowledgement(const ui::FriendlyMatchRequest& request,
const FriendlyBookingResult& outcome, uint64_t revision) const {
ui::FriendlyBookingAck ack;
@@ -499,6 +570,9 @@ ui::FriendlyBookingAck FriendlyActions::acknowledgement(const ui::FriendlyMatchR
return ack;
}
// Books a friendly match (club or national). The request must be a book request for the
// current revision, otherwise the quote is stale. After booking, the planner count must
// have grown by 2, else the booking is rolled back and planner_mismatch is set.
FriendlyActions::Booking FriendlyActions::book(const ui::FriendlyMatchRequest& request,
uint64_t& revision, bool national, const Accept& acknowledge) {
Booking result;
@@ -526,11 +600,14 @@ FriendlyActions::Booking FriendlyActions::book(const ui::FriendlyMatchRequest& r
return result;
}
// Books a club friendly.
FriendlyActions::Booking FriendlyActions::book_club(const ui::FriendlyMatchRequest& request,
uint64_t& revision, const Accept& acknowledge) { return book(request, revision, false, acknowledge); }
// Books a national team friendly.
FriendlyActions::Booking FriendlyActions::book_national(const ui::FriendlyMatchRequest& request,
uint64_t& revision, const Accept& acknowledge) { return book(request, revision, true, acknowledge); }
// Console booking from an existing quote; the revision increases when it was booked.
FriendlyBookingResult FriendlyActions::book_console(const FriendlyBookingQuote& quote, uint16_t day,
bool accept_opponent, int consenting_manager, bool accept_cost, int approving_manager, uint64_t& revision) {
FriendlyBookingResult result;
@@ -544,19 +621,25 @@ FriendlyBookingResult FriendlyActions::book_console(const FriendlyBookingQuote&
return result;
}
// Quote functions (thin wrappers over the game functions): club friendly quote,
FriendlyBookingQuote FriendlyActions::quote(int manager, int opponent, bool home) const {
return quote_friendly_match(session_.state(), manager, opponent, home);
}
// national friendly quote (uses the random generator),
NationalFriendlyQuote FriendlyActions::national_quote(const NationalFriendlyOwner& owner, int opponent, bool home) {
return quote_national_friendly_match(session_.state(), owner, opponent, home, session_.rand());
}
// whether a club friendly can be played on a day,
FriendlyDateStatus FriendlyActions::date_status(const FriendlyBookingQuote& quote, uint16_t day) const {
return friendly_match_date_status(session_.state(), quote, day);
}
// the same for a national friendly,
FriendlyDateStatus FriendlyActions::national_date_status(const NationalFriendlyQuote& quote,
const NationalFriendlyOwner& owner, uint16_t day) const {
return national_friendly_match_date_status(session_.state(), quote, owner, session_.rand(), day);
}
// and the owner identity of a national friendly built from the request (the last two
// fields are fixed constants).
NationalFriendlyOwner FriendlyActions::national_owner(const ui::FriendlyMatchRequest& request) {
return {request.quote_id, request.revision, request.manager_slot, 0x165, 6};
}
+7
View File
@@ -1,4 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// Application-boundary facades for desk-level windows: one small class per owner (desk
// settings, balance plan, other games, top scorers, opportunities, manager join, mailbox,
// menu layout, environment, reschedule, contracts, friendly matches). Each wraps a
// CareerSession reference; its apply() runs an action under a rollback transaction (see
// action_transaction.hpp), and open()/dispatch() take the UI request plus the shared
// revision counter and an optional "accept" callback that carries the front end's
// acknowledgement. Implemented in desktop_actions.cpp; window_actions.hpp holds the club windows.
#pragma once
#include "app/career_session.hpp"
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// SDL event helpers for the live match-day presentation, which runs while the engine is
// synchronously paused in its observer hook. live_matchday_board_side() turns a mouse press
// into a side (0 or 1) of the board only at the allowed minutes and screen intervals;
// pump_live_matchday_events() drains the SDL queue, reports a quit request and an ESC skip
// through its return value / out-parameter, and re-queues only non-interactive system events.
// Header-only; owns no state.
#pragma once
#include <SDL.h>
+753 -270
View File
File diff suppressed because it is too large. Load diff
+63
View File
@@ -0,0 +1,63 @@
// SPDX-License-Identifier: GPL-3.0-only
// Mouse pointer for the pitch page. SDL owns the pointer position; the UI only hands over
// the original 11x11 pixel bitmap (121 ARGB values). PitchPointer builds an SDL colour
// cursor from it, enlarged by an integer scale derived from the window size in points, and
// caches it until the pixels or the scale change. set_default() sets the bitmap used on all
// other pages. Header-only; the cursor is freed in clear() / the destructor.
#pragma once
#include <SDL.h>
#include <algorithm>
#include <array>
#include <cstdint>
#include <optional>
#include <vector>
namespace bmh::app {
// SDL owns pointer position; the UI supplies only the original bitmap/colors. Everywhere but on the
// pitch page the pointer is the original's default 11x11 bitmap (set_default); the pitch page
// passes the same bitmap with its position-colour fill.
class PitchPointer {
public:
~PitchPointer() { clear(); }
void clear() {
if (cursor_) {
SDL_SetCursor(SDL_GetDefaultCursor());
SDL_FreeCursor(cursor_);
cursor_ = nullptr;
}
pixels_.reset();
}
void set_default(const std::optional<std::array<uint32_t,121>>& pixels) { default_ = pixels; }
void show(const std::optional<std::array<uint32_t,121>>& requested, SDL_Renderer* renderer) {
const auto& pixels = requested ? requested : default_;
if (!pixels) { SDL_SetCursor(SDL_GetDefaultCursor()); return; }
// Cursor bitmaps are sized in window points, not in pixels: on a high-DPI display (macOS
// Retina) the renderer's output is larger than the window, and a bitmap scaled to it would
// show twice as large. SDL_GetWindowSize gives the points.
int width = 320, height = 240;
if (SDL_Window* window = SDL_RenderGetWindow(renderer)) SDL_GetWindowSize(window, &width, &height);
else SDL_GetRendererOutputSize(renderer, &width, &height);
const int scale = std::max(1, std::min(width / 320, height / 240));
if (!cursor_ || pixels != pixels_ || scale != scale_) {
std::vector<uint32_t> enlarged(size_t(11 * scale) * size_t(11 * scale));
for (int y = 0; y < 11 * scale; ++y) for (int x = 0; x < 11 * scale; ++x)
enlarged[size_t(y) * size_t(11 * scale) + size_t(x)] =
pixels->at(size_t(y / scale) * 11 + size_t(x / scale));
SDL_Surface* surface = SDL_CreateRGBSurfaceWithFormatFrom(enlarged.data(),
11 * scale, 11 * scale, 32, 11 * scale * 4, SDL_PIXELFORMAT_ARGB8888);
SDL_Cursor* next = surface ? SDL_CreateColorCursor(surface, 0, 0) : nullptr;
if (surface) SDL_FreeSurface(surface);
if (!next) return; // A headless SDL driver may not support host cursors.
clear(); cursor_ = next; pixels_ = pixels; scale_ = scale;
}
SDL_SetCursor(cursor_);
}
private:
SDL_Cursor* cursor_ = nullptr;
std::optional<std::array<uint32_t,121>> pixels_, default_;
int scale_ = 1;
};
} // namespace bmh::app
+68
View File
@@ -0,0 +1,68 @@
// SPDX-License-Identifier: GPL-3.0-only
// Quit confirmation (a deliberate deviation from the original): a native message box in
// German or English whose default button is "Cancel". poll() and peep() wrap
// SDL_PollEvent / SDL_PeepEvents and drop SDL_QUIT events the user does not confirm. The
// dialog is shown from the UI thread only, and a dialog that fails to open counts as "not
// confirmed". The presenter is injectable (defaults to SDL_ShowMessageBox). Header-only.
#pragma once
#include <SDL.h>
#include <functional>
#include <utility>
namespace bmh::app {
// OpenBMH deviates from the original: confirms application exit with a localized native dialog, with cancellation selected by default.
// All event retrieval remains on the UI thread. An event filter/watch could run
// on SDL's event thread and must not own a native modal dialog.
class QuitConfirmation {
public:
using Presenter = std::function<int(const SDL_MessageBoxData*, int*)>;
QuitConfirmation(SDL_Window* window, bool english, Presenter presenter = SDL_ShowMessageBox)
: window_(window), english_(english), presenter_(std::move(presenter)) {}
bool confirm() {
if (confirmed_) return true;
const SDL_MessageBoxButtonData buttons[] = {
{SDL_MESSAGEBOX_BUTTON_RETURNKEY_DEFAULT | SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT,
0, english_ ? "Cancel" : "Abbrechen"},
{0, 1, english_ ? "Quit" : "Beenden"}
};
const SDL_MessageBoxData dialog{SDL_MESSAGEBOX_WARNING, window_,
english_ ? "Quit OpenBMH?" : "OpenBMH beenden?",
english_ ? "Do you really want to quit OpenBMH?\nUnsaved changes will be lost." :
"OpenBMH wirklich beenden?\nNicht gespeicherte Änderungen gehen verloren.",
2, buttons, nullptr};
int selected = 0;
if (presenter_(&dialog, &selected) < 0) {
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Cannot show quit confirmation: %s", SDL_GetError());
return false; // A failed dialog must not silently discard the session.
}
confirmed_ = selected == 1;
return confirmed_;
}
int poll(SDL_Event* event) {
if (!event) return SDL_PollEvent(nullptr);
while (SDL_PollEvent(event)) {
if (event->type != SDL_QUIT || confirm()) return 1;
}
return 0;
}
int peep(SDL_Event* events, int count, SDL_eventaction action, Uint32 first, Uint32 last) {
const int received = SDL_PeepEvents(events, count, action, first, last);
if (received <= 0 || !events || action != SDL_GETEVENT) return received;
int kept = 0;
for (int i = 0; i < received; ++i)
if (events[i].type != SDL_QUIT || confirm()) events[kept++] = events[i];
return kept;
}
private:
SDL_Window* window_;
bool english_, confirmed_ = false;
Presenter presenter_;
};
} // namespace bmh::app
+45
View File
@@ -0,0 +1,45 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of StartScreen (start_screen.hpp): decodes the embedded JPEG
// (start_screen_data.hpp) with stb_image into an RGB24 texture, switches the renderer's
// logical size to the image size while presenting and restores the previous logical size in
// the destructor. Errors are reported as std::runtime_error; the stb_image implementation
// is compiled into this file only (JPEG decoding, no stdio).
#include "app/start_screen.hpp"
#include "app/start_screen_data.hpp"
#include <SDL.h>
#include <memory>
#include <stdexcept>
#include <string>
#define STBI_ONLY_JPEG
#define STBI_NO_STDIO
#define STBI_NO_HDR
#define STBI_NO_LINEAR
#define STB_IMAGE_IMPLEMENTATION
#include "app/third_party/stb_image.h"
namespace bmh::app {
StartScreen::StartScreen(SDL_Renderer* renderer):renderer_(renderer) {
if(!renderer_)throw std::runtime_error("Start screen: missing renderer");
SDL_RenderGetLogicalSize(renderer_,&previous_width_,&previous_height_);
int channels=0;
const std::unique_ptr<unsigned char,decltype(&stbi_image_free)> pixels(
stbi_load_from_memory(start_screen_jpeg,int(start_screen_jpeg_size),&width_,&height_,&channels,3),stbi_image_free);
if(!pixels)throw std::runtime_error("Start screen: embedded artwork could not be decoded");
texture_=SDL_CreateTexture(renderer_,SDL_PIXELFORMAT_RGB24,SDL_TEXTUREACCESS_STATIC,width_,height_);
if(!texture_)throw std::runtime_error(SDL_GetError());
if(SDL_UpdateTexture(texture_,nullptr,pixels.get(),width_*3)!=0||SDL_SetTextureScaleMode(texture_,SDL_ScaleModeLinear)!=0) {
const std::string error=SDL_GetError();SDL_DestroyTexture(texture_);texture_=nullptr;throw std::runtime_error(error);
}
}
StartScreen::~StartScreen() {
SDL_DestroyTexture(texture_);
SDL_RenderSetLogicalSize(renderer_,previous_width_,previous_height_);
}
void StartScreen::present() {
if(SDL_RenderSetLogicalSize(renderer_,width_,height_)!=0)throw std::runtime_error(SDL_GetError());
Uint8 r=0,g=0,b=0,a=0;SDL_GetRenderDrawColor(renderer_,&r,&g,&b,&a);
SDL_SetRenderDrawColor(renderer_,0,0,0,255);
const int cleared=SDL_RenderClear(renderer_);SDL_SetRenderDrawColor(renderer_,r,g,b,a);
if(cleared!=0||SDL_RenderCopy(renderer_,texture_,nullptr,nullptr)!=0)throw std::runtime_error(SDL_GetError());
SDL_RenderPresent(renderer_);
}
}
+26
View File
@@ -0,0 +1,26 @@
// SPDX-License-Identifier: GPL-3.0-only
// Start screen shown before the game data is loaded: one embedded picture drawn with its
// own renderer logical size, independent of the indexed game canvas. Owns the SDL
// texture; non-copyable. Implemented in start_screen.cpp, the image bytes come from
// start_screen_data.hpp.
#pragma once
struct SDL_Renderer;
struct SDL_Texture;
namespace bmh::app {
// Owned, embedded artwork, rendered independently of the indexed game canvas.
// Destruction restores the caller's logical size and therefore its input mapping.
class StartScreen {
public:
explicit StartScreen(SDL_Renderer*);
~StartScreen();
StartScreen(const StartScreen&)=delete;
StartScreen& operator=(const StartScreen&)=delete;
void present();
int width()const{return width_;}
int height()const{return height_;}
private:
SDL_Renderer* renderer_;
SDL_Texture* texture_=nullptr;
int width_=0,height_=0,previous_width_=0,previous_height_=0;
};
}
+9
View File
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Declares the embedded start screen artwork (JPEG bytes and their size); the definitions
// live in a separate data translation unit. Consumed only by start_screen.cpp.
#pragma once
#include <cstddef>
namespace bmh::app {
extern const unsigned char start_screen_jpeg[];
extern const std::size_t start_screen_jpeg_size;
}
+8
View File
@@ -0,0 +1,8 @@
# stb_image
Unmodified upstream stb_image 2.30 header, commit `013ac3beddff3dbffafd5177e7972067cd2b5083`.
Source: [013ac3beddff3dbffafd5177e7972067cd2b5083](https://github.com/nothings/stb/blob/013ac3beddff3dbffafd5177e7972067cd2b5083/stb_image.h).
SHA256: `594c2fe35d49488b4382dbfaec8f98366defca819d916ac95becf3e75f4200b3`.
Only JPEG decoding is compiled. The complete dual MIT/public-domain license
is retained in the header and in `docs/licenses/stb_image.txt`.
+7988
View File
File diff suppressed because it is too large. Load diff
+25
View File
@@ -0,0 +1,25 @@
// SPDX-License-Identifier: GPL-3.0-only
// RAII guard for SDL video: SDL_Init(SDL_INIT_VIDEO) in the constructor (throws
// std::runtime_error on failure) and SDL_Quit in the destructor. It must exist before any
// native file picker is opened (see the comment on the class). Non-copyable, header-only.
#pragma once
#include <SDL.h>
#include <stdexcept>
#include <string>
namespace bmh::app {
// Establish SDL's native application before any file picker can create NSApp.
// Cocoa otherwise retains the picker's non-keyboard activation policy.
class VideoSession {
public:
VideoSession() {
if (SDL_Init(SDL_INIT_VIDEO) != 0) {
const std::string error = SDL_GetError();
SDL_Quit();
throw std::runtime_error(error);
}
}
~VideoSession() { SDL_Quit(); }
VideoSession(const VideoSession&) = delete;
VideoSession& operator=(const VideoSession&) = delete;
};
}
+75 -3
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the club and league window facades declared in window_actions.hpp. Each
// method validates the UI request against the session state, runs it on the CareerSession
// inside an apply() transaction (state, RNG and revision are restored on rejection or an
// exception) and hands the result to the front end's acknowledgement callback. Errors come
// back through the std::string& error parameter; see controller.cpp for the overall model.
#include "formats/executable_layout.hpp"
#include "app/window_actions.hpp"
#include "app/action_transaction.hpp"
@@ -11,6 +16,9 @@
namespace bmh::app {
using detail::apply_window;
// Runs `action` as a transaction on the league family state. Returns true if the action
// succeeded; if it returns false or throws, the checkpoint and the revision are restored
// (an exception is rethrown).
bool LeagueFamilyActions::apply(uint64_t& revision, const std::function<bool()>& action) {
auto before = session_.league_family_checkpoint();
const auto old_revision = revision;
@@ -26,6 +34,8 @@ bool LeagueFamilyActions::apply(uint64_t& revision, const std::function<bool()>&
return false;
}
// Opens the league pairings screen from the desk (menu kind 1, using the desk item of
// kind 1). Returns its state, or nothing with `error` set if the session refused.
std::optional<ui::LeaguePairingsState> LeagueFamilyActions::open_pairings(
const ui::DeskState& observed, uint64_t& revision, std::string& error) {
ui::DeskRequest request;
@@ -43,6 +53,7 @@ std::optional<ui::LeaguePairingsState> LeagueFamilyActions::open_pairings(
return result;
}
// Sends one pairings screen event (kind and value) to the session inside a transaction.
std::optional<CareerSession::LeaguePairingsDispatch> LeagueFamilyActions::pairings(
const ui::LeaguePairingsIdentity& observed, LeaguePairingsAction kind, int value,
uint64_t& revision, std::string& error) {
@@ -58,16 +69,19 @@ std::optional<CareerSession::LeaguePairingsDispatch> LeagueFamilyActions::pairin
return result;
}
// Builds the desk request that opens menu 1 (pairings) for the manager of `identity`.
ui::DeskRequest LeagueFamilyActions::pairings_entry(const ui::StrengthsIdentity& identity,
uint64_t revision) {
return {ui::DeskRequestKind::open_menu, identity.manager, 0, 1, -1, revision};
}
// Builds the pairings request that selects `league`.
ui::LeaguePairingsRequest LeagueFamilyActions::pairings_selection(
const ui::LeaguePairingsIdentity& identity, int league) {
return {identity, {LeaguePairingsAction::select_league, league, -1}};
}
// Turns a fresh strengths request into an `open` request bound to `identity`.
ui::StrengthsRequest LeagueFamilyActions::strengths_entry(const ui::StrengthsRequest& fresh,
const ui::StrengthsIdentity& identity) {
auto request = fresh;
@@ -76,6 +90,9 @@ ui::StrengthsRequest LeagueFamilyActions::strengths_entry(const ui::StrengthsReq
return request;
}
// Runs `action` as a transaction on the transfer state. Before it, the game state, random
// generators, offer editor, poach state, club modal runtime and revision are copied; they
// are all restored if the action returns false or throws (then rethrown).
bool TransferActions::apply(uint64_t& revision, const std::function<bool()>& action) {
auto state = session_.g_;
const auto game = session_.game_;
@@ -85,6 +102,7 @@ bool TransferActions::apply(uint64_t& revision, const std::function<bool()>& act
const auto owner_revision = session_.transfer_offer_revision_;
auto runtime = session_.club_modal_runtime_;
const auto old_revision = revision;
// Puts every saved piece back into the session.
const auto restore = [&] {
session_.g_ = std::move(state);
session_.game_ = game;
@@ -105,15 +123,21 @@ bool TransferActions::apply(uint64_t& revision, const std::function<bool()>& act
return false;
}
// Handles a transfer market request. In the normal interactive policy the session does
// the work (with the sale hooks and the review callback). The other policy is an older
// path that only allows listing a player and submitting a bid; it bumps the revision
// only if the state or random stream really changed. `acknowledge` is called on success.
std::optional<TransferActions::MarketDispatch> TransferActions::market(
const ui::TransferMarketRequest& request, const HumanBuyerSaleHooks& hooks,
uint64_t& revision, std::string& error, HumanBuyerMarketEntryPolicy policy,
const MarketAccept& acknowledge) {
const MarketAccept& acknowledge,
const std::function<int(const GameState&, const TransferOfferListView&)>& review) {
std::optional<MarketDispatch> result;
// Body of the transaction; returning false rolls everything back.
apply(revision, [&] {
const auto old_revision = revision;
if (policy == HumanBuyerMarketEntryPolicy::normal_interactive) {
const auto action = session_.dispatch_transfer_market(request, hooks, revision, error);
const auto action = session_.dispatch_transfer_market(request, hooks, revision, error, review);
if (!action) return false;
result = MarketDispatch{*action, revision != old_revision};
} else {
@@ -150,6 +174,9 @@ std::optional<TransferActions::MarketDispatch> TransferActions::market(
return result;
}
// Checks a market request against the current state. Returns a German error text if the
// request is stale or invalid, or an empty string if it may proceed. Bonus values may be
// at most 255 (interactive policy) or 100 (legacy policy).
std::string TransferActions::rejection(const ui::TransferMarketRequest& request,
uint64_t revision, HumanBuyerMarketEntryPolicy policy) const {
const auto& state = session_.state();
@@ -174,11 +201,14 @@ std::string TransferActions::rejection(const ui::TransferMarketRequest& request,
return "Dieser Spieler gehört nicht mehr zur gewählten Kaderposition.";
} else if (request.kind != ui::TransferMarketRequestKind::open_offer &&
request.kind != ui::TransferMarketRequestKind::preview_quote &&
request.kind != ui::TransferMarketRequestKind::open_poach)
request.kind != ui::TransferMarketRequestKind::open_poach &&
request.kind != ui::TransferMarketRequestKind::review_offers &&
request.kind != ui::TransferMarketRequestKind::store_search_profile)
return "Diese Transferaktion ist nicht verfügbar.";
return {};
}
// Opens the transfer offer editor for a market request (one transaction).
std::optional<CareerSession::TransferOfferEditorDispatch> TransferActions::open_offer(
const ui::TransferMarketRequest& request, uint64_t& revision, std::string& error,
const OfferAccept& acknowledge) {
@@ -192,6 +222,7 @@ std::optional<CareerSession::TransferOfferEditorDispatch> TransferActions::open_
return result;
}
// Asks the session for a preview (quote) of a market request without committing it.
std::optional<CareerSession::TransferMarketPreviewDispatch> TransferActions::preview(
const ui::TransferMarketRequest& request, uint64_t& revision, std::string& error,
const PreviewAccept& acknowledge) {
@@ -205,6 +236,8 @@ std::optional<CareerSession::TransferMarketPreviewDispatch> TransferActions::pre
return result;
}
// Sends an action of the outgoing offer editor to the session; the team and player
// information presenters are used when it opens those screens.
std::optional<CareerSession::TransferOfferEditorDispatch> TransferActions::offer(
const ui::OutgoingTransferRequest& request, const HumanBuyerSaleHooks& hooks,
uint64_t& revision, std::string& error, const TransferOfferTeamInfoPresenter& team_info,
@@ -219,6 +252,7 @@ std::optional<CareerSession::TransferOfferEditorDispatch> TransferActions::offer
return result;
}
// Starts a poaching attempt for the given manager and squad slot.
std::optional<CareerSession::PoachDispatch> TransferActions::poach(int manager, int slot,
uint64_t& revision, std::string& error) {
std::optional<CareerSession::PoachDispatch> result;
@@ -229,6 +263,8 @@ std::optional<CareerSession::PoachDispatch> TransferActions::poach(int manager,
return result;
}
// Builds the request to list the squad player `item` on the market (as a loan if `loan`),
// bound to the observed state's manager, club and revision.
ui::TransferMarketRequest TransferActions::listing(const ui::TransferMarketState& observed,
const ui::TransferMarketSquadItem& item, bool loan) {
ui::TransferMarketRequest request;
@@ -244,6 +280,8 @@ ui::TransferMarketRequest TransferActions::listing(const ui::TransferMarketState
return request;
}
// Builds the request to open an offer for the market entry `item`; an existing own bid
// is used as the starting point.
ui::TransferMarketRequest TransferActions::opening(const ui::TransferMarketState& observed,
const ui::TransferMarketItem& item, bool loan) {
ui::TransferMarketRequest request;
@@ -261,6 +299,7 @@ ui::TransferMarketRequest TransferActions::opening(const ui::TransferMarketState
return request;
}
// Builds a request from the offer editor's current state plus the changed field and value.
ui::OutgoingTransferRequest TransferActions::editor(const ui::OutgoingTransferEditorState& observed,
ui::OutgoingTransferRequestKind kind, ui::OutgoingTransferField field, uint32_t value) {
ui::OutgoingTransferRequest request;
@@ -280,11 +319,13 @@ ui::OutgoingTransferRequest TransferActions::editor(const ui::OutgoingTransferEd
return request;
}
// Runs `action` as a transaction restoring the bank checkpoint on failure.
bool BankActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return apply_window(session_, revision, session_.bank_checkpoint(),
[&](CareerSession::BankCheckpoint before) { session_.restore_bank_checkpoint(std::move(before)); }, action);
}
// Sends a bank request to the session; `acknowledge` is called when it was accepted.
bool BankActions::dispatch(const ui::BankRequest& request, uint64_t& revision, std::string& error,
const std::function<void()>& acknowledge) {
return apply(revision, [&] {
@@ -294,6 +335,7 @@ bool BankActions::dispatch(const ui::BankRequest& request, uint64_t& revision, s
});
}
// Creates a bank request of `kind` bound to the observed manager, club and revision.
ui::BankRequest BankActions::bind(const ui::BankState& observed, ui::BankRequestKind kind) {
ui::BankRequest request;
request.kind = kind;
@@ -303,12 +345,14 @@ ui::BankRequest BankActions::bind(const ui::BankState& observed, ui::BankRequest
return request;
}
// Request to move `amount` to the deposit account.
ui::BankRequest BankActions::savings(const ui::BankState& observed, int32_t amount) {
auto request = bind(observed, ui::BankRequestKind::move_to_deposit);
request.amount = amount;
return request;
}
// Request for an investment action on asset index `asset` with `count` units.
ui::BankRequest BankActions::investment(const ui::BankState& observed, ui::BankRequestKind kind,
int asset, int count) {
auto request = bind(observed, kind);
@@ -317,6 +361,8 @@ ui::BankRequest BankActions::investment(const ui::BankState& observed, ui::BankR
return request;
}
// Request for a bank credit: carries the saved credit, the player's edits, whether the
// fees are accepted and the counterparty.
ui::BankRequest BankActions::credit(const ui::BankState& observed, const BankCreditContext& context,
const BankCreditDraft& draft, bool accept_fees, int counterparty) {
auto request = bind(observed, ui::BankRequestKind::bank_credit);
@@ -327,11 +373,14 @@ ui::BankRequest BankActions::credit(const ui::BankState& observed, const BankCre
return request;
}
// Runs `action` as a transaction restoring the stadium checkpoint on failure.
bool StadiumActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return apply_window(session_, revision, session_.stadium_checkpoint(),
[&](CareerSession::StadiumCheckpoint before) { session_.restore_stadium_checkpoint(std::move(before)); }, action);
}
// Sends a stadium request to the session with the notice hooks; `acknowledge` is called
// when it was accepted.
bool StadiumActions::dispatch(const ui::StadiumRequest& request, uint64_t& revision, std::string& error,
const ConstructionNoticeHook& construction, const SeasonTicketCompensationNoticeHook& compensation,
const std::function<void()>& acknowledge) {
@@ -342,6 +391,7 @@ bool StadiumActions::dispatch(const ui::StadiumRequest& request, uint64_t& revis
});
}
// Creates a stadium request bound to the observed club, revision, scope and sequence.
ui::StadiumRequest StadiumActions::request(const ui::StadiumState& observed, ui::StadiumRequestKind kind,
int object, int option, int32_t price, bool accept_tip) {
ui::StadiumRequest request;
@@ -359,6 +409,8 @@ ui::StadiumRequest StadiumActions::request(const ui::StadiumState& observed, ui:
return request;
}
// Sets the ticket price for the observed desk's club; the stable club identity is filled
// in when the club index is valid.
bool DeskActions::ticket_price(const ui::DeskState& observed, int price,
uint64_t& revision, std::string& error) {
TicketPriceRequest request;
@@ -371,11 +423,13 @@ bool DeskActions::ticket_price(const ui::DeskState& observed, int price,
return session_.dispatch_ticket_price(request, revision, error);
}
// Runs `action` as a transaction restoring the lineup checkpoint on failure.
bool LineupActions::apply(uint64_t& revision, const std::function<bool()>& action) {
return apply_window(session_, revision, session_.lineup_checkpoint(),
[&](CareerSession::LineupCheckpoint before) { session_.restore_lineup_checkpoint(std::move(before)); }, action);
}
// Sends a lineup request to the session; `acknowledge` is called when accepted.
bool LineupActions::lineup(const ui::LineupRequest& request, uint64_t& revision, std::string& error,
const std::function<void()>& acknowledge) {
return apply(revision, [&] {
@@ -385,6 +439,7 @@ bool LineupActions::lineup(const ui::LineupRequest& request, uint64_t& revision,
});
}
// Sends a pitch request to the session; `acknowledge` is called when accepted.
bool LineupActions::pitch(const ui::PitchRequest& request, uint64_t& revision, std::string& error,
const std::function<void()>& acknowledge) {
return apply(revision, [&] {
@@ -394,10 +449,13 @@ bool LineupActions::pitch(const ui::PitchRequest& request, uint64_t& revision, s
});
}
// Sends a pitch swap request to the session as one transaction.
bool LineupActions::pitch_swap(const ui::PitchRequest& request, uint64_t& revision, std::string& error) {
return apply(revision, [&] { return session_.dispatch_pitch_swap(request, revision, error); });
}
// Changes one order value (`aspect`) of a player. Only valid for the observed revision;
// on success the revision is increased.
bool LineupActions::order(const ui::LineupState& observed, const ui::LineupPlayer& player,
int aspect, int value, uint64_t& revision) {
return apply(revision, [&] {
@@ -408,6 +466,9 @@ bool LineupActions::order(const ui::LineupState& observed, const ui::LineupPlaye
});
}
// Tries the requested pitch move on a copy of the state and tells whether the player ends
// up paired with `second_row` (requested), with another player (other_pair) or whether the
// move is invalid.
LineupActions::PairTarget LineupActions::pair_target(const ui::PitchRequest& request, int second_row) const {
auto preview = session_.state();
if (!move_pitch_player_source(preview, request.manager_slot, request.runtime_club,
@@ -419,6 +480,7 @@ LineupActions::PairTarget LineupActions::pair_target(const ui::PitchRequest& req
? PairTarget::requested : PairTarget::other_pair;
}
// Creates a lineup request that prepares the lineup of the observed state.
ui::LineupRequest LineupActions::prepare(const ui::LineupState& observed) {
ui::LineupRequest request;
request.kind = ui::LineupRequestKind::prepare_lineup;
@@ -428,6 +490,7 @@ ui::LineupRequest LineupActions::prepare(const ui::LineupState& observed) {
return request;
}
// Creates a request to swap two players of the lineup.
ui::LineupRequest LineupActions::swap(const ui::LineupState& observed,
const ui::LineupPlayer& first, const ui::LineupPlayer& second) {
auto request = prepare(observed);
@@ -438,6 +501,8 @@ ui::LineupRequest LineupActions::swap(const ui::LineupState& observed,
return request;
}
// Creates a pitch request of `kind` bound to the observed lineup. The observed live mode
// must be known, otherwise a FormatError is thrown.
ui::PitchRequest LineupActions::bind_pitch(const ui::PreparationState& observed, ui::PitchRequestKind kind) {
if (!observed.pitch || !observed.pitch->indoor.has_value())
throw FormatError("pitch: missing observed live mode");
@@ -450,6 +515,7 @@ ui::PitchRequest LineupActions::bind_pitch(const ui::PreparationState& observed,
return request;
}
// Creates a request to swap two players on the pitch (including their current positions).
ui::PitchRequest LineupActions::swap_pitch(const ui::PreparationState& observed,
const ui::LineupPlayer& first, const ui::LineupPlayer& second) {
auto request = bind_pitch(observed, ui::PitchRequestKind::swap_players);
@@ -459,6 +525,7 @@ ui::PitchRequest LineupActions::swap_pitch(const ui::PreparationState& observed,
return request;
}
// Creates a request to switch the pitch page (toggles the 0x000c bits of the display word).
ui::PitchRequest LineupActions::page(const ui::PreparationState& observed) {
auto request = bind_pitch(observed, ui::PitchRequestKind::select_pitch_page);
request.expected_mode = uint8_t(observed.pitch->mode);
@@ -470,6 +537,8 @@ ui::PitchRequest LineupActions::page(const ui::PreparationState& observed) {
return request;
}
// Creates a request to load or save a formation in `slot`; saving copies the position
// bytes of the 11 players on the pitch.
ui::PitchRequest LineupActions::formation(const ui::PreparationState& observed,
ui::PitchRequestKind kind, int slot) {
auto request = bind_pitch(observed, kind);
@@ -485,6 +554,7 @@ ui::PitchRequest LineupActions::formation(const ui::PreparationState& observed,
return request;
}
// Creates a request to move a player to the given depth and lane.
ui::PitchRequest LineupActions::move(const ui::PreparationState& observed, const ui::LineupPlayer& player,
int depth, int lane) {
auto request = bind_pitch(observed, ui::PitchRequestKind::move_player);
@@ -495,6 +565,8 @@ ui::PitchRequest LineupActions::move(const ui::PreparationState& observed, const
return request;
}
// Creates a request that advances one of the three automatic weights (index 0..2) by one
// step; each weight is a 2-bit value that wraps around after 3.
ui::PitchRequest LineupActions::weight(const ui::PreparationState& observed, int index) {
if (index < 0 || index > 2) throw FormatError("pitch: invalid automatic weight index");
auto request = bind_pitch(observed, ui::PitchRequestKind::set_automatic_weight);
+7 -1
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Application-boundary facades for the club and league windows: league table/pairings/
// strengths, transfer market and offers, bank, stadium, desk actions and lineup. Same pattern
// as desktop_actions.hpp: a class per owner that wraps a CareerSession, offers apply() as a
// rollback transaction and takes the shared revision counter plus an acknowledgement
// callback from the front end. Implemented in window_actions.cpp, called from controller.cpp.
#pragma once
#include "app/career_session.hpp"
@@ -38,7 +43,8 @@ public:
std::optional<MarketDispatch> market(const ui::TransferMarketRequest&, const HumanBuyerSaleHooks&,
uint64_t& revision, std::string& error,
HumanBuyerMarketEntryPolicy = HumanBuyerMarketEntryPolicy::normal_interactive,
const MarketAccept& = {});
const MarketAccept& = {},
const std::function<int(const GameState&, const TransferOfferListView&)>& review = {});
std::optional<CareerSession::TransferOfferEditorDispatch> open_offer(const ui::TransferMarketRequest&,
uint64_t& revision, std::string& error, const OfferAccept& = {});
std::optional<CareerSession::TransferMarketPreviewDispatch> preview(const ui::TransferMarketRequest&,
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of container.hpp: parse_container() checks the FORM/ALPTRAUM header and
// walks the adjacent little-endian chunks (no alignment byte) with bounds checks, filling
// a Container of offsets; decode_sample() and decode_original_cue() convert the bounded
// sample data to PCM. Pure functions on byte spans, no state; failures are reported through
// the std::string& error argument and a false result.
#include "container.hpp"
#include <algorithm>
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Reader for the original sound container (a FORM/ALPTRAUM chunk wrapper) and for the PCM
// samples inside it. A Container only lists chunk ids and payload offsets; the payload bytes
// stay in the caller's buffer, which must outlive any use of the offsets. decode_sample()
// turns unsigned 8-bit samples into signed 16-bit mono PCM; decode_original_cue() resolves
// only the PCM-backed effects (original ids 17..22). Pairs with container.cpp; the PCM types
// are shared by mixer, playback, semantic cues and the music fallback.
#pragma once
#include <cstddef>
+4
View File
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of Mixer (mixer.hpp). Incoming PCM is resampled to the output rate with
// range and overflow checks and a total/per-voice byte ceiling (2 MiB overall, an eighth of
// that per voice); mix_block() sums music and active voices into the output block, applies
// the volume and advances the cursors (the music loops).
#include "mixer.hpp"
#include <algorithm>
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Small PCM mixer used by the software (non-original) playback path: one looping music
// buffer plus up to 8 one-shot voices, all converted to the output rate when added.
// start_music_loop()/add_voice() may allocate; mix_block() only reads the prepared buffers
// and writes into caller-owned storage, so it is safe to call from the audio path. Owned
// by Playback (playback.hpp); the byte limits are in mixer.cpp.
#pragma once
#include "container.hpp"
+4
View File
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the synthetic matchday loop (music_fallback.hpp): a fixed 22050 Hz,
// 108 bpm, 8-bar sequence of bass, chord and lead notes defined by constant MIDI tables,
// rendered to mono PCM16. No game state or randomness is involved, so the output is the
// same on every run.
#include "music_fallback.hpp"
#include <algorithm>
+4
View File
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Synthetic fallback matchday music: a deterministic 8-bar loop generated in code. It is
// presentation filler, not decoded original music and not tied to any original sound id.
// The result is a PcmSample that Playback::start_music_loop() can play; implemented in
// music_fallback.cpp.
#pragma once
#include "container.hpp"
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of OriginalSynth (original.hpp). The hidden State holds the parsed
// songs, tracks, channels, sample banks and the Nuked-OPL3 chip core (src/audio/third_party);
// tick() runs one sequencer step of the original timer interrupt, render() produces output
// samples from the chip and the PCM channel. load() validates every input and fails
// cleanly on malformed data; the register and sample observers exist only for offline
// validation (original_validation.cpp, sound_driver.cpp).
#include "original.hpp"
#include "container.hpp"
#include "third_party/nuked-opl3/opl3.h"
+7
View File
@@ -1,4 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// Emulation of the original game's sound system (MIDI-style sequencer, OPL FM instruments
// and one Sound Blaster PCM channel) as OriginalSynth. The application reads the sound
// containers (S/2000..2003) and the frequency/operator tables from the user's executable
// and hands them in as OriginalAssets; this module knows nothing about game state, file
// layout, the simulation clock or random generators. command() takes the original sound ids
// (0 title, 1 desk, 2 intro, 3 crowd, 8 stop, 10..22 effects); render() fills PCM blocks
// without allocating. Implemented in original.cpp, driven by Playback and the audio tools.
#pragma once
#include <array>
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Validation executable for the original-sound emulation (original.hpp, playback.hpp). It
// needs the user's game data directory as its single argument, loads the executable tables
// and sound containers from it, and runs oracle checks on song/effect output, transitions,
// malformed input, option and mute handling, effect priorities and the audio callback
// lifecycle. With an empty argument it prints SKIP and exits with 77 (test skipped).
// Contains no game assets itself.
#include "formats/executable_layout.hpp"
#include "original.hpp"
#include "playback.hpp"
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of Playback (playback.hpp): opens the SDL audio device, feeds either the
// OriginalSynth from the SDL callback (original mode) or bounded blocks from the Mixer via
// pump() (software mode), and maps original ids and semantic cues to sound played on the
// device. Duplicate or out-of-order event ids are rejected before anything is played;
// shutdown() releases the device.
#include "playback.hpp"
#include <algorithm>
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Audio output device wrapper (SDL) and the single audio object the application uses.
// Playback owns the SDL device, a software Mixer (PCM effects, optional music loop) and the
// OriginalSynth (the full original driver, streamed from SDL's audio callback so modal
// windows cannot starve it). Cue requests carry a session id and an increasing event id
// chosen by the controller; submit() consumes each event once and returns a CueStatus.
// Mute and volume apply to both paths. Pairs with playback.cpp and app/audio.hpp.
#pragma once
#include "container.hpp"
+3
View File
@@ -1,4 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of synthesize_semantic_cue() (semantic_cues.hpp): builds each cue in code
// (the whistles from frequency sweeps with attack and release shaping) at 22050 Hz and
// clamps the result to 16-bit PCM. Pure and deterministic.
#include "semantic_cues.hpp"
#include <algorithm>
+4
View File
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Semantic sound cues (kickoff whistle, goal, full-time whistle) synthesized in code for
// use when no verified original effect is available. They are labels of intent, never
// original sound ids. The generator is deterministic mono PCM16 at 22050 Hz and has no
// dependency on game state, randomness or rendering; implemented in semantic_cues.cpp.
#pragma once
#include "container.hpp"
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Command line tool openbmh_sound for the audio module. It works either on one sound
// container file (play or export a sample, a test tone, or an original effect id as WAV) or,
// with --original DATA_DIR, on the user's game data through OriginalSynth (export a song or
// effect to WAV, or play ids through the real device). It also plays or exports the
// synthetic semantic cues and the fallback music loop. Own state only: parsed arguments.
// Bounds on seconds, loops and ids are checked before anything runs.
#include "formats/executable_layout.hpp"
#include "container.hpp"
#include "music_fallback.hpp"
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Self-contained checks for the audio module that need no game data: container parsing
// against authored fixtures, sample and cue decoding, the mixer, the playback request
// rules and the synthetic music fallback. The fixtures are built in code and are not
// copied from any game asset. Returns non-zero on the first failed CHECK; companion of
// original_validation.cpp, which covers the original-driver emulation.
#include "container.hpp"
#include "music_fallback.hpp"
#include "playback.hpp"
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the console line parser (parser.hpp): trimming, top-level splitting of
// the argument list (commas inside quotes or brackets do not split), parsing of one
// argument (positional or name=value), canonical name comparison that ignores case, '.' and
// '_', line classification, and the integer/bool converters for arguments. Pure functions;
// no console state. The console (console.cpp, windows_*.cpp) checks the argument types.
#include "cli/console/parser.hpp"
#include <cctype>
+16 -18
View File
@@ -1,11 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-only
// OpenBMH deviates from the original: uses monthly staff levels in increments of five thousand and the supported youth-academy controls.
// The club environment (menu 24, docs/CLI_CONCEPT/06-verein.md 10, H2 p. 93, supported rule profile p. 107,
// 111): co-trainer, doctor and physio in levels of 5 000 a month, and the supported rule profile youth
// academy that costs a season price of the league.
//
// The rules are the engine's (src/game/environment.hpp, a port of Image with the
// supported rule profile patch); a command is one click of the original screen.
// The console and desktop share all six monthly environment budgets.
#include "app/desktop_actions.hpp"
#include "cli/console/console.hpp"
@@ -19,20 +13,21 @@ using namespace detail;
void Console::register_environment_commands() {
auto show = [this] {
const EnvironmentState s = environment_state(session_->state(), active_slot());
std::vector<std::vector<std::string>> rows = {
{"AssistantCoach", std::to_string(s.level[kCoTrainer]), money(s.monthly[kCoTrainer])},
{"Doctor", std::to_string(s.level[kDoctor]), money(s.monthly[kDoctor])},
{"Physio", std::to_string(s.level[kPhysio]), money(s.monthly[kPhysio])},
{"YouthAcademy", s.monthly[kYouthAcademy] != 0 ? "on" : "off", money(s.youth_price) + " per season"}};
emit_table({"Item", "Level", "Costs"}, rows);
emit('i', std::string("youth academy: ") + (s.youth_paid ? "paid this season" : s.youth_open ? "can be started (July/August)"
: "too late for this season"));
std::vector<std::vector<std::string>> rows;
constexpr const char* names[] = {"YouthYoungest", "YouthAcademy", "YouthOldest", "AssistantCoach", "Doctor", "Physio"};
for (int i = 0; i < kEnvironmentItems; ++i)
rows.push_back({names[i], std::to_string(s.level[size_t(i)]), money(s.monthly[size_t(i)])});
emit_table({"Item", "Level", "MonthlyCosts"}, rows);
rows.clear();
for (size_t i = 0; i < 3; ++i)
rows.push_back({names[i], std::to_string(s.youth_position[i] + 1), std::to_string(s.youth_league[i] + 1)});
emit_table({"YouthTeam", "Position", "Division"}, rows);
};
openers_[24] = [this, show] {
open_window("Environment");
show();
};
add({"Environment", "ShowEnvironment", {}, "staff levels and the youth academy", false}, [show](const Values&) { show(); });
add({"Environment", "ShowEnvironment", {}, "all six monthly budgets and youth tables", false}, [show](const Values&) { show(); });
auto apply = [this, show](int item, int level) {
std::string error;
const auto r=app::EnvironmentActions(*session_).set_console(
@@ -44,11 +39,14 @@ void Console::register_environment_commands() {
add({"Environment", "SetStaffLevel", {choice("role", {"AssistantCoach", "Doctor", "Physio"}), integer("level", 0, 6)},
"click a staff tile: level 0..6, 5 000 a month each", true},
[apply](const Values& v) { apply(kCoTrainer + v.choice("role"), int(v.integer("level"))); });
add({"Environment", "SetYouthAcademy", {choice("state", {"On", "Off"})}, "start (July/August) or stop the youth academy", true},
add({"Environment", "SetYouthLevel", {choice("team", {"Youngest", "Academy", "Oldest"}), integer("level", 0, 6)},
"set one youth team's monthly budget, level 0..6", true},
[apply](const Values& v) { apply(v.choice("team"), int(v.integer("level"))); });
add({"Environment", "SetYouthAcademy", {choice("state", {"On", "Off"})}, "set the middle youth budget to level 6 or 0", true},
[this, apply](const Values& v) {
const bool on = environment_state(session_->state(), active_slot()).monthly[kYouthAcademy] != 0;
const bool want = v.choice("state") == 0;
// the original's click on an active academy switches it off: click only for a change
// Retain the old On/Off command as an alias for the middle youth budget.
if (on == want) emit('+', std::string("youth academy already ") + (on ? "on" : "off"));
else apply(kYouthAcademy, want ? 6 : 0);
});
+108 -1
View File
@@ -17,6 +17,7 @@
#include "cli/console/detail.hpp"
#include "game/desk_actions.hpp"
#include "game/human_buyer_sale.hpp"
#include "game/messages.hpp"
#include "game/poach.hpp"
#include "game/schedule.hpp"
#include "ui/club_info.hpp"
@@ -160,6 +161,8 @@ void Console::register_transfer_commands() {
require_engine(false, "transfer", error);
}
flush_notices();
if (outcome->action.status != TransferActionStatus::accepted)
fail("E_RULE", "Der Spieler konnte nicht auf die Transferliste gesetzt werden.");
emit('+', utf8(item.name) + (loan
? " steht auf der Transferliste; der Entleiher wählt 12 oder 24 Monate im Angebot"
: " is on the transfer list"));
@@ -175,6 +178,42 @@ void Console::register_transfer_commands() {
list_player(v.text("player"), true);
});
add({"Transfer", "ShowOffers", {player}, "incoming offers for an own listed player", false},
[this, market_item](const Values& v) {
const auto item = market_item(v.text("player"));
if (!item.own_listing) fail("E_RULE", "the listing belongs to another club");
const auto offers = project_transfer_offer_list(session_->state(), item.list_entry);
std::vector<std::vector<std::string>> rows;
for (const auto& offer : offers.offers) {
if (!offer.present) continue;
rows.push_back({std::to_string(offer.bid_index), utf8(session_->state().club_name(offer.buyer)),
money(offer.fee), money(offer.monthly_salary), std::to_string(offer.contract_months),
offer.loan ? "loan" : "sale",
offer.eligible && offer.loan_permitted && offer.transaction_supported ? "yes" : "no"});
}
emit_table({"Bid", "Club", "Fee", "Monthly salary", "Months", "Type", "Available"}, rows);
if (rows.empty()) emit('i', "Noch keine Angebote für diesen Spieler.");
});
add({"Transfer", "AcceptOffer", {player, integer("bid", 0, 3)}, "accept an existing bid before weekly expiry", true},
[this, market, market_item, hooks, flush_notices](const Values& v) {
const auto observed = market();
const auto item = market_item(v.text("player"));
if (!item.own_listing) fail("E_RULE", "the listing belongs to another club");
auto request = app::TransferActions::opening(observed, item, false);
request.kind = ui::TransferMarketRequestKind::review_offers;
request.selected_players.clear();
const int bid = int(v.integer("bid"));
std::string error;
const auto outcome = app::TransferActions(*session_).market(request, hooks(), revision_, error,
app::HumanBuyerMarketEntryPolicy::normal_interactive, {},
[bid](const GameState&, const TransferOfferListView&) { return bid; });
if (!outcome) require_engine(false, "transfer", error);
flush_notices();
if (outcome->action.status != TransferActionStatus::accepted)
fail("E_RULE", "Dieses Angebot kann nicht angenommen werden; die Transferliste bleibt unverändert.");
emit('+', "Das Angebot wurde angenommen.");
});
// --- Transfer.Negotiate: the offer editor (06-verein 5.2) -----------------------------
auto show_offer = [this] {
if (!offer_editor_) fail("E_INTERNAL", "no offer editor");
@@ -478,8 +517,76 @@ void Console::register_transfer_commands() {
show_offer();
});
// --- the search profile (buttons Suchen / Vorschlag of the market, game/search_profile.hpp) ---------------
// The 18 values of the profile in the order of the original dialog; the console shows and takes them as a list.
static const char* const kProfileLabels[18] = {
"Goalkeeper", "Defender", "Midfielder", "Forward", "AgeMin(16+)", "AgeMax(16+)", "StrengthMin", "StrengthMax",
"AttrCondition", "AttrTechnique", "AttrForm", "Side1", "Side2", "Side3", "Side4", "PriceLow", "PriceMid", "PriceHigh"};
auto show_profile = [this](const SearchProfile& p, const char* heading) {
std::vector<std::vector<std::string>> rows;
for (size_t i = 0; i < p.size(); ++i)
rows.push_back({kProfileLabels[i], std::to_string(i == 0 ? p[i] & ~kSearchProfileOff : p[i])});
emit_table({heading, "Value"}, rows);
std::string list;
for (size_t i = 0; i < p.size(); ++i) list += (i ? "," : "") + std::to_string(i == 0 ? p[i] & ~kSearchProfileOff : p[i]);
emit('i', std::string("profile ") + (p[0] & kSearchProfileOff ? "OFF" : "active") + "; as SetSearchProfile([" + list + "])");
};
auto manager_slot = [market] { return market().manager_slot; };
add({"Transfer", "ShowSearchProfile", {}, "SUCHEN: your search profile (18 values; positions, age, strength, attributes, sides, price classes)", false},
[this, manager_slot, show_profile](const Values&) { show_profile(session_->search_profile(manager_slot()), "Search profile"); });
add({"Transfer", "SuggestSearchProfile", {boolean("whole", true), boolean("apply", true)},
"VORSCHLAG: the profile your squad asks for (whole = count the substitutes); apply = store it and list the matches", false},
[this, manager_slot, show_profile, flush_notices](const Values& v) {
const int manager = manager_slot();
const auto suggestion = session_->suggest_search_profile(manager, v.boolean("whole", false));
show_profile(suggestion, "Suggestion");
if (v.boolean("apply", false)) {
std::string error;
const auto result = session_->dispatch_search_profile(manager, suggestion, false, true, revision_, error);
if (!result) require_engine(false, "search profile", error);
emit('i', utf8(message_text(session_->state(), ::bmh::layout::Month_SearchProfileNews_TextPointer4)));
emit('+', std::to_string(result->hits.size()) + " listed player(s) fit the profile");
for (const auto& hit : result->hits) emit('i', utf8(hit.message));
}
});
Param profile_values = detail::text("values");
profile_values.display = "values:[18 numbers] (see ShowSearchProfile)";
add({"Transfer", "SetSearchProfile", {profile_values, boolean("apply", true)},
"SUCHEN: store the search profile (the 18 values of ShowSearchProfile, switches 0/1, age 0..24 = 16..40, strength 0..99); apply = list the matches now", false},
[this, manager_slot, show_profile](const Values& v) {
std::string list = v.text("values");
if (list.size() >= 2 && list.front() == '[' && list.back() == ']') list = list.substr(1, list.size() - 2);
SearchProfile profile{};
size_t count = 0, start = 0;
while (start <= list.size()) {
const size_t comma = list.find(',', start);
std::string item = list.substr(start, comma == std::string::npos ? std::string::npos : comma - start);
item.erase(0, item.find_first_not_of(' '));
item.erase(item.find_last_not_of(' ') + 1);
if (item.empty() || item.find_first_not_of("0123456789") != std::string::npos || item.size() > 3)
fail("E_BAD_ARGUMENT", "the profile values are numbers separated by commas");
if (count >= profile.size()) fail("E_BAD_ARGUMENT", "the profile has 18 values");
profile[count++] = uint8_t(std::min(255, std::stoi(item)));
if (comma == std::string::npos) break;
start = comma + 1;
}
if (count != profile.size()) fail("E_BAD_ARGUMENT", "the profile has 18 values, not " + std::to_string(count));
if (!search_profile_valid(profile))
fail("E_BAD_ARGUMENT", "switches are 0 or 1, the age values 0..24 and the strength values 0..99");
std::string error;
const auto result = session_->dispatch_search_profile(manager_slot(), profile, false, v.boolean("apply", true), revision_, error);
if (!result) require_engine(false, "search profile", error);
emit('+', result->active ? "search profile stored"
: "search profile stored but switched off (all values 0 or all 1 count as no search)");
if (v.boolean("apply", true)) {
emit('i', utf8(message_text(session_->state(), ::bmh::layout::Month_SearchProfileNews_TextPointer4)));
emit('+', std::to_string(result->hits.size()) + " listed player(s) fit the profile");
for (const auto& hit : result->hits) emit('i', utf8(hit.message));
}
});
// the rest of the market (06-verein 5): later steps of stage 3 or engine gaps
for (const char* name : {"SetSquadView", "SetSquadSheet", "SetMarketVisible", "ShowPlayer", "OpenOffers", "OpenSearch",
for (const char* name : {"SetSquadView", "SetSquadSheet", "SetMarketVisible", "ShowPlayer", "OpenOffers",
"ShowTransferNews", "ShowTeamInfo"})
add({"Transfer", name, {}, "not in the console yet", false},
[name](const Values&) { fail("E_ENGINE_GAP", std::string(name) + " is not in the console yet"); });
+4
View File
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of parse_json()/dump_json() (json.hpp): a small recursive-descent Parser
// over a string_view that reports the byte position in JsonError messages, UTF-8 handling
// for string escapes, and a serializer for the Json variant. No state beyond the parser's
// position in the input.
#include "cli/json.hpp"
#include <charconv>
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Minimal JSON value type for the CLI protocol (no external library). A Json holds null,
// bool, a 64-bit integer, string, array or object (std::map) in one std::variant; the
// accessors return null pointers when the type does not match, so callers must check.
// Numbers are integers only. parse_json() throws JsonError on bad input; dump_json() writes
// compact text. Used by protocol.*, seat_hub.cpp and main.cpp; implemented in json.cpp.
#pragma once
#include <cstdint>
+7
View File
@@ -1,4 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// Entry point of openbmh_cli, the headless front end without a window. Besides parsing the
// command line (Arguments) it offers several modes on top of the same engine: the JSON
// protocol on stdin/stdout (protocol.hpp) with --log/--replay, the console language
// (docs/CLI_CONCEPT) as plain session, replay, mailbox server (--serve), multi-seat server
// (--seats, SeatHub), TCP listener on 127.0.0.1 (--listen), and --send to hand one block to
// a running mailbox session. --data may be a game directory, the game's EXE or an archive
// (src/launch resolves it). All game logic stays in the engine; this file only moves lines.
#include "cli/protocol.hpp"
#include "cli/console/console.hpp"
#include "cli/seat_hub.hpp"
+7
View File
@@ -1,4 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the JSON protocol (protocol.hpp). Protocol::handle() validates the
// request keys per command (check_keys / check_command_keys), then calls the CareerSession
// and the same projection functions the SDL front end uses (desk, table, mail, tactics,
// training, camp, bank, stadium, kickoff, save/load, ...), and wraps the result with the
// current revision. Errors are returned as {"ok": false, "error": ...}, never thrown to the
// caller. The "replay" flag lets a logged session be played again (saves may overwrite).
// text_request()/text_response() implement the one-line text form of the protocol.
#include "formats/executable_layout.hpp"
#include "cli/protocol.hpp"
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// The JSON line protocol of openbmh_cli (the non-console mode): one request object with a
// "cmd" field in, one response object ("ok", "revision", result or error) out. Protocol owns
// one app::CareerSession (created by "new" or "load") and the revision counter that every
// state-changing command must echo back, so stale requests are refused like in the UI
// flow. text_request()/text_response() translate a simple one-line text form to and from the
// same JSON. Implemented in protocol.cpp; Protocol::help() lists the commands.
#pragma once
#include "cli/json.hpp"
+6
View File
@@ -1,4 +1,10 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of SeatHub (seat_hub.hpp): routes the blocks of several clients into one
// console::Console. It runs a block as the seat's manager ("@k"), classifies each output
// line with Console::LineInfo, queues lines that concern other seats as their "meanwhile"
// feed, holds WaitTurn blocks until they can be answered, and holds the Run/Step of a live
// match until every seat has sent one. State per seat is a small Seat record; the game
// itself lives in the console.
#include "cli/seat_hub.hpp"
#include <algorithm>
+42
View File
@@ -0,0 +1,42 @@
// SPDX-License-Identifier: GPL-3.0-only
// Decides which club badge tokens the original draws as a fallback instead of an individual
// crest. The cut-off for foreign clubs differs between game editions, so it is read from one
// instruction in the loaded executable (layout::ForeignBadgeGateInstruction) and stored in the
// process-wide original_foreign_badge_end by install_original_badge_policy(). An executable
// that does not match the verified pattern falls back to 138. Header-only; the club
// selectors themselves stay in the database and savegame data.
#pragma once
#include "formats/executable_layout.hpp"
#include "formats/le.hpp"
namespace bmh {
// Installed alongside the loaded edition's other runtime tables. Club selectors
// remain database/savegame data; this only reproduces the original drawing gate.
inline int original_foreign_badge_end = 138;
inline int original_badge_gate(const LeImage& exe) {
constexpr auto instruction = layout::ForeignBadgeGateInstruction;
if (exe.contains(instruction) && exe.contains(instruction + 6) &&
exe.u8(instruction) == 0x66 && exe.u8(instruction + 1) == 0x81 &&
exe.u8(instruction + 2) == 0xfb && exe.u8(instruction + 5) == 0x7c &&
exe.u8(instruction + 6) == 7) {
const int end = exe.u16(instruction + 3);
if (end == 90 || end == 138) return end;
}
// Never invent individual foreign crests for an unverified drawing routine.
return 138;
}
inline void install_original_badge_policy(const LeImage& exe) {
original_foreign_badge_end = original_badge_gate(exe);
}
inline bool original_badge_fallback(int token, const LeImage* exe = nullptr) {
const int team = token & 0xfff;
const int end = exe ? original_badge_gate(*exe) : original_foreign_badge_end;
return team == 0xfff || (team >= 90 && team < end) || (team >= 168 && team < 357);
}
} // namespace bmh
+4
View File
@@ -1,4 +1,8 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the basic file helpers declared in binary.hpp: read_file() loads a whole
// file into a Bytes vector (FormatError if it cannot be opened) and iso646de_to_utf8()
// converts the game's ISO 646-DE strings ([ \ ] { | } ~ stand for the umlauts and the sharp s)
// to UTF-8. No state.
#include "formats/binary.hpp"
#include <fstream>
File diff suppressed because it is too large. Load diff
+169
View File
@@ -0,0 +1,169 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of diamond_image.hpp: the images built from the embedded numbers of the generated .inc files plus the
// texts of openbmh.dat.
#include "formats/diamond_image.hpp"
#include <algorithm>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <string>
#include <string_view>
#include <system_error>
#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#elif defined(__APPLE__)
#include <mach-o/dyld.h>
#else
#include <unistd.h>
#endif
namespace bmh {
namespace {
struct Chunk { uint32_t address; uint32_t size; const uint8_t* bytes; };
struct Range { uint32_t address; uint32_t length; };
namespace german {
#include "formats/diamond_constants.inc"
} // namespace german
namespace english {
#include "formats/fltd_constants.inc"
} // namespace english
constexpr char kMagic[12] = "OPENBMH-DAT"; // 11 characters and the NUL
constexpr char kFileName[] = "openbmh.dat";
std::string lower(std::string s) {
for (char& c : s) c = char(std::tolower(static_cast<unsigned char>(c)));
return s;
}
uint32_t word(const Bytes& b, size_t at) {
if (at + 4 > b.size()) throw FormatError("openbmh.dat: truncated");
return uint32_t(b[at]) | uint32_t(b[at + 1]) << 8 | uint32_t(b[at + 2]) << 16 | uint32_t(b[at + 3]) << 24;
}
LeImage build(uint32_t base, uint32_t size, const Chunk* first, const Chunk* last) {
Bytes bytes(size, 0);
for (const Chunk* chunk = first; chunk != last; ++chunk)
std::copy(chunk->bytes, chunk->bytes + chunk->size, bytes.begin() + (chunk->address - base));
return LeImage::from_bytes(base, std::move(bytes));
}
std::filesystem::path executable_directory() {
std::error_code ec;
#ifdef _WIN32
wchar_t buffer[32768];
const DWORD n = GetModuleFileNameW(nullptr, buffer, DWORD(std::size(buffer)));
if (n == 0 || n >= std::size(buffer)) return {};
return std::filesystem::path(buffer).parent_path();
#elif defined(__APPLE__)
char buffer[4096];
uint32_t size = sizeof buffer;
if (_NSGetExecutablePath(buffer, &size) != 0) return {};
return std::filesystem::weakly_canonical(buffer, ec).parent_path();
#else
char buffer[4096];
const ssize_t n = readlink("/proc/self/exe", buffer, sizeof buffer - 1);
if (n <= 0) return {};
buffer[n] = 0;
return std::filesystem::path(buffer).parent_path();
#endif
}
std::filesystem::path file_in(const std::filesystem::path& directory) {
if (directory.empty()) return {};
std::error_code ec;
for (const auto& entry : std::filesystem::directory_iterator(directory, ec))
if (entry.is_regular_file(ec) && lower(entry.path().filename().string()) == kFileName) return entry.path();
return {};
}
void add_texts(LeImage& image, int edition, const std::filesystem::path& game_directory) {
const auto file = find_texts_file(game_directory);
if (file.empty()) return;
try {
apply_texts(image, edition, read_file(file));
} catch (const std::exception&) {
// a damaged texts file leaves the texts empty; the game itself still runs
}
}
} // namespace
std::filesystem::path find_texts_file(const std::filesystem::path& game_directory) {
if (const char* env = std::getenv("OPENBMH_DAT"); env && *env) {
if (std::string_view(env) == "-") return {}; // "no texts file at all" (tests of the launcher)
std::error_code ec;
if (std::filesystem::is_regular_file(env, ec)) return env;
}
for (const auto& directory : {game_directory, executable_directory(), std::filesystem::path(".")})
if (auto file = file_in(directory); !file.empty()) return file;
return {};
}
std::string texts_signature(const std::filesystem::path& game_directory) {
const auto file = find_texts_file(game_directory);
if (file.empty()) return {};
try {
const Bytes data = read_file(file);
uint64_t hash = 1469598103934665603ull; // FNV-1a
for (uint8_t b : data) hash = (hash ^ b) * 1099511628211ull;
return std::to_string(data.size()) + "-" + std::to_string(hash);
} catch (const std::exception&) {
return {};
}
}
bool apply_texts(LeImage& image, int edition, const Bytes& file) {
if (file.size() < sizeof kMagic + 4 || !std::equal(kMagic, kMagic + sizeof kMagic, file.begin()))
throw FormatError("openbmh.dat: not an OpenBMH data file");
const Range* known = edition == 1 ? std::begin(german::kTextRanges) : std::begin(english::kTextRanges);
const Range* known_end = edition == 1 ? std::end(german::kTextRanges) : std::end(english::kTextRanges);
const uint32_t sets = word(file, sizeof kMagic);
if (sets > 16) throw FormatError("openbmh.dat: too many sets");
size_t at = sizeof kMagic + 4;
bool found = false;
for (uint32_t s = 0; s < sets; ++s) {
const uint32_t id = word(file, at), count = word(file, at + 4);
if (count > 65536) throw FormatError("openbmh.dat: too many ranges");
const size_t table = at + 8;
size_t data = table + size_t(count) * 8;
for (uint32_t n = 0; n < count; ++n) {
const uint32_t address = word(file, table + n * 8ull), length = word(file, table + n * 8ull + 4);
if (data + length > file.size()) throw FormatError("openbmh.dat: truncated");
if (int(id) == edition) {
const bool allowed = std::any_of(known, known_end,
[&](const Range& r) { return r.address == address && length <= r.length; });
if (!allowed) throw FormatError("openbmh.dat: a range is not a text of the game");
image.patch(address, file.data() + data, length);
found = true;
}
data += length;
}
at = data;
}
return found;
}
LeImage diamond_constants_image(const std::filesystem::path& game_directory) {
LeImage image = build(german::kImageBase, german::kImageSize, std::begin(german::kChunks), std::end(german::kChunks));
add_texts(image, 1, game_directory);
return image;
}
LeImage english_constants_image(const std::filesystem::path& game_directory) {
LeImage image = build(english::kImageBase, english::kImageSize, std::begin(english::kChunks), std::end(english::kChunks));
add_texts(image, 2, game_directory);
return image;
}
bool is_executable_name(const std::filesystem::path& file_name) { return lower(file_name.string()) == "bmh.exe"; }
} // namespace bmh
+48
View File
@@ -0,0 +1,48 @@
// SPDX-License-Identifier: GPL-3.0-only
// The game without BMH.exe and FLTD.EXE: OpenBMH carries the numbers of the Diamond 3.7 executable (tables, rates,
// positions, prices; the generated formats/diamond_constants.inc) and of the English Football Limited
// (formats/fltd_constants.inc) and needs only the asset files of the game. The game texts that live in the executables
// (live commentary, messages) are not part of the source: they are in the data file openbmh.dat, which ships with the
// release next to the programs (tools/diamond_constants/generate.py makes it). Without that file those texts are empty.
//
// load_le() returns diamond_constants_image() for a BMH.exe that does not exist, so every reader of the executable image
// works unchanged. A BMH.exe that is there is used as before (it carries its own edition's numbers and texts). For an
// English installation the launcher (launch/fltd.cpp) writes english_constants_image() as the image of the game
// directory when FLTD.EXE is missing.
#pragma once
#include <filesystem>
#include <string>
#include "formats/binary.hpp"
#include "formats/le.hpp"
namespace bmh {
// openbmh.dat: "OPENBMH-DAT" NUL, u32 set count, then per set u32 edition (1 German, 2 English), u32 range count, count
// times (u32 address, u32 length), then the bytes of all ranges. A range must be one of the edition's text ranges, so
// the file can never change a number of the image.
//
// The file is looked for in: the environment variable OPENBMH_DAT ("-" = none at all), the folder of the game data, the folder of the
// running program, the current folder. Returns an empty path when there is none.
std::filesystem::path find_texts_file(const std::filesystem::path& game_directory);
// A short text that changes when the texts file changes (empty without a file): used to rebuild cached English games.
std::string texts_signature(const std::filesystem::path& game_directory);
// The German (Diamond 3.7) image built from the embedded numbers plus the texts of openbmh.dat (found for
// `game_directory`).
LeImage diamond_constants_image(const std::filesystem::path& game_directory = {});
// The English Football Limited image in the German address space (what launch::translate_fltd() makes from
// FLTD.EXE), built from the embedded numbers plus the texts of openbmh.dat.
LeImage english_constants_image(const std::filesystem::path& game_directory = {});
// Puts the texts of an openbmh.dat file (edition 1 or 2) into `image`. Throws FormatError for malformed data or for a
// range that is not a text range of that edition. Returns false when the file has no set of that edition.
bool apply_texts(LeImage& image, int edition, const Bytes& file);
// Whether `file_name` is the name of the executable (BMH.exe in any case).
bool is_executable_name(const std::filesystem::path& file_name);
} // namespace bmh
+49 -2
View File
@@ -764,7 +764,7 @@ inline constexpr auto EnglishLayoutTranslation156 = 0x6e08c;
inline constexpr auto EnglishLayoutTranslation157 = 0x6e094;
inline constexpr auto EnglishLayoutTranslation158 = 0x6e0b8;
inline constexpr auto EnglishLayoutTranslation159 = 0x6e0bb;
inline constexpr auto EnglishLayoutTranslation16 = 0x6be4f;
inline constexpr auto EnglishLayoutTranslation16 = 0x6be50;
inline constexpr auto EnglishLayoutTranslation160 = 0x6e0d8;
inline constexpr auto EnglishLayoutTranslation161 = 0x6e110;
inline constexpr auto EnglishLayoutTranslation162 = 0x6e11c;
@@ -874,6 +874,13 @@ inline constexpr auto EnglishLayoutTranslation255 = 0x6f0ec;
inline constexpr auto EnglishLayoutTranslation256 = 0x6f2ae;
inline constexpr auto EnglishLayoutTranslation257 = 0x6f2d4;
inline constexpr auto EnglishLayoutTranslation258 = 0x6f2e0;
// English six-budget environment data used by the common monthly model.
inline constexpr auto EnglishEnvironmentTileX = 0x6d230;
inline constexpr auto EnglishEnvironmentTileY = 0x6d238;
inline constexpr auto EnglishEnvironmentYouthColors = 0x6d240;
inline constexpr auto EnglishEnvironmentBudgetSteps = 0x6d244;
inline constexpr auto EnglishEnvironmentYouthPositionSuffix = 0x6d24a;
inline constexpr auto EnglishEnvironmentCostSuffix = 0x6d24f;
inline constexpr auto EnglishLayoutTranslation259 = 0x6f2fc;
inline constexpr auto EnglishLayoutTranslation26 = 0x6bf2c;
inline constexpr auto EnglishLayoutTranslation260 = 0x6f300;
@@ -986,7 +993,7 @@ inline constexpr auto EnglishLayoutTranslation7 = 0x6be0c;
inline constexpr auto EnglishLayoutTranslation70 = 0x6d270;
inline constexpr auto EnglishLayoutTranslation71 = 0x6d272;
inline constexpr auto EnglishLayoutTranslation72 = 0x6d274;
inline constexpr auto EnglishLayoutTranslation73 = 0x6d29c;
inline constexpr auto EnglishLayoutTranslation73 = 0x6d29d;
inline constexpr auto EnglishLayoutTranslation74 = 0x6d3b4;
inline constexpr auto EnglishLayoutTranslation75 = 0x6d404;
inline constexpr auto EnglishLayoutTranslation76 = 0x6d408;
@@ -1026,6 +1033,11 @@ inline constexpr auto EnglishLeagueCupSemiFinalResults = 0x7d002;
inline constexpr auto Environment_FormatError_RuntimeField = 0xa50f0;
inline constexpr auto Environment_FormatError_RuntimeField2 = 0xa50f6;
inline constexpr auto Environment_Render_TextPointer = 0xaeb74;
inline constexpr auto EnvironmentYouthTeams = 0xbd4bc;
inline constexpr auto EnvironmentYouthPositionSuffix = 0xa1698;
inline constexpr auto EnvironmentCostSuffix = 0xa169d;
inline constexpr auto EnvironmentYouthLeagueTextPointer = 0xaeb78;
inline constexpr auto EnvironmentYouthColors = 0xa50fc;
inline constexpr auto Environment_SetEnvironment_ExecutableField = 0xaf394;
inline constexpr auto EuropeNameTable = 0xae710;
inline constexpr auto EventPasses = 0xa2ba1;
@@ -1403,6 +1415,10 @@ inline constexpr auto Month_ReturnLoans_TextPointer7 = 0xaee44;
inline constexpr auto Month_ReturnLoans_TextPointer8 = 0xaee48;
inline constexpr auto Month_SearchProfileNews_TextPointer = 0xaedd8;
inline constexpr auto Month_SearchProfileNews_TextPointer2 = 0xaf254;
inline constexpr auto Month_SearchProfileNews_TextPointer3 = 0xaf258; // ending of the message box after "Suchen"
inline constexpr auto Month_SearchProfileNews_TextPointer4 = 0xaf25c; // "Ihre Scouting-Abteilung ...": shown first when the dialog is confirmed
inline constexpr auto TransferMarket_WithdrawQuestion_TextPointer = 0xaf2a4; // "Wollen Sie " (+ player name)
inline constexpr auto TransferMarket_WithdrawQuestion_TextPointer2 = 0xaf2a8; // " vom Transfermarkt holen?"
inline constexpr auto NationalFriendlyPayerPrefixText = 0xa000f;
inline constexpr auto NextDeskManager = 0xbd6cc;
inline constexpr auto NoClubText = 0xaec74;
@@ -1471,6 +1487,17 @@ inline constexpr auto Pitch_Render_TextPointer2 = 0xae0ec;
inline constexpr auto Pitch_Render_TextPointer3 = 0xae0f0;
inline constexpr auto Pitch_Render_TextPointer4 = 0xae0f4;
inline constexpr auto Pitch_Render_TextPointer5 = 0xae0f8;
inline constexpr auto PitchPreferenceDepthBases = 0xa3cc3;
inline constexpr auto PitchPreferenceRed = 0xa3cc7;
inline constexpr auto PitchPreferenceGreen = 0xa3cd1;
inline constexpr auto OriginalPointerPixels = 0xa45b4;
inline constexpr auto EnglishPitchPreferenceDepthBases = 0x6e230;
inline constexpr auto EnglishPitchPreferenceRed = 0x6e234;
inline constexpr auto EnglishPitchPreferenceGreen = 0x6e240;
inline constexpr auto EnglishOriginalPointerPixels = 0x70554;
inline constexpr auto PitchOrderPositionPointers = 0xa2a37;
inline constexpr auto PitchOrderZoneMasks = 0xa2a4b;
inline constexpr auto PitchOrderZoneTextPointers = 0xae818;
inline constexpr auto Placements = 0xbd38c;
inline constexpr auto PlainBackground = 0xa2569;
inline constexpr auto PlanTicketPrice = 0xa4856;
@@ -1543,6 +1570,7 @@ inline constexpr auto SaveLoad_Render_ExecutableField = 0xa148f;
inline constexpr auto SaveLoad_Render_RuntimeField = 0xa2334;
inline constexpr auto SaveLoad_Render_RuntimeField2 = 0xa233f;
inline constexpr auto SaveLoad_Render_RuntimeField3 = 0xa234a;
inline constexpr auto SaveLoad_OverwriteQuestionPointer = 0xa21c4;
inline constexpr auto SaveLoad_Render_TextPointer = 0xa1512;
inline constexpr auto SaveLoad_Render_TextPointer2 = 0xae5f0;
inline constexpr auto SaveLoad_Render_TextPointer3 = 0xae620;
@@ -1891,6 +1919,10 @@ inline constexpr auto TransferMarket_Rect_TextPointer2 = 0xa0045;
inline constexpr auto TransferMarket_Rect_TextPointer3 = 0xae148;
inline constexpr auto TransferMarket_Rect_TextPointer4 = 0xae14c;
inline constexpr auto TransferMarket_Rect_TextPointer5 = 0xae150;
// Search dialog (buttons Suchen / Vorschlag): seven 5-byte rows (y, step in px, cells, slider flag, profile offset)
// and the text pointer of its confirm button.
inline constexpr auto TransferMarket_SearchRows_RuntimeField = 0xa20fb;
inline constexpr auto TransferMarket_SearchButton_TextPointer = 0xae144;
inline constexpr auto TransferMarket_Rect_TextPointer6 = 0xaecac;
inline constexpr auto TransferMarket_Rect_TextPointer7 = 0xaf250;
inline constexpr auto TransferMarket_Render_TextPointer = 0xaf264;
@@ -1964,4 +1996,19 @@ inline constexpr auto EnglishFourTeamFixtureTable = 0x6eea0;
inline constexpr auto EnglishSixTeamFixtureTable = 0x6eed4;
inline constexpr auto EnglishTwelveTeamFixtureTable = 0x6f0bc;
inline constexpr auto EnglishTwentyTeamFixtureTable = 0x6ee40;
inline constexpr auto EnglishDesktopBinSourceX = 0x6e180;
inline constexpr auto EnglishDesktopBinSourceY = 0x6e182;
inline constexpr auto EnglishDesktopSocketSourceX = 0x6e184;
} // namespace bmh::layout
namespace bmh::layout {
inline constexpr auto EnvironmentBudgetSteps = 0xa50ff;
inline constexpr auto EnvironmentVerifiedCodeBegin = 0x6c000;
inline constexpr auto EnvironmentVerifiedCodeEnd = 0x6cb40;
inline constexpr auto EnvironmentVerifiedHookBegin = 0x7af65;
inline constexpr auto EnvironmentVerifiedHookEnd = 0x7b020;
}
namespace bmh::layout { inline constexpr auto ForeignBadgeGateInstruction = 0x10070; }
namespace bmh::layout { inline constexpr auto CalendarDateSetup = 0x21270; }
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the .FBM savegame container (fbm.hpp): fbm_encrypt()/fbm_decrypt() are the
// stream cipher whose key changes by 0x29 per byte, and load_savegame() finds the "KRON_FBM"
// magic, splits the plain header from the encrypted stream, decrypts it and verifies the
// one-byte checksum, which is reported in Savegame::checksum_ok (not thrown). The decrypted
// stream is interpreted by savestate.cpp. Pure functions, no state.
#include "formats/fbm.hpp"
#include <algorithm>
File diff suppressed because it is too large. Load diff
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the .FNT bitmap font loader and renderer (font.hpp): load_font() reads
// the header, the 1-bit glyph bitmap and the per-character location (and spacing) tables and
// checks that the file size matches exactly; Font::glyph(), text_width() and draw() look up
// glyphs (out-of-range characters use the last glyph) and draw them into an indexed Image.
// No state beyond the Font object.
#include "formats/font.hpp"
namespace bmh {
+71 -4
View File
@@ -1,8 +1,16 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the executable image loader (le.hpp): load_le() reads the original
// DOS/4GW LE executable, places its objects at their link addresses and applies the internal
// fixups (FormatError for other files or external fixups). It also accepts the OpenBMH image
// format written by save_image(), so a translated image can replace the executable.
// LeImage::cstring() reads NUL-terminated strings from the image. No global state.
#include "formats/le.hpp"
#include "formats/rule_base.hpp"
#include "formats/diamond_image.hpp"
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <fstream>
#include <vector>
@@ -18,10 +26,63 @@ struct Object {
std::string LeImage::cstring(uint32_t address) const {
std::string s;
while (contains(address) && u8(address) != 0) s.push_back(char(u8(address++)));
const uint32_t first = address;
while (contains(address) && bytes_[address - base_] != 0) s.push_back(char(bytes_[address++ - base_]));
if (le_trace::hook) le_trace::hook(first, uint32_t(s.size()) + 1, 't');
return s;
}
namespace le_trace {
void (*hook)(uint32_t, uint32_t, char) = nullptr;
namespace {
// One flag byte per image address: 1 number read, 2 string read, 4 start of a bulk read.
std::vector<uint8_t>& marks() {
static std::vector<uint8_t> value(0x100000, 0);
return value;
}
std::string& trace_path() {
static std::string value;
return value;
}
void record(uint32_t address, uint32_t length, char kind) {
auto& m = marks();
const uint8_t flag = kind == 'n' ? 1 : kind == 't' ? 2 : 4;
if (address < 0x10000 || address - 0x10000 >= m.size()) return;
if (length == 0) length = 1;
for (uint32_t i = 0; i < length && address - 0x10000 + i < m.size(); ++i) m[address - 0x10000 + i] |= flag;
}
// Appends the marked ranges ("<flag> <start> <length>" in hex, one per line) to the trace file.
void flush() {
if (trace_path().empty()) return;
std::ofstream out(trace_path(), std::ios::app);
const auto& m = marks();
for (uint8_t flag : {uint8_t(1), uint8_t(2), uint8_t(4)}) {
size_t i = 0;
while (i < m.size()) {
if (!(m[i] & flag)) { ++i; continue; }
size_t j = i;
while (j < m.size() && (m[j] & flag)) ++j;
out << std::hex << unsigned(flag) << ' ' << (i + 0x10000) << ' ' << (j - i) << '\n';
i = j;
}
}
}
} // namespace
void enable_from_environment() {
static bool done = false;
if (done) return;
done = true;
if (const char* path = std::getenv("OPENBMH_LE_TRACE"); path && *path) {
trace_path() = path;
(void)marks(); // constructed before atexit(flush) is registered, so it is destroyed after flush has run
hook = record;
std::atexit(flush);
}
}
} // namespace le_trace
namespace {
constexpr char kImageMagic[14] = "OPENBMH-IMAGE"; // 13 characters and the NUL
}
@@ -37,13 +98,20 @@ void save_image(const LeImage& image, const std::filesystem::path& path) {
}
LeImage load_le(const std::filesystem::path& path) {
le_trace::enable_from_environment();
// The game runs from its asset files alone: for a BMH.exe that is not there the embedded numbers of the Diamond 3.7 executable
// and the texts of openbmh.dat stand in for it.
{
std::error_code ec;
if (is_executable_name(path.filename()) && !std::filesystem::exists(path, ec))
return diamond_constants_image(path.has_parent_path() ? path.parent_path() : std::filesystem::path("."));
}
const Bytes raw = read_file(path);
if (raw.size() >= sizeof kImageMagic + 8 && std::equal(kImageMagic, kImageMagic + sizeof kImageMagic, raw.begin())) {
const auto word = [&](size_t at) { return uint32_t(raw[at] | raw[at + 1] << 8 | raw[at + 2] << 16) | uint32_t(raw[at + 3]) << 24; };
const uint32_t base = word(sizeof kImageMagic), size = word(sizeof kImageMagic + 4);
if (raw.size() != sizeof kImageMagic + 8 + size_t(size)) throw FormatError("OpenBMH image: wrong size");
LeImage img = LeImage::from_bytes(base, Bytes(raw.begin() + sizeof kImageMagic + 8, raw.end()));
apply_rule_base(img);
return img;
}
auto u8 = [&](size_t o) -> uint32_t {
@@ -133,7 +201,6 @@ LeImage load_le(const std::filesystem::path& path) {
}
}
}
apply_rule_base(img);
return img;
}
+18 -6
View File
@@ -16,20 +16,34 @@
namespace bmh {
// Read recording for building the embedded constants (formats/diamond_constants.inc): when the environment variable
// OPENBMH_LE_TRACE names a file, every image read is noted (numbers, strings, bulk pointers) and appended to that
// file when the program ends. Without the variable the hook is a null pointer and costs one branch per read.
namespace le_trace {
extern void (*hook)(uint32_t address, uint32_t length, char kind); // kind: 'n' number, 't' string, 'b' bulk pointer
void enable_from_environment();
} // namespace le_trace
class LeImage {
public:
uint32_t base() const { return base_; }
uint32_t size() const { return uint32_t(bytes_.size()); }
bool contains(uint32_t address) const { return address >= base_ && address - base_ < bytes_.size(); }
uint8_t u8(uint32_t address) const { return bytes_.at(address - base_); }
uint8_t u8(uint32_t address) const {
if (le_trace::hook) le_trace::hook(address, 1, 'n');
return bytes_.at(address - base_);
}
uint16_t u16(uint32_t address) const { return uint16_t(u8(address) | u8(address + 1) << 8); }
uint32_t u32(uint32_t address) const { return uint32_t(u16(address)) | uint32_t(u16(address + 2)) << 16; }
// A NUL terminated string at `address` (ISO 646-DE bytes, see textd.hpp).
std::string cstring(uint32_t address) const;
// The string a pointer variable at `address` points to (e.g. Weekly_AdvertisingOffers_TextPointer).
std::string string_at_pointer(uint32_t address) const { return cstring(u32(address)); }
const uint8_t* data(uint32_t address) const { return bytes_.data() + (address - base_); }
// Overwrites bytes inside the image (the rule base, formats/rule_base.hpp).
const uint8_t* data(uint32_t address) const {
if (le_trace::hook) le_trace::hook(address, 0, 'b');
return bytes_.data() + (address - base_);
}
// Overwrites bytes inside a prepared image for verified address translation.
void patch(uint32_t address, const uint8_t* bytes, size_t count) {
for (size_t i = 0; i < count; ++i) bytes_.at(address - base_ + i) = bytes[i];
}
@@ -51,10 +65,8 @@ private:
Bytes bytes_;
};
// OpenBMH deviates from the original: applies a shared supported rule profile when loading editions with different rule-table values.
// Loads the original executable image without changing edition-specific rule tables.
// Throws FormatError for files that are not LE executables or use external fixups.
// A German BMH.EXE is loaded with the OpenBMH rule base applied (formats/rule_base.hpp):
// every edition plays by the supported rule profile rule values.
LeImage load_le(const std::filesystem::path& path);
// The OpenBMH image format: "OPENBMH-IMAGE" NUL, u32 base, u32 size, the bytes. load_le()
+18
View File
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: GPL-3.0-only
// Reads from the loaded executable how many league levels a player can see; the original
// separates internal domestic league slots from these visible levels. Throws
// std::invalid_argument when the stored constants fail the sanity check. Header-only,
// stateless; the address comes from executable_layout.hpp and the image from le.hpp.
#pragma once
#include "formats/executable_layout.hpp"
#include "formats/le.hpp"
#include <stdexcept>
namespace bmh {
// Original data separates internal domestic slots from player-visible levels.
inline int player_league_count(const LeImage& image) {
const auto address=layout::LeaguePairings_LeaguePairingsConstants_RuntimeField;
if(!image.contains(address+1)||image.u8(address)!=5||image.u8(address+1)<1||image.u8(address+1)>5)
throw std::invalid_argument("invalid player-facing league count");
return image.u8(address+1);
}
}
+5
View File
@@ -1,4 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
// Implementation of the M3D.MAN master database loader (m3d.hpp). load_database() reads the
// file sequentially with a bounds-checked Reader: first the lengths of the four string pools
// (clubs, players, referees, stadiums), then the pools, the name offset tables and the raw
// record blocks, whose sizes depend on the DbCounts passed in. Several blocks are kept as raw
// bytes in the Database (raw_* fields). Throws FormatError on a truncated file.
#include "formats/m3d.hpp"
#include <cstring>
Loaded 100 of 462 files, more files were not shown because too many files have changed in this diff. Show more