1 #ifndef CARTRIDGESLOTMANAGER_HH
2 #define CARTRIDGESLOTMANAGER_HH
41 [[nodiscard]]
bool isExternalSlot(
int ps,
int ss,
bool convert)
const;
44 [[nodiscard]]
int getSlot(
int ps,
int ss)
const;
52 std::string_view commandName);
53 void execute(std::span<const TclObject> tokens,
TclObject& result,
54 EmuTime::param time)
override;
55 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
56 void tabCompletion(std::vector<std::string>& tokens)
const override;
57 [[nodiscard]]
bool needRecord(std::span<const TclObject> tokens)
const override;
59 const HardwareConfig* getExtensionConfig(std::string_view cartname);
64 struct CartridgeSlotInfo final :
InfoTopic {
65 explicit CartridgeSlotInfo(
InfoCommand& machineInfoCommand);
66 void execute(std::span<const TclObject> tokens,
68 [[nodiscard]] std::string help(std::span<const TclObject> tokens)
const override;
73 [[nodiscard]]
bool exists()
const;
74 [[nodiscard]]
bool used(
const HardwareConfig* allowed =
nullptr)
const;
76 std::optional<CartCmd> cartCommand;
77 std::optional<ExtCmd> extCommand;
79 unsigned useCount = 0;
83 static constexpr
unsigned MAX_SLOTS = 16 + 4;
84 Slot slots[MAX_SLOTS];
CartridgeSlotManager(MSXMotherBoard &motherBoard)
void getAnyFreeSlot(int &ps, int &ss) const
static int getSlotNum(std::string_view slot)
void createExternalSlot(int ps)
void testRemoveExternalSlot(int ps, const HardwareConfig &allowed) const
void getSpecificSlot(unsigned slot, int &ps, int &ss) const
bool isExternalSlot(int ps, int ss, bool convert) const
void removeExternalSlot(int ps)
void freeSlot(int ps, int ss, const HardwareConfig &hwConfig)
int allocateAnyPrimarySlot(const HardwareConfig &hwConfig)
int allocateSpecificPrimarySlot(unsigned slot, const HardwareConfig &hwConfig)
void allocateSlot(int ps, int ss, const HardwareConfig &hwConfig)
void freePrimarySlot(int ps, const HardwareConfig &hwConfig)
Commands that directly influence the MSX state should send and events so that they can be recorded by...
bool exists(zstring_view filename)
Does this file (directory) exists?
This file implemented 3 utility functions: