Skip to content

Commit

Permalink
maps: Finish devices/bus (nw)
Browse files Browse the repository at this point in the history
That's it for ADDRESS_MAP_START.  Please don't try to remove the
macros yet, let's wait for a full release before that so that the
forks can catch up.
  • Loading branch information
galibert committed Apr 21, 2018
1 parent 9a35d98 commit b44fe96
Show file tree
Hide file tree
Showing 20 changed files with 253 additions and 223 deletions.
21 changes: 11 additions & 10 deletions src/devices/bus/amiga/zorro/buddha.cpp
Expand Up @@ -42,16 +42,17 @@ DEFINE_DEVICE_TYPE(BUDDHA, buddha_device, "buddha", "Buddha IDE controller")
// mmio_map - device-specific memory mapped I/O
//-------------------------------------------------

ADDRESS_MAP_START(buddha_device::mmio_map)
AM_RANGE(0x7fe, 0x7ff) AM_READWRITE(speed_r, speed_w)
AM_RANGE(0x800, 0x8ff) AM_READWRITE(ide_0_cs0_r, ide_0_cs0_w)
AM_RANGE(0x900, 0x9ff) AM_READWRITE(ide_0_cs1_r, ide_0_cs1_w)
AM_RANGE(0xa00, 0xaff) AM_READWRITE(ide_1_cs0_r, ide_1_cs0_w)
AM_RANGE(0xb00, 0xbff) AM_READWRITE(ide_1_cs1_r, ide_1_cs1_w)
AM_RANGE(0xf00, 0xf3f) AM_READ(ide_0_interrupt_r)
AM_RANGE(0xf40, 0xf7f) AM_READ(ide_1_interrupt_r)
AM_RANGE(0xfc0, 0xfff) AM_WRITE(ide_interrupt_enable_w)
ADDRESS_MAP_END
void buddha_device::mmio_map(address_map &map)
{
map(0x7fe, 0x7ff).rw(this, FUNC(buddha_device::speed_r), FUNC(buddha_device::speed_w));
map(0x800, 0x8ff).rw(this, FUNC(buddha_device::ide_0_cs0_r), FUNC(buddha_device::ide_0_cs0_w));
map(0x900, 0x9ff).rw(this, FUNC(buddha_device::ide_0_cs1_r), FUNC(buddha_device::ide_0_cs1_w));
map(0xa00, 0xaff).rw(this, FUNC(buddha_device::ide_1_cs0_r), FUNC(buddha_device::ide_1_cs0_w));
map(0xb00, 0xbff).rw(this, FUNC(buddha_device::ide_1_cs1_r), FUNC(buddha_device::ide_1_cs1_w));
map(0xf00, 0xf3f).r(this, FUNC(buddha_device::ide_0_interrupt_r));
map(0xf40, 0xf7f).r(this, FUNC(buddha_device::ide_1_interrupt_r));
map(0xfc0, 0xfff).w(this, FUNC(buddha_device::ide_interrupt_enable_w));
}

//-------------------------------------------------
// device_add_mconfig - add device configuration
Expand Down
7 changes: 4 additions & 3 deletions src/devices/bus/cbmiec/c1526.cpp
Expand Up @@ -78,9 +78,10 @@ const tiny_rom_entry *c4023_device::device_rom_region() const
// ADDRESS_MAP( c1526_mem )
//-------------------------------------------------

ADDRESS_MAP_START(c1526_device_base::c1526_mem)
AM_RANGE(0x0000, 0x1fff) AM_ROM AM_REGION(M6504_TAG, 0)
ADDRESS_MAP_END
void c1526_device_base::c1526_mem(address_map &map)
{
map(0x0000, 0x1fff).rom().region(M6504_TAG, 0);
}


//-------------------------------------------------
Expand Down
32 changes: 17 additions & 15 deletions src/devices/bus/cbmiec/c1541.cpp
Expand Up @@ -513,27 +513,29 @@ void c1541_device_base::c1541_mem(address_map &map)
// ADDRESS_MAP( c1541dd_mem )
//-------------------------------------------------

