diff --git a/machines/machinefactory.cpp b/machines/machinefactory.cpp index 9a2ad0e..e26ae9b 100644 --- a/machines/machinefactory.cpp +++ b/machines/machinefactory.cpp @@ -76,8 +76,15 @@ static const PropMap GossamerSettings = { new IntProperty( 2, vector({2, 4, 6}))}, }; -static const map>> machines = { - {"pmg3", {GossamerSettings, create_gossamer}}, +static const map PropHelp = { + {"rambank1_size", "specifies RAM bank 1 size in MB"}, + {"rambank2_size", "specifies RAM bank 2 size in MB"}, + {"rambank3_size", "specifies RAM bank 3 size in MB"}, + {"gfxmem_size", "specifies video memory size in MB"}, +}; + +static const map, string>> machines = { + {"pmg3", {GossamerSettings, create_gossamer, "PowerMacintosh G3 (Beige)"}}, }; string machine_name_from_rom(string& rom_filepath) { @@ -169,6 +176,30 @@ void set_machine_settings(map &settings) { } } +void list_machines() { + cout << endl << "Supported machines:" << endl << endl; + + for (auto& mach : machines) { + cout << mach.first << "\t\t" << get<2>(mach.second) << endl; + } + + cout << endl; +} + +void list_properties() { + cout << endl; + + for (auto& mach : machines) { + cout << get<2>(mach.second) << " properties:" << endl << endl; + + for (auto& p : get<0>(mach.second)) { + cout << p.first << "\t\t" << PropHelp.at(p.first) << endl << endl; + } + } + + cout << endl; +} + /* Read ROM file content and transfer it to the dedicated ROM region */ void load_rom(std::ifstream& rom_file, uint32_t file_size) { unsigned char* sysrom_mem = new unsigned char[file_size]; diff --git a/machines/machinefactory.h b/machines/machinefactory.h index 8c0d2a5..7cff1bf 100644 --- a/machines/machinefactory.h +++ b/machines/machinefactory.h @@ -38,6 +38,8 @@ std::string machine_name_from_rom(std::string& rom_filepath); int get_machine_settings(string& id, map &settings); void set_machine_settings(map &settings); int create_machine_for_id(string& id, string& rom_filepath); +void list_machines(void); +void list_properties(void); /* Machine-specific factory functions. */ int create_gossamer(void); diff --git a/main.cpp b/main.cpp index c0eb436..f40c1a8 100644 --- a/main.cpp +++ b/main.cpp @@ -101,7 +101,14 @@ int main(int argc, char** argv) { CLI11_PARSE(app, argc, argv); if (*list_cmd) { - std::cout << "Got: " << sub_arg << std::endl; + if (sub_arg == "machines") { + list_machines(); + } else if (sub_arg == "properties") { + list_properties(); + } else { + cout << "Unknown list subcommand " << sub_arg << endl; + } + return 0; } if (debugger_enabled) {