diff --git a/cpu/ppc/poweropcodes.cpp b/cpu/ppc/poweropcodes.cpp
index 07c5024..731b563 100644
--- a/cpu/ppc/poweropcodes.cpp
+++ b/cpu/ppc/poweropcodes.cpp
@@ -24,11 +24,9 @@ along with this program. If not, see .
#include "ppcemu.h"
#include "ppcmmu.h"
-#include
#include
#include
#include
-#include
#include
#include
diff --git a/devices/atirage.cpp b/devices/atirage.cpp
index e85f0e6..26ab260 100644
--- a/devices/atirage.cpp
+++ b/devices/atirage.cpp
@@ -28,9 +28,8 @@ along with this program. If not, see .
#include
-ATIRage::ATIRage(uint16_t dev_id) : PCIDevice("ati-rage")
-{
- this->vram_size = 0x200000; /* FIXME: hardcoded VRAM size! */
+ATIRage::ATIRage(uint16_t dev_id, uint32_t mem_amount) : PCIDevice("ati-rage") {
+ this->vram_size = mem_amount << 20;
/*allocate video RAM */
this->vram_ptr = new uint8_t[this->vram_size];
diff --git a/devices/atirage.h b/devices/atirage.h
index 60b6d70..9cbf72e 100644
--- a/devices/atirage.h
+++ b/devices/atirage.h
@@ -111,7 +111,7 @@ constexpr auto MEMMAP_OFFSET = 0x007FFC00UL; /* offset to memory mapped register
class ATIRage : public PCIDevice {
public:
- ATIRage(uint16_t dev_id);
+ ATIRage(uint16_t dev_id, uint32_t mem_amount);
~ATIRage();
/* MMIODevice methods */
diff --git a/machines/machineconfig.cpp b/machines/machineconfig.cpp
index 46b5757..2664474 100644
--- a/machines/machineconfig.cpp
+++ b/machines/machineconfig.cpp
@@ -16,7 +16,7 @@ void init_gpu_map() {
}
void init_machine_properties() {
- PowerMac6100_Properties.emplace("machineid", StringProperty("Nubus Power Mac"));
+ 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"));
@@ -25,7 +25,7 @@ void init_machine_properties() {
PowerMac6100_Properties.emplace("gfxmem", StringProperty("1"));
- PowerMacG3_Properties.emplace("machineid", StringProperty("Power Mac G3 Beige"));
+ 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"));
diff --git a/machines/machinefactory.cpp b/machines/machinefactory.cpp
index 54c0759..32128c0 100644
--- a/machines/machinefactory.cpp
+++ b/machines/machinefactory.cpp
@@ -61,10 +61,10 @@ static const map rom_identity = {
};
-int create_machine_for_id(uint32_t id) {
+int create_machine_for_id(uint32_t id, uint32_t* grab_ram_size, uint32_t gfx_size) {
switch (id) {
case 0x476F7373:
- create_gossamer();
+ create_gossamer(grab_ram_size, gfx_size);
break;
default:
LOG_F(ERROR, "Unknown machine ID: %X", id);
@@ -89,7 +89,7 @@ void load_rom(ifstream& rom_file, uint32_t file_size) {
}
-int create_machine_for_rom(const char* rom_filepath) {
+int create_machine_for_rom(const char* rom_filepath, uint32_t* grab_ram_size, uint32_t gfx_size) {
ifstream rom_file;
uint32_t file_size, config_info_offset, rom_id;
char rom_id_str[17];
@@ -136,7 +136,7 @@ int create_machine_for_rom(const char* rom_filepath) {
LOG_F(INFO, "The machine is identified as... %s\n", rom_identity.at(rom_id).c_str());
- create_machine_for_id(rom_id);
+ create_machine_for_id(rom_id, grab_ram_size, gfx_size);
load_rom(rom_file, file_size);
diff --git a/machines/machinefactory.h b/machines/machinefactory.h
index eb349c1..9d17334 100644
--- a/machines/machinefactory.h
+++ b/machines/machinefactory.h
@@ -29,8 +29,8 @@ along with this program. If not, see .
#include "machinebase.h"
-int create_machine_for_rom(const char* rom_filepath);
+int create_machine_for_rom(const char* rom_filepath, uint32_t* grab_ram_size, uint32_t gfx_size);
-int create_gossamer(void);
+int create_gossamer(uint32_t* grab_ram_size, uint32_t gfx_size);
#endif /* MACHINE_FACTORY_H */
diff --git a/machines/machinegossamer.cpp b/machines/machinegossamer.cpp
index ddf022e..c12346b 100644
--- a/machines/machinegossamer.cpp
+++ b/machines/machinegossamer.cpp
@@ -33,6 +33,7 @@ along with this program. If not, see .
#include "devices/spdram.h"
#include "devices/viacuda.h"
#include "machinebase.h"
+#include "machineproperties.h"
#include
static void setup_ram_slot(std::string name, int i2c_addr, int capacity_megs) {
@@ -49,7 +50,7 @@ static void setup_ram_slot(std::string name, int i2c_addr, int capacity_megs) {
}
-int create_gossamer() {
+int create_gossamer(uint32_t* grab_ram_size, uint32_t gfx_size) {
if (gMachineObj) {
LOG_F(ERROR, "Global machine object not empty!");
return -1;
@@ -86,12 +87,12 @@ int create_gossamer() {
}
/* configure RAM slots */
- setup_ram_slot("RAM_DIMM_1", 0x57, 64); /* RAM slot 1 -> 64MB by default */
- setup_ram_slot("RAM_DIMM_2", 0x56, 0); /* RAM slot 2 -> empty by default */
- setup_ram_slot("RAM_DIMM_3", 0x55, 0); /* RAM slot 3 -> empty by default */
+ setup_ram_slot("RAM_DIMM_1", 0x57, grab_ram_size[0]); /* RAM slot 1 -> 64MB by default */
+ setup_ram_slot("RAM_DIMM_2", 0x56, grab_ram_size[1]); /* RAM slot 2 -> empty by default */
+ setup_ram_slot("RAM_DIMM_3", 0x55, grab_ram_size[2]); /* RAM slot 3 -> empty by default */
/* register ATI 3D Rage Pro video card with the PCI host bridge */
- gMachineObj->add_component("ATIRage", new ATIRage(ATI_RAGE_PRO_DEV_ID));
+ gMachineObj->add_component("ATIRage", new ATIRage(ATI_RAGE_PRO_DEV_ID, gfx_size));
grackle_obj->pci_register_device(
18, dynamic_cast(gMachineObj->get_comp_by_name("ATIRage")));
diff --git a/machines/machinepresets.h b/machines/machinepresets.h
index 698a3fc..97c0f54 100644
--- a/machines/machinepresets.h
+++ b/machines/machinepresets.h
@@ -4,6 +4,8 @@ std::map PowerMac6100_Properties;
std::map PowerMacG3_Properties;
-void init_machine_properties(); // JANKY FUNCTION TO FIX VS 2019 BUG!
+map PPC_CPUs;
-#define ILLEGAL_DEVICE_VALUE 0x168A523B
\ No newline at end of file
+map GFX_CARDs;
+
+void init_machine_properties(); // JANKY FUNCTION TO FIX VS 2019 BUG!
\ No newline at end of file
diff --git a/machines/machineproperties.h b/machines/machineproperties.h
index af5dbac..6ecc58e 100644
--- a/machines/machineproperties.h
+++ b/machines/machineproperties.h
@@ -1,16 +1,16 @@
-
-#ifndef MACHINE_PROPERTIES_H
-#define MACHINE_PROPERTIES_H
-
#include "endianswap.h"
#include
-#include
+#include
#include