2022-01-17 12:58:51 +00:00
|
|
|
/*
|
|
|
|
DingusPPC - The Experimental PowerPC Macintosh emulator
|
|
|
|
Copyright (C) 2018-22 divingkatae and maximum
|
|
|
|
(theweirdo) spatium
|
|
|
|
|
|
|
|
(Contact divingkatae#1017 or powermax#2286 on Discord for more info)
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** @file Constructs a Catalyst (Power Macintosh 7200) machine. */
|
|
|
|
|
|
|
|
#include <cpu/ppc/ppcemu.h>
|
2023-11-03 07:21:33 +00:00
|
|
|
#include <devices/common/hwcomponent.h>
|
|
|
|
#include <devices/common/pci/pcidevice.h>
|
|
|
|
#include <devices/common/pci/pcihost.h>
|
2022-01-17 12:58:51 +00:00
|
|
|
#include <devices/memctrl/platinum.h>
|
|
|
|
#include <loguru.hpp>
|
|
|
|
#include <machines/machinebase.h>
|
2022-07-18 09:48:23 +00:00
|
|
|
#include <machines/machinefactory.h>
|
2022-01-17 12:58:51 +00:00
|
|
|
#include <machines/machineproperties.h>
|
2023-11-03 07:21:33 +00:00
|
|
|
#include <memctrl/memctrlbase.h>
|
2022-01-17 12:58:51 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2022-07-18 09:48:23 +00:00
|
|
|
int initialize_catalyst(std::string& id)
|
2022-01-17 12:58:51 +00:00
|
|
|
{
|
2023-01-11 22:35:54 +00:00
|
|
|
LOG_F(INFO, "Building machine Catalyst...");
|
2022-12-21 10:24:22 +00:00
|
|
|
|
2022-01-17 12:58:51 +00:00
|
|
|
PlatinumCtrl* platinum_obj;
|
|
|
|
|
|
|
|
PCIHost *pci_host = dynamic_cast<PCIHost*>(gMachineObj->get_comp_by_name("Bandit1"));
|
|
|
|
|
|
|
|
// add the GrandCentral I/O controller
|
|
|
|
pci_host->pci_register_device(
|
2023-02-05 08:37:29 +00:00
|
|
|
DEV_FUN(0x10,0), dynamic_cast<PCIDevice*>(gMachineObj->get_comp_by_name("GrandCentral")));
|
2022-01-17 12:58:51 +00:00
|
|
|
|
|
|
|
// get (raw) pointer to the memory controller
|
|
|
|
platinum_obj = dynamic_cast<PlatinumCtrl*>(gMachineObj->get_comp_by_name("Platinum"));
|
|
|
|
|
|
|
|
// allocate ROM region
|
|
|
|
if (!platinum_obj->add_rom_region(0xFFC00000, 0x400000)) {
|
2022-08-14 12:26:56 +00:00
|
|
|
LOG_F(ERROR, "Could not allocate ROM region!");
|
2022-01-17 12:58:51 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// plug 8MB RAM DIMM into slot #0
|
2022-08-06 17:33:25 +00:00
|
|
|
platinum_obj->insert_ram_dimm(0, DRAM_CAP_8MB);
|
2022-01-17 12:58:51 +00:00
|
|
|
|
|
|
|
// allocate and map physical RAM
|
|
|
|
platinum_obj->map_phys_ram();
|
|
|
|
|
|
|
|
// init virtual CPU and request MPC601
|
|
|
|
ppc_cpu_init(platinum_obj, PPC_VER::MPC601, 7833600ULL);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2022-07-18 09:48:23 +00:00
|
|
|
|
|
|
|
static const PropMap pm7200_settings = {
|
|
|
|
{"rambank1_size",
|
|
|
|
new IntProperty(16, vector<uint32_t>({4, 8, 16, 32, 64, 128}))},
|
|
|
|
{"rambank2_size",
|
|
|
|
new IntProperty( 0, vector<uint32_t>({0, 4, 8, 16, 32, 64, 128}))},
|
|
|
|
{"rambank3_size",
|
|
|
|
new IntProperty( 0, vector<uint32_t>({0, 4, 8, 16, 32, 64, 128}))},
|
|
|
|
{"rambank4_size",
|
|
|
|
new IntProperty( 0, vector<uint32_t>({0, 4, 8, 16, 32, 64, 128}))},
|
|
|
|
{"gfxmem_size",
|
|
|
|
new IntProperty( 1, vector<uint32_t>({1, 2, 4}))},
|
|
|
|
{"mon_id",
|
|
|
|
new StrProperty("HiRes12-14in")},
|
2022-07-19 23:36:45 +00:00
|
|
|
{"emmo",
|
|
|
|
new BinProperty(0)},
|
2022-07-18 09:48:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static vector<string> pm7200_devices = {
|
|
|
|
"Platinum", "Bandit1", "GrandCentral"
|
|
|
|
};
|
|
|
|
|
|
|
|
static const MachineDescription pm7200_descriptor = {
|
|
|
|
.name = "pm7200",
|
|
|
|
.description = "Power Macintosh 7200",
|
|
|
|
.devices = pm7200_devices,
|
|
|
|
.settings = pm7200_settings,
|
|
|
|
.init_func = &initialize_catalyst
|
|
|
|
};
|
|
|
|
|
|
|
|
REGISTER_MACHINE(pm7200, pm7200_descriptor);
|