diff --git a/machines/machineconfig.cpp b/machines/machineconfig.cpp index 86d311c..9f1ed16 100644 --- a/machines/machineconfig.cpp +++ b/machines/machineconfig.cpp @@ -6,42 +6,6 @@ #include #include -void init_ppc_cpu_map() { - - PPC_CPUs.emplace("PPC_MPC601", 0x00010001); - PPC_CPUs.emplace("PPC_MPC603", 0x00030001); - PPC_CPUs.emplace("PPC_MPC604", 0x00040001); - PPC_CPUs.emplace("PPC_MPC603E", 0x00060101); - PPC_CPUs.emplace("PPC_MPC750", 0x00080200); -} - -void init_gpu_map() { - GFX_CARDs.emplace("ATI_Rage_Pro", 0x10024750); - GFX_CARDs.emplace("ATI_Rage_128_Pro", 0x10025052); -} - -void init_machine_properties() { - PowerMac6100_Properties.emplace("machineid", StringProperty("PowerMac6100")); - PowerMac6100_Properties.emplace("cputype", StringProperty("PPC_MPC601")); - PowerMac6100_Properties.emplace("motherboard", StringProperty("Nubus")); - PowerMac6100_Properties.emplace("ioboard", StringProperty("Nubus_IO")); - PowerMac6100_Properties.emplace("rambank1", StringProperty("8")); - PowerMac6100_Properties.emplace("gfxcard", StringProperty("Nubus_Video")); - PowerMac6100_Properties.emplace("gfxmem", StringProperty("1")); - PowerMac6100_Properties.emplace("minram", StringProperty("8")); - PowerMac6100_Properties.emplace("maxram", StringProperty("136")); - - PowerMacG3_Properties.emplace("machineid", StringProperty("PowerMacG3")); - PowerMacG3_Properties.emplace("cputype", StringProperty("PPC_MPC750")); - PowerMacG3_Properties.emplace("motherboard", StringProperty("Grackle")); - PowerMacG3_Properties.emplace("ioboard", StringProperty("Heathrow")); - PowerMacG3_Properties.emplace("rambank1", StringProperty("64")); - PowerMacG3_Properties.emplace("gfxcard", StringProperty("ATI_Rage_Pro")); - PowerMacG3_Properties.emplace("gfxmem", StringProperty("2")); - PowerMacG3_Properties.emplace("minram", StringProperty("32")); - PowerMacG3_Properties.emplace("maxram", StringProperty("256")); -} - uint32_t get_gfx_card(std::string gfx_str) { if (gfx_str.compare("Nubus_Video")) { return 0; @@ -153,9 +117,6 @@ int establish_machine_presets( ifstream rom_file; uint32_t file_size; - init_ppc_cpu_map(); - init_gpu_map(); - init_machine_properties(); //init_search_array(); //search_properties(machine_str); diff --git a/machines/machinepresets.h b/machines/machinepresets.h index 97c0f54..baa8c35 100644 --- a/machines/machinepresets.h +++ b/machines/machinepresets.h @@ -1,11 +1,39 @@ #include "machineproperties.h" +#include -std::map PowerMac6100_Properties; +static std::map PowerMac6100_Properties = { + {"machineid", StringProperty("PowerMacG3")}, + {"cputype", StringProperty("PPC_MPC750")}, + {"motherboard", StringProperty("Grackle")}, + {"ioboard", StringProperty("Heathrow")}, + {"rambank1", StringProperty("64")}, + {"minram", StringProperty("32")}, + {"maxram", StringProperty("256")}, + {"gfxcard", StringProperty("Nubus_Video")}, + {"gfxmem", StringProperty("2")} +}; -std::map PowerMacG3_Properties; +static std::map PowerMacG3_Properties = { + {"machineid", StringProperty("PowerMacG3")}, + {"cputype", StringProperty("PPC_MPC750")}, + {"motherboard", StringProperty("Grackle")}, + {"ioboard", StringProperty("Heathrow")}, + {"rambank1", StringProperty("64")}, + {"minram", StringProperty("32")}, + {"maxram", StringProperty("256")}, + {"gfxcard", StringProperty("ATI_Rage_Pro")}, + {"gfxmem", StringProperty("2")} +}; -map PPC_CPUs; +static std::map PPC_CPUs = { + {"PPC_MPC601", 0x00010001}, + {"PPC_MPC603", 0x00030001}, + {"PPC_MPC604", 0x00040001}, + {"PPC_MPC603E", 0x00060101}, + {"PPC_MPC750", 0x00080200} +}; -map GFX_CARDs; - -void init_machine_properties(); // JANKY FUNCTION TO FIX VS 2019 BUG! \ No newline at end of file +static std::map GFX_CARDs = { + {"ATI_Rage_Pro", 0x10024750}, + {"ATI_Rage_128_Pro", 0x10025052} +}; \ No newline at end of file diff --git a/machines/machineproperties.h b/machines/machineproperties.h index b2f0d18..787b4e9 100644 --- a/machines/machineproperties.h +++ b/machines/machineproperties.h @@ -35,9 +35,6 @@ private: string StringInput = std::to_string(ILLEGAL_DEVICE_VALUE); }; -void init_ppc_cpu_map(); //JANKY FUNCTION TO FIX VS 2019 BUG! -void init_gpu_map(); //JANKY FUNCTION TO FIX VS 2019 BUG! - uint32_t get_gfx_card(std::string gfx_str); uint32_t get_cpu_type(std::string cpu_str); void search_properties(uint32_t chosen_gestalt);