Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa6ec96305 | ||
|
|
e337c3c6b2 | ||
|
|
6cccbb01d3 | ||
|
|
8780d7b5a5 | ||
|
|
a279bfb6df | ||
|
|
0535764834 |
No files matched your search
@@ -62,4 +62,4 @@ jobs:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
RELEASE_TAG: ${{ github.ref_name }}
|
||||
run: |
|
||||
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.6/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.8/RELEASE_NOTES.md
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-only
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
project(OpenBMH VERSION 1.0.6 LANGUAGES CXX C)
|
||||
project(OpenBMH VERSION 1.0.8 LANGUAGES CXX C)
|
||||
if(APPLE)
|
||||
# Enable native languages before dependencies/subdirectories inherit rules.
|
||||
enable_language(OBJC OBJCXX)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# OpenBMH
|
||||
|
||||
**Classic-Version: 1.0.6.** Die originalgetreue Linie bleibt in diesem Repository.
|
||||
**Classic-Version: 1.0.8.** 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.
|
||||
|
||||
@@ -30,7 +30,7 @@ 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.6/RELEASE_NOTES.md).
|
||||
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.8/RELEASE_NOTES.md).
|
||||
|
||||
## Features and direction
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ describe deliberate changes; they are not a list of every known compatibility li
|
||||
- [src/game/weekly.hpp](../src/game/weekly.hpp): uses the supported weekly processing and transfer rule profile.
|
||||
- [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.
|
||||
|
||||
@@ -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.
|
||||
@@ -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.
|
||||
@@ -3869,6 +3869,12 @@ int main(int argc, char** argv) {
|
||||
const auto released = held ? flow.hold(e.button.x, e.button.y, 2000)
|
||||
: flow.click(e.button.x, e.button.y, e.button.button == SDL_BUTTON_RIGHT, e.button.clicks >= 2);
|
||||
present_formation_save_feedback();
|
||||
// JA of the manager confirmation is shown pushed in briefly before the
|
||||
// (possibly slow) next step starts, as in the original.
|
||||
if (flow.screen_name() == "manager_accepted") {
|
||||
present_season(flow.render(), "OpenBMH - manager_accepted");
|
||||
SDL_Delay(150);
|
||||
}
|
||||
handle(released);
|
||||
present_desk_record_points();
|
||||
press.reset();
|
||||
|
||||
+101
-9
@@ -2,6 +2,7 @@
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/bank_credit.hpp"
|
||||
|
||||
#include <array>
|
||||
#include <bit>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
@@ -29,6 +30,102 @@ uint32_t read_record(const GameState& g, size_t at) {
|
||||
for (int i = 0; i < 4; ++i) v |= uint32_t(g.manager_records.at(at + i)) << (i * 8);
|
||||
return v;
|
||||
}
|
||||
// The original evaluates ((base / 100) * den) / 100 on the x87 stack: every step is rounded to a
|
||||
// 64-bit mantissa (round to nearest even), only the final store rounds to a 53-bit double. The
|
||||
// host's long double is not that format (64 bits on MSVC and on Apple silicon), which changed the
|
||||
// result by 1 for loans of about a million and more. This evaluates the same chain exactly with
|
||||
// integers, so the result is the same on every platform. Returns the value truncated toward zero.
|
||||
struct Wide { // 128-bit unsigned, little-endian 32-bit limbs
|
||||
std::array<uint32_t, 4> l{};
|
||||
unsigned bit_length() const {
|
||||
for (int i = 3; i >= 0; --i)
|
||||
if (l[size_t(i)]) return unsigned(i) * 32 + unsigned(32 - std::countl_zero(l[size_t(i)]));
|
||||
return 0;
|
||||
}
|
||||
bool bit(unsigned n) const { return n < 128 && (l[n / 32] >> (n % 32)) & 1u; }
|
||||
bool any_below(unsigned n) const { // any bit below position n set
|
||||
for (unsigned i = 0; i < n && i < 128; ++i) if (bit(i)) return true;
|
||||
return false;
|
||||
}
|
||||
static Wide from(uint64_t v) { Wide w; w.l[0] = uint32_t(v); w.l[1] = uint32_t(v >> 32); return w; }
|
||||
uint64_t window(unsigned lo) const { // the 64 bits starting at bit `lo`
|
||||
uint64_t v = 0;
|
||||
for (unsigned i = 0; i < 64; ++i) if (bit(lo + i)) v |= uint64_t(1) << i;
|
||||
return v;
|
||||
}
|
||||
};
|
||||
struct Extended { uint64_t m = 0; int e = 0; }; // value = m * 2^e, m has 64 bits (or is zero)
|
||||
// Round `w` (plus a "something was dropped" flag) to 64 bits, nearest even; value = w * 2^exp.
|
||||
Extended round_to_64(const Wide& w, bool sticky, int exp) {
|
||||
const unsigned len = w.bit_length();
|
||||
Extended r;
|
||||
if (len == 0) return r;
|
||||
if (len <= 64) {
|
||||
const unsigned up = 64 - len;
|
||||
r.m = w.window(0) << up;
|
||||
r.e = exp - int(up);
|
||||
return r;
|
||||
}
|
||||
const unsigned s = len - 64;
|
||||
r.m = w.window(s);
|
||||
const bool guard = w.bit(s - 1), rest = sticky || w.any_below(s - 1);
|
||||
r.e = exp + int(s);
|
||||
if (guard && (rest || (r.m & 1))) {
|
||||
if (++r.m == 0) { r.m = uint64_t(1) << 63; ++r.e; }
|
||||
}
|
||||
return r;
|
||||
}
|
||||
Extended x87_divide_small(const Extended& a, uint32_t d) {
|
||||
Wide n; // a.m * 2^64, divided limb by limb
|
||||
n.l[2] = uint32_t(a.m); n.l[3] = uint32_t(a.m >> 32);
|
||||
uint64_t rem = 0;
|
||||
Wide q;
|
||||
for (int i = 3; i >= 0; --i) {
|
||||
const uint64_t cur = (rem << 32) | n.l[size_t(i)];
|
||||
q.l[size_t(i)] = uint32_t(cur / d);
|
||||
rem = cur % d;
|
||||
}
|
||||
return round_to_64(q, rem != 0, a.e - 64);
|
||||
}
|
||||
Extended x87_multiply_small(const Extended& a, uint32_t b) {
|
||||
Wide p;
|
||||
uint64_t carry = 0;
|
||||
const uint32_t limb[2] = {uint32_t(a.m), uint32_t(a.m >> 32)};
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
const uint64_t cur = uint64_t(limb[i]) * b + carry;
|
||||
p.l[size_t(i)] = uint32_t(cur);
|
||||
carry = cur >> 32;
|
||||
}
|
||||
p.l[2] = uint32_t(carry);
|
||||
return round_to_64(p, false, a.e);
|
||||
}
|
||||
// ((base / 100) * den) / 100 stored as a double and truncated toward zero. `zero` reports an exact
|
||||
// zero before truncation (the original's "exact zero becomes 1" rule looks at the stored double).
|
||||
int64_t x87_amount_chain(int32_t base, uint32_t den, bool& zero) {
|
||||
zero = base == 0 || den == 0;
|
||||
if (zero) return 0;
|
||||
const bool negative = base < 0;
|
||||
const uint64_t magnitude = negative ? uint64_t(-int64_t(base)) : uint64_t(base);
|
||||
Extended v = round_to_64(Wide::from(magnitude), false, 0);
|
||||
v = x87_divide_small(v, 100);
|
||||
v = x87_multiply_small(v, den);
|
||||
v = x87_divide_small(v, 100);
|
||||
// store as double: 53-bit mantissa, nearest even
|
||||
uint64_t m53 = v.m >> 11;
|
||||
int e = v.e + 11;
|
||||
const bool guard = (v.m >> 10) & 1, rest = (v.m & 0x3ff) != 0;
|
||||
if (guard && (rest || (m53 & 1))) ++m53; // a carry to 2^53 is still exact
|
||||
uint64_t whole;
|
||||
if (e >= 0) {
|
||||
if (e > 10) throw std::invalid_argument("invalid native credit amount");
|
||||
whole = m53 << e;
|
||||
} else {
|
||||
whole = -e >= 64 ? 0 : m53 >> unsigned(-e);
|
||||
}
|
||||
if (whole > uint64_t(std::numeric_limits<int32_t>::max()) + (negative ? 1u : 0u))
|
||||
throw std::invalid_argument("invalid native credit amount");
|
||||
return negative ? -int64_t(whole) : int64_t(whole);
|
||||
}
|
||||
// Amount: signed IMUL/IDIV, x87 intermediate, QWORD store,
|
||||
// exact-zero floor, then Amount2's explicit rounding toward zero.
|
||||
int32_t amount(const BankCreditContext& c, uint32_t months, int32_t principal) {
|
||||
@@ -37,15 +134,10 @@ int32_t amount(const BankCreditContext& c, uint32_t months, int32_t principal) {
|
||||
const int32_t factor = c.rate_table[months];
|
||||
const int32_t base = divide(mul(principal, factor), 100);
|
||||
const int32_t den = divide(10000, factor - 100);
|
||||
const long double intermediate = (static_cast<long double>(base) / c.divisor)
|
||||
* den / c.divisor;
|
||||
double raw = static_cast<double>(intermediate);
|
||||
if (raw == 0 && principal != 0) raw = 1;
|
||||
raw = std::trunc(raw);
|
||||
if (!std::isfinite(raw) || raw < std::numeric_limits<int32_t>::min()
|
||||
|| raw > std::numeric_limits<int32_t>::max())
|
||||
throw std::invalid_argument("invalid native credit amount");
|
||||
return static_cast<int32_t>(raw);
|
||||
bool zero = false;
|
||||
int64_t result = x87_amount_chain(base, uint32_t(den), zero);
|
||||
if (zero && principal != 0) result = 1;
|
||||
return static_cast<int32_t>(result);
|
||||
}
|
||||
void balance(const BankCreditContext& c, BankCreditDraft& d) {
|
||||
int32_t result = add(c.cash, signed_word(d.values[0]));
|
||||
|
||||
@@ -368,6 +368,9 @@ bool LeaguePairingsScreen::release(int x,int y) {
|
||||
return true;
|
||||
}
|
||||
if(button==5)return true; // Source ellipsis has no action.
|
||||
// OpenBMH deviates from the original: the computer tip is ignored silently once a visible result is known, instead of raising an engine error.
|
||||
if(button==4&&std::any_of(state_.source.rows.begin(),state_.source.rows.end(),
|
||||
[](const auto& row){return row.raw_result!=0xcc;}))return true;
|
||||
post({button==0?LeaguePairingsAction::reset:button==1?LeaguePairingsAction::search:
|
||||
button==2?LeaguePairingsAction::filter_by_club:button==3?LeaguePairingsAction::postponed_list:
|
||||
button==4?LeaguePairingsAction::computer_tip:LeaguePairingsAction::unsupported,button});return true;
|
||||
|
||||
+3
-1
@@ -392,7 +392,9 @@ Image ManagerScreen::render() const {
|
||||
badge(out, 54, 89, choice_.master_club); portrait(out, 221, 89, choice_.portrait);
|
||||
const auto& prompt = texts_[(::bmh::layout::Manager_SmallText_TextPointer - ::bmh::layout::TextPointerTable) / 4];
|
||||
small_text(out, 73 + 170 / 2 - small_.text_width(prompt) / 2, 140, prompt);
|
||||
button(out, 62, 166, 75, texts_[(::bmh::layout::GameEnd_Copy_TextPointer - ::bmh::layout::TextPointerTable) / 4], false);
|
||||
// The original shows JA pushed in for a moment after it is clicked.
|
||||
button(out, 62, 166, 75, texts_[(::bmh::layout::GameEnd_Copy_TextPointer - ::bmh::layout::TextPointerTable) / 4],
|
||||
view_ == ManagerView::accepted);
|
||||
button(out, 175, 166, 75, texts_[(::bmh::layout::GameEnd_Copy_TextPointer2 - ::bmh::layout::TextPointerTable) / 4], false);
|
||||
}
|
||||
return out;
|
||||
|
||||
@@ -110,7 +110,7 @@ void validate_other_games_preparation(const OtherGamesIdentity& id, const DeskSt
|
||||
id.manager_slot != before.manager_slot || id.runtime_team != before.runtime_club ||
|
||||
id.day_counter != before.day_counter || id.manager_slot < 0 ||
|
||||
size_t(id.manager_slot) >= before.managers.size() ||
|
||||
id.club_identity != int(before.session_identity_key(size_t(id.manager_slot))))
|
||||
id.club_identity != int(before.managers[size_t(id.manager_slot)].club_identity_key))
|
||||
throw FormatError("other games: mismatched desk acknowledgement");
|
||||
auto expected = before;
|
||||
expected.revision = id.revision;
|
||||
@@ -175,7 +175,7 @@ void StartupFlow::show_top_scorers(TopScorersState page,PreparationState prepara
|
||||
page.identity.runtime_team!=desktop_->state().runtime_club||
|
||||
page.identity.day_counter!=desktop_->state().day_counter||
|
||||
page.identity.revision!=desktop_->state().revision+1||page.identity.sequence!=0||!page.identity.scope||
|
||||
page.identity.club_identity!=int(desktop_->state().session_identity_key(size_t(owner.manager_slot))))
|
||||
page.identity.club_identity!=int(desktop_->state().managers[size_t(owner.manager_slot)].club_identity_key))
|
||||
throw FormatError("top scorers: mismatched opening acknowledgement");
|
||||
if(preparation.desktop.revision!=page.identity.revision||preparation.desktop.manager_slot!=owner.manager_slot||
|
||||
preparation.desktop.runtime_club!=desktop_->state().runtime_club||
|
||||
|
||||
Reference in new issue
Block a user