From 4f6f606be5141f35c9e8df22b09d62546b5b6ea7 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Sat, 12 Sep 2015 10:06:02 +0300 Subject: [PATCH] isa_ibm_pgc: reinstall ROM mapping at reset time --- src/devices/bus/isa/pgc.c | 29 +++++++++++------------------ src/devices/bus/isa/pgc.h | 2 ++ 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/devices/bus/isa/pgc.c b/src/devices/bus/isa/pgc.c index ed191e070c3..6ed1f4b3cb3 100644 --- a/src/devices/bus/isa/pgc.c +++ b/src/devices/bus/isa/pgc.c @@ -16,9 +16,9 @@ http://www.seasip.info/VintagePC/pgc.html To do: - - memory map (restore ROM mapping on reset, ...) + - decode memory map - various VRAM write modes - - what's up with irq 3 (= vblank irq)? + - what's up with irq 3 (= vblank irq)? (causes soft reset) - "test pin of the microprocessor samples the hsync pulse" - CGA emulator - bus state handling? @@ -28,8 +28,6 @@ #include "emu.h" -//nclude "machine/ram.h" - #include "pgc.h" #define VERBOSE_PGC 1 @@ -223,10 +221,6 @@ isa8_pgc_device::isa8_pgc_device(const machine_config &mconfig, device_type type { } -//------------------------------------------------- -// device_start - device-specific startup -//------------------------------------------------- - void isa8_pgc_device::device_start() { address_space &space = m_cpu->space( AS_PROGRAM ); @@ -251,11 +245,17 @@ void isa8_pgc_device::device_start() membank("vram")->set_base(m_vram); m_eram = auto_alloc_array(machine(), UINT8, 0x8000); + + machine().add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(FUNC(isa8_pgc_device::reset_common), this)); } -//------------------------------------------------- -// device_reset - device-specific reset -//------------------------------------------------- +void isa8_pgc_device::reset_common() +{ + address_space &space = m_cpu->space( AS_PROGRAM ); + + space.unmap_readwrite(0xf8000, 0xfffff); + space.install_rom(0xf8000, 0xfffff, memregion("maincpu")->base() + 0x8000); +} void isa8_pgc_device::device_reset() { @@ -267,13 +267,6 @@ void isa8_pgc_device::device_reset() m_isa->install_bank(0xc6400, 0xc67ff, 0, 0, "commarea", m_commarea); else m_isa->install_bank(0xc6000, 0xc63ff, 0, 0, "commarea", m_commarea); -#if 0 - address_space &space = m_cpu->space( AS_PROGRAM ); - - space.unmap_readwrite(0xf8000, 0xfffff); - space.install_rom(0xf8000, 0xfffff, - space.machine().root_device().memregion("maincpu")->base() + 0x8000); -#endif } // diff --git a/src/devices/bus/isa/pgc.h b/src/devices/bus/isa/pgc.h index bb51fa9d177..9e5361bf105 100644 --- a/src/devices/bus/isa/pgc.h +++ b/src/devices/bus/isa/pgc.h @@ -42,6 +42,8 @@ public: DECLARE_WRITE8_MEMBER( lut_w ); DECLARE_READ8_MEMBER( init_r ); + void reset_common(); + protected: // device-level overrides virtual void device_start();