ADDRESS_MAP_START(c1541_device_base::c1541dd_mem)
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x6000) AM_RAM
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_0_TAG, via6522_device, read, write)
AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write)
AM_RANGE(0x8000, 0x9fff) AM_RAM
AM_RANGE(0xa000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0x2000)
ADDRESS_MAP_END
void c1541_device_base::c1541dd_mem(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x6000).ram();
map(0x1800, 0x180f).mirror(0x63f0).rw(M6522_0_TAG, FUNC(via6522_device::read), FUNC(via6522_device::write));
map(0x1c00, 0x1c0f).mirror(0x63f0).rw(M6522_1_TAG, FUNC(via6522_device::read), FUNC(via6522_device::write));
map(0x8000, 0x9fff).ram();
map(0xa000, 0xffff).rom().region(M6502_TAG, 0x2000);
}


//-------------------------------------------------
// ADDRESS_MAP( c1541pd_mem )
//-------------------------------------------------

ADDRESS_MAP_START(c1541_device_base::c1541pd_mem)
AM_RANGE(0x0000, 0x07ff) AM_MIRROR(0x6000) AM_RAM
AM_RANGE(0x1800, 0x180f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_0_TAG, via6522_device, read, write)
AM_RANGE(0x1c00, 0x1c0f) AM_MIRROR(0x63f0) AM_DEVREADWRITE(M6522_1_TAG, via6522_device, read, write)
AM_RANGE(0x8000, 0x9fff) AM_ROM AM_REGION(M6502_TAG, 0x4000)
AM_RANGE(0xa000, 0xbfff) AM_RAM
AM_RANGE(0xc000, 0xffff) AM_ROM AM_REGION(M6502_TAG, 0x0000)
ADDRESS_MAP_END
void c1541_device_base::c1541pd_mem(address_map &map)
{
map(0x0000, 0x07ff).mirror(0x6000).ram();
map(0x1800, 0x180f).mirror(0x63f0).rw(M6522_0_TAG, FUNC(via6522_device::read), FUNC(via6522_device::write));
map(0x1c00, 0x1c0f).mirror(0x63f0).rw(M6522_1_TAG, FUNC(via6522_device::read), FUNC(via6522_device::write));
map(0x8000, 0x9fff).rom().region(M6502_TAG, 0x4000);
map(0xa000, 0xbfff).ram();
map(0xc000, 0xffff).rom().region(M6502_TAG, 0x0000);
}


