Introduce explicit Classic and expanded 1.1 data profile dimensions (by Codex)
This commit is contained in:
1 parent
b2a6300aad
commit
ff05d4f28a
12 files changed
+132
-8
No files matched your search
+1
-1
@@ -101,7 +101,7 @@ void startup_players(GameState& g, GameRandom& game, WatcomRandom& rand) {
|
||||
namespace bmh {
|
||||
|
||||
GameState startup_state(const LeImage& exe, const Database& db, const Bytes& m3_men, const Bytes& m3_dat) {
|
||||
const DbCounts counts;
|
||||
const DbCounts counts=db.counts;
|
||||
const std::vector<SaveBlock> layout = save_layout(counts, true);
|
||||
Bytes stream;
|
||||
for (const SaveBlock& b : layout) {
|
||||
|
||||
+1
-1
@@ -59,7 +59,7 @@ Bytes save_stream(const GameState& live) {
|
||||
const GameState& g = coach ? swapped : live;
|
||||
const bool records = g.memory.has(::bmh::layout::ClubSeasonRecords) && g.memory.u32(::bmh::layout::ClubSeasonRecords) != 0;
|
||||
Bytes stream;
|
||||
for (const SaveBlock& b : save_layout(DbCounts{}, records)) {
|
||||
for (const SaveBlock& b : save_layout(g.counts, records)) {
|
||||
Bytes d(b.size, 0);
|
||||
if (b.heap) {
|
||||
switch (b.address) {
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ int div8(int x) { return x / 8; }
|
||||
} // namespace
|
||||
|
||||
GameState GameState::from_save(const SaveState& save, const DbCounts& c) {
|
||||
GameState g;
|
||||
GameState g; g.counts=c;
|
||||
const SaveBlock& squads = save.block(::bmh::layout::SquadSlots);
|
||||
for (size_t i = 0; i + 1 < squads.size; i += 2)
|
||||
g.squad_slots.push_back(uint16_t(save.data(::bmh::layout::SquadSlots)[i] | save.data(::bmh::layout::SquadSlots)[i + 1] << 8));
|
||||
|
||||
@@ -36,6 +36,7 @@ constexpr uint16_t kEmptySlot = 0x0FFF;
|
||||
constexpr uint16_t kSlotInLineup = 0x8000;
|
||||
|
||||
struct GameState {
|
||||
DbCounts counts{};
|
||||
std::vector<uint16_t> squad_slots; // *SquadSlots, all squads back to back (see squad_range)
|
||||
std::vector<Player> players; // *PlayerConditionTechniqueForm / *PlayerSkillWords / *PlayerIdentityWords, names not filled
|
||||
std::vector<uint8_t> team_morale; // *TeamMorale, per team: bits 0-5 morale / 2, bits 6-7 flags
|
||||
|
||||
Reference in new issue
Block a user