From f0553720d6ebd0215f7c9c260195e50d699ecdfb Mon Sep 17 00:00:00 2001 From: Maxim Poliakovski Date: Wed, 20 Jul 2022 01:36:45 +0200 Subject: [PATCH] Catalyst: factory test control. --- devices/ioctrl/grandcentral.cpp | 5 ++++- devices/ioctrl/macio.h | 2 ++ machines/machinecatalyst.cpp | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/devices/ioctrl/grandcentral.cpp b/devices/ioctrl/grandcentral.cpp index 42829c2..05e3e1d 100644 --- a/devices/ioctrl/grandcentral.cpp +++ b/devices/ioctrl/grandcentral.cpp @@ -74,6 +74,9 @@ GrandCentral::GrandCentral() : PCIDevice("mac-io/grandcentral"), InterruptCtrl() // connect floppy disk HW this->swim3 = dynamic_cast(gMachineObj->get_comp_by_name("Swim3")); + + // set EMMO pin status (active low) + this->emmo_pin = GET_BIN_PROP("emmo") ^ 1; } void GrandCentral::notify_bar_change(int bar_num) @@ -116,7 +119,7 @@ uint32_t GrandCentral::read(uint32_t reg_start, uint32_t offset, int size) case 7: // VIA-CUDA return this->viacuda->read((offset >> 9) & 0xF); case 0xA: // Board register 1 (IOBus dev #1) - return BYTESWAP_32(0x100); + return BYTESWAP_32(this->emmo_pin << 8); case 0xF: // NVRAM Data (IOBus dev #6) return this->nvram->read_byte( (this->nvram_addr_hi << 5) + ((offset >> 4) & 0x1F)); diff --git a/devices/ioctrl/macio.h b/devices/ioctrl/macio.h index c76fb04..7ad2c1e 100644 --- a/devices/ioctrl/macio.h +++ b/devices/ioctrl/macio.h @@ -109,6 +109,8 @@ protected: private: uint32_t base_addr = 0; + uint8_t emmo_pin; // factory tester status, active low + // interrupt state uint32_t int_mask = 0; uint32_t int_levels = 0; diff --git a/machines/machinecatalyst.cpp b/machines/machinecatalyst.cpp index 63240ef..7b87410 100644 --- a/machines/machinecatalyst.cpp +++ b/machines/machinecatalyst.cpp @@ -81,6 +81,8 @@ static const PropMap pm7200_settings = { new IntProperty( 1, vector({1, 2, 4}))}, {"mon_id", new StrProperty("HiRes12-14in")}, + {"emmo", + new BinProperty(0)}, }; static vector pm7200_devices = {