//-------------------------------------------------
Expand Down
7 changes: 4 additions & 3 deletions src/devices/bus/cbus/mpu_pc98.cpp
Expand Up @@ -61,9 +61,10 @@ mpu_pc98_device::mpu_pc98_device(const machine_config &mconfig, const char *tag,
{
}

ADDRESS_MAP_START(mpu_pc98_device::map)
AM_RANGE(0, 3) AM_DEVREADWRITE8(MPU_CORE_TAG, mpu401_device, mpu_r, mpu_w, 0xff)
ADDRESS_MAP_END
void mpu_pc98_device::map(address_map &map)
{
map(0x0, 0x0).rw(MPU_CORE_TAG, FUNC(mpu401_device::mpu_r), FUNC(mpu401_device::mpu_w));
}

//-------------------------------------------------
// device_start - device-specific startup
Expand Down
15 changes: 8 additions & 7 deletions src/devices/bus/cgenie/expansion/floppy.cpp
Expand Up @@ -30,13 +30,14 @@

DEFINE_DEVICE_TYPE(CGENIE_FDC, cgenie_fdc_device, "cgenie_fdc", "Colour Genie FDC")

ADDRESS_MAP_START(cgenie_fdc_device::mmio)
AM_RANGE(0xe0, 0xe3) AM_MIRROR(0x10) AM_READWRITE(irq_r, select_w)
AM_RANGE(0xec, 0xec) AM_MIRROR(0x10) AM_DEVREAD("fd1793", fd1793_device, status_r) AM_WRITE(command_w)
AM_RANGE(0xed, 0xed) AM_MIRROR(0x10) AM_DEVREADWRITE("fd1793", fd1793_device, track_r, track_w)
AM_RANGE(0xee, 0xee) AM_MIRROR(0x10) AM_DEVREADWRITE("fd1793", fd1793_device, sector_r, sector_w)
AM_RANGE(0xef, 0xef) AM_MIRROR(0x10) AM_DEVREADWRITE("fd1793", fd1793_device, data_r, data_w)
ADDRESS_MAP_END
void cgenie_fdc_device::mmio(address_map &map)
{
map(0xe0, 0xe3).mirror(0x10).rw(this, FUNC(cgenie_fdc_device::irq_r), FUNC(cgenie_fdc_device::select_w));
map(0xec, 0xec).mirror(0x10).r("fd1793", FUNC(fd1793_device::status_r)).w(this, FUNC(cgenie_fdc_device::command_w));
map(0xed, 0xed).mirror(0x10).rw("fd1793", FUNC(fd1793_device::track_r), FUNC(fd1793_device::track_w));
map(0xee, 0xee).mirror(0x10).rw("fd1793", FUNC(fd1793_device::sector_r), FUNC(fd1793_device::sector_w));
map(0xef, 0xef).mirror(0x10).rw("fd1793", FUNC(fd1793_device::data_r), FUNC(fd1793_device::data_w));
}

FLOPPY_FORMATS_MEMBER( cgenie_fdc_device::floppy_formats )
FLOPPY_CGENIE_FORMAT
Expand Down
26 changes: 14 additions & 12 deletions src/devices/bus/dmv/k230.cpp
Expand Up @@ -46,18 +46,20 @@ void dmv_k230_device::k230_io(address_map &map)
map(0x00, 0xff).rw(this, FUNC(dmv_k230_device::io_r), FUNC(dmv_k230_device::io_w));
}

ADDRESS_MAP_START(dmv_k230_device::k234_mem)
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE( 0x00000, 0x7ffff ) AM_READWRITE(program_r, program_w)
AM_RANGE( 0xfff00, 0xfffff ) AM_READWRITE(io_r, io_w)
ADDRESS_MAP_END

ADDRESS_MAP_START(dmv_k230_device::k235_io)
ADDRESS_MAP_UNMAP_HIGH
ADDRESS_MAP_GLOBAL_MASK(0xff)
AM_RANGE( 0x00, 0xff ) AM_READWRITE(io_r, io_w)
AM_RANGE( 0x90, 0x91 ) AM_DEVREADWRITE("pic8259", pic8259_device, read, write)
ADDRESS_MAP_END
void dmv_k230_device::k234_mem(address_map &map)
{
map.unmap_value_high();
map(0x00000, 0x7ffff).rw(this, FUNC(dmv_k230_device::program_r), FUNC(dmv_k230_device::program_w));
map(0xfff00, 0xfffff).rw(this, FUNC(dmv_k230_device::io_r), FUNC(dmv_k230_device::io_w));
}

void dmv_k230_device::k235_io(address_map &map)
{
map.unmap_value_high();
map.global_mask(0xff);
map(0x00, 0xff).rw(this, FUNC(dmv_k230_device::io_r), FUNC(dmv_k230_device::io_w));
map(0x90, 0x91).rw("pic8259", FUNC(pic8259_device::read), FUNC(pic8259_device::write));
}

static INPUT_PORTS_START( dmv_k235 )
PORT_START("DSW")
Expand Down
9 changes: 5 additions & 4 deletions src/devices/bus/einstein/pipe/silicon_disc.cpp
Expand Up @@ -20,10 +20,11 @@ DEFINE_DEVICE_TYPE(EINSTEIN_SILICON_DISC, einstein_silicon_disc_device, "einstei
// device_address_map
//-------------------------------------------------

ADDRESS_MAP_START(einstein_silicon_disc_device::map)
AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) AM_WRITE(sector_low_w)
AM_RANGE(0x09, 0x09) AM_MIRROR(0xff00) AM_WRITE(sector_high_w)
ADDRESS_MAP_END
void einstein_silicon_disc_device::map(address_map &map)
{
map(0x08, 0x08).mirror(0xff00).w(this, FUNC(einstein_silicon_disc_device::sector_low_w));
map(0x09, 0x09).mirror(0xff00).w(this, FUNC(einstein_silicon_disc_device::sector_high_w));
}

//-------------------------------------------------
// rom_region - device-specific ROM region
Expand Down
11 changes: 6 additions & 5 deletions src/devices/bus/einstein/pipe/tk02.cpp
Expand Up @@ -21,12 +21,13 @@ DEFINE_DEVICE_TYPE(TK02_80COL, tk02_device, "tk02", "TK02 80 Column Monochrome U
// device_address_map
//-------------------------------------------------

ADDRESS_MAP_START(tk02_device::map)
void tk02_device::map(address_map &map)
{
// AM_RANGE(0x00, 0x07) AM_SELECT(0xff00) AM_READWRITE(ram_r, ram_w) // no AM_SELECT (or AM_MASK) support here
AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) AM_DEVWRITE("crtc", mc6845_device, address_w)
AM_RANGE(0x09, 0x09) AM_MIRROR(0xff00) AM_DEVWRITE("crtc", mc6845_device, register_w)
AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_READ(status_r)
ADDRESS_MAP_END
map(0x08, 0x08).mirror(0xff00).w("crtc", FUNC(mc6845_device::address_w));
map(0x09, 0x09).mirror(0xff00).w("crtc", FUNC(mc6845_device::register_w));
map(0x0c, 0x0c).mirror(0xff00).r(this, FUNC(tk02_device::status_r));
}

