142
142
segas1x_state *state = machine.driver_data<segas1x_state>();
143
143
address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
145
soundlatch_w(space, 0, data & 0xff);
145
state->soundlatch_byte_w(*space, 0, data & 0xff);
146
146
device_set_input_line(state->m_soundcpu, INPUT_LINE_NMI, PULSE_LINE);
252
252
return state->m_misc_io_data[offset];
254
254
/* otherwise, return an input port */
255
return input_port_read(space->machine(), portnames[offset]);
255
return space->machine().root_device().ioport(portnames[offset])->read();
257
257
/* 'SEGA' protection */
360
360
/* video control latch */
362
return input_port_read(space->machine(), portnames[offset & 1]);
362
return space->machine().root_device().ioport(portnames[offset & 1])->read();
364
364
if (state->m_custom_io_r)
365
365
return state->m_custom_io_r(space, offset, mem_mask);
453
return input_port_read(space->machine(), "P3");
453
return space->machine().root_device().ioport("P3")->read();
456
return input_port_read(space->machine(), "P4");
456
return space->machine().root_device().ioport("P4")->read();
459
return input_port_read(space->machine(), "P34START");
459
return space->machine().root_device().ioport("P34START")->read();
461
461
return segaic16_open_bus_r(space, 0, mem_mask);
497
state->m_lghost_value = 255 - input_port_read(space->machine(), "GUNY1");
497
state->m_lghost_value = 255 - state->ioport("GUNY1")->read();
501
state->m_lghost_value = input_port_read(space->machine(), "GUNX1");
501
state->m_lghost_value = state->ioport("GUNX1")->read();
505
state->m_lghost_value = 255 - input_port_read(space->machine(), state->m_lghost_select ? "GUNY3" : "GUNY2");
505
state->m_lghost_value = 255 - state->ioport(state->m_lghost_select ? "GUNY3" : "GUNY2")->read();
509
state->m_lghost_value = input_port_read(space->machine(), state->m_lghost_select ? "GUNX3" : "GUNX2");
509
state->m_lghost_value = state->ioport(state->m_lghost_select ? "GUNX3" : "GUNX2")->read();
533
return (input_port_read(space->machine(), "TRACKX1") - state->m_wwally_last_x[0]) & 0xff;
533
return (state->ioport("TRACKX1")->read() - state->m_wwally_last_x[0]) & 0xff;
536
return (input_port_read(space->machine(), "TRACKY1") - state->m_wwally_last_y[0]) & 0xff;
536
return (state->ioport("TRACKY1")->read() - state->m_wwally_last_y[0]) & 0xff;
539
return (input_port_read(space->machine(), "TRACKX2") - state->m_wwally_last_x[1]) & 0xff;
539
return (state->ioport("TRACKX2")->read() - state->m_wwally_last_x[1]) & 0xff;
542
return (input_port_read(space->machine(), "TRACKY2") - state->m_wwally_last_y[1]) & 0xff;
542
return (state->ioport("TRACKY2")->read() - state->m_wwally_last_y[1]) & 0xff;
545
return (input_port_read(space->machine(), "TRACKX3") - state->m_wwally_last_x[2]) & 0xff;
545
return (state->ioport("TRACKX3")->read() - state->m_wwally_last_x[2]) & 0xff;
548
return (input_port_read(space->machine(), "TRACKY3") - state->m_wwally_last_y[2]) & 0xff;
548
return (state->ioport("TRACKY3")->read() - state->m_wwally_last_y[2]) & 0xff;
550
550
return segaic16_open_bus_r(space, 0, mem_mask);
562
state->m_wwally_last_x[0] = input_port_read(space->machine(), "TRACKX1");
563
state->m_wwally_last_y[0] = input_port_read(space->machine(), "TRACKY1");
562
state->m_wwally_last_x[0] = state->ioport("TRACKX1")->read();
563
state->m_wwally_last_y[0] = state->ioport("TRACKY1")->read();
568
state->m_wwally_last_x[1] = input_port_read(space->machine(), "TRACKX2");
569
state->m_wwally_last_y[1] = input_port_read(space->machine(), "TRACKY2");
568
state->m_wwally_last_x[1] = state->ioport("TRACKX2")->read();
569
state->m_wwally_last_y[1] = state->ioport("TRACKY2")->read();
574
state->m_wwally_last_x[2] = input_port_read(space->machine(), "TRACKX3");
575
state->m_wwally_last_y[2] = input_port_read(space->machine(), "TRACKY3");
574
state->m_wwally_last_x[2] = state->ioport("TRACKX3")->read();
575
state->m_wwally_last_y[2] = state->ioport("TRACKY3")->read();
607
607
*************************************/
609
static ADDRESS_MAP_START( system18_map, AS_PROGRAM, 16 )
609
static ADDRESS_MAP_START( system18_map, AS_PROGRAM, 16, segas1x_state )
610
610
ADDRESS_MAP_UNMAP_HIGH
611
AM_RANGE(0x000000, 0xffffff) AM_READWRITE(segaic16_memory_mapper_lsb_r, segaic16_memory_mapper_lsb_w)
611
AM_RANGE(0x000000, 0xffffff) AM_READWRITE_LEGACY(segaic16_memory_mapper_lsb_r, segaic16_memory_mapper_lsb_w)
620
620
*************************************/
622
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
622
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, segas1x_state )
623
623
ADDRESS_MAP_UNMAP_HIGH
624
624
AM_RANGE(0x0000, 0x9fff) AM_ROM AM_REGION("soundcpu", 0x10000)
625
625
AM_RANGE(0xa000, 0xbfff) AM_ROMBANK("bank1")
626
AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x0ff0) AM_DEVWRITE("rfsnd", rf5c68_w)
627
AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE("rfsnd", rf5c68_mem_r, rf5c68_mem_w)
626
AM_RANGE(0xc000, 0xc00f) AM_MIRROR(0x0ff0) AM_DEVWRITE_LEGACY("rfsnd", rf5c68_w)
627
AM_RANGE(0xd000, 0xdfff) AM_DEVREADWRITE_LEGACY("rfsnd", rf5c68_mem_r, rf5c68_mem_w)
628
628
AM_RANGE(0xe000, 0xffff) AM_RAM
631
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8 )
631
static ADDRESS_MAP_START( sound_portmap, AS_IO, 8, segas1x_state )
632
632
ADDRESS_MAP_UNMAP_HIGH
633
633
ADDRESS_MAP_GLOBAL_MASK(0xff)
634
AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE("ym1", ym3438_r, ym3438_w)
635
AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_DEVREADWRITE("ym2", ym3438_r, ym3438_w)
636
AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE(soundbank_w)
637
AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_READWRITE(soundlatch_r, mcu_data_w)
634
AM_RANGE(0x80, 0x83) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym1", ym3438_r, ym3438_w)
635
AM_RANGE(0x90, 0x93) AM_MIRROR(0x0c) AM_DEVREADWRITE_LEGACY("ym2", ym3438_r, ym3438_w)
636
AM_RANGE(0xa0, 0xa0) AM_MIRROR(0x1f) AM_WRITE_LEGACY(soundbank_w)
637
AM_RANGE(0xc0, 0xc0) AM_MIRROR(0x1f) AM_READ(soundlatch_byte_r) AM_WRITE_LEGACY(mcu_data_w)
646
646
*************************************/
648
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8 )
648
static ADDRESS_MAP_START( mcu_io_map, AS_IO, 8, segas1x_state )
649
649
ADDRESS_MAP_UNMAP_HIGH
650
650
/* port 2 not used for high order address byte */
651
AM_RANGE(0x0000, 0x001f) AM_MIRROR(0xff00) AM_READWRITE(segaic16_memory_mapper_r, segaic16_memory_mapper_w)
651
AM_RANGE(0x0000, 0x001f) AM_MIRROR(0xff00) AM_READWRITE_LEGACY(segaic16_memory_mapper_r, segaic16_memory_mapper_w)