diff --git a/src/devices/machine/i82439hx.cpp b/src/devices/machine/i82439hx.cpp index 2157bdc0043..86ac53874b7 100644 --- a/src/devices/machine/i82439hx.cpp +++ b/src/devices/machine/i82439hx.cpp @@ -78,6 +78,7 @@ void i82439hx_host_device::device_reset() errcmd = 0x00; errsts = 0x00; errsyn = 0x00; + smiact_n = 1; } void i82439hx_host_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, @@ -85,14 +86,23 @@ void i82439hx_host_device::map_extra(uint64_t memory_window_start, uint64_t memo { io_space->install_device(0, 0xffff, *static_cast(this), &pci_host_device::io_configuration_access_map); + // memory hole at 512-640 kbytes if((dramc & 0xc0) == 0x40) memory_space->install_ram (0x00000000, 0x0007ffff, &ram[0x00000000/4]); else memory_space->install_ram (0x00000000, 0x0009ffff, &ram[0x00000000/4]); - if(smram & 0x40) - memory_space->install_ram (0x000a0000, 0x000bffff, &ram[0x000a0000/4]); + // assume that map_extra of the northbridge is called after the video card has mepped its memory here + if (smram & 0x08) + { + if (smiact_n == 0) + memory_space->install_ram(0x000a0000, 0x000bffff, &ram[0x000a0000 / 4]); + else + if (smram & 0x40) + memory_space->install_ram(0x000a0000, 0x000bffff, &ram[0x000a0000 / 4]); + } + // assume that map_extra of the northbridge is called after the one of the southbridge if(pam[1] & 0x01) memory_space->install_rom (0x000c0000, 0x000c3fff, &ram[0x000c0000/4]); if(pam[1] & 0x02) @@ -147,6 +157,7 @@ void i82439hx_host_device::map_extra(uint64_t memory_window_start, uint64_t memo memory_space->install_writeonly(0x000f0000, 0x000fffff, &ram[0x000f0000/4]); memory_space->install_ram (0x00100000, 0x00efffff, &ram[0x00100000/4]); + // memory hole at 15-16 mbytes if((dramc & 0xc0) != 0x80) memory_space->install_ram (0x00f00000, 0x00ffffff, &ram[0x00f00000/4]); @@ -293,3 +304,14 @@ READ8_MEMBER (i82439hx_host_device::errsyn_r) { return errsyn; } + +WRITE_LINE_MEMBER(i82439hx_host_device::smi_act_w) +{ + // state is 0 when smm is not active + // but smiact_n reflects the state of the SMIACT# pin + if (state == 0) + smiact_n = 1; + else + smiact_n = 0; + remap_cb(); +} diff --git a/src/devices/machine/i82439hx.h b/src/devices/machine/i82439hx.h index 0a4f47a5827..bab7dc20052 100644 --- a/src/devices/machine/i82439hx.h +++ b/src/devices/machine/i82439hx.h @@ -21,6 +21,8 @@ public: void set_cpu_tag(const char *tag); void set_ram_size(int ram_size); + DECLARE_WRITE_LINE_MEMBER(smi_act_w); + protected: virtual void device_start() override; virtual void device_reset() override; @@ -41,6 +43,7 @@ private: uint8_t pcon, cc, dramec, dramc, dramt; uint8_t pam[7], drb[8]; uint8_t drt, drat, smram, errcmd, errsts, errsyn; + int smiact_n; DECLARE_READ8_MEMBER (pcon_r); DECLARE_WRITE8_MEMBER(pcon_w);