src/mess/machine/northbridge.c
| r0 | r15483 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Northbridge implementation |
| 4 | |
| 5 | ***************************************************************************/ |
| 6 | |
| 7 | #include "emu.h" |
| 8 | #include "machine/northbridge.h" |
| 9 | |
| 10 | //************************************************************************** |
| 11 | // GLOBAL VARIABLES |
| 12 | //************************************************************************** |
| 13 | |
| 14 | const device_type NORTHBRIDGE = &device_creator<northbridge_device>; |
| 15 | |
| 16 | northbridge_device::northbridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 17 | : device_t(mconfig, NORTHBRIDGE, "Northbridge", tag, owner, clock), |
| 18 | m_maincpu(*this, ":maincpu"), |
| 19 | m_ram(*this, ":" RAM_TAG) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | //------------------------------------------------- |
| 24 | // device_start - device-specific startup |
| 25 | //------------------------------------------------- |
| 26 | |
| 27 | void northbridge_device::device_start() |
| 28 | { |
| 29 | address_space* space = machine().device(":maincpu")->memory().space(AS_PROGRAM); |
| 30 | |
| 31 | machine().root_device().membank("bank10")->set_base(m_ram->pointer()); |
| 32 | |
| 33 | if (m_ram->size() > 0x0a0000) |
| 34 | { |
| 35 | offs_t ram_limit = 0x100000 + m_ram->size() - 0x0a0000; |
| 36 | space->install_read_bank(0x100000, ram_limit - 1, "bank1"); |
| 37 | space->install_write_bank(0x100000, ram_limit - 1, "bank1"); |
| 38 | machine().root_device().membank("bank1")->set_base(m_ram->pointer() + 0xa0000); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | //------------------------------------------------- |
| 43 | // device_reset - device-specific reset |
| 44 | //------------------------------------------------- |
| 45 | |
| 46 | void northbridge_device::device_reset() |
| 47 | { |
| 48 | } |
src/mess/machine/northbridge.h
| r0 | r15483 | |
| 1 | #pragma once |
| 2 | |
| 3 | #ifndef __NORTHBRIDGE_H__ |
| 4 | #define __NORTHBRIDGE_H__ |
| 5 | |
| 6 | #include "emu.h" |
| 7 | |
| 8 | #include "machine/ram.h" |
| 9 | |
| 10 | //************************************************************************** |
| 11 | // TYPE DEFINITIONS |
| 12 | //************************************************************************** |
| 13 | |
| 14 | // ======================> northbridge_device |
| 15 | |
| 16 | class northbridge_device : |
| 17 | public device_t |
| 18 | { |
| 19 | public: |
| 20 | // construction/destruction |
| 21 | northbridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 22 | |
| 23 | protected: |
| 24 | // device-level overrides |
| 25 | virtual void device_start(); |
| 26 | virtual void device_reset(); |
| 27 | public: |
| 28 | required_device<cpu_device> m_maincpu; |
| 29 | required_device<ram_device> m_ram; |
| 30 | |
| 31 | }; |
| 32 | |
| 33 | |
| 34 | // device type definition |
| 35 | extern const device_type NORTHBRIDGE; |
| 36 | |
| 37 | #endif /* __NORTHBRIDGE_H__ */ |
| | No newline at end of file |
src/mess/machine/southbridge.c
| r15482 | r15483 | |
| 201 | 201 | m_keybc(*this, "keybc"), |
| 202 | 202 | m_isabus(*this, "isabus"), |
| 203 | 203 | m_speaker(*this, SPEAKER_TAG), |
| 204 | | m_ram(*this, ":" RAM_TAG), |
| 205 | 204 | m_mc146818(*this, "rtc"), |
| 206 | 205 | m_pc_kbdc(*this, "pc_kbdc") |
| 207 | 206 | { |
| r15482 | r15483 | |
| 225 | 224 | |
| 226 | 225 | void southbridge_device::device_start() |
| 227 | 226 | { |
| 228 | | address_space* space = machine().device(":maincpu")->memory().space(AS_PROGRAM); |
| 229 | | |
| 230 | | machine().root_device().membank("bank10")->set_base(m_ram->pointer()); |
| 231 | | |
| 232 | | if (m_ram->size() > 0x0a0000) |
| 233 | | { |
| 234 | | offs_t ram_limit = 0x100000 + m_ram->size() - 0x0a0000; |
| 235 | | space->install_read_bank(0x100000, ram_limit - 1, "bank1"); |
| 236 | | space->install_write_bank(0x100000, ram_limit - 1, "bank1"); |
| 237 | | machine().root_device().membank("bank1")->set_base(m_ram->pointer() + 0xa0000); |
| 238 | | } |
| 239 | 227 | address_space* spaceio = machine().device(":maincpu")->memory().space(AS_IO); |
| 240 | 228 | |
| 241 | 229 | spaceio->install_legacy_readwrite_handler(*m_dma8237_1, 0x0000, 0x001f, FUNC(i8237_r), FUNC(i8237_w), 0xffffffff); |
src/mess/drivers/at.c
| r15482 | r15483 | |
| 12 | 12 | |
| 13 | 13 | #include "includes/at.h" |
| 14 | 14 | #include "machine/pc_keyboards.h" |
| 15 | #include "machine/northbridge.h" |
| 15 | 16 | #include "machine/southbridge.h" |
| 16 | 17 | |
| 17 | 18 | |
| r15482 | r15483 | |
| 628 | 629 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 629 | 630 | MCFG_RAM_EXTRA_OPTIONS("1M,2M,8M,16M,32M,64M") |
| 630 | 631 | |
| 631 | | MCFG_DEVICE_ADD("sb",SOUTHBRIDGE,0); |
| 632 | MCFG_DEVICE_ADD("nb",NORTHBRIDGE,0) |
| 633 | MCFG_DEVICE_ADD("sb",SOUTHBRIDGE,0) |
| 632 | 634 | |
| 633 | 635 | MCFG_PCI_BUS_ADD("pcibus", 0) |
| 634 | 636 | MCFG_PCI_BUS_DEVICE("pcibus:0", pci_devices, "i82439tx", NULL, &tx_config, 0, true) |
| r15482 | r15483 | |
| 651 | 653 | MCFG_RAM_DEFAULT_SIZE("4M") |
| 652 | 654 | MCFG_RAM_EXTRA_OPTIONS("1M,2M,8M,16M,32M,64M") |
| 653 | 655 | |
| 654 | | MCFG_DEVICE_ADD("sb",SOUTHBRIDGE,0); |
| 656 | MCFG_DEVICE_ADD("nb",NORTHBRIDGE,0) |
| 657 | MCFG_DEVICE_ADD("sb",SOUTHBRIDGE,0) |
| 655 | 658 | |
| 656 | 659 | MCFG_PCI_BUS_ADD("pcibus", 0) |
| 657 | 660 | MCFG_PCI_BUS_DEVICE("pcibus:0", pci_devices, "i82439tx", NULL, &tx_config, 0, true) |