//-------------------------------------------------
// rom_region - device-specific ROM region
Expand Down
16 changes: 9 additions & 7 deletions src/devices/bus/hexbus/hx5102.cpp
Expand Up @@ -110,17 +110,19 @@ DEFINE_DEVICE_TYPE_NS(HX5102, bus::hexbus, hx5102_device, "ti_hx5102", "TI Hexbu

namespace bus { namespace hexbus {

ADDRESS_MAP_START(hx5102_device::memmap)
AM_RANGE(0x0000, 0xffff) AM_READWRITE(read, write)
ADDRESS_MAP_END
void hx5102_device::memmap(address_map &map)
{
map(0x0000, 0xffff).rw(this, FUNC(hx5102_device::read), FUNC(hx5102_device::write));
}

/*
CRU access to CRU addresses 1700 - 17FE)
*/
ADDRESS_MAP_START(hx5102_device::crumap)
AM_RANGE(0x17e0>>4,0x17fe>>4) AM_READ(cruread)
AM_RANGE(0x17e0>>1,0x17fe>>1) AM_WRITE(cruwrite)
ADDRESS_MAP_END
void hx5102_device::crumap(address_map &map)
{
map(0x17e0>>4, 0x17fe>>4).r(this, FUNC(hx5102_device::cruread));
map(0x17e0>>1, 0x17fe>>1).w(this, FUNC(hx5102_device::cruwrite));
}

hx5102_device::hx5102_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock):
hexbus_chained_device(mconfig, HX5102, tag, owner, clock),
Expand Down
46 changes: 24 additions & 22 deletions src/devices/bus/ieee488/c8050.cpp
Expand Up @@ -220,34 +220,36 @@ void c8050_device::c8050_fdc_mem(address_map &map)
// ADDRESS_MAP( c8250lp_fdc_mem )
//-------------------------------------------------

ADDRESS_MAP_START(c8050_device::c8250lp_fdc_mem)
ADDRESS_MAP_GLOBAL_MASK(0x1fff)
AM_RANGE(0x0000, 0x003f) AM_MIRROR(0x0300) AM_DEVICE(M6530_TAG, mos6530_new_device, ram_map)
AM_RANGE(0x0040, 0x004f) AM_MIRROR(0x0330) AM_DEVICE(M6522_TAG, via6522_device, map)
AM_RANGE(0x0080, 0x008f) AM_MIRROR(0x0330) AM_DEVICE(M6530_TAG, mos6530_new_device, io_map)
AM_RANGE(0x0400, 0x07ff) AM_RAM AM_SHARE("share1")
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2")
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3")
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("share4")
AM_RANGE(0x1800, 0x1fff) AM_ROM AM_REGION(M6504_TAG, 0)
ADDRESS_MAP_END
void c8050_device::c8250lp_fdc_mem(address_map &map)
{
map.global_mask(0x1fff);
map(0x0000, 0x003f).mirror(0x0300).m(M6530_TAG, FUNC(mos6530_new_device::ram_map));
map(0x0040, 0x004f).mirror(0x0330).m(M6522_TAG, FUNC(via6522_device::map));
map(0x0080, 0x008f).mirror(0x0330).m(M6530_TAG, FUNC(mos6530_new_device::io_map));
map(0x0400, 0x07ff).ram().share("share1");
map(0x0800, 0x0bff).ram().share("share2");
map(0x0c00, 0x0fff).ram().share("share3");
map(0x1000, 0x13ff).ram().share("share4");
map(0x1800, 0x1fff).rom().region(M6504_TAG, 0);
}


//-------------------------------------------------
// ADDRESS_MAP( sfd1001_fdc_mem )
//-------------------------------------------------

ADDRESS_MAP_START(c8050_device::sfd1001_fdc_mem)
ADDRESS_MAP_GLOBAL_MASK(0x1fff)
AM_RANGE(0x0000, 0x003f) AM_MIRROR(0x0300) AM_DEVICE(M6530_TAG, mos6530_new_device, ram_map)
AM_RANGE(0x0040, 0x004f) AM_MIRROR(0x0330) AM_DEVICE(M6522_TAG, via6522_device, map)
AM_RANGE(0x0080, 0x008f) AM_MIRROR(0x0330) AM_DEVICE(M6530_TAG, mos6530_new_device, io_map)
AM_RANGE(0x0400, 0x07ff) AM_RAM AM_SHARE("share1")
AM_RANGE(0x0800, 0x0bff) AM_RAM AM_SHARE("share2")
AM_RANGE(0x0c00, 0x0fff) AM_RAM AM_SHARE("share3")
AM_RANGE(0x1000, 0x13ff) AM_RAM AM_SHARE("share4")
AM_RANGE(0x1800, 0x1fff) AM_ROM AM_REGION(M6504_TAG, 0)
ADDRESS_MAP_END
void c8050_device::sfd1001_fdc_mem(address_map &map)
{
map.global_mask(0x1fff);
map(0x0000, 0x003f).mirror(0x0300).m(M6530_TAG, FUNC(mos6530_new_device::ram_map));
map(0x0040, 0x004f).mirror(0x0330).m(M6522_TAG, FUNC(via6522_device::map));
map(0x0080, 0x008f).mirror(0x0330).m(M6530_TAG, FUNC(mos6530_new_device::io_map));
map(0x0400, 0x07ff).ram().share("share1");
map(0x0800, 0x0bff).ram().share("share2");
map(0x0c00, 0x0fff).ram().share("share3");
map(0x1000, 0x13ff).ram().share("share4");
map(0x1800, 0x1fff).rom().region(M6504_TAG, 0);
}


//-------------------------------------------------
Expand Down

0 comments on commit b44fe96

Please sign in to comment.