summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/isa/cga.cpp
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2016-06-05 23:41:13 +0200
committer Olivier Galibert <galibert@pobox.com>2016-06-14 23:21:58 +0200
commitb82d7c4aef44eac0c4752b7db3c29306610a84ac (patch)
tree40c96f334c72d5dc4d5e1e27bee3616e5905c8ef /src/devices/bus/isa/cga.cpp
parent58ee7eb241f3f9458544df2f14be525cfc6a1810 (diff)
Memory fun [O.Galibert]
- Added AM_SELECT/addrselect field. Replaces the old AM_MIRROR/AM_MASK combo used to mirror a handler and get the mirrored bits in the offset. - Removed mask and/or mirror from where it didn't belong. Simplified a lot of instances of mask that just weren't needed, especially in bus handlers. Used the short forms of install handlers where possible. - Replaced the 60s hippy, "It's cool man" range parameter handling in map_range that tried to guess what was meant when the values passed were not entirely sensible, by a cranky, diner waitress-turned IRS auditor curmudgeon. Main control function has a series of 14 tests just to find a reason to fatalerror out your requests. You have been warned. Some drivers, hopefully not many, will fail the gate-guarding bureaucrat trials. Should be easy to fix actually, I worked on the error messages. A full regression test would be welcome.
Diffstat (limited to 'src/devices/bus/isa/cga.cpp')
-rw-r--r--src/devices/bus/isa/cga.cpp35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/devices/bus/isa/cga.cpp b/src/devices/bus/isa/cga.cpp
index 888318f65d7..2dc3a5cd300 100644
--- a/src/devices/bus/isa/cga.cpp
+++ b/src/devices/bus/isa/cga.cpp
@@ -348,8 +348,10 @@ void isa8_cga_device::device_start()
set_isa_device();
m_vram.resize(m_vram_size);
- m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
- m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", &m_vram[0]);
+ m_isa->install_device(0x3d0, 0x3df, read8_delegate( FUNC(isa8_cga_device::io_read), this ), write8_delegate( FUNC(isa8_cga_device::io_write), this ) );
+ m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, "bank_cga", &m_vram[0]);
+ if(m_vram_size == 0x4000)
+ m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
/* Initialise the cga palette */
int i;
@@ -1578,12 +1580,13 @@ void isa8_cga_pc1512_device::device_start()
{
isa8_cga_device::device_start();
- m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_pc1512_device::io_read), this ), write8_delegate( FUNC(isa8_cga_pc1512_device::io_write), this ) );
- m_isa->install_bank(0xb8000, 0xbbfff, 0, 0, "bank1", &m_vram[0]);
+ m_isa->install_device(0x3d0, 0x3df, read8_delegate( FUNC(isa8_cga_pc1512_device::io_read), this ), write8_delegate( FUNC(isa8_cga_pc1512_device::io_write), this ) );
+ m_isa->install_bank(0xb8000, 0xbbfff, "bank1", &m_vram[0]);
address_space &space = machine().firstcpu->space( AS_PROGRAM );
- space.install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
+ space.install_write_handler( 0xb8000, 0xbbfff, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
+ space.install_write_handler( 0xbc000, 0xbffff, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
}
void isa8_cga_pc1512_device::device_reset()
@@ -1716,9 +1719,9 @@ void isa8_wyse700_device::device_start()
{
isa8_cga_device::device_start();
- m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_wyse700_device::io_read), this ), write8_delegate( FUNC(isa8_wyse700_device::io_write), this ) );
- m_isa->install_bank(0xa0000, 0xaffff, 0, 0, "bank_wy1", &m_vram[0x00000]);
- m_isa->install_bank(0xb0000, 0xbffff, 0, 0, "bank_cga", &m_vram[0x10000]);
+ m_isa->install_device(0x3d0, 0x3df, read8_delegate( FUNC(isa8_wyse700_device::io_read), this ), write8_delegate( FUNC(isa8_wyse700_device::io_write), this ) );
+ m_isa->install_bank(0xa0000, 0xaffff, "bank_wy1", &m_vram[0x00000]);
+ m_isa->install_bank(0xb0000, 0xbffff, "bank_cga", &m_vram[0x10000]);
}
void isa8_wyse700_device::device_reset()
@@ -1778,7 +1781,7 @@ void isa8_ec1841_0002_device::device_start()
{
isa8_cga_device::device_start();
- m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_ec1841_0002_device::io_read), this ), write8_delegate( FUNC(isa8_ec1841_0002_device::io_write), this ) );
+ m_isa->install_device(0x3d0, 0x3df, read8_delegate( FUNC(isa8_ec1841_0002_device::io_read), this ), write8_delegate( FUNC(isa8_ec1841_0002_device::io_write), this ) );
}
void isa8_ec1841_0002_device::device_reset()
@@ -1810,11 +1813,17 @@ WRITE8_MEMBER( isa8_ec1841_0002_device::io_write )
case 0x0f:
m_p3df = data;
if (data & 1) {
- m_isa->install_memory(0xb8000, 0xb9fff, 0, m_vram_size & 0x4000,
- read8_delegate( FUNC(isa8_ec1841_0002_device::char_ram_read), this),
- write8_delegate(FUNC(isa8_ec1841_0002_device::char_ram_write), this) );
+ m_isa->install_memory(0xb8000, 0xb9fff,
+ read8_delegate( FUNC(isa8_ec1841_0002_device::char_ram_read), this),
+ write8_delegate(FUNC(isa8_ec1841_0002_device::char_ram_write), this) );
+ if(m_vram_size == 0x4000)
+ m_isa->install_memory(0xbc000, 0xbdfff,
+ read8_delegate( FUNC(isa8_ec1841_0002_device::char_ram_read), this),
+ write8_delegate(FUNC(isa8_ec1841_0002_device::char_ram_write), this) );
} else {
- m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, 0, m_vram_size & 0x4000, "bank_cga", &m_vram[0]);
+ m_isa->install_bank(0xb8000, 0xb8000 + MIN(0x8000,m_vram_size) - 1, "bank_cga", &m_vram[0]);
+ if(m_vram_size == 0x4000)
+ m_isa->install_bank(0xbc000, 0xbffff, "bank_cga", &m_vram[0]);
}
break;
default: