summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/harddriv.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/harddriv.cpp')
-rw-r--r--src/mame/drivers/harddriv.cpp315
1 files changed, 166 insertions, 149 deletions
diff --git a/src/mame/drivers/harddriv.cpp b/src/mame/drivers/harddriv.cpp
index 7bb67bd0893..f5137f03232 100644
--- a/src/mame/drivers/harddriv.cpp
+++ b/src/mame/drivers/harddriv.cpp
@@ -539,45 +539,48 @@ public:
};
-ADDRESS_MAP_START(harddriv_state::driver_68k_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x000000, 0x0fffff) AM_ROM
- AM_RANGE(0x600000, 0x603fff) AM_READ(hd68k_port0_r)
- AM_RANGE(0x604000, 0x607fff) AM_WRITE(hd68k_nwr_w)
- AM_RANGE(0x608000, 0x60bfff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0x60c000, 0x60ffff) AM_WRITE(hd68k_irq_ack_w)
- AM_RANGE(0xa00000, 0xa7ffff) AM_WRITE(hd68k_wr0_write)
- AM_RANGE(0xa80000, 0xafffff) AM_READ(hd68k_a80000_r) AM_WRITE(hd68k_wr1_write)
- AM_RANGE(0xb00000, 0xb7ffff) AM_READWRITE(hd68k_adc8_r, hd68k_wr2_write)
- AM_RANGE(0xb80000, 0xbfffff) AM_READWRITE(hd68k_adc12_r, hd68k_adc_control_w)
- AM_RANGE(0xc00000, 0xc03fff) AM_READWRITE(hd68k_gsp_io_r, hd68k_gsp_io_w)
- AM_RANGE(0xc04000, 0xc07fff) AM_READWRITE(hd68k_msp_io_r, hd68k_msp_io_w)
- AM_RANGE(0xff0000, 0xff001f) AM_DEVREADWRITE8("duartn68681", mc68681_device, read, write, 0xff00)
- AM_RANGE(0xff4000, 0xff4fff) AM_READWRITE(hd68k_zram_r, hd68k_zram_w)
- AM_RANGE(0xff8000, 0xffffff) AM_RAM
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(harddriv_state::driver_gsp_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00000000, 0x0000200f) AM_NOP /* hit during self-test */
- AM_RANGE(0x02000000, 0x0207ffff) AM_READWRITE(hdgsp_vram_2bpp_r, hdgsp_vram_1bpp_w)
- AM_RANGE(0xc0000000, 0xc00001ff) AM_DEVREADWRITE("gsp", tms34010_device, io_register_r, io_register_w)
- AM_RANGE(0xf4000000, 0xf40000ff) AM_READWRITE(hdgsp_control_lo_r, hdgsp_control_lo_w) AM_SHARE("gsp_control_lo")
- AM_RANGE(0xf4800000, 0xf48000ff) AM_READWRITE(hdgsp_control_hi_r, hdgsp_control_hi_w) AM_SHARE("gsp_control_hi")
- AM_RANGE(0xf5000000, 0xf5000fff) AM_READWRITE(hdgsp_paletteram_lo_r, hdgsp_paletteram_lo_w) AM_SHARE("gsp_palram_lo")
- AM_RANGE(0xf5800000, 0xf5800fff) AM_READWRITE(hdgsp_paletteram_hi_r, hdgsp_paletteram_hi_w) AM_SHARE("gsp_palram_hi")
- AM_RANGE(0xff800000, 0xffffffff) AM_RAM AM_SHARE("gsp_vram")
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(harddriv_state::driver_msp_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00000000, 0x000fffff) AM_RAM AM_SHARE("msp_ram")
- AM_RANGE(0x00700000, 0x007fffff) AM_RAM AM_SHARE("msp_ram")
- AM_RANGE(0xc0000000, 0xc00001ff) AM_DEVREADWRITE("msp", tms34010_device, io_register_r, io_register_w)
- AM_RANGE(0xfff00000, 0xffffffff) AM_RAM AM_SHARE("msp_ram")
-ADDRESS_MAP_END
+void harddriv_state::driver_68k_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x000000, 0x0fffff).rom();
+ map(0x600000, 0x603fff).r(this, FUNC(harddriv_state::hd68k_port0_r));
+ map(0x604000, 0x607fff).w(this, FUNC(harddriv_state::hd68k_nwr_w));
+ map(0x608000, 0x60bfff).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
+ map(0x60c000, 0x60ffff).w(this, FUNC(harddriv_state::hd68k_irq_ack_w));
+ map(0xa00000, 0xa7ffff).w(this, FUNC(harddriv_state::hd68k_wr0_write));
+ map(0xa80000, 0xafffff).r(this, FUNC(harddriv_state::hd68k_a80000_r)).w(this, FUNC(harddriv_state::hd68k_wr1_write));
+ map(0xb00000, 0xb7ffff).rw(this, FUNC(harddriv_state::hd68k_adc8_r), FUNC(harddriv_state::hd68k_wr2_write));
+ map(0xb80000, 0xbfffff).rw(this, FUNC(harddriv_state::hd68k_adc12_r), FUNC(harddriv_state::hd68k_adc_control_w));
+ map(0xc00000, 0xc03fff).rw(this, FUNC(harddriv_state::hd68k_gsp_io_r), FUNC(harddriv_state::hd68k_gsp_io_w));
+ map(0xc04000, 0xc07fff).rw(this, FUNC(harddriv_state::hd68k_msp_io_r), FUNC(harddriv_state::hd68k_msp_io_w));
+ map(0xff0000, 0xff001f).rw("duartn68681", FUNC(mc68681_device::read), FUNC(mc68681_device::write)).umask16(0xff00);
+ map(0xff4000, 0xff4fff).rw(this, FUNC(harddriv_state::hd68k_zram_r), FUNC(harddriv_state::hd68k_zram_w));
+ map(0xff8000, 0xffffff).ram();
+}
+
+
+void harddriv_state::driver_gsp_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00000000, 0x0000200f).noprw(); /* hit during self-test */
+ map(0x02000000, 0x0207ffff).rw(this, FUNC(harddriv_state::hdgsp_vram_2bpp_r), FUNC(harddriv_state::hdgsp_vram_1bpp_w));
+ map(0xc0000000, 0xc00001ff).rw("gsp", FUNC(tms34010_device::io_register_r), FUNC(tms34010_device::io_register_w));
+ map(0xf4000000, 0xf40000ff).rw(this, FUNC(harddriv_state::hdgsp_control_lo_r), FUNC(harddriv_state::hdgsp_control_lo_w)).share("gsp_control_lo");
+ map(0xf4800000, 0xf48000ff).rw(this, FUNC(harddriv_state::hdgsp_control_hi_r), FUNC(harddriv_state::hdgsp_control_hi_w)).share("gsp_control_hi");
+ map(0xf5000000, 0xf5000fff).rw(this, FUNC(harddriv_state::hdgsp_paletteram_lo_r), FUNC(harddriv_state::hdgsp_paletteram_lo_w)).share("gsp_palram_lo");
+ map(0xf5800000, 0xf5800fff).rw(this, FUNC(harddriv_state::hdgsp_paletteram_hi_r), FUNC(harddriv_state::hdgsp_paletteram_hi_w)).share("gsp_palram_hi");
+ map(0xff800000, 0xffffffff).ram().share("gsp_vram");
+}
+
+
+void harddriv_state::driver_msp_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00000000, 0x000fffff).ram().share("msp_ram");
+ map(0x00700000, 0x007fffff).ram().share("msp_ram");
+ map(0xc0000000, 0xc00001ff).rw("msp", FUNC(tms34010_device::io_register_r), FUNC(tms34010_device::io_register_w));
+ map(0xfff00000, 0xffffffff).ram().share("msp_ram");
+}
@@ -587,35 +590,37 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(harddriv_state::multisync_68k_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x000000, 0x0fffff) AM_ROM
- AM_RANGE(0x604000, 0x607fff) AM_READWRITE(hd68k_sound_reset_r, hd68k_nwr_w)
- AM_RANGE(0x608000, 0x60bfff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE(hd68k_port0_r, hd68k_irq_ack_w)
- AM_RANGE(0xa00000, 0xa7ffff) AM_WRITE(hd68k_wr0_write)
- AM_RANGE(0xa80000, 0xafffff) AM_READ(hd68k_a80000_r) AM_WRITE(hd68k_wr1_write)
- AM_RANGE(0xb00000, 0xb7ffff) AM_READWRITE(hd68k_adc8_r, hd68k_wr2_write)
- AM_RANGE(0xb80000, 0xbfffff) AM_READWRITE(hd68k_adc12_r, hd68k_adc_control_w)
- AM_RANGE(0xc00000, 0xc03fff) AM_READWRITE(hd68k_gsp_io_r, hd68k_gsp_io_w)
- AM_RANGE(0xc04000, 0xc07fff) AM_READWRITE(hd68k_msp_io_r, hd68k_msp_io_w)
- AM_RANGE(0xff0000, 0xff001f) AM_DEVREADWRITE8("duartn68681", mc68681_device, read, write, 0xff00)
- AM_RANGE(0xff4000, 0xff4fff) AM_READWRITE(hd68k_zram_r, hd68k_zram_w)
- AM_RANGE(0xff8000, 0xffffff) AM_RAM
-ADDRESS_MAP_END
-
-
-ADDRESS_MAP_START(harddriv_state::multisync_gsp_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00000000, 0x0000200f) AM_NOP /* hit during self-test */
- AM_RANGE(0x02000000, 0x020fffff) AM_READWRITE(hdgsp_vram_2bpp_r, hdgsp_vram_2bpp_w)
- AM_RANGE(0xc0000000, 0xc00001ff) AM_DEVREAD("gsp", tms34010_device, io_register_r) AM_WRITE(hdgsp_io_w)
- AM_RANGE(0xf4000000, 0xf40000ff) AM_READWRITE(hdgsp_control_lo_r, hdgsp_control_lo_w) AM_SHARE("gsp_control_lo")
- AM_RANGE(0xf4800000, 0xf48000ff) AM_READWRITE(hdgsp_control_hi_r, hdgsp_control_hi_w) AM_SHARE("gsp_control_hi")
- AM_RANGE(0xf5000000, 0xf5000fff) AM_READWRITE(hdgsp_paletteram_lo_r, hdgsp_paletteram_lo_w) AM_SHARE("gsp_palram_lo")
- AM_RANGE(0xf5800000, 0xf5800fff) AM_READWRITE(hdgsp_paletteram_hi_r, hdgsp_paletteram_hi_w) AM_SHARE("gsp_palram_hi")
- AM_RANGE(0xff800000, 0xffbfffff) AM_MIRROR(0x0400000) AM_RAM AM_SHARE("gsp_vram")
-ADDRESS_MAP_END
+void harddriv_state::multisync_68k_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x000000, 0x0fffff).rom();
+ map(0x604000, 0x607fff).rw(this, FUNC(harddriv_state::hd68k_sound_reset_r), FUNC(harddriv_state::hd68k_nwr_w));
+ map(0x608000, 0x60bfff).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
+ map(0x60c000, 0x60ffff).rw(this, FUNC(harddriv_state::hd68k_port0_r), FUNC(harddriv_state::hd68k_irq_ack_w));
+ map(0xa00000, 0xa7ffff).w(this, FUNC(harddriv_state::hd68k_wr0_write));
+ map(0xa80000, 0xafffff).r(this, FUNC(harddriv_state::hd68k_a80000_r)).w(this, FUNC(harddriv_state::hd68k_wr1_write));
+ map(0xb00000, 0xb7ffff).rw(this, FUNC(harddriv_state::hd68k_adc8_r), FUNC(harddriv_state::hd68k_wr2_write));
+ map(0xb80000, 0xbfffff).rw(this, FUNC(harddriv_state::hd68k_adc12_r), FUNC(harddriv_state::hd68k_adc_control_w));
+ map(0xc00000, 0xc03fff).rw(this, FUNC(harddriv_state::hd68k_gsp_io_r), FUNC(harddriv_state::hd68k_gsp_io_w));
+ map(0xc04000, 0xc07fff).rw(this, FUNC(harddriv_state::hd68k_msp_io_r), FUNC(harddriv_state::hd68k_msp_io_w));
+ map(0xff0000, 0xff001f).rw("duartn68681", FUNC(mc68681_device::read), FUNC(mc68681_device::write)).umask16(0xff00);
+ map(0xff4000, 0xff4fff).rw(this, FUNC(harddriv_state::hd68k_zram_r), FUNC(harddriv_state::hd68k_zram_w));
+ map(0xff8000, 0xffffff).ram();
+}
+
+
+void harddriv_state::multisync_gsp_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00000000, 0x0000200f).noprw(); /* hit during self-test */
+ map(0x02000000, 0x020fffff).rw(this, FUNC(harddriv_state::hdgsp_vram_2bpp_r), FUNC(harddriv_state::hdgsp_vram_2bpp_w));
+ map(0xc0000000, 0xc00001ff).r("gsp", FUNC(tms34010_device::io_register_r)).w(this, FUNC(harddriv_state::hdgsp_io_w));
+ map(0xf4000000, 0xf40000ff).rw(this, FUNC(harddriv_state::hdgsp_control_lo_r), FUNC(harddriv_state::hdgsp_control_lo_w)).share("gsp_control_lo");
+ map(0xf4800000, 0xf48000ff).rw(this, FUNC(harddriv_state::hdgsp_control_hi_r), FUNC(harddriv_state::hdgsp_control_hi_w)).share("gsp_control_hi");
+ map(0xf5000000, 0xf5000fff).rw(this, FUNC(harddriv_state::hdgsp_paletteram_lo_r), FUNC(harddriv_state::hdgsp_paletteram_lo_w)).share("gsp_palram_lo");
+ map(0xf5800000, 0xf5800fff).rw(this, FUNC(harddriv_state::hdgsp_paletteram_hi_r), FUNC(harddriv_state::hdgsp_paletteram_hi_w)).share("gsp_palram_hi");
+ map(0xff800000, 0xffbfffff).mirror(0x0400000).ram().share("gsp_vram");
+}
@@ -625,36 +630,38 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(harddriv_state::multisync2_68k_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x000000, 0x1fffff) AM_ROM
- AM_RANGE(0x604000, 0x607fff) AM_WRITE(hd68k_nwr_w)
- AM_RANGE(0x608000, 0x60bfff) AM_DEVWRITE("watchdog", watchdog_timer_device, reset16_w)
- AM_RANGE(0x60c000, 0x60ffff) AM_READWRITE(hd68k_port0_r, hd68k_irq_ack_w)
- AM_RANGE(0xa00000, 0xa7ffff) AM_WRITE(hd68k_wr0_write)
- AM_RANGE(0xa80000, 0xafffff) AM_READ(hd68k_a80000_r) AM_WRITE(hd68k_wr1_write)
- AM_RANGE(0xb00000, 0xb7ffff) AM_READWRITE(hd68k_adc8_r, hd68k_wr2_write)
- AM_RANGE(0xb80000, 0xbfffff) AM_READWRITE(hd68k_adc12_r, hd68k_adc_control_w)
- AM_RANGE(0xc00000, 0xc03fff) AM_READWRITE(hd68k_gsp_io_r, hd68k_gsp_io_w)
- AM_RANGE(0xc04000, 0xc07fff) AM_READWRITE(hd68k_msp_io_r, hd68k_msp_io_w)
- AM_RANGE(0xfc0000, 0xfc001f) AM_DEVREADWRITE8("duartn68681", mc68681_device, read, write, 0xff00)
- AM_RANGE(0xfd0000, 0xfd0fff) AM_MIRROR(0x004000) AM_READWRITE(hd68k_zram_r, hd68k_zram_w)
- AM_RANGE(0xff0000, 0xffffff) AM_RAM
-ADDRESS_MAP_END
+void harddriv_state::multisync2_68k_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x000000, 0x1fffff).rom();
+ map(0x604000, 0x607fff).w(this, FUNC(harddriv_state::hd68k_nwr_w));
+ map(0x608000, 0x60bfff).w("watchdog", FUNC(watchdog_timer_device::reset16_w));
+ map(0x60c000, 0x60ffff).rw(this, FUNC(harddriv_state::hd68k_port0_r), FUNC(harddriv_state::hd68k_irq_ack_w));
+ map(0xa00000, 0xa7ffff).w(this, FUNC(harddriv_state::hd68k_wr0_write));
+ map(0xa80000, 0xafffff).r(this, FUNC(harddriv_state::hd68k_a80000_r)).w(this, FUNC(harddriv_state::hd68k_wr1_write));
+ map(0xb00000, 0xb7ffff).rw(this, FUNC(harddriv_state::hd68k_adc8_r), FUNC(harddriv_state::hd68k_wr2_write));
+ map(0xb80000, 0xbfffff).rw(this, FUNC(harddriv_state::hd68k_adc12_r), FUNC(harddriv_state::hd68k_adc_control_w));
+ map(0xc00000, 0xc03fff).rw(this, FUNC(harddriv_state::hd68k_gsp_io_r), FUNC(harddriv_state::hd68k_gsp_io_w));
+ map(0xc04000, 0xc07fff).rw(this, FUNC(harddriv_state::hd68k_msp_io_r), FUNC(harddriv_state::hd68k_msp_io_w));
+ map(0xfc0000, 0xfc001f).rw("duartn68681", FUNC(mc68681_device::read), FUNC(mc68681_device::write)).umask16(0xff00);
+ map(0xfd0000, 0xfd0fff).mirror(0x004000).rw(this, FUNC(harddriv_state::hd68k_zram_r), FUNC(harddriv_state::hd68k_zram_w));
+ map(0xff0000, 0xffffff).ram();
+}
/* GSP is identical to original multisync */
-ADDRESS_MAP_START(harddriv_state::multisync2_gsp_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x00000000, 0x0000200f) AM_NOP /* hit during self-test */
- AM_RANGE(0x02000000, 0x020fffff) AM_READWRITE(hdgsp_vram_2bpp_r, hdgsp_vram_2bpp_w)
- AM_RANGE(0xc0000000, 0xc00001ff) AM_DEVREAD("gsp", tms34010_device, io_register_r) AM_WRITE(hdgsp_io_w)
- AM_RANGE(0xf4000000, 0xf40000ff) AM_READWRITE(hdgsp_control_lo_r, hdgsp_control_lo_w) AM_SHARE("gsp_control_lo")
- AM_RANGE(0xf4800000, 0xf48000ff) AM_READWRITE(hdgsp_control_hi_r, hdgsp_control_hi_w) AM_SHARE("gsp_control_hi")
- AM_RANGE(0xf5000000, 0xf5000fff) AM_READWRITE(hdgsp_paletteram_lo_r, hdgsp_paletteram_lo_w) AM_SHARE("gsp_palram_lo")
- AM_RANGE(0xf5800000, 0xf5800fff) AM_READWRITE(hdgsp_paletteram_hi_r, hdgsp_paletteram_hi_w) AM_SHARE("gsp_palram_hi")
- AM_RANGE(0xff800000, 0xffffffff) AM_RAM AM_SHARE("gsp_vram")
-ADDRESS_MAP_END
+void harddriv_state::multisync2_gsp_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x00000000, 0x0000200f).noprw(); /* hit during self-test */
+ map(0x02000000, 0x020fffff).rw(this, FUNC(harddriv_state::hdgsp_vram_2bpp_r), FUNC(harddriv_state::hdgsp_vram_2bpp_w));
+ map(0xc0000000, 0xc00001ff).r("gsp", FUNC(tms34010_device::io_register_r)).w(this, FUNC(harddriv_state::hdgsp_io_w));
+ map(0xf4000000, 0xf40000ff).rw(this, FUNC(harddriv_state::hdgsp_control_lo_r), FUNC(harddriv_state::hdgsp_control_lo_w)).share("gsp_control_lo");
+ map(0xf4800000, 0xf48000ff).rw(this, FUNC(harddriv_state::hdgsp_control_hi_r), FUNC(harddriv_state::hdgsp_control_hi_w)).share("gsp_control_hi");
+ map(0xf5000000, 0xf5000fff).rw(this, FUNC(harddriv_state::hdgsp_paletteram_lo_r), FUNC(harddriv_state::hdgsp_paletteram_lo_w)).share("gsp_palram_lo");
+ map(0xf5800000, 0xf5800fff).rw(this, FUNC(harddriv_state::hdgsp_paletteram_hi_r), FUNC(harddriv_state::hdgsp_paletteram_hi_w)).share("gsp_palram_hi");
+ map(0xff800000, 0xffffffff).ram().share("gsp_vram");
+}
@@ -664,18 +671,20 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(harddriv_state::adsp_program_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("adsp_pgm_memory")
- AM_RANGE(0x2000, 0x3fff) AM_READNOP // ROM?
-ADDRESS_MAP_END
+void harddriv_state::adsp_program_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x1fff).ram().share("adsp_pgm_memory");
+ map(0x2000, 0x3fff).nopr(); // ROM?
+}
-ADDRESS_MAP_START(harddriv_state::adsp_data_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("adsp_data")
- AM_RANGE(0x2000, 0x2fff) AM_READWRITE(hdadsp_special_r, hdadsp_special_w)
-ADDRESS_MAP_END
+void harddriv_state::adsp_data_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x1fff).ram().share("adsp_data");
+ map(0x2000, 0x2fff).rw(this, FUNC(harddriv_state::hdadsp_special_r), FUNC(harddriv_state::hdadsp_special_w));
+}
@@ -685,45 +694,51 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(harddriv_state::ds3_program_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE("adsp_pgm_memory")
-ADDRESS_MAP_END
+void harddriv_state::ds3_program_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x3fff).ram().share("adsp_pgm_memory");
+}
-ADDRESS_MAP_START(harddriv_state::ds3_data_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x1fff) AM_RAM AM_SHARE("adsp_data")
- AM_RANGE(0x2000, 0x3fff) AM_READWRITE(hdds3_special_r, hdds3_special_w)
- AM_RANGE(0x3800, 0x3bff) AM_RAM /* internal RAM */
- AM_RANGE(0x3fe0, 0x3fff) AM_READWRITE(hdds3_control_r, hdds3_control_w) /* adsp control regs */
-ADDRESS_MAP_END
+void harddriv_state::ds3_data_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x1fff).ram().share("adsp_data");
+ map(0x2000, 0x3fff).rw(this, FUNC(harddriv_state::hdds3_special_r), FUNC(harddriv_state::hdds3_special_w));
+ map(0x3800, 0x3bff).ram(); /* internal RAM */
+ map(0x3fe0, 0x3fff).rw(this, FUNC(harddriv_state::hdds3_control_r), FUNC(harddriv_state::hdds3_control_w)); /* adsp control regs */
+}
-ADDRESS_MAP_START(harddriv_state::ds3sdsp_program_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE("ds3sdsp_pgm")
-ADDRESS_MAP_END
+void harddriv_state::ds3sdsp_program_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x3fff).ram().share("ds3sdsp_pgm");
+}
-ADDRESS_MAP_START(harddriv_state::ds3sdsp_data_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x2000, 0x3fff) AM_READWRITE(hdds3_sdsp_special_r, hdds3_sdsp_special_w)
- AM_RANGE(0x3800, 0x39ff) AM_RAM /* internal RAM */
- AM_RANGE(0x3fe0, 0x3fff) AM_READWRITE(hdds3_sdsp_control_r, hdds3_sdsp_control_w)
-ADDRESS_MAP_END
+void harddriv_state::ds3sdsp_data_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x2000, 0x3fff).rw(this, FUNC(harddriv_state::hdds3_sdsp_special_r), FUNC(harddriv_state::hdds3_sdsp_special_w));
+ map(0x3800, 0x39ff).ram(); /* internal RAM */
+ map(0x3fe0, 0x3fff).rw(this, FUNC(harddriv_state::hdds3_sdsp_control_r), FUNC(harddriv_state::hdds3_sdsp_control_w));
+}
-ADDRESS_MAP_START(harddriv_state::ds3xdsp_program_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x3fff) AM_RAM AM_SHARE("ds3xdsp_pgm")
-ADDRESS_MAP_END
+void harddriv_state::ds3xdsp_program_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x3fff).ram().share("ds3xdsp_pgm");
+}
-ADDRESS_MAP_START(harddriv_state::ds3xdsp_data_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x0000, 0x1fff) AM_RAM // TODO
- AM_RANGE(0x3800, 0x39ff) AM_RAM /* internal RAM */
- AM_RANGE(0x3fe0, 0x3fff) AM_READWRITE(hdds3_xdsp_control_r, hdds3_xdsp_control_w)
-ADDRESS_MAP_END
+void harddriv_state::ds3xdsp_data_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x0000, 0x1fff).ram(); // TODO
+ map(0x3800, 0x39ff).ram(); /* internal RAM */
+ map(0x3fe0, 0x3fff).rw(this, FUNC(harddriv_state::hdds3_xdsp_control_r), FUNC(harddriv_state::hdds3_xdsp_control_w));
+}
@@ -733,12 +748,13 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(harddriv_state::dsk_dsp32_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x000000, 0x001fff) AM_RAM
- AM_RANGE(0x600000, 0x63ffff) AM_RAM AM_SHARE("dsp32_ram")
- AM_RANGE(0xfff800, 0xffffff) AM_RAM
-ADDRESS_MAP_END
+void harddriv_state::dsk_dsp32_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x000000, 0x001fff).ram();
+ map(0x600000, 0x63ffff).ram().share("dsp32_ram");
+ map(0xfff800, 0xffffff).ram();
+}
@@ -748,13 +764,14 @@ ADDRESS_MAP_END
*
*************************************/
-ADDRESS_MAP_START(harddriv_state::dsk2_dsp32_map)
- ADDRESS_MAP_UNMAP_HIGH
- AM_RANGE(0x000000, 0x001fff) AM_RAM
- AM_RANGE(0x200000, 0x23ffff) AM_RAM
- AM_RANGE(0x400000, 0x5fffff) AM_ROM AM_REGION("user4", 0)
- AM_RANGE(0xfff800, 0xffffff) AM_RAM
-ADDRESS_MAP_END
+void harddriv_state::dsk2_dsp32_map(address_map &map)
+{
+ map.unmap_value_high();
+ map(0x000000, 0x001fff).ram();
+ map(0x200000, 0x23ffff).ram();
+ map(0x400000, 0x5fffff).rom().region("user4", 0);
+ map(0xfff800, 0xffffff).ram();
+}
/*************************************
5ab45b8cb6bb21119c00b8'>src/emu/cpu/tms32025/tms32025.c2
-rw-r--r--src/emu/cpu/tms32031/32031ops.c4
-rw-r--r--src/emu/cpu/tms32031/tms32031.c6
-rw-r--r--src/emu/cpu/tms34010/34010gfx.c2
-rw-r--r--src/emu/cpu/tms34010/34010ops.c2
-rw-r--r--src/emu/cpu/tms34010/tms34010.c30
-rw-r--r--src/emu/cpu/tms9900/99xxcore.h4
-rwxr-xr-xsrc/emu/cpu/upd7725/upd7725.c6
-rw-r--r--src/emu/cpu/vtlb.c16
-rw-r--r--src/emu/cpu/z180/z180.c4
-rw-r--r--src/emu/cpu/z8/z8.c4
-rw-r--r--src/emu/cpu/z80/z80daisy.c2
-rw-r--r--src/emu/crsshair.c40
-rw-r--r--src/emu/crsshair.h10
-rw-r--r--src/emu/debug/debugcmd.c278
-rw-r--r--src/emu/debug/debugcmd.h8
-rw-r--r--src/emu/debug/debugcon.c36
-rw-r--r--src/emu/debug/debugcon.h14
-rw-r--r--src/emu/debug/debugcpu.c258
-rw-r--r--src/emu/debug/debugcpu.h20
-rw-r--r--src/emu/debug/debugvw.c30
-rw-r--r--src/emu/debug/dvdisasm.c14
-rw-r--r--src/emu/debug/dvmemory.c12
-rw-r--r--src/emu/debug/dvstate.c18
-rw-r--r--src/emu/debugger.c20
-rw-r--r--src/emu/debugger.h22
-rw-r--r--src/emu/debugint/debugint.c104
-rw-r--r--src/emu/debugint/debugint.h4
-rw-r--r--src/emu/devcb.c16
-rw-r--r--src/emu/devcb.h4
-rw-r--r--src/emu/devcpu.c2
-rw-r--r--src/emu/devcpu.h4
-rw-r--r--src/emu/devimage.c8
-rw-r--r--src/emu/devintrf.c21
-rw-r--r--src/emu/devintrf.h14
-rw-r--r--src/emu/devlegcy.c2
-rw-r--r--src/emu/diexec.c24
-rw-r--r--src/emu/diexec.h8
-rw-r--r--src/emu/diimage.c14
-rw-r--r--src/emu/disound.c24
-rw-r--r--src/emu/distate.c2
-rw-r--r--src/emu/drawgfx.c70
-rw-r--r--src/emu/drawgfx.h10
-rw-r--r--src/emu/driver.h6
-rw-r--r--src/emu/drivers/empty.c2
-rw-r--r--src/emu/emucore.h4
-rw-r--r--src/emu/emuopts.c2
-rw-r--r--src/emu/emupal.c143
-rw-r--r--src/emu/emupal.h36
-rw-r--r--src/emu/image.c58
-rw-r--r--src/emu/image.h8
-rw-r--r--src/emu/imagedev/bitbngr.c6
-rw-r--r--src/emu/imagedev/bitbngr.h2
-rw-r--r--src/emu/imagedev/cartslot.c14
-rw-r--r--src/emu/imagedev/cassette.c16
-rw-r--r--src/emu/imagedev/cassimg.c10
-rw-r--r--src/emu/imagedev/cassimg.h10
-rw-r--r--src/emu/imagedev/chd_cd.c2
-rw-r--r--src/emu/imagedev/flopdrv.c30
-rw-r--r--src/emu/imagedev/flopdrv.h6
-rw-r--r--src/emu/imagedev/snapquik.c10
-rw-r--r--src/emu/imagedev/snapquik.h4
-rw-r--r--src/emu/inptport.c482
-rw-r--r--src/emu/inptport.h65
-rw-r--r--src/emu/input.c148
-rw-r--r--src/emu/input.h30
-rw-r--r--src/emu/inputseq.c14
-rw-r--r--src/emu/inputseq.h14
-rw-r--r--src/emu/machine.c90
-rw-r--r--src/emu/machine.h32
-rw-r--r--src/emu/machine/53c810.c30
-rw-r--r--src/emu/machine/53c810.h10
-rw-r--r--src/emu/machine/6526cia.c2
-rw-r--r--src/emu/machine/6532riot.c2
-rw-r--r--src/emu/machine/6821pia.c2
-rw-r--r--src/emu/machine/68681.c22
-rw-r--r--src/emu/machine/74123.c2
-rw-r--r--src/emu/machine/74181.c4
-rw-r--r--src/emu/machine/74181.h2
-rw-r--r--src/emu/machine/7474.c2
-rw-r--r--src/emu/machine/8042kbdc.c46
-rw-r--r--src/emu/machine/8042kbdc.h8
-rw-r--r--src/emu/machine/adc083x.c38
-rw-r--r--src/emu/machine/am53cf96.c8
-rw-r--r--src/emu/machine/am53cf96.h4
-rw-r--r--src/emu/machine/at28c16.c24
-rw-r--r--src/emu/machine/cdp1852.c2
-rw-r--r--src/emu/machine/cr589.c2
-rw-r--r--src/emu/machine/devhelpr.h2
-rw-r--r--src/emu/machine/ds1302.c2
-rw-r--r--src/emu/machine/ds2401.c4
-rw-r--r--src/emu/machine/ds2404.c2
-rw-r--r--src/emu/machine/eeprom.c10
-rw-r--r--src/emu/machine/er2055.c2
-rw-r--r--src/emu/machine/f3853.c2
-rw-r--r--src/emu/machine/generic.c148
-rw-r--r--src/emu/machine/generic.h28
-rw-r--r--src/emu/machine/i2cmem.c14
-rw-r--r--src/emu/machine/i8155.c2
-rw-r--r--src/emu/machine/i8355.c2
-rw-r--r--src/emu/machine/idectrl.c49
-rw-r--r--src/emu/machine/ins8250.c2
-rw-r--r--src/emu/machine/k033906.c4
-rw-r--r--src/emu/machine/k056230.c2
-rw-r--r--src/emu/machine/latch8.c10
-rw-r--r--src/emu/machine/ldcore.c68
-rw-r--r--src/emu/machine/ldpr8210.c14
-rw-r--r--src/emu/machine/ldv1000.c14
-rw-r--r--src/emu/machine/ldvp931.c16
-rw-r--r--src/emu/machine/mb3773.c2
-rw-r--r--src/emu/machine/mb87078.c2
-rw-r--r--src/emu/machine/mb87078.h2
-rw-r--r--src/emu/machine/mc146818.c4
-rw-r--r--src/emu/machine/microtch.c4
-rw-r--r--src/emu/machine/microtch.h6
-rw-r--r--src/emu/machine/msm6242.c8
-rw-r--r--src/emu/machine/nmc9306.c2
-rw-r--r--src/emu/machine/nvram.c2
-rw-r--r--src/emu/machine/pc16552d.c28
-rw-r--r--src/emu/machine/pc16552d.h4
-rw-r--r--src/emu/machine/pci.c13
-rw-r--r--src/emu/machine/pci.h2
-rw-r--r--src/emu/machine/pckeybrd.h6
-rw-r--r--src/emu/machine/pcshare.h2
-rw-r--r--src/emu/machine/pd4990a.c2
-rw-r--r--src/emu/machine/pic8259.c2
-rw-r--r--src/emu/machine/pit8253.c10
-rw-r--r--src/emu/machine/ram.c4
-rw-r--r--src/emu/machine/rtc65271.c8
-rw-r--r--src/emu/machine/s3c2400.c10
-rw-r--r--src/emu/machine/s3c2410.c10
-rw-r--r--src/emu/machine/s3c2440.c10
-rw-r--r--src/emu/machine/s3c24xx.c294
-rw-r--r--src/emu/machine/scsi.c8
-rw-r--r--src/emu/machine/scsi.h10
-rw-r--r--src/emu/machine/scsicd.c26
-rw-r--r--src/emu/machine/scsidev.c12
-rw-r--r--src/emu/machine/scsihd.c6
-rw-r--r--src/emu/machine/smc91c9x.c5
-rw-r--r--src/emu/machine/timekpr.c6
-rw-r--r--src/emu/machine/tmp68301.c32
-rw-r--r--src/emu/machine/tmp68301.h6
-rw-r--r--src/emu/machine/wd33c93.c26
-rw-r--r--src/emu/machine/wd33c93.h4
-rw-r--r--src/emu/machine/x2212.c2
-rw-r--r--src/emu/machine/x76f041.c4
-rw-r--r--src/emu/machine/x76f100.c4
-rw-r--r--src/emu/machine/z80ctc.c4
-rw-r--r--src/emu/machine/z80dart.c2
-rw-r--r--src/emu/machine/z80dma.c2
-rw-r--r--src/emu/machine/z80pio.c2
-rw-r--r--src/emu/machine/z80sio.c8
-rw-r--r--src/emu/machine/z80sti.c2
-rw-r--r--src/emu/mame.c4
-rw-r--r--src/emu/mame.h2
-rw-r--r--src/emu/mconfig.h8
-rw-r--r--src/emu/memory.c217
-rw-r--r--src/emu/memory.h20
-rw-r--r--src/emu/output.c8
-rw-r--r--src/emu/output.h2
-rw-r--r--src/emu/render.c50
-rw-r--r--src/emu/render.h4
-rw-r--r--src/emu/rendfont.c40
-rw-r--r--src/emu/rendlay.c20
-rw-r--r--src/emu/romload.c118
-rw-r--r--src/emu/romload.h8
-rw-r--r--src/emu/schedule.c4
-rw-r--r--src/emu/schedule.h8
-rw-r--r--src/emu/screen.c74
-rw-r--r--src/emu/screen.h10
-rw-r--r--src/emu/softlist.c88
-rw-r--r--src/emu/softlist.h2
-rw-r--r--src/emu/sound.c58
-rw-r--r--src/emu/sound.h4
-rw-r--r--src/emu/sound/2151intf.c4
-rw-r--r--src/emu/sound/2203intf.c8
-rw-r--r--src/emu/sound/2413intf.c4
-rw-r--r--src/emu/sound/2608intf.c8
-rw-r--r--src/emu/sound/2610intf.c12
-rw-r--r--src/emu/sound/2612intf.c8
-rw-r--r--src/emu/sound/262intf.c6
-rw-r--r--src/emu/sound/3526intf.c6
-rw-r--r--src/emu/sound/3812intf.c6
-rw-r--r--src/emu/sound/8950intf.c6
-rw-r--r--src/emu/sound/aica.c14
-rw-r--r--src/emu/sound/aicalfo.c4
-rw-r--r--src/emu/sound/asc.c4
-rw-r--r--src/emu/sound/astrocde.c2
-rw-r--r--src/emu/sound/ay8910.c8
-rw-r--r--src/emu/sound/beep.c2
-rw-r--r--src/emu/sound/bsmt2000.c2
-rw-r--r--src/emu/sound/c140.c4
-rw-r--r--src/emu/sound/c352.c2
-rw-r--r--src/emu/sound/c6280.c8
-rw-r--r--src/emu/sound/cdda.c8
-rw-r--r--src/emu/sound/cdda.h2
-rw-r--r--src/emu/sound/cdp1863.c4
-rw-r--r--src/emu/sound/cdp1864.c26
-rw-r--r--src/emu/sound/cdp1869.c6
-rw-r--r--src/emu/sound/cem3394.c6
-rw-r--r--src/emu/sound/dac.c2
-rw-r--r--src/emu/sound/digitalk.c4
-rw-r--r--src/emu/sound/disc_inp.c8
-rw-r--r--src/emu/sound/disc_wav.c2
-rw-r--r--src/emu/sound/discrete.c16
-rw-r--r--src/emu/sound/discrete.h2
-rw-r--r--src/emu/sound/dmadac.c4
-rw-r--r--src/emu/sound/es5503.c4
-rw-r--r--src/emu/sound/es5506.c60
-rw-r--r--src/emu/sound/es8712.c2
-rw-r--r--src/emu/sound/filter.c2
-rw-r--r--src/emu/sound/flt_rc.c4
-rw-r--r--src/emu/sound/flt_vol.c2
-rw-r--r--src/emu/sound/fm.c30
-rw-r--r--src/emu/sound/fm.h2
-rw-r--r--src/emu/sound/fm2612.c8
-rw-r--r--src/emu/sound/fmopl.c8
-rw-r--r--src/emu/sound/gaelco.c8
-rw-r--r--src/emu/sound/hc55516.c2
-rw-r--r--src/emu/sound/ics2115.c6
-rw-r--r--src/emu/sound/iremga20.c2
-rw-r--r--src/emu/sound/k005289.c8
-rw-r--r--src/emu/sound/k007232.c2
-rw-r--r--src/emu/sound/k051649.c8
-rw-r--r--src/emu/sound/k053260.c10
-rw-r--r--src/emu/sound/k054539.c24
-rw-r--r--src/emu/sound/k056800.c4
-rw-r--r--src/emu/sound/k056800.h2
-rw-r--r--src/emu/sound/mas3507d.c2
-rw-r--r--src/emu/sound/mos6560.c48
-rw-r--r--src/emu/sound/mos6560.h12
-rw-r--r--src/emu/sound/msm5205.c6
-rw-r--r--src/emu/sound/msm5232.c4
-rw-r--r--src/emu/sound/multipcm.c2
-rw-r--r--src/emu/sound/n63701x.c2
-rw-r--r--src/emu/sound/namco.c10
-rw-r--r--src/emu/sound/nes_apu.c8
-rw-r--r--src/emu/sound/nile.c2
-rw-r--r--src/emu/sound/okim6258.c2
-rw-r--r--src/emu/sound/okim6295.c4
-rw-r--r--src/emu/sound/okim6376.c2
-rw-r--r--src/emu/sound/okim9810.c2
-rw-r--r--src/emu/sound/pokey.c24
-rw-r--r--src/emu/sound/qsound.c4
-rw-r--r--src/emu/sound/rf5c400.c12
-rw-r--r--src/emu/sound/rf5c68.c2
-rw-r--r--src/emu/sound/s14001a.c2
-rw-r--r--src/emu/sound/s2636.c4
-rw-r--r--src/emu/sound/saa1099.c8
-rw-r--r--src/emu/sound/samples.c22
-rw-r--r--src/emu/sound/samples.h2
-rw-r--r--src/emu/sound/scsp.c24
-rw-r--r--src/emu/sound/scsplfo.c4
-rw-r--r--src/emu/sound/segapcm.c4
-rw-r--r--src/emu/sound/sid.c10
-rw-r--r--src/emu/sound/sid.h2
-rw-r--r--src/emu/sound/sid6581.c6
-rw-r--r--src/emu/sound/sidvoice.c2
-rw-r--r--src/emu/sound/sidvoice.h2
-rw-r--r--src/emu/sound/sn76477.c10
-rw-r--r--src/emu/sound/sn76496.c2
-rw-r--r--src/emu/sound/snkwave.c2
-rw-r--r--src/emu/sound/sp0250.c6
-rw-r--r--src/emu/sound/sp0256.c4
-rw-r--r--src/emu/sound/speaker.c8
-rw-r--r--src/emu/sound/spu.c26
-rw-r--r--src/emu/sound/st0016.c2
-rw-r--r--src/emu/sound/t6w28.c2
-rw-r--r--src/emu/sound/tiaintf.c2
-rw-r--r--src/emu/sound/tms3615.c2
-rw-r--r--src/emu/sound/tms36xx.c2
-rw-r--r--src/emu/sound/tms5110.c8
-rw-r--r--src/emu/sound/tms5220.c6
-rw-r--r--src/emu/sound/upd7759.c6
-rw-r--r--src/emu/sound/vlm5030.c8
-rw-r--r--src/emu/sound/votrax.c6
-rw-r--r--src/emu/sound/vrender0.c2
-rw-r--r--src/emu/sound/wave.c12
-rw-r--r--src/emu/sound/x1_010.c8
-rw-r--r--src/emu/sound/ym2151.c20
-rw-r--r--src/emu/sound/ym2413.c6
-rw-r--r--src/emu/sound/ymf262.c6
-rw-r--r--src/emu/sound/ymf271.c10
-rw-r--r--src/emu/sound/ymf278b.c16
-rw-r--r--src/emu/sound/ymz280b.c10
-rw-r--r--src/emu/sound/zsg2.c4
-rw-r--r--src/emu/speaker.c4
-rw-r--r--src/emu/state.c15
-rw-r--r--src/emu/state.h32
-rw-r--r--src/emu/tilemap.c138
-rw-r--r--src/emu/tilemap.h28
-rw-r--r--src/emu/timer.c4
-rw-r--r--src/emu/ui.c332
-rw-r--r--src/emu/ui.h18
-rw-r--r--src/emu/uigfx.c154
-rw-r--r--src/emu/uigfx.h4
-rw-r--r--src/emu/uiimage.c66
-rw-r--r--src/emu/uiimage.h8
-rw-r--r--src/emu/uiinput.c36
-rw-r--r--src/emu/uiinput.h26
-rw-r--r--src/emu/uimenu.c322
-rw-r--r--src/emu/uimenu.h20
-rw-r--r--src/emu/video.c18
-rw-r--r--src/emu/video.h2
-rw-r--r--src/emu/video/crt9007.c4
-rw-r--r--src/emu/video/crt9021.c4
-rw-r--r--src/emu/video/crt9212.c2
-rw-r--r--src/emu/video/generic.c320
-rw-r--r--src/emu/video/generic.h20
-rw-r--r--src/emu/video/hd61830.c4
-rw-r--r--src/emu/video/hd63484.c8
-rw-r--r--src/emu/video/mc6845.c26
-rw-r--r--src/emu/video/msm6255.c4
-rw-r--r--src/emu/video/pc_vga.c46
-rw-r--r--src/emu/video/pc_vga.h8
-rw-r--r--src/emu/video/pc_video.c18
-rw-r--r--src/emu/video/pc_video.h4
-rw-r--r--src/emu/video/poly.c8
-rw-r--r--src/emu/video/poly.h2
-rw-r--r--src/emu/video/resnet.c2
-rw-r--r--src/emu/video/resnet.h2
-rw-r--r--src/emu/video/s2636.c10
-rw-r--r--src/emu/video/saa5050.c16
-rw-r--r--src/emu/video/tlc34076.c12
-rw-r--r--src/emu/video/tms34061.c26
-rw-r--r--src/emu/video/tms34061.h4
-rw-r--r--src/emu/video/tms9927.c6
-rw-r--r--src/emu/video/tms9928a.c50
-rw-r--r--src/emu/video/tms9928a.h6
-rw-r--r--src/emu/video/v9938.c42
-rw-r--r--src/emu/video/v9938.h4
-rw-r--r--src/emu/video/vector.c10
-rw-r--r--src/emu/video/vector.h2
-rw-r--r--src/emu/video/voodoo.c141
-rw-r--r--src/emu/watchdog.c34
-rw-r--r--src/emu/watchdog.h6
-rw-r--r--src/ldplayer/ldplayer.c32
-rw-r--r--src/mame/audio/8080bw.c84
-rw-r--r--src/mame/audio/amiga.c10
-rw-r--r--src/mame/audio/astrof.c10
-rw-r--r--src/mame/audio/atarijsa.c100
-rw-r--r--src/mame/audio/atarijsa.h2
-rw-r--r--src/mame/audio/aztarac.c14
-rw-r--r--src/mame/audio/beezer.c6
-rw-r--r--src/mame/audio/blockade.c2
-rw-r--r--src/mame/audio/bzone.c2
-rw-r--r--src/mame/audio/cage.c44
-rw-r--r--src/mame/audio/cage.h6
-rw-r--r--src/mame/audio/carnival.c6
-rw-r--r--src/mame/audio/cchasm.c38
-rw-r--r--src/mame/audio/cclimber.c16
-rw-r--r--src/mame/audio/cinemat.c130
-rw-r--r--src/mame/audio/circus.c6
-rw-r--r--src/mame/audio/copsnrob.c8
-rw-r--r--src/mame/audio/cps3.c4
-rw-r--r--src/mame/audio/cyberbal.c56
-rw-r--r--src/mame/audio/dcs.c166
-rw-r--r--src/mame/audio/dcs.h6
-rw-r--r--src/mame/audio/depthch.c2
-rw-r--r--src/mame/audio/dkong.c12
-rw-r--r--src/mame/audio/exidy.c32
-rw-r--r--src/mame/audio/exidy440.c24
-rw-r--r--src/mame/audio/exidy440.h2
-rw-r--r--src/mame/audio/firetrk.c2
-rw-r--r--src/mame/audio/flower.c12
-rw-r--r--src/mame/audio/geebee.c6
-rw-r--r--src/mame/audio/gomoku.c8
-rw-r--r--src/mame/audio/gorf.c4
-rw-r--r--src/mame/audio/gottlieb.c76
-rw-r--r--src/mame/audio/gotya.c2
-rw-r--r--src/mame/audio/gridlee.c8
-rw-r--r--src/mame/audio/harddriv.c66
-rw-r--r--src/mame/audio/hyprolyb.c6
-rw-r--r--src/mame/audio/invinco.c2
-rw-r--r--src/mame/audio/irem.c18
-rw-r--r--src/mame/audio/jaguar.c42
-rw-r--r--src/mame/audio/jedi.c26
-rw-r--r--src/mame/audio/laserbat.c4
-rw-r--r--src/mame/audio/leland.c74
-rw-r--r--src/mame/audio/m72.c14
-rw-r--r--src/mame/audio/mario.c34
-rw-r--r--src/mame/audio/mcr.c88
-rw-r--r--src/mame/audio/mcr.h14
-rw-r--r--src/mame/audio/meadows.c22
-rw-r--r--src/mame/audio/micro3d.c28
-rw-r--r--src/mame/audio/mw8080bw.c102
-rw-r--r--src/mame/audio/n8080.c104
-rw-r--r--src/mame/audio/namco52.c8
-rw-r--r--src/mame/audio/namco54.c6
-rw-r--r--src/mame/audio/namcoc7x.c6
-rw-r--r--src/mame/audio/namcoc7x.h2
-rw-r--r--src/mame/audio/phoenix.c10
-rw-r--r--src/mame/audio/pleiads.c8
-rw-r--r--src/mame/audio/polepos.c6
-rw-r--r--src/mame/audio/polyplay.c22
-rw-r--r--src/mame/audio/pulsar.c4
-rw-r--r--src/mame/audio/qix.c10
-rw-r--r--src/mame/audio/redalert.c30
-rw-r--r--src/mame/audio/redbaron.c4
-rw-r--r--src/mame/audio/scramble.c44
-rw-r--r--src/mame/audio/segag80r.c74
-rw-r--r--src/mame/audio/segag80v.c12
-rw-r--r--src/mame/audio/segasnd.c16
-rw-r--r--src/mame/audio/segasnd.h2
-rw-r--r--src/mame/audio/seibu.c46
-rw-r--r--src/mame/audio/seibu.h4
-rw-r--r--src/mame/audio/senjyo.c18
-rw-r--r--src/mame/audio/skyraid.c2
-rw-r--r--src/mame/audio/snes_snd.c18
-rw-r--r--src/mame/audio/snk6502.c42
-rw-r--r--src/mame/audio/spacefb.c12
-rw-r--r--src/mame/audio/starwars.c30
-rw-r--r--src/mame/audio/suna8.c14
-rw-r--r--src/mame/audio/t5182.c12
-rw-r--r--src/mame/audio/taito_en.c24
-rw-r--r--src/mame/audio/taitosnd.c4
-rw-r--r--src/mame/audio/targ.c18
-rw-r--r--src/mame/audio/tiamc1.c4
-rw-r--r--src/mame/audio/timeplt.c18
-rw-r--r--src/mame/audio/trackfld.c18
-rw-r--r--src/mame/audio/turbo.c38
-rw-r--r--src/mame/audio/tx1.c26
-rw-r--r--src/mame/audio/vicdual.c12
-rw-r--r--src/mame/audio/warpwarp.c8
-rw-r--r--src/mame/audio/williams.c60
-rw-r--r--src/mame/audio/williams.h8
-rw-r--r--src/mame/audio/wiping.c10
-rw-r--r--src/mame/audio/wow.c4
-rw-r--r--src/mame/audio/zaxxon.c20
-rw-r--r--src/mame/drivers/1942.c14
-rw-r--r--src/mame/drivers/1943.c6
-rw-r--r--src/mame/drivers/1945kiii.c22
-rw-r--r--src/mame/drivers/20pacgal.c38
-rw-r--r--src/mame/drivers/2mindril.c62
-rw-r--r--src/mame/drivers/39in1.c486
-rw-r--r--src/mame/drivers/40love.c62
-rw-r--r--src/mame/drivers/4enraya.c8
-rw-r--r--src/mame/drivers/5clown.c56
-rw-r--r--src/mame/drivers/8080bw.c14
-rw-r--r--src/mame/drivers/86lions.c20
-rw-r--r--src/mame/drivers/88games.c58
-rw-r--r--src/mame/drivers/ace.c52
-rw-r--r--src/mame/drivers/acefruit.c46
-rw-r--r--src/mame/drivers/acommand.c48
-rw-r--r--src/mame/drivers/actfancr.c36
-rw-r--r--src/mame/drivers/adp.c128
-rw-r--r--src/mame/drivers/aeroboto.c18
-rw-r--r--src/mame/drivers/aerofgt.c24
-rw-r--r--src/mame/drivers/airbustr.c62
-rw-r--r--src/mame/drivers/ajax.c2
-rw-r--r--src/mame/drivers/albazc.c22
-rw-r--r--src/mame/drivers/albazg.c50
-rw-r--r--src/mame/drivers/aleck64.c8
-rw-r--r--src/mame/drivers/alg.c70
-rw-r--r--src/mame/drivers/aliens.c42
-rw-r--r--src/mame/drivers/alpha68k.c178
-rw-r--r--src/mame/drivers/ambush.c6
-rw-r--r--src/mame/drivers/ampoker2.c8
-rw-r--r--src/mame/drivers/amspdwy.c22
-rw-r--r--src/mame/drivers/angelkds.c28
-rw-r--r--src/mame/drivers/appoooh.c16
-rw-r--r--src/mame/drivers/aquarium.c36
-rw-r--r--src/mame/drivers/arabian.c26
-rw-r--r--src/mame/drivers/arcadecl.c16
-rw-r--r--src/mame/drivers/arcadia.c36
-rw-r--r--src/mame/drivers/argus.c6
-rw-r--r--src/mame/drivers/aristmk4.c104
-rw-r--r--src/mame/drivers/aristmk5.c32
-rw-r--r--src/mame/drivers/arkanoid.c38
-rw-r--r--src/mame/drivers/armedf.c36
-rw-r--r--src/mame/drivers/artmagic.c72
-rw-r--r--src/mame/drivers/ashnojoe.c22
-rw-r--r--src/mame/drivers/asterix.c40
-rw-r--r--src/mame/drivers/asteroid.c10
-rw-r--r--src/mame/drivers/astinvad.c80
-rw-r--r--src/mame/drivers/astrocde.c106
-rw-r--r--src/mame/drivers/astrocorp.c72
-rw-r--r--src/mame/drivers/astrof.c134
-rw-r--r--src/mame/drivers/asuka.c36
-rw-r--r--src/mame/drivers/atarifb.c6
-rw-r--r--src/mame/drivers/atarig1.c44
-rw-r--r--src/mame/drivers/atarig42.c50
-rw-r--r--src/mame/drivers/atarigt.c56
-rw-r--r--src/mame/drivers/atarigx2.c38
-rw-r--r--src/mame/drivers/atarisy1.c86
-rw-r--r--src/mame/drivers/atarisy2.c138
-rw-r--r--src/mame/drivers/atarisy4.c74
-rw-r--r--src/mame/drivers/ataxx.c36
-rw-r--r--src/mame/drivers/atetris.c34
-rw-r--r--src/mame/drivers/attckufo.c16
-rw-r--r--src/mame/drivers/avalnche.c18
-rw-r--r--src/mame/drivers/avt.c12
-rw-r--r--src/mame/drivers/aztarac.c8
-rw-r--r--src/mame/drivers/backfire.c96
-rw-r--r--src/mame/drivers/badlands.c56
-rw-r--r--src/mame/drivers/bagman.c22
-rw-r--r--src/mame/drivers/balsente.c28
-rw-r--r--src/mame/drivers/bankp.c2
-rw-r--r--src/mame/drivers/baraduke.c34
-rw-r--r--src/mame/drivers/batman.c28
-rw-r--r--src/mame/drivers/battlane.c16
-rw-r--r--src/mame/drivers/battlera.c22
-rw-r--r--src/mame/drivers/battlex.c16
-rw-r--r--src/mame/drivers/battlnts.c24
-rw-r--r--src/mame/drivers/bbusters.c24
-rw-r--r--src/mame/drivers/beaminv.c32
-rw-r--r--src/mame/drivers/beathead.c22
-rw-r--r--src/mame/drivers/berzerk.c96
-rw-r--r--src/mame/drivers/bestleag.c34
-rw-r--r--src/mame/drivers/bfcobra.c136
-rw-r--r--src/mame/drivers/bfm_sc1.c74
-rw-r--r--src/mame/drivers/bfm_sc2.c182
-rw-r--r--src/mame/drivers/bfmsys85.c32
-rw-r--r--src/mame/drivers/big10.c16
-rw-r--r--src/mame/drivers/bigevglf.c70
-rw-r--r--src/mame/drivers/bigfghtr.c76
-rw-r--r--src/mame/drivers/bingoc.c12
-rw-r--r--src/mame/drivers/bingor.c16
-rw-r--r--src/mame/drivers/bionicc.c20
-rw-r--r--src/mame/drivers/bishi.c26
-rw-r--r--src/mame/drivers/bking.c38
-rw-r--r--src/mame/drivers/blackt96.c26
-rw-r--r--src/mame/drivers/bladestl.c32
-rw-r--r--src/mame/drivers/blitz.c30
-rw-r--r--src/mame/drivers/blitz68k.c228
-rw-r--r--src/mame/drivers/blktiger.c30
-rw-r--r--src/mame/drivers/blmbycar.c28
-rw-r--r--src/mame/drivers/blockade.c14
-rw-r--r--src/mame/drivers/blockhl.c38
-rw-r--r--src/mame/drivers/blockout.c10
-rw-r--r--src/mame/drivers/blstroid.c16
-rw-r--r--src/mame/drivers/blueprnt.c16
-rw-r--r--src/mame/drivers/bmcbowl.c30
-rw-r--r--src/mame/drivers/bnstars.c104
-rw-r--r--src/mame/drivers/bogeyman.c16
-rw-r--r--src/mame/drivers/bombjack.c10
-rw-r--r--src/mame/drivers/boogwing.c8
-rw-r--r--src/mame/drivers/bottom9.c52
-rw-r--r--src/mame/drivers/boxer.c54
-rw-r--r--src/mame/drivers/brkthru.c20
-rw-r--r--src/mame/drivers/bsktball.c30
-rw-r--r--src/mame/drivers/btime.c100
-rw-r--r--src/mame/drivers/btoads.c34
-rw-r--r--src/mame/drivers/bublbobl.c42
-rw-r--r--src/mame/drivers/buggychl.c20
-rw-r--r--src/mame/drivers/buster.c8
-rw-r--r--src/mame/drivers/bwidow.c20
-rw-r--r--src/mame/drivers/bwing.c54
-rw-r--r--src/mame/drivers/bzone.c24
-rw-r--r--src/mame/drivers/cabal.c36
-rw-r--r--src/mame/drivers/cabaret.c36
-rw-r--r--src/mame/drivers/calchase.c78
-rw-r--r--src/mame/drivers/calomega.c46
-rw-r--r--src/mame/drivers/calorie.c30
-rw-r--r--src/mame/drivers/canyon.c8
-rw-r--r--src/mame/drivers/capbowl.c38
-rw-r--r--src/mame/drivers/cardline.c22
-rw-r--r--src/mame/drivers/carjmbre.c2
-rw-r--r--src/mame/drivers/carpolo.c4
-rw-r--r--src/mame/drivers/carrera.c6
-rw-r--r--src/mame/drivers/caswin.c32
-rw-r--r--src/mame/drivers/cave.c308
-rw-r--r--src/mame/drivers/cb2001.c26
-rw-r--r--src/mame/drivers/cball.c24
-rw-r--r--src/mame/drivers/cbasebal.c24
-rw-r--r--src/mame/drivers/cbuster.c30
-rw-r--r--src/mame/drivers/ccastles.c44
-rw-r--r--src/mame/drivers/cchance.c14
-rw-r--r--src/mame/drivers/cchasm.c2
-rw-r--r--src/mame/drivers/cclimber.c20
-rw-r--r--src/mame/drivers/cd32.c104
-rw-r--r--src/mame/drivers/cdi.c42
-rw-r--r--src/mame/drivers/centiped.c56
-rw-r--r--src/mame/drivers/chaknpop.c10
-rw-r--r--src/mame/drivers/cham24.c44
-rw-r--r--src/mame/drivers/champbas.c38
-rw-r--r--src/mame/drivers/champbwl.c24
-rw-r--r--src/mame/drivers/chanbara.c58
-rw-r--r--src/mame/drivers/changela.c62
-rw-r--r--src/mame/drivers/cheekyms.c8
-rw-r--r--src/mame/drivers/chihiro.c8
-rw-r--r--src/mame/drivers/chinagat.c56
-rw-r--r--src/mame/drivers/chinsan.c54
-rw-r--r--src/mame/drivers/chqflag.c56
-rw-r--r--src/mame/drivers/chsuper.c24
-rw-r--r--src/mame/drivers/cidelsa.c20
-rw-r--r--src/mame/drivers/cinemat.c64
-rw-r--r--src/mame/drivers/circus.c22
-rw-r--r--src/mame/drivers/circusc.c22
-rw-r--r--src/mame/drivers/cischeat.c150
-rw-r--r--src/mame/drivers/citycon.c12
-rw-r--r--src/mame/drivers/clayshoo.c40
-rw-r--r--src/mame/drivers/cliffhgr.c28
-rw-r--r--src/mame/drivers/cloak.c10
-rw-r--r--src/mame/drivers/cloud9.c36
-rw-r--r--src/mame/drivers/clshroad.c10
-rw-r--r--src/mame/drivers/cmmb.c32
-rw-r--r--src/mame/drivers/cninja.c48
-rw-r--r--src/mame/drivers/cntsteer.c102
-rw-r--r--src/mame/drivers/coinmstr.c30
-rw-r--r--src/mame/drivers/coinmvga.c18
-rw-r--r--src/mame/drivers/cojag.c116
-rw-r--r--src/mame/drivers/combatsc.c60
-rw-r--r--src/mame/drivers/commando.c14
-rw-r--r--src/mame/drivers/compgolf.c22
-rw-r--r--src/mame/drivers/contra.c20
-rw-r--r--src/mame/drivers/coolpool.c116
-rw-r--r--src/mame/drivers/coolridr.c76
-rw-r--r--src/mame/drivers/cop01.c16
-rw-r--r--src/mame/drivers/copsnrob.c10
-rw-r--r--src/mame/drivers/corona.c30
-rw-r--r--src/mame/drivers/cosmic.c62
-rw-r--r--src/mame/drivers/cps1.c102
-rw-r--r--src/mame/drivers/cps2.c94
-rw-r--r--src/mame/drivers/cps3.c202
-rw-r--r--src/mame/drivers/crbaloon.c32
-rw-r--r--src/mame/drivers/crgolf.c42
-rw-r--r--src/mame/drivers/crimfght.c34
-rw-r--r--src/mame/drivers/crospang.c14
-rw-r--r--src/mame/drivers/crshrace.c26
-rw-r--r--src/mame/drivers/crystal.c112
-rw-r--r--src/mame/drivers/cshooter.c54
-rw-r--r--src/mame/drivers/csplayh5.c92
-rw-r--r--src/mame/drivers/cubeqst.c70
-rw-r--r--src/mame/drivers/cultures.c40
-rw-r--r--src/mame/drivers/cvs.c108
-rw-r--r--src/mame/drivers/cyberbal.c36
-rw-r--r--src/mame/drivers/cybertnk.c100
-rw-r--r--src/mame/drivers/cyclemb.c18
-rw-r--r--src/mame/drivers/d9final.c18
-rw-r--r--src/mame/drivers/dacholer.c56
-rw-r--r--src/mame/drivers/dai3wksi.c34
-rw-r--r--src/mame/drivers/dambustr.c8
-rw-r--r--src/mame/drivers/darius.c196
-rw-r--r--src/mame/drivers/darkhors.c56
-rw-r--r--src/mame/drivers/darkmist.c44
-rw-r--r--src/mame/drivers/darkseal.c12
-rw-r--r--src/mame/drivers/dassault.c44
-rw-r--r--src/mame/drivers/dblewing.c42
-rw-r--r--src/mame/drivers/dbz.c34
-rw-r--r--src/mame/drivers/dcheese.c36
-rw-r--r--src/mame/drivers/dcon.c2
-rw-r--r--src/mame/drivers/dday.c6
-rw-r--r--src/mame/drivers/ddayjlc.c56
-rw-r--r--src/mame/drivers/ddealer.c50
-rw-r--r--src/mame/drivers/ddenlovr.c732
-rw-r--r--src/mame/drivers/ddragon.c110
-rw-r--r--src/mame/drivers/ddragon3.c18
-rw-r--r--src/mame/drivers/ddribble.c36
-rw-r--r--src/mame/drivers/deadang.c8
-rw-r--r--src/mame/drivers/dec0.c60
-rw-r--r--src/mame/drivers/dec8.c150
-rw-r--r--src/mame/drivers/deco156.c46
-rw-r--r--src/mame/drivers/deco32.c164
-rw-r--r--src/mame/drivers/deco_ld.c22
-rw-r--r--src/mame/drivers/deco_mlc.c64
-rw-r--r--src/mame/drivers/decocass.c60
-rw-r--r--src/mame/drivers/deniam.c12
-rw-r--r--src/mame/drivers/deshoros.c28
-rw-r--r--src/mame/drivers/destroyr.c48
-rw-r--r--src/mame/drivers/dgpix.c46
-rw-r--r--src/mame/drivers/dietgo.c10
-rw-r--r--src/mame/drivers/discoboy.c60
-rw-r--r--src/mame/drivers/diverboy.c18
-rw-r--r--src/mame/drivers/djboy.c80
-rw-r--r--src/mame/drivers/djmain.c100
-rw-r--r--src/mame/drivers/dkong.c116
-rw-r--r--src/mame/drivers/dlair.c42
-rw-r--r--src/mame/drivers/dmndrby.c48
-rw-r--r--src/mame/drivers/docastle.c18
-rw-r--r--src/mame/drivers/dogfgt.c22
-rw-r--r--src/mame/drivers/dominob.c18
-rw-r--r--src/mame/drivers/dooyong.c18
-rw-r--r--src/mame/drivers/dorachan.c18
-rw-r--r--src/mame/drivers/dotrikun.c10
-rw-r--r--src/mame/drivers/dragrace.c34
-rw-r--r--src/mame/drivers/dreamwld.c46
-rw-r--r--src/mame/drivers/drgnmst.c34
-rw-r--r--src/mame/drivers/dribling.c38
-rw-r--r--src/mame/drivers/drmicro.c18
-rw-r--r--src/mame/drivers/drtomy.c26
-rw-r--r--src/mame/drivers/drw80pkr.c52
-rw-r--r--src/mame/drivers/dunhuang.c104
-rw-r--r--src/mame/drivers/dwarfd.c54
-rw-r--r--src/mame/drivers/dynadice.c24
-rw-r--r--src/mame/drivers/dynax.c422
-rw-r--r--src/mame/drivers/egghunt.c36
-rw-r--r--src/mame/drivers/embargo.c26
-rw-r--r--src/mame/drivers/enigma2.c66
-rw-r--r--src/mame/drivers/eolith.c36
-rw-r--r--src/mame/drivers/eolith16.c16
-rw-r--r--src/mame/drivers/eolithsp.c8
-rw-r--r--src/mame/drivers/epos.c14
-rw-r--r--src/mame/drivers/eprom.c36
-rw-r--r--src/mame/drivers/equites.c76
-rw-r--r--src/mame/drivers/ertictac.c14
-rw-r--r--src/mame/drivers/esd16.c24
-rw-r--r--src/mame/drivers/esh.c22
-rw-r--r--src/mame/drivers/espial.c18
-rw-r--r--src/mame/drivers/esripsys.c120
-rw-r--r--src/mame/drivers/ettrivia.c56
-rw-r--r--src/mame/drivers/exedexes.c4
-rw-r--r--src/mame/drivers/exerion.c32
-rw-r--r--src/mame/drivers/exidy.c26
-rw-r--r--src/mame/drivers/exidy440.c62
-rw-r--r--src/mame/drivers/expro02.c14
-rw-r--r--src/mame/drivers/exprraid.c34
-rw-r--r--src/mame/drivers/exterm.c44
-rw-r--r--src/mame/drivers/exzisus.c38
-rw-r--r--src/mame/drivers/f-32.c6
-rw-r--r--src/mame/drivers/f1gp.c34
-rw-r--r--src/mame/drivers/fantland.c78
-rw-r--r--src/mame/drivers/fastfred.c50
-rw-r--r--src/mame/drivers/fastlane.c20
-rw-r--r--src/mame/drivers/fcombat.c46
-rw-r--r--src/mame/drivers/fcrash.c108
-rw-r--r--src/mame/drivers/feversoc.c44
-rw-r--r--src/mame/drivers/fgoal.c46
-rw-r--r--src/mame/drivers/finalizr.c22
-rw-r--r--src/mame/drivers/firebeat.c204
-rw-r--r--src/mame/drivers/firefox.c110
-rw-r--r--src/mame/drivers/firetrap.c44
-rw-r--r--src/mame/drivers/firetrk.c104
-rw-r--r--src/mame/drivers/fitfight.c32
-rw-r--r--src/mame/drivers/flkatck.c32
-rw-r--r--src/mame/drivers/flower.c12
-rw-r--r--src/mame/drivers/flstory.c42
-rw-r--r--src/mame/drivers/flyball.c48
-rw-r--r--src/mame/drivers/foodf.c32
-rw-r--r--src/mame/drivers/forte2.c18
-rw-r--r--src/mame/drivers/fortecar.c8
-rw-r--r--src/mame/drivers/freekick.c48
-rw-r--r--src/mame/drivers/fromanc2.c76
-rw-r--r--src/mame/drivers/fromance.c44
-rw-r--r--src/mame/drivers/funkybee.c8
-rw-r--r--src/mame/drivers/funkyjet.c10
-rw-r--r--src/mame/drivers/funworld.c40
-rw-r--r--src/mame/drivers/funybubl.c12
-rw-r--r--src/mame/drivers/fuukifg2.c50
-rw-r--r--src/mame/drivers/fuukifg3.c60
-rw-r--r--src/mame/drivers/gaelco.c20
-rw-r--r--src/mame/drivers/gaelco2.c8
-rw-r--r--src/mame/drivers/gaelco3d.c90
-rw-r--r--src/mame/drivers/gaiden.c52
-rw-r--r--src/mame/drivers/gal3.c52
-rw-r--r--src/mame/drivers/galaga.c76
-rw-r--r--src/mame/drivers/galastrm.c34
-rw-r--r--src/mame/drivers/galaxi.c68
-rw-r--r--src/mame/drivers/galaxia.c16
-rw-r--r--src/mame/drivers/galaxian.c302
-rw-r--r--src/mame/drivers/galaxold.c22
-rw-r--r--src/mame/drivers/galdrvr.c2
-rw-r--r--src/mame/drivers/galivan.c40
-rw-r--r--src/mame/drivers/galpani2.c62
-rw-r--r--src/mame/drivers/galpani3.c120
-rw-r--r--src/mame/drivers/galpanic.c24
-rw-r--r--src/mame/drivers/galspnbl.c8
-rw-r--r--src/mame/drivers/gamecstl.c76
-rw-r--r--src/mame/drivers/gameplan.c32
-rw-r--r--src/mame/drivers/gaplus.c54
-rw-r--r--src/mame/drivers/gauntlet.c64
-rw-r--r--src/mame/drivers/gberet.c26
-rw-r--r--src/mame/drivers/gbusters.c48
-rw-r--r--src/mame/drivers/gcpinbal.c30
-rw-r--r--src/mame/drivers/gei.c106
-rw-r--r--src/mame/drivers/ghosteo.c34
-rw-r--r--src/mame/drivers/gijoe.c38
-rw-r--r--src/mame/drivers/ginganin.c20
-rw-r--r--src/mame/drivers/gladiatr.c66
-rw-r--r--src/mame/drivers/glass.c20
-rw-r--r--src/mame/drivers/gng.c14
-rw-r--r--src/mame/drivers/go2000.c24
-rw-r--r--src/mame/drivers/goal92.c28
-rw-r--r--src/mame/drivers/goindol.c26
-rw-r--r--src/mame/drivers/goldngam.c4
-rw-r--r--src/mame/drivers/goldnpkr.c66
-rw-r--r--src/mame/drivers/goldstar.c130
-rw-r--r--src/mame/drivers/gomoku.c2
-rw-r--r--src/mame/drivers/good.c12
-rw-r--r--src/mame/drivers/goodejan.c14
-rw-r--r--src/mame/drivers/gotcha.c8
-rw-r--r--src/mame/drivers/gottlieb.c78
-rw-r--r--src/mame/drivers/gotya.c6
-rw-r--r--src/mame/drivers/gpworld.c44
-rw-r--r--src/mame/drivers/gradius3.c44
-rw-r--r--src/mame/drivers/grchamp.c50
-rw-r--r--src/mame/drivers/gridlee.c50
-rw-r--r--src/mame/drivers/groundfx.c40
-rw-r--r--src/mame/drivers/gstream.c54
-rw-r--r--src/mame/drivers/gstriker.c50
-rw-r--r--src/mame/drivers/gsword.c38
-rw-r--r--src/mame/drivers/gticlub.c72
-rw-r--r--src/mame/drivers/guab.c44
-rw-r--r--src/mame/drivers/gunbustr.c38
-rw-r--r--src/mame/drivers/gundealr.c24
-rw-r--r--src/mame/drivers/gunpey.c22
-rw-r--r--src/mame/drivers/gunsmoke.c6
-rw-r--r--src/mame/drivers/gyruss.c14
-rw-r--r--src/mame/drivers/halleys.c98
-rw-r--r--src/mame/drivers/hanaawas.c16
-rw-r--r--src/mame/drivers/harddriv.c58
-rw-r--r--src/mame/drivers/hcastle.c22
-rw-r--r--src/mame/drivers/hexion.c6
-rw-r--r--src/mame/drivers/highvdeo.c58
-rw-r--r--src/mame/drivers/himesiki.c12
-rw-r--r--src/mame/drivers/hitme.c40
-rw-r--r--src/mame/drivers/hitpoker.c40
-rw-r--r--src/mame/drivers/hnayayoi.c18
-rw-r--r--src/mame/drivers/hng64.c140
-rw-r--r--src/mame/drivers/homedata.c116
-rw-r--r--src/mame/drivers/homerun.c14
-rw-r--r--src/mame/drivers/hornet.c146
-rw-r--r--src/mame/drivers/hotblock.c16
-rw-r--r--src/mame/drivers/hotstuff.c2
-rw-r--r--src/mame/drivers/hshavoc.c4
-rw-r--r--src/mame/drivers/hvyunit.c86
-rw-r--r--src/mame/drivers/hyperspt.c2
-rw-r--r--src/mame/drivers/hyprduel.c78
-rw-r--r--src/mame/drivers/igs009.c104
-rw-r--r--src/mame/drivers/igs011.c350
-rw-r--r--src/mame/drivers/igs017.c234
-rw-r--r--src/mame/drivers/igs_m027.c32
-rw-r--r--src/mame/drivers/igspoker.c80
-rw-r--r--src/mame/drivers/ikki.c8
-rw-r--r--src/mame/drivers/imolagp.c40
-rw-r--r--src/mame/drivers/intrscti.c10
-rw-r--r--src/mame/drivers/inufuku.c18
-rw-r--r--src/mame/drivers/iqblock.c32
-rw-r--r--src/mame/drivers/irobot.c6
-rw-r--r--src/mame/drivers/ironhors.c14
-rw-r--r--src/mame/drivers/istellar.c30
-rw-r--r--src/mame/drivers/itech32.c212
-rw-r--r--src/mame/drivers/itech8.c106
-rw-r--r--src/mame/drivers/itgambl2.c26
-rw-r--r--src/mame/drivers/itgambl3.c26
-rw-r--r--src/mame/drivers/jack.c48
-rw-r--r--src/mame/drivers/jackal.c46
-rw-r--r--src/mame/drivers/jackie.c66
-rw-r--r--src/mame/drivers/jackpool.c58
-rw-r--r--src/mame/drivers/jailbrek.c16
-rw-r--r--src/mame/drivers/jalmah.c168
-rw-r--r--src/mame/drivers/jangou.c102
-rw-r--r--src/mame/drivers/jantotsu.c46
-rw-r--r--src/mame/drivers/jchan.c72
-rw-r--r--src/mame/drivers/jedi.c36
-rw-r--r--src/mame/drivers/jokrwild.c14
-rw-r--r--src/mame/drivers/jollyjgr.c32
-rw-r--r--src/mame/drivers/jongkyo.c60
-rw-r--r--src/mame/drivers/jpmimpct.c58
-rw-r--r--src/mame/drivers/jpmsys5.c60
-rw-r--r--src/mame/drivers/jrpacman.c6
-rw-r--r--src/mame/drivers/jubilee.c10
-rw-r--r--src/mame/drivers/junofrst.c36
-rw-r--r--src/mame/drivers/kaneko16.c88
-rw-r--r--src/mame/drivers/kangaroo.c14
-rw-r--r--src/mame/drivers/karnov.c68
-rw-r--r--src/mame/drivers/kchamp.c40
-rw-r--r--src/mame/drivers/kickgoal.c26
-rw-r--r--src/mame/drivers/kingdrby.c50
-rw-r--r--src/mame/drivers/kingobox.c26
-rw-r--r--src/mame/drivers/kingpin.c8
-rw-r--r--src/mame/drivers/kinst.c36
-rw-r--r--src/mame/drivers/klax.c12
-rw-r--r--src/mame/drivers/kncljoe.c16
-rw-r--r--src/mame/drivers/koftball.c30
-rw-r--r--src/mame/drivers/koikoi.c28
-rw-r--r--src/mame/drivers/konamigq.c42
-rw-r--r--src/mame/drivers/konamigv.c82
-rw-r--r--src/mame/drivers/konamigx.c94
-rw-r--r--src/mame/drivers/konamim2.c54
-rw-r--r--src/mame/drivers/kongambl.c14
-rw-r--r--src/mame/drivers/kopunch.c20
-rw-r--r--src/mame/drivers/ksayakyu.c14
-rw-r--r--src/mame/drivers/ksys573.c326
-rw-r--r--src/mame/drivers/kungfur.c36
-rw-r--r--src/mame/drivers/kyugo.c22
-rw-r--r--src/mame/drivers/labyrunr.c14
-rw-r--r--src/mame/drivers/ladybug.c38
-rw-r--r--src/mame/drivers/ladyfrog.c22
-rw-r--r--src/mame/drivers/laserbas.c20
-rw-r--r--src/mame/drivers/laserbat.c62
-rw-r--r--src/mame/drivers/lasso.c24
-rw-r--r--src/mame/drivers/lastduel.c12
-rw-r--r--src/mame/drivers/lastfght.c64
-rw-r--r--src/mame/drivers/lazercmd.c34
-rw-r--r--src/mame/drivers/legionna.c10
-rw-r--r--src/mame/drivers/leland.c110
-rw-r--r--src/mame/drivers/lemmings.c30
-rw-r--r--src/mame/drivers/lethal.c48
-rw-r--r--src/mame/drivers/lethalj.c20
-rw-r--r--src/mame/drivers/lgp.c18
-rw-r--r--src/mame/drivers/liberate.c70
-rw-r--r--src/mame/drivers/liberatr.c12
-rw-r--r--src/mame/drivers/limenko.c106
-rw-r--r--src/mame/drivers/littlerb.c46
-rw-r--r--src/mame/drivers/lkage.c40
-rw-r--r--src/mame/drivers/lockon.c68
-rw-r--r--src/mame/drivers/looping.c62
-rw-r--r--src/mame/drivers/lordgun.c54
-rw-r--r--src/mame/drivers/lsasquad.c18
-rw-r--r--src/mame/drivers/ltcasino.c12
-rw-r--r--src/mame/drivers/luckgrln.c62
-rw-r--r--src/mame/drivers/lucky74.c20
-rw-r--r--src/mame/drivers/lvcards.c12
-rw-r--r--src/mame/drivers/lwings.c32
-rw-r--r--src/mame/drivers/m10.c70
-rw-r--r--src/mame/drivers/m107.c68
-rw-r--r--src/mame/drivers/m14.c28
-rw-r--r--src/mame/drivers/m52.c2
-rw-r--r--src/mame/drivers/m58.c2
-rw-r--r--src/mame/drivers/m62.c42
-rw-r--r--src/mame/drivers/m63.c86
-rw-r--r--src/mame/drivers/m72.c156
-rw-r--r--src/mame/drivers/m79amb.c20
-rw-r--r--src/mame/drivers/m90.c20
-rw-r--r--src/mame/drivers/m92.c98
-rw-r--r--src/mame/drivers/macrossp.c36
-rw-r--r--src/mame/drivers/macs.c64
-rw-r--r--src/mame/drivers/madalien.c18
-rw-r--r--src/mame/drivers/madmotor.c14
-rw-r--r--src/mame/drivers/magic10.c34
-rw-r--r--src/mame/drivers/magicard.c72
-rw-r--r--src/mame/drivers/magicfly.c36
-rw-r--r--src/mame/drivers/magmax.c32
-rw-r--r--src/mame/drivers/magtouch.c18
-rw-r--r--src/mame/drivers/mainevt.c50
-rw-r--r--src/mame/drivers/mainsnk.c8
-rw-r--r--src/mame/drivers/malzak.c28
-rw-r--r--src/mame/drivers/mappy.c138
-rw-r--r--src/mame/drivers/marineb.c12
-rw-r--r--src/mame/drivers/marinedt.c60
-rw-r--r--src/mame/drivers/mastboy.c60
-rw-r--r--src/mame/drivers/matmania.c18
-rw-r--r--src/mame/drivers/maxaflex.c52
-rw-r--r--src/mame/drivers/maygay1b.c34
-rw-r--r--src/mame/drivers/maygayv1.c54
-rw-r--r--src/mame/drivers/mayumi.c28
-rw-r--r--src/mame/drivers/mazerbla.c140
-rw-r--r--src/mame/drivers/mcatadv.c22
-rw-r--r--src/mame/drivers/mcr.c38
-rw-r--r--src/mame/drivers/mcr3.c122
-rw-r--r--src/mame/drivers/mcr68.c110
-rw-r--r--src/mame/drivers/meadows.c44
-rw-r--r--src/mame/drivers/mediagx.c142
-rw-r--r--src/mame/drivers/megadriv.c50
-rw-r--r--src/mame/drivers/megadrvb.c46
-rw-r--r--src/mame/drivers/megaplay.c52
-rw-r--r--src/mame/drivers/megasys1.c104
-rw-r--r--src/mame/drivers/megatech.c72
-rw-r--r--src/mame/drivers/megazone.c20
-rw-r--r--src/mame/drivers/meijinsn.c22
-rw-r--r--src/mame/drivers/merit.c94
-rw-r--r--src/mame/drivers/meritm.c106
-rw-r--r--src/mame/drivers/mermaid.c26
-rw-r--r--src/mame/drivers/metalmx.c38
-rw-r--r--src/mame/drivers/metlclsh.c24
-rw-r--r--src/mame/drivers/metro.c206
-rw-r--r--src/mame/drivers/mexico86.c16
-rw-r--r--src/mame/drivers/mgolf.c52
-rw-r--r--src/mame/drivers/mhavoc.c10
-rw-r--r--src/mame/drivers/midas.c40
-rw-r--r--src/mame/drivers/midvunit.c106
-rw-r--r--src/mame/drivers/midzeus.c64
-rw-r--r--src/mame/drivers/mikie.c14
-rw-r--r--src/mame/drivers/mil4000.c24
-rw-r--r--src/mame/drivers/miniboy7.c12
-rw-r--r--src/mame/drivers/minivadr.c2
-rw-r--r--src/mame/drivers/mirage.c36
-rw-r--r--src/mame/drivers/mirax.c32
-rw-r--r--src/mame/drivers/missb2.c40
-rw-r--r--src/mame/drivers/missile.c88
-rw-r--r--src/mame/drivers/mitchell.c118
-rw-r--r--src/mame/drivers/mjkjidai.c16
-rw-r--r--src/mame/drivers/mjsister.c70
-rw-r--r--src/mame/drivers/mlanding.c92
-rw-r--r--src/mame/drivers/model1.c56
-rw-r--r--src/mame/drivers/model2.c268
-rw-r--r--src/mame/drivers/model3.c374
-rw-r--r--src/mame/drivers/mogura.c24
-rw-r--r--src/mame/drivers/mole.c16
-rw-r--r--src/mame/drivers/momoko.c8
-rw-r--r--src/mame/drivers/monzagp.c22
-rw-r--r--src/mame/drivers/moo.c54
-rw-r--r--src/mame/drivers/mosaic.c12
-rw-r--r--src/mame/drivers/mouser.c26
-rw-r--r--src/mame/drivers/mpoker.c30
-rw-r--r--src/mame/drivers/mpu4.c222
-rw-r--r--src/mame/drivers/mpu4drvr.c176
-rw-r--r--src/mame/drivers/mquake.c20
-rw-r--r--src/mame/drivers/mrdo.c2
-rw-r--r--src/mame/drivers/mrflea.c26
-rw-r--r--src/mame/drivers/ms32.c112
-rw-r--r--src/mame/drivers/msisaac.c30
-rw-r--r--src/mame/drivers/mugsmash.c18
-rw-r--r--src/mame/drivers/multfish.c120
-rw-r--r--src/mame/drivers/multigam.c202
-rw-r--r--src/mame/drivers/munchmo.c20
-rw-r--r--src/mame/drivers/murogem.c4
-rw-r--r--src/mame/drivers/murogmbl.c4
-rw-r--r--src/mame/drivers/mustache.c14
-rw-r--r--src/mame/drivers/mw18w.c4
-rw-r--r--src/mame/drivers/mw8080bw.c146
-rw-r--r--src/mame/drivers/mwarr.c48
-rw-r--r--src/mame/drivers/mystston.c12
-rw-r--r--src/mame/drivers/mystwarr.c60
-rw-r--r--src/mame/drivers/n8080.c24
-rw-r--r--src/mame/drivers/namcofl.c72
-rw-r--r--src/mame/drivers/namcoic.c82
-rw-r--r--src/mame/drivers/namcona1.c92
-rw-r--r--src/mame/drivers/namconb1.c102
-rw-r--r--src/mame/drivers/namcond1.c8
-rw-r--r--src/mame/drivers/namcos1.c34
-rw-r--r--src/mame/drivers/namcos10.c40
-rw-r--r--src/mame/drivers/namcos11.c166
-rw-r--r--src/mame/drivers/namcos12.c146
-rw-r--r--src/mame/drivers/namcos2.c6
-rw-r--r--src/mame/drivers/namcos21.c52
-rw-r--r--src/mame/drivers/namcos22.c154
-rw-r--r--src/mame/drivers/namcos23.c132
-rw-r--r--src/mame/drivers/namcos86.c78
-rw-r--r--src/mame/drivers/naomi.c26
-rw-r--r--src/mame/drivers/naughtyb.c30
-rw-r--r--src/mame/drivers/nbmj8688.c20
-rw-r--r--src/mame/drivers/nbmj8891.c26
-rw-r--r--src/mame/drivers/nbmj8900.c8
-rw-r--r--src/mame/drivers/nbmj8991.c14
-rw-r--r--src/mame/drivers/nbmj9195.c208
-rw-r--r--src/mame/drivers/nemesis.c70
-rw-r--r--src/mame/drivers/neodrvr.c98
-rw-r--r--src/mame/drivers/neogeo.c234
-rw-r--r--src/mame/drivers/neoprint.c66
-rw-r--r--src/mame/drivers/neptunp2.c2
-rw-r--r--src/mame/drivers/news.c4
-rw-r--r--src/mame/drivers/nightgal.c114
-rw-r--r--src/mame/drivers/ninjakd2.c64
-rw-r--r--src/mame/drivers/ninjaw.c64
-rw-r--r--src/mame/drivers/niyanpai.c100
-rw-r--r--src/mame/drivers/nmg5.c78
-rw-r--r--src/mame/drivers/nmk16.c114
-rw-r--r--src/mame/drivers/norautp.c48
-rw-r--r--src/mame/drivers/nova2001.c14
-rw-r--r--src/mame/drivers/nsmpoker.c12
-rw-r--r--src/mame/drivers/nss.c20
-rw-r--r--src/mame/drivers/nwk-tr.c76
-rw-r--r--src/mame/drivers/nycaptor.c66
-rw-r--r--src/mame/drivers/nyny.c66
-rw-r--r--src/mame/drivers/offtwall.c42
-rw-r--r--src/mame/drivers/ohmygod.c18
-rw-r--r--src/mame/drivers/ojankohs.c84
-rw-r--r--src/mame/drivers/olibochu.c34
-rw-r--r--src/mame/drivers/omegrace.c22
-rw-r--r--src/mame/drivers/oneshot.c22
-rw-r--r--src/mame/drivers/onetwo.c40
-rw-r--r--src/mame/drivers/opwolf.c62
-rw-r--r--src/mame/drivers/orbit.c24
-rw-r--r--src/mame/drivers/othello.c52
-rw-r--r--src/mame/drivers/othldrby.c18
-rw-r--r--src/mame/drivers/othunder.c76
-rw-r--r--src/mame/drivers/overdriv.c46
-rw-r--r--src/mame/drivers/pachifev.c20
-rw-r--r--src/mame/drivers/pacland.c30
-rw-r--r--src/mame/drivers/pacman.c140
-rw-r--r--src/mame/drivers/pandoras.c36
-rw-r--r--src/mame/drivers/pangofun.c16
-rw-r--r--src/mame/drivers/panicr.c54
-rw-r--r--src/mame/drivers/paradise.c26
-rw-r--r--src/mame/drivers/parodius.c60
-rw-r--r--src/mame/drivers/pasha2.c32
-rw-r--r--src/mame/drivers/pastelg.c30
-rw-r--r--src/mame/drivers/pbaction.c16
-rw-r--r--src/mame/drivers/pcat_dyn.c16
-rw-r--r--src/mame/drivers/pcat_nit.c26
-rw-r--r--src/mame/drivers/pcktgal.c32
-rw-r--r--src/mame/drivers/pcxt.c138
-rw-r--r--src/mame/drivers/pengadvb.c78
-rw-r--r--src/mame/drivers/pengo.c6
-rw-r--r--src/mame/drivers/peplus.c102
-rw-r--r--src/mame/drivers/pgm.c312
-rw-r--r--src/mame/drivers/phoenix.c4
-rw-r--r--src/mame/drivers/photon.c14
-rw-r--r--src/mame/drivers/photon2.c20
-rw-r--r--src/mame/drivers/photoply.c56
-rw-r--r--src/mame/drivers/pingpong.c58
-rw-r--r--src/mame/drivers/pinkiri8.c56
-rw-r--r--src/mame/drivers/pipedrm.c38
-rw-r--r--src/mame/drivers/pipeline.c34
-rw-r--r--src/mame/drivers/pirates.c36
-rw-r--r--src/mame/drivers/pitnrun.c8
-rw-r--r--src/mame/drivers/pkscram.c44
-rw-r--r--src/mame/drivers/pktgaldx.c6
-rw-r--r--src/mame/drivers/playch10.c12
-rw-r--r--src/mame/drivers/playmark.c56
-rw-r--r--src/mame/drivers/plygonet.c72
-rw-r--r--src/mame/drivers/pntnpuzl.c54
-rw-r--r--src/mame/drivers/pokechmp.c30
-rw-r--r--src/mame/drivers/poker72.c22
-rw-r--r--src/mame/drivers/polepos.c64
-rw-r--r--src/mame/drivers/policetr.c42
-rw-r--r--src/mame/drivers/polyplay.c36
-rw-r--r--src/mame/drivers/poo.c12
-rw-r--r--src/mame/drivers/poolshrk.c20
-rw-r--r--src/mame/drivers/pooyan.c10
-rw-r--r--src/mame/drivers/popeye.c22
-rw-r--r--src/mame/drivers/popper.c24
-rw-r--r--src/mame/drivers/portrait.c14
-rw-r--r--src/mame/drivers/powerbal.c32
-rw-r--r--src/mame/drivers/powerins.c8
-rw-r--r--src/mame/drivers/ppmast93.c24
-rw-r--r--src/mame/drivers/prehisle.c4
-rw-r--r--src/mame/drivers/progolf.c46
-rw-r--r--src/mame/drivers/psikyo.c144
-rw-r--r--src/mame/drivers/psikyo4.c98
-rw-r--r--src/mame/drivers/psikyosh.c58
-rw-r--r--src/mame/drivers/psychic5.c26
-rw-r--r--src/mame/drivers/pturn.c46
-rw-r--r--src/mame/drivers/puckpkmn.c4
-rw-r--r--src/mame/drivers/punchout.c12
-rw-r--r--src/mame/drivers/pushman.c32
-rw-r--r--src/mame/drivers/pzletime.c32
-rw-r--r--src/mame/drivers/qdrmfgp.c68
-rw-r--r--src/mame/drivers/qix.c16
-rw-r--r--src/mame/drivers/quakeat.c12
-rw-r--r--src/mame/drivers/quantum.c14
-rw-r--r--src/mame/drivers/quasar.c24
-rw-r--r--src/mame/drivers/quizdna.c8
-rw-r--r--src/mame/drivers/quizo.c8
-rw-r--r--src/mame/drivers/quizpun2.c42
-rw-r--r--src/mame/drivers/r2dtank.c44
-rw-r--r--src/mame/drivers/r2dx_v33.c34
-rw-r--r--src/mame/drivers/rabbit.c96
-rw-r--r--src/mame/drivers/raiden.c12
-rw-r--r--src/mame/drivers/raiden2.c68
-rw-r--r--src/mame/drivers/rainbow.c28
-rw-r--r--src/mame/drivers/rallyx.c38
-rw-r--r--src/mame/drivers/rampart.c26
-rw-r--r--src/mame/drivers/rastan.c26
-rw-r--r--src/mame/drivers/rbmk.c22
-rw-r--r--src/mame/drivers/re900.c32
-rw-r--r--src/mame/drivers/realbrk.c66
-rw-r--r--src/mame/drivers/redalert.c12
-rw-r--r--src/mame/drivers/redclash.c18
-rw-r--r--src/mame/drivers/relief.c34
-rw-r--r--src/mame/drivers/renegade.c64
-rw-r--r--src/mame/drivers/retofinv.c26
-rw-r--r--src/mame/drivers/rgum.c6
-rw-r--r--src/mame/drivers/rmhaihai.c40
-rw-r--r--src/mame/drivers/rockrage.c22
-rw-r--r--src/mame/drivers/rocnrope.c2
-rw-r--r--src/mame/drivers/rohga.c12
-rw-r--r--src/mame/drivers/rollerg.c36
-rw-r--r--src/mame/drivers/rotaryf.c4
-rw-r--r--src/mame/drivers/roul.c12
-rw-r--r--src/mame/drivers/route16.c26
-rw-r--r--src/mame/drivers/royalmah.c320
-rw-r--r--src/mame/drivers/rpunch.c26
-rw-r--r--src/mame/drivers/runaway.c22
-rw-r--r--src/mame/drivers/rungun.c58
-rw-r--r--src/mame/drivers/safarir.c24
-rw-r--r--src/mame/drivers/sandscrp.c44
-rw-r--r--src/mame/drivers/sangho.c104
-rw-r--r--src/mame/drivers/sauro.c12
-rw-r--r--src/mame/drivers/sbasketb.c4
-rw-r--r--src/mame/drivers/sbowling.c36
-rw-r--r--src/mame/drivers/sbrkout.c78
-rw-r--r--src/mame/drivers/scobra.c6
-rw-r--r--src/mame/drivers/scotrsht.c8
-rw-r--r--src/mame/drivers/scramble.c2
-rw-r--r--src/mame/drivers/scregg.c8
-rw-r--r--src/mame/drivers/sderby.c14
-rw-r--r--src/mame/drivers/seattle.c264
-rw-r--r--src/mame/drivers/segac2.c114
-rw-r--r--src/mame/drivers/segae.c36
-rw-r--r--src/mame/drivers/segag80r.c96
-rw-r--r--src/mame/drivers/segag80v.c74
-rw-r--r--src/mame/drivers/segahang.c94
-rw-r--r--src/mame/drivers/segald.c42
-rw-r--r--src/mame/drivers/segaorun.c120
-rw-r--r--src/mame/drivers/segas16a.c218
-rw-r--r--src/mame/drivers/segas16b.c258
-rw-r--r--src/mame/drivers/segas18.c132
-rw-r--r--src/mame/drivers/segas24.c186
-rw-r--r--src/mame/drivers/segas32.c214
-rw-r--r--src/mame/drivers/segaxbd.c110
-rw-r--r--src/mame/drivers/segaybd.c62
-rw-r--r--src/mame/drivers/seibuspi.c192
-rw-r--r--src/mame/drivers/seicross.c14
-rw-r--r--src/mame/drivers/sengokmj.c28
-rw-r--r--src/mame/drivers/senjyo.c20
-rw-r--r--src/mame/drivers/seta.c246
-rw-r--r--src/mame/drivers/seta2.c152
-rw-r--r--src/mame/drivers/sf.c28
-rw-r--r--src/mame/drivers/sfbonus.c76
-rw-r--r--src/mame/drivers/sfkick.c86
-rw-r--r--src/mame/drivers/sg1000a.c6
-rw-r--r--src/mame/drivers/shadfrce.c38
-rw-r--r--src/mame/drivers/shangha3.c40
-rw-r--r--src/mame/drivers/shanghai.c8
-rw-r--r--src/mame/drivers/shangkid.c32
-rw-r--r--src/mame/drivers/shaolins.c2
-rw-r--r--src/mame/drivers/shisen.c12
-rw-r--r--src/mame/drivers/shootout.c24
-rw-r--r--src/mame/drivers/shougi.c24
-rw-r--r--src/mame/drivers/shuuz.c22
-rw-r--r--src/mame/drivers/sidearms.c20
-rw-r--r--src/mame/drivers/sidepckt.c22
-rw-r--r--src/mame/drivers/sigmab52.c24
-rw-r--r--src/mame/drivers/sigmab98.c290
-rw-r--r--src/mame/drivers/silkroad.c12
-rw-r--r--src/mame/drivers/simpl156.c56
-rw-r--r--src/mame/drivers/simpsons.c24
-rw-r--r--src/mame/drivers/skeetsht.c26
-rw-r--r--src/mame/drivers/skimaxx.c32
-rw-r--r--src/mame/drivers/skullxbo.c26
-rw-r--r--src/mame/drivers/skyarmy.c20
-rw-r--r--src/mame/drivers/skydiver.c6
-rw-r--r--src/mame/drivers/skyfox.c14
-rw-r--r--src/mame/drivers/skykid.c46
-rw-r--r--src/mame/drivers/skylncr.c76
-rw-r--r--src/mame/drivers/skyraid.c14
-rw-r--r--src/mame/drivers/slapfght.c30
-rw-r--r--src/mame/drivers/slapshot.c56
-rw-r--r--src/mame/drivers/sliver.c52
-rw-r--r--src/mame/drivers/slotcarn.c24
-rw-r--r--src/mame/drivers/sms.c34
-rw-r--r--src/mame/drivers/snesb.c68
-rw-r--r--src/mame/drivers/snk.c170
-rw-r--r--src/mame/drivers/snk6502.c20
-rw-r--r--src/mame/drivers/snk68.c28
-rw-r--r--src/mame/drivers/snookr10.c12
-rw-r--r--src/mame/drivers/snowbros.c82
-rw-r--r--src/mame/drivers/solomon.c2
-rw-r--r--src/mame/drivers/sonson.c12
-rw-r--r--src/mame/drivers/sothello.c44
-rw-r--r--src/mame/drivers/spacefb.c20
-rw-r--r--src/mame/drivers/spaceg.c10
-rw-r--r--src/mame/drivers/spbactn.c4
-rw-r--r--src/mame/drivers/spcforce.c22
-rw-r--r--src/mame/drivers/spdodgeb.c34
-rw-r--r--src/mame/drivers/speedatk.c20
-rw-r--r--src/mame/drivers/speedbal.c6
-rw-r--r--src/mame/drivers/speedspn.c6
-rw-r--r--src/mame/drivers/speglsht.c20
-rw-r--r--src/mame/drivers/spiders.c40
-rw-r--r--src/mame/drivers/splash.c80
-rw-r--r--src/mame/drivers/spoker.c70
-rw-r--r--src/mame/drivers/spool99.c72
-rw-r--r--src/mame/drivers/sprcros2.c20
-rw-r--r--src/mame/drivers/sprint2.c58
-rw-r--r--src/mame/drivers/sprint4.c34
-rw-r--r--src/mame/drivers/sprint8.c22
-rw-r--r--src/mame/drivers/spy.c54
-rw-r--r--src/mame/drivers/srmp2.c64
-rw-r--r--src/mame/drivers/srmp5.c56
-rw-r--r--src/mame/drivers/srmp6.c72
-rw-r--r--src/mame/drivers/srumbler.c10
-rw-r--r--src/mame/drivers/ssfindo.c76
-rw-r--r--src/mame/drivers/sshangha.c44
-rw-r--r--src/mame/drivers/ssingles.c22
-rw-r--r--src/mame/drivers/sslam.c30
-rw-r--r--src/mame/drivers/ssozumo.c4
-rw-r--r--src/mame/drivers/sspeedr.c8
-rw-r--r--src/mame/drivers/ssrj.c8
-rw-r--r--src/mame/drivers/sstrangr.c8
-rw-r--r--src/mame/drivers/ssv.c184
-rw-r--r--src/mame/drivers/st0016.c28
-rw-r--r--src/mame/drivers/stactics.c18
-rw-r--r--src/mame/drivers/stadhero.c10
-rw-r--r--src/mame/drivers/starfire.c26
-rw-r--r--src/mame/drivers/starshp1.c28
-rw-r--r--src/mame/drivers/starwars.c26
-rw-r--r--src/mame/drivers/statriv2.c48
-rw-r--r--src/mame/drivers/stepstag.c8
-rw-r--r--src/mame/drivers/stlforce.c4
-rw-r--r--src/mame/drivers/strnskil.c12
-rw-r--r--src/mame/drivers/stv.c224
-rw-r--r--src/mame/drivers/stvinit.c166
-rw-r--r--src/mame/drivers/sub.c24
-rw-r--r--src/mame/drivers/subsino.c86
-rw-r--r--src/mame/drivers/subsino2.c254
-rw-r--r--src/mame/drivers/suna16.c40
-rw-r--r--src/mame/drivers/suna8.c154
-rw-r--r--src/mame/drivers/supbtime.c18
-rw-r--r--src/mame/drivers/supdrapo.c14
-rw-r--r--src/mame/drivers/superchs.c52
-rw-r--r--src/mame/drivers/superdq.c34
-rw-r--r--src/mame/drivers/superqix.c150
-rw-r--r--src/mame/drivers/supertnk.c30
-rw-r--r--src/mame/drivers/suprgolf.c62
-rw-r--r--src/mame/drivers/suprloco.c6
-rw-r--r--src/mame/drivers/suprnova.c94
-rw-r--r--src/mame/drivers/suprridr.c20
-rw-r--r--src/mame/drivers/suprslam.c20
-rw-r--r--src/mame/drivers/surpratk.c42
-rw-r--r--src/mame/drivers/system1.c136
-rw-r--r--src/mame/drivers/system16.c218
-rw-r--r--src/mame/drivers/tagteam.c6
-rw-r--r--src/mame/drivers/tail2nos.c22
-rw-r--r--src/mame/drivers/taito_b.c114
-rw-r--r--src/mame/drivers/taito_f2.c140
-rw-r--r--src/mame/drivers/taito_f3.c146
-rw-r--r--src/mame/drivers/taito_h.c42
-rw-r--r--src/mame/drivers/taito_l.c176
-rw-r--r--src/mame/drivers/taito_o.c12
-rw-r--r--src/mame/drivers/taito_x.c48
-rw-r--r--src/mame/drivers/taito_z.c154
-rw-r--r--src/mame/drivers/taitoair.c52
-rw-r--r--src/mame/drivers/taitogn.c154
-rw-r--r--src/mame/drivers/taitojc.c80
-rw-r--r--src/mame/drivers/taitosj.c40
-rw-r--r--src/mame/drivers/taitowlf.c82
-rw-r--r--src/mame/drivers/tank8.c20
-rw-r--r--src/mame/drivers/tankbatt.c40
-rw-r--r--src/mame/drivers/tankbust.c24
-rw-r--r--src/mame/drivers/taotaido.c14
-rw-r--r--src/mame/drivers/targeth.c4
-rw-r--r--src/mame/drivers/tatsumi.c84
-rw-r--r--src/mame/drivers/tattack.c8
-rw-r--r--src/mame/drivers/taxidrvr.c26
-rw-r--r--src/mame/drivers/tbowl.c36
-rw-r--r--src/mame/drivers/tceptor.c32
-rw-r--r--src/mame/drivers/tcl.c6
-rw-r--r--src/mame/drivers/tecmo.c42
-rw-r--r--src/mame/drivers/tecmo16.c4
-rw-r--r--src/mame/drivers/tecmosys.c74
-rw-r--r--src/mame/drivers/tehkanwc.c42
-rw-r--r--src/mame/drivers/tempest.c32
-rw-r--r--src/mame/drivers/terracre.c16
-rw-r--r--src/mame/drivers/tetrisp2.c82
-rw-r--r--src/mame/drivers/tgtpanic.c6
-rw-r--r--src/mame/drivers/thayers.c78
-rw-r--r--src/mame/drivers/thedeep.c30
-rw-r--r--src/mame/drivers/thepit.c10
-rw-r--r--src/mame/drivers/thief.c18
-rw-r--r--src/mame/drivers/thoop2.c6
-rw-r--r--src/mame/drivers/thunderj.c26
-rw-r--r--src/mame/drivers/thunderx.c80
-rw-r--r--src/mame/drivers/tiamc1.c6
-rw-r--r--src/mame/drivers/tickee.c58
-rw-r--r--src/mame/drivers/tigeroad.c10
-rw-r--r--src/mame/drivers/timelimt.c8
-rw-r--r--src/mame/drivers/timeplt.c14
-rw-r--r--src/mame/drivers/timetrv.c8
-rw-r--r--src/mame/drivers/tmaster.c134
-rw-r--r--src/mame/drivers/tmmjprd.c96
-rw-r--r--src/mame/drivers/tmnt.c160
-rw-r--r--src/mame/drivers/tnzs.c28
-rw-r--r--src/mame/drivers/toaplan1.c2
-rw-r--r--src/mame/drivers/toaplan2.c160
-rw-r--r--src/mame/drivers/toki.c34
-rw-r--r--src/mame/drivers/tomcat.c48
-rw-r--r--src/mame/drivers/toobin.c16
-rw-r--r--src/mame/drivers/topspeed.c66
-rw-r--r--src/mame/drivers/toratora.c38
-rw-r--r--src/mame/drivers/tourtabl.c14
-rw-r--r--src/mame/drivers/toypop.c74
-rw-r--r--src/mame/drivers/tp84.c16
-rw-r--r--src/mame/drivers/trackfld.c32
-rw-r--r--src/mame/drivers/travrusa.c6
-rw-r--r--src/mame/drivers/triplhnt.c34
-rw-r--r--src/mame/drivers/truco.c6
-rw-r--r--src/mame/drivers/trucocl.c8
-rw-r--r--src/mame/drivers/trvmadns.c38
-rw-r--r--src/mame/drivers/trvquest.c18
-rw-r--r--src/mame/drivers/tryout.c12
-rw-r--r--src/mame/drivers/tsamurai.c44
-rw-r--r--src/mame/drivers/ttchamp.c20
-rw-r--r--src/mame/drivers/tubep.c68
-rw-r--r--src/mame/drivers/tugboat.c40
-rw-r--r--src/mame/drivers/tumbleb.c108
-rw-r--r--src/mame/drivers/tumblep.c22
-rw-r--r--src/mame/drivers/tunhunt.c20
-rw-r--r--src/mame/drivers/turbo.c94
-rw-r--r--src/mame/drivers/tutankhm.c18
-rw-r--r--src/mame/drivers/twin16.c82
-rw-r--r--src/mame/drivers/twincobr.c2
-rw-r--r--src/mame/drivers/twinkle.c54
-rw-r--r--src/mame/drivers/twins.c22
-rw-r--r--src/mame/drivers/tx1.c52
-rw-r--r--src/mame/drivers/uapce.c16
-rw-r--r--src/mame/drivers/ultraman.c18
-rw-r--r--src/mame/drivers/ultratnk.c32
-rw-r--r--src/mame/drivers/ultrsprt.c34
-rw-r--r--src/mame/drivers/undrfire.c60
-rw-r--r--src/mame/drivers/unico.c34
-rw-r--r--src/mame/drivers/upscope.c28
-rw-r--r--src/mame/drivers/usgames.c14
-rw-r--r--src/mame/drivers/vamphalf.c136
-rw-r--r--src/mame/drivers/vaportra.c28
-rw-r--r--src/mame/drivers/vastar.c10
-rw-r--r--src/mame/drivers/vball.c36
-rw-r--r--src/mame/drivers/vcombat.c62
-rw-r--r--src/mame/drivers/vega.c4
-rw-r--r--src/mame/drivers/vegaeo.c18
-rw-r--r--src/mame/drivers/vegas.c188
-rw-r--r--src/mame/drivers/vendetta.c70
-rw-r--r--src/mame/drivers/vicdual.c122
-rw-r--r--src/mame/drivers/victory.c8
-rw-r--r--src/mame/drivers/videopin.c38
-rw-r--r--src/mame/drivers/videopkr.c68
-rw-r--r--src/mame/drivers/vigilant.c12
-rw-r--r--src/mame/drivers/vindictr.c12
-rw-r--r--src/mame/drivers/viper.c64
-rw-r--r--src/mame/drivers/vmetal.c58
-rw-r--r--src/mame/drivers/volfied.c10
-rw-r--r--src/mame/drivers/vpoker.c12
-rw-r--r--src/mame/drivers/vroulet.c20
-rw-r--r--src/mame/drivers/vsnes.c12
-rw-r--r--src/mame/drivers/wallc.c16
-rw-r--r--src/mame/drivers/wardner.c22
-rw-r--r--src/mame/drivers/warpwarp.c72
-rw-r--r--src/mame/drivers/warriorb.c50
-rw-r--r--src/mame/drivers/wc90.c12
-rw-r--r--src/mame/drivers/wc90b.c22
-rw-r--r--src/mame/drivers/wecleman.c74
-rw-r--r--src/mame/drivers/welltris.c16
-rw-r--r--src/mame/drivers/wgp.c66
-rw-r--r--src/mame/drivers/wheelfir.c64
-rw-r--r--src/mame/drivers/williams.c70
-rw-r--r--src/mame/drivers/wink.c28
-rw-r--r--src/mame/drivers/wiping.c14
-rw-r--r--src/mame/drivers/witch.c74
-rw-r--r--src/mame/drivers/wiz.c20
-rw-r--r--src/mame/drivers/wldarrow.c6
-rw-r--r--src/mame/drivers/wolfpack.c18
-rw-r--r--src/mame/drivers/wrally.c4
-rw-r--r--src/mame/drivers/wwfsstar.c24
-rw-r--r--src/mame/drivers/wwfwfest.c30
-rw-r--r--src/mame/drivers/xain.c76
-rw-r--r--src/mame/drivers/xexex.c96
-rw-r--r--src/mame/drivers/xmen.c46
-rw-r--r--src/mame/drivers/xorworld.c2
-rw-r--r--src/mame/drivers/xtheball.c22
-rw-r--r--src/mame/drivers/xxmissio.c18
-rw-r--r--src/mame/drivers/xybots.c14
-rw-r--r--src/mame/drivers/xyonix.c24
-rw-r--r--src/mame/drivers/yiear.c6
-rw-r--r--src/mame/drivers/yunsun16.c14
-rw-r--r--src/mame/drivers/yunsung8.c22
-rw-r--r--src/mame/drivers/zaccaria.c48
-rw-r--r--src/mame/drivers/zaxxon.c46
-rw-r--r--src/mame/drivers/zerozone.c16
-rw-r--r--src/mame/drivers/zn.c346
-rw-r--r--src/mame/drivers/zodiack.c24
-rw-r--r--src/mame/drivers/zr107.c86
-rw-r--r--src/mame/includes/88games.h6
-rw-r--r--src/mame/includes/ajax.h6
-rw-r--r--src/mame/includes/aliens.h4
-rw-r--r--src/mame/includes/alpha68k.h4
-rw-r--r--src/mame/includes/amiga.h54
-rw-r--r--src/mame/includes/archimds.h20
-rw-r--r--src/mame/includes/artmagic.h2
-rw-r--r--src/mame/includes/asterix.h4
-rw-r--r--src/mame/includes/atari.h8
-rw-r--r--src/mame/includes/battlnts.h4
-rw-r--r--src/mame/includes/bishi.h2
-rw-r--r--src/mame/includes/bladestl.h4
-rw-r--r--src/mame/includes/blockhl.h4
-rw-r--r--src/mame/includes/bottom9.h6
-rw-r--r--src/mame/includes/carpolo.h10
-rw-r--r--src/mame/includes/cave.h8
-rw-r--r--src/mame/includes/cd32.h2
-rw-r--r--src/mame/includes/chqflag.h6
-rw-r--r--src/mame/includes/cinemat.h2
-rw-r--r--src/mame/includes/cosmic.h2
-rw-r--r--src/mame/includes/cps1.h38
-rw-r--r--src/mame/includes/crbaloon.h4
-rw-r--r--src/mame/includes/crimfght.h4
-rw-r--r--src/mame/includes/cvs.h2
-rw-r--r--src/mame/includes/cyberbal.h2
-rw-r--r--src/mame/includes/dbz.h4
-rw-r--r--src/mame/includes/dc.h4
-rw-r--r--src/mame/includes/dcheese.h2
-rw-r--r--src/mame/includes/dec0.h4
-rw-r--r--src/mame/includes/decocrpt.h10
-rw-r--r--src/mame/includes/decoprot.h2
-rw-r--r--src/mame/includes/djmain.h2
-rw-r--r--src/mame/includes/dynax.h10
-rw-r--r--src/mame/includes/eolithsp.h2
-rw-r--r--src/mame/includes/esripsys.h2
-rw-r--r--src/mame/includes/exidy.h2
-rw-r--r--src/mame/includes/exidy440.h2
-rw-r--r--src/mame/includes/fromanc2.h2
-rw-r--r--src/mame/includes/galaga.h2
-rw-r--r--src/mame/includes/galaxian.h28
-rw-r--r--src/mame/includes/galaxold.h6
-rw-r--r--src/mame/includes/gbusters.h4
-rw-r--r--src/mame/includes/genesis.h2
-rw-r--r--src/mame/includes/gijoe.h4
-rw-r--r--src/mame/includes/gradius3.h4
-rw-r--r--src/mame/includes/harddriv.h2
-rw-r--r--src/mame/includes/hng64.h2
-rw-r--r--src/mame/includes/irobot.h4
-rw-r--r--src/mame/includes/itech32.h2
-rw-r--r--src/mame/includes/itech8.h2
-rw-r--r--src/mame/includes/jackal.h2
-rw-r--r--src/mame/includes/jaguar.h10
-rw-r--r--src/mame/includes/kaneko16.h14
-rw-r--r--src/mame/includes/karnov.h2
-rw-r--r--src/mame/includes/konamigx.h6
-rw-r--r--src/mame/includes/ladybug.h8
-rw-r--r--src/mame/includes/legionna.h4
-rw-r--r--src/mame/includes/leland.h26
-rw-r--r--src/mame/includes/lethal.h4
-rw-r--r--src/mame/includes/lordgun.h2
-rw-r--r--src/mame/includes/m92.h2
-rw-r--r--src/mame/includes/mainevt.h8
-rw-r--r--src/mame/includes/meadows.h4
-rw-r--r--src/mame/includes/megadriv.h8
-rw-r--r--src/mame/includes/metro.h2
-rw-r--r--src/mame/includes/micro3d.h2
-rw-r--r--src/mame/includes/model1.h6
-rw-r--r--src/mame/includes/model2.h2
-rw-r--r--src/mame/includes/model3.h12
-rw-r--r--src/mame/includes/moo.h4
-rw-r--r--src/mame/includes/mw8080bw.h4
-rw-r--r--src/mame/includes/mystston.h2
-rw-r--r--src/mame/includes/n64.h6
-rw-r--r--src/mame/includes/n8080.h2
-rw-r--r--src/mame/includes/namcoic.h18
-rw-r--r--src/mame/includes/namcos1.h2
-rw-r--r--src/mame/includes/namcos2.h6
-rw-r--r--src/mame/includes/namcos22.h2
-rw-r--r--src/mame/includes/naomi.h2
-rw-r--r--src/mame/includes/neogeo.h158
-rw-r--r--src/mame/includes/opwolf.h2
-rw-r--r--src/mame/includes/overdriv.h6
-rw-r--r--src/mame/includes/pacman.h4
-rw-r--r--src/mame/includes/parodius.h4
-rw-r--r--src/mame/includes/pgm.h42
-rw-r--r--src/mame/includes/polyplay.h8
-rw-r--r--src/mame/includes/psikyo.h2
-rw-r--r--src/mame/includes/psx.h28
-rw-r--r--src/mame/includes/qdrmfgp.h4
-rw-r--r--src/mame/includes/raiden2.h8
-rw-r--r--src/mame/includes/rainbow.h2
-rw-r--r--src/mame/includes/rockrage.h4
-rw-r--r--src/mame/includes/rollerg.h4
-rw-r--r--src/mame/includes/rungun.h2
-rw-r--r--src/mame/includes/segamsys.h4
-rw-r--r--src/mame/includes/segas16.h12
-rw-r--r--src/mame/includes/segas24.h14
-rw-r--r--src/mame/includes/segas32.h4
-rw-r--r--src/mame/includes/seibuspi.h2
-rw-r--r--src/mame/includes/seta.h2
-rw-r--r--src/mame/includes/simpsons.h6
-rw-r--r--src/mame/includes/skullxbo.h2
-rw-r--r--src/mame/includes/slapstic.h2
-rw-r--r--src/mame/includes/snes.h6
-rw-r--r--src/mame/includes/snk6502.h6
-rw-r--r--src/mame/includes/sprint8.h2
-rw-r--r--src/mame/includes/spy.h4
-rw-r--r--src/mame/includes/ssv.h2
-rw-r--r--src/mame/includes/starwars.h4
-rw-r--r--src/mame/includes/stv.h8
-rw-r--r--src/mame/includes/suprnova.h2
-rw-r--r--src/mame/includes/suprridr.h2
-rw-r--r--src/mame/includes/surpratk.h4
-rw-r--r--src/mame/includes/system1.h2
-rw-r--r--src/mame/includes/tail2nos.h2
-rw-r--r--src/mame/includes/taito_l.h26
-rw-r--r--src/mame/includes/taitojc.h4
-rw-r--r--src/mame/includes/tank8.h2
-rw-r--r--src/mame/includes/tatsumi.h2
-rw-r--r--src/mame/includes/tecmosys.h2
-rw-r--r--src/mame/includes/thunderx.h4
-rw-r--r--src/mame/includes/tmnt.h24
-rw-r--r--src/mame/includes/toaplan1.h6
-rw-r--r--src/mame/includes/triplhnt.h2
-rw-r--r--src/mame/includes/tubep.h2
-rw-r--r--src/mame/includes/twin16.h4
-rw-r--r--src/mame/includes/twincobr.h8
-rw-r--r--src/mame/includes/ultraman.h8
-rw-r--r--src/mame/includes/vball.h6
-rw-r--r--src/mame/includes/vendetta.h6
-rw-r--r--src/mame/includes/vertigo.h10
-rw-r--r--src/mame/includes/vicdual.h2
-rw-r--r--src/mame/includes/volfied.h4
-rw-r--r--src/mame/includes/wecleman.h4
-rw-r--r--src/mame/includes/xexex.h4
-rw-r--r--src/mame/includes/xmen.h4
-rw-r--r--src/mame/machine/acitya.c32
-rw-r--r--src/mame/machine/ajax.c64
-rw-r--r--src/mame/machine/amiga.c180
-rw-r--r--src/mame/machine/archimds.c96
-rw-r--r--src/mame/machine/arkanoid.c38
-rw-r--r--src/mame/machine/asic65.c18
-rw-r--r--src/mame/machine/asic65.h4
-rw-r--r--src/mame/machine/asteroid.c44
-rw-r--r--src/mame/machine/atari.c46
-rw-r--r--src/mame/machine/atarifb.c82
-rw-r--r--src/mame/machine/atarigen.c236
-rw-r--r--src/mame/machine/atarigen.h20
-rw-r--r--src/mame/machine/bagman.c8
-rw-r--r--src/mame/machine/balsente.c174
-rw-r--r--src/mame/machine/beezer.c36
-rw-r--r--src/mame/machine/bigevglf.c24
-rw-r--r--src/mame/machine/bonzeadv.c34
-rw-r--r--src/mame/machine/bsktball.c24
-rw-r--r--src/mame/machine/btime.c8
-rw-r--r--src/mame/machine/bublbobl.c92
-rw-r--r--src/mame/machine/buggychl.c2
-rw-r--r--src/mame/machine/carpolo.c114
-rw-r--r--src/mame/machine/cchip.c14
-rw-r--r--src/mame/machine/cclimber.c14
-rw-r--r--src/mame/machine/cd32.c36
-rw-r--r--src/mame/machine/cdi070.c244
-rw-r--r--src/mame/machine/cdi070.h14
-rw-r--r--src/mame/machine/cdicdic.c130
-rw-r--r--src/mame/machine/cdislave.c68
-rw-r--r--src/mame/machine/chaknpop.c20
-rw-r--r--src/mame/machine/cps2crpt.c12
-rw-r--r--src/mame/machine/cx4fn.c4
-rw-r--r--src/mame/machine/cx4oam.c12
-rw-r--r--src/mame/machine/cx4ops.c14
-rw-r--r--src/mame/machine/dc.c118
-rw-r--r--src/mame/machine/dec0.c94
-rw-r--r--src/mame/machine/deco102.c10
-rw-r--r--src/mame/machine/deco156.c6
-rw-r--r--src/mame/machine/decocass.c291
-rw-r--r--src/mame/machine/decocass.h4
-rw-r--r--src/mame/machine/decocrpt.c12
-rw-r--r--src/mame/machine/decoprot.c100
-rw-r--r--src/mame/machine/docastle.c12
-rw-r--r--src/mame/machine/fd1089.c18
-rw-r--r--src/mame/machine/fd1089.h4
-rw-r--r--src/mame/machine/fddebug.c130
-rw-r--r--src/mame/machine/fddebug.h4
-rw-r--r--src/mame/machine/flstory.c32
-rw-r--r--src/mame/machine/gaelco2.c44
-rw-r--r--src/mame/machine/gaelco3d.c4
-rw-r--r--src/mame/machine/gaelcrpt.c2
-rw-r--r--src/mame/machine/galaxold.c86
-rw-r--r--src/mame/machine/gaplus.c8
-rw-r--r--src/mame/machine/gdcrypt.c6
-rw-r--r--src/mame/machine/harddriv.c224
-rw-r--r--src/mame/machine/irobot.c96
-rw-r--r--src/mame/machine/jalcrpt.c36
-rw-r--r--src/mame/machine/jalcrpt.h12
-rw-r--r--src/mame/machine/jumpshot.c4
-rw-r--r--src/mame/machine/kabuki.c46
-rw-r--r--src/mame/machine/kaneko16.c80
-rw-r--r--src/mame/machine/konami1.c8
-rw-r--r--src/mame/machine/konami1.h2
-rw-r--r--src/mame/machine/konamigx.c6
-rw-r--r--src/mame/machine/konppc.c44
-rw-r--r--src/mame/machine/konppc.h4
-rw-r--r--src/mame/machine/leland.c270
-rw-r--r--src/mame/machine/lkage.c24
-rw-r--r--src/mame/machine/lsasquad.c46
-rw-r--r--src/mame/machine/maniach.c24
-rw-r--r--src/mame/machine/mc8123.c8
-rw-r--r--src/mame/machine/mc8123.h2
-rw-r--r--src/mame/machine/mcr.c14
-rw-r--r--src/mame/machine/mcr68.c74
-rw-r--r--src/mame/machine/md_cart.c312
-rw-r--r--src/mame/machine/megadriv.c644
-rw-r--r--src/mame/machine/meters.c4
-rw-r--r--src/mame/machine/meters.h2
-rw-r--r--src/mame/machine/mexico86.c28
-rw-r--r--src/mame/machine/mhavoc.c84
-rw-r--r--src/mame/machine/micro3d.c92
-rw-r--r--src/mame/machine/midtunit.c56
-rw-r--r--src/mame/machine/midwayic.c100
-rw-r--r--src/mame/machine/midwayic.h14
-rw-r--r--src/mame/machine/midwunit.c44
-rw-r--r--src/mame/machine/midxunit.c44
-rw-r--r--src/mame/machine/midyunit.c84
-rw-r--r--src/mame/machine/model1.c262
-rw-r--r--src/mame/machine/model3.c22
-rw-r--r--src/mame/machine/mw8080bw.c38
-rw-r--r--src/mame/machine/n64.c106
-rw-r--r--src/mame/machine/namco06.c24
-rw-r--r--src/mame/machine/namco50.c6
-rw-r--r--src/mame/machine/namco51.c10
-rw-r--r--src/mame/machine/namco53.c2
-rw-r--r--src/mame/machine/namcond1.c14
-rw-r--r--src/mame/machine/namcos1.c124
-rw-r--r--src/mame/machine/namcos2.c106
-rw-r--r--src/mame/machine/naomi.c22
-rw-r--r--src/mame/machine/naomibd.c35
-rw-r--r--src/mame/machine/nb1413m3.c132
-rw-r--r--src/mame/machine/neoboot.c212
-rw-r--r--src/mame/machine/neocrypt.c158
-rw-r--r--src/mame/machine/neoprot.c92
-rw-r--r--src/mame/machine/nitedrvr.c50
-rw-r--r--src/mame/machine/nmk004.c20
-rw-r--r--src/mame/machine/nmk004.h2
-rw-r--r--src/mame/machine/nmk112.c10
-rw-r--r--src/mame/machine/nycaptor.c26
-rw-r--r--src/mame/machine/opwolf.c30
-rw-r--r--src/mame/machine/pacplus.c4
-rw-r--r--src/mame/machine/pcecommn.c8
-rw-r--r--src/mame/machine/pcecommn.h2
-rw-r--r--src/mame/machine/pckeybrd.c20
-rw-r--r--src/mame/machine/pcshare.c32
-rw-r--r--src/mame/machine/pgmcrypt.c84
-rw-r--r--src/mame/machine/pgmprot.c30
-rw-r--r--src/mame/machine/pitnrun.c36
-rw-r--r--src/mame/machine/playch10.c250
-rw-r--r--src/mame/machine/psx.c122
-rw-r--r--src/mame/machine/qix.c74
-rw-r--r--src/mame/machine/r2crypt.c6
-rw-r--r--src/mame/machine/rainbow.c28
-rw-r--r--src/mame/machine/retofinv.c28
-rw-r--r--src/mame/machine/s16fd.c40
-rw-r--r--src/mame/machine/s24fd.c36
-rw-r--r--src/mame/machine/scramble.c108
-rw-r--r--src/mame/machine/scudsp.c2
-rw-r--r--src/mame/machine/segacrp2.c24
-rw-r--r--src/mame/machine/segacrp2.h16
-rw-r--r--src/mame/machine/segacrpt.c76
-rw-r--r--src/mame/machine/segacrpt.h50
-rw-r--r--src/mame/machine/segaic16.c30
-rw-r--r--src/mame/machine/segaic16.h12
-rw-r--r--src/mame/machine/segamsys.c80
-rw-r--r--src/mame/machine/segas24.c20
-rw-r--r--src/mame/machine/segas32.c22
-rw-r--r--src/mame/machine/seicop.c70
-rw-r--r--src/mame/machine/simpsons.c48
-rw-r--r--src/mame/machine/slapfght.c88
-rw-r--r--src/mame/machine/slapstic.c14
-rw-r--r--src/mame/machine/slikshot.c32
-rw-r--r--src/mame/machine/snes.c224
-rw-r--r--src/mame/machine/snes7110.c40
-rw-r--r--src/mame/machine/snesbsx.c6
-rw-r--r--src/mame/machine/snescx4.c18
-rw-r--r--src/mame/machine/snesobc1.c2
-rw-r--r--src/mame/machine/snesrtc.c10
-rw-r--r--src/mame/machine/snessdd1.c76
-rw-r--r--src/mame/machine/starwars.c62
-rw-r--r--src/mame/machine/steppers.c4
-rw-r--r--src/mame/machine/steppers.h2
-rw-r--r--src/mame/machine/stfight.c36
-rw-r--r--src/mame/machine/stvcd.c92
-rw-r--r--src/mame/machine/stvcd.h2
-rw-r--r--src/mame/machine/stvprot.c48
-rw-r--r--src/mame/machine/stvprot.h16
-rw-r--r--src/mame/machine/subs.c32
-rw-r--r--src/mame/machine/tait8741.c50
-rw-r--r--src/mame/machine/tait8741.h2
-rw-r--r--src/mame/machine/taitoio.c30
-rw-r--r--src/mame/machine/taitosj.c62
-rw-r--r--src/mame/machine/tatsumi.c92
-rw-r--r--src/mame/machine/tecmosys.c10
-rw-r--r--src/mame/machine/theglobp.c32
-rw-r--r--src/mame/machine/ticket.c10
-rw-r--r--src/mame/machine/tnzs.c168
-rw-r--r--src/mame/machine/toaplan1.c124
-rw-r--r--src/mame/machine/twincobr.c104
-rw-r--r--src/mame/machine/tx1.c118
-rw-r--r--src/mame/machine/vertigo.c56
-rw-r--r--src/mame/machine/volfied.c36
-rw-r--r--src/mame/machine/vsnes.c248
-rw-r--r--src/mame/machine/williams.c186
-rw-r--r--src/mame/machine/wrally.c10
-rw-r--r--src/mame/machine/xevious.c34
-rw-r--r--src/mame/machine/zs01.c6
-rw-r--r--src/mame/video/1942.c30
-rw-r--r--src/mame/video/1943.c60
-rw-r--r--src/mame/video/20pacgal.c16
-rw-r--r--src/mame/video/40love.c82
-rw-r--r--src/mame/video/4enraya.c8
-rw-r--r--src/mame/video/8080bw.c90
-rw-r--r--src/mame/video/88games.c14
-rw-r--r--src/mame/video/actfancr.c14
-rw-r--r--src/mame/video/aeroboto.c24
-rw-r--r--src/mame/video/aerofgt.c248
-rw-r--r--src/mame/video/airbustr.c22
-rw-r--r--src/mame/video/ajax.c20
-rw-r--r--src/mame/video/aliens.c18
-rw-r--r--src/mame/video/alpha68k.c150
-rw-r--r--src/mame/video/ambush.c22
-rw-r--r--src/mame/video/amiga.c40
-rw-r--r--src/mame/video/amigaaga.c20
-rw-r--r--src/mame/video/ampoker2.c14
-rw-r--r--src/mame/video/amspdwy.c26
-rw-r--r--src/mame/video/angelkds.c42
-rw-r--r--src/mame/video/antic.c4
-rw-r--r--src/mame/video/appoooh.c52
-rw-r--r--src/mame/video/aquarium.c26
-rw-r--r--src/mame/video/arabian.c18
-rw-r--r--src/mame/video/arcadecl.c14
-rw-r--r--src/mame/video/archimds.c16
-rw-r--r--src/mame/video/argus.c198
-rw-r--r--src/mame/video/arkanoid.c60
-rw-r--r--src/mame/video/armedf.c66
-rw-r--r--src/mame/video/artmagic.c32
-rw-r--r--src/mame/video/ashnojoe.c38
-rw-r--r--src/mame/video/asterix.c20
-rw-r--r--src/mame/video/astrocde.c60
-rw-r--r--src/mame/video/asuka.c10
-rw-r--r--src/mame/video/atari.c52
-rw-r--r--src/mame/video/atarifb.c42
-rw-r--r--src/mame/video/atarig1.c18
-rw-r--r--src/mame/video/atarig42.c20
-rw-r--r--src/mame/video/atarigt.c22
-rw-r--r--src/mame/video/atarigx2.c20
-rw-r--r--src/mame/video/atarimo.c40
-rw-r--r--src/mame/video/atarimo.h2
-rw-r--r--src/mame/video/atarirle.c36
-rw-r--r--src/mame/video/atarisy1.c92
-rw-r--r--src/mame/video/atarisy2.c42
-rw-r--r--src/mame/video/atetris.c8
-rw-r--r--src/mame/video/avgdvg.c36
-rw-r--r--src/mame/video/aztarac.c14
-rw-r--r--src/mame/video/badlands.c10
-rw-r--r--src/mame/video/bagman.c28
-rw-r--r--src/mame/video/balsente.c44
-rw-r--r--src/mame/video/bankp.c40
-rw-r--r--src/mame/video/baraduke.c50
-rw-r--r--src/mame/video/batman.c14
-rw-r--r--src/mame/video/battlane.c38
-rw-r--r--src/mame/video/battlera.c68
-rw-r--r--src/mame/video/battlex.c30
-rw-r--r--src/mame/video/battlnts.c14
-rw-r--r--src/mame/video/bbusters.c40
-rw-r--r--src/mame/video/beathead.c18
-rw-r--r--src/mame/video/beezer.c10
-rw-r--r--src/mame/video/bfm_adr2.c10
-rw-r--r--src/mame/video/bfm_adr2.h2
-rw-r--r--src/mame/video/bfm_dm01.c12
-rw-r--r--src/mame/video/bfm_dm01.h4
-rw-r--r--src/mame/video/bigevglf.c32
-rw-r--r--src/mame/video/bigstrkb.c26
-rw-r--r--src/mame/video/bionicc.c46
-rw-r--r--src/mame/video/bishi.c12
-rw-r--r--src/mame/video/bking.c68
-rw-r--r--src/mame/video/bladestl.c26
-rw-r--r--src/mame/video/blktiger.c46
-rw-r--r--src/mame/video/blmbycar.c38
-rw-r--r--src/mame/video/blockade.c12
-rw-r--r--src/mame/video/blockhl.c18
-rw-r--r--src/mame/video/blockout.c26
-rw-r--r--src/mame/video/bloodbro.c48
-rw-r--r--src/mame/video/blstroid.c16
-rw-r--r--src/mame/video/blueprnt.c30
-rw-r--r--src/mame/video/bogeyman.c26
-rw-r--r--src/mame/video/bombjack.c30
-rw-r--r--src/mame/video/boogwing.c20
-rw-r--r--src/mame/video/bosco.c72
-rw-r--r--src/mame/video/bottom9.c16
-rw-r--r--src/mame/video/brkthru.c46
-rw-r--r--src/mame/video/bsktball.c16
-rw-r--r--src/mame/video/btime.c150
-rw-r--r--src/mame/video/btoads.c56
-rw-r--r--src/mame/video/bublbobl.c8
-rw-r--r--src/mame/video/buggychl.c56
-rw-r--r--src/mame/video/bwing.c66
-rw-r--r--src/mame/video/cabal.c24
-rw-r--r--src/mame/video/calomega.c12
-rw-r--r--src/mame/video/canyon.c24
-rw-r--r--src/mame/video/capbowl.c16
-rw-r--r--src/mame/video/carjmbre.c22
-rw-r--r--src/mame/video/carpolo.c88
-rw-r--r--src/mame/video/cave.c214
-rw-r--r--src/mame/video/cbasebal.c32
-rw-r--r--src/mame/video/cbuster.c32
-rw-r--r--src/mame/video/ccastles.c52
-rw-r--r--src/mame/video/cchasm.c14
-rw-r--r--src/mame/video/cclimber.c96
-rw-r--r--src/mame/video/centiped.c68
-rw-r--r--src/mame/video/chaknpop.c42
-rw-r--r--src/mame/video/champbas.c58
-rw-r--r--src/mame/video/changela.c72
-rw-r--r--src/mame/video/cheekyms.c24
-rw-r--r--src/mame/video/chqflag.c20
-rw-r--r--src/mame/video/cidelsa.c22
-rw-r--r--src/mame/video/cinemat.c26
-rw-r--r--src/mame/video/circus.c50
-rw-r--r--src/mame/video/circusc.c30
-rw-r--r--src/mame/video/cischeat.c264
-rw-r--r--src/mame/video/citycon.c32
-rw-r--r--src/mame/video/cloak.c44
-rw-r--r--src/mame/video/cloud9.c48
-rw-r--r--src/mame/video/clshroad.c38
-rw-r--r--src/mame/video/cninja.c68
-rw-r--r--src/mame/video/combatsc.c78
-rw-r--r--src/mame/video/commando.c40
-rw-r--r--src/mame/video/compgolf.c24
-rw-r--r--src/mame/video/contra.c52
-rw-r--r--src/mame/video/cop01.c38
-rw-r--r--src/mame/video/copsnrob.c16
-rw-r--r--src/mame/video/cosmic.c130
-rw-r--r--src/mame/video/cps1.c218
-rw-r--r--src/mame/video/crbaloon.c28
-rw-r--r--src/mame/video/crgolf.c14
-rw-r--r--src/mame/video/crimfght.c16
-rw-r--r--src/mame/video/crospang.c40
-rw-r--r--src/mame/video/crshrace.c54
-rw-r--r--src/mame/video/cvs.c64
-rw-r--r--src/mame/video/cyberbal.c36
-rw-r--r--src/mame/video/darius.c20
-rw-r--r--src/mame/video/darkmist.c38
-rw-r--r--src/mame/video/darkseal.c24
-rw-r--r--src/mame/video/dassault.c22
-rw-r--r--src/mame/video/dbz.c24
-rw-r--r--src/mame/video/dc.c72
-rw-r--r--src/mame/video/dcheese.c56
-rw-r--r--src/mame/video/dcon.c88
-rw-r--r--src/mame/video/dday.c196
-rw-r--r--src/mame/video/ddragon.c24
-rw-r--r--src/mame/video/ddragon3.c38
-rw-r--r--src/mame/video/ddribble.c38
-rw-r--r--src/mame/video/deadang.c34
-rw-r--r--src/mame/video/dec0.c150
-rw-r--r--src/mame/video/dec8.c148
-rw-r--r--src/mame/video/decbac06.c16
-rw-r--r--src/mame/video/decbac06.h6
-rw-r--r--src/mame/video/decmxc06.c8
-rw-r--r--src/mame/video/decmxc06.h2
-rw-r--r--src/mame/video/deco16ic.c26
-rw-r--r--src/mame/video/deco32.c156
-rw-r--r--src/mame/video/deco_mlc.c30
-rw-r--r--src/mame/video/decocass.c130
-rw-r--r--src/mame/video/decocomn.c34
-rw-r--r--src/mame/video/decospr.c48
-rw-r--r--src/mame/video/decospr.h6
-rw-r--r--src/mame/video/deniam.c82
-rw-r--r--src/mame/video/dietgo.c6
-rw-r--r--src/mame/video/digdug.c40
-rw-r--r--src/mame/video/djboy.c18
-rw-r--r--src/mame/video/djmain.c24
-rw-r--r--src/mame/video/dkong.c126
-rw-r--r--src/mame/video/docastle.c46
-rw-r--r--src/mame/video/dogfgt.c44
-rw-r--r--src/mame/video/dooyong.c202
-rw-r--r--src/mame/video/dragrace.c6
-rw-r--r--src/mame/video/drgnmst.c24
-rw-r--r--src/mame/video/dribling.c10
-rw-r--r--src/mame/video/drmicro.c20
-rw-r--r--src/mame/video/dynax.c220
-rw-r--r--src/mame/video/dynduke.c56
-rw-r--r--src/mame/video/eolith.c8
-rw-r--r--src/mame/video/epos.c18
-rw-r--r--src/mame/video/eprom.c30
-rw-r--r--src/mame/video/equites.c100
-rw-r--r--src/mame/video/esd16.c88
-rw-r--r--src/mame/video/espial.c44
-rw-r--r--src/mame/video/esripsys.c44
-rw-r--r--src/mame/video/exedexes.c60
-rw-r--r--src/mame/video/exerion.c44
-rw-r--r--src/mame/video/exidy.c64
-rw-r--r--src/mame/video/exidy440.c66
-rw-r--r--src/mame/video/exprraid.c36
-rw-r--r--src/mame/video/exterm.c12
-rw-r--r--src/mame/video/exzisus.c30
-rw-r--r--src/mame/video/f1gp.c102
-rw-r--r--src/mame/video/fantland.c10
-rw-r--r--src/mame/video/fastfred.c64
-rw-r--r--src/mame/video/fastlane.c30
-rw-r--r--src/mame/video/fcombat.c22
-rw-r--r--src/mame/video/fgoal.c24
-rw-r--r--src/mame/video/finalizr.c26
-rw-r--r--src/mame/video/firetrap.c54
-rw-r--r--src/mame/video/firetrk.c92
-rw-r--r--src/mame/video/fitfight.c46
-rw-r--r--src/mame/video/flkatck.c18
-rw-r--r--src/mame/video/flower.c34
-rw-r--r--src/mame/video/flstory.c90
-rw-r--r--src/mame/video/foodf.c18
-rw-r--r--src/mame/video/freekick.c36
-rw-r--r--src/mame/video/fromanc2.c110
-rw-r--r--src/mame/video/fromance.c70
-rw-r--r--src/mame/video/funkybee.c38
-rw-r--r--src/mame/video/funkyjet.c6
-rw-r--r--src/mame/video/funworld.c14
-rw-r--r--src/mame/video/funybubl.c20
-rw-r--r--src/mame/video/fuukifg2.c42
-rw-r--r--src/mame/video/fuukifg3.c54
-rw-r--r--src/mame/video/gaelco.c30
-rw-r--r--src/mame/video/gaelco2.c42
-rw-r--r--src/mame/video/gaelco3d.c62
-rw-r--r--src/mame/video/gaiden.c122
-rw-r--r--src/mame/video/galaga.c44
-rw-r--r--src/mame/video/galastrm.c70
-rw-r--r--src/mame/video/galaxian.c96
-rw-r--r--src/mame/video/galaxold.c168
-rw-r--r--src/mame/video/galivan.c68
-rw-r--r--src/mame/video/galpani2.c32
-rw-r--r--src/mame/video/galpanic.c40
-rw-r--r--src/mame/video/galspnbl.c22
-rw-r--r--src/mame/video/gameplan.c34
-rw-r--r--src/mame/video/gaplus.c62
-rw-r--r--src/mame/video/gatron.c8
-rw-r--r--src/mame/video/gauntlet.c16
-rw-r--r--src/mame/video/gberet.c48
-rw-r--r--src/mame/video/gbusters.c12
-rw-r--r--src/mame/video/gcpinbal.c34
-rw-r--r--src/mame/video/genesis.c100
-rw-r--r--src/mame/video/gijoe.c16
-rw-r--r--src/mame/video/ginganin.c46
-rw-r--r--src/mame/video/gladiatr.c58
-rw-r--r--src/mame/video/glass.c26
-rw-r--r--src/mame/video/gng.c30
-rw-r--r--src/mame/video/goal92.c40
-rw-r--r--src/mame/video/goindol.c24
-rw-r--r--src/mame/video/goldstar.c74
-rw-r--r--src/mame/video/gomoku.c32
-rw-r--r--src/mame/video/gotcha.c32
-rw-r--r--src/mame/video/gottlieb.c60
-rw-r--r--src/mame/video/gotya.c42
-rw-r--r--src/mame/video/gp9001.c28
-rw-r--r--src/mame/video/gp9001.h6
-rw-r--r--src/mame/video/gradius3.c28
-rw-r--r--src/mame/video/grchamp.c52
-rw-r--r--src/mame/video/gridlee.c22
-rw-r--r--src/mame/video/groundfx.c24
-rw-r--r--src/mame/video/gstriker.c60
-rw-r--r--src/mame/video/gsword.c42
-rw-r--r--src/mame/video/gtia.c16
-rw-r--r--src/mame/video/gtia.h2
-rw-r--r--src/mame/video/gticlub.c88
-rw-r--r--src/mame/video/gticlub.h6
-rw-r--r--src/mame/video/gumbo.c12
-rw-r--r--src/mame/video/gunbustr.c32
-rw-r--r--src/mame/video/gundealr.c24
-rw-r--r--src/mame/video/gunsmoke.c46
-rw-r--r--src/mame/video/gyruss.c30
-rw-r--r--src/mame/video/hanaawas.c24
-rw-r--r--src/mame/video/harddriv.c54
-rw-r--r--src/mame/video/hcastle.c54
-rw-r--r--src/mame/video/hexion.c28
-rw-r--r--src/mame/video/higemaru.c38
-rw-r--r--src/mame/video/himesiki.c24
-rw-r--r--src/mame/video/hnayayoi.c44
-rw-r--r--src/mame/video/hng64.c144
-rw-r--r--src/mame/video/holeland.c42
-rw-r--r--src/mame/video/homedata.c156
-rw-r--r--src/mame/video/homerun.c26
-rw-r--r--src/mame/video/hyhoo.c26
-rw-r--r--src/mame/video/hyperspt.c44
-rw-r--r--src/mame/video/hyprduel.c108
-rw-r--r--src/mame/video/ikki.c36
-rw-r--r--src/mame/video/inufuku.c34
-rw-r--r--src/mame/video/iqblock.c16
-rw-r--r--src/mame/video/irobot.c30
-rw-r--r--src/mame/video/ironhors.c76
-rw-r--r--src/mame/video/itech32.c106
-rw-r--r--src/mame/video/itech8.c66
-rw-r--r--src/mame/video/jack.c38
-rw-r--r--src/mame/video/jackal.c44
-rw-r--r--src/mame/video/jagblit.c6
-rw-r--r--src/mame/video/jagobj.c10
-rw-r--r--src/mame/video/jaguar.c90
-rw-r--r--src/mame/video/jailbrek.c28
-rw-r--r--src/mame/video/jalblend.c6
-rw-r--r--src/mame/video/jalblend.h2
-rw-r--r--src/mame/video/jedi.c26
-rw-r--r--src/mame/video/jpmimpct.c16
-rw-r--r--src/mame/video/kan_panb.c38
-rw-r--r--src/mame/video/kan_pand.c8
-rw-r--r--src/mame/video/kaneko16.c80
-rw-r--r--src/mame/video/kangaroo.c28
-rw-r--r--src/mame/video/karnov.c52
-rw-r--r--src/mame/video/kchamp.c36
-rw-r--r--src/mame/video/kickgoal.c42
-rw-r--r--src/mame/video/kingobox.c58
-rw-r--r--src/mame/video/klax.c6
-rw-r--r--src/mame/video/kncljoe.c40
-rw-r--r--src/mame/video/konamigx.c160
-rw-r--r--src/mame/video/konamiic.c420
-rw-r--r--src/mame/video/konamiic.h66
-rw-r--r--src/mame/video/konicdev.c426
-rw-r--r--src/mame/video/konicdev.h20
-rw-r--r--src/mame/video/kopunch.c20
-rw-r--r--src/mame/video/ksayakyu.c26
-rw-r--r--src/mame/video/kyugo.c36
-rw-r--r--src/mame/video/labyrunr.c38
-rw-r--r--src/mame/video/ladybug.c80
-rw-r--r--src/mame/video/ladyfrog.c52
-rw-r--r--src/mame/video/lasso.c82
-rw-r--r--src/mame/video/lastduel.c66
-rw-r--r--src/mame/video/lazercmd.c10
-rw-r--r--src/mame/video/legionna.c84
-rw-r--r--src/mame/video/leland.c62
-rw-r--r--src/mame/video/lemmings.c40
-rw-r--r--src/mame/video/lethal.c16
-rw-r--r--src/mame/video/lethalj.c22
-rw-r--r--src/mame/video/liberate.c86
-rw-r--r--src/mame/video/liberatr.c12
-rw-r--r--src/mame/video/lkage.c28
-rw-r--r--src/mame/video/lockon.c82
-rw-r--r--src/mame/video/lordgun.c60
-rw-r--r--src/mame/video/lsasquad.c44
-rw-r--r--src/mame/video/lucky74.c16
-rw-r--r--src/mame/video/lvcards.c46
-rw-r--r--src/mame/video/lwings.c58
-rw-r--r--src/mame/video/m10.c30
-rw-r--r--src/mame/video/m107.c52
-rw-r--r--src/mame/video/m52.c92
-rw-r--r--src/mame/video/m57.c40
-rw-r--r--src/mame/video/m58.c56
-rw-r--r--src/mame/video/m62.c168
-rw-r--r--src/mame/video/m72.c118
-rw-r--r--src/mame/video/m90.c78
-rw-r--r--src/mame/video/m92.c78
-rw-r--r--src/mame/video/macrossp.c64
-rw-r--r--src/mame/video/madalien.c58
-rw-r--r--src/mame/video/madmotor.c14
-rw-r--r--src/mame/video/magmax.c32
-rw-r--r--src/mame/video/mainevt.c26
-rw-r--r--src/mame/video/mainsnk.c26
-rw-r--r--src/mame/video/malzak.c6
-rw-r--r--src/mame/video/mappy.c84
-rw-r--r--src/mame/video/marineb.c80
-rw-r--r--src/mame/video/mario.c44
-rw-r--r--src/mame/video/markham.c30
-rw-r--r--src/mame/video/matmania.c32
-rw-r--r--src/mame/video/mcatadv.c34
-rw-r--r--src/mame/video/mcd212.c116
-rw-r--r--src/mame/video/mcd212.h4
-rw-r--r--src/mame/video/mcr.c62
-rw-r--r--src/mame/video/mcr3.c56
-rw-r--r--src/mame/video/mcr68.c78
-rw-r--r--src/mame/video/meadows.c22
-rw-r--r--src/mame/video/megasys1.c70
-rw-r--r--src/mame/video/megazone.c24
-rw-r--r--src/mame/video/mermaid.c112
-rw-r--r--src/mame/video/metlclsh.c30
-rw-r--r--src/mame/video/metro.c80
-rw-r--r--src/mame/video/mexico86.c16
-rw-r--r--src/mame/video/micro3d.c36
-rw-r--r--src/mame/video/midtunit.c14
-rw-r--r--src/mame/video/midvunit.c60
-rw-r--r--src/mame/video/midyunit.c58
-rw-r--r--src/mame/video/midzeus.c56
-rw-r--r--src/mame/video/midzeus2.c52
-rw-r--r--src/mame/video/mikie.c34
-rw-r--r--src/mame/video/mitchell.c66
-rw-r--r--src/mame/video/mjkjidai.c30
-rw-r--r--src/mame/video/model1.c82
-rw-r--r--src/mame/video/model2.c50
-rw-r--r--src/mame/video/model3.c156
-rw-r--r--src/mame/video/momoko.c48
-rw-r--r--src/mame/video/moo.c18
-rw-r--r--src/mame/video/mosaic.c12
-rw-r--r--src/mame/video/mouser.c28
-rw-r--r--src/mame/video/mrdo.c36
-rw-r--r--src/mame/video/mrflea.c24
-rw-r--r--src/mame/video/mrjong.c30
-rw-r--r--src/mame/video/ms32.c72
-rw-r--r--src/mame/video/msisaac.c40
-rw-r--r--src/mame/video/mugsmash.c22
-rw-r--r--src/mame/video/munchmo.c36
-rw-r--r--src/mame/video/mustache.c30
-rw-r--r--src/mame/video/mw8080bw.c12
-rw-r--r--src/mame/video/mystston.c40
-rw-r--r--src/mame/video/mystwarr.c100
-rw-r--r--src/mame/video/n64.c24
-rw-r--r--src/mame/video/n64.h4
-rw-r--r--src/mame/video/n8080.c50
-rw-r--r--src/mame/video/namcofl.c20
-rw-r--r--src/mame/video/namcona1.c86
-rw-r--r--src/mame/video/namconb1.c42
-rw-r--r--src/mame/video/namcos1.c70
-rw-r--r--src/mame/video/namcos2.c60
-rw-r--r--src/mame/video/namcos21.c30
-rw-r--r--src/mame/video/namcos22.c128
-rw-r--r--src/mame/video/namcos86.c72
-rw-r--r--src/mame/video/naughtyb.c30
-rw-r--r--src/mame/video/nbmj8688.c70
-rw-r--r--src/mame/video/nbmj8891.c114
-rw-r--r--src/mame/video/nbmj8900.c96
-rw-r--r--src/mame/video/nbmj8991.c94
-rw-r--r--src/mame/video/nbmj9195.c96
-rw-r--r--src/mame/video/nemesis.c78
-rw-r--r--src/mame/video/neogeo.c156
-rw-r--r--src/mame/video/news.c14
-rw-r--r--src/mame/video/ninjakd2.c90
-rw-r--r--src/mame/video/ninjaw.c16
-rw-r--r--src/mame/video/nitedrvr.c16
-rw-r--r--src/mame/video/niyanpai.c102
-rw-r--r--src/mame/video/nmk16.c218
-rw-r--r--src/mame/video/nova2001.c66
-rw-r--r--src/mame/video/nycaptor.c100
-rw-r--r--src/mame/video/offtwall.c6
-rw-r--r--src/mame/video/ohmygod.c22
-rw-r--r--src/mame/video/ojankohs.c62
-rw-r--r--src/mame/video/oneshot.c38
-rw-r--r--src/mame/video/opwolf.c6
-rw-r--r--src/mame/video/orbit.c18
-rw-r--r--src/mame/video/othldrby.c40
-rw-r--r--src/mame/video/othunder.c22
-rw-r--r--src/mame/video/overdriv.c16
-rw-r--r--src/mame/video/pacland.c84
-rw-r--r--src/mame/video/pacman.c104
-rw-r--r--src/mame/video/pandoras.c32
-rw-r--r--src/mame/video/paradise.c82
-rw-r--r--src/mame/video/parodius.c12
-rw-r--r--src/mame/video/pass.c12
-rw-r--r--src/mame/video/pastelg.c64
-rw-r--r--src/mame/video/pbaction.c30
-rw-r--r--src/mame/video/pcktgal.c26
-rw-r--r--src/mame/video/pgm.c36
-rw-r--r--src/mame/video/phoenix.c64
-rw-r--r--src/mame/video/pingpong.c28
-rw-r--r--src/mame/video/pirates.c24
-rw-r--r--src/mame/video/pitnrun.c66
-rw-r--r--src/mame/video/pktgaldx.c18
-rw-r--r--src/mame/video/playch10.c22
-rw-r--r--src/mame/video/playmark.c120
-rw-r--r--src/mame/video/plygonet.c26
-rw-r--r--src/mame/video/pokechmp.c22
-rw-r--r--src/mame/video/polepos.c88
-rw-r--r--src/mame/video/policetr.c40
-rw-r--r--src/mame/video/polyplay.c12
-rw-r--r--src/mame/video/poolshrk.c8
-rw-r--r--src/mame/video/pooyan.c30
-rw-r--r--src/mame/video/popeye.c52
-rw-r--r--src/mame/video/popper.c42
-rw-r--r--src/mame/video/portrait.c34
-rw-r--r--src/mame/video/powerins.c42
-rw-r--r--src/mame/video/ppu2c0x.c34
-rw-r--r--src/mame/video/ppu2c0x.h4
-rw-r--r--src/mame/video/prehisle.c44
-rw-r--r--src/mame/video/psikyo.c84
-rw-r--r--src/mame/video/psikyo4.c18
-rw-r--r--src/mame/video/psikyosh.c74
-rw-r--r--src/mame/video/psx.c88
-rw-r--r--src/mame/video/psychic5.c80
-rw-r--r--src/mame/video/punchout.c92
-rw-r--r--src/mame/video/pushman.c20
-rw-r--r--src/mame/video/qdrmfgp.c14
-rw-r--r--src/mame/video/qix.c40
-rw-r--r--src/mame/video/quasar.c32
-rw-r--r--src/mame/video/quizdna.c46
-rw-r--r--src/mame/video/quizpani.c14
-rw-r--r--src/mame/video/raiden.c38
-rw-r--r--src/mame/video/rainbow.c18
-rw-r--r--src/mame/video/rallyx.c158
-rw-r--r--src/mame/video/rampart.c8
-rw-r--r--src/mame/video/rastan.c14
-rw-r--r--src/mame/video/rdpblend.h2
-rw-r--r--src/mame/video/rdpspn16.c8
-rw-r--r--src/mame/video/rdpspn16.h2
-rw-r--r--src/mame/video/rdptpipe.c6
-rw-r--r--src/mame/video/rdptpipe.h2
-rw-r--r--src/mame/video/rdptri.h4
-rw-r--r--src/mame/video/realbrk.c88
-rw-r--r--src/mame/video/redalert.c26
-rw-r--r--src/mame/video/redclash.c88
-rw-r--r--src/mame/video/relief.c12
-rw-r--r--src/mame/video/renegade.c28
-rw-r--r--src/mame/video/retofinv.c36
-rw-r--r--src/mame/video/rockrage.c32
-rw-r--r--src/mame/video/rocnrope.c32
-rw-r--r--src/mame/video/rohga.c68
-rw-r--r--src/mame/video/rollerg.c14
-rw-r--r--src/mame/video/rollrace.c42
-rw-r--r--src/mame/video/route16.c24
-rw-r--r--src/mame/video/rpunch.c44
-rw-r--r--src/mame/video/runaway.c26
-rw-r--r--src/mame/video/rungun.c26
-rw-r--r--src/mame/video/sauro.c46
-rw-r--r--src/mame/video/sbasketb.c32
-rw-r--r--src/mame/video/sbugger.c16
-rw-r--r--src/mame/video/scotrsht.c34
-rw-r--r--src/mame/video/sderby.c34
-rw-r--r--src/mame/video/sega16sp.c118
-rw-r--r--src/mame/video/segag80r.c128
-rw-r--r--src/mame/video/segag80v.c14
-rw-r--r--src/mame/video/segahang.c4
-rw-r--r--src/mame/video/segaic16.c74
-rw-r--r--src/mame/video/segaic16.h56
-rw-r--r--src/mame/video/segaic24.c46
-rw-r--r--src/mame/video/segaic24.h10
-rw-r--r--src/mame/video/segaorun.c6
-rw-r--r--src/mame/video/segas16a.c4
-rw-r--r--src/mame/video/segas16b.c6
-rw-r--r--src/mame/video/segas18.c58
-rw-r--r--src/mame/video/segas24.c8
-rw-r--r--src/mame/video/segas32.c132
-rw-r--r--src/mame/video/segaxbd.c6
-rw-r--r--src/mame/video/segaybd.c8
-rw-r--r--src/mame/video/sei_crtc.c18
-rw-r--r--src/mame/video/seibuspi.c90
-rw-r--r--src/mame/video/seicross.c26
-rw-r--r--src/mame/video/senjyo.c58
-rw-r--r--src/mame/video/seta.c186
-rw-r--r--src/mame/video/seta2.c50
-rw-r--r--src/mame/video/sf.c36
-rw-r--r--src/mame/video/shadfrce.c46
-rw-r--r--src/mame/video/shangha3.c26
-rw-r--r--src/mame/video/shangkid.c48
-rw-r--r--src/mame/video/shaolins.c40
-rw-r--r--src/mame/video/shisen.c22
-rw-r--r--src/mame/video/shootout.c34
-rw-r--r--src/mame/video/shuuz.c6
-rw-r--r--src/mame/video/sidearms.c66
-rw-r--r--src/mame/video/sidepckt.c32
-rw-r--r--src/mame/video/silkroad.c30
-rw-r--r--src/mame/video/simpl156.c14
-rw-r--r--src/mame/video/simpsons.c28
-rw-r--r--src/mame/video/sknsspr.c10
-rw-r--r--src/mame/video/sknsspr.h4
-rw-r--r--src/mame/video/skullxbo.c30
-rw-r--r--src/mame/video/skydiver.c32
-rw-r--r--src/mame/video/skyfox.c24
-rw-r--r--src/mame/video/skykid.c46
-rw-r--r--src/mame/video/skyraid.c44
-rw-r--r--src/mame/video/slapfght.c60
-rw-r--r--src/mame/video/slapshot.c42
-rw-r--r--src/mame/video/snes.c72
-rw-r--r--src/mame/video/snk.c196
-rw-r--r--src/mame/video/snk6502.c68
-rw-r--r--src/mame/video/snk68.c58
-rw-r--r--src/mame/video/snookr10.c18
-rw-r--r--src/mame/video/solomon.c30
-rw-r--r--src/mame/video/sonson.c34
-rw-r--r--src/mame/video/spacefb.c40
-rw-r--r--src/mame/video/spbactn.c42
-rw-r--r--src/mame/video/spcforce.c8
-rw-r--r--src/mame/video/spdodgeb.c40
-rw-r--r--src/mame/video/speedatk.c20
-rw-r--r--src/mame/video/speedbal.c20
-rw-r--r--src/mame/video/speedspn.c26
-rw-r--r--src/mame/video/splash.c36
-rw-r--r--src/mame/video/sprcros2.c36
-rw-r--r--src/mame/video/sprint2.c78
-rw-r--r--src/mame/video/sprint4.c66
-rw-r--r--src/mame/video/sprint8.c46
-rw-r--r--src/mame/video/spy.c14
-rw-r--r--src/mame/video/srmp2.c58
-rw-r--r--src/mame/video/srumbler.c32
-rw-r--r--src/mame/video/sshangha.c28
-rw-r--r--src/mame/video/sslam.c44
-rw-r--r--src/mame/video/ssozumo.c32
-rw-r--r--src/mame/video/sspeedr.c52
-rw-r--r--src/mame/video/ssrj.c24
-rw-r--r--src/mame/video/ssv.c68
-rw-r--r--src/mame/video/st0016.c44
-rw-r--r--src/mame/video/stactics.c24
-rw-r--r--src/mame/video/stadhero.c16
-rw-r--r--src/mame/video/starcrus.c102
-rw-r--r--src/mame/video/starfire.c26
-rw-r--r--src/mame/video/starshp1.c70
-rw-r--r--src/mame/video/stfight.c52
-rw-r--r--src/mame/video/stlforce.c28
-rw-r--r--src/mame/video/strnskil.c34
-rw-r--r--src/mame/video/stvvdp1.c48
-rw-r--r--src/mame/video/stvvdp2.c304
-rw-r--r--src/mame/video/subs.c36
-rw-r--r--src/mame/video/suna16.c42
-rw-r--r--src/mame/video/suna8.c70
-rw-r--r--src/mame/video/supbtime.c6
-rw-r--r--src/mame/video/superchs.c32
-rw-r--r--src/mame/video/superqix.c56
-rw-r--r--src/mame/video/suprloco.c34
-rw-r--r--src/mame/video/suprnova.c24
-rw-r--r--src/mame/video/suprridr.c32
-rw-r--r--src/mame/video/suprslam.c26
-rw-r--r--src/mame/video/surpratk.c12
-rw-r--r--src/mame/video/system1.c76
-rw-r--r--src/mame/video/system16.c78
-rw-r--r--src/mame/video/tagteam.c34
-rw-r--r--src/mame/video/tail2nos.c34
-rw-r--r--src/mame/video/taito_b.c52
-rw-r--r--src/mame/video/taito_f2.c132
-rw-r--r--src/mame/video/taito_f3.c182
-rw-r--r--src/mame/video/taito_h.c66
-rw-r--r--src/mame/video/taito_l.c84
-rw-r--r--src/mame/video/taito_o.c12
-rw-r--r--src/mame/video/taito_z.c118
-rw-r--r--src/mame/video/taitoair.c24
-rw-r--r--src/mame/video/taitoic.c104
-rw-r--r--src/mame/video/taitojc.c60
-rw-r--r--src/mame/video/taitosj.c114
-rw-r--r--src/mame/video/tank8.c56
-rw-r--r--src/mame/video/tankbatt.c24
-rw-r--r--src/mame/video/tankbust.c32
-rw-r--r--src/mame/video/taotaido.c26
-rw-r--r--src/mame/video/targeth.c18
-rw-r--r--src/mame/video/tatsumi.c166
-rw-r--r--src/mame/video/taxidrvr.c12
-rw-r--r--src/mame/video/tbowl.c52
-rw-r--r--src/mame/video/tceptor.c94
-rw-r--r--src/mame/video/tecmo.c38
-rw-r--r--src/mame/video/tecmo16.c102
-rw-r--r--src/mame/video/tehkanwc.c40
-rw-r--r--src/mame/video/terracre.c44
-rw-r--r--src/mame/video/tetrisp2.c88
-rw-r--r--src/mame/video/thedeep.c22
-rw-r--r--src/mame/video/thepit.c36
-rw-r--r--src/mame/video/thief.c34
-rw-r--r--src/mame/video/thoop2.c32
-rw-r--r--src/mame/video/thunderj.c12
-rw-r--r--src/mame/video/thunderx.c14
-rw-r--r--src/mame/video/tia.c36
-rw-r--r--src/mame/video/tia.h2
-rw-r--r--src/mame/video/tiamc1.c44
-rw-r--r--src/mame/video/tigeroad.c44
-rw-r--r--src/mame/video/timelimt.c28
-rw-r--r--src/mame/video/timeplt.c26
-rw-r--r--src/mame/video/tmnt.c172
-rw-r--r--src/mame/video/tnzs.c26
-rw-r--r--src/mame/video/toaplan1.c148
-rw-r--r--src/mame/video/toaplan2.c80
-rw-r--r--src/mame/video/toki.c48
-rw-r--r--src/mame/video/toobin.c42
-rw-r--r--src/mame/video/topspeed.c24
-rw-r--r--src/mame/video/toypop.c46
-rw-r--r--src/mame/video/tp84.c34
-rw-r--r--src/mame/video/trackfld.c44
-rw-r--r--src/mame/video/travrusa.c56
-rw-r--r--src/mame/video/triplhnt.c20
-rw-r--r--src/mame/video/truco.c4
-rw-r--r--src/mame/video/trucocl.c10
-rw-r--r--src/mame/video/tryout.c40
-rw-r--r--src/mame/video/tsamurai.c46
-rw-r--r--src/mame/video/tubep.c52
-rw-r--r--src/mame/video/tumbleb.c170
-rw-r--r--src/mame/video/tumblep.c6
-rw-r--r--src/mame/video/tunhunt.c68
-rw-r--r--src/mame/video/turbo.c64
-rw-r--r--src/mame/video/tutankhm.c12
-rw-r--r--src/mame/video/twin16.c78
-rw-r--r--src/mame/video/twincobr.c86
-rw-r--r--src/mame/video/tx1.c172
-rw-r--r--src/mame/video/ultraman.c32
-rw-r--r--src/mame/video/ultratnk.c64
-rw-r--r--src/mame/video/undrfire.c78
-rw-r--r--src/mame/video/unico.c68
-rw-r--r--src/mame/video/usgames.c14
-rw-r--r--src/mame/video/vaportra.c34
-rw-r--r--src/mame/video/vastar.c36
-rw-r--r--src/mame/video/vball.c36
-rw-r--r--src/mame/video/vdc.c52
-rw-r--r--src/mame/video/vendetta.c16
-rw-r--r--src/mame/video/vertigo.c22
-rw-r--r--src/mame/video/vicdual.c12
-rw-r--r--src/mame/video/victory.c98
-rw-r--r--src/mame/video/videopin.c12
-rw-r--r--src/mame/video/vigilant.c84
-rw-r--r--src/mame/video/vindictr.c18
-rw-r--r--src/mame/video/volfied.c26
-rw-r--r--src/mame/video/vrender0.c2
-rw-r--r--src/mame/video/vsnes.c8
-rw-r--r--src/mame/video/vulgus.c54
-rw-r--r--src/mame/video/warpwarp.c24
-rw-r--r--src/mame/video/warriorb.c18
-rw-r--r--src/mame/video/wc90.c58
-rw-r--r--src/mame/video/wc90b.c26
-rw-r--r--src/mame/video/wecleman.c112
-rw-r--r--src/mame/video/welltris.c48
-rw-r--r--src/mame/video/wgp.c54
-rw-r--r--src/mame/video/williams.c80
-rw-r--r--src/mame/video/wiping.c20
-rw-r--r--src/mame/video/wiz.c78
-rw-r--r--src/mame/video/wolfpack.c104
-rw-r--r--src/mame/video/wrally.c20
-rw-r--r--src/mame/video/wwfsstar.c20
-rw-r--r--src/mame/video/wwfwfest.c32
-rw-r--r--src/mame/video/xain.c52
-rw-r--r--src/mame/video/xevious.c74
-rw-r--r--src/mame/video/xexex.c16
-rw-r--r--src/mame/video/xmen.c22
-rw-r--r--src/mame/video/xorworld.c34
-rw-r--r--src/mame/video/xxmissio.c26
-rw-r--r--src/mame/video/xybots.c8
-rw-r--r--src/mame/video/xyonix.c10
-rw-r--r--src/mame/video/ygv608.c66
-rw-r--r--src/mame/video/yiear.c30
-rw-r--r--src/mame/video/yunsun16.c26
-rw-r--r--src/mame/video/yunsung8.c24
-rw-r--r--src/mame/video/zac2650.c70
-rw-r--r--src/mame/video/zaccaria.c34
-rw-r--r--src/mame/video/zaxxon.c82
-rw-r--r--src/mame/video/zerozone.c10
-rw-r--r--src/mame/video/zodiack.c52
-rw-r--r--src/osd/sdl/debugosx.h28
-rw-r--r--src/osd/sdl/debugwin.c46
-rw-r--r--src/osd/sdl/debugwin.h2
-rw-r--r--src/osd/sdl/drawogl.c16
-rw-r--r--src/osd/sdl/dview.c4
-rw-r--r--src/osd/sdl/dview.h2
-rw-r--r--src/osd/sdl/input.c58
-rw-r--r--src/osd/sdl/input.h12
-rw-r--r--src/osd/sdl/osdsdl.h2
-rw-r--r--src/osd/sdl/output.c8
-rw-r--r--src/osd/sdl/output.h2
-rw-r--r--src/osd/sdl/sdlmain.c14
-rw-r--r--src/osd/sdl/sound.c26
-rw-r--r--src/osd/sdl/video.c36
-rw-r--r--src/osd/sdl/video.h2
-rw-r--r--src/osd/sdl/window.c69
-rw-r--r--src/osd/sdl/window.h13
-rw-r--r--src/osd/windows/debugwin.c122
-rw-r--r--src/osd/windows/debugwin.h2
-rw-r--r--src/osd/windows/drawd3d.c6
-rw-r--r--src/osd/windows/drawdd.c6
-rw-r--r--src/osd/windows/input.c78
-rw-r--r--src/osd/windows/input.h4
-rw-r--r--src/osd/windows/output.c14
-rw-r--r--src/osd/windows/output.h2
-rw-r--r--src/osd/windows/sound.c14
-rw-r--r--src/osd/windows/sound.h2
-rw-r--r--src/osd/windows/video.c28
-rw-r--r--src/osd/windows/video.h2
-rw-r--r--src/osd/windows/window.c84
-rw-r--r--src/osd/windows/window.h24
-rw-r--r--src/osd/windows/winmain.c12
-rw-r--r--src/osd/windows/winmenu.c2
2557 files changed, 54180 insertions, 54127 deletions
diff --git a/src/emu/audio/generic.c b/src/emu/audio/generic.c
index fc2919d9e54..a40474d9da2 100644
--- a/src/emu/audio/generic.c
+++ b/src/emu/audio/generic.c
@@ -35,11 +35,11 @@ struct _generic_audio_private
register for save states
-------------------------------------------------*/
-int generic_sound_init(running_machine *machine)
+int generic_sound_init(running_machine &machine)
{
generic_audio_private *state;
- state = machine->generic_audio_data = auto_alloc_clear(machine, generic_audio_private);
+ state = machine.generic_audio_data = auto_alloc_clear(machine, generic_audio_private);
/* register globals with the save state system */
state_save_register_global_array(machine, state->latched_value);
@@ -67,7 +67,7 @@ int generic_sound_init(running_machine *machine)
static TIMER_CALLBACK( latch_callback )
{
- generic_audio_private *state = machine->generic_audio_data;
+ generic_audio_private *state = machine.generic_audio_data;
UINT16 value = param >> 8;
int which = param & 0xff;
@@ -87,7 +87,7 @@ static TIMER_CALLBACK( latch_callback )
INLINE void latch_w(address_space *space, int which, UINT16 value)
{
- space->machine->scheduler().synchronize(FUNC(latch_callback), which | (value << 8));
+ space->machine().scheduler().synchronize(FUNC(latch_callback), which | (value << 8));
}
@@ -97,7 +97,7 @@ INLINE void latch_w(address_space *space, int which, UINT16 value)
INLINE UINT16 latch_r(address_space *space, int which)
{
- generic_audio_private *state = space->machine->generic_audio_data;
+ generic_audio_private *state = space->machine().generic_audio_data;
state->latch_read[which] = 1;
return state->latched_value[which];
}
@@ -109,7 +109,7 @@ INLINE UINT16 latch_r(address_space *space, int which)
INLINE void latch_clear(address_space *space, int which)
{
- generic_audio_private *state = space->machine->generic_audio_data;
+ generic_audio_private *state = space->machine().generic_audio_data;
state->latched_value[which] = state->latch_clear_value;
}
@@ -160,9 +160,9 @@ WRITE8_HANDLER( soundlatch4_clear_w ) { latch_clear(space, 3); }
value for all sound latches
-------------------------------------------------*/
-void soundlatch_setclearedvalue(running_machine *machine, int value)
+void soundlatch_setclearedvalue(running_machine &machine, int value)
{
- generic_audio_private *state = machine->generic_audio_data;
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
+ generic_audio_private *state = machine.generic_audio_data;
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call soundlatch_setclearedvalue at init time!");
state->latch_clear_value = value;
}
diff --git a/src/emu/audio/generic.h b/src/emu/audio/generic.h
index 319eb2d450f..d693e723d40 100644
--- a/src/emu/audio/generic.h
+++ b/src/emu/audio/generic.h
@@ -22,7 +22,7 @@
***************************************************************************/
-int generic_sound_init(running_machine *machine);
+int generic_sound_init(running_machine &machine);
/* latch readers */
READ8_HANDLER( soundlatch_r );
@@ -53,7 +53,7 @@ WRITE8_HANDLER( soundlatch4_clear_w );
/* If you're going to use soundlatchX_clear_w, and the cleared value is
something other than 0x00, use this function from machine_init. Note
that this one call effects all 4 latches */
-void soundlatch_setclearedvalue(running_machine *machine, int value);
+void soundlatch_setclearedvalue(running_machine &machine, int value);
#endif /* __SOUND_GENERIC_H__ */
diff --git a/src/emu/cheat.c b/src/emu/cheat.c
index 2391b8c53a8..e26b1ad0af6 100644
--- a/src/emu/cheat.c
+++ b/src/emu/cheat.c
@@ -190,7 +190,7 @@ cheat_parameter::cheat_parameter(cheat_manager &manager, symbol_table &symbols,
int format = xml_get_attribute_int_format(itemnode, "value");
// allocate and append a new item
- item &curitem = m_itemlist.append(*auto_alloc(&manager.machine(), item(itemnode->value, value, format)));
+ item &curitem = m_itemlist.append(*auto_alloc(manager.machine(), item(itemnode->value, value, format)));
// ensure the maximum expands to suit
m_maxval = MAX(m_maxval, curitem.value());
@@ -366,11 +366,11 @@ cheat_script::cheat_script(cheat_manager &manager, symbol_table &symbols, const
{
// handle action nodes
if (strcmp(entrynode->name, "action") == 0)
- m_entrylist.append(*auto_alloc(&manager.machine(), script_entry(manager, symbols, filename, *entrynode, true)));
+ m_entrylist.append(*auto_alloc(manager.machine(), script_entry(manager, symbols, filename, *entrynode, true)));
// handle output nodes
else if (strcmp(entrynode->name, "output") == 0)
- m_entrylist.append(*auto_alloc(&manager.machine(), script_entry(manager, symbols, filename, *entrynode, false)));
+ m_entrylist.append(*auto_alloc(manager.machine(), script_entry(manager, symbols, filename, *entrynode, false)));
// anything else is ignored
else
@@ -476,7 +476,7 @@ cheat_script::script_entry::script_entry(cheat_manager &manager, symbol_table &s
int totalargs = 0;
for (xml_data_node *argnode = xml_get_sibling(entrynode.child, "argument"); argnode != NULL; argnode = xml_get_sibling(argnode->next, "argument"))
{
- output_argument &curarg = m_arglist.append(*auto_alloc(&manager.machine(), output_argument(manager, symbols, filename, *argnode)));
+ output_argument &curarg = m_arglist.append(*auto_alloc(manager.machine(), output_argument(manager, symbols, filename, *argnode)));
// verify we didn't overrun the argument count
totalargs += curarg.count();
@@ -766,7 +766,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
if (paramnode != NULL)
{
// load this parameter
- m_parameter = auto_alloc(&manager.machine(), cheat_parameter(manager, m_symbols, filename, *paramnode));
+ m_parameter = auto_alloc(manager.machine(), cheat_parameter(manager, m_symbols, filename, *paramnode));
// only one parameter allowed
paramnode = xml_get_sibling(paramnode->next, "parameter");
@@ -778,7 +778,7 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
for (xml_data_node *scriptnode = xml_get_sibling(cheatnode.child, "script"); scriptnode != NULL; scriptnode = xml_get_sibling(scriptnode->next, "script"))
{
// load this entry
- cheat_script *curscript = auto_alloc(&manager.machine(), cheat_script(manager, m_symbols, filename, *scriptnode));
+ cheat_script *curscript = auto_alloc(manager.machine(), cheat_script(manager, m_symbols, filename, *scriptnode));
// if we have a script already for this slot, it is an error
cheat_script *&slot = script_for_state(curscript->state());
@@ -803,11 +803,11 @@ cheat_entry::cheat_entry(cheat_manager &manager, symbol_table &globaltable, cons
cheat_entry::~cheat_entry()
{
- auto_free(&m_manager.machine(), m_on_script);
- auto_free(&m_manager.machine(), m_off_script);
- auto_free(&m_manager.machine(), m_change_script);
- auto_free(&m_manager.machine(), m_run_script);
- auto_free(&m_manager.machine(), m_parameter);
+ auto_free(m_manager.machine(), m_on_script);
+ auto_free(m_manager.machine(), m_off_script);
+ auto_free(m_manager.machine(), m_change_script);
+ auto_free(m_manager.machine(), m_run_script);
+ auto_free(m_manager.machine(), m_parameter);
}
@@ -1107,7 +1107,7 @@ cheat_manager::cheat_manager(running_machine &machine)
// we rely on the debugger expression callbacks; if the debugger isn't
// enabled, we must jumpstart them manually
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0)
- debug_cpu_init(&machine);
+ debug_cpu_init(machine);
// configure for memory access (shared with debugger)
debug_cpu_configure_memory(machine, m_symtable);
@@ -1446,7 +1446,7 @@ void cheat_manager::load_cheats(const char *filename)
for (xml_data_node *cheatnode = xml_get_sibling(mamecheatnode->child, "cheat"); cheatnode != NULL; cheatnode = xml_get_sibling(cheatnode->next, "cheat"))
{
// load this entry
- cheat_entry *curcheat = auto_alloc(&m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
+ cheat_entry *curcheat = auto_alloc(m_machine, cheat_entry(*this, m_symtable, filename, *cheatnode));
// make sure we're not a duplicate
cheat_entry *scannode = NULL;
@@ -1462,7 +1462,7 @@ void cheat_manager::load_cheats(const char *filename)
if (scannode == NULL)
m_cheatlist.append(*curcheat);
else
- auto_free(&m_machine, curcheat);
+ auto_free(m_machine, curcheat);
}
// free the file and loop for the next one
diff --git a/src/emu/config.c b/src/emu/config.c
index af7ea10f395..3f1b7e18d93 100644
--- a/src/emu/config.c
+++ b/src/emu/config.c
@@ -46,8 +46,8 @@ static config_type *typelist;
FUNCTION PROTOTYPES
***************************************************************************/
-static int config_load_xml(running_machine *machine, emu_file &file, int type);
-static int config_save_xml(running_machine *machine, emu_file &file, int type);
+static int config_load_xml(running_machine &machine, emu_file &file, int type);
+static int config_save_xml(running_machine &machine, emu_file &file, int type);
@@ -61,7 +61,7 @@ static int config_save_xml(running_machine *machine, emu_file &file, int type);
*
*************************************/
-void config_init(running_machine *machine)
+void config_init(running_machine &machine)
{
typelist = NULL;
}
@@ -75,7 +75,7 @@ void config_init(running_machine *machine)
*
*************************************/
-void config_register(running_machine *machine, const char *nodename, config_callback_func load, config_callback_func save)
+void config_register(running_machine &machine, const char *nodename, config_callback_func load, config_callback_func save)
{
config_type *newtype;
config_type **ptype;
@@ -100,9 +100,9 @@ void config_register(running_machine *machine, const char *nodename, config_call
*
*************************************/
-int config_load_settings(running_machine *machine)
+int config_load_settings(running_machine &machine)
{
- const char *controller = machine->options().ctrlr();
+ const char *controller = machine.options().ctrlr();
config_type *type;
int loaded = 0;
@@ -114,7 +114,7 @@ int config_load_settings(running_machine *machine)
if (controller[0] != 0)
{
/* open the config file */
- emu_file file(machine->options().ctrlr_path(), OPEN_FLAG_READ);
+ emu_file file(machine.options().ctrlr_path(), OPEN_FLAG_READ);
file_error filerr = file.open(controller, ".cfg");
if (filerr != FILERR_NONE)
@@ -126,13 +126,13 @@ int config_load_settings(running_machine *machine)
}
/* next load the defaults file */
- emu_file file(machine->options().cfg_directory(), OPEN_FLAG_READ);
+ emu_file file(machine.options().cfg_directory(), OPEN_FLAG_READ);
file_error filerr = file.open("default.cfg");
if (filerr == FILERR_NONE)
config_load_xml(machine, file, CONFIG_TYPE_DEFAULT);
/* finally, load the game-specific file */
- filerr = file.open(machine->basename(), ".cfg");
+ filerr = file.open(machine.basename(), ".cfg");
if (filerr == FILERR_NONE)
loaded = config_load_xml(machine, file, CONFIG_TYPE_GAME);
@@ -146,7 +146,7 @@ int config_load_settings(running_machine *machine)
}
-void config_save_settings(running_machine *machine)
+void config_save_settings(running_machine &machine)
{
config_type *type;
@@ -155,13 +155,13 @@ void config_save_settings(running_machine *machine)
(*type->save)(machine, CONFIG_TYPE_INIT, NULL);
/* save the defaults file */
- emu_file file(machine->options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ emu_file file(machine.options().cfg_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open("default.cfg");
if (filerr == FILERR_NONE)
config_save_xml(machine, file, CONFIG_TYPE_DEFAULT);
/* finally, save the game-specific file */
- filerr = file.open(machine->basename(), ".cfg");
+ filerr = file.open(machine.basename(), ".cfg");
if (filerr == FILERR_NONE)
config_save_xml(machine, file, CONFIG_TYPE_GAME);
@@ -178,7 +178,7 @@ void config_save_settings(running_machine *machine)
*
*************************************/
-static int config_load_xml(running_machine *machine, emu_file &file, int which_type)
+static int config_load_xml(running_machine &machine, emu_file &file, int which_type)
{
xml_data_node *root, *confignode, *systemnode;
config_type *type;
@@ -201,13 +201,13 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
goto error;
/* strip off all the path crap from the source filename */
- srcfile = strrchr(machine->system().source_file, '/');
+ srcfile = strrchr(machine.system().source_file, '/');
if (!srcfile)
- srcfile = strrchr(machine->system().source_file, '\\');
+ srcfile = strrchr(machine.system().source_file, '\\');
if (!srcfile)
- srcfile = strrchr(machine->system().source_file, ':');
+ srcfile = strrchr(machine.system().source_file, ':');
if (!srcfile)
- srcfile = machine->system().source_file;
+ srcfile = machine.system().source_file;
else
srcfile++;
@@ -223,7 +223,7 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
{
case CONFIG_TYPE_GAME:
/* only match on the specific game name */
- if (strcmp(name, machine->system().name) != 0)
+ if (strcmp(name, machine.system().name) != 0)
continue;
break;
@@ -238,9 +238,9 @@ static int config_load_xml(running_machine *machine, emu_file &file, int which_t
const game_driver *clone_of;
/* match on: default, game name, source file name, parent name, grandparent name */
if (strcmp(name, "default") != 0 &&
- strcmp(name, machine->system().name) != 0 &&
+ strcmp(name, machine.system().name) != 0 &&
strcmp(name, srcfile) != 0 &&
- ((clone_of = driver_get_clone(&machine->system())) == NULL || strcmp(name, clone_of->name) != 0) &&
+ ((clone_of = driver_get_clone(&machine.system())) == NULL || strcmp(name, clone_of->name) != 0) &&
(clone_of == NULL || ((clone_of = driver_get_clone(clone_of)) == NULL) || strcmp(name, clone_of->name) != 0))
continue;
break;
@@ -279,7 +279,7 @@ error:
*
*************************************/
-static int config_save_xml(running_machine *machine, emu_file &file, int which_type)
+static int config_save_xml(running_machine &machine, emu_file &file, int which_type)
{
xml_data_node *root = xml_file_create();
xml_data_node *confignode, *systemnode;
@@ -299,7 +299,7 @@ static int config_save_xml(running_machine *machine, emu_file &file, int which_t
systemnode = xml_add_child(confignode, "system", NULL);
if (!systemnode)
goto error;
- xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine->system().name);
+ xml_set_attribute(systemnode, "name", (which_type == CONFIG_TYPE_DEFAULT) ? "default" : machine.system().name);
/* create the input node and write it out */
/* loop over all registrants and call their save function */
diff --git a/src/emu/config.h b/src/emu/config.h
index c34bb1bea6b..4dc13486b6c 100644
--- a/src/emu/config.h
+++ b/src/emu/config.h
@@ -43,7 +43,7 @@ enum
*
*************************************/
-typedef void (*config_callback_func)(running_machine *machine, int config_type, xml_data_node *parentnode);
+typedef void (*config_callback_func)(running_machine &machine, int config_type, xml_data_node *parentnode);
@@ -53,9 +53,9 @@ typedef void (*config_callback_func)(running_machine *machine, int config_type,
*
*************************************/
-void config_init(running_machine *machine);
-void config_register(running_machine *machine, const char *nodename, config_callback_func load, config_callback_func save);
-int config_load_settings(running_machine *machine);
-void config_save_settings(running_machine *machine);
+void config_init(running_machine &machine);
+void config_register(running_machine &machine, const char *nodename, config_callback_func load, config_callback_func save);
+int config_load_settings(running_machine &machine);
+void config_save_settings(running_machine &machine);
#endif /* __CONFIG_H__ */
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index 2b4804cd13e..fb38ee505da 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -211,17 +211,17 @@ device_config *adsp2181_device_config::static_alloc_device_config(const machine_
device_t *adsp2100_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, adsp2100_device(machine, *this));
+ return auto_alloc(machine, adsp2100_device(machine, *this));
}
device_t *adsp2101_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, adsp2101_device(machine, *this));
+ return auto_alloc(machine, adsp2101_device(machine, *this));
}
device_t *adsp2181_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, adsp2181_device(machine, *this));
+ return auto_alloc(machine, adsp2181_device(machine, *this));
}
diff --git a/src/emu/cpu/alph8201/alph8201.c b/src/emu/cpu/alph8201/alph8201.c
index b947f79ac6f..fb95ddf6c10 100644
--- a/src/emu/cpu/alph8201/alph8201.c
+++ b/src/emu/cpu/alph8201/alph8201.c
@@ -298,7 +298,7 @@ INLINE void M_UNDEFINED(alpha8201_state *cpustate)
mame_printf_debug("alpha8201: cpustate->PC = %03x, Unimplemented opcode = %02x\n", cpustate->PC-1, M_RDMEM(cpustate->PC-1));
#endif
#if BREAK_ON_UNKNOWN_OPCODE
- debugger_break(cpustate->device->machine);
+ debugger_break(cpustate->device->machine());
#endif
}
@@ -311,7 +311,7 @@ INLINE void M_UNDEFINED2(alpha8201_state *cpustate)
mame_printf_debug("alpha8201: cpustate->PC = %03x, Unimplemented opcode = %02x,%02x\n", cpustate->PC-2, op,imm);
#endif
#if BREAK_ON_UNKNOWN_OPCODE
- debugger_break(cpustate->device->machine);
+ debugger_break(cpustate->device->machine());
#endif
}
diff --git a/src/emu/cpu/am29000/am29000.c b/src/emu/cpu/am29000/am29000.c
index 6dc4efcae5c..cbaf9a238fb 100644
--- a/src/emu/cpu/am29000/am29000.c
+++ b/src/emu/cpu/am29000/am29000.c
@@ -388,7 +388,7 @@ INLINE void fetch_decode(am29000_state *am29000)
static CPU_EXECUTE( am29000 )
{
am29000_state *am29000 = get_safe_token(device);
- UINT32 call_debugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
+ UINT32 call_debugger = (device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
external_irq_check(am29000);
diff --git a/src/emu/cpu/asap/asap.c b/src/emu/cpu/asap/asap.c
index ee9f35ce217..adaed749d75 100644
--- a/src/emu/cpu/asap/asap.c
+++ b/src/emu/cpu/asap/asap.c
@@ -194,7 +194,7 @@ device_config *asap_device_config::static_alloc_device_config(const machine_conf
device_t *asap_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, asap_device(machine, *this));
+ return auto_alloc(machine, asap_device(machine, *this));
}
diff --git a/src/emu/cpu/cop400/cop400.c b/src/emu/cpu/cop400/cop400.c
index fc2240c8f96..3a0c74a10aa 100644
--- a/src/emu/cpu/cop400/cop400.c
+++ b/src/emu/cpu/cop400/cop400.c
@@ -886,14 +886,14 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
/* allocate serial timer */
- cpustate->serial_timer = device->machine->scheduler().timer_alloc(FUNC(serial_tick), cpustate);
+ cpustate->serial_timer = device->machine().scheduler().timer_alloc(FUNC(serial_tick), cpustate);
cpustate->serial_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
/* allocate counter timer */
if (has_counter)
{
- cpustate->counter_timer = device->machine->scheduler().timer_alloc(FUNC(counter_tick), cpustate);
+ cpustate->counter_timer = device->machine().scheduler().timer_alloc(FUNC(counter_tick), cpustate);
cpustate->counter_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16 / 4));
}
@@ -901,7 +901,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (has_inil)
{
- cpustate->inil_timer = device->machine->scheduler().timer_alloc(FUNC(inil_tick), cpustate);
+ cpustate->inil_timer = device->machine().scheduler().timer_alloc(FUNC(inil_tick), cpustate);
cpustate->inil_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
@@ -909,7 +909,7 @@ static void cop400_init(legacy_cpu_device *device, UINT8 g_mask, UINT8 d_mask, U
if (cpustate->intf->microbus == COP400_MICROBUS_ENABLED)
{
- cpustate->microbus_timer = device->machine->scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
+ cpustate->microbus_timer = device->machine().scheduler().timer_alloc(FUNC(microbus_tick), cpustate);
cpustate->microbus_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock() / 16));
}
diff --git a/src/emu/cpu/cosmac/cosmac.c b/src/emu/cpu/cosmac/cosmac.c
index fa65160de7b..b7cbbfc17d6 100644
--- a/src/emu/cpu/cosmac/cosmac.c
+++ b/src/emu/cpu/cosmac/cosmac.c
@@ -214,7 +214,7 @@ device_config *cosmac_device_config::static_alloc_device_config(const machine_co
device_t *cosmac_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cosmac_device(machine, *this));
+ return auto_alloc(machine, cosmac_device(machine, *this));
}
diff --git a/src/emu/cpu/cubeqcpu/cubeqcpu.c b/src/emu/cpu/cubeqcpu/cubeqcpu.c
index e4b5c8d2f16..963eaec21bb 100644
--- a/src/emu/cpu/cubeqcpu/cubeqcpu.c
+++ b/src/emu/cpu/cubeqcpu/cubeqcpu.c
@@ -275,7 +275,7 @@ static void cquestsnd_state_register(device_t *device)
device->save_item(NAME(cpustate->prev_ipram));
device->save_item(NAME(cpustate->prev_ipwrt));
- device->machine->state().register_postload(cquestsnd_postload, (void *)device);
+ device->machine().state().register_postload(cquestsnd_postload, (void *)device);
}
static CPU_INIT( cquestsnd )
@@ -286,14 +286,14 @@ static CPU_INIT( cquestsnd )
memset(cpustate, 0, sizeof(*cpustate));
cpustate->dac_w = _config->dac_w;
- cpustate->sound_data = (UINT16*)device->machine->region(_config->sound_data_region)->base();
+ cpustate->sound_data = (UINT16*)device->machine().region(_config->sound_data_region)->base();
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
/* Allocate RAM shared with 68000 */
- cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096/2);
+ cpustate->sram = auto_alloc_array(device->machine(), UINT16, 4096/2);
cquestsnd_state_register(device);
}
@@ -349,7 +349,7 @@ static void cquestrot_state_register(device_t *device)
device->save_pointer(NAME(cpustate->dram), 16384);
device->save_pointer(NAME(cpustate->sram), 2048);
- device->machine->state().register_postload(cquestrot_postload, (void *)device);
+ device->machine().state().register_postload(cquestrot_postload, (void *)device);
}
static CPU_INIT( cquestrot )
@@ -359,11 +359,11 @@ static CPU_INIT( cquestrot )
memset(cpustate, 0, sizeof(*cpustate));
/* Allocate RAM */
- cpustate->dram = auto_alloc_array(device->machine, UINT16, 16384); /* Shared with 68000 */
- cpustate->sram = auto_alloc_array(device->machine, UINT16, 2048); /* Private */
+ cpustate->dram = auto_alloc_array(device->machine(), UINT16, 16384); /* Shared with 68000 */
+ cpustate->sram = auto_alloc_array(device->machine(), UINT16, 2048); /* Private */
cpustate->device = device;
- cpustate->lindevice = device->machine->device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
+ cpustate->lindevice = device->machine().device<legacy_cpu_device>(rotconfig->lin_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
@@ -433,7 +433,7 @@ static void cquestlin_state_register(device_t *device)
device->save_pointer(NAME(cpustate->e_stack), 32768);
device->save_pointer(NAME(cpustate->o_stack), 32768);
- device->machine->state().register_postload(cquestlin_postload, (void *)device);
+ device->machine().state().register_postload(cquestlin_postload, (void *)device);
}
static CPU_INIT( cquestlin )
@@ -443,13 +443,13 @@ static CPU_INIT( cquestlin )
memset(cpustate, 0, sizeof(*cpustate));
/* Allocate RAM */
- cpustate->sram = auto_alloc_array(device->machine, UINT16, 4096); /* Shared with rotate CPU */
- cpustate->ptr_ram = auto_alloc_array(device->machine, UINT8, 1024); /* Pointer RAM */
- cpustate->e_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
- cpustate->o_stack = auto_alloc_array(device->machine, UINT32, 32768); /* Stack DRAM: 32kx20 */
+ cpustate->sram = auto_alloc_array(device->machine(), UINT16, 4096); /* Shared with rotate CPU */
+ cpustate->ptr_ram = auto_alloc_array(device->machine(), UINT8, 1024); /* Pointer RAM */
+ cpustate->e_stack = auto_alloc_array(device->machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
+ cpustate->o_stack = auto_alloc_array(device->machine(), UINT32, 32768); /* Stack DRAM: 32kx20 */
cpustate->device = device;
- cpustate->rotdevice = device->machine->device<legacy_cpu_device>(linconfig->rot_cpu_tag);
+ cpustate->rotdevice = device->machine().device<legacy_cpu_device>(linconfig->rot_cpu_tag);
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
@@ -503,7 +503,7 @@ static int do_sndjmp(cquestsnd_state *cpustate, int jmp)
static CPU_EXECUTE( cquestsnd )
{
cquestsnd_state *cpustate = get_safe_token_snd(device);
- int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
/* Core execution loop */
do
@@ -764,7 +764,7 @@ static CPU_EXECUTE( cquestrot )
{
cquestrot_state *cpustate = get_safe_token_rot(device);
cquestlin_state *lincpustate = get_safe_token_lin(cpustate->lindevice);
- int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
/* Core execution loop */
do
@@ -1177,7 +1177,7 @@ static CPU_EXECUTE( cquestlin )
cquestlin_state *cpustate = get_safe_token_lin(device);
cquestrot_state *rotcpustate = get_safe_token_rot(cpustate->rotdevice);
- int calldebugger = ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ int calldebugger = ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
UINT32 *stack_ram;
UINT8 *ptr_ram;
diff --git a/src/emu/cpu/drcbex64.c b/src/emu/cpu/drcbex64.c
index 54aa38f9526..cd72fbb6943 100644
--- a/src/emu/cpu/drcbex64.c
+++ b/src/emu/cpu/drcbex64.c
@@ -2781,13 +2781,13 @@ void drcbe_x64::op_debug(x86code *&dst, const instruction &inst)
assert_no_condition(inst);
assert_no_flags(inst);
- if ((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
// normalize parameters
be_parameter pcp(*this, inst.param(0), PTYPE_MRI);
// test and branch
- emit_mov_r64_imm(dst, REG_RAX, (FPTR)&m_device.machine->debug_flags); // mov rax,&debug_flags
+ emit_mov_r64_imm(dst, REG_RAX, (FPTR)m_device.machine().debug_flags); // mov rax,&debug_flags
emit_test_m32_imm(dst, MBD(REG_RAX, 0), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_link skip = { 0 };
emit_jcc_short_link(dst, x64emit::COND_Z, skip); // jz skip
diff --git a/src/emu/cpu/drcbex86.c b/src/emu/cpu/drcbex86.c
index 3419a988125..ad62f3c3338 100644
--- a/src/emu/cpu/drcbex86.c
+++ b/src/emu/cpu/drcbex86.c
@@ -3012,13 +3012,13 @@ void drcbe_x86::op_debug(x86code *&dst, const instruction &inst)
assert_no_condition(inst);
assert_no_flags(inst);
- if ((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
// normalize parameters
be_parameter pcp(*this, inst.param(0), PTYPE_MRI);
// test and branch
- emit_test_m32_imm(dst, MABS(&m_device.machine->debug_flags), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
+ emit_test_m32_imm(dst, MABS(&m_device.machine().debug_flags), DEBUG_FLAG_CALL_HOOK); // test [debug_flags],DEBUG_FLAG_CALL_HOOK
emit_link skip = { 0 };
emit_jcc_short_link(dst, x86emit::COND_Z, skip); // jz skip
diff --git a/src/emu/cpu/drcfe.c b/src/emu/cpu/drcfe.c
index 43b71385772..03000e151a9 100644
--- a/src/emu/cpu/drcfe.c
+++ b/src/emu/cpu/drcfe.c
@@ -84,9 +84,9 @@ drc_frontend::drc_frontend(device_t &cpu, UINT32 window_start, UINT32 window_end
m_cpudevice(downcast<cpu_device &>(cpu)),
m_program(m_cpudevice.space(AS_PROGRAM)),
m_pageshift(m_cpudevice.space_config(AS_PROGRAM)->m_page_shift),
- m_desc_live_list(cpu.machine->respool()),
- m_desc_allocator(cpu.machine->respool()),
- m_desc_array(auto_alloc_array_clear(cpu.machine, opcode_desc *, window_end + window_start + 2))
+ m_desc_live_list(cpu.machine().respool()),
+ m_desc_allocator(cpu.machine().respool()),
+ m_desc_array(auto_alloc_array_clear(cpu.machine(), opcode_desc *, window_end + window_start + 2))
{
}
@@ -101,7 +101,7 @@ drc_frontend::~drc_frontend()
release_descriptions();
// free the description array
- auto_free(m_cpudevice.machine, m_desc_array);
+ auto_free(m_cpudevice.machine(), m_desc_array);
}
diff --git a/src/emu/cpu/drcuml.c b/src/emu/cpu/drcuml.c
index 1f6e48fe0d9..b19ff71f555 100644
--- a/src/emu/cpu/drcuml.c
+++ b/src/emu/cpu/drcuml.c
@@ -151,11 +151,11 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
: m_device(device),
m_cache(cache),
m_beintf((flags & DRCUML_OPTION_USE_C) ?
- *static_cast<drcbe_interface *>(auto_alloc(device.machine, drcbe_c(*this, device, cache, flags, modes, addrbits, ignorebits))) :
- *static_cast<drcbe_interface *>(auto_alloc(device.machine, drcbe_native(*this, device, cache, flags, modes, addrbits, ignorebits)))),
+ *static_cast<drcbe_interface *>(auto_alloc(device.machine(), drcbe_c(*this, device, cache, flags, modes, addrbits, ignorebits))) :
+ *static_cast<drcbe_interface *>(auto_alloc(device.machine(), drcbe_native(*this, device, cache, flags, modes, addrbits, ignorebits)))),
m_umllog(NULL),
- m_blocklist(device.machine->respool()),
- m_symlist(device.machine->respool())
+ m_blocklist(device.machine().respool()),
+ m_symlist(device.machine().respool())
{
// if we're to log, create the logfile
if (flags & DRCUML_OPTION_LOG_UML)
@@ -170,7 +170,7 @@ drcuml_state::drcuml_state(device_t &device, drc_cache &cache, UINT32 flags, int
drcuml_state::~drcuml_state()
{
// free the back-end
- auto_free(m_device.machine, &m_beintf);
+ auto_free(m_device.machine(), &m_beintf);
// close any files
if (m_umllog != NULL)
@@ -230,7 +230,7 @@ drcuml_block *drcuml_state::begin_block(UINT32 maxinst)
// if we failed to find one, allocate a new one
if (bestblock == NULL)
- bestblock = &m_blocklist.append(*auto_alloc(m_device.machine, drcuml_block(*this, maxinst * 3/2)));
+ bestblock = &m_blocklist.append(*auto_alloc(m_device.machine(), drcuml_block(*this, maxinst * 3/2)));
// start the block
bestblock->begin();
@@ -245,7 +245,7 @@ drcuml_block *drcuml_state::begin_block(UINT32 maxinst)
code_handle *drcuml_state::handle_alloc(const char *name)
{
// allocate the handle, add it to our list, and return it
- return &m_handlelist.append(*auto_alloc(m_device.machine, code_handle(*this, name)));
+ return &m_handlelist.append(*auto_alloc(m_device.machine(), code_handle(*this, name)));
}
@@ -256,7 +256,7 @@ code_handle *drcuml_state::handle_alloc(const char *name)
void drcuml_state::symbol_add(void *base, UINT32 length, const char *name)
{
- m_symlist.append(*auto_alloc(m_device.machine, symbol(base, length, name)));
+ m_symlist.append(*auto_alloc(m_device.machine(), symbol(base, length, name)));
}
@@ -323,7 +323,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
m_next(NULL),
m_nextinst(0),
m_maxinst(maxinst * 3/2),
- m_inst(auto_alloc_array(drcuml.device().machine, instruction, m_maxinst)),
+ m_inst(auto_alloc_array(drcuml.device().machine(), instruction, m_maxinst)),
m_inuse(false)
{
}
@@ -336,7 +336,7 @@ drcuml_block::drcuml_block(drcuml_state &drcuml, UINT32 maxinst)
drcuml_block::~drcuml_block()
{
// free the instruction list
- auto_free(m_drcuml.device().machine, m_inst);
+ auto_free(m_drcuml.device().machine(), m_inst);
}
@@ -951,31 +951,31 @@ static void bevalidate_execute(drcuml_state *drcuml, code_handle **handles, cons
static void bevalidate_initialize_random_state(drcuml_state *drcuml, drcuml_block *block, drcuml_machine_state *state)
{
- running_machine *machine = drcuml->device->machine;
+ running_machine &machine = drcuml->device->machine();
int regnum;
// initialize core state to random values
- state->fmod = machine->rand() & 0x03;
- state->flags = machine->rand() & 0x1f;
- state->exp = machine->rand();
+ state->fmod = machine.rand() & 0x03;
+ state->flags = machine.rand() & 0x1f;
+ state->exp = machine.rand();
// initialize integer registers to random values
for (regnum = 0; regnum < ARRAY_LENGTH(state->r); regnum++)
{
- state->r[regnum].w.h = machine->rand();
- state->r[regnum].w.l = machine->rand();
+ state->r[regnum].w.h = machine.rand();
+ state->r[regnum].w.l = machine.rand();
}
// initialize float registers to random values
for (regnum = 0; regnum < ARRAY_LENGTH(state->f); regnum++)
{
- *(UINT32 *)&state->f[regnum].s.h = machine->rand();
- *(UINT32 *)&state->f[regnum].s.l = machine->rand();
+ *(UINT32 *)&state->f[regnum].s.h = machine.rand();
+ *(UINT32 *)&state->f[regnum].s.l = machine.rand();
}
// initialize map variables to random values
for (regnum = 0; regnum < MAPVAR_COUNT; regnum++)
- UML_MAPVAR(block, MVAR(regnum), machine->rand());
+ UML_MAPVAR(block, MVAR(regnum), machine.rand());
}
diff --git a/src/emu/cpu/dsp16/dsp16.c b/src/emu/cpu/dsp16/dsp16.c
index f3dfa3d074a..5ee8f991faf 100644
--- a/src/emu/cpu/dsp16/dsp16.c
+++ b/src/emu/cpu/dsp16/dsp16.c
@@ -45,7 +45,7 @@ device_config *dsp16_device_config::static_alloc_device_config(const machine_con
device_t *dsp16_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, dsp16_device(machine, *this));
+ return auto_alloc(machine, dsp16_device(machine, *this));
}
diff --git a/src/emu/cpu/dsp32/dsp32.c b/src/emu/cpu/dsp32/dsp32.c
index 19859c26586..8c61ac81546 100644
--- a/src/emu/cpu/dsp32/dsp32.c
+++ b/src/emu/cpu/dsp32/dsp32.c
@@ -202,7 +202,7 @@ device_config *dsp32c_device_config::static_alloc_device_config(const machine_co
device_t *dsp32c_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, dsp32c_device(machine, *this));
+ return auto_alloc(machine, dsp32c_device(machine, *this));
}
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index 93ed7708691..f919578fb03 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -238,7 +238,7 @@ static CPU_INIT( dsp56k )
/* Setup the direct memory handler for this CPU */
/* NOTE: Be sure to grab this guy and call him if you ever install another direct_update_hander in a driver! */
- const_cast<address_space *>(cpustate->program)->set_direct_update_handler(direct_update_delegate_create_static(dsp56k_direct_handler, *device->machine));
+ const_cast<address_space *>(cpustate->program)->set_direct_update_handler(direct_update_delegate_create_static(dsp56k_direct_handler, device->machine()));
}
diff --git a/src/emu/cpu/e132xs/e132xs.c b/src/emu/cpu/e132xs/e132xs.c
index 7cd6a29a443..d93620aba96 100644
--- a/src/emu/cpu/e132xs/e132xs.c
+++ b/src/emu/cpu/e132xs/e132xs.c
@@ -1546,7 +1546,7 @@ static void hyperstone_init(legacy_cpu_device *device, device_irq_callback irqca
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
cpustate->io = device->space(AS_IO);
- cpustate->timer = device->machine->scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device);
+ cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(e132xs_timer_callback), (void *)device);
cpustate->clock_scale_mask = scale_mask;
}
diff --git a/src/emu/cpu/esrip/esrip.c b/src/emu/cpu/esrip/esrip.c
index 9b983566760..a69939fa430 100644
--- a/src/emu/cpu/esrip/esrip.c
+++ b/src/emu/cpu/esrip/esrip.c
@@ -116,8 +116,8 @@ typedef struct
read16_device_func fdt_r;
write16_device_func fdt_w;
- UINT8 (*status_in)(running_machine *machine);
- int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
+ UINT8 (*status_in)(running_machine &machine);
+ int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
} esrip_state;
@@ -256,19 +256,19 @@ static CPU_INIT( esrip )
/* Register configuration structure callbacks */
cpustate->fdt_r = _config->fdt_r;
cpustate->fdt_w = _config->fdt_w;
- cpustate->lbrm = (UINT8*)device->machine->region(_config->lbrm_prom)->base();
+ cpustate->lbrm = (UINT8*)device->machine().region(_config->lbrm_prom)->base();
cpustate->status_in = _config->status_in;
cpustate->draw = _config->draw;
/* Allocate image pointer table RAM */
- cpustate->ipt_ram = auto_alloc_array(device->machine, UINT16, IPT_RAM_SIZE/2);
+ cpustate->ipt_ram = auto_alloc_array(device->machine(), UINT16, IPT_RAM_SIZE/2);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
/* Create the instruction decode lookup table */
- cpustate->optable = auto_alloc_array(device->machine, UINT8, 65536);
+ cpustate->optable = auto_alloc_array(device->machine(), UINT8, 65536);
make_ops(cpustate);
/* Register stuff for state saving */
@@ -354,9 +354,9 @@ static CPU_EXIT( esrip )
PRIVATE FUNCTIONS
***************************************************************************/
-static int get_hblank(running_machine *machine)
+static int get_hblank(running_machine &machine)
{
- return machine->primary_screen->hblank();
+ return machine.primary_screen->hblank();
}
/* Return the state of the LBRM line (Y-scaling related) */
@@ -384,7 +384,7 @@ INLINE int check_jmp(esrip_state *cpustate, UINT8 jmp_ctrl)
/* T3 */ case 6: ret = BIT(cpustate->t, 2); break;
/* T4 */ case 1: ret = BIT(cpustate->t, 3); break;
/* /LBRM */ case 5: ret = !get_lbrm(cpustate); break;
- /* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine); break;
+ /* /HBLANK */ case 3: ret = !get_hblank(cpustate->device->machine()); break;
/* JMP */ case 7: ret = 0; break;
}
@@ -1664,11 +1664,11 @@ INLINE void am29116_execute(esrip_state *cpustate, UINT16 inst, int _sre)
static CPU_EXECUTE( esrip )
{
esrip_state *cpustate = get_safe_token(device);
- int calldebugger = (device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0;
+ int calldebugger = (device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0;
UINT8 status;
/* I think we can get away with placing this outside of the loop */
- status = cpustate->status_in(device->machine);
+ status = cpustate->status_in(device->machine());
/* Core execution loop */
do
@@ -1811,7 +1811,7 @@ static CPU_EXECUTE( esrip )
cpustate->attr_latch = x_bus;
cpustate->fig = 1;
- cpustate->fig_cycles = cpustate->draw(device->machine, cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr_latch, cpustate->c_latch, cpustate->x_scale, cpustate->img_bank);
+ cpustate->fig_cycles = cpustate->draw(device->machine(), cpustate->adl_latch, cpustate->adr_latch, cpustate->fig_latch, cpustate->attr_latch, cpustate->iaddr_latch, cpustate->c_latch, cpustate->x_scale, cpustate->img_bank);
}
/* X-scale */
@@ -1943,7 +1943,7 @@ CPU_GET_INFO( esrip )
cpustate->status & 0x04 ? 'N' : '.',
cpustate->status & 0x02 ? 'C' : '.',
cpustate->status & 0x01 ? 'Z' : '.',
- get_hblank(device->machine) ? 'H' : '.'); break;
+ get_hblank(device->machine()) ? 'H' : '.'); break;
case CPUINFO_STR_REGISTER + ESRIP_PC: sprintf(info->s, "PC: %04X", RIP_PC); break;
case CPUINFO_STR_REGISTER + ESRIP_ACC: sprintf(info->s, "ACC: %04X", cpustate->acc); break;
diff --git a/src/emu/cpu/esrip/esrip.h b/src/emu/cpu/esrip/esrip.h
index 8935136b689..7a06e88bea2 100644
--- a/src/emu/cpu/esrip/esrip.h
+++ b/src/emu/cpu/esrip/esrip.h
@@ -85,8 +85,8 @@ struct _esrip_config_
{
read16_device_func fdt_r;
write16_device_func fdt_w;
- UINT8 (*status_in)(running_machine *machine);
- int (*draw)(running_machine *machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
+ UINT8 (*status_in)(running_machine &machine);
+ int (*draw)(running_machine &machine, int l, int r, int fig, int attr, int addr, int col, int x_scale, int bank);
const char* const lbrm_prom;
};
diff --git a/src/emu/cpu/g65816/g65816.c b/src/emu/cpu/g65816/g65816.c
index 30d58b3ddcc..3d7782dc9e5 100644
--- a/src/emu/cpu/g65816/g65816.c
+++ b/src/emu/cpu/g65816/g65816.c
@@ -365,7 +365,7 @@ static CPU_INIT( g65816 )
device->save_item(NAME(cpustate->irq_delay));
device->save_item(NAME(cpustate->stopped));
- device->machine->state().register_postload(g65816_restore_state, cpustate);
+ device->machine().state().register_postload(g65816_restore_state, cpustate);
}
/**************************************************************************
diff --git a/src/emu/cpu/h83002/h8_16.c b/src/emu/cpu/h83002/h8_16.c
index 9b5fb48ee47..d6fdcafc590 100644
--- a/src/emu/cpu/h83002/h8_16.c
+++ b/src/emu/cpu/h83002/h8_16.c
@@ -237,7 +237,7 @@ static CPU_INIT(h8)
device->save_item(NAME(h8->h8TSTR));
device->save_item(NAME(h8->h8TCNT));
- device->machine->state().register_postload(h8_onstateload, h8);
+ device->machine().state().register_postload(h8_onstateload, h8);
h8_itu_init(h8);
}
diff --git a/src/emu/cpu/h83002/h8_8.c b/src/emu/cpu/h83002/h8_8.c
index ce7cd1a4f63..e95d5602c5c 100644
--- a/src/emu/cpu/h83002/h8_8.c
+++ b/src/emu/cpu/h83002/h8_8.c
@@ -241,10 +241,10 @@ static CPU_INIT(h8bit)
h8->direct = &h8->program->direct();
h8->io = device->space(AS_IO);
- h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8);
- h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8);
- h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8);
- h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8);
+ h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_0_cb), h8);
+ h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_1_cb), h8);
+ h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_2_cb), h8);
+ h8->timer[3] = h8->device->machine().scheduler().timer_alloc(FUNC(h8_timer_3_cb), h8);
device->save_item(NAME(h8->h8err));
device->save_item(NAME(h8->regs));
@@ -259,7 +259,7 @@ static CPU_INIT(h8bit)
device->save_item(NAME(h8->h8TSTR));
device->save_item(NAME(h8->h8TCNT));
- h8->device->machine->state().register_postload(h8_onstateload, h8);
+ h8->device->machine().state().register_postload(h8_onstateload, h8);
}
static CPU_RESET(h8bit)
diff --git a/src/emu/cpu/h83002/h8periph.c b/src/emu/cpu/h83002/h8periph.c
index 50ff0143cb2..644471f94ea 100644
--- a/src/emu/cpu/h83002/h8periph.c
+++ b/src/emu/cpu/h83002/h8periph.c
@@ -766,20 +766,20 @@ void h8_3007_register1_write8(h83xx_state *h8, UINT32 address, UINT8 val)
void h8_3007_itu_init(h83xx_state *h8)
{
- h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8);
- h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8);
- h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8);
+ h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_0_cb), h8);
+ h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_1_cb), h8);
+ h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_3007_timer_2_cb), h8);
h8_itu_reset(h8);
}
void h8_itu_init(h83xx_state *h8)
{
- h8->timer[0] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8);
- h8->timer[1] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8);
- h8->timer[2] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8);
- h8->timer[3] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8);
- h8->timer[4] = h8->device->machine->scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8);
+ h8->timer[0] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_0_cb), h8);
+ h8->timer[1] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_1_cb), h8);
+ h8->timer[2] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_2_cb), h8);
+ h8->timer[3] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_3_cb), h8);
+ h8->timer[4] = h8->device->machine().scheduler().timer_alloc(FUNC(h8itu_timer_4_cb), h8);
h8_itu_reset(h8);
}
diff --git a/src/emu/cpu/hd6309/hd6309.c b/src/emu/cpu/hd6309/hd6309.c
index d931748a568..87746628c6e 100644
--- a/src/emu/cpu/hd6309/hd6309.c
+++ b/src/emu/cpu/hd6309/hd6309.c
@@ -541,7 +541,7 @@ static CPU_INIT( hd6309 )
device->save_item(NAME(DP));
device->save_item(NAME(CC));
device->save_item(NAME(MD));
- device->machine->state().register_postload(hd6309_postload, (void *) device);
+ device->machine().state().register_postload(hd6309_postload, (void *) device);
device->save_item(NAME(m68_state->int_state));
device->save_item(NAME(m68_state->nmi_state));
device->save_item(NAME(m68_state->irq_state[0]));
diff --git a/src/emu/cpu/i386/i386.c b/src/emu/cpu/i386/i386.c
index 963cf8bf467..62a39490969 100644
--- a/src/emu/cpu/i386/i386.c
+++ b/src/emu/cpu/i386/i386.c
@@ -418,7 +418,7 @@ INLINE void CYCLES_RM(i386_state *cpustate,int modrm, int r, int m)
}
}
-static void build_cycle_table(running_machine *machine)
+static void build_cycle_table(running_machine &machine)
{
int i, j;
for (j=0; j < X86_NUM_CPUS; j++)
@@ -534,7 +534,7 @@ static CPU_INIT( i386 )
static const int regs32[8] = {EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI};
i386_state *cpustate = get_safe_token(device);
- build_cycle_table(device->machine);
+ build_cycle_table(device->machine());
for( i=0; i < 256; i++ ) {
int c=0;
@@ -614,7 +614,7 @@ static CPU_INIT( i386 )
device->save_item(NAME(cpustate->ldtr.flags));
device->save_item(NAME(cpustate->irq_state));
device->save_item(NAME(cpustate->performed_intersegment_jump));
- device->machine->state().register_postload(i386_postload, (void *)device);
+ device->machine().state().register_postload(i386_postload, (void *)device);
}
static void build_opcode_table(i386_state *cpustate, UINT32 features)
diff --git a/src/emu/cpu/jaguar/jaguar.c b/src/emu/cpu/jaguar/jaguar.c
index 5811cd8dc65..6d88c701e24 100644
--- a/src/emu/cpu/jaguar/jaguar.c
+++ b/src/emu/cpu/jaguar/jaguar.c
@@ -430,7 +430,7 @@ static void init_common(int isdsp, legacy_cpu_device *device, device_irq_callbac
device->save_item(NAME(jaguar->a));
device->save_item(NAME(jaguar->ctrl));
device->save_item(NAME(jaguar->ppc));
- device->machine->state().register_postload(jaguar_postload, (void *)device);
+ device->machine().state().register_postload(jaguar_postload, (void *)device);
}
diff --git a/src/emu/cpu/m37710/m37710.c b/src/emu/cpu/m37710/m37710.c
index ad5ced6347c..d385094425b 100644
--- a/src/emu/cpu/m37710/m37710.c
+++ b/src/emu/cpu/m37710/m37710.c
@@ -906,7 +906,7 @@ static CPU_INIT( m37710 )
cpustate->destination = 0;
for (i = 0; i < 8; i++)
- cpustate->timers[i] = device->machine->scheduler().timer_alloc(FUNC(m37710_timer_cb), cpustate);
+ cpustate->timers[i] = device->machine().scheduler().timer_alloc(FUNC(m37710_timer_cb), cpustate);
device->save_item(NAME(cpustate->a));
device->save_item(NAME(cpustate->b));
@@ -949,7 +949,7 @@ static CPU_INIT( m37710 )
device->save_item(NAME(cpustate->reload[6]));
device->save_item(NAME(cpustate->reload[7]));
- device->machine->state().register_postload(m37710_restore_state, cpustate);
+ device->machine().state().register_postload(m37710_restore_state, cpustate);
}
/**************************************************************************
diff --git a/src/emu/cpu/m6800/m6800.c b/src/emu/cpu/m6800/m6800.c
index 23e68c92d03..700fb0a633e 100644
--- a/src/emu/cpu/m6800/m6800.c
+++ b/src/emu/cpu/m6800/m6800.c
@@ -1204,7 +1204,7 @@ static CPU_INIT( m6801 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "m6801");
@@ -1254,7 +1254,7 @@ static CPU_INIT( m6803 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "m6803");
@@ -1312,7 +1312,7 @@ static CPU_INIT( hd6301 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "hd6301");
}
@@ -1336,7 +1336,7 @@ static CPU_INIT( hd63701 )
cpustate->io = device->space(AS_IO);
cpustate->clock = device->clock() / 4;
- cpustate->sci_timer = device->machine->scheduler().timer_alloc(FUNC(sci_tick), cpustate);
+ cpustate->sci_timer = device->machine().scheduler().timer_alloc(FUNC(sci_tick), cpustate);
state_register(cpustate, "hd63701");
}
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c
index 94f3b4a2e41..1b900f5d7e8 100644
--- a/src/emu/cpu/m68000/m68kcpu.c
+++ b/src/emu/cpu/m68000/m68kcpu.c
@@ -538,7 +538,7 @@ static void set_irq_line(m68ki_cpu_core *m68k, int irqline, int state)
m68k->nmi_pending = TRUE;
}
-static void m68k_presave(running_machine *machine, void *param)
+static void m68k_presave(running_machine &machine, void *param)
{
m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
m68k->save_sr = m68ki_get_sr(m68k);
@@ -546,7 +546,7 @@ static void m68k_presave(running_machine *machine, void *param)
m68k->save_halted = (m68k->stopped & STOP_LEVEL_HALT) != 0;
}
-static void m68k_postload(running_machine *machine, void *param)
+static void m68k_postload(running_machine &machine, void *param)
{
m68ki_cpu_core *m68k = (m68ki_cpu_core *)param;
m68ki_set_sr_noint_nosp(m68k, m68k->save_sr);
@@ -762,8 +762,8 @@ static CPU_INIT( m68k )
device->save_item(NAME(m68k->save_halted));
device->save_item(NAME(m68k->pref_addr));
device->save_item(NAME(m68k->pref_data));
- device->machine->state().register_presave(m68k_presave, m68k);
- device->machine->state().register_postload(m68k_postload, m68k);
+ device->machine().state().register_presave(m68k_presave, m68k);
+ device->machine().state().register_postload(m68k_postload, m68k);
}
/* Pulse the RESET line on the CPU */
diff --git a/src/emu/cpu/mb86233/mb86233.c b/src/emu/cpu/mb86233/mb86233.c
index 64c0483995a..3150b447b48 100644
--- a/src/emu/cpu/mb86233/mb86233.c
+++ b/src/emu/cpu/mb86233/mb86233.c
@@ -121,13 +121,13 @@ static CPU_INIT( mb86233 )
cpustate->fifo_write_cb = _config->fifo_write_cb;
}
- cpustate->RAM = auto_alloc_array(device->machine, UINT32, 2 * 0x200); /* 2x 2KB */
+ cpustate->RAM = auto_alloc_array(device->machine(), UINT32, 2 * 0x200); /* 2x 2KB */
memset( cpustate->RAM, 0, 2 * 0x200 * sizeof(UINT32) );
cpustate->ARAM = &cpustate->RAM[0];
cpustate->BRAM = &cpustate->RAM[0x200];
- cpustate->Tables = (UINT32*) device->machine->region(_config->tablergn)->base();
+ cpustate->Tables = (UINT32*) device->machine().region(_config->tablergn)->base();
- state_save_register_global_pointer(device->machine, cpustate->RAM,2 * 0x200 * sizeof(UINT32));
+ state_save_register_global_pointer(device->machine(), cpustate->RAM,2 * 0x200 * sizeof(UINT32));
}
static CPU_RESET( mb86233 )
diff --git a/src/emu/cpu/mb88xx/mb88xx.c b/src/emu/cpu/mb88xx/mb88xx.c
index d14b6cf5b44..8c60ca444aa 100644
--- a/src/emu/cpu/mb88xx/mb88xx.c
+++ b/src/emu/cpu/mb88xx/mb88xx.c
@@ -149,7 +149,7 @@ static CPU_INIT( mb88 )
cpustate->data = device->space(AS_DATA);
cpustate->io = device->space(AS_IO);
- cpustate->serial = device->machine->scheduler().timer_alloc(FUNC(serial_timer), (void *)device);
+ cpustate->serial = device->machine().scheduler().timer_alloc(FUNC(serial_timer), (void *)device);
device->save_item(NAME(cpustate->PC));
device->save_item(NAME(cpustate->PA));
diff --git a/src/emu/cpu/mc68hc11/mc68hc11.c b/src/emu/cpu/mc68hc11/mc68hc11.c
index 7cd5d87d15e..4806a287fd3 100644
--- a/src/emu/cpu/mc68hc11/mc68hc11.c
+++ b/src/emu/cpu/mc68hc11/mc68hc11.c
@@ -410,7 +410,7 @@ static CPU_INIT( hc11 )
cpustate->internal_ram_size = 1280;
}
- cpustate->internal_ram = auto_alloc_array(device->machine, UINT8, cpustate->internal_ram_size);
+ cpustate->internal_ram = auto_alloc_array(device->machine(), UINT8, cpustate->internal_ram_size);
cpustate->reg_position = 0;
cpustate->ram_position = 0x100;
diff --git a/src/emu/cpu/mcs48/mcs48.c b/src/emu/cpu/mcs48/mcs48.c
index bcedcf23008..4575a04fd9c 100644
--- a/src/emu/cpu/mcs48/mcs48.c
+++ b/src/emu/cpu/mcs48/mcs48.c
@@ -1215,7 +1215,7 @@ static TIMER_CALLBACK( master_callback )
void upi41_master_w(device_t *_device, UINT8 a0, UINT8 data)
{
legacy_cpu_device *device = downcast<legacy_cpu_device *>(_device);
- device->machine->scheduler().synchronize(FUNC(master_callback), (a0 << 8) | data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(master_callback), (a0 << 8) | data, (void *)device);
}
diff --git a/src/emu/cpu/mips/mips3com.c b/src/emu/cpu/mips/mips3com.c
index 9e84e9d3780..21e67659249 100644
--- a/src/emu/cpu/mips/mips3com.c
+++ b/src/emu/cpu/mips/mips3com.c
@@ -105,7 +105,7 @@ void mips3com_init(mips3_state *mips, mips3_flavor flavor, int bigendian, legacy
mips->vtlb = vtlb_alloc(device, AS_PROGRAM, 2 * mips->tlbentries + 2, 0);
/* allocate a timer for the compare interrupt */
- mips->compare_int_timer = device->machine->scheduler().timer_alloc(FUNC(compare_int_callback), (void *)device);
+ mips->compare_int_timer = device->machine().scheduler().timer_alloc(FUNC(compare_int_callback), (void *)device);
/* reset the state */
mips3com_reset(mips);
diff --git a/src/emu/cpu/mips/mips3drc.c b/src/emu/cpu/mips/mips3drc.c
index 83f95669eff..f62c4d16c8b 100644
--- a/src/emu/cpu/mips/mips3drc.c
+++ b/src/emu/cpu/mips/mips3drc.c
@@ -396,7 +396,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
int regnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*mips3)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*mips3)));
if (cache == NULL)
fatalerror("Unable to allocate cache of size %d", (UINT32)(CACHE_SIZE + sizeof(*mips3)));
@@ -419,7 +419,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
- mips3->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ mips3->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
mips3->impstate->drcuml->symbol_add(&mips3->pc, sizeof(mips3->pc), "pc");
@@ -465,7 +465,7 @@ static void mips3_init(mips3_flavor flavor, int bigendian, legacy_cpu_device *de
mips3->impstate->drcuml->symbol_add(&mips3->impstate->fpmode, sizeof(mips3->impstate->fpmode), "fpmode");
/* initialize the front-end helper */
- mips3->impstate->drcfe = auto_alloc(device->machine, mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ mips3->impstate->drcfe = auto_alloc(device->machine(), mips3_frontend(*mips3, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* allocate memory for cache-local state and initialize it */
memcpy(mips3->impstate->fpmode, fpmode_source, sizeof(fpmode_source));
@@ -562,9 +562,9 @@ static CPU_EXIT( mips3 )
mips3com_exit(mips3);
/* clean up the DRC */
- auto_free(device->machine, mips3->impstate->drcfe);
- auto_free(device->machine, mips3->impstate->drcuml);
- auto_free(device->machine, mips3->impstate->cache);
+ auto_free(device->machine(), mips3->impstate->drcfe);
+ auto_free(device->machine(), mips3->impstate->drcuml);
+ auto_free(device->machine(), mips3->impstate->cache);
}
@@ -1275,7 +1275,7 @@ static void static_generate_memory_accessor(mips3_state *mips3, int mode, int si
UML_JMPc(block, COND_Z, tlbmiss = label++); // jmp tlbmiss,z
UML_ROLINS(block, I0, I3, 0, 0xfffff000); // rolins i0,i3,0,0xfffff000
- if ((mips3->device->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if ((mips3->device->machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
for (ramnum = 0; ramnum < MIPS3_MAX_FASTRAM; ramnum++)
if (mips3->impstate->fastram[ramnum].base != NULL && (!iswrite || !mips3->impstate->fastram[ramnum].readonly))
{
@@ -1612,7 +1612,7 @@ static void generate_sequence_instruction(mips3_state *mips3, drcuml_block *bloc
}
/* if we are debugging, call the debugger */
- if ((mips3->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((mips3->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&mips3->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(mips3, block);
diff --git a/src/emu/cpu/mips/psx.c b/src/emu/cpu/mips/psx.c
index 72a5bde1bf0..2437f082721 100644
--- a/src/emu/cpu/mips/psx.c
+++ b/src/emu/cpu/mips/psx.c
@@ -232,7 +232,7 @@ void psxcpu_device::set_biu( UINT32 data, UINT32 mem_mask )
void psxcpu_device::stop()
{
- debugger_break( machine );
+ debugger_break( m_machine );
debugger_instruction_hook( this, m_pc );
}
@@ -1602,12 +1602,12 @@ device_config *cxd8661r_device_config::static_alloc_device_config(const machine_
device_t *psxcpu_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, psxcpu_device(machine, *this));
+ return auto_alloc(machine, psxcpu_device(machine, *this));
}
device_t *cxd8661r_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, psxcpu_device(machine, *this));
+ return auto_alloc(machine, psxcpu_device(machine, *this));
}
diff --git a/src/emu/cpu/mips/r3000.c b/src/emu/cpu/mips/r3000.c
index 1388fd9edf6..c0a6cbb2b9a 100644
--- a/src/emu/cpu/mips/r3000.c
+++ b/src/emu/cpu/mips/r3000.c
@@ -303,8 +303,8 @@ static CPU_INIT( r3000 )
r3000_state *r3000 = get_safe_token(device);
/* allocate memory */
- r3000->icache = auto_alloc_array(device->machine, UINT32, configdata->icache/4);
- r3000->dcache = auto_alloc_array(device->machine, UINT32, configdata->dcache/4);
+ r3000->icache = auto_alloc_array(device->machine(), UINT32, configdata->icache/4);
+ r3000->dcache = auto_alloc_array(device->machine(), UINT32, configdata->dcache/4);
r3000->icache_size = configdata->icache;
r3000->dcache_size = configdata->dcache;
diff --git a/src/emu/cpu/mn10200/mn10200.c b/src/emu/cpu/mn10200/mn10200.c
index 9b37e6d194d..4ffb6ac3a88 100644
--- a/src/emu/cpu/mn10200/mn10200.c
+++ b/src/emu/cpu/mn10200/mn10200.c
@@ -295,7 +295,7 @@ static CPU_INIT(mn10200)
for (tmr = 0; tmr < NUM_TIMERS_8BIT; tmr++)
{
- cpustate->timer_timers[tmr] = device->machine->scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
+ cpustate->timer_timers[tmr] = device->machine().scheduler().timer_alloc(FUNC(simple_timer_cb), cpustate);
cpustate->timer_timers[tmr]->adjust(attotime::never, tmr);
}
}
diff --git a/src/emu/cpu/nec/v25.c b/src/emu/cpu/nec/v25.c
index 8b8f27eef71..15c8ea5e666 100644
--- a/src/emu/cpu/nec/v25.c
+++ b/src/emu/cpu/nec/v25.c
@@ -430,7 +430,7 @@ static void v25_init(legacy_cpu_device *device, device_irq_callback irqcallback,
nec_state->config = config;
for (int i = 0; i < 4; i++)
- nec_state->timers[i] = device->machine->scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state);
+ nec_state->timers[i] = device->machine().scheduler().timer_alloc(FUNC(v25_timer_callback), nec_state);
device->save_item(NAME(nec_state->ram.w));
device->save_item(NAME(nec_state->intp_state));
diff --git a/src/emu/cpu/powerpc/ppc.c b/src/emu/cpu/powerpc/ppc.c
index 296e1594ee0..a839bf2c51c 100644
--- a/src/emu/cpu/powerpc/ppc.c
+++ b/src/emu/cpu/powerpc/ppc.c
@@ -947,8 +947,8 @@ static CPU_INIT( ppc403 )
// !!! why is rfci here !!!
ppc.optable19[51] = ppc_rfci;
- ppc.spu.rx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback));
- ppc.spu.tx_timer = device->machine->scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback));
+ ppc.spu.rx_timer = device->machine().scheduler().timer_alloc(FUNC(ppc403_spu_rx_callback));
+ ppc.spu.tx_timer = device->machine().scheduler().timer_alloc(FUNC(ppc403_spu_tx_callback));
ppc.read8 = ppc403_read8;
ppc.read16 = ppc403_read16;
diff --git a/src/emu/cpu/powerpc/ppccom.c b/src/emu/cpu/powerpc/ppccom.c
index c99b2a50ebc..60d3855793d 100644
--- a/src/emu/cpu/powerpc/ppccom.c
+++ b/src/emu/cpu/powerpc/ppccom.c
@@ -328,14 +328,14 @@ void ppccom_init(powerpc_state *ppc, powerpc_flavor flavor, UINT8 cap, int tb_di
/* allocate a timer for the compare interrupt */
if ((cap & PPCCAP_OEA) && (ppc->tb_divisor))
- ppc->decrementer_int_timer = device->machine->scheduler().timer_alloc(FUNC(decrementer_int_callback), ppc);
+ ppc->decrementer_int_timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_int_callback), ppc);
/* and for the 4XX interrupts if needed */
if (cap & PPCCAP_4XX)
{
- ppc->fit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc);
- ppc->pit_timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc);
- ppc->spu.timer = device->machine->scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc);
+ ppc->fit_timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_fit_callback), ppc);
+ ppc->pit_timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_pit_callback), ppc);
+ ppc->spu.timer = device->machine().scheduler().timer_alloc(FUNC(ppc4xx_spu_callback), ppc);
}
/* register for save states */
@@ -403,7 +403,7 @@ void ppccom_reset(powerpc_state *ppc)
ppc->dec_zero_cycles = ppc->device->total_cycles();
if (ppc->tb_divisor)
{
- decrementer_int_callback(ppc->device->machine, ppc, 0);
+ decrementer_int_callback(ppc->device->machine(), ppc, 0);
}
}
@@ -676,7 +676,7 @@ void ppccom_execute_tlbl(powerpc_state *ppc)
int entrynum;
/* determine entry number; we use rand() for associativity */
- entrynum = ((address >> 12) & 0x1f) | (ppc->device->machine->rand() & 0x20) | (isitlb ? 0x40 : 0);
+ entrynum = ((address >> 12) & 0x1f) | (ppc->device->machine().rand() & 0x20) | (isitlb ? 0x40 : 0);
/* determine the flags */
flags = VTLB_FLAG_VALID | VTLB_READ_ALLOWED | VTLB_FETCH_ALLOWED;
@@ -946,9 +946,9 @@ void ppccom_execute_mtspr(powerpc_state *ppc)
case SPR4XX_TCR:
ppc->spr[SPR4XX_TCR] = ppc->param1 | (oldval & PPC4XX_TCR_WRC_MASK);
if ((oldval ^ ppc->spr[SPR4XX_TCR]) & PPC4XX_TCR_FIE)
- ppc4xx_fit_callback(ppc->device->machine, ppc, FALSE);
+ ppc4xx_fit_callback(ppc->device->machine(), ppc, FALSE);
if ((oldval ^ ppc->spr[SPR4XX_TCR]) & PPC4XX_TCR_PIE)
- ppc4xx_pit_callback(ppc->device->machine, ppc, FALSE);
+ ppc4xx_pit_callback(ppc->device->machine(), ppc, FALSE);
return;
/* timer status register */
@@ -961,7 +961,7 @@ void ppccom_execute_mtspr(powerpc_state *ppc)
case SPR4XX_PIT:
ppc->spr[SPR4XX_PIT] = ppc->param1;
ppc->pit_reload = ppc->param1;
- ppc4xx_pit_callback(ppc->device->machine, ppc, FALSE);
+ ppc4xx_pit_callback(ppc->device->machine(), ppc, FALSE);
return;
/* timebase */
diff --git a/src/emu/cpu/powerpc/ppcdrc.c b/src/emu/cpu/powerpc/ppcdrc.c
index 8aff8c0a62f..ce77712dd12 100644
--- a/src/emu/cpu/powerpc/ppcdrc.c
+++ b/src/emu/cpu/powerpc/ppcdrc.c
@@ -557,7 +557,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
int regnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*ppc)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*ppc)));
/* allocate the core from the near cache */
*(powerpc_state **)device->token() = ppc = (powerpc_state *)cache->alloc_near(sizeof(*ppc));
@@ -578,7 +578,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
- ppc->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ ppc->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
ppc->impstate->drcuml->symbol_add(&ppc->pc, sizeof(ppc->pc), "pc");
@@ -624,7 +624,7 @@ static void ppcdrc_init(powerpc_flavor flavor, UINT8 cap, int tb_divisor, legacy
ppc->impstate->drcuml->symbol_add(&ppc->impstate->fcmp_cr_table, sizeof(ppc->impstate->fcmp_cr_table), "fcmp_cr_table");
/* initialize the front-end helper */
- ppc->impstate->drcfe = auto_alloc(device->machine, ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ ppc->impstate->drcfe = auto_alloc(device->machine(), ppc_frontend(*ppc, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* initialize the implementation state tables */
memcpy(ppc->impstate->fpmode, fpmode_source, sizeof(fpmode_source));
@@ -716,9 +716,9 @@ static CPU_EXIT( ppcdrc )
ppccom_exit(ppc);
/* clean up the DRC */
- auto_free(device->machine, ppc->impstate->drcfe);
- auto_free(device->machine, ppc->impstate->drcuml);
- auto_free(device->machine, ppc->impstate->cache);
+ auto_free(device->machine(), ppc->impstate->drcfe);
+ auto_free(device->machine(), ppc->impstate->drcuml);
+ auto_free(device->machine(), ppc->impstate->cache);
}
@@ -1511,7 +1511,7 @@ static void static_generate_memory_accessor(powerpc_state *ppc, int mode, int si
UML_AND(block, I0, I0, 0x7fffffff); // and i0,i0,0x7fffffff
UML_XOR(block, I0, I0, (mode & MODE_LITTLE_ENDIAN) ? (8 - size) : 0); // xor i0,i0,8-size
- if ((ppc->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((ppc->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
for (ramnum = 0; ramnum < PPC_MAX_FASTRAM; ramnum++)
if (ppc->impstate->fastram[ramnum].base != NULL && (!iswrite || !ppc->impstate->fastram[ramnum].readonly))
{
@@ -2127,7 +2127,7 @@ static void generate_sequence_instruction(powerpc_state *ppc, drcuml_block *bloc
}
/* if we are debugging, call the debugger */
- if ((ppc->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((ppc->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&ppc->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(ppc, block); // <save fastregs>
diff --git a/src/emu/cpu/rsp/rsp.c b/src/emu/cpu/rsp/rsp.c
index a756842f2f8..1a9bd158f6e 100644
--- a/src/emu/cpu/rsp/rsp.c
+++ b/src/emu/cpu/rsp/rsp.c
@@ -207,7 +207,7 @@ static void set_cop0_reg(rsp_state *rsp, int reg, UINT32 data)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -303,7 +303,7 @@ static CPU_INIT( rsp )
#endif
// ...except for the accumulators.
- // We're not calling machine->rand() because initializing something with machine->rand()
+ // We're not calling machine.rand() because initializing something with machine.rand()
// makes me retch uncontrollably.
for(accumIdx = 0; accumIdx < 8; accumIdx++ )
{
diff --git a/src/emu/cpu/rsp/rspdrc.c b/src/emu/cpu/rsp/rspdrc.c
index 9c7b2295355..f41d462b3a5 100644
--- a/src/emu/cpu/rsp/rspdrc.c
+++ b/src/emu/cpu/rsp/rspdrc.c
@@ -496,7 +496,7 @@ static void cfunc_unimplemented_opcode(void *param)
{
rsp_state *rsp = (rsp_state*)param;
int op = rsp->impstate->arg0;
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -508,7 +508,7 @@ static void cfunc_unimplemented_opcode(void *param)
static void unimplemented_opcode(rsp_state *rsp, UINT32 op)
{
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
rsp_dasm_one(string, rsp->ppc, op);
@@ -612,7 +612,7 @@ static CPU_INIT( rsp )
//int elnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(*rsp)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(*rsp)));
/* allocate the core memory */
*(rsp_state **)device->token() = rsp = (rsp_state *)cache->alloc_near(sizeof(*rsp));
@@ -638,7 +638,7 @@ static CPU_INIT( rsp )
{
flags |= DRCUML_OPTION_LOG_NATIVE;
}
- rsp->impstate->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 8, 32, 2));
+ rsp->impstate->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 8, 32, 2));
/* add symbols for our stuff */
rsp->impstate->drcuml->symbol_add(&rsp->pc, sizeof(rsp->pc), "pc");
@@ -656,7 +656,7 @@ static CPU_INIT( rsp )
rsp->impstate->drcuml->symbol_add(&rsp->impstate->numcycles, sizeof(rsp->impstate->numcycles), "numcycles");
/* initialize the front-end helper */
- rsp->impstate->drcfe = auto_alloc(device->machine, rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ rsp->impstate->drcfe = auto_alloc(device->machine(), rsp_frontend(*rsp, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 32; regnum++)
@@ -696,9 +696,9 @@ static CPU_EXIT( rsp )
rsp_state *rsp = get_safe_token(device);
/* clean up the DRC */
- auto_free(device->machine, rsp->impstate->drcfe);
- auto_free(device->machine, rsp->impstate->drcuml);
- auto_free(device->machine, rsp->impstate->cache);
+ auto_free(device->machine(), rsp->impstate->drcfe);
+ auto_free(device->machine(), rsp->impstate->drcuml);
+ auto_free(device->machine(), rsp->impstate->cache);
}
@@ -3817,7 +3817,7 @@ static void generate_sequence_instruction(rsp_state *rsp, drcuml_block *block, c
UML_MAPVAR(block, MAPVAR_CYCLES, compiler->cycles); // mapvar CYCLES,compiler->cycles
/* if we are debugging, call the debugger */
- if ((rsp->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((rsp->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&rsp->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(rsp, block);
diff --git a/src/emu/cpu/sc61860/sc61860.c b/src/emu/cpu/sc61860/sc61860.c
index ce2e0951626..edf585abc8f 100644
--- a/src/emu/cpu/sc61860/sc61860.c
+++ b/src/emu/cpu/sc61860/sc61860.c
@@ -104,7 +104,7 @@ static CPU_INIT( sc61860 )
{
sc61860_state *cpustate = get_safe_token(device);
cpustate->config = (sc61860_cpu_core *) device->baseconfig().static_config();
- device->machine->scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
+ device->machine().scheduler().timer_pulse(attotime::from_hz(500), FUNC(sc61860_2ms_tick), 0, cpustate);
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
cpustate->direct = &cpustate->program->direct();
diff --git a/src/emu/cpu/sh2/sh2comn.c b/src/emu/cpu/sh2/sh2comn.c
index 6cd5b690da1..4fcacce823d 100644
--- a/src/emu/cpu/sh2/sh2comn.c
+++ b/src/emu/cpu/sh2/sh2comn.c
@@ -923,17 +923,17 @@ void sh2_common_init(sh2_state *sh2, legacy_cpu_device *device, device_irq_callb
const sh2_cpu_core *conf = (const sh2_cpu_core *)device->baseconfig().static_config();
int i;
- sh2->timer = device->machine->scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
+ sh2->timer = device->machine().scheduler().timer_alloc(FUNC(sh2_timer_callback), sh2);
sh2->timer->adjust(attotime::never);
- sh2->dma_current_active_timer[0] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
+ sh2->dma_current_active_timer[0] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[0]->adjust(attotime::never);
- sh2->dma_current_active_timer[1] = device->machine->scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
+ sh2->dma_current_active_timer[1] = device->machine().scheduler().timer_alloc(FUNC(sh2_dma_current_active_callback), sh2);
sh2->dma_current_active_timer[1]->adjust(attotime::never);
- sh2->m = auto_alloc_array(device->machine, UINT32, 0x200/4);
+ sh2->m = auto_alloc_array(device->machine(), UINT32, 0x200/4);
if(conf)
{
diff --git a/src/emu/cpu/sh2/sh2drc.c b/src/emu/cpu/sh2/sh2drc.c
index f1a44969ff4..41bcc49289e 100644
--- a/src/emu/cpu/sh2/sh2drc.c
+++ b/src/emu/cpu/sh2/sh2drc.c
@@ -8,7 +8,7 @@
Visit http://mamedev.org for licensing and usage restrictions.
ST-V status:
- colmns97 & stress crash due to SCSP stream->machine getting corrupted.
+ colmns97 & stress crash due to SCSP stream->machine() getting corrupted.
cottonbm w/US bios: run to 60323B4 on master, then MOV insn @ 602f5aa crashes?
actually crash on slave @ 6032b38 after above. reading wrong addr for jump vector.
@@ -683,7 +683,7 @@ static CPU_INIT( sh2 )
int regnum;
/* allocate enough space for the cache and the core */
- cache = auto_alloc(device->machine, drc_cache(CACHE_SIZE + sizeof(sh2_state)));
+ cache = auto_alloc(device->machine(), drc_cache(CACHE_SIZE + sizeof(sh2_state)));
/* allocate the core memory */
*(sh2_state **)device->token() = sh2 = (sh2_state *)cache->alloc_near(sizeof(sh2_state));
@@ -705,7 +705,7 @@ static CPU_INIT( sh2 )
flags |= DRCUML_OPTION_LOG_UML;
if (LOG_NATIVE)
flags |= DRCUML_OPTION_LOG_NATIVE;
- sh2->drcuml = auto_alloc(device->machine, drcuml_state(*device, *cache, flags, 1, 32, 1));
+ sh2->drcuml = auto_alloc(device->machine(), drcuml_state(*device, *cache, flags, 1, 32, 1));
/* add symbols for our stuff */
sh2->drcuml->symbol_add(&sh2->pc, sizeof(sh2->pc), "pc");
@@ -724,7 +724,7 @@ static CPU_INIT( sh2 )
sh2->drcuml->symbol_add(&sh2->mach, sizeof(sh2->macl), "mach");
/* initialize the front-end helper */
- sh2->drcfe = auto_alloc(device->machine, sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
+ sh2->drcfe = auto_alloc(device->machine(), sh2_frontend(*sh2, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE));
/* compute the register parameters */
for (regnum = 0; regnum < 16; regnum++)
@@ -764,9 +764,9 @@ static CPU_EXIT( sh2 )
sh2_state *sh2 = get_safe_token(device);
/* clean up the DRC */
- auto_free(device->machine, sh2->drcfe);
- auto_free(device->machine, sh2->drcuml);
- auto_free(device->machine, sh2->cache);
+ auto_free(device->machine(), sh2->drcfe);
+ auto_free(device->machine(), sh2->drcuml);
+ auto_free(device->machine(), sh2->cache);
}
@@ -1577,7 +1577,7 @@ static void generate_sequence_instruction(sh2_state *sh2, drcuml_block *block, c
}
/* if we are debugging, call the debugger */
- if ((sh2->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh2->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
UML_MOV(block, mem(&sh2->pc), desc->pc); // mov [pc],desc->pc
save_fast_iregs(sh2, block);
diff --git a/src/emu/cpu/sh4/sh4.c b/src/emu/cpu/sh4/sh4.c
index d928ae6d633..6d508d9b996 100644
--- a/src/emu/cpu/sh4/sh4.c
+++ b/src/emu/cpu/sh4/sh4.c
@@ -845,7 +845,7 @@ INLINE void LDCSR(sh4_state *sh4, UINT32 m)
UINT32 reg;
reg = sh4->r[m];
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if ((sh4->r[m] & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->r[m] & sRB ? 1 : 0);
@@ -873,7 +873,7 @@ UINT32 old;
old = sh4->sr;
sh4->ea = sh4->r[m];
sh4->sr = RL(sh4, sh4->ea ) & FLAGS;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (old & sRB) >> 29);
if ((old & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->sr & sRB ? 1 : 0);
@@ -1459,7 +1459,7 @@ INLINE void RTE(sh4_state *sh4)
{
sh4->delay = sh4->pc;
sh4->pc = sh4->ea = sh4->spc;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if ((sh4->ssr & sRB) != (sh4->sr & sRB))
sh4_change_register_bank(sh4, sh4->ssr & sRB ? 1 : 0);
@@ -1750,7 +1750,7 @@ INLINE void TRAPA(sh4_state *sh4, UINT32 i)
sh4->sgr = sh4->r[15];
sh4->sr |= MD;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if (!(sh4->sr & sRB))
sh4_change_register_bank(sh4, 1);
@@ -3196,7 +3196,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
FRCHG(sh4);
break;
default:
- debugger_break(sh4->device->machine);
+ debugger_break(sh4->device->machine());
break;
}
} else {
@@ -3207,7 +3207,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
}
break;
default:
- debugger_break(sh4->device->machine);
+ debugger_break(sh4->device->machine());
break;
}
break;
@@ -3215,7 +3215,7 @@ INLINE void op1111(sh4_state *sh4, UINT16 opcode)
FMAC(sh4, Rm,Rn);
break;
default:
- debugger_break(sh4->device->machine);
+ debugger_break(sh4->device->machine());
break;
}
}
diff --git a/src/emu/cpu/sh4/sh4comn.c b/src/emu/cpu/sh4/sh4comn.c
index f6df416911c..e24742e9f28 100644
--- a/src/emu/cpu/sh4/sh4comn.c
+++ b/src/emu/cpu/sh4/sh4comn.c
@@ -193,7 +193,7 @@ void sh4_exception(sh4_state *sh4, const char *message, int exception) // handle
sh4->sgr = sh4->r[15];
sh4->sr |= MD;
- if ((sh4->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((sh4->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
sh4_syncronize_register_bank(sh4, (sh4->sr & sRB) >> 29);
if (!(sh4->sr & sRB))
sh4_change_register_bank(sh4, 1);
@@ -1160,24 +1160,24 @@ void sh4_common_init(device_t *device)
for (i=0; i<3; i++)
{
- sh4->timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
+ sh4->timer[i] = device->machine().scheduler().timer_alloc(FUNC(sh4_timer_callback), sh4);
sh4->timer[i]->adjust(attotime::never, i);
}
for (i=0; i<4; i++)
{
- sh4->dma_timer[i] = device->machine->scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
+ sh4->dma_timer[i] = device->machine().scheduler().timer_alloc(FUNC(sh4_dmac_callback), sh4);
sh4->dma_timer[i]->adjust(attotime::never, i);
}
- sh4->refresh_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
+ sh4->refresh_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_refresh_timer_callback), sh4);
sh4->refresh_timer->adjust(attotime::never);
sh4->refresh_timer_base = 0;
- sh4->rtc_timer = device->machine->scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
+ sh4->rtc_timer = device->machine().scheduler().timer_alloc(FUNC(sh4_rtc_timer_callback), sh4);
sh4->rtc_timer->adjust(attotime::never);
- sh4->m = auto_alloc_array(device->machine, UINT32, 16384);
+ sh4->m = auto_alloc_array(device->machine(), UINT32, 16384);
}
void sh4_dma_ddt(device_t *device, struct sh4_ddt_dma *s)
diff --git a/src/emu/cpu/sharc/sharc.c b/src/emu/cpu/sharc/sharc.c
index 5d70fcc2f78..63bd604603f 100644
--- a/src/emu/cpu/sharc/sharc.c
+++ b/src/emu/cpu/sharc/sharc.c
@@ -430,7 +430,7 @@ static CPU_INIT( sharc )
build_opcode_table();
- cpustate->internal_ram = auto_alloc_array(device->machine, UINT16, 2 * 0x10000); // 2x 128KB
+ cpustate->internal_ram = auto_alloc_array(device->machine(), UINT16, 2 * 0x10000); // 2x 128KB
cpustate->internal_ram_block0 = &cpustate->internal_ram[0];
cpustate->internal_ram_block1 = &cpustate->internal_ram[0x20000/2];
diff --git a/src/emu/cpu/ssem/ssem.c b/src/emu/cpu/ssem/ssem.c
index 18d4aa7ead5..22f18c12983 100644
--- a/src/emu/cpu/ssem/ssem.c
+++ b/src/emu/cpu/ssem/ssem.c
@@ -95,7 +95,7 @@ INLINE void WRITE32(ssem_state *cpustate, UINT32 address, UINT32 data)
static void unimplemented_opcode(ssem_state *cpustate, UINT32 op)
{
- if((cpustate->device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if((cpustate->device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
char string[200];
ssem_dasm_one(string, cpustate->pc-1, op);
diff --git a/src/emu/cpu/tlcs90/tlcs90.c b/src/emu/cpu/tlcs90/tlcs90.c
index aa38f2009ad..720112a8127 100644
--- a/src/emu/cpu/tlcs90/tlcs90.c
+++ b/src/emu/cpu/tlcs90/tlcs90.c
@@ -2726,9 +2726,9 @@ static CPU_INIT( t90 )
// Timers
for (i = 0; i < 4; i++)
- cpustate->timer[i] = device->machine->scheduler().timer_alloc(FUNC(t90_timer_callback), cpustate);
+ cpustate->timer[i] = device->machine().scheduler().timer_alloc(FUNC(t90_timer_callback), cpustate);
- cpustate->timer[4] = device->machine->scheduler().timer_alloc(FUNC(t90_timer4_callback), cpustate);
+ cpustate->timer[4] = device->machine().scheduler().timer_alloc(FUNC(t90_timer4_callback), cpustate);
}
static ADDRESS_MAP_START(tmp90840_mem, AS_PROGRAM, 8)
diff --git a/src/emu/cpu/tms32025/tms32025.c b/src/emu/cpu/tms32025/tms32025.c
index 1c9aa0dd33a..fcaf214431b 100644
--- a/src/emu/cpu/tms32025/tms32025.c
+++ b/src/emu/cpu/tms32025/tms32025.c
@@ -1719,7 +1719,7 @@ static CPU_INIT( tms32025 )
{
tms32025_state *cpustate = get_safe_token(device);
- cpustate->intRAM = auto_alloc_array(device->machine, UINT16, 0x800);
+ cpustate->intRAM = auto_alloc_array(device->machine(), UINT16, 0x800);
cpustate->irq_callback = irqcallback;
cpustate->device = device;
cpustate->program = device->space(AS_PROGRAM);
diff --git a/src/emu/cpu/tms32031/32031ops.c b/src/emu/cpu/tms32031/32031ops.c
index 9fae72f13cd..4a3654b5c03 100644
--- a/src/emu/cpu/tms32031/32031ops.c
+++ b/src/emu/cpu/tms32031/32031ops.c
@@ -103,7 +103,7 @@ void tms3203x_device::illegal(UINT32 op)
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
logerror("Illegal op @ %06X: %08X (tbl=%03X)\n", m_pc - 1, op, op >> 21);
- debugger_break(machine);
+ debugger_break(m_machine);
}
}
@@ -120,7 +120,7 @@ inline void tms3203x_device::execute_one()
m_icount -= 2; // 2 clocks per cycle
m_pc++;
#if (TMS_3203X_LOG_OPCODE_USAGE)
- if (machine->primary_screen->frame_number() == 2003)
+ if (machine.primary_screen->frame_number() == 2003)
m_hits[op >> 21]++;
#endif
(this->*s_tms32031ops[op >> 21])(op);
diff --git a/src/emu/cpu/tms32031/tms32031.c b/src/emu/cpu/tms32031/tms32031.c
index 124a7d81e2a..32e37e8b874 100644
--- a/src/emu/cpu/tms32031/tms32031.c
+++ b/src/emu/cpu/tms32031/tms32031.c
@@ -178,12 +178,12 @@ device_config *tms32032_device_config::static_alloc_device_config(const machine_
device_t *tms32031_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, tms32031_device(machine, *this));
+ return auto_alloc(machine, tms32031_device(machine, *this));
}
device_t *tms32032_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, tms32032_device(machine, *this));
+ return auto_alloc(machine, tms32032_device(machine, *this));
}
@@ -854,7 +854,7 @@ void tms3203x_device::execute_run()
{
// watch for out-of-range stack pointers
if (IREG(TMR_SP) & 0xff000000)
- debugger_break(&m_machine);
+ debugger_break(m_machine);
if ((IREG(TMR_ST) & RMFLAG) && m_pc == IREG(TMR_RE) + 1)
{
if ((INT32)--IREG(TMR_RC) >= 0)
diff --git a/src/emu/cpu/tms34010/34010gfx.c b/src/emu/cpu/tms34010/34010gfx.c
index 2936d3961bd..73dd70ee972 100644
--- a/src/emu/cpu/tms34010/34010gfx.c
+++ b/src/emu/cpu/tms34010/34010gfx.c
@@ -11,7 +11,7 @@
#define LOG_GFX_OPS 0
-#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine, KEYCODE_L)) logerror x; } while (0)
+#define LOGGFX(x) do { if (LOG_GFX_OPS && input_code_pressed(tms->device->machine(), KEYCODE_L)) logerror x; } while (0)
/* Graphics Instructions */
diff --git a/src/emu/cpu/tms34010/34010ops.c b/src/emu/cpu/tms34010/34010ops.c
index ab162bfd88c..66d5f8237b4 100644
--- a/src/emu/cpu/tms34010/34010ops.c
+++ b/src/emu/cpu/tms34010/34010ops.c
@@ -97,7 +97,7 @@ static void unimpl(tms34010_state *tms, UINT16 op)
if (tms->pc == 0 || opcode_table[tms->direct->read_decrypted_word(TOBYTE(tms->pc)) >> 4] == unimpl)
{
device_set_input_line(tms->device, INPUT_LINE_HALT, ASSERT_LINE);
- debugger_break(tms->device->machine);
+ debugger_break(tms->device->machine());
}
}
diff --git a/src/emu/cpu/tms34010/tms34010.c b/src/emu/cpu/tms34010/tms34010.c
index c89895c5066..65b3b9e9ab0 100644
--- a/src/emu/cpu/tms34010/tms34010.c
+++ b/src/emu/cpu/tms34010/tms34010.c
@@ -630,7 +630,7 @@ static CPU_INIT( tms34010 )
tms->device = device;
tms->program = device->space(AS_PROGRAM);
tms->direct = &tms->program->direct();
- tms->screen = downcast<screen_device *>(device->machine->device(configdata->screen_tag));
+ tms->screen = downcast<screen_device *>(device->machine().device(configdata->screen_tag));
/* set up the state table */
{
@@ -652,11 +652,11 @@ static CPU_INIT( tms34010 )
}
/* allocate a scanline timer and set it to go off at the start */
- tms->scantimer = device->machine->scheduler().timer_alloc(FUNC(scanline_callback), tms);
+ tms->scantimer = device->machine().scheduler().timer_alloc(FUNC(scanline_callback), tms);
tms->scantimer->adjust(attotime::zero);
/* allocate the shiftreg */
- tms->shiftreg = auto_alloc_array(device->machine, UINT16, SHIFTREG_SIZE/2);
+ tms->shiftreg = auto_alloc_array(device->machine(), UINT16, SHIFTREG_SIZE/2);
device->save_item(NAME(tms->pc));
device->save_item(NAME(tms->st));
@@ -669,7 +669,7 @@ static CPU_INIT( tms34010 )
device->save_item(NAME(tms->pixelshift));
device->save_item(NAME(tms->gfxcycles));
device->save_pointer(NAME(&tms->regs[0].reg), ARRAY_LENGTH(tms->regs));
- device->machine->state().register_postload(tms34010_state_postload, tms);
+ device->machine().state().register_postload(tms34010_state_postload, tms);
}
static CPU_RESET( tms34010 )
@@ -799,7 +799,7 @@ static CPU_EXECUTE( tms34010 )
/* check interrupts first */
tms->executing = TRUE;
check_interrupt(tms);
- if ((tms->device->machine->debug_flags & DEBUG_FLAG_ENABLED) == 0)
+ if ((tms->device->machine().debug_flags & DEBUG_FLAG_ENABLED) == 0)
{
do
{
@@ -1080,14 +1080,14 @@ void tms34010_get_display_params(device_t *cpu, tms34010_display_params *params)
SCREEN_UPDATE( tms340x0 )
{
- pen_t blackpen = get_black_pen(screen->machine);
+ pen_t blackpen = get_black_pen(screen->machine());
tms34010_display_params params;
tms34010_state *tms = NULL;
device_t *cpu;
int x;
/* find the owning CPU */
- for (cpu = screen->machine->m_devicelist.first(); cpu != NULL; cpu = cpu->next())
+ for (cpu = screen->machine().m_devicelist.first(); cpu != NULL; cpu = cpu->next())
{
device_type type = cpu->type();
if (type == TMS34010 || type == TMS34020)
@@ -1200,7 +1200,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* NMI issued? */
if (data & 0x0100)
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
break;
case REG_HSTCTLL:
@@ -1235,7 +1235,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
/* input interrupt? (should really be state-based, but the functions don't exist!) */
if (!(oldreg & 0x0008) && (newreg & 0x0008))
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
else if ((oldreg & 0x0008) && !(newreg & 0x0008))
IOREG(tms, REG_INTPEND) &= ~TMS34010_HI;
break;
@@ -1270,7 +1270,7 @@ WRITE16_HANDLER( tms34010_io_register_w )
}
// if (LOG_CONTROL_REGS)
-// logerror("%s: %s = %04X (%d)\n", tms->device->machine->describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
+// logerror("%s: %s = %04X (%d)\n", tms->device->machine().describe_context(), ioreg_name[offset], IOREG(tms, offset), tms->screen->vpos());
}
@@ -1307,7 +1307,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
IOREG(tms, offset) = data;
// if (LOG_CONTROL_REGS)
-// logerror("%s: %s = %04X (%d)\n", device->machine->describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
+// logerror("%s: %s = %04X (%d)\n", device->machine().describe_context(), ioreg020_name[offset], IOREG(tms, offset), tms->screen->vpos());
switch (offset)
{
@@ -1351,7 +1351,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* NMI issued? */
if (data & 0x0100)
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), 0, tms);
break;
case REG020_HSTCTLL:
@@ -1386,7 +1386,7 @@ WRITE16_HANDLER( tms34020_io_register_w )
/* input interrupt? (should really be state-based, but the functions don't exist!) */
if (!(oldreg & 0x0008) && (newreg & 0x0008))
- tms->device->machine->scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
+ tms->device->machine().scheduler().synchronize(FUNC(internal_interrupt_callback), TMS34010_HI, tms);
else if ((oldreg & 0x0008) && !(newreg & 0x0008))
IOREG(tms, REG020_INTPEND) &= ~TMS34010_HI;
break;
@@ -1466,7 +1466,7 @@ READ16_HANDLER( tms34010_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
-// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
+// logerror("%s: read %s\n", device->machine().describe_context(), ioreg_name[offset]);
switch (offset)
{
@@ -1509,7 +1509,7 @@ READ16_HANDLER( tms34020_io_register_r )
int result, total;
// if (LOG_CONTROL_REGS)
-// logerror("%s: read %s\n", device->machine->describe_context(), ioreg_name[offset]);
+// logerror("%s: read %s\n", device->machine().describe_context(), ioreg_name[offset]);
switch (offset)
{
diff --git a/src/emu/cpu/tms9900/99xxcore.h b/src/emu/cpu/tms9900/99xxcore.h
index 31c953c68a1..df8a4714626 100644
--- a/src/emu/cpu/tms9900/99xxcore.h
+++ b/src/emu/cpu/tms9900/99xxcore.h
@@ -1298,7 +1298,7 @@ static CPU_INIT( tms99xx )
cpustate->io = device->space(AS_IO);
#if (TMS99XX_MODEL == TMS9995_ID)
- cpustate->timer = device->machine->scheduler().timer_alloc(FUNC(decrementer_callback), cpustate);
+ cpustate->timer = device->machine().scheduler().timer_alloc(FUNC(decrementer_callback), cpustate);
#endif
cpustate->idle_callback = param ? param->idle_callback : NULL;
@@ -1815,7 +1815,7 @@ static void tms99xx_set_irq_line(tms99xx_state *cpustate, int irqline, int state
{ /* decrement, then interrupt if reach 0 */
if ((-- cpustate->decrementer_count) == 0)
{
- decrementer_callback(cpustate->device->machine, cpustate, 0);
+ decrementer_callback(cpustate->device->machine(), cpustate, 0);
cpustate->decrementer_count = cpustate->decrementer_interval; /* reload */
}
}
diff --git a/src/emu/cpu/upd7725/upd7725.c b/src/emu/cpu/upd7725/upd7725.c
index 5922099e680..5856bb50611 100755
--- a/src/emu/cpu/upd7725/upd7725.c
+++ b/src/emu/cpu/upd7725/upd7725.c
@@ -72,17 +72,17 @@ device_config *upd96050_device_config::static_alloc_device_config(const machine_
device_t *necdsp_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, necdsp_device(machine, *this));
+ return auto_alloc(machine, necdsp_device(machine, *this));
}
device_t *upd7725_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, upd7725_device(machine, *this));
+ return auto_alloc(machine, upd7725_device(machine, *this));
}
device_t *upd96050_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, upd96050_device(machine, *this));
+ return auto_alloc(machine, upd96050_device(machine, *this));
}
//-------------------------------------------------
diff --git a/src/emu/cpu/vtlb.c b/src/emu/cpu/vtlb.c
index 80a5b9109f7..7cec6b3a90e 100644
--- a/src/emu/cpu/vtlb.c
+++ b/src/emu/cpu/vtlb.c
@@ -59,7 +59,7 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
vtlb_state *vtlb;
/* allocate memory for the core structure */
- vtlb = auto_alloc_clear(cpu->machine, vtlb_state);
+ vtlb = auto_alloc_clear(cpu->machine(), vtlb_state);
/* fill in CPU information */
vtlb->cpudevice = downcast<cpu_device *>(cpu);
@@ -76,17 +76,17 @@ vtlb_state *vtlb_alloc(device_t *cpu, address_spacenum space, int fixed_entries,
assert(vtlb->addrwidth > vtlb->pageshift);
/* allocate the entry array */
- vtlb->live = auto_alloc_array_clear(cpu->machine, offs_t, fixed_entries + dynamic_entries);
+ vtlb->live = auto_alloc_array_clear(cpu->machine(), offs_t, fixed_entries + dynamic_entries);
cpu->save_pointer(NAME(vtlb->live), fixed_entries + dynamic_entries, space);
/* allocate the lookup table */
- vtlb->table = auto_alloc_array_clear(cpu->machine, vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
+ vtlb->table = auto_alloc_array_clear(cpu->machine(), vtlb_entry, (size_t) 1 << (vtlb->addrwidth - vtlb->pageshift));
cpu->save_pointer(NAME(vtlb->table), 1 << (vtlb->addrwidth - vtlb->pageshift), space);
/* allocate the fixed page count array */
if (fixed_entries > 0)
{
- vtlb->fixedpages = auto_alloc_array_clear(cpu->machine, int, fixed_entries);
+ vtlb->fixedpages = auto_alloc_array_clear(cpu->machine(), int, fixed_entries);
cpu->save_pointer(NAME(vtlb->fixedpages), fixed_entries, space);
}
return vtlb;
@@ -101,16 +101,16 @@ void vtlb_free(vtlb_state *vtlb)
{
/* free the fixed pages if allocated */
if (vtlb->fixedpages != NULL)
- auto_free(vtlb->cpudevice->machine, vtlb->fixedpages);
+ auto_free(vtlb->cpudevice->machine(), vtlb->fixedpages);
/* free the table and array if they exist */
if (vtlb->live != NULL)
- auto_free(vtlb->cpudevice->machine, vtlb->live);
+ auto_free(vtlb->cpudevice->machine(), vtlb->live);
if (vtlb->table != NULL)
- auto_free(vtlb->cpudevice->machine, vtlb->table);
+ auto_free(vtlb->cpudevice->machine(), vtlb->table);
/* and then the VTLB object itself */
- auto_free(vtlb->cpudevice->machine, vtlb);
+ auto_free(vtlb->cpudevice->machine(), vtlb);
}
diff --git a/src/emu/cpu/z180/z180.c b/src/emu/cpu/z180/z180.c
index 5f9139ffc78..546cef949c0 100644
--- a/src/emu/cpu/z180/z180.c
+++ b/src/emu/cpu/z180/z180.c
@@ -1945,8 +1945,8 @@ static CPU_INIT( z180 )
cpustate->daisy.init(device, (const z80_daisy_config *)device->baseconfig().static_config());
cpustate->irq_callback = irqcallback;
- SZHVC_add = auto_alloc_array(device->machine, UINT8, 2*256*256);
- SZHVC_sub = auto_alloc_array(device->machine, UINT8, 2*256*256);
+ SZHVC_add = auto_alloc_array(device->machine(), UINT8, 2*256*256);
+ SZHVC_sub = auto_alloc_array(device->machine(), UINT8, 2*256*256);
/* set up the state table */
{
diff --git a/src/emu/cpu/z8/z8.c b/src/emu/cpu/z8/z8.c
index e25b8f3b24c..444f36b4af2 100644
--- a/src/emu/cpu/z8/z8.c
+++ b/src/emu/cpu/z8/z8.c
@@ -669,8 +669,8 @@ static CPU_INIT( z8 )
cpustate->io = device->space(AS_IO);
/* allocate timers */
- cpustate->t0_timer = device->machine->scheduler().timer_alloc(FUNC(t0_tick), cpustate);
- cpustate->t1_timer = device->machine->scheduler().timer_alloc(FUNC(t1_tick), cpustate);
+ cpustate->t0_timer = device->machine().scheduler().timer_alloc(FUNC(t0_tick), cpustate);
+ cpustate->t1_timer = device->machine().scheduler().timer_alloc(FUNC(t1_tick), cpustate);
/* register for state saving */
device->save_item(NAME(cpustate->pc));
diff --git a/src/emu/cpu/z80/z80daisy.c b/src/emu/cpu/z80/z80daisy.c
index 9b789d0e38d..4b50bd12118 100644
--- a/src/emu/cpu/z80/z80daisy.c
+++ b/src/emu/cpu/z80/z80daisy.c
@@ -95,7 +95,7 @@ void z80_daisy_chain::init(device_t *cpudevice, const z80_daisy_config *daisy)
fatalerror("Device '%s' does not implement the z80daisy interface!", daisy->devname);
// append to the end
- *tailptr = auto_alloc(cpudevice->machine, daisy_entry(target));
+ *tailptr = auto_alloc(cpudevice->machine(), daisy_entry(target));
tailptr = &(*tailptr)->m_next;
}
}
diff --git a/src/emu/crsshair.c b/src/emu/crsshair.c
index c2ed06f4233..fbf9700ab83 100644
--- a/src/emu/crsshair.c
+++ b/src/emu/crsshair.c
@@ -132,8 +132,8 @@ static const rgb_t crosshair_colors[] =
***************************************************************************/
static void crosshair_exit(running_machine &machine);
-static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+static void crosshair_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void crosshair_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static void animate(screen_device &device, void *param, bool vblank_state);
@@ -148,7 +148,7 @@ static void animate(screen_device &device, void *param, bool vblank_state);
structures for the given player
-------------------------------------------------*/
-static void create_bitmap(running_machine *machine, int player)
+static void create_bitmap(running_machine &machine, int player)
{
int x, y;
char filename[20];
@@ -156,9 +156,9 @@ static void create_bitmap(running_machine *machine, int player)
/* if we have a bitmap and texture for this player, kill it */
global_free(global.bitmap[player]);
- machine->render().texture_free(global.texture[player]);
+ machine.render().texture_free(global.texture[player]);
- emu_file crossfile(machine->options().crosshair_path(), OPEN_FLAG_READ);
+ emu_file crossfile(machine.options().crosshair_path(), OPEN_FLAG_READ);
if (global.name[player][0] != 0)
{
/* look for user specified file */
@@ -169,7 +169,7 @@ static void create_bitmap(running_machine *machine, int player)
{
/* look for default cross?.png in crsshair\game dir */
sprintf(filename, "cross%d.png", player + 1);
- global.bitmap[player] = render_load_png(crossfile, machine->system().name, filename, NULL, NULL);
+ global.bitmap[player] = render_load_png(crossfile, machine.system().name, filename, NULL, NULL);
/* look for default cross?.png in crsshair dir */
if (global.bitmap[player] == NULL)
@@ -198,7 +198,7 @@ static void create_bitmap(running_machine *machine, int player)
}
/* create a texture to reference the bitmap */
- global.texture[player] = machine->render().texture_alloc(render_texture::hq_scale);
+ global.texture[player] = machine.render().texture_alloc(render_texture::hq_scale);
global.texture[player]->set_bitmap(global.bitmap[player], NULL, TEXFORMAT_ARGB32);
}
@@ -208,10 +208,10 @@ static void create_bitmap(running_machine *machine, int player)
bitmaps and such
-------------------------------------------------*/
-void crosshair_init(running_machine *machine)
+void crosshair_init(running_machine &machine)
{
/* request a callback upon exiting */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, crosshair_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, crosshair_exit);
/* clear all the globals */
memset(&global, 0, sizeof(global));
@@ -220,7 +220,7 @@ void crosshair_init(running_machine *machine)
global.auto_time = CROSSHAIR_VISIBILITY_AUTOTIME_DEFAULT;
/* determine who needs crosshairs */
- for (const input_port_config *port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (const input_port_config *port = machine.m_portlist.first(); port != NULL; port = port->next())
for (const input_field_config *field = port->fieldlist; field != NULL; field = field->next)
if (field->crossaxis != CROSSHAIR_AXIS_NONE)
{
@@ -235,7 +235,7 @@ void crosshair_init(running_machine *machine)
global.visible[player] = (CROSSHAIR_VISIBILITY_DEFAULT == CROSSHAIR_VISIBILITY_OFF) ? FALSE : TRUE;
/* for now, use the main screen */
- global.screen[player] = machine->primary_screen;
+ global.screen[player] = machine.primary_screen;
create_bitmap(machine, player);
}
@@ -245,8 +245,8 @@ void crosshair_init(running_machine *machine)
config_register(machine, "crosshairs", crosshair_load, crosshair_save);
/* register the animation callback */
- if (machine->primary_screen != NULL)
- machine->primary_screen->register_vblank_callback(animate, NULL);
+ if (machine.primary_screen != NULL)
+ machine.primary_screen->register_vblank_callback(animate, NULL);
}
@@ -274,7 +274,7 @@ static void crosshair_exit(running_machine &machine)
if any crosshairs are used
-------------------------------------------------*/
-int crosshair_get_usage(running_machine *machine)
+int crosshair_get_usage(running_machine &machine)
{
return global.usage;
}
@@ -286,7 +286,7 @@ int crosshair_get_usage(running_machine *machine)
Note: auto_time is common for all players
-------------------------------------------------*/
-void crosshair_get_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings)
+void crosshair_get_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings)
{
settings->auto_time = global.auto_time;
settings->used = global.used[player];
@@ -301,7 +301,7 @@ void crosshair_get_user_settings(running_machine *machine, UINT8 player, crossha
Note: auto_time is common for all players
-------------------------------------------------*/
-void crosshair_set_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings)
+void crosshair_set_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings)
{
int changed = FALSE;
@@ -346,7 +346,7 @@ static void animate(screen_device &device, void *param, bool vblank_state)
{
/* read all the lightgun values */
if (global.used[player])
- input_port_get_crosshair_position(device.machine, player, &global.x[player], &global.y[player]);
+ input_port_get_crosshair_position(device.machine(), player, &global.x[player], &global.y[player]);
/* auto visibility */
if (global.mode[player] == CROSSHAIR_VISIBILITY_AUTO)
@@ -405,7 +405,7 @@ void crosshair_render(screen_device &screen)
given player's crosshair
-------------------------------------------------*/
-void crosshair_set_screen(running_machine *machine, int player, device_t *screen)
+void crosshair_set_screen(running_machine &machine, int player, device_t *screen)
{
global.screen[player] = screen;
}
@@ -416,7 +416,7 @@ void crosshair_set_screen(running_machine *machine, int player, device_t *screen
configuration file
-------------------------------------------------*/
-static void crosshair_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void crosshair_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* Note: crosshair_load() is only registered if croshairs are used */
@@ -475,7 +475,7 @@ static void crosshair_load(running_machine *machine, int config_type, xml_data_n
configuration file
-------------------------------------------------*/
-static void crosshair_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void crosshair_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* Note: crosshair_save() is only registered if crosshairs are used */
diff --git a/src/emu/crsshair.h b/src/emu/crsshair.h
index 92285c7f2db..defbea703d1 100644
--- a/src/emu/crsshair.h
+++ b/src/emu/crsshair.h
@@ -59,22 +59,22 @@ struct _crosshair_user_settings
***************************************************************************/
/* initializes the crosshair system */
-void crosshair_init(running_machine *machine);
+void crosshair_init(running_machine &machine);
/* draws crosshair(s) in a given screen, if neccessary */
void crosshair_render(screen_device &screen);
/* sets the screen(s) for a given player's crosshair */
-void crosshair_set_screen(running_machine *machine, int player, device_t *screen);
+void crosshair_set_screen(running_machine &machine, int player, device_t *screen);
/* return TRUE if any crosshairs are used */
-int crosshair_get_usage(running_machine *machine);
+int crosshair_get_usage(running_machine &machine);
/* return the current crosshair settings for the given player */
-void crosshair_get_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings);
+void crosshair_get_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings);
/* modify the current crosshair settings for the given player */
-void crosshair_set_user_settings(running_machine *machine, UINT8 player, crosshair_user_settings *settings);
+void crosshair_set_user_settings(running_machine &machine, UINT8 player, crosshair_user_settings *settings);
#endif /* __CRSSHAIR_H__ */
diff --git a/src/emu/debug/debugcmd.c b/src/emu/debug/debugcmd.c
index 2bd5196eaff..c3e76dd192b 100644
--- a/src/emu/debug/debugcmd.c
+++ b/src/emu/debug/debugcmd.c
@@ -99,56 +99,56 @@ static UINT64 execute_if(symbol_table &table, void *ref, int params, const UINT6
static UINT64 global_get(symbol_table &table, void *ref);
static void global_set(symbol_table &table, void *ref, UINT64 value);
-static void execute_help(running_machine *machine, int ref, int params, const char **param);
-static void execute_print(running_machine *machine, int ref, int params, const char **param);
-static void execute_printf(running_machine *machine, int ref, int params, const char **param);
-static void execute_logerror(running_machine *machine, int ref, int params, const char **param);
-static void execute_tracelog(running_machine *machine, int ref, int params, const char **param);
-static void execute_quit(running_machine *machine, int ref, int params, const char **param);
-static void execute_do(running_machine *machine, int ref, int params, const char **param);
-static void execute_step(running_machine *machine, int ref, int params, const char **param);
-static void execute_over(running_machine *machine, int ref, int params, const char **param);
-static void execute_out(running_machine *machine, int ref, int params, const char **param);
-static void execute_go(running_machine *machine, int ref, int params, const char **param);
-static void execute_go_vblank(running_machine *machine, int ref, int params, const char **param);
-static void execute_go_interrupt(running_machine *machine, int ref, int params, const char **param);
-static void execute_go_time(running_machine *machine, int ref, int params, const char *param[]);
-static void execute_focus(running_machine *machine, int ref, int params, const char **param);
-static void execute_ignore(running_machine *machine, int ref, int params, const char **param);
-static void execute_observe(running_machine *machine, int ref, int params, const char **param);
-static void execute_next(running_machine *machine, int ref, int params, const char **param);
-static void execute_comment(running_machine *machine, int ref, int params, const char **param);
-static void execute_comment_del(running_machine *machine, int ref, int params, const char **param);
-static void execute_comment_save(running_machine *machine, int ref, int params, const char **param);
-static void execute_bpset(running_machine *machine, int ref, int params, const char **param);
-static void execute_bpclear(running_machine *machine, int ref, int params, const char **param);
-static void execute_bpdisenable(running_machine *machine, int ref, int params, const char **param);
-static void execute_bplist(running_machine *machine, int ref, int params, const char **param);
-static void execute_wpset(running_machine *machine, int ref, int params, const char **param);
-static void execute_wpclear(running_machine *machine, int ref, int params, const char **param);
-static void execute_wpdisenable(running_machine *machine, int ref, int params, const char **param);
-static void execute_wplist(running_machine *machine, int ref, int params, const char **param);
-static void execute_hotspot(running_machine *machine, int ref, int params, const char **param);
-static void execute_save(running_machine *machine, int ref, int params, const char **param);
-static void execute_load(running_machine *machine, int ref, int params, const char **param);
-static void execute_dump(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatinit(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatnext(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatlist(running_machine *machine, int ref, int params, const char **param);
-static void execute_cheatundo(running_machine *machine, int ref, int params, const char **param);
-static void execute_dasm(running_machine *machine, int ref, int params, const char **param);
-static void execute_find(running_machine *machine, int ref, int params, const char **param);
-static void execute_trace(running_machine *machine, int ref, int params, const char **param);
-static void execute_traceover(running_machine *machine, int ref, int params, const char **param);
-static void execute_traceflush(running_machine *machine, int ref, int params, const char **param);
-static void execute_history(running_machine *machine, int ref, int params, const char **param);
-static void execute_snap(running_machine *machine, int ref, int params, const char **param);
-static void execute_source(running_machine *machine, int ref, int params, const char **param);
-static void execute_map(running_machine *machine, int ref, int params, const char **param);
-static void execute_memdump(running_machine *machine, int ref, int params, const char **param);
-static void execute_symlist(running_machine *machine, int ref, int params, const char **param);
-static void execute_softreset(running_machine *machine, int ref, int params, const char **param);
-static void execute_hardreset(running_machine *machine, int ref, int params, const char **param);
+static void execute_help(running_machine &machine, int ref, int params, const char **param);
+static void execute_print(running_machine &machine, int ref, int params, const char **param);
+static void execute_printf(running_machine &machine, int ref, int params, const char **param);
+static void execute_logerror(running_machine &machine, int ref, int params, const char **param);
+static void execute_tracelog(running_machine &machine, int ref, int params, const char **param);
+static void execute_quit(running_machine &machine, int ref, int params, const char **param);
+static void execute_do(running_machine &machine, int ref, int params, const char **param);
+static void execute_step(running_machine &machine, int ref, int params, const char **param);
+static void execute_over(running_machine &machine, int ref, int params, const char **param);
+static void execute_out(running_machine &machine, int ref, int params, const char **param);
+static void execute_go(running_machine &machine, int ref, int params, const char **param);
+static void execute_go_vblank(running_machine &machine, int ref, int params, const char **param);
+static void execute_go_interrupt(running_machine &machine, int ref, int params, const char **param);
+static void execute_go_time(running_machine &machine, int ref, int params, const char *param[]);
+static void execute_focus(running_machine &machine, int ref, int params, const char **param);
+static void execute_ignore(running_machine &machine, int ref, int params, const char **param);
+static void execute_observe(running_machine &machine, int ref, int params, const char **param);
+static void execute_next(running_machine &machine, int ref, int params, const char **param);
+static void execute_comment(running_machine &machine, int ref, int params, const char **param);
+static void execute_comment_del(running_machine &machine, int ref, int params, const char **param);
+static void execute_comment_save(running_machine &machine, int ref, int params, const char **param);
+static void execute_bpset(running_machine &machine, int ref, int params, const char **param);
+static void execute_bpclear(running_machine &machine, int ref, int params, const char **param);
+static void execute_bpdisenable(running_machine &machine, int ref, int params, const char **param);
+static void execute_bplist(running_machine &machine, int ref, int params, const char **param);
+static void execute_wpset(running_machine &machine, int ref, int params, const char **param);
+static void execute_wpclear(running_machine &machine, int ref, int params, const char **param);
+static void execute_wpdisenable(running_machine &machine, int ref, int params, const char **param);
+static void execute_wplist(running_machine &machine, int ref, int params, const char **param);
+static void execute_hotspot(running_machine &machine, int ref, int params, const char **param);
+static void execute_save(running_machine &machine, int ref, int params, const char **param);
+static void execute_load(running_machine &machine, int ref, int params, const char **param);
+static void execute_dump(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatinit(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatnext(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatlist(running_machine &machine, int ref, int params, const char **param);
+static void execute_cheatundo(running_machine &machine, int ref, int params, const char **param);
+static void execute_dasm(running_machine &machine, int ref, int params, const char **param);
+static void execute_find(running_machine &machine, int ref, int params, const char **param);
+static void execute_trace(running_machine &machine, int ref, int params, const char **param);
+static void execute_traceover(running_machine &machine, int ref, int params, const char **param);
+static void execute_traceflush(running_machine &machine, int ref, int params, const char **param);
+static void execute_history(running_machine &machine, int ref, int params, const char **param);
+static void execute_snap(running_machine &machine, int ref, int params, const char **param);
+static void execute_source(running_machine &machine, int ref, int params, const char **param);
+static void execute_map(running_machine &machine, int ref, int params, const char **param);
+static void execute_memdump(running_machine &machine, int ref, int params, const char **param);
+static void execute_symlist(running_machine &machine, int ref, int params, const char **param);
+static void execute_softreset(running_machine &machine, int ref, int params, const char **param);
+static void execute_hardreset(running_machine &machine, int ref, int params, const char **param);
@@ -226,7 +226,7 @@ INLINE UINT64 cheat_read_extended(const cheat_system *cheatsys, address_space *s
system
-------------------------------------------------*/
-void debug_command_init(running_machine *machine)
+void debug_command_init(running_machine &machine)
{
symbol_table *symtable = debug_cpu_get_global_symtable(machine);
const char *name;
@@ -244,7 +244,7 @@ void debug_command_init(running_machine *machine)
void *base;
/* stop when we run out of items */
- name = machine->state().indexed_item(itemnum, base, valsize, valcount);
+ name = machine.state().indexed_item(itemnum, base, valsize, valcount);
if (name == NULL)
break;
@@ -369,10 +369,10 @@ void debug_command_init(running_machine *machine)
debug_console_register_command(machine, "softreset", CMDFLAG_NONE, 0, 0, 1, execute_softreset);
debug_console_register_command(machine, "hardreset", CMDFLAG_NONE, 0, 0, 1, execute_hardreset);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_command_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_command_exit);
/* set up the initial debugscript if specified */
- name = machine->options().debug_script();
+ name = machine.options().debug_script();
if (name[0] != 0)
debug_cpu_source_script(machine, name);
}
@@ -389,7 +389,7 @@ static void debug_command_exit(running_machine &machine)
device->debug()->trace(NULL, 0, NULL);
if (cheat.length)
- auto_free(&machine, cheat.cheatmap);
+ auto_free(machine, cheat.cheatmap);
}
@@ -478,7 +478,7 @@ static void global_set(symbol_table &table, void *ref, UINT64 value)
number parameter
-------------------------------------------------*/
-int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result)
+int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result)
{
/* NULL parameter does nothing and returns no error */
if (param == NULL)
@@ -506,7 +506,7 @@ int debug_command_parameter_number(running_machine *machine, const char *param,
parameter as a cpu
-------------------------------------------------*/
-int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result)
+int debug_command_parameter_cpu(running_machine &machine, const char *param, device_t **result)
{
UINT64 cpunum;
@@ -523,7 +523,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
}
/* first look for a tag match */
- *result = machine->device(param);
+ *result = machine.device(param);
if (*result != NULL)
return TRUE;
@@ -540,7 +540,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
/* if we got a valid one, return */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (cpunum-- == 0)
{
*result = &exec->device();
@@ -559,7 +559,7 @@ int debug_command_parameter_cpu(running_machine *machine, const char *param, dev
address space
-------------------------------------------------*/
-int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, address_space **result)
+int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result)
{
device_t *cpu;
@@ -583,7 +583,7 @@ int debug_command_parameter_cpu_space(running_machine *machine, const char *para
an expression parameter
-------------------------------------------------*/
-static int debug_command_parameter_expression(running_machine *machine, const char *param, parsed_expression &result)
+static int debug_command_parameter_expression(running_machine &machine, const char *param, parsed_expression &result)
{
/* NULL parameter does nothing and returns no error */
if (param == NULL)
@@ -611,7 +611,7 @@ static int debug_command_parameter_expression(running_machine *machine, const ch
command parameter
-------------------------------------------------*/
-static int debug_command_parameter_command(running_machine *machine, const char *param)
+static int debug_command_parameter_command(running_machine &machine, const char *param)
{
CMDERR err;
@@ -641,7 +641,7 @@ static int debug_command_parameter_command(running_machine *machine, const char
execute_help - execute the help command
-------------------------------------------------*/
-static void execute_help(running_machine *machine, int ref, int params, const char *param[])
+static void execute_help(running_machine &machine, int ref, int params, const char *param[])
{
if (params == 0)
debug_console_printf_wrap(machine, 80, "%s\n", debug_get_help(""));
@@ -654,7 +654,7 @@ static void execute_help(running_machine *machine, int ref, int params, const ch
execute_print - execute the print command
-------------------------------------------------*/
-static void execute_print(running_machine *machine, int ref, int params, const char *param[])
+static void execute_print(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
int i;
@@ -675,7 +675,7 @@ static void execute_print(running_machine *machine, int ref, int params, const c
mini_printf - safe printf to a buffer
-------------------------------------------------*/
-static int mini_printf(running_machine *machine, char *buffer, const char *format, int params, UINT64 *param)
+static int mini_printf(running_machine &machine, char *buffer, const char *format, int params, UINT64 *param)
{
const char *f = format;
char *p = buffer;
@@ -769,7 +769,7 @@ static int mini_printf(running_machine *machine, char *buffer, const char *forma
execute_printf - execute the printf command
-------------------------------------------------*/
-static void execute_printf(running_machine *machine, int ref, int params, const char *param[])
+static void execute_printf(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@@ -790,7 +790,7 @@ static void execute_printf(running_machine *machine, int ref, int params, const
execute_logerror - execute the logerror command
-------------------------------------------------*/
-static void execute_logerror(running_machine *machine, int ref, int params, const char *param[])
+static void execute_logerror(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@@ -811,7 +811,7 @@ static void execute_logerror(running_machine *machine, int ref, int params, cons
execute_tracelog - execute the tracelog command
-------------------------------------------------*/
-static void execute_tracelog(running_machine *machine, int ref, int params, const char *param[])
+static void execute_tracelog(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 values[MAX_COMMAND_PARAMS];
char buffer[1024];
@@ -832,10 +832,10 @@ static void execute_tracelog(running_machine *machine, int ref, int params, cons
execute_quit - execute the quit command
-------------------------------------------------*/
-static void execute_quit(running_machine *machine, int ref, int params, const char *param[])
+static void execute_quit(running_machine &machine, int ref, int params, const char *param[])
{
mame_printf_error("Exited via the debugger\n");
- machine->schedule_exit();
+ machine.schedule_exit();
}
@@ -843,7 +843,7 @@ static void execute_quit(running_machine *machine, int ref, int params, const ch
execute_do - execute the do command
-------------------------------------------------*/
-static void execute_do(running_machine *machine, int ref, int params, const char *param[])
+static void execute_do(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 dummy;
debug_command_parameter_number(machine, param[0], &dummy);
@@ -854,7 +854,7 @@ static void execute_do(running_machine *machine, int ref, int params, const char
execute_step - execute the step command
-------------------------------------------------*/
-static void execute_step(running_machine *machine, int ref, int params, const char *param[])
+static void execute_step(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 steps = 1;
@@ -870,7 +870,7 @@ static void execute_step(running_machine *machine, int ref, int params, const ch
execute_over - execute the over command
-------------------------------------------------*/
-static void execute_over(running_machine *machine, int ref, int params, const char *param[])
+static void execute_over(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 steps = 1;
@@ -886,7 +886,7 @@ static void execute_over(running_machine *machine, int ref, int params, const ch
execute_out - execute the out command
-------------------------------------------------*/
-static void execute_out(running_machine *machine, int ref, int params, const char *param[])
+static void execute_out(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->single_step_out();
}
@@ -896,7 +896,7 @@ static void execute_out(running_machine *machine, int ref, int params, const cha
execute_go - execute the go command
-------------------------------------------------*/
-static void execute_go(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 addr = ~0;
@@ -913,7 +913,7 @@ static void execute_go(running_machine *machine, int ref, int params, const char
command
-------------------------------------------------*/
-static void execute_go_vblank(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go_vblank(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->go_vblank();
}
@@ -923,7 +923,7 @@ static void execute_go_vblank(running_machine *machine, int ref, int params, con
execute_go_interrupt - execute the goint command
-------------------------------------------------*/
-static void execute_go_interrupt(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go_interrupt(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 irqline = -1;
@@ -939,7 +939,7 @@ static void execute_go_interrupt(running_machine *machine, int ref, int params,
execute_go_time - execute the gtime command
-------------------------------------------------*/
-static void execute_go_time(running_machine *machine, int ref, int params, const char *param[])
+static void execute_go_time(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 milliseconds = -1;
@@ -955,7 +955,7 @@ static void execute_go_time(running_machine *machine, int ref, int params, const
execute_next - execute the next command
-------------------------------------------------*/
-static void execute_next(running_machine *machine, int ref, int params, const char *param[])
+static void execute_next(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_get_visible_cpu(machine)->debug()->go_next_device();
}
@@ -965,7 +965,7 @@ static void execute_next(running_machine *machine, int ref, int params, const ch
execute_focus - execute the focus command
-------------------------------------------------*/
-static void execute_focus(running_machine *machine, int ref, int params, const char *param[])
+static void execute_focus(running_machine &machine, int ref, int params, const char *param[])
{
/* validate params */
device_t *cpu;
@@ -977,7 +977,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
/* then loop over CPUs and set the ignore flags on all other CPUs */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != cpu)
exec->device().debug()->ignore(true);
debug_console_printf(machine, "Now focused on CPU '%s'\n", cpu->tag());
@@ -988,7 +988,7 @@ static void execute_focus(running_machine *machine, int ref, int params, const c
execute_ignore - execute the ignore command
-------------------------------------------------*/
-static void execute_ignore(running_machine *machine, int ref, int params, const char *param[])
+static void execute_ignore(running_machine &machine, int ref, int params, const char *param[])
{
/* if there are no parameters, dump the ignore list */
if (params == 0)
@@ -997,7 +997,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (!exec->device().debug()->observing())
@@ -1030,7 +1030,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
/* make sure this isn't the last live CPU */
device_execute_interface *exec = NULL;
bool gotone;
- for (gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
if (&exec->device() != devicelist[paramnum] && exec->device().debug()->observing())
break;
if (!gotone)
@@ -1050,7 +1050,7 @@ static void execute_ignore(running_machine *machine, int ref, int params, const
execute_observe - execute the observe command
-------------------------------------------------*/
-static void execute_observe(running_machine *machine, int ref, int params, const char *param[])
+static void execute_observe(running_machine &machine, int ref, int params, const char *param[])
{
/* if there are no parameters, dump the ignore list */
if (params == 0)
@@ -1059,7 +1059,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
/* loop over all executable devices */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
/* build up a comma-separated list */
if (exec->device().debug()->observing())
@@ -1100,7 +1100,7 @@ static void execute_observe(running_machine *machine, int ref, int params, const
execute_comment - add a comment to a line
-------------------------------------------------*/
-static void execute_comment(running_machine *machine, int ref, int params, const char *param[])
+static void execute_comment(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
@@ -1122,7 +1122,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const
/* Now try adding the comment */
cpu->debug()->comment_add(address, param[1], 0x00ff0000);
- cpu->machine->debug_view().update_all(DVT_DISASSEMBLY);
+ cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@@ -1130,7 +1130,7 @@ static void execute_comment(running_machine *machine, int ref, int params, const
execute_comment_del - remove a comment from an addr
--------------------------------------------------------*/
-static void execute_comment_del(running_machine *machine, int ref, int params, const char *param[])
+static void execute_comment_del(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
UINT64 address;
@@ -1146,7 +1146,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c
/* If it's a number, it must be an address */
/* The bankoff and cbn will be pulled from what's currently active */
cpu->debug()->comment_remove(address);
- cpu->machine->debug_view().update_all(DVT_DISASSEMBLY);
+ cpu->machine().debug_view().update_all(DVT_DISASSEMBLY);
}
@@ -1154,7 +1154,7 @@ static void execute_comment_del(running_machine *machine, int ref, int params, c
execute_comment - add a comment to a line
-------------------------------------------------*/
-static void execute_comment_save(running_machine *machine, int ref, int params, const char *param[])
+static void execute_comment_save(running_machine &machine, int ref, int params, const char *param[])
{
if (debug_comment_save(machine))
debug_console_printf(machine, "Comments successfully saved\n");
@@ -1166,7 +1166,7 @@ static void execute_comment_save(running_machine *machine, int ref, int params,
command
-------------------------------------------------*/
-static void execute_bpset(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bpset(running_machine &machine, int ref, int params, const char *param[])
{
device_t *cpu;
const char *action = NULL;
@@ -1201,14 +1201,14 @@ static void execute_bpset(running_machine *machine, int ref, int params, const c
clear command
-------------------------------------------------*/
-static void execute_bpclear(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bpclear(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_clear_all();
debug_console_printf(machine, "Cleared all breakpoints\n");
}
@@ -1219,7 +1219,7 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_clear(bpindex))
found = true;
if (found)
@@ -1235,14 +1235,14 @@ static void execute_bpclear(running_machine *machine, int ref, int params, const
disable/enable commands
-------------------------------------------------*/
-static void execute_bpdisenable(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bpdisenable(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 bpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->breakpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all breakpoints\n");
@@ -1256,7 +1256,7 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_enable(bpindex, ref))
found = true;
if (found)
@@ -1272,13 +1272,13 @@ static void execute_bpdisenable(running_machine *machine, int ref, int params, c
command
-------------------------------------------------*/
-static void execute_bplist(running_machine *machine, int ref, int params, const char *param[])
+static void execute_bplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
astring buffer;
/* loop over all CPUs */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->breakpoint_first() != NULL)
{
debug_console_printf(machine, "Device '%s' breakpoints:\n", device->tag());
@@ -1306,7 +1306,7 @@ static void execute_bplist(running_machine *machine, int ref, int params, const
command
-------------------------------------------------*/
-static void execute_wpset(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wpset(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
const char *action = NULL;
@@ -1359,14 +1359,14 @@ static void execute_wpset(running_machine *machine, int ref, int params, const c
clear command
-------------------------------------------------*/
-static void execute_wpclear(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wpclear(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_clear_all();
debug_console_printf(machine, "Cleared all watchpoints\n");
}
@@ -1377,7 +1377,7 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_clear(wpindex))
found = true;
if (found)
@@ -1393,14 +1393,14 @@ static void execute_wpclear(running_machine *machine, int ref, int params, const
disable/enable commands
-------------------------------------------------*/
-static void execute_wpdisenable(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wpdisenable(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 wpindex;
/* if 0 parameters, clear all */
if (params == 0)
{
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
device->debug()->watchpoint_enable_all(ref);
if (ref == 0)
debug_console_printf(machine, "Disabled all watchpoints\n");
@@ -1414,7 +1414,7 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
else
{
bool found = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->watchpoint_enable(wpindex, ref))
found = true;
if (found)
@@ -1430,13 +1430,13 @@ static void execute_wpdisenable(running_machine *machine, int ref, int params, c
command
-------------------------------------------------*/
-static void execute_wplist(running_machine *machine, int ref, int params, const char *param[])
+static void execute_wplist(running_machine &machine, int ref, int params, const char *param[])
{
int printed = 0;
astring buffer;
/* loop over all CPUs */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
if (device->debug()->watchpoint_first(spacenum) != NULL)
{
@@ -1470,7 +1470,7 @@ static void execute_wplist(running_machine *machine, int ref, int params, const
command
-------------------------------------------------*/
-static void execute_hotspot(running_machine *machine, int ref, int params, const char *param[])
+static void execute_hotspot(running_machine &machine, int ref, int params, const char *param[])
{
/* if no params, and there are live hotspots, clear them */
if (params == 0)
@@ -1478,7 +1478,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
bool cleared = false;
/* loop over CPUs and find live spots */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->hotspot_tracking_enabled())
{
device->debug()->hotspot_track(0, 0);
@@ -1512,7 +1512,7 @@ static void execute_hotspot(running_machine *machine, int ref, int params, const
execute_save - execute the save command
-------------------------------------------------*/
-static void execute_save(running_machine *machine, int ref, int params, const char *param[])
+static void execute_save(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@@ -1556,7 +1556,7 @@ static void execute_save(running_machine *machine, int ref, int params, const ch
execute_load - execute the load command
-------------------------------------------------*/
-static void execute_load(running_machine *machine, int ref, int params, const char *param[])
+static void execute_load(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@@ -1606,7 +1606,7 @@ static void execute_load(running_machine *machine, int ref, int params, const ch
execute_dump - execute the dump command
-------------------------------------------------*/
-static void execute_dump(running_machine *machine, int ref, int params, const char *param[])
+static void execute_dump(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length, width = 0, ascii = 1;
address_space *space;
@@ -1704,7 +1704,7 @@ static void execute_dump(running_machine *machine, int ref, int params, const ch
execute_cheatinit - initialize the cheat system
-------------------------------------------------*/
-static void execute_cheatinit(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatinit(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, length = 0, real_length = 0;
address_space *space;
@@ -1867,7 +1867,7 @@ static void execute_cheatinit(running_machine *machine, int ref, int params, con
execute_cheatnext - execute the search
-------------------------------------------------*/
-static void execute_cheatnext(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatnext(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
UINT64 cheatindex;
@@ -2044,7 +2044,7 @@ static void execute_cheatnext(running_machine *machine, int ref, int params, con
execute_cheatlist - show a list of active cheat
-------------------------------------------------*/
-static void execute_cheatlist(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatlist(running_machine &machine, int ref, int params, const char *param[])
{
char spaceletter, sizeletter;
address_space *space;
@@ -2110,7 +2110,7 @@ static void execute_cheatlist(running_machine *machine, int ref, int params, con
execute_cheatundo - undo the last search
-------------------------------------------------*/
-static void execute_cheatundo(running_machine *machine, int ref, int params, const char *param[])
+static void execute_cheatundo(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 cheatindex;
UINT32 undo_count = 0;
@@ -2139,7 +2139,7 @@ static void execute_cheatundo(running_machine *machine, int ref, int params, con
execute_find - execute the find command
-------------------------------------------------*/
-static void execute_find(running_machine *machine, int ref, int params, const char *param[])
+static void execute_find(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, endoffset, length;
address_space *space;
@@ -2238,7 +2238,7 @@ static void execute_find(running_machine *machine, int ref, int params, const ch
execute_dasm - execute the dasm command
-------------------------------------------------*/
-static void execute_dasm(running_machine *machine, int ref, int params, const char *param[])
+static void execute_dasm(running_machine &machine, int ref, int params, const char *param[])
{
UINT64 offset, length, bytes = 1;
int minbytes, maxbytes, byteswidth;
@@ -2353,7 +2353,7 @@ static void execute_dasm(running_machine *machine, int ref, int params, const ch
trace over and trace info
-------------------------------------------------*/
-static void execute_trace_internal(running_machine *machine, int ref, int params, const char *param[], int trace_over)
+static void execute_trace_internal(running_machine &machine, int ref, int params, const char *param[], int trace_over)
{
const char *action = NULL, *filename = param[0];
device_t *cpu;
@@ -2403,7 +2403,7 @@ static void execute_trace_internal(running_machine *machine, int ref, int params
execute_trace - execute the trace command
-------------------------------------------------*/
-static void execute_trace(running_machine *machine, int ref, int params, const char *param[])
+static void execute_trace(running_machine &machine, int ref, int params, const char *param[])
{
execute_trace_internal(machine, ref, params, param, 0);
}
@@ -2413,7 +2413,7 @@ static void execute_trace(running_machine *machine, int ref, int params, const c
execute_traceover - execute the trace over command
-------------------------------------------------*/
-static void execute_traceover(running_machine *machine, int ref, int params, const char *param[])
+static void execute_traceover(running_machine &machine, int ref, int params, const char *param[])
{
execute_trace_internal(machine, ref, params, param, 1);
}
@@ -2423,7 +2423,7 @@ static void execute_traceover(running_machine *machine, int ref, int params, con
execute_traceflush - execute the trace flush command
-------------------------------------------------*/
-static void execute_traceflush(running_machine *machine, int ref, int params, const char *param[])
+static void execute_traceflush(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_flush_traces(machine);
}
@@ -2433,7 +2433,7 @@ static void execute_traceflush(running_machine *machine, int ref, int params, co
execute_history - execute the history command
-------------------------------------------------*/
-static void execute_history(running_machine *machine, int ref, int params, const char *param[])
+static void execute_history(running_machine &machine, int ref, int params, const char *param[])
{
/* validate parameters */
address_space *space;
@@ -2477,12 +2477,12 @@ static void execute_history(running_machine *machine, int ref, int params, const
execute_snap - execute the snapshot command
-------------------------------------------------*/
-static void execute_snap(running_machine *machine, int ref, int params, const char *param[])
+static void execute_snap(running_machine &machine, int ref, int params, const char *param[])
{
/* if no params, use the default behavior */
if (params == 0)
{
- machine->video().save_active_screen_snapshots();
+ machine.video().save_active_screen_snapshots();
debug_console_printf(machine, "Saved snapshot\n");
}
@@ -2492,9 +2492,9 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
const char *filename = param[0];
int scrnum = (params > 1) ? atoi(param[1]) : 0;
- screen_device *screen = downcast<screen_device *>(machine->m_devicelist.find(SCREEN, scrnum));
+ screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, scrnum));
- if ((screen == NULL) || !machine->render().is_live(*screen))
+ if ((screen == NULL) || !machine.render().is_live(*screen))
{
debug_console_printf(machine, "Invalid screen number '%d'\n", scrnum);
return;
@@ -2503,7 +2503,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
astring fname(filename);
if (fname.find(0, ".png") == -1)
fname.cat(".png");
- emu_file file(machine->options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ emu_file file(machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(fname);
if (filerr != FILERR_NONE)
@@ -2512,7 +2512,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
return;
}
- screen->machine->video().save_snapshot(screen, file);
+ screen->machine().video().save_snapshot(screen, file);
debug_console_printf(machine, "Saved screen #%d snapshot as '%s'\n", scrnum, filename);
}
}
@@ -2522,7 +2522,7 @@ static void execute_snap(running_machine *machine, int ref, int params, const ch
execute_source - execute the source command
-------------------------------------------------*/
-static void execute_source(running_machine *machine, int ref, int params, const char *param[])
+static void execute_source(running_machine &machine, int ref, int params, const char *param[])
{
debug_cpu_source_script(machine, param[0]);
}
@@ -2532,7 +2532,7 @@ static void execute_source(running_machine *machine, int ref, int params, const
execute_map - execute the map command
-------------------------------------------------*/
-static void execute_map(running_machine *machine, int ref, int params, const char *param[])
+static void execute_map(running_machine &machine, int ref, int params, const char *param[])
{
address_space *space;
offs_t taddress;
@@ -2567,7 +2567,7 @@ static void execute_map(running_machine *machine, int ref, int params, const cha
execute_memdump - execute the memdump command
-------------------------------------------------*/
-static void execute_memdump(running_machine *machine, int ref, int params, const char **param)
+static void execute_memdump(running_machine &machine, int ref, int params, const char **param)
{
FILE *file;
const char *filename;
@@ -2596,7 +2596,7 @@ static int CLIB_DECL symbol_sort_compare(const void *item1, const void *item2)
return strcmp(str1, str2);
}
-static void execute_symlist(running_machine *machine, int ref, int params, const char **param)
+static void execute_symlist(running_machine &machine, int ref, int params, const char **param)
{
device_t *cpu = NULL;
const char *namelist[1000];
@@ -2654,9 +2654,9 @@ static void execute_symlist(running_machine *machine, int ref, int params, const
execute_softreset - execute the softreset command
-------------------------------------------------*/
-static void execute_softreset(running_machine *machine, int ref, int params, const char **param)
+static void execute_softreset(running_machine &machine, int ref, int params, const char **param)
{
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
}
@@ -2664,7 +2664,7 @@ static void execute_softreset(running_machine *machine, int ref, int params, con
execute_hardreset - execute the hardreset command
-------------------------------------------------*/
-static void execute_hardreset(running_machine *machine, int ref, int params, const char **param)
+static void execute_hardreset(running_machine &machine, int ref, int params, const char **param)
{
- machine->schedule_hard_reset();
+ machine.schedule_hard_reset();
}
diff --git a/src/emu/debug/debugcmd.h b/src/emu/debug/debugcmd.h
index 7e43b784786..0944df45f89 100644
--- a/src/emu/debug/debugcmd.h
+++ b/src/emu/debug/debugcmd.h
@@ -20,19 +20,19 @@
/* ----- initialization ----- */
/* initializes the command system */
-void debug_command_init(running_machine *machine);
+void debug_command_init(running_machine &machine);
/* ----- parameter validation ----- */
/* validates a number parameter */
-int debug_command_parameter_number(running_machine *machine, const char *param, UINT64 *result);
+int debug_command_parameter_number(running_machine &machine, const char *param, UINT64 *result);
/* validates a parameter as a cpu */
-int debug_command_parameter_cpu(running_machine *machine, const char *param, device_t **result);
+int debug_command_parameter_cpu(running_machine &machine, const char *param, device_t **result);
/* validates a parameter as a cpu and retrieves the given address space */
-int debug_command_parameter_cpu_space(running_machine *machine, const char *param, int spacenum, address_space **result);
+int debug_command_parameter_cpu_space(running_machine &machine, const char *param, int spacenum, address_space **result);
#endif
diff --git a/src/emu/debug/debugcon.c b/src/emu/debug/debugcon.c
index f09d3cce4fb..e73b463a99a 100644
--- a/src/emu/debug/debugcon.c
+++ b/src/emu/debug/debugcon.c
@@ -43,7 +43,7 @@ struct _debug_command
char command[32];
const char * params;
const char * help;
- void (*handler)(running_machine *machine, int ref, int params, const char **param);
+ void (*handler)(running_machine &machine, int ref, int params, const char **param);
void (*handler_ex)(int ref);
UINT32 flags;
int ref;
@@ -83,7 +83,7 @@ static void debug_console_exit(running_machine &machine);
system
-------------------------------------------------*/
-void debug_console_init(running_machine *machine)
+void debug_console_init(running_machine &machine)
{
/* allocate text buffers */
console_textbuf = text_buffer_alloc(CONSOLE_BUF_SIZE, CONSOLE_MAX_LINES);
@@ -96,10 +96,10 @@ void debug_console_init(running_machine *machine)
/* print the opening lines */
debug_console_printf(machine, "MAME new debugger version %s\n", build_version);
- debug_console_printf(machine, "Currently targeting %s (%s)\n", machine->system().name, machine->system().description);
+ debug_console_printf(machine, "Currently targeting %s (%s)\n", machine.system().name, machine.system().description);
/* request callback upon exiting */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_console_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_console_exit);
}
@@ -193,7 +193,7 @@ static void trim_parameter(char **paramptr, int keep_quotes)
command
-------------------------------------------------*/
-static CMDERR internal_execute_command(running_machine *machine, int execute, int params, char **param)
+static CMDERR internal_execute_command(running_machine &machine, int execute, int params, char **param)
{
debug_command *cmd, *found = NULL;
int i, foundcount = 0;
@@ -268,7 +268,7 @@ static CMDERR internal_execute_command(running_machine *machine, int execute, in
and either executes or just validates it
-------------------------------------------------*/
-static CMDERR internal_parse_command(running_machine *machine, const char *original_command, int execute)
+static CMDERR internal_parse_command(running_machine &machine, const char *original_command, int execute)
{
char command[MAX_COMMAND_LENGTH], parens[MAX_COMMAND_LENGTH];
char *params[MAX_COMMAND_PARAMS] = { 0 };
@@ -364,7 +364,7 @@ static CMDERR internal_parse_command(running_machine *machine, const char *origi
command string
-------------------------------------------------*/
-CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo)
+CMDERR debug_console_execute_command(running_machine &machine, const char *command, int echo)
{
CMDERR result;
@@ -387,7 +387,7 @@ CMDERR debug_console_execute_command(running_machine *machine, const char *comma
/* update all views */
if (echo)
{
- machine->debug_view().update_all();
+ machine.debug_view().update_all();
debugger_refresh_display(machine);
}
return result;
@@ -399,7 +399,7 @@ CMDERR debug_console_execute_command(running_machine *machine, const char *comma
command string
-------------------------------------------------*/
-CMDERR debug_console_validate_command(running_machine *machine, const char *command)
+CMDERR debug_console_validate_command(running_machine &machine, const char *command)
{
return internal_parse_command(machine, command, FALSE);
}
@@ -410,12 +410,12 @@ CMDERR debug_console_validate_command(running_machine *machine, const char *comm
command handler
-------------------------------------------------*/
-void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param))
+void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param))
{
debug_command *cmd;
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
- assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
+ assert_always((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
cmd = auto_alloc_clear(machine, debug_command);
@@ -474,7 +474,7 @@ const char *debug_cmderr_to_string(CMDERR error)
console
-------------------------------------------------*/
-void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...)
+void CLIB_DECL debug_console_printf(running_machine &machine, const char *format, ...)
{
astring buffer;
va_list arg;
@@ -486,7 +486,7 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
- machine->debug_view().update_all(DVT_CONSOLE);
+ machine.debug_view().update_all(DVT_CONSOLE);
}
@@ -496,7 +496,7 @@ void CLIB_DECL debug_console_printf(running_machine *machine, const char *format
console
-------------------------------------------------*/
-void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args)
+void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *format, va_list args)
{
astring buffer;
@@ -504,7 +504,7 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
text_buffer_print(console_textbuf, buffer);
/* force an update of any console views */
- machine->debug_view().update_all(DVT_CONSOLE);
+ machine.debug_view().update_all(DVT_CONSOLE);
}
@@ -514,7 +514,7 @@ void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *forma
console
-------------------------------------------------*/
-void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...)
+void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, const char *format, ...)
{
astring buffer;
va_list arg;
@@ -526,7 +526,7 @@ void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol,
text_buffer_print_wrap(console_textbuf, buffer, wrapcol);
/* force an update of any console views */
- machine->debug_view().update_all(DVT_CONSOLE);
+ machine.debug_view().update_all(DVT_CONSOLE);
}
diff --git a/src/emu/debug/debugcon.h b/src/emu/debug/debugcon.h
index 3ff691c9dbd..9977a19b578 100644
--- a/src/emu/debug/debugcon.h
+++ b/src/emu/debug/debugcon.h
@@ -75,18 +75,18 @@ typedef UINT32 CMDERR;
***************************************************************************/
/* initialization */
-void debug_console_init(running_machine *machine);
+void debug_console_init(running_machine &machine);
/* command handling */
-CMDERR debug_console_execute_command(running_machine *machine, const char *command, int echo);
-CMDERR debug_console_validate_command(running_machine *machine, const char *command);
-void debug_console_register_command(running_machine *machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine *machine, int ref, int params, const char **param));
+CMDERR debug_console_execute_command(running_machine &machine, const char *command, int echo);
+CMDERR debug_console_validate_command(running_machine &machine, const char *command);
+void debug_console_register_command(running_machine &machine, const char *command, UINT32 flags, int ref, int minparams, int maxparams, void (*handler)(running_machine &machine, int ref, int params, const char **param));
const char * debug_cmderr_to_string(CMDERR error);
/* console management */
-void CLIB_DECL debug_console_printf(running_machine *machine, const char *format, ...) ATTR_PRINTF(2,3);
-void CLIB_DECL debug_console_vprintf(running_machine *machine, const char *format, va_list args);
-void CLIB_DECL debug_console_printf_wrap(running_machine *machine, int wrapcol, const char *format, ...) ATTR_PRINTF(3,4);
+void CLIB_DECL debug_console_printf(running_machine &machine, const char *format, ...) ATTR_PRINTF(2,3);
+void CLIB_DECL debug_console_vprintf(running_machine &machine, const char *format, va_list args);
+void CLIB_DECL debug_console_printf_wrap(running_machine &machine, int wrapcol, const char *format, ...) ATTR_PRINTF(3,4);
text_buffer * debug_console_get_textbuf(void);
/* errorlog management */
diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c
index d530745c6ed..e79bd70d9e0 100644
--- a/src/emu/debug/debugcpu.c
+++ b/src/emu/debug/debugcpu.c
@@ -115,15 +115,15 @@ struct _debugcpu_private
static void debug_cpu_exit(running_machine &machine);
static void on_vblank(screen_device &device, void *param, bool vblank_state);
static void reset_transient_flags(running_machine &machine);
-static void process_source_file(running_machine *machine);
+static void process_source_file(running_machine &machine);
/* expression handlers */
static UINT64 expression_read_memory(void *param, const char *name, expression_space space, UINT32 address, int size);
static UINT64 expression_read_program_direct(address_space *space, int opcode, offs_t address, int size);
-static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size);
+static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size);
static void expression_write_memory(void *param, const char *name, expression_space space, UINT32 address, int size, UINT64 data);
static void expression_write_program_direct(address_space *space, int opcode, offs_t address, int size, UINT64 data);
-static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data);
+static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data);
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space);
/* variable getters/setters */
@@ -143,23 +143,23 @@ static UINT64 get_frame(symbol_table &table, void *ref);
information for debugging
-------------------------------------------------*/
-void debug_cpu_init(running_machine *machine)
+void debug_cpu_init(running_machine &machine)
{
- screen_device *first_screen = machine->first_screen();
+ screen_device *first_screen = machine.first_screen();
debugcpu_private *global;
int regnum;
/* allocate and reset globals */
- machine->debugcpu_data = global = auto_alloc_clear(machine, debugcpu_private);
+ machine.debugcpu_data = global = auto_alloc_clear(machine, debugcpu_private);
global->execution_state = EXECUTION_STATE_STOPPED;
global->bpindex = 1;
global->wpindex = 1;
/* create a global symbol table */
- global->symtable = global_alloc(symbol_table(machine));
+ global->symtable = global_alloc(symbol_table(&machine));
// configure our base memory accessors
- debug_cpu_configure_memory(*machine, *global->symtable);
+ debug_cpu_configure_memory(machine, *global->symtable);
/* add "wpaddr", "wpdata", "cycles", "cpunum", "logunmap" to the global symbol table */
global->symtable->add("wpaddr", symbol_table::READ_ONLY, &global->wpaddr);
@@ -178,13 +178,13 @@ void debug_cpu_init(running_machine *machine)
}
/* first CPU is visible by default */
- global->visiblecpu = machine->firstcpu;
+ global->visiblecpu = machine.firstcpu;
/* add callback for breaking on VBLANK */
- if (machine->primary_screen != NULL)
- machine->primary_screen->register_vblank_callback(on_vblank, NULL);
+ if (machine.primary_screen != NULL)
+ machine.primary_screen->register_vblank_callback(on_vblank, NULL);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debug_cpu_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debug_cpu_exit);
}
@@ -200,11 +200,11 @@ void debug_cpu_configure_memory(running_machine &machine, symbol_table &table)
fatalerror
-------------------------------------------------*/
-void debug_cpu_flush_traces(running_machine *machine)
+void debug_cpu_flush_traces(running_machine &machine)
{
/* this can be called on exit even when no debugging is enabled, so
make sure the devdebug is valid before proceeding */
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug() != NULL)
device->debug()->trace_flush();
}
@@ -220,9 +220,9 @@ void debug_cpu_flush_traces(running_machine *machine)
device (the one that commands should apply to)
-------------------------------------------------*/
-device_t *debug_cpu_get_visible_cpu(running_machine *machine)
+device_t *debug_cpu_get_visible_cpu(running_machine &machine)
{
- return machine->debugcpu_data->visiblecpu;
+ return machine.debugcpu_data->visiblecpu;
}
@@ -231,9 +231,9 @@ device_t *debug_cpu_get_visible_cpu(running_machine *machine)
the debugger is currently live
-------------------------------------------------*/
-int debug_cpu_within_instruction_hook(running_machine *machine)
+int debug_cpu_within_instruction_hook(running_machine &machine)
{
- return machine->debugcpu_data->within_instruction_hook;
+ return machine.debugcpu_data->within_instruction_hook;
}
@@ -242,9 +242,9 @@ int debug_cpu_within_instruction_hook(running_machine *machine)
current execution state is stopped
-------------------------------------------------*/
-int debug_cpu_is_stopped(running_machine *machine)
+int debug_cpu_is_stopped(running_machine &machine)
{
- debugcpu_private *global = machine->debugcpu_data;
+ debugcpu_private *global = machine.debugcpu_data;
return (global != NULL) ? (global->execution_state == EXECUTION_STATE_STOPPED) : false;
}
@@ -259,9 +259,9 @@ int debug_cpu_is_stopped(running_machine *machine)
global symbol table
-------------------------------------------------*/
-symbol_table *debug_cpu_get_global_symtable(running_machine *machine)
+symbol_table *debug_cpu_get_global_symtable(running_machine &machine)
{
- return machine->debugcpu_data->symtable;
+ return machine.debugcpu_data->symtable;
}
@@ -270,9 +270,9 @@ symbol_table *debug_cpu_get_global_symtable(running_machine *machine)
locally-visible symbol table
-------------------------------------------------*/
-symbol_table *debug_cpu_get_visible_symtable(running_machine *machine)
+symbol_table *debug_cpu_get_visible_symtable(running_machine &machine)
{
- return &machine->debugcpu_data->visiblecpu->debug()->symtable();
+ return &machine.debugcpu_data->visiblecpu->debug()->symtable();
}
@@ -281,9 +281,9 @@ symbol_table *debug_cpu_get_visible_symtable(running_machine *machine)
command script to execute
-------------------------------------------------*/
-void debug_cpu_source_script(running_machine *machine, const char *file)
+void debug_cpu_source_script(running_machine &machine, const char *file)
{
- debugcpu_private *global = machine->debugcpu_data;
+ debugcpu_private *global = machine.debugcpu_data;
/* close any existing source file */
if (global->source_file != NULL)
@@ -298,7 +298,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file)
global->source_file = fopen(file, "r");
if (!global->source_file)
{
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (machine.phase() == MACHINE_PHASE_RUNNING)
debug_console_printf(machine, "Cannot open command file '%s'\n", file);
else
fatalerror("Cannot open command file '%s'", file);
@@ -317,7 +317,7 @@ void debug_cpu_source_script(running_machine *machine, const char *file)
// the given machine
//-------------------------------------------------
-bool debug_comment_save(running_machine *machine)
+bool debug_comment_save(running_machine &machine)
{
// if we don't have a root, bail
xml_data_node *root = xml_file_create();
@@ -337,11 +337,11 @@ bool debug_comment_save(running_machine *machine)
xml_data_node *systemnode = xml_add_child(commentnode, "system", NULL);
if (systemnode == NULL)
throw emu_exception();
- xml_set_attribute(systemnode, "name", machine->system().name);
+ xml_set_attribute(systemnode, "name", machine.system().name);
// for each device
bool found_comments = false;
- for (device_t *device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device_t *device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (device->debug()->comment_count() > 0)
{
// create a node for this device
@@ -359,8 +359,8 @@ bool debug_comment_save(running_machine *machine)
// flush the file
if (found_comments)
{
- emu_file file(machine->options().comment_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- file_error filerr = file.open(machine->basename(), ".cmt");
+ emu_file file(machine.options().comment_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ file_error filerr = file.open(machine.basename(), ".cmt");
if (filerr == FILERR_NONE)
xml_file_write(root, file);
}
@@ -382,11 +382,11 @@ bool debug_comment_save(running_machine *machine)
// the given machine
//-------------------------------------------------
-bool debug_comment_load(running_machine *machine)
+bool debug_comment_load(running_machine &machine)
{
// open the file
- emu_file file(machine->options().comment_directory(), OPEN_FLAG_READ);
- file_error filerr = file.open(machine->basename(), ".cmt");
+ emu_file file(machine.options().comment_directory(), OPEN_FLAG_READ);
+ file_error filerr = file.open(machine.basename(), ".cmt");
// if an error, just return false
if (filerr != FILERR_NONE)
@@ -413,13 +413,13 @@ bool debug_comment_load(running_machine *machine)
// check to make sure the file is applicable
xml_data_node *systemnode = xml_get_sibling(commentnode->child, "system");
const char *name = xml_get_attribute_string(systemnode, "name", "");
- if (strcmp(name, machine->system().name) != 0)
+ if (strcmp(name, machine.system().name) != 0)
throw emu_exception();
// iterate over devices
for (xml_data_node *cpunode = xml_get_sibling(systemnode->child, "cpu"); cpunode; cpunode = xml_get_sibling(cpunode->next, "cpu"))
{
- device_t *device = machine->device(xml_get_attribute_string(cpunode, "tag", ""));
+ device_t *device = machine.device(xml_get_attribute_string(cpunode, "tag", ""));
if (device != NULL)
if (!device->debug()->comment_import(*cpunode))
throw emu_exception();
@@ -471,7 +471,7 @@ int debug_cpu_translate(address_space *space, int intention, offs_t *address)
UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT64 custom;
UINT8 result;
@@ -507,7 +507,7 @@ UINT8 debug_read_byte(address_space *_space, offs_t address, int apply_translati
UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT16 result;
/* mask against the logical byte mask */
@@ -562,7 +562,7 @@ UINT16 debug_read_word(address_space *_space, offs_t address, int apply_translat
UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT32 result;
/* mask against the logical byte mask */
@@ -617,7 +617,7 @@ UINT32 debug_read_dword(address_space *_space, offs_t address, int apply_transla
UINT64 debug_read_qword(address_space *_space, offs_t address, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT64 result;
/* mask against the logical byte mask */
@@ -691,7 +691,7 @@ UINT64 debug_read_memory(address_space *space, offs_t address, int size, int app
void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -725,7 +725,7 @@ void debug_write_byte(address_space *_space, offs_t address, UINT8 data, int app
void debug_write_word(address_space *_space, offs_t address, UINT16 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -778,7 +778,7 @@ void debug_write_word(address_space *_space, offs_t address, UINT16 data, int ap
void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -831,7 +831,7 @@ void debug_write_dword(address_space *_space, offs_t address, UINT32 data, int a
void debug_write_qword(address_space *_space, offs_t address, UINT64 data, int apply_translation)
{
address_space *space = const_cast<address_space *>(_space);
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* mask against the logical byte mask */
address &= space->logbytemask();
@@ -902,7 +902,7 @@ UINT64 debug_read_opcode(address_space *_space, offs_t address, int size, int ar
{
address_space *space = const_cast<address_space *>(_space);
UINT64 result = ~(UINT64)0 & (~(UINT64)0 >> (64 - 8*size)), result2;
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
/* keep in logical range */
address &= space->logbytemask();
@@ -1072,7 +1072,7 @@ static void on_vblank(screen_device &device, void *param, bool vblank_state)
{
/* just set a global flag to be consumed later */
if (vblank_state)
- device.machine->debugcpu_data->vblank_occurred = true;
+ device.machine().debugcpu_data->vblank_occurred = true;
}
@@ -1095,9 +1095,9 @@ static void reset_transient_flags(running_machine &machine)
a source file
-------------------------------------------------*/
-static void process_source_file(running_machine *machine)
+static void process_source_file(running_machine &machine)
{
- debugcpu_private *global = machine->debugcpu_data;
+ debugcpu_private *global = machine.debugcpu_data;
/* loop until the file is exhausted or until we are executing again */
while (global->source_file != NULL && global->execution_state == EXECUTION_STATE_STOPPED)
@@ -1145,11 +1145,11 @@ static void process_source_file(running_machine *machine)
based on a case insensitive tag search
-------------------------------------------------*/
-static device_t *expression_get_device(running_machine *machine, const char *tag)
+static device_t *expression_get_device(running_machine &machine, const char *tag)
{
device_t *device;
- for (device = machine->m_devicelist.first(); device != NULL; device = device->next())
+ for (device = machine.m_devicelist.first(); device != NULL; device = device->next())
if (mame_stricmp(device->tag(), tag) == 0)
return device;
@@ -1165,7 +1165,7 @@ static device_t *expression_get_device(running_machine *machine, const char *tag
static UINT64 expression_read_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size)
{
- running_machine *machine = (running_machine *)param;
+ running_machine &machine = *(running_machine *)param;
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
device_t *device = NULL;
address_space *space;
@@ -1286,9 +1286,9 @@ static UINT64 expression_read_program_direct(address_space *_space, int opcode,
from a memory region
-------------------------------------------------*/
-static UINT64 expression_read_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size)
+static UINT64 expression_read_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size)
{
- const memory_region *region = machine->region(rgntag);
+ const memory_region *region = machine.region(rgntag);
UINT64 result = ~(UINT64)0 >> (64 - 8*size);
/* make sure we get a valid base before proceeding */
@@ -1337,7 +1337,7 @@ static UINT64 expression_read_memory_region(running_machine *machine, const char
static void expression_write_memory(void *param, const char *name, expression_space spacenum, UINT32 address, int size, UINT64 data)
{
- running_machine *machine = (running_machine *)param;
+ running_machine &machine = *(running_machine *)param;
device_t *device = NULL;
address_space *space;
@@ -1400,7 +1400,7 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
address_space *space = const_cast<address_space *>(_space);
if (space != NULL)
{
- debugcpu_private *global = space->machine->debugcpu_data;
+ debugcpu_private *global = space->machine().debugcpu_data;
UINT8 *base;
/* adjust the address into a byte address, but not if being called recursively */
@@ -1462,10 +1462,10 @@ static void expression_write_program_direct(address_space *_space, int opcode, o
from a memory region
-------------------------------------------------*/
-static void expression_write_memory_region(running_machine *machine, const char *rgntag, offs_t address, int size, UINT64 data)
+static void expression_write_memory_region(running_machine &machine, const char *rgntag, offs_t address, int size, UINT64 data)
{
- debugcpu_private *global = machine->debugcpu_data;
- const memory_region *region = machine->region(rgntag);
+ debugcpu_private *global = machine.debugcpu_data;
+ const memory_region *region = machine.region(rgntag);
/* make sure we get a valid base before proceeding */
if (region != NULL)
@@ -1520,7 +1520,7 @@ static void expression_write_memory_region(running_machine *machine, const char
static expression_error::error_code expression_validate(void *param, const char *name, expression_space space)
{
- running_machine *machine = (running_machine *)param;
+ running_machine &machine = *(running_machine *)param;
device_t *device = NULL;
switch (space)
@@ -1574,7 +1574,7 @@ static expression_error::error_code expression_validate(void *param, const char
case EXPSPACE_REGION:
if (name == NULL)
return expression_error::MISSING_MEMORY_NAME;
- if (machine->region(name)->base() == NULL)
+ if (machine.region(name)->base() == NULL)
return expression_error::INVALID_MEMORY_NAME;
break;
@@ -1630,12 +1630,12 @@ static UINT64 get_frame(symbol_table &table, void *ref)
static UINT64 get_cpunum(symbol_table &table, void *ref)
{
- running_machine *machine = reinterpret_cast<running_machine *>(table.globalref());
- device_t *target = machine->debugcpu_data->visiblecpu;
+ running_machine &machine = *reinterpret_cast<running_machine *>(table.globalref());
+ device_t *target = machine.debugcpu_data->visiblecpu;
device_execute_interface *exec = NULL;
int index = 0;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
if (&exec->device() == target)
return index;
@@ -1661,7 +1661,7 @@ device_debug::device_debug(device_t &device)
m_state(NULL),
m_disasm(NULL),
m_flags(0),
- m_symtable(&device, debug_cpu_get_global_symtable(device.machine)),
+ m_symtable(&device, debug_cpu_get_global_symtable(device.machine())),
m_instrhook(NULL),
m_dasm_override(NULL),
m_opwidth(0),
@@ -1744,9 +1744,9 @@ device_debug::~device_debug()
void device_debug::start_hook(attotime endtime)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
- assert((m_device.machine->debug_flags & DEBUG_FLAG_ENABLED) != 0);
+ assert((m_device.machine().debug_flags & DEBUG_FLAG_ENABLED) != 0);
// stash a pointer to the current live CPU
assert(global->livecpu == NULL);
@@ -1757,7 +1757,7 @@ void device_debug::start_hook(attotime endtime)
{
global->m_stop_when_not_device = NULL;
global->execution_state = EXECUTION_STATE_STOPPED;
- reset_transient_flags(*m_device.machine);
+ reset_transient_flags(m_device.machine());
}
// update the target execution end time
@@ -1769,8 +1769,8 @@ void device_debug::start_hook(attotime endtime)
// check for periodic updates
if (&m_device == global->visiblecpu && osd_ticks() > global->last_periodic_update_time + osd_ticks_per_second()/4)
{
- m_device.machine->debug_view().update_all();
- m_device.machine->debug_view().flush_osd_updates();
+ m_device.machine().debug_view().update_all();
+ m_device.machine().debug_view().flush_osd_updates();
global->last_periodic_update_time = osd_ticks();
}
@@ -1790,11 +1790,11 @@ void device_debug::start_hook(attotime endtime)
if ((m_flags & DEBUG_FLAG_STOP_VBLANK) != 0)
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(m_device.machine, "Stopped at VBLANK\n");
+ debug_console_printf(m_device.machine(), "Stopped at VBLANK\n");
}
// check for debug keypresses
- else if (ui_input_pressed(m_device.machine, IPT_UI_DEBUG_BREAK))
+ else if (ui_input_pressed(m_device.machine(), IPT_UI_DEBUG_BREAK))
global->visiblecpu->debug()->halt_on_next_instruction("User-initiated break\n");
}
}
@@ -1811,7 +1811,7 @@ void device_debug::start_hook(attotime endtime)
void device_debug::stop_hook()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(global->livecpu == &m_device);
@@ -1827,13 +1827,13 @@ void device_debug::stop_hook()
void device_debug::interrupt_hook(int irqline)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
// see if this matches a pending interrupt request
if ((m_flags & DEBUG_FLAG_STOP_INTERRUPT) != 0 && (m_stopirq == -1 || m_stopirq == irqline))
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(m_device.machine, "Stopped on interrupt (CPU '%s', IRQ %d)\n", m_device.tag(), irqline);
+ debug_console_printf(m_device.machine(), "Stopped on interrupt (CPU '%s', IRQ %d)\n", m_device.tag(), irqline);
compute_debug_flags();
}
}
@@ -1846,13 +1846,13 @@ void device_debug::interrupt_hook(int irqline)
void device_debug::exception_hook(int exception)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
// see if this matches a pending interrupt request
if ((m_flags & DEBUG_FLAG_STOP_EXCEPTION) != 0 && (m_stopexception == -1 || m_stopexception == exception))
{
global->execution_state = EXECUTION_STATE_STOPPED;
- debug_console_printf(m_device.machine, "Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception);
+ debug_console_printf(m_device.machine(), "Stopped on exception (CPU '%s', exception %d)\n", m_device.tag(), exception);
compute_debug_flags();
}
}
@@ -1865,7 +1865,7 @@ void device_debug::exception_hook(int exception)
void device_debug::instruction_hook(offs_t curpc)
{
- running_machine &machine = *m_device.machine;
+ running_machine &machine = m_device.machine();
debugcpu_private *global = machine.debugcpu_data;
// note that we are in the debugger code
@@ -1901,7 +1901,7 @@ void device_debug::instruction_hook(offs_t curpc)
{
machine.debug_view().update_all();
machine.debug_view().flush_osd_updates();
- debugger_refresh_display(&machine);
+ debugger_refresh_display(machine);
}
}
}
@@ -1912,14 +1912,14 @@ void device_debug::instruction_hook(offs_t curpc)
// see if we hit a target time
if ((m_flags & DEBUG_FLAG_STOP_TIME) != 0 && machine.time() >= m_stoptime)
{
- debug_console_printf(&machine, "Stopped at time interval %.1g\n", machine.time().as_double());
+ debug_console_printf(machine, "Stopped at time interval %.1g\n", machine.time().as_double());
global->execution_state = EXECUTION_STATE_STOPPED;
}
// check the temp running breakpoint and break if we hit it
else if ((m_flags & DEBUG_FLAG_STOP_PC) != 0 && m_stopaddr == curpc)
{
- debug_console_printf(&machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", m_stopaddr, m_device.tag());
+ debug_console_printf(machine, "Stopped at temporary breakpoint %X on CPU '%s'\n", m_stopaddr, m_device.tag());
global->execution_state = EXECUTION_STATE_STOPPED;
}
@@ -1936,12 +1936,12 @@ void device_debug::instruction_hook(offs_t curpc)
// load comments if we haven't yet
if (!global->comments_loaded)
{
- debug_comment_load(m_device.machine);
+ debug_comment_load(m_device.machine());
global->comments_loaded = true;
}
// reset any transient state
- reset_transient_flags(*m_device.machine);
+ reset_transient_flags(m_device.machine());
global->breakcpu = NULL;
// remember the last visible CPU in the debugger
@@ -1949,10 +1949,10 @@ void device_debug::instruction_hook(offs_t curpc)
// update all views
machine.debug_view().update_all();
- debugger_refresh_display(m_device.machine);
+ debugger_refresh_display(m_device.machine());
// wait for the debugger; during this time, disable sound output
- m_device.machine->sound().debugger_mute(true);
+ m_device.machine().sound().debugger_mute(true);
while (global->execution_state == EXECUTION_STATE_STOPPED)
{
// flush any pending updates before waiting again
@@ -1970,17 +1970,17 @@ void device_debug::instruction_hook(offs_t curpc)
if (global->memory_modified)
{
machine.debug_view().update_all(DVT_DISASSEMBLY);
- debugger_refresh_display(m_device.machine);
+ debugger_refresh_display(m_device.machine());
}
// check for commands in the source file
- process_source_file(m_device.machine);
+ process_source_file(m_device.machine());
// if an event got scheduled, resume
if (machine.scheduled_event_pending())
global->execution_state = EXECUTION_STATE_RUNNING;
}
- m_device.machine->sound().debugger_mute(false);
+ m_device.machine().sound().debugger_mute(false);
// remember the last visible CPU in the debugger
global->visiblecpu = &m_device;
@@ -2080,7 +2080,7 @@ if (m_memory != NULL && m_disasm != NULL)
void device_debug::ignore(bool ignore)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2101,7 +2101,7 @@ void device_debug::ignore(bool ignore)
void device_debug::single_step(int numsteps)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2119,7 +2119,7 @@ void device_debug::single_step(int numsteps)
void device_debug::single_step_over(int numsteps)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2137,7 +2137,7 @@ void device_debug::single_step_over(int numsteps)
void device_debug::single_step_out()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2155,7 +2155,7 @@ void device_debug::single_step_out()
void device_debug::go(offs_t targetpc)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2171,7 +2171,7 @@ void device_debug::go(offs_t targetpc)
void device_debug::go_vblank()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2188,7 +2188,7 @@ void device_debug::go_vblank()
void device_debug::go_interrupt(int irqline)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2205,7 +2205,7 @@ void device_debug::go_interrupt(int irqline)
void device_debug::go_exception(int exception)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2222,11 +2222,11 @@ void device_debug::go_exception(int exception)
void device_debug::go_milliseconds(UINT64 milliseconds)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
- m_stoptime = m_device.machine->time() + attotime::from_msec(milliseconds);
+ m_stoptime = m_device.machine().time() + attotime::from_msec(milliseconds);
m_flags |= DEBUG_FLAG_STOP_TIME;
global->execution_state = EXECUTION_STATE_RUNNING;
}
@@ -2239,7 +2239,7 @@ void device_debug::go_milliseconds(UINT64 milliseconds)
void device_debug::go_next_device()
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
assert(m_exec != NULL);
@@ -2255,7 +2255,7 @@ void device_debug::go_next_device()
void device_debug::halt_on_next_instruction(const char *fmt, ...)
{
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
va_list arg;
assert(m_exec != NULL);
@@ -2266,7 +2266,7 @@ void device_debug::halt_on_next_instruction(const char *fmt, ...)
// output the message to the console
va_start(arg, fmt);
- debug_console_vprintf(m_device.machine, fmt, arg);
+ debug_console_vprintf(m_device.machine(), fmt, arg);
va_end(arg);
// if we are live, stop now, otherwise note that we want to break there
@@ -2289,7 +2289,7 @@ void device_debug::halt_on_next_instruction(const char *fmt, ...)
int device_debug::breakpoint_set(offs_t address, const char *condition, const char *action)
{
// allocate a new one
- breakpoint *bp = auto_alloc(m_device.machine, breakpoint(m_symtable, m_device.machine->debugcpu_data->bpindex++, address, condition, action));
+ breakpoint *bp = auto_alloc(m_device.machine(), breakpoint(m_symtable, m_device.machine().debugcpu_data->bpindex++, address, condition, action));
// hook it into our list
bp->m_next = m_bplist;
@@ -2314,7 +2314,7 @@ bool device_debug::breakpoint_clear(int index)
{
breakpoint *deleteme = *bp;
*bp = deleteme->m_next;
- auto_free(m_device.machine, deleteme);
+ auto_free(m_device.machine(), deleteme);
breakpoint_update_flags();
return true;
}
@@ -2380,7 +2380,7 @@ int device_debug::watchpoint_set(address_space &space, int type, offs_t address,
assert(space.spacenum() < ARRAY_LENGTH(m_wplist));
// allocate a new one
- watchpoint *wp = auto_alloc(m_device.machine, watchpoint(m_symtable, m_device.machine->debugcpu_data->bpindex++, space, type, address, length, condition, action));
+ watchpoint *wp = auto_alloc(m_device.machine(), watchpoint(m_symtable, m_device.machine().debugcpu_data->bpindex++, space, type, address, length, condition, action));
// hook it into our list
wp->m_next = m_wplist[space.spacenum()];
@@ -2407,7 +2407,7 @@ bool device_debug::watchpoint_clear(int index)
watchpoint *deleteme = *wp;
address_space &space = deleteme->m_space;
*wp = deleteme->m_next;
- auto_free(m_device.machine, deleteme);
+ auto_free(m_device.machine(), deleteme);
watchpoint_update_flags(space);
return true;
}
@@ -2474,14 +2474,14 @@ void device_debug::watchpoint_enable_all(bool enable)
void device_debug::hotspot_track(int numspots, int threshhold)
{
// if we already have tracking enabled, kill it
- auto_free(m_device.machine, m_hotspots);
+ auto_free(m_device.machine(), m_hotspots);
m_hotspots = NULL;
// only start tracking if we have a non-zero count
if (numspots > 0)
{
// allocate memory for hotspots
- m_hotspots = auto_alloc_array(m_device.machine, hotspot_entry, numspots);
+ m_hotspots = auto_alloc_array(m_device.machine(), hotspot_entry, numspots);
memset(m_hotspots, 0xff, sizeof(*m_hotspots) * numspots);
// fill in the info
@@ -2519,7 +2519,7 @@ void device_debug::comment_add(offs_t addr, const char *comment, rgb_t color)
{
// create a new item for the list
UINT32 crc = compute_opcode_crc32(addr);
- dasm_comment *newcomment = auto_alloc(m_device.machine, dasm_comment(comment, addr, color, crc));
+ dasm_comment *newcomment = auto_alloc(m_device.machine(), dasm_comment(comment, addr, color, crc));
// figure out where to insert it
dasm_comment *prev = NULL;
@@ -2646,7 +2646,7 @@ bool device_debug::comment_import(xml_data_node &cpunode)
sscanf(xml_get_attribute_string(datanode, "crc", 0), "%08X", &crc);
// add the new comment; we assume they were saved ordered
- m_comment_list.append(*auto_alloc(m_device.machine, dasm_comment(datanode->value, address, color, crc)));
+ m_comment_list.append(*auto_alloc(m_device.machine(), dasm_comment(datanode->value, address, color, crc)));
}
return true;
}
@@ -2723,12 +2723,12 @@ UINT32 device_debug::compute_opcode_crc32(offs_t address) const
void device_debug::trace(FILE *file, bool trace_over, const char *action)
{
// delete any existing tracers
- auto_free(m_device.machine, m_trace);
+ auto_free(m_device.machine(), m_trace);
m_trace = NULL;
// if we have a new file, make a new tracer
if (file != NULL)
- m_trace = auto_alloc(m_device.machine, tracer(*this, *file, trace_over, action));
+ m_trace = auto_alloc(m_device.machine(), tracer(*this, *file, trace_over, action));
}
@@ -2756,33 +2756,33 @@ void device_debug::trace_printf(const char *fmt, ...)
void device_debug::compute_debug_flags()
{
- running_machine *machine = m_device.machine;
- debugcpu_private *global = machine->debugcpu_data;
+ running_machine &machine = m_device.machine();
+ debugcpu_private *global = machine.debugcpu_data;
// clear out global flags by default, keep DEBUG_FLAG_OSD_ENABLED
- machine->debug_flags &= DEBUG_FLAG_OSD_ENABLED;
- machine->debug_flags |= DEBUG_FLAG_ENABLED;
+ machine.debug_flags &= DEBUG_FLAG_OSD_ENABLED;
+ machine.debug_flags |= DEBUG_FLAG_ENABLED;
// if we are ignoring this CPU, or if events are pending, we're done
- if ((m_flags & DEBUG_FLAG_OBSERVING) == 0 || machine->scheduled_event_pending() || machine->save_or_load_pending())
+ if ((m_flags & DEBUG_FLAG_OBSERVING) == 0 || machine.scheduled_event_pending() || machine.save_or_load_pending())
return;
// if we're stopped, keep calling the hook
if (global->execution_state == EXECUTION_STATE_STOPPED)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// if we're tracking history, or we're hooked, or stepping, or stopping at a breakpoint
// make sure we call the hook
if ((m_flags & (DEBUG_FLAG_HISTORY | DEBUG_FLAG_HOOKED | DEBUG_FLAG_STEPPING_ANY | DEBUG_FLAG_STOP_PC | DEBUG_FLAG_LIVE_BP)) != 0)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// also call if we are tracing
if (m_trace != NULL)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
// if we are stopping at a particular time and that time is within the current timeslice, we need to be called
if ((m_flags & DEBUG_FLAG_STOP_TIME) && m_endexectime <= m_stoptime)
- machine->debug_flags |= DEBUG_FLAG_CALL_HOOK;
+ machine.debug_flags |= DEBUG_FLAG_CALL_HOOK;
}
@@ -2837,7 +2837,7 @@ void device_debug::breakpoint_update_flags()
}
// push the flags out globally
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
if (global->livecpu != NULL)
global->livecpu->debug()->compute_debug_flags();
}
@@ -2855,16 +2855,16 @@ void device_debug::breakpoint_check(offs_t pc)
if (bp->hit(pc))
{
// halt in the debugger by default
- debugcpu_private *global = m_device.machine->debugcpu_data;
+ debugcpu_private *global = m_device.machine().debugcpu_data;
global->execution_state = EXECUTION_STATE_STOPPED;
// if we hit, evaluate the action
if (bp->m_action)
- debug_console_execute_command(m_device.machine, bp->m_action, 0);
+ debug_console_execute_command(m_device.machine(), bp->m_action, 0);
// print a notification, unless the action made us go again
if (global->execution_state == EXECUTION_STATE_STOPPED)
- debug_console_printf(m_device.machine, "Stopped at breakpoint %X\n", bp->m_index);
+ debug_console_printf(m_device.machine(), "Stopped at breakpoint %X\n", bp->m_index);
break;
}
}
@@ -2906,7 +2906,7 @@ void device_debug::watchpoint_update_flags(address_space &space)
void device_debug::watchpoint_check(address_space &space, int type, offs_t address, UINT64 value_to_write, UINT64 mem_mask)
{
- debugcpu_private *global = space.machine->debugcpu_data;
+ debugcpu_private *global = space.machine().debugcpu_data;
// if we're within debugger code, don't stop
if (global->within_instruction_hook || global->debugger_access)
@@ -2953,7 +2953,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
// if we hit, evaluate the action
if (wp->m_action)
- debug_console_execute_command(space.machine, wp->m_action, 0);
+ debug_console_execute_command(space.machine(), wp->m_action, 0);
// print a notification, unless the action made us go again
if (global->execution_state == EXECUTION_STATE_STOPPED)
@@ -2975,7 +2975,7 @@ void device_debug::watchpoint_check(address_space &space, int type, offs_t addre
}
else
buffer.printf("Stopped at watchpoint %X reading %s from %08X (PC=%X)", wp->m_index, sizes[size], space.byte_to_address(address), pc);
- debug_console_printf(space.machine, "%s\n", buffer.cstr());
+ debug_console_printf(space.machine(), "%s\n", buffer.cstr());
space.cpu->debug()->compute_debug_flags();
}
break;
@@ -3006,7 +3006,7 @@ void device_debug::hotspot_check(address_space &space, offs_t address)
// if the bottom of the list is over the threshhold, print it
hotspot_entry &spot = m_hotspots[m_hotspot_count - 1];
if (spot.m_count > m_hotspot_threshhold)
- debug_console_printf(space.machine, "Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
+ debug_console_printf(space.machine(), "Hotspot @ %s %08X (PC=%08X) hit %d times (fell off bottom)\n", space.name(), spot.m_access, spot.m_pc, spot.m_count);
// move everything else down and insert this one at the top
memmove(&m_hotspots[1], &m_hotspots[0], sizeof(m_hotspots[0]) * (m_hotspot_count - 1));
@@ -3307,7 +3307,7 @@ void device_debug::tracer::update(offs_t pc)
// execute any trace actions first
if (m_action)
- debug_console_execute_command(m_debug.m_device.machine, m_action, 0);
+ debug_console_execute_command(m_debug.m_device.machine(), m_action, 0);
// print the address
astring buffer;
diff --git a/src/emu/debug/debugcpu.h b/src/emu/debug/debugcpu.h
index 990cc7e5cf5..2c414b88fc8 100644
--- a/src/emu/debug/debugcpu.h
+++ b/src/emu/debug/debugcpu.h
@@ -370,51 +370,51 @@ private:
/* ----- initialization and cleanup ----- */
/* initialize the CPU tracking for the debugger */
-void debug_cpu_init(running_machine *machine);
+void debug_cpu_init(running_machine &machine);
void debug_cpu_configure_memory(running_machine &machine, symbol_table &table);
/* flushes all traces; this is useful if a trace is going on when we fatalerror */
-void debug_cpu_flush_traces(running_machine *machine);
+void debug_cpu_flush_traces(running_machine &machine);
/* ----- debugging status & information ----- */
/* return the visible CPU device (the one that commands should apply to) */
-device_t *debug_cpu_get_visible_cpu(running_machine *machine);
+device_t *debug_cpu_get_visible_cpu(running_machine &machine);
/* TRUE if the debugger is currently stopped within an instruction hook callback */
-int debug_cpu_within_instruction_hook(running_machine *machine);
+int debug_cpu_within_instruction_hook(running_machine &machine);
/* return TRUE if the current execution state is stopped */
-int debug_cpu_is_stopped(running_machine *machine);
+int debug_cpu_is_stopped(running_machine &machine);
/* ----- symbol table interfaces ----- */
/* return the global symbol table */
-symbol_table *debug_cpu_get_global_symtable(running_machine *machine);
+symbol_table *debug_cpu_get_global_symtable(running_machine &machine);
/* return the locally-visible symbol table */
-symbol_table *debug_cpu_get_visible_symtable(running_machine *machine);
+symbol_table *debug_cpu_get_visible_symtable(running_machine &machine);
/* ----- misc debugger functions ----- */
/* specifies a debug command script to execute */
-void debug_cpu_source_script(running_machine *machine, const char *file);
+void debug_cpu_source_script(running_machine &machine, const char *file);
/* ----- debugger comment helpers ----- */
// save all comments for a given machine
-bool debug_comment_save(running_machine *machine);
+bool debug_comment_save(running_machine &machine);
// load all comments for a given machine
-bool debug_comment_load(running_machine *machine);
+bool debug_comment_load(running_machine &machine);
diff --git a/src/emu/debug/debugvw.c b/src/emu/debug/debugvw.c
index 2454644c7ed..9d652f5078d 100644
--- a/src/emu/debug/debugvw.c
+++ b/src/emu/debug/debugvw.c
@@ -147,7 +147,7 @@ void debug_view_source_list::reset()
{
debug_view_source *source = m_head;
m_head = source->m_next;
- auto_free(&m_machine, source);
+ auto_free(m_machine, source);
}
// reset the tail pointer and index
@@ -222,7 +222,7 @@ debug_view::debug_view(running_machine &machine, debug_view_type type, debug_vie
{
// allocate memory for the buffer
m_viewdata_size = m_visible.y * m_visible.x;
- m_viewdata = auto_alloc_array(&machine, debug_view_char, m_viewdata_size);
+ m_viewdata = auto_alloc_array(machine, debug_view_char, m_viewdata_size);
}
@@ -256,8 +256,8 @@ void debug_view::end_update()
if (size > m_viewdata_size)
{
m_viewdata_size = size;
- auto_free(&m_machine, m_viewdata);
- m_viewdata = auto_alloc_array(&m_machine, debug_view_char, m_viewdata_size);
+ auto_free(m_machine, m_viewdata);
+ m_viewdata = auto_alloc_array(m_machine, debug_view_char, m_viewdata_size);
}
// update the view
@@ -450,7 +450,7 @@ debug_view_manager::~debug_view_manager()
{
debug_view *oldhead = m_viewlist;
m_viewlist = oldhead->m_next;
- auto_free(&m_machine, oldhead);
+ auto_free(m_machine, oldhead);
}
}
@@ -464,25 +464,25 @@ debug_view *debug_view_manager::alloc_view(debug_view_type type, debug_view_osd_
switch (type)
{
case DVT_CONSOLE:
- return append(auto_alloc(&m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_console(m_machine, osdupdate, osdprivate)));
case DVT_STATE:
- return append(auto_alloc(&m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_state(m_machine, osdupdate, osdprivate)));
case DVT_DISASSEMBLY:
- return append(auto_alloc(&m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_disasm(m_machine, osdupdate, osdprivate)));
case DVT_MEMORY:
- return append(auto_alloc(&m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_memory(m_machine, osdupdate, osdprivate)));
case DVT_LOG:
- return append(auto_alloc(&m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
+ return append(auto_alloc(m_machine, debug_view_log(m_machine, osdupdate, osdprivate)));
case DVT_TIMERS:
-// return append(auto_alloc(&m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
+// return append(auto_alloc(m_machine, debug_view_timers(m_machine, osdupdate, osdprivate)));
case DVT_ALLOCS:
-// return append(auto_alloc(&m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
+// return append(auto_alloc(m_machine, debug_view_allocs(m_machine, osdupdate, osdprivate)));
default:
fatalerror("Attempt to create invalid debug view type %d\n", type);
@@ -502,7 +502,7 @@ void debug_view_manager::free_view(debug_view &view)
if (*viewptr == &view)
{
*viewptr = view.m_next;
- auto_free(&m_machine, &view);
+ auto_free(m_machine, &view);
break;
}
}
@@ -559,7 +559,7 @@ debug_view_expression::debug_view_expression(running_machine &machine)
: m_machine(machine),
m_dirty(true),
m_result(0),
- m_parsed(debug_cpu_get_global_symtable(&machine)),
+ m_parsed(debug_cpu_get_global_symtable(machine)),
m_string("0")
{
}
@@ -581,7 +581,7 @@ debug_view_expression::~debug_view_expression()
void debug_view_expression::set_context(symbol_table *context)
{
- m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(&m_machine));
+ m_parsed.set_symbols((context != NULL) ? context : debug_cpu_get_global_symtable(m_machine));
m_dirty = true;
}
diff --git a/src/emu/debug/dvdisasm.c b/src/emu/debug/dvdisasm.c
index c98682776b9..5275eea49db 100644
--- a/src/emu/debug/dvdisasm.c
+++ b/src/emu/debug/dvdisasm.c
@@ -116,8 +116,8 @@ debug_view_disasm::debug_view_disasm(running_machine &machine, debug_view_osd_up
debug_view_disasm::~debug_view_disasm()
{
- auto_free(&m_machine, m_byteaddress);
- auto_free(&m_machine, m_dasm);
+ auto_free(m_machine, m_byteaddress);
+ auto_free(m_machine, m_dasm);
}
@@ -137,7 +137,7 @@ void debug_view_disasm::enumerate_sources()
for (bool gotone = m_machine.m_devicelist.first(dasm); gotone; gotone = dasm->next(dasm))
{
name.printf("%s '%s'", dasm->device().name(), dasm->device().tag());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_disasm_source(name, dasm->device())));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_disasm_source(name, dasm->device())));
}
// reset the source to a known good entry
@@ -377,12 +377,12 @@ bool debug_view_disasm::recompute(offs_t pc, int startline, int lines)
m_allocated = m_total;
// allocate address array
- auto_free(&m_machine, m_byteaddress);
- m_byteaddress = auto_alloc_array(&m_machine, offs_t, m_allocated.y);
+ auto_free(m_machine, m_byteaddress);
+ m_byteaddress = auto_alloc_array(m_machine, offs_t, m_allocated.y);
// allocate disassembly buffer
- auto_free(&m_machine, m_dasm);
- m_dasm = auto_alloc_array(&m_machine, char, m_allocated.x * m_allocated.y);
+ auto_free(m_machine, m_dasm);
+ m_dasm = auto_alloc_array(m_machine, char, m_allocated.x * m_allocated.y);
}
// iterate over lines
diff --git a/src/emu/debug/dvmemory.c b/src/emu/debug/dvmemory.c
index 8d636999e49..0d2417fe0c1 100644
--- a/src/emu/debug/dvmemory.c
+++ b/src/emu/debug/dvmemory.c
@@ -160,7 +160,7 @@ void debug_view_memory::enumerate_sources()
if (space != NULL)
{
name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *space)));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *space)));
}
}
@@ -168,7 +168,7 @@ void debug_view_memory::enumerate_sources()
for (const memory_region *region = m_machine.first_region(); region != NULL; region = region->next())
{
name.printf("Region '%s'", region->name());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, *region)));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, *region)));
}
// finally add all global array symbols
@@ -185,7 +185,7 @@ void debug_view_memory::enumerate_sources()
if (valcount > 1 && strstr(itemname, "globals/"))
{
name.cpy(strrchr(itemname, '/') + 1);
- m_source_list.append(*auto_alloc(&m_machine, debug_view_memory_source(name, base, valsize, valcount)));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_memory_source(name, base, valsize, valcount)));
}
}
@@ -707,10 +707,10 @@ void debug_view_memory::write(UINT8 size, offs_t offs, UINT64 data)
// hack for FD1094 editing
#ifdef FD1094_HACK
- if (source.m_base == *m_machine.region("user2"))
+ if (source.m_base == m_machine.region("user2"))
{
- extern void fd1094_regenerate_key(running_machine *machine);
- fd1094_regenerate_key(&m_machine);
+ extern void fd1094_regenerate_key(running_machine &machine);
+ fd1094_regenerate_key(m_machine);
}
#endif
}
diff --git a/src/emu/debug/dvstate.c b/src/emu/debug/dvstate.c
index 01383a3ca2c..296dadc6c35 100644
--- a/src/emu/debug/dvstate.c
+++ b/src/emu/debug/dvstate.c
@@ -108,7 +108,7 @@ void debug_view_state::enumerate_sources()
for (bool gotone = m_machine.m_devicelist.first(state); gotone; gotone = state->next(state))
{
name.printf("%s '%s'", state->device().name(), state->device().tag());
- m_source_list.append(*auto_alloc(&m_machine, debug_view_state_source(name, state->device())));
+ m_source_list.append(*auto_alloc(m_machine, debug_view_state_source(name, state->device())));
}
// reset the source to a known good entry
@@ -127,7 +127,7 @@ void debug_view_state::reset()
{
state_item *oldhead = m_state_list;
m_state_list = oldhead->m_next;
- auto_free(&m_machine, oldhead);
+ auto_free(m_machine, oldhead);
}
}
@@ -146,34 +146,34 @@ void debug_view_state::recompute()
// add a cycles entry: cycles:99999999
state_item **tailptr = &m_state_list;
- *tailptr = auto_alloc(&m_machine, state_item(REG_CYCLES, "cycles", 8));
+ *tailptr = auto_alloc(m_machine, state_item(REG_CYCLES, "cycles", 8));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamx:1234
- *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMX, "beamx", 4));
+ *tailptr = auto_alloc(m_machine, state_item(REG_BEAMX, "beamx", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: beamy:5678
- *tailptr = auto_alloc(&m_machine, state_item(REG_BEAMY, "beamy", 4));
+ *tailptr = auto_alloc(m_machine, state_item(REG_BEAMY, "beamy", 4));
tailptr = &(*tailptr)->m_next;
// add a beam entry: frame:123456
- *tailptr = auto_alloc(&m_machine, state_item(REG_FRAME, "frame", 6));
+ *tailptr = auto_alloc(m_machine, state_item(REG_FRAME, "frame", 6));
tailptr = &(*tailptr)->m_next;
// add a flags entry: flags:xxxxxxxx
- *tailptr = auto_alloc(&m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
+ *tailptr = auto_alloc(m_machine, state_item(STATE_GENFLAGS, "flags", source.m_stateintf->state_string_max_length(STATE_GENFLAGS)));
tailptr = &(*tailptr)->m_next;
// add a divider entry
- *tailptr = auto_alloc(&m_machine, state_item(REG_DIVIDER, "", 0));
+ *tailptr = auto_alloc(m_machine, state_item(REG_DIVIDER, "", 0));
tailptr = &(*tailptr)->m_next;
// add all registers into it
for (const device_state_entry *entry = source.m_stateintf->state_first(); entry != NULL; entry = entry->next())
if (entry->visible())
{
- *tailptr = auto_alloc(&m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
+ *tailptr = auto_alloc(m_machine, state_item(entry->index(), entry->symbol(), source.m_stateintf->state_string_max_length(entry->index())));
tailptr = &(*tailptr)->m_next;
}
diff --git a/src/emu/debugger.c b/src/emu/debugger.c
index 519b08dcd1d..536740dd97b 100644
--- a/src/emu/debugger.c
+++ b/src/emu/debugger.c
@@ -60,15 +60,15 @@ static void debugger_exit(running_machine &machine);
debugger_init - start up all subsections
-------------------------------------------------*/
-void debugger_init(running_machine *machine)
+void debugger_init(running_machine &machine)
{
/* only if debugging is enabled */
- if (machine->debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
{
machine_entry *entry;
/* initialize the submodules */
- machine->m_debug_view = auto_alloc(machine, debug_view_manager(*machine));
+ machine.m_debug_view = auto_alloc(machine, debug_view_manager(machine));
debug_cpu_init(machine);
debug_command_init(machine);
debug_console_init(machine);
@@ -77,10 +77,10 @@ void debugger_init(running_machine *machine)
debugint_init(machine);
/* allocate a new entry for our global list */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debugger_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debugger_exit);
entry = global_alloc(machine_entry);
entry->next = machine_list;
- entry->machine = machine;
+ entry->machine = &machine;
machine_list = entry;
/* register an atexit handler if we haven't yet */
@@ -89,10 +89,10 @@ void debugger_init(running_machine *machine)
atexit_registered = TRUE;
/* listen in on the errorlog */
- machine->add_logerror_callback(debug_errorlog_write_line);
+ machine.add_logerror_callback(debug_errorlog_write_line);
/* initialize osd debugger features */
- machine->osd().init_debugger();
+ machine.osd().init_debugger();
}
}
@@ -102,9 +102,9 @@ void debugger_init(running_machine *machine)
video display
-------------------------------------------------*/
-void debugger_refresh_display(running_machine *machine)
+void debugger_refresh_display(running_machine &machine)
{
- machine->video().frame_update(true);
+ machine.video().frame_update(true);
}
@@ -141,7 +141,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void)
while (machine_list != NULL)
{
machine_entry *deleteme = machine_list;
- debug_cpu_flush_traces(deleteme->machine);
+ debug_cpu_flush_traces(*deleteme->machine);
machine_list = deleteme->next;
global_free(deleteme);
}
diff --git a/src/emu/debugger.h b/src/emu/debugger.h
index 4b13c3fa615..6b2978974eb 100644
--- a/src/emu/debugger.h
+++ b/src/emu/debugger.h
@@ -24,10 +24,10 @@
/* ----- core debugger functions ----- */
/* initialize the debugger */
-void debugger_init(running_machine *machine);
+void debugger_init(running_machine &machine);
/* redraw the current video display */
-void debugger_refresh_display(running_machine *machine);
+void debugger_refresh_display(running_machine &machine);
/* OSD can call this to safely flush all traces in the event of a crash */
void debugger_flush_all_traces_on_abnormal_exit(void);
@@ -45,7 +45,7 @@ void debugger_flush_all_traces_on_abnormal_exit(void);
INLINE void debugger_instruction_hook(device_t *device, offs_t curpc)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_CALL_HOOK) != 0)
device->debug()->instruction_hook(curpc);
}
@@ -57,7 +57,7 @@ INLINE void debugger_instruction_hook(device_t *device, offs_t curpc)
INLINE void debugger_exception_hook(device_t *device, int exception)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->exception_hook(exception);
}
@@ -75,7 +75,7 @@ INLINE void debugger_exception_hook(device_t *device, int exception)
INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->start_hook(endtime);
}
@@ -88,7 +88,7 @@ INLINE void debugger_start_cpu_hook(device_t *device, attotime endtime)
INLINE void debugger_stop_cpu_hook(device_t *device)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->stop_hook();
}
@@ -101,7 +101,7 @@ INLINE void debugger_stop_cpu_hook(device_t *device)
INLINE void debugger_interrupt_hook(device_t *device, int irqline)
{
- if ((device->machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((device->machine().debug_flags & DEBUG_FLAG_ENABLED) != 0)
device->debug()->interrupt_hook(irqline);
}
@@ -116,9 +116,9 @@ INLINE void debugger_interrupt_hook(device_t *device, int irqline)
next opportunity
-------------------------------------------------*/
-INLINE void debugger_break(running_machine *machine)
+INLINE void debugger_break(running_machine &machine)
{
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
debug_cpu_get_visible_cpu(machine)->debug()->halt_on_next_instruction("Internal breakpoint\n");
}
@@ -129,9 +129,9 @@ INLINE void debugger_break(running_machine *machine)
halted within the instruction hook
-------------------------------------------------*/
-INLINE int debugger_within_instruction_hook(running_machine *machine)
+INLINE int debugger_within_instruction_hook(running_machine &machine)
{
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
return debug_cpu_within_instruction_hook(machine);
return FALSE;
}
diff --git a/src/emu/debugint/debugint.c b/src/emu/debugint/debugint.c
index a6fedf61500..82a393105f0 100644
--- a/src/emu/debugint/debugint.c
+++ b/src/emu/debugint/debugint.c
@@ -150,7 +150,7 @@ class DView
DISABLE_COPYING(DView);
public:
- DView(render_target *target, running_machine *machine, debug_view_type type, int flags)
+ DView(render_target *target, running_machine &machine, debug_view_type type, int flags)
: next(NULL),
type(0),
state(0),
@@ -160,9 +160,9 @@ public:
this->target = target;
//dv->container = render_target_get_component_container(target, name, &pos);
this->container = target->debug_alloc();
- this->view = machine->debug_view().alloc_view(type, dview_update, this);
+ this->view = machine.debug_view().alloc_view(type, dview_update, this);
this->type = type;
- this->machine = machine;
+ this->m_machine = &machine;
this->state = flags | VIEW_STATE_NEEDS_UPDATE;
// initial size
@@ -186,16 +186,18 @@ public:
~DView()
{
this->target->debug_free(*this->container);
- machine->debug_view().free_view(*this->view);
+ m_machine->debug_view().free_view(*this->view);
}
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
DView * next;
int type;
debug_view * view;
render_container * container;
render_target * target;
- running_machine * machine;
+ running_machine * m_machine;
int state;
// drawing
rectangle bounds;
@@ -299,7 +301,7 @@ static void set_focus_view(DView *dv)
}
}
-static DView *dview_alloc(render_target *target, running_machine *machine, debug_view_type type, int flags)
+static DView *dview_alloc(render_target *target, running_machine &machine, debug_view_type type, int flags)
{
DView *dv;
@@ -316,7 +318,7 @@ static void dview_free(DView *dv)
{
//astring_free(dv->title);
LIST_REMOVE(list, dv, DView);
- auto_free(dv->machine, dv);
+ auto_free(dv->machine(), dv);
}
static void dview_get_rect(DView *dv, int type, rectangle *rect)
@@ -895,11 +897,11 @@ static void debugint_exit(running_machine &machine)
}
-void debugint_init(running_machine *machine)
+void debugint_init(running_machine &machine)
{
unicode_char ch;
int chw;
- debug_font = machine->render().font_alloc("ui.bdf"); //ui_get_font(machine);
+ debug_font = machine.render().font_alloc("ui.bdf"); //ui_get_font(machine);
debug_font_width = 0;
debug_font_height = 15;
@@ -908,7 +910,7 @@ void debugint_init(running_machine *machine)
list = NULL;
focus_view = NULL;
- debug_font_aspect = machine->render().ui_aspect();
+ debug_font_aspect = machine.render().ui_aspect();
for (ch=0;ch<=127;ch++)
{
@@ -919,7 +921,7 @@ void debugint_init(running_machine *machine)
debug_font_width++;
/* FIXME: above does not really work */
debug_font_width = 10;
- machine->add_notifier(MACHINE_NOTIFY_EXIT, debugint_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, debugint_exit);
}
#if 0
@@ -957,9 +959,9 @@ static void process_string(DView *dv, const char *str)
break;
case DVT_CONSOLE:
if(!dv->editor.str[(long)0])
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step();
else
- debug_console_execute_command(dv->machine, str, 1);
+ debug_console_execute_command(dv->machine(), str, 1);
break;
case DVT_MEMORY:
downcast<debug_view_memory *>(dv->view)->set_expression(str);
@@ -977,11 +979,11 @@ static void on_disassembly_window_activate(DView *dv, const ui_menu_event *event
render_target *target;
const debug_view_source *source;
- target = &dv->machine->render().ui_target();
+ target = &dv->machine().render().ui_target();
- ndv = dview_alloc(target, dv->machine, DVT_DISASSEMBLY, 0);
+ ndv = dview_alloc(target, dv->machine(), DVT_DISASSEMBLY, 0);
ndv->editor.active = TRUE;
- ndv->editor.container = &dv->machine->render().ui_container();
+ ndv->editor.container = &dv->machine().render().ui_container();
source = ndv->view->source();
dview_set_title(ndv, source->name());
set_focus_view(ndv);
@@ -1010,8 +1012,8 @@ static void on_log_window_activate(DView *dv, const ui_menu_event *event)
DView *ndv;
render_target *target;
- target = &dv->machine->render().ui_target();
- ndv = dview_alloc(target, dv->machine, DVT_LOG, 0);
+ target = &dv->machine().render().ui_target();
+ ndv = dview_alloc(target, dv->machine(), DVT_LOG, 0);
dview_set_title(ndv, "Log");
set_focus_view(ndv);
}
@@ -1025,63 +1027,63 @@ static void on_close_activate(DView *dv, const ui_menu_event *event)
static void on_run_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
#if 0
void on_run_h_activate(DView *dv, const ui_menu_event *event)
{
debugwin_show(0);
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
#endif
static void on_run_cpu_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go_next_device();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go_next_device();
}
static void on_run_irq_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go_interrupt();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go_interrupt();
}
static void on_run_vbl_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go_vblank();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go_vblank();
}
static void on_step_into_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step();
}
static void on_step_over_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step_over();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step_over();
}
#ifdef UNUSED_CODE
static void on_step_out_activate(DView *dv, const ui_menu_event *event)
{
- debug_cpu_get_visible_cpu(dv->machine)->debug()->single_step_out();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->single_step_out();
}
#endif
static void on_hard_reset_activate(DView *dv, const ui_menu_event *event)
{
- dv->machine->schedule_hard_reset();
+ dv->machine().schedule_hard_reset();
}
static void on_soft_reset_activate(DView *dv, const ui_menu_event *event)
{
- dv->machine->schedule_soft_reset();
- debug_cpu_get_visible_cpu(dv->machine)->debug()->go();
+ dv->machine().schedule_soft_reset();
+ debug_cpu_get_visible_cpu(dv->machine())->debug()->go();
}
static void on_exit_activate(DView *dv, const ui_menu_event *event)
{
- dv->machine->schedule_exit();
+ dv->machine().schedule_exit();
}
static void on_view_opcodes_activate(DView *dv, const ui_menu_event *event)
@@ -1108,11 +1110,11 @@ static void on_run_to_cursor_activate(DView *dv, const ui_menu_event *event)
{
char command[64];
- if (dv->view->cursor_visible() && debug_cpu_get_visible_cpu(dv->machine) == dv->view->source()->device())
+ if (dv->view->cursor_visible() && debug_cpu_get_visible_cpu(dv->machine()) == dv->view->source()->device())
{
offs_t address = downcast<debug_view_disasm *>(dv->view)->selected_address();
sprintf(command, "go %X", address);
- debug_console_execute_command(dv->machine, command, 1);
+ debug_console_execute_command(dv->machine(), command, 1);
}
}
@@ -1157,7 +1159,7 @@ static void render_editor(DView_edit *editor)
menu_main_populate - populate the main menu
-------------------------------------------------*/
-static void CreateMainMenu(running_machine *machine)
+static void CreateMainMenu(running_machine &machine)
{
const char *subtext = "";
int rc;
@@ -1165,7 +1167,7 @@ static void CreateMainMenu(running_machine *machine)
if (menu != NULL)
ui_menu_free(menu);
- menu = ui_menu_alloc(machine, &machine->render().ui_container(),NULL,NULL);
+ menu = ui_menu_alloc(machine, &machine.render().ui_container(),NULL,NULL);
switch (focus_view->type)
{
@@ -1258,7 +1260,7 @@ static int map_point(DView *dv, INT32 target_x, INT32 target_y, INT32 *mapped_x,
return FALSE;
}
-static void handle_mouse(running_machine *machine)
+static void handle_mouse(running_machine &machine)
{
render_target * mouse_target;
INT32 x,y;
@@ -1288,7 +1290,7 @@ static void handle_mouse(running_machine *machine)
handle_editor - handle the editor
-------------------------------------------------*/
-static void handle_editor(running_machine *machine)
+static void handle_editor(running_machine &machine)
{
if (focus_view->editor.active)
{
@@ -1344,12 +1346,12 @@ static void handle_editor(running_machine *machine)
menu_main - handle the main menu
-------------------------------------------------*/
-static void handle_menus(running_machine *machine)
+static void handle_menus(running_machine &machine)
{
const ui_menu_event *event;
- machine->render().ui_container().empty();
- ui_input_frame_update(*machine);
+ machine.render().ui_container().empty();
+ ui_input_frame_update(machine);
if (menu != NULL)
{
/* process the menu */
@@ -1447,35 +1449,35 @@ void debugint_wait_for_debugger(device_t &device, bool firststop)
DView *dv;
render_target *target;
- target = &device.machine->render().ui_target();
+ target = &device.machine().render().ui_target();
//set_view_by_name(target, "Debug");
- dv = dview_alloc(target, device.machine, DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
+ dv = dview_alloc(target, device.machine(), DVT_DISASSEMBLY, VIEW_STATE_FOLLOW_CPU);
dv->editor.active = TRUE;
- dv->editor.container = &device.machine->render().ui_container();
- dv = dview_alloc(target, device.machine, DVT_STATE, VIEW_STATE_FOLLOW_CPU);
- dv = dview_alloc(target, device.machine, DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
+ dv->editor.container = &device.machine().render().ui_container();
+ dv = dview_alloc(target, device.machine(), DVT_STATE, VIEW_STATE_FOLLOW_CPU);
+ dv = dview_alloc(target, device.machine(), DVT_CONSOLE, VIEW_STATE_FOLLOW_CPU);
dview_set_title(dv, "Console");
dv->editor.active = TRUE;
- dv->editor.container = &device.machine->render().ui_container();
+ dv->editor.container = &device.machine().render().ui_container();
set_focus_view(dv);
}
followers_set_cpu(&device);
- //ui_update_and_render(device.machine, &device.machine->render().ui_container()());
+ //ui_update_and_render(device.machine(), device.machine().render().ui_container()());
update_views();
- device.machine->osd().update(false);
- handle_menus(device.machine);
- handle_mouse(device.machine);
+ device.machine().osd().update(false);
+ handle_menus(device.machine());
+ handle_mouse(device.machine());
//osd_sleep(osd_ticks_per_second()/60);
}
-void debugint_update_during_game(running_machine *machine)
+void debugint_update_during_game(running_machine &machine)
{
- if (!debug_cpu_is_stopped(machine) && machine->phase() == MACHINE_PHASE_RUNNING)
+ if (!debug_cpu_is_stopped(machine) && machine.phase() == MACHINE_PHASE_RUNNING)
{
update_views();
}
diff --git a/src/emu/debugint/debugint.h b/src/emu/debugint/debugint.h
index 4d057e17b15..850be46a547 100644
--- a/src/emu/debugint/debugint.h
+++ b/src/emu/debugint/debugint.h
@@ -36,12 +36,12 @@
***************************************************************************/
/* initialize the internal debugger */
-void debugint_init(running_machine *machine);
+void debugint_init(running_machine &machine);
/* process events for internal debugger */
void debugint_wait_for_debugger(device_t &device, bool firststop);
/* update the internal debugger during a game */
-void debugint_update_during_game(running_machine *machine);
+void debugint_update_during_game(running_machine &machine);
#endif
diff --git a/src/emu/devcb.c b/src/emu/devcb.c
index d70af9f9507..5907abc7a3f 100644
--- a/src/emu/devcb.c
+++ b/src/emu/devcb.c
@@ -41,7 +41,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(config->tag);
+ resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->read = trampoline_read_port_to_read_line;
@@ -74,7 +74,7 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@@ -130,7 +130,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(config->tag);
+ resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_write_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->write = trampoline_write_port_to_write_line;
@@ -178,7 +178,7 @@ void devcb_resolve_write_line(devcb_resolved_write_line *resolved, const devcb_w
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@@ -228,7 +228,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
/* input port handlers */
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(config->tag);
+ resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_read8: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->read = trampoline_read_port_to_read8;
@@ -258,7 +258,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
@@ -307,7 +307,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_INPUT)
{
- resolved->target = device->machine->port(config->tag);
+ resolved->target = device->machine().port(config->tag);
if (resolved->target == NULL)
fatalerror("devcb_resolve_read_line: unable to find input port '%s' (requested by %s '%s')", config->tag, device->name(), device->tag());
resolved->write = trampoline_write_port_to_write8;
@@ -337,7 +337,7 @@ void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *c
if (config->type == DEVCB_TYPE_SELF)
resolved->target = device;
else if (config->type == DEVCB_TYPE_DRIVER)
- resolved->target = device->machine->driver_data();
+ resolved->target = device->machine().driver_data();
else
if (strcmp(config->tag, DEVICE_SELF_OWNER) == 0)
resolved->target = device->owner();
diff --git a/src/emu/devcb.h b/src/emu/devcb.h
index 6940923bed8..6641c2fdaf1 100644
--- a/src/emu/devcb.h
+++ b/src/emu/devcb.h
@@ -75,7 +75,7 @@ template<class _Class, UINT8 (_Class::*_Function)(address_space &, offs_t, UINT8
UINT8 devcb_stub(device_t *device, offs_t offset)
{
_Class *target = downcast<_Class *>(device);
- return (target->*_Function)(*memory_nonspecific_space(device->machine), offset, 0xff);
+ return (target->*_Function)(*memory_nonspecific_space(device->machine()), offset, 0xff);
}
// static template for a write_line stub function that calls through a given WRITE_LINE_MEMBER
@@ -91,7 +91,7 @@ template<class _Class, void (_Class::*_Function)(address_space &, offs_t, UINT8,
void devcb_stub(device_t *device, offs_t offset, UINT8 data)
{
_Class *target = downcast<_Class *>(device);
- (target->*_Function)(*memory_nonspecific_space(device->machine), offset, data, 0xff);
+ (target->*_Function)(*memory_nonspecific_space(device->machine()), offset, data, 0xff);
}
#define DEVCB_NULL { DEVCB_TYPE_NULL }
diff --git a/src/emu/devcpu.c b/src/emu/devcpu.c
index 9585949b348..4793308c966 100644
--- a/src/emu/devcpu.c
+++ b/src/emu/devcpu.c
@@ -236,7 +236,7 @@ legacy_cpu_device::legacy_cpu_device(running_machine &machine, const legacy_cpu_
throw emu_fatalerror("Device %s specifies a 0 context size!\n", tag());
// allocate memory for the token
- m_token = auto_alloc_array_clear(&machine, UINT8, tokenbytes);
+ m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
}
diff --git a/src/emu/devcpu.h b/src/emu/devcpu.h
index aa40b5f78ea..e889321448f 100644
--- a/src/emu/devcpu.h
+++ b/src/emu/devcpu.h
@@ -286,8 +286,8 @@ const device_type name = basename##_device_config::static_alloc_device_config
#define INTERRUPT_GEN(func) void func(device_t *device)
// helpers for using machine/cputag instead of cpu objects
-#define cputag_set_input_line(mach, tag, line, state) device_execute((mach)->device(tag))->set_input_line(line, state)
-#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach)->device(tag))->set_input_line_and_vector(line, state, vec)
+#define cputag_set_input_line(mach, tag, line, state) device_execute((mach).device(tag))->set_input_line(line, state)
+#define cputag_set_input_line_and_vector(mach, tag, line, state, vec) device_execute((mach).device(tag))->set_input_line_and_vector(line, state, vec)
diff --git a/src/emu/devimage.c b/src/emu/devimage.c
index 0815a74df09..d2183f690ba 100644
--- a/src/emu/devimage.c
+++ b/src/emu/devimage.c
@@ -487,7 +487,7 @@ done:
if (m_err!=0) {
if (!m_init_phase)
{
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (m_machine.phase() == MACHINE_PHASE_RUNNING)
popmessage("Error: Unable to %s image '%s': %s\n", is_create ? "create" : "load", path, error());
else
mame_printf_error("Error: Unable to %s image '%s': %s", is_create ? "create" : "load", path, error());
@@ -496,13 +496,13 @@ done:
}
else {
/* do we need to reset the CPU? only schedule it if load/create is successful */
- if (device().machine->time() > attotime::zero && m_image_config.is_reset_on_load())
- device().machine->schedule_hard_reset();
+ if (device().machine().time() > attotime::zero && m_image_config.is_reset_on_load())
+ device().machine().schedule_hard_reset();
else
{
if (!m_init_phase)
{
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (m_machine.phase() == MACHINE_PHASE_RUNNING)
popmessage("Image '%s' was successfully %s.", path, is_create ? "created" : "loaded");
else
mame_printf_info("Image '%s' was successfully %s.\n", path, is_create ? "created" : "loaded");
diff --git a/src/emu/devintrf.c b/src/emu/devintrf.c
index 60c217b06af..094693f3114 100644
--- a/src/emu/devintrf.c
+++ b/src/emu/devintrf.c
@@ -189,7 +189,7 @@ void device_list::static_exit(running_machine &machine)
{
// first let the debugger save comments
if ((machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
- debug_comment_save(&machine);
+ debug_comment_save(machine);
// then nuke the devices
machine.m_devicelist.reset();
@@ -201,7 +201,7 @@ void device_list::static_exit(running_machine &machine)
// about to save
//-------------------------------------------------
-void device_list::static_pre_save(running_machine *machine, void *param)
+void device_list::static_pre_save(running_machine &machine, void *param)
{
device_list *list = reinterpret_cast<device_list *>(param);
for (device_t *device = list->first(); device != NULL; device = device->next())
@@ -214,7 +214,7 @@ void device_list::static_pre_save(running_machine *machine, void *param)
// completed a load
//-------------------------------------------------
-void device_list::static_post_load(running_machine *machine, void *param)
+void device_list::static_post_load(running_machine &machine, void *param)
{
device_list *list = reinterpret_cast<device_list *>(param);
for (device_t *device = list->first(); device != NULL; device = device->next())
@@ -545,8 +545,7 @@ void device_interface::interface_debug_setup()
//-------------------------------------------------
device_t::device_t(running_machine &_machine, const device_config &config)
- : machine(&_machine),
- m_machine(_machine),
+ : m_machine(_machine),
m_state_manager(_machine.state()),
m_debug(NULL),
m_execute(NULL),
@@ -573,7 +572,7 @@ device_t::device_t(running_machine &_machine, const device_config &config)
device_t::~device_t()
{
- auto_free(&m_machine, m_debug);
+ auto_free(m_machine, m_debug);
}
@@ -737,13 +736,13 @@ void device_t::start()
intf->interface_pre_start();
// remember the number of state registrations
- int state_registrations = machine->state().registration_count();
+ int state_registrations = m_machine.state().registration_count();
// start the device
device_start();
// complain if nothing was registered by the device
- state_registrations = machine->state().registration_count() - state_registrations;
+ state_registrations = m_machine.state().registration_count() - state_registrations;
device_execute_interface *exec;
device_sound_interface *sound;
if (state_registrations == 0 && (interface(exec) || interface(sound)))
@@ -763,7 +762,7 @@ void device_t::start()
// if we're debugging, create a device_debug object
if ((m_machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
{
- m_debug = auto_alloc(&m_machine, device_debug(*this));
+ m_debug = auto_alloc(m_machine, device_debug(*this));
debug_setup();
}
@@ -983,7 +982,7 @@ device_t *device_t::auto_finder_base::find_device(device_t &base, const char *ta
void *device_t::auto_finder_base::find_shared_ptr(device_t &base, const char *tag)
{
- return memory_get_shared(*base.machine, tag);
+ return memory_get_shared(base.machine(), tag);
}
@@ -994,6 +993,6 @@ void *device_t::auto_finder_base::find_shared_ptr(device_t &base, const char *ta
size_t device_t::auto_finder_base::find_shared_size(device_t &base, const char *tag)
{
size_t result = 0;
- memory_get_shared(*base.machine, tag, result);
+ memory_get_shared(base.machine(), tag, result);
return result;
}
diff --git a/src/emu/devintrf.h b/src/emu/devintrf.h
index 5b7106c2b66..1897daf9881 100644
--- a/src/emu/devintrf.h
+++ b/src/emu/devintrf.h
@@ -56,7 +56,7 @@
#define DERIVED_CLOCK(num, den) (0xff000000 | ((num) << 12) | ((den) << 0))
// shorthand for accessing devices by machine/type/tag
-#define devtag_reset(mach,tag) (mach)->device(tag)->reset()
+#define devtag_reset(mach,tag) (mach).device(tag)->reset()
// often derived devices need only a different name and a simple parameter to differentiate them
// these are provided as macros because you can't pass string literals to templates, annoyingly enough
@@ -89,7 +89,7 @@ device_config *_ConfigClass::static_alloc_device_config(const machine_config &mc
\
device_t *_ConfigClass::alloc_device(running_machine &machine) const \
{ \
- return auto_alloc(&machine, _DeviceClass(machine, *this)); \
+ return auto_alloc(machine, _DeviceClass(machine, *this)); \
} \
@@ -234,8 +234,8 @@ class device_list : public tagged_device_list<device_t>
static void static_reset(running_machine &machine);
static void static_exit(running_machine &machine);
- static void static_pre_save(running_machine *machine, void *param);
- static void static_post_load(running_machine *machine, void *param);
+ static void static_pre_save(running_machine &machine, void *param);
+ static void static_post_load(running_machine &machine, void *param);
public:
device_list(resource_pool &pool = global_resource_pool);
@@ -394,6 +394,9 @@ protected:
virtual ~device_t();
public:
+ // getters
+ running_machine &machine() const { return m_machine; }
+
// iteration helpers
device_t *next() const { return m_next; }
device_t *typenext() const;
@@ -467,9 +470,6 @@ public:
machine_config_constructor machine_config_additions() const { return m_baseconfig.machine_config_additions(); }
const input_port_token *input_ports() const { return m_baseconfig.input_ports(); }
-public:
- running_machine * machine;
-
protected:
// miscellaneous helpers
void find_interfaces();
diff --git a/src/emu/devlegcy.c b/src/emu/devlegcy.c
index 0479a2e87d5..638153683e6 100644
--- a/src/emu/devlegcy.c
+++ b/src/emu/devlegcy.c
@@ -217,7 +217,7 @@ legacy_device_base::legacy_device_base(running_machine &_machine, const device_c
{
int tokenbytes = m_config.get_legacy_config_int(DEVINFO_INT_TOKEN_BYTES);
if (tokenbytes != 0)
- m_token = auto_alloc_array_clear(machine, UINT8, tokenbytes);
+ m_token = auto_alloc_array_clear(m_machine, UINT8, tokenbytes);
}
diff --git a/src/emu/diexec.c b/src/emu/diexec.c
index ae703b650be..d5c7b295d5c 100644
--- a/src/emu/diexec.c
+++ b/src/emu/diexec.c
@@ -314,7 +314,7 @@ device_execute_interface::~device_execute_interface()
bool device_execute_interface::executing() const
{
- return (this == device().machine->scheduler().currently_executing());
+ return (this == device().machine().scheduler().currently_executing());
}
@@ -372,7 +372,7 @@ void device_execute_interface::adjust_icount(int delta)
void device_execute_interface::abort_timeslice()
{
// ignore if not the executing device
- if (this != device().machine->scheduler().currently_executing())
+ if (this != device().machine().scheduler().currently_executing())
return;
// swallow the remaining cycles
@@ -442,7 +442,7 @@ void device_execute_interface::spin_until_time(attotime duration)
suspend_until_trigger(TRIGGER_SUSPENDTIME + timetrig, true);
// then set a timer for it
- device().machine->scheduler().timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
+ device().machine().scheduler().timer_set(duration, FUNC(static_timed_trigger_callback), TRIGGER_SUSPENDTIME + timetrig, this);
timetrig = (timetrig + 1) % 256;
}
@@ -547,7 +547,7 @@ void device_execute_interface::execute_set_input(int linenum, int state)
void device_execute_interface::interface_pre_start()
{
// fill in the initial states
- int index = device().machine->m_devicelist.indexof(m_device);
+ int index = device().machine().m_devicelist.indexof(m_device);
m_suspend = SUSPEND_REASON_RESET;
m_profiler = profile_type(index + PROFILER_DEVICE_FIRST);
m_inttrigger = index + TRIGGER_INT;
@@ -558,9 +558,9 @@ void device_execute_interface::interface_pre_start()
// allocate timers if we need them
if (m_execute_config.m_vblank_interrupts_per_frame > 1)
- m_partial_frame_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
+ m_partial_frame_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_partial_frame_interrupt), (void *)this);
if (m_execute_config.m_timed_interrupt_period != attotime::zero)
- m_timedint_timer = device().machine->scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
+ m_timedint_timer = device().machine().scheduler().timer_alloc(FUNC(static_trigger_periodic_interrupt), (void *)this);
// register for save states
m_device.save_item(NAME(m_suspend));
@@ -623,11 +623,11 @@ void device_execute_interface::interface_post_reset()
// new style - use screen tag directly
screen_device *screen;
if (m_execute_config.m_vblank_interrupt_screen != NULL)
- screen = downcast<screen_device *>(device().machine->device(m_execute_config.m_vblank_interrupt_screen));
+ screen = downcast<screen_device *>(device().machine().device(m_execute_config.m_vblank_interrupt_screen));
// old style 'hack' setup - use screen #0
else
- screen = device().machine->first_screen();
+ screen = device().machine().first_screen();
assert(screen != NULL);
screen->register_vblank_callback(static_on_vblank, NULL);
@@ -665,7 +665,7 @@ void device_execute_interface::interface_clock_changed()
m_divisor = attos;
// re-compute the perfect interleave factor
- device().machine->scheduler().compute_perfect_interleave();
+ device().machine().scheduler().compute_perfect_interleave();
}
@@ -709,7 +709,7 @@ void device_execute_interface::static_on_vblank(screen_device &screen, void *par
if (vblank_state)
{
device_execute_interface *exec = NULL;
- for (bool gotone = screen.machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = screen.machine().m_devicelist.first(exec); gotone; gotone = exec->next(exec))
exec->on_vblank_start(screen);
}
}
@@ -740,7 +740,7 @@ void device_execute_interface::on_vblank_start(screen_device &screen)
// if we have more than one interrupt per frame, start the timer now to trigger the rest of them
if (m_execute_config.m_vblank_interrupts_per_frame > 1 && !suspended(SUSPEND_REASON_DISABLE))
{
- m_partial_frame_period = device().machine->primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
+ m_partial_frame_period = device().machine().primary_screen->frame_period() / m_execute_config.m_vblank_interrupts_per_frame;
m_partial_frame_timer->adjust(m_partial_frame_period);
}
}
@@ -916,7 +916,7 @@ if (TEMPLOG) printf("setline(%s,%d,%d,%d)\n", m_device->tag(), m_linenum, state,
// if this is the first one, set the timer
if (event_index == 0)
- m_execute->device().machine->scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
+ m_execute->device().machine().scheduler().synchronize(FUNC(static_empty_event_queue), 0, (void *)this);
}
}
diff --git a/src/emu/diexec.h b/src/emu/diexec.h
index 65b398a4640..db1fc83643f 100644
--- a/src/emu/diexec.h
+++ b/src/emu/diexec.h
@@ -300,7 +300,7 @@ protected:
int m_qindex; // index within the queue
private:
- static void static_empty_event_queue(running_machine *machine, void *ptr, int param);
+ static void static_empty_event_queue(running_machine &machine, void *ptr, int param);
void empty_event_queue();
};
@@ -344,15 +344,15 @@ protected:
private:
// callbacks
- static void static_timed_trigger_callback(running_machine *machine, void *ptr, int param);
+ static void static_timed_trigger_callback(running_machine &machine, void *ptr, int param);
static void static_on_vblank(screen_device &screen, void *param, bool vblank_state);
void on_vblank_start(screen_device &screen);
- static void static_trigger_partial_frame_interrupt(running_machine *machine, void *ptr, int param);
+ static void static_trigger_partial_frame_interrupt(running_machine &machine, void *ptr, int param);
void trigger_partial_frame_interrupt();
- static void static_trigger_periodic_interrupt(running_machine *machine, void *ptr, int param);
+ static void static_trigger_periodic_interrupt(running_machine &machine, void *ptr, int param);
void trigger_periodic_interrupt();
attoseconds_t minimum_quantum() const;
diff --git a/src/emu/diimage.c b/src/emu/diimage.c
index 6ef5203baec..7573fa8e6f3 100644
--- a/src/emu/diimage.c
+++ b/src/emu/diimage.c
@@ -394,7 +394,7 @@ void device_image_interface::setup_working_directory()
if (try_change_working_directory("software"))
{
/* now down to a directory for this computer */
- gamedrv = &device().machine->system();
+ gamedrv = &device().machine().system();
while(gamedrv && !try_change_working_directory(gamedrv->name))
{
gamedrv = driver_get_compatible(gamedrv);
@@ -431,7 +431,7 @@ UINT8 *device_image_interface::get_software_region(const char *tag)
return NULL;
sprintf( full_tag, "%s:%s", device().tag(), tag );
- return device().machine->region( full_tag )->base();
+ return device().machine().region( full_tag )->base();
}
@@ -444,7 +444,7 @@ UINT32 device_image_interface::get_software_region_length(const char *tag)
char full_tag[256];
sprintf( full_tag, "%s:%s", device().tag(), tag );
- return device().machine->region( full_tag )->bytes();
+ return device().machine().region( full_tag )->bytes();
}
@@ -582,9 +582,9 @@ UINT32 device_image_interface::crc()
-------------------------------------------------*/
void device_image_interface::battery_load(void *buffer, int length, int fill)
{
- astring *fname = astring_assemble_4(astring_alloc(), device().machine->system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
+ astring *fname = astring_assemble_4(astring_alloc(), device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
- image_battery_load_by_name(device().machine->options(), astring_c(fname), buffer, length, fill);
+ image_battery_load_by_name(device().machine().options(), astring_c(fname), buffer, length, fill);
astring_free(fname);
}
@@ -596,9 +596,9 @@ void device_image_interface::battery_load(void *buffer, int length, int fill)
-------------------------------------------------*/
void device_image_interface::battery_save(const void *buffer, int length)
{
- astring *fname = astring_assemble_4(astring_alloc(), device().machine->system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
+ astring *fname = astring_assemble_4(astring_alloc(), device().machine().system().name, PATH_SEPARATOR, m_basename_noext, ".nv");
- image_battery_save_by_name(device().machine->options(), astring_c(fname), buffer, length);
+ image_battery_save_by_name(device().machine().options(), astring_c(fname), buffer, length);
astring_free(fname);
}
diff --git a/src/emu/disound.c b/src/emu/disound.c
index 4a1b31dc772..89fbd33ecb8 100644
--- a/src/emu/disound.c
+++ b/src/emu/disound.c
@@ -181,7 +181,7 @@ int device_sound_interface::inputs() const
{
// scan the list counting streams we own and summing their inputs
int inputs = 0;
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
inputs += stream->input_count();
return inputs;
@@ -197,7 +197,7 @@ int device_sound_interface::outputs() const
{
// scan the list counting streams we own and summing their outputs
int outputs = 0;
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
outputs += stream->output_count();
return outputs;
@@ -215,7 +215,7 @@ sound_stream *device_sound_interface::input_to_stream_input(int inputnum, int &s
assert(inputnum >= 0);
// scan the list looking for streams owned by this device
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &m_device)
{
if (inputnum < stream->input_count())
@@ -242,7 +242,7 @@ sound_stream *device_sound_interface::output_to_stream_output(int outputnum, int
assert(outputnum >= 0);
// scan the list looking for streams owned by this device
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
{
if (outputnum < stream->output_count())
@@ -268,7 +268,7 @@ void device_sound_interface::set_output_gain(int outputnum, float gain)
// handle ALL_OUTPUTS as a special case
if (outputnum == ALL_OUTPUTS)
{
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
for (int outputnum = 0; outputnum < stream->output_count(); outputnum++)
stream->set_output_gain(outputnum, gain);
@@ -294,13 +294,13 @@ void device_sound_interface::interface_pre_start()
{
// scan all the sound devices
device_sound_interface *sound = NULL;
- for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route; if we are, make sure the source device is started
- device_t *target_device = m_device.machine->device(route->m_target);
+ device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && !sound->device().started())
throw device_missing_dependencies();
}
@@ -308,13 +308,13 @@ void device_sound_interface::interface_pre_start()
// now iterate through devices again and assign any auto-allocated inputs
m_auto_allocated_inputs = 0;
- for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// see if we are the target of this route
- device_t *target_device = m_device.machine->device(route->m_target);
+ device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device && route->m_input == AUTO_ALLOC_INPUT)
{
const_cast<device_config_sound_interface::sound_route *>(route)->m_input = m_auto_allocated_inputs;
@@ -334,13 +334,13 @@ void device_sound_interface::interface_post_start()
{
// iterate over all the sound devices
device_sound_interface *sound = NULL;
- for (bool gotone = m_device.machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = m_device.machine().m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
// scan each route on the device
for (const device_config_sound_interface::sound_route *route = sound->sound_config().first_route(); route != NULL; route = route->next())
{
// if we are the target of this route, hook it up
- device_t *target_device = m_device.machine->device(route->m_target);
+ device_t *target_device = m_device.machine().device(route->m_target);
if (target_device == &m_device)
{
// iterate over all outputs, matching any that apply
@@ -378,7 +378,7 @@ void device_sound_interface::interface_post_start()
void device_sound_interface::interface_pre_reset()
{
// update all streams on this device prior to reset
- for (sound_stream *stream = m_device.machine->sound().first_stream(); stream != NULL; stream = stream->next())
+ for (sound_stream *stream = m_device.machine().sound().first_stream(); stream != NULL; stream = stream->next())
if (&stream->device() == &device())
stream->update();
}
diff --git a/src/emu/distate.c b/src/emu/distate.c
index f4e01737ea6..4a095bc5457 100644
--- a/src/emu/distate.c
+++ b/src/emu/distate.c
@@ -579,7 +579,7 @@ device_state_entry &device_state_interface::state_add(int index, const char *sym
assert(symbol != NULL);
// allocate new entry
- device_state_entry *entry = auto_alloc(device().machine, device_state_entry(index, symbol, data, size));
+ device_state_entry *entry = auto_alloc(device().machine(), device_state_entry(index, symbol, data, size));
// append to the end of the list
m_state_list.append(*entry);
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index c5701def17e..cf5654394f1 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -79,9 +79,9 @@ INLINE INT32 normalize_yscroll(bitmap_t *bitmap, INT32 yscroll)
elements referenced by a machine
-------------------------------------------------*/
-void gfx_init(running_machine *machine)
+void gfx_init(running_machine &machine)
{
- const gfx_decode_entry *gfxdecodeinfo = machine->config().m_gfxdecodeinfo;
+ const gfx_decode_entry *gfxdecodeinfo = machine.config().m_gfxdecodeinfo;
int curgfx;
/* skip if nothing to do */
@@ -92,7 +92,7 @@ void gfx_init(running_machine *machine)
for (curgfx = 0; curgfx < MAX_GFX_ELEMENTS && gfxdecodeinfo[curgfx].gfxlayout != NULL; curgfx++)
{
const gfx_decode_entry *gfxdecode = &gfxdecodeinfo[curgfx];
- const memory_region *region = (gfxdecode->memory_region != NULL) ? machine->region(gfxdecode->memory_region) : NULL;
+ const memory_region *region = (gfxdecode->memory_region != NULL) ? machine.region(gfxdecode->memory_region) : NULL;
UINT32 region_length = (region != NULL) ? (8 * region->bytes()) : 0;
const UINT8 *region_base = (region != NULL) ? region->base() : NULL;
UINT32 xscale = (gfxdecode->xscale == 0) ? 1 : gfxdecode->xscale;
@@ -206,7 +206,7 @@ void gfx_init(running_machine *machine)
glcopy.total = total;
/* allocate the graphics */
- machine->gfx[curgfx] = gfx_element_alloc(machine, &glcopy, (region_base != NULL) ? region_base + gfxdecode->start : NULL, gfxdecode->total_color_codes, gfxdecode->color_codes_start);
+ machine.gfx[curgfx] = gfx_element_alloc(machine, &glcopy, (region_base != NULL) ? region_base + gfxdecode->start : NULL, gfxdecode->total_color_codes, gfxdecode->color_codes_start);
}
}
@@ -217,7 +217,7 @@ void gfx_init(running_machine *machine)
based on a given layout
-------------------------------------------------*/
-gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base)
+gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base)
{
int israw = (gl->planeoffset[0] == GFX_RAW);
int planes = gl->planes;
@@ -243,7 +243,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
gfx->total_colors = total_colors;
gfx->srcdata = srcdata;
- gfx->machine = machine;
+ gfx->m_machine = &machine;
/* copy the layout */
gfx->layout = *gl;
@@ -338,12 +338,12 @@ void gfx_element_free(gfx_element *gfx)
return;
/* free our data */
- auto_free(gfx->machine, gfx->layout.extyoffs);
- auto_free(gfx->machine, gfx->layout.extxoffs);
- auto_free(gfx->machine, gfx->pen_usage);
- auto_free(gfx->machine, gfx->dirty);
- auto_free(gfx->machine, gfx->gfxdata);
- auto_free(gfx->machine, gfx);
+ auto_free(gfx->machine(), gfx->layout.extyoffs);
+ auto_free(gfx->machine(), gfx->layout.extxoffs);
+ auto_free(gfx->machine(), gfx->pen_usage);
+ auto_free(gfx->machine(), gfx->dirty);
+ auto_free(gfx->machine(), gfx->gfxdata);
+ auto_free(gfx->machine(), gfx);
}
@@ -352,7 +352,7 @@ void gfx_element_free(gfx_element *gfx)
temporary one-off gfx_element
-------------------------------------------------*/
-void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags)
+void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags)
{
static UINT8 not_dirty = 0;
@@ -369,7 +369,7 @@ void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UIN
gfx->color_base = color_base;
gfx->color_depth = color_granularity;
gfx->color_granularity = color_granularity;
- gfx->total_colors = (machine->total_colors() - color_base) / color_granularity;
+ gfx->total_colors = (machine.total_colors() - color_base) / color_granularity;
gfx->pen_usage = NULL;
@@ -380,7 +380,7 @@ void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UIN
gfx->dirty = &not_dirty;
gfx->dirtyseq = 0;
- gfx->machine = machine;
+ gfx->m_machine = &machine;
}
@@ -517,7 +517,7 @@ void drawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -553,7 +553,7 @@ void drawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_eleme
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -638,7 +638,7 @@ void drawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -686,7 +686,7 @@ void drawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -723,7 +723,7 @@ void drawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@@ -768,7 +768,7 @@ void drawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -811,7 +811,7 @@ void drawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_e
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -910,7 +910,7 @@ void drawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -965,7 +965,7 @@ void drawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* render based on dest bitmap depth */
if (dest->bpp == 16)
@@ -1009,7 +1009,7 @@ void drawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@@ -1047,7 +1047,7 @@ void pdrawgfx_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_elemen
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1086,7 +1086,7 @@ void pdrawgfx_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_elem
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1174,7 +1174,7 @@ void pdrawgfx_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1225,7 +1225,7 @@ void pdrawgfx_transtable(bitmap_t *dest, const rectangle *cliprect, const gfx_el
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1265,7 +1265,7 @@ void pdrawgfx_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_element
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
@@ -1313,7 +1313,7 @@ void pdrawgfxzoom_opaque(bitmap_t *dest, const rectangle *cliprect, const gfx_el
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1360,7 +1360,7 @@ void pdrawgfxzoom_transpen(bitmap_t *dest, const rectangle *cliprect, const gfx_
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1466,7 +1466,7 @@ void pdrawgfxzoom_transmask(bitmap_t *dest, const rectangle *cliprect, const gfx
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* use pen usage to optimize */
if (gfx->pen_usage != NULL && !gfx->dirty[code])
@@ -1525,7 +1525,7 @@ void pdrawgfxzoom_transtable(bitmap_t *dest, const rectangle *cliprect, const gf
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* high bit of the mask is implicitly on */
pmask |= 1 << 31;
@@ -1574,7 +1574,7 @@ void pdrawgfxzoom_alpha(bitmap_t *dest, const rectangle *cliprect, const gfx_ele
/* get final code and color, and grab lookup tables */
code %= gfx->total_elements;
color %= gfx->total_colors;
- paldata = &gfx->machine->pens[gfx->color_base + gfx->color_granularity * color];
+ paldata = &gfx->machine().pens[gfx->color_base + gfx->color_granularity * color];
/* early out if completely transparent */
if (gfx->pen_usage != NULL && !gfx->dirty[code] && (gfx->pen_usage[code] & ~(1 << transpen)) == 0)
diff --git a/src/emu/drawgfx.h b/src/emu/drawgfx.h
index b5f15be9ecb..4a379f580ab 100644
--- a/src/emu/drawgfx.h
+++ b/src/emu/drawgfx.h
@@ -120,6 +120,8 @@ struct _gfx_layout
class gfx_element
{
public:
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
UINT16 width; /* current pixel width of each element (changeble with source clipping) */
UINT16 height; /* current pixel height of each element (changeble with source clipping) */
UINT16 startx; /* current source clip X offset */
@@ -144,7 +146,7 @@ public:
UINT8 * dirty; /* dirty array for detecting tiles that need decoding */
UINT32 dirtyseq; /* sequence number; incremented each time a tile is dirtied */
- running_machine *machine; /* pointer to the owning machine */
+ running_machine *m_machine; /* pointer to the owning machine */
gfx_layout layout; /* copy of the original layout */
};
@@ -170,10 +172,10 @@ struct gfx_decode_entry
/* ----- graphics elements ----- */
/* allocate memory for the graphics elements referenced by a machine */
-void gfx_init(running_machine *machine);
+void gfx_init(running_machine &machine);
/* allocate a gfx_element structure based on a given layout */
-gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base);
+gfx_element *gfx_element_alloc(running_machine &machine, const gfx_layout *gl, const UINT8 *srcdata, UINT32 total_colors, UINT32 color_base);
/* update a single code in a gfx_element */
void gfx_element_decode(const gfx_element *gfx, UINT32 code);
@@ -182,7 +184,7 @@ void gfx_element_decode(const gfx_element *gfx, UINT32 code);
void gfx_element_free(gfx_element *gfx);
/* create a temporary one-off gfx_element */
-void gfx_element_build_temporary(gfx_element *gfx, running_machine *machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags);
+void gfx_element_build_temporary(gfx_element *gfx, running_machine &machine, UINT8 *base, UINT32 width, UINT32 height, UINT32 rowbytes, UINT32 color_base, UINT32 color_granularity, UINT32 flags);
diff --git a/src/emu/driver.h b/src/emu/driver.h
index fa38519c93f..47e64ef6564 100644
--- a/src/emu/driver.h
+++ b/src/emu/driver.h
@@ -60,7 +60,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*driver_init_func)(running_machine *machine);
+typedef void (*driver_init_func)(running_machine &machine);
struct game_driver
@@ -73,7 +73,7 @@ struct game_driver
const char * manufacturer; /* manufacturer of the game */
machine_config_constructor machine_config; /* machine driver tokens */
const input_port_token *ipt; /* pointer to array of input port tokens */
- void (*driver_init)(running_machine *machine); /* DRIVER_INIT callback */
+ void (*driver_init)(running_machine &machine); /* DRIVER_INIT callback */
const rom_entry * rom; /* pointer to list of ROMs for the game */
const char * compatible_with;
UINT32 flags; /* orientation and other flags; see defines below */
@@ -88,7 +88,7 @@ struct game_driver
#define DRIVER_INIT_NAME(name) driver_init_##name
-#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine *machine)
+#define DRIVER_INIT(name) void DRIVER_INIT_NAME(name)(running_machine &machine)
#define DRIVER_INIT_CALL(name) DRIVER_INIT_NAME(name)(machine)
#define driver_init_0 NULL
diff --git a/src/emu/drivers/empty.c b/src/emu/drivers/empty.c
index ad4511b44f3..bea3c2231ab 100644
--- a/src/emu/drivers/empty.c
+++ b/src/emu/drivers/empty.c
@@ -23,7 +23,7 @@
static MACHINE_START( empty )
{
/* force the UI to show the game select screen */
- ui_menu_force_game_select(machine, &machine->render().ui_container());
+ ui_menu_force_game_select(machine, &machine.render().ui_container());
}
diff --git a/src/emu/emucore.h b/src/emu/emucore.h
index b8801fc5159..68503d30887 100644
--- a/src/emu/emucore.h
+++ b/src/emu/emucore.h
@@ -373,7 +373,7 @@ inline _Dest crosscast(_Source *src)
//**************************************************************************
DECL_NORETURN void fatalerror(const char *format, ...) ATTR_PRINTF(1,2) ATTR_NORETURN;
-DECL_NORETURN void fatalerror_exitcode(running_machine *machine, int exitcode, const char *format, ...) ATTR_PRINTF(3,4) ATTR_NORETURN;
+DECL_NORETURN void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...) ATTR_PRINTF(3,4) ATTR_NORETURN;
inline void fatalerror(const char *format, ...)
{
@@ -383,7 +383,7 @@ inline void fatalerror(const char *format, ...)
va_end(ap);
}
-inline void fatalerror_exitcode(running_machine *machine, int exitcode, const char *format, ...)
+inline void fatalerror_exitcode(running_machine &machine, int exitcode, const char *format, ...)
{
va_list ap;
va_start(ap, format);
diff --git a/src/emu/emuopts.c b/src/emu/emuopts.c
index d3db7c45503..69cca4f8b87 100644
--- a/src/emu/emuopts.c
+++ b/src/emu/emuopts.c
@@ -401,7 +401,7 @@ void emu_options::set_system_name(const char *name)
const char *emu_options::device_option(device_image_interface &image)
{
- return image.device().machine->options().value(image.image_config().instance_name());
+ return image.device().machine().options().value(image.image_config().instance_name());
}
diff --git a/src/emu/emupal.c b/src/emu/emupal.c
index 819c1746283..061aa96dd90 100644
--- a/src/emu/emupal.c
+++ b/src/emu/emupal.c
@@ -62,7 +62,9 @@ struct _palette_private
class colortable_t
{
public:
- running_machine * machine; /* associated machine */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* associated machine */
UINT32 entries; /* number of entries */
UINT32 palentries; /* number of palette entries */
UINT16 * raw; /* raw data about each entry */
@@ -75,13 +77,13 @@ public:
FUNCTION PROTOTYPES
***************************************************************************/
-static void palette_presave(running_machine *machine, void *param);
-static void palette_postload(running_machine *machine, void *param);
+static void palette_presave(running_machine &machine, void *param);
+static void palette_postload(running_machine &machine, void *param);
static void palette_exit(running_machine &machine);
-static void allocate_palette(running_machine *machine, palette_private *palette);
-static void allocate_color_tables(running_machine *machine, palette_private *palette);
-static void allocate_shadow_tables(running_machine *machine, palette_private *palette);
-static void configure_rgb_shadows(running_machine *machine, int mode, float factor);
+static void allocate_palette(running_machine &machine, palette_private *palette);
+static void allocate_color_tables(running_machine &machine, palette_private *palette);
+static void allocate_shadow_tables(running_machine &machine, palette_private *palette);
+static void configure_rgb_shadows(running_machine &machine, int mode, float factor);
@@ -94,17 +96,17 @@ static void configure_rgb_shadows(running_machine *machine, int mode, float fact
takes place before the display is created
-------------------------------------------------*/
-void palette_init(running_machine *machine)
+void palette_init(running_machine &machine)
{
palette_private *palette = auto_alloc_clear(machine, palette_private);
- screen_device *device = machine->first_screen();
+ screen_device *device = machine.first_screen();
/* get the format from the first screen, or use BITMAP_FORMAT_INVALID, if screenless */
bitmap_format format = (device != NULL) ? device->format() : BITMAP_FORMAT_INVALID;
/* request cleanup */
- machine->palette_data = palette;
- machine->add_notifier(MACHINE_NOTIFY_EXIT, palette_exit);
+ machine.palette_data = palette;
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, palette_exit);
/* reset all our data */
palette->format = format;
@@ -120,7 +122,7 @@ void palette_init(running_machine *machine)
case BITMAP_FORMAT_INVALID:
/* invalid format means no palette - or at least it should */
- assert(machine->total_colors() == 0);
+ assert(machine.total_colors() == 0);
return;
default:
@@ -129,7 +131,7 @@ void palette_init(running_machine *machine)
}
/* allocate all the data structures */
- if (machine->total_colors() > 0)
+ if (machine.total_colors() > 0)
{
int numcolors;
@@ -138,13 +140,13 @@ void palette_init(running_machine *machine)
allocate_shadow_tables(machine, palette);
/* set up save/restore of the palette */
- numcolors = palette_get_num_colors(machine->palette);
+ numcolors = palette_get_num_colors(machine.palette);
palette->save_pen = auto_alloc_array(machine, pen_t, numcolors);
palette->save_bright = auto_alloc_array(machine, float, numcolors);
state_save_register_global_pointer(machine, palette->save_pen, numcolors);
state_save_register_global_pointer(machine, palette->save_bright, numcolors);
- machine->state().register_presave(palette_presave, palette);
- machine->state().register_postload(palette_postload, palette);
+ machine.state().register_presave(palette_presave, palette);
+ machine.state().register_postload(palette_postload, palette);
}
}
@@ -159,12 +161,12 @@ void palette_init(running_machine *machine)
shadow brightness factor
-------------------------------------------------*/
-void palette_set_shadow_factor(running_machine *machine, double factor)
+void palette_set_shadow_factor(running_machine &machine, double factor)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
assert(palette->shadow_group != 0);
- palette_group_set_contrast(machine->palette, palette->shadow_group, factor);
+ palette_group_set_contrast(machine.palette, palette->shadow_group, factor);
}
@@ -173,12 +175,12 @@ void palette_set_shadow_factor(running_machine *machine, double factor)
highlight brightness factor
-------------------------------------------------*/
-void palette_set_highlight_factor(running_machine *machine, double factor)
+void palette_set_highlight_factor(running_machine &machine, double factor)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
assert(palette->hilight_group != 0);
- palette_group_set_contrast(machine->palette, palette->hilight_group, factor);
+ palette_group_set_contrast(machine.palette, palette->hilight_group, factor);
}
@@ -238,11 +240,11 @@ void palette_set_highlight_factor(running_machine *machine, double factor)
different live shadow tables
-------------------------------------------------*/
-void palette_set_shadow_mode(running_machine *machine, int mode)
+void palette_set_shadow_mode(running_machine &machine, int mode)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
assert(mode >= 0 && mode < MAX_SHADOW_PRESETS);
- machine->shadow_table = palette->shadow_table[mode].base;
+ machine.shadow_table = palette->shadow_table[mode].base;
}
@@ -251,9 +253,9 @@ void palette_set_shadow_mode(running_machine *machine, int mode)
RGB values for 1 of 4 shadow tables
-------------------------------------------------*/
-void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int dg, int db, int noclip)
+void palette_set_shadow_dRGB32(running_machine &machine, int mode, int dr, int dg, int db, int noclip)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
shadow_table_data *stable = &palette->shadow_table[mode];
int i;
@@ -313,20 +315,19 @@ void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int d
with the given number of entries
-------------------------------------------------*/
-colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize)
+colortable_t *colortable_alloc(running_machine &machine, UINT32 palettesize)
{
colortable_t *ctable;
UINT32 index;
- assert(machine != NULL);
assert(palettesize > 0);
/* allocate the colortable */
ctable = auto_alloc_clear(machine, colortable_t);
/* fill in the basics */
- ctable->machine = machine;
- ctable->entries = machine->total_colors();
+ ctable->m_machine = &machine;
+ ctable->entries = machine.total_colors();
ctable->palentries = palettesize;
/* allocate the raw colortable */
@@ -361,7 +362,7 @@ void colortable_entry_set_value(colortable_t *ctable, UINT32 entry, UINT16 value
if (ctable->raw[entry] != value)
{
ctable->raw[entry] = value;
- palette_set_color(ctable->machine, entry, ctable->palette[value]);
+ palette_set_color(ctable->machine(), entry, ctable->palette[value]);
}
}
@@ -403,7 +404,7 @@ void colortable_palette_set_color(colortable_t *ctable, UINT32 entry, rgb_t colo
/* update the palette for any colortable entries that reference it */
for (index = 0; index < ctable->entries; index++)
if (ctable->raw[index] == entry)
- palette_set_color(ctable->machine, index, color);
+ palette_set_color(ctable->machine(), index, color);
}
}
@@ -495,9 +496,9 @@ UINT32 colortable_palette_get_size(colortable_t *ctable)
black color
-------------------------------------------------*/
-pen_t get_black_pen(running_machine *machine)
+pen_t get_black_pen(running_machine &machine)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
return palette->black_pen;
}
@@ -507,9 +508,9 @@ pen_t get_black_pen(running_machine *machine)
white color
-------------------------------------------------*/
-pen_t get_white_pen(running_machine *machine)
+pen_t get_white_pen(running_machine &machine)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
return palette->white_pen;
}
@@ -524,17 +525,17 @@ pen_t get_white_pen(running_machine *machine)
for saving
-------------------------------------------------*/
-static void palette_presave(running_machine *machine, void *param)
+static void palette_presave(running_machine &machine, void *param)
{
- int numcolors = palette_get_num_colors(machine->palette);
+ int numcolors = palette_get_num_colors(machine.palette);
palette_private *palette = (palette_private *)param;
int index;
/* fill the save arrays with updated pen and brightness information */
for (index = 0; index < numcolors; index++)
{
- palette->save_pen[index] = palette_entry_get_color(machine->palette, index);
- palette->save_bright[index] = palette_entry_get_contrast(machine->palette, index);
+ palette->save_pen[index] = palette_entry_get_color(machine.palette, index);
+ palette->save_bright[index] = palette_entry_get_contrast(machine.palette, index);
}
}
@@ -544,17 +545,17 @@ static void palette_presave(running_machine *machine, void *param)
actually update the palette
-------------------------------------------------*/
-static void palette_postload(running_machine *machine, void *param)
+static void palette_postload(running_machine &machine, void *param)
{
- int numcolors = palette_get_num_colors(machine->palette);
+ int numcolors = palette_get_num_colors(machine.palette);
palette_private *palette = (palette_private *)param;
int index;
/* reset the pen and brightness for each entry */
for (index = 0; index < numcolors; index++)
{
- palette_entry_set_color(machine->palette, index, palette->save_pen[index]);
- palette_entry_set_contrast(machine->palette, index, palette->save_bright[index]);
+ palette_entry_set_color(machine.palette, index, palette->save_pen[index]);
+ palette_entry_set_contrast(machine.palette, index, palette->save_bright[index]);
}
}
@@ -576,39 +577,39 @@ static void palette_exit(running_machine &machine)
palette object itself
-------------------------------------------------*/
-static void allocate_palette(running_machine *machine, palette_private *palette)
+static void allocate_palette(running_machine &machine, palette_private *palette)
{
int numgroups, index;
/* determine the number of groups we need */
numgroups = 1;
- if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS)
palette->shadow_group = numgroups++;
- if (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
palette->hilight_group = numgroups++;
- assert_always(machine->total_colors() * numgroups <= 65536, "Error: palette has more than 65536 colors.");
+ assert_always(machine.total_colors() * numgroups <= 65536, "Error: palette has more than 65536 colors.");
/* allocate a palette object containing all the colors and groups */
- machine->palette = palette_alloc(machine->total_colors(), numgroups);
- assert_always(machine->palette != NULL, "Failed to allocate system palette");
+ machine.palette = palette_alloc(machine.total_colors(), numgroups);
+ assert_always(machine.palette != NULL, "Failed to allocate system palette");
/* configure the groups */
if (palette->shadow_group != 0)
- palette_group_set_contrast(machine->palette, palette->shadow_group, (float)PALETTE_DEFAULT_SHADOW_FACTOR);
+ palette_group_set_contrast(machine.palette, palette->shadow_group, (float)PALETTE_DEFAULT_SHADOW_FACTOR);
if (palette->hilight_group != 0)
- palette_group_set_contrast(machine->palette, palette->hilight_group, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR);
+ palette_group_set_contrast(machine.palette, palette->hilight_group, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR);
/* set the initial colors to a standard rainbow */
- for (index = 0; index < machine->total_colors(); index++)
- palette_entry_set_color(machine->palette, index, MAKE_RGB(pal1bit(index >> 0), pal1bit(index >> 1), pal1bit(index >> 2)));
+ for (index = 0; index < machine.total_colors(); index++)
+ palette_entry_set_color(machine.palette, index, MAKE_RGB(pal1bit(index >> 0), pal1bit(index >> 1), pal1bit(index >> 2)));
/* switch off the color mode */
switch (palette->format)
{
/* 16-bit paletteized case */
case BITMAP_FORMAT_INDEXED16:
- palette->black_pen = palette_get_black_entry(machine->palette);
- palette->white_pen = palette_get_white_entry(machine->palette);
+ palette->black_pen = palette_get_black_entry(machine.palette);
+ palette->white_pen = palette_get_white_entry(machine.palette);
if (palette->black_pen >= 65536)
palette->black_pen = 0;
if (palette->white_pen >= 65536)
@@ -640,9 +641,9 @@ static void allocate_palette(running_machine *machine, palette_private *palette)
pen and color tables
-------------------------------------------------*/
-static void allocate_color_tables(running_machine *machine, palette_private *palette)
+static void allocate_color_tables(running_machine &machine, palette_private *palette)
{
- int total_colors = palette_get_num_colors(machine->palette) * palette_get_num_groups(machine->palette);
+ int total_colors = palette_get_num_colors(machine.palette) * palette_get_num_groups(machine.palette);
pen_t *pentable;
int i;
@@ -651,21 +652,21 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal
{
case BITMAP_FORMAT_INDEXED16:
/* create a dummy 1:1 mapping */
- machine->pens = pentable = auto_alloc_array(machine, pen_t, total_colors + 2);
+ machine.pens = pentable = auto_alloc_array(machine, pen_t, total_colors + 2);
for (i = 0; i < total_colors + 2; i++)
pentable[i] = i;
break;
case BITMAP_FORMAT_RGB15:
- machine->pens = palette_entry_list_adjusted_rgb15(machine->palette);
+ machine.pens = palette_entry_list_adjusted_rgb15(machine.palette);
break;
case BITMAP_FORMAT_RGB32:
- machine->pens = palette_entry_list_adjusted(machine->palette);
+ machine.pens = palette_entry_list_adjusted(machine.palette);
break;
default:
- machine->pens = NULL;
+ machine.pens = NULL;
break;
}
}
@@ -676,10 +677,10 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal
shadow tables
-------------------------------------------------*/
-static void allocate_shadow_tables(running_machine *machine, palette_private *palette)
+static void allocate_shadow_tables(running_machine &machine, palette_private *palette)
{
/* if we have shadows, allocate shadow tables */
- if (machine->config().m_video_attributes & VIDEO_HAS_SHADOWS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_SHADOWS)
{
pen_t *table = auto_alloc_array(machine, pen_t, 65536);
int i;
@@ -689,7 +690,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
{
palette->shadow_table[0].base = palette->shadow_table[2].base = table;
for (i = 0; i < 65536; i++)
- table[i] = (i < machine->total_colors()) ? (i + machine->total_colors()) : i;
+ table[i] = (i < machine.total_colors()) ? (i + machine.total_colors()) : i;
}
/* RGB mode gets two 32k tables in slots 0 and 2 */
@@ -702,7 +703,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
}
/* if we have hilights, allocate shadow tables */
- if (machine->config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
+ if (machine.config().m_video_attributes & VIDEO_HAS_HIGHLIGHTS)
{
pen_t *table = auto_alloc_array(machine, pen_t, 65536);
int i;
@@ -712,7 +713,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
{
palette->shadow_table[1].base = palette->shadow_table[3].base = table;
for (i = 0; i < 65536; i++)
- table[i] = (i < machine->total_colors()) ? (i + 2 * machine->total_colors()) : i;
+ table[i] = (i < machine.total_colors()) ? (i + 2 * machine.total_colors()) : i;
}
/* RGB mode gets two 32k tables in slots 1 and 3 */
@@ -725,7 +726,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
}
/* set the default table */
- machine->shadow_table = palette->shadow_table[0].base;
+ machine.shadow_table = palette->shadow_table[0].base;
}
@@ -734,9 +735,9 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
for the RGB tables
-------------------------------------------------*/
-static void configure_rgb_shadows(running_machine *machine, int mode, float factor)
+static void configure_rgb_shadows(running_machine &machine, int mode, float factor)
{
- palette_private *palette = machine->palette_data;
+ palette_private *palette = machine.palette_data;
shadow_table_data *stable = &palette->shadow_table[mode];
int ifactor = (int)(factor * 256.0f);
int i;
diff --git a/src/emu/emupal.h b/src/emu/emupal.h
index 9b590de8c46..1180cfdb25a 100644
--- a/src/emu/emupal.h
+++ b/src/emu/emupal.h
@@ -124,34 +124,34 @@ class colortable_t;
/* ----- initialization and configuration ----- */
/* palette initialization that takes place before the display is created */
-void palette_init(running_machine *machine);
+void palette_init(running_machine &machine);
/* ----- shadow/hilight configuration ----- */
/* set the global shadow brightness factor */
-void palette_set_shadow_factor(running_machine *machine, double factor);
+void palette_set_shadow_factor(running_machine &machine, double factor);
/* set the global highlight brightness factor */
-void palette_set_highlight_factor(running_machine *machine, double factor);
+void palette_set_highlight_factor(running_machine &machine, double factor);
/* ----- shadow table configuration ----- */
/* select 1 of 4 different live shadow tables */
-void palette_set_shadow_mode(running_machine *machine, int mode);
+void palette_set_shadow_mode(running_machine &machine, int mode);
/* configure delta RGB values for 1 of 4 shadow tables */
-void palette_set_shadow_dRGB32(running_machine *machine, int mode, int dr, int dg, int db, int noclip);
+void palette_set_shadow_dRGB32(running_machine &machine, int mode, int dr, int dg, int db, int noclip);
/* ----- colortable management ----- */
/* allocate a new colortable with the given number of entries */
-colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize);
+colortable_t *colortable_alloc(running_machine &machine, UINT32 palettesize);
/* set the value of a colortable entry */
void colortable_entry_set_value(colortable_t *ctable, UINT32 entry, UINT16 value);
@@ -179,10 +179,10 @@ UINT32 colortable_palette_get_size(colortable_t *ctable);
/* ----- utilities ----- */
/* return the pen for a fixed black color */
-pen_t get_black_pen(running_machine *machine);
+pen_t get_black_pen(running_machine &machine);
/* return the pen for a fixed white color */
-pen_t get_white_pen(running_machine *machine);
+pen_t get_white_pen(running_machine &machine);
@@ -196,9 +196,9 @@ pen_t get_white_pen(running_machine *machine);
entry
-------------------------------------------------*/
-INLINE void palette_set_color(running_machine *machine, pen_t pen, rgb_t rgb)
+INLINE void palette_set_color(running_machine &machine, pen_t pen, rgb_t rgb)
{
- palette_entry_set_color(machine->palette, pen, rgb);
+ palette_entry_set_color(machine.palette, pen, rgb);
}
@@ -207,9 +207,9 @@ INLINE void palette_set_color(running_machine *machine, pen_t pen, rgb_t rgb)
entry with individual R,G,B components
-------------------------------------------------*/
-INLINE void palette_set_color_rgb(running_machine *machine, pen_t pen, UINT8 r, UINT8 g, UINT8 b)
+INLINE void palette_set_color_rgb(running_machine &machine, pen_t pen, UINT8 r, UINT8 g, UINT8 b)
{
- palette_entry_set_color(machine->palette, pen, MAKE_RGB(r, g, b));
+ palette_entry_set_color(machine.palette, pen, MAKE_RGB(r, g, b));
}
@@ -218,9 +218,9 @@ INLINE void palette_set_color_rgb(running_machine *machine, pen_t pen, UINT8 r,
entry
-------------------------------------------------*/
-INLINE rgb_t palette_get_color(running_machine *machine, pen_t pen)
+INLINE rgb_t palette_get_color(running_machine &machine, pen_t pen)
{
- return palette_entry_get_color(machine->palette, pen);
+ return palette_entry_get_color(machine.palette, pen);
}
@@ -229,9 +229,9 @@ INLINE rgb_t palette_get_color(running_machine *machine, pen_t pen)
contrast factor
-------------------------------------------------*/
-INLINE void palette_set_pen_contrast(running_machine *machine, pen_t pen, double bright)
+INLINE void palette_set_pen_contrast(running_machine &machine, pen_t pen, double bright)
{
- palette_entry_set_contrast(machine->palette, pen, bright);
+ palette_entry_set_contrast(machine.palette, pen, bright);
}
@@ -240,10 +240,10 @@ INLINE void palette_set_pen_contrast(running_machine *machine, pen_t pen, double
entries from an array of rgb_t values
-------------------------------------------------*/
-INLINE void palette_set_colors(running_machine *machine, pen_t color_base, const rgb_t *colors, int color_count)
+INLINE void palette_set_colors(running_machine &machine, pen_t color_base, const rgb_t *colors, int color_count)
{
while (color_count--)
- palette_entry_set_color(machine->palette, color_base++, *colors++);
+ palette_entry_set_color(machine.palette, color_base++, *colors++);
}
diff --git a/src/emu/image.c b/src/emu/image.c
index 03cfb34e339..e228f980a76 100644
--- a/src/emu/image.c
+++ b/src/emu/image.c
@@ -62,7 +62,7 @@ struct io_procs image_ioprocs =
configuration items
-------------------------------------------------*/
-static void image_dirs_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void image_dirs_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *node;
const char *dev_instance;
@@ -77,7 +77,7 @@ static void image_dirs_load(running_machine *machine, int config_type, xml_data_
if ((dev_instance != NULL) && (dev_instance[0] != '\0'))
{
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
if (!strcmp(dev_instance, image->image_config().instance_name())) {
working_directory = xml_get_attribute_string(node, "directory", NULL);
@@ -97,7 +97,7 @@ static void image_dirs_load(running_machine *machine, int config_type, xml_data_
directories to the configuration file
-------------------------------------------------*/
-static void image_dirs_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void image_dirs_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *node;
const char *dev_instance;
@@ -106,7 +106,7 @@ static void image_dirs_save(running_machine *machine, int config_type, xml_data_
/* only care about game-specific data */
if (config_type == CONFIG_TYPE_GAME)
{
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
dev_instance = image->image_config().instance_name();
@@ -153,21 +153,21 @@ static int write_config(emu_options &options, const char *filename, const game_d
out of core into the options
-------------------------------------------------*/
-static void image_options_extract(running_machine *machine)
+static void image_options_extract(running_machine &machine)
{
/* only extract the device options if we've added them */
-// if (machine->options().bool_value(OPTION_ADDED_DEVICE_OPTIONS))
+// if (machine.options().bool_value(OPTION_ADDED_DEVICE_OPTIONS))
{
int index = 0;
device_image_interface *image = NULL;
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
const char *filename = image->filename();
/* and set the option */
astring error;
- machine->options().set_value(image->image_config().instance_name(), filename ? filename : "", OPTION_PRIORITY_CMDLINE, error);
+ machine.options().set_value(image->image_config().instance_name(), filename ? filename : "", OPTION_PRIORITY_CMDLINE, error);
assert(!error);
index++;
@@ -175,8 +175,8 @@ static void image_options_extract(running_machine *machine)
}
/* write the config, if appropriate */
- if (machine->options().write_config())
- write_config(machine->options(), NULL, &machine->system());
+ if (machine.options().write_config())
+ write_config(machine.options(), NULL, &machine.system());
}
/*-------------------------------------------------
@@ -189,7 +189,7 @@ void image_unload_all(running_machine &machine)
device_image_interface *image = NULL;
// extract the options
- image_options_extract(&machine);
+ image_options_extract(machine);
for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
@@ -202,16 +202,16 @@ void image_unload_all(running_machine &machine)
running_machine
-------------------------------------------------*/
-void image_device_init(running_machine *machine)
+void image_device_init(running_machine &machine)
{
const char *image_name;
device_image_interface *image = NULL;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
/* is an image specified for this image */
- image_name = machine->options().device_option(*image);
+ image_name = machine.options().device_option(*image);
if ((image_name != NULL) && (image_name[0] != '\0'))
{
@@ -229,7 +229,7 @@ void image_device_init(running_machine *machine)
astring image_basename(image_name);
/* unload all images */
- image_unload_all(*machine);
+ image_unload_all(machine);
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load (%s) failed: %s",
image->image_config().devconfig().name(),
@@ -255,12 +255,12 @@ void image_device_init(running_machine *machine)
running_machine
-------------------------------------------------*/
-void image_postdevice_init(running_machine *machine)
+void image_postdevice_init(running_machine &machine)
{
device_image_interface *image = NULL;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
int result = image->finish_load();
/* did the image load fail? */
@@ -270,7 +270,7 @@ void image_postdevice_init(running_machine *machine)
astring image_err = astring(image->error());
/* unload all images */
- image_unload_all(*machine);
+ image_unload_all(machine);
fatalerror_exitcode(machine, MAMERR_DEVICE, "Device %s load failed: %s",
image->image_config().devconfig().name(),
@@ -279,7 +279,7 @@ void image_postdevice_init(running_machine *machine)
}
/* add a callback for when we shut down */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, image_unload_all);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, image_unload_all);
}
/***************************************************************************
INITIALIZATION
@@ -289,7 +289,7 @@ void image_postdevice_init(running_machine *machine)
image_init - start up the image system
-------------------------------------------------*/
-void image_init(running_machine *machine)
+void image_init(running_machine &machine)
{
image_device_init(machine);
config_register(machine, "image_directories", image_dirs_load, image_dirs_save);
@@ -364,11 +364,11 @@ static char *strip_extension(const char *filename)
string with the image info text
-------------------------------------------------*/
-astring *image_info_astring(running_machine *machine, astring *string)
+astring *image_info_astring(running_machine &machine, astring *string)
{
device_image_interface *image = NULL;
- astring_printf(string, "%s\n\n", machine->system().description);
+ astring_printf(string, "%s\n\n", machine.system().description);
#if 0
if (mess_ram_size > 0)
@@ -378,7 +378,7 @@ astring *image_info_astring(running_machine *machine, astring *string)
}
#endif
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
const char *name = image->filename();
if (name != NULL)
@@ -471,12 +471,12 @@ void image_battery_save_by_name(emu_options &options, const char *filename, cons
image_from_absolute_index - retreives index number
of image in device list
-------------------------------------------------*/
-device_image_interface *image_from_absolute_index(running_machine *machine, int absolute_index)
+device_image_interface *image_from_absolute_index(running_machine &machine, int absolute_index)
{
device_image_interface *image = NULL;
int cnt = 0;
/* make sure that any required devices have been allocated */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
if (cnt==absolute_index) return image;
cnt++;
@@ -492,11 +492,11 @@ device_image_interface *image_from_absolute_index(running_machine *machine, int
void image_add_device_with_subdevices(device_t *owner, device_type type, const char *tag, UINT32 clock)
{
astring tempstring;
- device_list *device_list = &owner->machine->m_devicelist;
- machine_config &config = const_cast<machine_config &>(owner->machine->config());
+ device_list *device_list = &owner->machine().m_devicelist;
+ machine_config &config = const_cast<machine_config &>(owner->machine().config());
device_config *devconfig = type(config, owner->subtag(tempstring,tag), &owner->baseconfig(), clock);
- device_t &device = device_list->append(devconfig->tag(), *devconfig->alloc_device(*owner->machine));
+ device_t &device = device_list->append(devconfig->tag(), *devconfig->alloc_device(owner->machine()));
machine_config_constructor machconfig = device.machine_config_additions();
if (machconfig != NULL)
@@ -505,7 +505,7 @@ void image_add_device_with_subdevices(device_t *owner, device_type type, const c
for (const device_config *config_dev = config.m_devicelist.first(); config_dev != NULL; config_dev = config_dev->next())
{
if (config_dev->owner()==devconfig) {
- device_list->append(config_dev->tag(), *config_dev->alloc_device(*owner->machine));
+ device_list->append(config_dev->tag(), *config_dev->alloc_device(owner->machine()));
}
}
}
diff --git a/src/emu/image.h b/src/emu/image.h
index 3f082772104..659a43dacf6 100644
--- a/src/emu/image.h
+++ b/src/emu/image.h
@@ -20,17 +20,17 @@
#include "ioprocs.h"
-void image_init(running_machine *machine);
-void image_postdevice_init(running_machine *machine);
+void image_init(running_machine &machine);
+void image_postdevice_init(running_machine &machine);
extern struct io_procs image_ioprocs;
void image_battery_load_by_name(emu_options &options, const char *filename, void *buffer, int length, int fill);
void image_battery_save_by_name(emu_options &options, const char *filename, const void *buffer, int length);
-astring *image_info_astring(running_machine *machine, astring *string);
+astring *image_info_astring(running_machine &machine, astring *string);
-device_image_interface *image_from_absolute_index(running_machine *machine, int absolute_index);
+device_image_interface *image_from_absolute_index(running_machine &machine, int absolute_index);
void image_add_device_with_subdevices(device_t *owner, device_type type, const char *tag, UINT32 clock);
diff --git a/src/emu/imagedev/bitbngr.c b/src/emu/imagedev/bitbngr.c
index 591a38d1032..cb2dadac3ea 100644
--- a/src/emu/imagedev/bitbngr.c
+++ b/src/emu/imagedev/bitbngr.c
@@ -344,10 +344,10 @@ static DEVICE_START(bitbanger)
/* output config */
bi->build_count = 0;
- bi->bitbanger_output_timer = device->machine->scheduler().timer_alloc(FUNC(bitbanger_output_timer), (void *) device);
+ bi->bitbanger_output_timer = device->machine().scheduler().timer_alloc(FUNC(bitbanger_output_timer), (void *) device);
/* input config */
- bi->bitbanger_input_timer = device->machine->scheduler().timer_alloc(FUNC(bitbanger_input_timer), (void *) device );
+ bi->bitbanger_input_timer = device->machine().scheduler().timer_alloc(FUNC(bitbanger_input_timer), (void *) device );
bi->idle_delay = attotime::from_seconds(1);
bi->input_buffer_size = 0;
bi->input_buffer_cursor = 0;
@@ -453,7 +453,7 @@ void bitbanger_output(device_t *device, int value)
bi->bitbanger_output_timer->adjust(one_point_five_baud, 0, bi->current_baud);
}
- //fprintf(stderr,"%s, %d\n", device->machine->time().as_string(9), value);
+ //fprintf(stderr,"%s, %d\n", device->machine().time().as_string(9), value);
bi->output_value = value;
}
diff --git a/src/emu/imagedev/bitbngr.h b/src/emu/imagedev/bitbngr.h
index 85124ca2536..ac27e3817c0 100644
--- a/src/emu/imagedev/bitbngr.h
+++ b/src/emu/imagedev/bitbngr.h
@@ -70,7 +70,7 @@ typedef struct _bitbanger_config bitbanger_config;
struct _bitbanger_config
{
/* callback to driver */
- void (*input_callback)(running_machine *machine, UINT8 bit);
+ void (*input_callback)(running_machine &machine, UINT8 bit);
int default_mode; /* emulating a printer or modem */
int default_baud; /* output bits per second */
int default_tune; /* fine tune adjustment to the baud */
diff --git a/src/emu/imagedev/cartslot.c b/src/emu/imagedev/cartslot.c
index 60e1a25820c..112141dbbb0 100644
--- a/src/emu/imagedev/cartslot.c
+++ b/src/emu/imagedev/cartslot.c
@@ -72,7 +72,7 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
offset = ROM_GETOFFSET(roment);
length = ROM_GETLENGTH(roment);
flags = ROM_GETFLAGS(roment);
- ptr = ((UINT8 *) image->device().machine->region(region)->base()) + offset;
+ ptr = ((UINT8 *) image->device().machine().region(region)->base()) + offset;
if (mode == PROCESS_LOAD)
{
@@ -124,7 +124,7 @@ static int load_cartridge(device_image_interface *image, const rom_entry *romrgn
/* if the region is inverted, do that now */
device_memory_interface *memory;
- cpu = image->device().machine->device(type);
+ cpu = image->device().machine().device(type);
if (cpu!=NULL && cpu->interface(memory))
{
datawidth = cpu->memory().space_config(AS_PROGRAM)->m_databus_width / 8;
@@ -169,7 +169,7 @@ static int process_cartridge(device_image_interface *image, process_mode mode)
const rom_entry *romrgn, *roment;
int result = 0;
- for (source = rom_first_source(image->device().machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(image->device().machine().config()); source != NULL; source = rom_next_source(*source))
{
for (romrgn = rom_first_region(*source); romrgn != NULL; romrgn = rom_next_region(romrgn))
{
@@ -303,7 +303,7 @@ static DEVICE_IMAGE_LOAD( cartslot )
return (*config->device_load)(image);
/* try opening this as if it were a multicart */
- multicart_open(device->machine->options(), image.filename(), device->machine->system().name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc);
+ multicart_open(device->machine().options(), image.filename(), device->machine().system().name, MULTICART_FLAGS_LOAD_RESOURCES, &cart->mc);
if (cart->mc == NULL)
{
@@ -337,7 +337,7 @@ static DEVICE_IMAGE_UNLOAD( cartslot )
if (cart->mc != NULL)
{
- multicart_close(device->machine->options(), cart->mc);
+ multicart_close(device->machine().options(), cart->mc);
cart->mc = NULL;
}
@@ -360,12 +360,12 @@ static const cartslot_pcb_type *identify_pcb(device_image_interface &image)
if (image.software_entry() == NULL && image.exists())
{
/* try opening this as if it were a multicart */
- multicart_open_error me = multicart_open(image.device().machine->options(), image.filename(), image.device().machine->system().name, MULTICART_FLAGS_DONT_LOAD_RESOURCES, &mc);
+ multicart_open_error me = multicart_open(image.device().machine().options(), image.filename(), image.device().machine().system().name, MULTICART_FLAGS_DONT_LOAD_RESOURCES, &mc);
if (me == MCERR_NONE)
{
/* this was a multicart - read from it */
astring_cpyc(&pcb_name, mc->pcb_type);
- multicart_close(image.device().machine->options(), mc);
+ multicart_close(image.device().machine().options(), mc);
}
else
{
diff --git a/src/emu/imagedev/cassette.c b/src/emu/imagedev/cassette.c
index c62e9544d54..555196c890b 100644
--- a/src/emu/imagedev/cassette.c
+++ b/src/emu/imagedev/cassette.c
@@ -71,7 +71,7 @@ INLINE int cassette_is_motor_on(device_t *device)
static void cassette_update(device_t *device)
{
dev_cassette_t *cassette = get_safe_token( device );
- double cur_time = device->machine->time().as_double();
+ double cur_time = device->machine().time().as_double();
if (cassette_is_motor_on(device))
{
@@ -187,7 +187,7 @@ double cassette_get_position(device_t *device)
position = cassette->position;
if (cassette_is_motor_on(device))
- position += device->machine->time().as_double() - cassette->position_time;
+ position += device->machine().time().as_double() - cassette->position_time;
return position;
}
@@ -273,7 +273,7 @@ static DEVICE_IMAGE_LOAD( cassette )
{
/* creating an image */
create_opts = cassette->config->create_opts;
- err = cassette_create(device->machine, (void *) &image, &image_ioprocs, &wavfile_format, create_opts, CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT, &cassette->cassette);
+ err = cassette_create(device->machine(), (void *) &image, &image_ioprocs, &wavfile_format, create_opts, CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT, &cassette->cassette);
if (err)
goto error;
}
@@ -285,7 +285,7 @@ static DEVICE_IMAGE_LOAD( cassette )
is_writable = image.is_writable();
cassette_flags = is_writable ? (CASSETTE_FLAG_READWRITE|CASSETTE_FLAG_SAVEONEXIT) : CASSETTE_FLAG_READONLY;
extension = image.filetype();
- err = cassette_open_choices(device->machine,(void *) &image, &image_ioprocs, extension, formats, cassette_flags, &cassette->cassette);
+ err = cassette_open_choices(device->machine(),(void *) &image, &image_ioprocs, extension, formats, cassette_flags, &cassette->cassette);
/* this is kind of a hack */
if (err && is_writable)
@@ -302,7 +302,7 @@ static DEVICE_IMAGE_LOAD( cassette )
/* reset the position */
cassette->position = 0.0;
- cassette->position_time = device->machine->time().as_double();
+ cassette->position_time = device->machine().time().as_double();
return IMAGE_INIT_PASS;
@@ -360,7 +360,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
x = 0.2f;
y = 0.5f;
- dev = device->machine->m_devicelist.first(CASSETTE );
+ dev = device->machine().m_devicelist.first(CASSETTE );
while ( dev && strcmp( dev->tag(), device->tag() ) )
{
@@ -368,7 +368,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
dev = dev->typenext();
}
- y *= ui_get_line_height(*device->machine) + 2.0f * UI_BOX_TB_BORDER;
+ y *= ui_get_line_height(device->machine()) + 2.0f * UI_BOX_TB_BORDER;
/* choose which frame of the animation we are at */
n = ((int) position / ANIMATION_FPS) % ANIMATION_FRAMES;
/* Since you can have anything in a BDF file, we will use crude ascii characters instead */
@@ -393,7 +393,7 @@ static DEVICE_IMAGE_DISPLAY(cassette)
(int) length);
/* draw the cassette */
- ui_draw_text_box(&device->machine->render().ui_container(), buf, JUSTIFY_LEFT, x, y, UI_BACKGROUND_COLOR);
+ ui_draw_text_box(&device->machine().render().ui_container(), buf, JUSTIFY_LEFT, x, y, UI_BACKGROUND_COLOR);
}
/*-------------------------------------------------
diff --git a/src/emu/imagedev/cassimg.c b/src/emu/imagedev/cassimg.c
index f2e3c9b2eb7..b69196af57e 100644
--- a/src/emu/imagedev/cassimg.c
+++ b/src/emu/imagedev/cassimg.c
@@ -81,7 +81,7 @@ static INT16 interpolate16(INT32 value)
initialization and termination
*********************************************************************/
-static cassette_image *cassette_init(running_machine *machine,const struct CassetteFormat *format, void *file, const struct io_procs *procs, int flags)
+static cassette_image *cassette_init(running_machine &machine,const struct CassetteFormat *format, void *file, const struct io_procs *procs, int flags)
{
cassette_image *cassette;
@@ -95,7 +95,7 @@ static cassette_image *cassette_init(running_machine *machine,const struct Casse
cassette->io.procs = procs;
cassette->flags = flags;
cassette->pool = pool_alloc_lib(NULL);
- cassette->machine = machine;
+ cassette->m_machine = &machine;
return cassette;
}
@@ -125,7 +125,7 @@ static int good_format(const struct CassetteFormat *format, const char *extensio
-casserr_t cassette_open_choices(running_machine *machine,void *file, const struct io_procs *procs, const char *extension,
+casserr_t cassette_open_choices(running_machine &machine,void *file, const struct io_procs *procs, const char *extension,
const struct CassetteFormat *const *formats, int flags, cassette_image **outcassette)
{
casserr_t err;
@@ -190,7 +190,7 @@ done:
-casserr_t cassette_open(running_machine *machine, void *file, const struct io_procs *procs,
+casserr_t cassette_open(running_machine &machine, void *file, const struct io_procs *procs,
const struct CassetteFormat *format, int flags, cassette_image **outcassette)
{
const struct CassetteFormat *formats[2];
@@ -201,7 +201,7 @@ casserr_t cassette_open(running_machine *machine, void *file, const struct io_pr
-casserr_t cassette_create(running_machine *machine, void *file, const struct io_procs *procs, const struct CassetteFormat *format,
+casserr_t cassette_create(running_machine &machine, void *file, const struct io_procs *procs, const struct CassetteFormat *format,
const struct CassetteOptions *opts, int flags, cassette_image **outcassette)
{
casserr_t err;
diff --git a/src/emu/imagedev/cassimg.h b/src/emu/imagedev/cassimg.h
index 5128e5628d2..48b6a32f3c3 100644
--- a/src/emu/imagedev/cassimg.h
+++ b/src/emu/imagedev/cassimg.h
@@ -87,6 +87,8 @@ struct CassetteInfo
struct _cassette_image
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
const struct CassetteFormat *format;
struct io_generic io;
object_pool *pool;
@@ -99,7 +101,7 @@ struct _cassette_image
size_t block_count;
size_t sample_count;
- running_machine *machine;
+ running_machine *m_machine;
};
typedef struct _cassette_image cassette_image;
@@ -163,11 +165,11 @@ CASSETTE_FORMATLIST_EXTERN(cassette_default_formats);
***************************************************************************/
-casserr_t cassette_open(running_machine *machine,void *file, const struct io_procs *procs,
+casserr_t cassette_open(running_machine &machine,void *file, const struct io_procs *procs,
const struct CassetteFormat *format, int flags, cassette_image **outcassette);
-casserr_t cassette_open_choices(running_machine *machine,void *file, const struct io_procs *procs, const char *extension,
+casserr_t cassette_open_choices(running_machine &machine,void *file, const struct io_procs *procs, const char *extension,
const struct CassetteFormat *const *formats, int flags, cassette_image **outcassette);
-casserr_t cassette_create(running_machine *machine,void *file, const struct io_procs *procs, const struct CassetteFormat *format,
+casserr_t cassette_create(running_machine &machine,void *file, const struct io_procs *procs, const struct CassetteFormat *format,
const struct CassetteOptions *opts, int flags, cassette_image **outcassette);
casserr_t cassette_save(cassette_image *cassette);
void cassette_close(cassette_image *cassette);
diff --git a/src/emu/imagedev/chd_cd.c b/src/emu/imagedev/chd_cd.c
index 008fa87fb2b..df427a0507a 100644
--- a/src/emu/imagedev/chd_cd.c
+++ b/src/emu/imagedev/chd_cd.c
@@ -87,7 +87,7 @@ static DEVICE_IMAGE_LOAD(cdrom)
if ( err )
goto error;
} else {
- chd = get_disk_handle(image.device().machine, image.device().subtag(tempstring,"cdrom"));
+ chd = get_disk_handle(image.device().machine(), image.device().subtag(tempstring,"cdrom"));
}
/* open the CHD file */
diff --git a/src/emu/imagedev/flopdrv.c b/src/emu/imagedev/flopdrv.c
index b31ae72358d..70b019cd9ce 100644
--- a/src/emu/imagedev/flopdrv.c
+++ b/src/emu/imagedev/flopdrv.c
@@ -214,7 +214,7 @@ static void floppy_drive_init(device_t *img)
pDrive->flags = 0;
pDrive->index_pulse_callback = NULL;
pDrive->ready_state_change_callback = NULL;
- pDrive->index_timer = img->machine->scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img);
+ pDrive->index_timer = img->machine().scheduler().timer_alloc(FUNC(floppy_drive_index_callback), (void *) img);
pDrive->idx = 0;
floppy_drive_set_geometry(img, ((floppy_config*)img->baseconfig().static_config())->floppy_type);
@@ -674,7 +674,7 @@ DEVICE_IMAGE_LOAD( floppy )
else
next_wpt = CLEAR_LINE;
- image.device().machine->scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), next_wpt, flopimg);
+ image.device().machine().scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), next_wpt, flopimg);
return retVal;
}
@@ -702,16 +702,16 @@ DEVICE_IMAGE_UNLOAD( floppy )
devcb_call_write_line(&flopimg->out_wpt_func, flopimg->wpt);
/* set timer for disk eject */
- image.device().machine->scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), ASSERT_LINE, flopimg);
+ image.device().machine().scheduler().timer_set(attotime::from_msec(250), FUNC(set_wpt), ASSERT_LINE, flopimg);
}
-device_t *floppy_get_device(running_machine *machine,int drive)
+device_t *floppy_get_device(running_machine &machine,int drive)
{
switch(drive) {
- case 0 : return machine->device(FLOPPY_0);
- case 1 : return machine->device(FLOPPY_1);
- case 2 : return machine->device(FLOPPY_2);
- case 3 : return machine->device(FLOPPY_3);
+ case 0 : return machine.device(FLOPPY_0);
+ case 1 : return machine.device(FLOPPY_1);
+ case 2 : return machine.device(FLOPPY_2);
+ case 3 : return machine.device(FLOPPY_3);
}
return NULL;
}
@@ -728,7 +728,7 @@ void floppy_set_type(device_t *image,int ftype)
flopimg->floppy_drive_type = ftype;
}
-device_t *floppy_get_device_by_type(running_machine *machine,int ftype,int drive)
+device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive)
{
int i;
int cnt = 0;
@@ -758,7 +758,7 @@ int floppy_get_drive_by_type(device_t *image,int ftype)
{
int i,drive =0;
for (i=0;i<4;i++) {
- device_t *disk = floppy_get_device(image->machine,i);
+ device_t *disk = floppy_get_device(image->machine(),i);
if (floppy_get_drive_type(disk)==ftype) {
if (image==disk) {
return drive;
@@ -769,13 +769,13 @@ int floppy_get_drive_by_type(device_t *image,int ftype)
return drive;
}
-int floppy_get_count(running_machine *machine)
+int floppy_get_count(running_machine &machine)
{
int cnt = 0;
- if (machine->device(FLOPPY_0)) cnt++;
- if (machine->device(FLOPPY_1)) cnt++;
- if (machine->device(FLOPPY_2)) cnt++;
- if (machine->device(FLOPPY_3)) cnt++;
+ if (machine.device(FLOPPY_0)) cnt++;
+ if (machine.device(FLOPPY_1)) cnt++;
+ if (machine.device(FLOPPY_2)) cnt++;
+ if (machine.device(FLOPPY_3)) cnt++;
return cnt;
}
diff --git a/src/emu/imagedev/flopdrv.h b/src/emu/imagedev/flopdrv.h
index 971b5ee1ac1..d9c8f2203e6 100644
--- a/src/emu/imagedev/flopdrv.h
+++ b/src/emu/imagedev/flopdrv.h
@@ -137,11 +137,11 @@ void floppy_install_unload_proc(device_t *image, void (*proc)(device_image_inter
void floppy_install_load_proc(device_t *image, void (*proc)(device_image_interface &image));
-device_t *floppy_get_device(running_machine *machine,int drive);
-device_t *floppy_get_device_by_type(running_machine *machine,int ftype,int drive);
+device_t *floppy_get_device(running_machine &machine,int drive);
+device_t *floppy_get_device_by_type(running_machine &machine,int ftype,int drive);
int floppy_get_drive_type(device_t *image);
void floppy_set_type(device_t *image,int ftype);
-int floppy_get_count(running_machine *machine);
+int floppy_get_count(running_machine &machine);
int floppy_get_drive(device_t *image);
int floppy_get_drive_by_type(device_t *image,int ftype);
diff --git a/src/emu/imagedev/snapquik.c b/src/emu/imagedev/snapquik.c
index af56b4776ec..ba9ccaeaad3 100644
--- a/src/emu/imagedev/snapquik.c
+++ b/src/emu/imagedev/snapquik.c
@@ -132,7 +132,7 @@ static DEVICE_START( snapquick )
snapquick_token *token = get_token(device);
/* allocate a timer */
- token->timer = device->machine->scheduler().timer_alloc(FUNC(process_snapshot_or_quickload), (void *) dynamic_cast<device_image_interface *>(device));
+ token->timer = device->machine().scheduler().timer_alloc(FUNC(process_snapshot_or_quickload), (void *) dynamic_cast<device_image_interface *>(device));
}
@@ -298,7 +298,7 @@ static int z80bin_load_file(device_image_interface *image, const char *file_type
image->message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
return IMAGE_INIT_FAIL;
}
- image->device().machine->device("maincpu")->memory().space(AS_PROGRAM)->write_byte(j, data);
+ image->device().machine().device("maincpu")->memory().space(AS_PROGRAM)->write_byte(j, data);
}
return IMAGE_INIT_PASS;
@@ -326,17 +326,17 @@ static QUICKLOAD_LOAD( z80bin )
config = (const z80bin_config *)downcast<const legacy_device_config_base &>(image.device().baseconfig()).inline_config();
/* check to see if autorun is on (I hate how this works) */
- autorun = input_port_read_safe(image.device().machine, "CONFIG", 0xFF) & 1;
+ autorun = input_port_read_safe(image.device().machine(), "CONFIG", 0xFF) & 1;
/* start program */
if (config->execute != NULL)
{
- (*config->execute)(image.device().machine, start_addr, end_addr, exec_addr, autorun);
+ (*config->execute)(image.device().machine(), start_addr, end_addr, exec_addr, autorun);
}
else
{
if (autorun)
- cpu_set_reg(image.device().machine->device("maincpu"), STATE_GENPC, exec_addr);
+ cpu_set_reg(image.device().machine().device("maincpu"), STATE_GENPC, exec_addr);
}
}
diff --git a/src/emu/imagedev/snapquik.h b/src/emu/imagedev/snapquik.h
index 37ccfa12a2c..126c47c8807 100644
--- a/src/emu/imagedev/snapquik.h
+++ b/src/emu/imagedev/snapquik.h
@@ -39,7 +39,7 @@ DECLARE_LEGACY_IMAGE_DEVICE(Z80BIN, z80bin);
#define QUICKLOAD_LOAD(name) int QUICKLOAD_LOAD_NAME(name)(device_image_interface &image, const char *file_type, int quickload_size)
#define Z80BIN_EXECUTE_NAME(name) z80bin_execute_##name
-#define Z80BIN_EXECUTE(name) void Z80BIN_EXECUTE_NAME(name)(running_machine *machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun)
+#define Z80BIN_EXECUTE(name) void Z80BIN_EXECUTE_NAME(name)(running_machine &machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun)
#define LOAD_REG(_cpu, _reg, _data) \
do { \
@@ -64,7 +64,7 @@ struct _snapquick_config
attoseconds_t delay_attoseconds; /* loading delay (attoseconds) */
};
-typedef void (*z80bin_execute_func)(running_machine *machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun);
+typedef void (*z80bin_execute_func)(running_machine &machine, UINT16 start_address, UINT16 end_address, UINT16 execute_address, int autorun);
typedef struct _z80bin_config z80bin_config;
struct _z80bin_config
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 59d834634e2..22194da114e 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -297,9 +297,9 @@ struct _input_port_private
inputx_code *codes;
key_buffer *keybuffer;
emu_timer *inputx_timer;
- int (*queue_chars)(running_machine *machine, const unicode_char *text, size_t text_len);
- int (*accept_char)(running_machine *machine, unicode_char ch);
- int (*charqueue_empty)(running_machine *machine);
+ int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len);
+ int (*accept_char)(running_machine &machine, unicode_char ch);
+ int (*charqueue_empty)(running_machine &machine);
attotime current_rate;
};
@@ -623,8 +623,8 @@ static TIMER_CALLBACK(inputx_timerproc);
/* Debugging commands and handlers. */
-static void execute_input(running_machine *machine, int ref, int params, const char *param[]);
-static void execute_dumpkbd(running_machine *machine, int ref, int params, const char *param[]);
+static void execute_input(running_machine &machine, int ref, int params, const char *param[]);
+static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[]);
/***************************************************************************
COMMON SHARED STRINGS
@@ -774,17 +774,17 @@ static void input_port_exit(running_machine &machine);
static INT32 apply_analog_settings(INT32 current, analog_field_state *analog);
/* initialization helpers */
-static void init_port_types(running_machine *machine);
-static void init_port_state(running_machine *machine);
+static void init_port_types(running_machine &machine);
+static void init_port_state(running_machine &machine);
static void init_autoselect_devices(running_machine &machine, int type1, int type2, int type3, const char *option, const char *ananame);
static device_field_info *init_field_device_info(const input_field_config *field,const char *device_name);
static analog_field_state *init_field_analog_state(const input_field_config *field);
/* once-per-frame updates */
static void frame_update_callback(running_machine &machine);
-static void frame_update(running_machine *machine);
-static void frame_update_digital_joysticks(running_machine *machine);
-static void frame_update_analog_field(running_machine *machine, analog_field_state *analog);
+static void frame_update(running_machine &machine);
+static void frame_update_digital_joysticks(running_machine &machine);
+static void frame_update_analog_field(running_machine &machine, analog_field_state *analog);
static int frame_get_digital_field_state(const input_field_config *field, int mouse_down);
/* port configuration helpers */
@@ -798,33 +798,33 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
static void diplocation_free(input_field_diplocation **diplocptr);
/* tokenization helpers */
-static int token_to_input_field_type(running_machine *machine, const char *string, int *player);
-static const char *input_field_type_to_token(running_machine *machine, int type, int player);
+static int token_to_input_field_type(running_machine &machine, const char *string, int *player);
+static const char *input_field_type_to_token(running_machine &machine, int type, int player);
static int token_to_seq_type(const char *string);
/* settings load */
-static void load_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void load_remap_table(running_machine *machine, xml_data_node *parentnode);
-static int load_default_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
-static int load_game_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
+static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void load_remap_table(running_machine &machine, xml_data_node *parentnode);
+static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
+static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq);
/* settings save */
-static void save_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq);
+static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq);
static int save_this_input_field_type(int type);
-static void save_default_inputs(running_machine *machine, xml_data_node *parentnode);
-static void save_game_inputs(running_machine *machine, xml_data_node *parentnode);
+static void save_default_inputs(running_machine &machine, xml_data_node *parentnode);
+static void save_game_inputs(running_machine &machine, xml_data_node *parentnode);
/* input playback */
-static time_t playback_init(running_machine *machine);
-static void playback_end(running_machine *machine, const char *message);
-static void playback_frame(running_machine *machine, attotime curtime);
+static time_t playback_init(running_machine &machine);
+static void playback_end(running_machine &machine, const char *message);
+static void playback_frame(running_machine &machine, attotime curtime);
static void playback_port(const input_port_config *port);
/* input recording */
-static void record_init(running_machine *machine);
-static void record_end(running_machine *machine, const char *message);
-static void record_frame(running_machine *machine, attotime curtime);
+static void record_init(running_machine &machine);
+static void record_end(running_machine &machine, const char *message);
+static void record_frame(running_machine &machine, attotime curtime);
static void record_port(const input_port_config *port);
@@ -890,7 +890,7 @@ INLINE const char *get_port_tag(const input_port_config *port, char *tempbuffer)
if (port->tag != NULL)
return port->tag;
- for (curport = port->machine->m_portlist.first(); curport != NULL; curport = curport->next())
+ for (curport = port->machine().m_portlist.first(); curport != NULL; curport = curport->next())
{
if (curport == port)
break;
@@ -973,19 +973,19 @@ static WRITE_LINE_DEVICE_HANDLER( changed_write_line_device )
system
-------------------------------------------------*/
-time_t input_port_init(running_machine *machine, const input_port_token *tokens, const device_config_list &devicelist)
+time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_config_list &devicelist)
{
//input_port_private *portdata;
char errorbuf[1024];
time_t basetime;
/* allocate memory for our data structure */
- machine->input_port_data = auto_alloc_clear(machine, input_port_private);
- //portdata = machine->input_port_data;
+ machine.input_port_data = auto_alloc_clear(machine, input_port_private);
+ //portdata = machine.input_port_data;
/* add an exit callback and a frame callback */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, input_port_exit);
- machine->add_notifier(MACHINE_NOTIFY_FRAME, frame_update_callback);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, input_port_exit);
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, frame_update_callback);
/* initialize the default port info from the OSD */
init_port_types(machine);
@@ -993,7 +993,7 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens,
/* if we have a token list, proceed */
if (tokens != NULL)
{
- input_port_list_init(machine->m_portlist, tokens, errorbuf, sizeof(errorbuf), TRUE, NULL);
+ input_port_list_init(machine.m_portlist, tokens, errorbuf, sizeof(errorbuf), TRUE, NULL);
if (errorbuf[0] != 0)
mame_printf_error("Input port errors:\n%s", errorbuf);
}
@@ -1001,7 +1001,7 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens,
for (device_config *config = devicelist.first(); config != NULL; config = config->next())
{
if (config->input_ports()!=NULL) {
- input_port_list_init(machine->m_portlist, config->input_ports(), errorbuf, sizeof(errorbuf), TRUE, config);
+ input_port_list_init(machine.m_portlist, config->input_ports(), errorbuf, sizeof(errorbuf), TRUE, config);
if (errorbuf[0] != 0)
mame_printf_error("Input port errors:\n%s", errorbuf);
}
@@ -1027,8 +1027,8 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens,
static void input_port_exit(running_machine &machine)
{
/* close any playback or recording files */
- playback_end(&machine, NULL);
- record_end(&machine, NULL);
+ playback_end(machine, NULL);
+ record_end(machine, NULL);
}
@@ -1097,7 +1097,7 @@ const char *input_field_name(const input_field_config *field)
return field->name;
/* otherwise, return the name associated with the type */
- return input_type_name(field->port->machine, field->type, field->player);
+ return input_type_name(field->port->machine(), field->type, field->player);
}
@@ -1120,7 +1120,7 @@ const input_seq *input_field_seq(const input_field_config *field, input_seq_type
/* if the portseq is the special default code, return the expanded default value */
if (input_seq_get_1(portseq) == SEQCODE_DEFAULT)
- return input_type_seq(field->port->machine, field->type, field->player, seqtype);
+ return input_type_seq(field->port->machine(), field->type, field->player, seqtype);
/* otherwise, return the sequence as-is */
return portseq;
@@ -1171,7 +1171,7 @@ void input_field_set_user_settings(const input_field_config *field, const input_
/* copy the basics */
for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
{
- const input_seq *defseq = input_type_seq(field->port->machine, field->type, field->player, (input_seq_type)seqtype);
+ const input_seq *defseq = input_type_seq(field->port->machine(), field->type, field->player, (input_seq_type)seqtype);
if (input_seq_cmp(defseq, &settings->seq[seqtype]) == 0)
field->state->seq[seqtype] = default_seq;
else
@@ -1207,7 +1207,7 @@ const char *input_field_setting_name(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
if (setting->value == field->state->value)
return setting->name;
@@ -1229,7 +1229,7 @@ int input_field_has_previous_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
return (setting->value != field->state->value);
return FALSE;
@@ -1253,7 +1253,7 @@ void input_field_select_previous_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
prevsetting = NULL;
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
{
if (setting->value == field->state->value)
{
@@ -1268,7 +1268,7 @@ void input_field_select_previous_setting(const input_field_config *field)
if (!found_match)
{
for (prevsetting = field->settinglist; prevsetting != NULL; prevsetting = prevsetting->next)
- if (input_condition_true(field->port->machine, &prevsetting->condition))
+ if (input_condition_true(field->port->machine(), &prevsetting->condition))
break;
}
@@ -1293,7 +1293,7 @@ int input_field_has_next_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
{
if (found)
return TRUE;
@@ -1321,20 +1321,20 @@ void input_field_select_next_setting(const input_field_config *field)
/* scan the list of settings looking for a match on the current value */
nextsetting = NULL;
for (setting = field->settinglist; setting != NULL; setting = setting->next)
- if (input_condition_true(field->port->machine, &setting->condition))
+ if (input_condition_true(field->port->machine(), &setting->condition))
if (setting->value == field->state->value)
break;
/* if we found one, scan forward for the next valid one */
if (setting != NULL)
for (nextsetting = setting->next; nextsetting != NULL; nextsetting = nextsetting->next)
- if (input_condition_true(field->port->machine, &nextsetting->condition))
+ if (input_condition_true(field->port->machine(), &nextsetting->condition))
break;
/* if we hit the end, search from the beginning */
if (nextsetting == NULL)
for (nextsetting = field->settinglist; nextsetting != NULL; nextsetting = nextsetting->next)
- if (input_condition_true(field->port->machine, &nextsetting->condition))
+ if (input_condition_true(field->port->machine(), &nextsetting->condition))
break;
/* update the value to the previous one */
@@ -1364,12 +1364,12 @@ int input_type_is_analog(int type)
for the given type/player
-------------------------------------------------*/
-const char *input_type_name(running_machine *machine, int type, int player)
+const char *input_type_name(running_machine &machine, int type, int player)
{
/* if we have a machine, use the live state and quick lookup */
- if (machine != NULL)
+ if (1)//machine != NULL)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
return typestate->typedesc.name;
@@ -1394,12 +1394,12 @@ const char *input_type_name(running_machine *machine, int type, int player)
for the given type/player
-------------------------------------------------*/
-int input_type_group(running_machine *machine, int type, int player)
+int input_type_group(running_machine &machine, int type, int player)
{
/* if we have a machine, use the live state and quick lookup */
- if (machine != NULL)
+ if (1)//machine != NULL)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
return typestate->typedesc.group;
@@ -1424,7 +1424,7 @@ int input_type_group(running_machine *machine, int type, int player)
sequence for the given type/player
-------------------------------------------------*/
-const input_seq *input_type_seq(running_machine *machine, int type, int player, input_seq_type seqtype)
+const input_seq *input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype)
{
static const input_seq ip_none = SEQ_DEF_0;
@@ -1432,9 +1432,9 @@ const input_seq *input_type_seq(running_machine *machine, int type, int player,
assert((player >= 0) && (player < MAX_PLAYERS));
/* if we have a machine, use the live state and quick lookup */
- if (machine != NULL)
+ if (1)//machine != NULL)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
return &typestate->seq[seqtype];
@@ -1459,9 +1459,9 @@ const input_seq *input_type_seq(running_machine *machine, int type, int player,
sequence for the given type/player
-------------------------------------------------*/
-void input_type_set_seq(running_machine *machine, int type, int player, input_seq_type seqtype, const input_seq *newseq)
+void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate = portdata->type_to_typestate[type][player];
if (typestate != NULL)
typestate->seq[seqtype] = *newseq;
@@ -1474,7 +1474,7 @@ void input_type_set_seq(running_machine *machine, int type, int player, input_se
is pressed
-------------------------------------------------*/
-int input_type_pressed(running_machine *machine, int type, int player)
+int input_type_pressed(running_machine &machine, int type, int player)
{
return input_seq_pressed(machine, input_type_seq(machine, type, player, SEQ_TYPE_STANDARD));
}
@@ -1484,9 +1484,9 @@ int input_type_pressed(running_machine *machine, int type, int player)
input_type_list - return the list of types
-------------------------------------------------*/
-const input_type_desc *input_type_list(running_machine *machine)
+const input_type_desc *input_type_list(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
return &portdata->typestatelist->typedesc;
}
@@ -1502,9 +1502,9 @@ const input_type_desc *input_type_list(running_machine *machine)
port exists
-------------------------------------------------*/
-bool input_port_exists(running_machine *machine, const char *tag)
+bool input_port_exists(running_machine &machine, const char *tag)
{
- return machine->port(tag) != 0;
+ return machine.port(tag) != 0;
}
@@ -1514,9 +1514,9 @@ bool input_port_exists(running_machine *machine, const char *tag)
unused or unknown)
-------------------------------------------------*/
-input_port_value input_port_active(running_machine *machine, const char *tag)
+input_port_value input_port_active(running_machine &machine, const char *tag)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return port->active;
@@ -1530,9 +1530,9 @@ input_port_value input_port_active(running_machine *machine, const char *tag)
the port does not exist
-------------------------------------------------*/
-input_port_value input_port_active_safe(running_machine *machine, const char *tag, input_port_value defvalue)
+input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
return port == NULL ? defvalue : port->active;
}
@@ -1549,7 +1549,7 @@ input_port_value input_port_active_safe(running_machine *machine, const char *ta
input_port_value input_port_read_direct(const input_port_config *port)
{
- input_port_private *portdata = port->machine->input_port_data;
+ input_port_private *portdata = port->machine().input_port_data;
analog_field_state *analog;
device_field_info *device_field;
input_port_value result;
@@ -1561,7 +1561,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* update custom values */
for (device_field = port->state->readdevicelist; device_field != NULL; device_field = device_field->next)
- if (input_condition_true(port->machine, &device_field->field->condition))
+ if (input_condition_true(port->machine(), &device_field->field->condition))
{
/* replace the bits with bits from the device */
input_port_value newval = (*device_field->field->read_line_device)(device_field->device);
@@ -1572,7 +1572,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* update VBLANK bits */
if (port->state->vblank != 0)
{
- if (port->machine->primary_screen->vblank())
+ if (port->machine().primary_screen->vblank())
result |= port->state->vblank;
else
result &= ~port->state->vblank;
@@ -1583,7 +1583,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* merge in analog portions */
for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
- if (input_condition_true(port->machine, &analog->field->condition))
+ if (input_condition_true(port->machine(), &analog->field->condition))
{
/* start with the raw value */
INT32 value = analog->accum;
@@ -1591,7 +1591,7 @@ input_port_value input_port_read_direct(const input_port_config *port)
/* interpolate if appropriate and if time has passed since the last update */
if (analog->interpolate && !(analog->field->flags & ANALOG_FLAG_RESET) && portdata->last_delta_nsec != 0)
{
- attoseconds_t nsec_since_last = (port->machine->time() - portdata->last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
+ attoseconds_t nsec_since_last = (port->machine().time() - portdata->last_frame_time).as_attoseconds() / ATTOSECONDS_PER_NANOSECOND;
value = analog->previous + ((INT64)(analog->accum - analog->previous) * nsec_since_last / portdata->last_delta_nsec);
}
@@ -1619,9 +1619,9 @@ input_port_value input_port_read_direct(const input_port_config *port)
an input port specified by tag
-------------------------------------------------*/
-input_port_value input_port_read(running_machine *machine, const char *tag)
+input_port_value input_port_read(running_machine &machine, const char *tag)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return input_port_read_direct(port);
@@ -1636,7 +1636,7 @@ input_port_value input_port_read(running_machine *machine, const char *tag)
input_port_value input_port_read(device_t *device, const char *tag)
{
astring tempstring;
- const input_port_config *port = device->machine->port(device->baseconfig().subtag(tempstring, tag));
+ const input_port_config *port = device->machine().port(device->baseconfig().subtag(tempstring, tag));
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
return input_port_read_direct(port);
@@ -1649,9 +1649,9 @@ input_port_value input_port_read(device_t *device, const char *tag)
value if the port does not exist
-------------------------------------------------*/
-input_port_value input_port_read_safe(running_machine *machine, const char *tag, UINT32 defvalue)
+input_port_value input_port_read_safe(running_machine &machine, const char *tag, UINT32 defvalue)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
return (port == NULL) ? defvalue : input_port_read_direct(port);
}
@@ -1662,14 +1662,14 @@ input_port_value input_port_read_safe(running_machine *machine, const char *tag,
player
-------------------------------------------------*/
-int input_port_get_crosshair_position(running_machine *machine, int player, float *x, float *y)
+int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y)
{
const input_port_config *port;
const input_field_config *field;
int gotx = FALSE, goty = FALSE;
/* read all the lightgun values */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->player == player && field->crossaxis != CROSSHAIR_AXIS_NONE)
if (input_condition_true(machine, &field->condition))
@@ -1728,7 +1728,7 @@ int input_port_get_crosshair_position(running_machine *machine, int player, floa
conditions
-------------------------------------------------*/
-void input_port_update_defaults(running_machine *machine)
+void input_port_update_defaults(running_machine &machine)
{
int loopnum;
@@ -1738,7 +1738,7 @@ void input_port_update_defaults(running_machine *machine)
const input_port_config *port;
/* loop over all input ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
const input_field_config *field;
@@ -1803,7 +1803,7 @@ void input_port_write_direct(const input_port_config *port, input_port_value dat
COMBINE_DATA(&port->state->outputvalue);
for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
- if (device_field->field->type == IPT_OUTPUT && input_condition_true(port->machine, &device_field->field->condition))
+ if (device_field->field->type == IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition))
{
input_port_value newval = ( (port->state->outputvalue ^ device_field->field->defvalue ) & device_field->field->mask) >> device_field->shift;
@@ -1823,9 +1823,9 @@ void input_port_write_direct(const input_port_config *port, input_port_value dat
port specified by tag
-------------------------------------------------*/
-void input_port_write(running_machine *machine, const char *tag, input_port_value value, input_port_value mask)
+void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
if (port == NULL)
fatalerror("Unable to locate input port '%s'", tag);
input_port_write_direct(port, value, mask);
@@ -1837,9 +1837,9 @@ void input_port_write(running_machine *machine, const char *tag, input_port_valu
a port, ignore if the port does not exist
-------------------------------------------------*/
-void input_port_write_safe(running_machine *machine, const char *tag, input_port_value value, input_port_value mask)
+void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask)
{
- const input_port_config *port = machine->port(tag);
+ const input_port_config *port = machine.port(tag);
if (port != NULL)
input_port_write_direct(port, value, mask);
}
@@ -1855,7 +1855,7 @@ void input_port_write_safe(running_machine *machine, const char *tag, input_port
if the given condition attached is true
-------------------------------------------------*/
-int input_condition_true(running_machine *machine, const input_condition *condition)
+int input_condition_true(running_machine &machine, const input_condition *condition)
{
input_port_value condvalue;
@@ -1926,9 +1926,9 @@ const char *input_port_string_from_token(const input_port_token token)
type list
-------------------------------------------------*/
-static void init_port_types(running_machine *machine)
+static void init_port_types(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state **stateptr;
input_type_state *curtype;
input_type_desc *lasttype = NULL;
@@ -1953,7 +1953,7 @@ static void init_port_types(running_machine *machine)
}
/* ask the OSD to customize the list */
- machine->osd().customize_input_type_list(&portdata->typestatelist->typedesc);
+ machine.osd().customize_input_type_list(&portdata->typestatelist->typedesc);
/* now iterate over the OSD-modified types */
for (curtype = portdata->typestatelist; curtype != NULL; curtype = curtype->next)
@@ -2080,15 +2080,15 @@ static astring *get_keyboard_key_name(const input_field_config *field)
states based on the tokens
-------------------------------------------------*/
-static void init_port_state(running_machine *machine)
+static void init_port_state(running_machine &machine)
{
- const char *joystick_map_default = machine->options().joystick_map();
- input_port_private *portdata = machine->input_port_data;
+ const char *joystick_map_default = machine.options().joystick_map();
+ input_port_private *portdata = machine.input_port_data;
const input_field_config *field;
const input_port_config *port;
/* allocate live structures to mirror the configuration */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
analog_field_state **analogstatetail;
device_field_info **readdevicetail;
@@ -2098,7 +2098,7 @@ static void init_port_state(running_machine *machine)
/* allocate a new input_port_info structure */
portstate = auto_alloc_clear(machine, input_port_state);
((input_port_config *)port)->state = portstate;
- ((input_port_config *)port)->machine = machine;
+ ((input_port_config *)port)->m_machine = &machine;
/* start with tail pointers to all the data */
analogstatetail = &portstate->analoglist;
@@ -2164,18 +2164,18 @@ static void init_port_state(running_machine *machine)
}
/* handle autoselection of devices */
- init_autoselect_devices(*machine, IPT_PADDLE, IPT_PADDLE_V, 0, OPTION_PADDLE_DEVICE, "paddle");
- init_autoselect_devices(*machine, IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE, "analog joystick");
- init_autoselect_devices(*machine, IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, 0, OPTION_LIGHTGUN_DEVICE, "lightgun");
- init_autoselect_devices(*machine, IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, OPTION_PEDAL_DEVICE, "pedal");
- init_autoselect_devices(*machine, IPT_DIAL, IPT_DIAL_V, 0, OPTION_DIAL_DEVICE, "dial");
- init_autoselect_devices(*machine, IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
- init_autoselect_devices(*machine, IPT_POSITIONAL, IPT_POSITIONAL_V, 0, OPTION_POSITIONAL_DEVICE, "positional");
- init_autoselect_devices(*machine, IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
+ init_autoselect_devices(machine, IPT_PADDLE, IPT_PADDLE_V, 0, OPTION_PADDLE_DEVICE, "paddle");
+ init_autoselect_devices(machine, IPT_AD_STICK_X, IPT_AD_STICK_Y, IPT_AD_STICK_Z, OPTION_ADSTICK_DEVICE, "analog joystick");
+ init_autoselect_devices(machine, IPT_LIGHTGUN_X, IPT_LIGHTGUN_Y, 0, OPTION_LIGHTGUN_DEVICE, "lightgun");
+ init_autoselect_devices(machine, IPT_PEDAL, IPT_PEDAL2, IPT_PEDAL3, OPTION_PEDAL_DEVICE, "pedal");
+ init_autoselect_devices(machine, IPT_DIAL, IPT_DIAL_V, 0, OPTION_DIAL_DEVICE, "dial");
+ init_autoselect_devices(machine, IPT_TRACKBALL_X, IPT_TRACKBALL_Y, 0, OPTION_TRACKBALL_DEVICE, "trackball");
+ init_autoselect_devices(machine, IPT_POSITIONAL, IPT_POSITIONAL_V, 0, OPTION_POSITIONAL_DEVICE, "positional");
+ init_autoselect_devices(machine, IPT_MOUSE_X, IPT_MOUSE_Y, 0, OPTION_MOUSE_DEVICE, "mouse");
/* look for 4-way joysticks and change the default map if we find any */
if (joystick_map_default[0] == 0 || strcmp(joystick_map_default, "auto") == 0)
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->state->joystick != NULL && field->way == 4)
{
@@ -2229,7 +2229,7 @@ static void init_autoselect_devices(running_machine &machine, int type1, int typ
mame_printf_error("Invalid %s value %s; reverting to keyboard\n", option, stemp);
/* only scan the list if we haven't already enabled this class of control */
- if (portlist.first() != NULL && !input_device_class_enabled(portlist.first()->machine, autoenable))
+ if (portlist.first() != NULL && !input_device_class_enabled(portlist.first()->machine(), autoenable))
for (port = portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
@@ -2239,7 +2239,7 @@ static void init_autoselect_devices(running_machine &machine, int type1, int typ
(type3 != 0 && field->type == type3))
{
mame_printf_verbose("Input: Autoenabling %s due to presence of a %s\n", autostring, ananame);
- input_device_class_enable(port->machine, autoenable, TRUE);
+ input_device_class_enable(port->machine(), autoenable, TRUE);
break;
}
}
@@ -2256,7 +2256,7 @@ static device_field_info *init_field_device_info(const input_field_config *field
input_port_value mask;
/* allocate memory */
- info = auto_alloc_clear(field->port->machine, device_field_info);
+ info = auto_alloc_clear(field->port->machine(), device_field_info);
/* fill in the data */
info->field = field;
@@ -2264,7 +2264,7 @@ static device_field_info *init_field_device_info(const input_field_config *field
info->shift++;
if (device_name != NULL)
- info->device = field->port->machine->device(device_name);
+ info->device = field->port->machine().device(device_name);
else
info->device = (device_t *) info;
@@ -2284,7 +2284,7 @@ static analog_field_state *init_field_analog_state(const input_field_config *fie
input_port_value mask;
/* allocate memory */
- state = auto_alloc_clear(field->port->machine, analog_field_state);
+ state = auto_alloc_clear(field->port->machine(), analog_field_state);
/* compute the shift amount and number of bits */
for (mask = field->mask; !(mask & 1); mask >>= 1)
@@ -2459,12 +2459,12 @@ static void frame_update_callback(running_machine &machine)
return;
/* otherwise, use the common code */
- frame_update(&machine);
+ frame_update(machine);
}
-static key_buffer *get_buffer(running_machine *machine)
+static key_buffer *get_buffer(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
assert(inputx_can_post(machine));
return (key_buffer *)portdata->keybuffer;
}
@@ -2489,9 +2489,9 @@ static const inputx_code *find_code(inputx_code *codes, unicode_char ch)
called from core to allow for natural keyboard
-------------------------------------------------*/
-static void input_port_update_hook(running_machine *machine, const input_port_config *port, input_port_value *digital)
+static void input_port_update_hook(running_machine &machine, const input_port_config *port, input_port_value *digital)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const key_buffer *keybuf;
const inputx_code *code;
unicode_char ch;
@@ -2531,12 +2531,12 @@ static void input_port_update_hook(running_machine *machine, const input_port_co
port updating
-------------------------------------------------*/
-static void frame_update(running_machine *machine)
+static void frame_update(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const input_field_config *mouse_field = NULL;
int ui_visible = ui_is_menu_active();
- attotime curtime = machine->time();
+ attotime curtime = machine.time();
const input_port_config *port;
render_target *mouse_target;
INT32 mouse_target_x;
@@ -2567,11 +2567,11 @@ g_profiler.start(PROFILER_INPUT);
input_port_value mask;
float x, y;
if (mouse_target->map_point_input(mouse_target_x, mouse_target_y, tag, mask, x, y))
- mouse_field = input_field_by_tag_and_mask(machine->m_portlist, tag, mask);
+ mouse_field = input_field_by_tag_and_mask(machine.m_portlist, tag, mask);
}
/* loop over all input ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
const input_field_config *field;
device_field_info *device_field;
@@ -2583,7 +2583,7 @@ g_profiler.start(PROFILER_INPUT);
/* now loop back and modify based on the inputs */
for (field = port->fieldlist; field != NULL; field = field->next)
- if (input_condition_true(port->machine, &field->condition))
+ if (input_condition_true(port->machine(), &field->condition))
{
/* accumulate VBLANK bits */
if (field->type == IPT_VBLANK)
@@ -2608,7 +2608,7 @@ g_profiler.start(PROFILER_INPUT);
/* call device line changed handlers */
newvalue = input_port_read_direct(port);
for (device_field = port->state->writedevicelist; device_field; device_field = device_field->next)
- if (device_field->field->type != IPT_OUTPUT && input_condition_true(port->machine, &device_field->field->condition))
+ if (device_field->field->type != IPT_OUTPUT && input_condition_true(port->machine(), &device_field->field->condition))
{
input_port_value newval = (newvalue & device_field->field->mask) >> device_field->shift;
@@ -2632,9 +2632,9 @@ g_profiler.stop();
accumulating the results in a port
-------------------------------------------------*/
-static void frame_update_digital_joysticks(running_machine *machine)
+static void frame_update_digital_joysticks(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
int player, joyindex;
/* loop over all the joysticks */
@@ -2699,7 +2699,7 @@ static void frame_update_digital_joysticks(running_machine *machine)
if ((joystick->current4way & (JOYDIR_UP_BIT | JOYDIR_DOWN_BIT)) &&
(joystick->current4way & (JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT)))
{
- if (machine->rand() & 1)
+ if (machine.rand() & 1)
joystick->current4way &= ~(JOYDIR_LEFT_BIT | JOYDIR_RIGHT_BIT);
else
joystick->current4way &= ~(JOYDIR_UP_BIT | JOYDIR_DOWN_BIT);
@@ -2715,7 +2715,7 @@ static void frame_update_digital_joysticks(running_machine *machine)
internals of a single analog field
-------------------------------------------------*/
-static void frame_update_analog_field(running_machine *machine, analog_field_state *analog)
+static void frame_update_analog_field(running_machine &machine, analog_field_state *analog)
{
input_item_class itemclass;
int keypressed = FALSE;
@@ -2861,7 +2861,7 @@ static void frame_update_analog_field(running_machine *machine, analog_field_sta
static int frame_get_digital_field_state(const input_field_config *field, int mouse_down)
{
- int curstate = mouse_down || input_seq_pressed(field->port->machine, input_field_seq(field, SEQ_TYPE_STANDARD));
+ int curstate = mouse_down || input_seq_pressed(field->port->machine(), input_field_seq(field, SEQ_TYPE_STANDARD));
int changed = FALSE;
/* if the state changed, look for switch down/switch up */
@@ -2871,7 +2871,7 @@ static int frame_get_digital_field_state(const input_field_config *field, int mo
changed = TRUE;
}
- if (field->type == IPT_KEYBOARD && ui_get_use_natural_keyboard(field->port->machine))
+ if (field->type == IPT_KEYBOARD && ui_get_use_natural_keyboard(field->port->machine()))
return FALSE;
/* if this is a switch-down event, handle impulse and toggle */
@@ -2917,7 +2917,7 @@ static int frame_get_digital_field_state(const input_field_config *field, int mo
}
/* skip locked-out coin inputs */
- if (curstate && field->type >= IPT_COIN1 && field->type <= IPT_COIN12 && coin_lockout_get_state(field->port->machine, field->type - IPT_COIN1) && field->port->machine->options().coin_lockout())
+ if (curstate && field->type >= IPT_COIN1 && field->type <= IPT_COIN12 && coin_lockout_get_state(field->port->machine(), field->type - IPT_COIN1) && field->port->machine().options().coin_lockout())
{
ui_popup_time(3, "Coinlock disabled %s.", input_field_name(field));
return FALSE;
@@ -3645,7 +3645,7 @@ input_port_config::input_port_config(const char *_tag)
tag(_tag),
fieldlist(NULL),
state(NULL),
- machine(NULL),
+ m_machine(NULL),
owner(NULL),
active(0)
{
@@ -3941,9 +3941,9 @@ static void diplocation_free(input_field_diplocation **diplocptr)
token to an input field type and player
-------------------------------------------------*/
-static int token_to_input_field_type(running_machine *machine, const char *string, int *player)
+static int token_to_input_field_type(running_machine &machine, const char *string, int *player)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const input_type_desc *typedesc;
int ipnum;
@@ -3970,9 +3970,9 @@ static int token_to_input_field_type(running_machine *machine, const char *strin
field type and player to a string token
-------------------------------------------------*/
-static const char *input_field_type_to_token(running_machine *machine, int type, int player)
+static const char *input_field_type_to_token(running_machine &machine, int type, int player)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate;
static char tempbuf[32];
@@ -4015,9 +4015,9 @@ static int token_to_seq_type(const char *string)
configuration data from the XML nodes
-------------------------------------------------*/
-static void load_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void load_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
xml_data_node *portnode;
int seqtype;
@@ -4090,9 +4090,9 @@ static void load_config_callback(running_machine *machine, int config_type, xml_
global remapping table
-------------------------------------------------*/
-static void load_remap_table(running_machine *machine, xml_data_node *parentnode)
+static void load_remap_table(running_machine &machine, xml_data_node *parentnode)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_code *oldtable, *newtable;
xml_data_node *remapnode;
int count;
@@ -4157,9 +4157,9 @@ static void load_remap_table(running_machine *machine, xml_data_node *parentnode
data to the default mappings
-------------------------------------------------*/
-static int load_default_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
+static int load_default_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate;
int seqtype;
@@ -4182,7 +4182,7 @@ static int load_default_config(running_machine *machine, xml_data_node *portnode
data to the current set of input ports
-------------------------------------------------*/
-static int load_game_config(running_machine *machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
+static int load_game_config(running_machine &machine, xml_data_node *portnode, int type, int player, const input_seq *newseq)
{
input_port_value mask, defvalue;
const input_field_config *field;
@@ -4196,7 +4196,7 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i
defvalue = xml_get_attribute_int(portnode, "defvalue", 0);
/* find the port we want; if no tag, search them all */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
if (tag == NULL || strcmp(get_port_tag(port, tempbuffer), tag) == 0)
for (field = port->fieldlist; field != NULL; field = field->next)
@@ -4246,7 +4246,7 @@ static int load_game_config(running_machine *machine, xml_data_node *portnode, i
saving input port configuration
-------------------------------------------------*/
-static void save_config_callback(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void save_config_callback(running_machine &machine, int config_type, xml_data_node *parentnode)
{
/* if no parentnode, ignore */
if (parentnode == NULL)
@@ -4265,7 +4265,7 @@ static void save_config_callback(running_machine *machine, int config_type, xml_
sequence
-------------------------------------------------*/
-static void save_sequence(running_machine *machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq)
+static void save_sequence(running_machine &machine, xml_data_node *parentnode, int type, int porttype, const input_seq *seq)
{
astring seqstring;
xml_data_node *seqnode;
@@ -4308,9 +4308,9 @@ static int save_this_input_field_type(int type)
mappings that have changed
-------------------------------------------------*/
-static void save_default_inputs(running_machine *machine, xml_data_node *parentnode)
+static void save_default_inputs(running_machine &machine, xml_data_node *parentnode)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
input_type_state *typestate;
/* iterate over ports */
@@ -4352,13 +4352,13 @@ static void save_default_inputs(running_machine *machine, xml_data_node *parentn
mappings that have changed
-------------------------------------------------*/
-static void save_game_inputs(running_machine *machine, xml_data_node *parentnode)
+static void save_game_inputs(running_machine &machine, xml_data_node *parentnode)
{
const input_field_config *field;
const input_port_config *port;
/* iterate over ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (save_this_input_field_type(field->type))
{
@@ -4437,9 +4437,9 @@ static void save_game_inputs(running_machine *machine, xml_data_node *parentnode
from the playback file
-------------------------------------------------*/
-static UINT8 playback_read_uint8(running_machine *machine)
+static UINT8 playback_read_uint8(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT8 result;
/* protect against NULL handles if previous reads fail */
@@ -4463,9 +4463,9 @@ static UINT8 playback_read_uint8(running_machine *machine)
from the playback file
-------------------------------------------------*/
-static UINT32 playback_read_uint32(running_machine *machine)
+static UINT32 playback_read_uint32(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT32 result;
/* protect against NULL handles if previous reads fail */
@@ -4489,9 +4489,9 @@ static UINT32 playback_read_uint32(running_machine *machine)
from the playback file
-------------------------------------------------*/
-static UINT64 playback_read_uint64(running_machine *machine)
+static UINT64 playback_read_uint64(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT64 result;
/* protect against NULL handles if previous reads fail */
@@ -4514,10 +4514,10 @@ static UINT64 playback_read_uint64(running_machine *machine)
playback_init - initialize INP playback
-------------------------------------------------*/
-static time_t playback_init(running_machine *machine)
+static time_t playback_init(running_machine &machine)
{
- const char *filename = machine->options().playback();
- input_port_private *portdata = machine->input_port_data;
+ const char *filename = machine.options().playback();
+ input_port_private *portdata = machine.input_port_data;
UINT8 header[INP_HEADER_SIZE];
time_t basetime;
@@ -4526,7 +4526,7 @@ static time_t playback_init(running_machine *machine)
return 0;
/* open the playback file */
- portdata->playback_file = auto_alloc(machine, emu_file(machine->options().input_directory(), OPEN_FLAG_READ));
+ portdata->playback_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_READ));
file_error filerr = portdata->playback_file->open(filename);
assert_always(filerr == FILERR_NONE, "Failed to open file for playback");
@@ -4547,8 +4547,8 @@ static time_t playback_init(running_machine *machine)
mame_printf_info("Recorded using %s\n", header + 0x20);
/* verify the header against the current game */
- if (memcmp(machine->system().name, header + 0x14, strlen(machine->system().name) + 1) != 0)
- mame_printf_info("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", header + 0x14, machine->system().name);
+ if (memcmp(machine.system().name, header + 0x14, strlen(machine.system().name) + 1) != 0)
+ mame_printf_info("Input file is for " GAMENOUN " '%s', not for current " GAMENOUN " '%s'\n", header + 0x14, machine.system().name);
/* enable compression */
portdata->playback_file->compress(FCOMPRESS_MEDIUM);
@@ -4561,9 +4561,9 @@ static time_t playback_init(running_machine *machine)
playback_end - end INP playback
-------------------------------------------------*/
-static void playback_end(running_machine *machine, const char *message)
+static void playback_end(running_machine &machine, const char *message)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* only applies if we have a live file */
if (portdata->playback_file != NULL)
@@ -4589,9 +4589,9 @@ static void playback_end(running_machine *machine, const char *message)
playback
-------------------------------------------------*/
-static void playback_frame(running_machine *machine, attotime curtime)
+static void playback_frame(running_machine &machine, attotime curtime)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* if playing back, fetch the information and verify */
if (portdata->playback_file != NULL)
@@ -4617,7 +4617,7 @@ static void playback_frame(running_machine *machine, attotime curtime)
static void playback_port(const input_port_config *port)
{
- input_port_private *portdata = port->machine->input_port_data;
+ input_port_private *portdata = port->machine().input_port_data;
/* if playing back, fetch information about this port */
if (portdata->playback_file != NULL)
@@ -4625,19 +4625,19 @@ static void playback_port(const input_port_config *port)
analog_field_state *analog;
/* read the default value and the digital state */
- port->state->defvalue = playback_read_uint32(port->machine);
- port->state->digital = playback_read_uint32(port->machine);
+ port->state->defvalue = playback_read_uint32(port->machine());
+ port->state->digital = playback_read_uint32(port->machine());
/* loop over analog ports and save their data */
for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
{
/* read current and previous values */
- analog->accum = playback_read_uint32(port->machine);
- analog->previous = playback_read_uint32(port->machine);
+ analog->accum = playback_read_uint32(port->machine());
+ analog->previous = playback_read_uint32(port->machine());
/* read configuration information */
- analog->sensitivity = playback_read_uint32(port->machine);
- analog->reverse = playback_read_uint8(port->machine);
+ analog->sensitivity = playback_read_uint32(port->machine());
+ analog->reverse = playback_read_uint8(port->machine());
}
}
}
@@ -4653,9 +4653,9 @@ static void playback_port(const input_port_config *port)
to the record file
-------------------------------------------------*/
-static void record_write_uint8(running_machine *machine, UINT8 data)
+static void record_write_uint8(running_machine &machine, UINT8 data)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT8 result = data;
/* protect against NULL handles if previous reads fail */
@@ -4673,9 +4673,9 @@ static void record_write_uint8(running_machine *machine, UINT8 data)
to the record file
-------------------------------------------------*/
-static void record_write_uint32(running_machine *machine, UINT32 data)
+static void record_write_uint32(running_machine &machine, UINT32 data)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT32 result = LITTLE_ENDIANIZE_INT32(data);
/* protect against NULL handles if previous reads fail */
@@ -4693,9 +4693,9 @@ static void record_write_uint32(running_machine *machine, UINT32 data)
to the record file
-------------------------------------------------*/
-static void record_write_uint64(running_machine *machine, UINT64 data)
+static void record_write_uint64(running_machine &machine, UINT64 data)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
UINT64 result = LITTLE_ENDIANIZE_INT64(data);
/* protect against NULL handles if previous reads fail */
@@ -4712,10 +4712,10 @@ static void record_write_uint64(running_machine *machine, UINT64 data)
record_init - initialize INP recording
-------------------------------------------------*/
-static void record_init(running_machine *machine)
+static void record_init(running_machine &machine)
{
- const char *filename = machine->options().record();
- input_port_private *portdata = machine->input_port_data;
+ const char *filename = machine.options().record();
+ input_port_private *portdata = machine.input_port_data;
UINT8 header[INP_HEADER_SIZE];
system_time systime;
@@ -4724,12 +4724,12 @@ static void record_init(running_machine *machine)
return;
/* open the record file */
- portdata->record_file = auto_alloc(machine, emu_file(machine->options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
+ portdata->record_file = auto_alloc(machine, emu_file(machine.options().input_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
file_error filerr = portdata->record_file->open(filename);
assert_always(filerr == FILERR_NONE, "Failed to open file for recording");
/* get the base time */
- machine->base_datetime(systime);
+ machine.base_datetime(systime);
/* fill in the header */
memset(header, 0, sizeof(header));
@@ -4744,7 +4744,7 @@ static void record_init(running_machine *machine)
header[0x0f] = systime.time >> 56;
header[0x10] = INP_HEADER_MAJVERSION;
header[0x11] = INP_HEADER_MINVERSION;
- strcpy((char *)header + 0x14, machine->system().name);
+ strcpy((char *)header + 0x14, machine.system().name);
sprintf((char *)header + 0x20, APPNAME " %s", build_version);
/* write it */
@@ -4759,9 +4759,9 @@ static void record_init(running_machine *machine)
record_end - end INP recording
-------------------------------------------------*/
-static void record_end(running_machine *machine, const char *message)
+static void record_end(running_machine &machine, const char *message)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* only applies if we have a live file */
if (portdata->record_file != NULL)
@@ -4782,9 +4782,9 @@ static void record_end(running_machine *machine, const char *message)
recording
-------------------------------------------------*/
-static void record_frame(running_machine *machine, attotime curtime)
+static void record_frame(running_machine &machine, attotime curtime)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
/* if recording, record information about the current frame */
if (portdata->record_file != NULL)
@@ -4794,7 +4794,7 @@ static void record_frame(running_machine *machine, attotime curtime)
record_write_uint64(machine, curtime.attoseconds);
/* then the current speed */
- record_write_uint32(machine, machine->video().speed_percent() * (double)(1 << 20));
+ record_write_uint32(machine, machine.video().speed_percent() * (double)(1 << 20));
}
}
@@ -4805,7 +4805,7 @@ static void record_frame(running_machine *machine, attotime curtime)
static void record_port(const input_port_config *port)
{
- input_port_private *portdata = port->machine->input_port_data;
+ input_port_private *portdata = port->machine().input_port_data;
/* if recording, store information about this port */
if (portdata->record_file != NULL)
@@ -4813,29 +4813,29 @@ static void record_port(const input_port_config *port)
analog_field_state *analog;
/* store the default value and digital state */
- record_write_uint32(port->machine, port->state->defvalue);
- record_write_uint32(port->machine, port->state->digital);
+ record_write_uint32(port->machine(), port->state->defvalue);
+ record_write_uint32(port->machine(), port->state->digital);
/* loop over analog ports and save their data */
for (analog = port->state->analoglist; analog != NULL; analog = analog->next)
{
/* store current and previous values */
- record_write_uint32(port->machine, analog->accum);
- record_write_uint32(port->machine, analog->previous);
+ record_write_uint32(port->machine(), analog->accum);
+ record_write_uint32(port->machine(), analog->previous);
/* store configuration information */
- record_write_uint32(port->machine, analog->sensitivity);
- record_write_uint8(port->machine, analog->reverse);
+ record_write_uint32(port->machine(), analog->sensitivity);
+ record_write_uint8(port->machine(), analog->reverse);
}
}
}
-int input_machine_has_keyboard(running_machine *machine)
+int input_machine_has_keyboard(running_machine &machine)
{
int have_keyboard = FALSE;
const input_field_config *field;
const input_port_config *port;
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -4858,7 +4858,7 @@ int input_machine_has_keyboard(running_machine *machine)
given code; used for logging and debugging
-------------------------------------------------*/
-static const char *code_point_string(running_machine *machine, unicode_char ch)
+static const char *code_point_string(running_machine &machine, unicode_char ch)
{
static char buf[16];
const char *result = buf;
@@ -4905,7 +4905,7 @@ static const char *code_point_string(running_machine *machine, unicode_char ch)
sets up natural keyboard input mapping
-------------------------------------------------*/
-static int scan_keys(running_machine *machine, const input_port_config *portconfig, inputx_code *codes, const input_port_config * *ports, const input_field_config * *shift_ports, int keys, int shift)
+static int scan_keys(running_machine &machine, const input_port_config *portconfig, inputx_code *codes, const input_port_config * *ports, const input_field_config * *shift_ports, int keys, int shift)
{
int code_count = 0;
const input_port_config *port;
@@ -4967,7 +4967,7 @@ static int scan_keys(running_machine *machine, const input_port_config *portconf
chars
-------------------------------------------------*/
-static inputx_code *build_codes(running_machine *machine, const input_port_config *portconfig)
+static inputx_code *build_codes(running_machine &machine, const input_port_config *portconfig)
{
inputx_code *codes = NULL;
const input_port_config *ports[NUM_SIMUL_KEYS];
@@ -5045,19 +5045,19 @@ static void clear_keybuffer(running_machine &machine)
-static void setup_keybuffer(running_machine *machine)
+static void setup_keybuffer(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
- portdata->inputx_timer = machine->scheduler().timer_alloc(FUNC(inputx_timerproc));
+ input_port_private *portdata = machine.input_port_data;
+ portdata->inputx_timer = machine.scheduler().timer_alloc(FUNC(inputx_timerproc));
portdata->keybuffer = auto_alloc_clear(machine, key_buffer);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, clear_keybuffer);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, clear_keybuffer);
}
-void inputx_init(running_machine *machine)
+void inputx_init(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
portdata->codes = NULL;
portdata->inputx_timer = NULL;
portdata->queue_chars = NULL;
@@ -5065,7 +5065,7 @@ void inputx_init(running_machine *machine)
portdata->charqueue_empty = NULL;
portdata->keybuffer = NULL;
- if (machine->debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
{
debug_console_register_command(machine, "input", CMDFLAG_NONE, 0, 1, 1, execute_input);
debug_console_register_command(machine, "dumpkbd", CMDFLAG_NONE, 0, 0, 1, execute_dumpkbd);
@@ -5074,7 +5074,7 @@ void inputx_init(running_machine *machine)
/* posting keys directly only makes sense for a computer */
if (input_machine_has_keyboard(machine))
{
- portdata->codes = build_codes(machine, machine->m_portlist.first());
+ portdata->codes = build_codes(machine, machine.m_portlist.first());
setup_keybuffer(machine);
}
}
@@ -5082,27 +5082,27 @@ void inputx_init(running_machine *machine)
void inputx_setup_natural_keyboard(
- running_machine *machine,
- int (*queue_chars)(running_machine *machine, const unicode_char *text, size_t text_len),
- int (*accept_char)(running_machine *machine, unicode_char ch),
- int (*charqueue_empty)(running_machine *machine))
+ running_machine &machine,
+ int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
+ int (*accept_char)(running_machine &machine, unicode_char ch),
+ int (*charqueue_empty)(running_machine &machine))
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
portdata->queue_chars = queue_chars;
portdata->accept_char = accept_char;
portdata->charqueue_empty = charqueue_empty;
}
-int inputx_can_post(running_machine *machine)
+int inputx_can_post(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
return portdata->queue_chars || portdata->codes;
}
-static int can_post_key_directly(running_machine *machine, unicode_char ch)
+static int can_post_key_directly(running_machine &machine, unicode_char ch)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
int rc = FALSE;
const inputx_code *code;
@@ -5121,7 +5121,7 @@ static int can_post_key_directly(running_machine *machine, unicode_char ch)
-static int can_post_key_alternate(running_machine *machine, unicode_char ch)
+static int can_post_key_alternate(running_machine &machine, unicode_char ch)
{
const char *s;
const char_info *ci;
@@ -5173,9 +5173,9 @@ static attotime choose_delay(input_port_private *portdata, unicode_char ch)
-static void internal_post_key(running_machine *machine, unicode_char ch)
+static void internal_post_key(running_machine &machine, unicode_char ch)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
key_buffer *keybuf;
keybuf = get_buffer(machine);
@@ -5193,7 +5193,7 @@ static void internal_post_key(running_machine *machine, unicode_char ch)
-static int buffer_full(running_machine *machine)
+static int buffer_full(running_machine &machine)
{
key_buffer *keybuf;
keybuf = get_buffer(machine);
@@ -5202,9 +5202,9 @@ static int buffer_full(running_machine *machine)
-static void inputx_postn_rate(running_machine *machine, const unicode_char *text, size_t text_len, attotime rate)
+static void inputx_postn_rate(running_machine &machine, const unicode_char *text, size_t text_len, attotime rate)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
int last_cr = 0;
unicode_char ch;
const char *s;
@@ -5264,7 +5264,7 @@ static void inputx_postn_rate(running_machine *machine, const unicode_char *text
static TIMER_CALLBACK(inputx_timerproc)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
key_buffer *keybuf;
attotime delay;
@@ -5305,9 +5305,9 @@ static TIMER_CALLBACK(inputx_timerproc)
}
}
-int inputx_is_posting(running_machine *machine)
+int inputx_is_posting(running_machine &machine)
{
- input_port_private *portdata = machine->input_port_data;
+ input_port_private *portdata = machine.input_port_data;
const key_buffer *keybuf;
keybuf = get_buffer(machine);
return (keybuf->begin_pos != keybuf->end_pos) || (portdata->charqueue_empty && !(*portdata->charqueue_empty)(machine));
@@ -5318,9 +5318,9 @@ int inputx_is_posting(running_machine *machine)
Coded input
***************************************************************************/
-static void inputx_postc_rate(running_machine *machine, unicode_char ch, attotime rate);
+static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate);
-static void inputx_postn_coded_rate(running_machine *machine, const char *text, size_t text_len, attotime rate)
+static void inputx_postn_coded_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
{
size_t i, j, key_len, increment;
unicode_char ch;
@@ -5397,17 +5397,17 @@ static void inputx_postn_coded_rate(running_machine *machine, const char *text,
***************************************************************************/
-static void inputx_postc_rate(running_machine *machine, unicode_char ch, attotime rate)
+static void inputx_postc_rate(running_machine &machine, unicode_char ch, attotime rate)
{
inputx_postn_rate(machine, &ch, 1, rate);
}
-void inputx_postc(running_machine *machine, unicode_char ch)
+void inputx_postc(running_machine &machine, unicode_char ch)
{
inputx_postc_rate(machine, ch, attotime::zero);
}
-static void inputx_postn_utf8_rate(running_machine *machine, const char *text, size_t text_len, attotime rate)
+static void inputx_postn_utf8_rate(running_machine &machine, const char *text, size_t text_len, attotime rate)
{
size_t len = 0;
unicode_char buf[256];
@@ -5435,12 +5435,12 @@ static void inputx_postn_utf8_rate(running_machine *machine, const char *text, s
inputx_postn_rate(machine, buf, len, rate);
}
-void inputx_post_utf8(running_machine *machine, const char *text)
+void inputx_post_utf8(running_machine &machine, const char *text)
{
inputx_postn_utf8_rate(machine, text, strlen(text), attotime::zero);
}
-void inputx_post_utf8_rate(running_machine *machine, const char *text, attotime rate)
+void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate)
{
inputx_postn_utf8_rate(machine, text, strlen(text), rate);
}
@@ -5538,12 +5538,12 @@ int input_player_number(const input_field_config *port)
particular input class is present
-------------------------------------------------*/
-int input_has_input_class(running_machine *machine, int inputclass)
+int input_has_input_class(running_machine &machine, int inputclass)
{
const input_port_config *port;
const input_field_config *field;
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -5561,14 +5561,14 @@ int input_has_input_class(running_machine *machine, int inputclass)
active players
-------------------------------------------------*/
-int input_count_players(running_machine *machine)
+int input_count_players(running_machine &machine)
{
const input_port_config *port;
const input_field_config *field;
int joystick_count;
joystick_count = 0;
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -5589,7 +5589,7 @@ int input_count_players(running_machine *machine)
specific category is active
-------------------------------------------------*/
-int input_category_active(running_machine *machine, int category)
+int input_category_active(running_machine &machine, int category)
{
const input_port_config *port;
const input_field_config *field = NULL;
@@ -5599,7 +5599,7 @@ int input_category_active(running_machine *machine, int category)
assert(category >= 1);
/* loop through the input ports */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
{
for (field = port->fieldlist; field != NULL; field = field->next)
{
@@ -5632,7 +5632,7 @@ int input_category_active(running_machine *machine, int category)
natural keyboard input
-------------------------------------------------*/
-static void execute_input(running_machine *machine, int ref, int params, const char *param[])
+static void execute_input(running_machine &machine, int ref, int params, const char *param[])
{
inputx_postn_coded_rate(machine, param[0], strlen(param[0]), attotime::zero);
}
@@ -5644,9 +5644,9 @@ static void execute_input(running_machine *machine, int ref, int params, const c
keyboard codes
-------------------------------------------------*/
-static void execute_dumpkbd(running_machine *machine, int ref, int params, const char *param[])
+static void execute_dumpkbd(running_machine &machine, int ref, int params, const char *param[])
{
- inputx_code *codes = machine->input_port_data->codes;
+ inputx_code *codes = machine.input_port_data->codes;
const char *filename;
FILE *file = NULL;
const inputx_code *code;
diff --git a/src/emu/inptport.h b/src/emu/inptport.h
index 31d566323fa..7f98c5092d2 100644
--- a/src/emu/inptport.h
+++ b/src/emu/inptport.h
@@ -741,6 +741,7 @@ public:
~input_port_config();
input_port_config *next() const { return m_next; }
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
input_port_config * m_next; /* pointer to next port */
const char * tag; /* pointer to this port's tag */
@@ -748,7 +749,7 @@ public:
/* these fields are only valid if the port is live */
input_port_state * state; /* live state of port (NULL if not live) */
- running_machine * machine; /* machine if port is live */
+ running_machine * m_machine; /* machine if port is live */
device_config * owner; /* associated device, when appropriate */
input_port_value active; /* mask of active bits in the port */
};
@@ -1081,7 +1082,7 @@ struct _inp_header
/* ----- core system management ----- */
/* initialize the input ports, processing the given token list */
-time_t input_port_init(running_machine *machine, const input_port_token *tokens, const device_config_list &devicelist);
+time_t input_port_init(running_machine &machine, const input_port_token *tokens, const device_config_list &devicelist);
@@ -1101,22 +1102,22 @@ const input_field_config *input_field_by_tag_and_mask(const ioport_list &portlis
int input_type_is_analog(int type);
/* return the name for the given type/player */
-const char *input_type_name(running_machine *machine, int type, int player);
+const char *input_type_name(running_machine &machine, int type, int player);
/* return the group for the given type/player */
-int input_type_group(running_machine *machine, int type, int player);
+int input_type_group(running_machine &machine, int type, int player);
/* return the global input mapping sequence for the given type/player */
-const input_seq *input_type_seq(running_machine *machine, int type, int player, input_seq_type seqtype);
+const input_seq *input_type_seq(running_machine &machine, int type, int player, input_seq_type seqtype);
/* change the global input sequence for the given type/player */
-void input_type_set_seq(running_machine *machine, int type, int player, input_seq_type seqtype, const input_seq *newseq);
+void input_type_set_seq(running_machine &machine, int type, int player, input_seq_type seqtype, const input_seq *newseq);
/* return TRUE if the sequence for the given input type/player is pressed */
-int input_type_pressed(running_machine *machine, int type, int player);
+int input_type_pressed(running_machine &machine, int type, int player);
/* return the list of default mappings */
-const input_type_desc *input_type_list(running_machine *machine);
+const input_type_desc *input_type_list(running_machine &machine);
@@ -1153,13 +1154,13 @@ void input_field_select_next_setting(const input_field_config *field);
/* ----- port checking ----- */
/* return whether an input port exists */
-bool input_port_exists(running_machine *machine, const char *tag);
+bool input_port_exists(running_machine &machine, const char *tag);
/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown) */
-input_port_value input_port_active(running_machine *machine, const char *tag);
+input_port_value input_port_active(running_machine &machine, const char *tag);
/* return a bitmask of which bits of an input port are active (i.e. not unused or unknown), or a default value if the port does not exist */
-input_port_value input_port_active_safe(running_machine *machine, const char *tag, input_port_value defvalue);
+input_port_value input_port_active_safe(running_machine &machine, const char *tag, input_port_value defvalue);
/* ----- port reading ----- */
@@ -1168,19 +1169,19 @@ input_port_value input_port_active_safe(running_machine *machine, const char *ta
input_port_value input_port_read_direct(const input_port_config *port);
/* return the value of an input port specified by tag */
-input_port_value input_port_read(running_machine *machine, const char *tag);
+input_port_value input_port_read(running_machine &machine, const char *tag);
/* return the value of a device input port specified by tag */
input_port_value input_port_read(device_t *device, const char *tag);
/* return the value of an input port specified by tag, or a default value if the port does not exist */
-input_port_value input_port_read_safe(running_machine *machine, const char *tag, input_port_value defvalue);
+input_port_value input_port_read_safe(running_machine &machine, const char *tag, input_port_value defvalue);
/* return the extracted crosshair values for the given player */
-int input_port_get_crosshair_position(running_machine *machine, int player, float *x, float *y);
+int input_port_get_crosshair_position(running_machine &machine, int player, float *x, float *y);
/* force an update to the input port values based on current conditions */
-void input_port_update_defaults(running_machine *machine);
+void input_port_update_defaults(running_machine &machine);
@@ -1190,50 +1191,50 @@ void input_port_update_defaults(running_machine *machine);
void input_port_write_direct(const input_port_config *port, input_port_value value, input_port_value mask);
/* write a value to a port specified by tag */
-void input_port_write(running_machine *machine, const char *tag, input_port_value value, input_port_value mask);
+void input_port_write(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
/* write a value to a port, ignore if the port does not exist */
-void input_port_write_safe(running_machine *machine, const char *tag, input_port_value value, input_port_value mask);
+void input_port_write_safe(running_machine &machine, const char *tag, input_port_value value, input_port_value mask);
/* ----- misc helper functions ----- */
/* return the TRUE if the given condition attached is true */
-int input_condition_true(running_machine *machine, const input_condition *condition);
+int input_condition_true(running_machine &machine, const input_condition *condition);
/* convert an input_port_token to a default string */
const char *input_port_string_from_token(const input_port_token token);
/* return TRUE if machine use full keyboard emulation */
-int input_machine_has_keyboard(running_machine *machine);
+int input_machine_has_keyboard(running_machine &machine);
/* these are called by the core; they should not be called from FEs */
-void inputx_init(running_machine *machine);
+void inputx_init(running_machine &machine);
/* called by drivers to setup natural keyboard support */
-void inputx_setup_natural_keyboard(running_machine *machine,
- int (*queue_chars)(running_machine *machine, const unicode_char *text, size_t text_len),
- int (*accept_char)(running_machine *machine, unicode_char ch),
- int (*charqueue_empty)(running_machine *machine));
+void inputx_setup_natural_keyboard(running_machine &machine,
+ int (*queue_chars)(running_machine &machine, const unicode_char *text, size_t text_len),
+ int (*accept_char)(running_machine &machine, unicode_char ch),
+ int (*charqueue_empty)(running_machine &machine));
/* validity checks */
int validate_natural_keyboard_statics(void);
/* these can be called from FEs */
-int inputx_can_post(running_machine *machine);
+int inputx_can_post(running_machine &machine);
/* various posting functions; can be called from FEs */
-void inputx_postc(running_machine *machine, unicode_char ch);
-void inputx_post_utf8(running_machine *machine, const char *text);
-void inputx_post_utf8_rate(running_machine *machine, const char *text, attotime rate);
-int inputx_is_posting(running_machine *machine);
+void inputx_postc(running_machine &machine, unicode_char ch);
+void inputx_post_utf8(running_machine &machine, const char *text);
+void inputx_post_utf8_rate(running_machine &machine, const char *text, attotime rate);
+int inputx_is_posting(running_machine &machine);
/* miscellaneous functions */
int input_classify_port(const input_field_config *field);
-int input_has_input_class(running_machine *machine, int inputclass);
+int input_has_input_class(running_machine &machine, int inputclass);
int input_player_number(const input_field_config *field);
-int input_count_players(running_machine *machine);
-int input_category_active(running_machine *machine, int category);
+int input_count_players(running_machine &machine);
+int input_category_active(running_machine &machine, int category);
#endif /* __INPTPORT_H__ */
diff --git a/src/emu/input.c b/src/emu/input.c
index 40d09320fda..bbe4ea7ad4b 100644
--- a/src/emu/input.c
+++ b/src/emu/input.c
@@ -80,7 +80,9 @@ struct _joystick_map
/* a single input device */
struct _input_device
{
- running_machine * machine; /* machine we are attached to */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* machine we are attached to */
astring name; /* string name of device */
input_device_class devclass; /* class of this device */
int devindex; /* device index of this device */
@@ -421,15 +423,15 @@ const char joystick_map_4way_diagonal[] = "4444s8888..444458888.444555888.ss5.
***************************************************************************/
static void input_frame(running_machine &machine);
-static input_device_item *input_code_item(running_machine *machine, input_code code);
-static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item);
+static input_device_item *input_code_item(running_machine &machine, input_code code);
+static INT32 convert_absolute_value(running_machine &machine, input_code code, input_device_item *item);
static INT32 convert_relative_value(input_code code, input_device_item *item);
-static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item);
-static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result);
+static INT32 convert_switch_value(running_machine &machine, input_code code, input_device_item *item);
+static INT32 apply_deadzone_and_saturation(running_machine &machine, input_code code, INT32 result);
static int joystick_map_parse(const char *mapstring, joystick_map *map);
static void joystick_map_print(const char *header, const char *origstring, const joystick_map *map);
-static void input_code_reset_axes(running_machine *machine);
-static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code);
+static void input_code_reset_axes(running_machine &machine);
+static int input_code_check_axis(running_machine &machine, input_device_item *item, input_code code);
@@ -442,13 +444,13 @@ static int input_code_check_axis(running_machine *machine, input_device_item *it
a pointer to the associated device
-------------------------------------------------*/
-INLINE input_device *input_code_device(running_machine *machine, input_code code)
+INLINE input_device *input_code_device(running_machine &machine, input_code code)
{
/* if the class is valid... */
input_device_class devclass = INPUT_CODE_DEVCLASS(code);
if (devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
/* ...and the index is valid for that class, return a pointer to the device */
int devindex = INPUT_CODE_DEVINDEX(code);
@@ -470,7 +472,7 @@ INLINE input_code device_item_to_code(input_device *device, input_item_id itemid
{
int devindex = device->devindex;
- assert(devindex < device->machine->input_data->device_list[device->devclass].count);
+ assert(devindex < device->machine().input_data->device_list[device->devclass].count);
assert(itemid < ITEM_ID_ABSOLUTE_MAXIMUM);
assert(device->item[itemid] != NULL);
@@ -504,9 +506,9 @@ INLINE input_item_class input_item_standard_class(input_device_class devclass, i
of an input item
-------------------------------------------------*/
-INLINE void input_item_update_value(running_machine *machine, input_device_item *item)
+INLINE void input_item_update_value(running_machine &machine, input_device_item *item)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
item->current = (*item->getstate)(device_list[item->devclass].list[item->devindex]->internal, item->internal);
}
@@ -517,9 +519,9 @@ INLINE void input_item_update_value(running_machine *machine, input_device_item
of memory for pressed switches
-------------------------------------------------*/
-INLINE void code_pressed_memory_reset(running_machine *machine)
+INLINE void code_pressed_memory_reset(running_machine &machine)
{
- input_code *code_pressed_memory = machine->input_data->code_pressed_memory;
+ input_code *code_pressed_memory = machine.input_data->code_pressed_memory;
int memnum;
for (memnum = 0; memnum < MAX_PRESSED_SWITCHES; memnum++)
@@ -570,45 +572,45 @@ INLINE const char *code_to_string(const code_string_table *table, UINT32 code)
input_init - initialize the input lists
-------------------------------------------------*/
-void input_init(running_machine *machine)
+void input_init(running_machine &machine)
{
joystick_map map;
input_private *state;
input_device_list *device_list;
/* remember this machine */
- stashed_machine = machine;
+ stashed_machine = &machine;
/* allocate private memory */
- machine->input_data = state = auto_alloc_clear(machine, input_private);
+ machine.input_data = state = auto_alloc_clear(machine, input_private);
device_list = state->device_list;
/* reset code memory */
code_pressed_memory_reset(machine);
/* request a per-frame callback for bookkeeping */
- machine->add_notifier(MACHINE_NOTIFY_FRAME, input_frame);
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, input_frame);
/* read input enable options */
device_list[DEVICE_CLASS_KEYBOARD].enabled = TRUE;
- device_list[DEVICE_CLASS_MOUSE].enabled = machine->options().mouse();
- device_list[DEVICE_CLASS_LIGHTGUN].enabled = machine->options().lightgun();
- device_list[DEVICE_CLASS_JOYSTICK].enabled = machine->options().joystick();
+ device_list[DEVICE_CLASS_MOUSE].enabled = machine.options().mouse();
+ device_list[DEVICE_CLASS_LIGHTGUN].enabled = machine.options().lightgun();
+ device_list[DEVICE_CLASS_JOYSTICK].enabled = machine.options().joystick();
/* read input device multi options */
- device_list[DEVICE_CLASS_KEYBOARD].multi = machine->options().multi_keyboard();
- device_list[DEVICE_CLASS_MOUSE].multi = machine->options().multi_mouse();
+ device_list[DEVICE_CLASS_KEYBOARD].multi = machine.options().multi_keyboard();
+ device_list[DEVICE_CLASS_MOUSE].multi = machine.options().multi_mouse();
device_list[DEVICE_CLASS_LIGHTGUN].multi = TRUE;
device_list[DEVICE_CLASS_JOYSTICK].multi = TRUE;
/* read other input options */
- state->steadykey_enabled = machine->options().steadykey();
- state->lightgun_reload_button = machine->options().offscreen_reload();
- state->joystick_deadzone = (INT32)(machine->options().joystick_deadzone() * INPUT_ABSOLUTE_MAX);
- state->joystick_saturation = (INT32)(machine->options().joystick_saturation() * INPUT_ABSOLUTE_MAX);
+ state->steadykey_enabled = machine.options().steadykey();
+ state->lightgun_reload_button = machine.options().offscreen_reload();
+ state->joystick_deadzone = (INT32)(machine.options().joystick_deadzone() * INPUT_ABSOLUTE_MAX);
+ state->joystick_saturation = (INT32)(machine.options().joystick_saturation() * INPUT_ABSOLUTE_MAX);
/* get the default joystick map */
- state->joystick_map_default = machine->options().joystick_map();
+ state->joystick_map_default = machine.options().joystick_map();
if (state->joystick_map_default[0] == 0 || strcmp(state->joystick_map_default, "auto") == 0)
state->joystick_map_default = joystick_map_8way;
if (!joystick_map_parse(state->joystick_map_default, &map))
@@ -623,9 +625,9 @@ void input_init(running_machine *machine)
a device class
-------------------------------------------------*/
-void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable)
+void input_device_class_enable(running_machine &machine, input_device_class devclass, UINT8 enable)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
device_list[devclass].enabled = enable;
@@ -637,9 +639,9 @@ void input_device_class_enable(running_machine *machine, input_device_class devc
enabled?
-------------------------------------------------*/
-UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass)
+UINT8 input_device_class_enabled(running_machine &machine, input_device_class devclass)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
assert(devclass > DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
return device_list[devclass].enabled;
@@ -651,9 +653,9 @@ UINT8 input_device_class_enabled(running_machine *machine, input_device_class de
joystick map for a device
-------------------------------------------------*/
-int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring)
+int input_device_set_joystick_map(running_machine &machine, int devindex, const char *mapstring)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
int startindex = devindex;
int stopindex = devindex;
joystick_map map;
@@ -710,7 +712,7 @@ static void input_frame(running_machine &machine)
input_device_item *item = device->item[itemid];
if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
{
- input_item_update_value(&machine, item);
+ input_item_update_value(machine, item);
if ((item->current ^ item->oldkey) & 1)
{
changed = TRUE;
@@ -747,12 +749,12 @@ static void input_frame(running_machine &machine)
input_device_add - add a new input device
-------------------------------------------------*/
-input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal)
+input_device *input_device_add(running_machine &machine, input_device_class devclass, const char *name, void *internal)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
input_device_list *devlist = &state->device_list[devclass];
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call input_device_add at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call input_device_add at init time!");
assert(name != NULL);
assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
@@ -766,7 +768,7 @@ input_device *input_device_add(running_machine *machine, input_device_class devc
devlist->list[devlist->count++] = device;
/* fill in the data */
- device->machine = machine;
+ device->m_machine = &machine;
device->name.cpy(name);
device->devclass = devclass;
device->devindex = devlist->count - 1;
@@ -794,7 +796,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
input_device_item *item;
input_item_id itemid_std = itemid;
- assert_always(device->machine->phase() == MACHINE_PHASE_INIT, "Can only call input_device_item_add at init time!");
+ assert_always(device->machine().phase() == MACHINE_PHASE_INIT, "Can only call input_device_item_add at init time!");
assert(name != NULL);
assert(itemid > ITEM_ID_INVALID && itemid < ITEM_ID_MAXIMUM);
assert(getstate != NULL);
@@ -810,7 +812,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
assert(device->item[itemid] == NULL);
/* allocate a new item and copy data into it */
- item = auto_alloc_clear(device->machine, input_device_item);
+ item = auto_alloc_clear(device->machine(), input_device_item);
device->item[itemid] = item;
device->maxitem = MAX(device->maxitem, itemid);
@@ -848,9 +850,9 @@ void input_device_item_add(input_device *device, const char *name, void *interna
given input code
-------------------------------------------------*/
-INT32 input_code_value(running_machine *machine, input_code code)
+INT32 input_code_value(running_machine &machine, input_code code)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass = INPUT_CODE_DEVCLASS(code);
int startindex = INPUT_CODE_DEVINDEX(code);
int stopindex = startindex;
@@ -918,7 +920,7 @@ exit:
given input code has been pressed
-------------------------------------------------*/
-int input_code_pressed(running_machine *machine, input_code code)
+int input_code_pressed(running_machine &machine, input_code code)
{
return (input_code_value(machine, code) != 0);
}
@@ -930,9 +932,9 @@ int input_code_pressed(running_machine *machine, input_code code)
on since the last call
-------------------------------------------------*/
-int input_code_pressed_once(running_machine *machine, input_code code)
+int input_code_pressed_once(running_machine &machine, input_code code)
{
- input_code *code_pressed_memory = machine->input_data->code_pressed_memory;
+ input_code *code_pressed_memory = machine.input_data->code_pressed_memory;
int curvalue = input_code_pressed(machine, code);
int memnum, empty = -1;
@@ -972,9 +974,9 @@ int input_code_pressed_once(running_machine *machine, input_code code)
an input_item_id to an input_code
-------------------------------------------------*/
-input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid)
+input_code input_code_from_input_item_id(running_machine &machine, input_item_id itemid)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* iterate over device classes and devices */
@@ -999,9 +1001,9 @@ input_code input_code_from_input_item_id(running_machine *machine, input_item_id
input_code_poll_switches - poll for any input
-------------------------------------------------*/
-input_code input_code_poll_switches(running_machine *machine, int reset)
+input_code input_code_poll_switches(running_machine &machine, int reset)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* if resetting memory, do it now */
@@ -1094,9 +1096,9 @@ input_code input_code_poll_switches(running_machine *machine, int reset)
any keyboard-specific input
-------------------------------------------------*/
-input_code input_code_poll_keyboard_switches(running_machine *machine, int reset)
+input_code input_code_poll_keyboard_switches(running_machine &machine, int reset)
{
- input_device_list *devlist = &machine->input_data->device_list[DEVICE_CLASS_KEYBOARD];
+ input_device_list *devlist = &machine.input_data->device_list[DEVICE_CLASS_KEYBOARD];
int devnum;
/* if resetting memory, do it now */
@@ -1132,7 +1134,7 @@ input_code input_code_poll_keyboard_switches(running_machine *machine, int reset
move far enough
-------------------------------------------------*/
-static int input_code_check_axis(running_machine *machine, input_device_item *item, input_code code)
+static int input_code_check_axis(running_machine &machine, input_device_item *item, input_code code)
{
INT32 curval, diff;
@@ -1177,9 +1179,9 @@ static int input_code_check_axis(running_machine *machine, input_device_item *it
input_code_reset_axes - reset axes memory
-------------------------------------------------*/
-static void input_code_reset_axes(running_machine *machine)
+static void input_code_reset_axes(running_machine &machine)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* iterate over device classes and devices */
@@ -1219,9 +1221,9 @@ static void input_code_reset_axes(running_machine *machine)
input_code_poll_axes - poll for any input
-------------------------------------------------*/
-input_code input_code_poll_axes(running_machine *machine, int reset)
+input_code input_code_poll_axes(running_machine &machine, int reset)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_class devclass;
/* if resetting memory, do it now */
@@ -1275,9 +1277,9 @@ input_code input_code_poll_axes(running_machine *machine, int reset)
a friendly name
-------------------------------------------------*/
-astring &input_code_name(running_machine *machine, astring &string, input_code code)
+astring &input_code_name(running_machine &machine, astring &string, input_code code)
{
- input_device_list *device_list = machine->input_data->device_list;
+ input_device_list *device_list = machine.input_data->device_list;
input_device_item *item = input_code_item(machine, code);
const char *devclass;
const char *devcode;
@@ -1335,7 +1337,7 @@ astring &input_code_name(running_machine *machine, astring &string, input_code c
a given code
-------------------------------------------------*/
-astring &input_code_to_token(running_machine *machine, astring &string, input_code code)
+astring &input_code_to_token(running_machine &machine, astring &string, input_code code)
{
input_device_item *item = input_code_item(machine, code);
const char *devclass;
@@ -1390,7 +1392,7 @@ astring &input_code_to_token(running_machine *machine, astring &string, input_co
code from a token
-------------------------------------------------*/
-input_code input_code_from_token(running_machine *machine, const char *_token)
+input_code input_code_from_token(running_machine &machine, const char *_token)
{
UINT32 devclass, itemid, devindex, modifier, standard;
UINT32 itemclass = ITEM_CLASS_INVALID;
@@ -1438,7 +1440,7 @@ input_code input_code_from_token(running_machine *machine, const char *_token)
/* otherwise, keep parsing */
else
{
- input_device_list *device_list = (machine != NULL) ? machine->input_data->device_list : NULL;
+ input_device_list *device_list = machine.input_data->device_list;
input_device *device;
/* if this is an invalid device, we have nothing to look up */
@@ -1510,16 +1512,16 @@ exit:
INT32 debug_global_input_code_pressed(input_code code)
{
- if (!mame_is_valid_machine(stashed_machine))
+ if (!mame_is_valid_machine(*stashed_machine))
return 0;
- return input_code_pressed(stashed_machine, code);
+ return input_code_pressed(*stashed_machine, code);
}
INT32 debug_global_input_code_pressed_once(input_code code)
{
- if (!mame_is_valid_machine(stashed_machine))
+ if (!mame_is_valid_machine(*stashed_machine))
return 0;
- return input_code_pressed_once(stashed_machine, code);
+ return input_code_pressed_once(*stashed_machine, code);
}
/***************************************************************************
@@ -1531,7 +1533,7 @@ INT32 debug_global_input_code_pressed_once(input_code code)
from the code
-------------------------------------------------*/
-static input_device_item *input_code_item(running_machine *machine, input_code code)
+static input_device_item *input_code_item(running_machine &machine, input_code code)
{
input_device *device = input_code_device(machine, code);
input_item_id itemid;
@@ -1555,9 +1557,9 @@ static input_device_item *input_code_item(running_machine *machine, input_code c
value into the class specified by code
-------------------------------------------------*/
-static INT32 convert_absolute_value(running_machine *machine, input_code code, input_device_item *item)
+static INT32 convert_absolute_value(running_machine &machine, input_code code, input_device_item *item)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
/* make sure values are valid */
assert(item->current >= INPUT_ABSOLUTE_MIN && item->current <= INPUT_ABSOLUTE_MAX);
@@ -1679,9 +1681,9 @@ static INT32 convert_relative_value(input_code code, input_device_item *item)
value into the class specified by code
-------------------------------------------------*/
-static INT32 convert_switch_value(running_machine *machine, input_code code, input_device_item *item)
+static INT32 convert_switch_value(running_machine &machine, input_code code, input_device_item *item)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
/* only a switch is supported */
if (INPUT_CODE_ITEMCLASS(code) == ITEM_CLASS_SWITCH)
@@ -1723,9 +1725,9 @@ static INT32 convert_switch_value(running_machine *machine, input_code code, inp
absolute value
-------------------------------------------------*/
-static INT32 apply_deadzone_and_saturation(running_machine *machine, input_code code, INT32 result)
+static INT32 apply_deadzone_and_saturation(running_machine &machine, input_code code, INT32 result)
{
- input_private *state = machine->input_data;
+ input_private *state = machine.input_data;
int negative = FALSE;
/* ignore if not a joystick */
diff --git a/src/emu/input.h b/src/emu/input.h
index b7af5498352..ecbd66d0d49 100644
--- a/src/emu/input.h
+++ b/src/emu/input.h
@@ -582,22 +582,22 @@ extern const char joystick_map_4way_diagonal[];
/* ----- initialization and configuration ----- */
/* core initialization, prior to calling osd_init() */
-void input_init(running_machine *machine);
+void input_init(running_machine &machine);
/* enable or disable a device class */
-void input_device_class_enable(running_machine *machine, input_device_class devclass, UINT8 enable);
+void input_device_class_enable(running_machine &machine, input_device_class devclass, UINT8 enable);
/* is a device class enabled? */
-UINT8 input_device_class_enabled(running_machine *machine, input_device_class devclass);
+UINT8 input_device_class_enabled(running_machine &machine, input_device_class devclass);
/* configure default joystick maps */
-int input_device_set_joystick_map(running_machine *machine, int devindex, const char *mapstring);
+int input_device_set_joystick_map(running_machine &machine, int devindex, const char *mapstring);
/* ----- OSD configuration and access ----- */
/* add a new input device */
-input_device *input_device_add(running_machine *machine, input_device_class devclass, const char *name, void *internal);
+input_device *input_device_add(running_machine &machine, input_device_class devclass, const char *name, void *internal);
/* add a new item to an input device */
void input_device_item_add(input_device *device, const char *name, void *internal, input_item_id itemid, item_get_state_func getstate);
@@ -607,38 +607,38 @@ void input_device_item_add(input_device *device, const char *name, void *interna
/* ----- state queries ----- */
/* return the value of a particular input code */
-INT32 input_code_value(running_machine *machine, input_code code);
+INT32 input_code_value(running_machine &machine, input_code code);
/* return TRUE if the given input code has been pressed */
-INT32 input_code_pressed(running_machine *machine, input_code code);
+INT32 input_code_pressed(running_machine &machine, input_code code);
/* same as above, but returns TRUE only on the first call after an off->on transition */
-INT32 input_code_pressed_once(running_machine *machine, input_code code);
+INT32 input_code_pressed_once(running_machine &machine, input_code code);
/* translates an input_item_id to an input_code */
-input_code input_code_from_input_item_id(running_machine *machine, input_item_id itemid);
+input_code input_code_from_input_item_id(running_machine &machine, input_item_id itemid);
/* poll for any switch input, optionally resetting internal memory */
-input_code input_code_poll_switches(running_machine *machine, int reset);
+input_code input_code_poll_switches(running_machine &machine, int reset);
/* poll for any keyboard switch input, optionally resetting internal memory */
-input_code input_code_poll_keyboard_switches(running_machine *machine, int reset);
+input_code input_code_poll_keyboard_switches(running_machine &machine, int reset);
/* poll for any axis input, optionally resetting internal memory */
-input_code input_code_poll_axes(running_machine *machine, int reset);
+input_code input_code_poll_axes(running_machine &machine, int reset);
/* ----- strings and tokenization ----- */
/* generate the friendly name of an input code, returning the length (buffer can be NULL) */
-astring &input_code_name(running_machine *machine, astring &buffer, input_code code);
+astring &input_code_name(running_machine &machine, astring &buffer, input_code code);
/* convert an input code to a token, returning the length (buffer can be NULL) */
-astring &input_code_to_token(running_machine *machine, astring &buffer, input_code code);
+astring &input_code_to_token(running_machine &machine, astring &buffer, input_code code);
/* convert a token back to an input code */
-input_code input_code_from_token(running_machine *machine, const char *_token);
+input_code input_code_from_token(running_machine &machine, const char *_token);
diff --git a/src/emu/inputseq.c b/src/emu/inputseq.c
index 972e4c4f149..6b54596a983 100644
--- a/src/emu/inputseq.c
+++ b/src/emu/inputseq.c
@@ -132,7 +132,7 @@ INLINE void input_seq_backspace(input_seq *seq)
sequence of switch inputs is "pressed"
-------------------------------------------------*/
-int input_seq_pressed(running_machine *machine, const input_seq *seq)
+int input_seq_pressed(running_machine &machine, const input_seq *seq)
{
int result = FALSE;
int invert = FALSE;
@@ -187,7 +187,7 @@ int input_seq_pressed(running_machine *machine, const input_seq *seq)
axis defined in an input sequence
-------------------------------------------------*/
-INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr)
+INT32 input_seq_axis_value(running_machine &machine, const input_seq *seq, input_item_class *itemclass_ptr)
{
input_item_class itemclasszero = ITEM_CLASS_ABSOLUTE;
input_item_class itemclass = ITEM_CLASS_INVALID;
@@ -278,7 +278,7 @@ INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input
new sequence of the given itemclass
-------------------------------------------------*/
-void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq)
+void input_seq_poll_start(running_machine &machine, input_item_class itemclass, const input_seq *startseq)
{
input_code dummycode;
@@ -309,7 +309,7 @@ void input_seq_poll_start(running_machine *machine, input_item_class itemclass,
input_seq_poll - continue polling
-------------------------------------------------*/
-int input_seq_poll(running_machine *machine, input_seq *finalseq)
+int input_seq_poll(running_machine &machine, input_seq *finalseq)
{
input_code lastcode = input_seq_get_last(&record_seq);
int has_or = FALSE;
@@ -406,7 +406,7 @@ int input_seq_poll(running_machine *machine, input_seq *finalseq)
of a sequence
-------------------------------------------------*/
-astring &input_seq_name(running_machine *machine, astring &string, const input_seq *seq)
+astring &input_seq_name(running_machine &machine, astring &string, const input_seq *seq)
{
astring codestr;
int codenum, copycodenum;
@@ -464,7 +464,7 @@ astring &input_seq_name(running_machine *machine, astring &string, const input_s
form of a sequence
-------------------------------------------------*/
-astring &input_seq_to_tokens(running_machine *machine, astring &string, const input_seq *seq)
+astring &input_seq_to_tokens(running_machine &machine, astring &string, const input_seq *seq)
{
astring codestr;
int codenum;
@@ -503,7 +503,7 @@ astring &input_seq_to_tokens(running_machine *machine, astring &string, const in
form of a sequence
-------------------------------------------------*/
-int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq)
+int input_seq_from_tokens(running_machine &machine, const char *string, input_seq *seq)
{
char *strcopy = auto_alloc_array(machine, char, strlen(string) + 1);
char *str = strcopy;
diff --git a/src/emu/inputseq.h b/src/emu/inputseq.h
index aa1f65f841d..d0d344ee12d 100644
--- a/src/emu/inputseq.h
+++ b/src/emu/inputseq.h
@@ -71,33 +71,33 @@ struct _input_seq
/* ----- state queries ----- */
/* return TRUE if the given switch sequence has been pressed */
-int input_seq_pressed(running_machine *machine, const input_seq *seq);
+int input_seq_pressed(running_machine &machine, const input_seq *seq);
/* return the value of an axis sequence */
-INT32 input_seq_axis_value(running_machine *machine, const input_seq *seq, input_item_class *itemclass_ptr);
+INT32 input_seq_axis_value(running_machine &machine, const input_seq *seq, input_item_class *itemclass_ptr);
/* ----- sequence polling ----- */
/* begin polling for a new sequence of the given itemclass */
-void input_seq_poll_start(running_machine *machine, input_item_class itemclass, const input_seq *startseq);
+void input_seq_poll_start(running_machine &machine, input_item_class itemclass, const input_seq *startseq);
/* continue polling for a sequence */
-int input_seq_poll(running_machine *machine, input_seq *finalseq);
+int input_seq_poll(running_machine &machine, input_seq *finalseq);
/* ----- strings and tokenization ----- */
/* generate the friendly name of an input sequence */
-astring &input_seq_name(running_machine *machine, astring &string, const input_seq *seq);
+astring &input_seq_name(running_machine &machine, astring &string, const input_seq *seq);
/* convert an input sequence to tokens, returning the length */
-astring &input_seq_to_tokens(running_machine *machine, astring &string, const input_seq *seq);
+astring &input_seq_to_tokens(running_machine &machine, astring &string, const input_seq *seq);
/* convert a set of tokens back to an input sequence */
-int input_seq_from_tokens(running_machine *machine, const char *string, input_seq *seq);
+int input_seq_from_tokens(running_machine &machine, const char *string, input_seq *seq);
diff --git a/src/emu/machine.c b/src/emu/machine.c
index 2ea6772b10a..31dcc31ca5c 100644
--- a/src/emu/machine.c
+++ b/src/emu/machine.c
@@ -258,13 +258,13 @@ const char *running_machine::describe_context()
void running_machine::start()
{
// initialize basic can't-fail systems here
- config_init(this);
- input_init(this);
- output_init(this);
- palette_init(this);
- m_render = auto_alloc(this, render_manager(*this));
- generic_machine_init(this);
- generic_sound_init(this);
+ config_init(*this);
+ input_init(*this);
+ output_init(*this);
+ palette_init(*this);
+ m_render = auto_alloc(*this, render_manager(*this));
+ generic_machine_init(*this);
+ generic_sound_init(*this);
// allocate a soft_reset timer
m_soft_reset_timer = m_scheduler.timer_alloc(MSTUB(timer_expired, running_machine, soft_reset), this);
@@ -273,8 +273,8 @@ void running_machine::start()
m_osd.init(*this);
// create the video manager
- m_video = auto_alloc(this, video_manager(*this));
- ui_init(this);
+ m_video = auto_alloc(*this, video_manager(*this));
+ ui_init(*this);
// initialize the base time (needed for doing record/playback)
::time(&m_base_time);
@@ -282,44 +282,44 @@ void running_machine::start()
// initialize the input system and input ports for the game
// this must be done before memory_init in order to allow specifying
// callbacks based on input port tags
- time_t newbase = input_port_init(this, m_system.ipt, m_config.m_devicelist);
+ time_t newbase = input_port_init(*this, m_system.ipt, m_config.m_devicelist);
if (newbase != 0)
m_base_time = newbase;
// intialize UI input
- ui_input_init(this);
+ ui_input_init(*this);
// initialize the streams engine before the sound devices start
- m_sound = auto_alloc(this, sound_manager(*this));
+ m_sound = auto_alloc(*this, sound_manager(*this));
// first load ROMs, then populate memory, and finally initialize CPUs
// these operations must proceed in this order
- rom_init(this);
- memory_init(this);
- watchdog_init(this);
+ rom_init(*this);
+ memory_init(*this);
+ watchdog_init(*this);
// must happen after memory_init because this relies on generic.spriteram
- generic_video_init(this);
+ generic_video_init(*this);
// allocate the gfx elements prior to device initialization
- gfx_init(this);
+ gfx_init(*this);
// initialize natural keyboard support
- inputx_init(this);
+ inputx_init(*this);
// initialize image devices
- image_init(this);
- tilemap_init(this);
- crosshair_init(this);
+ image_init(*this);
+ tilemap_init(*this);
+ crosshair_init(*this);
// initialize the debugger
if ((debug_flags & DEBUG_FLAG_ENABLED) != 0)
- debugger_init(this);
+ debugger_init(*this);
// call the game driver's init function
// this is where decryption is done and memory maps are altered
// so this location in the init order is important
- ui_set_startup_text(this, "Initializing...", true);
+ ui_set_startup_text(*this, "Initializing...", true);
// start up the devices
m_devicelist.start_all();
@@ -334,7 +334,7 @@ void running_machine::start()
schedule_load("auto");
// set up the cheat engine
- m_cheat = auto_alloc(this, cheat_manager(*this));
+ m_cheat = auto_alloc(*this, cheat_manager(*this));
// disallow save state registrations starting here
m_state.allow_registration(false);
@@ -358,7 +358,7 @@ int running_machine::run(bool firstrun)
// if we have a logfile, set up the callback
if (options().log())
{
- m_logfile = auto_alloc(this, emu_file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
+ m_logfile = auto_alloc(*this, emu_file(OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
file_error filerr = m_logfile->open("error.log");
assert_always(filerr == FILERR_NONE, "unable to open log file");
add_logerror_callback(logfile_callback);
@@ -368,12 +368,12 @@ int running_machine::run(bool firstrun)
start();
// load the configuration settings and NVRAM
- bool settingsloaded = config_load_settings(this);
- nvram_load(this);
+ bool settingsloaded = config_load_settings(*this);
+ nvram_load(*this);
sound().ui_mute(false);
// display the startup screens
- ui_display_startup_screens(this, firstrun, !settingsloaded);
+ ui_display_startup_screens(*this, firstrun, !settingsloaded);
// perform a soft reset -- this takes us to the running phase
soft_reset(*this);
@@ -404,8 +404,8 @@ int running_machine::run(bool firstrun)
// save the NVRAM and configuration
sound().ui_mute(true);
- nvram_save(this);
- config_save_settings(this);
+ nvram_save(*this);
+ config_save_settings(*this);
}
catch (emu_fatalerror &fatal)
{
@@ -430,7 +430,7 @@ int running_machine::run(bool firstrun)
zip_file_cache_clear();
// close the logfile
- auto_free(this, m_logfile);
+ auto_free(*this, m_logfile);
return error;
}
@@ -445,7 +445,7 @@ void running_machine::schedule_exit()
if (m_exit_to_game_select && options().system_name()[0] != 0)
{
options().set_system_name("");
- ui_menu_force_game_select(this, &render().ui_container());
+ ui_menu_force_game_select(*this, &render().ui_container());
}
// otherwise, exit for real
@@ -610,7 +610,7 @@ memory_region *running_machine::region_alloc(const char *name, UINT32 length, UI
fatalerror("region_alloc called with duplicate region name \"%s\"\n", name);
// allocate the region
- return &m_regionlist.append(name, *auto_alloc(this, memory_region(*this, name, length, width, endian)));
+ return &m_regionlist.append(name, *auto_alloc(*this, memory_region(*this, name, length, width, endian)));
}
@@ -651,7 +651,7 @@ void running_machine::add_notifier(machine_notification event, notify_callback c
void running_machine::add_logerror_callback(logerror_callback callback)
{
assert_always(m_current_phase == MACHINE_PHASE_INIT, "Can only call add_logerror_callback at init time!");
- m_logerror_list.append(*auto_alloc(this, logerror_callback_item(callback)));
+ m_logerror_list.append(*auto_alloc(*this, logerror_callback_item(callback)));
}
@@ -877,7 +877,7 @@ memory_region::memory_region(running_machine &machine, const char *name, UINT32
m_endianness(endian)
{
assert(width == 1 || width == 2 || width == 4 || width == 8);
- m_base.u8 = auto_alloc_array(&machine, UINT8, length);
+ m_base.u8 = auto_alloc_array(machine, UINT8, length);
}
@@ -887,7 +887,7 @@ memory_region::memory_region(running_machine &machine, const char *name, UINT32
memory_region::~memory_region()
{
- auto_free(&m_machine, m_base.v);
+ auto_free(m_machine, m_base.v);
}
@@ -1026,7 +1026,7 @@ void driver_device::driver_start()
void driver_device::machine_start()
{
if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_START])(m_machine);
}
@@ -1038,7 +1038,7 @@ void driver_device::machine_start()
void driver_device::sound_start()
{
if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_START])(m_machine);
}
@@ -1050,7 +1050,7 @@ void driver_device::sound_start()
void driver_device::video_start()
{
if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_START])(m_machine);
}
@@ -1072,7 +1072,7 @@ void driver_device::driver_reset()
void driver_device::machine_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_MACHINE_RESET])(m_machine);
}
@@ -1084,7 +1084,7 @@ void driver_device::machine_reset()
void driver_device::sound_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_SOUND_RESET])(m_machine);
}
@@ -1096,7 +1096,7 @@ void driver_device::sound_reset()
void driver_device::video_reset()
{
if (m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET] != NULL)
- (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(&m_machine);
+ (*m_config.m_callbacks[driver_device_config_base::CB_VIDEO_RESET])(m_machine);
}
@@ -1134,14 +1134,14 @@ void driver_device::device_start()
// call the game-specific init
if (m_config.m_system->driver_init != NULL)
- (*m_config.m_system->driver_init)(&m_machine);
+ (*m_config.m_system->driver_init)(m_machine);
// finish image devices init process
- image_postdevice_init(&m_machine);
+ image_postdevice_init(m_machine);
// call palette_init if present
if (m_config.m_palette_init != NULL)
- (*m_config.m_palette_init)(&m_machine, machine->region("proms")->base());
+ (*m_config.m_palette_init)(m_machine, m_machine.region("proms")->base());
// start the various pieces
driver_start();
diff --git a/src/emu/machine.h b/src/emu/machine.h
index 775b416cf85..6caff360b51 100644
--- a/src/emu/machine.h
+++ b/src/emu/machine.h
@@ -112,31 +112,31 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled
// macros to wrap legacy callbacks
#define MACHINE_START_NAME(name) machine_start_##name
-#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine *machine)
+#define MACHINE_START(name) void MACHINE_START_NAME(name)(running_machine &machine)
#define MACHINE_START_CALL(name) MACHINE_START_NAME(name)(machine)
#define MACHINE_RESET_NAME(name) machine_reset_##name
-#define MACHINE_RESET(name) void MACHINE_RESET_NAME(name)(running_machine *machine)
+#define MACHINE_RESET(name) void MACHINE_RESET_NAME(name)(running_machine &machine)
#define MACHINE_RESET_CALL(name) MACHINE_RESET_NAME(name)(machine)
#define SOUND_START_NAME(name) sound_start_##name
-#define SOUND_START(name) void SOUND_START_NAME(name)(running_machine *machine)
+#define SOUND_START(name) void SOUND_START_NAME(name)(running_machine &machine)
#define SOUND_START_CALL(name) SOUND_START_NAME(name)(machine)
#define SOUND_RESET_NAME(name) sound_reset_##name
-#define SOUND_RESET(name) void SOUND_RESET_NAME(name)(running_machine *machine)
+#define SOUND_RESET(name) void SOUND_RESET_NAME(name)(running_machine &machine)
#define SOUND_RESET_CALL(name) SOUND_RESET_NAME(name)(machine)
#define VIDEO_START_NAME(name) video_start_##name
-#define VIDEO_START(name) void VIDEO_START_NAME(name)(running_machine *machine)
+#define VIDEO_START(name) void VIDEO_START_NAME(name)(running_machine &machine)
#define VIDEO_START_CALL(name) VIDEO_START_NAME(name)(machine)
#define VIDEO_RESET_NAME(name) video_reset_##name
-#define VIDEO_RESET(name) void VIDEO_RESET_NAME(name)(running_machine *machine)
+#define VIDEO_RESET(name) void VIDEO_RESET_NAME(name)(running_machine &machine)
#define VIDEO_RESET_CALL(name) VIDEO_RESET_NAME(name)(machine)
#define PALETTE_INIT_NAME(name) palette_init_##name
-#define PALETTE_INIT(name) void PALETTE_INIT_NAME(name)(running_machine *machine, const UINT8 *color_prom)
+#define PALETTE_INIT(name) void PALETTE_INIT_NAME(name)(running_machine &machine, const UINT8 *color_prom)
#define PALETTE_INIT_CALL(name) PALETTE_INIT_NAME(name)(machine, color_prom)
@@ -153,11 +153,11 @@ const int DEBUG_FLAG_OSD_ENABLED = 0x00001000; // The OSD debugger is enabled
// global allocation helpers
-#define auto_alloc(m, t) pool_alloc(static_cast<running_machine *>(m)->respool(), t)
-#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine *>(m)->respool(), t)
-#define auto_alloc_array(m, t, c) pool_alloc_array(static_cast<running_machine *>(m)->respool(), t, c)
-#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine *>(m)->respool(), t, c)
-#define auto_free(m, v) pool_free(static_cast<running_machine *>(m)->respool(), v)
+#define auto_alloc(m, t) pool_alloc(static_cast<running_machine &>(m).respool(), t)
+#define auto_alloc_clear(m, t) pool_alloc_clear(static_cast<running_machine &>(m).respool(), t)
+#define auto_alloc_array(m, t, c) pool_alloc_array(static_cast<running_machine &>(m).respool(), t, c)
+#define auto_alloc_array_clear(m, t, c) pool_alloc_array_clear(static_cast<running_machine &>(m).respool(), t, c)
+#define auto_free(m, v) pool_free(static_cast<running_machine &>(m).respool(), v)
#define auto_bitmap_alloc(m, w, h, f) auto_alloc(m, bitmap_t(w, h, f))
#define auto_strdup(m, s) strcpy(auto_alloc_array(m, char, strlen(s) + 1), s)
@@ -197,8 +197,8 @@ typedef tagged_list<memory_region> region_list;
// legacy callback functions
-typedef void (*legacy_callback_func)(running_machine *machine);
-typedef void (*palette_init_func)(running_machine *machine, const UINT8 *color_prom);
+typedef void (*legacy_callback_func)(running_machine &machine);
+typedef void (*palette_init_func)(running_machine &machine, const UINT8 *color_prom);
@@ -315,7 +315,7 @@ class running_machine : public bindable_object
{
DISABLE_COPYING(running_machine);
- friend void debugger_init(running_machine *machine);
+ friend void debugger_init(running_machine &machine);
friend class sound_manager;
typedef void (*notify_callback)(running_machine &machine);
@@ -596,7 +596,7 @@ public:
{
// we clear here for historical reasons, as many existing driver states
// assume everything is NULL before starting
- return auto_alloc_clear(&machine, _DeviceClass(machine, *this));
+ return auto_alloc_clear(machine, _DeviceClass(machine, *this));
}
};
diff --git a/src/emu/machine/53c810.c b/src/emu/machine/53c810.c
index 2dcc0f938eb..caaf32460b5 100644
--- a/src/emu/machine/53c810.c
+++ b/src/emu/machine/53c810.c
@@ -42,15 +42,15 @@ static struct {
int halted;
int carry;
UINT32 (* fetch)(UINT32 dsp);
- void (* irq_callback)(running_machine *machine);
+ void (* irq_callback)(running_machine &machine);
void (* dma_callback)(UINT32, UINT32, int, int);
} lsi810;
-typedef void (*opcode_handler)(running_machine *machine);
-#define OPCODE_HANDLER(name) void name(running_machine *machine)
+typedef void (*opcode_handler)(running_machine &machine);
+#define OPCODE_HANDLER(name) void name(running_machine &machine)
static opcode_handler dma_opcode[256];
-INLINE UINT32 FETCH(running_machine *machine)
+INLINE UINT32 FETCH(running_machine &machine)
{
UINT32 r = intf->fetch(machine, lsi810.dsp);
lsi810.dsp += 4;
@@ -340,7 +340,7 @@ static int scripts_compute_branch(void)
return passed;
}
-static UINT32 scripts_get_jump_dest(running_machine *machine)
+static UINT32 scripts_get_jump_dest(running_machine &machine)
{
INT32 dsps;
UINT32 dest;
@@ -421,7 +421,7 @@ static OPCODE_HANDLER( dmaop_load )
-static void dma_exec(running_machine *machine)
+static void dma_exec(running_machine &machine)
{
lsi810.dma_icount = DMA_MAX_ICOUNT;
@@ -484,7 +484,7 @@ READ8_HANDLER( lsi53c810_reg_r )
// clear the interrupt on service
if(intf->irq_callback != NULL)
{
- intf->irq_callback(space->machine, 0);
+ intf->irq_callback(space->machine(), 0);
}
return lsi810.istat;
@@ -599,7 +599,7 @@ WRITE8_HANDLER( lsi53c810_reg_w )
lsi810.dsp |= data << 24;
lsi810.halted = 0;
if((lsi810.dmode & 0x1) == 0 && !lsi810.halted) {
- dma_exec(space->machine);
+ dma_exec(space->machine());
}
break;
case 0x34: /* SCRATCH A */
@@ -620,19 +620,19 @@ WRITE8_HANDLER( lsi53c810_reg_w )
if(lsi810.dcntl & 0x14 && !lsi810.halted) /* single-step & start DMA */
{
int op;
- lsi810.dcmd = FETCH(space->machine);
+ lsi810.dcmd = FETCH(space->machine());
op = (lsi810.dcmd >> 24) & 0xff;
- dma_opcode[op](space->machine);
+ dma_opcode[op](space->machine());
lsi810.istat |= 0x3; /* DMA interrupt pending */
lsi810.dstat |= 0x8; /* SSI (Single Step Interrupt) */
if(intf->irq_callback != NULL) {
- intf->irq_callback(space->machine, 1);
+ intf->irq_callback(space->machine(), 1);
}
}
else if(lsi810.dcntl & 0x04 && !lsi810.halted) /* manual start DMA */
{
- dma_exec(space->machine);
+ dma_exec(space->machine());
}
break;
case 0x40: /* SIEN0 */
@@ -672,7 +672,7 @@ static void add_opcode(UINT8 op, UINT8 mask, opcode_handler handler)
}
}
-void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface)
+void lsi53c810_init(running_machine &machine, const struct LSI53C810interface *interface)
{
int i;
@@ -766,12 +766,12 @@ void *lsi53c810_get_device(int id)
*
*************************************/
-static UINT32 lsi53c810_dasm_fetch(running_machine *machine, UINT32 pc)
+static UINT32 lsi53c810_dasm_fetch(running_machine &machine, UINT32 pc)
{
return intf->fetch(machine, pc);
}
-unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc)
+unsigned lsi53c810_dasm(running_machine &machine, char *buf, UINT32 pc)
{
unsigned result = 0;
const char *op_mnemonic = NULL;
diff --git a/src/emu/machine/53c810.h b/src/emu/machine/53c810.h
index 1d3b80772b3..3c49d8d0f15 100644
--- a/src/emu/machine/53c810.h
+++ b/src/emu/machine/53c810.h
@@ -6,12 +6,12 @@
struct LSI53C810interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
- void (*irq_callback)(running_machine *machine, int); /* IRQ callback */
- void (*dma_callback)(running_machine *machine, UINT32, UINT32, int, int); /* DMA callback */
- UINT32 (*fetch)(running_machine *machine, UINT32 dsp);
+ void (*irq_callback)(running_machine &machine, int); /* IRQ callback */
+ void (*dma_callback)(running_machine &machine, UINT32, UINT32, int, int); /* DMA callback */
+ UINT32 (*fetch)(running_machine &machine, UINT32 dsp);
};
-extern void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface);
+extern void lsi53c810_init(running_machine &machine, const struct LSI53C810interface *interface);
extern void lsi53c810_exit(const struct LSI53C810interface *interface);
extern void lsi53c810_read_data(int bytes, UINT8 *pData);
@@ -22,6 +22,6 @@ extern void *lsi53c810_get_device(int id);
READ8_HANDLER( lsi53c810_reg_r );
WRITE8_HANDLER( lsi53c810_reg_w );
-unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc);
+unsigned lsi53c810_dasm(running_machine &machine, char *buf, UINT32 pc);
#endif
diff --git a/src/emu/machine/6526cia.c b/src/emu/machine/6526cia.c
index a90652efded..00d74718e59 100644
--- a/src/emu/machine/6526cia.c
+++ b/src/emu/machine/6526cia.c
@@ -72,7 +72,7 @@ device_config *mos6526_device_config::static_alloc_device_config(const machine_c
device_t *mos6526_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, mos6526_device(machine, *this));
+ return auto_alloc(machine, mos6526_device(machine, *this));
}
diff --git a/src/emu/machine/6532riot.c b/src/emu/machine/6532riot.c
index 63437a2dfa5..426277e8e06 100644
--- a/src/emu/machine/6532riot.c
+++ b/src/emu/machine/6532riot.c
@@ -70,7 +70,7 @@ device_config *riot6532_device_config::static_alloc_device_config(const machine_
device_t *riot6532_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, riot6532_device(machine, *this));
+ return auto_alloc(machine, riot6532_device(machine, *this));
}
diff --git a/src/emu/machine/6821pia.c b/src/emu/machine/6821pia.c
index 03afe7986c2..94181f76459 100644
--- a/src/emu/machine/6821pia.c
+++ b/src/emu/machine/6821pia.c
@@ -66,7 +66,7 @@ device_config *pia6821_device_config::static_alloc_device_config(const machine_c
device_t *pia6821_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, pia6821_device(machine, *this));
+ return auto_alloc(machine, pia6821_device(machine, *this));
}
diff --git a/src/emu/machine/68681.c b/src/emu/machine/68681.c
index f12b48dc192..a053f1e432c 100644
--- a/src/emu/machine/68681.c
+++ b/src/emu/machine/68681.c
@@ -541,14 +541,14 @@ READ8_DEVICE_HANDLER(duart68681_r)
{
r = 0xff;
#if 0
- if (input_code_pressed(device->machine, KEYCODE_1)) r ^= 0x0001;
- if (input_code_pressed(device->machine, KEYCODE_2)) r ^= 0x0002;
- if (input_code_pressed(device->machine, KEYCODE_3)) r ^= 0x0004;
- if (input_code_pressed(device->machine, KEYCODE_4)) r ^= 0x0008;
- if (input_code_pressed(device->machine, KEYCODE_5)) r ^= 0x0010;
- if (input_code_pressed(device->machine, KEYCODE_6)) r ^= 0x0020;
- if (input_code_pressed(device->machine, KEYCODE_7)) r ^= 0x0040;
- if (input_code_pressed(device->machine, KEYCODE_8)) r ^= 0x0080;
+ if (input_code_pressed(device->machine(), KEYCODE_1)) r ^= 0x0001;
+ if (input_code_pressed(device->machine(), KEYCODE_2)) r ^= 0x0002;
+ if (input_code_pressed(device->machine(), KEYCODE_3)) r ^= 0x0004;
+ if (input_code_pressed(device->machine(), KEYCODE_4)) r ^= 0x0008;
+ if (input_code_pressed(device->machine(), KEYCODE_5)) r ^= 0x0010;
+ if (input_code_pressed(device->machine(), KEYCODE_6)) r ^= 0x0020;
+ if (input_code_pressed(device->machine(), KEYCODE_7)) r ^= 0x0040;
+ if (input_code_pressed(device->machine(), KEYCODE_8)) r ^= 0x0080;
#endif
}
break;
@@ -710,9 +710,9 @@ static DEVICE_START(duart68681)
duart68681->duart_config = (const duart68681_config *)device->baseconfig().static_config();
duart68681->device = device;
- duart68681->channel[0].tx_timer = device->machine->scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
- duart68681->channel[1].tx_timer = device->machine->scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
- duart68681->duart_timer = device->machine->scheduler().timer_alloc(FUNC(duart_timer_callback), (void*)device);
+ duart68681->channel[0].tx_timer = device->machine().scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
+ duart68681->channel[1].tx_timer = device->machine().scheduler().timer_alloc(FUNC(tx_timer_callback), (void*)device);
+ duart68681->duart_timer = device->machine().scheduler().timer_alloc(FUNC(duart_timer_callback), (void*)device);
device->save_item(NAME(duart68681->ACR));
device->save_item(NAME(duart68681->IMR));
diff --git a/src/emu/machine/74123.c b/src/emu/machine/74123.c
index 2ab8ff8619f..8a6338d7149 100644
--- a/src/emu/machine/74123.c
+++ b/src/emu/machine/74123.c
@@ -52,7 +52,7 @@ device_config *ttl74123_device_config::static_alloc_device_config(const machine_
device_t *ttl74123_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ttl74123_device(machine, *this));
+ return auto_alloc(machine, ttl74123_device(machine, *this));
}
diff --git a/src/emu/machine/74181.c b/src/emu/machine/74181.c
index 03c2478e490..dca07ad01fe 100644
--- a/src/emu/machine/74181.c
+++ b/src/emu/machine/74181.c
@@ -27,11 +27,11 @@ struct _TTL74181_state
static TTL74181_state chips[TTL74181_MAX_CHIPS];
-void TTL74181_config(running_machine *machine, int which, void *intf)
+void TTL74181_config(running_machine &machine, int which, void *intf)
{
TTL74181_state *c;
- assert_always(machine->phase() == MACHINE_PHASE_INIT, "Can only call at init time!");
+ assert_always(machine.phase() == MACHINE_PHASE_INIT, "Can only call at init time!");
assert_always(intf == 0, "Interface must be NULL");
assert_always((which >= 0) && (which < TTL74181_MAX_CHIPS), "Exceeded maximum number of 74181 chips");
diff --git a/src/emu/machine/74181.h b/src/emu/machine/74181.h
index e4f23dcd16e..5d15bdac9cf 100644
--- a/src/emu/machine/74181.h
+++ b/src/emu/machine/74181.h
@@ -33,7 +33,7 @@
#define TTL74181_OUTPUT_CN4 (7)
-void TTL74181_config(running_machine *machine, int chip, void *interface);
+void TTL74181_config(running_machine &machine, int chip, void *interface);
void TTL74181_reset(int chip);
void TTL74181_write(int chip, int startline, int lines, UINT8 data);
diff --git a/src/emu/machine/7474.c b/src/emu/machine/7474.c
index 5e537210d89..3b92dab2463 100644
--- a/src/emu/machine/7474.c
+++ b/src/emu/machine/7474.c
@@ -80,7 +80,7 @@ device_config *ttl7474_device_config::static_alloc_device_config(const machine_c
device_t *ttl7474_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ttl7474_device(machine, *this));
+ return auto_alloc(machine, ttl7474_device(machine, *this));
}
diff --git a/src/emu/machine/8042kbdc.c b/src/emu/machine/8042kbdc.c
index 2bf3b3a8dfe..8d45e2005a8 100644
--- a/src/emu/machine/8042kbdc.c
+++ b/src/emu/machine/8042kbdc.c
@@ -204,9 +204,9 @@
static struct
{
kbdc8042_type_t type;
- void (*set_gate_a20)(running_machine *machine, int a20);
- void (*keyboard_interrupt)(running_machine *machine, int state);
- int (*get_out2)(running_machine *machine);
+ void (*set_gate_a20)(running_machine &machine, int a20);
+ void (*keyboard_interrupt)(running_machine &machine, int state);
+ int (*get_out2)(running_machine &machine);
UINT8 inport, outport, data, command;
@@ -234,7 +234,7 @@ static struct
static int poll_delay;
-static void at_8042_check_keyboard(running_machine *machine);
+static void at_8042_check_keyboard(running_machine &machine);
@@ -244,7 +244,7 @@ static void at_8042_check_keyboard(running_machine *machine);
***************************************************************************/
-static void at_8042_set_outport(running_machine *machine, UINT8 data, int initial)
+static void at_8042_set_outport(running_machine &machine, UINT8 data, int initial)
{
UINT8 change;
change = initial ? 0xFF : (kbdc8042.outport ^ data);
@@ -266,7 +266,7 @@ static TIMER_CALLBACK( kbdc8042_time )
-void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *intf)
+void kbdc8042_init(running_machine &machine, const struct kbdc8042_interface *intf)
{
poll_delay = 10;
memset(&kbdc8042, 0, sizeof(kbdc8042));
@@ -279,10 +279,10 @@ void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *in
kbdc8042.inport = 0xa0;
at_8042_set_outport(machine, 0xfe, 1);
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(kbdc8042_time));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(kbdc8042_time));
}
-static void at_8042_receive(running_machine *machine, UINT8 data)
+static void at_8042_receive(running_machine &machine, UINT8 data)
{
if (LOG_KEYBOARD)
logerror("at_8042_receive Received 0x%02x\n", data);
@@ -297,7 +297,7 @@ static void at_8042_receive(running_machine *machine, UINT8 data)
}
}
-static void at_8042_check_keyboard(running_machine *machine)
+static void at_8042_check_keyboard(running_machine &machine)
{
int data;
@@ -360,7 +360,7 @@ READ8_HANDLER(kbdc8042_8_r)
/* at386 self test doesn't like this */
at_8042_clear_keyboard_received();
}
- at_8042_check_keyboard(space->machine);
+ at_8042_check_keyboard(space->machine());
break;
case 1:
@@ -388,14 +388,14 @@ READ8_HANDLER(kbdc8042_8_r)
break;
case 2:
- if (kbdc8042.get_out2(space->machine))
+ if (kbdc8042.get_out2(space->machine()))
data |= 0x20;
else
data &= ~0x20;
break;
case 4:
- at_8042_check_keyboard(space->machine);
+ at_8042_check_keyboard(space->machine());
if (kbdc8042.keyboard.received || kbdc8042.mouse.received)
data |= 1;
@@ -441,7 +441,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
/* normal case */
kbdc8042.data = data;
kbdc8042.sending=1;
- at_keyboard_write(space->machine, data);
+ at_keyboard_write(space->machine(), data);
break;
case 1:
@@ -455,14 +455,14 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- keyboard clock (output)
* `------------ keyboard data (output)
*/
- at_8042_set_outport(space->machine, data, 0);
+ at_8042_set_outport(space->machine(), data, 0);
break;
case 2:
/* preceeded by writing 0xD2 to port 60h */
kbdc8042.data = data;
kbdc8042.sending=1;
- at_keyboard_write(space->machine, data);
+ at_keyboard_write(space->machine(), data);
break;
case 3:
@@ -506,13 +506,13 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.mouse.on = 1;
break;
case 0xa9: /* test mouse */
- at_8042_receive(space->machine, PS2_MOUSE_ON ? 0x00 : 0xff);
+ at_8042_receive(space->machine(), PS2_MOUSE_ON ? 0x00 : 0xff);
break;
case 0xaa: /* selftest */
- at_8042_receive(space->machine, 0x55);
+ at_8042_receive(space->machine(), 0x55);
break;
case 0xab: /* test keyboard */
- at_8042_receive(space->machine, KEYBOARD_ON ? 0x00 : 0xff);
+ at_8042_receive(space->machine(), KEYBOARD_ON ? 0x00 : 0xff);
break;
case 0xad: /* disable keyboard interface */
kbdc8042.keyboard.on = 0;
@@ -530,7 +530,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- 1=primary display is MDA, 0=CGA
* `------------ 1=keyboard not inhibited; 0=inhibited
*/
- at_8042_receive(space->machine, kbdc8042.inport);
+ at_8042_receive(space->machine(), kbdc8042.inport);
break;
case 0xc1: /* read input port 3..0 until write to 0x60 */
kbdc8042.status_read_mode = 1;
@@ -539,7 +539,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.status_read_mode = 2;
break;
case 0xd0: /* read output port */
- at_8042_receive(space->machine, kbdc8042.outport);
+ at_8042_receive(space->machine(), kbdc8042.outport);
break;
case 0xd1:
/* write output port; next byte written to port 60h is placed on
@@ -568,7 +568,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
break;
case 0xe0:
/* read test inputs; read T1/T0 test inputs into bit 1/0 */
- at_8042_receive(space->machine, 0x00);
+ at_8042_receive(space->machine(), 0x00);
break;
case 0xf0:
@@ -584,8 +584,8 @@ WRITE8_HANDLER(kbdc8042_8_w)
* the bits low set in the command byte. The only pulse that has
* an effect currently is bit 0, which pulses the CPU's reset line
*/
- device_set_input_line(space->machine->firstcpu, INPUT_LINE_RESET, PULSE_LINE);
- at_8042_set_outport(space->machine, kbdc8042.outport | 0x02, 0);
+ device_set_input_line(space->machine().firstcpu, INPUT_LINE_RESET, PULSE_LINE);
+ at_8042_set_outport(space->machine(), kbdc8042.outport | 0x02, 0);
break;
}
kbdc8042.sending = 1;
diff --git a/src/emu/machine/8042kbdc.h b/src/emu/machine/8042kbdc.h
index f6ec7b4c44c..35dc301d570 100644
--- a/src/emu/machine/8042kbdc.h
+++ b/src/emu/machine/8042kbdc.h
@@ -21,14 +21,14 @@ typedef enum
struct kbdc8042_interface
{
kbdc8042_type_t type;
- void (*set_gate_a20)(running_machine *machine, int a20);
- void (*keyboard_interrupt)(running_machine *machine, int state);
- int (*get_out2)(running_machine *machine);
+ void (*set_gate_a20)(running_machine &machine, int a20);
+ void (*keyboard_interrupt)(running_machine &machine, int state);
+ int (*get_out2)(running_machine &machine);
};
-void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *intf);
+void kbdc8042_init(running_machine &machine, const struct kbdc8042_interface *intf);
READ8_HANDLER(kbdc8042_8_r);
WRITE8_HANDLER(kbdc8042_8_w);
diff --git a/src/emu/machine/adc083x.c b/src/emu/machine/adc083x.c
index 06ad3b4a3fc..6e14a262e32 100644
--- a/src/emu/machine/adc083x.c
+++ b/src/emu/machine/adc083x.c
@@ -11,7 +11,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine *machine, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine &machine, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -20,7 +20,7 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( int n_level, running_machine *machin
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine ->describe_context( ), buf );
+ logerror( "%s: %s", machine.describe_context( ), buf );
}
}
@@ -116,7 +116,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_cs_write )
if( adc083x->cs != state )
{
- verboselog( 2, device->machine, "adc083x_cs_write( %s, %d )\n", device->tag(), state );
+ verboselog( 2, device->machine(), "adc083x_cs_write( %s, %d )\n", device->tag(), state );
}
if( adc083x->cs == 0 && state != 0 )
@@ -234,7 +234,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
if( adc083x->clk != state )
{
- verboselog( 2, device->machine, "adc083x_clk_write( %s, %d )\n", device->tag(), state );
+ verboselog( 2, device->machine(), "adc083x_clk_write( %s, %d )\n", device->tag(), state );
}
if( adc083x->cs == 0 )
@@ -246,7 +246,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
case STATE_WAIT_FOR_START:
if( adc083x->di != 0 )
{
- verboselog( 1, device->machine, "adc083x %s got start bit\n", device->tag() );
+ verboselog( 1, device->machine(), "adc083x %s got start bit\n", device->tag() );
adc083x->state = STATE_SHIFT_MUX;
adc083x->sars = 0;
adc083x->sgl = 0;
@@ -257,7 +257,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
}
else
{
- verboselog( 1, device->machine, "adc083x %s not start bit\n", device->tag() );
+ verboselog( 1, device->machine(), "adc083x %s not start bit\n", device->tag() );
}
break;
@@ -269,7 +269,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->sgl = 1;
}
- verboselog( 1, device->machine, "adc083x %s sgl <- %d\n", device->tag(), adc083x->sgl );
+ verboselog( 1, device->machine(), "adc083x %s sgl <- %d\n", device->tag(), adc083x->sgl );
break;
case 1:
@@ -277,7 +277,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->odd = 1;
}
- verboselog( 1, device->machine, "adc083x %s odd <- %d\n", device->tag(), adc083x->odd );
+ verboselog( 1, device->machine(), "adc083x %s odd <- %d\n", device->tag(), adc083x->odd );
break;
case 2:
@@ -285,7 +285,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->sel1 = 1;
}
- verboselog( 1, device->machine, "adc083x %s sel1 <- %d\n", device->tag(), adc083x->sel1 );
+ verboselog( 1, device->machine(), "adc083x %s sel1 <- %d\n", device->tag(), adc083x->sel1 );
break;
case 3:
@@ -293,7 +293,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
{
adc083x->sel0 = 1;
}
- verboselog( 1, device->machine, "adc083x %s sel0 <- %d\n", device->tag(), adc083x->sel0 );
+ verboselog( 1, device->machine(), "adc083x %s sel0 <- %d\n", device->tag(), adc083x->sel0 );
break;
}
@@ -309,11 +309,11 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
adc083x->sars = 0;
if( device->type() == ADC0838 && adc083x->se != 0 )
{
- verboselog( 1, device->machine, "adc083x %s not se\n", device->tag() );
+ verboselog( 1, device->machine(), "adc083x %s not se\n", device->tag() );
}
else
{
- verboselog( 1, device->machine, "adc083x %s got se\n", device->tag() );
+ verboselog( 1, device->machine(), "adc083x %s got se\n", device->tag() );
adc083x->state = STATE_OUTPUT_LSB_FIRST;
adc083x->bit = 1;
}
@@ -326,7 +326,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
switch( adc083x->state )
{
case STATE_MUX_SETTLE:
- verboselog( 1, device->machine, "adc083x %s mux settle\n", device->tag() );
+ verboselog( 1, device->machine(), "adc083x %s mux settle\n", device->tag() );
adc083x->output = adc083x_conversion( device );
adc083x->state = STATE_OUTPUT_MSB_FIRST;
adc083x->bit = 7;
@@ -336,7 +336,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
case STATE_OUTPUT_MSB_FIRST:
adc083x->_do = ( adc083x->output >> adc083x->bit ) & 1;
- verboselog( 1, device->machine, "adc083x %s msb %d -> %d\n", device->tag(), adc083x->bit, adc083x->_do );
+ verboselog( 1, device->machine(), "adc083x %s msb %d -> %d\n", device->tag(), adc083x->bit, adc083x->_do );
adc083x->bit--;
if( adc083x->bit < 0 )
@@ -354,7 +354,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_clk_write )
case STATE_OUTPUT_LSB_FIRST:
adc083x->_do = ( adc083x->output >> adc083x->bit ) & 1;
- verboselog( 1, device->machine, "adc083x %s lsb %d -> %d\n", device->tag(), adc083x->bit, adc083x->_do );
+ verboselog( 1, device->machine(), "adc083x %s lsb %d -> %d\n", device->tag(), adc083x->bit, adc083x->_do );
adc083x->bit++;
if( adc083x->bit == 8 )
@@ -384,7 +384,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_di_write )
if( adc083x->di != state )
{
- verboselog( 2, device->machine, "adc083x_di_write( %s, %d )\n", device->tag(), state );
+ verboselog( 2, device->machine(), "adc083x_di_write( %s, %d )\n", device->tag(), state );
}
adc083x->di = state;
@@ -400,7 +400,7 @@ WRITE_LINE_DEVICE_HANDLER( adc083x_se_write )
if( adc083x->se != state )
{
- verboselog( 2, device->machine, "adc083x_se_write( %s, %d )\n", device->tag(), state );
+ verboselog( 2, device->machine(), "adc083x_se_write( %s, %d )\n", device->tag(), state );
}
adc083x->se = state;
@@ -414,7 +414,7 @@ READ_LINE_DEVICE_HANDLER( adc083x_sars_read )
{
adc0831_state *adc083x = get_safe_token( device );
- verboselog( 1, device->machine, "adc083x_sars_read( %s ) %d\n", device->tag(), adc083x->sars );
+ verboselog( 1, device->machine(), "adc083x_sars_read( %s ) %d\n", device->tag(), adc083x->sars );
return adc083x->sars;
}
@@ -426,7 +426,7 @@ READ_LINE_DEVICE_HANDLER( adc083x_do_read )
{
adc0831_state *adc083x = get_safe_token( device );
- verboselog( 1, device->machine, "adc083x_do_read( %s ) %d\n", device->tag(), adc083x->_do );
+ verboselog( 1, device->machine(), "adc083x_do_read( %s ) %d\n", device->tag(), adc083x->_do );
return adc083x->_do;
}
diff --git a/src/emu/machine/am53cf96.c b/src/emu/machine/am53cf96.c
index 1119175f14b..5d02656167f 100644
--- a/src/emu/machine/am53cf96.c
+++ b/src/emu/machine/am53cf96.c
@@ -159,10 +159,10 @@ WRITE32_HANDLER( am53cf96_w )
case 3: // reset SCSI bus
scsi_regs[REG_INTSTATE] = 4; // command sent OK
xfer_state = 0;
- space->machine->scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
+ space->machine().scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
break;
case 0x42: // select with ATN steps
- space->machine->scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
+ space->machine().scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
if ((fifo[1] == 0) || (fifo[1] == 0x48) || (fifo[1] == 0x4b))
{
scsi_regs[REG_INTSTATE] = 6;
@@ -192,7 +192,7 @@ WRITE32_HANDLER( am53cf96_w )
case 0x10: // information transfer (must not change xfer_state)
case 0x11: // second phase of information transfer
case 0x12: // message accepted
- space->machine->scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
+ space->machine().scheduler().timer_set( attotime::from_hz( 16384 ), FUNC(am53cf96_irq ));
scsi_regs[REG_INTSTATE] = 6; // command sent OK
break;
default:
@@ -208,7 +208,7 @@ WRITE32_HANDLER( am53cf96_w )
}
}
-void am53cf96_init( running_machine *machine, const struct AM53CF96interface *interface )
+void am53cf96_init( running_machine &machine, const struct AM53CF96interface *interface )
{
int i;
diff --git a/src/emu/machine/am53cf96.h b/src/emu/machine/am53cf96.h
index 1eeb728bb63..df74b4a80aa 100644
--- a/src/emu/machine/am53cf96.h
+++ b/src/emu/machine/am53cf96.h
@@ -11,10 +11,10 @@
struct AM53CF96interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
- void (*irq_callback)(running_machine *machine); /* irq callback */
+ void (*irq_callback)(running_machine &machine); /* irq callback */
};
-extern void am53cf96_init( running_machine *machine, const struct AM53CF96interface *interface );
+extern void am53cf96_init( running_machine &machine, const struct AM53CF96interface *interface );
extern void am53cf96_exit( const struct AM53CF96interface *interface );
extern void am53cf96_read_data(int bytes, UINT8 *pData);
void am53cf96_write_data(int bytes, UINT8 *pData);
diff --git a/src/emu/machine/at28c16.c b/src/emu/machine/at28c16.c
index f7418af244d..ff7bc172ddc 100644
--- a/src/emu/machine/at28c16.c
+++ b/src/emu/machine/at28c16.c
@@ -63,7 +63,7 @@ device_config *at28c16_device_config::static_alloc_device_config( const machine_
device_t *at28c16_device_config::alloc_device( running_machine &machine ) const
{
- return auto_alloc( &machine, at28c16_device( machine, *this ) );
+ return auto_alloc( machine, at28c16_device( machine, *this ) );
}
@@ -187,7 +187,7 @@ void at28c16_device::nvram_default()
void at28c16_device::nvram_read( emu_file &file )
{
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, AT28C16_TOTAL_BYTES );
file.read( buffer, AT28C16_TOTAL_BYTES );
@@ -196,7 +196,7 @@ void at28c16_device::nvram_read( emu_file &file )
m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
}
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
//-------------------------------------------------
@@ -206,7 +206,7 @@ void at28c16_device::nvram_read( emu_file &file )
void at28c16_device::nvram_write( emu_file &file )
{
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, AT28C16_TOTAL_BYTES );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, AT28C16_TOTAL_BYTES );
for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
{
@@ -215,7 +215,7 @@ void at28c16_device::nvram_write( emu_file &file )
file.write( buffer, AT28C16_TOTAL_BYTES );
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
@@ -233,11 +233,11 @@ void at28c16_device::write( offs_t offset, UINT8 data )
{
if( m_last_write >= 0 )
{
-// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: write( %04x, %02x ) busy\n", machine.describe_context(), offset, data );
}
else if( m_oe_12v )
{
-// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: write( %04x, %02x ) erase\n", machine.describe_context(), offset, data );
if( m_last_write < 0 )
{
for( offs_t offs = 0; offs < AT28C16_TOTAL_BYTES; offs++ )
@@ -256,7 +256,7 @@ void at28c16_device::write( offs_t offset, UINT8 data )
offset += AT28C16_ID_BYTES;
}
-// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: write( %04x, %02x )\n", machine.describe_context(), offset, data );
if( m_last_write < 0 && m_addrspace[ 0 ]->read_byte( offset ) != data )
{
m_addrspace[ 0 ]->write_byte( offset, data );
@@ -277,7 +277,7 @@ UINT8 at28c16_device::read( offs_t offset )
if( m_last_write >= 0 )
{
UINT8 data = m_last_write ^ 0x80;
-// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: read( %04x ) write status %02x\n", machine.describe_context(), offset, data );
return data;
}
else
@@ -288,7 +288,7 @@ UINT8 at28c16_device::read( offs_t offset )
}
UINT8 data = m_addrspace[ 0 ]->read_byte( offset );
-// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine->describe_context(), offset, data );
+// logerror( "%s: AT28C16: read( %04x ) data %02x\n", machine.describe_context(), offset, data );
return data;
}
}
@@ -304,7 +304,7 @@ void at28c16_device::set_a9_12v( int state )
state &= 1;
if( m_a9_12v != state )
{
-// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine->describe_context(), state );
+// logerror( "%s: AT28C16: set_a9_12v( %d )\n", machine.describe_context(), state );
m_a9_12v = state;
}
}
@@ -320,7 +320,7 @@ void at28c16_device::set_oe_12v( int state )
state &= 1;
if( m_oe_12v != state )
{
-// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine->describe_context(), state );
+// logerror( "%s: AT28C16: set_oe_12v( %d )\n", machine.describe_context(), state );
m_oe_12v = state;
}
}
diff --git a/src/emu/machine/cdp1852.c b/src/emu/machine/cdp1852.c
index fe98f13d53b..a5e4ea0783a 100644
--- a/src/emu/machine/cdp1852.c
+++ b/src/emu/machine/cdp1852.c
@@ -165,7 +165,7 @@ static DEVICE_START( cdp1852 )
if (device->clock() > 0)
{
/* create the scan timer */
- cdp1852->scan_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1852_scan_tick), (void *)device);
+ cdp1852->scan_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1852_scan_tick), (void *)device);
cdp1852->scan_timer->adjust(attotime::zero, 0, attotime::from_hz(device->clock()));
}
diff --git a/src/emu/machine/cr589.c b/src/emu/machine/cr589.c
index ed4a9ad00f1..1297b3a893a 100644
--- a/src/emu/machine/cr589.c
+++ b/src/emu/machine/cr589.c
@@ -110,7 +110,7 @@ static void cr589_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
our_this->download = 0;
diff --git a/src/emu/machine/devhelpr.h b/src/emu/machine/devhelpr.h
index 8d35dc7a295..97ee11a08d4 100644
--- a/src/emu/machine/devhelpr.h
+++ b/src/emu/machine/devhelpr.h
@@ -47,7 +47,7 @@
{ return global_alloc(devname##_device_config(mconfig, tag, owner, clock)); } \
\
device_t *devname##_device_config::alloc_device(running_machine &machine) const \
- { return auto_alloc(&machine, devname##_device(machine, *this)); }
+ { return auto_alloc(machine, devname##_device(machine, *this)); }
#define GENERIC_DEVICE_DERIVED_CONFIG(basename, devname) \
class devname##_device_config : public basename##_device_config \
diff --git a/src/emu/machine/ds1302.c b/src/emu/machine/ds1302.c
index 6b59a0d6a09..63b732d446b 100644
--- a/src/emu/machine/ds1302.c
+++ b/src/emu/machine/ds1302.c
@@ -70,7 +70,7 @@ device_config *ds1302_device_config::static_alloc_device_config(const machine_co
device_t *ds1302_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ds1302_device(machine, *this));
+ return auto_alloc(machine, ds1302_device(machine, *this));
}
diff --git a/src/emu/machine/ds2401.c b/src/emu/machine/ds2401.c
index 412a78a483e..2902a033c03 100644
--- a/src/emu/machine/ds2401.c
+++ b/src/emu/machine/ds2401.c
@@ -20,7 +20,7 @@ inline void ATTR_PRINTF(3,4) ds2401_device::verboselog(int n_level, const char *
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("ds2401 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("ds2401 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -38,7 +38,7 @@ device_config *ds2401_device_config::static_alloc_device_config(const machine_co
device_t *ds2401_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ds2401_device(machine, *this));
+ return auto_alloc(machine, ds2401_device(machine, *this));
}
ds2401_device::ds2401_device(running_machine &_machine, const ds2401_device_config &_config)
diff --git a/src/emu/machine/ds2404.c b/src/emu/machine/ds2404.c
index e834744d557..c16ca1b5ca7 100644
--- a/src/emu/machine/ds2404.c
+++ b/src/emu/machine/ds2404.c
@@ -47,7 +47,7 @@ device_config *ds2404_device_config::static_alloc_device_config(const machine_co
device_t *ds2404_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ds2404_device(machine, *this));
+ return auto_alloc(machine, ds2404_device(machine, *this));
}
diff --git a/src/emu/machine/eeprom.c b/src/emu/machine/eeprom.c
index 27c95819464..5c5a3bbe9e0 100644
--- a/src/emu/machine/eeprom.c
+++ b/src/emu/machine/eeprom.c
@@ -104,7 +104,7 @@ device_config *eeprom_device_config::static_alloc_device_config(const machine_co
device_t *eeprom_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, eeprom_device(machine, *this));
+ return auto_alloc(machine, eeprom_device(machine, *this));
}
@@ -302,11 +302,11 @@ void eeprom_device::nvram_read(emu_file &file)
UINT32 eeprom_length = 1 << m_config.m_address_bits;
UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
- UINT8 *buffer = auto_alloc_array(&m_machine, UINT8, eeprom_bytes);
+ UINT8 *buffer = auto_alloc_array(m_machine, UINT8, eeprom_bytes);
file.read(buffer, eeprom_bytes);
for (offs_t offs = 0; offs < eeprom_bytes; offs++)
m_addrspace[0]->write_byte(offs, buffer[offs]);
- auto_free(&m_machine, buffer);
+ auto_free(m_machine, buffer);
}
@@ -320,11 +320,11 @@ void eeprom_device::nvram_write(emu_file &file)
UINT32 eeprom_length = 1 << m_config.m_address_bits;
UINT32 eeprom_bytes = eeprom_length * m_config.m_data_bits / 8;
- UINT8 *buffer = auto_alloc_array(&m_machine, UINT8, eeprom_bytes);
+ UINT8 *buffer = auto_alloc_array(m_machine, UINT8, eeprom_bytes);
for (offs_t offs = 0; offs < eeprom_bytes; offs++)
buffer[offs] = m_addrspace[0]->read_byte(offs);
file.write(buffer, eeprom_bytes);
- auto_free(&m_machine, buffer);
+ auto_free(m_machine, buffer);
}
diff --git a/src/emu/machine/er2055.c b/src/emu/machine/er2055.c
index ff7879a19ff..ddf735fe3a0 100644
--- a/src/emu/machine/er2055.c
+++ b/src/emu/machine/er2055.c
@@ -87,7 +87,7 @@ device_config *er2055_device_config::static_alloc_device_config(const machine_co
device_t *er2055_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, er2055_device(machine, *this));
+ return auto_alloc(machine, er2055_device(machine, *this));
}
diff --git a/src/emu/machine/f3853.c b/src/emu/machine/f3853.c
index 0cb2db9bb20..98040b3fd9d 100644
--- a/src/emu/machine/f3853.c
+++ b/src/emu/machine/f3853.c
@@ -68,7 +68,7 @@ device_config *f3853_device_config::static_alloc_device_config(const machine_con
device_t *f3853_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, f3853_device(machine, *this));
+ return auto_alloc(machine, f3853_device(machine, *this));
}
diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c
index 8d595230f07..c7a5a4a0c0e 100644
--- a/src/emu/machine/generic.c
+++ b/src/emu/machine/generic.c
@@ -19,8 +19,8 @@
FUNCTION PROTOTYPES
***************************************************************************/
-static void counters_load(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void counters_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+static void counters_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void counters_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static void interrupt_reset(running_machine &machine);
@@ -58,7 +58,7 @@ struct _generic_machine_private
INLINE int interrupt_enabled(device_t *device)
{
- generic_machine_private *state = device->machine->generic_machine_data;
+ generic_machine_private *state = device->machine().generic_machine_data;
for (int index = 0; index < ARRAY_LENGTH(state->interrupt_device); index++)
if (state->interrupt_device[index] == device)
return state->interrupt_enable[index];
@@ -76,14 +76,14 @@ INLINE int interrupt_enabled(device_t *device)
register for save states
-------------------------------------------------*/
-void generic_machine_init(running_machine *machine)
+void generic_machine_init(running_machine &machine)
{
generic_machine_private *state;
int counternum;
/* allocate our state */
- machine->generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
- state = machine->generic_machine_data;
+ machine.generic_machine_data = auto_alloc_clear(machine, generic_machine_private);
+ state = machine.generic_machine_data;
/* reset coin counters */
for (counternum = 0; counternum < COIN_COUNTERS; counternum++)
@@ -96,29 +96,29 @@ void generic_machine_init(running_machine *machine)
memset(state->interrupt_device, 0, sizeof(state->interrupt_device));
device_execute_interface *exec = NULL;
int index = 0;
- for (bool gotone = machine->m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone && index < ARRAY_LENGTH(state->interrupt_device); gotone = exec->next(exec))
state->interrupt_device[index++] = &exec->device();
/* register coin save state */
- machine->state().save_item(NAME(state->coin_count));
- machine->state().save_item(NAME(state->coinlockedout));
- machine->state().save_item(NAME(state->lastcoin));
+ machine.state().save_item(NAME(state->coin_count));
+ machine.state().save_item(NAME(state->coinlockedout));
+ machine.state().save_item(NAME(state->lastcoin));
/* reset memory card info */
state->memcard_inserted = -1;
/* register a reset callback and save state for interrupt enable */
- machine->add_notifier(MACHINE_NOTIFY_RESET, interrupt_reset);
- machine->state().save_item(NAME(state->interrupt_enable));
+ machine.add_notifier(MACHINE_NOTIFY_RESET, interrupt_reset);
+ machine.state().save_item(NAME(state->interrupt_enable));
/* register for configuration */
config_register(machine, "counters", counters_load, counters_save);
/* for memory cards, request save state and an exit callback */
- if (machine->config().m_memcard_handler != NULL)
+ if (machine.config().m_memcard_handler != NULL)
{
state_save_register_global(machine, state->memcard_inserted);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, memcard_eject);
}
}
@@ -133,9 +133,9 @@ void generic_machine_init(running_machine *machine)
tickets dispensed
-------------------------------------------------*/
-int get_dispensed_tickets(running_machine *machine)
+int get_dispensed_tickets(running_machine &machine)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
return state->dispensed_tickets;
}
@@ -145,9 +145,9 @@ int get_dispensed_tickets(running_machine *machine)
number of dispensed tickets
-------------------------------------------------*/
-void increment_dispensed_tickets(running_machine *machine, int delta)
+void increment_dispensed_tickets(running_machine &machine, int delta)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
state->dispensed_tickets += delta;
}
@@ -162,9 +162,9 @@ void increment_dispensed_tickets(running_machine *machine, int delta)
and tickets
-------------------------------------------------*/
-static void counters_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void counters_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
xml_data_node *coinnode, *ticketnode;
/* on init, reset the counters */
@@ -202,9 +202,9 @@ static void counters_load(running_machine *machine, int config_type, xml_data_no
and tickets
-------------------------------------------------*/
-static void counters_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void counters_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
int i;
/* only care about game-specific data */
@@ -237,9 +237,9 @@ static void counters_save(running_machine *machine, int config_type, xml_data_no
coin_counter_w - sets input for coin counter
-------------------------------------------------*/
-void coin_counter_w(running_machine *machine, int num, int on)
+void coin_counter_w(running_machine &machine, int num, int on)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coin_count))
return;
@@ -255,9 +255,9 @@ void coin_counter_w(running_machine *machine, int num, int on)
for a given coin
-------------------------------------------------*/
-int coin_counter_get_count(running_machine *machine, int num)
+int coin_counter_get_count(running_machine &machine, int num)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coin_count))
return 0;
return state->coin_count[num];
@@ -268,9 +268,9 @@ int coin_counter_get_count(running_machine *machine, int num)
coin_lockout_w - locks out one coin input
-------------------------------------------------*/
-void coin_lockout_w(running_machine *machine, int num,int on)
+void coin_lockout_w(running_machine &machine, int num,int on)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coinlockedout))
return;
state->coinlockedout[num] = on;
@@ -282,9 +282,9 @@ void coin_lockout_w(running_machine *machine, int num,int on)
state for a particular coin
-------------------------------------------------*/
-int coin_lockout_get_state(running_machine *machine, int num)
+int coin_lockout_get_state(running_machine &machine, int num)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
if (num >= ARRAY_LENGTH(state->coinlockedout))
return FALSE;
return state->coinlockedout[num];
@@ -296,9 +296,9 @@ int coin_lockout_get_state(running_machine *machine, int num)
inputs
-------------------------------------------------*/
-void coin_lockout_global_w(running_machine *machine, int on)
+void coin_lockout_global_w(running_machine &machine, int on)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
int i;
for (i = 0; i < ARRAY_LENGTH(state->coinlockedout); i++)
@@ -315,20 +315,20 @@ void coin_lockout_global_w(running_machine *machine, int on)
nvram_load - load a system's NVRAM
-------------------------------------------------*/
-void nvram_load(running_machine *machine)
+void nvram_load(running_machine &machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
- if (!machine->m_devicelist.first(nvram) && machine->config().m_nvram_handler == NULL)
+ if (!machine.m_devicelist.first(nvram) && machine.config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
- emu_file file(machine->options().nvram_directory(), OPEN_FLAG_READ);
- if (file.open(machine->basename(), ".nv") == FILERR_NONE)
+ emu_file file(machine.options().nvram_directory(), OPEN_FLAG_READ);
+ if (file.open(machine.basename(), ".nv") == FILERR_NONE)
{
// read data from general NVRAM handler first
- if (machine->config().m_nvram_handler != NULL)
- (*machine->config().m_nvram_handler)(machine, &file, FALSE);
+ if (machine.config().m_nvram_handler != NULL)
+ (*machine.config().m_nvram_handler)(machine, &file, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@@ -339,8 +339,8 @@ void nvram_load(running_machine *machine)
else
{
// initialize via the general NVRAM handler first
- if (machine->config().m_nvram_handler != NULL)
- (*machine->config().m_nvram_handler)(machine, NULL, FALSE);
+ if (machine.config().m_nvram_handler != NULL)
+ (*machine.config().m_nvram_handler)(machine, NULL, FALSE);
// find all devices with NVRAM handlers, and read from them next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@@ -353,20 +353,20 @@ void nvram_load(running_machine *machine)
nvram_save - save a system's NVRAM
-------------------------------------------------*/
-void nvram_save(running_machine *machine)
+void nvram_save(running_machine &machine)
{
// only need to do something if we have an NVRAM device or an nvram_handler
device_nvram_interface *nvram = NULL;
- if (!machine->m_devicelist.first(nvram) && machine->config().m_nvram_handler == NULL)
+ if (!machine.m_devicelist.first(nvram) && machine.config().m_nvram_handler == NULL)
return;
// open the file; if it exists, call everyone to read from it
- emu_file file(machine->options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- if (file.open(machine->basename(), ".nv") == FILERR_NONE)
+ emu_file file(machine.options().nvram_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ if (file.open(machine.basename(), ".nv") == FILERR_NONE)
{
// write data via general NVRAM handler first
- if (machine->config().m_nvram_handler != NULL)
- (*machine->config().m_nvram_handler)(machine, &file, TRUE);
+ if (machine.config().m_nvram_handler != NULL)
+ (*machine.config().m_nvram_handler)(machine, &file, TRUE);
// find all devices with NVRAM handlers, and tell them to write next
for (bool gotone = (nvram != NULL); gotone; gotone = nvram->next(nvram))
@@ -396,7 +396,7 @@ INLINE void memcard_name(int index, char *buffer)
the given index
-------------------------------------------------*/
-int memcard_create(running_machine *machine, int index, int overwrite)
+int memcard_create(running_machine &machine, int index, int overwrite)
{
char name[16];
@@ -404,23 +404,23 @@ int memcard_create(running_machine *machine, int index, int overwrite)
memcard_name(index, name);
/* if we can't overwrite, fail if the file already exists */
- astring fname(machine->basename(), PATH_SEPARATOR, name);
+ astring fname(machine.basename(), PATH_SEPARATOR, name);
if (!overwrite)
{
- emu_file testfile(machine->options().memcard_directory(), OPEN_FLAG_READ);
+ emu_file testfile(machine.options().memcard_directory(), OPEN_FLAG_READ);
if (testfile.open(fname) == FILERR_NONE)
return 1;
}
/* create a new file */
- emu_file file(machine->options().memcard_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
+ emu_file file(machine.options().memcard_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
file_error filerr = file.open(fname);
if (filerr != FILERR_NONE)
return 1;
/* initialize and then save the card */
- if (machine->config().m_memcard_handler)
- (*machine->config().m_memcard_handler)(machine, file, MEMCARD_CREATE);
+ if (machine.config().m_memcard_handler)
+ (*machine.config().m_memcard_handler)(machine, file, MEMCARD_CREATE);
/* close the file */
return 0;
@@ -432,28 +432,28 @@ int memcard_create(running_machine *machine, int index, int overwrite)
with the given index
-------------------------------------------------*/
-int memcard_insert(running_machine *machine, int index)
+int memcard_insert(running_machine &machine, int index)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
char name[16];
/* if a card is already inserted, eject it first */
if (state->memcard_inserted != -1)
- memcard_eject(*machine);
+ memcard_eject(machine);
assert(state->memcard_inserted == -1);
/* create a name */
memcard_name(index, name);
/* open the file; if we can't, it's an error */
- emu_file file(machine->options().memcard_directory(), OPEN_FLAG_READ);
- file_error filerr = file.open(machine->basename(), PATH_SEPARATOR, name);
+ emu_file file(machine.options().memcard_directory(), OPEN_FLAG_READ);
+ file_error filerr = file.open(machine.basename(), PATH_SEPARATOR, name);
if (filerr != FILERR_NONE)
return 1;
/* initialize and then load the card */
- if (machine->config().m_memcard_handler)
- (*machine->config().m_memcard_handler)(machine, file, MEMCARD_INSERT);
+ if (machine.config().m_memcard_handler)
+ (*machine.config().m_memcard_handler)(machine, file, MEMCARD_INSERT);
/* close the file */
state->memcard_inserted = index;
@@ -486,7 +486,7 @@ void memcard_eject(running_machine &machine)
/* initialize and then load the card */
if (machine.config().m_memcard_handler)
- (*machine.config().m_memcard_handler)(&machine, file, MEMCARD_EJECT);
+ (*machine.config().m_memcard_handler)(machine, file, MEMCARD_EJECT);
/* close the file */
state->memcard_inserted = -1;
@@ -498,9 +498,9 @@ void memcard_eject(running_machine &machine)
card index, or -1 if none
-------------------------------------------------*/
-int memcard_present(running_machine *machine)
+int memcard_present(running_machine &machine)
{
- generic_machine_private *state = machine->generic_machine_data;
+ generic_machine_private *state = machine.generic_machine_data;
return state->memcard_inserted;
}
@@ -514,7 +514,7 @@ int memcard_present(running_machine *machine)
set_led_status - set the state of a given LED
-------------------------------------------------*/
-void set_led_status(running_machine *machine, int num, int on)
+void set_led_status(running_machine &machine, int num, int on)
{
output_set_led_value(num, on);
}
@@ -585,7 +585,7 @@ void generic_pulse_irq_line(device_t *device, int irqline)
cpu_device *cpudevice = downcast<cpu_device *>(device);
attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles());
- device->machine->scheduler().timer_set(target_time - device->machine->time(), FUNC(irq_pulse_clear), irqline, (void *)device);
+ device->machine().scheduler().timer_set(target_time - device->machine().time(), FUNC(irq_pulse_clear), irqline, (void *)device);
}
@@ -602,7 +602,7 @@ void generic_pulse_irq_line_and_vector(device_t *device, int irqline, int vector
cpu_device *cpudevice = downcast<cpu_device *>(device);
attotime target_time = cpudevice->local_time() + cpudevice->cycles_to_attotime(cpudevice->min_cycles());
- device->machine->scheduler().timer_set(target_time - device->machine->time(), FUNC(irq_pulse_clear), irqline, (void *)device);
+ device->machine().scheduler().timer_set(target_time - device->machine().time(), FUNC(irq_pulse_clear), irqline, (void *)device);
}
@@ -615,7 +615,7 @@ void cpu_interrupt_enable(device_t *device, int enabled)
{
cpu_device *cpudevice = downcast<cpu_device *>(device);
- generic_machine_private *state = device->machine->generic_machine_data;
+ generic_machine_private *state = device->machine().generic_machine_data;
int index;
for (index = 0; index < ARRAY_LENGTH(state->interrupt_device); index++)
if (state->interrupt_device[index] == device)
@@ -628,7 +628,7 @@ void cpu_interrupt_enable(device_t *device, int enabled)
/* make sure there are no queued interrupts */
if (enabled == 0)
- device->machine->scheduler().synchronize(FUNC(clear_all_lines), 0, (void *)cpudevice);
+ device->machine().scheduler().synchronize(FUNC(clear_all_lines), 0, (void *)cpudevice);
}
@@ -713,24 +713,24 @@ INTERRUPT_GEN( irq7_line_assert ) { if (interrupt_enabled(device)) device_set_in
8-bit reset read/write handlers
-------------------------------------------------*/
-WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(space->machine); }
-READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(space->machine); return space->unmap(); }
+WRITE8_HANDLER( watchdog_reset_w ) { watchdog_reset(space->machine()); }
+READ8_HANDLER( watchdog_reset_r ) { watchdog_reset(space->machine()); return space->unmap(); }
/*-------------------------------------------------
16-bit reset read/write handlers
-------------------------------------------------*/
-WRITE16_HANDLER( watchdog_reset16_w ) { watchdog_reset(space->machine); }
-READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(space->machine); return space->unmap(); }
+WRITE16_HANDLER( watchdog_reset16_w ) { watchdog_reset(space->machine()); }
+READ16_HANDLER( watchdog_reset16_r ) { watchdog_reset(space->machine()); return space->unmap(); }
/*-------------------------------------------------
32-bit reset read/write handlers
-------------------------------------------------*/
-WRITE32_HANDLER( watchdog_reset32_w ) { watchdog_reset(space->machine); }
-READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine); return space->unmap(); }
+WRITE32_HANDLER( watchdog_reset32_w ) { watchdog_reset(space->machine()); }
+READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine()); return space->unmap(); }
@@ -748,5 +748,5 @@ READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine); return sp
CUSTOM_INPUT( custom_port_read )
{
const char *tag = (const char *)param;
- return input_port_read(field->port->machine, tag);
+ return input_port_read(field->port->machine(), tag);
}
diff --git a/src/emu/machine/generic.h b/src/emu/machine/generic.h
index 565a14ff679..3cc006c5e5e 100644
--- a/src/emu/machine/generic.h
+++ b/src/emu/machine/generic.h
@@ -38,69 +38,69 @@
/* ----- initialization ----- */
/* set up all the common systems */
-void generic_machine_init(running_machine *machine);
+void generic_machine_init(running_machine &machine);
/* ----- tickets ----- */
/* return the number of tickets dispensed */
-int get_dispensed_tickets(running_machine *machine);
+int get_dispensed_tickets(running_machine &machine);
/* increment the number of dispensed tickets */
-void increment_dispensed_tickets(running_machine *machine, int delta);
+void increment_dispensed_tickets(running_machine &machine, int delta);
/* ----- coin counters ----- */
/* write to a particular coin counter (clocks on active high edge) */
-void coin_counter_w(running_machine *machine, int num, int on);
+void coin_counter_w(running_machine &machine, int num, int on);
/* return the coin count for a given coin */
-int coin_counter_get_count(running_machine *machine, int num);
+int coin_counter_get_count(running_machine &machine, int num);
/* enable/disable coin lockout for a particular coin */
-void coin_lockout_w(running_machine *machine, int num, int on);
+void coin_lockout_w(running_machine &machine, int num, int on);
/* return current lockout state for a particular coin */
-int coin_lockout_get_state(running_machine *machine, int num);
+int coin_lockout_get_state(running_machine &machine, int num);
/* enable/disable global coin lockout */
-void coin_lockout_global_w(running_machine *machine, int on);
+void coin_lockout_global_w(running_machine &machine, int on);
/* ----- NVRAM management ----- */
/* load NVRAM from a file */
-void nvram_load(running_machine *machine);
+void nvram_load(running_machine &machine);
/* save NVRAM to a file */
-void nvram_save(running_machine *machine);
+void nvram_save(running_machine &machine);
/* ----- memory card management ----- */
/* create a new memory card with the given index */
-int memcard_create(running_machine *machine, int index, int overwrite);
+int memcard_create(running_machine &machine, int index, int overwrite);
/* "insert" a memory card with the given index and load its data */
-int memcard_insert(running_machine *machine, int index);
+int memcard_insert(running_machine &machine, int index);
/* "eject" a memory card and save its data */
void memcard_eject(running_machine &machine);
/* returns the index of the current memory card, or -1 if none */
-int memcard_present(running_machine *machine);
+int memcard_present(running_machine &machine);
/* ----- miscellaneous bits & pieces ----- */
/* set the status of an LED */
-void set_led_status(running_machine *machine, int num, int value);
+void set_led_status(running_machine &machine, int num, int value);
diff --git a/src/emu/machine/i2cmem.c b/src/emu/machine/i2cmem.c
index 88dd45e805f..063030d6b23 100644
--- a/src/emu/machine/i2cmem.c
+++ b/src/emu/machine/i2cmem.c
@@ -47,7 +47,7 @@ INLINE void ATTR_PRINTF( 3, 4 ) verboselog( device_t *device, int n_level, const
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: I2CMEM(%s) %s", device->machine ->describe_context( ), device->tag(), buf );
+ logerror( "%s: I2CMEM(%s) %s", device->machine().describe_context( ), device->tag(), buf );
}
}
@@ -106,7 +106,7 @@ device_config *i2cmem_device_config::static_alloc_device_config( const machine_c
device_t *i2cmem_device_config::alloc_device( running_machine &machine ) const
{
- return auto_alloc( &machine, i2cmem_device( machine, *this ) );
+ return auto_alloc( machine, i2cmem_device( machine, *this ) );
}
@@ -182,7 +182,7 @@ i2cmem_device::i2cmem_device( running_machine &_machine, const i2cmem_device_con
{
if( m_config.m_page_size > 0 )
{
- m_page = auto_alloc_array( machine, UINT8, m_config.m_page_size );
+ m_page = auto_alloc_array( m_machine, UINT8, m_config.m_page_size );
}
}
@@ -262,7 +262,7 @@ void i2cmem_device::nvram_default()
void i2cmem_device::nvram_read( emu_file &file )
{
int i2cmem_bytes = m_config.m_data_size;
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, i2cmem_bytes );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, i2cmem_bytes );
file.read( buffer, i2cmem_bytes );
@@ -271,7 +271,7 @@ void i2cmem_device::nvram_read( emu_file &file )
m_addrspace[ 0 ]->write_byte( offs, buffer[ offs ] );
}
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
//-------------------------------------------------
@@ -282,7 +282,7 @@ void i2cmem_device::nvram_read( emu_file &file )
void i2cmem_device::nvram_write( emu_file &file )
{
int i2cmem_bytes = m_config.m_data_size;
- UINT8 *buffer = auto_alloc_array( &m_machine, UINT8, i2cmem_bytes );
+ UINT8 *buffer = auto_alloc_array( m_machine, UINT8, i2cmem_bytes );
for( offs_t offs = 0; offs < i2cmem_bytes; offs++ )
{
@@ -291,7 +291,7 @@ void i2cmem_device::nvram_write( emu_file &file )
file.write( buffer, i2cmem_bytes );
- auto_free( &m_machine, buffer );
+ auto_free( m_machine, buffer );
}
diff --git a/src/emu/machine/i8155.c b/src/emu/machine/i8155.c
index 8b6bcfa9cfd..3726e766029 100644
--- a/src/emu/machine/i8155.c
+++ b/src/emu/machine/i8155.c
@@ -138,7 +138,7 @@ device_config *i8155_device_config::static_alloc_device_config(const machine_con
device_t *i8155_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, i8155_device(machine, *this));
+ return auto_alloc(machine, i8155_device(machine, *this));
}
diff --git a/src/emu/machine/i8355.c b/src/emu/machine/i8355.c
index 6c305793710..10671198227 100644
--- a/src/emu/machine/i8355.c
+++ b/src/emu/machine/i8355.c
@@ -83,7 +83,7 @@ device_config *i8355_device_config::static_alloc_device_config(const machine_con
device_t *i8355_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, i8355_device(machine, *this));
+ return auto_alloc(machine, i8355_device(machine, *this));
}
diff --git a/src/emu/machine/idectrl.c b/src/emu/machine/idectrl.c
index 91e5a710dc1..106c4bb5470 100644
--- a/src/emu/machine/idectrl.c
+++ b/src/emu/machine/idectrl.c
@@ -258,9 +258,9 @@ INLINE void signal_delayed_interrupt(ide_state *ide, attotime time, int buffer_r
/* set a timer */
if (buffer_ready)
- ide->device->machine->scheduler().timer_set(time, FUNC(delayed_interrupt_buffer_ready), 0, ide);
+ ide->device->machine().scheduler().timer_set(time, FUNC(delayed_interrupt_buffer_ready), 0, ide);
else
- ide->device->machine->scheduler().timer_set(time, FUNC(delayed_interrupt), 0, ide);
+ ide->device->machine().scheduler().timer_set(time, FUNC(delayed_interrupt), 0, ide);
}
@@ -625,7 +625,7 @@ static void security_error(ide_state *ide)
ide->status &= ~IDE_STATUS_DRIVE_READY;
/* just set a timer and mark ourselves error */
- ide->device->machine->scheduler().timer_set(TIME_SECURITY_ERROR, FUNC(security_error_done), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_SECURITY_ERROR, FUNC(security_error_done), 0, ide);
}
@@ -806,10 +806,10 @@ static void read_first_sector(ide_state *ide)
seek_time = TIME_SEEK_MULTISECTOR;
ide->cur_lba = new_lba;
- ide->device->machine->scheduler().timer_set(seek_time, FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(seek_time, FUNC(read_sector_done_callback), 0, ide);
}
else
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
}
@@ -825,11 +825,11 @@ static void read_next_sector(ide_state *ide)
read_sector_done(ide);
else
/* just set a timer */
- ide->device->machine->scheduler().timer_set(attotime::from_usec(1), FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(read_sector_done_callback), 0, ide);
}
else
/* just set a timer */
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(read_sector_done_callback), 0, ide);
}
@@ -862,13 +862,13 @@ static void continue_write(ide_state *ide)
else
{
/* set a timer to do the write */
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
}
}
else
{
/* set a timer to do the write */
- ide->device->machine->scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
+ ide->device->machine().scheduler().timer_set(TIME_PER_SECTOR, FUNC(write_sector_done_callback), 0, ide);
}
}
@@ -1224,7 +1224,7 @@ static void handle_command(ide_state *ide, UINT8 command)
default:
LOGPRINT(("IDE unknown command (%02X)\n", command));
- debugger_break(ide->device->machine);
+ debugger_break(ide->device->machine());
break;
}
}
@@ -1244,7 +1244,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* logit */
// if (BANK(bank, offset) != IDE_BANK0_DATA && BANK(bank, offset) != IDE_BANK0_STATUS_COMMAND && BANK(bank, offset) != IDE_BANK1_STATUS_CONTROL)
- LOG(("%s:IDE read at %d:%X, size=%d\n", device->machine->describe_context(), bank, offset, size));
+ LOG(("%s:IDE read at %d:%X, size=%d\n", device->machine().describe_context(), bank, offset, size));
switch (BANK(bank, offset))
{
@@ -1279,7 +1279,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* if we're at the end of the buffer, handle it */
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
{
- LOG(("%s:IDE completed PIO read\n", device->machine->describe_context()));
+ LOG(("%s:IDE completed PIO read\n", device->machine().describe_context()));
continue_read(ide);
}
}
@@ -1330,7 +1330,7 @@ static UINT32 ide_controller_read(device_t *device, int bank, offs_t offset, int
/* log anything else */
default:
- logerror("%s:unknown IDE read at %03X, size=%d\n", device->machine->describe_context(), offset, size);
+ logerror("%s:unknown IDE read at %03X, size=%d\n", device->machine().describe_context(), offset, size);
break;
}
@@ -1352,7 +1352,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
/* logit */
if (BANK(bank, offset) != IDE_BANK0_DATA)
- LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", device->machine->describe_context(), bank, offset, data, size));
+ LOG(("%s:IDE write to %d:%X = %08X, size=%d\n", device->machine().describe_context(), bank, offset, data, size));
// fprintf(stderr, "ide write %03x %02x size=%d\n", offset, data, size);
switch (BANK(bank, offset))
{
@@ -1389,7 +1389,7 @@ static void ide_controller_write(device_t *device, int bank, offs_t offset, int
/* if we're at the end of the buffer, handle it */
if (ide->buffer_offset >= IDE_DISK_SECTOR_SIZE)
{
- LOG(("%s:IDE completed PIO write\n", device->machine->describe_context()));
+ LOG(("%s:IDE completed PIO write\n", device->machine().describe_context()));
if (ide->command == IDE_COMMAND_SECURITY_UNLOCK)
{
if (ide->user_password_enable && memcmp(ide->buffer, ide->user_password, 2 + 32) == 0)
@@ -1518,7 +1518,7 @@ static UINT32 ide_bus_master_read(device_t *device, offs_t offset, int size)
{
ide_state *ide = get_safe_token(device);
- LOG(("%s:ide_bus_master_read(%d, %d)\n", device->machine->describe_context(), offset, size));
+ LOG(("%s:ide_bus_master_read(%d, %d)\n", device->machine().describe_context(), offset, size));
/* command register */
if (offset == 0)
@@ -1547,7 +1547,7 @@ static void ide_bus_master_write(device_t *device, offs_t offset, int size, UINT
{
ide_state *ide = get_safe_token(device);
- LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", device->machine->describe_context(), offset, size, data));
+ LOG(("%s:ide_bus_master_write(%d, %d, %08X)\n", device->machine().describe_context(), offset, size, data));
/* command register */
if (offset == 0)
@@ -1792,21 +1792,20 @@ static DEVICE_START( ide_controller )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* store a pointer back to the device */
ide->device = device;
/* set MAME harddisk handle */
config = (const ide_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
- ide->handle = get_disk_handle(device->machine, (config->master != NULL) ? config->master : device->tag());
+ ide->handle = get_disk_handle(device->machine(), (config->master != NULL) ? config->master : device->tag());
ide->disk = hard_disk_open(ide->handle);
assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n");
/* find the bus master space */
if (config->bmcpu != NULL)
{
- device_t *bmtarget = device->machine->device(config->bmcpu);
+ device_t *bmtarget = device->machine().device(config->bmcpu);
if (bmtarget == NULL)
throw emu_fatalerror("IDE controller '%s' bus master target '%s' doesn't exist!", device->tag(), config->bmcpu);
device_memory_interface *memory;
@@ -1835,8 +1834,8 @@ static DEVICE_START( ide_controller )
}
/* create a timer for timing status */
- ide->last_status_timer = device->machine->scheduler().timer_alloc(FUNC(NULL));
- ide->reset_timer = device->machine->scheduler().timer_alloc(FUNC(reset_callback), (void *)device);
+ ide->last_status_timer = device->machine().scheduler().timer_alloc(FUNC(NULL));
+ ide->reset_timer = device->machine().scheduler().timer_alloc(FUNC(reset_callback), (void *)device);
/* register ide states */
device->save_item(NAME(ide->adapter_control));
@@ -1910,14 +1909,14 @@ static DEVICE_RESET( ide_controller )
LOG(("IDE controller reset performed\n"));
- if (device->machine->device( "harddisk" )) {
+ if (device->machine().device( "harddisk" )) {
if (!ide->disk)
{
- ide->handle = hd_get_chd_file( device->machine->device( "harddisk" ) ); // should be config->master
+ ide->handle = hd_get_chd_file( device->machine().device( "harddisk" ) ); // should be config->master
if (ide->handle)
{
- ide->disk = hd_get_hard_disk_file( device->machine->device( "harddisk" ) ); // should be config->master
+ ide->disk = hd_get_hard_disk_file( device->machine().device( "harddisk" ) ); // should be config->master
if (ide->disk != NULL)
{
diff --git a/src/emu/machine/ins8250.c b/src/emu/machine/ins8250.c
index a23c3ab4981..e44641922b3 100644
--- a/src/emu/machine/ins8250.c
+++ b/src/emu/machine/ins8250.c
@@ -437,7 +437,7 @@ READ8_DEVICE_HANDLER( ins8250_r )
case 5:
#if 0
- if (ins8250->send.active && (machine->time()-ins8250->send.time>uart_byte_time(n)))
+ if (ins8250->send.active && (machine.time()-ins8250->send.time>uart_byte_time(n)))
{
// currently polling is enough for pc1512
ins8250->lsr |= 0x40; /* set TSRE */
diff --git a/src/emu/machine/k033906.c b/src/emu/machine/k033906.c
index 30f8fa35baf..bea1fdd7c49 100644
--- a/src/emu/machine/k033906.c
+++ b/src/emu/machine/k033906.c
@@ -65,8 +65,8 @@ void k033906_device::device_start()
{
m_voodoo = m_machine.device(m_config.m_voodoo_tag);
- m_reg = auto_alloc_array(&m_machine, UINT32, 256);
- m_ram = auto_alloc_array(&m_machine, UINT32, 32768);
+ m_reg = auto_alloc_array(m_machine, UINT32, 256);
+ m_ram = auto_alloc_array(m_machine, UINT32, 32768);
m_reg_set = 0;
diff --git a/src/emu/machine/k056230.c b/src/emu/machine/k056230.c
index 9d17ae4b734..54c944e1f03 100644
--- a/src/emu/machine/k056230.c
+++ b/src/emu/machine/k056230.c
@@ -74,7 +74,7 @@ void k056230_device::device_start()
m_is_thunderh = m_config.m_is_thunderh;
- m_ram = auto_alloc_array(&m_machine, UINT32, 0x2000);
+ m_ram = auto_alloc_array(m_machine, UINT32, 0x2000);
save_pointer(NAME(m_ram), 0x2000);
}
diff --git a/src/emu/machine/latch8.c b/src/emu/machine/latch8.c
index 289588f28e6..5ec709f1597 100644
--- a/src/emu/machine/latch8.c
+++ b/src/emu/machine/latch8.c
@@ -44,7 +44,7 @@ static void update(device_t *device, UINT8 new_val, UINT8 mask)
UINT8 changed = old_val ^ latch8->value;
for (i=0; i<8; i++)
if (((changed & (1<<i)) != 0) && latch8->intf->node_map[i] != 0)
- discrete_sound_w(device->machine->device(latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
+ discrete_sound_w(device->machine().device(latch8->intf->node_device[i]), latch8->intf->node_map[i] , (latch8->value >> i) & 1);
}
}
@@ -83,7 +83,7 @@ READ8_DEVICE_HANDLER( latch8_r )
if (latch8->has_read)
{
/* temporary hack until all relevant systems are devices */
- address_space *space = device->machine->firstcpu->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
int i;
for (i=0; i<8; i++)
{
@@ -105,7 +105,7 @@ WRITE8_DEVICE_HANDLER( latch8_w )
assert(offset == 0);
if (latch8->intf->nosync != 0xff)
- device->machine->scheduler().synchronize(FUNC(latch8_timerproc), (0xFF << 8) | data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(latch8_timerproc), (0xFF << 8) | data, (void *)device);
else
update(device, data, 0xFF);
}
@@ -165,7 +165,7 @@ INLINE void latch8_bitx_w(device_t *device, int bit, offs_t offset, UINT8 data)
if (latch8->intf->nosync & mask)
update(device, masked_data, mask);
else
- device->machine->scheduler().synchronize(FUNC(latch8_timerproc), (mask << 8) | masked_data, (void *) device);
+ device->machine().scheduler().synchronize(FUNC(latch8_timerproc), (mask << 8) | masked_data, (void *) device);
}
WRITE8_DEVICE_HANDLER( latch8_bit0_w ) { latch8_bitx_w(device, 0, offset, data); }
@@ -206,7 +206,7 @@ static DEVICE_START( latch8 )
{
if (latch8->devices[i] != NULL)
fatalerror("Device %s: Bit %d already has a handler.\n", device->tag(), i);
- latch8->devices[i] = device->machine->device(latch8->intf->devread[i].tag);
+ latch8->devices[i] = device->machine().device(latch8->intf->devread[i].tag);
if (latch8->devices[i] == NULL)
fatalerror("Device %s: Unable to find device %s\n", device->tag(), latch8->intf->devread[i].tag);
latch8->has_devread = 1;
diff --git a/src/emu/machine/ldcore.c b/src/emu/machine/ldcore.c
index b7e540ca0ab..353fb68d130 100644
--- a/src/emu/machine/ldcore.c
+++ b/src/emu/machine/ldcore.c
@@ -146,8 +146,8 @@ static void read_track_data(laserdisc_state *ld);
static void process_track_data(device_t *device);
static DEVICE_START( laserdisc_sound );
static STREAM_UPDATE( custom_stream_callback );
-static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode);
-static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+static void configuration_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+static void configuration_save(running_machine &machine, int config_type, xml_data_node *parentnode);
@@ -292,7 +292,7 @@ static void vblank_state_changed(screen_device &screen, void *param, bool vblank
device_t *device = (device_t *)param;
laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core;
- attotime curtime = screen.machine->time();
+ attotime curtime = screen.machine().time();
/* update current track based on slider speed */
update_slider_pos(ldcore, curtime);
@@ -305,7 +305,7 @@ static void vblank_state_changed(screen_device &screen, void *param, bool vblank
(*ldcore->intf.vsync)(ld, &ldcore->metadata[ldcore->fieldnum], ldcore->fieldnum, curtime);
/* set a timer to begin fetching the next frame just before the VBI data would be fetched */
- screen.machine->scheduler().timer_set(screen.time_until_pos(16*2), FUNC(perform_player_update), 0, ld);
+ screen.machine().scheduler().timer_set(screen.time_until_pos(16*2), FUNC(perform_player_update), 0, ld);
}
}
@@ -319,7 +319,7 @@ static TIMER_CALLBACK( perform_player_update )
{
laserdisc_state *ld = (laserdisc_state *)ptr;
ldcore_data *ldcore = ld->core;
- attotime curtime = machine->time();
+ attotime curtime = machine.time();
/* wait for previous read and decode to finish */
process_track_data(ld->device);
@@ -554,7 +554,7 @@ void ldcore_set_slider_speed(laserdisc_state *ld, INT32 tracks_per_vsync)
ldcore_data *ldcore = ld->core;
attotime vsyncperiod = ld->screen->frame_period();
- update_slider_pos(ldcore, ld->device->machine->time());
+ update_slider_pos(ldcore, ld->device->machine().time());
/* if 0, set the time to 0 */
if (tracks_per_vsync == 0)
@@ -582,7 +582,7 @@ void ldcore_advance_slider(laserdisc_state *ld, INT32 numtracks)
{
ldcore_data *ldcore = ld->core;
- update_slider_pos(ldcore, ld->device->machine->time());
+ update_slider_pos(ldcore, ld->device->machine().time());
add_and_clamp_track(ldcore, numtracks);
if (LOG_SLIDER)
printf("Advance by %d\n", numtracks);
@@ -599,7 +599,7 @@ slider_position ldcore_get_slider_position(laserdisc_state *ld)
ldcore_data *ldcore = ld->core;
/* update the slider position first */
- update_slider_pos(ldcore, ld->device->machine->time());
+ update_slider_pos(ldcore, ld->device->machine().time());
/* return the status */
if (ldcore->curtrack == 1)
@@ -964,7 +964,7 @@ static void process_track_data(device_t *device)
static DEVICE_START( laserdisc_sound )
{
sound_token *token = (sound_token *)downcast<legacy_device_base *>(device)->token();
- token->stream = device->machine->sound().stream_alloc(*device, 0, 2, 48000, token, custom_stream_callback);
+ token->stream = device->machine().sound().stream_alloc(*device, 0, 2, 48000, token, custom_stream_callback);
token->ld = NULL;
}
@@ -1072,7 +1072,7 @@ static STREAM_UPDATE( custom_stream_callback )
the configuration file
-------------------------------------------------*/
-static void configuration_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void configuration_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
xml_data_node *overnode;
xml_data_node *ldnode;
@@ -1089,7 +1089,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da
for (ldnode = xml_get_sibling(parentnode->child, "device"); ldnode != NULL; ldnode = xml_get_sibling(ldnode->next, "device"))
{
const char *devtag = xml_get_attribute_string(ldnode, "tag", "");
- device_t *device = machine->device(devtag);
+ device_t *device = machine.device(devtag);
if (device != NULL)
{
laserdisc_state *ld = get_safe_token(device);
@@ -1115,7 +1115,7 @@ static void configuration_load(running_machine *machine, int config_type, xml_da
configuration file
-------------------------------------------------*/
-static void configuration_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+static void configuration_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
device_t *device;
@@ -1124,7 +1124,7 @@ static void configuration_save(running_machine *machine, int config_type, xml_da
return;
/* iterate over disc devices */
- for (device = machine->m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
+ for (device = machine.m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
{
laserdisc_config *origconfig = (laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
laserdisc_state *ld = get_safe_token(device);
@@ -1214,7 +1214,7 @@ void laserdisc_overlay_enable(device_t *device, int enable)
SCREEN_UPDATE( laserdisc )
{
- device_t *laserdisc = screen->machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = screen->machine().m_devicelist.first(LASERDISC);
if (laserdisc != NULL)
{
const rectangle &visarea = screen->visible_area();
@@ -1245,7 +1245,7 @@ SCREEN_UPDATE( laserdisc )
if (overbitmap != NULL)
{
if (overbitmap->format == BITMAP_FORMAT_INDEXED16)
- ldcore->overtex->set_bitmap(overbitmap, &ldcore->config.overclip, TEXFORMAT_PALETTEA16, laserdisc->machine->palette);
+ ldcore->overtex->set_bitmap(overbitmap, &ldcore->config.overclip, TEXFORMAT_PALETTEA16, laserdisc->machine().palette);
else if (overbitmap->format == BITMAP_FORMAT_RGB32)
ldcore->overtex->set_bitmap(overbitmap, &ldcore->config.overclip, TEXFORMAT_ARGB32);
}
@@ -1331,7 +1331,7 @@ static void init_disc(device_t *device)
if (config->getdisc != NULL)
ldcore->disc = (*config->getdisc)(device);
else
- ldcore->disc = get_disk_handle(device->machine, device->tag());
+ ldcore->disc = get_disk_handle(device->machine(), device->tag());
/* set default parameters */
ldcore->width = 720;
@@ -1372,7 +1372,7 @@ static void init_disc(device_t *device)
ldcore->chdtracks = totalhunks / 2;
/* allocate memory for the precomputed per-frame metadata */
- ldcore->vbidata = auto_alloc_array(device->machine, UINT8, totalhunks * VBI_PACKED_BYTES);
+ ldcore->vbidata = auto_alloc_array(device->machine(), UINT8, totalhunks * VBI_PACKED_BYTES);
err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL, NULL);
if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES)
fatalerror("Precomputed VBI metadata missing or incorrect size");
@@ -1401,23 +1401,23 @@ static void init_video(device_t *device)
frame_data *frame = &ldcore->frame[index];
/* first allocate a YUY16 bitmap at 2x the height */
- frame->bitmap = auto_alloc(device->machine, bitmap_t(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16));
+ frame->bitmap = auto_alloc(device->machine(), bitmap_t(ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16));
fillbitmap_yuy16(frame->bitmap, 40, 109, 240);
/* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
- frame->visbitmap = auto_alloc(device->machine, bitmap_t(BITMAP_ADDR16(frame->bitmap, 44, frame->bitmap->width * 8 / 720),
+ frame->visbitmap = auto_alloc(device->machine(), bitmap_t(BITMAP_ADDR16(frame->bitmap, 44, frame->bitmap->width * 8 / 720),
frame->bitmap->width - 2 * frame->bitmap->width * 8 / 720,
frame->bitmap->height - 44,
frame->bitmap->rowpixels, frame->bitmap->format));
}
/* allocate an empty frame of the same size */
- ldcore->emptyframe = auto_bitmap_alloc(device->machine, ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
+ ldcore->emptyframe = auto_bitmap_alloc(device->machine(), ldcore->width, ldcore->height * 2, BITMAP_FORMAT_YUY16);
fillbitmap_yuy16(ldcore->emptyframe, 0, 128, 128);
/* allocate texture for rendering */
ldcore->videoenable = TRUE;
- ldcore->videotex = device->machine->render().texture_alloc();
+ ldcore->videotex = device->machine().render().texture_alloc();
if (ldcore->videotex == NULL)
fatalerror("Out of memory allocating video texture");
@@ -1432,9 +1432,9 @@ static void init_video(device_t *device)
if (ldcore->config.overwidth > 0 && ldcore->config.overheight > 0 && ldcore->config.overupdate != NULL)
{
ldcore->overenable = TRUE;
- ldcore->overbitmap[0] = auto_bitmap_alloc(device->machine, ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
- ldcore->overbitmap[1] = auto_bitmap_alloc(device->machine, ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
- ldcore->overtex = device->machine->render().texture_alloc();
+ ldcore->overbitmap[0] = auto_bitmap_alloc(device->machine(), ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
+ ldcore->overbitmap[1] = auto_bitmap_alloc(device->machine(), ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
+ ldcore->overtex = device->machine().render().texture_alloc();
if (ldcore->overtex == NULL)
fatalerror("Out of memory allocating overlay texture");
}
@@ -1452,13 +1452,13 @@ static void init_audio(device_t *device)
ldcore_data *ldcore = ld->core;
/* find the custom audio */
- ldcore->audiocustom = device->machine->device(ldcore->config.sound);
+ ldcore->audiocustom = device->machine().device(ldcore->config.sound);
/* allocate audio buffers */
ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million;
ldcore->audiobufsize = ldcore->audiomaxsamples * 4;
- ldcore->audiobuffer[0] = auto_alloc_array(device->machine, INT16, ldcore->audiobufsize);
- ldcore->audiobuffer[1] = auto_alloc_array(device->machine, INT16, ldcore->audiobufsize);
+ ldcore->audiobuffer[0] = auto_alloc_array(device->machine(), INT16, ldcore->audiobufsize);
+ ldcore->audiobuffer[1] = auto_alloc_array(device->machine(), INT16, ldcore->audiobufsize);
}
@@ -1480,7 +1480,7 @@ static DEVICE_START( laserdisc )
int index;
/* ensure that our screen is started first */
- ld->screen = downcast<screen_device *>(device->machine->device(config->screen));
+ ld->screen = downcast<screen_device *>(device->machine().device(config->screen));
assert(ld->screen != NULL);
if (!ld->screen->started())
throw device_missing_dependencies();
@@ -1489,14 +1489,14 @@ static DEVICE_START( laserdisc )
ld->device = device;
/* allocate memory for the core state */
- ld->core = auto_alloc_clear(device->machine, ldcore_data);
+ ld->core = auto_alloc_clear(device->machine(), ldcore_data);
ldcore = ld->core;
/* determine the maximum player-specific state size and allocate it */
statesize = 0;
for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++)
statesize = MAX(statesize, player_interfaces[index]->statesize);
- ld->player = (ldplayer_data *)auto_alloc_array_clear(device->machine, UINT8, statesize);
+ ld->player = (ldplayer_data *)auto_alloc_array_clear(device->machine(), UINT8, statesize);
/* copy config data to the live state */
ldcore->config = *config;
@@ -1517,7 +1517,7 @@ static DEVICE_START( laserdisc )
init_audio(device);
/* register callbacks */
- config_register(device->machine, "laserdisc", configuration_load, configuration_save);
+ config_register(device->machine(), "laserdisc", configuration_load, configuration_save);
}
@@ -1535,10 +1535,10 @@ static DEVICE_STOP( laserdisc )
chd_async_complete(ldcore->disc);
/* free any textures and palettes */
- device->machine->render().texture_free(ldcore->videotex);
+ device->machine().render().texture_free(ldcore->videotex);
if (ldcore->videopalette != NULL)
palette_deref(ldcore->videopalette);
- device->machine->render().texture_free(ldcore->overtex);
+ device->machine().render().texture_free(ldcore->overtex);
}
@@ -1549,7 +1549,7 @@ static DEVICE_STOP( laserdisc )
static DEVICE_RESET( laserdisc )
{
laserdisc_state *ld = get_safe_token(device);
- attotime curtime = device->machine->time();
+ attotime curtime = device->machine().time();
ldcore_data *ldcore = ld->core;
int pltype, line;
diff --git a/src/emu/machine/ldpr8210.c b/src/emu/machine/ldpr8210.c
index 5f9c6e22ed0..1e90f5862f6 100644
--- a/src/emu/machine/ldpr8210.c
+++ b/src/emu/machine/ldpr8210.c
@@ -341,7 +341,7 @@ const ldplayer_interface pr8210_interface =
static void pr8210_init(laserdisc_state *ld)
{
astring tempstring;
- attotime curtime = ld->device->machine->time();
+ attotime curtime = ld->device->machine().time();
ldplayer_data *player = ld->player;
/* reset our state */
@@ -381,10 +381,10 @@ static void pr8210_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int field
/* signal VSYNC and set a timer to turn it off */
player->vsync = TRUE;
- ld->device->machine->scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
/* also set a timer to fetch the VBI data when it is ready */
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
}
@@ -452,7 +452,7 @@ static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
/* handle rising edge */
if (prev != ASSERT_LINE && data == ASSERT_LINE)
{
- attotime curtime = ld->device->machine->time();
+ attotime curtime = ld->device->machine().time();
attotime delta, overalldelta;
int longpulse;
@@ -841,7 +841,7 @@ static WRITE8_HANDLER( pr8210_port2_w )
/* on the falling edge of bit 5, start the slow timer */
if (!(data & 0x20) && (prev & 0x20))
- player->slowtrg = space->machine->time();
+ player->slowtrg = space->machine().time();
/* bit 6 when low triggers an IRQ on the MCU */
if (player->cpu != NULL)
@@ -1121,7 +1121,7 @@ static void simutrek_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fie
if (LOG_SIMUTREK)
printf("%3d:VSYNC IRQ\n", ld->screen->vpos());
device_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
- ld->device->machine->scheduler().timer_set(ld->screen->scan_period(), FUNC(irq_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->scan_period(), FUNC(irq_off), 0, ld);
}
}
@@ -1166,7 +1166,7 @@ static UINT8 simutrek_status_r(laserdisc_state *ld)
static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
{
- ld->device->machine->scheduler().synchronize(FUNC(simutrek_latched_data_w), data, ld);
+ ld->device->machine().scheduler().synchronize(FUNC(simutrek_latched_data_w), data, ld);
if (LOG_SIMUTREK)
printf("%03d:**** Simutrek Command = %02X\n", ld->screen->vpos(), data);
}
diff --git a/src/emu/machine/ldv1000.c b/src/emu/machine/ldv1000.c
index f9477730987..02bc16486df 100644
--- a/src/emu/machine/ldv1000.c
+++ b/src/emu/machine/ldv1000.c
@@ -258,13 +258,13 @@ static void ldv1000_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fiel
/* signal VSYNC and set a timer to turn it off */
player->vsync = TRUE;
- ld->device->machine->scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->scan_period() * 4, FUNC(vsync_off), 0, ld);
/* also set a timer to fetch the VBI data when it is ready */
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(19*2), FUNC(vbi_data_fetch), 0, ld);
/* boost interleave for the first 1ms to improve communications */
- ld->device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_msec(1));
+ ld->device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_msec(1));
}
@@ -526,7 +526,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_porta_w )
laserdisc_state *ld = ldcore_get_safe_token(device->owner());
ld->player->counter_start = data;
if (LOG_PORT_IO)
- printf("%s:PORTA.0=%02X\n", device->machine->describe_context(), data);
+ printf("%s:PORTA.0=%02X\n", device->machine().describe_context(), data);
}
@@ -589,7 +589,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
player->portc0 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0x0f) != 0)
{
- printf("%s:PORTC.0=%02X", device->machine->describe_context(), data);
+ printf("%s:PORTC.0=%02X", device->machine().describe_context(), data);
if (data & 0x01) printf(" PRELOAD");
if (!(data & 0x02)) printf(" /MULTIJUMP");
if (data & 0x04) printf(" SCANMODE");
@@ -685,7 +685,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portb_w )
player->portb1 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0xff) != 0)
{
- printf("%s:PORTB.1=%02X:", device->machine->describe_context(), data);
+ printf("%s:PORTB.1=%02X:", device->machine().describe_context(), data);
if (!(data & 0x01)) printf(" FOCSON");
if (!(data & 0x02)) printf(" SPDLRUN");
if (!(data & 0x04)) printf(" JUMPTRIG");
@@ -741,7 +741,7 @@ static WRITE8_DEVICE_HANDLER( ppi1_portc_w )
player->portc1 = data;
if (LOG_PORT_IO && ((data ^ prev) & 0xcf) != 0)
{
- printf("%s:PORTC.1=%02X", device->machine->describe_context(), data);
+ printf("%s:PORTC.1=%02X", device->machine().describe_context(), data);
if (data & 0x01) printf(" AUD1");
if (data & 0x02) printf(" AUD2");
if (data & 0x04) printf(" AUDEN");
diff --git a/src/emu/machine/ldvp931.c b/src/emu/machine/ldvp931.c
index e01a3f07541..d3b5d0005f7 100644
--- a/src/emu/machine/ldvp931.c
+++ b/src/emu/machine/ldvp931.c
@@ -234,7 +234,7 @@ static void vp931_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldn
/* set the ERP signal to 1 to indicate start of frame, and set a timer to turn it off */
ld->player->daticerp = 1;
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(15*2), FUNC(erp_off), 0, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(15*2), FUNC(erp_off), 0, ld);
}
@@ -246,7 +246,7 @@ static void vp931_vsync(laserdisc_state *ld, const vbi_metadata *vbi, int fieldn
static INT32 vp931_update(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime)
{
/* set the first VBI timer to go at the start of line 16 */
- ld->device->machine->scheduler().timer_set(ld->screen->time_until_pos(16*2), FUNC(vbi_data_fetch), LASERDISC_CODE_LINE16 << 2, ld);
+ ld->device->machine().scheduler().timer_set(ld->screen->time_until_pos(16*2), FUNC(vbi_data_fetch), LASERDISC_CODE_LINE16 << 2, ld);
/* play forward by default */
return fieldnum;
@@ -261,7 +261,7 @@ static INT32 vp931_update(laserdisc_state *ld, const vbi_metadata *vbi, int fiel
static void vp931_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
{
/* set a timer to synchronize execution before sending the data */
- ld->device->machine->scheduler().synchronize(FUNC(deferred_data_w), data, ld);
+ ld->device->machine().scheduler().synchronize(FUNC(deferred_data_w), data, ld);
}
@@ -283,7 +283,7 @@ static UINT8 vp931_data_r(laserdisc_state *ld)
}
/* also boost interleave for 4 scanlines to ensure proper communications */
- ld->device->machine->scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
+ ld->device->machine().scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
return player->tocontroller;
}
@@ -336,7 +336,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
if (which == 0)
{
device_set_input_line(player->cpu, MCS48_INPUT_IRQ, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_nsec(5580), FUNC(irq_off), 0, ld);
+ machine.scheduler().timer_set(attotime::from_nsec(5580), FUNC(irq_off), 0, ld);
}
/* clock the data strobe on each subsequent callback */
@@ -344,7 +344,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
{
player->daticval = code >> (8 * (3 - which));
player->datastrobe = 1;
- machine->scheduler().timer_set(attotime::from_nsec(5000), FUNC(datastrobe_off), 0, ld);
+ machine.scheduler().timer_set(attotime::from_nsec(5000), FUNC(datastrobe_off), 0, ld);
}
/* determine the next bit to fetch and reprime ourself */
@@ -354,7 +354,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
line++;
}
if (line <= LASERDISC_CODE_LINE18 + 1)
- machine->scheduler().timer_set(ld->screen->time_until_pos(line*2, which * 2 * ld->screen->width() / 4), FUNC(vbi_data_fetch), (line << 2), ld);
+ machine.scheduler().timer_set(ld->screen->time_until_pos(line*2, which * 2 * ld->screen->width() / 4), FUNC(vbi_data_fetch), (line << 2), ld);
}
@@ -617,7 +617,7 @@ static WRITE8_HANDLER( to_controller_w )
(*player->data_ready_cb)(ld->device, TRUE);
/* also boost interleave for 4 scanlines to ensure proper communications */
- ld->device->machine->scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
+ ld->device->machine().scheduler().boost_interleave(attotime::zero, ld->screen->scan_period() * 4);
}
diff --git a/src/emu/machine/mb3773.c b/src/emu/machine/mb3773.c
index 55dbbed0ae8..ae114786ab7 100644
--- a/src/emu/machine/mb3773.c
+++ b/src/emu/machine/mb3773.c
@@ -55,7 +55,7 @@ device_config *mb3773_device_config::static_alloc_device_config( const machine_c
device_t *mb3773_device_config::alloc_device( running_machine &machine ) const
{
- return auto_alloc( &machine, mb3773_device( machine, *this ) );
+ return auto_alloc( machine, mb3773_device( machine, *this ) );
}
diff --git a/src/emu/machine/mb87078.c b/src/emu/machine/mb87078.c
index 5a60dd5686a..c487e751ae8 100644
--- a/src/emu/machine/mb87078.c
+++ b/src/emu/machine/mb87078.c
@@ -175,7 +175,7 @@ static void gain_recalc( device_t *device )
int old_index = mb87078->gain[i];
mb87078->gain[i] = calc_gain_index(mb87078->latch[0][i], mb87078->latch[1][i]);
if (old_index != mb87078->gain[i])
- mb87078->gain_changed_cb(device->machine, i, mb87078_gain_percent[mb87078->gain[i]]);
+ mb87078->gain_changed_cb(device->machine(), i, mb87078_gain_percent[mb87078->gain[i]]);
}
}
diff --git a/src/emu/machine/mb87078.h b/src/emu/machine/mb87078.h
index 9c5397cd966..7f62b44c06e 100644
--- a/src/emu/machine/mb87078.h
+++ b/src/emu/machine/mb87078.h
@@ -16,7 +16,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*mb87078_gain_changed_cb)(running_machine *machine, int channel, int percent /*, float decibels*/);
+typedef void (*mb87078_gain_changed_cb)(running_machine &machine, int channel, int percent /*, float decibels*/);
typedef struct _mb87078_interface mb87078_interface;
struct _mb87078_interface
diff --git a/src/emu/machine/mc146818.c b/src/emu/machine/mc146818.c
index 926818829cc..8f31779a58b 100644
--- a/src/emu/machine/mc146818.c
+++ b/src/emu/machine/mc146818.c
@@ -141,7 +141,7 @@ device_config *mc146818_device_config::static_alloc_device_config(const machine_
device_t *mc146818_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, mc146818_device(machine, *this));
+ return auto_alloc(machine, mc146818_device(machine, *this));
}
@@ -436,7 +436,7 @@ READ8_MEMBER( mc146818_device::read )
switch (m_index % MC146818_DATA_SIZE) {
case 0xa:
data = m_data[m_index % MC146818_DATA_SIZE];
- if ((space.machine->time() - m_last_refresh) < attotime::from_hz(32768))
+ if ((space.machine().time() - m_last_refresh) < attotime::from_hz(32768))
data |= 0x80;
#if 0
/* for pc1512 bios realtime clock test */
diff --git a/src/emu/machine/microtch.c b/src/emu/machine/microtch.c
index 4d07c268216..128dc29c383 100644
--- a/src/emu/machine/microtch.c
+++ b/src/emu/machine/microtch.c
@@ -151,7 +151,7 @@ static TIMER_CALLBACK(microtouch_timer_callback)
}
};
-void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb)
+void microtouch_init(running_machine &machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb)
{
memset(&microtouch, 0, sizeof(microtouch));
@@ -159,7 +159,7 @@ void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microto
microtouch.tx_callback = tx_cb;
microtouch.touch_callback = touch_cb;
- microtouch.timer = machine->scheduler().timer_alloc(FUNC(microtouch_timer_callback));
+ microtouch.timer = machine.scheduler().timer_alloc(FUNC(microtouch_timer_callback));
microtouch.timer->adjust(attotime::from_hz(167*5), 0, attotime::from_hz(167*5));
state_save_register_item(machine, "microtouch", NULL, 0, microtouch.reset_done);
diff --git a/src/emu/machine/microtch.h b/src/emu/machine/microtch.h
index efa6c2a4f12..d378c49eb91 100644
--- a/src/emu/machine/microtch.h
+++ b/src/emu/machine/microtch.h
@@ -3,10 +3,10 @@
INPUT_PORTS_EXTERN(microtouch);
-typedef void (*microtouch_tx_func)(running_machine *machine, UINT8 data);
-typedef int (*microtouch_touch_func)(running_machine *machine, int *touch_x, int *touch_y);
+typedef void (*microtouch_tx_func)(running_machine &machine, UINT8 data);
+typedef int (*microtouch_touch_func)(running_machine &machine, int *touch_x, int *touch_y);
-void microtouch_init(running_machine *machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb);
+void microtouch_init(running_machine &machine, microtouch_tx_func tx_cb, microtouch_touch_func touch_cb);
void microtouch_rx(int count, UINT8* data);
#endif //_MICROTOUCH_H
diff --git a/src/emu/machine/msm6242.c b/src/emu/machine/msm6242.c
index 31bc218740f..8ba28098905 100644
--- a/src/emu/machine/msm6242.c
+++ b/src/emu/machine/msm6242.c
@@ -58,7 +58,7 @@ READ8_DEVICE_HANDLER( msm6242_r )
}
else /* otherwise, use the current time */
{
- device->machine->current_datetime(curtime);
+ device->machine().current_datetime(curtime);
}
switch(offset)
@@ -103,7 +103,7 @@ READ8_DEVICE_HANDLER( msm6242_r )
case MSM6242_REG_CF: return msm6242->reg[2];
}
- logerror("%s: MSM6242 unmapped offset %02x read\n", device->machine->describe_context(), offset);
+ logerror("%s: MSM6242 unmapped offset %02x read\n", device->machine().describe_context(), offset);
return 0;
}
@@ -120,7 +120,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w )
if (data & 1) /* was Hold set? */
{
- device->machine->current_datetime(msm6242->hold_time);
+ device->machine().current_datetime(msm6242->hold_time);
}
return;
@@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( msm6242_w )
}
}
- logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", device->machine->describe_context(), offset, data);
+ logerror("%s: MSM6242 unmapped offset %02x written with %02x\n", device->machine().describe_context(), offset, data);
}
diff --git a/src/emu/machine/nmc9306.c b/src/emu/machine/nmc9306.c
index 2ea9c963365..71ded4d32ad 100644
--- a/src/emu/machine/nmc9306.c
+++ b/src/emu/machine/nmc9306.c
@@ -93,7 +93,7 @@ device_config *nmc9306_device_config::static_alloc_device_config(const machine_c
device_t *nmc9306_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, nmc9306_device(machine, *this));
+ return auto_alloc(machine, nmc9306_device(machine, *this));
}
diff --git a/src/emu/machine/nvram.c b/src/emu/machine/nvram.c
index 33894e7a6a3..58e174a0d92 100644
--- a/src/emu/machine/nvram.c
+++ b/src/emu/machine/nvram.c
@@ -83,7 +83,7 @@ device_config *nvram_device_config::static_alloc_device_config(const machine_con
device_t *nvram_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, nvram_device(machine, *this));
+ return auto_alloc(machine, nvram_device(machine, *this));
}
diff --git a/src/emu/machine/pc16552d.c b/src/emu/machine/pc16552d.c
index 3b9888d040b..4595d48a85f 100644
--- a/src/emu/machine/pc16552d.c
+++ b/src/emu/machine/pc16552d.c
@@ -54,7 +54,7 @@ typedef struct
{
PC16552D_CHANNEL ch[2];
int frequency;
- void (* irq_handler)(running_machine *machine, int channel, int value);
+ void (* irq_handler)(running_machine &machine, int channel, int value);
void (* tx_callback)(int channel, int count, UINT8* data);
} PC16552D_REGS;
@@ -67,7 +67,7 @@ static PC16552D_REGS duart[MAX_PC16552D_CHIPS];
static const int rx_trigger_level[4] = { 1, 4, 8, 14 };
-static void check_interrupts(running_machine *machine, int chip, int channel)
+static void check_interrupts(running_machine &machine, int chip, int channel)
{
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
int signal = 0;
@@ -89,7 +89,7 @@ static void check_interrupts(running_machine *machine, int chip, int channel)
}
}
-static void duart_push_rx_fifo(running_machine *machine, int chip, int channel, UINT8 data)
+static void duart_push_rx_fifo(running_machine &machine, int chip, int channel, UINT8 data)
{
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -114,7 +114,7 @@ static void duart_push_rx_fifo(running_machine *machine, int chip, int channel,
}
}
-static UINT8 duart_pop_rx_fifo(running_machine *machine, int chip, int channel)
+static UINT8 duart_pop_rx_fifo(running_machine &machine, int chip, int channel)
{
UINT8 r;
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -183,7 +183,7 @@ static UINT8 duart_pop_tx_fifo(int chip, int channel, UINT8 data)
#endif
-static UINT8 duart_r(running_machine *machine, int chip, int reg)
+static UINT8 duart_r(running_machine &machine, int chip, int reg)
{
int channel = (reg >> 3) & 1;
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -291,7 +291,7 @@ static UINT8 duart_r(running_machine *machine, int chip, int reg)
return ch->reg[reg];
}
-static void duart_w(running_machine *machine, int chip, int reg, UINT8 data)
+static void duart_w(running_machine &machine, int chip, int reg, UINT8 data)
{
int channel = (reg >> 3) & 1;
PC16552D_CHANNEL *ch = &duart[chip].ch[channel];
@@ -387,7 +387,7 @@ static void duart_w(running_machine *machine, int chip, int reg, UINT8 data)
/*****************************************************************************/
-void pc16552d_init(running_machine *machine, int chip, int frequency, void (* irq_handler)(running_machine *machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data))
+void pc16552d_init(running_machine &machine, int chip, int frequency, void (* irq_handler)(running_machine &machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data))
{
memset(&duart[chip], 0, sizeof(PC16552D_REGS));
@@ -400,14 +400,14 @@ void pc16552d_init(running_machine *machine, int chip, int frequency, void (* ir
duart[chip].ch[1].pending_interrupt = 0;
// allocate transmit timers
- duart[chip].ch[0].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
+ duart[chip].ch[0].tx_fifo_timer = machine.scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
duart[chip].ch[0].tx_fifo_timer->adjust(attotime::never, (chip * 2) + 0);
- duart[chip].ch[1].tx_fifo_timer = machine->scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
+ duart[chip].ch[1].tx_fifo_timer = machine.scheduler().timer_alloc(FUNC(tx_fifo_timer_callback));
duart[chip].ch[1].tx_fifo_timer->adjust(attotime::never, (chip * 2) + 1);
}
-void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 data)
+void pc16552d_rx_data(running_machine &machine, int chip, int channel, UINT8 data)
{
if (duart[chip].ch[channel].reg[REG_FIFO_CTRL] & 0x01) // RCVR & XMIT FIFO enable
{
@@ -420,20 +420,20 @@ void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 dat
READ8_HANDLER(pc16552d_0_r)
{
- return duart_r(space->machine, 0, offset);
+ return duart_r(space->machine(), 0, offset);
}
WRITE8_HANDLER(pc16552d_0_w)
{
- duart_w(space->machine, 0, offset, data);
+ duart_w(space->machine(), 0, offset, data);
}
READ8_HANDLER(pc16552d_1_r)
{
- return duart_r(space->machine, 1, offset);
+ return duart_r(space->machine(), 1, offset);
}
WRITE8_HANDLER(pc16552d_1_w)
{
- duart_w(space->machine, 1, offset, data);
+ duart_w(space->machine(), 1, offset, data);
}
diff --git a/src/emu/machine/pc16552d.h b/src/emu/machine/pc16552d.h
index 58133ccc24e..93f2181e37a 100644
--- a/src/emu/machine/pc16552d.h
+++ b/src/emu/machine/pc16552d.h
@@ -1,8 +1,8 @@
#ifndef PC16552D_H
#define PC16552D_H
-void pc16552d_init(running_machine *machine, int chip, int frequency, void (* irq_handler)(running_machine *machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data));
-void pc16552d_rx_data(running_machine *machine, int chip, int channel, UINT8 data);
+void pc16552d_init(running_machine &machine, int chip, int frequency, void (* irq_handler)(running_machine &machine, int channel, int value), void (* tx_callback)(int channel, int count, UINT8* data));
+void pc16552d_rx_data(running_machine &machine, int chip, int channel, UINT8 data);
READ8_HANDLER(pc16552d_0_r);
WRITE8_HANDLER(pc16552d_0_w);
diff --git a/src/emu/machine/pci.c b/src/emu/machine/pci.c
index 090e2fe1d85..ba21473d61e 100644
--- a/src/emu/machine/pci.c
+++ b/src/emu/machine/pci.c
@@ -222,10 +222,10 @@ READ64_DEVICE_HANDLER(pci_64be_r) { return read64be_with_32le_device_handler(pci
WRITE64_DEVICE_HANDLER(pci_64be_w) { write64be_with_32le_device_handler(pci_32le_w, device, offset, data, mem_mask); }
-int pci_add_sibling( running_machine *machine, char *pcitag, char *sibling )
+int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling )
{
- device_t *device1 = machine->device(pcitag);
- device_t *device2 = machine->device(sibling);
+ device_t *device1 = machine.device(pcitag);
+ device_t *device2 = machine.device(sibling);
pci_bus_state *pcibus1 = get_safe_token(device1);
pci_bus_state *pcibus2 = get_safe_token(device2);
pci_bus_config *config2;
@@ -271,7 +271,6 @@ static DEVICE_START( pci_bus )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* store a pointer back to the device */
pcibus->config = (const pci_bus_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
@@ -281,17 +280,17 @@ static DEVICE_START( pci_bus )
/* find all our devices */
for (devicenum = 0; devicenum < ARRAY_LENGTH(pcibus->device); devicenum++)
if (pcibus->config->device[devicenum].devtag != NULL)
- pcibus->device[devicenum] = device->machine->device(pcibus->config->device[devicenum].devtag);
+ pcibus->device[devicenum] = device->machine().device(pcibus->config->device[devicenum].devtag);
if (pcibus->config->father != NULL)
- pci_add_sibling(device->machine, (char *)pcibus->config->father, (char *)device->tag());
+ pci_add_sibling(device->machine(), (char *)pcibus->config->father, (char *)device->tag());
/* register pci states */
device->save_item(NAME(pcibus->address));
device->save_item(NAME(pcibus->devicenum));
device->save_item(NAME(pcibus->busnum));
- device->machine->state().register_postload(pci_bus_postload, pcibus);
+ device->machine().state().register_postload(pci_bus_postload, pcibus);
}
diff --git a/src/emu/machine/pci.h b/src/emu/machine/pci.h
index b88e3f1aa1f..c61fcb709ba 100644
--- a/src/emu/machine/pci.h
+++ b/src/emu/machine/pci.h
@@ -64,7 +64,7 @@ WRITE32_DEVICE_HANDLER( pci_32le_w );
READ64_DEVICE_HANDLER( pci_64be_r );
WRITE64_DEVICE_HANDLER( pci_64be_w );
-int pci_add_sibling( running_machine *machine, char *pcitag, char *sibling );
+int pci_add_sibling( running_machine &machine, char *pcitag, char *sibling );
/* ----- device interface ----- */
diff --git a/src/emu/machine/pckeybrd.h b/src/emu/machine/pckeybrd.h
index a5c21b025ab..ed1f4c4439a 100644
--- a/src/emu/machine/pckeybrd.h
+++ b/src/emu/machine/pckeybrd.h
@@ -19,12 +19,12 @@ typedef enum
AT_KEYBOARD_TYPE_MF2
} AT_KEYBOARD_TYPE;
-void at_keyboard_init(running_machine *machine, AT_KEYBOARD_TYPE type);
+void at_keyboard_init(running_machine &machine, AT_KEYBOARD_TYPE type);
void at_keyboard_polling(void);
int at_keyboard_read(void);
-void at_keyboard_write(running_machine *machine, UINT8 data);
-void at_keyboard_reset(running_machine *machine);
+void at_keyboard_write(running_machine &machine, UINT8 data);
+void at_keyboard_reset(running_machine &machine);
void at_keyboard_set_scan_code_set(int set);
INPUT_PORTS_EXTERN( pc_keyboard );
diff --git a/src/emu/machine/pcshare.h b/src/emu/machine/pcshare.h
index 3b8f1f57eae..a746f7a1982 100644
--- a/src/emu/machine/pcshare.h
+++ b/src/emu/machine/pcshare.h
@@ -2,7 +2,7 @@
#define PCCOMMON_KEYBOARD_PC 0
#define PCCOMMON_KEYBOARD_AT 1
-void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(running_machine *, int));
+void init_pc_common(running_machine &machine, UINT32 flags, void (*set_keyb_int_func)(running_machine &, int));
void pc_keyboard(void);
UINT8 pc_keyb_read(void);
diff --git a/src/emu/machine/pd4990a.c b/src/emu/machine/pd4990a.c
index 7c41e867f04..86c928cea15 100644
--- a/src/emu/machine/pd4990a.c
+++ b/src/emu/machine/pd4990a.c
@@ -449,7 +449,7 @@ static DEVICE_START( upd4990a )
upd4990a_state *upd4990a = get_safe_token(device);
system_time curtime, *systime = &curtime;
- device->machine->current_datetime(curtime);
+ device->machine().current_datetime(curtime);
#if 0
upd4990a->seconds = 0x00;
diff --git a/src/emu/machine/pic8259.c b/src/emu/machine/pic8259.c
index 36e2b87e1b6..dd8e59cb952 100644
--- a/src/emu/machine/pic8259.c
+++ b/src/emu/machine/pic8259.c
@@ -406,7 +406,7 @@ static DEVICE_START( pic8259 )
assert(intf != NULL);
- pic8259->timer = device->machine->scheduler().timer_alloc( FUNC(pic8259_timerproc), (void *)device );
+ pic8259->timer = device->machine().scheduler().timer_alloc( FUNC(pic8259_timerproc), (void *)device );
/* resolve callbacks */
devcb_resolve_write_line(&pic8259->out_int_func, &intf->out_int_func, device);
diff --git a/src/emu/machine/pit8253.c b/src/emu/machine/pit8253.c
index abb85c08387..1781aae3a44 100644
--- a/src/emu/machine/pit8253.c
+++ b/src/emu/machine/pit8253.c
@@ -614,7 +614,7 @@ static void simulate2(device_t *device, struct pit8253_timer *timer, INT64 elaps
{
attotime next_fire_time = timer->last_updated + cycles_to_output * attotime::from_hz( timer->clockin );
- timer->updatetimer->adjust(next_fire_time - device->machine->time(), timer->index );
+ timer->updatetimer->adjust(next_fire_time - device->machine().time(), timer->index );
}
LOG2(("pit8253: simulate2(): simulating %d cycles for %d in mode %d, bcd = %d, phase = %d, gate = %d, output %d, value = 0x%04x, cycles_to_output = %04x\n",
@@ -654,7 +654,7 @@ static void update(device_t *device, struct pit8253_timer *timer)
{
/* With the 82C54's maximum clockin of 10MHz, 64 bits is nearly 60,000
years of time. Should be enough for now. */
- attotime now = device->machine->time();
+ attotime now = device->machine().time();
attotime elapsed_time = now - timer->last_updated;
INT64 elapsed_cycles = elapsed_time.as_double() * timer->clockin;
@@ -916,7 +916,7 @@ WRITE8_DEVICE_HANDLER( pit8253_w )
update(device, timer);
- if ( device->machine->time() > timer->last_updated && timer->clockin != 0 )
+ if ( device->machine().time() > timer->last_updated && timer->clockin != 0 )
{
middle_of_a_cycle = 1;
}
@@ -1081,7 +1081,7 @@ static void common_start( device_t *device, int device_type ) {
/* initialize timer */
timer->clockin = pit8253->config->timer[timerno].clockin;
- timer->updatetimer = device->machine->scheduler().timer_alloc(FUNC(update_timer_cb), (void *)device);
+ timer->updatetimer = device->machine().scheduler().timer_alloc(FUNC(update_timer_cb), (void *)device);
timer->updatetimer->adjust(attotime::never, timerno);
/* resolve callbacks */
@@ -1148,7 +1148,7 @@ static DEVICE_RESET( pit8253 ) {
timer->null_count = 1;
timer->cycles_to_output = CYCLES_NEVER;
- timer->last_updated = device->machine->time();
+ timer->last_updated = device->machine().time();
update(device, timer);
}
diff --git a/src/emu/machine/ram.c b/src/emu/machine/ram.c
index 7a08d377fd0..dee4fa83c4e 100644
--- a/src/emu/machine/ram.c
+++ b/src/emu/machine/ram.c
@@ -100,7 +100,7 @@ static DEVICE_START( ram )
/* the device named 'ram' can get ram options from command line */
if (strcmp(device->tag(), RAM_TAG) == 0)
{
- const char *ramsize_string = device->machine->options().ram_size();
+ const char *ramsize_string = device->machine().options().ram_size();
if ((ramsize_string != NULL) && (ramsize_string[0] != '\0'))
ram->size = ram_parse_string(ramsize_string);
@@ -111,7 +111,7 @@ static DEVICE_START( ram )
ram->size = ram_parse_string(config->default_size);
/* allocate space for the ram */
- ram->ram = auto_alloc_array(device->machine, UINT8, ram->size);
+ ram->ram = auto_alloc_array(device->machine(), UINT8, ram->size);
/* reset ram to the default value */
memset(ram->ram, config->default_value, ram->size);
diff --git a/src/emu/machine/rtc65271.c b/src/emu/machine/rtc65271.c
index 3ed46197e8b..502826c90e9 100644
--- a/src/emu/machine/rtc65271.c
+++ b/src/emu/machine/rtc65271.c
@@ -236,7 +236,7 @@ static int rtc65271_file_load(device_t *device, emu_file &file)
system_time systime;
/* get the current date/time from the core */
- device->machine->current_datetime(systime);
+ device->machine().current_datetime(systime);
/* set clock registers */
state->regs[reg_second] = systime.local_time.second;
@@ -522,7 +522,7 @@ static TIMER_CALLBACK( rtc_begin_update_callback )
state->regs[reg_A] |= reg_A_UIP;
/* schedule end of update cycle */
- device->machine->scheduler().timer_set(UPDATE_CYCLE_TIME, FUNC(rtc_end_update_callback), 0, (void *)device);
+ device->machine().scheduler().timer_set(UPDATE_CYCLE_TIME, FUNC(rtc_end_update_callback), 0, (void *)device);
}
}
@@ -688,9 +688,9 @@ static DEVICE_START( rtc65271 )
rtc65271_config *config = (rtc65271_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
rtc65271_state *state = get_safe_token(device);
- state->update_timer = device->machine->scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)device);
+ state->update_timer = device->machine().scheduler().timer_alloc(FUNC(rtc_begin_update_callback), (void *)device);
state->update_timer->adjust(attotime::from_seconds(1), 0, attotime::from_seconds(1));
- state->SQW_timer = device->machine->scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)device);
+ state->SQW_timer = device->machine().scheduler().timer_alloc(FUNC(rtc_SQW_callback), (void *)device);
state->interrupt_callback = config->interrupt_callback;
device->save_item(NAME(state->regs));
diff --git a/src/emu/machine/s3c2400.c b/src/emu/machine/s3c2400.c
index ed330f124cd..0b969b191cb 100644
--- a/src/emu/machine/s3c2400.c
+++ b/src/emu/machine/s3c2400.c
@@ -14,7 +14,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
- logerror( "%s: %s", machine->describe_context( ), buf);
+ logerror( "%s: %s", machine.describe_context( ), buf);
}
}
@@ -33,19 +33,19 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
VIDEO_START( s3c2400 )
{
- device_t *device = machine->device( S3C2400_TAG);
+ device_t *device = machine.device( S3C2400_TAG);
s3c24xx_video_start( device, machine);
}
SCREEN_UPDATE( s3c2400 )
{
- device_t *device = screen->machine->device( S3C2400_TAG);
+ device_t *device = screen->machine().device( S3C2400_TAG);
return s3c24xx_video_update( device, screen, bitmap, cliprect);
}
DEVICE_START( s3c2400 )
{
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
DEVICE_START_CALL(s3c24xx);
space->install_legacy_readwrite_handler( *device, 0x14000000, 0x1400003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
space->install_legacy_readwrite_handler( *device, 0x14200000, 0x1420005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
diff --git a/src/emu/machine/s3c2410.c b/src/emu/machine/s3c2410.c
index 498020ecda3..9dee05b1fbf 100644
--- a/src/emu/machine/s3c2410.c
+++ b/src/emu/machine/s3c2410.c
@@ -14,7 +14,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
- logerror( "%s: %s", machine->describe_context( ), buf);
+ logerror( "%s: %s", machine.describe_context( ), buf);
}
}
@@ -33,19 +33,19 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
VIDEO_START( s3c2410 )
{
- device_t *device = machine->device( S3C2410_TAG);
+ device_t *device = machine.device( S3C2410_TAG);
s3c24xx_video_start( device, machine);
}
SCREEN_UPDATE( s3c2410 )
{
- device_t *device = screen->machine->device( S3C2410_TAG);
+ device_t *device = screen->machine().device( S3C2410_TAG);
return s3c24xx_video_update( device, screen, bitmap, cliprect);
}
DEVICE_START( s3c2410 )
{
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
DEVICE_START_CALL(s3c24xx);
space->install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
space->install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
diff --git a/src/emu/machine/s3c2440.c b/src/emu/machine/s3c2440.c
index 359eb41d5bc..445053926ed 100644
--- a/src/emu/machine/s3c2440.c
+++ b/src/emu/machine/s3c2440.c
@@ -14,7 +14,7 @@
#define VERBOSE_LEVEL ( 0 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ...)
{
if (VERBOSE_LEVEL >= n_level)
{
@@ -23,7 +23,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt);
vsprintf( buf, s_fmt, v);
va_end( v);
- logerror( "%s: %s", machine->describe_context( ), buf);
+ logerror( "%s: %s", machine.describe_context( ), buf);
}
}
@@ -33,19 +33,19 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
VIDEO_START( s3c2440 )
{
- device_t *device = machine->device( S3C2440_TAG);
+ device_t *device = machine.device( S3C2440_TAG);
s3c24xx_video_start( device, machine);
}
SCREEN_UPDATE( s3c2440 )
{
- device_t *device = screen->machine->device( S3C2440_TAG);
+ device_t *device = screen->machine().device( S3C2440_TAG);
return s3c24xx_video_update( device, screen, bitmap, cliprect);
}
DEVICE_START( s3c2440 )
{
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
space->install_legacy_readwrite_handler( *device, 0x48000000, 0x4800003b, FUNC(s3c24xx_memcon_r), FUNC(s3c24xx_memcon_w));
space->install_legacy_readwrite_handler( *device, 0x49000000, 0x4900005b, FUNC(s3c24xx_usb_host_r), FUNC(s3c24xx_usb_host_w));
space->install_legacy_readwrite_handler( *device, 0x4a000000, 0x4a00001f, FUNC(s3c24xx_irq_r), FUNC(s3c24xx_irq_w));
diff --git a/src/emu/machine/s3c24xx.c b/src/emu/machine/s3c24xx.c
index 6ec6e637426..fcd4ac80a95 100644
--- a/src/emu/machine/s3c24xx.c
+++ b/src/emu/machine/s3c24xx.c
@@ -225,7 +225,7 @@ static void s3c24xx_lcd_dma_reload( device_t *device)
s3c24xx->lcd.offsize = BITS( s3c24xx->lcd.regs.lcdsaddr3, 21, 11);
s3c24xx->lcd.pagewidth_cur = 0;
s3c24xx->lcd.pagewidth_max = BITS( s3c24xx->lcd.regs.lcdsaddr3, 10, 0);
- verboselog( device->machine, 3, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", s3c24xx->lcd.vramaddr_cur, s3c24xx->lcd.vramaddr_max, s3c24xx->lcd.offsize, s3c24xx->lcd.pagewidth_max);
+ verboselog( device->machine(), 3, "LCD - vramaddr %08X %08X offsize %08X pagewidth %08X\n", s3c24xx->lcd.vramaddr_cur, s3c24xx->lcd.vramaddr_max, s3c24xx->lcd.offsize, s3c24xx->lcd.pagewidth_max);
s3c24xx->lcd.dma_data = 0;
s3c24xx->lcd.dma_bits = 0;
}
@@ -238,7 +238,7 @@ static void s3c24xx_lcd_dma_init( device_t *device)
s3c24xx->lcd.bswp = BIT( s3c24xx->lcd.regs.lcdcon5, 1);
s3c24xx->lcd.hwswp = BIT( s3c24xx->lcd.regs.lcdcon5, 0);
s3c24xx->lcd.tpal = s3c24xx->lcd.regs.tpal;
- verboselog( device->machine, 3, "LCD - bppmode %d hwswp %d bswp %d\n", s3c24xx->lcd.bppmode, s3c24xx->lcd.hwswp, s3c24xx->lcd.bswp);
+ verboselog( device->machine(), 3, "LCD - bppmode %d hwswp %d bswp %d\n", s3c24xx->lcd.bppmode, s3c24xx->lcd.hwswp, s3c24xx->lcd.bswp);
s3c24xx->lcd.dma_data = 0;
s3c24xx->lcd.dma_bits = 0;
}
@@ -247,7 +247,7 @@ static void s3c24xx_lcd_dma_init( device_t *device)
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- address_space* space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space* space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
UINT8 *vram, data[4];
vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
for (int i = 0; i < 2; i++)
@@ -291,7 +291,7 @@ static UINT32 s3c24xx_lcd_dma_read( device_t *device)
static UINT32 s3c24xx_lcd_dma_read( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- address_space* space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space* space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
UINT8 *vram, data[4];
vram = (UINT8 *)space->get_read_ptr( s3c24xx->lcd.vramaddr_cur);
for (int i = 0; i < 2; i++)
@@ -570,7 +570,7 @@ static void s3c24xx_lcd_render_tft_01( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 32; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 31) & 0x01);
+ *scanline++ = palette_get_color( device->machine(), (data >> 31) & 0x01);
data = data << 1;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 4))
@@ -594,7 +594,7 @@ static void s3c24xx_lcd_render_tft_02( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 16; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 30) & 0x03);
+ *scanline++ = palette_get_color( device->machine(), (data >> 30) & 0x03);
data = data << 2;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 3))
@@ -618,7 +618,7 @@ static void s3c24xx_lcd_render_tft_04( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 8; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 28) & 0x0F);
+ *scanline++ = palette_get_color( device->machine(), (data >> 28) & 0x0F);
data = data << 4;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 2))
@@ -642,7 +642,7 @@ static void s3c24xx_lcd_render_tft_08( device_t *device)
UINT32 data = s3c24xx_lcd_dma_read( device);
for (int j = 0; j < 4; j++)
{
- *scanline++ = palette_get_color( device->machine, (data >> 24) & 0xFF);
+ *scanline++ = palette_get_color( device->machine(), (data >> 24) & 0xFF);
data = data << 8;
s3c24xx->lcd.hpos++;
if (s3c24xx->lcd.hpos >= s3c24xx->lcd.hpos_min + (s3c24xx->lcd.pagewidth_max << 1))
@@ -684,7 +684,7 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
{
device_t *device = (device_t *)ptr;
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
UINT32 tpalen;
verboselog( machine, 2, "LCD timer callback\n");
s3c24xx->lcd.vpos = screen->vpos();
@@ -725,10 +725,10 @@ static TIMER_CALLBACK( s3c24xx_lcd_timer_exp )
s3c24xx->lcd.timer->adjust( screen->time_until_pos( s3c24xx->lcd.vpos, s3c24xx->lcd.hpos));
}
-static void s3c24xx_video_start( device_t *device, running_machine *machine)
+static void s3c24xx_video_start( device_t *device, running_machine &machine)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = machine->primary_screen;
+ screen_device *screen = machine.primary_screen;
s3c24xx->lcd.bitmap[0] = screen->alloc_compatible_bitmap();
s3c24xx->lcd.bitmap[1] = screen->alloc_compatible_bitmap();
}
@@ -789,7 +789,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
case S3C24XX_LCDCON1 :
{
// make sure line counter is going
- UINT32 vpos = device->machine->primary_screen->vpos();
+ UINT32 vpos = device->machine().primary_screen->vpos();
if (vpos < s3c24xx->lcd.vpos_min) vpos = s3c24xx->lcd.vpos_min;
if (vpos > s3c24xx->lcd.vpos_max) vpos = s3c24xx->lcd.vpos_max;
data = (data & ~0xFFFC0000) | ((s3c24xx->lcd.vpos_max - vpos) << 18);
@@ -797,7 +797,7 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
break;
case S3C24XX_LCDCON5 :
{
- UINT32 vpos = device->machine->primary_screen->vpos();
+ UINT32 vpos = device->machine().primary_screen->vpos();
data = data & ~0x00018000;
if (vpos < s3c24xx->lcd.vpos_min) data = data | 0x00000000;
if (vpos > s3c24xx->lcd.vpos_max) data = data | 0x00018000;
@@ -805,19 +805,19 @@ READ32_DEVICE_HANDLER( s3c2440_lcd_r )
}
break;
}
- verboselog( device->machine, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
return data;
}
static void s3c24xx_lcd_configure_tft( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine->primary_screen;
+ screen_device *screen = device->machine().primary_screen;
UINT32 vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk;
double framerate, vclk;
UINT32 width, height;
rectangle visarea;
- verboselog( device->machine, 5, "s3c24xx_lcd_configure_tft\n");
+ verboselog( device->machine(), 5, "s3c24xx_lcd_configure_tft\n");
vspw = BITS( s3c24xx->lcd.regs.lcdcon2, 5, 0);
vbpd = BITS( s3c24xx->lcd.regs.lcdcon2, 31, 24);
lineval = BITS( s3c24xx->lcd.regs.lcdcon2, 23, 14);
@@ -828,11 +828,11 @@ static void s3c24xx_lcd_configure_tft( device_t *device)
hozval = BITS( s3c24xx->lcd.regs.lcdcon3, 18, 8);
clkval = BITS( s3c24xx->lcd.regs.lcdcon1, 17, 8);
hclk = s3c24xx_get_hclk( device);
- verboselog( device->machine, 3, "LCD - vspw %d vbpd %d lineval %d vfpd %d hspw %d hbpd %d hfpd %d hozval %d clkval %d hclk %d\n", vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk);
+ verboselog( device->machine(), 3, "LCD - vspw %d vbpd %d lineval %d vfpd %d hspw %d hbpd %d hfpd %d hozval %d clkval %d hclk %d\n", vspw, vbpd, lineval, vfpd, hspw, hbpd, hfpd, hozval, clkval, hclk);
vclk = (double)(hclk / ((clkval + 1) * 2));
- verboselog( device->machine, 3, "LCD - vclk %f\n", vclk);
+ verboselog( device->machine(), 3, "LCD - vclk %f\n", vclk);
framerate = vclk / (((vspw + 1) + (vbpd + 1) + (lineval + 1) + (vfpd + 1)) * ((hspw + 1) + (hbpd + 1) + (hozval + 1) + (hfpd + 1)));
- verboselog( device->machine, 3, "LCD - framerate %f\n", framerate);
+ verboselog( device->machine(), 3, "LCD - framerate %f\n", framerate);
s3c24xx->lcd.framerate = framerate;
width = (hspw + 1) + (hbpd + 1) + (hozval + 1) + (hfpd + 1);
height = (vspw + 1) + (vbpd + 1) + (lineval + 1) + (vfpd + 1);
@@ -840,8 +840,8 @@ static void s3c24xx_lcd_configure_tft( device_t *device)
visarea.min_y = (vspw + 1) + (vbpd + 1);
visarea.max_x = visarea.min_x + (hozval + 1) - 1;
visarea.max_y = visarea.min_y + (lineval + 1) - 1;
- verboselog( device->machine, 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
- verboselog( device->machine, 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
+ verboselog( device->machine(), 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
+ verboselog( device->machine(), 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
s3c24xx->lcd.hpos_min = (hspw + 1) + (hbpd + 1);
s3c24xx->lcd.hpos_max = s3c24xx->lcd.hpos_min + (hozval + 1) - 1;
s3c24xx->lcd.vpos_min = (vspw + 1) + (vbpd + 1);
@@ -852,12 +852,12 @@ static void s3c24xx_lcd_configure_tft( device_t *device)
static void s3c24xx_lcd_configure_stn( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine->primary_screen;
+ screen_device *screen = device->machine().primary_screen;
UINT32 pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk;
double vclk, framerate;
UINT32 width, height;
rectangle visarea;
- verboselog( device->machine, 5, "s3c24xx_lcd_configure_stn\n");
+ verboselog( device->machine(), 5, "s3c24xx_lcd_configure_stn\n");
pnrmode = BITS( s3c24xx->lcd.regs.lcdcon1, 6, 5);
bppmode = BITS( s3c24xx->lcd.regs.lcdcon1, 4, 1);
clkval = BITS( s3c24xx->lcd.regs.lcdcon1, 17, 8);
@@ -867,11 +867,11 @@ static void s3c24xx_lcd_configure_stn( device_t *device)
lineblank = BITS( s3c24xx->lcd.regs.lcdcon3, 7, 0);
wlh = BITS( s3c24xx->lcd.regs.lcdcon4, 1, 0);
hclk = s3c24xx_get_hclk( device);
- verboselog( device->machine, 3, "LCD - pnrmode %d bppmode %d clkval %d lineval %d wdly %d hozval %d lineblank %d wlh %d hclk %d\n", pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk);
+ verboselog( device->machine(), 3, "LCD - pnrmode %d bppmode %d clkval %d lineval %d wdly %d hozval %d lineblank %d wlh %d hclk %d\n", pnrmode, bppmode, clkval, lineval, wdly, hozval, lineblank, wlh, hclk);
vclk = (double)(hclk / ((clkval + 0) * 2));
- verboselog( device->machine, 3, "LCD - vclk %f\n", vclk);
+ verboselog( device->machine(), 3, "LCD - vclk %f\n", vclk);
framerate = 1 / (((1 / vclk) * (hozval + 1) + (1 / hclk) * ((1 << (4 + wlh)) + (1 << (4 + wdly)) + (lineblank * 8))) * (lineval + 1));
- verboselog( device->machine, 3, "LCD - framerate %f\n", framerate);
+ verboselog( device->machine(), 3, "LCD - framerate %f\n", framerate);
switch (pnrmode)
{
case S3C24XX_PNRMODE_STN_04_SS : width = ((hozval + 1) * 4); break;
@@ -885,8 +885,8 @@ static void s3c24xx_lcd_configure_stn( device_t *device)
visarea.min_y = 0;
visarea.max_x = width - 1;
visarea.max_y = height - 1;
- verboselog( device->machine, 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
- verboselog( device->machine, 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
+ verboselog( device->machine(), 3, "LCD - visarea min_x %d min_y %d max_x %d max_y %d\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
+ verboselog( device->machine(), 3, "video_screen_configure %d %d %f\n", width, height, s3c24xx->lcd.framerate);
s3c24xx->lcd.hpos_min = 0;
s3c24xx->lcd.hpos_max = width - 1;
s3c24xx->lcd.vpos_min = 0;
@@ -898,7 +898,7 @@ static void s3c24xx_lcd_configure( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 bppmode;
- verboselog( device->machine, 5, "s3c24xx_lcd_configure\n");
+ verboselog( device->machine(), 5, "s3c24xx_lcd_configure\n");
bppmode = BITS( s3c24xx->lcd.regs.lcdcon1, 4, 1);
if ((bppmode & (1 << 3)) == 0)
{
@@ -913,8 +913,8 @@ static void s3c24xx_lcd_configure( device_t *device)
static void s3c24xx_lcd_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- screen_device *screen = device->machine->primary_screen;
- verboselog( device->machine, 1, "LCD start\n");
+ screen_device *screen = device->machine().primary_screen;
+ verboselog( device->machine(), 1, "LCD start\n");
s3c24xx_lcd_configure( device);
s3c24xx_lcd_dma_init( device);
s3c24xx->lcd.timer->adjust( screen->time_until_pos( s3c24xx->lcd.vpos_min, s3c24xx->lcd.hpos_min));
@@ -923,7 +923,7 @@ static void s3c24xx_lcd_start( device_t *device)
static void s3c24xx_lcd_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "LCD stop\n");
+ verboselog( device->machine(), 1, "LCD stop\n");
s3c24xx->lcd.timer->adjust( attotime::never);
}
@@ -944,7 +944,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_lcd_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->lcd.regs)[offset];
- verboselog( device->machine, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCD + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->lcd.regs)[offset]);
switch (offset)
{
@@ -965,20 +965,20 @@ static READ32_DEVICE_HANDLER( s3c24xx_lcd_palette_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->lcdpal.regs.data[offset];
- verboselog( device->machine, 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X -> %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_lcd_palette_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
+ verboselog( device->machine(), 9, "(LCD) %08X <- %08X\n", S3C24XX_BASE_LCDPAL + (offset << 2), data);
COMBINE_DATA(&s3c24xx->lcdpal.regs.data[offset]);
if (mem_mask != 0xffffffff)
{
- verboselog( device->machine, 0, "s3c24xx_lcd_palette_w: unknown mask %08x\n", mem_mask);
+ verboselog( device->machine(), 0, "s3c24xx_lcd_palette_w: unknown mask %08x\n", mem_mask);
}
- palette_set_color( device->machine, offset, s3c24xx_get_color_tft_16( device, data & 0xFFFF));
+ palette_set_color( device->machine(), offset, s3c24xx_get_color_tft_16( device, data & 0xFFFF));
}
/* Clock & Power Management */
@@ -1025,21 +1025,21 @@ static READ32_DEVICE_HANDLER( s3c24xx_clkpow_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = ((UINT32*)&s3c24xx->clkpow.regs)[offset];
- verboselog( device->machine, 9, "(CLKPOW) %08X -> %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CLKPOW) %08X -> %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_clkpow_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(CLKPOW) %08X <- %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CLKPOW) %08X <- %08X\n", S3C24XX_BASE_CLKPOW + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->clkpow.regs)[offset]);
switch (offset)
{
case S3C24XX_MPLLCON :
{
- verboselog( device->machine, 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk( device), s3c24xx_get_hclk( device), s3c24xx_get_pclk( device));
- device->machine->device( "maincpu")->set_unscaled_clock(s3c24xx_get_fclk( device) * CLOCK_MULTIPLIER);
+ verboselog( device->machine(), 5, "CLKPOW - fclk %d hclk %d pclk %d\n", s3c24xx_get_fclk( device), s3c24xx_get_hclk( device), s3c24xx_get_pclk( device));
+ device->machine().device( "maincpu")->set_unscaled_clock(s3c24xx_get_fclk( device) * CLOCK_MULTIPLIER);
}
break;
}
@@ -1065,7 +1065,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
s3c24xx->irq.regs.intoffset = int_type;
if (s3c24xx->irq.line_irq != ASSERT_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, ASSERT_LINE);
s3c24xx->irq.line_irq = ASSERT_LINE;
}
}
@@ -1073,7 +1073,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
{
if (s3c24xx->irq.line_irq != CLEAR_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_IRQ_LINE, CLEAR_LINE);
s3c24xx->irq.line_irq = CLEAR_LINE;
}
}
@@ -1089,7 +1089,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
}
if (s3c24xx->irq.line_fiq != ASSERT_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_FIRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_FIRQ_LINE, ASSERT_LINE);
s3c24xx->irq.line_fiq = ASSERT_LINE;
}
}
@@ -1097,7 +1097,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
{
if (s3c24xx->irq.line_fiq != CLEAR_LINE)
{
- cputag_set_input_line( device->machine, "maincpu", ARM7_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line( device->machine(), "maincpu", ARM7_FIRQ_LINE, CLEAR_LINE);
s3c24xx->irq.line_fiq = CLEAR_LINE;
}
}
@@ -1106,7 +1106,7 @@ static void s3c24xx_check_pending_irq( device_t *device)
static void s3c24xx_request_irq( device_t *device, UINT32 int_type)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "request irq %d\n", int_type);
+ verboselog( device->machine(), 5, "request irq %d\n", int_type);
s3c24xx->irq.regs.srcpnd |= (1 << int_type);
s3c24xx_check_pending_irq( device);
}
@@ -1132,7 +1132,7 @@ static void s3c24xx_check_pending_subirq( device_t *device)
ATTR_UNUSED static void s3c24xx_request_subirq( device_t *device, UINT32 int_type)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "request subirq %d\n", int_type);
+ verboselog( device->machine(), 5, "request subirq %d\n", int_type);
s3c24xx->irq.regs.subsrcpnd |= (1 << int_type);
s3c24xx_check_pending_subirq( device);
}
@@ -1163,7 +1163,7 @@ static void s3c24xx_check_pending_eint( device_t *device)
ATTR_UNUSED static void s3c24xx_request_eint( device_t *device, UINT32 number)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "request external interrupt %d\n", number);
+ verboselog( device->machine(), 5, "request external interrupt %d\n", number);
if (number < 4)
{
s3c24xx_request_irq( device, S3C24XX_INT_EINT0 + number);
@@ -1181,7 +1181,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_irq_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = ((UINT32*)&s3c24xx->irq.regs)[offset];
- verboselog( device->machine, 9, "(IRQ) %08X -> %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IRQ) %08X -> %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
return data;
}
@@ -1189,7 +1189,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_irq_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->irq.regs)[offset];
- verboselog( device->machine, 9, "(IRQ) %08X <- %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IRQ) %08X <- %08X\n", S3C24XX_BASE_INT + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->irq.regs)[offset]);
switch (offset)
{
@@ -1274,7 +1274,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_pwm_r )
}
break;
}
- verboselog( device->machine, 9, "(PWM) %08X -> %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(PWM) %08X -> %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
return data;
}
@@ -1286,7 +1286,7 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
const int mux_shift[] = { 0, 4, 8, 12, 16};
UINT32 pclk, prescaler, mux, cnt, cmp, auto_reload;
double freq, hz;
- verboselog( device->machine, 1, "PWM %d start\n", timer);
+ verboselog( device->machine(), 1, "PWM %d start\n", timer);
pclk = s3c24xx_get_pclk( device);
prescaler = (s3c24xx->pwm.regs.tcfg0 >> prescaler_shift[timer]) & 0xFF;
mux = (s3c24xx->pwm.regs.tcfg1 >> mux_shift[timer]) & 0x0F;
@@ -1351,7 +1351,7 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
{
hz = freq / cnt;
}
- verboselog( device->machine, 5, "PWM %d - pclk=%d prescaler=%d div=%d freq=%f cnt=%d cmp=%d auto_reload=%d hz=%f\n", timer, pclk, prescaler, mux_table[mux], freq, cnt, cmp, auto_reload, hz);
+ verboselog( device->machine(), 5, "PWM %d - pclk=%d prescaler=%d div=%d freq=%f cnt=%d cmp=%d auto_reload=%d hz=%f\n", timer, pclk, prescaler, mux_table[mux], freq, cnt, cmp, auto_reload, hz);
s3c24xx->pwm.cnt[timer] = cnt;
s3c24xx->pwm.cmp[timer] = cmp;
s3c24xx->pwm.freq[timer] = freq;
@@ -1368,7 +1368,7 @@ static void s3c24xx_pwm_start( device_t *device, int timer)
static void s3c24xx_pwm_stop( device_t *device, int timer)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "PWM %d stop\n", timer);
+ verboselog( device->machine(), 1, "PWM %d stop\n", timer);
s3c24xx->pwm.timer[timer]->adjust( attotime::never);
}
@@ -1390,7 +1390,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_pwm_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->pwm.regs)[offset];
- verboselog( device->machine, 9, "(PWM) %08X <- %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(PWM) %08X <- %08X\n", S3C24XX_BASE_PWM + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->pwm.regs)[offset]);
switch (offset)
{
@@ -1454,10 +1454,10 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs;
UINT32 curr_tc, curr_src, curr_dst;
- address_space *space = device->machine->device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space *space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM);
int dsz, inc_src, inc_dst, servmode, tsz;
const UINT32 ch_int[] = { S3C24XX_INT_DMA0, S3C24XX_INT_DMA1, S3C24XX_INT_DMA2, S3C24XX_INT_DMA3};
- verboselog( device->machine, 5, "DMA %d trigger\n", ch);
+ verboselog( device->machine(), 5, "DMA %d trigger\n", ch);
curr_tc = S3C24XX_DSTAT_GET_CURR_TC( regs->dstat);
dsz = S3C24XX_DCON_GET_DSZ( regs->dcon);
curr_src = S3C24XX_DCSRC_GET_CURR_SRC( regs->dcsrc);
@@ -1471,7 +1471,7 @@ static void s3c24xx_dma_trigger( device_t *device, int ch)
inc_src = BIT( regs->disrcc, 0);
inc_dst = BIT( regs->didstc, 0);
#endif
- verboselog( device->machine, 5, "DMA %d - curr_src %08X curr_dst %08X curr_tc %d dsz %d\n", ch, curr_src, curr_dst, curr_tc, dsz);
+ verboselog( device->machine(), 5, "DMA %d - curr_src %08X curr_dst %08X curr_tc %d dsz %d\n", ch, curr_src, curr_dst, curr_tc, dsz);
while (curr_tc > 0)
{
curr_tc--;
@@ -1512,7 +1512,7 @@ static void s3c24xx_dma_request_iis( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[2].regs;
- verboselog( device->machine, 5, "s3c24xx_dma_request_iis\n");
+ verboselog( device->machine(), 5, "s3c24xx_dma_request_iis\n");
if ((S3C24XX_DMASKTRIG_GET_ON_OFF( regs->dmasktrig) != 0) && (S3C24XX_DCON_GET_SWHWSEL( regs->dcon) != 0) && (S3C24XX_DCON_GET_HWSRCSEL( regs->dcon) == 0))
{
s3c24xx_dma_trigger( device, 2);
@@ -1522,7 +1522,7 @@ static void s3c24xx_dma_request_iis( device_t *device)
static void s3c24xx_dma_request_pwm( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "s3c24xx_dma_request_pwm\n");
+ verboselog( device->machine(), 5, "s3c24xx_dma_request_pwm\n");
for (int i = 0; i < 4; i++)
{
if (i != 1)
@@ -1543,7 +1543,7 @@ static void s3c24xx_dma_start( device_t *device, int ch)
s3c24xx_dma_regs_t *regs = &s3c24xx->dma[ch].regs;
UINT32 dsz, tsz, reload;
int inc_src, inc_dst, _int, servmode, swhwsel, hwsrcsel;
- verboselog( device->machine, 1, "DMA %d start\n", ch);
+ verboselog( device->machine(), 1, "DMA %d start\n", ch);
addr_src = S3C24XX_DISRC_GET_SADDR( regs->disrc);
addr_dst = S3C24XX_DIDST_GET_DADDR( regs->didst);
tc = S3C24XX_DCON_GET_TC( regs->dcon);
@@ -1561,8 +1561,8 @@ static void s3c24xx_dma_start( device_t *device, int ch)
inc_src = BIT( regs->disrcc, 0);
inc_dst = BIT( regs->didstc, 0);
#endif
- verboselog( device->machine, 5, "DMA %d - addr_src %08X inc_src %d addr_dst %08X inc_dst %d int %d tsz %d servmode %d hwsrcsel %d swhwsel %d reload %d dsz %d tc %d\n", ch, addr_src, inc_src, addr_dst, inc_dst, _int, tsz, servmode, hwsrcsel, swhwsel, reload, dsz, tc);
- verboselog( device->machine, 5, "DMA %d - copy %08X bytes from %08X (%s) to %08X (%s)\n", ch, (tc << dsz) << (tsz << 1), addr_src, inc_src ? "fix" : "inc", addr_dst, inc_dst ? "fix" : "inc");
+ verboselog( device->machine(), 5, "DMA %d - addr_src %08X inc_src %d addr_dst %08X inc_dst %d int %d tsz %d servmode %d hwsrcsel %d swhwsel %d reload %d dsz %d tc %d\n", ch, addr_src, inc_src, addr_dst, inc_dst, _int, tsz, servmode, hwsrcsel, swhwsel, reload, dsz, tc);
+ verboselog( device->machine(), 5, "DMA %d - copy %08X bytes from %08X (%s) to %08X (%s)\n", ch, (tc << dsz) << (tsz << 1), addr_src, inc_src ? "fix" : "inc", addr_dst, inc_dst ? "fix" : "inc");
s3c24xx_dma_reload( device, ch);
if (swhwsel == 0)
{
@@ -1572,7 +1572,7 @@ static void s3c24xx_dma_start( device_t *device, int ch)
static void s3c24xx_dma_stop( device_t *device, int ch)
{
- verboselog( device->machine, 1, "DMA %d stop\n", ch);
+ verboselog( device->machine(), 1, "DMA %d stop\n", ch);
}
static void s3c24xx_dma_recalc( device_t *device, int ch)
@@ -1626,52 +1626,52 @@ static void s3c24xx_dma_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 da
static READ32_DEVICE_HANDLER( s3c24xx_dma_0_r )
{
UINT32 data = s3c24xx_dma_r( device, 0, offset);
- verboselog( device->machine, 9, "(DMA 0) %08X -> %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 0) %08X -> %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_dma_1_r )
{
UINT32 data = s3c24xx_dma_r( device, 1, offset);
- verboselog( device->machine, 9, "(DMA 1) %08X -> %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 1) %08X -> %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_dma_2_r )
{
UINT32 data = s3c24xx_dma_r( device, 2, offset);
- verboselog( device->machine, 9, "(DMA 2) %08X -> %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 2) %08X -> %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_dma_3_r )
{
UINT32 data = s3c24xx_dma_r( device, 3, offset);
- verboselog( device->machine, 9, "(DMA 3) %08X -> %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 3) %08X -> %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_0_w )
{
- verboselog( device->machine, 9, "(DMA 0) %08X <- %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 0) %08X <- %08X\n", S3C24XX_BASE_DMA_0 + (offset << 2), data);
s3c24xx_dma_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_1_w )
{
- verboselog( device->machine, 9, "(DMA 1) %08X <- %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 1) %08X <- %08X\n", S3C24XX_BASE_DMA_1 + (offset << 2), data);
s3c24xx_dma_w( device, 1, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_2_w )
{
- verboselog( device->machine, 9, "(DMA 2) %08X <- %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 2) %08X <- %08X\n", S3C24XX_BASE_DMA_2 + (offset << 2), data);
s3c24xx_dma_w( device, 2, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_dma_3_w )
{
- verboselog( device->machine, 9, "(DMA 3) %08X <- %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(DMA 3) %08X <- %08X\n", S3C24XX_BASE_DMA_3 + (offset << 2), data);
s3c24xx_dma_w( device, 3, offset, data, mem_mask);
}
@@ -1761,7 +1761,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_gpio_r )
break;
#endif
}
- verboselog( device->machine, 9, "(GPIO) %08X -> %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
+ verboselog( device->machine(), 9, "(GPIO) %08X -> %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
return data;
}
@@ -1771,7 +1771,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_gpio_w )
#if defined(DEVICE_S3C2410) || defined(DEVICE_S3C2440)
UINT32 old_value = ((UINT32*)&s3c24xx->gpio.regs)[offset];
#endif
- verboselog( device->machine, 9, "(GPIO) %08X <- %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
+ verboselog( device->machine(), 9, "(GPIO) %08X <- %08X\n", S3C24XX_BASE_GPIO + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->gpio.regs)[offset]);
switch (offset)
{
@@ -1844,14 +1844,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_memcon_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->memcon.regs.data[offset];
- verboselog( device->machine, 9, "(MEMCON) %08X -> %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MEMCON) %08X -> %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_memcon_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(MEMCON) %08X <- %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MEMCON) %08X <- %08X\n", S3C24XX_BASE_MEMCON + (offset << 2), data);
COMBINE_DATA(&s3c24xx->memcon.regs.data[offset]);
}
@@ -1870,14 +1870,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_usb_host_r )
}
break;
}
- verboselog( device->machine, 9, "(USB H) %08X -> %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB H) %08X -> %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_usb_host_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(USB H) %08X <- %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB H) %08X <- %08X\n", S3C24XX_BASE_USBHOST + (offset << 2), data);
COMBINE_DATA(&s3c24xx->usbhost.regs.data[offset]);
}
@@ -1897,7 +1897,7 @@ static UINT32 s3c24xx_uart_r( device_t *device, UINT32 ch, UINT32 offset)
case S3C24XX_URXH :
{
UINT8 rxdata = data & 0xFF;
- verboselog( device->machine, 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?');
+ verboselog( device->machine(), 5, "UART %d read %02X (%c)\n", ch, rxdata, ((rxdata >= 32) && (rxdata < 128)) ? (char)rxdata : '?');
s3c24xx->uart[ch].regs.utrstat &= ~1; // [bit 0] Receive buffer data ready
}
break;
@@ -1914,7 +1914,7 @@ static void s3c24xx_uart_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 d
case S3C24XX_UTXH :
{
UINT8 txdata = data & 0xFF;
- verboselog( device->machine, 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?');
+ verboselog( device->machine(), 5, "UART %d write %02X (%c)\n", ch, txdata, ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?');
#ifdef UART_PRINTF
printf( "%c", ((txdata >= 32) && (txdata < 128)) ? (char)txdata : '?');
#endif
@@ -1926,14 +1926,14 @@ static void s3c24xx_uart_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 d
static READ32_DEVICE_HANDLER( s3c24xx_uart_0_r )
{
UINT32 data = s3c24xx_uart_r( device, 0, offset);
-// verboselog( device->machine, 9, "(UART 0) %08X -> %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 0) %08X -> %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c24xx_uart_1_r )
{
UINT32 data = s3c24xx_uart_r( device, 1, offset);
-// verboselog( device->machine, 9, "(UART 1) %08X -> %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 1) %08X -> %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
return data;
}
@@ -1942,7 +1942,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_uart_1_r )
static READ32_DEVICE_HANDLER( s3c24xx_uart_2_r )
{
UINT32 data = s3c24xx_uart_r( device, 2, offset);
-// verboselog( device->machine, 9, "(UART 2) %08X -> %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 2) %08X -> %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
return data;
}
@@ -1950,13 +1950,13 @@ static READ32_DEVICE_HANDLER( s3c24xx_uart_2_r )
static WRITE32_DEVICE_HANDLER( s3c24xx_uart_0_w )
{
-// verboselog( device->machine, 9, "(UART 0) %08X <- %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 0) %08X <- %08X\n", S3C24XX_BASE_UART_0 + (offset << 2), data);
s3c24xx_uart_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c24xx_uart_1_w )
{
-// verboselog( device->machine, 9, "(UART 1) %08X <- %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 1) %08X <- %08X\n", S3C24XX_BASE_UART_1 + (offset << 2), data);
s3c24xx_uart_w( device, 1, offset, data, mem_mask);
}
@@ -1964,7 +1964,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_uart_1_w )
static WRITE32_DEVICE_HANDLER( s3c24xx_uart_2_w )
{
-// verboselog( device->machine, 9, "(UART 2) %08X <- %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
+// verboselog( device->machine(), 9, "(UART 2) %08X <- %08X\n", S3C24XX_BASE_UART_2 + (offset << 2), data);
s3c24xx_uart_w( device, 2, offset, data, mem_mask);
}
@@ -1984,14 +1984,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_usb_device_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->usbdev.regs.data[offset];
- verboselog( device->machine, 9, "(USB D) %08X -> %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB D) %08X -> %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_usb_device_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(USB D) %08X <- %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
+ verboselog( device->machine(), 9, "(USB D) %08X <- %08X\n", S3C24XX_BASE_USBDEV + (offset << 2), data);
COMBINE_DATA(&s3c24xx->usbdev.regs.data[offset]);
}
@@ -2039,7 +2039,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_wdt_r )
}
break;
}
- verboselog( device->machine, 9, "(WDT) %08X -> %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(WDT) %08X -> %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
return data;
}
@@ -2048,13 +2048,13 @@ static void s3c24xx_wdt_start( device_t *device)
s3c24xx_t *s3c24xx = get_token( device);
UINT32 pclk, prescaler, clock;
double freq, hz;
- verboselog( device->machine, 1, "WDT start\n");
+ verboselog( device->machine(), 1, "WDT start\n");
pclk = s3c24xx_get_pclk( device);
prescaler = BITS( s3c24xx->wdt.regs.wtcon, 15, 8);
clock = 16 << BITS( s3c24xx->wdt.regs.wtcon, 4, 3);
freq = (double)pclk / (prescaler + 1) / clock;
hz = freq / s3c24xx->wdt.regs.wtcnt;
- verboselog( device->machine, 5, "WDT pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz);
+ verboselog( device->machine(), 5, "WDT pclk %d prescaler %d clock %d freq %f hz %f\n", pclk, prescaler, clock, freq, hz);
s3c24xx->wdt.timer->adjust( attotime::from_hz( hz), 0, attotime::from_hz( hz));
#if defined(DEVICE_S3C2410)
s3c24xx->wdt.freq = freq;
@@ -2065,7 +2065,7 @@ static void s3c24xx_wdt_start( device_t *device)
static void s3c24xx_wdt_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "WDT stop\n");
+ verboselog( device->machine(), 1, "WDT stop\n");
s3c24xx->wdt.regs.wtcnt = s3c24xx_wdt_calc_current_count( device);
s3c24xx->wdt.timer->adjust( attotime::never);
}
@@ -2087,7 +2087,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_wdt_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->wdt.regs)[offset];
- verboselog( device->machine, 9, "(WDT) %08X <- %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
+ verboselog( device->machine(), 9, "(WDT) %08X <- %08X\n", S3C24XX_BASE_WDT + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->wdt.regs)[offset]);
switch (offset)
{
@@ -2156,7 +2156,7 @@ INLINE int iface_i2c_sda_r( device_t *device)
static void i2c_send_start( device_t *device)
{
- verboselog( device->machine, 5, "i2c_send_start\n");
+ verboselog( device->machine(), 5, "i2c_send_start\n");
iface_i2c_sda_w( device, 1);
iface_i2c_scl_w( device, 1);
iface_i2c_sda_w( device, 0);
@@ -2165,7 +2165,7 @@ static void i2c_send_start( device_t *device)
static void i2c_send_stop( device_t *device)
{
- verboselog( device->machine, 5, "i2c_send_stop\n");
+ verboselog( device->machine(), 5, "i2c_send_stop\n");
iface_i2c_sda_w( device, 0);
iface_i2c_scl_w( device, 1);
iface_i2c_sda_w( device, 1);
@@ -2175,7 +2175,7 @@ static void i2c_send_stop( device_t *device)
static UINT8 i2c_receive_byte( device_t *device, int ack)
{
UINT8 data = 0;
- verboselog( device->machine, 5, "i2c_receive_byte ...\n");
+ verboselog( device->machine(), 5, "i2c_receive_byte ...\n");
iface_i2c_sda_w( device, 1);
for (int i = 0; i < 8; i++)
{
@@ -2183,8 +2183,8 @@ static UINT8 i2c_receive_byte( device_t *device, int ack)
data = (data << 1) + (iface_i2c_sda_r( device) ? 1 : 0);
iface_i2c_scl_w( device, 0);
}
- verboselog( device->machine, 5, "recv data %02X\n", data);
- verboselog( device->machine, 5, "send ack %d\n", ack);
+ verboselog( device->machine(), 5, "recv data %02X\n", data);
+ verboselog( device->machine(), 5, "send ack %d\n", ack);
iface_i2c_sda_w( device, ack ? 0 : 1);
iface_i2c_scl_w( device, 1);
iface_i2c_scl_w( device, 0);
@@ -2194,8 +2194,8 @@ static UINT8 i2c_receive_byte( device_t *device, int ack)
static int i2c_send_byte( device_t *device, UINT8 data)
{
int ack;
- verboselog( device->machine, 5, "i2c_send_byte ...\n");
- verboselog( device->machine, 5, "send data %02X\n", data);
+ verboselog( device->machine(), 5, "i2c_send_byte ...\n");
+ verboselog( device->machine(), 5, "send data %02X\n", data);
for (int i = 0; i < 8; i++)
{
iface_i2c_sda_w( device, (data & 0x80) ? 1 : 0);
@@ -2206,7 +2206,7 @@ static int i2c_send_byte( device_t *device, UINT8 data)
iface_i2c_sda_w( device, 1); // ack bit
iface_i2c_scl_w( device, 1);
ack = iface_i2c_sda_r( device);
- verboselog( device->machine, 5, "recv ack %d\n", ack);
+ verboselog( device->machine(), 5, "recv ack %d\n", ack);
iface_i2c_scl_w( device, 0);
return ack;
}
@@ -2215,7 +2215,7 @@ static void iic_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
int mode_selection;
- verboselog( device->machine, 1, "IIC start\n");
+ verboselog( device->machine(), 1, "IIC start\n");
i2c_send_start( device);
mode_selection = BITS( s3c24xx->iic.regs.iicstat, 7, 6);
switch (mode_selection)
@@ -2229,7 +2229,7 @@ static void iic_start( device_t *device)
static void iic_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "IIC stop\n");
+ verboselog( device->machine(), 1, "IIC stop\n");
i2c_send_stop( device);
s3c24xx->iic.timer->adjust( attotime::never);
}
@@ -2238,7 +2238,7 @@ static void iic_resume( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
int mode_selection;
- verboselog( device->machine, 1, "IIC resume\n");
+ verboselog( device->machine(), 1, "IIC resume\n");
mode_selection = BITS( s3c24xx->iic.regs.iicstat, 7, 6);
switch (mode_selection)
{
@@ -2260,7 +2260,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_iic_r )
}
break;
}
- verboselog( device->machine, 9, "(IIC) %08X -> %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIC) %08X -> %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
return data;
}
@@ -2268,7 +2268,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_iic_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->iic.regs)[offset];
- verboselog( device->machine, 9, "(IIC) %08X <- %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIC) %08X <- %08X\n", S3C24XX_BASE_IIC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->iic.regs)[offset]);
switch (offset)
{
@@ -2375,21 +2375,21 @@ static void s3c24xx_iis_start( device_t *device)
const UINT32 codeclk_table[] = { 256, 384};
double freq;
int pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk;
- verboselog( device->machine, 1, "IIS start\n");
+ verboselog( device->machine(), 1, "IIS start\n");
prescaler_enable = BIT( s3c24xx->iis.regs.iiscon, 1);
prescaler_control_a = BITS( s3c24xx->iis.regs.iispsr, 9, 5);
prescaler_control_b = BITS( s3c24xx->iis.regs.iispsr, 4, 0);
codeclk = BIT( s3c24xx->iis.regs.iismod, 2);
pclk = s3c24xx_get_pclk( device);
freq = ((double)pclk / (prescaler_control_a + 1) / codeclk_table[codeclk]) * 2; // why do I have to multiply by two?
- verboselog( device->machine, 5, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq);
+ verboselog( device->machine(), 5, "IIS - pclk %d psc_enable %d psc_a %d psc_b %d codeclk %d freq %f\n", pclk, prescaler_enable, prescaler_control_a, prescaler_control_b, codeclk_table[codeclk], freq);
s3c24xx->iis.timer->adjust( attotime::from_hz( freq), 0, attotime::from_hz( freq));
}
static void s3c24xx_iis_stop( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "IIS stop\n");
+ verboselog( device->machine(), 1, "IIS stop\n");
s3c24xx->iis.timer->adjust( attotime::never);
}
@@ -2420,7 +2420,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_iis_r )
break;
}
#endif
- verboselog( device->machine, 9, "(IIS) %08X -> %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIS) %08X -> %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
return data;
}
@@ -2428,7 +2428,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_iis_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->iis.regs)[offset];
- verboselog( device->machine, 9, "(IIS) %08X <- %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
+ verboselog( device->machine(), 9, "(IIS) %08X <- %08X\n", S3C24XX_BASE_IIS + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->iis.regs)[offset]);
switch (offset)
{
@@ -2486,7 +2486,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_rtc_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = ((UINT32*)&s3c24xx->rtc.regs)[offset];
- verboselog( device->machine, 9, "(RTC) %08X -> %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(RTC) %08X -> %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
return data;
}
@@ -2511,7 +2511,7 @@ static void s3c24xx_rtc_recalc( device_t *device)
static WRITE32_DEVICE_HANDLER( s3c24xx_rtc_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(RTC) %08X <- %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(RTC) %08X <- %08X\n", S3C24XX_BASE_RTC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->rtc.regs)[offset]);
switch (offset)
{
@@ -2573,7 +2573,7 @@ static void s3c24xx_rtc_update( device_t *device)
}
}
}
- verboselog( device->machine, 5, "RTC - %04d/%02d/%02d %02d:%02d:%02d\n", bcd_2_dec( s3c24xx->rtc.regs.bcdyear) + 2000, bcd_2_dec( s3c24xx->rtc.regs.bcdmon), bcd_2_dec( s3c24xx->rtc.regs.bcdday), bcd_2_dec( s3c24xx->rtc.regs.bcdhour), bcd_2_dec( s3c24xx->rtc.regs.bcdmin), bcd_2_dec( s3c24xx->rtc.regs.bcdsec));
+ verboselog( device->machine(), 5, "RTC - %04d/%02d/%02d %02d:%02d:%02d\n", bcd_2_dec( s3c24xx->rtc.regs.bcdyear) + 2000, bcd_2_dec( s3c24xx->rtc.regs.bcdmon), bcd_2_dec( s3c24xx->rtc.regs.bcdday), bcd_2_dec( s3c24xx->rtc.regs.bcdhour), bcd_2_dec( s3c24xx->rtc.regs.bcdmin), bcd_2_dec( s3c24xx->rtc.regs.bcdsec));
}
static void s3c24xx_rtc_check_alarm( device_t *device)
@@ -2643,14 +2643,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_adc_r )
break;
#endif
}
- verboselog( device->machine, 9, "(ADC) %08X -> %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(ADC) %08X -> %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
return data;
}
static void s3c24xx_adc_start( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 1, "ADC start\n");
+ verboselog( device->machine(), 1, "ADC start\n");
s3c24xx->adc.regs.adccon &= ~(1 << 0); // A/D conversion is completed
s3c24xx->adc.regs.adccon |= (1 << 15); // End of A/D conversion
}
@@ -2659,7 +2659,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_adc_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->adc.regs)[offset];
- verboselog( device->machine, 9, "(ADC) %08X <- %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(ADC) %08X <- %08X\n", S3C24XX_BASE_ADC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->adc.regs)[offset]);
switch (offset)
{
@@ -2712,7 +2712,7 @@ static void s3c24xx_spi_w( device_t *device, UINT32 ch, UINT32 offset, UINT32 da
static READ32_DEVICE_HANDLER( s3c24xx_spi_0_r )
{
UINT32 data = s3c24xx_spi_r( device, 0, offset);
- verboselog( device->machine, 9, "(SPI 0) %08X -> %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 0) %08X -> %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
return data;
}
@@ -2721,7 +2721,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_spi_0_r )
static READ32_DEVICE_HANDLER( s3c24xx_spi_1_r )
{
UINT32 data = s3c24xx_spi_r( device, 1, offset);
- verboselog( device->machine, 9, "(SPI 1) %08X -> %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 1) %08X -> %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
return data;
}
@@ -2729,7 +2729,7 @@ static READ32_DEVICE_HANDLER( s3c24xx_spi_1_r )
static WRITE32_DEVICE_HANDLER( s3c24xx_spi_0_w )
{
- verboselog( device->machine, 9, "(SPI 0) %08X <- %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 0) %08X <- %08X\n", S3C24XX_BASE_SPI_0 + (offset << 2), data);
s3c24xx_spi_w( device, 0, offset, data, mem_mask);
}
@@ -2737,7 +2737,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_spi_0_w )
static WRITE32_DEVICE_HANDLER( s3c24xx_spi_1_w )
{
- verboselog( device->machine, 9, "(SPI 1) %08X <- %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SPI 1) %08X <- %08X\n", S3C24XX_BASE_SPI_1 + (offset << 2), data);
s3c24xx_spi_w( device, 1, offset, data, mem_mask);
}
@@ -2751,14 +2751,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_mmc_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->mmc.regs.data[offset];
- verboselog( device->machine, 9, "(MMC) %08X -> %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MMC) %08X -> %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_mmc_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(MMC) %08X <- %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
+ verboselog( device->machine(), 9, "(MMC) %08X <- %08X\n", S3C24XX_BASE_MMC + (offset << 2), data);
COMBINE_DATA(&s3c24xx->mmc.regs.data[offset]);
}
@@ -2772,14 +2772,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_sdi_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->sdi.regs.data[offset];
- verboselog( device->machine, 9, "(SDI) %08X -> %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SDI) %08X -> %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_sdi_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(SDI) %08X <- %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
+ verboselog( device->machine(), 9, "(SDI) %08X <- %08X\n", S3C24XX_BASE_SDI + (offset << 2), data);
COMBINE_DATA(&s3c24xx->sdi.regs.data[offset]);
}
@@ -2903,7 +2903,7 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
temp[1] = s3c24xx->nand.mecc[1];
temp[2] = s3c24xx->nand.mecc[2];
nand_update_mecc( s3c24xx->nand.mecc, s3c24xx->nand.pos++, data);
- verboselog( device->machine, 5, "NAND - MECC %03X - %02X %02X %02X -> %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2]);
+ verboselog( device->machine(), 5, "NAND - MECC %03X - %02X %02X %02X -> %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2]);
if (s3c24xx->nand.pos == 512) s3c24xx->nand.pos = 0;
#else
if ((s3c24xx->nand.regs.nfcont & (1 << 5)) == 0)
@@ -2913,7 +2913,7 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
temp[2] = s3c24xx->nand.mecc[2];
temp[3] = s3c24xx->nand.mecc[3];
nand_update_mecc( s3c24xx->nand.mecc, s3c24xx->nand.pos++, data);
- verboselog( device->machine, 5, "NAND - MECC %03X - %02X %02X %02X %02X -> %02X %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], temp[3], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2], s3c24xx->nand.mecc[3]);
+ verboselog( device->machine(), 5, "NAND - MECC %03X - %02X %02X %02X %02X -> %02X %02X %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], temp[2], temp[3], s3c24xx->nand.mecc[0], s3c24xx->nand.mecc[1], s3c24xx->nand.mecc[2], s3c24xx->nand.mecc[3]);
if (s3c24xx->nand.pos == 2048) s3c24xx->nand.pos = 0;
}
if ((s3c24xx->nand.regs.nfcont & (1 << 6)) == 0)
@@ -2921,7 +2921,7 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
temp[0] = s3c24xx->nand.secc[0];
temp[1] = s3c24xx->nand.secc[1];
nand_update_secc( s3c24xx->nand.secc, s3c24xx->nand.pos++, data);
- verboselog( device->machine, 5, "NAND - SECC %02X - %02X %02X -> %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], s3c24xx->nand.secc[0], s3c24xx->nand.secc[1]);
+ verboselog( device->machine(), 5, "NAND - SECC %02X - %02X %02X -> %02X %02X\n", s3c24xx->nand.pos - 1, temp[0], temp[1], s3c24xx->nand.secc[0], s3c24xx->nand.secc[1]);
if (s3c24xx->nand.pos == 16) s3c24xx->nand.pos = 0;
}
#endif
@@ -2929,27 +2929,27 @@ static void s3c24xx_nand_update_ecc( device_t *device, UINT8 data)
static void s3c24xx_nand_command_w( device_t *device, UINT8 data)
{
- verboselog( device->machine, 5, "NAND write command %02X\n", data);
+ verboselog( device->machine(), 5, "NAND write command %02X\n", data);
iface_nand_command_w( device, data);
}
static void s3c24xx_nand_address_w( device_t *device, UINT8 data)
{
- verboselog( device->machine, 5, "NAND write address %02X\n", data);
+ verboselog( device->machine(), 5, "NAND write address %02X\n", data);
iface_nand_address_w( device, data);
}
static UINT8 s3c24xx_nand_data_r( device_t *device)
{
UINT8 data = iface_nand_data_r( device);
- verboselog( device->machine, 5, "NAND data read %02X\n", data);
+ verboselog( device->machine(), 5, "NAND data read %02X\n", data);
s3c24xx_nand_update_ecc( device, data);
return data;
}
static void s3c24xx_nand_data_w( device_t *device, UINT8 data)
{
- verboselog( device->machine, 5, "NAND write data %02X\n", data);
+ verboselog( device->machine(), 5, "NAND write data %02X\n", data);
iface_nand_data_w( device, data);
s3c24xx_nand_update_ecc( device, data);
}
@@ -3001,14 +3001,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_nand_r )
break;
#endif
}
- verboselog( device->machine, 9, "(NAND) %08X -> %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask);
+ verboselog( device->machine(), 9, "(NAND) %08X -> %08X (%08X)\n", S3C24XX_BASE_NAND + (offset << 2), data, mem_mask);
return data;
}
static void s3c24xx_nand_init_ecc( device_t *device)
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 5, "NAND - init ecc\n");
+ verboselog( device->machine(), 5, "NAND - init ecc\n");
#if defined(DEVICE_S3C2410)
s3c24xx->nand.mecc[0] = 0;
s3c24xx->nand.mecc[1] = 0;
@@ -3028,7 +3028,7 @@ static WRITE32_DEVICE_HANDLER( s3c24xx_nand_w )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 old_value = ((UINT32*)&s3c24xx->nand.regs)[offset];
- verboselog( device->machine, 9, "(NAND) %08X <- %08X\n", S3C24XX_BASE_NAND + (offset << 2), data);
+ verboselog( device->machine(), 9, "(NAND) %08X <- %08X\n", S3C24XX_BASE_NAND + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c24xx->nand.regs)[offset]);
switch (offset)
{
@@ -3117,14 +3117,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_cam_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->cam.regs.data[offset];
- verboselog( device->machine, 9, "(CAM) %08X -> %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CAM) %08X -> %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_cam_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(CAM) %08X <- %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
+ verboselog( device->machine(), 9, "(CAM) %08X <- %08X\n", S3C24XX_BASE_CAM + (offset << 2), data);
COMBINE_DATA(&s3c24xx->cam.regs.data[offset]);
}
@@ -3138,14 +3138,14 @@ static READ32_DEVICE_HANDLER( s3c24xx_ac97_r )
{
s3c24xx_t *s3c24xx = get_token( device);
UINT32 data = s3c24xx->ac97.regs.data[offset];
- verboselog( device->machine, 9, "(AC97) %08X -> %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(AC97) %08X -> %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c24xx_ac97_w )
{
s3c24xx_t *s3c24xx = get_token( device);
- verboselog( device->machine, 9, "(AC97) %08X <- %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
+ verboselog( device->machine(), 9, "(AC97) %08X <- %08X\n", S3C24XX_BASE_AC97 + (offset << 2), data);
COMBINE_DATA(&s3c24xx->ac97.regs.data[offset]);
}
@@ -3168,14 +3168,14 @@ static DEVICE_START( s3c24xx )
{
s3c24xx_t *s3c24xx = get_token( device);
s3c24xx->iface = (const s3c24xx_interface *)device->baseconfig().static_config();
- for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_pwm_timer_exp), (void*)device);
- for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_dma_timer_exp), (void*)device);
- s3c24xx->iic.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_iic_timer_exp), (void*)device);
- s3c24xx->iis.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_iis_timer_exp), (void*)device);
- s3c24xx->lcd.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_lcd_timer_exp), (void*)device);
- s3c24xx->rtc.timer_tick_count = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_tick_count_exp), (void*)device);
- s3c24xx->rtc.timer_update = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_update_exp), (void*)device);
- s3c24xx->wdt.timer = device->machine->scheduler().timer_alloc( FUNC(s3c24xx_wdt_timer_exp), (void*)device);
+ for (int i = 0; i < 5; i++) s3c24xx->pwm.timer[i] = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_pwm_timer_exp), (void*)device);
+ for (int i = 0; i < 4; i++) s3c24xx->dma[i].timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_dma_timer_exp), (void*)device);
+ s3c24xx->iic.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_iic_timer_exp), (void*)device);
+ s3c24xx->iis.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_iis_timer_exp), (void*)device);
+ s3c24xx->lcd.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_lcd_timer_exp), (void*)device);
+ s3c24xx->rtc.timer_tick_count = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_tick_count_exp), (void*)device);
+ s3c24xx->rtc.timer_update = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_rtc_timer_update_exp), (void*)device);
+ s3c24xx->wdt.timer = device->machine().scheduler().timer_alloc( FUNC(s3c24xx_wdt_timer_exp), (void*)device);
s3c24xx->rtc.timer_update->adjust( attotime::from_msec( 1000), 0, attotime::from_msec( 1000));
s3c24xx_rtc_init( device);
}
diff --git a/src/emu/machine/scsi.c b/src/emu/machine/scsi.c
index 1ddf429bed8..9506bb1fe0a 100644
--- a/src/emu/machine/scsi.c
+++ b/src/emu/machine/scsi.c
@@ -1,12 +1,12 @@
#include "emu.h"
#include "scsi.h"
-void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
+void SCSIAllocInstance( running_machine &machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
{
SCSIAllocInstanceParams params;
params.instance = NULL;
params.diskregion = diskregion;
- params.machine = machine;
+ params.m_machine = &machine;
scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, (void *)scsiClass, 0, &params );
*instance = params.instance;
}
@@ -104,11 +104,11 @@ int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intpa
return scsiClass->baseClass->dispatch( operation, file, intparm, ptrparm );
}
-SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass )
+SCSIInstance *SCSIMalloc( running_machine &machine, const SCSIClass *scsiClass )
{
SCSIInstance *scsiInstance = (SCSIInstance *)auto_alloc_array(machine, UINT8, SCSISizeof( scsiClass ));
scsiInstance->scsiClass = scsiClass;
- scsiInstance->machine = machine;
+ scsiInstance->m_machine = &machine;
return scsiInstance;
}
diff --git a/src/emu/machine/scsi.h b/src/emu/machine/scsi.h
index 3bc85c05417..b040e32230a 100644
--- a/src/emu/machine/scsi.h
+++ b/src/emu/machine/scsi.h
@@ -20,15 +20,17 @@ typedef struct _SCSIClass
typedef struct
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
const SCSIClass *scsiClass;
- running_machine *machine;
+ running_machine *m_machine;
} SCSIInstance;
typedef struct
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
SCSIInstance *instance;
const char *diskregion;
- running_machine *machine;
+ running_machine *m_machine;
} SCSIAllocInstanceParams;
// commands accepted by a SCSI device's dispatch handler
@@ -84,7 +86,7 @@ enum
#define SCSI_PHASE_MESSAGE_OUT ( 6 )
#define SCSI_PHASE_MESSAGE_IN ( 7 )
-extern void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion );
+extern void SCSIAllocInstance( running_machine &machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion );
extern void SCSIDeleteInstance( SCSIInstance *instance );
extern void SCSISetDevice( SCSIInstance *instance, void *device );
extern void SCSIGetDevice( SCSIInstance *instance, void **device );
@@ -97,7 +99,7 @@ extern void SCSIReadData( SCSIInstance *instance, void *data, int dataLength );
extern void SCSISetPhase( SCSIInstance *instance, int phase );
extern void SCSIGetPhase( SCSIInstance *instance, int *phase );
-extern SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass );
+extern SCSIInstance *SCSIMalloc( running_machine &machine, const SCSIClass *scsiClass );
extern int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm );
extern void *SCSIThis( const SCSIClass *scsiClass, SCSIInstance *instance );
extern int SCSISizeof( const SCSIClass *scsiClass );
diff --git a/src/emu/machine/scsicd.c b/src/emu/machine/scsicd.c
index 8dfb0ff7e72..3034981819f 100644
--- a/src/emu/machine/scsicd.c
+++ b/src/emu/machine/scsicd.c
@@ -70,7 +70,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return SCSILengthFromUINT8( &command[ 4 ] );
case 0x1b: // START STOP UNIT
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -103,7 +103,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
our_this->cur_subblock = 0;
}
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -143,7 +143,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
length = 4;
}
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -173,7 +173,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
if (cdrom_get_track_type(cdrom, trk) == CD_TRACK_AUDIO)
{
our_this->play_err_flag = 0;
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_start_audio(cdda, our_this->lba, our_this->blocks);
}
@@ -203,7 +203,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
if (our_this->blocks && cdrom)
{
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_start_audio(cdda, our_this->lba, our_this->blocks);
}
@@ -215,7 +215,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
case 0x4b: // PAUSE/RESUME
if (cdrom)
{
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_pause_audio(cdda, (command[8] & 0x01) ^ 0x01);
}
@@ -254,7 +254,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
if (cdrom_get_track_type(cdrom, trk) == CD_TRACK_AUDIO)
{
our_this->play_err_flag = 0;
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
cdda_start_audio(cdda, our_this->lba, our_this->blocks);
}
@@ -282,7 +282,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
our_this->cur_subblock = 0;
}
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL)
{
cdda_stop_audio(cdda);
@@ -329,7 +329,7 @@ static void scsicd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
data[0] = 0x71; // deferred error
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
if (cdda != NULL && cdda_audio_active(cdda))
{
data[12] = 0x00;
@@ -422,7 +422,7 @@ static void scsicd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
msf = command[1] & 0x2;
- cdda = cdda_from_cdrom(scsiInstance->machine, cdrom);
+ cdda = cdda_from_cdrom(scsiInstance->machine(), cdrom);
audio_active = cdda != NULL && cdda_audio_active(cdda);
if (audio_active)
{
@@ -671,7 +671,7 @@ static void scsicd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->lba = 0;
@@ -690,9 +690,9 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
state_save_register_item( machine, "scsicd", diskregion, 0, our_this->cur_subblock );
state_save_register_item( machine, "scsicd", diskregion, 0, our_this->play_err_flag );
- if (machine->device( diskregion )) {
+ if (machine.device( diskregion )) {
our_this->is_file = TRUE;
- our_this->cdrom = cd_get_cdrom_file( machine->device( diskregion ) );
+ our_this->cdrom = cd_get_cdrom_file( machine.device( diskregion ) );
} else {
our_this->is_file = FALSE;
our_this->cdrom = cdrom_open(get_disk_handle( machine, diskregion ));
diff --git a/src/emu/machine/scsidev.c b/src/emu/machine/scsidev.c
index 0018fa17305..c20f8f23ac8 100644
--- a/src/emu/machine/scsidev.c
+++ b/src/emu/machine/scsidev.c
@@ -28,7 +28,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return 0;
default:
- logerror( "%s: SCSIDEV unknown command %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown command %02x\n", scsiInstance->machine().describe_context(), command[ 0 ] );
return 0;
}
}
@@ -43,7 +43,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
switch( command[ 0 ] )
{
default:
- logerror( "%s: SCSIDEV unknown read %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown read %02x\n", scsiInstance->machine().describe_context(), command[ 0 ] );
break;
}
}
@@ -58,7 +58,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
switch( command[ 0 ] )
{
default:
- logerror( "%s: SCSIDEV unknown write %02x\n", scsiInstance->machine->describe_context(), command[ 0 ] );
+ logerror( "%s: SCSIDEV unknown write %02x\n", scsiInstance->machine().describe_context(), command[ 0 ] );
break;
}
}
@@ -100,7 +100,7 @@ static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
@@ -141,12 +141,12 @@ static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptr
case SCSIOP_ALLOC_INSTANCE:
params = (SCSIAllocInstanceParams *)ptrparm;
- params->instance = SCSIMalloc( params->machine, (const SCSIClass *)file );
+ params->instance = SCSIMalloc( params->machine(), (const SCSIClass *)file );
scsidev_alloc_instance( params->instance, params->diskregion );
return 0;
case SCSIOP_DELETE_INSTANCE:
- auto_free( ((SCSIInstance *)file)->machine, file );
+ auto_free( ((SCSIInstance *)file)->machine(), file );
return 0;
}
return 0;
diff --git a/src/emu/machine/scsihd.c b/src/emu/machine/scsihd.c
index 64b99c0c2c3..b3b6c340c8a 100644
--- a/src/emu/machine/scsihd.c
+++ b/src/emu/machine/scsihd.c
@@ -245,7 +245,7 @@ static void scsihd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
- running_machine *machine = scsiInstance->machine;
+ running_machine &machine = scsiInstance->machine();
SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->lba = 0;
@@ -254,9 +254,9 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
state_save_register_item( machine, "scsihd", diskregion, 0, our_this->lba );
state_save_register_item( machine, "scsihd", diskregion, 0, our_this->blocks );
- if (machine->device( diskregion )) {
+ if (machine.device( diskregion )) {
our_this->is_file = TRUE;
- our_this->disk = hd_get_hard_disk_file( machine->device( diskregion ) );
+ our_this->disk = hd_get_hard_disk_file( machine.device( diskregion ) );
} else {
our_this->is_file = FALSE;
our_this->disk = hard_disk_open(get_disk_handle( machine, diskregion ));
diff --git a/src/emu/machine/smc91c9x.c b/src/emu/machine/smc91c9x.c
index 8e37f8f65a9..94c9afd9c27 100644
--- a/src/emu/machine/smc91c9x.c
+++ b/src/emu/machine/smc91c9x.c
@@ -376,7 +376,7 @@ READ16_DEVICE_HANDLER( smc91c9x_r )
}
if (LOG_ETHERNET && offset != EREG_BANK)
- logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", device->machine->describe_context(), ethernet_regname[offset], result, mem_mask);
+ logerror("%s:smc91c9x_r(%s) = %04X & %04X\n", device->machine().describe_context(), ethernet_regname[offset], result, mem_mask);
return result;
}
@@ -401,7 +401,7 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w )
COMBINE_DATA(&smc->reg[offset]);
if (LOG_ETHERNET && offset != 7)
- logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", device->machine->describe_context(), ethernet_regname[offset], data, mem_mask);
+ logerror("%s:smc91c9x_w(%s) = %04X & %04X\n", device->machine().describe_context(), ethernet_regname[offset], data, mem_mask);
/* handle it */
switch (offset)
@@ -516,7 +516,6 @@ static DEVICE_START( smc91c9x )
assert(device != NULL);
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* store a pointer back to the device */
smc->device = device;
diff --git a/src/emu/machine/timekpr.c b/src/emu/machine/timekpr.c
index 2cce3bc68eb..79bd13627ca 100644
--- a/src/emu/machine/timekpr.c
+++ b/src/emu/machine/timekpr.c
@@ -62,7 +62,7 @@
#define TIMEKPR_DEVCFG_DERIVED_DEV_ALLOC(devtype) \
device_t *devtype##_device_config::alloc_device(running_machine &machine) const \
- { return auto_alloc(&machine, devtype##_device(machine, *this)); }
+ { return auto_alloc(machine, devtype##_device(machine, *this)); }
#define TIMEKPR_DERIVE(devtype, name, shortname) \
TIMEKPR_DEV_DERIVED_CTOR(devtype) \
@@ -104,7 +104,7 @@ device_config *timekeeper_device_config::static_alloc_device_config(const machin
device_t *timekeeper_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, timekeeper_device(machine, *this));
+ return auto_alloc(machine, timekeeper_device(machine, *this));
}
/***************************************************************************
@@ -211,7 +211,7 @@ void timekeeper_device::device_start()
m_month = make_bcd( systime.local_time.month + 1 );
m_year = make_bcd( systime.local_time.year % 100 );
m_century = make_bcd( systime.local_time.year / 100 );
- m_data = auto_alloc_array( &m_machine, UINT8, m_size );
+ m_data = auto_alloc_array( m_machine, UINT8, m_size );
m_default_data = *region();
if (m_default_data)
diff --git a/src/emu/machine/tmp68301.c b/src/emu/machine/tmp68301.c
index 2767b2277d5..3c09130fc2f 100644
--- a/src/emu/machine/tmp68301.c
+++ b/src/emu/machine/tmp68301.c
@@ -18,12 +18,12 @@ static emu_timer *tmp68301_timer[3]; // 3 Timers
static int tmp68301_irq_vector[8];
-static void tmp68301_update_timer( running_machine *machine, int i );
+static void tmp68301_update_timer( running_machine &machine, int i );
static IRQ_CALLBACK(tmp68301_irq_callback)
{
int vector = tmp68301_irq_vector[irqline];
-// logerror("%s: irq callback returns %04X for level %x\n",machine->describe_context(),vector,int_level);
+// logerror("%s: irq callback returns %04X for level %x\n",machine.describe_context(),vector,int_level);
return vector;
}
@@ -35,7 +35,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
UINT16 ICR = tmp68301_regs[0x8e/2+i]; // Interrupt Controller Register (ICR7..9)
UINT16 IVNR = tmp68301_regs[0x9a/2]; // Interrupt Vector Number Register (IVNR)
-// logerror("s: callback timer %04X, j = %d\n",machine->describe_context(),i,tcount);
+// logerror("s: callback timer %04X, j = %d\n",machine.describe_context(),i,tcount);
if ( (TCR & 0x0004) && // INT
!(IMR & (0x100<<i))
@@ -47,7 +47,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
tmp68301_irq_vector[level] = IVNR & 0x00e0;
tmp68301_irq_vector[level] += 4+i;
- device_set_input_line(machine->firstcpu,level,HOLD_LINE);
+ device_set_input_line(machine.firstcpu,level,HOLD_LINE);
}
if (TCR & 0x0080) // N/1
@@ -61,7 +61,7 @@ static TIMER_CALLBACK( tmp68301_timer_callback )
}
}
-static void tmp68301_update_timer( running_machine *machine, int i )
+static void tmp68301_update_timer( running_machine &machine, int i )
{
UINT16 TCR = tmp68301_regs[(0x200 + i * 0x20)/2];
UINT16 MAX1 = tmp68301_regs[(0x204 + i * 0x20)/2];
@@ -90,19 +90,19 @@ static void tmp68301_update_timer( running_machine *machine, int i )
{
int scale = (TCR & 0x3c00)>>10; // P4..1
if (scale > 8) scale = 8;
- duration = attotime::from_hz(machine->firstcpu->unscaled_clock()) * ((1 << scale) * max);
+ duration = attotime::from_hz(machine.firstcpu->unscaled_clock()) * ((1 << scale) * max);
}
break;
}
-// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",machine->describe_context(),i,duration,max);
+// logerror("%s: TMP68301 Timer %d, duration %lf, max %04X\n",machine.describe_context(),i,duration,max);
if (!(TCR & 0x0002)) // CS
{
if (duration != attotime::zero)
tmp68301_timer[i]->adjust(duration,i);
else
- logerror("%s: TMP68301 error, timer %d duration is 0\n",machine->describe_context(),i);
+ logerror("%s: TMP68301 error, timer %d duration is 0\n",machine.describe_context(),i);
}
}
@@ -110,7 +110,7 @@ MACHINE_START( tmp68301 )
{
int i;
for (i = 0; i < 3; i++)
- tmp68301_timer[i] = machine->scheduler().timer_alloc(FUNC(tmp68301_timer_callback));
+ tmp68301_timer[i] = machine.scheduler().timer_alloc(FUNC(tmp68301_timer_callback));
}
MACHINE_RESET( tmp68301 )
@@ -120,11 +120,11 @@ MACHINE_RESET( tmp68301 )
for (i = 0; i < 3; i++)
tmp68301_IE[i] = 0;
- device_set_irq_callback(machine->firstcpu, tmp68301_irq_callback);
+ device_set_irq_callback(machine.firstcpu, tmp68301_irq_callback);
}
/* Update the IRQ state based on all possible causes */
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
int i;
@@ -150,7 +150,7 @@ static void update_irq_state(running_machine *machine)
tmp68301_IE[i] = 0; // Interrupts are edge triggerred
- device_set_input_line(machine->firstcpu,level,HOLD_LINE);
+ device_set_input_line(machine.firstcpu,level,HOLD_LINE);
}
}
}
@@ -177,13 +177,13 @@ WRITE16_HANDLER( tmp68301_regs_w )
{
int i = ((offset*2) >> 5) & 3;
- tmp68301_update_timer( space->machine, i );
+ tmp68301_update_timer( space->machine(), i );
}
break;
}
}
-void tmp68301_external_interrupt_0(running_machine *machine) { tmp68301_IE[0] = 1; update_irq_state(machine); }
-void tmp68301_external_interrupt_1(running_machine *machine) { tmp68301_IE[1] = 1; update_irq_state(machine); }
-void tmp68301_external_interrupt_2(running_machine *machine) { tmp68301_IE[2] = 1; update_irq_state(machine); }
+void tmp68301_external_interrupt_0(running_machine &machine) { tmp68301_IE[0] = 1; update_irq_state(machine); }
+void tmp68301_external_interrupt_1(running_machine &machine) { tmp68301_IE[1] = 1; update_irq_state(machine); }
+void tmp68301_external_interrupt_2(running_machine &machine) { tmp68301_IE[2] = 1; update_irq_state(machine); }
diff --git a/src/emu/machine/tmp68301.h b/src/emu/machine/tmp68301.h
index c57407d68c8..c83c249c839 100644
--- a/src/emu/machine/tmp68301.h
+++ b/src/emu/machine/tmp68301.h
@@ -10,8 +10,8 @@ READ16_HANDLER( tmp68301_regs_r );
WRITE16_HANDLER( tmp68301_regs_w );
// Interrupts
-void tmp68301_external_interrupt_0(running_machine *machine);
-void tmp68301_external_interrupt_1(running_machine *machine);
-void tmp68301_external_interrupt_2(running_machine *machine);
+void tmp68301_external_interrupt_0(running_machine &machine);
+void tmp68301_external_interrupt_1(running_machine &machine);
+void tmp68301_external_interrupt_2(running_machine &machine);
#endif
diff --git a/src/emu/machine/wd33c93.c b/src/emu/machine/wd33c93.c
index 3f093a69c64..df05fadf910 100644
--- a/src/emu/machine/wd33c93.c
+++ b/src/emu/machine/wd33c93.c
@@ -168,8 +168,8 @@ static const struct WD33C93interface *intf;
#define SRCID_ER 0x80
/* command handler definition */
-typedef void (*cmd_handler)(running_machine *machine);
-#define CMD_HANDLER(name) void name(running_machine *machine)
+typedef void (*cmd_handler)(running_machine &machine);
+#define CMD_HANDLER(name) void name(running_machine &machine)
#define TEMP_INPUT_LEN 262144
#define FIFO_SIZE 12
@@ -235,7 +235,7 @@ static void wd33c93_read_data(int bytes, UINT8 *pData)
}
}
-static void wd33c93_complete_immediate( running_machine *machine, int status )
+static void wd33c93_complete_immediate( running_machine &machine, int status )
{
/* reset our timer */
scsi_data.cmd_timer->reset( );
@@ -293,7 +293,7 @@ static void wd33c93_complete_cmd( UINT8 status )
/* command handlers */
static CMD_HANDLER( wd33c93_invalid_cmd )
{
- logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", machine->describe_context(), scsi_data.regs[WD_COMMAND] );
+ logerror( "%s:Unknown/Unimplemented SCSI controller command: %02x\n", machine.describe_context(), scsi_data.regs[WD_COMMAND] );
/* complete the command */
wd33c93_complete_cmd( CSR_INVALID );
@@ -352,7 +352,7 @@ static CMD_HANDLER( wd33c93_select_cmd )
}
/* queue up a service request out in the future */
- machine->scheduler().timer_set( attotime::from_usec(50), FUNC(wd33c93_service_request ));
+ machine.scheduler().timer_set( attotime::from_usec(50), FUNC(wd33c93_service_request ));
}
else
{
@@ -424,7 +424,7 @@ static CMD_HANDLER( wd33c93_selectxfer_cmd )
scsi_data.busphase = PHS_MESS_IN;
/* queue up a service request out in the future */
- machine->scheduler().timer_set( attotime::from_msec(50), FUNC(wd33c93_service_request ));
+ machine.scheduler().timer_set( attotime::from_msec(50), FUNC(wd33c93_service_request ));
}
}
else
@@ -454,7 +454,7 @@ static CMD_HANDLER( wd33c93_xferinfo_cmd )
scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
/* the command will be completed once the data is transferred */
- machine->scheduler().timer_set( attotime::from_msec(1), FUNC(wd33c93_deassert_cip ));
+ machine.scheduler().timer_set( attotime::from_msec(1), FUNC(wd33c93_deassert_cip ));
}
/* Command handlers */
@@ -497,7 +497,7 @@ static const cmd_handler wd33c93_cmds[0x22] =
};
/* Handle pending commands */
-static void wd33c93_command( running_machine *machine )
+static void wd33c93_command( running_machine &machine )
{
/* get the command */
UINT8 cmd = scsi_data.regs[WD_COMMAND];
@@ -540,7 +540,7 @@ WRITE8_HANDLER(wd33c93_w)
scsi_data.regs[WD_AUXILIARY_STATUS] |= ASR_CIP;
/* process the command */
- wd33c93_command(space->machine);
+ wd33c93_command(space->machine());
}
else if ( scsi_data.sasr == WD_CDB_1 )
{
@@ -635,7 +635,7 @@ WRITE8_HANDLER(wd33c93_w)
}
/* complete the command */
- wd33c93_complete_immediate(space->machine, CSR_XFER_DONE | scsi_data.busphase);
+ wd33c93_complete_immediate(space->machine(), CSR_XFER_DONE | scsi_data.busphase);
}
}
else
@@ -682,7 +682,7 @@ READ8_HANDLER(wd33c93_r)
if (intf && intf->irq_callback)
{
- intf->irq_callback(space->machine, 0);
+ intf->irq_callback(space->machine(), 0);
}
LOG(( "WD33C93: PC=%08x - Status read (%02x)\n", cpu_get_pc(space->cpu), scsi_data.regs[WD_SCSI_STATUS] ));
@@ -778,7 +778,7 @@ READ8_HANDLER(wd33c93_r)
return 0;
}
-void wd33c93_init( running_machine *machine, const struct WD33C93interface *interface )
+void wd33c93_init( running_machine &machine, const struct WD33C93interface *interface )
{
int i;
@@ -795,7 +795,7 @@ void wd33c93_init( running_machine *machine, const struct WD33C93interface *inte
}
/* allocate a timer for commands */
- scsi_data.cmd_timer = machine->scheduler().timer_alloc(FUNC(wd33c93_complete_cb));
+ scsi_data.cmd_timer = machine.scheduler().timer_alloc(FUNC(wd33c93_complete_cb));
scsi_data.temp_input = auto_alloc_array( machine, UINT8, TEMP_INPUT_LEN );
diff --git a/src/emu/machine/wd33c93.h b/src/emu/machine/wd33c93.h
index 7598aa99cb4..2804019dbbc 100644
--- a/src/emu/machine/wd33c93.h
+++ b/src/emu/machine/wd33c93.h
@@ -11,10 +11,10 @@
struct WD33C93interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
- void (*irq_callback)(running_machine *machine, int state); /* irq callback */
+ void (*irq_callback)(running_machine &machine, int state); /* irq callback */
};
-extern void wd33c93_init( running_machine *machine, const struct WD33C93interface *interface );
+extern void wd33c93_init( running_machine &machine, const struct WD33C93interface *interface );
extern void wd33c93_exit( const struct WD33C93interface *interface );
extern void wd33c93_get_dma_data(int bytes, UINT8 *pData);
extern void wd33c93_write_data(int bytes, UINT8 *pData);
diff --git a/src/emu/machine/x2212.c b/src/emu/machine/x2212.c
index 81f76677f0a..e246ca53e05 100644
--- a/src/emu/machine/x2212.c
+++ b/src/emu/machine/x2212.c
@@ -62,7 +62,7 @@ device_config *x2212_device_config::static_alloc_device_config(const machine_con
device_t *x2212_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, x2212_device(machine, *this));
+ return auto_alloc(machine, x2212_device(machine, *this));
}
diff --git a/src/emu/machine/x76f041.c b/src/emu/machine/x76f041.c
index 6844c2ac507..6070a120a54 100644
--- a/src/emu/machine/x76f041.c
+++ b/src/emu/machine/x76f041.c
@@ -25,7 +25,7 @@ inline void ATTR_PRINTF(3,4) x76f041_device::verboselog(int n_level, const char
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("x76f041 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("x76f041 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -43,7 +43,7 @@ device_config *x76f041_device_config::static_alloc_device_config(const machine_c
device_t *x76f041_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, x76f041_device(machine, *this));
+ return auto_alloc(machine, x76f041_device(machine, *this));
}
x76f041_device::x76f041_device(running_machine &_machine, const x76f041_device_config &_config)
diff --git a/src/emu/machine/x76f100.c b/src/emu/machine/x76f100.c
index 222a8d540f6..e89ec08b015 100644
--- a/src/emu/machine/x76f100.c
+++ b/src/emu/machine/x76f100.c
@@ -23,7 +23,7 @@ inline void ATTR_PRINTF(3,4) x76f100_device::verboselog(int n_level, const char
va_start(v, s_fmt);
vsprintf(buf, s_fmt, v);
va_end(v);
- logerror("x76f100 %s %s: %s", config.tag(), machine->describe_context(), buf);
+ logerror("x76f100 %s %s: %s", config.tag(), m_machine.describe_context(), buf);
}
}
@@ -41,7 +41,7 @@ device_config *x76f100_device_config::static_alloc_device_config(const machine_c
device_t *x76f100_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, x76f100_device(machine, *this));
+ return auto_alloc(machine, x76f100_device(machine, *this));
}
x76f100_device::x76f100_device(running_machine &_machine, const x76f100_device_config &_config)
diff --git a/src/emu/machine/z80ctc.c b/src/emu/machine/z80ctc.c
index e112707233b..fe195f62913 100644
--- a/src/emu/machine/z80ctc.c
+++ b/src/emu/machine/z80ctc.c
@@ -108,7 +108,7 @@ device_config *z80ctc_device_config::static_alloc_device_config(const machine_co
device_t *z80ctc_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80ctc_device(machine, *this));
+ return auto_alloc(machine, z80ctc_device(machine, *this));
}
@@ -336,7 +336,7 @@ void z80ctc_device::ctc_channel::start(z80ctc_device *device, int index, bool no
if (write_line != NULL)
devcb_resolve_write_line(&m_zc, write_line, m_device);
m_notimer = notimer;
- m_timer = m_device->machine->scheduler().timer_alloc(FUNC(static_timer_callback), this);
+ m_timer = m_device->machine().scheduler().timer_alloc(FUNC(static_timer_callback), this);
// register for save states
m_device->save_item(NAME(m_mode), m_index);
diff --git a/src/emu/machine/z80dart.c b/src/emu/machine/z80dart.c
index e23b39a65d8..6058d8d7148 100644
--- a/src/emu/machine/z80dart.c
+++ b/src/emu/machine/z80dart.c
@@ -221,7 +221,7 @@ device_config *z80dart_device_config::static_alloc_device_config(const machine_c
device_t *z80dart_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80dart_device(machine, *this));
+ return auto_alloc(machine, z80dart_device(machine, *this));
}
diff --git a/src/emu/machine/z80dma.c b/src/emu/machine/z80dma.c
index 8f027e5037d..0ae998debcd 100644
--- a/src/emu/machine/z80dma.c
+++ b/src/emu/machine/z80dma.c
@@ -172,7 +172,7 @@ device_config *z80dma_device_config::static_alloc_device_config(const machine_co
device_t *z80dma_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80dma_device(machine, *this));
+ return auto_alloc(machine, z80dma_device(machine, *this));
}
diff --git a/src/emu/machine/z80pio.c b/src/emu/machine/z80pio.c
index 3ca7bbd330c..1e6c123d308 100644
--- a/src/emu/machine/z80pio.c
+++ b/src/emu/machine/z80pio.c
@@ -84,7 +84,7 @@ device_config *z80pio_device_config::static_alloc_device_config(const machine_co
device_t *z80pio_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80pio_device(machine, *this));
+ return auto_alloc(machine, z80pio_device(machine, *this));
}
diff --git a/src/emu/machine/z80sio.c b/src/emu/machine/z80sio.c
index cb39ca4c90d..71e99630a02 100644
--- a/src/emu/machine/z80sio.c
+++ b/src/emu/machine/z80sio.c
@@ -326,7 +326,7 @@ device_config *z80sio_device_config::static_alloc_device_config(const machine_co
device_t *z80sio_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80sio_device(machine, *this));
+ return auto_alloc(machine, z80sio_device(machine, *this));
}
@@ -524,7 +524,7 @@ void z80sio_device::sio_channel::start(z80sio_device *device, int index)
{
m_device = device;
m_index = index;
- m_receive_timer = device->machine->scheduler().timer_alloc(FUNC(static_serial_callback), this);
+ m_receive_timer = device->machine().scheduler().timer_alloc(FUNC(static_serial_callback), this);
}
@@ -713,7 +713,7 @@ int z80sio_device::sio_channel::rts()
void z80sio_device::sio_channel::set_cts(int state)
{
- m_device->machine->scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_CTS << 1) + (state != 0), this);
+ m_device->machine().scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_CTS << 1) + (state != 0), this);
}
@@ -723,7 +723,7 @@ void z80sio_device::sio_channel::set_cts(int state)
void z80sio_device::sio_channel::set_dcd(int state)
{
- m_device->machine->scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_DCD << 1) + (state != 0), this);
+ m_device->machine().scheduler().synchronize(FUNC(static_change_input_line), (SIO_RR0_DCD << 1) + (state != 0), this);
}
diff --git a/src/emu/machine/z80sti.c b/src/emu/machine/z80sti.c
index 61442abc32d..6be81805b97 100644
--- a/src/emu/machine/z80sti.c
+++ b/src/emu/machine/z80sti.c
@@ -175,7 +175,7 @@ device_config *z80sti_device_config::static_alloc_device_config(const machine_co
device_t *z80sti_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, z80sti_device(machine, *this));
+ return auto_alloc(machine, z80sti_device(machine, *this));
}
diff --git a/src/emu/mame.c b/src/emu/mame.c
index 1cbfa192f72..65d671b32ef 100644
--- a/src/emu/mame.c
+++ b/src/emu/mame.c
@@ -129,9 +129,9 @@ const char mame_disclaimer[] =
given machine is valid
-------------------------------------------------*/
-int mame_is_valid_machine(running_machine *machine)
+int mame_is_valid_machine(running_machine &machine)
{
- return (machine != NULL && machine == global_machine);
+ return (&machine == global_machine);
}
diff --git a/src/emu/mame.h b/src/emu/mame.h
index 5132fd3f659..52a0399dc55 100644
--- a/src/emu/mame.h
+++ b/src/emu/mame.h
@@ -99,7 +99,7 @@ extern const char build_version[];
int mame_execute(emu_options &options, osd_interface &osd);
/* return true if the given machine is valid */
-int mame_is_valid_machine(running_machine *machine);
+int mame_is_valid_machine(running_machine &machine);
diff --git a/src/emu/mconfig.h b/src/emu/mconfig.h
index b52ec412234..05fb5500cb7 100644
--- a/src/emu/mconfig.h
+++ b/src/emu/mconfig.h
@@ -84,11 +84,11 @@
#define NVRAM_HANDLER_NAME(name) nvram_handler_##name
-#define NVRAM_HANDLER(name) void NVRAM_HANDLER_NAME(name)(running_machine *machine, emu_file *file, int read_or_write)
+#define NVRAM_HANDLER(name) void NVRAM_HANDLER_NAME(name)(running_machine &machine, emu_file *file, int read_or_write)
#define NVRAM_HANDLER_CALL(name) NVRAM_HANDLER_NAME(name)(machine, file, read_or_write)
#define MEMCARD_HANDLER_NAME(name) memcard_handler_##name
-#define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine *machine, emu_file &file, int action)
+#define MEMCARD_HANDLER(name) void MEMCARD_HANDLER_NAME(name)(running_machine &machine, emu_file &file, int action)
#define MEMCARD_HANDLER_CALL(name) MEMCARD_HANDLER_NAME(name)(machine, file, action)
@@ -110,8 +110,8 @@ class screen_device_config;
// various callback functions
-typedef void (*nvram_handler_func)(running_machine *machine, emu_file *file, int read_or_write);
-typedef void (*memcard_handler_func)(running_machine *machine, emu_file &file, int action);
+typedef void (*nvram_handler_func)(running_machine &machine, emu_file *file, int read_or_write);
+typedef void (*memcard_handler_func)(running_machine &machine, emu_file &file, int action);
diff --git a/src/emu/memory.c b/src/emu/memory.c
index 45e3772a3cd..abb1b6c3873 100644
--- a/src/emu/memory.c
+++ b/src/emu/memory.c
@@ -190,13 +190,13 @@
AM_SIZE_MEMBER(struct, sizefield)
Specifies a field within a given struct as where to store the base
or size of the current bucket. The struct is assumed to be hanging
- off of the machine->driver_data pointer.
+ off of the machine.driver_data pointer.
AM_BASE_GENERIC(basefield)
AM_SIZE_GENERIC(sizefield)
Specifies a field within the global generic_pointers struct as
where to store the base or size of the current bucket. The global
- generic_pointer struct lives in machine->generic.
+ generic_pointer struct lives in machine.generic.
***************************************************************************/
@@ -788,7 +788,7 @@ private:
{
if (m_space.log_unmap() && !m_space.debugger_access())
logerror("%s: unmapped %s memory read from %s & %s\n",
- m_space.m_machine.describe_context(), m_space.name(),
+ m_space.machine().describe_context(), m_space.name(),
core_i64_hex_format(m_space.byte_to_address(offset * sizeof(_UintType)), m_space.addrchars()),
core_i64_hex_format(mask, 2 * sizeof(_UintType)));
return m_space.unmap();
@@ -844,7 +844,7 @@ private:
{
if (m_space.log_unmap() && !m_space.debugger_access())
logerror("%s: unmapped %s memory write to %s = %s & %s\n",
- m_space.m_machine.describe_context(), m_space.name(),
+ m_space.machine().describe_context(), m_space.name(),
core_i64_hex_format(m_space.byte_to_address(offset * sizeof(_UintType)), m_space.addrchars()),
core_i64_hex_format(data, 2 * sizeof(_UintType)),
core_i64_hex_format(mask, 2 * sizeof(_UintType)));
@@ -1542,7 +1542,7 @@ UINT8 address_table::s_watchpoint_table[1 << LEVEL1_BITS];
static STATE_POSTLOAD( bank_reattach );
// debugging
-static void generate_memdump(running_machine *machine);
+static void generate_memdump(running_machine &machine);
@@ -1554,21 +1554,21 @@ static void generate_memdump(running_machine *machine);
// memory_init - initialize the memory system
//-------------------------------------------------
-void memory_init(running_machine *machine)
+void memory_init(running_machine &machine)
{
// allocate our private data
- memory_private *memdata = machine->memory_data = auto_alloc_clear(machine, memory_private);
+ memory_private *memdata = machine.memory_data = auto_alloc_clear(machine, memory_private);
memdata->banknext = STATIC_BANK1;
// loop over devices and spaces within each device
device_memory_interface *memory = NULL;
- for (bool gotone = machine->m_devicelist.first(memory); gotone; gotone = memory->next(memory))
+ for (bool gotone = machine.m_devicelist.first(memory); gotone; gotone = memory->next(memory))
for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
{
// if there is a configuration for this space, we need an address space
const address_space_config *spaceconfig = memory->space_config(spacenum);
if (spaceconfig != NULL)
- memdata->spacelist.append(address_space::allocate(*machine, *spaceconfig, *memory, spacenum));
+ memdata->spacelist.append(address_space::allocate(machine, *spaceconfig, *memory, spacenum));
}
// construct and preprocess the address_map for each space
@@ -1588,7 +1588,7 @@ void memory_init(running_machine *machine)
space->locate_memory();
// register a callback to reset banks when reloading state
- machine->state().register_postload(bank_reattach, NULL);
+ machine.state().register_postload(bank_reattach, NULL);
// dump the final memory configuration
generate_memdump(machine);
@@ -1597,9 +1597,9 @@ void memory_init(running_machine *machine)
memdata->initialized = true;
}
-address_space *memory_nonspecific_space(running_machine *machine)
+address_space *memory_nonspecific_space(running_machine &machine)
{
- memory_private *memdata = machine->memory_data;
+ memory_private *memdata = machine.memory_data;
return memdata->spacelist.first();
}
@@ -1614,10 +1614,10 @@ address_space *memory_nonspecific_space(running_machine *machine)
// addresses for a bank
//-------------------------------------------------
-void memory_configure_bank(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
+void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_configure_bank called for unknown bank '%s'", tag);
if (base == NULL)
@@ -1634,10 +1634,10 @@ void memory_configure_bank(running_machine *machine, const char *tag, int starte
// the decrypted addresses for a bank
//-------------------------------------------------
-void memory_configure_bank_decrypted(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
+void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_configure_bank_decrypted called for unknown bank '%s'", tag);
if (base == NULL)
@@ -1654,10 +1654,10 @@ void memory_configure_bank_decrypted(running_machine *machine, const char *tag,
// entry to be the new bank base
//-------------------------------------------------
-void memory_set_bank(running_machine *machine, const char *tag, int entrynum)
+void memory_set_bank(running_machine &machine, const char *tag, int entrynum)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_set_bank called for unknown bank '%s'", tag);
@@ -1671,10 +1671,10 @@ void memory_set_bank(running_machine *machine, const char *tag, int entrynum)
// selected bank
//-------------------------------------------------
-int memory_get_bank(running_machine *machine, const char *tag)
+int memory_get_bank(running_machine &machine, const char *tag)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
fatalerror("memory_get_bank called for unknown bank '%s'", tag);
@@ -1687,10 +1687,10 @@ int memory_get_bank(running_machine *machine, const char *tag)
// memory_set_bankptr - set the base of a bank
//-------------------------------------------------
-void memory_set_bankptr(running_machine *machine, const char *tag, void *base)
+void memory_set_bankptr(running_machine &machine, const char *tag, void *base)
{
// validation checks
- memory_bank *bank = machine->memory_data->bankmap.find_hash_only(tag);
+ memory_bank *bank = machine.memory_data->bankmap.find_hash_only(tag);
if (bank == NULL)
throw emu_fatalerror("memory_set_bankptr called for unknown bank '%s'", tag);
@@ -1725,14 +1725,14 @@ void *memory_get_shared(running_machine &machine, const char *tag, size_t &lengt
// to the given file
//-------------------------------------------------
-void memory_dump(running_machine *machine, FILE *file)
+void memory_dump(running_machine &machine, FILE *file)
{
// skip if we can't open the file
if (file == NULL)
return;
// loop over address spaces
- for (address_space *space = machine->memory_data->spacelist.first(); space != NULL; space = space->next())
+ for (address_space *space = machine.memory_data->spacelist.first(); space != NULL; space = space->next())
{
fprintf(file, "\n\n"
"====================================================\n"
@@ -1753,7 +1753,7 @@ void memory_dump(running_machine *machine, FILE *file)
// generate_memdump - internal memory dump
//-------------------------------------------------
-static void generate_memdump(running_machine *machine)
+static void generate_memdump(running_machine &machine)
{
if (MEM_DUMP)
{
@@ -1774,7 +1774,7 @@ static void generate_memdump(running_machine *machine)
static STATE_POSTLOAD( bank_reattach )
{
// for each non-anonymous bank, explicitly reset its entry
- for (memory_bank *bank = machine->memory_data->banklist.first(); bank != NULL; bank = bank->next())
+ for (memory_bank *bank = machine.memory_data->banklist.first(); bank != NULL; bank = bank->next())
if (!bank->anonymous() && bank->entry() != BANK_ENTRY_UNSPECIFIED)
bank->set_entry(bank->entry());
}
@@ -1790,12 +1790,11 @@ static STATE_POSTLOAD( bank_reattach )
//-------------------------------------------------
address_space::address_space(device_memory_interface &memory, address_spacenum spacenum, bool large)
- : machine(memory.device().machine),
- cpu(&memory.device()),
- m_machine(*memory.device().machine),
+ : cpu(&memory.device()),
m_next(NULL),
m_config(*memory.space_config(spacenum)),
m_device(memory.device()),
+ m_machine(memory.device().machine()),
m_map(NULL),
m_addrmask(0xffffffffUL >> (32 - m_config.m_addrbus_width)),
m_bytemask(address_to_byte_end(m_addrmask)),
@@ -1805,7 +1804,7 @@ address_space::address_space(device_memory_interface &memory, address_spacenum s
m_spacenum(spacenum),
m_debugger_access(false),
m_log_unmap(true),
- m_direct(*auto_alloc(memory.device().machine, direct_read_data(*this))),
+ m_direct(*auto_alloc(memory.device().machine(), direct_read_data(*this))),
m_name(memory.space_config(spacenum)->name()),
m_addrchars((m_config.m_databus_width + 3) / 4),
m_logaddrchars((m_config.m_logaddr_width + 3) / 4)
@@ -1841,64 +1840,64 @@ address_space &address_space::allocate(running_machine &machine, const address_s
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_8le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_8le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_8le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_8le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_8be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_8be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_8be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_8be_small(memory, spacenum));
}
case 16:
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_16le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_16le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_16le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_16le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_16be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_16be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_16be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_16be_small(memory, spacenum));
}
case 32:
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_32le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_32le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_32le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_32le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_32be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_32be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_32be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_32be_small(memory, spacenum));
}
case 64:
if (config.endianness() == ENDIANNESS_LITTLE)
{
if (large)
- return *auto_alloc(&machine, address_space_64le_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_64le_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_64le_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_64le_small(memory, spacenum));
}
else
{
if (large)
- return *auto_alloc(&machine, address_space_64be_large(memory, spacenum));
+ return *auto_alloc(machine, address_space_64be_large(memory, spacenum));
else
- return *auto_alloc(&machine, address_space_64be_small(memory, spacenum));
+ return *auto_alloc(machine, address_space_64be_small(memory, spacenum));
}
}
throw emu_fatalerror("Invalid width %d specified for address_space::allocate", config.data_width());
@@ -1964,7 +1963,7 @@ void address_space::prepare_map()
if (entry->m_share != NULL && m_machine.memory_data->sharemap.find(entry->m_share) == NULL)
{
VPRINTF(("Creating share '%s' of length 0x%X\n", entry->m_share, entry->m_byteend + 1 - entry->m_bytestart));
- memory_share *share = auto_alloc(&m_machine, memory_share(entry->m_byteend + 1 - entry->m_bytestart));
+ memory_share *share = auto_alloc(m_machine, memory_share(entry->m_byteend + 1 - entry->m_bytestart));
m_machine.memory_data->sharemap.add(entry->m_share, share, false);
}
@@ -2171,7 +2170,7 @@ void address_space::allocate_memory()
memory_block *prev_memblock_tail = blocklist.last();
for (address_map_entry *entry = m_map->m_entrylist.first(); entry != NULL; entry = entry->next())
if (entry->m_memory != NULL)
- blocklist.append(*auto_alloc(&m_machine, memory_block(*this, entry->m_bytestart, entry->m_byteend, entry->m_memory)));
+ blocklist.append(*auto_alloc(m_machine, memory_block(*this, entry->m_bytestart, entry->m_byteend, entry->m_memory)));
// loop over all blocks just allocated and assign pointers from them
address_map_entry *unassigned = NULL;
@@ -2218,7 +2217,7 @@ void address_space::allocate_memory()
// we now have a block to allocate; do it
offs_t curbytestart = curblockstart * MEMORY_BLOCK_CHUNK;
offs_t curbyteend = curblockend * MEMORY_BLOCK_CHUNK + (MEMORY_BLOCK_CHUNK - 1);
- memory_block &block = blocklist.append(*auto_alloc(&m_machine, memory_block(*this, curbytestart, curbyteend)));
+ memory_block &block = blocklist.append(*auto_alloc(m_machine, memory_block(*this, curbytestart, curbyteend)));
// assign memory that intersected the new block
unassigned = block_assign_intersecting(curbytestart, curbyteend, block.data());
@@ -2468,7 +2467,7 @@ void address_space::install_readwrite_port(offs_t addrstart, offs_t addrend, off
}
// update the memory dump
- generate_memdump(&m_machine);
+ generate_memdump(m_machine);
}
@@ -2499,7 +2498,7 @@ void address_space::install_bank_generic(offs_t addrstart, offs_t addrend, offs_
}
// update the memory dump
- generate_memdump(&m_machine);
+ generate_memdump(m_machine);
}
@@ -2542,7 +2541,7 @@ void *address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_
{
if (m_machine.phase() >= MACHINE_PHASE_RESET)
fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!");
- memory_block &block = memdata->blocklist.append(*auto_alloc(&m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
+ memory_block &block = memdata->blocklist.append(*auto_alloc(m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
bank.set_base(block.data());
}
}
@@ -2571,7 +2570,7 @@ void *address_space::install_ram_generic(offs_t addrstart, offs_t addrend, offs_
{
if (m_machine.phase() >= MACHINE_PHASE_RESET)
fatalerror("Attempted to call install_ram_generic() after initialization time without a baseptr!");
- memory_block &block = memdata->blocklist.append(*auto_alloc(&m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
+ memory_block &block = memdata->blocklist.append(*auto_alloc(m_machine, memory_block(*this, address_to_byte(addrstart), address_to_byte_end(addrend))));
bank.set_base(block.data());
}
}
@@ -2594,7 +2593,7 @@ UINT8 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, off
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2607,7 +2606,7 @@ UINT8 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, of
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2633,7 +2632,7 @@ UINT8 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addre
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2646,7 +2645,7 @@ UINT8 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t addr
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2671,7 +2670,7 @@ UINT8 *address_space::install_legacy_read_handler(device_t &device, offs_t addrs
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2684,7 +2683,7 @@ UINT8 *address_space::install_legacy_write_handler(device_t &device, offs_t addr
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT8 *>(find_backing_memory(addrstart, addrend));
}
@@ -2704,7 +2703,7 @@ UINT16 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, of
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2712,7 +2711,7 @@ UINT16 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, o
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2733,7 +2732,7 @@ UINT16 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2741,7 +2740,7 @@ UINT16 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2761,7 +2760,7 @@ UINT16 *address_space::install_legacy_read_handler(device_t &device, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2769,7 +2768,7 @@ UINT16 *address_space::install_legacy_write_handler(device_t &device, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT16 *>(find_backing_memory(addrstart, addrend));
}
@@ -2789,7 +2788,7 @@ UINT32 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, of
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2797,7 +2796,7 @@ UINT32 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, o
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2818,7 +2817,7 @@ UINT32 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2826,7 +2825,7 @@ UINT32 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2846,7 +2845,7 @@ UINT32 *address_space::install_legacy_read_handler(device_t &device, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2854,7 +2853,7 @@ UINT32 *address_space::install_legacy_write_handler(device_t &device, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT32 *>(find_backing_memory(addrstart, addrend));
}
@@ -2874,7 +2873,7 @@ UINT64 *address_space::install_read_handler(offs_t addrstart, offs_t addrend, of
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2882,7 +2881,7 @@ UINT64 *address_space::install_write_handler(offs_t addrstart, offs_t addrend, o
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_delegate(handler, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2903,7 +2902,7 @@ UINT64 *address_space::install_legacy_read_handler(offs_t addrstart, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(*this, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2911,7 +2910,7 @@ UINT64 *address_space::install_legacy_write_handler(offs_t addrstart, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(*this, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2931,7 +2930,7 @@ UINT64 *address_space::install_legacy_read_handler(device_t &device, offs_t addr
{
UINT32 entry = read().map_range(addrstart, addrend, addrmask, addrmirror);
read().handler_read(entry).set_legacy_func(device, rhandler, rname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -2939,7 +2938,7 @@ UINT64 *address_space::install_legacy_write_handler(device_t &device, offs_t add
{
UINT32 entry = write().map_range(addrstart, addrend, addrmask, addrmirror);
write().handler_write(entry).set_legacy_func(device, whandler, wname, unitmask);
- generate_memdump(machine);
+ generate_memdump(m_machine);
return reinterpret_cast<UINT64 *>(find_backing_memory(addrstart, addrend));
}
@@ -3078,7 +3077,7 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
}
// allocate the bank
- bank = auto_alloc(&m_machine, memory_bank(*this, banknum, bytestart, byteend, tag));
+ bank = auto_alloc(m_machine, memory_bank(*this, banknum, bytestart, byteend, tag));
memdata->banklist.append(*bank);
// for named banks, add to the map and register for save states
@@ -3102,11 +3101,11 @@ memory_bank &address_space::bank_find_or_allocate(const char *tag, offs_t addrst
//-------------------------------------------------
address_table::address_table(address_space &space, bool large)
- : m_table(auto_alloc_array(&space.m_machine, UINT8, 1 << LEVEL1_BITS)),
+ : m_table(auto_alloc_array(space.machine(), UINT8, 1 << LEVEL1_BITS)),
m_live_lookup(m_table),
m_space(space),
m_large(large),
- m_subtable(auto_alloc_array(&space.m_machine, subtable_data, SUBTABLE_COUNT)),
+ m_subtable(auto_alloc_array(space.machine(), subtable_data, SUBTABLE_COUNT)),
m_subtable_alloc(0)
{
// make our static table all watchpoints
@@ -3124,8 +3123,8 @@ address_table::address_table(address_space &space, bool large)
address_table::~address_table()
{
- auto_free(&m_space.m_machine, m_table);
- auto_free(&m_space.m_machine, m_subtable);
+ auto_free(m_space.machine(), m_table);
+ auto_free(m_space.machine(), m_subtable);
}
@@ -3495,11 +3494,11 @@ UINT8 address_table::subtable_alloc()
m_subtable_alloc += SUBTABLE_ALLOC;
UINT32 newsize = (1 << LEVEL1_BITS) + (m_subtable_alloc << level2_bits());
- UINT8 *newtable = auto_alloc_array_clear(&m_space.m_machine, UINT8, newsize);
+ UINT8 *newtable = auto_alloc_array_clear(m_space.machine(), UINT8, newsize);
memcpy(newtable, m_table, oldsize);
if (m_live_lookup == m_table)
m_live_lookup = newtable;
- auto_free(&m_space.m_machine, m_table);
+ auto_free(m_space.machine(), m_table);
m_table = newtable;
}
@@ -3712,7 +3711,7 @@ const char *address_table::handler_name(UINT8 entry) const
// banks have names
if (entry >= STATIC_BANK1 && entry <= STATIC_BANKMAX)
- for (memory_bank *info = m_space.m_machine.memory_data->banklist.first(); info != NULL; info = info->next())
+ for (memory_bank *info = m_space.machine().memory_data->banklist.first(); info != NULL; info = info->next())
if (info->index() == entry)
return info->name();
@@ -3736,8 +3735,8 @@ address_table_read::address_table_read(address_space &space, bool large)
// allocate handlers for each entry, prepopulating the bankptrs for banks
for (int entrynum = 0; entrynum < ARRAY_LENGTH(m_handlers); entrynum++)
{
- UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.m_machine.memory_data->bank_ptr[entrynum] : NULL;
- m_handlers[entrynum] = auto_alloc(&space.m_machine, handler_entry_read(space.data_width(), space.endianness(), bankptr));
+ UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.machine().memory_data->bank_ptr[entrynum] : NULL;
+ m_handlers[entrynum] = auto_alloc(space.machine(), handler_entry_read(space.data_width(), space.endianness(), bankptr));
}
// we have to allocate different object types based on the data bus width
@@ -3786,7 +3785,7 @@ address_table_read::address_table_read(address_space &space, bool large)
address_table_read::~address_table_read()
{
for (int handnum = 0; handnum < ARRAY_LENGTH(m_handlers); handnum++)
- auto_free(&m_space.m_machine, m_handlers[handnum]);
+ auto_free(m_space.machine(), m_handlers[handnum]);
}
@@ -3812,8 +3811,8 @@ address_table_write::address_table_write(address_space &space, bool large)
// allocate handlers for each entry, prepopulating the bankptrs for banks
for (int entrynum = 0; entrynum < ARRAY_LENGTH(m_handlers); entrynum++)
{
- UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.m_machine.memory_data->bank_ptr[entrynum] : NULL;
- m_handlers[entrynum] = auto_alloc(&space.m_machine, handler_entry_write(space.data_width(), space.endianness(), bankptr));
+ UINT8 **bankptr = (entrynum >= STATIC_BANK1 && entrynum <= STATIC_BANKMAX) ? &space.machine().memory_data->bank_ptr[entrynum] : NULL;
+ m_handlers[entrynum] = auto_alloc(space.machine(), handler_entry_write(space.data_width(), space.endianness(), bankptr));
}
// we have to allocate different object types based on the data bus width
@@ -3862,7 +3861,7 @@ address_table_write::address_table_write(address_space &space, bool large)
address_table_write::~address_table_write()
{
for (int handnum = 0; handnum < ARRAY_LENGTH(m_handlers); handnum++)
- auto_free(&m_space.m_machine, m_handlers[handnum]);
+ auto_free(m_space.machine(), m_handlers[handnum]);
}
@@ -3942,8 +3941,8 @@ bool direct_read_data::set_direct_region(offs_t &byteaddress)
}
// if no decrypted opcodes, point to the same base
- UINT8 *base = m_space.m_machine.memory_data->bank_ptr[m_entry];
- UINT8 *based = m_space.m_machine.memory_data->bankd_ptr[m_entry];
+ UINT8 *base = m_space.machine().memory_data->bank_ptr[m_entry];
+ UINT8 *based = m_space.machine().memory_data->bankd_ptr[m_entry];
if (based == NULL)
based = base;
@@ -3978,7 +3977,7 @@ direct_read_data::direct_range *direct_read_data::find_range(offs_t byteaddress,
if (range != NULL)
m_freerangelist.detach(*range);
else
- range = auto_alloc(&m_space.m_machine, direct_range);
+ range = auto_alloc(m_space.machine(), direct_range);
// fill in the range
m_space.read().derive_range(byteaddress, range->m_bytestart, range->m_byteend);
@@ -4057,7 +4056,7 @@ void direct_read_data::explicit_configure(offs_t bytestart, offs_t byteend, offs
memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteend, void *memory)
: m_next(NULL),
- m_machine(space.m_machine),
+ m_machine(space.machine()),
m_space(space),
m_bytestart(bytestart),
m_byteend(byteend),
@@ -4071,17 +4070,17 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
{
offs_t length = byteend + 1 - bytestart;
if (length < 4096)
- m_allocated = m_data = auto_alloc_array_clear(&space.m_machine, UINT8, length);
+ m_allocated = m_data = auto_alloc_array_clear(space.machine(), UINT8, length);
else
{
- m_allocated = auto_alloc_array_clear(&space.m_machine, UINT8, length + 0xfff);
+ m_allocated = auto_alloc_array_clear(space.machine(), UINT8, length + 0xfff);
m_data = reinterpret_cast<UINT8 *>((reinterpret_cast<FPTR>(m_allocated) + 0xfff) & ~0xfff);
}
}
// register for saving, but only if we're not part of a memory region
const memory_region *region;
- for (region = space.m_machine.first_region(); region != NULL; region = region->next())
+ for (region = space.machine().first_region(); region != NULL; region = region->next())
if (m_data >= region->base() && (m_data + (byteend - bytestart + 1)) < region->end())
{
VPRINTF(("skipping save of this memory block as it is covered by a memory region\n"));
@@ -4094,7 +4093,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
int bytes_per_element = space.data_width() / 8;
astring name;
name.printf("%08x-%08x", bytestart, byteend);
- space.m_machine.state().save_memory("memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element);
+ space.machine().state().save_memory("memory", space.device().tag(), space.spacenum(), name, m_data, bytes_per_element, (UINT32)(byteend + 1 - bytestart) / bytes_per_element);
}
}
@@ -4106,7 +4105,7 @@ memory_block::memory_block(address_space &space, offs_t bytestart, offs_t byteen
memory_block::~memory_block()
{
if (m_allocated != NULL)
- auto_free(&m_machine, m_allocated);
+ auto_free(m_machine, m_allocated);
}
@@ -4121,9 +4120,9 @@ memory_block::~memory_block()
memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs_t byteend, const char *tag)
: m_next(NULL),
- m_machine(space.m_machine),
- m_baseptr(&space.m_machine.memory_data->bank_ptr[index]),
- m_basedptr(&space.m_machine.memory_data->bankd_ptr[index]),
+ m_machine(space.machine()),
+ m_baseptr(&space.machine().memory_data->bank_ptr[index]),
+ m_basedptr(&space.machine().memory_data->bankd_ptr[index]),
m_index(index),
m_anonymous(tag == NULL),
m_bytestart(bytestart),
@@ -4144,8 +4143,8 @@ memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs
m_name.printf("Bank '%s'", tag);
}
- if (!m_anonymous && space.m_machine.state().registration_allowed())
- space.m_machine.state().save_item("memory", m_tag, 0, NAME(m_curentry));
+ if (!m_anonymous && space.machine().state().registration_allowed())
+ space.machine().state().save_item("memory", m_tag, 0, NAME(m_curentry));
}
@@ -4155,7 +4154,7 @@ memory_bank::memory_bank(address_space &space, int index, offs_t bytestart, offs
memory_bank::~memory_bank()
{
- auto_free(&m_machine, m_entry);
+ auto_free(m_machine, m_entry);
}
@@ -4184,7 +4183,7 @@ void memory_bank::add_reference(address_space &space, read_or_write readorwrite)
// if we already have a reference, skip it
if (references_space(space, readorwrite))
return;
- m_reflist.append(*auto_alloc(&space.m_machine, bank_reference(space, readorwrite)));
+ m_reflist.append(*auto_alloc(space.machine(), bank_reference(space, readorwrite)));
}
@@ -4269,12 +4268,12 @@ void memory_bank::expand_entries(int entrynum)
int newcount = entrynum + 1;
// allocate a new array and copy from the old one; zero out the new entries
- bank_entry *newentry = auto_alloc_array(&m_machine, bank_entry, newcount);
+ bank_entry *newentry = auto_alloc_array(m_machine, bank_entry, newcount);
memcpy(newentry, m_entry, sizeof(m_entry[0]) * m_entry_count);
memset(&newentry[m_entry_count], 0, (newcount - m_entry_count) * sizeof(m_entry[0]));
// free the old array and set the updated values
- auto_free(&m_machine, m_entry);
+ auto_free(m_machine, m_entry);
m_entry = newentry;
m_entry_count = newcount;
}
diff --git a/src/emu/memory.h b/src/emu/memory.h
index b7d648f61de..cf5ef7cad54 100644
--- a/src/emu/memory.h
+++ b/src/emu/memory.h
@@ -353,6 +353,7 @@ public:
// getters
address_space *next() const { return m_next; }
device_t &device() const { return m_device; }
+ running_machine &machine() const { return m_machine; }
const char *name() const { return m_name; }
address_spacenum spacenum() const { return m_spacenum; }
address_map *map() const { return m_map; }
@@ -576,15 +577,14 @@ private:
public:
// public state (eventually will go away)
- running_machine * machine; // kept for backwards compatibility
device_t * cpu; // kept for backwards compatibility
- running_machine & m_machine; // reference to the owning machine
protected:
// private state
address_space * m_next; // next address space in the global list
const address_space_config &m_config; // configuration of this space
device_t & m_device; // reference to the owning device
+ running_machine & m_machine; // reference to the owning machine
address_map * m_map; // original memory map
offs_t m_addrmask; // physical address mask
offs_t m_bytemask; // byte-converted physical address mask
@@ -715,31 +715,31 @@ extern const char *const address_space_names[ADDRESS_SPACES];
//**************************************************************************
// initialize the memory system
-void memory_init(running_machine *machine);
+void memory_init(running_machine &machine);
// configure the addresses for a bank
-void memory_configure_bank(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
+void memory_configure_bank(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
// configure the decrypted addresses for a bank
-void memory_configure_bank_decrypted(running_machine *machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(1, 5);
+void memory_configure_bank_decrypted(running_machine &machine, const char *tag, int startentry, int numentries, void *base, offs_t stride) ATTR_NONNULL(5);
// select one pre-configured entry to be the new bank base
-void memory_set_bank(running_machine *machine, const char *tag, int entrynum) ATTR_NONNULL(1);
+void memory_set_bank(running_machine &machine, const char *tag, int entrynum);
// return the currently selected bank
-int memory_get_bank(running_machine *machine, const char *tag) ATTR_NONNULL(1);
+int memory_get_bank(running_machine &machine, const char *tag);
// set the absolute address of a bank base
-void memory_set_bankptr(running_machine *machine, const char *tag, void *base) ATTR_NONNULL(1, 3);
+void memory_set_bankptr(running_machine &machine, const char *tag, void *base) ATTR_NONNULL(3);
// get a pointer to a shared memory region by tag
void *memory_get_shared(running_machine &machine, const char *tag);
void *memory_get_shared(running_machine &machine, const char *tag, size_t &length);
// dump the internal memory tables to the given file
-void memory_dump(running_machine *machine, FILE *file);
+void memory_dump(running_machine &machine, FILE *file);
-address_space *memory_nonspecific_space(running_machine *machine);
+address_space *memory_nonspecific_space(running_machine &machine);
//**************************************************************************
diff --git a/src/emu/output.c b/src/emu/output.c
index b4b05e30a1a..31a0f444f95 100644
--- a/src/emu/output.c
+++ b/src/emu/output.c
@@ -144,14 +144,14 @@ INLINE output_item *create_new_item(const char *outname, INT32 value)
output_init - initialize everything
-------------------------------------------------*/
-void output_init(running_machine *machine)
+void output_init(running_machine &machine)
{
/* add pause callback */
- machine->add_notifier(MACHINE_NOTIFY_PAUSE, output_pause);
- machine->add_notifier(MACHINE_NOTIFY_RESUME, output_resume);
+ machine.add_notifier(MACHINE_NOTIFY_PAUSE, output_pause);
+ machine.add_notifier(MACHINE_NOTIFY_RESUME, output_resume);
/* get a callback when done */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, output_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, output_exit);
/* reset the lists */
memset(itemtable, 0, sizeof(itemtable));
diff --git a/src/emu/output.h b/src/emu/output.h
index 308d5c764c7..46b74ea5a92 100644
--- a/src/emu/output.h
+++ b/src/emu/output.h
@@ -32,7 +32,7 @@ typedef void (*output_notifier_func)(const char *outname, INT32 value, void *par
***************************************************************************/
/* core initialization */
-void output_init(running_machine *machine);
+void output_init(running_machine &machine);
/* set the value for a given output */
void output_set_value(const char *outname, INT32 value);
diff --git a/src/emu/render.c b/src/emu/render.c
index 709e9a3d0ea..654534d3a52 100644
--- a/src/emu/render.c
+++ b/src/emu/render.c
@@ -405,7 +405,7 @@ void render_texture::release()
for (int scalenum = 0; scalenum < ARRAY_LENGTH(m_scaled); scalenum++)
{
m_manager->invalidate_all(m_scaled[scalenum].bitmap);
- auto_free(&m_manager->machine(), m_scaled[scalenum].bitmap);
+ auto_free(m_manager->machine(), m_scaled[scalenum].bitmap);
m_scaled[scalenum].bitmap = NULL;
m_scaled[scalenum].seqid = 0;
}
@@ -423,7 +423,7 @@ void render_texture::release()
m_palette = NULL;
// free any B/C/G lookup tables
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = NULL;
m_bcglookup_entries = 0;
}
@@ -467,7 +467,7 @@ void render_texture::set_bitmap(bitmap_t *bitmap, const rectangle *sbounds, int
if (m_scaled[scalenum].bitmap != NULL)
{
m_manager->invalidate_all(m_scaled[scalenum].bitmap);
- auto_free(&m_manager->machine(), m_scaled[scalenum].bitmap);
+ auto_free(m_manager->machine(), m_scaled[scalenum].bitmap);
}
m_scaled[scalenum].bitmap = NULL;
m_scaled[scalenum].seqid = 0;
@@ -545,11 +545,11 @@ bool render_texture::get_scaled(UINT32 dwidth, UINT32 dheight, render_texinfo &t
if (scaled->bitmap != NULL)
{
m_manager->invalidate_all(scaled->bitmap);
- auto_free(&m_manager->machine(), scaled->bitmap);
+ auto_free(m_manager->machine(), scaled->bitmap);
}
// allocate a new bitmap
- scaled->bitmap = auto_alloc(&m_manager->machine(), bitmap_t(dwidth, dheight, BITMAP_FORMAT_ARGB32));
+ scaled->bitmap = auto_alloc(m_manager->machine(), bitmap_t(dwidth, dheight, BITMAP_FORMAT_ARGB32));
scaled->seqid = ++m_curseq;
// let the scaler do the work
@@ -599,9 +599,9 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
numentries = palette_get_num_colors(m_palette) * palette_get_num_groups(m_palette);
if (m_bcglookup == NULL || m_bcglookup_entries < numentries)
{
- rgb_t *newlookup = auto_alloc_array(&m_manager->machine(), rgb_t, numentries);
+ rgb_t *newlookup = auto_alloc_array(m_manager->machine(), rgb_t, numentries);
memcpy(newlookup, m_bcglookup, m_bcglookup_entries * sizeof(rgb_t));
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = newlookup;
m_bcglookup_entries = numentries;
}
@@ -629,9 +629,9 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
adjusted = palette_entry_list_adjusted(m_palette);
if (m_bcglookup == NULL || m_bcglookup_entries < 4 * 32)
{
- rgb_t *newlookup = auto_alloc_array(&m_manager->machine(), rgb_t, 4 * 32);
+ rgb_t *newlookup = auto_alloc_array(m_manager->machine(), rgb_t, 4 * 32);
memcpy(newlookup, m_bcglookup, m_bcglookup_entries * sizeof(rgb_t));
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = newlookup;
m_bcglookup_entries = 4 * 32;
}
@@ -664,9 +664,9 @@ const rgb_t *render_texture::get_adjusted_palette(render_container &container)
adjusted = palette_entry_list_adjusted(m_palette);
if (m_bcglookup == NULL || m_bcglookup_entries < 4 * 256)
{
- rgb_t *newlookup = auto_alloc_array(&m_manager->machine(), rgb_t, 4 * 256);
+ rgb_t *newlookup = auto_alloc_array(m_manager->machine(), rgb_t, 4 * 256);
memcpy(newlookup, m_bcglookup, m_bcglookup_entries * sizeof(rgb_t));
- auto_free(&m_manager->machine(), m_bcglookup);
+ auto_free(m_manager->machine(), m_bcglookup);
m_bcglookup = newlookup;
m_bcglookup_entries = 4 * 256;
}
@@ -1051,7 +1051,7 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
: m_next(NULL),
m_manager(manager),
m_curview(NULL),
- m_filelist(*auto_alloc(&manager.machine(), simple_list<layout_file>(manager.machine().respool()))),
+ m_filelist(*auto_alloc(manager.machine(), simple_list<layout_file>(manager.machine().respool()))),
m_flags(flags),
m_listindex(0),
m_width(640),
@@ -1110,7 +1110,7 @@ render_target::render_target(render_manager &manager, const char *layoutfile, UI
render_target::~render_target()
{
- auto_free(&m_manager.machine(), &m_filelist);
+ auto_free(m_manager.machine(), &m_filelist);
}
@@ -1703,7 +1703,7 @@ bool render_target::load_layout_file(const char *dirname, const char *filename)
bool result = true;
try
{
- m_filelist.append(*auto_alloc(&m_manager.machine(), layout_file(m_manager.machine(), *rootnode, dirname)));
+ m_filelist.append(*auto_alloc(m_manager.machine(), layout_file(m_manager.machine(), *rootnode, dirname)));
}
catch (emu_fatalerror &err)
{
@@ -2458,11 +2458,11 @@ render_manager::render_manager(running_machine &machine)
m_ui_target(NULL),
m_live_textures(0),
m_texture_allocator(machine.respool()),
- m_ui_container(auto_alloc(&machine, render_container(*this))),
+ m_ui_container(auto_alloc(machine, render_container(*this))),
m_screen_container_list(machine.respool())
{
// register callbacks
- config_register(&machine, "video", config_load_static, config_save_static);
+ config_register(machine, "video", config_load_static, config_save_static);
// create one container per screen
for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
@@ -2527,7 +2527,7 @@ float render_manager::max_update_rate() const
render_target *render_manager::target_alloc(const char *layoutfile, UINT32 flags)
{
- return &m_targetlist.append(*auto_alloc(&m_machine, render_target(*this, layoutfile, flags)));
+ return &m_targetlist.append(*auto_alloc(m_machine, render_target(*this, layoutfile, flags)));
}
@@ -2621,7 +2621,7 @@ void render_manager::texture_free(render_texture *texture)
render_font *render_manager::font_alloc(const char *filename)
{
- return auto_alloc(&m_machine, render_font(*this, filename));
+ return auto_alloc(m_machine, render_font(*this, filename));
}
@@ -2631,7 +2631,7 @@ render_font *render_manager::font_alloc(const char *filename)
void render_manager::font_free(render_font *font)
{
- auto_free(&m_machine, font);
+ auto_free(m_machine, font);
}
@@ -2658,7 +2658,7 @@ void render_manager::invalidate_all(void *refptr)
render_container *render_manager::container_alloc(screen_device *screen)
{
- render_container *container = auto_alloc(&m_machine, render_container(*this, screen));
+ render_container *container = auto_alloc(m_machine, render_container(*this, screen));
if (screen != NULL)
m_screen_container_list.append(*container);
return container;
@@ -2672,7 +2672,7 @@ render_container *render_manager::container_alloc(screen_device *screen)
void render_manager::container_free(render_container *container)
{
m_screen_container_list.detach(*container);
- auto_free(&m_machine, container);
+ auto_free(m_machine, container);
}
@@ -2681,9 +2681,9 @@ void render_manager::container_free(render_container *container)
// configuration file
//-------------------------------------------------
-void render_manager::config_load_static(running_machine *machine, int config_type, xml_data_node *parentnode)
+void render_manager::config_load_static(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- machine->render().config_load(config_type, parentnode);
+ machine.render().config_load(config_type, parentnode);
}
void render_manager::config_load(int config_type, xml_data_node *parentnode)
@@ -2745,9 +2745,9 @@ void render_manager::config_load(int config_type, xml_data_node *parentnode)
// file
//-------------------------------------------------
-void render_manager::config_save_static(running_machine *machine, int config_type, xml_data_node *parentnode)
+void render_manager::config_save_static(running_machine &machine, int config_type, xml_data_node *parentnode)
{
- machine->render().config_save(config_type, parentnode);
+ machine.render().config_save(config_type, parentnode);
}
void render_manager::config_save(int config_type, xml_data_node *parentnode)
diff --git a/src/emu/render.h b/src/emu/render.h
index 312977d9299..d14e28f03b0 100644
--- a/src/emu/render.h
+++ b/src/emu/render.h
@@ -761,8 +761,8 @@ private:
void container_free(render_container *container);
// config callbacks
- static void config_load_static(running_machine *machine, int config_type, xml_data_node *parentnode);
- static void config_save_static(running_machine *machine, int config_type, xml_data_node *parentnode);
+ static void config_load_static(running_machine &machine, int config_type, xml_data_node *parentnode);
+ static void config_save_static(running_machine &machine, int config_type, xml_data_node *parentnode);
void config_load(int config_type, xml_data_node *parentnode);
void config_save(int config_type, xml_data_node *parentnode);
diff --git a/src/emu/rendfont.c b/src/emu/rendfont.c
index 629e6b84533..c5325f3c1e8 100644
--- a/src/emu/rendfont.c
+++ b/src/emu/rendfont.c
@@ -83,7 +83,7 @@ inline render_font::glyph &render_font::get_char(unicode_char chnum)
// grab the table; if none, return the dummy character
glyph *glyphtable = m_glyphs[chnum / 256];
if (glyphtable == NULL && m_format == FF_OSD)
- glyphtable = m_glyphs[chnum / 256] = auto_alloc_array_clear(&m_manager.machine(), glyph, 256);
+ glyphtable = m_glyphs[chnum / 256] = auto_alloc_array_clear(m_manager.machine(), glyph, 256);
if (glyphtable == NULL)
return dummy_glyph;
@@ -161,15 +161,15 @@ render_font::~render_font()
{
glyph &gl = m_glyphs[tablenum][charnum];
m_manager.texture_free(gl.texture);
- auto_free(&m_manager.machine(), gl.bitmap);
+ auto_free(m_manager.machine(), gl.bitmap);
}
// free the subtable itself
- auto_free(&m_manager.machine(), m_glyphs[tablenum]);
+ auto_free(m_manager.machine(), m_glyphs[tablenum]);
}
// free the raw data and the size itself
- auto_free(&m_manager.machine(), m_rawdata);
+ auto_free(m_manager.machine(), m_rawdata);
// release the OSD font
if (m_osdfont != NULL)
@@ -212,7 +212,7 @@ void render_font::char_expand(unicode_char chnum, glyph &gl)
return;
// allocate a new bitmap of the size we need
- gl.bitmap = auto_alloc(&m_manager.machine(), bitmap_t(gl.bmwidth, m_height, BITMAP_FORMAT_ARGB32));
+ gl.bitmap = auto_alloc(m_manager.machine(), bitmap_t(gl.bmwidth, m_height, BITMAP_FORMAT_ARGB32));
bitmap_fill(gl.bitmap, NULL, 0);
// extract the data
@@ -419,7 +419,7 @@ bool render_font::load_cached_bdf(const char *filename)
// determine the file size and allocate memory
m_rawsize = file.size();
- char *data = auto_alloc_array_clear(&m_manager.machine(), char, m_rawsize + 1);
+ char *data = auto_alloc_array_clear(m_manager.machine(), char, m_rawsize + 1);
// read the first chunk
UINT32 bytes = file.read(data, MIN(CACHED_BDF_HASH_SIZE, m_rawsize));
@@ -445,7 +445,7 @@ bool render_font::load_cached_bdf(const char *filename)
// if that worked, we're done
if (result)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return true;
}
}
@@ -457,7 +457,7 @@ bool render_font::load_cached_bdf(const char *filename)
UINT32 read = file.read(data + bytes, m_rawsize - bytes);
if (read != m_rawsize - bytes)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return false;
}
}
@@ -559,7 +559,7 @@ bool render_font::load_bdf()
{
// if we don't have a subtable yet, make one
if (m_glyphs[charnum / 256] == NULL)
- m_glyphs[charnum / 256] = auto_alloc_array_clear(&m_manager.machine(), glyph, 256);
+ m_glyphs[charnum / 256] = auto_alloc_array_clear(m_manager.machine(), glyph, 256);
// fill in the entry
glyph &gl = m_glyphs[charnum / 256][charnum % 256];
@@ -620,11 +620,11 @@ bool render_font::load_cached(emu_file &file, UINT32 hash)
return false;
// now read the rest of the data
- UINT8 *data = auto_alloc_array(&m_manager.machine(), UINT8, filesize - CACHED_HEADER_SIZE);
+ UINT8 *data = auto_alloc_array(m_manager.machine(), UINT8, filesize - CACHED_HEADER_SIZE);
bytes_read = file.read(data, filesize - CACHED_HEADER_SIZE);
if (bytes_read != filesize - CACHED_HEADER_SIZE)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return false;
}
@@ -637,7 +637,7 @@ bool render_font::load_cached(emu_file &file, UINT32 hash)
// if we don't have a subtable yet, make one
if (m_glyphs[chnum / 256] == NULL)
- m_glyphs[chnum / 256] = auto_alloc_array_clear(&m_manager.machine(), glyph, 256);
+ m_glyphs[chnum / 256] = auto_alloc_array_clear(m_manager.machine(), glyph, 256);
// fill in the entry
glyph &gl = m_glyphs[chnum / 256][chnum % 256];
@@ -652,7 +652,7 @@ bool render_font::load_cached(emu_file &file, UINT32 hash)
offset += (gl.bmwidth * gl.bmheight + 7) / 8;
if (offset > filesize - CACHED_HEADER_SIZE)
{
- auto_free(&m_manager.machine(), data);
+ auto_free(m_manager.machine(), data);
return false;
}
}
@@ -696,10 +696,10 @@ bool render_font::save_cached(const char *filename, UINT32 hash)
try
{
// allocate an array to hold the character data
- UINT8 *chartable = auto_alloc_array_clear(&m_manager.machine(), UINT8, numchars * CACHED_CHAR_SIZE);
+ UINT8 *chartable = auto_alloc_array_clear(m_manager.machine(), UINT8, numchars * CACHED_CHAR_SIZE);
// allocate a temp buffer to compress into
- UINT8 *tempbuffer = auto_alloc_array(&m_manager.machine(), UINT8, 65536);
+ UINT8 *tempbuffer = auto_alloc_array(m_manager.machine(), UINT8, 65536);
// write the header
UINT8 *dest = tempbuffer;
@@ -773,7 +773,7 @@ bool render_font::save_cached(const char *filename, UINT32 hash)
// free the bitmap and texture
m_manager.texture_free(gl.texture);
- auto_free(&m_manager.machine(), gl.bitmap);
+ auto_free(m_manager.machine(), gl.bitmap);
gl.texture = NULL;
gl.bitmap = NULL;
}
@@ -802,15 +802,15 @@ bool render_font::save_cached(const char *filename, UINT32 hash)
throw emu_fatalerror("Error writing cached file");
// all done
- auto_free(&m_manager.machine(), tempbuffer);
- auto_free(&m_manager.machine(), chartable);
+ auto_free(m_manager.machine(), tempbuffer);
+ auto_free(m_manager.machine(), chartable);
return true;
}
catch (...)
{
file.remove_on_close();
- auto_free(&m_manager.machine(), tempbuffer);
- auto_free(&m_manager.machine(), chartable);
+ auto_free(m_manager.machine(), tempbuffer);
+ auto_free(m_manager.machine(), chartable);
return false;
}
}
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 5f99b5b8d27..c6e03f1c1d6 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -454,7 +454,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
for (xml_data_node *compnode = elemnode.child; compnode != NULL; compnode = compnode->next)
{
// allocate a new component
- component &newcomp = m_complist.append(*auto_alloc(&machine, component(machine, *compnode, dirname)));
+ component &newcomp = m_complist.append(*auto_alloc(machine, component(machine, *compnode, dirname)));
// accumulate bounds
if (first)
@@ -494,7 +494,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
}
// allocate an array of element textures for the states
- m_elemtex = auto_alloc_array(&machine, texture, m_maxstate + 1);
+ m_elemtex = auto_alloc_array(machine, texture, m_maxstate + 1);
}
@@ -505,7 +505,7 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
layout_element::~layout_element()
{
// loop over all states and free their textures
- auto_free(&m_machine, m_elemtex);
+ auto_free(m_machine, m_elemtex);
}
@@ -1682,19 +1682,19 @@ layout_view::layout_view(running_machine &machine, xml_data_node &viewnode, simp
// load backdrop items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "backdrop"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "backdrop"))
- m_backdrop_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_backdrop_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// load screen items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "screen"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "screen"))
- m_screen_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_screen_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// load overlay items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "overlay"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "overlay"))
- m_overlay_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_overlay_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// load bezel items
for (xml_data_node *itemnode = xml_get_sibling(viewnode.child, "bezel"); itemnode != NULL; itemnode = xml_get_sibling(itemnode->next, "bezel"))
- m_bezel_list.append(*auto_alloc(&machine, item(machine, *itemnode, elemlist)));
+ m_bezel_list.append(*auto_alloc(machine, item(machine, *itemnode, elemlist)));
// recompute the data for the view based on a default layer config
recompute(render_layer_config());
@@ -1914,7 +1914,7 @@ int layout_view::item::state() const
{
const input_field_config *field = input_field_by_tag_and_mask(m_element->machine().m_portlist, m_input_tag, m_input_mask);
if (field != NULL)
- state = ((input_port_read_safe(&m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0;
+ state = ((input_port_read_safe(m_element->machine(), m_input_tag, 0) ^ field->defvalue) & m_input_mask) ? 1 : 0;
}
return state;
}
@@ -1946,11 +1946,11 @@ layout_file::layout_file(running_machine &machine, xml_data_node &rootnode, cons
// parse all the elements
for (xml_data_node *elemnode = xml_get_sibling(mamelayoutnode->child, "element"); elemnode != NULL; elemnode = xml_get_sibling(elemnode->next, "element"))
- m_elemlist.append(*auto_alloc(&machine, layout_element(machine, *elemnode, dirname)));
+ m_elemlist.append(*auto_alloc(machine, layout_element(machine, *elemnode, dirname)));
// parse all the views
for (xml_data_node *viewnode = xml_get_sibling(mamelayoutnode->child, "view"); viewnode != NULL; viewnode = xml_get_sibling(viewnode->next, "view"))
- m_viewlist.append(*auto_alloc(&machine, layout_view(machine, *viewnode, m_elemlist)));
+ m_viewlist.append(*auto_alloc(machine, layout_view(machine, *viewnode, m_elemlist)));
}
diff --git a/src/emu/romload.c b/src/emu/romload.c
index fec47443462..760cfc46ac0 100644
--- a/src/emu/romload.c
+++ b/src/emu/romload.c
@@ -49,7 +49,9 @@ struct _open_chd
typedef struct _romload_private rom_load_data;
struct _romload_private
{
- running_machine *machine; /* machine object where needed */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine *m_machine; /* machine object where needed */
int system_bios; /* the system BIOS we wish to load */
int warnings; /* warning count during processing */
@@ -127,11 +129,11 @@ file_error common_process_file(emu_options &options, const char *location, bool
CHD file associated with the given region
-------------------------------------------------*/
-chd_file *get_disk_handle(running_machine *machine, const char *region)
+chd_file *get_disk_handle(running_machine &machine, const char *region)
{
open_chd *curdisk;
- for (curdisk = machine->romload_data->chd_list; curdisk != NULL; curdisk = curdisk->next)
+ for (curdisk = machine.romload_data->chd_list; curdisk != NULL; curdisk = curdisk->next)
if (strcmp(curdisk->region, region) == 0)
return (curdisk->diffchd != NULL) ? curdisk->diffchd : curdisk->origchd;
return NULL;
@@ -143,9 +145,9 @@ chd_file *get_disk_handle(running_machine *machine, const char *region)
list of CHD files
-------------------------------------------------*/
-static void add_disk_handle(running_machine *machine, open_chd *chd)
+static void add_disk_handle(running_machine &machine, open_chd *chd)
{
- romload_private *romload_data = machine->romload_data;
+ romload_private *romload_data = machine.romload_data;
*romload_data->chd_list_tailptr = auto_alloc(machine, open_chd);
**romload_data->chd_list_tailptr = *chd;
@@ -168,7 +170,7 @@ void set_disk_handle(running_machine &machine, const char *region, emu_file &fil
chd.origfile = &file;
/* we're okay, add to the list of disks */
- add_disk_handle(&machine, &chd);
+ add_disk_handle(machine, &chd);
}
@@ -330,7 +332,7 @@ static void CLIB_DECL ATTR_PRINTF(1,2) debugload(const char *string, ...)
static void determine_bios_rom(rom_load_data *romdata)
{
- const char *specbios = romdata->machine->options().bios();
+ const char *specbios = romdata->machine().options().bios();
const char *defaultname = NULL;
const rom_entry *rom;
int default_no = 1;
@@ -338,7 +340,7 @@ static void determine_bios_rom(rom_load_data *romdata)
romdata->system_bios = 0;
- for (const rom_source *source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (const rom_source *source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
{
/* first determine the default BIOS name */
for (rom = source->rom_region(); !ROMENTRY_ISEND(rom); rom++)
@@ -396,7 +398,7 @@ static void count_roms(rom_load_data *romdata)
romdata->romstotalsize = 0;
/* loop over regions, then over files */
- for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
for (rom = rom_first_file(region); rom != NULL; rom = rom_next_file(rom))
if (ROM_GETBIOSFLAGS(rom) == 0 || ROM_GETBIOSFLAGS(rom) == romdata->system_bios)
@@ -412,10 +414,10 @@ static void count_roms(rom_load_data *romdata)
random data
-------------------------------------------------*/
-static void fill_random(running_machine *machine, UINT8 *base, UINT32 length)
+static void fill_random(running_machine &machine, UINT8 *base, UINT32 length)
{
while (length--)
- *base++ = machine->rand();
+ *base++ = machine.rand();
}
@@ -531,7 +533,7 @@ static void display_loading_rom_message(rom_load_data *romdata, const char *name
else
sprintf(buffer, "Loading Complete");
- ui_set_startup_text(romdata->machine, buffer, FALSE);
+ ui_set_startup_text(romdata->machine(), buffer, FALSE);
}
@@ -550,7 +552,7 @@ static void display_rom_load_results(rom_load_data *romdata)
{
/* create the error message and exit fatally */
mame_printf_error("%s", romdata->errorstring.cstr());
- fatalerror_exitcode(romdata->machine, MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
+ fatalerror_exitcode(romdata->machine(), MAMERR_MISSING_FILES, "ERROR: required files are missing, the "GAMENOUN" cannot be run.");
}
/* if we had warnings, output them, but continue */
@@ -569,7 +571,7 @@ static void display_rom_load_results(rom_load_data *romdata)
static void region_post_process(rom_load_data *romdata, const char *rgntag, bool invert)
{
- const memory_region *region = romdata->machine->region(rgntag);
+ const memory_region *region = romdata->machine().region(rgntag);
UINT8 *base;
int i, j;
@@ -624,9 +626,9 @@ static int open_rom_file(rom_load_data *romdata, const char *regiontag, const ro
/* attempt reading up the chain through the parents. It automatically also
attempts any kind of load by checksum supported by the archives. */
romdata->file = NULL;
- for (drv = &romdata->machine->system(); romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
+ for (drv = &romdata->machine().system(); romdata->file == NULL && drv != NULL; drv = driver_get_clone(drv))
if (drv->name != NULL && *drv->name != 0)
- filerr = common_process_file(romdata->machine->options(), drv->name, has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), drv->name, has_crc, crc, romp, &romdata->file);
/* if the region is load by name, load the ROM from there */
if (romdata->file == NULL && regiontag != NULL)
@@ -676,21 +678,21 @@ static int open_rom_file(rom_load_data *romdata, const char *regiontag, const ro
// - if we are not using lists, we have regiontag only;
// - if we are using lists, we have: list/clonename, list/parentname, clonename, parentname
if (!is_list)
- filerr = common_process_file(romdata->machine->options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag1.cstr(), has_crc, crc, romp, &romdata->file);
else
{
// try to load from list/setname
if ((romdata->file == NULL) && (tag2.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag2.cstr(), has_crc, crc, romp, &romdata->file);
// try to load from list/parentname
if ((romdata->file == NULL) && has_parent && (tag3.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag3.cstr(), has_crc, crc, romp, &romdata->file);
// try to load from setname
if ((romdata->file == NULL) && (tag4.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag4.cstr(), has_crc, crc, romp, &romdata->file);
// try to load from parentname
if ((romdata->file == NULL) && has_parent && (tag5.cstr() != NULL))
- filerr = common_process_file(romdata->machine->options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
+ filerr = common_process_file(romdata->machine().options(), tag5.cstr(), has_crc, crc, romp, &romdata->file);
}
}
@@ -716,7 +718,7 @@ static int rom_fread(rom_load_data *romdata, UINT8 *buffer, int length)
/* otherwise, fill with randomness */
else
- fill_random(romdata->machine, buffer, length);
+ fill_random(romdata->machine(), buffer, length);
return length;
}
@@ -761,7 +763,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
/* use a temporary buffer for complex loads */
tempbufsize = MIN(TEMPBUFFER_MAX_SIZE, numbytes);
- tempbuf = auto_alloc_array(romdata->machine, UINT8, tempbufsize);
+ tempbuf = auto_alloc_array(romdata->machine(), UINT8, tempbufsize);
/* chunky reads for complex loads */
skip += groupsize;
@@ -775,7 +777,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
LOG((" Reading %X bytes into buffer\n", bytesleft));
if (rom_fread(romdata, bufptr, bytesleft) != bytesleft)
{
- auto_free(romdata->machine, tempbuf);
+ auto_free(romdata->machine(), tempbuf);
return 0;
}
numbytes -= bytesleft;
@@ -836,7 +838,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
}
}
}
- auto_free(romdata->machine, tempbuf);
+ auto_free(romdata->machine(), tempbuf);
LOG((" All done\n"));
return ROM_GETLENGTH(romp);
@@ -885,7 +887,7 @@ static void copy_rom_data(rom_load_data *romdata, const rom_entry *romp)
fatalerror("Error in RomModule definition: COPY has an invalid length\n");
/* make sure the source was valid */
- const memory_region *region = romdata->machine->region(srcrgntag);
+ const memory_region *region = romdata->machine().region(srcrgntag);
if (region == NULL)
fatalerror("Error in RomModule definition: COPY from an invalid region\n");
@@ -1226,7 +1228,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
/* first open the source drive */
LOG(("Opening disk image: %s\n", filename.cstr()));
- err = open_disk_image(romdata->machine->options(), &romdata->machine->system(), romp, &chd.origfile, &chd.origchd, locationtag);
+ err = open_disk_image(romdata->machine().options(), &romdata->machine().system(), romp, &chd.origfile, &chd.origchd, locationtag);
if (err != CHDERR_NONE)
{
if (err == CHDERR_FILE_NOT_FOUND)
@@ -1266,7 +1268,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
if (!DISK_ISREADONLY(romp))
{
/* try to open or create the diff */
- err = open_disk_diff(romdata->machine->options(), romp, chd.origchd, &chd.difffile, &chd.diffchd);
+ err = open_disk_diff(romdata->machine().options(), romp, chd.origchd, &chd.difffile, &chd.diffchd);
if (err != CHDERR_NONE)
{
romdata->errorstring.catprintf("%s DIFF CHD ERROR: %s\n", filename.cstr(), chd_error_string(err));
@@ -1277,7 +1279,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
/* we're okay, add to the list of disks */
LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp)));
- add_disk_handle(romdata->machine, &chd);
+ add_disk_handle(romdata->machine(), &chd);
}
}
}
@@ -1288,9 +1290,9 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
flags for the given device
-------------------------------------------------*/
-static void normalize_flags_for_device(running_machine *machine, const char *rgntag, UINT8 &width, endianness_t &endian)
+static void normalize_flags_for_device(running_machine &machine, const char *rgntag, UINT8 &width, endianness_t &endian)
{
- device_t *device = machine->device(rgntag);
+ device_t *device = machine.device(rgntag);
device_memory_interface *memory;
if (device->interface(memory))
{
@@ -1332,7 +1334,7 @@ static void normalize_flags_for_device(running_machine *machine, const char *rgn
void load_software_part_region(device_t *device, char *swlist, char *swname, rom_entry *start_region)
{
astring locationtag(swlist), breakstr("%");
- rom_load_data *romdata = device->machine->romload_data;
+ rom_load_data *romdata = device->machine().romload_data;
const rom_entry *region;
astring regiontag;
@@ -1340,7 +1342,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
// " swlist % clonename % parentname "
// open_rom_file contains the code to split the elements and to create paths to load from
- software_list *software_list_ptr = software_list_open(device->machine->options(), swlist, FALSE, NULL);
+ software_list *software_list_ptr = software_list_open(device->machine().options(), swlist, FALSE, NULL);
if (software_list_ptr)
{
locationtag.cat(breakstr);
@@ -1354,7 +1356,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
locationtag.cat(breakstr);
// printf("%s\n", locationtag.cstr());
}
- const char *parentname = software_get_clone(device->machine->options(), swlist, swinfo->shortname);
+ const char *parentname = software_get_clone(device->machine().options(), swlist, swinfo->shortname);
if (parentname != NULL)
swinfo = software_list_find(software_list_ptr, parentname, NULL);
else
@@ -1370,12 +1372,12 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
romdata->errorstring.reset();
- if (software_get_support(device->machine->options(), swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
+ if (software_get_support(device->machine().options(), swlist, swname) == SOFTWARE_SUPPORTED_PARTIAL)
{
romdata->errorstring.catprintf("WARNING: support for software %s (in list %s) is only partial\n", swname, swlist);
romdata->warnings++;
}
- if (software_get_support(device->machine->options(), swlist, swname) == SOFTWARE_SUPPORTED_NO)
+ if (software_get_support(device->machine().options(), swlist, swname) == SOFTWARE_SUPPORTED_NO)
{
romdata->errorstring.catprintf("WARNING: support for software %s (in list %s) is only preliminary\n", swname, swlist);
romdata->warnings++;
@@ -1395,18 +1397,18 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
/* if this is a device region, override with the device width and endianness */
endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
UINT8 width = ROMREGION_GETWIDTH(region) / 8;
- const memory_region *memregion = romdata->machine->region(regiontag);
+ const memory_region *memregion = romdata->machine().region(regiontag);
if (memregion != NULL)
{
- if (romdata->machine->device(regiontag) != NULL)
- normalize_flags_for_device(romdata->machine, regiontag, width, endianness);
+ if (romdata->machine().device(regiontag) != NULL)
+ normalize_flags_for_device(romdata->machine(), regiontag, width, endianness);
/* clear old region (todo: should be moved to an image unload function) */
- romdata->machine->region_free(memregion->name());
+ romdata->machine().region_free(memregion->name());
}
/* remember the base and length */
- romdata->region = romdata->machine->region_alloc(regiontag, regionlength, width, endianness);
+ romdata->region = romdata->machine().region_alloc(regiontag, regionlength, width, endianness);
LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base()));
/* clear the region if it's requested */
@@ -1420,7 +1422,7 @@ void load_software_part_region(device_t *device, char *swlist, char *swname, rom
#ifdef MAME_DEBUG
/* if we're debugging, fill region with random data to catch errors */
else
- fill_random(romdata->machine, romdata->region->base(), romdata->region->bytes());
+ fill_random(romdata->machine(), romdata->region->base(), romdata->region->bytes());
#endif
/* now process the entries in the region */
@@ -1450,12 +1452,12 @@ static void process_region_list(rom_load_data *romdata)
const rom_entry *region;
/* loop until we hit the end */
- for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
{
UINT32 regionlength = ROMREGION_GETLENGTH(region);
- rom_region_name(regiontag, &romdata->machine->system(), source, region);
+ rom_region_name(regiontag, &romdata->machine().system(), source, region);
LOG(("Processing region \"%s\" (length=%X)\n", regiontag.cstr(), regionlength));
/* the first entry must be a region */
@@ -1466,11 +1468,11 @@ static void process_region_list(rom_load_data *romdata)
/* if this is a device region, override with the device width and endianness */
UINT8 width = ROMREGION_GETWIDTH(region) / 8;
endianness_t endianness = ROMREGION_ISBIGENDIAN(region) ? ENDIANNESS_BIG : ENDIANNESS_LITTLE;
- if (romdata->machine->device(regiontag) != NULL)
- normalize_flags_for_device(romdata->machine, regiontag, width, endianness);
+ if (romdata->machine().device(regiontag) != NULL)
+ normalize_flags_for_device(romdata->machine(), regiontag, width, endianness);
/* remember the base and length */
- romdata->region = romdata->machine->region_alloc(regiontag, regionlength, width, endianness);
+ romdata->region = romdata->machine().region_alloc(regiontag, regionlength, width, endianness);
LOG(("Allocated %X bytes @ %p\n", romdata->region->bytes(), romdata->region->base()));
/* clear the region if it's requested */
@@ -1484,7 +1486,7 @@ static void process_region_list(rom_load_data *romdata)
#ifdef MAME_DEBUG
/* if we're debugging, fill region with random data to catch errors */
else
- fill_random(romdata->machine, romdata->region->base(), romdata->region->bytes());
+ fill_random(romdata->machine(), romdata->region->base(), romdata->region->bytes());
#endif
/* now process the entries in the region */
@@ -1495,7 +1497,7 @@ static void process_region_list(rom_load_data *romdata)
}
/* now go back and post-process all the regions */
- for (source = rom_first_source(romdata->machine->config()); source != NULL; source = rom_next_source(*source))
+ for (source = rom_first_source(romdata->machine().config()); source != NULL; source = rom_next_source(*source))
for (region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
region_post_process(romdata, ROMREGION_GETTAG(region), ROMREGION_ISINVERTED(region));
}
@@ -1506,18 +1508,18 @@ static void process_region_list(rom_load_data *romdata)
images associated with the given machine
-------------------------------------------------*/
-void rom_init(running_machine *machine)
+void rom_init(running_machine &machine)
{
rom_load_data *romdata;
/* allocate private data */
- machine->romload_data = romdata = auto_alloc_clear(machine, romload_private);
+ machine.romload_data = romdata = auto_alloc_clear(machine, romload_private);
/* make sure we get called back on the way out */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, rom_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, rom_exit);
/* reset the romdata struct */
- romdata->machine = machine;
+ romdata->m_machine = &machine;
/* figure out which BIOS we are using */
determine_bios_rom(romdata);
@@ -1527,7 +1529,7 @@ void rom_init(running_machine *machine)
/* reset the disk list */
romdata->chd_list = NULL;
- romdata->chd_list_tailptr = &machine->romload_data->chd_list;
+ romdata->chd_list_tailptr = &machine.romload_data->chd_list;
/* process the ROM entries we were passed */
process_region_list(romdata);
@@ -1565,9 +1567,9 @@ static void rom_exit(running_machine &machine)
warnings we generated
-------------------------------------------------*/
-int rom_load_warnings(running_machine *machine)
+int rom_load_warnings(running_machine &machine)
{
- return machine->romload_data->warnings;
+ return machine.romload_data->warnings;
}
@@ -1576,7 +1578,7 @@ int rom_load_warnings(running_machine *machine)
BAD_DUMP/NO_DUMP warnings we generated
-------------------------------------------------*/
-int rom_load_knownbad(running_machine *machine)
+int rom_load_knownbad(running_machine &machine)
{
- return machine->romload_data->knownbad;
+ return machine.romload_data->knownbad;
}
diff --git a/src/emu/romload.h b/src/emu/romload.h
index 68d842d1613..65451683ec7 100644
--- a/src/emu/romload.h
+++ b/src/emu/romload.h
@@ -266,13 +266,13 @@ struct rom_entry
/* ----- ROM processing ----- */
/* load the ROMs and open the disk images associated with the given machine */
-void rom_init(running_machine *machine);
+void rom_init(running_machine &machine);
/* return the number of warnings we generated */
-int rom_load_warnings(running_machine *machine);
+int rom_load_warnings(running_machine &machine);
/* return the number of BAD_DUMP/NO_DUMP warnings we generated */
-int rom_load_knownbad(running_machine *machine);
+int rom_load_knownbad(running_machine &machine);
/* ----- Helpers ----- */
@@ -318,7 +318,7 @@ astring &rom_region_name(astring &result, const game_driver *drv, const rom_sour
chd_error open_disk_image(emu_options &options, const game_driver *gamedrv, const rom_entry *romp, emu_file **image_file, chd_file **image_chd,const char *locationtag);
/* return a pointer to the CHD file associated with the given region */
-chd_file *get_disk_handle(running_machine *machine, const char *region);
+chd_file *get_disk_handle(running_machine &machine, const char *region);
/* set a pointer to the CHD file associated with the given region */
void set_disk_handle(running_machine &machine, const char *region, emu_file &file, chd_file &chdfile);
diff --git a/src/emu/schedule.c b/src/emu/schedule.c
index 1630d4dfbee..33cbac54fe6 100644
--- a/src/emu/schedule.c
+++ b/src/emu/schedule.c
@@ -143,7 +143,7 @@ emu_timer &emu_timer::init(running_machine &machine, timer_expired_func callback
emu_timer &emu_timer::init(device_t &device, device_timer_id id, void *ptr, bool temporary)
{
// ensure the entire timer state is clean
- m_machine = device.machine;
+ m_machine = &device.machine();
m_next = NULL;
m_prev = NULL;
m_callback = NULL;
@@ -875,7 +875,7 @@ void device_scheduler::execute_timers()
if (timer.m_device != NULL)
timer.m_device->timer_expired(timer, timer.m_id, timer.m_param, timer.m_ptr);
else if (timer.m_callback != NULL)
- (*timer.m_callback)(&m_machine, timer.m_ptr, timer.m_param);
+ (*timer.m_callback)(m_machine, timer.m_ptr, timer.m_param);
g_profiler.stop();
}
diff --git a/src/emu/schedule.h b/src/emu/schedule.h
index 959d2345ad5..4c8e936fd45 100644
--- a/src/emu/schedule.h
+++ b/src/emu/schedule.h
@@ -62,7 +62,7 @@
#define PERIOD_OF_555_MONOSTABLE(r,c) attotime::from_nsec(PERIOD_OF_555_MONOSTABLE_NSEC(r,c))
#define PERIOD_OF_555_ASTABLE(r1,r2,c) attotime::from_nsec(PERIOD_OF_555_ASTABLE_NSEC(r1,r2,c))
-#define TIMER_CALLBACK(name) void name(running_machine *machine, void *ptr, int param)
+#define TIMER_CALLBACK(name) void name(running_machine &machine, void *ptr, int param)
@@ -71,14 +71,14 @@
//**************************************************************************
// timer callbacks look like this
-typedef void (*timer_expired_func)(running_machine *machine, void *ptr, INT32 param);
+typedef void (*timer_expired_func)(running_machine &machine, void *ptr, INT32 param);
// stub for when the ptr parameter points to a class
template<class T, void (T::*func)(running_machine &machine, INT32 param)>
-void timer_expired_stub(running_machine *machine, void *ptr, INT32 param)
+void timer_expired_stub(running_machine &machine, void *ptr, INT32 param)
{
T *target = reinterpret_cast<T *>(ptr);
- (target->*func)(*machine, param);
+ (target->*func)(machine, param);
}
diff --git a/src/emu/screen.c b/src/emu/screen.c
index 71e3a964524..8908fd69fe7 100644
--- a/src/emu/screen.c
+++ b/src/emu/screen.c
@@ -107,7 +107,7 @@ device_config *screen_device_config::static_alloc_device_config(const machine_co
device_t *screen_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, screen_device(machine, *this));
+ return auto_alloc(machine, screen_device(machine, *this));
}
@@ -371,15 +371,15 @@ void screen_device::device_start()
m_container->set_user_settings(settings);
// allocate the VBLANK timers
- m_vblank_begin_timer = machine->scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this);
- m_vblank_end_timer = machine->scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this);
+ m_vblank_begin_timer = m_machine.scheduler().timer_alloc(FUNC(static_vblank_begin_callback), (void *)this);
+ m_vblank_end_timer = m_machine.scheduler().timer_alloc(FUNC(static_vblank_end_callback), (void *)this);
// allocate a timer to reset partial updates
- m_scanline0_timer = machine->scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
+ m_scanline0_timer = m_machine.scheduler().timer_alloc(FUNC(static_scanline0_callback), (void *)this);
// allocate a timer to generate per-scanline updates
- if ((machine->config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
- m_scanline_timer = machine->scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
+ if ((m_machine.config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
+ m_scanline_timer = m_machine.scheduler().timer_alloc(FUNC(static_scanline_update_callback), (void *)this);
// configure the screen with the default parameters
configure(m_config.m_width, m_config.m_height, m_config.m_visarea, m_config.m_refresh);
@@ -389,23 +389,23 @@ void screen_device::device_start()
m_vblank_end_time = attotime(0, m_vblank_period);
// start the timer to generate per-scanline updates
- if ((machine->config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
+ if ((m_machine.config().m_video_attributes & VIDEO_UPDATE_SCANLINE) != 0)
m_scanline_timer->adjust(time_until_pos(0));
// create burn-in bitmap
- if (machine->options().burnin())
+ if (m_machine.options().burnin())
{
int width, height;
- if (sscanf(machine->options().snap_size(), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
+ if (sscanf(m_machine.options().snap_size(), "%dx%d", &width, &height) != 2 || width == 0 || height == 0)
width = height = 300;
- m_burnin = auto_alloc(machine, bitmap_t(width, height, BITMAP_FORMAT_INDEXED64));
+ m_burnin = auto_alloc(m_machine, bitmap_t(width, height, BITMAP_FORMAT_INDEXED64));
if (m_burnin == NULL)
fatalerror("Error allocating burn-in bitmap for screen at (%dx%d)\n", width, height);
bitmap_fill(m_burnin, NULL, 0);
}
// load the effect overlay
- const char *overname = machine->options().effect();
+ const char *overname = m_machine.options().effect();
if (overname != NULL && strcmp(overname, "none") != 0)
load_effect_overlay(overname);
@@ -496,7 +496,7 @@ void screen_device::configure(int width, int height, const rectangle &visarea, a
void screen_device::reset_origin(int beamy, int beamx)
{
// compute the effective VBLANK start/end times
- attotime curtime = machine->time();
+ attotime curtime = m_machine.time();
m_vblank_end_time = curtime - attotime(0, beamy * m_scantime + beamx * m_pixeltime);
m_vblank_start_time = m_vblank_end_time - attotime(0, m_vblank_period);
@@ -541,8 +541,8 @@ void screen_device::realloc_screen_bitmaps()
// free what we have currently
m_machine.render().texture_free(m_texture[0]);
m_machine.render().texture_free(m_texture[1]);
- auto_free(machine, m_bitmap[0]);
- auto_free(machine, m_bitmap[1]);
+ auto_free(m_machine, m_bitmap[0]);
+ auto_free(m_machine, m_bitmap[1]);
// compute new width/height
curwidth = MAX(m_width, curwidth);
@@ -552,17 +552,17 @@ void screen_device::realloc_screen_bitmaps()
palette_t *palette = NULL;
switch (m_config.m_format)
{
- case BITMAP_FORMAT_INDEXED16: m_texture_format = TEXFORMAT_PALETTE16; palette = machine->palette; break;
+ case BITMAP_FORMAT_INDEXED16: m_texture_format = TEXFORMAT_PALETTE16; palette = m_machine.palette; break;
case BITMAP_FORMAT_RGB15: m_texture_format = TEXFORMAT_RGB15; palette = NULL; break;
case BITMAP_FORMAT_RGB32: m_texture_format = TEXFORMAT_RGB32; palette = NULL; break;
default: fatalerror("Invalid bitmap format!"); break;
}
// allocate bitmaps
- m_bitmap[0] = auto_alloc(machine, bitmap_t(curwidth, curheight, m_config.m_format));
- bitmap_set_palette(m_bitmap[0], machine->palette);
- m_bitmap[1] = auto_alloc(machine, bitmap_t(curwidth, curheight, m_config.m_format));
- bitmap_set_palette(m_bitmap[1], machine->palette);
+ m_bitmap[0] = auto_alloc(m_machine, bitmap_t(curwidth, curheight, m_config.m_format));
+ bitmap_set_palette(m_bitmap[0], m_machine.palette);
+ m_bitmap[1] = auto_alloc(m_machine, bitmap_t(curwidth, curheight, m_config.m_format));
+ bitmap_set_palette(m_bitmap[1], m_machine.palette);
// allocate textures
m_texture[0] = m_machine.render().texture_alloc();
@@ -609,7 +609,7 @@ bool screen_device::update_partial(int scanline)
LOG_PARTIAL_UPDATES(("Partial: update_partial(%s, %d): ", tag(), scanline));
// these two checks only apply if we're allowed to skip frames
- if (!(machine->config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
+ if (!(m_machine.config().m_video_attributes & VIDEO_ALWAYS_UPDATE))
{
// if skipping this frame, bail
if (m_machine.video().skip_this_frame())
@@ -696,7 +696,7 @@ void screen_device::update_now()
int screen_device::vpos() const
{
- attoseconds_t delta = (machine->time() - m_vblank_start_time).as_attoseconds();
+ attoseconds_t delta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
int vpos;
// round to the nearest pixel
@@ -717,7 +717,7 @@ int screen_device::vpos() const
int screen_device::hpos() const
{
- attoseconds_t delta = (machine->time() - m_vblank_start_time).as_attoseconds();
+ attoseconds_t delta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
// round to the nearest pixel
delta += m_pixeltime / 2;
@@ -753,7 +753,7 @@ attotime screen_device::time_until_pos(int vpos, int hpos) const
attoseconds_t targetdelta = (attoseconds_t)vpos * m_scantime + (attoseconds_t)hpos * m_pixeltime;
// if we're past that time (within 1/2 of a pixel), head to the next frame
- attoseconds_t curdelta = (machine->time() - m_vblank_start_time).as_attoseconds();
+ attoseconds_t curdelta = (m_machine.time() - m_vblank_start_time).as_attoseconds();
if (targetdelta <= curdelta + m_pixeltime / 2)
targetdelta += m_frame_period;
while (targetdelta <= curdelta)
@@ -777,7 +777,7 @@ attotime screen_device::time_until_vblank_end() const
attotime target_time = m_vblank_end_time;
if (!vblank())
target_time += attotime(0, m_frame_period);
- return target_time - machine->time();
+ return target_time - m_machine.time();
}
@@ -800,7 +800,7 @@ void screen_device::register_vblank_callback(vblank_state_changed_func vblank_ca
// if not found, register
if (*itemptr == NULL)
{
- *itemptr = auto_alloc(machine, callback_item);
+ *itemptr = auto_alloc(m_machine, callback_item);
(*itemptr)->m_next = NULL;
(*itemptr)->m_callback = vblank_callback;
(*itemptr)->m_param = param;
@@ -816,7 +816,7 @@ void screen_device::register_vblank_callback(vblank_state_changed_func vblank_ca
void screen_device::vblank_begin_callback()
{
// reset the starting VBLANK time
- m_vblank_start_time = machine->time();
+ m_vblank_start_time = m_machine.time();
m_vblank_end_time = m_vblank_start_time + attotime(0, m_vblank_period);
// call the screen specific callbacks
@@ -824,8 +824,8 @@ void screen_device::vblank_begin_callback()
(*item->m_callback)(*this, item->m_param, true);
// if this is the primary screen and we need to update now
- if (this == machine->primary_screen && !(machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
- machine->video().frame_update();
+ if (this == m_machine.primary_screen && !(m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
+ m_machine.video().frame_update();
// reset the VBLANK start timer for the next frame
m_vblank_begin_timer->adjust(time_until_vblank_start());
@@ -850,8 +850,8 @@ void screen_device::vblank_end_callback()
(*item->m_callback)(*this, item->m_param, false);
// if this is the primary screen and we need to update now
- if (this == machine->primary_screen && (machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
- machine->video().frame_update();
+ if (this == m_machine.primary_screen && (m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK))
+ m_machine.video().frame_update();
// increment the frame number counter
m_frame_number++;
@@ -902,7 +902,7 @@ bool screen_device::update_quads()
if (m_machine.render().is_live(*this))
{
// only update if empty and not a vector game; otherwise assume the driver did it directly
- if (m_config.m_type != SCREEN_TYPE_VECTOR && (machine->config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
+ if (m_config.m_type != SCREEN_TYPE_VECTOR && (m_machine.config().m_video_attributes & VIDEO_SELF_RENDER) == 0)
{
// if we're not skipping the frame and if the screen actually changed, then update the texture
if (!m_machine.video().skip_this_frame() && m_changed)
@@ -911,7 +911,7 @@ bool screen_device::update_quads()
fixedvis.max_x++;
fixedvis.max_y++;
- palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? machine->palette : NULL;
+ palette_t *palette = (m_texture_format == TEXFORMAT_PALETTE16) ? m_machine.palette : NULL;
m_texture[m_curbitmap]->set_bitmap(m_bitmap[m_curbitmap], &fixedvis, m_texture_format, palette);
m_curtexture = m_curbitmap;
@@ -965,7 +965,7 @@ void screen_device::update_burnin()
if (srcbitmap->format == BITMAP_FORMAT_INDEXED16)
{
const UINT16 *src = BITMAP_ADDR16(srcbitmap, srcy >> 16, 0);
- const rgb_t *palette = palette_entry_list_adjusted(machine->palette);
+ const rgb_t *palette = palette_entry_list_adjusted(m_machine.palette);
for (x = 0, srcx = xstart; x < dstwidth; x++, srcx += xstep)
{
rgb_t pixel = palette[src[srcx >> 16]];
@@ -1015,7 +1015,7 @@ void screen_device::finalize_burnin()
scaledvis.max_y = m_visarea.max_y * m_burnin->height / m_height;
// wrap a bitmap around the subregion we care about
- bitmap_t *finalmap = auto_alloc(machine, bitmap_t(scaledvis.max_x + 1 - scaledvis.min_x,
+ bitmap_t *finalmap = auto_alloc(m_machine, bitmap_t(scaledvis.max_x + 1 - scaledvis.min_x,
scaledvis.max_y + 1 - scaledvis.min_y,
BITMAP_FORMAT_ARGB32));
@@ -1058,7 +1058,7 @@ void screen_device::finalize_burnin()
// compute the name and create the file
emu_file file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS);
- file_error filerr = file.open(machine->basename(), PATH_SEPARATOR "burnin-", tag(), ".png") ;
+ file_error filerr = file.open(m_machine.basename(), PATH_SEPARATOR "burnin-", tag(), ".png") ;
if (filerr == FILERR_NONE)
{
png_info pnginfo = { 0 };
@@ -1068,7 +1068,7 @@ void screen_device::finalize_burnin()
// add two text entries describing the image
sprintf(text, APPNAME " %s", build_version);
png_add_text(&pnginfo, "Software", text);
- sprintf(text, "%s %s", machine->system().manufacturer, machine->system().description);
+ sprintf(text, "%s %s", m_machine.system().manufacturer, m_machine.system().description);
png_add_text(&pnginfo, "System", text);
// now do the actual work
@@ -1125,7 +1125,7 @@ bool screen_device::screen_update(bitmap_t &bitmap, const rectangle &cliprect)
void screen_device::screen_eof()
{
if (m_config.m_screen_eof != NULL) {
- return (*m_config.m_screen_eof)(this, machine);
+ return (*m_config.m_screen_eof)(this, m_machine);
} else {
m_machine.driver_data<driver_device>()->screen_eof();
}
diff --git a/src/emu/screen.h b/src/emu/screen.h
index 746b7bd61f1..2c7f9d3ae25 100644
--- a/src/emu/screen.h
+++ b/src/emu/screen.h
@@ -78,7 +78,7 @@ extern const device_type SCREEN;
// callback that is called to notify of a change in the VBLANK state
typedef void (*vblank_state_changed_func)(screen_device &device, void *param, bool vblank_state);
typedef UINT32 (*screen_update_func)(screen_device *screen, bitmap_t *bitmap, const rectangle *cliprect);
-typedef void (*screen_eof_func)(screen_device *screen, running_machine *machine);
+typedef void (*screen_eof_func)(screen_device *screen, running_machine &machine);
// ======================> screen_device_config
@@ -175,14 +175,14 @@ public:
// beam positioning and state
int vpos() const;
int hpos() const;
- bool vblank() const { return (machine->time() < m_vblank_end_time); }
+ bool vblank() const { return (m_machine.time() < m_vblank_end_time); }
bool hblank() const { int curpos = hpos(); return (curpos < m_visarea.min_x || curpos > m_visarea.max_x); }
// timing
attotime time_until_pos(int vpos, int hpos = 0) const;
attotime time_until_vblank_start() const { return time_until_pos(m_visarea.max_y + 1); }
attotime time_until_vblank_end() const;
- attotime time_until_update() const { return (machine->config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
+ attotime time_until_update() const { return (m_machine.config().m_video_attributes & VIDEO_UPDATE_AFTER_VBLANK) ? time_until_vblank_end() : time_until_vblank_start(); }
attotime scan_period() const { return attotime(0, m_scantime); }
attotime frame_period() const { return (this == NULL || !started()) ? DEFAULT_FRAME_PERIOD : attotime(0, m_frame_period); };
UINT64 frame_number() const { return m_frame_number; }
@@ -194,7 +194,7 @@ public:
// additional helpers
void register_vblank_callback(vblank_state_changed_func vblank_callback, void *param);
- bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
+ bitmap_t *alloc_compatible_bitmap(int width = 0, int height = 0) { return auto_bitmap_alloc(m_machine, (width == 0) ? m_width : width, (height == 0) ? m_height : height, m_config.m_format); }
// internal to the video system
bool update_quads();
@@ -283,7 +283,7 @@ private:
#define SCREEN_UPDATE_CALL(name) SCREEN_UPDATE_NAME(name)(screen, bitmap, cliprect)
#define SCREEN_EOF_NAME(name) screen_eof_##name
-#define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device *screen, running_machine *machine)
+#define SCREEN_EOF(name) void SCREEN_EOF_NAME(name)(screen_device *screen, running_machine &machine)
#define SCREEN_EOF_CALL(name) SCREEN_EOF_NAME(name)(screen, machine)
#define screen_eof_0 NULL
diff --git a/src/emu/softlist.c b/src/emu/softlist.c
index 0dc7aa57205..8e3ce252433 100644
--- a/src/emu/softlist.c
+++ b/src/emu/softlist.c
@@ -163,7 +163,7 @@ INLINE void unknown_attribute_value(parse_state *state,
from the global pool. So they should be global_free'ed
when they are not used anymore.
-------------------------------------------------*/
-static void software_name_split(running_machine* machine, const char *swlist_swname, char **swlist_name, char **swname, char **swpart )
+static void software_name_split(running_machine& machine, const char *swlist_swname, char **swlist_name, char **swname, char **swpart )
{
const char *split_1st_loc = strchr( swlist_swname, ':' );
const char *split_2nd_loc = ( split_1st_loc ) ? strchr( split_1st_loc + 1, ':' ) : NULL;
@@ -1383,7 +1383,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
*sw_part = NULL;
/* Split full software name into software list name and short software name */
- software_name_split( image->device().machine, path, &swlist_name, &swname, &swpart );
+ software_name_split( image->device().machine(), path, &swlist_name, &swname, &swpart );
swname_bckp = swname;
const char *interface = image->image_config().image_interface();
@@ -1391,7 +1391,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
if ( swlist_name )
{
/* Try to open the software list xml file explicitly named by the user */
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1406,7 +1406,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
else
{
/* Loop through all the software lists named in the driver */
- for (device_t *swlists = image->device().machine->m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
+ for (device_t *swlists = image->device().machine().m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
{
if ( swlists )
{
@@ -1425,7 +1425,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_list_close( software_list_ptr );
}
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1445,14 +1445,14 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
/* If not found try to load the software list using the driver name */
if ( ! software_part_ptr )
{
- swlist_name = (char *)image->device().machine->system().name;
+ swlist_name = (char *)image->device().machine().system().name;
if ( software_list_ptr )
{
software_list_close( software_list_ptr );
}
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1478,7 +1478,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_list_close( software_list_ptr );
}
- software_list_ptr = software_list_open( image->device().machine->options(), swlist_name, FALSE, NULL );
+ software_list_ptr = software_list_open( image->device().machine().options(), swlist_name, FALSE, NULL );
if ( software_list_ptr )
{
@@ -1502,13 +1502,13 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
if (software_info_ptr == NULL)
{
// check if there is at least a software list
- if (image->device().machine->m_devicelist.first(SOFTWARE_LIST))
+ if (image->device().machine().m_devicelist.first(SOFTWARE_LIST))
{
mame_printf_error("\n\"%s\" approximately matches the following\n"
"supported software items (best match first):\n\n", swname_bckp);
}
- for (device_t *swlists = image->device().machine->m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
+ for (device_t *swlists = image->device().machine().m_devicelist.first(SOFTWARE_LIST); swlists != NULL; swlists = swlists->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(&swlists->baseconfig())->inline_config();
@@ -1516,7 +1516,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
{
if (swlist->list_name[i] && *swlist->list_name[i])
{
- software_list *list = software_list_open(image->device().machine->options(), swlist->list_name[i], FALSE, NULL);
+ software_list *list = software_list_open(image->device().machine().options(), swlist->list_name[i], FALSE, NULL);
if (list)
{
@@ -1561,37 +1561,37 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
}
/* Create a copy of the software and part information */
- *sw_info = auto_alloc_clear( image->device().machine, software_info );
- (*sw_info)->shortname = auto_strdup( image->device().machine, software_info_ptr->shortname );
- (*sw_info)->longname = auto_strdup( image->device().machine, software_info_ptr->longname );
+ *sw_info = auto_alloc_clear( image->device().machine(), software_info );
+ (*sw_info)->shortname = auto_strdup( image->device().machine(), software_info_ptr->shortname );
+ (*sw_info)->longname = auto_strdup( image->device().machine(), software_info_ptr->longname );
if ( software_info_ptr->year )
- (*sw_info)->year = auto_strdup( image->device().machine, software_info_ptr->year );
+ (*sw_info)->year = auto_strdup( image->device().machine(), software_info_ptr->year );
if ( software_info_ptr->publisher )
- (*sw_info)->publisher = auto_strdup( image->device().machine, software_info_ptr->publisher );
+ (*sw_info)->publisher = auto_strdup( image->device().machine(), software_info_ptr->publisher );
- *sw_part = auto_alloc_clear( image->device().machine, software_part );
- (*sw_part)->name = auto_strdup( image->device().machine, software_part_ptr->name );
+ *sw_part = auto_alloc_clear( image->device().machine(), software_part );
+ (*sw_part)->name = auto_strdup( image->device().machine(), software_part_ptr->name );
if ( software_part_ptr->interface_ )
- (*sw_part)->interface_ = auto_strdup( image->device().machine, software_part_ptr->interface_ );
+ (*sw_part)->interface_ = auto_strdup( image->device().machine(), software_part_ptr->interface_ );
if ( software_part_ptr->featurelist )
{
feature_list *list = software_part_ptr->featurelist;
- feature_list *new_list = auto_alloc_clear( image->device().machine, feature_list );
+ feature_list *new_list = auto_alloc_clear( image->device().machine(), feature_list );
(*sw_part)->featurelist = new_list;
- new_list->name = auto_strdup( image->device().machine, list->name );
- new_list->value = auto_strdup( image->device().machine, list->value );
+ new_list->name = auto_strdup( image->device().machine(), list->name );
+ new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next;
while( list )
{
- new_list->next = auto_alloc_clear( image->device().machine, feature_list );
+ new_list->next = auto_alloc_clear( image->device().machine(), feature_list );
new_list = new_list->next;
- new_list->name = auto_strdup( image->device().machine, list->name );
- new_list->value = auto_strdup( image->device().machine, list->value );
+ new_list->name = auto_strdup( image->device().machine(), list->name );
+ new_list->value = auto_strdup( image->device().machine(), list->value );
list = list->next;
}
@@ -1600,7 +1600,7 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
}
/* Tell the world which part we actually loaded */
- *full_sw_name = auto_alloc_array( image->device().machine, char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 );
+ *full_sw_name = auto_alloc_array( image->device().machine(), char, strlen(swlist_name) + strlen(software_info_ptr->shortname) + strlen(software_part_ptr->name) + 3 );
sprintf( *full_sw_name, "%s:%s:%s", swlist_name, software_info_ptr->shortname, software_part_ptr->name );
}
@@ -1611,9 +1611,9 @@ bool load_software_part(device_image_interface *image, const char *path, softwar
software_info_ptr = NULL;
software_list_ptr = NULL;
}
- auto_free( image->device().machine, swlist_name );
- auto_free( image->device().machine, swname );
- auto_free( image->device().machine, swpart );
+ auto_free( image->device().machine(), swlist_name );
+ auto_free( image->device().machine(), swname );
+ auto_free( image->device().machine(), swpart );
return result;
}
@@ -1872,9 +1872,9 @@ struct _software_part_state
};
-static void ui_mess_menu_populate_software_parts(running_machine *machine, ui_menu *menu, const char *swlist, const char *swinfo, const char *interface)
+static void ui_mess_menu_populate_software_parts(running_machine &machine, ui_menu *menu, const char *swlist, const char *swinfo, const char *interface)
{
- software_list *list = software_list_open(machine->options(), swlist, FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), swlist, FALSE, NULL);
if (list)
{
@@ -1907,7 +1907,7 @@ static void ui_mess_menu_populate_software_parts(running_machine *machine, ui_me
}
}
-void ui_mess_menu_software_parts(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_software_parts(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
software_entry_state *sw_state = (software_entry_state *)state;
@@ -1942,9 +1942,9 @@ void ui_mess_menu_software_parts(running_machine *machine, ui_menu *menu, void *
}
/* populate a specific list */
-static void ui_mess_menu_populate_software_entries(running_machine *machine, ui_menu *menu, char *list_name, device_image_interface* image)
+static void ui_mess_menu_populate_software_entries(running_machine &machine, ui_menu *menu, char *list_name, device_image_interface* image)
{
- software_list *list = software_list_open(machine->options(), list_name, FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), list_name, FALSE, NULL);
const char *interface = image->image_config().image_interface();
if (list)
{
@@ -1983,7 +1983,7 @@ bool swinfo_has_multiple_parts(software_info *swinfo, const char *interface)
return (count > 1) ? TRUE : FALSE;
}
-void ui_mess_menu_software_list(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
software_menu_state *sw_state = (software_menu_state *)state;
@@ -2003,13 +2003,13 @@ void ui_mess_menu_software_list(running_machine *machine, ui_menu *menu, void *p
{
device_image_interface *image = sw_state->image;
software_entry_state *entry = (software_entry_state *) event->itemref;
- software_list *tmp_list = software_list_open(machine->options(), sw_state->list_name, FALSE, NULL);
+ software_list *tmp_list = software_list_open(machine.options(), sw_state->list_name, FALSE, NULL);
software_info *tmp_info = software_list_find(tmp_list, entry->short_name, NULL);
// if the selected software has multiple parts that can be loaded, open the submenu
if (swinfo_has_multiple_parts(tmp_info, image->image_config().image_interface()))
{
- ui_menu *child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), ui_mess_menu_software_parts, entry);
+ ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_parts, entry);
software_entry_state *child_menustate = (software_entry_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->short_name = entry->short_name;
child_menustate->interface = image->image_config().image_interface();
@@ -2030,12 +2030,12 @@ void ui_mess_menu_software_list(running_machine *machine, ui_menu *menu, void *p
}
/* list of available software lists - i.e. cartridges, floppies */
-static void ui_mess_menu_populate_software_list(running_machine *machine, ui_menu *menu, device_image_interface* image)
+static void ui_mess_menu_populate_software_list(running_machine &machine, ui_menu *menu, device_image_interface* image)
{
bool haveCompatible = FALSE;
const char *interface = image->image_config().image_interface();
- for (const device_config *dev = machine->config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
@@ -2043,7 +2043,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
{
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM))
{
- software_list *list = software_list_open(machine->options(), swlist->list_name[i], FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
if (list)
{
@@ -2065,7 +2065,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
}
}
- for (const device_config *dev = machine->config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
+ for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
{
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
@@ -2073,7 +2073,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
{
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_COMPATIBLE_SYSTEM))
{
- software_list *list = software_list_open(machine->options(), swlist->list_name[i], FALSE, NULL);
+ software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
if (list)
{
@@ -2101,7 +2101,7 @@ static void ui_mess_menu_populate_software_list(running_machine *machine, ui_men
}
-void ui_image_menu_software(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
device_image_interface* image = (device_image_interface*)parameter;
@@ -2113,7 +2113,7 @@ void ui_image_menu_software(running_machine *machine, ui_menu *menu, void *param
if (event != NULL && event->iptkey == IPT_UI_SELECT)
{
- ui_menu *child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), ui_mess_menu_software_list, NULL);
+ ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_list, NULL);
software_menu_state *child_menustate = (software_menu_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->list_name = (char *)event->itemref;
child_menustate->image = image;
diff --git a/src/emu/softlist.h b/src/emu/softlist.h
index 563d5426044..b5dd563ee73 100644
--- a/src/emu/softlist.h
+++ b/src/emu/softlist.h
@@ -71,7 +71,7 @@ const char *software_part_get_feature(software_part *part, const char *feature_n
bool load_software_part(device_image_interface *image, const char *path, software_info **sw_info, software_part **sw_part, char **full_sw_name);
-void ui_image_menu_software(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *parameter, void *state);
/*********************************************************************
diff --git a/src/emu/sound.c b/src/emu/sound.c
index 2081f41c118..64ffa942bef 100644
--- a/src/emu/sound.c
+++ b/src/emu/sound.c
@@ -86,12 +86,12 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
m_attoseconds_per_sample(0),
m_max_samples_per_update(0),
m_inputs(inputs),
- m_input((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_input, inputs)),
- m_input_array((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_sample_t *, inputs)),
+ m_input((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_input, inputs)),
+ m_input_array((inputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_sample_t *, inputs)),
m_resample_bufalloc(0),
m_outputs(outputs),
- m_output((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_output, outputs)),
- m_output_array((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine, stream_sample_t *, outputs)),
+ m_output((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_output, outputs)),
+ m_output_array((outputs == 0) ? NULL : auto_alloc_array_clear(device.machine(), stream_sample_t *, outputs)),
m_output_bufalloc(0),
m_output_sampindex(0),
m_output_update_sampindex(0),
@@ -110,17 +110,17 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
// create a unique tag for saving
astring state_tag;
- state_tag.printf("%d", m_device.machine->sound().m_stream_list.count());
- m_device.machine->state().save_item("stream", state_tag, 0, NAME(m_sample_rate));
- m_device.machine->state().register_postload(state_postload_stub<sound_stream, &sound_stream::postload>, this);
+ state_tag.printf("%d", m_device.machine().sound().m_stream_list.count());
+ m_device.machine().state().save_item("stream", state_tag, 0, NAME(m_sample_rate));
+ m_device.machine().state().register_postload(state_postload_stub<sound_stream, &sound_stream::postload>, this);
// save the gain of each input and output
for (int inputnum = 0; inputnum < m_inputs; inputnum++)
- m_device.machine->state().save_item("stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain));
+ m_device.machine().state().save_item("stream", state_tag, inputnum, NAME(m_input[inputnum].m_gain));
for (int outputnum = 0; outputnum < m_outputs; outputnum++)
{
m_output[outputnum].m_stream = this;
- m_device.machine->state().save_item("stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
+ m_device.machine().state().save_item("stream", state_tag, outputnum, NAME(m_output[outputnum].m_gain));
}
// force an update to the sample rates; this will cause everything to be recomputed
@@ -139,7 +139,7 @@ sound_stream::sound_stream(device_t &device, int inputs, int outputs, int sample
attotime sound_stream::sample_time() const
{
- return attotime(m_device.machine->sound().last_update().seconds, 0) + attotime(0, m_output_sampindex * m_attoseconds_per_sample);
+ return attotime(m_device.machine().sound().last_update().seconds, 0) + attotime(0, m_output_sampindex * m_attoseconds_per_sample);
}
@@ -258,11 +258,11 @@ void sound_stream::set_input(int index, sound_stream *input_stream, int output_i
void sound_stream::update()
{
// determine the number of samples since the start of this second
- attotime time = m_device.machine->time();
+ attotime time = m_device.machine().time();
INT32 update_sampindex = INT32(time.attoseconds / m_attoseconds_per_sample);
// if we're ahead of the last update, then adjust upwards
- attotime last_update = m_device.machine->sound().last_update();
+ attotime last_update = m_device.machine().sound().last_update();
if (time.seconds > last_update.seconds)
{
assert(time.seconds == last_update.seconds + 1);
@@ -439,7 +439,7 @@ STREAM_UPDATE( sound_stream::device_stream_update_stub )
void sound_stream::recompute_sample_rate_data()
{
// recompute the timing parameters
- attoseconds_t update_attoseconds = m_device.machine->sound().update_attoseconds();
+ attoseconds_t update_attoseconds = m_device.machine().sound().update_attoseconds();
m_attoseconds_per_sample = ATTOSECONDS_PER_SECOND / m_sample_rate;
m_max_samples_per_update = (update_attoseconds + m_attoseconds_per_sample - 1) / m_attoseconds_per_sample;
@@ -498,9 +498,9 @@ void sound_stream::allocate_resample_buffers()
for (int inputnum = 0; inputnum < m_inputs; inputnum++)
{
stream_input &input = m_input[inputnum];
- stream_sample_t *newbuffer = auto_alloc_array(m_device.machine, stream_sample_t, m_resample_bufalloc);
+ stream_sample_t *newbuffer = auto_alloc_array(m_device.machine(), stream_sample_t, m_resample_bufalloc);
memcpy(newbuffer, input.m_resample, oldsize * sizeof(stream_sample_t));
- auto_free(m_device.machine, input.m_resample);
+ auto_free(m_device.machine(), input.m_resample);
input.m_resample = newbuffer;
}
}
@@ -526,10 +526,10 @@ void sound_stream::allocate_output_buffers()
for (int outputnum = 0; outputnum < m_outputs; outputnum++)
{
stream_output &output = m_output[outputnum];
- stream_sample_t *newbuffer = auto_alloc_array(m_device.machine, stream_sample_t, m_output_bufalloc);
+ stream_sample_t *newbuffer = auto_alloc_array(m_device.machine(), stream_sample_t, m_output_bufalloc);
memcpy(newbuffer, output.m_buffer, oldsize * sizeof(stream_sample_t));
memset(newbuffer + oldsize, 0, (m_output_bufalloc - oldsize) * sizeof(stream_sample_t));
- auto_free(m_device.machine, output.m_buffer);
+ auto_free(m_device.machine(), output.m_buffer);
output.m_buffer = newbuffer;
}
}
@@ -550,7 +550,7 @@ void sound_stream::postload()
memset(m_output[outputnum].m_buffer, 0, m_output_bufalloc * sizeof(m_output[outputnum].m_buffer[0]));
// recompute the sample indexes to make sense
- m_output_sampindex = m_device.machine->sound().last_update().attoseconds / m_attoseconds_per_sample;
+ m_output_sampindex = m_device.machine().sound().last_update().attoseconds / m_attoseconds_per_sample;
m_output_update_sampindex = m_output_sampindex;
m_output_base_sampindex = m_output_sampindex - m_max_samples_per_update;
}
@@ -791,22 +791,22 @@ sound_manager::sound_manager(running_machine &machine)
VPRINTF(("total speakers = %d\n", machine.m_devicelist.count(SPEAKER)));
// allocate memory for mix buffers
- m_leftmix = auto_alloc_array(&machine, INT32, machine.sample_rate());
- m_rightmix = auto_alloc_array(&machine, INT32, machine.sample_rate());
- m_finalmix = auto_alloc_array(&machine, INT16, machine.sample_rate());
+ m_leftmix = auto_alloc_array(machine, INT32, machine.sample_rate());
+ m_rightmix = auto_alloc_array(machine, INT32, machine.sample_rate());
+ m_finalmix = auto_alloc_array(machine, INT16, machine.sample_rate());
// open the output WAV file if specified
if (wavfile[0] != 0)
m_wavfile = wav_open(wavfile, machine.sample_rate(), 2);
// register callbacks
- config_register(&machine, "mixer", &sound_manager::config_load, &sound_manager::config_save);
+ config_register(machine, "mixer", &sound_manager::config_load, &sound_manager::config_save);
machine.add_notifier(MACHINE_NOTIFY_PAUSE, &sound_manager::pause);
machine.add_notifier(MACHINE_NOTIFY_RESUME, &sound_manager::resume);
machine.add_notifier(MACHINE_NOTIFY_RESET, &sound_manager::reset);
// register global states
- state_save_register_global(&machine, m_last_update);
+ state_save_register_global(machine, m_last_update);
// set the starting attenuation
set_attenuation(machine.options().volume());
@@ -836,9 +836,9 @@ sound_manager::~sound_manager()
sound_stream *sound_manager::stream_alloc(device_t &device, int inputs, int outputs, int sample_rate, void *param, sound_stream::stream_update_func callback)
{
if (callback != NULL)
- return &m_stream_list.append(*auto_alloc(device.machine, sound_stream(device, inputs, outputs, sample_rate, param, callback)));
+ return &m_stream_list.append(*auto_alloc(device.machine(), sound_stream(device, inputs, outputs, sample_rate, param, callback)));
else
- return &m_stream_list.append(*auto_alloc(device.machine, sound_stream(device, inputs, outputs, sample_rate)));
+ return &m_stream_list.append(*auto_alloc(device.machine(), sound_stream(device, inputs, outputs, sample_rate)));
}
@@ -930,7 +930,7 @@ void sound_manager::resume(running_machine &machine)
// configuration file
//-------------------------------------------------
-void sound_manager::config_load(running_machine *machine, int config_type, xml_data_node *parentnode)
+void sound_manager::config_load(running_machine &machine, int config_type, xml_data_node *parentnode)
{
// we only care about game files
if (config_type != CONFIG_TYPE_GAME)
@@ -944,7 +944,7 @@ void sound_manager::config_load(running_machine *machine, int config_type, xml_d
for (xml_data_node *channelnode = xml_get_sibling(parentnode->child, "channel"); channelnode != NULL; channelnode = xml_get_sibling(channelnode->next, "channel"))
{
speaker_input info;
- if (machine->sound().indexed_speaker_input(xml_get_attribute_int(channelnode, "index", -1), info))
+ if (machine.sound().indexed_speaker_input(xml_get_attribute_int(channelnode, "index", -1), info))
{
float defvol = xml_get_attribute_float(channelnode, "defvol", -1000.0);
float newvol = xml_get_attribute_float(channelnode, "newvol", -1000.0);
@@ -960,7 +960,7 @@ void sound_manager::config_load(running_machine *machine, int config_type, xml_d
// file
//-------------------------------------------------
-void sound_manager::config_save(running_machine *machine, int config_type, xml_data_node *parentnode)
+void sound_manager::config_save(running_machine &machine, int config_type, xml_data_node *parentnode)
{
// we only care about game files
if (config_type != CONFIG_TYPE_GAME)
@@ -971,7 +971,7 @@ void sound_manager::config_save(running_machine *machine, int config_type, xml_d
for (int mixernum = 0; ; mixernum++)
{
speaker_input info;
- if (!machine->sound().indexed_speaker_input(mixernum, info))
+ if (!machine.sound().indexed_speaker_input(mixernum, info))
break;
float defvol = info.stream->initial_input_gain(info.inputnum);
float newvol = info.stream->input_gain(info.inputnum);
diff --git a/src/emu/sound.h b/src/emu/sound.h
index d8130e1aae5..10ac49ef987 100644
--- a/src/emu/sound.h
+++ b/src/emu/sound.h
@@ -244,8 +244,8 @@ private:
static void reset(running_machine &machine);
static void pause(running_machine &machine);
static void resume(running_machine &machine);
- static void config_load(running_machine *machine, int config_type, xml_data_node *parentnode);
- static void config_save(running_machine *machine, int config_type, xml_data_node *parentnode);
+ static void config_load(running_machine &machine, int config_type, xml_data_node *parentnode);
+ static void config_save(running_machine &machine, int config_type, xml_data_node *parentnode);
static TIMER_CALLBACK( update_static ) { reinterpret_cast<sound_manager *>(ptr)->update(); }
void update();
diff --git a/src/emu/sound/2151intf.c b/src/emu/sound/2151intf.c
index 1531cf82c95..50155b780f6 100644
--- a/src/emu/sound/2151intf.c
+++ b/src/emu/sound/2151intf.c
@@ -56,12 +56,12 @@ static DEVICE_START( ym2151 )
rate = device->clock()/64;
/* stream setup */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2151_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2151_update);
info->chip = ym2151_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM2151 chip");
- device->machine->state().register_postload(ym2151intf_postload, info);
+ device->machine().state().register_postload(ym2151intf_postload, info);
ym2151_set_irq_handler(info->chip,info->intf->irqhandler);
ym2151_set_port_write_handler(info->chip,info->intf->portwritehandler);
diff --git a/src/emu/sound/2203intf.c b/src/emu/sound/2203intf.c
index 1604af2a8cd..c9759e016b0 100644
--- a/src/emu/sound/2203intf.c
+++ b/src/emu/sound/2203intf.c
@@ -134,17 +134,17 @@ static DEVICE_START( ym2203 )
assert_always(info->psg != NULL, "Error creating YM2203/AY8910 chip");
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2203_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2203_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2203_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2203_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym2203_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,ym2203_stream_update);
/* Initialize FM emurator */
info->chip = ym2203_init(info,device,device->clock(),rate,timer_handler,IRQHandler,&psgintf);
assert_always(info->chip != NULL, "Error creating YM2203 chip");
- device->machine->state().register_postload(ym2203_intf_postload, info);
+ device->machine().state().register_postload(ym2203_intf_postload, info);
}
static DEVICE_STOP( ym2203 )
diff --git a/src/emu/sound/2413intf.c b/src/emu/sound/2413intf.c
index fc37220eb23..ab4c738a1dc 100644
--- a/src/emu/sound/2413intf.c
+++ b/src/emu/sound/2413intf.c
@@ -62,7 +62,7 @@ static DEVICE_START( ym2413 )
assert_always(info->chip != NULL, "Error creating YM2413 chip");
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2413_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2413_stream_update);
ym2413_set_update_handler(info->chip, _stream_update, info);
@@ -83,7 +83,7 @@ static DEVICE_START( ym2413 )
{
ym2413_reset (i);
- ym2413[i].DAC_stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/72, i, YM2413DAC_update);
+ ym2413[i].DAC_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/72, i, YM2413DAC_update);
if (ym2413[i].DAC_stream == -1)
return 1;
diff --git a/src/emu/sound/2608intf.c b/src/emu/sound/2608intf.c
index 9d54be5f90b..9d267f78489 100644
--- a/src/emu/sound/2608intf.c
+++ b/src/emu/sound/2608intf.c
@@ -152,11 +152,11 @@ static DEVICE_START( ym2608 )
assert_always(info->psg != NULL, "Error creating YM2608/AY8910 chip");
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2608_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2608_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2608_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2608_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2608_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2608_stream_update);
/* setup adpcm buffers */
pcmbufa = *device->region();
pcmsizea = device->region()->bytes();
@@ -167,7 +167,7 @@ static DEVICE_START( ym2608 )
timer_handler,IRQHandler,&psgintf);
assert_always(info->chip != NULL, "Error creating YM2608 chip");
- device->machine->state().register_postload(ym2608_intf_postload, info);
+ device->machine().state().register_postload(ym2608_intf_postload, info);
}
static DEVICE_STOP( ym2608 )
diff --git a/src/emu/sound/2610intf.c b/src/emu/sound/2610intf.c
index e59bf97d8f8..2572bc295c9 100644
--- a/src/emu/sound/2610intf.c
+++ b/src/emu/sound/2610intf.c
@@ -156,17 +156,17 @@ static DEVICE_START( ym2610 )
assert_always(info->psg != NULL, "Error creating YM2610/AY8910 chip");
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,(type == YM2610) ? ym2610_stream_update : ym2610b_stream_update);
/* setup adpcm buffers */
pcmbufa = *device->region();
pcmsizea = device->region()->bytes();
name.printf("%s.deltat", device->tag());
- pcmbufb = (void *)(device->machine->region(name)->base());
- pcmsizeb = device->machine->region(name)->bytes();
+ pcmbufb = (void *)(device->machine().region(name)->base());
+ pcmsizeb = device->machine().region(name)->bytes();
if (pcmbufb == NULL || pcmsizeb == 0)
{
pcmbufb = pcmbufa;
@@ -179,7 +179,7 @@ static DEVICE_START( ym2610 )
timer_handler,IRQHandler,&psgintf);
assert_always(info->chip != NULL, "Error creating YM2610 chip");
- device->machine->state().register_postload(ym2610_intf_postload, info);
+ device->machine().state().register_postload(ym2610_intf_postload, info);
}
static DEVICE_STOP( ym2610 )
diff --git a/src/emu/sound/2612intf.c b/src/emu/sound/2612intf.c
index 88ca4ae82fa..2311ad39a0e 100644
--- a/src/emu/sound/2612intf.c
+++ b/src/emu/sound/2612intf.c
@@ -108,17 +108,17 @@ static DEVICE_START( ym2612 )
/* FM init */
/* Timer Handler set */
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2612_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_2612_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2612_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_2612_1), info);
/* stream system initialize */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,rate,info,ym2612_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,rate,info,ym2612_stream_update);
/**** initialize YM2612 ****/
info->chip = ym2612_init(info,device,device->clock(),rate,timer_handler,IRQHandler);
assert_always(info->chip != NULL, "Error creating YM2612 chip");
- device->machine->state().register_postload(ym2612_intf_postload, info);
+ device->machine().state().register_postload(ym2612_intf_postload, info);
}
diff --git a/src/emu/sound/262intf.c b/src/emu/sound/262intf.c
index eeaaf46f6c7..85b2853160f 100644
--- a/src/emu/sound/262intf.c
+++ b/src/emu/sound/262intf.c
@@ -88,15 +88,15 @@ static DEVICE_START( ymf262 )
info->chip = ymf262_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YMF262 chip");
- info->stream = device->machine->sound().stream_alloc(*device,0,4,rate,info,ymf262_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,4,rate,info,ymf262_stream_update);
/* YMF262 setup */
ymf262_set_timer_handler (info->chip, timer_handler_262, info);
ymf262_set_irq_handler (info->chip, IRQHandler_262, info);
ymf262_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_262_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_262_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_262_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_262_1), info);
}
static DEVICE_STOP( ymf262 )
diff --git a/src/emu/sound/3526intf.c b/src/emu/sound/3526intf.c
index 0d4b67b0434..e97ec9069a1 100644
--- a/src/emu/sound/3526intf.c
+++ b/src/emu/sound/3526intf.c
@@ -99,14 +99,14 @@ static DEVICE_START( ym3526 )
info->chip = ym3526_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM3526 chip");
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym3526_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,ym3526_stream_update);
/* YM3526 setup */
ym3526_set_timer_handler (info->chip, TimerHandler, info);
ym3526_set_irq_handler (info->chip, IRQHandler, info);
ym3526_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
}
static DEVICE_STOP( ym3526 )
diff --git a/src/emu/sound/3812intf.c b/src/emu/sound/3812intf.c
index fd58c7b04e1..5379ae5ed63 100644
--- a/src/emu/sound/3812intf.c
+++ b/src/emu/sound/3812intf.c
@@ -99,15 +99,15 @@ static DEVICE_START( ym3812 )
info->chip = ym3812_init(device,device->clock(),rate);
assert_always(info->chip != NULL, "Error creating YM3812 chip");
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,ym3812_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,ym3812_stream_update);
/* YM3812 setup */
ym3812_set_timer_handler (info->chip, TimerHandler, info);
ym3812_set_irq_handler (info->chip, IRQHandler, info);
ym3812_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
}
static DEVICE_STOP( ym3812 )
diff --git a/src/emu/sound/8950intf.c b/src/emu/sound/8950intf.c
index 19e02b73dc7..240f3e93bd5 100644
--- a/src/emu/sound/8950intf.c
+++ b/src/emu/sound/8950intf.c
@@ -129,7 +129,7 @@ static DEVICE_START( y8950 )
/* ADPCM ROM data */
y8950_set_delta_t_memory(info->chip, *device->region(), device->region()->bytes());
- info->stream = device->machine->sound().stream_alloc(*device,0,1,rate,info,y8950_stream_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,1,rate,info,y8950_stream_update);
/* port and keyboard handler */
y8950_set_port_handler(info->chip, Y8950PortHandler_w, Y8950PortHandler_r, info);
y8950_set_keyboard_handler(info->chip, Y8950KeyboardHandler_w, Y8950KeyboardHandler_r, info);
@@ -139,8 +139,8 @@ static DEVICE_START( y8950 )
y8950_set_irq_handler (info->chip, IRQHandler, info);
y8950_set_update_handler(info->chip, _stream_update, info);
- info->timer[0] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_0), info);
- info->timer[1] = device->machine->scheduler().timer_alloc(FUNC(timer_callback_1), info);
+ info->timer[0] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_0), info);
+ info->timer[1] = device->machine().scheduler().timer_alloc(FUNC(timer_callback_1), info);
}
static DEVICE_STOP( y8950 )
diff --git a/src/emu/sound/aica.c b/src/emu/sound/aica.c
index ca10f73af89..9dd5dbbecd4 100644
--- a/src/emu/sound/aica.c
+++ b/src/emu/sound/aica.c
@@ -521,9 +521,9 @@ static void AICA_Init(device_t *device, aica_state *AICA, const aica_interface *
}
}
- AICA->timerA = device->machine->scheduler().timer_alloc(FUNC(timerA_cb), AICA);
- AICA->timerB = device->machine->scheduler().timer_alloc(FUNC(timerB_cb), AICA);
- AICA->timerC = device->machine->scheduler().timer_alloc(FUNC(timerC_cb), AICA);
+ AICA->timerA = device->machine().scheduler().timer_alloc(FUNC(timerA_cb), AICA);
+ AICA->timerB = device->machine().scheduler().timer_alloc(FUNC(timerB_cb), AICA);
+ AICA->timerC = device->machine().scheduler().timer_alloc(FUNC(timerC_cb), AICA);
for(i=0;i<0x400;++i)
{
@@ -614,9 +614,9 @@ static void AICA_Init(device_t *device, aica_state *AICA, const aica_interface *
AICA->Slots[i].lpend=1;
}
- AICALFO_Init(device->machine);
- AICA->buffertmpl=auto_alloc_array_clear(device->machine, signed int, 44100);
- AICA->buffertmpr=auto_alloc_array_clear(device->machine, signed int, 44100);
+ AICALFO_Init(device->machine());
+ AICA->buffertmpl=auto_alloc_array_clear(device->machine(), signed int, 44100);
+ AICA->buffertmpr=auto_alloc_array_clear(device->machine(), signed int, 44100);
// no "pend"
AICA[0].udata.data[0xa0/2] = 0;
@@ -1283,7 +1283,7 @@ static DEVICE_START( aica )
{
AICA->IntARMCB = intf->irq_callback;
- AICA->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, AICA, AICA_Update);
+ AICA->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, AICA, AICA_Update);
}
}
diff --git a/src/emu/sound/aicalfo.c b/src/emu/sound/aicalfo.c
index d6b6436f9cd..f992ea29a2d 100644
--- a/src/emu/sound/aicalfo.c
+++ b/src/emu/sound/aicalfo.c
@@ -34,7 +34,7 @@ static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
static int PSCALES[8][256];
static int ASCALES[8][256];
-static void AICALFO_Init(running_machine *machine)
+static void AICALFO_Init(running_machine &machine)
{
int i,s;
for(i=0;i<256;++i)
@@ -82,7 +82,7 @@ static void AICALFO_Init(running_machine *machine)
//noise
//a=lfo_noise[i];
- a=machine->rand()&0xff;
+ a=machine.rand()&0xff;
p=128-a;
ALFO_NOI[i]=a;
PLFO_NOI[i]=p;
diff --git a/src/emu/sound/asc.c b/src/emu/sound/asc.c
index 7440b1b885b..824c04a92c3 100644
--- a/src/emu/sound/asc.c
+++ b/src/emu/sound/asc.c
@@ -93,7 +93,7 @@ device_config *asc_device_config::static_alloc_device_config(const machine_confi
device_t *asc_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, asc_device(machine, *this));
+ return auto_alloc(machine, asc_device(machine, *this));
}
//**************************************************************************
@@ -133,7 +133,7 @@ void asc_device::device_start()
memset(m_regs, 0, sizeof(m_regs));
- m_sync_timer = this->machine->scheduler().timer_alloc(FUNC(sync_timer_cb), this);
+ m_sync_timer = this->machine().scheduler().timer_alloc(FUNC(sync_timer_cb), this);
save_item(NAME(m_fifo_a_rdptr));
save_item(NAME(m_fifo_b_rdptr));
diff --git a/src/emu/sound/astrocde.c b/src/emu/sound/astrocde.c
index 4547172cc8c..3ae7112fb7a 100644
--- a/src/emu/sound/astrocde.c
+++ b/src/emu/sound/astrocde.c
@@ -271,7 +271,7 @@ static DEVICE_START( astrocade )
chip->bitswap[i] = BITSWAP8(i, 0,1,2,3,4,5,6,7);
/* allocate a stream for output */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), chip, astrocade_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), chip, astrocade_update);
/* reset state */
DEVICE_RESET_CALL(astrocade);
diff --git a/src/emu/sound/ay8910.c b/src/emu/sound/ay8910.c
index 3ff68bcc46f..f9f57e326b9 100644
--- a/src/emu/sound/ay8910.c
+++ b/src/emu/sound/ay8910.c
@@ -738,7 +738,7 @@ void *ay8910_start_ym(void *infoptr, device_type chip_type, device_t *device, in
ay8910_context *info = (ay8910_context *)infoptr;
if (info == NULL)
- info = auto_alloc_clear(device->machine, ay8910_context);
+ info = auto_alloc_clear(device->machine(), ay8910_context);
info->device = device;
info->intf = intf;
@@ -775,7 +775,7 @@ void *ay8910_start_ym(void *infoptr, device_type chip_type, device_t *device, in
/* The envelope is pacing twice as fast for the YM2149 as for the AY-3-8910, */
/* This handled by the step parameter. Consequently we use a divider of 8 here. */
- info->channel = device->machine->sound().stream_alloc(*device, 0, info->streams, device->clock() / 8, info, ay8910_update);
+ info->channel = device->machine().sound().stream_alloc(*device, 0, info->streams, device->clock() / 8, info, ay8910_update);
ay8910_set_clock_ym(info,device->clock());
ay8910_statesave(info, device);
@@ -887,7 +887,7 @@ int ay8910_read_ym(void *chip)
if (psg->portAread.read)
psg->regs[AY_PORTA] = devcb_call_read8(&psg->portAread, 0);
else
- logerror("%s: warning - read 8910 '%s' Port A\n",psg->device->machine->describe_context(),psg->device->tag());
+ logerror("%s: warning - read 8910 '%s' Port A\n",psg->device->machine().describe_context(),psg->device->tag());
break;
case AY_PORTB:
if ((psg->regs[AY_ENABLE] & 0x80) != 0)
@@ -895,7 +895,7 @@ int ay8910_read_ym(void *chip)
if (psg->portBread.read)
psg->regs[AY_PORTB] = devcb_call_read8(&psg->portBread, 0);
else
- logerror("%s: warning - read 8910 '%s' Port B\n",psg->device->machine->describe_context(),psg->device->tag());
+ logerror("%s: warning - read 8910 '%s' Port B\n",psg->device->machine().describe_context(),psg->device->tag());
break;
}
diff --git a/src/emu/sound/beep.c b/src/emu/sound/beep.c
index 0c0fe947f9e..fc5f9d5e124 100644
--- a/src/emu/sound/beep.c
+++ b/src/emu/sound/beep.c
@@ -92,7 +92,7 @@ static DEVICE_START( beep )
{
beep_state *pBeep = get_safe_token(device);
- pBeep->stream = device->machine->sound().stream_alloc(*device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
+ pBeep->stream = device->machine().sound().stream_alloc(*device, 0, 1, BEEP_RATE, pBeep, beep_sound_update );
pBeep->enable = 0;
pBeep->frequency = 3250;
pBeep->incr = 0;
diff --git a/src/emu/sound/bsmt2000.c b/src/emu/sound/bsmt2000.c
index d2781fef5b1..523836045f4 100644
--- a/src/emu/sound/bsmt2000.c
+++ b/src/emu/sound/bsmt2000.c
@@ -134,7 +134,7 @@ device_config *bsmt2000_device_config::static_alloc_device_config(const machine_
device_t *bsmt2000_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, bsmt2000_device(machine, *this));
+ return auto_alloc(machine, bsmt2000_device(machine, *this));
}
diff --git a/src/emu/sound/c140.c b/src/emu/sound/c140.c
index f87c8d22b8c..cc5e5deeab9 100644
--- a/src/emu/sound/c140.c
+++ b/src/emu/sound/c140.c
@@ -470,7 +470,7 @@ static DEVICE_START( c140 )
info->banking_type = intf->banking_type;
- info->stream = device->machine->sound().stream_alloc(*device,0,2,info->sample_rate,info,update_stereo);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,info->sample_rate,info,update_stereo);
info->pRom=*device->region();
@@ -492,7 +492,7 @@ static DEVICE_START( c140 )
}
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- info->mixer_buffer_left = auto_alloc_array(device->machine, INT16, 2 * info->sample_rate);
+ info->mixer_buffer_left = auto_alloc_array(device->machine(), INT16, 2 * info->sample_rate);
info->mixer_buffer_right = info->mixer_buffer_left + info->sample_rate;
}
diff --git a/src/emu/sound/c352.c b/src/emu/sound/c352.c
index 93e38fd841b..4bb73edcb73 100644
--- a/src/emu/sound/c352.c
+++ b/src/emu/sound/c352.c
@@ -545,7 +545,7 @@ static DEVICE_START( c352 )
info->sample_rate_base = device->clock() / 192;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 4, info->sample_rate_base, info, c352_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 4, info->sample_rate_base, info, c352_update);
c352_init(info, device);
}
diff --git a/src/emu/sound/c6280.c b/src/emu/sound/c6280.c
index 0412d014dab..64a9a0dda10 100644
--- a/src/emu/sound/c6280.c
+++ b/src/emu/sound/c6280.c
@@ -26,7 +26,7 @@
game will reset the index prior to playback so this isn't an issue.
- While the noise emulation is complete, the data for the pseudo-random
- bitstream is calculated by machine->rand() and is not a representation of what
+ bitstream is calculated by machine.rand() and is not a representation of what
the actual hardware does.
For some background on Hudson Soft's C62 chipset:
@@ -107,7 +107,7 @@ static void c6280_init(device_t *device, c6280_t *p, double clk, double rate)
memset(p, 0, sizeof(c6280_t));
p->device = device;
- p->cpudevice = device->machine->device(intf->cpu);
+ p->cpudevice = device->machine().device(intf->cpu);
if (p->cpudevice == NULL)
fatalerror("c6280_init: no CPU found with tag of '%s'\n", device->tag());
@@ -277,7 +277,7 @@ static STREAM_UPDATE( c6280_update )
p->channel[ch].noise_counter += step;
if(p->channel[ch].noise_counter >= 0x800)
{
- data = (p->device->machine->rand() & 1) ? 0x1F : 0;
+ data = (p->device->machine().rand() & 1) ? 0x1F : 0;
}
p->channel[ch].noise_counter &= 0x7FF;
outputs[0][i] += (INT16)(vll * (data - 16));
@@ -328,7 +328,7 @@ static DEVICE_START( c6280 )
c6280_init(device, info, device->clock(), rate);
/* Create stereo stream */
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, rate, info, c6280_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, rate, info, c6280_update);
}
READ8_DEVICE_HANDLER( c6280_r )
diff --git a/src/emu/sound/cdda.c b/src/emu/sound/cdda.c
index 71d02515f7d..fdf102b050b 100644
--- a/src/emu/sound/cdda.c
+++ b/src/emu/sound/cdda.c
@@ -54,11 +54,11 @@ static DEVICE_START( cdda )
cdda_info *info = get_safe_token(device);
/* allocate an audio cache */
- info->audio_cache = auto_alloc_array( device->machine, UINT8, CD_MAX_SECTOR_DATA * MAX_SECTORS );
+ info->audio_cache = auto_alloc_array( device->machine(), UINT8, CD_MAX_SECTOR_DATA * MAX_SECTORS );
//intf = (const struct CDDAinterface *)device->baseconfig().static_config();
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, cdda_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, cdda_update);
device->save_item( NAME(info->audio_playing) );
device->save_item( NAME(info->audio_pause) );
@@ -88,11 +88,11 @@ void cdda_set_cdrom(device_t *device, void *file)
that references the given CD-ROM file
-------------------------------------------------*/
-device_t *cdda_from_cdrom(running_machine *machine, void *file)
+device_t *cdda_from_cdrom(running_machine &machine, void *file)
{
device_sound_interface *sound = NULL;
- for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->device().type() == CDDA)
{
cdda_info *info = get_safe_token(*sound);
diff --git a/src/emu/sound/cdda.h b/src/emu/sound/cdda.h
index 3db1830e9af..0c9c605978b 100644
--- a/src/emu/sound/cdda.h
+++ b/src/emu/sound/cdda.h
@@ -6,7 +6,7 @@
#include "devlegcy.h"
void cdda_set_cdrom(device_t *device, void *file);
-device_t *cdda_from_cdrom(running_machine *machine, void *file);
+device_t *cdda_from_cdrom(running_machine &machine, void *file);
void cdda_start_audio(device_t *device, UINT32 startlba, UINT32 numblocks);
void cdda_stop_audio(device_t *device);
diff --git a/src/emu/sound/cdp1863.c b/src/emu/sound/cdp1863.c
index 29c9dac9a19..64349b5193f 100644
--- a/src/emu/sound/cdp1863.c
+++ b/src/emu/sound/cdp1863.c
@@ -123,7 +123,7 @@ static STREAM_UPDATE( cdp1863_stream_update )
if (cdp1863->oe)
{
double frequency;
- int rate = device->machine->sample_rate() / 2;
+ int rate = device->machine().sample_rate() / 2;
/* get progress through wave */
int incr = cdp1863->incr;
@@ -175,7 +175,7 @@ static DEVICE_START( cdp1863 )
const cdp1863_config *config = get_safe_config(device);
/* set initial values */
- cdp1863->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), cdp1863, cdp1863_stream_update);
+ cdp1863->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), cdp1863, cdp1863_stream_update);
cdp1863->clock1 = device->clock();
cdp1863->clock2 = config->clock2;
cdp1863->oe = 1;
diff --git a/src/emu/sound/cdp1864.c b/src/emu/sound/cdp1864.c
index 52fcb51368f..da02f4f8f50 100644
--- a/src/emu/sound/cdp1864.c
+++ b/src/emu/sound/cdp1864.c
@@ -176,7 +176,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick )
}
}
- cdp1864->dma_timer->adjust(machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT));
+ cdp1864->dma_timer->adjust(machine.firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_WAIT));
cdp1864->dmaout = 0;
}
@@ -190,7 +190,7 @@ static TIMER_CALLBACK( cdp1864_dma_tick )
}
}
- cdp1864->dma_timer->adjust(machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE));
+ cdp1864->dma_timer->adjust(machine.firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_ACTIVE));
cdp1864->dmaout = 1;
}
@@ -226,7 +226,7 @@ static void cdp1864_init_palette(device_t *device, const cdp1864_interface *intf
g = (i & 1) ? luma : 0;
b = (i & 2) ? luma : 0;
- palette_set_color_rgb( device->machine, i, r, g, b );
+ palette_set_color_rgb( device->machine(), i, r, g, b );
}
}
@@ -364,7 +364,7 @@ static STREAM_UPDATE( cdp1864_stream_update )
if (cdp1864->aoe)
{
double frequency = cdp1864->cpu->unscaled_clock() / 8 / 4 / (cdp1864->latch + 1) / 2;
- int rate = device->machine->sample_rate() / 2;
+ int rate = device->machine().sample_rate() / 2;
/* get progress through wave */
int incr = cdp1864->incr;
@@ -410,7 +410,7 @@ void cdp1864_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprec
}
else
{
- bitmap_fill(bitmap, cliprect, get_black_pen(device->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(device->machine()));
}
}
@@ -432,26 +432,26 @@ static DEVICE_START( cdp1864 )
devcb_resolve_write_line(&cdp1864->out_efx_func, &intf->out_efx_func, device);
/* get the cpu */
- cdp1864->cpu = device->machine->device(intf->cpu_tag);
+ cdp1864->cpu = device->machine().device(intf->cpu_tag);
/* get the screen device */
- cdp1864->screen = downcast<screen_device *>(device->machine->device(intf->screen_tag));
+ cdp1864->screen = downcast<screen_device *>(device->machine().device(intf->screen_tag));
assert(cdp1864->screen != NULL);
/* allocate the temporary bitmap */
- cdp1864->bitmap = auto_bitmap_alloc(device->machine, cdp1864->screen->width(), cdp1864->screen->height(), cdp1864->screen->format());
+ cdp1864->bitmap = auto_bitmap_alloc(device->machine(), cdp1864->screen->width(), cdp1864->screen->height(), cdp1864->screen->format());
bitmap_fill(cdp1864->bitmap, 0, CDP1864_BACKGROUND_COLOR_SEQUENCE[cdp1864->bgcolor] + 8);
/* initialize the palette */
cdp1864_init_palette(device, intf);
/* create sound stream */
- cdp1864->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), cdp1864, cdp1864_stream_update);
+ cdp1864->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), cdp1864, cdp1864_stream_update);
/* create the timers */
- cdp1864->int_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_int_tick), (void *)device);
- cdp1864->efx_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_efx_tick), (void *)device);
- cdp1864->dma_timer = device->machine->scheduler().timer_alloc(FUNC(cdp1864_dma_tick), (void *)device);
+ cdp1864->int_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1864_int_tick), (void *)device);
+ cdp1864->efx_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1864_efx_tick), (void *)device);
+ cdp1864->dma_timer = device->machine().scheduler().timer_alloc(FUNC(cdp1864_dma_tick), (void *)device);
/* register for state saving */
device->save_item(NAME(cdp1864->disp));
@@ -477,7 +477,7 @@ static DEVICE_RESET( cdp1864 )
cdp1864->int_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_INT_START));
cdp1864->efx_timer->adjust(cdp1864->screen->time_until_pos(CDP1864_SCANLINE_EFX_TOP_START));
- cdp1864->dma_timer->adjust(device->machine->firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START));
+ cdp1864->dma_timer->adjust(device->machine().firstcpu->cycles_to_attotime(CDP1864_CYCLES_DMA_START));
cdp1864->disp = 0;
cdp1864->dmaout = 0;
diff --git a/src/emu/sound/cdp1869.c b/src/emu/sound/cdp1869.c
index cd3952d6604..f003bed0791 100644
--- a/src/emu/sound/cdp1869.c
+++ b/src/emu/sound/cdp1869.c
@@ -101,7 +101,7 @@ device_config *cdp1869_device_config::static_alloc_device_config(const machine_c
device_t *cdp1869_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, cdp1869_device(machine, *this));
+ return auto_alloc(machine, cdp1869_device(machine, *this));
}
@@ -496,7 +496,7 @@ void cdp1869_device::initialize_palette()
for (i = 0; i < 8; i++)
{
- palette_set_color(machine, i, get_rgb(i, i, 15));
+ palette_set_color(m_machine, i, get_rgb(i, i, 15));
}
// tone-on-tone display (CFC=1)
@@ -504,7 +504,7 @@ void cdp1869_device::initialize_palette()
{
for (int l = 0; l < 8; l++)
{
- palette_set_color(machine, i, get_rgb(i, c, l));
+ palette_set_color(m_machine, i, get_rgb(i, c, l));
i++;
}
}
diff --git a/src/emu/sound/cem3394.c b/src/emu/sound/cem3394.c
index e703910374c..b15c2887312 100644
--- a/src/emu/sound/cem3394.c
+++ b/src/emu/sound/cem3394.c
@@ -334,14 +334,14 @@ static DEVICE_START( cem3394 )
chip->inv_sample_rate = 1.0 / (double)chip->sample_rate;
/* allocate stream channels, 1 per chip */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, cem3394_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, cem3394_update);
chip->external = intf->external;
chip->vco_zero_freq = intf->vco_zero_freq;
chip->filter_zero_freq = intf->filter_zero_freq;
/* allocate memory for a mixer buffer and external buffer (1 second should do it!) */
- chip->mixer_buffer = auto_alloc_array(device->machine, INT16, chip->sample_rate);
- chip->external_buffer = auto_alloc_array(device->machine, INT16, chip->sample_rate);
+ chip->mixer_buffer = auto_alloc_array(device->machine(), INT16, chip->sample_rate);
+ chip->external_buffer = auto_alloc_array(device->machine(), INT16, chip->sample_rate);
device->save_item(NAME(chip->values));
device->save_item(NAME(chip->wave_select));
diff --git a/src/emu/sound/dac.c b/src/emu/sound/dac.c
index 4a600718d16..57b5171cc22 100644
--- a/src/emu/sound/dac.c
+++ b/src/emu/sound/dac.c
@@ -110,7 +110,7 @@ static DEVICE_START( dac )
DAC_build_voltable(info);
- info->channel = device->machine->sound().stream_alloc(*device,0,1,device->clock() ? device->clock() : DEFAULT_SAMPLE_RATE,info,DAC_update);
+ info->channel = device->machine().sound().stream_alloc(*device,0,1,device->clock() ? device->clock() : DEFAULT_SAMPLE_RATE,info,DAC_update);
info->output = 0;
device->save_item(NAME(info->output));
diff --git a/src/emu/sound/digitalk.c b/src/emu/sound/digitalk.c
index 5fbb1cbf5f0..48410c38df7 100644
--- a/src/emu/sound/digitalk.c
+++ b/src/emu/sound/digitalk.c
@@ -648,8 +648,8 @@ static DEVICE_START(digitalker)
{
digitalker *dg = get_safe_token(device);
dg->device = device;
- dg->rom = device->machine->region(device->tag())->base();
- dg->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
+ dg->rom = device->machine().region(device->tag())->base();
+ dg->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, dg, digitalker_update);
dg->dac_index = 128;
dg->data = 0xff;
dg->cs = dg->cms = dg->wr = 1;
diff --git a/src/emu/sound/disc_inp.c b/src/emu/sound/disc_inp.c
index 53331138932..d2e09bcd7e0 100644
--- a/src/emu/sound/disc_inp.c
+++ b/src/emu/sound/disc_inp.c
@@ -23,14 +23,14 @@
READ8_DEVICE_HANDLER(discrete_sound_r)
{
discrete_device *disc_device = downcast<discrete_device *>(device);
- return disc_device->read( *disc_device->machine->firstcpu->space(), offset, 0xff);
+ return disc_device->read( *disc_device->machine().firstcpu->space(), offset, 0xff);
}
WRITE8_DEVICE_HANDLER(discrete_sound_w)
{
discrete_device *disc_device = downcast<discrete_device *>(device);
- disc_device->write(*disc_device->machine->firstcpu->space(), offset, data, 0xff);
+ disc_device->write(*disc_device->machine().firstcpu->space(), offset, data, 0xff);
}
/************************************************************************
@@ -75,7 +75,7 @@ DISCRETE_RESET(dss_adjustment)
{
double min, max;
- m_port = m_device->machine->m_portlist.find((const char *)this->custom_data());
+ m_port = m_device->machine().m_portlist.find((const char *)this->custom_data());
if (m_port == NULL)
fatalerror("DISCRETE_ADJUSTMENT - NODE_%d has invalid tag", this->index());
@@ -334,7 +334,7 @@ void DISCRETE_CLASS_NAME(dss_input_stream)::stream_start(void)
discrete_sound_device *snd_device = downcast<discrete_sound_device *>(m_device);
//assert(DSS_INPUT_STREAM__STREAM < snd_device->m_input_stream_list.count());
- m_buffer_stream = m_device->machine->sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), this, static_stream_generate);
+ m_buffer_stream = m_device->machine().sound().stream_alloc(*snd_device, 0, 1, this->sample_rate(), this, static_stream_generate);
snd_device->get_stream()->set_input(m_stream_in_number, m_buffer_stream);
}
diff --git a/src/emu/sound/disc_wav.c b/src/emu/sound/disc_wav.c
index c3d46dad81e..1e4109d52ff 100644
--- a/src/emu/sound/disc_wav.c
+++ b/src/emu/sound/disc_wav.c
@@ -452,7 +452,7 @@ DISCRETE_STEP(dss_noise)
if(m_phase > (2.0 * M_PI))
{
/* GCC's rand returns a RAND_MAX value of 0x7fff */
- int newval = (m_device->machine->rand() & 0x7fff) - 16384;
+ int newval = (m_device->machine().rand() & 0x7fff) - 16384;
/* make sure the peak to peak values are the amplitude */
v_out = DSS_NOISE__AMP / 2;
diff --git a/src/emu/sound/discrete.c b/src/emu/sound/discrete.c
index 75b5671db11..b2bb8036238 100644
--- a/src/emu/sound/discrete.c
+++ b/src/emu/sound/discrete.c
@@ -314,7 +314,7 @@ void discrete_task::check(discrete_task *dest_task)
{
output_buffer buf;
- buf.node_buf = auto_alloc_array(m_device.machine, double,
+ buf.node_buf = auto_alloc_array(m_device.machine(), double,
((task_node->sample_rate() + sound_manager::STREAMS_UPDATE_FREQUENCY) / sound_manager::STREAMS_UPDATE_FREQUENCY));
buf.ptr = buf.node_buf;
buf.source = dest_node->m_input[inputnum];
@@ -326,7 +326,7 @@ void discrete_task::check(discrete_task *dest_task)
m_device.discrete_log("dso_task_start - buffering %d(%d) in task %p group %d referenced by %d group %d", NODE_INDEX(inputnode_num), NODE_CHILD_NODE_NUM(inputnode_num), this, task_group, dest_node->index(), dest_task->task_group);
/* register into source list */
- //source = auto_alloc(device->machine, discrete_source_node);
+ //source = auto_alloc(device->machine(), discrete_source_node);
//source.task = this;
//source.output_node = i;
source.linked_outbuf = pbuf;
@@ -688,7 +688,7 @@ void discrete_device::init_nodes(const sound_block_list_t &block_list)
/* make sure we have one simple task
* No need to create a node since there are no dependencies.
*/
- task = auto_alloc_clear(machine, discrete_task(*this));
+ task = auto_alloc_clear(m_machine, discrete_task(*this));
task_list.add(task);
}
@@ -722,7 +722,7 @@ void discrete_device::init_nodes(const sound_block_list_t &block_list)
{
if (task != NULL)
fatalerror("init_nodes() - Nested DISCRETE_START_TASK.");
- task = auto_alloc_clear(machine, discrete_task(*this));
+ task = auto_alloc_clear(m_machine, discrete_task(*this));
task->task_group = block->initial[0];
if (task->task_group < 0 || task->task_group >= DISCRETE_MAX_TASK_GROUPS)
fatalerror("discrete_dso_task: illegal task_group %d", task->task_group);
@@ -861,12 +861,12 @@ device_config *discrete_sound_device_config::static_alloc_device_config(const ma
device_t *discrete_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, discrete_device(machine, *this));
+ return auto_alloc(machine, discrete_device(machine, *this));
}
device_t *discrete_sound_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, discrete_sound_device(machine, *this));
+ return auto_alloc(machine, discrete_sound_device(machine, *this));
}
@@ -930,7 +930,7 @@ void discrete_device::device_start()
if (this->clock())
m_sample_rate = this->clock();
else
- m_sample_rate = this->machine->sample_rate();
+ m_sample_rate = this->machine().sample_rate();
m_sample_time = 1.0 / m_sample_rate;
m_neg_sample_time = - m_sample_time;
@@ -958,7 +958,7 @@ void discrete_device::device_start()
m_node_list.clear();
/* allocate memory to hold pointers to nodes by index */
- m_indexed_node = auto_alloc_array_clear(this->machine, discrete_base_node *, DISCRETE_MAX_NODES);
+ m_indexed_node = auto_alloc_array_clear(this->machine(), discrete_base_node *, DISCRETE_MAX_NODES);
/* initialize the node data */
init_nodes(block_list);
diff --git a/src/emu/sound/discrete.h b/src/emu/sound/discrete.h
index 9174c9753a9..731bdef93e9 100644
--- a/src/emu/sound/discrete.h
+++ b/src/emu/sound/discrete.h
@@ -4563,7 +4563,7 @@ class discrete_node_factory : public discrete_node_base_factory
template <class C>
discrete_base_node * discrete_node_factory<C>::Create(discrete_device * pdev, const discrete_block *block)
{
- discrete_base_node *r = auto_alloc_clear(pdev->machine, C);
+ discrete_base_node *r = auto_alloc_clear(pdev->machine(), C);
r->init(pdev, block);
return r;
diff --git a/src/emu/sound/dmadac.c b/src/emu/sound/dmadac.c
index 470604834e2..9a8d6613235 100644
--- a/src/emu/sound/dmadac.c
+++ b/src/emu/sound/dmadac.c
@@ -106,13 +106,13 @@ static DEVICE_START( dmadac )
dmadac_state *info = get_safe_token(device);
/* allocate a clear a buffer */
- info->buffer = auto_alloc_array_clear(device->machine, INT16, BUFFER_SIZE);
+ info->buffer = auto_alloc_array_clear(device->machine(), INT16, BUFFER_SIZE);
/* reset the state */
info->volume = 0x100;
/* allocate a stream channel */
- info->channel = device->machine->sound().stream_alloc(*device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update);
+ info->channel = device->machine().sound().stream_alloc(*device, 0, 1, DEFAULT_SAMPLE_RATE, info, dmadac_update);
/* register with the save state system */
device->save_item(NAME(info->bufin));
diff --git a/src/emu/sound/es5503.c b/src/emu/sound/es5503.c
index f0e4f58a028..23fc862b099 100644
--- a/src/emu/sound/es5503.c
+++ b/src/emu/sound/es5503.c
@@ -259,14 +259,14 @@ static DEVICE_START( es5503 )
chip->oscillators[osc].irqpend = 0;
chip->oscillators[osc].accumulator = 0;
- chip->oscillators[osc].timer = device->machine->scheduler().timer_alloc(FUNC(es5503_timer_cb), &chip->oscillators[osc]);
+ chip->oscillators[osc].timer = device->machine().scheduler().timer_alloc(FUNC(es5503_timer_cb), &chip->oscillators[osc]);
chip->oscillators[osc].chip = (void *)chip;
}
chip->oscsenabled = 1;
chip->output_rate = (device->clock()/8)/34; // (input clock / 8) / # of oscs. enabled + 2
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, chip->output_rate, chip, es5503_pcm_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, chip->output_rate, chip, es5503_pcm_update);
}
READ8_DEVICE_HANDLER( es5503_r )
diff --git a/src/emu/sound/es5506.c b/src/emu/sound/es5506.c
index f6e8572fbd2..2f25bd7ead4 100644
--- a/src/emu/sound/es5506.c
+++ b/src/emu/sound/es5506.c
@@ -261,7 +261,7 @@ static void compute_tables(es5506_state *chip)
int i;
/* allocate ulaw lookup table */
- chip->ulaw_lookup = auto_alloc_array(chip->device->machine, INT16, 1 << ULAW_MAXBITS);
+ chip->ulaw_lookup = auto_alloc_array(chip->device->machine(), INT16, 1 << ULAW_MAXBITS);
/* generate ulaw lookup table */
for (i = 0; i < (1 << ULAW_MAXBITS); i++)
@@ -280,7 +280,7 @@ static void compute_tables(es5506_state *chip)
}
/* allocate volume lookup table */
- chip->volume_lookup = auto_alloc_array(chip->device->machine, UINT16, 4096);
+ chip->volume_lookup = auto_alloc_array(chip->device->machine(), UINT16, 4096);
/* generate volume lookup table */
for (i = 0; i < 4096; i++)
@@ -910,13 +910,13 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
eslog = fopen("es.log", "w");
/* create the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / (16*32), chip, es5506_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / (16*32), chip, es5506_update);
/* initialize the regions */
- chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine->region(intf->region0)->base() : NULL;
- chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine->region(intf->region1)->base() : NULL;
- chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine->region(intf->region2)->base() : NULL;
- chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine->region(intf->region3)->base() : NULL;
+ chip->region_base[0] = intf->region0 ? (UINT16 *)device->machine().region(intf->region0)->base() : NULL;
+ chip->region_base[1] = intf->region1 ? (UINT16 *)device->machine().region(intf->region1)->base() : NULL;
+ chip->region_base[2] = intf->region2 ? (UINT16 *)device->machine().region(intf->region2)->base() : NULL;
+ chip->region_base[3] = intf->region3 ? (UINT16 *)device->machine().region(intf->region3)->base() : NULL;
/* initialize the rest of the structure */
chip->device = device;
@@ -940,7 +940,7 @@ static void es5506_start_common(device_t *device, const void *config, device_typ
}
/* allocate memory */
- chip->scratch = auto_alloc_array(device->machine, INT32, 2 * MAX_SAMPLE_CHUNK);
+ chip->scratch = auto_alloc_array(device->machine(), INT32, 2 * MAX_SAMPLE_CHUNK);
/* register save */
device->save_item(NAME(chip->sample_rate));
@@ -1596,7 +1596,7 @@ static DEVICE_RESET( es5505 )
INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- running_machine *machine = chip->device->machine;
+ running_machine &machine = chip->device->machine();
switch (offset)
{
@@ -1619,7 +1619,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
}
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
+ fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine.describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask ^ 0xffff);
break;
case 0x01: /* FC */
@@ -1628,7 +1628,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->freqcount = (voice->freqcount & ~0x1fe00) | ((data & 0xff00) << 1);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, freq count=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->freqcount);
+ fprintf(eslog, "%s:voice %d, freq count=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->freqcount);
break;
case 0x02: /* STRT (hi) */
@@ -1637,7 +1637,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->start = (voice->start & ~0x7c000000) | ((data & 0x1f00) << 18);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start);
+ fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->start);
break;
case 0x03: /* STRT (lo) */
@@ -1646,7 +1646,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->start = (voice->start & ~0x0003fc00) | ((data & 0xff00) << 2);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->start);
+ fprintf(eslog, "%s:voice %d, loop start=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->start);
break;
case 0x04: /* END (hi) */
@@ -1658,7 +1658,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
voice->control |= CONTROL_STOP0;
#endif
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end);
+ fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->end);
break;
case 0x05: /* END (lo) */
@@ -1670,7 +1670,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
voice->control |= CONTROL_STOP0;
#endif
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->end);
+ fprintf(eslog, "%s:voice %d, loop end=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->end);
break;
case 0x06: /* K2 */
@@ -1679,7 +1679,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->k2 = (voice->k2 & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, K2=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k2);
+ fprintf(eslog, "%s:voice %d, K2=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->k2);
break;
case 0x07: /* K1 */
@@ -1688,21 +1688,21 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->k1 = (voice->k1 & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, K1=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->k1);
+ fprintf(eslog, "%s:voice %d, K1=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->k1);
break;
case 0x08: /* LVOL */
if (ACCESSING_BITS_8_15)
voice->lvol = (voice->lvol & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, left vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->lvol);
+ fprintf(eslog, "%s:voice %d, left vol=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->lvol);
break;
case 0x09: /* RVOL */
if (ACCESSING_BITS_8_15)
voice->rvol = (voice->rvol & ~0xff00) | (data & 0xff00);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, right vol=%04x\n", machine->describe_context(), chip->current_page & 0x1f, voice->rvol);
+ fprintf(eslog, "%s:voice %d, right vol=%04x\n", machine.describe_context(), chip->current_page & 0x1f, voice->rvol);
break;
case 0x0a: /* ACC (hi) */
@@ -1711,7 +1711,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->accum = (voice->accum & ~0x7c000000) | ((data & 0x1f00) << 18);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum);
+ fprintf(eslog, "%s:voice %d, accum=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->accum);
break;
case 0x0b: /* ACC (lo) */
@@ -1720,7 +1720,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
if (ACCESSING_BITS_8_15)
voice->accum = (voice->accum & ~0x0003fc00) | ((data & 0xff00) << 2);
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, accum=%08x\n", machine->describe_context(), chip->current_page & 0x1f, voice->accum);
+ fprintf(eslog, "%s:voice %d, accum=%08x\n", machine.describe_context(), chip->current_page & 0x1f, voice->accum);
break;
case 0x0c: /* unused */
@@ -1751,7 +1751,7 @@ INLINE void es5505_reg_write_low(es5506_state *chip, es5506_voice *voice, offs_t
INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_t offset, UINT16 data, UINT16 mem_mask)
{
- running_machine *machine = chip->device->machine;
+ running_machine &machine = chip->device->machine();
switch (offset)
{
@@ -1769,7 +1769,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
((data << 2) & (CONTROL_CA0 | CONTROL_CA1));
}
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask);
+ fprintf(eslog, "%s:voice %d, control=%04x (raw=%04x & %04x)\n", machine.describe_context(), chip->current_page & 0x1f, voice->control, data, mem_mask);
break;
case 0x01: /* O4(n-1) */
@@ -1778,7 +1778,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o4n1 = (INT16)((voice->o4n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O4(n-1)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o4n1 & 0x3ffff);
break;
case 0x02: /* O3(n-1) */
@@ -1787,7 +1787,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o3n1 = (INT16)((voice->o3n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O3(n-1)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o3n1 & 0x3ffff);
break;
case 0x03: /* O3(n-2) */
@@ -1796,7 +1796,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o3n2 = (INT16)((voice->o3n2 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O3(n-2)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o3n2 & 0x3ffff);
break;
case 0x04: /* O2(n-1) */
@@ -1805,7 +1805,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o2n1 = (INT16)((voice->o2n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O2(n-1)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff);
break;
case 0x05: /* O2(n-2) */
@@ -1814,7 +1814,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o2n2 = (INT16)((voice->o2n2 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
+ fprintf(eslog, "%s:voice %d, O2(n-2)=%05x\n", machine.describe_context(), chip->current_page & 0x1f, voice->o2n2 & 0x3ffff);
break;
case 0x06: /* O1(n-1) */
@@ -1823,7 +1823,7 @@ INLINE void es5505_reg_write_high(es5506_state *chip, es5506_voice *voice, offs_
if (ACCESSING_BITS_8_15)
voice->o1n1 = (INT16)((voice->o1n1 & ~0xff00) | (data & 0xff00));
if (LOG_COMMANDS && eslog)
- fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine->describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
+ fprintf(eslog, "%s:voice %d, O1(n-1)=%05x (accum=%08x)\n", machine.describe_context(), chip->current_page & 0x1f, voice->o2n1 & 0x3ffff, voice->accum);
break;
case 0x07:
@@ -1906,7 +1906,7 @@ WRITE16_DEVICE_HANDLER( es5505_w )
es5506_state *chip = get_safe_token(device);
es5506_voice *voice = &chip->voice[chip->current_page & 0x1f];
-// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", machine->describe_context(), chip->current_page, offset, data, mem_mask);
+// logerror("%s:ES5505 write %02x/%02x = %04x & %04x\n", machine.describe_context(), chip->current_page, offset, data, mem_mask);
/* force an update */
chip->stream->update();
diff --git a/src/emu/sound/es8712.c b/src/emu/sound/es8712.c
index 4615b5dc026..8cae3700798 100644
--- a/src/emu/sound/es8712.c
+++ b/src/emu/sound/es8712.c
@@ -227,7 +227,7 @@ static DEVICE_START( es8712 )
chip->region_base = *device->region();
/* generate the name and create the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), chip, es8712_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), chip, es8712_update);
/* initialize the rest of the structure */
chip->signal = -2;
diff --git a/src/emu/sound/filter.c b/src/emu/sound/filter.c
index 5aa7582fdad..43acebde248 100644
--- a/src/emu/sound/filter.c
+++ b/src/emu/sound/filter.c
@@ -134,7 +134,7 @@ filter* filter_lp_fir_alloc(double freq, int order) {
void filter2_setup(device_t *device, int type, double fc, double d, double gain,
filter2_context *filter2)
{
- int sample_rate = device->machine->sample_rate();
+ int sample_rate = device->machine().sample_rate();
double w; /* cutoff freq, in radians/sec */
double w_squared;
double den; /* temp variable */
diff --git a/src/emu/sound/flt_rc.c b/src/emu/sound/flt_rc.c
index 9f004c08cbc..ab831c234ed 100644
--- a/src/emu/sound/flt_rc.c
+++ b/src/emu/sound/flt_rc.c
@@ -83,7 +83,7 @@ static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, d
/* Cut Frequency = 1/(2*Pi*Req*C) */
/* k = (1-(EXP(-TIMEDELTA/RC))) */
- info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine->sample_rate()));
+ info->k = 0x10000 - 0x10000 * (exp(-1 / (Req * C) / info->device->machine().sample_rate()));
}
@@ -93,7 +93,7 @@ static DEVICE_START( filter_rc )
const flt_rc_config *conf = (const flt_rc_config *)device->baseconfig().static_config();
info->device = device;
- info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate(), info, filter_rc_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_rc_update);
if (conf)
set_RC_info(info, conf->type, conf->R1, conf->R2, conf->R3, conf->C);
else
diff --git a/src/emu/sound/flt_vol.c b/src/emu/sound/flt_vol.c
index 2e057223f8e..27b354be948 100644
--- a/src/emu/sound/flt_vol.c
+++ b/src/emu/sound/flt_vol.c
@@ -34,7 +34,7 @@ static DEVICE_START( filter_volume )
filter_volume_state *info = get_safe_token(device);
info->gain = 0x100;
- info->stream = device->machine->sound().stream_alloc(*device, 1, 1, device->machine->sample_rate(), info, filter_volume_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 1, 1, device->machine().sample_rate(), info, filter_volume_update);
}
diff --git a/src/emu/sound/fm.c b/src/emu/sound/fm.c
index 256a6a595a8..8027883618c 100644
--- a/src/emu/sound/fm.c
+++ b/src/emu/sound/fm.c
@@ -841,7 +841,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
{
if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 )
{
- if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(ST->device->machine)) > 0)
+ if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(&ST->device->machine())) > 0)
return ST->status | 0x80; /* with busy */
/* expire */
FM_BUSY_CLEAR(ST);
@@ -851,7 +851,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock )
{
TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(attotime::from_hz(ST->clock), busyclock * ST->timer_prescaler);
- ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(ST->device->machine), expiry_period);
+ ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(&ST->device->machine()), expiry_period);
}
#else
#define FM_STATUS_FLAG(ST) ((ST)->status)
@@ -2264,11 +2264,11 @@ void * ym2203_init(void *param, device_t *device, int clock, int rate,
YM2203 *F2203;
/* allocate ym2203 state space */
- F2203 = auto_alloc_clear(device->machine, YM2203);
+ F2203 = auto_alloc_clear(device->machine(), YM2203);
if( !init_tables() )
{
- auto_free( device->machine, F2203 );
+ auto_free( device->machine(), F2203 );
return NULL;
}
@@ -2295,7 +2295,7 @@ void ym2203_shutdown(void *chip)
YM2203 *FM2203 = (YM2203 *)chip;
FMCloseTable();
- auto_free(FM2203->OPN.ST.device->machine, FM2203);
+ auto_free(FM2203->OPN.ST.device->machine(), FM2203);
}
/* YM2203 I/O interface */
@@ -3487,11 +3487,11 @@ void * ym2608_init(void *param, device_t *device, int clock, int rate,
YM2608 *F2608;
/* allocate extend state space */
- F2608 = auto_alloc_clear(device->machine, YM2608);
+ F2608 = auto_alloc_clear(device->machine(), YM2608);
/* allocate total level table (128kb space) */
if( !init_tables() )
{
- auto_free( device->machine, F2608 );
+ auto_free( device->machine(), F2608 );
return NULL;
}
@@ -3539,7 +3539,7 @@ void ym2608_shutdown(void *chip)
YM2608 *F2608 = (YM2608 *)chip;
FMCloseTable();
- auto_free(F2608->OPN.ST.device->machine, F2608);
+ auto_free(F2608->OPN.ST.device->machine(), F2608);
}
/* reset one of chips */
@@ -4170,11 +4170,11 @@ void *ym2610_init(void *param, device_t *device, int clock, int rate,
YM2610 *F2610;
/* allocate extend state space */
- F2610 = auto_alloc_clear(device->machine, YM2610);
+ F2610 = auto_alloc_clear(device->machine(), YM2610);
/* allocate total level table (128kb space) */
if( !init_tables() )
{
- auto_free( device->machine, F2610 );
+ auto_free( device->machine(), F2610 );
return NULL;
}
@@ -4214,7 +4214,7 @@ void ym2610_shutdown(void *chip)
YM2610 *F2610 = (YM2610 *)chip;
FMCloseTable();
- auto_free(F2610->OPN.ST.device->machine, F2610);
+ auto_free(F2610->OPN.ST.device->machine(), F2610);
}
/* reset one of chip */
@@ -4230,17 +4230,17 @@ void ym2610_reset_chip(void *chip)
/* setup PCM buffers again */
name.printf("%s",dev->tag());
- F2610->pcmbuf = (const UINT8 *)dev->machine->region(name)->base();
- F2610->pcm_size = dev->machine->region(name)->bytes();
+ F2610->pcmbuf = (const UINT8 *)dev->machine().region(name)->base();
+ F2610->pcm_size = dev->machine().region(name)->bytes();
name.printf("%s.deltat",dev->tag());
- F2610->deltaT.memory = (UINT8 *)dev->machine->region(name)->base();
+ F2610->deltaT.memory = (UINT8 *)dev->machine().region(name)->base();
if(F2610->deltaT.memory == NULL)
{
F2610->deltaT.memory = (UINT8*)F2610->pcmbuf;
F2610->deltaT.memory_size = F2610->pcm_size;
}
else
- F2610->deltaT.memory_size = dev->machine->region(name)->bytes();
+ F2610->deltaT.memory_size = dev->machine().region(name)->bytes();
/* Reset Prescaler */
OPNSetPres( OPN, 6*24, 6*24, 4*2); /* OPN 1/6 , SSG 1/4 */
diff --git a/src/emu/sound/fm.h b/src/emu/sound/fm.h
index 6a195006fc0..120ca9bdea8 100644
--- a/src/emu/sound/fm.h
+++ b/src/emu/sound/fm.h
@@ -42,7 +42,7 @@ struct _ssg_callbacks
#if FM_BUSY_FLAG_SUPPORT
#define TIME_TYPE attotime
#define UNDEFINED_TIME attotime::zero
-#define FM_GET_TIME_NOW(machine) machine->time()
+#define FM_GET_TIME_NOW(machine) (machine)->time()
#define ADD_TIMES(t1, t2) ((t1) + (t2))
#define COMPARE_TIMES(t1, t2) (((t1) == (t2)) ? 0 : ((t1) < (t2)) ? -1 : 1)
#define MULTIPLY_TIME_BY_INT(t,i) ((t) * (i))
diff --git a/src/emu/sound/fm2612.c b/src/emu/sound/fm2612.c
index 7a22e09dcc9..b8002cf1a29 100644
--- a/src/emu/sound/fm2612.c
+++ b/src/emu/sound/fm2612.c
@@ -1004,7 +1004,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
{
if( COMPARE_TIMES(ST->busy_expiry_time, UNDEFINED_TIME) != 0 )
{
- if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(ST->device->machine)) > 0)
+ if (COMPARE_TIMES(ST->busy_expiry_time, FM_GET_TIME_NOW(&ST->device->machine())) > 0)
return ST->status | 0x80; /* with busy */
/* expire */
FM_BUSY_CLEAR(ST);
@@ -1014,7 +1014,7 @@ INLINE UINT8 FM_STATUS_FLAG(FM_ST *ST)
INLINE void FM_BUSY_SET(FM_ST *ST,int busyclock )
{
TIME_TYPE expiry_period = MULTIPLY_TIME_BY_INT(attotime::from_hz(ST->clock), busyclock * ST->timer_prescaler);
- ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(ST->device->machine), expiry_period);
+ ST->busy_expiry_time = ADD_TIMES(FM_GET_TIME_NOW(&ST->device->machine()), expiry_period);
}
#else
#define FM_STATUS_FLAG(ST) ((ST)->status)
@@ -2369,7 +2369,7 @@ void * ym2612_init(void *param, device_t *device, int clock, int rate,
YM2612 *F2612;
/* allocate extend state space */
- F2612 = auto_alloc_clear(device->machine, YM2612);
+ F2612 = auto_alloc_clear(device->machine(), YM2612);
/* allocate total level table (128kb space) */
init_tables();
@@ -2397,7 +2397,7 @@ void ym2612_shutdown(void *chip)
YM2612 *F2612 = (YM2612 *)chip;
FMCloseTable();
- auto_free(F2612->OPN.ST.device->machine, F2612);
+ auto_free(F2612->OPN.ST.device->machine(), F2612);
}
/* reset one of chip */
diff --git a/src/emu/sound/fmopl.c b/src/emu/sound/fmopl.c
index 7f885bc1119..77e2a03473e 100644
--- a/src/emu/sound/fmopl.c
+++ b/src/emu/sound/fmopl.c
@@ -1744,7 +1744,7 @@ static int OPL_LockTable(device_t *device)
{
cymfile = fopen("3812_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create file 3812_.cym\n");
}
@@ -1957,7 +1957,7 @@ static void OPL_save_state(FM_OPL *OPL, device_t *device)
device->save_item(NAME(OPL->statusmask));
device->save_item(NAME(OPL->mode));
- device->machine->state().register_postload(OPL_postload, OPL);
+ device->machine().state().register_postload(OPL_postload, OPL);
}
@@ -1980,7 +1980,7 @@ static FM_OPL *OPLCreate(device_t *device, UINT32 clock, UINT32 rate, int type)
#endif
/* allocate memory block */
- ptr = (char *)auto_alloc_array_clear(device->machine, UINT8, state_size);
+ ptr = (char *)auto_alloc_array_clear(device->machine(), UINT8, state_size);
OPL = (FM_OPL *)ptr;
@@ -2009,7 +2009,7 @@ static FM_OPL *OPLCreate(device_t *device, UINT32 clock, UINT32 rate, int type)
static void OPLDestroy(FM_OPL *OPL)
{
OPL_UnLockTable();
- auto_free(OPL->device->machine, OPL);
+ auto_free(OPL->device->machine(), OPL);
}
/* Optional handlers */
diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c
index 036590bf837..5823f3248e4 100644
--- a/src/emu/sound/gaelco.c
+++ b/src/emu/sound/gaelco.c
@@ -195,7 +195,7 @@ READ16_DEVICE_HANDLER( gaelcosnd_r )
{
gaelco_sound_state *info = get_safe_token(device);
- LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", device->machine->describe_context(), offset));
+ LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", device->machine().describe_context(), offset));
return info->sndregs[offset];
}
@@ -209,7 +209,7 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w )
gaelco_sound_state *info = get_safe_token(device);
gaelco_sound_channel *channel = &info->channel[offset >> 3];
- LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", device->machine->describe_context(), data, offset));
+ LOG_READ_WRITES(("%s: (GAE1): write %04x to %04x\n", device->machine().describe_context(), data, offset));
/* first update the stream to this point in time */
info->stream->update();
@@ -259,8 +259,8 @@ static DEVICE_START( gaelco )
for (j = 0; j < 4; j++){
info->banks[j] = intf->banks[j];
}
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update);
- info->snd_data = (UINT8 *)device->machine->region(intf->gfxregion)->base();
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 8000, info, gaelco_update);
+ info->snd_data = (UINT8 *)device->machine().region(intf->gfxregion)->base();
if (info->snd_data == NULL)
info->snd_data = *device->region();
diff --git a/src/emu/sound/hc55516.c b/src/emu/sound/hc55516.c
index c10f765a3c6..58d4d862886 100644
--- a/src/emu/sound/hc55516.c
+++ b/src/emu/sound/hc55516.c
@@ -76,7 +76,7 @@ static void start_common(device_t *device, UINT8 _shiftreg_mask, int _active_clo
chip->last_clock_state = 0;
/* create the stream */
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, chip, hc55516_update);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, chip, hc55516_update);
device->save_item(NAME(chip->last_clock_state));
device->save_item(NAME(chip->digit));
diff --git a/src/emu/sound/ics2115.c b/src/emu/sound/ics2115.c
index 0a15dae9b6d..02fe11b9eca 100644
--- a/src/emu/sound/ics2115.c
+++ b/src/emu/sound/ics2115.c
@@ -33,7 +33,7 @@ device_config *ics2115_device_config::static_alloc_device_config(const machine_c
device_t *ics2115_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, ics2115_device(machine, *this));
+ return auto_alloc(machine, ics2115_device(machine, *this));
}
ics2115_device::ics2115_device(running_machine &machine, const ics2115_device_config &config)
@@ -47,8 +47,8 @@ ics2115_device::ics2115_device(running_machine &machine, const ics2115_device_co
void ics2115_device::device_start()
{
m_rom = *region();
- m_timer[0].timer = machine->scheduler().timer_alloc(FUNC(timer_cb_0), this);
- m_timer[1].timer = machine->scheduler().timer_alloc(FUNC(timer_cb_1), this);
+ m_timer[0].timer = m_machine.scheduler().timer_alloc(FUNC(timer_cb_0), this);
+ m_timer[1].timer = m_machine.scheduler().timer_alloc(FUNC(timer_cb_1), this);
m_stream = m_machine.sound().stream_alloc(*this, 0, 2, 33075);
//Exact formula as per patent 5809466
diff --git a/src/emu/sound/iremga20.c b/src/emu/sound/iremga20.c
index cb8aa2cc451..a92e6870fca 100644
--- a/src/emu/sound/iremga20.c
+++ b/src/emu/sound/iremga20.c
@@ -247,7 +247,7 @@ static DEVICE_START( iremga20 )
for ( i = 0; i < 0x40; i++ )
chip->regs[i] = 0;
- chip->stream = device->machine->sound().stream_alloc( *device, 0, 2, device->clock()/4, chip, IremGA20_update );
+ chip->stream = device->machine().sound().stream_alloc( *device, 0, 2, device->clock()/4, chip, IremGA20_update );
device->save_item(NAME(chip->regs));
for (i = 0; i < 4; i++)
diff --git a/src/emu/sound/k005289.c b/src/emu/sound/k005289.c
index a33ce5c7e98..d8c14c66998 100644
--- a/src/emu/sound/k005289.c
+++ b/src/emu/sound/k005289.c
@@ -68,7 +68,7 @@ INLINE k005289_state *get_safe_token(device_t *device)
}
/* build a table to divide by the number of voices */
-static void make_mixer_table(running_machine *machine, k005289_state *info, int voices)
+static void make_mixer_table(running_machine &machine, k005289_state *info, int voices)
{
int count = voices * 128;
int i;
@@ -164,14 +164,14 @@ static DEVICE_START( k005289 )
/* get stream channels */
info->rate = device->clock()/16;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, K005289_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, info->rate, info, K005289_update);
info->mclock = device->clock();
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- info->mixer_buffer = auto_alloc_array(device->machine, short, 2 * info->rate);
+ info->mixer_buffer = auto_alloc_array(device->machine(), short, 2 * info->rate);
/* build the mixer table */
- make_mixer_table(device->machine, info, 2);
+ make_mixer_table(device->machine(), info, 2);
info->sound_prom = *device->region();
diff --git a/src/emu/sound/k007232.c b/src/emu/sound/k007232.c
index f763342dabd..8a5de7ee2b4 100644
--- a/src/emu/sound/k007232.c
+++ b/src/emu/sound/k007232.c
@@ -328,7 +328,7 @@ static DEVICE_START( k007232 )
for( i = 0; i < 0x10; i++ ) info->wreg[i] = 0;
- info->stream = device->machine->sound().stream_alloc(*device,0,2,device->clock()/128,info,KDAC_A_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,device->clock()/128,info,KDAC_A_update);
KDAC_A_make_fncode(info);
}
diff --git a/src/emu/sound/k051649.c b/src/emu/sound/k051649.c
index 9a9d60cd71c..361d565c615 100644
--- a/src/emu/sound/k051649.c
+++ b/src/emu/sound/k051649.c
@@ -62,7 +62,7 @@ INLINE k051649_state *get_safe_token(device_t *device)
}
/* build a table to divide by the number of voices */
-static void make_mixer_table(running_machine *machine, k051649_state *info, int voices)
+static void make_mixer_table(running_machine &machine, k051649_state *info, int voices)
{
int count = voices * 256;
int i;
@@ -138,14 +138,14 @@ static DEVICE_START( k051649 )
/* get stream channels */
info->rate = device->clock()/16;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, info->rate, info, k051649_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, info->rate, info, k051649_update);
info->mclock = device->clock();
/* allocate a buffer to mix into - 1 second's worth should be more than enough */
- info->mixer_buffer = auto_alloc_array(device->machine, short, 2 * info->rate);
+ info->mixer_buffer = auto_alloc_array(device->machine(), short, 2 * info->rate);
/* build the mixer table */
- make_mixer_table(device->machine, info, 5);
+ make_mixer_table(device->machine(), info, 5);
}
static DEVICE_RESET( k051649 )
diff --git a/src/emu/sound/k053260.c b/src/emu/sound/k053260.c
index 068e026159e..e694bec5dc7 100644
--- a/src/emu/sound/k053260.c
+++ b/src/emu/sound/k053260.c
@@ -221,7 +221,7 @@ static DEVICE_START( k053260 )
ic->mode = 0;
- const memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine->region(ic->intf->rgnoverride) : device->region();
+ const memory_region *region = (ic->intf->rgnoverride != NULL) ? device->machine().region(ic->intf->rgnoverride) : device->region();
ic->rom = *region;
ic->rom_size = region->bytes();
@@ -231,9 +231,9 @@ static DEVICE_START( k053260 )
for ( i = 0; i < 0x30; i++ )
ic->regs[i] = 0;
- ic->delta_table = auto_alloc_array( device->machine, UINT32, 0x1000 );
+ ic->delta_table = auto_alloc_array( device->machine(), UINT32, 0x1000 );
- ic->channel = device->machine->sound().stream_alloc( *device, 0, 2, rate, ic, k053260_update );
+ ic->channel = device->machine().sound().stream_alloc( *device, 0, 2, rate, ic, k053260_update );
InitDeltaTable( ic, rate, device->clock() );
@@ -258,7 +258,7 @@ static DEVICE_START( k053260 )
/* setup SH1 timer if necessary */
if ( ic->intf->irq )
- device->machine->scheduler().timer_pulse( attotime::from_hz(device->clock()) * 32, FUNC(ic->intf->irq ));
+ device->machine().scheduler().timer_pulse( attotime::from_hz(device->clock()) * 32, FUNC(ic->intf->irq ));
}
INLINE void check_bounds( k053260_state *ic, int channel )
@@ -424,7 +424,7 @@ READ8_DEVICE_HANDLER( k053260_r )
ic->channels[0].pos += ( 1 << 16 );
if ( offs > ic->rom_size ) {
- logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine->describe_context(),offs,ic->rom_size );
+ logerror("%s: K53260: Attempting to read past ROM size in ROM Read Mode (offs = %06x, size = %06x).\n", device->machine().describe_context(),offs,ic->rom_size );
return 0;
}
diff --git a/src/emu/sound/k054539.c b/src/emu/sound/k054539.c
index 00d44b5cdb1..638d7b62007 100644
--- a/src/emu/sound/k054539.c
+++ b/src/emu/sound/k054539.c
@@ -384,7 +384,7 @@ else
double gc_f0;
int gc_i, gc_j, gc_k, gc_l;
- if (input_code_pressed_once(device->machine, KEYCODE_DEL_PAD))
+ if (input_code_pressed_once(device->machine(), KEYCODE_DEL_PAD))
{
gc_active ^= 1;
if (!gc_active) popmessage(NULL);
@@ -392,23 +392,23 @@ else
if (gc_active)
{
- if (input_code_pressed_once(device->machine, KEYCODE_0_PAD)) gc_chip ^= 1;
+ if (input_code_pressed_once(device->machine(), KEYCODE_0_PAD)) gc_chip ^= 1;
gc_i = gc_pos[gc_chip];
gc_j = 0;
- if (input_code_pressed_once(device->machine, KEYCODE_4_PAD)) { gc_i--; gc_j = 1; }
- if (input_code_pressed_once(device->machine, KEYCODE_6_PAD)) { gc_i++; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_4_PAD)) { gc_i--; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_6_PAD)) { gc_i++; gc_j = 1; }
if (gc_j) { gc_i &= 7; gc_pos[gc_chip] = gc_i; }
- if (input_code_pressed_once(device->machine, KEYCODE_5_PAD))
+ if (input_code_pressed_once(device->machine(), KEYCODE_5_PAD))
info->k054539_gain[gc_i] = 1.0;
else
{
gc_fptr = &info->k054539_gain[gc_i];
gc_f0 = *gc_fptr;
gc_j = 0;
- if (input_code_pressed_once(device->machine, KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; }
- if (input_code_pressed_once(device->machine, KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_2_PAD)) { gc_f0 -= 0.1; gc_j = 1; }
+ if (input_code_pressed_once(device->machine(), KEYCODE_8_PAD)) { gc_f0 += 0.1; gc_j = 1; }
if (gc_j) { if (gc_f0 < 0) gc_f0 = 0; *gc_fptr = gc_f0; }
}
@@ -451,12 +451,12 @@ static void k054539_init_chip(device_t *device, k054539_state *info)
info->k054539_flags |= K054539_UPDATE_AT_KEYON; //* make it default until proven otherwise
// Real size of 0x4000, the addon is to simplify the reverb buffer computations
- info->ram = auto_alloc_array(device->machine, unsigned char, 0x4000*2+device->clock()/50*2);
+ info->ram = auto_alloc_array(device->machine(), unsigned char, 0x4000*2+device->clock()/50*2);
info->reverb_pos = 0;
info->cur_ptr = 0;
memset(info->ram, 0, 0x4000*2+device->clock()/50*2);
- const memory_region *region = (info->intf->rgnoverride != NULL) ? device->machine->region(info->intf->rgnoverride) : device->region();
+ const memory_region *region = (info->intf->rgnoverride != NULL) ? device->machine().region(info->intf->rgnoverride) : device->region();
info->rom = *region;
info->rom_size = region->bytes();
info->rom_mask = 0xffffffffU;
@@ -470,9 +470,9 @@ static void k054539_init_chip(device_t *device, k054539_state *info)
// One or more of the registers must be the timer period
// And anyway, this particular frequency is probably wrong
// 480 hz is TRUSTED by gokuparo disco stage - the looping sample doesn't line up otherwise
- device->machine->scheduler().timer_pulse(attotime::from_hz(480), FUNC(k054539_irq), 0, info);
+ device->machine().scheduler().timer_pulse(attotime::from_hz(480), FUNC(k054539_irq), 0, info);
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock(), info, k054539_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock(), info, k054539_update);
device->save_item(NAME(info->regs));
device->save_pointer(NAME(info->ram), 0x4000);
@@ -674,7 +674,7 @@ static DEVICE_START( k054539 )
k054539_init_chip(device, info);
- device->machine->state().register_postload(reset_zones, info);
+ device->machine().state().register_postload(reset_zones, info);
}
diff --git a/src/emu/sound/k056800.c b/src/emu/sound/k056800.c
index eb2c671b59d..758303edd11 100644
--- a/src/emu/sound/k056800.c
+++ b/src/emu/sound/k056800.c
@@ -61,7 +61,7 @@ static void k056800_host_reg_w( device_t *device, int reg, UINT8 data )
k056800->sound_reg[reg] = data;
if (reg == 7)
- k056800->irq_cb(device->machine, 1);
+ k056800->irq_cb(device->machine(), 1);
}
static UINT8 k056800_sound_reg_r( device_t *device, int reg )
@@ -146,7 +146,7 @@ static DEVICE_START( k056800 )
k056800->irq_cb = intf->irq_cb;
- k056800->sound_cpu_timer = device->machine->scheduler().timer_alloc(FUNC(k056800_sound_cpu_timer_tick), k056800);
+ k056800->sound_cpu_timer = device->machine().scheduler().timer_alloc(FUNC(k056800_sound_cpu_timer_tick), k056800);
k056800->sound_cpu_timer->adjust(timer_period, 0, timer_period);
device->save_item(NAME(k056800->host_reg));
diff --git a/src/emu/sound/k056800.h b/src/emu/sound/k056800.h
index 57c205b61a7..81afa200ae3 100644
--- a/src/emu/sound/k056800.h
+++ b/src/emu/sound/k056800.h
@@ -14,7 +14,7 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef void (*k056800_irq_cb)(running_machine *, int);
+typedef void (*k056800_irq_cb)(running_machine &, int);
typedef struct _k056800_interface k056800_interface;
diff --git a/src/emu/sound/mas3507d.c b/src/emu/sound/mas3507d.c
index c88a3d4e477..77fa947259d 100644
--- a/src/emu/sound/mas3507d.c
+++ b/src/emu/sound/mas3507d.c
@@ -21,7 +21,7 @@ device_config *mas3507d_device_config::static_alloc_device_config(const machine_
device_t *mas3507d_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, mas3507d_device(machine, *this));
+ return auto_alloc(machine, mas3507d_device(machine, *this));
}
mas3507d_device::mas3507d_device(running_machine &machine, const mas3507d_device_config &_config)
diff --git a/src/emu/sound/mos6560.c b/src/emu/sound/mos6560.c
index 471a4ed193d..061fe8a957a 100644
--- a/src/emu/sound/mos6560.c
+++ b/src/emu/sound/mos6560.c
@@ -145,7 +145,7 @@ INLINE const mos6560_interface *get_interface( device_t *device )
if(VERBOSE_LEVEL >= N) \
{ \
if( M ) \
- logerror("%11.6f: %-24s", device->machine->time().as_double(), (char*) M ); \
+ logerror("%11.6f: %-24s", device->machine().time().as_double(), (char*) M ); \
logerror A; \
} \
} while (0)
@@ -153,9 +153,9 @@ INLINE const mos6560_interface *get_interface( device_t *device )
/* 2008-05 FP: lightpen code needs to read input port from vc20.c */
-#define LIGHTPEN_BUTTON ((mos6560->lightpen_button_cb != NULL) ? mos6560->lightpen_button_cb(device->machine) : 0)
-#define LIGHTPEN_X_VALUE ((mos6560->lightpen_x_cb != NULL) ? mos6560->lightpen_x_cb(device->machine) : 0)
-#define LIGHTPEN_Y_VALUE ((mos6560->lightpen_y_cb != NULL) ? mos6560->lightpen_y_cb(device->machine) : 0)
+#define LIGHTPEN_BUTTON ((mos6560->lightpen_button_cb != NULL) ? mos6560->lightpen_button_cb(device->machine()) : 0)
+#define LIGHTPEN_X_VALUE ((mos6560->lightpen_x_cb != NULL) ? mos6560->lightpen_x_cb(device->machine()) : 0)
+#define LIGHTPEN_Y_VALUE ((mos6560->lightpen_y_cb != NULL) ? mos6560->lightpen_y_cb(device->machine()) : 0)
/* lightpen delivers values from internal counters
* they do not start with the visual area or frame area */
@@ -214,7 +214,7 @@ static void mos6560_draw_character( device_t *device, int ybegin, int yend, int
for (y = ybegin; y <= yend; y++)
{
- code = mos6560->dma_read(device->machine, (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
+ code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 0) = color[code >> 7];
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 1) = color[(code >> 6) & 1];
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 2) = color[(code >> 5) & 1];
@@ -238,7 +238,7 @@ static void mos6560_draw_character_multi( device_t *device, int ybegin, int yend
for (y = ybegin; y <= yend; y++)
{
- code = mos6560->dma_read(device->machine, (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
+ code = mos6560->dma_read(device->machine(), (mos6560->chargenaddr + ch * mos6560->charheight + y) & 0x3fff);
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 0) =
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 1) = color[code >> 6];
*BITMAP_ADDR16(mos6560->bitmap, y + yoff, xoff + 2) =
@@ -298,8 +298,8 @@ static void mos6560_drawlines( device_t *device, int first, int last )
for (xoff = mos6560->xpos; (xoff < mos6560->xpos + mos6560->xsize) && (xoff < mos6560->total_xsize); xoff += 8, offs++)
{
- ch = mos6560->dma_read(device->machine, (mos6560->videoaddr + offs) & 0x3fff);
- attr = (mos6560->dma_read_color(device->machine, (mos6560->videoaddr + offs) & 0x3fff)) & 0xf;
+ ch = mos6560->dma_read(device->machine(), (mos6560->videoaddr + offs) & 0x3fff);
+ attr = (mos6560->dma_read_color(device->machine(), (mos6560->videoaddr + offs) & 0x3fff)) & 0xf;
if (mos6560->type == MOS6560_ATTACKUFO)
{
@@ -460,7 +460,7 @@ READ8_DEVICE_HANDLER( mos6560_port_r )
break;
case 6: /*lightpen horizontal */
case 7: /*lightpen vertical */
- if (LIGHTPEN_BUTTON && ((device->machine->time().as_double() - mos6560->lightpenreadtime) * MOS656X_VRETRACERATE >= 1))
+ if (LIGHTPEN_BUTTON && ((device->machine().time().as_double() - mos6560->lightpenreadtime) * MOS656X_VRETRACERATE >= 1))
{
/* only 1 update each frame */
/* and diode must recognize light */
@@ -469,13 +469,13 @@ READ8_DEVICE_HANDLER( mos6560_port_r )
mos6560->reg[6] = MOS656X_X_VALUE;
mos6560->reg[7] = MOS656X_Y_VALUE;
}
- mos6560->lightpenreadtime = device->machine->time().as_double();
+ mos6560->lightpenreadtime = device->machine().time().as_double();
}
val = mos6560->reg[offset];
break;
case 8: /* poti 1 */
case 9: /* poti 2 */
- val = (mos6560->paddle_cb != NULL) ? mos6560->paddle_cb[offset - 8](device->machine) : mos6560->reg[offset];
+ val = (mos6560->paddle_cb != NULL) ? mos6560->paddle_cb[offset - 8](device->machine()) : mos6560->reg[offset];
break;
default:
val = mos6560->reg[offset];
@@ -587,7 +587,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE1_ON)
{
mos6560->tone1pos = 0;
- mos6560->tone1samples = device->machine->sample_rate() / TONE1_FREQUENCY;
+ mos6560->tone1samples = device->machine().sample_rate() / TONE1_FREQUENCY;
if (!mos6560->tone1samples == 0)
mos6560->tone1samples = 1;
}
@@ -598,7 +598,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE2_ON)
{
mos6560->tone2pos = 0;
- mos6560->tone2samples = device->machine->sample_rate() / TONE2_FREQUENCY;
+ mos6560->tone2samples = device->machine().sample_rate() / TONE2_FREQUENCY;
if (mos6560->tone2samples == 0)
mos6560->tone2samples = 1;
}
@@ -609,7 +609,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
if (!(old & 0x80) && TONE3_ON)
{
mos6560->tone3pos = 0;
- mos6560->tone3samples = device->machine->sample_rate() / TONE3_FREQUENCY;
+ mos6560->tone3samples = device->machine().sample_rate() / TONE3_FREQUENCY;
if (mos6560->tone3samples == 0)
mos6560->tone3samples = 1;
}
@@ -619,7 +619,7 @@ static void mos6560_soundport_w( device_t *device, int offset, int data )
mos6560->reg[offset] = data;
if (NOISE_ON)
{
- mos6560->noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * device->machine->sample_rate()
+ mos6560->noisesamples = (int) ((double) NOISE_FREQUENCY_MAX * device->machine().sample_rate()
* NOISE_BUFFER_SIZE_SEC / NOISE_FREQUENCY);
DBG_LOG (1, "mos6560", ("noise %.2x %d sample:%d\n",
data, NOISE_FREQUENCY, mos6560->noisesamples));
@@ -664,7 +664,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone1pos >= mos6560->tone1samples)
{
mos6560->tone1pos = 0;
- mos6560->tone1samples = device->machine->sample_rate() / TONE1_FREQUENCY;
+ mos6560->tone1samples = device->machine().sample_rate() / TONE1_FREQUENCY;
if (mos6560->tone1samples == 0)
mos6560->tone1samples = 1;
}
@@ -680,7 +680,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone2pos >= mos6560->tone2samples)
{
mos6560->tone2pos = 0;
- mos6560->tone2samples = device->machine->sample_rate() / TONE2_FREQUENCY;
+ mos6560->tone2samples = device->machine().sample_rate() / TONE2_FREQUENCY;
if (mos6560->tone2samples == 0)
mos6560->tone2samples = 1;
}
@@ -696,7 +696,7 @@ static STREAM_UPDATE( mos6560_update )
if (mos6560->tone3pos >= mos6560->tone3samples)
{
mos6560->tone3pos = 0;
- mos6560->tone3samples = device->machine->sample_rate() / TONE3_FREQUENCY;
+ mos6560->tone3samples = device->machine().sample_rate() / TONE3_FREQUENCY;
if (mos6560->tone3samples == 0)
mos6560->tone3samples = 1;
}
@@ -739,11 +739,11 @@ static void mos6560_sound_start( device_t *device )
mos6560_state *mos6560 = get_safe_token(device);
int i;
- mos6560->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, mos6560_update);
+ mos6560->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, mos6560_update);
/* buffer for fastest played sample for 5 second so we have enough data for min 5 second */
mos6560->noisesize = NOISE_FREQUENCY_MAX * NOISE_BUFFER_SIZE_SEC;
- mos6560->noise = auto_alloc_array(device->machine, INT8, mos6560->noisesize);
+ mos6560->noise = auto_alloc_array(device->machine(), INT8, mos6560->noisesize);
{
int noiseshift = 0x7ffff8;
char data;
@@ -774,11 +774,11 @@ static void mos6560_sound_start( device_t *device )
noiseshift <<= 1;
}
}
- mos6560->tonesize = device->machine->sample_rate() / TONE_FREQUENCY_MIN;
+ mos6560->tonesize = device->machine().sample_rate() / TONE_FREQUENCY_MIN;
if (mos6560->tonesize > 0)
{
- mos6560->tone = auto_alloc_array(device->machine, INT16, mos6560->tonesize);
+ mos6560->tone = auto_alloc_array(device->machine(), INT16, mos6560->tonesize);
for (i = 0; i < mos6560->tonesize; i++)
{
@@ -802,13 +802,13 @@ static DEVICE_START( mos6560 )
const mos6560_interface *intf = (mos6560_interface *)device->baseconfig().static_config();
int width, height;
- mos6560->screen = downcast<screen_device *>(device->machine->device(intf->screen));
+ mos6560->screen = downcast<screen_device *>(device->machine().device(intf->screen));
width = mos6560->screen->width();
height = mos6560->screen->height();
mos6560->type = intf->type;
- mos6560->bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED16);
+ mos6560->bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED16);
assert(intf->dma_read != NULL);
assert(intf->dma_read_color != NULL);
diff --git a/src/emu/sound/mos6560.h b/src/emu/sound/mos6560.h
index 7d1e873df3b..fc7d406e0d5 100644
--- a/src/emu/sound/mos6560.h
+++ b/src/emu/sound/mos6560.h
@@ -15,13 +15,13 @@
TYPE DEFINITIONS
***************************************************************************/
-typedef UINT8 (*mos6560_lightpen_x_callback)(running_machine *machine);
-typedef UINT8 (*mos6560_lightpen_y_callback)(running_machine *machine);
-typedef UINT8 (*mos6560_lightpen_button_callback)(running_machine *machine);
-typedef UINT8 (*mos6560_paddle_callback)(running_machine *machine);
+typedef UINT8 (*mos6560_lightpen_x_callback)(running_machine &machine);
+typedef UINT8 (*mos6560_lightpen_y_callback)(running_machine &machine);
+typedef UINT8 (*mos6560_lightpen_button_callback)(running_machine &machine);
+typedef UINT8 (*mos6560_paddle_callback)(running_machine &machine);
-typedef int (*mos6560_dma_read)(running_machine *machine, int);
-typedef int (*mos6560_dma_read_color)(running_machine *machine, int);
+typedef int (*mos6560_dma_read)(running_machine &machine, int);
+typedef int (*mos6560_dma_read_color)(running_machine &machine, int);
typedef enum
diff --git a/src/emu/sound/msm5205.c b/src/emu/sound/msm5205.c
index cf50d6e442d..3414804e91f 100644
--- a/src/emu/sound/msm5205.c
+++ b/src/emu/sound/msm5205.c
@@ -187,8 +187,8 @@ static DEVICE_START( msm5205 )
ComputeTables (voice);
/* stream system initialize */
- voice->stream = device->machine->sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update);
- voice->timer = device->machine->scheduler().timer_alloc(FUNC(MSM5205_vclk_callback), voice);
+ voice->stream = device->machine().sound().stream_alloc(*device,0,1,device->clock(),voice,MSM5205_update);
+ voice->timer = device->machine().scheduler().timer_alloc(FUNC(MSM5205_vclk_callback), voice);
/* initialize */
DEVICE_RESET_CALL(msm5205);
@@ -221,7 +221,7 @@ void msm5205_vclk_w (device_t *device, int vclk)
if( voice->vclk != vclk)
{
voice->vclk = vclk;
- if( !vclk ) MSM5205_vclk_callback(voice->device->machine, voice, 0);
+ if( !vclk ) MSM5205_vclk_callback(voice->device->machine(), voice, 0);
}
}
}
diff --git a/src/emu/sound/msm5232.c b/src/emu/sound/msm5232.c
index f7bcd3378f9..819eff53b7f 100644
--- a/src/emu/sound/msm5232.c
+++ b/src/emu/sound/msm5232.c
@@ -796,10 +796,10 @@ static DEVICE_START( msm5232 )
msm5232_init(chip, intf, device->clock(), rate);
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 11, rate, chip, MSM5232_update_one);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 11, rate, chip, MSM5232_update_one);
/* register with the save state system */
- device->machine->state().register_postload(msm5232_postload, chip);
+ device->machine().state().register_postload(msm5232_postload, chip);
device->save_item(NAME(chip->EN_out16));
device->save_item(NAME(chip->EN_out8));
device->save_item(NAME(chip->EN_out4));
diff --git a/src/emu/sound/multipcm.c b/src/emu/sound/multipcm.c
index a0cff9a46a7..43c7a2b3a2f 100644
--- a/src/emu/sound/multipcm.c
+++ b/src/emu/sound/multipcm.c
@@ -503,7 +503,7 @@ static DEVICE_START( multipcm )
ptChip->ROM=*device->region();
ptChip->Rate=(float) device->clock() / MULTIPCM_CLOCKDIV;
- ptChip->stream = device->machine->sound().stream_alloc(*device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update);
+ ptChip->stream = device->machine().sound().stream_alloc(*device, 0, 2, ptChip->Rate, ptChip, MultiPCM_update);
//Volume+pan table
for(i=0;i<0x800;++i)
diff --git a/src/emu/sound/n63701x.c b/src/emu/sound/n63701x.c
index 9c33e396ee2..0c0faae0b1b 100644
--- a/src/emu/sound/n63701x.c
+++ b/src/emu/sound/n63701x.c
@@ -114,7 +114,7 @@ static DEVICE_START( namco_63701x )
chip->rom = *device->region();
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/1000, chip, namco_63701x_update);
}
diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c
index 8d60b93aa2d..eae14998f21 100644
--- a/src/emu/sound/namco.c
+++ b/src/emu/sound/namco.c
@@ -112,7 +112,7 @@ static void update_namco_waveform(namco_sound *chip, int offset, UINT8 data)
/* build the decoded waveform table */
-static void build_decoded_waveform(running_machine *machine, namco_sound *chip, UINT8 *rgnbase)
+static void build_decoded_waveform(running_machine &machine, namco_sound *chip, UINT8 *rgnbase)
{
INT16 *p;
int size;
@@ -369,7 +369,7 @@ static DEVICE_START( namco )
chip->last_channel = chip->channel_list + chip->num_voices;
chip->stereo = intf->stereo;
- chip->soundregs = auto_alloc_array_clear(device->machine, UINT8, 0x400);
+ chip->soundregs = auto_alloc_array_clear(device->machine(), UINT8, 0x400);
/* adjust internal clock */
chip->namco_clock = device->clock();
@@ -384,13 +384,13 @@ static DEVICE_START( namco )
logerror("Namco: freq fractional bits = %d: internal freq = %d, output freq = %d\n", chip->f_fracbits, chip->namco_clock, chip->sample_rate);
/* build the waveform table */
- build_decoded_waveform(device->machine, chip, *device->region());
+ build_decoded_waveform(device->machine(), chip, *device->region());
/* get stream channels */
if (intf->stereo)
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, chip->sample_rate, chip, namco_update_stereo);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, chip->sample_rate, chip, namco_update_stereo);
else
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, namco_update_mono);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, namco_update_mono);
/* start with sound enabled, many games don't have a sound enable register */
chip->sound_enable = 1;
diff --git a/src/emu/sound/nes_apu.c b/src/emu/sound/nes_apu.c
index c95a9672691..f7c37cae2fa 100644
--- a/src/emu/sound/nes_apu.c
+++ b/src/emu/sound/nes_apu.c
@@ -690,9 +690,9 @@ static DEVICE_START( nesapu )
int i;
/* Initialize global variables */
- info->samps_per_sync = rate / ATTOSECONDS_TO_HZ(device->machine->primary_screen->frame_period().attoseconds);
+ info->samps_per_sync = rate / ATTOSECONDS_TO_HZ(device->machine().primary_screen->frame_period().attoseconds);
info->buffer_size = info->samps_per_sync;
- info->real_rate = info->samps_per_sync * ATTOSECONDS_TO_HZ(device->machine->primary_screen->frame_period().attoseconds);
+ info->real_rate = info->samps_per_sync * ATTOSECONDS_TO_HZ(device->machine().primary_screen->frame_period().attoseconds);
info->apu_incsize = (float) (device->clock() / (float) info->real_rate);
/* Use initializer calls */
@@ -704,9 +704,9 @@ static DEVICE_START( nesapu )
info->buffer_size+=info->samps_per_sync;
/* Initialize individual chips */
- (info->APU.dpcm).memory = device->machine->device(intf->cpu_tag)->memory().space(AS_PROGRAM);
+ (info->APU.dpcm).memory = device->machine().device(intf->cpu_tag)->memory().space(AS_PROGRAM);
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, rate, info, nes_psg_update_sound);
/* register for save */
for (i = 0; i < 2; i++)
diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c
index 54132196ebc..f2eb959bafb 100644
--- a/src/emu/sound/nile.c
+++ b/src/emu/sound/nile.c
@@ -227,7 +227,7 @@ static DEVICE_START( nile )
info->sound_ram = *device->region();
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, nile_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, nile_update);
}
diff --git a/src/emu/sound/okim6258.c b/src/emu/sound/okim6258.c
index 1bff117eaf2..15dd49a9eb1 100644
--- a/src/emu/sound/okim6258.c
+++ b/src/emu/sound/okim6258.c
@@ -201,7 +201,7 @@ static DEVICE_START( okim6258 )
info->output_bits = intf->output_12bits ? 12 : 10;
info->divider = dividers[intf->divider];
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/info->divider, info, okim6258_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/info->divider, info, okim6258_update);
info->signal = -2;
info->step = 0;
diff --git a/src/emu/sound/okim6295.c b/src/emu/sound/okim6295.c
index 1b765f31f50..af27711b7d3 100644
--- a/src/emu/sound/okim6295.c
+++ b/src/emu/sound/okim6295.c
@@ -115,7 +115,7 @@ device_config *okim6295_device_config::static_alloc_device_config(const machine_
device_t *okim6295_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, okim6295_device(machine, *this));
+ return auto_alloc(machine, okim6295_device(machine, *this));
}
@@ -266,7 +266,7 @@ void okim6295_device::set_bank_base(offs_t base)
if (m_bank_installed)
{
m_bank_offs = base;
- memory_set_bankptr(&m_machine, tag(), m_region->base() + base);
+ memory_set_bankptr(m_machine, tag(), m_region->base() + base);
}
}
diff --git a/src/emu/sound/okim6376.c b/src/emu/sound/okim6376.c
index fcfda3f9ba9..c1ac5f5eb92 100644
--- a/src/emu/sound/okim6376.c
+++ b/src/emu/sound/okim6376.c
@@ -306,7 +306,7 @@ static DEVICE_START( okim6376 )
info->master_clock = device->clock();
/* generate the name and create the stream */
- info->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/divisor, info, okim6376_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/divisor, info, okim6376_update);
/* initialize the voices */
for (voice = 0; voice < OKIM6376_VOICES; voice++)
diff --git a/src/emu/sound/okim9810.c b/src/emu/sound/okim9810.c
index ffbf37a39f2..095c811f9ad 100644
--- a/src/emu/sound/okim9810.c
+++ b/src/emu/sound/okim9810.c
@@ -101,7 +101,7 @@ device_config *okim9810_device_config::static_alloc_device_config(const machine_
device_t *okim9810_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, okim9810_device(machine, *this));
+ return auto_alloc(machine, okim9810_device(machine, *this));
}
diff --git a/src/emu/sound/pokey.c b/src/emu/sound/pokey.c
index 54f15f94d88..d63278331d4 100644
--- a/src/emu/sound/pokey.c
+++ b/src/emu/sound/pokey.c
@@ -648,15 +648,15 @@ static DEVICE_START( pokey )
chip->clockmult = DIV_64;
chip->KBCODE = 0x09; /* Atari 800 'no key' */
chip->SKCTL = SK_RESET; /* let the RNG run after reset */
- chip->rtimer = device->machine->scheduler().timer_alloc(FUNC(NULL));
+ chip->rtimer = device->machine().scheduler().timer_alloc(FUNC(NULL));
- chip->timer[0] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
- chip->timer[1] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
- chip->timer[2] = device->machine->scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
+ chip->timer[0] = device->machine().scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
+ chip->timer[1] = device->machine().scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
+ chip->timer[2] = device->machine().scheduler().timer_alloc(FUNC(pokey_timer_expire), chip);
for (i=0; i<8; i++)
{
- chip->ptimer[i] = device->machine->scheduler().timer_alloc(FUNC(pokey_pot_trigger), chip);
+ chip->ptimer[i] = device->machine().scheduler().timer_alloc(FUNC(pokey_pot_trigger), chip);
devcb_resolve_read8(&chip->pot_r[i], &chip->intf.pot_r[i], device);
}
devcb_resolve_read8(&chip->allpot_r, &chip->intf.allpot_r, device);
@@ -664,7 +664,7 @@ static DEVICE_START( pokey )
devcb_resolve_write8(&chip->serout_w, &chip->intf.serout_w, device);
chip->interrupt_cb = chip->intf.interrupt_cb;
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, chip, pokey_update);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, sample_rate, chip, pokey_update);
register_for_save(chip, device);
}
@@ -843,7 +843,7 @@ READ8_DEVICE_HANDLER( pokey_r )
}
}
else
- logerror("%s: warning - read '%s' POT%d\n", p->device->machine->describe_context(), p->device->tag(), pot);
+ logerror("%s: warning - read '%s' POT%d\n", p->device->machine().describe_context(), p->device->tag(), pot);
break;
case ALLPOT_C:
@@ -943,7 +943,7 @@ READ8_HANDLER( quad_pokey_r )
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
- return pokey_r(space->machine->device(devname[pokey_num]), pokey_reg);
+ return pokey_r(space->machine().device(devname[pokey_num]), pokey_reg);
}
@@ -1138,9 +1138,9 @@ WRITE8_DEVICE_HANDLER( pokey_w )
* loaders from Ballblazer and Escape from Fractalus
* The real times are unknown
*/
- device->machine->scheduler().timer_set(attotime::from_usec(200), FUNC(pokey_serout_ready_cb), 0, p);
+ device->machine().scheduler().timer_set(attotime::from_usec(200), FUNC(pokey_serout_ready_cb), 0, p);
/* 10 bits (assumption 1 start, 8 data and 1 stop bit) take how long? */
- device->machine->scheduler().timer_set(attotime::from_usec(2000), FUNC(pokey_serout_complete), 0, p);
+ device->machine().scheduler().timer_set(attotime::from_usec(2000), FUNC(pokey_serout_complete), 0, p);
break;
case IRQEN_C:
@@ -1329,13 +1329,13 @@ WRITE8_HANDLER( quad_pokey_w )
int control = (offset & 0x20) >> 2;
int pokey_reg = (offset % 8) | control;
- pokey_w(space->machine->device(devname[pokey_num]), pokey_reg, data);
+ pokey_w(space->machine().device(devname[pokey_num]), pokey_reg, data);
}
void pokey_serin_ready(device_t *device, int after)
{
pokey_state *p = get_safe_token(device);
- device->machine->scheduler().timer_set(p->clock_period * after, FUNC(pokey_serin_ready_cb), 0, p);
+ device->machine().scheduler().timer_set(p->clock_period * after, FUNC(pokey_serin_ready_cb), 0, p);
}
void pokey_break_w(device_t *device, int shift)
diff --git a/src/emu/sound/qsound.c b/src/emu/sound/qsound.c
index af1222395d9..cc08776aca6 100644
--- a/src/emu/sound/qsound.c
+++ b/src/emu/sound/qsound.c
@@ -123,7 +123,7 @@ static DEVICE_START( qsound )
{
/* Allocate stream */
- chip->stream = device->machine->sound().stream_alloc(
+ chip->stream = device->machine().sound().stream_alloc(
*device, 0, 2,
device->clock() / QSOUND_CLOCKDIV,
chip,
@@ -187,7 +187,7 @@ WRITE8_DEVICE_HANDLER( qsound_w )
break;
default:
- logerror("%s: unexpected qsound write to offset %d == %02X\n", device->machine->describe_context(), offset, data);
+ logerror("%s: unexpected qsound write to offset %d == %02X\n", device->machine().describe_context(), offset, data);
break;
}
}
diff --git a/src/emu/sound/rf5c400.c b/src/emu/sound/rf5c400.c
index e7c12f73d1e..65ff5be839f 100644
--- a/src/emu/sound/rf5c400.c
+++ b/src/emu/sound/rf5c400.c
@@ -264,7 +264,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
double r;
// attack
- r = 1.0 / (ENV_AR_SPEED * device->machine->sample_rate());
+ r = 1.0 / (ENV_AR_SPEED * device->machine().sample_rate());
for (i = 0; i < ENV_MIN_AR; i++)
{
info->env_ar_table[i] = 1.0;
@@ -280,7 +280,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
}
// decay
- r = -1.0 / (ENV_DR_SPEED * device->machine->sample_rate());
+ r = -1.0 / (ENV_DR_SPEED * device->machine().sample_rate());
for (i = 0; i < ENV_MIN_DR; i++)
{
info->env_dr_table[i] = r;
@@ -296,7 +296,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
}
// release
- r = -1.0 / (ENV_RR_SPEED * device->machine->sample_rate());
+ r = -1.0 / (ENV_RR_SPEED * device->machine().sample_rate());
for (i = 0; i < ENV_MIN_RR; i++)
{
info->env_rr_table[i] = r;
@@ -345,7 +345,7 @@ static void rf5c400_init_chip(device_t *device, rf5c400_state *info)
device->save_item(NAME(info->channels[i].env_scale), i);
}
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/384, info, rf5c400_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/384, info, rf5c400_update);
}
@@ -448,11 +448,11 @@ WRITE16_DEVICE_HANDLER( rf5c400_w )
default:
{
- //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", device->machine->describe_context(), data, offset, mem_mask);
+ //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X\n", device->machine().describe_context(), data, offset, mem_mask);
break;
}
}
- //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", device->machine->describe_context(), data, offset, mem_mask);
+ //mame_printf_debug("%s:rf5c400_w: %08X, %08X, %08X at %08X\n", device->machine().describe_context(), data, offset, mem_mask);
}
else
{
diff --git a/src/emu/sound/rf5c68.c b/src/emu/sound/rf5c68.c
index ba756d0ec56..56f60f4e7a7 100644
--- a/src/emu/sound/rf5c68.c
+++ b/src/emu/sound/rf5c68.c
@@ -145,7 +145,7 @@ static DEVICE_START( rf5c68 )
rf5c68_state *chip = get_safe_token(device);
/* allocate the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 384, chip, rf5c68_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 384, chip, rf5c68_update);
chip->device = device;
diff --git a/src/emu/sound/s14001a.c b/src/emu/sound/s14001a.c
index d2d9741b658..902d644e81c 100644
--- a/src/emu/sound/s14001a.c
+++ b/src/emu/sound/s14001a.c
@@ -592,7 +592,7 @@ static DEVICE_START( s14001a )
chip->SpeechRom = *device->region();
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine->sample_rate(), chip, s14001a_pcm_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() ? device->clock() : device->machine().sample_rate(), chip, s14001a_pcm_update);
}
int s14001a_bsy_r(device_t *device)
diff --git a/src/emu/sound/s2636.c b/src/emu/sound/s2636.c
index 36c5c29a519..baeb1b7f487 100644
--- a/src/emu/sound/s2636.c
+++ b/src/emu/sound/s2636.c
@@ -38,7 +38,7 @@ void s2636_soundport_w (device_t *device, int offset, int data)
token->pos = 0;
token->level = TRUE;
// frequency 7874/(data+1)
- token->size = device->machine->sample_rate() * (data + 1) /7874;
+ token->size = device->machine().sample_rate() * (data + 1) /7874;
break;
}
}
@@ -79,7 +79,7 @@ static DEVICE_START(s2636_sound)
{
s2636_sound *token = get_token(device);
memset(token, 0, sizeof(*token));
- token->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, s2636_update);
+ token->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, s2636_update);
}
diff --git a/src/emu/sound/saa1099.c b/src/emu/sound/saa1099.c
index 19054f55327..f93f1639247 100644
--- a/src/emu/sound/saa1099.c
+++ b/src/emu/sound/saa1099.c
@@ -327,7 +327,7 @@ static DEVICE_START( saa1099 )
saa->sample_rate = device->clock() / 256;
/* for each chip allocate one stream */
- saa->stream = device->machine->sound().stream_alloc(*device, 0, 2, saa->sample_rate, saa, saa1099_update);
+ saa->stream = device->machine().sound().stream_alloc(*device, 0, 2, saa->sample_rate, saa, saa1099_update);
}
WRITE8_DEVICE_HANDLER( saa1099_control_w )
@@ -337,7 +337,7 @@ WRITE8_DEVICE_HANDLER( saa1099_control_w )
if ((data & 0xff) > 0x1c)
{
/* Error! */
- logerror("%s: (SAA1099 '%s') Unknown register selected\n",device->machine->describe_context(), device->tag());
+ logerror("%s: (SAA1099 '%s') Unknown register selected\n",device->machine().describe_context(), device->tag());
}
saa->selected_reg = data & 0x1f;
@@ -423,7 +423,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
int i;
/* Synch & Reset generators */
- logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",device->machine->describe_context(), device->tag());
+ logerror("%s: (SAA1099 '%s') -reg 0x1c- Chip reset\n",device->machine().describe_context(), device->tag());
for (i = 0; i < 6; i++)
{
saa->channels[i].level = 0;
@@ -432,7 +432,7 @@ WRITE8_DEVICE_HANDLER( saa1099_data_w )
}
break;
default: /* Error! */
- logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",device->machine->describe_context(), device->tag(), reg, data);
+ logerror("%s: (SAA1099 '%s') Unknown operation (reg:%02x, data:%02x)\n",device->machine().describe_context(), device->tag(), reg, data);
}
}
diff --git a/src/emu/sound/samples.c b/src/emu/sound/samples.c
index 2d76933a3ed..1052cbfbcfb 100644
--- a/src/emu/sound/samples.c
+++ b/src/emu/sound/samples.c
@@ -48,7 +48,7 @@ INLINE samples_info *get_safe_token(device_t *device)
read_wav_sample - read a WAV file as a sample
-------------------------------------------------*/
-static int read_wav_sample(running_machine *machine, emu_file &file, loaded_sample *sample)
+static int read_wav_sample(running_machine &machine, emu_file &file, loaded_sample *sample)
{
unsigned long offset = 0;
UINT32 length, rate, filesize;
@@ -177,14 +177,14 @@ static int read_wav_sample(running_machine *machine, emu_file &file, loaded_samp
readsamples - load all samples
-------------------------------------------------*/
-loaded_samples *readsamples(running_machine *machine, const char *const *samplenames, const char *basename)
+loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *basename)
{
loaded_samples *samples;
int skipfirst = 0;
int i;
/* if the user doesn't want to use samples, bail */
- if (!machine->options().samples())
+ if (!machine.options().samples())
return NULL;
if (samplenames == 0 || samplenames[0] == 0)
return NULL;
@@ -206,7 +206,7 @@ loaded_samples *readsamples(running_machine *machine, const char *const *samplen
for (i = 0; i < samples->total; i++)
if (samplenames[i+skipfirst][0])
{
- emu_file file(machine->options().sample_path(), OPEN_FLAG_READ);
+ emu_file file(machine.options().sample_path(), OPEN_FLAG_READ);
file_error filerr = file.open(basename, PATH_SEPARATOR, samplenames[i+skipfirst]);
if (filerr != FILERR_NONE && skipfirst)
@@ -251,7 +251,7 @@ void sample_start(device_t *device,int channel,int samplenum,int loop)
chan->pos = 0;
chan->frac = 0;
chan->basefreq = sample->frequency;
- chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate();
+ chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate();
chan->loop = loop;
}
@@ -275,7 +275,7 @@ void sample_start_raw(device_t *device,int channel,const INT16 *sampledata,int s
chan->pos = 0;
chan->frac = 0;
chan->basefreq = frequency;
- chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine->sample_rate();
+ chan->step = ((INT64)chan->basefreq << FRAC_BITS) / info->device->machine().sample_rate();
chan->loop = loop;
}
@@ -292,7 +292,7 @@ void sample_set_freq(device_t *device,int channel,int freq)
/* force an update before we start */
chan->stream->update();
- chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine->sample_rate();
+ chan->step = ((INT64)freq << FRAC_BITS) / info->device->machine().sample_rate();
}
@@ -468,15 +468,15 @@ static DEVICE_START( samples )
/* read audio samples */
if (intf->samplenames)
- info->samples = readsamples(device->machine, intf->samplenames,device->machine->system().name);
+ info->samples = readsamples(device->machine(), intf->samplenames,device->machine().system().name);
/* allocate channels */
info->numchannels = intf->channels;
assert(info->numchannels < MAX_CHANNELS);
- info->channel = auto_alloc_array(device->machine, sample_channel, info->numchannels);
+ info->channel = auto_alloc_array(device->machine(), sample_channel, info->numchannels);
for (i = 0; i < info->numchannels; i++)
{
- info->channel[i].stream = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), &info->channel[i], sample_update_sound);
+ info->channel[i].stream = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), &info->channel[i], sample_update_sound);
info->channel[i].source = NULL;
info->channel[i].source_num = -1;
@@ -493,7 +493,7 @@ static DEVICE_START( samples )
device->save_item(NAME(info->channel[i].loop), i);
device->save_item(NAME(info->channel[i].paused), i);
}
- device->machine->state().register_postload(samples_postload, info);
+ device->machine().state().register_postload(samples_postload, info);
/* initialize any custom handlers */
if (intf->start)
diff --git a/src/emu/sound/samples.h b/src/emu/sound/samples.h
index 018296aec08..0d44d994c2f 100644
--- a/src/emu/sound/samples.h
+++ b/src/emu/sound/samples.h
@@ -42,7 +42,7 @@ int sample_playing(device_t *device,int channel);
/* helper function that reads samples from disk - this can be used by other */
/* drivers as well (e.g. a sound chip emulator needing drum samples) */
-loaded_samples *readsamples(running_machine *machine, const char *const *samplenames, const char *name);
+loaded_samples *readsamples(running_machine &machine, const char *const *samplenames, const char *name);
DECLARE_LEGACY_SOUND_DEVICE(SAMPLES, samples);
diff --git a/src/emu/sound/scsp.c b/src/emu/sound/scsp.c
index 7e92f3eca8d..486f473ee33 100644
--- a/src/emu/sound/scsp.c
+++ b/src/emu/sound/scsp.c
@@ -547,9 +547,9 @@ static void SCSP_Init(device_t *device, scsp_state *scsp, const scsp_interface *
scsp->SCSPRAM += intf->roffset;
}
- scsp->timerA = device->machine->scheduler().timer_alloc(FUNC(timerA_cb), scsp);
- scsp->timerB = device->machine->scheduler().timer_alloc(FUNC(timerB_cb), scsp);
- scsp->timerC = device->machine->scheduler().timer_alloc(FUNC(timerC_cb), scsp);
+ scsp->timerA = device->machine().scheduler().timer_alloc(FUNC(timerA_cb), scsp);
+ scsp->timerB = device->machine().scheduler().timer_alloc(FUNC(timerB_cb), scsp);
+ scsp->timerC = device->machine().scheduler().timer_alloc(FUNC(timerC_cb), scsp);
for(i=0;i<0x400;++i)
{
@@ -639,9 +639,9 @@ static void SCSP_Init(device_t *device, scsp_state *scsp, const scsp_interface *
scsp->Slots[i].EG.state=RELEASE;
}
- LFO_Init(device->machine);
- scsp->buffertmpl=auto_alloc_array_clear(device->machine, signed int, 44100);
- scsp->buffertmpr=auto_alloc_array_clear(device->machine, signed int, 44100);
+ LFO_Init(device->machine());
+ scsp->buffertmpl=auto_alloc_array_clear(device->machine(), signed int, 44100);
+ scsp->buffertmpr=auto_alloc_array_clear(device->machine(), signed int, 44100);
// no "pend"
scsp->udata.data[0x20/2] = 0;
@@ -696,7 +696,7 @@ static void SCSP_UpdateSlotReg(scsp_state *scsp,int s,int r)
static void SCSP_UpdateReg(scsp_state *scsp, int reg)
{
/* temporary hack until this is converted to a device */
- address_space *space = scsp->device->machine->firstcpu->memory().space(AS_PROGRAM);
+ address_space *space = scsp->device->machine().firstcpu->memory().space(AS_PROGRAM);
switch(reg&0x3f)
{
case 0x2:
@@ -716,7 +716,7 @@ static void SCSP_UpdateReg(scsp_state *scsp, int reg)
break;
case 0x6:
case 0x7:
- scsp_midi_in(space->machine->device("scsp"), 0, scsp->udata.data[0x6/2]&0xff, 0);
+ scsp_midi_in(space->machine().device("scsp"), 0, scsp->udata.data[0x6/2]&0xff, 0);
break;
case 0x12:
case 0x13:
@@ -1214,7 +1214,7 @@ static void dma_scsp(address_space *space, scsp_state *scsp)
/*Job done,request a dma end irq*/
if(scsp_regs[0x1e/2] & 0x10)
- device_set_input_line(space->machine->device("audiocpu"),dma_transfer_end,HOLD_LINE);
+ device_set_input_line(space->machine().device("audiocpu"),dma_transfer_end,HOLD_LINE);
}
#ifdef UNUSED_FUNCTION
@@ -1249,7 +1249,7 @@ static DEVICE_START( scsp )
{
scsp->Int68kCB = intf->irq_callback;
- scsp->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, scsp, SCSP_Update);
+ scsp->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, scsp, SCSP_Update);
}
}
@@ -1318,7 +1318,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
scsp->scsp_dtlg = scsp_regs[0x416/2] & 0x0ffe;
if(scsp_dexe)
{
- dma_scsp(device->machine->firstcpu->memory().space(AS_PROGRAM), scsp);
+ dma_scsp(device->machine().firstcpu->memory().space(AS_PROGRAM), scsp);
scsp_regs[0x416/2]^=0x1000;//disable starting bit
}
break;
@@ -1326,7 +1326,7 @@ WRITE16_DEVICE_HANDLER( scsp_w )
case 0x42a:
if(stv_scu && !(stv_scu[40] & 0x40) /*&& scsp_regs[0x42c/2] & 0x20*/)/*Main CPU allow sound irq*/
{
- device_set_input_line_and_vector(device->machine->firstcpu, 9, HOLD_LINE , 0x46);
+ device_set_input_line_and_vector(device->machine().firstcpu, 9, HOLD_LINE , 0x46);
logerror("SCSP: Main CPU interrupt\n");
}
break;
diff --git a/src/emu/sound/scsplfo.c b/src/emu/sound/scsplfo.c
index 2609a612524..ca658d1d4ec 100644
--- a/src/emu/sound/scsplfo.c
+++ b/src/emu/sound/scsplfo.c
@@ -38,7 +38,7 @@ static const float PSCALE[8]={0.0f,7.0f,13.5f,27.0f,55.0f,112.0f,230.0f,494.0f};
static int PSCALES[8][256];
static int ASCALES[8][256];
-static void LFO_Init(running_machine *machine)
+static void LFO_Init(running_machine &machine)
{
int i,s;
for(i=0;i<256;++i)
@@ -86,7 +86,7 @@ static void LFO_Init(running_machine *machine)
//noise
//a=lfo_noise[i];
- a=machine->rand()&0xff;
+ a=machine.rand()&0xff;
p=128-a;
ALFO_NOI[i]=a;
PLFO_NOI[i]=p;
diff --git a/src/emu/sound/segapcm.c b/src/emu/sound/segapcm.c
index c7edc760ef6..4df96f9d9b6 100644
--- a/src/emu/sound/segapcm.c
+++ b/src/emu/sound/segapcm.c
@@ -109,7 +109,7 @@ static DEVICE_START( segapcm )
segapcm_state *spcm = get_safe_token(device);
spcm->rom = *device->region();
- spcm->ram = auto_alloc_array(device->machine, UINT8, 0x800);
+ spcm->ram = auto_alloc_array(device->machine(), UINT8, 0x800);
memset(spcm->ram, 0xff, 0x800);
@@ -127,7 +127,7 @@ static DEVICE_START( segapcm )
spcm->bankmask = mask & (rom_mask >> spcm->bankshift);
- spcm->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 128, spcm, SEGAPCM_update);
+ spcm->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 128, spcm, SEGAPCM_update);
device->save_item(NAME(spcm->low));
device->save_pointer(NAME(spcm->ram), 0x800);
diff --git a/src/emu/sound/sid.c b/src/emu/sound/sid.c
index 8aca0f283eb..5f35e04d8ba 100644
--- a/src/emu/sound/sid.c
+++ b/src/emu/sound/sid.c
@@ -149,9 +149,9 @@ int sidEmuReset(_SID6581 *This)
}
-static void filterTableInit(running_machine *machine)
+static void filterTableInit(running_machine &machine)
{
- int sample_rate = machine->sample_rate();
+ int sample_rate = machine.sample_rate();
UINT16 uk;
/* Parameter calculation has not been moved to a separate function */
/* by purpose. */
@@ -233,8 +233,8 @@ void sid6581_init (_SID6581 *This)
This->filter.Enabled = TRUE;
- sidInitMixerEngine(This->device->machine);
- filterTableInit(This->device->machine);
+ sidInitMixerEngine(This->device->machine());
+ filterTableInit(This->device->machine());
sidInitWaveformTables(This->type);
@@ -323,7 +323,7 @@ void sid6581_port_w (_SID6581 *This, int offset, int data)
}
}
-int sid6581_port_r (running_machine *machine, _SID6581 *This, int offset)
+int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset)
{
int data;
/* SIDPLAY reads last written at a sid address value */
diff --git a/src/emu/sound/sid.h b/src/emu/sound/sid.h
index df512edda13..e8c4e1bfe04 100644
--- a/src/emu/sound/sid.h
+++ b/src/emu/sound/sid.h
@@ -58,7 +58,7 @@ void sid6581_init (_SID6581 *This);
int sidEmuReset(_SID6581 *This);
-int sid6581_port_r (running_machine *machine, _SID6581 *This, int offset);
+int sid6581_port_r (running_machine &machine, _SID6581 *This, int offset);
void sid6581_port_w (_SID6581 *This, int offset, int data);
void sidEmuFillBuffer(_SID6581 *This, stream_sample_t *buffer, UINT32 bufferLen );
diff --git a/src/emu/sound/sid6581.c b/src/emu/sound/sid6581.c
index 6596df42d6e..49b99579078 100644
--- a/src/emu/sound/sid6581.c
+++ b/src/emu/sound/sid6581.c
@@ -35,8 +35,8 @@ static void sid_start(device_t *device, SIDTYPE sidtype)
const sid6581_interface *iface = (const sid6581_interface*) device->baseconfig().static_config();
sid->device = device;
- sid->mixer_channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), (void *) sid, sid_update);
- sid->PCMfreq = device->machine->sample_rate();
+ sid->mixer_channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *) sid, sid_update);
+ sid->PCMfreq = device->machine().sample_rate();
sid->clock = device->clock();
sid->ad_read = iface ? iface->ad_read : NULL;
sid->type = sidtype;
@@ -71,7 +71,7 @@ static DEVICE_START( sid8580 )
READ8_DEVICE_HANDLER ( sid6581_r )
{
- return sid6581_port_r(device->machine, get_sid(device), offset);
+ return sid6581_port_r(device->machine(), get_sid(device), offset);
}
diff --git a/src/emu/sound/sidvoice.c b/src/emu/sound/sidvoice.c
index 32387b569bc..59da4ed3ba6 100644
--- a/src/emu/sound/sidvoice.c
+++ b/src/emu/sound/sidvoice.c
@@ -25,7 +25,7 @@ static INT8* ampMod1x8;
static const UINT32 noiseSeed = 0x7ffff8;
-void sidInitMixerEngine(running_machine *machine)
+void sidInitMixerEngine(running_machine &machine)
{
UINT16 uk;
INT32 si, sj ;
diff --git a/src/emu/sound/sidvoice.h b/src/emu/sound/sidvoice.h
index fbf1fd00369..58e6ca856b5 100644
--- a/src/emu/sound/sidvoice.h
+++ b/src/emu/sound/sidvoice.h
@@ -106,7 +106,7 @@ void sidEmuSet2(sidOperator* pVoice);
INT8 sidWaveCalcNormal(sidOperator* pVoice);
void sidInitWaveformTables(SIDTYPE type);
-void sidInitMixerEngine(running_machine *machine);
+void sidInitMixerEngine(running_machine &machine);
#if 0
extern ptr2sidVoidFunc sid6581ModeNormalTable[16];
diff --git a/src/emu/sound/sn76477.c b/src/emu/sound/sn76477.c
index 15852105526..1c62f699fa9 100644
--- a/src/emu/sound/sn76477.c
+++ b/src/emu/sound/sn76477.c
@@ -253,7 +253,7 @@ struct _sn76477_state
/* others */
sound_stream *channel; /* returned by stream_create() */
- int sample_rate; /* from machine->sample_rate() */
+ int sample_rate; /* from machine.sample_rate() */
device_t *device;
wav_file *file; /* handle of the wave file to produce */
@@ -1988,13 +1988,13 @@ static STREAM_UPDATE( SN76477_update )
#if TEST_MODE
- static int recursing = 0; /* we need to prevent recursion since enable_w calls input_code_pressed_once(device->machine, KEYCODE_SPACE->update */
+ static int recursing = 0; /* we need to prevent recursion since enable_w calls input_code_pressed_once(device->machine(), KEYCODE_SPACE->update */
if () && !recursing)
{
recursing = 1;
- device->machine->sound().system_enable();
+ device->machine().sound().system_enable();
SN76477_test_enable_w(sn, !sn->enable);
}
@@ -2406,7 +2406,7 @@ static DEVICE_START( sn76477 )
sn->device = device;
- sn->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), sn, SN76477_update);
+ sn->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), sn, SN76477_update);
if (device->clock() > 0)
{
@@ -2414,7 +2414,7 @@ static DEVICE_START( sn76477 )
}
else
{
- sn->sample_rate = device->machine->sample_rate();
+ sn->sample_rate = device->machine().sample_rate();
}
intialize_noise(sn);
diff --git a/src/emu/sound/sn76496.c b/src/emu/sound/sn76496.c
index e3d66fbed62..826f4e7866a 100644
--- a/src/emu/sound/sn76496.c
+++ b/src/emu/sound/sn76496.c
@@ -360,7 +360,7 @@ static int SN76496_init(device_t *device, sn76496_state *R, int stereo)
int sample_rate = device->clock()/2;
int i;
- R->Channel = device->machine->sound().stream_alloc(*device,0,(stereo?2:1),sample_rate,R,SN76496Update);
+ R->Channel = device->machine().sound().stream_alloc(*device,0,(stereo?2:1),sample_rate,R,SN76496Update);
for (i = 0;i < 4;i++) R->Volume[i] = 0;
diff --git a/src/emu/sound/snkwave.c b/src/emu/sound/snkwave.c
index b2ccc46b1f7..20efad91663 100644
--- a/src/emu/sound/snkwave.c
+++ b/src/emu/sound/snkwave.c
@@ -119,7 +119,7 @@ static DEVICE_START( snkwave )
chip->sample_rate = chip->external_clock >> CLOCK_SHIFT;
/* get stream channels */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, snkwave_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 1, chip->sample_rate, chip, snkwave_update);
/* reset all the voices */
chip->frequency = 0;
diff --git a/src/emu/sound/sp0250.c b/src/emu/sound/sp0250.c
index fb6110eb67e..9c5f6367869 100644
--- a/src/emu/sound/sp0250.c
+++ b/src/emu/sound/sp0250.c
@@ -208,10 +208,10 @@ static DEVICE_START( sp0250 )
if (sp->drq != NULL)
{
sp->drq(sp->device, ASSERT_LINE);
- device->machine->scheduler().timer_pulse(attotime::from_hz(device->clock()) * CLOCK_DIVIDER, FUNC(sp0250_timer_tick), 0, sp);
+ device->machine().scheduler().timer_pulse(attotime::from_hz(device->clock()) * CLOCK_DIVIDER, FUNC(sp0250_timer_tick), 0, sp);
}
- sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update);
+ sp->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0250_update);
}
@@ -226,7 +226,7 @@ WRITE8_DEVICE_HANDLER( sp0250_w )
sp->drq(sp->device, CLEAR_LINE);
}
else
- logerror("%s: overflow SP0250 FIFO\n", device->machine->describe_context());
+ logerror("%s: overflow SP0250 FIFO\n", device->machine().describe_context());
}
diff --git a/src/emu/sound/sp0256.c b/src/emu/sound/sp0256.c
index 7481c9d48e9..914a601a9e5 100644
--- a/src/emu/sound/sp0256.c
+++ b/src/emu/sound/sp0256.c
@@ -1186,7 +1186,7 @@ static DEVICE_START( sp0256 )
devcb_call_write_line(&sp->drq, 1);
devcb_call_write_line(&sp->sby, 1);
- sp->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0256_update);
+ sp->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, sp, sp0256_update);
/* -------------------------------------------------------------------- */
/* Configure our internal variables. */
@@ -1196,7 +1196,7 @@ static DEVICE_START( sp0256 )
/* -------------------------------------------------------------------- */
/* Allocate a scratch buffer for generating ~10kHz samples. */
/* -------------------------------------------------------------------- */
- sp->scratch = auto_alloc_array(device->machine, INT16, SCBUF_SIZE);
+ sp->scratch = auto_alloc_array(device->machine(), INT16, SCBUF_SIZE);
sp->sc_head = sp->sc_tail = 0;
/* -------------------------------------------------------------------- */
diff --git a/src/emu/sound/speaker.c b/src/emu/sound/speaker.c
index fd43eade776..54f13bfa9f2 100644
--- a/src/emu/sound/speaker.c
+++ b/src/emu/sound/speaker.c
@@ -140,7 +140,7 @@ static DEVICE_START( speaker )
int i;
double x;
- sp->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), sp, speaker_sound_update);
+ sp->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), sp, speaker_sound_update);
if (intf != NULL)
{
@@ -159,8 +159,8 @@ static DEVICE_START( speaker )
for (i = 0; i < FILTER_LENGTH; i++)
sp->composed_volume[i] = 0;
sp->composed_sample_index = 0;
- sp->last_update_time = device->machine->time();
- sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine->sample_rate());
+ sp->last_update_time = device->machine().time();
+ sp->channel_sample_period = HZ_TO_ATTOSECONDS(device->machine().sample_rate());
sp->channel_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->channel_sample_period);
sp->interm_sample_period = sp->channel_sample_period / RATE_MULTIPLIER;
sp->interm_sample_period_secfrac = ATTOSECONDS_TO_DOUBLE(sp->interm_sample_period);
@@ -275,7 +275,7 @@ void speaker_level_w(device_t *device, int new_level)
new_level = sp->num_levels - 1;
volume = sp->levels[sp->level];
- time = device->machine->time();
+ time = device->machine().time();
if (time < sp->channel_next_sample_time)
{
diff --git a/src/emu/sound/spu.c b/src/emu/sound/spu.c
index 4ffbe31f845..e64f58f4e3a 100644
--- a/src/emu/sound/spu.c
+++ b/src/emu/sound/spu.c
@@ -285,7 +285,7 @@ device_config *spu_device_config::static_alloc_device_config(const machine_confi
device_t *spu_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, spu_device(machine, *this));
+ return auto_alloc(machine, spu_device(machine, *this));
}
class adpcm_decoder
@@ -3121,18 +3121,18 @@ void spu_device::flush_cdda(const unsigned int sector)
// MAME I/O stuff. This can get cleaner when machine/psx.c does.
-static void spu_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void spu_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- spu_device *spu = machine->device<spu_device>("spu");
- UINT8 *psxram = (UINT8 *)memory_get_shared(*machine, "share1");
+ spu_device *spu = machine.device<spu_device>("spu");
+ UINT8 *psxram = (UINT8 *)memory_get_shared(machine, "share1");
spu->start_dma(psxram + n_address, false, n_size*4);
}
-static void spu_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void spu_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- spu_device *spu = machine->device<spu_device>("spu");
- UINT8 *psxram = (UINT8 *)memory_get_shared(*machine, "share1");
+ spu_device *spu = machine.device<spu_device>("spu");
+ UINT8 *psxram = (UINT8 *)memory_get_shared(machine, "share1");
// printf("SPU DMA write from %x, size %x\n", n_address, n_size);
@@ -3141,12 +3141,12 @@ static void spu_dma_write( running_machine *machine, UINT32 n_address, INT32 n_s
READ16_HANDLER( spu_r )
{
- spu_device *spu = space->machine->device<spu_device>("spu");
+ spu_device *spu = space->machine().device<spu_device>("spu");
if (!spu->installed_dma_hooks)
{
- psx_dma_install_read_handler(space->machine, 4, spu_dma_read);
- psx_dma_install_write_handler(space->machine, 4, spu_dma_write);
+ psx_dma_install_read_handler(space->machine(), 4, spu_dma_read);
+ psx_dma_install_write_handler(space->machine(), 4, spu_dma_write);
spu->installed_dma_hooks = true;
}
@@ -3155,12 +3155,12 @@ READ16_HANDLER( spu_r )
WRITE16_HANDLER( spu_w )
{
- spu_device *spu = space->machine->device<spu_device>("spu");
+ spu_device *spu = space->machine().device<spu_device>("spu");
if (!spu->installed_dma_hooks)
{
- psx_dma_install_read_handler(space->machine, 4, spu_dma_read);
- psx_dma_install_write_handler(space->machine, 4, spu_dma_write);
+ psx_dma_install_read_handler(space->machine(), 4, spu_dma_read);
+ psx_dma_install_write_handler(space->machine(), 4, spu_dma_write);
spu->installed_dma_hooks = true;
}
diff --git a/src/emu/sound/st0016.c b/src/emu/sound/st0016.c
index c4473995127..dd9e41ed651 100644
--- a/src/emu/sound/st0016.c
+++ b/src/emu/sound/st0016.c
@@ -142,7 +142,7 @@ static DEVICE_START( st0016 )
info->sound_ram = intf->p_soundram;
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, info, st0016_update);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, info, st0016_update);
}
diff --git a/src/emu/sound/t6w28.c b/src/emu/sound/t6w28.c
index 864f31a3d0f..8f03adaa0aa 100644
--- a/src/emu/sound/t6w28.c
+++ b/src/emu/sound/t6w28.c
@@ -309,7 +309,7 @@ static int t6w28_init(device_t *device, t6w28_state *R)
int sample_rate = device->clock()/16;
int i;
- R->Channel = device->machine->sound().stream_alloc(*device,0,2,sample_rate,R,t6w28_update);
+ R->Channel = device->machine().sound().stream_alloc(*device,0,2,sample_rate,R,t6w28_update);
R->SampleRate = sample_rate;
diff --git a/src/emu/sound/tiaintf.c b/src/emu/sound/tiaintf.c
index cd3091ef3d7..8c977c5c102 100644
--- a/src/emu/sound/tiaintf.c
+++ b/src/emu/sound/tiaintf.c
@@ -28,7 +28,7 @@ static DEVICE_START( tia )
{
tia_state *info = get_safe_token(device);
- info->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), info, tia_update);
+ info->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), info, tia_update);
info->chip = tia_sound_init(device->clock(), device->clock(), 16);
assert_always(info->chip != NULL, "Error creating TIA chip");
diff --git a/src/emu/sound/tms3615.c b/src/emu/sound/tms3615.c
index d8d8ceb92d5..5c263335fee 100644
--- a/src/emu/sound/tms3615.c
+++ b/src/emu/sound/tms3615.c
@@ -89,7 +89,7 @@ static DEVICE_START( tms3615 )
{
tms_state *tms = get_safe_token(device);
- tms->channel = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/8, tms, tms3615_sound_update);
+ tms->channel = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/8, tms, tms3615_sound_update);
tms->samplerate = device->clock()/8;
tms->basefreq = device->clock();
}
diff --git a/src/emu/sound/tms36xx.c b/src/emu/sound/tms36xx.c
index 6d1e4635f73..e9c70baacdc 100644
--- a/src/emu/sound/tms36xx.c
+++ b/src/emu/sound/tms36xx.c
@@ -500,7 +500,7 @@ static DEVICE_START( tms36xx )
tms->intf = (const tms36xx_interface *)device->baseconfig().static_config();
- tms->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
+ tms->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() * 64, tms, tms36xx_sound_update);
tms->samplerate = device->clock() * 64;
tms->basefreq = device->clock();
enable = 0;
diff --git a/src/emu/sound/tms5110.c b/src/emu/sound/tms5110.c
index 09f34a1b124..11b04ad2998 100644
--- a/src/emu/sound/tms5110.c
+++ b/src/emu/sound/tms5110.c
@@ -1031,7 +1031,7 @@ static DEVICE_START( tms5110 )
devcb_resolve_read_line(&tms->data_func, &tms->intf->data_func, device);
/* initialize a stream */
- tms->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5110_update);
+ tms->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5110_update);
if (tms->table == NULL)
{
@@ -1048,7 +1048,7 @@ static DEVICE_START( tms5110 )
}
tms->state = CTL_STATE_INPUT; /* most probably not defined */
- tms->romclk_hack_timer = device->machine->scheduler().timer_alloc(FUNC(romclk_hack_timer_cb), (void *) device);
+ tms->romclk_hack_timer = device->machine().scheduler().timer_alloc(FUNC(romclk_hack_timer_cb), (void *) device);
register_for_save_states(tms);
}
@@ -1415,13 +1415,13 @@ static DEVICE_START( tmsprom )
tms->rom = *device->region();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No rom region found");
- tms->prom = device->machine->region(tms->intf->prom_region)->base();
+ tms->prom = device->machine().region(tms->intf->prom_region)->base();
assert_always(tms->rom != NULL, "Error creating TMSPROM chip: No prom region found");
tms->device = device;
tms->clock = device->clock();
- tms->romclk_timer = device->machine->scheduler().timer_alloc(FUNC(tmsprom_step), device);
+ tms->romclk_timer = device->machine().scheduler().timer_alloc(FUNC(tmsprom_step), device);
tms->romclk_timer->adjust(attotime::zero, 0, attotime::from_hz(tms->clock));
tms->bit = 0;
diff --git a/src/emu/sound/tms5220.c b/src/emu/sound/tms5220.c
index 0ad9576a78b..06969db03ca 100644
--- a/src/emu/sound/tms5220.c
+++ b/src/emu/sound/tms5220.c
@@ -1518,7 +1518,7 @@ static DEVICE_START( tms5220 )
devcb_resolve_write_line(&tms->readyq_func, &tms->intf->readyq_func, device);
/* initialize a stream */
- tms->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5220_update);
+ tms->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / 80, tms, tms5220_update);
/*if (tms->table == NULL)
{
@@ -1696,7 +1696,7 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_rsq_w )
tms->io_ready = 0;
update_ready_state(tms);
/* How long does /READY stay inactive, when /RS is pulled low? I believe its almost always ~16 clocks (25 usec at 800khz as shown on the datasheet) */
- tms->device->machine->scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~11?) cycles to complete
+ tms->device->machine().scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~11?) cycles to complete
}
}
}
@@ -1759,7 +1759,7 @@ WRITE_LINE_DEVICE_HANDLER( tms5220_wsq_w )
SET RATE (5220C only): ? cycles (probably ~16)
*/
// TODO: actually HANDLE the timing differences! currently just assuming always 16 cycles
- tms->device->machine->scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode
+ tms->device->machine().scheduler().timer_set(attotime::from_hz(device->clock()/16), FUNC(io_ready_cb), 1, tms); // this should take around 10-16 (closer to ~15) cycles to complete for fifo writes, TODO: but actually depends on what command is written if in command mode
}
}
}
diff --git a/src/emu/sound/upd7759.c b/src/emu/sound/upd7759.c
index 7d6fffa2991..f5bd40697cb 100644
--- a/src/emu/sound/upd7759.c
+++ b/src/emu/sound/upd7759.c
@@ -628,7 +628,7 @@ static void register_for_save(upd7759_state *chip, device_t *device)
device->save_item(NAME(chip->sample));
device->save_item(NAME(chip->romoffset));
- device->machine->state().register_postload(upd7759_postload, chip);
+ device->machine().state().register_postload(upd7759_postload, chip);
}
@@ -641,7 +641,7 @@ static DEVICE_START( upd7759 )
chip->device = device;
/* allocate a stream channel */
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock()/4, chip, upd7759_update);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock()/4, chip, upd7759_update);
/* compute the stepping rate based on the chip's clock speed */
chip->step = 4 * FRAC_ONE;
@@ -655,7 +655,7 @@ static DEVICE_START( upd7759 )
/* compute the ROM base or allocate a timer */
chip->rom = chip->rombase = *device->region();
if (chip->rom == NULL)
- chip->timer = device->machine->scheduler().timer_alloc(FUNC(upd7759_slave_update), chip);
+ chip->timer = device->machine().scheduler().timer_alloc(FUNC(upd7759_slave_update), chip);
/* set the DRQ callback */
chip->drqcallback = intf->drqcallback;
diff --git a/src/emu/sound/vlm5030.c b/src/emu/sound/vlm5030.c
index 351233f72ad..634c3cca5f9 100644
--- a/src/emu/sound/vlm5030.c
+++ b/src/emu/sound/vlm5030.c
@@ -47,7 +47,7 @@ RST not only resets the chip on its rising edge but grabs a byte of mode state d
9bit DAC is composed of 5bit Physical and 3bitPWM.
todo:
- Noise Generator circuit without 'machine->rand()' function.
+ Noise Generator circuit without 'machine.rand()' function.
----------- command format (Analytical result) ----------
@@ -410,7 +410,7 @@ static STREAM_UPDATE( vlm5030_update_callback )
}
else if (chip->old_pitch <= 1)
{ /* generate unvoiced samples here */
- current_val = (chip->device->machine->rand()&1) ? chip->current_energy : -chip->current_energy;
+ current_val = (chip->device->machine().rand()&1) ? chip->current_energy : -chip->current_energy;
}
else
{
@@ -703,7 +703,7 @@ static DEVICE_START( vlm5030 )
else
chip->address_mask = chip->intf->memory_size-1;
- chip->channel = device->machine->sound().stream_alloc(*device, 0, 1, emulation_rate,chip,vlm5030_update_callback);
+ chip->channel = device->machine().sound().stream_alloc(*device, 0, 1, emulation_rate,chip,vlm5030_update_callback);
/* don't restore "UINT8 *chip->rom" when use vlm5030_set_rom() */
@@ -726,7 +726,7 @@ static DEVICE_START( vlm5030 )
device->save_item(NAME(chip->target_pitch));
device->save_item(NAME(chip->target_k));
device->save_item(NAME(chip->x));
- device->machine->state().register_postload(vlm5030_restore_state, chip);
+ device->machine().state().register_postload(vlm5030_restore_state, chip);
}
diff --git a/src/emu/sound/votrax.c b/src/emu/sound/votrax.c
index adfb1e212ff..176d7cf537f 100644
--- a/src/emu/sound/votrax.c
+++ b/src/emu/sound/votrax.c
@@ -113,11 +113,11 @@ static DEVICE_START( votrax )
votrax_state *votrax = get_safe_token(device);
votrax->device = device;
- votrax->samples = readsamples(device->machine,VotraxTable,"votrax");
+ votrax->samples = readsamples(device->machine(),VotraxTable,"votrax");
votrax->frequency = 8000;
votrax->volume = 230;
- votrax->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), votrax, votrax_update_sound);
+ votrax->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), votrax, votrax_update_sound);
votrax->sample = NULL;
votrax->step = 0;
@@ -144,7 +144,7 @@ WRITE8_DEVICE_HANDLER( votrax_w )
info->sample = &info->samples->sample[Phoneme];
info->pos = 0;
info->frac = 0;
- info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine->sample_rate();
+ info->step = ((INT64)(info->sample->frequency + (256*Intonation)) << FRAC_BITS) / info->device->machine().sample_rate();
info->channel->set_output_gain(0, (info->volume + (8*Intonation)*100/255) / 100.0);
}
}
diff --git a/src/emu/sound/vrender0.c b/src/emu/sound/vrender0.c
index 46ca52ed6ae..e39d049fc26 100644
--- a/src/emu/sound/vrender0.c
+++ b/src/emu/sound/vrender0.c
@@ -110,7 +110,7 @@ static DEVICE_START( vrender0 )
memcpy(&(VR0->Intf),intf,sizeof(vr0_interface));
memset(VR0->SOUNDREGS,0,sizeof(VR0->SOUNDREGS));
- VR0->stream = device->machine->sound().stream_alloc(*device, 0, 2, 44100, VR0, VR0_Update);
+ VR0->stream = device->machine().sound().stream_alloc(*device, 0, 2, 44100, VR0, VR0_Update);
device->save_item(NAME(VR0->SOUNDREGS));
}
diff --git a/src/emu/sound/wave.c b/src/emu/sound/wave.c
index 42b7f724da3..86bbd429361 100644
--- a/src/emu/sound/wave.c
+++ b/src/emu/sound/wave.c
@@ -22,7 +22,7 @@
static STREAM_UPDATE( wave_sound_update )
{
device_image_interface *image = (device_image_interface *)param;
- int speakers = image->device().machine->m_devicelist.count(SPEAKER);
+ int speakers = image->device().machine().m_devicelist.count(SPEAKER);
cassette_image *cassette;
cassette_state state;
double time_index;
@@ -39,7 +39,7 @@ static STREAM_UPDATE( wave_sound_update )
{
cassette = cassette_get_image(&image->device());
time_index = cassette_get_position(&image->device());
- duration = ((double) samples) / image->device().machine->sample_rate();
+ duration = ((double) samples) / image->device().machine().sample_rate();
cassette_get_samples(cassette, 0, time_index, duration, samples, 2, left_buffer, CASSETTE_WAVEFORM_16BIT);
if (speakers > 1)
@@ -68,12 +68,12 @@ static DEVICE_START( wave )
assert( device != NULL );
assert( device->baseconfig().static_config() != NULL );
- int speakers = device->machine->config().m_devicelist.count(SPEAKER);
- image = dynamic_cast<device_image_interface *>(device->machine->device( (const char *)device->baseconfig().static_config()));
+ int speakers = device->machine().config().m_devicelist.count(SPEAKER);
+ image = dynamic_cast<device_image_interface *>(device->machine().device( (const char *)device->baseconfig().static_config()));
if (speakers > 1)
- device->machine->sound().stream_alloc(*device, 0, 2, device->machine->sample_rate(), (void *)image, wave_sound_update);
+ device->machine().sound().stream_alloc(*device, 0, 2, device->machine().sample_rate(), (void *)image, wave_sound_update);
else
- device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), (void *)image, wave_sound_update);
+ device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), (void *)image, wave_sound_update);
}
diff --git a/src/emu/sound/x1_010.c b/src/emu/sound/x1_010.c
index 2bdc309ffd0..c4d446e0173 100644
--- a/src/emu/sound/x1_010.c
+++ b/src/emu/sound/x1_010.c
@@ -216,7 +216,7 @@ static DEVICE_START( x1_010 )
LOG_SOUND(("masterclock = %d rate = %d\n", device->clock(), info->rate ));
/* get stream channels */
- info->stream = device->machine->sound().stream_alloc(*device,0,2,info->rate,info,seta_update);
+ info->stream = device->machine().sound().stream_alloc(*device,0,2,info->rate,info,seta_update);
}
@@ -255,7 +255,7 @@ WRITE8_DEVICE_HANDLER( seta_sound_w )
info->smp_offset[channel] = 0;
info->env_offset[channel] = 0;
}
- LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", device->machine->describe_context(), offset, data ));
+ LOG_REGISTER_WRITE(("%s: offset %6X : data %2X\n", device->machine().describe_context(), offset, data ));
info->reg[offset] = data;
}
@@ -271,7 +271,7 @@ READ16_DEVICE_HANDLER( seta_sound_word_r )
ret = info->HI_WORD_BUF[offset]<<8;
ret += (seta_sound_r( device, offset )&0xff);
- LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine->describe_context(), offset, ret ));
+ LOG_REGISTER_READ(( "%s: Read X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, ret ));
return ret;
}
@@ -280,7 +280,7 @@ WRITE16_DEVICE_HANDLER( seta_sound_word_w )
x1_010_state *info = get_safe_token(device);
info->HI_WORD_BUF[offset] = (data>>8)&0xff;
seta_sound_w( device, offset, data&0xff );
- LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine->describe_context(), offset, data ));
+ LOG_REGISTER_WRITE(( "%s: Write X1-010 Offset:%04X Data:%04X\n", device->machine().describe_context(), offset, data ));
}
diff --git a/src/emu/sound/ym2151.c b/src/emu/sound/ym2151.c
index 924790fea68..dd092c5b3ba 100644
--- a/src/emu/sound/ym2151.c
+++ b/src/emu/sound/ym2151.c
@@ -824,7 +824,7 @@ static TIMER_CALLBACK( timer_callback_a )
if (chip->irq_enable & 0x04)
{
chip->status |= 1;
- machine->scheduler().timer_set(attotime::zero, FUNC(irqAon_callback), 0, chip);
+ machine.scheduler().timer_set(attotime::zero, FUNC(irqAon_callback), 0, chip);
}
if (chip->irq_enable & 0x80)
chip->csm_req = 2; /* request KEY ON / KEY OFF sequence */
@@ -837,7 +837,7 @@ static TIMER_CALLBACK( timer_callback_b )
if (chip->irq_enable & 0x08)
{
chip->status |= 2;
- machine->scheduler().timer_set(attotime::zero, FUNC(irqBon_callback), 0, chip);
+ machine.scheduler().timer_set(attotime::zero, FUNC(irqBon_callback), 0, chip);
}
}
#if 0
@@ -1098,7 +1098,7 @@ void ym2151_write_reg(void *_chip, int r, int v)
{
#ifdef USE_MAME_TIMERS
chip->status &= ~1;
- chip->device->machine->scheduler().timer_set(attotime::zero, FUNC(irqAoff_callback), 0, chip);
+ chip->device->machine().scheduler().timer_set(attotime::zero, FUNC(irqAoff_callback), 0, chip);
#else
int oldstate = chip->status & 3;
chip->status &= ~1;
@@ -1110,7 +1110,7 @@ void ym2151_write_reg(void *_chip, int r, int v)
{
#ifdef USE_MAME_TIMERS
chip->status &= ~2;
- chip->device->machine->scheduler().timer_set(attotime::zero, FUNC(irqBoff_callback), 0, chip);
+ chip->device->machine().scheduler().timer_set(attotime::zero, FUNC(irqBoff_callback), 0, chip);
#else
int oldstate = chip->status & 3;
chip->status &= ~2;
@@ -1485,7 +1485,7 @@ static void ym2151_state_save_register( YM2151 *chip, device_t *device )
device->save_item(NAME(chip->connect));
- device->machine->state().register_postload(ym2151_postload, chip);
+ device->machine().state().register_postload(ym2151_postload, chip);
}
#else
STATE_POSTLOAD( ym2151_postload )
@@ -1509,7 +1509,7 @@ void * ym2151_init(device_t *device, int clock, int rate)
{
YM2151 *PSG;
- PSG = auto_alloc(device->machine, YM2151);
+ PSG = auto_alloc(device->machine(), YM2151);
memset(PSG, 0, sizeof(YM2151));
@@ -1533,8 +1533,8 @@ void * ym2151_init(device_t *device, int clock, int rate)
#ifdef USE_MAME_TIMERS
/* this must be done _before_ a call to ym2151_reset_chip() */
- PSG->timer_A = device->machine->scheduler().timer_alloc(FUNC(timer_callback_a), PSG);
- PSG->timer_B = device->machine->scheduler().timer_alloc(FUNC(timer_callback_b), PSG);
+ PSG->timer_A = device->machine().scheduler().timer_alloc(FUNC(timer_callback_a), PSG);
+ PSG->timer_B = device->machine().scheduler().timer_alloc(FUNC(timer_callback_b), PSG);
#else
PSG->tim_A = 0;
PSG->tim_B = 0;
@@ -1546,7 +1546,7 @@ void * ym2151_init(device_t *device, int clock, int rate)
{
cymfile = fopen("2151_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create file 2151_.cym\n");
}
@@ -1560,7 +1560,7 @@ void ym2151_shutdown(void *_chip)
{
YM2151 *chip = (YM2151 *)_chip;
- auto_free (chip->device->machine, chip);
+ auto_free (chip->device->machine(), chip);
if (cymfile)
fclose (cymfile);
diff --git a/src/emu/sound/ym2413.c b/src/emu/sound/ym2413.c
index 68992390a33..7aaf447e99b 100644
--- a/src/emu/sound/ym2413.c
+++ b/src/emu/sound/ym2413.c
@@ -1940,7 +1940,7 @@ static int OPLL_LockTable(device_t *device)
{
cymfile = fopen("2413_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create file 2413_.cym\n");
}
@@ -2011,7 +2011,7 @@ static YM2413 *OPLLCreate(device_t *device, int clock, int rate)
if (OPLL_LockTable(device) == -1) return NULL;
/* allocate memory block */
- chip = auto_alloc_clear(device->machine, YM2413);
+ chip = auto_alloc_clear(device->machine(), YM2413);
chip->device = device;
chip->clock = clock;
@@ -2029,7 +2029,7 @@ static YM2413 *OPLLCreate(device_t *device, int clock, int rate)
static void OPLLDestroy(YM2413 *chip)
{
OPLL_UnLockTable();
- auto_free(chip->device->machine, chip);
+ auto_free(chip->device->machine(), chip);
}
/* Option handlers */
diff --git a/src/emu/sound/ymf262.c b/src/emu/sound/ymf262.c
index 0d6ab4d9353..e6ea783f58f 100644
--- a/src/emu/sound/ymf262.c
+++ b/src/emu/sound/ymf262.c
@@ -2268,7 +2268,7 @@ static int OPL3_LockTable(device_t *device)
{
cymfile = fopen("ymf262_.cym","wb");
if (cymfile)
- device->machine->scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
+ device->machine().scheduler().timer_pulse ( attotime::from_hz(110), FUNC(cymfile_callback)); /*110 Hz pulse timer*/
else
logerror("Could not create ymf262_.cym file\n");
}
@@ -2341,7 +2341,7 @@ static OPL3 *OPL3Create(device_t *device, int clock, int rate, int type)
if (OPL3_LockTable(device) == -1) return NULL;
/* allocate memory block */
- chip = auto_alloc_clear(device->machine, OPL3);
+ chip = auto_alloc_clear(device->machine(), OPL3);
chip->device = device;
chip->type = type;
@@ -2360,7 +2360,7 @@ static OPL3 *OPL3Create(device_t *device, int clock, int rate, int type)
static void OPL3Destroy(OPL3 *chip)
{
OPL3_UnLockTable();
- auto_free(chip->device->machine, chip);
+ auto_free(chip->device->machine(), chip);
}
diff --git a/src/emu/sound/ymf271.c b/src/emu/sound/ymf271.c
index 3a476785612..043fb6f60c4 100644
--- a/src/emu/sound/ymf271.c
+++ b/src/emu/sound/ymf271.c
@@ -1589,7 +1589,7 @@ READ8_DEVICE_HANDLER( ymf271_r )
return 0;
}
-static void init_tables(running_machine *machine)
+static void init_tables(running_machine &machine)
{
int i,j;
@@ -1752,8 +1752,8 @@ static void init_state(YMF271Chip *chip, device_t *device)
static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, void (*cb)(device_t *,int), const devcb_read8 *ext_read, const devcb_write8 *ext_write)
{
- chip->timA = device->machine->scheduler().timer_alloc(FUNC(ymf271_timer_a_tick), chip);
- chip->timB = device->machine->scheduler().timer_alloc(FUNC(ymf271_timer_b_tick), chip);
+ chip->timA = device->machine().scheduler().timer_alloc(FUNC(ymf271_timer_a_tick), chip);
+ chip->timB = device->machine().scheduler().timer_alloc(FUNC(ymf271_timer_b_tick), chip);
chip->rom = rom;
chip->irq_callback = cb;
@@ -1761,7 +1761,7 @@ static void ymf271_init(device_t *device, YMF271Chip *chip, UINT8 *rom, void (*c
devcb_resolve_read8(&chip->ext_mem_read, ext_read, device);
devcb_resolve_write8(&chip->ext_mem_write, ext_write, device);
- init_tables(device->machine);
+ init_tables(device->machine());
init_state(chip, device);
}
@@ -1778,7 +1778,7 @@ static DEVICE_START( ymf271 )
intf = (device->baseconfig().static_config() != NULL) ? (const ymf271_interface *)device->baseconfig().static_config() : &defintrf;
ymf271_init(device, chip, *device->region(), intf->irq_callback, &intf->ext_read, &intf->ext_write);
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/384, chip, ymf271_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/384, chip, ymf271_update);
for (i = 0; i < 256; i++)
{
diff --git a/src/emu/sound/ymf278b.c b/src/emu/sound/ymf278b.c
index 7584588fffa..c0a116b1854 100644
--- a/src/emu/sound/ymf278b.c
+++ b/src/emu/sound/ymf278b.c
@@ -340,7 +340,7 @@ static STREAM_UPDATE( ymf278b_pcm_update )
}
}
-static void ymf278b_irq_check(running_machine *machine, YMF278BChip *chip)
+static void ymf278b_irq_check(running_machine &machine, YMF278BChip *chip)
{
int prev_line = chip->irq_line;
chip->irq_line = chip->current_irq ? ASSERT_LINE : CLEAR_LINE;
@@ -398,7 +398,7 @@ static void ymf278b_timer_b_reset(YMF278BChip *chip)
chip->timer_b->adjust(attotime::never);
}
-static void ymf278b_A_w(running_machine *machine, YMF278BChip *chip, UINT8 reg, UINT8 data)
+static void ymf278b_A_w(running_machine &machine, YMF278BChip *chip, UINT8 reg, UINT8 data)
{
switch(reg)
{
@@ -620,7 +620,7 @@ READ8_DEVICE_HANDLER( ymf278b_r )
return chip->current_irq | (chip->irq_line == ASSERT_LINE ? 0x80 : 0x00);
default:
- logerror("%s: unexpected read at offset %X from ymf278b\n", device->machine->describe_context(), offset);
+ logerror("%s: unexpected read at offset %X from ymf278b\n", device->machine().describe_context(), offset);
break;
}
return 0xff;
@@ -637,7 +637,7 @@ WRITE8_DEVICE_HANDLER( ymf278b_w )
break;
case 1:
- ymf278b_A_w(device->machine, chip, chip->port_A, data);
+ ymf278b_A_w(device->machine(), chip, chip->port_A, data);
break;
case 2:
@@ -657,7 +657,7 @@ WRITE8_DEVICE_HANDLER( ymf278b_w )
break;
default:
- logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", device->machine->describe_context(), offset, data);
+ logerror("%s: unexpected write at offset %X to ymf278b = %02X\n", device->machine().describe_context(), offset, data);
break;
}
}
@@ -666,8 +666,8 @@ static void ymf278b_init(device_t *device, YMF278BChip *chip, void (*cb)(device_
{
chip->rom = *device->region();
chip->irq_callback = cb;
- chip->timer_a = device->machine->scheduler().timer_alloc(FUNC(ymf278b_timer_a_tick), chip);
- chip->timer_b = device->machine->scheduler().timer_alloc(FUNC(ymf278b_timer_b_tick), chip);
+ chip->timer_a = device->machine().scheduler().timer_alloc(FUNC(ymf278b_timer_a_tick), chip);
+ chip->timer_b = device->machine().scheduler().timer_alloc(FUNC(ymf278b_timer_b_tick), chip);
chip->irq_line = CLEAR_LINE;
chip->clock = device->clock();
}
@@ -741,7 +741,7 @@ static DEVICE_START( ymf278b )
intf = (device->baseconfig().static_config() != NULL) ? (const ymf278b_interface *)device->baseconfig().static_config() : &defintrf;
ymf278b_init(device, chip, intf->irq_callback);
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock()/768, chip, ymf278b_pcm_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock()/768, chip, ymf278b_pcm_update);
// Volume table, 1 = -0.375dB, 8 = -3dB, 256 = -96dB
for(i = 0; i < 256; i++)
diff --git a/src/emu/sound/ymz280b.c b/src/emu/sound/ymz280b.c
index f363b80d98b..04f7938dae3 100644
--- a/src/emu/sound/ymz280b.c
+++ b/src/emu/sound/ymz280b.c
@@ -205,7 +205,7 @@ static STATE_POSTLOAD( YMZ280B_state_save_update_step )
struct YMZ280BVoice *voice = &chip->voice[j];
update_step(chip, voice);
if(voice->irq_schedule)
- machine->scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[j]), 0, chip);
+ machine.scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[j]), 0, chip);
}
}
@@ -581,7 +581,7 @@ static STREAM_UPDATE( ymz280b_update )
voice->playing = 0;
/* set update_irq_state_timer. IRQ is signaled on next CPU execution. */
- chip->device->machine->scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[v]), 0, chip);
+ chip->device->machine().scheduler().timer_set(attotime::zero, FUNC(update_irq_state_cb[v]), 0, chip);
voice->irq_schedule = 1;
}
}
@@ -651,10 +651,10 @@ static DEVICE_START( ymz280b )
chip->irq_callback = intf->irq_callback;
/* create the stream */
- chip->stream = device->machine->sound().stream_alloc(*device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update);
+ chip->stream = device->machine().sound().stream_alloc(*device, 0, 2, INTERNAL_SAMPLE_RATE, chip, ymz280b_update);
/* allocate memory */
- chip->scratch = auto_alloc_array(device->machine, INT16, MAX_SAMPLE_CHUNK);
+ chip->scratch = auto_alloc_array(device->machine(), INT16, MAX_SAMPLE_CHUNK);
/* state save */
{
@@ -694,7 +694,7 @@ static DEVICE_START( ymz280b )
}
}
- device->machine->state().register_postload(YMZ280B_state_save_update_step, chip);
+ device->machine().state().register_postload(YMZ280B_state_save_update_step, chip);
#if MAKE_WAVS
chip->wavresample = wav_open("resamp.wav", INTERNAL_SAMPLE_RATE, 2);
diff --git a/src/emu/sound/zsg2.c b/src/emu/sound/zsg2.c
index 7f5f99a3a04..28be392d6aa 100644
--- a/src/emu/sound/zsg2.c
+++ b/src/emu/sound/zsg2.c
@@ -226,9 +226,9 @@ static DEVICE_START( zsg2 )
memset(&info->zc, 0, sizeof(info->zc));
memset(&info->act, 0, sizeof(info->act));
- info->stream = device->machine->sound().stream_alloc(*device, 0, 2, info->sample_rate, info, update_stereo);
+ info->stream = device->machine().sound().stream_alloc(*device, 0, 2, info->sample_rate, info, update_stereo);
- info->bank_samples = device->machine->region(intf->samplergn)->base();
+ info->bank_samples = device->machine().region(intf->samplergn)->base();
}
/**************************************************************************
diff --git a/src/emu/speaker.c b/src/emu/speaker.c
index 924f2dab582..052a581a676 100644
--- a/src/emu/speaker.c
+++ b/src/emu/speaker.c
@@ -99,7 +99,7 @@ device_config *speaker_device_config::static_alloc_device_config(const machine_c
device_t *speaker_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, speaker_device(machine, *this));
+ return auto_alloc(machine, speaker_device(machine, *this));
}
@@ -170,7 +170,7 @@ void speaker_device::device_start()
}
// allocate the mixer stream
- m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, machine->sample_rate());
+ m_mixer_stream = m_machine.sound().stream_alloc(*this, m_auto_allocated_inputs, 1, m_machine.sample_rate());
}
diff --git a/src/emu/state.c b/src/emu/state.c
index a56f3a25528..1e5577addbc 100644
--- a/src/emu/state.c
+++ b/src/emu/state.c
@@ -162,7 +162,7 @@ void state_manager::register_presave(prepost_func func, void *param)
fatalerror("Duplicate save state function (%p, %p)", param, func);
// allocate a new entry
- m_presave_list.append(*auto_alloc(&m_machine, state_callback(func, param)));
+ m_presave_list.append(*auto_alloc(m_machine, state_callback(func, param)));
}
@@ -183,7 +183,7 @@ void state_manager::register_postload(prepost_func func, void *param)
fatalerror("Duplicate save state function (%p, %p)", param, func);
// allocate a new entry
- m_postload_list.append(*auto_alloc(&m_machine, state_callback(func, param)));
+ m_postload_list.append(*auto_alloc(m_machine, state_callback(func, param)));
}
@@ -228,7 +228,7 @@ void state_manager::save_memory(const char *module, const char *tag, UINT32 inde
}
// insert us into the list
- m_entry_list.insert_after(*auto_alloc(&m_machine, state_entry(val, totalname, valsize, valcount)), insert_after);
+ m_entry_list.insert_after(*auto_alloc(m_machine, state_entry(val, totalname, valsize, valcount)), insert_after);
}
@@ -237,12 +237,11 @@ void state_manager::save_memory(const char *module, const char *tag, UINT32 inde
// state
//-------------------------------------------------
-state_save_error state_manager::check_file(running_machine *machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
+state_save_error state_manager::check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...))
{
// if we want to validate the signature, compute it
UINT32 sig = 0;
- if (machine != NULL)
- sig = machine->state().signature();
+ sig = machine.state().signature();
// seek to the beginning and read the header
file.compress(FCOMPRESS_NONE);
@@ -300,7 +299,7 @@ state_save_error state_manager::read_file(emu_file &file)
// call the post-load functions
for (state_callback *func = m_postload_list.first(); func != NULL; func = func->next())
- (*func->m_func)(&m_machine, func->m_param);
+ (*func->m_func)(m_machine, func->m_param);
return STATERR_NONE;
}
@@ -334,7 +333,7 @@ state_save_error state_manager::write_file(emu_file &file)
// call the pre-save functions
for (state_callback *func = m_presave_list.first(); func != NULL; func = func->next())
- (*func->m_func)(&m_machine, func->m_param);
+ (*func->m_func)(m_machine, func->m_param);
// then write all the data
for (state_entry *entry = m_entry_list.first(); entry != NULL; entry = entry->next())
diff --git a/src/emu/state.h b/src/emu/state.h
index 8b22f1b990c..dacfef66673 100644
--- a/src/emu/state.h
+++ b/src/emu/state.h
@@ -68,20 +68,20 @@ enum state_save_error
//**************************************************************************
// macros to declare presave/postload functions with the appropriate parameters
-#define STATE_PRESAVE(name) void name(running_machine *machine, void *param)
-#define STATE_POSTLOAD(name) void name(running_machine *machine, void *param)
+#define STATE_PRESAVE(name) void name(running_machine &machine, void *param)
+#define STATE_POSTLOAD(name) void name(running_machine &machine, void *param)
// templates to assume the 'param' of a presave/postload function is a class pointer
template<class T, void (T::*func)()>
-void state_presave_stub(running_machine *machine, void *param)
+void state_presave_stub(running_machine &machine, void *param)
{
T *target = reinterpret_cast<T *>(param);
(target->*func)();
}
template<class T, void (T::*func)()>
-void state_postload_stub(running_machine *machine, void *param)
+void state_postload_stub(running_machine &machine, void *param)
{
T *target = reinterpret_cast<T *>(param);
(target->*func)();
@@ -97,37 +97,37 @@ void state_postload_stub(running_machine *machine, void *param)
// register items with explicit tags
#define state_save_register_item(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).state().save_item(_mod, _tag, _index, _val, #_val)
#define state_save_register_item_pointer(_mach, _mod, _tag, _index, _val, _count) \
- (_mach)->state().save_pointer(_mod, _tag, _index, _val, #_val, _count)
+ (_mach).state().save_pointer(_mod, _tag, _index, _val, #_val, _count)
#define state_save_register_item_array(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).state().save_item(_mod, _tag, _index, _val, #_val)
#define state_save_register_item_2d_array(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, _val, #_val)
+ (_mach).state().save_item(_mod, _tag, _index, _val, #_val)
#define state_save_register_item_bitmap(_mach, _mod, _tag, _index, _val) \
- (_mach)->state().save_item(_mod, _tag, _index, *(_val), #_val)
+ (_mach).state().save_item(_mod, _tag, _index, *(_val), #_val)
// register global items
#define state_save_register_global(_mach, _val) \
- (_mach)->state().save_item(_val, #_val)
+ (_mach).state().save_item(_val, #_val)
#define state_save_register_global_pointer(_mach, _val, _count) \
- (_mach)->state().save_pointer(_val, #_val, _count)
+ (_mach).state().save_pointer(_val, #_val, _count)
#define state_save_register_global_array(_mach, _val) \
- (_mach)->state().save_item(_val, #_val)
+ (_mach).state().save_item(_val, #_val)
#define state_save_register_global_2d_array(_mach, _val) \
- (_mach)->state().save_item(_val, #_val)
+ (_mach).state().save_item(_val, #_val)
#define state_save_register_global_bitmap(_mach, _val) \
- (_mach)->state().save_item(*(_val), #_val)
+ (_mach).state().save_item(*(_val), #_val)
@@ -142,7 +142,7 @@ class state_manager
template<typename T> struct type_checker<T*> { static const bool is_atom = false; static const bool is_pointer = true; };
public:
- typedef void (*prepost_func)(running_machine *machine, void *param);
+ typedef void (*prepost_func)(running_machine &machine, void *param);
// construction/destruction
state_manager(running_machine &machine);
@@ -202,7 +202,7 @@ public:
void save_pointer(T *value, const char *valname, UINT32 count, int index = 0) { save_pointer("global", NULL, index, value, valname, count); }
// file processing
- static state_save_error check_file(running_machine *machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...));
+ static state_save_error check_file(running_machine &machine, emu_file &file, const char *gamename, void (CLIB_DECL *errormsg)(const char *fmt, ...));
state_save_error write_file(emu_file &file);
state_save_error read_file(emu_file &file);
diff --git a/src/emu/tilemap.c b/src/emu/tilemap.c
index 41e3e48a604..014779c1b6f 100644
--- a/src/emu/tilemap.c
+++ b/src/emu/tilemap.c
@@ -67,8 +67,10 @@ struct _blit_parameters
/* core tilemap structure */
struct _tilemap_t
{
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
tilemap_t * next; /* pointer to next tilemap */
- running_machine * machine; /* pointer back to the owning machine */
+ running_machine * m_machine; /* pointer back to the owning machine */
/* basic tilemap metrics */
UINT32 rows; /* number of tile rows */
@@ -135,7 +137,7 @@ struct _tilemap_private
***************************************************************************/
/* system management helpers */
-static tilemap_t *tilemap_create_common(running_machine *machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
+static tilemap_t *tilemap_create_common(running_machine &machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
static void tilemap_exit(running_machine &machine);
static STATE_POSTLOAD( tilemap_postload );
static void tilemap_dispose(tilemap_t *tmap);
@@ -238,12 +240,12 @@ INLINE INT32 effective_colscroll(tilemap_t *tmap, int index, UINT32 screen_heigh
indexed_tilemap - return a tilemap by index
-------------------------------------------------*/
-INLINE tilemap_t *indexed_tilemap(running_machine *machine, int index)
+INLINE tilemap_t *indexed_tilemap(running_machine &machine, int index)
{
tilemap_t *tmap;
/* find by the tilemap index */
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
if (index-- == 0)
return tmap;
@@ -266,9 +268,9 @@ INLINE int gfx_elements_changed(tilemap_t *tmap)
/* iterate over all used gfx types and set the dirty flag if any of them have changed */
for (gfxnum = 0; usedmask != 0; usedmask >>= 1, gfxnum++)
if ((usedmask & 1) != 0)
- if (tmap->gfx_dirtyseq[gfxnum] != tmap->machine->gfx[gfxnum]->dirtyseq)
+ if (tmap->gfx_dirtyseq[gfxnum] != tmap->machine().gfx[gfxnum]->dirtyseq)
{
- tmap->gfx_dirtyseq[gfxnum] = tmap->machine->gfx[gfxnum]->dirtyseq;
+ tmap->gfx_dirtyseq[gfxnum] = tmap->machine().gfx[gfxnum]->dirtyseq;
isdirty = TRUE;
}
@@ -284,20 +286,20 @@ INLINE int gfx_elements_changed(tilemap_t *tmap)
tilemap_init - initialize the tilemap system
-------------------------------------------------*/
-void tilemap_init(running_machine *machine)
+void tilemap_init(running_machine &machine)
{
UINT32 screen_width, screen_height;
- if (machine->primary_screen == NULL)
+ if (machine.primary_screen == NULL)
return;
- screen_width = machine->primary_screen->width();
- screen_height = machine->primary_screen->height();
+ screen_width = machine.primary_screen->width();
+ screen_height = machine.primary_screen->height();
if (screen_width != 0 && screen_height != 0)
{
- machine->priority_bitmap = auto_bitmap_alloc(machine, screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, tilemap_exit);
+ machine.priority_bitmap = auto_bitmap_alloc(machine, screen_width, screen_height, BITMAP_FORMAT_INDEXED8);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, tilemap_exit);
}
}
@@ -311,9 +313,9 @@ void tilemap_init(running_machine *machine)
tilemap_create - create a new tilemap
-------------------------------------------------*/
-tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
+tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{
- return tilemap_create_common(machine, (void *)machine, tile_get_info, mapper, tilewidth, tileheight, cols, rows);
+ return tilemap_create_common(machine, (void *)&machine, tile_get_info, mapper, tilewidth, tileheight, cols, rows);
}
@@ -324,7 +326,7 @@ tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_
tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{
- return tilemap_create_common(device->machine, (void *)device, (tile_get_info_func)tile_get_info, mapper, tilewidth, tileheight, cols, rows);
+ return tilemap_create_common(device->machine(), (void *)device, (tile_get_info_func)tile_get_info, mapper, tilewidth, tileheight, cols, rows);
}
@@ -333,25 +335,25 @@ tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func til
function
-------------------------------------------------*/
-static tilemap_t *tilemap_create_common(running_machine *machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
+static tilemap_t *tilemap_create_common(running_machine &machine, void *get_info_object, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows)
{
tilemap_t *tmap;
int tilemap_instance;
int group;
/* if no tilemap private data yet, allocate it */
- if (machine->tilemap_data == NULL)
+ if (machine.tilemap_data == NULL)
{
- machine->tilemap_data = auto_alloc_clear(machine, tilemap_private);
- machine->tilemap_data->tailptr = &machine->tilemap_data->list;
+ machine.tilemap_data = auto_alloc_clear(machine, tilemap_private);
+ machine.tilemap_data->tailptr = &machine.tilemap_data->list;
}
- tilemap_instance = machine->tilemap_data->instance;
+ tilemap_instance = machine.tilemap_data->instance;
/* allocate the tilemap itself */
tmap = auto_alloc_clear(machine, tilemap_t);
/* fill in the basic metrics */
- tmap->machine = machine;
+ tmap->m_machine = &machine;
tmap->rows = rows;
tmap->cols = cols;
tmap->tilewidth = tilewidth;
@@ -392,26 +394,26 @@ static tilemap_t *tilemap_create_common(running_machine *machine, void *get_info
tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
/* add us to the end of the list of tilemaps */
- *machine->tilemap_data->tailptr = tmap;
- machine->tilemap_data->tailptr = &tmap->next;
+ *machine.tilemap_data->tailptr = tmap;
+ machine.tilemap_data->tailptr = &tmap->next;
/* save relevant state */
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->enable));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->attributes));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->palette_offset));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->pen_data_offset));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollrows));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollcols));
- machine->state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->rowscroll), rows * tileheight);
- machine->state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->colscroll), cols * tilewidth);
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx_flipped));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy));
- machine->state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy_flipped));
- machine->tilemap_data->instance++;
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->enable));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->attributes));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->palette_offset));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->pen_data_offset));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollrows));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->scrollcols));
+ machine.state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->rowscroll), rows * tileheight);
+ machine.state().save_pointer("tilemap", NULL, tilemap_instance, NAME(tmap->colscroll), cols * tilewidth);
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dx_flipped));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy));
+ machine.state().save_item("tilemap", NULL, tilemap_instance, NAME(tmap->dy_flipped));
+ machine.tilemap_data->instance++;
/* reset everything after a load */
- machine->state().register_postload(tilemap_postload, tmap);
+ machine.state().register_postload(tilemap_postload, tmap);
return tmap;
}
@@ -482,14 +484,14 @@ void tilemap_set_flip(tilemap_t *tmap, UINT32 attributes)
the tilemaps
-------------------------------------------------*/
-void tilemap_set_flip_all(running_machine *machine, UINT32 attributes)
+void tilemap_set_flip_all(running_machine &machine, UINT32 attributes)
{
tilemap_t *tmap;
- if (machine->tilemap_data == NULL)
+ if (machine.tilemap_data == NULL)
return;
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
tilemap_set_flip(tmap, attributes);
}
@@ -539,10 +541,10 @@ void tilemap_mark_all_tiles_dirty(tilemap_t *tmap)
tiles in all the tilemaps dirty
-------------------------------------------------*/
-void tilemap_mark_all_tiles_dirty_all(running_machine *machine)
+void tilemap_mark_all_tiles_dirty_all(running_machine &machine)
{
tilemap_t *tmap;
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
tilemap_mark_all_tiles_dirty(tmap);
}
@@ -836,8 +838,8 @@ g_profiler.start(PROFILER_TILEMAP_DRAW);
tmap->gfx_used = 0;
}
- width = tmap->machine->primary_screen->width();
- height = tmap->machine->primary_screen->height();
+ width = tmap->machine().primary_screen->width();
+ height = tmap->machine().primary_screen->height();
/* XY scrolling playfield */
if (tmap->scrollrows == 1 && tmap->scrollcols == 1)
@@ -984,16 +986,16 @@ g_profiler.stop();
tilemap_count - return the number of tilemaps
-------------------------------------------------*/
-int tilemap_count(running_machine *machine)
+int tilemap_count(running_machine &machine)
{
tilemap_t *tmap;
int count = 0;
- if (machine->tilemap_data == NULL)
+ if (machine.tilemap_data == NULL)
return 0;
/* find by the tilemap index */
- for (tmap = machine->tilemap_data->list; tmap != NULL; tmap = tmap->next)
+ for (tmap = machine.tilemap_data->list; tmap != NULL; tmap = tmap->next)
count++;
return count;
}
@@ -1004,7 +1006,7 @@ int tilemap_count(running_machine *machine)
indexed tilemap
-------------------------------------------------*/
-void tilemap_size_by_index(running_machine *machine, int number, UINT32 *width, UINT32 *height)
+void tilemap_size_by_index(running_machine &machine, int number, UINT32 *width, UINT32 *height)
{
tilemap_t *tmap = indexed_tilemap(machine, number);
*width = tmap->width;
@@ -1018,7 +1020,7 @@ void tilemap_size_by_index(running_machine *machine, int number, UINT32 *width,
priority)
-------------------------------------------------*/
-void tilemap_draw_by_index(running_machine *machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly)
+void tilemap_draw_by_index(running_machine &machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly)
{
tilemap_t *tmap = indexed_tilemap(machine, number);
blit_parameters blit;
@@ -1156,7 +1158,7 @@ static void tilemap_dispose(tilemap_t *tmap)
tilemap_t **tmapptr;
/* walk the list of tilemaps; when we find ourself, remove it */
- for (tmapptr = &tmap->machine->tilemap_data->list; *tmapptr != NULL; tmapptr = &(*tmapptr)->next)
+ for (tmapptr = &tmap->machine().tilemap_data->list; *tmapptr != NULL; tmapptr = &(*tmapptr)->next)
if (*tmapptr == tmap)
{
*tmapptr = tmap->next;
@@ -1164,15 +1166,15 @@ static void tilemap_dispose(tilemap_t *tmap)
}
/* free allocated memory */
- auto_free(tmap->machine, tmap->pen_to_flags);
- auto_free(tmap->machine, tmap->tileflags);
- auto_free(tmap->machine, tmap->flagsmap);
- auto_free(tmap->machine, tmap->pixmap);
- auto_free(tmap->machine, tmap->colscroll);
- auto_free(tmap->machine, tmap->rowscroll);
- auto_free(tmap->machine, tmap->logical_to_memory);
- auto_free(tmap->machine, tmap->memory_to_logical);
- auto_free(tmap->machine, tmap);
+ auto_free(tmap->machine(), tmap->pen_to_flags);
+ auto_free(tmap->machine(), tmap->tileflags);
+ auto_free(tmap->machine(), tmap->flagsmap);
+ auto_free(tmap->machine(), tmap->pixmap);
+ auto_free(tmap->machine(), tmap->colscroll);
+ auto_free(tmap->machine(), tmap->rowscroll);
+ auto_free(tmap->machine(), tmap->logical_to_memory);
+ auto_free(tmap->machine(), tmap->memory_to_logical);
+ auto_free(tmap->machine(), tmap);
}
@@ -1204,8 +1206,8 @@ static void mappings_create(tilemap_t *tmap)
tmap->max_memory_index++;
/* allocate the necessary mappings */
- tmap->memory_to_logical = auto_alloc_array(tmap->machine, tilemap_logical_index, tmap->max_memory_index);
- tmap->logical_to_memory = auto_alloc_array(tmap->machine, tilemap_memory_index, tmap->max_logical_index);
+ tmap->memory_to_logical = auto_alloc_array(tmap->machine(), tilemap_logical_index, tmap->max_memory_index);
+ tmap->logical_to_memory = auto_alloc_array(tmap->machine(), tilemap_memory_index, tmap->max_logical_index);
/* update the mappings */
mappings_update(tmap);
@@ -1333,7 +1335,7 @@ g_profiler.start(PROFILER_TILEMAP_UPDATE);
/* call the get info callback for the associated memory index */
memindex = tmap->logical_to_memory[logindex];
- (*tmap->tile_get_info)((running_machine *)tmap->tile_get_info_object, &tmap->tileinfo, memindex, tmap->user_data);
+ (*tmap->tile_get_info)(*(running_machine *)tmap->tile_get_info_object, &tmap->tileinfo, memindex, tmap->user_data);
/* apply the global tilemap flip to the returned flip flags */
flags = tmap->tileinfo.flags ^ (tmap->attributes & 0x03);
@@ -1350,7 +1352,7 @@ g_profiler.start(PROFILER_TILEMAP_UPDATE);
if (tmap->tileinfo.gfxnum != 0xff && (tmap->gfx_used & (1 << tmap->tileinfo.gfxnum)) == 0)
{
tmap->gfx_used |= 1 << tmap->tileinfo.gfxnum;
- tmap->gfx_dirtyseq[tmap->tileinfo.gfxnum] = tmap->machine->gfx[tmap->tileinfo.gfxnum]->dirtyseq;
+ tmap->gfx_dirtyseq[tmap->tileinfo.gfxnum] = tmap->machine().gfx[tmap->tileinfo.gfxnum]->dirtyseq;
}
g_profiler.stop();
@@ -1615,7 +1617,7 @@ static void configure_blit_parameters(blit_parameters *blit, tilemap_t *tmap, bi
static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit, int xpos, int ypos)
{
- bitmap_t *priority_bitmap = tmap->machine->priority_bitmap;
+ bitmap_t *priority_bitmap = tmap->machine().priority_bitmap;
bitmap_t *dest = blit->bitmap;
const UINT16 *source_baseaddr;
const UINT8 *mask_baseaddr;
@@ -1724,7 +1726,7 @@ static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit,
{
for (cury = y; cury < nexty; cury++)
{
- (*blit->draw_opaque)(dest0, source0, x_end - x_start, tmap->machine->pens, pmap0, blit->tilemap_priority_code, blit->alpha);
+ (*blit->draw_opaque)(dest0, source0, x_end - x_start, tmap->machine().pens, pmap0, blit->tilemap_priority_code, blit->alpha);
dest0 = (UINT8 *)dest0 + dest_line_pitch_bytes;
source0 += tmap->pixmap->rowpixels;
@@ -1738,7 +1740,7 @@ static void tilemap_draw_instance(tilemap_t *tmap, const blit_parameters *blit,
const UINT8 *mask0 = mask_baseaddr + x_start;
for (cury = y; cury < nexty; cury++)
{
- (*blit->draw_masked)(dest0, source0, mask0, blit->mask, blit->value, x_end - x_start, tmap->machine->pens, pmap0, blit->tilemap_priority_code, blit->alpha);
+ (*blit->draw_masked)(dest0, source0, mask0, blit->mask, blit->value, x_end - x_start, tmap->machine().pens, pmap0, blit->tilemap_priority_code, blit->alpha);
dest0 = (UINT8 *)dest0 + dest_line_pitch_bytes;
source0 += tmap->pixmap->rowpixels;
@@ -1794,8 +1796,8 @@ do { \
static void tilemap_draw_roz_core(tilemap_t *tmap, const blit_parameters *blit,
UINT32 startx, UINT32 starty, int incxx, int incxy, int incyx, int incyy, int wraparound)
{
- const pen_t *clut = &tmap->machine->pens[blit->tilemap_priority_code >> 16];
- bitmap_t *priority_bitmap = tmap->machine->priority_bitmap;
+ const pen_t *clut = &tmap->machine().pens[blit->tilemap_priority_code >> 16];
+ bitmap_t *priority_bitmap = tmap->machine().priority_bitmap;
bitmap_t *destbitmap = blit->bitmap;
bitmap_t *srcbitmap = tmap->pixmap;
bitmap_t *flagsmap = tmap->flagsmap;
diff --git a/src/emu/tilemap.h b/src/emu/tilemap.h
index 9c83c91ff47..0f9b750b05d 100644
--- a/src/emu/tilemap.h
+++ b/src/emu/tilemap.h
@@ -173,7 +173,7 @@
// set the common info for the tile
SET_TILE_INFO(
- 1, // use machine->gfx[1] for tile graphics
+ 1, // use machine.gfx[1] for tile graphics
code, // the index of the graphics for this tile
color, // the color to use for this tile
(flipx ? TILE_FLIPX : 0) | // flags for this tile; also
@@ -354,7 +354,7 @@
***************************************************************************/
/* function definition for a get info callback */
-#define TILE_GET_INFO(_name) void _name(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
+#define TILE_GET_INFO(_name) void _name(running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
#define TILE_GET_INFO_DEVICE(_name) void _name(device_t *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param)
/* function definition for a logical-to-memory mapper */
@@ -362,7 +362,7 @@
/* useful macro inside of a TILE_GET_INFO callback to set tile information */
#define SET_TILE_INFO(GFX,CODE,COLOR,FLAGS) tileinfo_set(machine, tileinfo, GFX, CODE, COLOR, FLAGS)
-#define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS) tileinfo_set(device->machine, tileinfo, GFX, CODE, COLOR, FLAGS)
+#define SET_TILE_INFO_DEVICE(GFX,CODE,COLOR,FLAGS) tileinfo_set(device->machine(), tileinfo, GFX, CODE, COLOR, FLAGS)
/* Macros for setting tile attributes in the TILE_GET_INFO callback: */
/* TILE_FLIP_YX assumes that flipy is in bit 1 and flipx is in bit 0 */
@@ -394,12 +394,12 @@ struct _tile_data
UINT8 group; /* defaults to 0; range from 0..TILEMAP_NUM_GROUPS */
UINT8 flags; /* defaults to 0; one or more of TILE_* flags above */
UINT8 pen_mask; /* defaults to 0xff; mask to apply to pen_data while rendering the tile */
- UINT8 gfxnum; /* defaults to 0xff; specify index of machine->gfx for auto-invalidation on dirty */
+ UINT8 gfxnum; /* defaults to 0xff; specify index of machine.gfx for auto-invalidation on dirty */
};
/* callback function to get info about a tile */
-typedef void (*tile_get_info_func)(running_machine *machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
+typedef void (*tile_get_info_func)(running_machine &machine, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
typedef void (*tile_get_info_device_func)(device_t *device, tile_data *tileinfo, tilemap_memory_index tile_index, void *param);
/* callback function to map a column,row pair to a memory index */
@@ -415,14 +415,14 @@ typedef tilemap_memory_index (*tilemap_mapper_func)(UINT32 col, UINT32 row, UINT
/* ----- system-wide management ----- */
/* initialize the tilemap system -- not for use by drivers */
-void tilemap_init(running_machine *machine);
+void tilemap_init(running_machine &machine);
/* ----- tilemap creation and configuration ----- */
/* create a new tilemap; note that tilemaps are tracked by the core so there is no dispose */
-tilemap_t *tilemap_create(running_machine *machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
+tilemap_t *tilemap_create(running_machine &machine, tile_get_info_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
/* create a new tilemap that is owned by a device */
tilemap_t *tilemap_create_device(device_t *device, tile_get_info_device_func tile_get_info, tilemap_mapper_func mapper, int tilewidth, int tileheight, int cols, int rows);
@@ -446,7 +446,7 @@ int tilemap_get_enable(tilemap_t *tmap);
void tilemap_set_flip(tilemap_t *tmap, UINT32 attributes);
/* set a global flip for all tilemaps */
-void tilemap_set_flip_all(running_machine *machine, UINT32 attributes);
+void tilemap_set_flip_all(running_machine &machine, UINT32 attributes);
@@ -459,7 +459,7 @@ void tilemap_mark_tile_dirty(tilemap_t *tmap, tilemap_memory_index memory_index)
void tilemap_mark_all_tiles_dirty(tilemap_t *tmap);
/* mark all the tiles dirty in all tilemaps */
-void tilemap_mark_all_tiles_dirty_all(running_machine *machine);
+void tilemap_mark_all_tiles_dirty_all(running_machine &machine);
@@ -531,13 +531,13 @@ void tilemap_draw_roz_primask(bitmap_t *dest, const rectangle *cliprect, tilemap
/* ----- indexed tilemap handling ----- */
/* return the number of tilemaps */
-int tilemap_count(running_machine *machine);
+int tilemap_count(running_machine &machine);
/* return the size of an indexed tilemap */
-void tilemap_size_by_index(running_machine *machine, int number, UINT32 *width, UINT32 *height);
+void tilemap_size_by_index(running_machine &machine, int number, UINT32 *width, UINT32 *height);
/* render an indexed tilemap with fixed characteristics (no priority) */
-void tilemap_draw_by_index(running_machine *machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly);
+void tilemap_draw_by_index(running_machine &machine, bitmap_t *dest, int number, UINT32 scrollx, UINT32 scrolly);
@@ -566,9 +566,9 @@ TILEMAP_MAPPER( tilemap_scan_cols_flip_xy );
structure
-------------------------------------------------*/
-INLINE void tileinfo_set(running_machine *machine, tile_data *tileinfo, int gfxnum, int rawcode, int rawcolor, int flags)
+INLINE void tileinfo_set(running_machine &machine, tile_data *tileinfo, int gfxnum, int rawcode, int rawcolor, int flags)
{
- const gfx_element *gfx = machine->gfx[gfxnum];
+ const gfx_element *gfx = machine.gfx[gfxnum];
int code = rawcode % gfx->total_elements;
tileinfo->pen_data = gfx_element_get_data(gfx, code);
tileinfo->palette_base = gfx->color_base + gfx->color_granularity * rawcolor;
diff --git a/src/emu/timer.c b/src/emu/timer.c
index bc9a4e8d396..eb4a2020ef9 100644
--- a/src/emu/timer.c
+++ b/src/emu/timer.c
@@ -100,7 +100,7 @@ device_config *timer_device_config::static_alloc_device_config(const machine_con
device_t *timer_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, timer_device(machine, *this));
+ return auto_alloc(machine, timer_device(machine, *this));
}
@@ -280,7 +280,7 @@ void timer_device::device_start()
{
// fetch the screen
if (m_config.m_screen != NULL)
- m_screen = downcast<screen_device *>(machine->device(m_config.m_screen));
+ m_screen = downcast<screen_device *>(m_machine.device(m_config.m_screen));
// allocate the timer
m_timer = timer_alloc();
diff --git a/src/emu/ui.c b/src/emu/ui.c
index 6fa9834c12d..61110734aca 100644
--- a/src/emu/ui.c
+++ b/src/emu/ui.c
@@ -93,7 +93,7 @@ static const input_item_id non_char_keys[] =
static render_font *ui_font;
/* current UI handler */
-static UINT32 (*ui_handler_callback)(running_machine *, render_container *, UINT32);
+static UINT32 (*ui_handler_callback)(running_machine &, render_container *, UINT32);
static UINT32 ui_handler_param;
/* flag to track single stepping */
@@ -129,42 +129,42 @@ static UINT8 non_char_keys_down[(ARRAY_LENGTH(non_char_keys) + 7) / 8];
static void ui_exit(running_machine &machine);
/* text generators */
-static astring &disclaimer_string(running_machine *machine, astring &buffer);
-static astring &warnings_string(running_machine *machine, astring &buffer);
+static astring &disclaimer_string(running_machine &machine, astring &buffer);
+static astring &warnings_string(running_machine &machine, astring &buffer);
/* UI handlers */
-static UINT32 handler_messagebox(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_messagebox_ok(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_messagebox_anykey(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_ingame(running_machine *machine, render_container *container, UINT32 state);
-static UINT32 handler_load_save(running_machine *machine, render_container *container, UINT32 state);
+static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_ingame(running_machine &machine, render_container *container, UINT32 state);
+static UINT32 handler_load_save(running_machine &machine, render_container *container, UINT32 state);
/* slider controls */
-static slider_state *slider_alloc(running_machine *machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
-static slider_state *slider_init(running_machine *machine);
-static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_mixervol(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval);
+static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg);
+static slider_state *slider_init(running_machine &machine);
+static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_mixervol(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overclock(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_brightness(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_contrast(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_gamma(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_xscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_yscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_xoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_yoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overxscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overyscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval);
static char *slider_get_screen_desc(screen_device &screen);
static char *slider_get_laserdisc_desc(device_t *screen);
#ifdef MAME_DEBUG
-static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval);
-static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval);
+static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval);
#endif
@@ -177,7 +177,7 @@ static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *st
pair for the current UI handler
-------------------------------------------------*/
-INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine *, render_container *, UINT32), UINT32 param)
+INLINE UINT32 ui_set_handler(UINT32 (*callback)(running_machine &, render_container *, UINT32), UINT32 param)
{
ui_handler_callback = callback;
ui_handler_param = param;
@@ -234,10 +234,10 @@ INLINE int is_breakable_char(unicode_char ch)
ui_init - set up the user interface
-------------------------------------------------*/
-int ui_init(running_machine *machine)
+int ui_init(running_machine &machine)
{
/* make sure we clean up after ourselves */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ui_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ui_exit);
/* initialize the other UI bits */
ui_menu_init(machine);
@@ -247,7 +247,7 @@ int ui_init(running_machine *machine)
single_step = FALSE;
ui_set_handler(handler_messagebox, 0);
/* retrieve options */
- ui_use_natural_keyboard = machine->options().natural_keyboard();
+ ui_use_natural_keyboard = machine.options().natural_keyboard();
return 0;
}
@@ -270,17 +270,17 @@ static void ui_exit(running_machine &machine)
various startup screens
-------------------------------------------------*/
-int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer)
+int ui_display_startup_screens(running_machine &machine, int first_time, int show_disclaimer)
{
const int maxstate = 3;
- int str = machine->options().seconds_to_run();
- int show_gameinfo = !machine->options().skip_gameinfo();
+ int str = machine.options().seconds_to_run();
+ int show_gameinfo = !machine.options().skip_gameinfo();
int show_warnings = TRUE;
int state;
/* disable everything if we are using -str for 300 or fewer seconds, or if we're the empty driver,
or if we are debugging */
- if (!first_time || (str > 0 && str < 60*5) || &machine->system() == &GAME_NAME(empty) || (machine->debug_flags & DEBUG_FLAG_ENABLED) != 0)
+ if (!first_time || (str > 0 && str < 60*5) || &machine.system() == &GAME_NAME(empty) || (machine.debug_flags & DEBUG_FLAG_ENABLED) != 0)
show_gameinfo = show_warnings = show_disclaimer = FALSE;
/* initialize the on-screen display system */
@@ -288,7 +288,7 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
/* loop over states */
ui_set_handler(handler_ingame, 0);
- for (state = 0; state < maxstate && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select(); state++)
+ for (state = 0; state < maxstate && !machine.scheduled_event_pending() && !ui_menu_is_force_game_select(); state++)
{
/* default to standard colors */
messagebox_backcolor = UI_BACKGROUND_COLOR;
@@ -305,9 +305,9 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
if (show_warnings && warnings_string(machine, messagebox_text).len() > 0)
{
ui_set_handler(handler_messagebox_ok, 0);
- if (machine->system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
+ if (machine.system().flags & (GAME_WRONG_COLORS | GAME_IMPERFECT_COLORS | GAME_REQUIRES_ARTWORK | GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND | GAME_NO_SOUND))
messagebox_backcolor = UI_YELLOW_COLOR;
- if (machine->system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
+ if (machine.system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
messagebox_backcolor = UI_RED_COLOR;
}
break;
@@ -323,12 +323,12 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
while (input_code_poll_switches(machine, FALSE) != INPUT_CODE_INVALID) ;
/* loop while we have a handler */
- while (ui_handler_callback != handler_ingame && !machine->scheduled_event_pending() && !ui_menu_is_force_game_select())
- machine->video().frame_update();
+ while (ui_handler_callback != handler_ingame && !machine.scheduled_event_pending() && !ui_menu_is_force_game_select())
+ machine.video().frame_update();
/* clear the handler and force an update */
ui_set_handler(handler_ingame, 0);
- machine->video().frame_update();
+ machine.video().frame_update();
}
/* if we're the empty driver, force the menus on */
@@ -344,7 +344,7 @@ int ui_display_startup_screens(running_machine *machine, int first_time, int sho
at startup
-------------------------------------------------*/
-void ui_set_startup_text(running_machine *machine, const char *text, int force)
+void ui_set_startup_text(running_machine &machine, const char *text, int force)
{
static osd_ticks_t lastupdatetime = 0;
osd_ticks_t curtime = osd_ticks();
@@ -357,7 +357,7 @@ void ui_set_startup_text(running_machine *machine, const char *text, int force)
if (force || (curtime - lastupdatetime) > osd_ticks_per_second() / 4)
{
lastupdatetime = curtime;
- machine->video().frame_update();
+ machine.video().frame_update();
}
}
@@ -367,15 +367,15 @@ void ui_set_startup_text(running_machine *machine, const char *text, int force)
render it; called by video.c
-------------------------------------------------*/
-void ui_update_and_render(running_machine *machine, render_container *container)
+void ui_update_and_render(running_machine &machine, render_container *container)
{
/* always start clean */
container->empty();
/* if we're paused, dim the whole screen */
- if (machine->phase() >= MACHINE_PHASE_RESET && (single_step || machine->paused()))
+ if (machine.phase() >= MACHINE_PHASE_RESET && (single_step || machine.paused()))
{
- int alpha = (1.0f - machine->options().pause_brightness()) * 255.0f;
+ int alpha = (1.0f - machine.options().pause_brightness()) * 255.0f;
if (ui_menu_is_force_game_select())
alpha = 255;
if (alpha > 255)
@@ -385,8 +385,8 @@ void ui_update_and_render(running_machine *machine, render_container *container)
}
/* render any cheat stuff at the bottom */
- if (machine->phase() >= MACHINE_PHASE_RESET)
- machine->cheat().render_text(*container);
+ if (machine.phase() >= MACHINE_PHASE_RESET)
+ machine.cheat().render_text(*container);
/* call the current UI handler */
assert(ui_handler_callback != NULL);
@@ -880,10 +880,10 @@ int ui_is_menu_active(void)
text to the given buffer
-------------------------------------------------*/
-static astring &disclaimer_string(running_machine *machine, astring &string)
+static astring &disclaimer_string(running_machine &machine, astring &string)
{
string.cpy("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n");
- string.catprintf("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine->system().description);
+ string.catprintf("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine.system().description);
string.cat("Otherwise, type OK or move the joystick left then right to continue");
return string;
}
@@ -894,7 +894,7 @@ static astring &disclaimer_string(running_machine *machine, astring &string)
text to the given buffer
-------------------------------------------------*/
-static astring &warnings_string(running_machine *machine, astring &string)
+static astring &warnings_string(running_machine &machine, astring &string)
{
#define WARNING_FLAGS ( GAME_NOT_WORKING | \
GAME_UNEMULATED_PROTECTION | \
@@ -912,19 +912,19 @@ static astring &warnings_string(running_machine *machine, astring &string)
string.reset();
/* if no warnings, nothing to return */
- if (rom_load_warnings(machine) == 0 && rom_load_knownbad(machine) == 0 && !(machine->system().flags & WARNING_FLAGS))
+ if (rom_load_warnings(machine) == 0 && rom_load_knownbad(machine) == 0 && !(machine.system().flags & WARNING_FLAGS))
return string;
/* add a warning if any ROMs were loaded with warnings */
if (rom_load_warnings(machine) > 0)
{
string.cat("One or more ROMs/CHDs for this game are incorrect. The " GAMENOUN " may not run correctly.\n");
- if (machine->system().flags & WARNING_FLAGS)
+ if (machine.system().flags & WARNING_FLAGS)
string.cat("\n");
}
/* if we have at least one warning flag, print the general header */
- if ((machine->system().flags & WARNING_FLAGS) || rom_load_knownbad(machine) > 0)
+ if ((machine.system().flags & WARNING_FLAGS) || rom_load_knownbad(machine) > 0)
{
string.cat("There are known problems with this " GAMENOUN "\n\n");
@@ -935,46 +935,46 @@ static astring &warnings_string(running_machine *machine, astring &string)
/* add one line per warning flag */
if (input_machine_has_keyboard(machine))
string.cat("The keyboard emulation may not be 100% accurate.\n");
- if (machine->system().flags & GAME_IMPERFECT_COLORS)
+ if (machine.system().flags & GAME_IMPERFECT_COLORS)
string.cat("The colors aren't 100% accurate.\n");
- if (machine->system().flags & GAME_WRONG_COLORS)
+ if (machine.system().flags & GAME_WRONG_COLORS)
string.cat("The colors are completely wrong.\n");
- if (machine->system().flags & GAME_IMPERFECT_GRAPHICS)
+ if (machine.system().flags & GAME_IMPERFECT_GRAPHICS)
string.cat("The video emulation isn't 100% accurate.\n");
- if (machine->system().flags & GAME_IMPERFECT_SOUND)
+ if (machine.system().flags & GAME_IMPERFECT_SOUND)
string.cat("The sound emulation isn't 100% accurate.\n");
- if (machine->system().flags & GAME_NO_SOUND)
+ if (machine.system().flags & GAME_NO_SOUND)
string.cat("The game lacks sound.\n");
- if (machine->system().flags & GAME_NO_COCKTAIL)
+ if (machine.system().flags & GAME_NO_COCKTAIL)
string.cat("Screen flipping in cocktail mode is not supported.\n");
/* check if external artwork is present before displaying this warning? */
- if (machine->system().flags & GAME_REQUIRES_ARTWORK)
+ if (machine.system().flags & GAME_REQUIRES_ARTWORK)
string.cat("The game requires external artwork files\n");
/* if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger */
- if (machine->system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
+ if (machine.system().flags & (GAME_NOT_WORKING | GAME_UNEMULATED_PROTECTION | GAME_MECHANICAL))
{
const game_driver *maindrv;
const game_driver *clone_of;
int foundworking;
/* add the strings for these warnings */
- if (machine->system().flags & GAME_UNEMULATED_PROTECTION)
+ if (machine.system().flags & GAME_UNEMULATED_PROTECTION)
string.cat("The game has protection which isn't fully emulated.\n");
- if (machine->system().flags & GAME_NOT_WORKING)
+ if (machine.system().flags & GAME_NOT_WORKING)
string.cat("\nTHIS " CAPGAMENOUN " DOESN'T WORK. The emulation for this game is not yet complete. "
"There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
- if (machine->system().flags & GAME_MECHANICAL)
+ if (machine.system().flags & GAME_MECHANICAL)
string.cat("\nCertain elements of this " GAMENOUN " cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
"It is not possible to fully play this " GAMENOUN ".\n");
/* find the parent of this driver */
- clone_of = driver_get_clone(&machine->system());
+ clone_of = driver_get_clone(&machine.system());
if (clone_of != NULL && !(clone_of->flags & GAME_IS_BIOS_ROOT))
maindrv = clone_of;
else
- maindrv = &machine->system();
+ maindrv = &machine.system();
/* scan the driver list for any working clones and add them */
foundworking = FALSE;
@@ -1007,17 +1007,17 @@ static astring &warnings_string(running_machine *machine, astring &string)
string with the game info text
-------------------------------------------------*/
-astring &game_info_astring(running_machine *machine, astring &string)
+astring &game_info_astring(running_machine &machine, astring &string)
{
- int scrcount = machine->m_devicelist.count(SCREEN);
+ int scrcount = machine.m_devicelist.count(SCREEN);
int found_sound = FALSE;
/* print description, manufacturer, and CPU: */
- string.printf("%s\n%s %s\n\nCPU:\n", machine->system().description, machine->system().year, machine->system().manufacturer);
+ string.printf("%s\n%s %s\n\nCPU:\n", machine.system().description, machine.system().year, machine.system().manufacturer);
/* loop over all CPUs */
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
/* get cpu specific clock that takes internal multiplier/dividers into account */
int clock = exec->device().clock();
@@ -1047,7 +1047,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
/* loop over all sound chips */
device_sound_interface *sound = NULL;
- for (bool gotone = machine->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = machine.m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
/* append the Sound: string */
if (!found_sound)
@@ -1086,7 +1086,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
string.cat("None\n");
else
{
- for (screen_device *screen = machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
{
if (scrcount > 1)
{
@@ -1103,7 +1103,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
string.catprintf("%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n",
visarea.max_x - visarea.min_x + 1,
visarea.max_y - visarea.min_y + 1,
- (machine->system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
+ (machine.system().flags & ORIENTATION_SWAP_XY) ? "V" : "H",
ATTOSECONDS_TO_HZ(screen->frame_period().attoseconds));
}
}
@@ -1123,7 +1123,7 @@ astring &game_info_astring(running_machine *machine, astring &string)
messagebox_text string but handles no input
-------------------------------------------------*/
-static UINT32 handler_messagebox(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_messagebox(running_machine &machine, render_container *container, UINT32 state)
{
ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
return 0;
@@ -1135,7 +1135,7 @@ static UINT32 handler_messagebox(running_machine *machine, render_container *con
messagebox_text string and waits for an OK
-------------------------------------------------*/
-static UINT32 handler_messagebox_ok(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_messagebox_ok(running_machine &machine, render_container *container, UINT32 state)
{
/* draw a standard message window */
ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
@@ -1151,7 +1151,7 @@ static UINT32 handler_messagebox_ok(running_machine *machine, render_container *
/* if the user cancels, exit out completely */
else if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
- machine->schedule_exit();
+ machine.schedule_exit();
state = UI_HANDLER_CANCEL;
}
@@ -1165,7 +1165,7 @@ static UINT32 handler_messagebox_ok(running_machine *machine, render_container *
any keypress
-------------------------------------------------*/
-static UINT32 handler_messagebox_anykey(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_messagebox_anykey(running_machine &machine, render_container *container, UINT32 state)
{
/* draw a standard message window */
ui_draw_text_box(container, messagebox_text, JUSTIFY_LEFT, 0.5f, 0.5f, messagebox_backcolor);
@@ -1173,7 +1173,7 @@ static UINT32 handler_messagebox_anykey(running_machine *machine, render_contain
/* if the user cancels, exit out completely */
if (ui_input_pressed(machine, IPT_UI_CANCEL))
{
- machine->schedule_exit();
+ machine.schedule_exit();
state = UI_HANDLER_CANCEL;
}
@@ -1189,7 +1189,7 @@ static UINT32 handler_messagebox_anykey(running_machine *machine, render_contain
natural keyboard input
-------------------------------------------------*/
-static void process_natural_keyboard(running_machine *machine)
+static void process_natural_keyboard(running_machine &machine)
{
ui_event event;
int i, pressed;
@@ -1240,7 +1240,7 @@ static void process_natural_keyboard(running_machine *machine)
ui_paste - does a paste from the keyboard
-------------------------------------------------*/
-void ui_paste(running_machine *machine)
+void ui_paste(running_machine &machine)
{
/* retrieve the clipboard text */
char *text = osd_get_clipboard_text();
@@ -1261,14 +1261,14 @@ void ui_paste(running_machine *machine)
callback function for each image device
-------------------------------------------------*/
-void ui_image_handler_ingame(running_machine *machine)
+void ui_image_handler_ingame(running_machine &machine)
{
device_image_interface *image = NULL;
/* run display routine for devices */
- if (machine->phase() == MACHINE_PHASE_RUNNING)
+ if (machine.phase() == MACHINE_PHASE_RUNNING)
{
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
image->call_display();
}
@@ -1281,15 +1281,15 @@ void ui_image_handler_ingame(running_machine *machine)
of the standard keypresses
-------------------------------------------------*/
-static UINT32 handler_ingame(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_ingame(running_machine &machine, render_container *container, UINT32 state)
{
- bool is_paused = machine->paused();
+ bool is_paused = machine.paused();
/* first draw the FPS counter */
if (showfps || osd_ticks() < showfps_end)
{
astring tempstring;
- ui_draw_text_full(container, machine->video().speed_text(tempstring), 0.0f, 0.0f, 1.0f,
+ ui_draw_text_full(container, machine.video().speed_text(tempstring), 0.0f, 0.0f, 1.0f,
JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
else
@@ -1299,19 +1299,19 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (show_profiler)
{
astring profilertext;
- g_profiler.text(*machine, profilertext);
+ g_profiler.text(machine, profilertext);
ui_draw_text_full(container, profilertext, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL);
}
/* if we're single-stepping, pause now */
if (single_step)
{
- machine->pause();
+ machine.pause();
single_step = FALSE;
}
/* determine if we should disable the rest of the UI */
- int ui_disabled = (input_machine_has_keyboard(machine) && !machine->ui_active());
+ int ui_disabled = (input_machine_has_keyboard(machine) && !machine.ui_active());
/* is ScrLk UI toggling applicable here? */
if (input_machine_has_keyboard(machine))
@@ -1320,10 +1320,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_TOGGLE_UI))
{
/* toggle the UI */
- machine->set_ui_active(!machine->ui_active());
+ machine.set_ui_active(!machine.ui_active());
/* display a popup indicating the new status */
- if (machine->ui_active())
+ if (machine.ui_active())
{
ui_popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
"Keyboard Emulation Status",
@@ -1347,7 +1347,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
}
/* is the natural keyboard enabled? */
- if (ui_get_use_natural_keyboard(machine) && (machine->phase() == MACHINE_PHASE_RUNNING))
+ if (ui_get_use_natural_keyboard(machine) && (machine.phase() == MACHINE_PHASE_RUNNING))
process_natural_keyboard(machine);
if (!ui_disabled)
@@ -1362,47 +1362,47 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_disabled) return ui_disabled;
if (ui_input_pressed(machine, IPT_UI_CANCEL))
- machine->schedule_exit();
+ machine.schedule_exit();
/* turn on menus if requested */
if (ui_input_pressed(machine, IPT_UI_CONFIGURE))
return ui_set_handler(ui_menu_ui_handler, 0);
/* if the on-screen display isn't up and the user has toggled it, turn it on */
- if ((machine->debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
+ if ((machine.debug_flags & DEBUG_FLAG_ENABLED) == 0 && ui_input_pressed(machine, IPT_UI_ON_SCREEN_DISPLAY))
return ui_set_handler(ui_slider_ui_handler, 1);
/* handle a reset request */
if (ui_input_pressed(machine, IPT_UI_RESET_MACHINE))
- machine->schedule_hard_reset();
+ machine.schedule_hard_reset();
if (ui_input_pressed(machine, IPT_UI_SOFT_RESET))
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
/* handle a request to display graphics/palette */
if (ui_input_pressed(machine, IPT_UI_SHOW_GFX))
{
if (!is_paused)
- machine->pause();
+ machine.pause();
return ui_set_handler(ui_gfx_ui_handler, is_paused);
}
/* handle a save state request */
if (ui_input_pressed(machine, IPT_UI_SAVE_STATE))
{
- machine->pause();
+ machine.pause();
return ui_set_handler(handler_load_save, LOADSAVE_SAVE);
}
/* handle a load state request */
if (ui_input_pressed(machine, IPT_UI_LOAD_STATE))
{
- machine->pause();
+ machine.pause();
return ui_set_handler(handler_load_save, LOADSAVE_LOAD);
}
/* handle a save snapshot request */
if (ui_input_pressed(machine, IPT_UI_SNAPSHOT))
- machine->video().save_active_screen_snapshots();
+ machine.video().save_active_screen_snapshots();
/* toggle pause */
if (ui_input_pressed(machine, IPT_UI_PAUSE))
@@ -1411,29 +1411,29 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (is_paused && (input_code_pressed(machine, KEYCODE_LSHIFT) || input_code_pressed(machine, KEYCODE_RSHIFT)))
{
single_step = TRUE;
- machine->resume();
+ machine.resume();
}
- else if (machine->paused())
- machine->resume();
+ else if (machine.paused())
+ machine.resume();
else
- machine->pause();
+ machine.pause();
}
/* handle a toggle cheats request */
if (ui_input_pressed(machine, IPT_UI_TOGGLE_CHEAT))
- machine->cheat().set_enable(!machine->cheat().enabled());
+ machine.cheat().set_enable(!machine.cheat().enabled());
/* toggle movie recording */
if (ui_input_pressed(machine, IPT_UI_RECORD_MOVIE))
{
- if (!machine->video().is_recording())
+ if (!machine.video().is_recording())
{
- machine->video().begin_recording(NULL, video_manager::MF_MNG);
+ machine.video().begin_recording(NULL, video_manager::MF_MNG);
popmessage("REC START");
}
else
{
- machine->video().end_recording();
+ machine.video().end_recording();
popmessage("REC STOP");
}
}
@@ -1450,10 +1450,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_INC))
{
/* get the current value and increment it */
- int newframeskip = machine->video().frameskip() + 1;
+ int newframeskip = machine.video().frameskip() + 1;
if (newframeskip > MAX_FRAMESKIP)
newframeskip = -1;
- machine->video().set_frameskip(newframeskip);
+ machine.video().set_frameskip(newframeskip);
/* display the FPS counter for 2 seconds */
ui_show_fps_temp(2.0);
@@ -1463,10 +1463,10 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
if (ui_input_pressed(machine, IPT_UI_FRAMESKIP_DEC))
{
/* get the current value and decrement it */
- int newframeskip = machine->video().frameskip() - 1;
+ int newframeskip = machine.video().frameskip() - 1;
if (newframeskip < -1)
newframeskip = MAX_FRAMESKIP;
- machine->video().set_frameskip(newframeskip);
+ machine.video().set_frameskip(newframeskip);
/* display the FPS counter for 2 seconds */
ui_show_fps_temp(2.0);
@@ -1474,16 +1474,16 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
/* toggle throttle? */
if (ui_input_pressed(machine, IPT_UI_THROTTLE))
- machine->video().set_throttled(!machine->video().throttled());
+ machine.video().set_throttled(!machine.video().throttled());
/* check for fast forward */
if (input_type_pressed(machine, IPT_UI_FAST_FORWARD, 0))
{
- machine->video().set_fastforward(true);
+ machine.video().set_fastforward(true);
ui_show_fps_temp(0.5);
}
else
- machine->video().set_fastforward(false);
+ machine.video().set_fastforward(false);
return 0;
}
@@ -1494,7 +1494,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain
specifying a game to save or load
-------------------------------------------------*/
-static UINT32 handler_load_save(running_machine *machine, render_container *container, UINT32 state)
+static UINT32 handler_load_save(running_machine &machine, render_container *container, UINT32 state)
{
char filename[20];
input_code code;
@@ -1520,7 +1520,7 @@ static UINT32 handler_load_save(running_machine *machine, render_container *cont
popmessage("Load cancelled");
/* reset the state */
- machine->resume();
+ machine.resume();
return UI_HANDLER_CANCEL;
}
@@ -1544,16 +1544,16 @@ static UINT32 handler_load_save(running_machine *machine, render_container *cont
if (state == LOADSAVE_SAVE)
{
popmessage("Save to position %c", file);
- machine->schedule_save(filename);
+ machine.schedule_save(filename);
}
else
{
popmessage("Load from position %c", file);
- machine->schedule_load(filename);
+ machine.schedule_load(filename);
}
/* remove the pause and reset the state */
- machine->resume();
+ machine.resume();
return UI_HANDLER_CANCEL;
}
@@ -1577,7 +1577,7 @@ const slider_state *ui_get_slider_list(void)
slider_alloc - allocate a new slider entry
-------------------------------------------------*/
-static slider_state *slider_alloc(running_machine *machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
+static slider_state *slider_alloc(running_machine &machine, const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
{
int size = sizeof(slider_state) + strlen(title);
slider_state *state = (slider_state *)auto_alloc_array_clear(machine, UINT8, size);
@@ -1599,7 +1599,7 @@ static slider_state *slider_alloc(running_machine *machine, const char *title, I
controls
-------------------------------------------------*/
-static slider_state *slider_init(running_machine *machine)
+static slider_state *slider_init(running_machine &machine)
{
const input_field_config *field;
const input_port_config *port;
@@ -1615,7 +1615,7 @@ static slider_state *slider_init(running_machine *machine)
/* add per-channel volume */
speaker_input info;
- for (item = 0; machine->sound().indexed_speaker_input(item, info); item++)
+ for (item = 0; machine.sound().indexed_speaker_input(item, info); item++)
{
INT32 maxval = 2000;
INT32 defval = info.stream->initial_input_gain(info.inputnum) * 1000.0f + 0.5f;
@@ -1630,7 +1630,7 @@ static slider_state *slider_init(running_machine *machine)
}
/* add analog adjusters */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->type == IPT_ADJUSTER)
{
@@ -1640,10 +1640,10 @@ static slider_state *slider_init(running_machine *machine)
}
/* add CPU overclocking (cheat only) */
- if (machine->options().cheat())
+ if (machine.options().cheat())
{
device_execute_interface *exec = NULL;
- for (bool gotone = machine->m_devicelist.first(exec); gotone; gotone = exec->next(exec))
+ for (bool gotone = machine.m_devicelist.first(exec); gotone; gotone = exec->next(exec))
{
void *param = (void *)&exec->device();
string.printf("Overclock CPU %s", exec->device().tag());
@@ -1653,7 +1653,7 @@ static slider_state *slider_init(running_machine *machine)
}
/* add screen parameters */
- for (screen_device *screen = machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
{
int defxscale = floor(screen->config().xscale() * 1000.0f + 0.5f);
int defyscale = floor(screen->config().yscale() * 1000.0f + 0.5f);
@@ -1662,7 +1662,7 @@ static slider_state *slider_init(running_machine *machine)
void *param = (void *)screen;
/* add refresh rate tweaker */
- if (machine->options().cheat())
+ if (machine.options().cheat())
{
string.printf("%s Refresh Rate", slider_get_screen_desc(*screen));
*tailptr = slider_alloc(machine, string, -10000, 0, 10000, 1000, slider_refresh, param);
@@ -1695,7 +1695,7 @@ static slider_state *slider_init(running_machine *machine)
tailptr = &(*tailptr)->next;
}
- for (device = machine->m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
+ for (device = machine.m_devicelist.first(LASERDISC); device != NULL; device = device->typenext())
{
const laserdisc_config *config = (const laserdisc_config *)downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config();
if (config->overupdate != NULL)
@@ -1722,7 +1722,7 @@ static slider_state *slider_init(running_machine *machine)
}
}
- for (screen_device *screen = machine->first_screen(); screen != NULL; screen = screen->next_screen())
+ for (screen_device *screen = machine.first_screen(); screen != NULL; screen = screen->next_screen())
if (screen->screen_type() == SCREEN_TYPE_VECTOR)
{
/* add flicker control */
@@ -1735,7 +1735,7 @@ static slider_state *slider_init(running_machine *machine)
#ifdef MAME_DEBUG
/* add crosshair adjusters */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->crossaxis != CROSSHAIR_AXIS_NONE && field->player == 0)
{
@@ -1757,13 +1757,13 @@ static slider_state *slider_init(running_machine *machine)
slider_volume - global volume slider callback
-------------------------------------------------*/
-static INT32 slider_volume(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_volume(running_machine &machine, void *arg, astring *string, INT32 newval)
{
if (newval != SLIDER_NOCHANGE)
- machine->sound().set_attenuation(newval);
+ machine.sound().set_attenuation(newval);
if (string != NULL)
- string->printf("%3ddB", machine->sound().attenuation());
- return machine->sound().attenuation();
+ string->printf("%3ddB", machine.sound().attenuation());
+ return machine.sound().attenuation();
}
@@ -1772,10 +1772,10 @@ static INT32 slider_volume(running_machine *machine, void *arg, astring *string,
slider callback
-------------------------------------------------*/
-static INT32 slider_mixervol(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_mixervol(running_machine &machine, void *arg, astring *string, INT32 newval)
{
speaker_input info;
- if (!machine->sound().indexed_speaker_input((FPTR)arg, info))
+ if (!machine.sound().indexed_speaker_input((FPTR)arg, info))
return 0;
if (newval != SLIDER_NOCHANGE)
{
@@ -1794,7 +1794,7 @@ static INT32 slider_mixervol(running_machine *machine, void *arg, astring *strin
callback
-------------------------------------------------*/
-static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_adjuster(running_machine &machine, void *arg, astring *string, INT32 newval)
{
const input_field_config *field = (const input_field_config *)arg;
input_field_user_settings settings;
@@ -1816,7 +1816,7 @@ static INT32 slider_adjuster(running_machine *machine, void *arg, astring *strin
callback
-------------------------------------------------*/
-static INT32 slider_overclock(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overclock(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *cpu = (device_t *)arg;
if (newval != SLIDER_NOCHANGE)
@@ -1831,7 +1831,7 @@ static INT32 slider_overclock(running_machine *machine, void *arg, astring *stri
slider_refresh - refresh rate slider callback
-------------------------------------------------*/
-static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_refresh(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
double defrefresh = ATTOSECONDS_TO_HZ(screen->config().refresh());
@@ -1845,8 +1845,8 @@ static INT32 slider_refresh(running_machine *machine, void *arg, astring *string
screen->configure(width, height, visarea, HZ_TO_ATTOSECONDS(defrefresh + (double)newval * 0.001));
}
if (string != NULL)
- string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds));
- refresh = ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds);
+ string->printf("%.3ffps", ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds));
+ refresh = ATTOSECONDS_TO_HZ(machine.primary_screen->frame_period().attoseconds);
return floor((refresh - defrefresh) * 1000.0f + 0.5f);
}
@@ -1856,7 +1856,7 @@ static INT32 slider_refresh(running_machine *machine, void *arg, astring *string
callback
-------------------------------------------------*/
-static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_brightness(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1878,7 +1878,7 @@ static INT32 slider_brightness(running_machine *machine, void *arg, astring *str
callback
-------------------------------------------------*/
-static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_contrast(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1899,7 +1899,7 @@ static INT32 slider_contrast(running_machine *machine, void *arg, astring *strin
slider_gamma - screen gamma slider callback
-------------------------------------------------*/
-static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_gamma(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1921,7 +1921,7 @@ static INT32 slider_gamma(running_machine *machine, void *arg, astring *string,
callback
-------------------------------------------------*/
-static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_xscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1943,7 +1943,7 @@ static INT32 slider_xscale(running_machine *machine, void *arg, astring *string,
callback
-------------------------------------------------*/
-static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_yscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1965,7 +1965,7 @@ static INT32 slider_yscale(running_machine *machine, void *arg, astring *string,
slider callback
-------------------------------------------------*/
-static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_xoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -1987,7 +1987,7 @@ static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string
slider callback
-------------------------------------------------*/
-static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_yoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
screen_device *screen = reinterpret_cast<screen_device *>(arg);
render_container::user_settings settings;
@@ -2009,7 +2009,7 @@ static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string
callback
-------------------------------------------------*/
-static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overxscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2031,7 +2031,7 @@ static INT32 slider_overxscale(running_machine *machine, void *arg, astring *str
callback
-------------------------------------------------*/
-static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overyscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2053,7 +2053,7 @@ static INT32 slider_overyscale(running_machine *machine, void *arg, astring *str
slider callback
-------------------------------------------------*/
-static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overxoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2075,7 +2075,7 @@ static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *st
slider callback
-------------------------------------------------*/
-static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_overyoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
device_t *laserdisc = (device_t *)arg;
laserdisc_config settings;
@@ -2097,7 +2097,7 @@ static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *st
callback
-------------------------------------------------*/
-static INT32 slider_flicker(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_flicker(running_machine &machine, void *arg, astring *string, INT32 newval)
{
if (newval != SLIDER_NOCHANGE)
vector_set_flicker((float)newval * 0.1f);
@@ -2112,7 +2112,7 @@ static INT32 slider_flicker(running_machine *machine, void *arg, astring *string
callback
-------------------------------------------------*/
-static INT32 slider_beam(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_beam(running_machine &machine, void *arg, astring *string, INT32 newval)
{
if (newval != SLIDER_NOCHANGE)
vector_set_beam((float)newval * 0.01f);
@@ -2129,7 +2129,7 @@ static INT32 slider_beam(running_machine *machine, void *arg, astring *string, I
static char *slider_get_screen_desc(screen_device &screen)
{
- int scrcount = screen.machine->m_devicelist.count(SCREEN);
+ int scrcount = screen.machine().m_devicelist.count(SCREEN);
static char descbuf[256];
if (scrcount > 1)
@@ -2148,7 +2148,7 @@ static char *slider_get_screen_desc(screen_device &screen)
static char *slider_get_laserdisc_desc(device_t *laserdisc)
{
- int ldcount = laserdisc->machine->m_devicelist.count(LASERDISC);
+ int ldcount = laserdisc->machine().m_devicelist.count(LASERDISC);
static char descbuf[256];
if (ldcount > 1)
@@ -2166,7 +2166,7 @@ static char *slider_get_laserdisc_desc(device_t *laserdisc)
-------------------------------------------------*/
#ifdef MAME_DEBUG
-static INT32 slider_crossscale(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_crossscale(running_machine &machine, void *arg, astring *string, INT32 newval)
{
input_field_config *field = (input_field_config *)arg;
@@ -2185,7 +2185,7 @@ static INT32 slider_crossscale(running_machine *machine, void *arg, astring *str
-------------------------------------------------*/
#ifdef MAME_DEBUG
-static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
+static INT32 slider_crossoffset(running_machine &machine, void *arg, astring *string, INT32 newval)
{
input_field_config *field = (input_field_config *)arg;
@@ -2203,7 +2203,7 @@ static INT32 slider_crossoffset(running_machine *machine, void *arg, astring *st
whether the natural keyboard is active
-------------------------------------------------*/
-int ui_get_use_natural_keyboard(running_machine *machine)
+int ui_get_use_natural_keyboard(running_machine &machine)
{
return ui_use_natural_keyboard;
}
@@ -2215,11 +2215,11 @@ int ui_get_use_natural_keyboard(running_machine *machine)
whether the natural keyboard is active
-------------------------------------------------*/
-void ui_set_use_natural_keyboard(running_machine *machine, int use_natural_keyboard)
+void ui_set_use_natural_keyboard(running_machine &machine, int use_natural_keyboard)
{
ui_use_natural_keyboard = use_natural_keyboard;
astring error;
- machine->options().set_value(OPTION_NATURAL_KEYBOARD, use_natural_keyboard, OPTION_PRIORITY_CMDLINE, error);
+ machine.options().set_value(OPTION_NATURAL_KEYBOARD, use_natural_keyboard, OPTION_PRIORITY_CMDLINE, error);
assert(!error);
}
diff --git a/src/emu/ui.h b/src/emu/ui.h
index d4f35f6b569..6eb096032ec 100644
--- a/src/emu/ui.h
+++ b/src/emu/ui.h
@@ -91,7 +91,7 @@ enum
TYPE DEFINITIONS
***************************************************************************/
-typedef INT32 (*slider_update)(running_machine *machine, void *arg, astring *string, INT32 newval);
+typedef INT32 (*slider_update)(running_machine &machine, void *arg, astring *string, INT32 newval);
typedef struct _slider_state slider_state;
struct _slider_state
@@ -121,16 +121,16 @@ struct _slider_state
***************************************************************************/
/* main init/exit routines */
-int ui_init(running_machine *machine);
+int ui_init(running_machine &machine);
/* display the startup screens */
-int ui_display_startup_screens(running_machine *machine, int first_time, int show_disclaimer);
+int ui_display_startup_screens(running_machine &machine, int first_time, int show_disclaimer);
/* set the current text to display at startup */
-void ui_set_startup_text(running_machine *machine, const char *text, int force);
+void ui_set_startup_text(running_machine &machine, const char *text, int force);
/* once-per-frame update and render */
-void ui_update_and_render(running_machine *machine, render_container *container);
+void ui_update_and_render(running_machine &machine, render_container *container);
/* returns the current UI font */
render_font *ui_get_font(running_machine &machine);
@@ -173,18 +173,18 @@ void ui_show_menu(void);
int ui_is_menu_active(void);
/* print the game info string into a buffer */
-astring &game_info_astring(running_machine *machine, astring &string);
+astring &game_info_astring(running_machine &machine, astring &string);
/* get the list of sliders */
const slider_state *ui_get_slider_list(void);
/* paste */
-void ui_paste(running_machine *machine);
+void ui_paste(running_machine &machine);
/* returns whether the natural keyboard is active */
-int ui_get_use_natural_keyboard(running_machine *machine);
+int ui_get_use_natural_keyboard(running_machine &machine);
/* specifies whether the natural keyboard is active */
-void ui_set_use_natural_keyboard(running_machine *machine, int use_natural_keyboard);
+void ui_set_use_natural_keyboard(running_machine &machine, int use_natural_keyboard);
#endif /* __USRINTRF_H__ */
diff --git a/src/emu/uigfx.c b/src/emu/uigfx.c
index 5b413e3fb03..2167be8a64b 100644
--- a/src/emu/uigfx.c
+++ b/src/emu/uigfx.c
@@ -79,19 +79,19 @@ static ui_gfx_state ui_gfx;
static void ui_gfx_exit(running_machine &machine);
/* palette handling */
-static void palette_handle_keys(running_machine *machine, ui_gfx_state *state);
-static void palette_handler(running_machine *machine, render_container *container, ui_gfx_state *state);
+static void palette_handle_keys(running_machine &machine, ui_gfx_state *state);
+static void palette_handler(running_machine &machine, render_container *container, ui_gfx_state *state);
/* graphics set handling */
-static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, int xcells, int ycells);
-static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate);
-static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx);
-static void gfxset_handler(running_machine *machine, render_container *container, ui_gfx_state *state);
+static void gfxset_handle_keys(running_machine &machine, ui_gfx_state *state, int xcells, int ycells);
+static void gfxset_draw_item(running_machine &machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate);
+static void gfxset_update_bitmap(running_machine &machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx);
+static void gfxset_handler(running_machine &machine, render_container *container, ui_gfx_state *state);
/* tilemap handling */
-static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, int viswidth, int visheight);
-static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height);
-static void tilemap_handler(running_machine *machine, render_container *container, ui_gfx_state *state);
+static void tilemap_handle_keys(running_machine &machine, ui_gfx_state *state, int viswidth, int visheight);
+static void tilemap_update_bitmap(running_machine &machine, ui_gfx_state *state, int width, int height);
+static void tilemap_handler(running_machine &machine, render_container *container, ui_gfx_state *state);
@@ -103,13 +103,13 @@ static void tilemap_handler(running_machine *machine, render_container *containe
ui_gfx_init - initialize the menu system
-------------------------------------------------*/
-void ui_gfx_init(running_machine *machine)
+void ui_gfx_init(running_machine &machine)
{
ui_gfx_state *state = &ui_gfx;
int gfx;
/* make sure we clean up after ourselves */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ui_gfx_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ui_gfx_exit);
/* initialize our global state */
memset(state, 0, sizeof(*state));
@@ -120,12 +120,12 @@ void ui_gfx_init(running_machine *machine)
/* set up the graphics state */
for (gfx = 0; gfx < MAX_GFX_ELEMENTS; gfx++)
{
- state->gfxset.rotate[gfx] = machine->system().flags & ORIENTATION_MASK;
+ state->gfxset.rotate[gfx] = machine.system().flags & ORIENTATION_MASK;
state->gfxset.count[gfx] = 16;
}
/* set up the tilemap state */
- state->tilemap.rotate = machine->system().flags & ORIENTATION_MASK;
+ state->tilemap.rotate = machine.system().flags & ORIENTATION_MASK;
}
@@ -149,16 +149,16 @@ static void ui_gfx_exit(running_machine &machine)
ui_gfx_ui_handler - primary UI handler
-------------------------------------------------*/
-UINT32 ui_gfx_ui_handler(running_machine *machine, render_container *container, UINT32 uistate)
+UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 uistate)
{
ui_gfx_state *state = &ui_gfx;
/* if we have nothing, implicitly cancel */
- if (machine->total_colors() == 0 && machine->colortable == NULL && machine->gfx[0] == NULL && tilemap_count(machine) == 0)
+ if (machine.total_colors() == 0 && machine.colortable == NULL && machine.gfx[0] == NULL && tilemap_count(machine) == 0)
goto cancel;
/* if we're not paused, mark the bitmap dirty */
- if (!machine->paused())
+ if (!machine.paused())
state->bitmap_dirty = TRUE;
/* switch off the state to display something */
@@ -167,7 +167,7 @@ again:
{
case 0:
/* if we have a palette, display it */
- if (machine->total_colors() > 0)
+ if (machine.total_colors() > 0)
{
palette_handler(machine, container, state);
break;
@@ -178,7 +178,7 @@ again:
case 1:
/* if we have graphics sets, display them */
- if (machine->gfx[0] != NULL)
+ if (machine.gfx[0] != NULL)
{
gfxset_handler(machine, container, state);
break;
@@ -208,10 +208,10 @@ again:
if (ui_input_pressed(machine, IPT_UI_PAUSE))
{
- if (machine->paused())
- machine->resume();
+ if (machine.paused())
+ machine.resume();
else
- machine->pause();
+ machine.pause();
}
if (ui_input_pressed(machine, IPT_UI_CANCEL) || ui_input_pressed(machine, IPT_UI_SHOW_GFX))
@@ -221,7 +221,7 @@ again:
cancel:
if (!uistate)
- machine->resume();
+ machine.resume();
state->bitmap_dirty = TRUE;
return UI_HANDLER_CANCEL;
}
@@ -237,12 +237,12 @@ cancel:
viewer
-------------------------------------------------*/
-static void palette_handler(running_machine *machine, render_container *container, ui_gfx_state *state)
+static void palette_handler(running_machine &machine, render_container *container, ui_gfx_state *state)
{
- int total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->total_colors();
+ int total = state->palette.which ? colortable_palette_get_size(machine.colortable) : machine.total_colors();
const char *title = state->palette.which ? "COLORTABLE" : "PALETTE";
- const rgb_t *raw_color = palette_entry_list_raw(machine->palette);
- render_font *ui_font = ui_get_font(*machine);
+ const rgb_t *raw_color = palette_entry_list_raw(machine.palette);
+ render_font *ui_font = ui_get_font(machine);
float cellwidth, cellheight;
float chwidth, chheight;
float titlewidth;
@@ -252,8 +252,8 @@ static void palette_handler(running_machine *machine, render_container *containe
int x, y, skip;
/* add a half character padding for the box */
- chheight = ui_get_line_height(*machine);
- chwidth = ui_font->char_width(chheight, machine->render().ui_aspect(), '0');
+ chheight = ui_get_line_height(machine);
+ chwidth = ui_font->char_width(chheight, machine.render().ui_aspect(), '0');
boxbounds.x0 = 0.0f + 0.5f * chwidth;
boxbounds.x1 = 1.0f - 0.5f * chwidth;
boxbounds.y0 = 0.0f + 0.5f * chheight;
@@ -273,7 +273,7 @@ static void palette_handler(running_machine *machine, render_container *containe
cellboxbounds.y0 += 3.0f * chheight;
/* figure out the title and expand the outer box to fit */
- titlewidth = ui_font->string_width(chheight, machine->render().ui_aspect(), title);
+ titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
x0 = 0.0f;
if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
x0 = boxbounds.x0 - (0.5f - 0.5f * (titlewidth + chwidth));
@@ -286,8 +286,8 @@ static void palette_handler(running_machine *machine, render_container *containe
y0 = boxbounds.y0 + 0.5f * chheight;
for (x = 0; title[x] != 0; x++)
{
- container->add_char(x0, y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
- x0 += ui_font->char_width(chheight, machine->render().ui_aspect(), title[x]);
+ container->add_char(x0, y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
+ x0 += ui_font->char_width(chheight, machine.render().ui_aspect(), title[x]);
}
/* compute the cell size */
@@ -300,7 +300,7 @@ static void palette_handler(running_machine *machine, render_container *containe
{
x0 = boxbounds.x0 + 6.0f * chwidth + (float)x * cellwidth;
y0 = boxbounds.y0 + 2.0f * chheight;
- container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
+ container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
/* if we're skipping, draw a point between the character and the box to indicate which */
/* one it's referring to */
@@ -328,8 +328,8 @@ static void palette_handler(running_machine *machine, render_container *containe
sprintf(buffer, "%5X", state->palette.offset + y * state->palette.count);
for (x = 4; x >= 0; x--)
{
- x0 -= ui_font->char_width(chheight, machine->render().ui_aspect(), buffer[x]);
- container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
+ x0 -= ui_font->char_width(chheight, machine.render().ui_aspect(), buffer[x]);
+ container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
}
}
@@ -340,7 +340,7 @@ static void palette_handler(running_machine *machine, render_container *containe
int index = state->palette.offset + y * state->palette.count + x;
if (index < total)
{
- pen_t pen = state->palette.which ? colortable_palette_get_color(machine->colortable, index) : raw_color[index];
+ pen_t pen = state->palette.which ? colortable_palette_get_color(machine.colortable, index) : raw_color[index];
container->add_rect(cellboxbounds.x0 + x * cellwidth, cellboxbounds.y0 + y * cellheight,
cellboxbounds.x0 + (x + 1) * cellwidth, cellboxbounds.y0 + (y + 1) * cellheight,
0xff000000 | pen, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
@@ -357,7 +357,7 @@ static void palette_handler(running_machine *machine, render_container *containe
palette viewer
-------------------------------------------------*/
-static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
+static void palette_handle_keys(running_machine &machine, ui_gfx_state *state)
{
int rowcount, screencount;
int total;
@@ -383,11 +383,11 @@ static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
/* clamp within range */
if (state->palette.which < 0)
state->palette.which = 1;
- if (state->palette.which > (int)(machine->colortable != NULL))
- state->palette.which = (int)(machine->colortable != NULL);
+ if (state->palette.which > (int)(machine.colortable != NULL))
+ state->palette.which = (int)(machine.colortable != NULL);
/* cache some info in locals */
- total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->total_colors();
+ total = state->palette.which ? colortable_palette_get_size(machine.colortable) : machine.total_colors();
/* determine number of entries per row and total */
rowcount = state->palette.count;
@@ -425,11 +425,11 @@ static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
viewer
-------------------------------------------------*/
-static void gfxset_handler(running_machine *machine, render_container *container, ui_gfx_state *state)
+static void gfxset_handler(running_machine &machine, render_container *container, ui_gfx_state *state)
{
- render_font *ui_font = ui_get_font(*machine);
+ render_font *ui_font = ui_get_font(machine);
int set = state->gfxset.set;
- gfx_element *gfx = machine->gfx[set];
+ gfx_element *gfx = machine.gfx[set];
float fullwidth, fullheight;
float cellwidth, cellheight;
float chwidth, chheight;
@@ -439,8 +439,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
render_bounds cellboxbounds;
render_bounds boxbounds;
int cellboxwidth, cellboxheight;
- int targwidth = machine->render().ui_target().width();
- int targheight = machine->render().ui_target().height();
+ int targwidth = machine.render().ui_target().width();
+ int targheight = machine.render().ui_target().height();
int cellxpix, cellypix;
int xcells, ycells;
int pixelscale = 0;
@@ -448,8 +448,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
char title[100];
/* add a half character padding for the box */
- chheight = ui_get_line_height(*machine);
- chwidth = ui_font->char_width(chheight, machine->render().ui_aspect(), '0');
+ chheight = ui_get_line_height(machine);
+ chwidth = ui_font->char_width(chheight, machine.render().ui_aspect(), '0');
boxbounds.x0 = 0.0f + 0.5f * chwidth;
boxbounds.x1 = 1.0f - 0.5f * chwidth;
boxbounds.y0 = 0.0f + 0.5f * chheight;
@@ -512,9 +512,9 @@ static void gfxset_handler(running_machine *machine, render_container *container
boxbounds.y1 = boxbounds.y0 + fullheight;
/* figure out the title and expand the outer box to fit */
- for (x = 0; x < MAX_GFX_ELEMENTS && machine->gfx[x] != NULL; x++) ;
+ for (x = 0; x < MAX_GFX_ELEMENTS && machine.gfx[x] != NULL; x++) ;
sprintf(title, "GFX %d/%d %dx%d COLOR %X", state->gfxset.set, x - 1, gfx->width, gfx->height, state->gfxset.color[set]);
- titlewidth = ui_font->string_width(chheight, machine->render().ui_aspect(), title);
+ titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
x0 = 0.0f;
if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
x0 = boxbounds.x0 - (0.5f - 0.5f * (titlewidth + chwidth));
@@ -527,8 +527,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
y0 = boxbounds.y0 + 0.5f * chheight;
for (x = 0; title[x] != 0; x++)
{
- container->add_char(x0, y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
- x0 += ui_font->char_width(chheight, machine->render().ui_aspect(), title[x]);
+ container->add_char(x0, y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
+ x0 += ui_font->char_width(chheight, machine.render().ui_aspect(), title[x]);
}
/* draw the top column headers */
@@ -537,7 +537,7 @@ static void gfxset_handler(running_machine *machine, render_container *container
{
x0 = boxbounds.x0 + 6.0f * chwidth + (float)x * cellwidth;
y0 = boxbounds.y0 + 2.0f * chheight;
- container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
+ container->add_char(x0 + 0.5f * (cellwidth - chwidth), y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, "0123456789ABCDEF"[x & 0xf]);
/* if we're skipping, draw a point between the character and the box to indicate which */
/* one it's referring to */
@@ -565,8 +565,8 @@ static void gfxset_handler(running_machine *machine, render_container *container
sprintf(buffer, "%5X", state->gfxset.offset[set] + y * xcells);
for (x = 4; x >= 0; x--)
{
- x0 -= ui_font->char_width(chheight, machine->render().ui_aspect(), buffer[x]);
- container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
+ x0 -= ui_font->char_width(chheight, machine.render().ui_aspect(), buffer[x]);
+ container->add_char(x0, y0 + 0.5f * (cellheight - chheight), chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, buffer[x]);
}
}
@@ -589,7 +589,7 @@ static void gfxset_handler(running_machine *machine, render_container *container
graphics viewer
-------------------------------------------------*/
-static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, int xcells, int ycells)
+static void gfxset_handle_keys(running_machine &machine, ui_gfx_state *state, int xcells, int ycells)
{
ui_gfx_state oldstate = *state;
gfx_element *gfx;
@@ -599,7 +599,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
if (ui_input_pressed(machine, IPT_UI_PREV_GROUP))
{
for (temp = state->gfxset.set - 1; temp >= 0; temp--)
- if (machine->gfx[temp] != NULL)
+ if (machine.gfx[temp] != NULL)
break;
if (temp >= 0)
state->gfxset.set = temp;
@@ -607,7 +607,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
if (ui_input_pressed(machine, IPT_UI_NEXT_GROUP))
{
for (temp = state->gfxset.set + 1; temp < MAX_GFX_ELEMENTS; temp++)
- if (machine->gfx[temp] != NULL)
+ if (machine.gfx[temp] != NULL)
break;
if (temp < MAX_GFX_ELEMENTS)
state->gfxset.set = temp;
@@ -615,7 +615,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
/* cache some info in locals */
set = state->gfxset.set;
- gfx = machine->gfx[set];
+ gfx = machine.gfx[set];
/* handle cells per line (minus,plus) */
if (ui_input_pressed(machine, IPT_UI_ZOOM_OUT))
@@ -682,7 +682,7 @@ static void gfxset_handle_keys(running_machine *machine, ui_gfx_state *state, in
graphics view bitmap
-------------------------------------------------*/
-static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx)
+static void gfxset_update_bitmap(running_machine &machine, ui_gfx_state *state, int xcells, int ycells, gfx_element *gfx)
{
int set = state->gfxset.set;
int cellxpix, cellypix;
@@ -696,12 +696,12 @@ static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state,
if (state->bitmap == NULL || state->texture == NULL || state->bitmap->bpp != 32 || state->bitmap->width != cellxpix * xcells || state->bitmap->height != cellypix * ycells)
{
/* free the old stuff */
- machine->render().texture_free(state->texture);
+ machine.render().texture_free(state->texture);
global_free(state->bitmap);
/* allocate new stuff */
state->bitmap = global_alloc(bitmap_t(cellxpix * xcells, cellypix * ycells, BITMAP_FORMAT_ARGB32));
- state->texture = machine->render().texture_alloc();
+ state->texture = machine.render().texture_alloc();
state->texture->set_bitmap(state->bitmap, NULL, TEXFORMAT_ARGB32);
/* force a redraw */
@@ -761,7 +761,7 @@ static void gfxset_update_bitmap(running_machine *machine, ui_gfx_state *state,
the view
-------------------------------------------------*/
-static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate)
+static void gfxset_draw_item(running_machine &machine, const gfx_element *gfx, int index, bitmap_t *bitmap, int dstx, int dsty, int color, int rotate)
{
static const pen_t default_palette[] =
{
@@ -770,7 +770,7 @@ static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, i
};
int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width;
int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height;
- const rgb_t *palette = (machine->total_colors() != 0) ? palette_entry_list_raw(machine->palette) : NULL;
+ const rgb_t *palette = (machine.total_colors() != 0) ? palette_entry_list_raw(machine.palette) : NULL;
UINT32 rowpixels = bitmap->rowpixels;
UINT32 palette_mask = ~0;
int x, y;
@@ -838,14 +838,14 @@ static void gfxset_draw_item(running_machine *machine, const gfx_element *gfx, i
viewer
-------------------------------------------------*/
-static void tilemap_handler(running_machine *machine, render_container *container, ui_gfx_state *state)
+static void tilemap_handler(running_machine &machine, render_container *container, ui_gfx_state *state)
{
- render_font *ui_font = ui_get_font(*machine);
+ render_font *ui_font = ui_get_font(machine);
float chwidth, chheight;
render_bounds mapboxbounds;
render_bounds boxbounds;
- int targwidth = machine->render().ui_target().width();
- int targheight = machine->render().ui_target().height();
+ int targwidth = machine.render().ui_target().width();
+ int targheight = machine.render().ui_target().height();
float titlewidth;
float x0, y0;
int mapboxwidth, mapboxheight;
@@ -860,8 +860,8 @@ static void tilemap_handler(running_machine *machine, render_container *containe
{ UINT32 temp = mapwidth; mapwidth = mapheight; mapheight = temp; }
/* add a half character padding for the box */
- chheight = ui_get_line_height(*machine);
- chwidth = ui_font->char_width(chheight, machine->render().ui_aspect(), '0');
+ chheight = ui_get_line_height(machine);
+ chwidth = ui_font->char_width(chheight, machine.render().ui_aspect(), '0');
boxbounds.x0 = 0.0f + 0.5f * chwidth;
boxbounds.x1 = 1.0f - 0.5f * chwidth;
boxbounds.y0 = 0.0f + 0.5f * chheight;
@@ -908,7 +908,7 @@ static void tilemap_handler(running_machine *machine, render_container *containe
/* figure out the title and expand the outer box to fit */
sprintf(title, "TMAP %d/%d %dx%d OFFS %d,%d", state->tilemap.which, tilemap_count(machine) - 1, mapwidth, mapheight, state->tilemap.xoffs, state->tilemap.yoffs);
- titlewidth = ui_font->string_width(chheight, machine->render().ui_aspect(), title);
+ titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
if (boxbounds.x1 - boxbounds.x0 < titlewidth + chwidth)
{
boxbounds.x0 = 0.5f - 0.5f * (titlewidth + chwidth);
@@ -923,8 +923,8 @@ static void tilemap_handler(running_machine *machine, render_container *containe
y0 = boxbounds.y0 + 0.5f * chheight;
for (x = 0; title[x] != 0; x++)
{
- container->add_char(x0, y0, chheight, machine->render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
- x0 += ui_font->char_width(chheight, machine->render().ui_aspect(), title[x]);
+ container->add_char(x0, y0, chheight, machine.render().ui_aspect(), ARGB_WHITE, *ui_font, title[x]);
+ x0 += ui_font->char_width(chheight, machine.render().ui_aspect(), title[x]);
}
/* update the bitmap */
@@ -946,7 +946,7 @@ static void tilemap_handler(running_machine *machine, render_container *containe
tilemap view
-------------------------------------------------*/
-static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, int viswidth, int visheight)
+static void tilemap_handle_keys(running_machine &machine, ui_gfx_state *state, int viswidth, int visheight)
{
ui_gfx_state oldstate = *state;
UINT32 mapwidth, mapheight;
@@ -1029,16 +1029,16 @@ static void tilemap_handle_keys(running_machine *machine, ui_gfx_state *state, i
for the tilemap view
-------------------------------------------------*/
-static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state, int width, int height)
+static void tilemap_update_bitmap(running_machine &machine, ui_gfx_state *state, int width, int height)
{
- bitmap_format screen_format = machine->primary_screen->format();
+ bitmap_format screen_format = machine.primary_screen->format();
palette_t *palette = NULL;
int screen_texformat;
/* convert the screen format to a texture format */
switch (screen_format)
{
- case BITMAP_FORMAT_INDEXED16: screen_texformat = TEXFORMAT_PALETTE16; palette = machine->palette; break;
+ case BITMAP_FORMAT_INDEXED16: screen_texformat = TEXFORMAT_PALETTE16; palette = machine.palette; break;
case BITMAP_FORMAT_RGB15: screen_texformat = TEXFORMAT_RGB15; palette = NULL; break;
case BITMAP_FORMAT_RGB32: screen_texformat = TEXFORMAT_RGB32; palette = NULL; break;
default: fatalerror("Invalid bitmap format!"); break;
@@ -1052,12 +1052,12 @@ static void tilemap_update_bitmap(running_machine *machine, ui_gfx_state *state,
if (state->bitmap == NULL || state->texture == NULL || state->bitmap->format != screen_format || state->bitmap->width != width || state->bitmap->height != height)
{
/* free the old stuff */
- machine->render().texture_free(state->texture);
+ machine.render().texture_free(state->texture);
global_free(state->bitmap);
/* allocate new stuff */
state->bitmap = global_alloc(bitmap_t(width, height, screen_format));
- state->texture = machine->render().texture_alloc();
+ state->texture = machine.render().texture_alloc();
state->texture->set_bitmap(state->bitmap, NULL, screen_texformat, palette);
/* force a redraw */
diff --git a/src/emu/uigfx.h b/src/emu/uigfx.h
index d7d1d2c42e8..c514916d127 100644
--- a/src/emu/uigfx.h
+++ b/src/emu/uigfx.h
@@ -21,10 +21,10 @@
***************************************************************************/
/* initialization */
-void ui_gfx_init(running_machine *machine);
+void ui_gfx_init(running_machine &machine);
/* master handler */
-UINT32 ui_gfx_ui_handler(running_machine *machine, render_container *container, UINT32 state);
+UINT32 ui_gfx_ui_handler(running_machine &machine, render_container *container, UINT32 state);
#endif /* __UIGFX_H__ */
diff --git a/src/emu/uiimage.c b/src/emu/uiimage.c
index 7c903b3cfe0..5405ff6d2c3 100644
--- a/src/emu/uiimage.c
+++ b/src/emu/uiimage.c
@@ -196,7 +196,7 @@ static void extra_text_draw_box(render_container &ui_container, float origx1, fl
and footer text
-------------------------------------------------*/
-static void extra_text_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom,
+static void extra_text_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom,
float origx1, float origy1, float origx2, float origy2,
const char *header, const char *footer)
{
@@ -204,9 +204,9 @@ static void extra_text_render(running_machine *machine, ui_menu *menu, void *sta
footer = ((footer != NULL) && (footer[0] != '\0')) ? footer : NULL;
if (header != NULL)
- extra_text_draw_box(machine->render().ui_container(), origx1, origx2, origy1, top, header, -1);
+ extra_text_draw_box(machine.render().ui_container(), origx1, origx2, origy1, top, header, -1);
if (footer != NULL)
- extra_text_draw_box(machine->render().ui_container(), origx1, origx2, origy2, bottom, footer, +1);
+ extra_text_draw_box(machine.render().ui_container(), origx1, origx2, origy2, bottom, footer, +1);
}
@@ -220,7 +220,7 @@ static void extra_text_render(running_machine *machine, ui_menu *menu, void *sta
confirm save as menu
-------------------------------------------------*/
-static void menu_confirm_save_as_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_confirm_save_as_populate(running_machine &machine, ui_menu *menu, void *state)
{
ui_menu_item_append(menu, "File Already Exists - Overide?", NULL, MENU_FLAG_DISABLE, NULL);
ui_menu_item_append(menu, MENU_SEPARATOR_ITEM, NULL, MENU_FLAG_DISABLE, NULL);
@@ -234,7 +234,7 @@ static void menu_confirm_save_as_populate(running_machine *machine, ui_menu *men
menu_confirm_save_as - confirm save as menu
-------------------------------------------------*/
-static void menu_confirm_save_as(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_confirm_save_as(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
confirm_save_as_menu_state *menustate = (confirm_save_as_menu_state *) state;
@@ -292,7 +292,7 @@ static int is_valid_filename_char(unicode_char unichar)
special rendering
-------------------------------------------------*/
-static void file_create_render_extra(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void file_create_render_extra(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
file_create_menu_state *menustate = (file_create_menu_state *) state;
@@ -308,7 +308,7 @@ static void file_create_render_extra(running_machine *machine, ui_menu *menu, vo
creator menu
-------------------------------------------------*/
-static void menu_file_create_populate(running_machine *machine, ui_menu *menu, void *state, void *selection)
+static void menu_file_create_populate(running_machine &machine, ui_menu *menu, void *state, void *selection)
{
astring buffer;
file_create_menu_state *menustate = (file_create_menu_state *) state;
@@ -341,7 +341,7 @@ static void menu_file_create_populate(running_machine *machine, ui_menu *menu, v
ui_menu_item_append(menu, "Create", NULL, 0, ITEMREF_CREATE);
/* set up custom render proc */
- ui_menu_set_custom_render(menu, file_create_render_extra, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER, 0);
+ ui_menu_set_custom_render(menu, file_create_render_extra, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER, 0);
}
@@ -382,7 +382,7 @@ static int create_new_image(device_image_interface *image, const char *directory
case ENTTYPE_FILE:
/* a file exists here - ask for permission from the user */
- child_menu = ui_menu_alloc(image->device().machine, &image->device().machine->render().ui_container(), menu_confirm_save_as, NULL);
+ child_menu = ui_menu_alloc(image->device().machine(), &image->device().machine().render().ui_container(), menu_confirm_save_as, NULL);
child_menustate = (confirm_save_as_menu_state*)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->yes = yes;
ui_menu_stack_push(child_menu);
@@ -423,7 +423,7 @@ static int create_new_image(device_image_interface *image, const char *directory
menu_file_create - file creator menu
-------------------------------------------------*/
-static void menu_file_create(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_file_create(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
void *selection;
const ui_menu_event *event;
@@ -498,7 +498,7 @@ static void menu_file_create(running_machine *machine, ui_menu *menu, void *para
special rendering
-------------------------------------------------*/
-static void file_selector_render_extra(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void file_selector_render_extra(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
file_selector_menu_state *menustate = (file_selector_menu_state *) state;
@@ -676,7 +676,7 @@ static void append_file_selector_entry_menu_item(ui_menu *menu, const file_selec
allocates all menu items for a directory
-------------------------------------------------*/
-static file_error menu_file_selector_populate(running_machine *machine, ui_menu *menu, file_selector_menu_state *menustate)
+static file_error menu_file_selector_populate(running_machine &machine, ui_menu *menu, file_selector_menu_state *menustate)
{
zippath_directory *directory = NULL;
file_error err = FILERR_NONE;
@@ -744,7 +744,7 @@ static file_error menu_file_selector_populate(running_machine *machine, ui_menu
ui_menu_set_selection(menu, (void *) selected_entry);
/* set up custom render proc */
- ui_menu_set_custom_render(menu, file_selector_render_extra, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER, 0);
+ ui_menu_set_custom_render(menu, file_selector_render_extra, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER, 0);
done:
if (directory != NULL)
@@ -770,7 +770,7 @@ static file_error check_path(const char *path)
menu_file_selector - file selector menu
-------------------------------------------------*/
-static void menu_file_selector(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_file_selector(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
file_error err;
const ui_menu_event *event;
@@ -815,13 +815,13 @@ static void menu_file_selector(running_machine *machine, ui_menu *menu, void *pa
case SELECTOR_ENTRY_TYPE_CREATE:
/* create */
- child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), menu_file_create, NULL);
+ child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), menu_file_create, NULL);
child_menustate = (file_create_menu_state*)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->manager_menustate = menustate->manager_menustate;
ui_menu_stack_push(child_menu);
break;
case SELECTOR_ENTRY_TYPE_SOFTWARE_LIST:
- child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), ui_image_menu_software, menustate->manager_menustate->selected_device);
+ child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_image_menu_software, menustate->manager_menustate->selected_device);
ui_menu_stack_push(child_menu);
break;
case SELECTOR_ENTRY_TYPE_DRIVE:
@@ -956,7 +956,7 @@ static void fix_working_directory(device_image_interface *image)
special rendering
-------------------------------------------------*/
-static void file_manager_render_extra(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void file_manager_render_extra(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
file_manager_menu_state *menustate = (file_manager_menu_state *) state;
const char *path;
@@ -974,14 +974,14 @@ static void file_manager_render_extra(running_machine *machine, ui_menu *menu, v
file manager menu
-------------------------------------------------*/
-static void menu_file_manager_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_file_manager_populate(running_machine &machine, ui_menu *menu, void *state)
{
char buffer[2048];
device_image_interface *image = NULL;
astring tmp_name;
/* cycle through all devices for this system */
- for (bool gotone = machine->m_devicelist.first(image); gotone; gotone = image->next(image))
+ for (bool gotone = machine.m_devicelist.first(image); gotone; gotone = image->next(image))
{
/* get the image type/id */
snprintf(buffer, ARRAY_LENGTH(buffer),
@@ -1019,7 +1019,7 @@ static void menu_file_manager_populate(running_machine *machine, ui_menu *menu,
}
/* set up custom render proc */
- ui_menu_set_custom_render(menu, file_manager_render_extra, 0, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER);
+ ui_menu_set_custom_render(menu, file_manager_render_extra, 0, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER);
}
@@ -1045,7 +1045,7 @@ static void file_manager_destroy_state(ui_menu *menu, void *state)
menu_file_manager - main file manager menu
-------------------------------------------------*/
-void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_image_menu_file_manager(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *event;
file_manager_menu_state *menustate;
@@ -1088,7 +1088,7 @@ void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *p
ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_POSITION);
/* push the menu */
- child_menu = ui_menu_alloc(machine, &machine->render().ui_container(), menu_file_selector, NULL);
+ child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), menu_file_selector, NULL);
child_menustate = (file_selector_menu_state *)ui_menu_alloc_state(child_menu, sizeof(*child_menustate), NULL);
child_menustate->manager_menustate = menustate;
ui_menu_stack_push(child_menu);
@@ -1101,7 +1101,7 @@ void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *p
on all loaded images
-------------------------------------------------*/
-void ui_image_menu_image_info(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_image_menu_image_info(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
/* if the menu isn't built, populate now */
if (!ui_menu_populated(menu))
@@ -1160,10 +1160,10 @@ struct _bitbanger_control_menu_state
devices in the machine
-------------------------------------------------*/
-INLINE int cassette_count( running_machine *machine )
+INLINE int cassette_count( running_machine &machine )
{
int count = 0;
- device_t *device = machine->m_devicelist.first(CASSETTE);
+ device_t *device = machine.m_devicelist.first(CASSETTE);
while ( device )
{
@@ -1178,10 +1178,10 @@ INLINE int cassette_count( running_machine *machine )
devices in the machine
-------------------------------------------------*/
-INLINE int bitbanger_count( running_machine *machine )
+INLINE int bitbanger_count( running_machine &machine )
{
int count = 0;
- device_t *device = machine->m_devicelist.first(BITBANGER);
+ device_t *device = machine.m_devicelist.first(BITBANGER);
while ( device )
{
@@ -1223,7 +1223,7 @@ astring *tapecontrol_gettime(astring *dest, device_t *device, int *curpos, int *
main tape control menu
-------------------------------------------------*/
-static void menu_tape_control_populate(running_machine *machine, ui_menu *menu, tape_control_menu_state *menustate)
+static void menu_tape_control_populate(running_machine &machine, ui_menu *menu, tape_control_menu_state *menustate)
{
astring timepos;
cassette_state state;
@@ -1300,7 +1300,7 @@ static void menu_tape_control_populate(running_machine *machine, ui_menu *menu,
main bitbanger control menu
-------------------------------------------------*/
-static void menu_bitbanger_control_populate(running_machine *machine, ui_menu *menu, bitbanger_control_menu_state *menustate)
+static void menu_bitbanger_control_populate(running_machine &machine, ui_menu *menu, bitbanger_control_menu_state *menustate)
{
int count = bitbanger_count(machine);
UINT32 flags = 0, mode_flags = 0, baud_flags = 0, tune_flags = 0;
@@ -1353,7 +1353,7 @@ static void menu_bitbanger_control_populate(running_machine *machine, ui_menu *m
menu_tape_control - main tape control menu
-------------------------------------------------*/
-void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_tape_control(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
tape_control_menu_state *menustate;
const ui_menu_event *event;
@@ -1368,7 +1368,7 @@ void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *pa
{
int index = menustate->index;
device_image_interface *device = NULL;
- for (bool gotone = machine->m_devicelist.first(device); gotone; gotone = device->next(device))
+ for (bool gotone = machine.m_devicelist.first(device); gotone; gotone = device->next(device))
{
if(device->device().type() == CASSETTE) {
if (index==0) break;
@@ -1450,7 +1450,7 @@ void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *pa
control menu
-------------------------------------------------*/
-void ui_mess_menu_bitbanger_control(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+void ui_mess_menu_bitbanger_control(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
bitbanger_control_menu_state *menustate;
const ui_menu_event *event;
@@ -1465,7 +1465,7 @@ void ui_mess_menu_bitbanger_control(running_machine *machine, ui_menu *menu, voi
{
int index = menustate->index;
device_image_interface *device = NULL;
- for (bool gotone = machine->m_devicelist.first(device); gotone; gotone = device->next(device))
+ for (bool gotone = machine.m_devicelist.first(device); gotone; gotone = device->next(device))
{
if(device->device().type() == BITBANGER) {
if (index==0) break;
diff --git a/src/emu/uiimage.h b/src/emu/uiimage.h
index 5c83d64e44e..31881cdbdb9 100644
--- a/src/emu/uiimage.h
+++ b/src/emu/uiimage.h
@@ -20,12 +20,12 @@
FUNCTION PROTOTYPES
***************************************************************************/
-void ui_image_menu_file_manager(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_image_menu_file_manager(running_machine &machine, ui_menu *menu, void *parameter, void *state);
-void ui_image_menu_image_info(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_image_menu_image_info(running_machine &machine, ui_menu *menu, void *parameter, void *state);
-void ui_mess_menu_bitbanger_control(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_mess_menu_bitbanger_control(running_machine &machine, ui_menu *menu, void *parameter, void *state);
-void ui_mess_menu_tape_control(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+void ui_mess_menu_tape_control(running_machine &machine, ui_menu *menu, void *parameter, void *state);
#endif /* __UIIMAGE_H__ */
diff --git a/src/emu/uiinput.c b/src/emu/uiinput.c
index 486d710ff54..1a7af6dda67 100644
--- a/src/emu/uiinput.c
+++ b/src/emu/uiinput.c
@@ -59,7 +59,7 @@ struct _ui_input_private
FUNCTION PROTOYPES
***************************************************************************/
-//static void ui_input_frame_update(running_machine *machine);
+//static void ui_input_frame_update(running_machine &machine);
@@ -72,15 +72,15 @@ struct _ui_input_private
system
-------------------------------------------------*/
-void ui_input_init(running_machine *machine)
+void ui_input_init(running_machine &machine)
{
/* create the private data */
- machine->ui_input_data = auto_alloc_clear(machine, ui_input_private);
- machine->ui_input_data->current_mouse_x = -1;
- machine->ui_input_data->current_mouse_y = -1;
+ machine.ui_input_data = auto_alloc_clear(machine, ui_input_private);
+ machine.ui_input_data->current_mouse_x = -1;
+ machine.ui_input_data->current_mouse_y = -1;
/* add a frame callback to poll inputs */
- machine->add_notifier(MACHINE_NOTIFY_FRAME, ui_input_frame_update);
+ machine.add_notifier(MACHINE_NOTIFY_FRAME, ui_input_frame_update);
}
@@ -103,7 +103,7 @@ void ui_input_frame_update(running_machine &machine)
/* update the state of all the UI keys */
for (code = __ipt_ui_start; code <= __ipt_ui_end; code++)
{
- int pressed = input_seq_pressed(&machine, input_type_seq(&machine, code, 0, SEQ_TYPE_STANDARD));
+ int pressed = input_seq_pressed(machine, input_type_seq(machine, code, 0, SEQ_TYPE_STANDARD));
if (!pressed || uidata->seqpressed[code] != SEQ_PRESSED_RESET)
uidata->seqpressed[code] = pressed;
}
@@ -115,9 +115,9 @@ void ui_input_frame_update(running_machine &machine)
onto the queue
-------------------------------------------------*/
-int ui_input_push_event(running_machine *machine, ui_event evt)
+int ui_input_push_event(running_machine &machine, ui_event evt)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
/* we may be called before the UI is initialized */
if (uidata == NULL)
@@ -168,9 +168,9 @@ int ui_input_push_event(running_machine *machine, ui_event evt)
ui_input_pop_event - pops an event off of the queue
-------------------------------------------------*/
-int ui_input_pop_event(running_machine *machine, ui_event *evt)
+int ui_input_pop_event(running_machine &machine, ui_event *evt)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
int result;
if (uidata->events_start != uidata->events_end)
@@ -193,9 +193,9 @@ int ui_input_pop_event(running_machine *machine, ui_event *evt)
and resets the sequence states
-------------------------------------------------*/
-void ui_input_reset(running_machine *machine)
+void ui_input_reset(running_machine &machine)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
int code;
uidata->events_start = 0;
@@ -213,9 +213,9 @@ void ui_input_reset(running_machine *machine)
location of the mouse
-------------------------------------------------*/
-render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y, int *button)
+render_target *ui_input_find_mouse(running_machine &machine, INT32 *x, INT32 *y, int *button)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
if (x != NULL)
*x = uidata->current_mouse_x;
if (y != NULL)
@@ -237,7 +237,7 @@ render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y,
detected
-------------------------------------------------*/
-int ui_input_pressed(running_machine *machine, int code)
+int ui_input_pressed(running_machine &machine, int code)
{
return ui_input_pressed_repeat(machine, code, 0);
}
@@ -250,9 +250,9 @@ int ui_input_pressed(running_machine *machine, int code)
is triggered
-------------------------------------------------*/
-int ui_input_pressed_repeat(running_machine *machine, int code, int speed)
+int ui_input_pressed_repeat(running_machine &machine, int code, int speed)
{
- ui_input_private *uidata = machine->ui_input_data;
+ ui_input_private *uidata = machine.ui_input_data;
int pressed = FALSE;
g_profiler.start(PROFILER_INPUT);
diff --git a/src/emu/uiinput.h b/src/emu/uiinput.h
index dc0d3382b28..5923fb501de 100644
--- a/src/emu/uiinput.h
+++ b/src/emu/uiinput.h
@@ -55,7 +55,7 @@ struct _ui_event
/* ----- core system management ----- */
/* initialization */
-void ui_input_init(running_machine *machine);
+void ui_input_init(running_machine &machine);
@@ -64,27 +64,27 @@ void ui_input_init(running_machine *machine);
void ui_input_frame_update(running_machine &machine);
/* pushes a single event onto the queue */
-int ui_input_push_event(running_machine *machine, ui_event event);
+int ui_input_push_event(running_machine &machine, ui_event event);
/* pops an event off of the queue */
-int ui_input_pop_event(running_machine *machine, ui_event *event);
+int ui_input_pop_event(running_machine &machine, ui_event *event);
/* clears all outstanding events */
-void ui_input_reset(running_machine *machine);
+void ui_input_reset(running_machine &machine);
/* retrieves the current location of the mouse */
-render_target *ui_input_find_mouse(running_machine *machine, INT32 *x, INT32 *y, int *button);
+render_target *ui_input_find_mouse(running_machine &machine, INT32 *x, INT32 *y, int *button);
/* ----- user interface sequence reading ----- */
/* return TRUE if a key down for the given user interface sequence is detected */
-int ui_input_pressed(running_machine *machine, int code);
+int ui_input_pressed(running_machine &machine, int code);
/* return TRUE if a key down for the given user interface sequence is detected, or if
autorepeat at the given speed is triggered */
-int ui_input_pressed_repeat(running_machine *machine, int code, int speed);
+int ui_input_pressed_repeat(running_machine &machine, int code, int speed);
@@ -97,7 +97,7 @@ int ui_input_pressed_repeat(running_machine *machine, int code, int speed);
move event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_move_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_move_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_MOVE;
@@ -113,7 +113,7 @@ INLINE void ui_input_push_mouse_move_event(running_machine *machine, render_targ
mouse leave event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_leave_event(running_machine *machine, render_target *target)
+INLINE void ui_input_push_mouse_leave_event(running_machine &machine, render_target *target)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_LEAVE;
@@ -127,7 +127,7 @@ INLINE void ui_input_push_mouse_leave_event(running_machine *machine, render_tar
down event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_down_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_down_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_DOWN;
@@ -143,7 +143,7 @@ INLINE void ui_input_push_mouse_down_event(running_machine *machine, render_targ
down event to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_up_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_up_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_UP;
@@ -160,7 +160,7 @@ INLINE void ui_input_push_mouse_up_event(running_machine *machine, render_target
render_target
-------------------------------------------------*/
-INLINE void ui_input_push_mouse_double_click_event(running_machine *machine, render_target *target, INT32 x, INT32 y)
+INLINE void ui_input_push_mouse_double_click_event(running_machine &machine, render_target *target, INT32 x, INT32 y)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_MOUSE_DOUBLE_CLICK;
@@ -176,7 +176,7 @@ INLINE void ui_input_push_mouse_double_click_event(running_machine *machine, ren
to the specified render_target
-------------------------------------------------*/
-INLINE void ui_input_push_char_event(running_machine *machine, render_target *target, unicode_char ch)
+INLINE void ui_input_push_char_event(running_machine &machine, render_target *target, unicode_char ch)
{
ui_event event = { UI_EVENT_NONE };
event.event_type = UI_EVENT_CHAR;
diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c
index d628cd67298..efd14614b1b 100644
--- a/src/emu/uimenu.c
+++ b/src/emu/uimenu.c
@@ -118,7 +118,9 @@ struct _ui_menu_item
struct _ui_menu
{
- running_machine * machine; /* machine we are attached to */
+ running_machine &machine() const { assert(m_machine != NULL); return *m_machine; }
+
+ running_machine * m_machine; /* machine we are attached to */
render_container * container; /* render_container we render to */
ui_menu_handler_func handler; /* handler callback */
void * parameter; /* parameter */
@@ -252,59 +254,59 @@ static const char exittext[] = "Exit";
static void ui_menu_exit(running_machine &machine);
/* internal menu processing */
-static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly);
+static void ui_menu_draw(running_machine &machine, ui_menu *menu, int customonly);
static void ui_menu_draw_text_box(ui_menu *menu);
static void ui_menu_handle_events(ui_menu *menu);
static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags);
static void ui_menu_validate_selection(ui_menu *menu, int scandir);
-static void ui_menu_clear_free_list(running_machine *machine);
+static void ui_menu_clear_free_list(running_machine &machine);
/* menu handlers */
-static void menu_main(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_main_populate(running_machine *machine, ui_menu *menu, void *state);
-static void menu_input_groups(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_input_groups_populate(running_machine *machine, ui_menu *menu, void *state);
-static void menu_input_general(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_input_general_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate, int group);
-static void menu_input_specific(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_input_specific_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate);
-static void menu_input_common(running_machine *machine, ui_menu *menu, void *parameter, void *state);
+static void menu_main(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_main_populate(running_machine &machine, ui_menu *menu, void *state);
+static void menu_input_groups(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_input_groups_populate(running_machine &machine, ui_menu *menu, void *state);
+static void menu_input_general(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_input_general_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate, int group);
+static void menu_input_specific(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_input_specific_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate);
+static void menu_input_common(running_machine &machine, ui_menu *menu, void *parameter, void *state);
static int CLIB_DECL menu_input_compare_items(const void *i1, const void *i2);
-static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate);
-static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_settings_categories(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_settings_common(running_machine *machine, ui_menu *menu, void *state, UINT32 type);
-static void menu_settings_populate(running_machine *machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type);
-static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_analog_populate(running_machine *machine, ui_menu *menu);
-static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_bookkeeping_populate(running_machine *machine, ui_menu *menu, attotime *curtime);
-static void menu_game_info(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_cheat_populate(running_machine *machine, ui_menu *menu);
-static void menu_memory_card(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, int cardnum);
-static void menu_sliders(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int menuless_mode);
-static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2);
-static void menu_video_targets(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_video_targets_populate(running_machine *machine, ui_menu *menu);
-static void menu_video_options(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_video_options_populate(running_machine *machine, ui_menu *menu, render_target *target);
-static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_crosshair_populate(running_machine *machine, ui_menu *menu);
-static void menu_quit_game(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_select_game(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-static void menu_select_game_populate(running_machine *machine, ui_menu *menu, select_game_state *menustate);
+static void menu_input_populate_and_sort(running_machine &machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate);
+static void menu_settings_dip_switches(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_settings_driver_config(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_settings_categories(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_settings_common(running_machine &machine, ui_menu *menu, void *state, UINT32 type);
+static void menu_settings_populate(running_machine &machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type);
+static void menu_analog(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_analog_populate(running_machine &machine, ui_menu *menu);
+static void menu_bookkeeping(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_bookkeeping_populate(running_machine &machine, ui_menu *menu, attotime *curtime);
+static void menu_game_info(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_cheat(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_cheat_populate(running_machine &machine, ui_menu *menu);
+static void menu_memory_card(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_memory_card_populate(running_machine &machine, ui_menu *menu, int cardnum);
+static void menu_sliders(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_sliders_populate(running_machine &machine, ui_menu *menu, int menuless_mode);
+static void menu_sliders_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2);
+static void menu_video_targets(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_video_targets_populate(running_machine &machine, ui_menu *menu);
+static void menu_video_options(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_video_options_populate(running_machine &machine, ui_menu *menu, render_target *target);
+static void menu_crosshair(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_crosshair_populate(running_machine &machine, ui_menu *menu);
+static void menu_quit_game(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_select_game(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+static void menu_select_game_populate(running_machine &machine, ui_menu *menu, select_game_state *menustate);
static int CLIB_DECL menu_select_game_driver_compare(const void *elem1, const void *elem2);
static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state *menustate);
-static void menu_select_game_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
+static void menu_select_game_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
/* menu helpers */
static void menu_render_triangle(bitmap_t &dest, const bitmap_t &source, const rectangle &sbounds, void *param);
static void menu_settings_custom_render_one(render_container *container, float x1, float y1, float x2, float y2, const dip_descriptor *dip, UINT32 selectedmask);
-static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
+static void menu_settings_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
@@ -320,7 +322,7 @@ static void menu_settings_custom_render(running_machine *machine, ui_menu *menu,
INLINE const input_seq *get_field_default_seq(const input_field_config *field, input_seq_type seqtype)
{
if (input_seq_get_1(&field->seq[seqtype]) == SEQCODE_DEFAULT)
- return input_type_seq(field->port->machine, field->type, field->player, seqtype);
+ return input_type_seq(field->port->machine(), field->type, field->player, seqtype);
else
return &field->seq[seqtype];
}
@@ -362,7 +364,7 @@ INLINE int item_is_selectable(const ui_menu_item *item)
INLINE int exclusive_input_pressed(ui_menu *menu, int key, int repeat)
{
- if (menu->menu_event.iptkey == IPT_INVALID && ui_input_pressed_repeat(menu->machine, key, repeat))
+ if (menu->menu_event.iptkey == IPT_INVALID && ui_input_pressed_repeat(menu->machine(), key, repeat))
{
menu->menu_event.iptkey = key;
return TRUE;
@@ -380,7 +382,7 @@ INLINE int exclusive_input_pressed(ui_menu *menu, int key, int repeat)
ui_menu_init - initialize the menu system
-------------------------------------------------*/
-void ui_menu_init(running_machine *machine)
+void ui_menu_init(running_machine &machine)
{
int x;
@@ -396,14 +398,14 @@ void ui_menu_init(running_machine *machine)
if (x > 256 - 25) alpha = 0xff * (255 - x) / 25;
*BITMAP_ADDR32(hilight_bitmap, 0, x) = MAKE_ARGB(alpha,0xff,0xff,0xff);
}
- hilight_texture = machine->render().texture_alloc();
+ hilight_texture = machine.render().texture_alloc();
hilight_texture->set_bitmap(hilight_bitmap, NULL, TEXFORMAT_ARGB32);
/* create a texture for arrow icons */
- arrow_texture = machine->render().texture_alloc(menu_render_triangle);
+ arrow_texture = machine.render().texture_alloc(menu_render_triangle);
/* add an exit callback to free memory */
- machine->add_notifier(MACHINE_NOTIFY_EXIT, ui_menu_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, ui_menu_exit);
}
@@ -414,8 +416,8 @@ void ui_menu_init(running_machine *machine)
static void ui_menu_exit(running_machine &machine)
{
/* free menus */
- ui_menu_stack_reset(&machine);
- ui_menu_clear_free_list(&machine);
+ ui_menu_stack_reset(machine);
+ ui_menu_clear_free_list(machine);
/* free textures */
machine.render().texture_free(hilight_texture);
@@ -432,7 +434,7 @@ static void ui_menu_exit(running_machine &machine)
ui_menu_alloc - allocate a new menu
-------------------------------------------------*/
-ui_menu *ui_menu_alloc(running_machine *machine, render_container *container, ui_menu_handler_func handler, void *parameter)
+ui_menu *ui_menu_alloc(running_machine &machine, render_container *container, ui_menu_handler_func handler, void *parameter)
{
ui_menu *menu;
@@ -440,7 +442,7 @@ ui_menu *ui_menu_alloc(running_machine *machine, render_container *container, ui
menu = auto_alloc_clear(machine, ui_menu);
/* initialize the state */
- menu->machine = machine;
+ menu->m_machine = &machine;
menu->container = container;
menu->handler = handler;
menu->parameter = parameter;
@@ -462,23 +464,23 @@ void ui_menu_free(ui_menu *menu)
{
ui_menu_pool *pool = menu->pool;
menu->pool = pool->next;
- auto_free(menu->machine, pool);
+ auto_free(menu->machine(), pool);
}
/* free the item array */
if (menu->item != NULL)
- auto_free(menu->machine, menu->item);
+ auto_free(menu->machine(), menu->item);
/* free the state */
if (menu->state != NULL)
{
if (menu->destroy_state != NULL)
(*menu->destroy_state)(menu, menu->state);
- auto_free(menu->machine, menu->state);
+ auto_free(menu->machine(), menu->state);
}
/* free the menu */
- auto_free(menu->machine, menu);
+ auto_free(menu->machine(), menu);
}
@@ -550,10 +552,10 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U
{
int olditems = menu->allocitems;
menu->allocitems += UI_MENU_ALLOC_ITEMS;
- ui_menu_item *newitems = auto_alloc_array(menu->machine, ui_menu_item, menu->allocitems);
+ ui_menu_item *newitems = auto_alloc_array(menu->machine(), ui_menu_item, menu->allocitems);
for (int itemnum = 0; itemnum < olditems; itemnum++)
newitems[itemnum] = menu->item[itemnum];
- auto_free(menu->machine, menu->item);
+ auto_free(menu->machine(), menu->item);
menu->item = newitems;
}
index = menu->numitems++;
@@ -585,7 +587,7 @@ void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, U
and returning any interesting events
-------------------------------------------------*/
-const ui_menu_event *ui_menu_process(running_machine *machine, ui_menu *menu, UINT32 flags)
+const ui_menu_event *ui_menu_process(running_machine &machine, ui_menu *menu, UINT32 flags)
{
/* reset the menu_event */
menu->menu_event.iptkey = IPT_INVALID;
@@ -644,9 +646,9 @@ void *ui_menu_alloc_state(ui_menu *menu, size_t size, ui_menu_destroy_state_func
{
if (menu->destroy_state != NULL)
(*menu->destroy_state)(menu, menu->state);
- auto_free(menu->machine, menu->state);
+ auto_free(menu->machine(), menu->state);
}
- menu->state = auto_alloc_array_clear(menu->machine, UINT8, size);
+ menu->state = auto_alloc_array_clear(menu->machine(), UINT8, size);
menu->destroy_state = destroy_state;
return menu->state;
@@ -674,7 +676,7 @@ void *ui_menu_pool_alloc(ui_menu *menu, size_t size)
}
/* allocate a new pool */
- pool = (ui_menu_pool *)auto_alloc_array_clear(menu->machine, UINT8, sizeof(*pool) + UI_MENU_POOL_SIZE);
+ pool = (ui_menu_pool *)auto_alloc_array_clear(menu->machine(), UINT8, sizeof(*pool) + UI_MENU_POOL_SIZE);
/* wire it up */
pool->next = menu->pool;
@@ -735,11 +737,11 @@ void ui_menu_set_selection(ui_menu *menu, void *selected_itemref)
ui_menu_draw - draw a menu
-------------------------------------------------*/
-static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly)
+static void ui_menu_draw(running_machine &machine, ui_menu *menu, int customonly)
{
- float line_height = ui_get_line_height(*machine);
- float lr_arrow_width = 0.4f * line_height * machine->render().ui_aspect();
- float ud_arrow_width = line_height * machine->render().ui_aspect();
+ float line_height = ui_get_line_height(machine);
+ float lr_arrow_width = 0.4f * line_height * machine.render().ui_aspect();
+ float ud_arrow_width = line_height * machine.render().ui_aspect();
float gutter_width = lr_arrow_width * 1.3f;
float x1, y1, x2, y2;
@@ -765,11 +767,11 @@ static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly
float total_width;
/* compute width of left hand side */
- total_width = gutter_width + ui_get_string_width(*machine, item->text) + gutter_width;
+ total_width = gutter_width + ui_get_string_width(machine, item->text) + gutter_width;
/* add in width of right hand side */
if (item->subtext)
- total_width += 2.0f * gutter_width + ui_get_string_width(*machine, item->subtext);
+ total_width += 2.0f * gutter_width + ui_get_string_width(machine, item->subtext);
/* track the maximum */
if (total_width > visible_width)
@@ -933,7 +935,7 @@ static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly
item_width += 2.0f * gutter_width;
/* if the subitem doesn't fit here, display dots */
- if (ui_get_string_width(*machine, subitem_text) > effective_width - item_width)
+ if (ui_get_string_width(machine, subitem_text) > effective_width - item_width)
{
subitem_text = "...";
if (itemnum == menu->selected)
@@ -1003,7 +1005,7 @@ static void ui_menu_draw(running_machine *machine, ui_menu *menu, int customonly
if (menu->custom != NULL)
{
void *selectedref = (menu->selected >= 0 && menu->selected < menu->numitems) ? menu->item[menu->selected].ref : NULL;
- (*menu->custom)(menu->machine, menu, menu->state, selectedref, menu->customtop, menu->custombottom, x1, y1, x2, y2);
+ (*menu->custom)(menu->machine(), menu, menu->state, selectedref, menu->customtop, menu->custombottom, x1, y1, x2, y2);
}
/* return the number of visible lines, minus 1 for top arrow and 1 for bottom arrow */
@@ -1021,8 +1023,8 @@ static void ui_menu_draw_text_box(ui_menu *menu)
{
const char *text = menu->item[0].text;
const char *backtext = menu->item[1].text;
- float line_height = ui_get_line_height(*menu->machine);
- float lr_arrow_width = 0.4f * line_height * menu->machine->render().ui_aspect();
+ float line_height = ui_get_line_height(menu->machine());
+ float lr_arrow_width = 0.4f * line_height * menu->machine().render().ui_aspect();
float gutter_width = lr_arrow_width;
float target_width, target_height, prior_width;
float target_x, target_y;
@@ -1035,7 +1037,7 @@ static void ui_menu_draw_text_box(ui_menu *menu)
target_height = floor((1.0f - 2.0f * UI_BOX_TB_BORDER) / line_height) * line_height;
/* maximum against "return to prior menu" text */
- prior_width = ui_get_string_width(*menu->machine, backtext) + 2.0f * gutter_width;
+ prior_width = ui_get_string_width(menu->machine(), backtext) + 2.0f * gutter_width;
target_width = MAX(target_width, prior_width);
/* determine the target location */
@@ -1088,7 +1090,7 @@ static void ui_menu_handle_events(ui_menu *menu)
ui_event menu_event;
/* loop while we have interesting events */
- while (ui_input_pop_event(menu->machine, &menu_event) && !stop)
+ while (ui_input_pop_event(menu->machine(), &menu_event) && !stop)
{
switch (menu_event.event_type)
{
@@ -1119,7 +1121,7 @@ static void ui_menu_handle_events(ui_menu *menu)
if (menu->selected == menu->numitems - 1)
{
menu->menu_event.iptkey = IPT_UI_CANCEL;
- ui_menu_stack_pop(menu->machine);
+ ui_menu_stack_pop(menu->machine());
}
}
stop = TRUE;
@@ -1163,7 +1165,7 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
if (menu->selected == menu->numitems - 1)
{
menu->menu_event.iptkey = IPT_UI_CANCEL;
- ui_menu_stack_pop(menu->machine);
+ ui_menu_stack_pop(menu->machine());
}
return;
}
@@ -1171,7 +1173,7 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
/* hitting cancel also pops the stack */
if (exclusive_input_pressed(menu, IPT_UI_CANCEL, 0))
{
- ui_menu_stack_pop(menu->machine);
+ ui_menu_stack_pop(menu->machine());
return;
}
@@ -1233,15 +1235,15 @@ static void ui_menu_handle_keys(ui_menu *menu, UINT32 flags)
/* pause enables/disables pause */
if (!ignorepause && exclusive_input_pressed(menu, IPT_UI_PAUSE, 0))
{
- if (menu->machine->paused())
- menu->machine->resume();
+ if (menu->machine().paused())
+ menu->machine().resume();
else
- menu->machine->pause();
+ menu->machine().pause();
}
/* handle a toggle cheats request */
- if (ui_input_pressed_repeat(menu->machine, IPT_UI_TOGGLE_CHEAT, 0))
- menu->machine->cheat().set_enable(!menu->machine->cheat().enabled());
+ if (ui_input_pressed_repeat(menu->machine(), IPT_UI_TOGGLE_CHEAT, 0))
+ menu->machine().cheat().set_enable(!menu->machine().cheat().enabled());
/* see if any other UI keys are pressed */
if (menu->menu_event.iptkey == IPT_INVALID)
@@ -1281,7 +1283,7 @@ static void ui_menu_validate_selection(ui_menu *menu, int scandir)
accumulated in the free list
-------------------------------------------------*/
-static void ui_menu_clear_free_list(running_machine *machine)
+static void ui_menu_clear_free_list(running_machine &machine)
{
while (menu_free != NULL)
{
@@ -1301,7 +1303,7 @@ static void ui_menu_clear_free_list(running_machine *machine)
ui_menu_stack_reset - reset the menu stack
-------------------------------------------------*/
-void ui_menu_stack_reset(running_machine *machine)
+void ui_menu_stack_reset(running_machine &machine)
{
while (menu_stack != NULL)
ui_menu_stack_pop(machine);
@@ -1318,7 +1320,7 @@ void ui_menu_stack_push(ui_menu *menu)
menu->parent = menu_stack;
menu_stack = menu;
ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST);
- ui_input_reset(menu->machine);
+ ui_input_reset(menu->machine());
}
@@ -1326,7 +1328,7 @@ void ui_menu_stack_push(ui_menu *menu)
ui_menu_stack_pop - pop a menu from the stack
-------------------------------------------------*/
-void ui_menu_stack_pop(running_machine *machine)
+void ui_menu_stack_pop(running_machine &machine)
{
if (menu_stack != NULL)
{
@@ -1349,7 +1351,7 @@ void ui_menu_stack_pop(running_machine *machine)
and calls the menu handler
-------------------------------------------------*/
-UINT32 ui_menu_ui_handler(running_machine *machine, render_container *container, UINT32 state)
+UINT32 ui_menu_ui_handler(running_machine &machine, render_container *container, UINT32 state)
{
/* if we have no menus stacked up, start with the main menu */
if (menu_stack == NULL)
@@ -1379,7 +1381,7 @@ UINT32 ui_menu_ui_handler(running_machine *machine, render_container *container,
standard menu handler
-------------------------------------------------*/
-UINT32 ui_slider_ui_handler(running_machine *machine, render_container *container, UINT32 state)
+UINT32 ui_slider_ui_handler(running_machine &machine, render_container *container, UINT32 state)
{
UINT32 result;
@@ -1403,9 +1405,9 @@ UINT32 ui_slider_ui_handler(running_machine *machine, render_container *containe
select menu to be visible and inescapable
-------------------------------------------------*/
-void ui_menu_force_game_select(running_machine *machine, render_container *container)
+void ui_menu_force_game_select(running_machine &machine, render_container *container)
{
- char *gamename = (char *)machine->options().system_name();
+ char *gamename = (char *)machine.options().system_name();
/* reset the menu stack */
ui_menu_stack_reset(machine);
@@ -1418,7 +1420,7 @@ void ui_menu_force_game_select(running_machine *machine, render_container *conta
ui_show_menu();
/* make sure MAME is paused */
- machine->pause();
+ machine.pause();
}
@@ -1449,7 +1451,7 @@ int ui_menu_is_force_game_select(void)
menu_main - handle the main menu
-------------------------------------------------*/
-static void menu_main(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_main(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -1468,7 +1470,7 @@ static void menu_main(running_machine *machine, ui_menu *menu, void *parameter,
ui_menu_keyboard_mode - menu that
-------------------------------------------------*/
-static void ui_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void ui_menu_keyboard_mode(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
int natural = ui_get_use_natural_keyboard(machine);
@@ -1495,7 +1497,7 @@ static void ui_menu_keyboard_mode(running_machine *machine, ui_menu *menu, void
menu_main_populate - populate the main menu
-------------------------------------------------*/
-static void menu_main_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_main_populate(running_machine &machine, ui_menu *menu, void *state)
{
const input_field_config *field;
const input_port_config *port;
@@ -1505,7 +1507,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
int has_dips = FALSE;
/* scan the input port array to see what options we need to enable */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
{
if (field->type == IPT_DIPSWITCH)
@@ -1539,7 +1541,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, CAPSTARTGAMENOUN " Information", NULL, 0, (void *)menu_game_info);
device_image_interface *image = NULL;
- if (machine->m_devicelist.first(image))
+ if (machine.m_devicelist.first(image))
{
/* add image info menu */
ui_menu_item_append(menu, "Image Information", NULL, 0, (void*)ui_image_menu_image_info);
@@ -1548,11 +1550,11 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, "File Manager", NULL, 0, (void*)ui_image_menu_file_manager);
/* add tape control menu */
- if (machine->m_devicelist.first(CASSETTE))
+ if (machine.m_devicelist.first(CASSETTE))
ui_menu_item_append(menu, "Tape Control", NULL, 0, (void*)ui_mess_menu_tape_control);
/* add bitbanger control menu */
- if (machine->m_devicelist.first(BITBANGER))
+ if (machine.m_devicelist.first(BITBANGER))
ui_menu_item_append(menu, "Bitbanger Control", NULL, 0, (void*)ui_mess_menu_bitbanger_control);
}
/* add keyboard mode menu */
@@ -1563,18 +1565,18 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
ui_menu_item_append(menu, "Slider Controls", NULL, 0, (void *)menu_sliders);
/* add video options menu */
- ui_menu_item_append(menu, "Video Options", NULL, 0, (machine->render().target_by_index(1) != NULL) ? (void *)menu_video_targets : (void *)menu_video_options);
+ ui_menu_item_append(menu, "Video Options", NULL, 0, (machine.render().target_by_index(1) != NULL) ? (void *)menu_video_targets : (void *)menu_video_options);
/* add crosshair options menu */
if (crosshair_get_usage(machine))
ui_menu_item_append(menu, "Crosshair Options", NULL, 0, (void *)menu_crosshair);
/* add cheat menu */
- if (machine->options().cheat() && machine->cheat().first() != NULL)
+ if (machine.options().cheat() && machine.cheat().first() != NULL)
ui_menu_item_append(menu, "Cheat", NULL, 0, (void *)menu_cheat);
/* add memory card menu */
- if (machine->config().m_memcard_handler != NULL)
+ if (machine.config().m_memcard_handler != NULL)
ui_menu_item_append(menu, "Memory Card", NULL, 0, (void *)menu_memory_card);
/* add reset and exit menus */
@@ -1587,7 +1589,7 @@ static void menu_main_populate(running_machine *machine, ui_menu *menu, void *st
menu
-------------------------------------------------*/
-static void menu_input_groups(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_groups(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -1607,7 +1609,7 @@ static void menu_input_groups(running_machine *machine, ui_menu *menu, void *par
input groups menu
-------------------------------------------------*/
-static void menu_input_groups_populate(running_machine *machine, ui_menu *menu, void *state)
+static void menu_input_groups_populate(running_machine &machine, ui_menu *menu, void *state)
{
int player;
@@ -1629,7 +1631,7 @@ static void menu_input_groups_populate(running_machine *machine, ui_menu *menu,
input menu
-------------------------------------------------*/
-static void menu_input_general(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_general(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_input_common(machine, menu, parameter, state);
}
@@ -1640,7 +1642,7 @@ static void menu_input_general(running_machine *machine, ui_menu *menu, void *pa
general input menu
-------------------------------------------------*/
-static void menu_input_general_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate, int group)
+static void menu_input_general_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate, int group)
{
input_item_data *itemlist = NULL;
const input_type_desc *typedesc;
@@ -1694,7 +1696,7 @@ static void menu_input_general_populate(running_machine *machine, ui_menu *menu,
input menu
-------------------------------------------------*/
-static void menu_input_specific(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_specific(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_input_common(machine, menu, NULL, state);
}
@@ -1705,7 +1707,7 @@ static void menu_input_specific(running_machine *machine, ui_menu *menu, void *p
the input menu with game-specific items
-------------------------------------------------*/
-static void menu_input_specific_populate(running_machine *machine, ui_menu *menu, input_menu_state *menustate)
+static void menu_input_specific_populate(running_machine &machine, ui_menu *menu, input_menu_state *menustate)
{
input_item_data *itemlist = NULL;
const input_field_config *field;
@@ -1719,7 +1721,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu
suborder[SEQ_TYPE_INCREMENT] = 2;
/* iterate over the input ports and add menu items */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
{
const char *name = input_field_name(field);
@@ -1770,7 +1772,7 @@ static void menu_input_specific_populate(running_machine *machine, ui_menu *menu
menu_input - display a menu for inputs
-------------------------------------------------*/
-static void menu_input_common(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_input_common(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
input_item_data *seqchangeditem = NULL;
input_menu_state *menustate;
@@ -1906,7 +1908,7 @@ static int menu_input_compare_items(const void *i1, const void *i2)
menu from them
-------------------------------------------------*/
-static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate)
+static void menu_input_populate_and_sort(running_machine &machine, ui_menu *menu, input_item_data *itemlist, input_menu_state *menustate)
{
const char *nameformat[INPUT_TYPE_TOTAL] = { 0 };
input_item_data **itemarray, *item;
@@ -1967,7 +1969,7 @@ static void menu_input_populate_and_sort(running_machine *machine, ui_menu *menu
switches menu
-------------------------------------------------*/
-static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_settings_dip_switches(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_settings_common(machine, menu, state, IPT_DIPSWITCH);
}
@@ -1978,7 +1980,7 @@ static void menu_settings_dip_switches(running_machine *machine, ui_menu *menu,
driver config menu
-------------------------------------------------*/
-static void menu_settings_driver_config(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_settings_driver_config(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_settings_common(machine, menu, state, IPT_CONFIG);
}
@@ -1989,7 +1991,7 @@ static void menu_settings_driver_config(running_machine *machine, ui_menu *menu,
categories menu
-------------------------------------------------*/
-static void menu_settings_categories(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_settings_categories(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
menu_settings_common(machine, menu, state, IPT_CATEGORY);
}
@@ -2000,7 +2002,7 @@ static void menu_settings_categories(running_machine *machine, ui_menu *menu, vo
switches menus
-------------------------------------------------*/
-static void menu_settings_common(running_machine *machine, ui_menu *menu, void *state, UINT32 type)
+static void menu_settings_common(running_machine &machine, ui_menu *menu, void *state, UINT32 type)
{
settings_menu_state *menustate;
const ui_menu_event *menu_event;
@@ -2059,7 +2061,7 @@ static void menu_settings_common(running_machine *machine, ui_menu *menu, void *
switches menus
-------------------------------------------------*/
-static void menu_settings_populate(running_machine *machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type)
+static void menu_settings_populate(running_machine &machine, ui_menu *menu, settings_menu_state *menustate, UINT32 type)
{
const input_field_config *field;
const input_port_config *port;
@@ -2071,7 +2073,7 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett
diplist_tailptr = &menustate->diplist;
/* loop over input ports and set up the current values */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (field->type == type && input_condition_true(machine, &field->condition))
{
@@ -2141,7 +2143,7 @@ static void menu_settings_populate(running_machine *machine, ui_menu *menu, sett
rendering
-------------------------------------------------*/
-static void menu_settings_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
+static void menu_settings_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
{
const input_field_config *field = (const input_field_config *)selectedref;
settings_menu_state *menustate = (settings_menu_state *)state;
@@ -2248,7 +2250,7 @@ static void menu_settings_custom_render_one(render_container *container, float x
menu_analog - handle the analog settings menu
-------------------------------------------------*/
-static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_analog(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -2317,7 +2319,7 @@ static void menu_analog(running_machine *machine, ui_menu *menu, void *parameter
settings menu
-------------------------------------------------*/
-static void menu_analog_populate(running_machine *machine, ui_menu *menu)
+static void menu_analog_populate(running_machine &machine, ui_menu *menu)
{
const input_field_config *field;
const input_port_config *port;
@@ -2325,7 +2327,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
astring text;
/* loop over input ports and add the items */
- for (port = machine->m_portlist.first(); port != NULL; port = port->next())
+ for (port = machine.m_portlist.first(); port != NULL; port = port->next())
for (field = port->fieldlist; field != NULL; field = field->next)
if (input_type_is_analog(field->type) && input_condition_true(machine, &field->condition))
{
@@ -2427,7 +2429,7 @@ static void menu_analog_populate(running_machine *machine, ui_menu *menu)
information menu
-------------------------------------------------*/
-static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_bookkeeping(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
attotime *prevtime;
attotime curtime;
@@ -2438,7 +2440,7 @@ static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *para
prevtime = (attotime *)state;
/* if the time has rolled over another second, regenerate */
- curtime = machine->time();
+ curtime = machine.time();
if (prevtime->seconds != curtime.seconds)
{
ui_menu_reset(menu, UI_MENU_RESET_SELECT_FIRST);
@@ -2456,7 +2458,7 @@ static void menu_bookkeeping(running_machine *machine, ui_menu *menu, void *para
information menu
-------------------------------------------------*/
-static void menu_bookkeeping_populate(running_machine *machine, ui_menu *menu, attotime *curtime)
+static void menu_bookkeeping_populate(running_machine &machine, ui_menu *menu, attotime *curtime)
{
int tickets = get_dispensed_tickets(machine);
astring tempstring;
@@ -2502,7 +2504,7 @@ static void menu_bookkeeping_populate(running_machine *machine, ui_menu *menu, a
menu
-------------------------------------------------*/
-static void menu_game_info(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_game_info(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
/* if the menu isn't built, populate now */
if (!ui_menu_populated(menu))
@@ -2520,7 +2522,7 @@ static void menu_game_info(running_machine *machine, ui_menu *menu, void *parame
menu_cheat - handle the cheat menu
-------------------------------------------------*/
-static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_cheat(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -2542,7 +2544,7 @@ static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter,
/* handle reset all + reset all cheats for reload all option */
if ((FPTR)menu_event->itemref < 3 && menu_event->iptkey == IPT_UI_SELECT)
{
- for (cheat_entry *curcheat = machine->cheat().first(); curcheat != NULL; curcheat = curcheat->next())
+ for (cheat_entry *curcheat = machine.cheat().first(); curcheat != NULL; curcheat = curcheat->next())
if (curcheat->select_default_state())
changed = true;
}
@@ -2590,7 +2592,7 @@ static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter,
if ((FPTR)menu_event->itemref == 2 && menu_event->iptkey == IPT_UI_SELECT)
{
/* re-init cheat engine and thus reload cheats/cheats have already been turned off by here */
- machine->cheat().reload();
+ machine.cheat().reload();
/* display the reloaded cheats */
ui_menu_reset(menu, UI_MENU_RESET_REMEMBER_REF);
@@ -2608,12 +2610,12 @@ static void menu_cheat(running_machine *machine, ui_menu *menu, void *parameter,
menu_cheat_populate - populate the cheat menu
-------------------------------------------------*/
-static void menu_cheat_populate(running_machine *machine, ui_menu *menu)
+static void menu_cheat_populate(running_machine &machine, ui_menu *menu)
{
/* iterate over cheats */
astring text;
astring subtext;
- for (cheat_entry *curcheat = machine->cheat().first(); curcheat != NULL; curcheat = curcheat->next())
+ for (cheat_entry *curcheat = machine.cheat().first(); curcheat != NULL; curcheat = curcheat->next())
{
UINT32 flags;
curcheat->menu_text(text, subtext, flags);
@@ -2636,7 +2638,7 @@ static void menu_cheat_populate(running_machine *machine, ui_menu *menu)
menu
-------------------------------------------------*/
-static void menu_memory_card(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_memory_card(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
int *cardnum;
@@ -2665,10 +2667,10 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para
{
/* handle card loading; if we succeed, clear the menus */
case MEMCARD_ITEM_LOAD:
- if (memcard_insert(menu->machine, *cardnum) == 0)
+ if (memcard_insert(menu->machine(), *cardnum) == 0)
{
popmessage("Memory card loaded");
- ui_menu_stack_reset(menu->machine);
+ ui_menu_stack_reset(menu->machine());
}
else
popmessage("Error loading memory card");
@@ -2676,13 +2678,13 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para
/* handle card ejecting */
case MEMCARD_ITEM_EJECT:
- memcard_eject(*menu->machine);
+ memcard_eject(menu->machine());
popmessage("Memory card ejected");
break;
/* handle card creating */
case MEMCARD_ITEM_CREATE:
- if (memcard_create(menu->machine, *cardnum, FALSE) == 0)
+ if (memcard_create(menu->machine(), *cardnum, FALSE) == 0)
popmessage("Memory card created");
else
popmessage("Error creating memory card\n(Card may already exist)");
@@ -2717,7 +2719,7 @@ static void menu_memory_card(running_machine *machine, ui_menu *menu, void *para
memory card menu
-------------------------------------------------*/
-static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, int cardnum)
+static void menu_memory_card_populate(running_machine &machine, ui_menu *menu, int cardnum)
{
char tempstring[20];
UINT32 flags = 0;
@@ -2742,7 +2744,7 @@ static void menu_memory_card_populate(running_machine *machine, ui_menu *menu, i
menu_sliders - handle the sliders menu
-------------------------------------------------*/
-static void menu_sliders(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_sliders(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
int menuless_mode = (parameter != NULL);
const ui_menu_event *menu_event;
@@ -2852,7 +2854,7 @@ static void menu_sliders(running_machine *machine, ui_menu *menu, void *paramete
menu
-------------------------------------------------*/
-static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int menuless_mode)
+static void menu_sliders_populate(running_machine &machine, ui_menu *menu, int menuless_mode)
{
const slider_state *curslider;
astring tempstring;
@@ -2872,7 +2874,7 @@ static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int m
break;
}
- ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height(*machine) + 2.0f * UI_BOX_TB_BORDER);
+ ui_menu_set_custom_render(menu, menu_sliders_custom_render, 0.0f, 2.0f * ui_get_line_height(machine) + 2.0f * UI_BOX_TB_BORDER);
}
@@ -2881,13 +2883,13 @@ static void menu_sliders_populate(running_machine *machine, ui_menu *menu, int m
rendering
-------------------------------------------------*/
-static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
+static void menu_sliders_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x1, float y1, float x2, float y2)
{
const slider_state *curslider = (const slider_state *)selectedref;
if (curslider != NULL)
{
float bar_left, bar_area_top, bar_width, bar_area_height, bar_top, bar_bottom, default_x, current_x;
- float line_height = ui_get_line_height(*machine);
+ float line_height = ui_get_line_height(machine);
float percentage, default_percentage;
astring tempstring;
float text_height;
@@ -2952,7 +2954,7 @@ static void menu_sliders_custom_render(running_machine *machine, ui_menu *menu,
menu
-------------------------------------------------*/
-static void menu_video_targets(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_video_targets(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -2972,14 +2974,14 @@ static void menu_video_targets(running_machine *machine, ui_menu *menu, void *pa
video targets menu
-------------------------------------------------*/
-static void menu_video_targets_populate(running_machine *machine, ui_menu *menu)
+static void menu_video_targets_populate(running_machine &machine, ui_menu *menu)
{
int targetnum;
/* find the targets */
for (targetnum = 0; ; targetnum++)
{
- render_target *target = machine->render().target_by_index(targetnum);
+ render_target *target = machine.render().target_by_index(targetnum);
char buffer[40];
/* stop when we run out */
@@ -2998,9 +3000,9 @@ static void menu_video_targets_populate(running_machine *machine, ui_menu *menu)
menu
-------------------------------------------------*/
-static void menu_video_options(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_video_options(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
- render_target *target = (parameter != NULL) ? (render_target *)parameter : machine->render().first_target();
+ render_target *target = (parameter != NULL) ? (render_target *)parameter : machine.render().first_target();
const ui_menu_event *menu_event;
int changed = FALSE;
@@ -3086,7 +3088,7 @@ static void menu_video_options(running_machine *machine, ui_menu *menu, void *pa
video options menu
-------------------------------------------------*/
-static void menu_video_options_populate(running_machine *machine, ui_menu *menu, render_target *target)
+static void menu_video_options_populate(running_machine &machine, ui_menu *menu, render_target *target)
{
const char *subtext = "";
astring tempstring;
@@ -3141,7 +3143,7 @@ static void menu_video_options_populate(running_machine *machine, ui_menu *menu,
menu
-------------------------------------------------*/
-static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_crosshair(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
const ui_menu_event *menu_event;
@@ -3246,7 +3248,7 @@ static void menu_crosshair(running_machine *machine, ui_menu *menu, void *parame
crosshair settings menu
-------------------------------------------------*/
-static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
+static void menu_crosshair_populate(running_machine &machine, ui_menu *menu)
{
crosshair_user_settings settings;
crosshair_item_data *data;
@@ -3299,7 +3301,7 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
/* search for crosshair graphics */
/* open a path to the crosshairs */
- file_enumerator path(machine->options().crosshair_path());
+ file_enumerator path(machine.options().crosshair_path());
const osd_directory_entry *dir;
/* reset search flags */
int using_default = FALSE;
@@ -3401,10 +3403,10 @@ static void menu_crosshair_populate(running_machine *machine, ui_menu *menu)
quitting the game
-------------------------------------------------*/
-static void menu_quit_game(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_quit_game(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
/* request a reset */
- machine->schedule_exit();
+ machine.schedule_exit();
/* reset the menu stack */
ui_menu_stack_reset(machine);
@@ -3416,7 +3418,7 @@ static void menu_quit_game(running_machine *machine, ui_menu *menu, void *parame
menu
-------------------------------------------------*/
-static void menu_select_game(running_machine *machine, ui_menu *menu, void *parameter, void *state)
+static void menu_select_game(running_machine &machine, ui_menu *menu, void *parameter, void *state)
{
select_game_state *menustate;
const ui_menu_event *menu_event;
@@ -3452,7 +3454,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
/* special case for configure inputs */
if ((FPTR)driver == 1)
- ui_menu_stack_push(ui_menu_alloc(menu->machine, menu->container, menu_input_groups, NULL));
+ ui_menu_stack_push(ui_menu_alloc(menu->machine(), menu->container, menu_input_groups, NULL));
/* anything else is a driver */
else
@@ -3462,7 +3464,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
int audit_result;
/* audit the game first to see if we're going to work */
- audit_records = audit_images(menu->machine->options(), driver, AUDIT_VALIDATE_FAST, &audit);
+ audit_records = audit_images(menu->machine().options(), driver, AUDIT_VALIDATE_FAST, &audit);
audit_result = audit_summary(driver, audit_records, audit, FALSE);
if (audit_records > 0)
global_free(audit);
@@ -3470,7 +3472,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
/* if everything looks good, schedule the new driver */
if (audit_result == CORRECT || audit_result == BEST_AVAILABLE)
{
- machine->schedule_new_driver(*driver);
+ machine.schedule_new_driver(*driver);
ui_menu_stack_reset(machine);
}
@@ -3487,7 +3489,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
else if (menu_event->iptkey == IPT_UI_CANCEL && menustate->search[0] != 0)
{
/* since we have already been popped, we must recreate ourself from scratch */
- ui_menu_stack_push(ui_menu_alloc(menu->machine, menu->container, menu_select_game, NULL));
+ ui_menu_stack_push(ui_menu_alloc(menu->machine(), menu->container, menu_select_game, NULL));
}
/* typed characters append to the buffer */
@@ -3527,7 +3529,7 @@ static void menu_select_game(running_machine *machine, ui_menu *menu, void *para
select menu
-------------------------------------------------*/
-static void menu_select_game_populate(running_machine *machine, ui_menu *menu, select_game_state *menustate)
+static void menu_select_game_populate(running_machine &machine, ui_menu *menu, select_game_state *menustate)
{
int matchcount;
int curitem;
@@ -3572,7 +3574,7 @@ static void menu_select_game_populate(running_machine *machine, ui_menu *menu, s
}
/* configure the custom rendering */
- ui_menu_set_custom_render(menu, menu_select_game_custom_render, ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER, 4.0f * ui_get_line_height(*machine) + 3.0f * UI_BOX_TB_BORDER);
+ ui_menu_set_custom_render(menu, menu_select_game_custom_render, ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER, 4.0f * ui_get_line_height(machine) + 3.0f * UI_BOX_TB_BORDER);
}
@@ -3614,7 +3616,7 @@ static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state
memset(found, 0, (driver_count + 7) / 8);
/* open a path to the ROMs and find them in the array */
- file_enumerator path(menu->machine->options().media_path());
+ file_enumerator path(menu->machine().options().media_path());
const osd_directory_entry *dir;
/* iterate while we get new objects */
@@ -3660,7 +3662,7 @@ static void menu_select_game_build_driver_list(ui_menu *menu, select_game_state
special rendering
-------------------------------------------------*/
-static void menu_select_game_custom_render(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
+static void menu_select_game_custom_render(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
{
select_game_state *menustate = (select_game_state *)state;
const game_driver *driver;
@@ -3798,7 +3800,7 @@ static void menu_select_game_custom_render(running_machine *machine, ui_menu *me
{
ui_draw_text_full(menu->container, &tempbuf[line][0], x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, NULL, NULL);
- y1 += ui_get_line_height(*machine);
+ y1 += ui_get_line_height(machine);
}
}
diff --git a/src/emu/uimenu.h b/src/emu/uimenu.h
index b58dd9f2b33..4e4d5e4f20f 100644
--- a/src/emu/uimenu.h
+++ b/src/emu/uimenu.h
@@ -57,8 +57,8 @@ typedef struct _ui_menu ui_menu;
/* menu-related callback functions */
-typedef void (*ui_menu_handler_func)(running_machine *machine, ui_menu *menu, void *parameter, void *state);
-typedef void (*ui_menu_custom_func)(running_machine *machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
+typedef void (*ui_menu_handler_func)(running_machine &machine, ui_menu *menu, void *parameter, void *state);
+typedef void (*ui_menu_custom_func)(running_machine &machine, ui_menu *menu, void *state, void *selectedref, float top, float bottom, float x, float y, float x2, float y2);
typedef void (*ui_menu_destroy_state_func)(ui_menu *menu, void *state);
@@ -81,14 +81,14 @@ struct _ui_menu_event
/* ----- core system management ----- */
/* initialization */
-void ui_menu_init(running_machine *machine);
+void ui_menu_init(running_machine &machine);
/* ----- core menu management ----- */
/* allocate a new menu */
-ui_menu *ui_menu_alloc(running_machine *machine, render_container *container, ui_menu_handler_func handler, void *parameter);
+ui_menu *ui_menu_alloc(running_machine &machine, render_container *container, ui_menu_handler_func handler, void *parameter);
/* free a menu */
void ui_menu_free(ui_menu *menu);
@@ -103,7 +103,7 @@ int ui_menu_populated(ui_menu *menu);
void ui_menu_item_append(ui_menu *menu, const char *text, const char *subtext, UINT32 flags, void *ref);
/* process a menu, drawing it and returning any interesting events */
-const ui_menu_event *ui_menu_process(running_machine *machine, ui_menu *menu, UINT32 flags);
+const ui_menu_event *ui_menu_process(running_machine &machine, ui_menu *menu, UINT32 flags);
/* configure the menu for custom rendering */
void ui_menu_set_custom_render(ui_menu *menu, ui_menu_custom_func custom, float top, float bottom);
@@ -128,26 +128,26 @@ void ui_menu_set_selection(ui_menu *menu, void *selected_itemref);
/* ----- menu stack management ----- */
/* reset the menus, clearing everything */
-void ui_menu_stack_reset(running_machine *machine);
+void ui_menu_stack_reset(running_machine &machine);
/* push a new menu onto the stack */
void ui_menu_stack_push(ui_menu *menu);
/* pop a menu from the stack */
-void ui_menu_stack_pop(running_machine *machine);
+void ui_menu_stack_pop(running_machine &machine);
/* ----- UI system interaction ----- */
/* master handler */
-UINT32 ui_menu_ui_handler(running_machine *machine, render_container *container, UINT32 state);
+UINT32 ui_menu_ui_handler(running_machine &machine, render_container *container, UINT32 state);
/* slider handler */
-UINT32 ui_slider_ui_handler(running_machine *machine, render_container *container, UINT32 state);
+UINT32 ui_slider_ui_handler(running_machine &machine, render_container *container, UINT32 state);
/* force game select menu */
-void ui_menu_force_game_select(running_machine *machine, render_container *container);
+void ui_menu_force_game_select(running_machine &machine, render_container *container);
int ui_menu_is_force_game_select(void);
diff --git a/src/emu/video.c b/src/emu/video.c
index 5cc3c54698b..aed2ef572bc 100644
--- a/src/emu/video.c
+++ b/src/emu/video.c
@@ -234,10 +234,10 @@ void video_manager::frame_update(bool debug)
}
// draw the user interface
- ui_update_and_render(&m_machine, &m_machine.render().ui_container());
+ ui_update_and_render(m_machine, &m_machine.render().ui_container());
// update the internal render debugger
- debugint_update_during_game(&m_machine);
+ debugint_update_during_game(m_machine);
// if we're throttling, synchronize before rendering
attotime current_time = m_machine.time();
@@ -265,7 +265,7 @@ void video_manager::frame_update(bool debug)
if (phase == MACHINE_PHASE_RUNNING)
{
// reset partial updates if we're paused or if the debugger is active
- if (m_machine.primary_screen != NULL && (m_machine.paused() || debug || debugger_within_instruction_hook(&m_machine)))
+ if (m_machine.primary_screen != NULL && (m_machine.paused() || debug || debugger_within_instruction_hook(m_machine)))
m_machine.primary_screen->scanline0_callback();
// otherwise, call the video EOF callback
@@ -452,7 +452,7 @@ void video_manager::begin_recording(const char *name, movie_format format)
else if (format == MF_MNG)
{
// create a new movie file and start recording
- m_mngfile = auto_alloc(&m_machine, emu_file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
+ m_mngfile = auto_alloc(m_machine, emu_file(m_machine.options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS));
file_error filerr;
if (name != NULL)
filerr = m_mngfile->open(name);
@@ -497,7 +497,7 @@ void video_manager::end_recording()
if (m_mngfile != NULL)
{
mng_capture_stop(*m_mngfile);
- auto_free(&m_machine, m_mngfile);
+ auto_free(m_machine, m_mngfile);
m_mngfile = NULL;
}
@@ -1082,8 +1082,8 @@ void video_manager::create_snapshot_bitmap(device_t *screen)
if (m_snap_bitmap == NULL || width != m_snap_bitmap->width || height != m_snap_bitmap->height)
{
if (m_snap_bitmap != NULL)
- auto_free(&m_machine, m_snap_bitmap);
- m_snap_bitmap = auto_alloc(&m_machine, bitmap_t(width, height, BITMAP_FORMAT_RGB32));
+ auto_free(m_machine, m_snap_bitmap);
+ m_snap_bitmap = auto_alloc(m_machine, bitmap_t(width, height, BITMAP_FORMAT_RGB32));
}
// render the screen there
@@ -1294,10 +1294,10 @@ void video_manager::record_frame()
invalid palette index
-------------------------------------------------*/
-void video_assert_out_of_range_pixels(running_machine *machine, bitmap_t *bitmap)
+void video_assert_out_of_range_pixels(running_machine &machine, bitmap_t *bitmap)
{
#ifdef MAME_DEBUG
- int maxindex = palette_get_max_index(machine->palette);
+ int maxindex = palette_get_max_index(machine.palette);
int x, y;
// this only applies to indexed16 bitmaps
diff --git a/src/emu/video.h b/src/emu/video.h
index e83e06d96f3..b928f9b6d0f 100644
--- a/src/emu/video.h
+++ b/src/emu/video.h
@@ -204,7 +204,7 @@ private:
// ----- debugging helpers -----
// assert if any pixels in the given bitmap contain an invalid palette index
-void video_assert_out_of_range_pixels(running_machine *machine, bitmap_t *bitmap);
+void video_assert_out_of_range_pixels(running_machine &machine, bitmap_t *bitmap);
#endif /* __VIDEO_H__ */
diff --git a/src/emu/video/crt9007.c b/src/emu/video/crt9007.c
index f048f8929f2..88ea8b4a6ad 100644
--- a/src/emu/video/crt9007.c
+++ b/src/emu/video/crt9007.c
@@ -255,7 +255,7 @@ device_config *crt9007_device_config::static_alloc_device_config(const machine_c
device_t *crt9007_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, crt9007_device(machine, *this));
+ return auto_alloc(machine, crt9007_device(machine, *this));
}
@@ -566,7 +566,7 @@ void crt9007_device::device_start()
devcb_resolve_write_line(&m_out_sld_func, &m_config.out_sld_func, this);
// get the screen device
- m_screen = machine->device<screen_device>(m_config.screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.screen_tag);
assert(m_screen != NULL);
// set horizontal pixels per column
diff --git a/src/emu/video/crt9021.c b/src/emu/video/crt9021.c
index 13844f4808f..dd159dd2ba4 100644
--- a/src/emu/video/crt9021.c
+++ b/src/emu/video/crt9021.c
@@ -103,7 +103,7 @@ device_config *crt9021_device_config::static_alloc_device_config(const machine_c
device_t *crt9021_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, crt9021_device(machine, *this));
+ return auto_alloc(machine, crt9021_device(machine, *this));
}
@@ -166,7 +166,7 @@ void crt9021_device::device_start()
devcb_resolve_read_line(&m_in_atten_func, &m_config.in_atten_func, this);
// get the screen device
- m_screen = machine->device<screen_device>(m_config.screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.screen_tag);
assert(m_screen != NULL);
// register for state saving
diff --git a/src/emu/video/crt9212.c b/src/emu/video/crt9212.c
index 0a91fc8948a..8b6e75e5766 100644
--- a/src/emu/video/crt9212.c
+++ b/src/emu/video/crt9212.c
@@ -76,7 +76,7 @@ device_config *crt9212_device_config::static_alloc_device_config(const machine_c
device_t *crt9212_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, crt9212_device(machine, *this));
+ return auto_alloc(machine, crt9212_device(machine, *this));
}
diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c
index 9b74b409f6e..f600106dc4b 100644
--- a/src/emu/video/generic.c
+++ b/src/emu/video/generic.c
@@ -118,9 +118,9 @@ const gfx_layout gfx_16x16x4_planar =
palette RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT16 paletteram16_le(running_machine *machine, offs_t offset)
+INLINE UINT16 paletteram16_le(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u8[offset & ~1] | (machine->generic.paletteram.u8[offset | 1] << 8);
+ return machine.generic.paletteram.u8[offset & ~1] | (machine.generic.paletteram.u8[offset | 1] << 8);
}
@@ -130,9 +130,9 @@ INLINE UINT16 paletteram16_le(running_machine *machine, offs_t offset)
palette RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT16 paletteram16_be(running_machine *machine, offs_t offset)
+INLINE UINT16 paletteram16_be(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u8[offset | 1] | (machine->generic.paletteram.u8[offset & ~1] << 8);
+ return machine.generic.paletteram.u8[offset | 1] | (machine.generic.paletteram.u8[offset & ~1] << 8);
}
@@ -142,9 +142,9 @@ INLINE UINT16 paletteram16_be(running_machine *machine, offs_t offset)
RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT16 paletteram16_split(running_machine *machine, offs_t offset)
+INLINE UINT16 paletteram16_split(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u8[offset] | (machine->generic.paletteram2.u8[offset] << 8);
+ return machine.generic.paletteram.u8[offset] | (machine.generic.paletteram2.u8[offset] << 8);
}
@@ -154,9 +154,9 @@ INLINE UINT16 paletteram16_split(running_machine *machine, offs_t offset)
palette RAM referenced by offset
-------------------------------------------------*/
-INLINE UINT32 paletteram32_be(running_machine *machine, offs_t offset)
+INLINE UINT32 paletteram32_be(running_machine &machine, offs_t offset)
{
- return machine->generic.paletteram.u16[offset | 1] | (machine->generic.paletteram.u16[offset & ~1] << 16);
+ return machine.generic.paletteram.u16[offset | 1] | (machine.generic.paletteram.u16[offset & ~1] << 16);
}
@@ -166,7 +166,7 @@ INLINE UINT32 paletteram32_be(running_machine *machine, offs_t offset)
shift values
-------------------------------------------------*/
-INLINE void set_color_444(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_444(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal4bit(data >> rshift), pal4bit(data >> gshift), pal4bit(data >> bshift));
}
@@ -178,7 +178,7 @@ INLINE void set_color_444(running_machine *machine, pen_t color, int rshift, int
shift values
-------------------------------------------------*/
-INLINE void set_color_4444(running_machine *machine, pen_t color, int ishift, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_4444(running_machine &machine, pen_t color, int ishift, int rshift, int gshift, int bshift, UINT16 data)
{
static const UINT8 ztable[16] =
{ 0x0, 0x3, 0x4, 0x5, 0x6, 0x7, 0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf, 0x10, 0x11 };
@@ -199,7 +199,7 @@ INLINE void set_color_4444(running_machine *machine, pen_t color, int ishift, in
shift values
-------------------------------------------------*/
-INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+INLINE void set_color_555(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
@@ -211,7 +211,7 @@ INLINE void set_color_555(running_machine *machine, pen_t color, int rshift, int
shift values
-------------------------------------------------*/
-INLINE void set_color_888(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
+INLINE void set_color_888(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT32 data)
{
palette_set_color_rgb(machine, color, (data >> rshift) & 0xff, (data >> gshift) & 0xff, (data >> bshift) & 0xff);
}
@@ -227,34 +227,34 @@ INLINE void set_color_888(running_machine *machine, pen_t color, int rshift, int
register for save states
-------------------------------------------------*/
-void generic_video_init(running_machine *machine)
+void generic_video_init(running_machine &machine)
{
generic_video_private *state;
- state = machine->generic_video_data = auto_alloc_clear(machine, generic_video_private);
+ state = machine.generic_video_data = auto_alloc_clear(machine, generic_video_private);
- machine->state().save_item(NAME(state->flip_screen_x));
- machine->state().save_item(NAME(state->flip_screen_y));
+ machine.state().save_item(NAME(state->flip_screen_x));
+ machine.state().save_item(NAME(state->flip_screen_y));
// create spriteram buffers if necessary
- if (machine->config().m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
+ if (machine.config().m_video_attributes & VIDEO_BUFFERS_SPRITERAM)
{
- assert_always(machine->generic.spriteram_size != 0, "Video buffers spriteram but spriteram size is 0");
+ assert_always(machine.generic.spriteram_size != 0, "Video buffers spriteram but spriteram size is 0");
// allocate memory for the back buffer
- machine->generic.buffered_spriteram.u8 = auto_alloc_array(machine, UINT8, machine->generic.spriteram_size);
+ machine.generic.buffered_spriteram.u8 = auto_alloc_array(machine, UINT8, machine.generic.spriteram_size);
// register for saving it
- state_save_register_global_pointer(machine, machine->generic.buffered_spriteram.u8, machine->generic.spriteram_size);
+ state_save_register_global_pointer(machine, machine.generic.buffered_spriteram.u8, machine.generic.spriteram_size);
// do the same for the second back buffer, if present
- if (machine->generic.spriteram2_size)
+ if (machine.generic.spriteram2_size)
{
// allocate memory
- machine->generic.buffered_spriteram2.u8 = auto_alloc_array(machine, UINT8, machine->generic.spriteram2_size);
+ machine.generic.buffered_spriteram2.u8 = auto_alloc_array(machine, UINT8, machine.generic.spriteram2_size);
// register for saving it
- state_save_register_global_pointer(machine, machine->generic.buffered_spriteram2.u8, machine->generic.spriteram2_size);
+ state_save_register_global_pointer(machine, machine.generic.buffered_spriteram2.u8, machine.generic.spriteram2_size);
}
}
}
@@ -273,10 +273,10 @@ void generic_video_init(running_machine *machine)
VIDEO_START( generic_bitmapped )
{
/* allocate the temporary bitmap */
- machine->generic.tmpbitmap = machine->primary_screen->alloc_compatible_bitmap();
+ machine.generic.tmpbitmap = machine.primary_screen->alloc_compatible_bitmap();
/* ensure the contents of the bitmap are saved */
- machine->state().save_item(NAME(*machine->generic.tmpbitmap));
+ machine.state().save_item(NAME(*machine.generic.tmpbitmap));
}
@@ -287,7 +287,7 @@ VIDEO_START( generic_bitmapped )
SCREEN_UPDATE( generic_bitmapped )
{
- copybitmap(bitmap, screen->machine->generic.tmpbitmap, 0, 0, 0, 0, cliprect);
+ copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect);
return 0;
}
@@ -348,17 +348,17 @@ more control is needed over what is buffered.
WRITE8_HANDLER( buffer_spriteram_w )
{
- memcpy(space->machine->generic.buffered_spriteram.u8, space->machine->generic.spriteram.u8, space->machine->generic.spriteram_size);
+ memcpy(space->machine().generic.buffered_spriteram.u8, space->machine().generic.spriteram.u8, space->machine().generic.spriteram_size);
}
WRITE16_HANDLER( buffer_spriteram16_w )
{
- memcpy(space->machine->generic.buffered_spriteram.u16, space->machine->generic.spriteram.u16, space->machine->generic.spriteram_size);
+ memcpy(space->machine().generic.buffered_spriteram.u16, space->machine().generic.spriteram.u16, space->machine().generic.spriteram_size);
}
WRITE32_HANDLER( buffer_spriteram32_w )
{
- memcpy(space->machine->generic.buffered_spriteram.u32, space->machine->generic.spriteram.u32, space->machine->generic.spriteram_size);
+ memcpy(space->machine().generic.buffered_spriteram.u32, space->machine().generic.spriteram.u32, space->machine().generic.spriteram_size);
}
@@ -369,17 +369,17 @@ WRITE32_HANDLER( buffer_spriteram32_w )
WRITE8_HANDLER( buffer_spriteram_2_w )
{
- memcpy(space->machine->generic.buffered_spriteram2.u8, space->machine->generic.spriteram2.u8, space->machine->generic.spriteram2_size);
+ memcpy(space->machine().generic.buffered_spriteram2.u8, space->machine().generic.spriteram2.u8, space->machine().generic.spriteram2_size);
}
WRITE16_HANDLER( buffer_spriteram16_2_w )
{
- memcpy(space->machine->generic.buffered_spriteram2.u16, space->machine->generic.spriteram2.u16, space->machine->generic.spriteram2_size);
+ memcpy(space->machine().generic.buffered_spriteram2.u16, space->machine().generic.spriteram2.u16, space->machine().generic.spriteram2_size);
}
WRITE32_HANDLER( buffer_spriteram32_2_w )
{
- memcpy(space->machine->generic.buffered_spriteram2.u32, space->machine->generic.spriteram2.u32, space->machine->generic.spriteram2_size);
+ memcpy(space->machine().generic.buffered_spriteram2.u32, space->machine().generic.spriteram2.u32, space->machine().generic.spriteram2_size);
}
@@ -388,14 +388,14 @@ WRITE32_HANDLER( buffer_spriteram32_2_w )
spriteram
-------------------------------------------------*/
-void buffer_spriteram(running_machine *machine, UINT8 *ptr, int length)
+void buffer_spriteram(running_machine &machine, UINT8 *ptr, int length)
{
- memcpy(machine->generic.buffered_spriteram.u8, ptr, length);
+ memcpy(machine.generic.buffered_spriteram.u8, ptr, length);
}
-void buffer_spriteram_2(running_machine *machine, UINT8 *ptr, int length)
+void buffer_spriteram_2(running_machine &machine, UINT8 *ptr, int length)
{
- memcpy(machine->generic.buffered_spriteram2.u8, ptr, length);
+ memcpy(machine.generic.buffered_spriteram2.u8, ptr, length);
}
@@ -408,13 +408,13 @@ void buffer_spriteram_2(running_machine *machine, UINT8 *ptr, int length)
updateflip - handle global flipping
-------------------------------------------------*/
-static void updateflip(running_machine *machine)
+static void updateflip(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
- attoseconds_t period = machine->primary_screen->frame_period().attoseconds;
- rectangle visarea = machine->primary_screen->visible_area();
+ generic_video_private *state = machine.generic_video_data;
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
+ attoseconds_t period = machine.primary_screen->frame_period().attoseconds;
+ rectangle visarea = machine.primary_screen->visible_area();
tilemap_set_flip_all(machine,(TILEMAP_FLIPX & state->flip_screen_x) | (TILEMAP_FLIPY & state->flip_screen_y));
@@ -435,7 +435,7 @@ static void updateflip(running_machine *machine)
visarea.max_y = temp;
}
- machine->primary_screen->configure(width, height, visarea, period);
+ machine.primary_screen->configure(width, height, visarea, period);
}
@@ -443,9 +443,9 @@ static void updateflip(running_machine *machine)
flip_screen_set - set global flip
-------------------------------------------------*/
-void flip_screen_set(running_machine *machine, int on)
+void flip_screen_set(running_machine &machine, int on)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
if (state->flip_screen_x != on || state->flip_screen_y != on)
{
@@ -461,14 +461,14 @@ void flip_screen_set(running_machine *machine, int on)
do not call update_flip.
-------------------------------------------------*/
-void flip_screen_set_no_update(running_machine *machine, int on)
+void flip_screen_set_no_update(running_machine &machine, int on)
{
/* flip_screen_y is not updated on purpose
* this function is for drivers which
* where writing to flip_screen_x to
* bypass update_flip
*/
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
state->flip_screen_x = on;
}
@@ -478,9 +478,9 @@ void flip_screen_set_no_update(running_machine *machine, int on)
flip_screen_x_set - set global horizontal flip
-------------------------------------------------*/
-void flip_screen_x_set(running_machine *machine, int on)
+void flip_screen_x_set(running_machine &machine, int on)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
if (state->flip_screen_x != on)
{
@@ -494,9 +494,9 @@ void flip_screen_x_set(running_machine *machine, int on)
flip_screen_y_set - set global vertical flip
-------------------------------------------------*/
-void flip_screen_y_set(running_machine *machine, int on)
+void flip_screen_y_set(running_machine &machine, int on)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
if (on) on = ~0;
if (state->flip_screen_y != on)
{
@@ -510,9 +510,9 @@ void flip_screen_y_set(running_machine *machine, int on)
flip_screen_get - get global flip
-------------------------------------------------*/
-int flip_screen_get(running_machine *machine)
+int flip_screen_get(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
return state->flip_screen_x;
}
@@ -521,9 +521,9 @@ int flip_screen_get(running_machine *machine)
flip_screen_x_get - get global x flip
-------------------------------------------------*/
-int flip_screen_x_get(running_machine *machine)
+int flip_screen_x_get(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
return state->flip_screen_x;
}
@@ -532,9 +532,9 @@ int flip_screen_x_get(running_machine *machine)
flip_screen_get - get global y flip
-------------------------------------------------*/
-int flip_screen_y_get(running_machine *machine)
+int flip_screen_y_get(running_machine &machine)
{
- generic_video_private *state = machine->generic_video_data;
+ generic_video_private *state = machine.generic_video_data;
return state->flip_screen_y;
}
@@ -552,7 +552,7 @@ PALETTE_INIT( all_black )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
palette_set_color(machine,i,RGB_BLACK); /* black */
}
@@ -606,7 +606,7 @@ PALETTE_INIT( RRRR_GGGG_BBBB )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0,bit1,bit2,bit3,r,g,b;
@@ -618,17 +618,17 @@ PALETTE_INIT( RRRR_GGGG_BBBB )
r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* green component */
- bit0 = (color_prom[i + machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + machine.total_colors()] >> 3) & 0x01;
g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
/* blue component */
- bit0 = (color_prom[i + 2*machine->total_colors()] >> 0) & 0x01;
- bit1 = (color_prom[i + 2*machine->total_colors()] >> 1) & 0x01;
- bit2 = (color_prom[i + 2*machine->total_colors()] >> 2) & 0x01;
- bit3 = (color_prom[i + 2*machine->total_colors()] >> 3) & 0x01;
+ bit0 = (color_prom[i + 2*machine.total_colors()] >> 0) & 0x01;
+ bit1 = (color_prom[i + 2*machine.total_colors()] >> 1) & 0x01;
+ bit2 = (color_prom[i + 2*machine.total_colors()] >> 2) & 0x01;
+ bit3 = (color_prom[i + 2*machine.total_colors()] >> 3) & 0x01;
b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -688,8 +688,8 @@ PALETTE_INIT( RRRRR_GGGGGG_BBBBB )
WRITE8_HANDLER( paletteram_RRRGGGBB_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0));
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data >> 0));
}
@@ -699,8 +699,8 @@ WRITE8_HANDLER( paletteram_RRRGGGBB_w )
WRITE8_HANDLER( paletteram_BBGGGRRR_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
}
@@ -712,8 +712,8 @@ WRITE8_HANDLER( paletteram_BBGGRRII_w )
{
int i = (data >> 0) & 3;
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal4bit(((data >> 0) & 0x0c) | i),
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal4bit(((data >> 0) & 0x0c) | i),
pal4bit(((data >> 2) & 0x0c) | i),
pal4bit(((data >> 4) & 0x0c) | i));
}
@@ -726,8 +726,8 @@ WRITE8_HANDLER( paletteram_IIBBGGRR_w )
{
int i = (data >> 6) & 3;
- space->machine->generic.paletteram.u8[offset] = data;
- palette_set_color_rgb(space->machine, offset, pal4bit(((data << 2) & 0x0c) | i),
+ space->machine().generic.paletteram.u8[offset] = data;
+ palette_set_color_rgb(space->machine(), offset, pal4bit(((data << 2) & 0x0c) | i),
pal4bit(((data >> 0) & 0x0c) | i),
pal4bit(((data >> 2) & 0x0c) | i));
}
@@ -744,32 +744,32 @@ WRITE8_HANDLER( paletteram_IIBBGGRR_w )
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 0, 4, 8, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 0, 4, 8, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 0, 4, 8, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 0, 4, 8, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 0, 4, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 0, 4, 8, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBGGGGRRRR_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 0, 4, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 0, 4, 8, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xxxxBBBBGGGGRRRR_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 0, 4, 8, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 0, 4, 8, space->machine().generic.paletteram.u16[offset]);
}
@@ -779,32 +779,32 @@ WRITE16_HANDLER( paletteram16_xxxxBBBBGGGGRRRR_word_w )
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 4, 0, 8, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 4, 0, 8, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 4, 0, 8, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 4, 0, 8, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 4, 0, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 4, 0, 8, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxBBBBRRRRGGGG_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 4, 0, 8, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 4, 0, 8, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xxxxBBBBRRRRGGGG_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 4, 0, 8, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 4, 0, 8, space->machine().generic.paletteram.u16[offset]);
}
@@ -814,14 +814,14 @@ WRITE16_HANDLER( paletteram16_xxxxBBBBRRRRGGGG_word_w )
WRITE8_HANDLER( paletteram_xxxxRRRRBBBBGGGG_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 0, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 0, 4, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRBBBBGGGG_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 0, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 0, 4, paletteram16_split(space->machine(), offset));
}
@@ -831,32 +831,32 @@ WRITE8_HANDLER( paletteram_xxxxRRRRBBBBGGGG_split2_w )
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 8, 4, 0, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 8, 4, 0, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 8, 4, 0, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 8, 4, 0, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 4, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 4, 0, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xxxxRRRRGGGGBBBB_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 8, 4, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 8, 4, 0, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xxxxRRRRGGGGBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 8, 4, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 8, 4, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -866,26 +866,26 @@ WRITE16_HANDLER( paletteram16_xxxxRRRRGGGGBBBB_word_w )
WRITE8_HANDLER( paletteram_RRRRGGGGBBBBxxxx_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset / 2, 12, 8, 4, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset / 2, 12, 8, 4, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_RRRRGGGGBBBBxxxx_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_444(space->machine, offset, 12, 8, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_444(space->machine(), offset, 12, 8, 4, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_RRRRGGGGBBBBxxxx_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_444(space->machine, offset, 12, 8, 4, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_444(space->machine(), offset, 12, 8, 4, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBxxxx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_444(space->machine, offset, 12, 8, 4, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_444(space->machine(), offset, 12, 8, 4, space->machine().generic.paletteram.u16[offset]);
}
@@ -900,32 +900,32 @@ WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBxxxx_word_w )
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 0, 5, 10, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 0, 5, 10, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 0, 5, 10, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 0, 5, 10, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset, 0, 5, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset, 0, 5, 10, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBGGGGGRRRRR_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_555(space->machine, offset, 0, 5, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_555(space->machine(), offset, 0, 5, 10, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xBBBBBGGGGGRRRRR_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 0, 5, 10, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 0, 5, 10, space->machine().generic.paletteram.u16[offset]);
}
@@ -935,14 +935,14 @@ WRITE16_HANDLER( paletteram16_xBBBBBGGGGGRRRRR_word_w )
WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset, 5, 0, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset, 5, 0, 10, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_555(space->machine, offset, 5, 0, 10, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_555(space->machine(), offset, 5, 0, 10, paletteram16_split(space->machine(), offset));
}
@@ -952,32 +952,32 @@ WRITE8_HANDLER( paletteram_xBBBBBRRRRRGGGGG_split2_w )
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_le_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 10, 5, 0, paletteram16_le(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 10, 5, 0, paletteram16_le(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_be_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset / 2, 10, 5, 0, paletteram16_be(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset / 2, 10, 5, 0, paletteram16_be(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split1_w )
{
- space->machine->generic.paletteram.u8[offset] = data;
- set_color_555(space->machine, offset, 10, 5, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram.u8[offset] = data;
+ set_color_555(space->machine(), offset, 10, 5, 0, paletteram16_split(space->machine(), offset));
}
WRITE8_HANDLER( paletteram_xRRRRRGGGGGBBBBB_split2_w )
{
- space->machine->generic.paletteram2.u8[offset] = data;
- set_color_555(space->machine, offset, 10, 5, 0, paletteram16_split(space->machine, offset));
+ space->machine().generic.paletteram2.u8[offset] = data;
+ set_color_555(space->machine(), offset, 10, 5, 0, paletteram16_split(space->machine(), offset));
}
WRITE16_HANDLER( paletteram16_xRRRRRGGGGGBBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 10, 5, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 10, 5, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -987,8 +987,8 @@ WRITE16_HANDLER( paletteram16_xRRRRRGGGGGBBBBB_word_w )
WRITE16_HANDLER( paletteram16_xGGGGGRRRRRBBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 5, 10, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 5, 10, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -998,8 +998,8 @@ WRITE16_HANDLER( paletteram16_xGGGGGRRRRRBBBBB_word_w )
WRITE16_HANDLER( paletteram16_xGGGGGBBBBBRRRRR_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 0, 10, 5, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 0, 10, 5, space->machine().generic.paletteram.u16[offset]);
}
@@ -1009,8 +1009,8 @@ WRITE16_HANDLER( paletteram16_xGGGGGBBBBBRRRRR_word_w )
WRITE16_HANDLER( paletteram16_GGGGGRRRRRBBBBBx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 6, 11, 1, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 6, 11, 1, space->machine().generic.paletteram.u16[offset]);
}
/*-------------------------------------------------
@@ -1019,8 +1019,8 @@ WRITE16_HANDLER( paletteram16_GGGGGRRRRRBBBBBx_word_w )
WRITE16_HANDLER( paletteram16_RRRRRGGGGGBBBBBx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_555(space->machine, offset, 11, 6, 1, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_555(space->machine(), offset, 11, 6, 1, space->machine().generic.paletteram.u16[offset]);
}
@@ -1030,9 +1030,9 @@ WRITE16_HANDLER( paletteram16_RRRRRGGGGGBBBBBx_word_w )
WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBRGBx_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- data = space->machine->generic.paletteram.u16[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)),
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ data = space->machine().generic.paletteram.u16[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(((data >> 11) & 0x1e) | ((data >> 3) & 0x01)),
pal5bit(((data >> 7) & 0x1e) | ((data >> 2) & 0x01)),
pal5bit(((data >> 3) & 0x1e) | ((data >> 1) & 0x01)));
}
@@ -1049,8 +1049,8 @@ WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBRGBx_word_w )
WRITE16_HANDLER( paletteram16_IIIIRRRRGGGGBBBB_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_4444(space->machine, offset, 12, 8, 4, 0, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_4444(space->machine(), offset, 12, 8, 4, 0, space->machine().generic.paletteram.u16[offset]);
}
@@ -1060,8 +1060,8 @@ WRITE16_HANDLER( paletteram16_IIIIRRRRGGGGBBBB_word_w )
WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBIIII_word_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_4444(space->machine, offset, 0, 12, 8, 4, space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_4444(space->machine(), offset, 0, 12, 8, 4, space->machine().generic.paletteram.u16[offset]);
}
@@ -1076,8 +1076,8 @@ WRITE16_HANDLER( paletteram16_RRRRGGGGBBBBIIII_word_w )
WRITE16_HANDLER( paletteram16_xrgb_word_be_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_888(space->machine, offset / 2, 16, 8, 0, paletteram32_be(space->machine, offset));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_888(space->machine(), offset / 2, 16, 8, 0, paletteram32_be(space->machine(), offset));
}
@@ -1087,6 +1087,6 @@ WRITE16_HANDLER( paletteram16_xrgb_word_be_w )
WRITE16_HANDLER( paletteram16_xbgr_word_be_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- set_color_888(space->machine, offset / 2, 0, 8, 16, paletteram32_be(space->machine, offset));
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ set_color_888(space->machine(), offset / 2, 0, 8, 16, paletteram32_be(space->machine(), offset));
}
diff --git a/src/emu/video/generic.h b/src/emu/video/generic.h
index 90796c75591..9ed617608d8 100644
--- a/src/emu/video/generic.h
+++ b/src/emu/video/generic.h
@@ -38,7 +38,7 @@ extern const gfx_layout gfx_16x16x4_planar;
/* ----- initialization ----- */
/* set up all the common systems */
-void generic_video_init(running_machine *machine);
+void generic_video_init(running_machine &machine);
/* generic video start with a temporary bitmap */
VIDEO_START( generic_bitmapped );
@@ -59,21 +59,21 @@ WRITE16_HANDLER( buffer_spriteram16_2_w );
WRITE32_HANDLER( buffer_spriteram32_2_w );
/* perform the actual buffering */
-void buffer_spriteram(running_machine *machine, UINT8 *ptr, int length);
-void buffer_spriteram_2(running_machine *machine, UINT8 *ptr, int length);
+void buffer_spriteram(running_machine &machine, UINT8 *ptr, int length);
+void buffer_spriteram_2(running_machine &machine, UINT8 *ptr, int length);
/* ----- global attributes ----- */
/* set global attributes */
-void flip_screen_set(running_machine *machine, int on);
-void flip_screen_set_no_update(running_machine *machine, int on); /* will not call update_flip */
-void flip_screen_x_set(running_machine *machine, int on);
-void flip_screen_y_set(running_machine *machine, int on);
-int flip_screen_get(running_machine *machine);
-int flip_screen_x_get(running_machine *machine);
-int flip_screen_y_get(running_machine *machine);
+void flip_screen_set(running_machine &machine, int on);
+void flip_screen_set_no_update(running_machine &machine, int on); /* will not call update_flip */
+void flip_screen_x_set(running_machine &machine, int on);
+void flip_screen_y_set(running_machine &machine, int on);
+int flip_screen_get(running_machine &machine);
+int flip_screen_x_get(running_machine &machine);
+int flip_screen_y_get(running_machine &machine);
//#define flip_screen flip_screen_get(machine)
diff --git a/src/emu/video/hd61830.c b/src/emu/video/hd61830.c
index 6fceb8014cb..b8fa2de0f85 100644
--- a/src/emu/video/hd61830.c
+++ b/src/emu/video/hd61830.c
@@ -105,7 +105,7 @@ device_config *hd61830_device_config::static_alloc_device_config(const machine_c
device_t *hd61830_device_config::alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, hd61830_device(machine, *this));
+ return auto_alloc(machine, hd61830_device(machine, *this));
}
@@ -208,7 +208,7 @@ void hd61830_device::device_start()
// resolve callbacks
devcb_resolve_read8(&m_in_rd_func, &m_config.m_in_rd_func, this);
- m_screen = machine->device<screen_device>(m_config.screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.screen_tag);
// register for state saving
save_item(NAME(m_bf));
diff --git a/src/emu/video/hd63484.c b/src/emu/video/hd63484.c
index 2e8a5efea7e..7d159b45224 100644
--- a/src/emu/video/hd63484.c
+++ b/src/emu/video/hd63484.c
@@ -1037,7 +1037,7 @@ static void hd63484_command_w(device_t *device, UINT16 cmd)
#if LOG_COMMANDS
int i;
- logerror("%s: HD63484 command %s (%04x) ", device->machine->describe_context(), instruction_name[hd63484->fifo[0] >> 10], hd63484->fifo[0]);
+ logerror("%s: HD63484 command %s (%04x) ", device->machine().describe_context(), instruction_name[hd63484->fifo[0] >> 10], hd63484->fifo[0]);
for (i = 1; i < hd63484->fifo_counter; i++)
logerror("%04x ", hd63484->fifo[i]);
logerror("\n");
@@ -1470,7 +1470,7 @@ READ16_DEVICE_HANDLER( hd63484_status_r )
// if (cpu_get_pc(space->cpu) != 0xfced6 && cpu_get_pc(space->cpu) != 0xfe1d6)
// logerror("%05x: HD63484 status read\n",cpu_get_pc(space->cpu));
- return 0xff22 | (device->machine->rand() & 0x0004); /* write FIFO ready + command end + (read FIFO ready or read FIFO not ready) */
+ return 0xff22 | (device->machine().rand() & 0x0004); /* write FIFO ready + command end + (read FIFO ready or read FIFO not ready) */
}
WRITE16_DEVICE_HANDLER( hd63484_address_w )
@@ -1508,7 +1508,7 @@ READ16_DEVICE_HANDLER( hd63484_data_r )
int res;
if (hd63484->regno == 0x80)
- res = device->machine->primary_screen->vpos();
+ res = device->machine().primary_screen->vpos();
else if (hd63484->regno == 0)
{
#if LOG_COMMANDS
@@ -1562,7 +1562,7 @@ static DEVICE_START( hd63484 )
const hd63484_interface *intf = get_interface(device);
hd63484->skattva_hack = intf->skattva_hack;
- hd63484->ram = auto_alloc_array_clear(device->machine, UINT16, HD63484_RAM_SIZE);
+ hd63484->ram = auto_alloc_array_clear(device->machine(), UINT16, HD63484_RAM_SIZE);
// device->save_item(NAME(hd63484->clear_bitmap));
// device->save_pointer(NAME(hd63484->spriteram), 0x1000);
diff --git a/src/emu/video/mc6845.c b/src/emu/video/mc6845.c
index a2858038003..3ea4a924f18 100644
--- a/src/emu/video/mc6845.c
+++ b/src/emu/video/mc6845.c
@@ -208,7 +208,7 @@ INLINE void call_on_update_address(device_t *device, int strobe)
mc6845_t *mc6845 = get_safe_token(device);
if (mc6845->intf->on_update_addr_changed)
- device->machine->scheduler().timer_set(attotime::zero, FUNC(on_update_address_cb), (mc6845->update_addr << 8) | strobe, (void *) device);
+ device->machine().scheduler().timer_set(attotime::zero, FUNC(on_update_address_cb), (mc6845->update_addr << 8) | strobe, (void *) device);
else
fatalerror("M6845: transparent memory mode without handler\n");
}
@@ -289,7 +289,7 @@ WRITE8_DEVICE_HANDLER( mc6845_register_w )
{
mc6845_t *mc6845 = get_safe_token(device);
- if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", device->machine->describe_context(), mc6845->register_address_latch, data);
+ if (LOG) logerror("%s:M6845 reg 0x%02x = 0x%02x\n", device->machine().describe_context(), mc6845->register_address_latch, data);
switch (mc6845->register_address_latch)
{
@@ -893,10 +893,10 @@ static void common_start(device_t *device, int device_type)
/* get the screen device */
if ( mc6845->intf->screen_tag != NULL )
{
- mc6845->screen = downcast<screen_device *>(device->machine->device(mc6845->intf->screen_tag));
+ mc6845->screen = downcast<screen_device *>(device->machine().device(mc6845->intf->screen_tag));
if (mc6845->screen == NULL) {
astring tempstring;
- mc6845->screen = downcast<screen_device *>(device->machine->device(device->owner()->subtag(tempstring,mc6845->intf->screen_tag)));
+ mc6845->screen = downcast<screen_device *>(device->machine().device(device->owner()->subtag(tempstring,mc6845->intf->screen_tag)));
}
assert(mc6845->screen != NULL);
}
@@ -904,19 +904,19 @@ static void common_start(device_t *device, int device_type)
mc6845->screen = NULL;
/* create the timers */
- mc6845->line_timer = device->machine->scheduler().timer_alloc(FUNC(line_timer_cb), (void *)device);
+ mc6845->line_timer = device->machine().scheduler().timer_alloc(FUNC(line_timer_cb), (void *)device);
- mc6845->de_off_timer = device->machine->scheduler().timer_alloc(FUNC(de_off_timer_cb), (void *)device);
- mc6845->upd_adr_timer = device->machine->scheduler().timer_alloc(FUNC(upd_adr_timer_cb), (void *)device);
+ mc6845->de_off_timer = device->machine().scheduler().timer_alloc(FUNC(de_off_timer_cb), (void *)device);
+ mc6845->upd_adr_timer = device->machine().scheduler().timer_alloc(FUNC(upd_adr_timer_cb), (void *)device);
- mc6845->cur_on_timer = device->machine->scheduler().timer_alloc(FUNC(cur_on_timer_cb), (void *)device);
- mc6845->cur_off_timer = device->machine->scheduler().timer_alloc(FUNC(cur_off_timer_cb), (void *)device);
+ mc6845->cur_on_timer = device->machine().scheduler().timer_alloc(FUNC(cur_on_timer_cb), (void *)device);
+ mc6845->cur_off_timer = device->machine().scheduler().timer_alloc(FUNC(cur_off_timer_cb), (void *)device);
- mc6845->hsync_on_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_on_timer_cb), (void *)device);
- mc6845->hsync_off_timer = device->machine->scheduler().timer_alloc(FUNC(hsync_off_timer_cb), (void *)device);
+ mc6845->hsync_on_timer = device->machine().scheduler().timer_alloc(FUNC(hsync_on_timer_cb), (void *)device);
+ mc6845->hsync_off_timer = device->machine().scheduler().timer_alloc(FUNC(hsync_off_timer_cb), (void *)device);
}
- mc6845->light_pen_latch_timer = device->machine->scheduler().timer_alloc(FUNC(light_pen_latch_timer_cb), (void *)device);
+ mc6845->light_pen_latch_timer = device->machine().scheduler().timer_alloc(FUNC(light_pen_latch_timer_cb), (void *)device);
/* Use some large startup values */
mc6845->horiz_char_total = 0xff;
@@ -924,7 +924,7 @@ static void common_start(device_t *device, int device_type)
mc6845->vert_char_total = 0x7f;
/* register for state saving */
- device->machine->state().register_postload(mc6845_state_save_postload, mc6845);
+ device->machine().state().register_postload(mc6845_state_save_postload, mc6845);
device->save_item(NAME(mc6845->clock));
device->save_item(NAME(mc6845->hpixels_per_column));
diff --git a/src/emu/video/msm6255.c b/src/emu/video/msm6255.c
index 9b0b078a7c3..00d43391d2a 100644
--- a/src/emu/video/msm6255.c
+++ b/src/emu/video/msm6255.c
@@ -143,7 +143,7 @@ msm6255_device::msm6255_device(running_machine &_machine, const msm6255_device_c
void msm6255_device::device_start()
{
// find screen
- m_screen = machine->device<screen_device>(m_config.m_screen_tag);
+ m_screen = m_machine.device<screen_device>(m_config.m_screen_tag);
// register for state saving
save_item(NAME(m_ir));
@@ -447,6 +447,6 @@ void msm6255_device::update_screen(bitmap_t *bitmap, const rectangle *cliprect)
}
else
{
- bitmap_fill(bitmap, cliprect, get_black_pen(machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(m_machine));
}
}
diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c
index 70eb3cbc52f..c38b10067ae 100644
--- a/src/emu/video/pc_vga.c
+++ b/src/emu/video/pc_vga.c
@@ -80,8 +80,8 @@ static VIDEO_START( vga );
static VIDEO_RESET( ega );
static VIDEO_RESET( vga );
-static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int *width, int *height);
-static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int *width, int *height);
+static pc_video_update_proc pc_vga_choosevideomode(running_machine &machine, int *width, int *height);
+static pc_video_update_proc pc_ega_choosevideomode(running_machine &machine, int *width, int *height);
/***************************************************************************
@@ -594,9 +594,9 @@ static WRITE64_HANDLER( vga_vga64_w ) { write64be_with_write8_handler(vga_vga_w,
static READ64_HANDLER( vga_ega64_r ) { return read64be_with_read8_handler(vga_ega_r, space, offset, mem_mask); }
static WRITE64_HANDLER( vga_ega64_w ) { write64be_with_write8_handler(vga_ega_w, space, offset, data, mem_mask); }
-static void vga_cpu_interface(running_machine *machine)
+static void vga_cpu_interface(running_machine &machine)
{
- address_space *space = machine->firstcpu->memory().space(AS_PROGRAM);
+ address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
static int sequencer, gc;
read8_space_func read_handler;
write8_space_func write_handler;
@@ -675,7 +675,7 @@ static void vga_cpu_interface(running_machine *machine)
}
else
{
- buswidth = downcast<cpu_device *>(machine->firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
+ buswidth = downcast<cpu_device *>(machine.firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
switch(buswidth)
{
case 8:
@@ -781,7 +781,7 @@ static READ8_HANDLER(vga_crtc_r)
int clock=vga.monitor.get_clock();
int lines=vga.monitor.get_lines();
int columns=vga.monitor.get_columns();
- int diff = (((space->machine->time() - vga.monitor.start_time) * clock).seconds)
+ int diff = (((space->machine().time() - vga.monitor.start_time) * clock).seconds)
%(lines*columns);
if (diff<columns*vga.monitor.get_sync_lines()) data|=8;
diff=diff/lines;
@@ -791,7 +791,7 @@ static READ8_HANDLER(vga_crtc_r)
if (vga.monitor.retrace)
{
data |= 1;
- if ((space->machine->time() - vga.monitor.start_time) > attotime::from_usec(300))
+ if ((space->machine().time() - vga.monitor.start_time) > attotime::from_usec(300))
{
data |= 8;
vga.monitor.retrace=0;
@@ -799,9 +799,9 @@ static READ8_HANDLER(vga_crtc_r)
}
else
{
- if ((space->machine->time() - vga.monitor.start_time) > attotime::from_msec(15))
+ if ((space->machine().time() - vga.monitor.start_time) > attotime::from_msec(15))
vga.monitor.retrace=1;
- vga.monitor.start_time=space->machine->time();
+ vga.monitor.start_time=space->machine().time();
}
#else
// not working with ps2m30
@@ -1053,10 +1053,10 @@ WRITE8_HANDLER(vga_port_03c0_w)
if (vga.sequencer.index < vga.svga_intf.seq_regcount)
{
vga.sequencer.data[vga.sequencer.index] = data;
- vga_cpu_interface(space->machine);
+ vga_cpu_interface(space->machine());
if (vga.sequencer.index == 0)
- vga.monitor.start_time = space->machine->time();
+ vga.monitor.start_time = space->machine().time();
}
break;
case 6:
@@ -1118,7 +1118,7 @@ WRITE8_HANDLER(vga_port_03c0_w)
if (vga.gc.index < vga.svga_intf.gc_regcount)
{
vga.gc.data[vga.gc.index] = data;
- vga_cpu_interface(space->machine);
+ vga_cpu_interface(space->machine());
}
break;
}
@@ -1154,7 +1154,7 @@ READ8_HANDLER( paradise_ega_03c0_r )
-void pc_vga_reset(running_machine *machine)
+void pc_vga_reset(running_machine &machine)
{
/* clear out the VGA structure */
memset(vga.pens, 0, sizeof(vga.pens));
@@ -1217,7 +1217,7 @@ static WRITE64_HANDLER( vga_port64be_03b0_w ) { write64be_with_write8_handler(vg
static WRITE64_HANDLER( vga_port64be_03c0_w ) { write64be_with_write8_handler(vga_port_03c0_w, space, offset, data, mem_mask); }
static WRITE64_HANDLER( vga_port64be_03d0_w ) { write64be_with_write8_handler(vga_port_03d0_w, space, offset, data, mem_mask); }
-void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf)
+void pc_vga_init(running_machine &machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf)
{
int i, j, k, mask, buswidth;
address_space *spacevga;
@@ -1265,8 +1265,8 @@ void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_in
memset(vga.crtc.data, '\0', vga.svga_intf.crtc_regcount);
memset(vga.gc.data, '\0', vga.svga_intf.gc_regcount);
- buswidth = downcast<cpu_device *>(machine->firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
- spacevga = machine->firstcpu->memory().space(vga.vga_intf.port_addressspace);
+ buswidth = downcast<cpu_device *>(machine.firstcpu)->space_config(AS_PROGRAM)->m_databus_width;
+ spacevga = machine.firstcpu->memory().space(vga.vga_intf.port_addressspace);
switch(buswidth)
{
case 8:
@@ -1325,7 +1325,7 @@ static VIDEO_START( ega )
vga.monitor.get_columns = ega_get_crtc_columns;
vga.monitor.get_sync_lines = vga_get_crtc_sync_lines;
vga.monitor.get_sync_columns = vga_get_crtc_sync_columns;
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
pc_video_start(machine, pc_ega_choosevideomode, 0);
}
@@ -1340,7 +1340,7 @@ static VIDEO_START( vga )
vga.monitor.get_columns=vga_get_crtc_columns;
vga.monitor.get_sync_lines=vga_get_crtc_sync_lines;
vga.monitor.get_sync_columns=vga_get_crtc_sync_columns;
- machine->scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
+ machine.scheduler().timer_pulse(attotime::from_hz(60), FUNC(vga_timer));
pc_video_start(machine, pc_vga_choosevideomode, 0);
}
@@ -1519,7 +1519,7 @@ static void vga_vh_vga(bitmap_t *bitmap)
}
}
-static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int *width, int *height)
+static pc_video_update_proc pc_ega_choosevideomode(running_machine &machine, int *width, int *height)
{
pc_video_update_proc proc = NULL;
int i;
@@ -1527,7 +1527,7 @@ static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int
//if (CRTC_ON)
{
for (i = 0; i < 16; i++)
- vga.pens[i]=machine->pens[i/*vga.attribute.data[i]&0x3f*/];
+ vga.pens[i]=machine.pens[i/*vga.attribute.data[i]&0x3f*/];
if (!GRAPHIC_MODE)
{
@@ -1545,7 +1545,7 @@ static pc_video_update_proc pc_ega_choosevideomode(running_machine *machine, int
return proc;
}
-static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int *width, int *height)
+static pc_video_update_proc pc_vga_choosevideomode(running_machine &machine, int *width, int *height)
{
pc_video_update_proc proc = NULL;
int i;
@@ -1567,7 +1567,7 @@ static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int
{
for (i=0; i<16;i++)
{
- vga.pens[i] = machine->pens[(vga.attribute.data[i]&0x0f)
+ vga.pens[i] = machine.pens[(vga.attribute.data[i]&0x0f)
|((vga.attribute.data[0x14]&0xf)<<4)];
}
}
@@ -1575,7 +1575,7 @@ static pc_video_update_proc pc_vga_choosevideomode(running_machine *machine, int
{
for (i=0; i<16;i++)
{
- vga.pens[i]=machine->pens[(vga.attribute.data[i]&0x3f)
+ vga.pens[i]=machine.pens[(vga.attribute.data[i]&0x3f)
|((vga.attribute.data[0x14]&0xc)<<4)];
}
}
diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h
index 525274ae344..da059e7ef39 100644
--- a/src/emu/video/pc_vga.h
+++ b/src/emu/video/pc_vga.h
@@ -19,7 +19,7 @@ struct pc_vga_interface
{
/* VGA memory mapper */
const char *vga_memory_bank;
- void (*map_vga_memory)(running_machine *machine, offs_t begin, offs_t end, read8_space_func rh, write8_space_func wh);
+ void (*map_vga_memory)(running_machine &machine, offs_t begin, offs_t end, read8_space_func rh, write8_space_func wh);
/* VGA dipswitch (???) */
read8_space_func read_dipswitch;
@@ -38,8 +38,8 @@ struct pc_svga_interface
pc_video_update_proc (*choosevideomode)(const UINT8 *sequencer, const UINT8 *crtc, const UINT8 *gc, int *width, int *height);
};
-void pc_vga_init(running_machine *machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf);
-void pc_vga_reset(running_machine *machine);
+void pc_vga_init(running_machine &machine, const struct pc_vga_interface *vga_intf, const struct pc_svga_interface *svga_intf);
+void pc_vga_reset(running_machine &machine);
void *pc_vga_memory(void);
size_t pc_vga_memory_size(void);
@@ -103,7 +103,7 @@ WRITE16_HANDLER( vga_port16le_03d0_w );
*/
#if 0
int i;
- UINT8 *memory=machine->region("maincpu")->base()+0xc0000;
+ UINT8 *memory=machine.region("maincpu")->base()+0xc0000;
UINT8 chksum;
/* oak vga */
diff --git a/src/emu/video/pc_video.c b/src/emu/video/pc_video.c
index 5293ffbf69e..9d591dcf908 100644
--- a/src/emu/video/pc_video.c
+++ b/src/emu/video/pc_video.c
@@ -19,7 +19,7 @@
***************************************************************************/
-static pc_video_update_proc (*pc_choosevideomode)(running_machine *machine, int *width, int *height);
+static pc_video_update_proc (*pc_choosevideomode)(running_machine &machine, int *width, int *height);
static int pc_anythingdirty;
static int pc_current_height;
static int pc_current_width;
@@ -38,22 +38,22 @@ static STATE_POSTLOAD( pc_video_postload )
-void pc_video_start(running_machine *machine,
- pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
+void pc_video_start(running_machine &machine,
+ pc_video_update_proc (*choosevideomode)(running_machine &machine, int *width, int *height),
size_t vramsize)
{
pc_choosevideomode = choosevideomode;
pc_anythingdirty = 1;
pc_current_height = -1;
pc_current_width = -1;
- machine->generic.tmpbitmap = NULL;
+ machine.generic.tmpbitmap = NULL;
if (vramsize)
{
video_start_generic_bitmapped(machine);
}
- machine->state().register_postload(pc_video_postload, NULL);
+ machine.state().register_postload(pc_video_postload, NULL);
}
@@ -64,7 +64,7 @@ SCREEN_UPDATE( pc_video )
int w = 0, h = 0;
pc_video_update_proc video_update;
- video_update = pc_choosevideomode(screen->machine, &w, &h);
+ video_update = pc_choosevideomode(screen->machine(), &w, &h);
if (video_update)
{
@@ -88,11 +88,11 @@ SCREEN_UPDATE( pc_video )
bitmap_fill(bitmap, cliprect, 0);
}
- video_update(screen->machine->generic.tmpbitmap ? screen->machine->generic.tmpbitmap : bitmap);
+ video_update(screen->machine().generic.tmpbitmap ? screen->machine().generic.tmpbitmap : bitmap);
- if (screen->machine->generic.tmpbitmap)
+ if (screen->machine().generic.tmpbitmap)
{
- copybitmap(bitmap, screen->machine->generic.tmpbitmap, 0, 0, 0, 0, cliprect);
+ copybitmap(bitmap, screen->machine().generic.tmpbitmap, 0, 0, 0, 0, cliprect);
if (!pc_anythingdirty)
rc = UPDATE_HAS_NOT_CHANGED;
pc_anythingdirty = 0;
diff --git a/src/emu/video/pc_video.h b/src/emu/video/pc_video.h
index 2256ce59cbf..8f1e13655b4 100644
--- a/src/emu/video/pc_video.h
+++ b/src/emu/video/pc_video.h
@@ -11,8 +11,8 @@
typedef void (*pc_video_update_proc)(bitmap_t *bitmap);
-void pc_video_start(running_machine *machine,
- pc_video_update_proc (*choosevideomode)(running_machine *machine, int *width, int *height),
+void pc_video_start(running_machine &machine,
+ pc_video_update_proc (*choosevideomode)(running_machine &machine, int *width, int *height),
size_t vramsize);
SCREEN_UPDATE( pc_video );
diff --git a/src/emu/video/poly.c b/src/emu/video/poly.c
index 02c1c16f8bf..4f372146231 100644
--- a/src/emu/video/poly.c
+++ b/src/emu/video/poly.c
@@ -200,7 +200,7 @@ struct _poly_manager
FUNCTION PROTOTYPES
***************************************************************************/
-static void **allocate_array(running_machine *machine, size_t *itemsize, UINT32 itemcount);
+static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 itemcount);
static void *poly_item_callback(void *param, int threadid);
static STATE_PRESAVE( poly_state_presave );
@@ -316,7 +316,7 @@ INLINE polygon_info *allocate_polygon(poly_manager *poly, int miny, int maxy)
manager
-------------------------------------------------*/
-poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_data_size, UINT8 flags)
+poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags)
{
poly_manager *poly;
@@ -347,7 +347,7 @@ poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_d
poly->queue = osd_work_queue_alloc(WORK_QUEUE_FLAG_MULTI | WORK_QUEUE_FLAG_HIGH_FREQ);
/* request a pre-save callback for synchronization */
- machine->state().register_presave(poly_state_presave, poly);
+ machine.state().register_presave(poly_state_presave, poly);
return poly;
}
@@ -1286,7 +1286,7 @@ int poly_zclip_if_less(int numverts, const poly_vertex *v, poly_vertex *outv, in
allocate_array - allocate an array of pointers
-------------------------------------------------*/
-static void **allocate_array(running_machine *machine, size_t *itemsize, UINT32 itemcount)
+static void **allocate_array(running_machine &machine, size_t *itemsize, UINT32 itemcount)
{
void **ptrarray;
int itemnum;
diff --git a/src/emu/video/poly.h b/src/emu/video/poly.h
index e6fc8c54fa3..49706ec5998 100644
--- a/src/emu/video/poly.h
+++ b/src/emu/video/poly.h
@@ -100,7 +100,7 @@ typedef void (*poly_draw_scanline_func)(void *dest, INT32 scanline, const poly_e
/* ----- initialization/teardown ----- */
/* allocate a new poly manager that can render triangles */
-poly_manager *poly_alloc(running_machine *machine, int max_polys, size_t extra_data_size, UINT8 flags);
+poly_manager *poly_alloc(running_machine &machine, int max_polys, size_t extra_data_size, UINT8 flags);
/* free a poly manager */
void poly_free(poly_manager *poly);
diff --git a/src/emu/video/resnet.c b/src/emu/video/resnet.c
index d60328e5f74..35d98e376ba 100644
--- a/src/emu/video/resnet.c
+++ b/src/emu/video/resnet.c
@@ -696,7 +696,7 @@ int compute_res_net(int inputs, int channel, const res_net_info *di)
return (int) (v * 255 / vcc + 0.4);
}
-rgb_t *compute_res_net_all(running_machine *machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di)
+rgb_t *compute_res_net_all(running_machine &machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di)
{
UINT8 r,g,b;
int i,j,k;
diff --git a/src/emu/video/resnet.h b/src/emu/video/resnet.h
index f81d37a5ad1..1c7d53845c6 100644
--- a/src/emu/video/resnet.h
+++ b/src/emu/video/resnet.h
@@ -160,7 +160,7 @@ int compute_res_net(int inputs, int channel, const res_net_info *di);
/* compute all values */
-rgb_t *compute_res_net_all(running_machine *machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di);
+rgb_t *compute_res_net_all(running_machine &machine, const UINT8 *prom, const res_net_decode_info *rdi, const res_net_info *di);
/* legacy interface */
diff --git a/src/emu/video/s2636.c b/src/emu/video/s2636.c
index 75045759216..f261e1f36db 100644
--- a/src/emu/video/s2636.c
+++ b/src/emu/video/s2636.c
@@ -324,7 +324,7 @@ WRITE8_DEVICE_HANDLER( s2636_work_ram_w )
const s2636_interface *intf = get_interface(device);
if ( intf->sound && *intf->sound )
{
- s2636_soundport_w(device->machine->device(intf->sound), 0, data);
+ s2636_soundport_w(device->machine().device(intf->sound), 0, data);
}
}
@@ -351,7 +351,7 @@ static DEVICE_START( s2636 )
{
s2636_state *s2636 = get_safe_token(device);
const s2636_interface *intf = get_interface(device);
- screen_device *screen = downcast<screen_device *>(device->machine->device(intf->screen));
+ screen_device *screen = downcast<screen_device *>(device->machine().device(intf->screen));
int width = screen->width();
int height = screen->height();
@@ -359,9 +359,9 @@ static DEVICE_START( s2636 )
s2636->x_offset = intf->x_offset;
s2636->y_offset = intf->y_offset;
- s2636->work_ram = auto_alloc_array_clear(device->machine, UINT8, intf->work_ram_size);
- s2636->bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED16);
- s2636->collision_bitmap = auto_bitmap_alloc(device->machine, width, height, BITMAP_FORMAT_INDEXED16);
+ s2636->work_ram = auto_alloc_array_clear(device->machine(), UINT8, intf->work_ram_size);
+ s2636->bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED16);
+ s2636->collision_bitmap = auto_bitmap_alloc(device->machine(), width, height, BITMAP_FORMAT_INDEXED16);
device->save_item(NAME(s2636->x_offset));
device->save_item(NAME(s2636->y_offset));
diff --git a/src/emu/video/saa5050.c b/src/emu/video/saa5050.c
index 8ca8457dd2e..d62f7ae3edd 100644
--- a/src/emu/video/saa5050.c
+++ b/src/emu/video/saa5050.c
@@ -154,18 +154,18 @@ PALETTE_INIT( saa5050 )
{
UINT8 i, r, g, b;
- machine->colortable = colortable_alloc(machine, 8);
+ machine.colortable = colortable_alloc(machine, 8);
for ( i = 0; i < 8; i++ )
{
r = saa5050_colors[i * 3];
g = saa5050_colors[i * 3 + 1];
b = saa5050_colors[i * 3 + 2];
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
for (i = 0; i < 128; i++)
- colortable_entry_set_value(machine->colortable, i, saa5050_palette[i]);
+ colortable_entry_set_value(machine.colortable, i, saa5050_palette[i]);
}
/*************************************
@@ -317,12 +317,12 @@ void saa5050_update( device_t *device, bitmap_t *bitmap, const rectangle *clipre
{
if (saa5050->flags & SAA5050_DBLHI)
{
- drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine->gfx[saa5050->gfxnum + 1], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
- drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine->gfx[saa5050->gfxnum + 2], code, colour, 0, 0, sx * 12, (ssy + 1) * 20, 0x20000, 0x20000);
+ drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 1], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
+ drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 2], code, colour, 0, 0, sx * 12, (ssy + 1) * 20, 0x20000, 0x20000);
}
else
{
- drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine->gfx[saa5050->gfxnum + 0], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
+ drawgfxzoom_opaque(bitmap, cliprect, saa5050->screen->machine().gfx[saa5050->gfxnum + 0], code, colour, 0, 0, sx * 12, ssy * 20, 0x20000, 0x20000);
}
}
}
@@ -344,14 +344,14 @@ static DEVICE_START( saa5050 )
saa5050_state *saa5050 = get_safe_token(device);
const saa5050_interface *intf = get_interface(device);
- saa5050->screen = device->machine->device(intf->screen);
+ saa5050->screen = device->machine().device(intf->screen);
saa5050->gfxnum = intf->gfxnum;
saa5050->x = intf->x;
saa5050->y = intf->y;
saa5050->size = intf->size;
saa5050->rev = intf->rev;
- saa5050->videoram = auto_alloc_array(device->machine, UINT8, 0x800);
+ saa5050->videoram = auto_alloc_array(device->machine(), UINT8, 0x800);
device->save_pointer(NAME(saa5050->videoram), 0x800);
device->save_item(NAME(saa5050->flags));
diff --git a/src/emu/video/tlc34076.c b/src/emu/video/tlc34076.c
index 5e36420e2a8..cbc5d5ae148 100644
--- a/src/emu/video/tlc34076.c
+++ b/src/emu/video/tlc34076.c
@@ -267,13 +267,13 @@ static DEVICE_START( tlc34076 )
state->dacbits = config->res_sel ? 8 : 6;
- state_save_register_global_array(device->machine, state->local_paletteram);
- state_save_register_global_array(device->machine, state->regs);
- state_save_register_global_array(device->machine, state->pens);
+ state_save_register_global_array(device->machine(), state->local_paletteram);
+ state_save_register_global_array(device->machine(), state->regs);
+ state_save_register_global_array(device->machine(), state->pens);
- state_save_register_global(device->machine, state->writeindex);
- state_save_register_global(device->machine, state->readindex);
- state_save_register_global(device->machine, state->dacbits);
+ state_save_register_global(device->machine(), state->writeindex);
+ state_save_register_global(device->machine(), state->readindex);
+ state_save_register_global(device->machine(), state->dacbits);
}
static const char DEVTEMPLATE_SOURCE[] = __FILE__;
diff --git a/src/emu/video/tms34061.c b/src/emu/video/tms34061.c
index e6d754914a1..b4ad0d6aa2d 100644
--- a/src/emu/video/tms34061.c
+++ b/src/emu/video/tms34061.c
@@ -75,12 +75,12 @@ static TIMER_CALLBACK( tms34061_interrupt );
*
*************************************/
-void tms34061_start(running_machine *machine, const struct tms34061_interface *interface)
+void tms34061_start(running_machine &machine, const struct tms34061_interface *interface)
{
/* reset the data */
memset(&tms34061, 0, sizeof(tms34061));
tms34061.intf = *interface;
- tms34061.screen = downcast<screen_device *>(machine->device(tms34061.intf.screen_tag));
+ tms34061.screen = downcast<screen_device *>(machine.device(tms34061.intf.screen_tag));
tms34061.vrammask = tms34061.intf.vramsize - 1;
/* allocate memory for VRAM */
@@ -119,7 +119,7 @@ void tms34061_start(running_machine *machine, const struct tms34061_interface *i
tms34061.regs[TMS34061_VERCOUNTER] = 0x0000;
/* start vertical interrupt timer */
- tms34061.timer = machine->scheduler().timer_alloc(FUNC(tms34061_interrupt));
+ tms34061.timer = machine.scheduler().timer_alloc(FUNC(tms34061_interrupt));
}
@@ -137,9 +137,9 @@ INLINE void update_interrupts(void)
{
/* if the status bit is set, and ints are enabled, turn it on */
if ((tms34061.regs[TMS34061_STATUS] & 0x0001) && (tms34061.regs[TMS34061_CONTROL1] & 0x0400))
- (*tms34061.intf.interrupt)(tms34061.screen->machine, ASSERT_LINE);
+ (*tms34061.intf.interrupt)(tms34061.screen->machine(), ASSERT_LINE);
else
- (*tms34061.intf.interrupt)(tms34061.screen->machine, CLEAR_LINE);
+ (*tms34061.intf.interrupt)(tms34061.screen->machine(), CLEAR_LINE);
}
}
@@ -184,7 +184,7 @@ static void register_w(address_space *space, offs_t offset, UINT8 data)
}
/* log it */
- if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space->machine->describe_context(), regnames[regnum], tms34061.regs[regnum]);
+ if (VERBOSE) logerror("%s:tms34061 %s = %04x\n", space->machine().describe_context(), regnames[regnum], tms34061.regs[regnum]);
/* update the state of things */
switch (regnum)
@@ -262,7 +262,7 @@ static UINT8 register_r(address_space *space, offs_t offset)
}
/* log it */
- if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space->machine->describe_context(), regnames[regnum], result);
+ if (VERBOSE) logerror("%s:tms34061 %s read = %04X\n", space->machine().describe_context(), regnames[regnum], result);
return (offset & 0x02) ? (result >> 8) : result;
}
@@ -369,7 +369,7 @@ static void xypixel_w(address_space *space, int offset, UINT8 data)
/* mask to the VRAM size */
pixeloffs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space->machine->describe_context(), pixeloffs, data, tms34061.latchdata);
+ if (VERBOSE) logerror("%s:tms34061 xy (%04x) = %02x/%02x\n", space->machine().describe_context(), pixeloffs, data, tms34061.latchdata);
/* set the pixel data */
tms34061.vram[pixeloffs] = data;
@@ -425,7 +425,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
offs = ((row << tms34061.intf.rowshift) | col) & tms34061.vrammask;
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
- if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space->machine->describe_context(), offs, data, tms34061.latchdata);
+ if (VERBOSE) logerror("%s:tms34061 direct (%04x) = %02x/%02x\n", space->machine().describe_context(), offs, data, tms34061.latchdata);
if (tms34061.vram[offs] != data || tms34061.latchram[offs] != tms34061.latchdata)
{
tms34061.vram[offs] = data;
@@ -439,7 +439,7 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
offs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space->machine->describe_context(), offs);
+ if (VERBOSE) logerror("%s:tms34061 shiftreg write (%04x)\n", space->machine().describe_context(), offs);
memcpy(&tms34061.vram[offs], tms34061.shiftreg, (size_t)1 << tms34061.intf.rowshift);
memset(&tms34061.latchram[offs], tms34061.latchdata, (size_t)1 << tms34061.intf.rowshift);
@@ -451,14 +451,14 @@ void tms34061_w(address_space *space, int col, int row, int func, UINT8 data)
if (tms34061.regs[TMS34061_CONTROL2] & 0x0040)
offs |= (tms34061.regs[TMS34061_CONTROL2] & 3) << 16;
offs &= tms34061.vrammask;
- if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space->machine->describe_context(), offs);
+ if (VERBOSE) logerror("%s:tms34061 shiftreg read (%04x)\n", space->machine().describe_context(), offs);
tms34061.shiftreg = &tms34061.vram[offs];
break;
/* log anything else */
default:
- logerror("%s:Unsupported TMS34061 function %d\n", space->machine->describe_context(), func);
+ logerror("%s:Unsupported TMS34061 function %d\n", space->machine().describe_context(), func);
break;
}
}
@@ -512,7 +512,7 @@ UINT8 tms34061_r(address_space *space, int col, int row, int func)
/* log anything else */
default:
- logerror("%s:Unsupported TMS34061 function %d\n", space->machine->describe_context(),
+ logerror("%s:Unsupported TMS34061 function %d\n", space->machine().describe_context(),
func);
break;
}
diff --git a/src/emu/video/tms34061.h b/src/emu/video/tms34061.h
index e94b56d9c29..0128785d9ef 100644
--- a/src/emu/video/tms34061.h
+++ b/src/emu/video/tms34061.h
@@ -43,7 +43,7 @@ struct tms34061_interface
const char *screen_tag; /* the screen we are acting on */
UINT8 rowshift; /* VRAM address is (row << rowshift) | col */
UINT32 vramsize; /* size of video RAM */
- void (*interrupt)(running_machine *machine, int state); /* interrupt gen callback */
+ void (*interrupt)(running_machine &machine, int state); /* interrupt gen callback */
};
@@ -59,7 +59,7 @@ struct tms34061_display
/* starts/stops the emulator */
-void tms34061_start(running_machine *machine, const struct tms34061_interface *interface);
+void tms34061_start(running_machine &machine, const struct tms34061_interface *interface);
/* reads/writes to the 34061 */
UINT8 tms34061_r(address_space *space, int col, int row, int func);
diff --git a/src/emu/video/tms9927.c b/src/emu/video/tms9927.c
index 5ef5425d04d..a7c89807d54 100644
--- a/src/emu/video/tms9927.c
+++ b/src/emu/video/tms9927.c
@@ -271,19 +271,19 @@ static DEVICE_START( tms9927 )
tms->hpixels_per_column = tms->intf->hpixels_per_column;
/* get the screen device */
- tms->screen = downcast<screen_device *>(device->machine->device(tms->intf->screen_tag));
+ tms->screen = downcast<screen_device *>(device->machine().device(tms->intf->screen_tag));
assert(tms->screen != NULL);
/* get the self-load PROM */
if (tms->intf->selfload_region != NULL)
{
- tms->selfload = device->machine->region(tms->intf->selfload_region)->base();
+ tms->selfload = device->machine().region(tms->intf->selfload_region)->base();
assert(tms->selfload != NULL);
}
}
/* register for state saving */
- device->machine->state().register_postload(tms9927_state_save_postload, tms);
+ device->machine().state().register_postload(tms9927_state_save_postload, tms);
device->save_item(NAME(tms->clock));
device->save_item(NAME(tms->reg));
diff --git a/src/emu/video/tms9928a.c b/src/emu/video/tms9928a.c
index ce9e803b821..b427a4cda3e 100644
--- a/src/emu/video/tms9928a.c
+++ b/src/emu/video/tms9928a.c
@@ -108,7 +108,7 @@ static void draw_mode3 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
static void draw_mode23 (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
static void draw_modebogus (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
static void draw_sprites (device_t *screen, bitmap_t *bitmap, const rectangle *cliprect);
-static void change_register (running_machine *machine, int reg, UINT8 data);
+static void change_register (running_machine &machine, int reg, UINT8 data);
static void (*const ModeHandlers[])(device_t *screen, bitmap_t *bitmap, const rectangle *cliprect) = {
draw_mode0, draw_mode1, draw_mode2, draw_mode12,
@@ -139,7 +139,7 @@ typedef struct {
INT32 Addr;
int colour,pattern,nametbl,spriteattribute,spritepattern;
int colourmask,patternmask;
- void (*INTCallback)(running_machine *, int);
+ void (*INTCallback)(running_machine &, int);
/* memory */
UINT8 *vMem, *dBackMem;
bitmap_t *tmpbmp;
@@ -176,7 +176,7 @@ void TMS9928A_reset () {
tms.latch = 0;
}
-static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *intf)
+static void TMS9928A_start (running_machine &machine, const TMS9928a_interface *intf)
{
assert_always(((intf->vram == 0x1000) || (intf->vram == 0x2000) || (intf->vram == 0x4000)), "4, 8 or 16 kB vram please");
@@ -194,9 +194,9 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
tms.visarea.max_y = tms.top_border + 24*8 - 1 + MIN(intf->bordery, tms.bottom_border);
/* configure the screen if we weren't overridden */
- if (machine->primary_screen->width() == LEFT_BORDER+32*8+RIGHT_BORDER &&
- machine->primary_screen->height() == TOP_BORDER_60HZ+24*8+BOTTOM_BORDER_60HZ)
- machine->primary_screen->configure(LEFT_BORDER + 32*8 + RIGHT_BORDER, tms.top_border + 24*8 + tms.bottom_border, tms.visarea, machine->primary_screen->frame_period().attoseconds);
+ if (machine.primary_screen->width() == LEFT_BORDER+32*8+RIGHT_BORDER &&
+ machine.primary_screen->height() == TOP_BORDER_60HZ+24*8+BOTTOM_BORDER_60HZ)
+ machine.primary_screen->configure(LEFT_BORDER + 32*8 + RIGHT_BORDER, tms.top_border + 24*8 + tms.bottom_border, tms.visarea, machine.primary_screen->frame_period().attoseconds);
/* Video RAM */
tms.vramsize = intf->vram;
@@ -206,7 +206,7 @@ static void TMS9928A_start (running_machine *machine, const TMS9928a_interface *
tms.dBackMem = auto_alloc_array(machine, UINT8, IMAGE_SIZE);
/* back bitmap */
- tms.tmpbmp = auto_bitmap_alloc (machine, 256, 192, machine->primary_screen->format());
+ tms.tmpbmp = auto_bitmap_alloc (machine, 256, 192, machine.primary_screen->format());
TMS9928A_reset ();
tms.LimitSprites = 1;
@@ -233,7 +233,7 @@ const rectangle *TMS9928A_get_visarea (void)
}
-void TMS9928A_post_load (running_machine *machine) {
+void TMS9928A_post_load (running_machine &machine) {
int i;
/* all registers need to be re-written, so tables are recalculated */
@@ -271,7 +271,7 @@ READ8_HANDLER (TMS9928A_register_r) {
tms.StatusReg = 0x1f;
if (tms.INT) {
tms.INT = 0;
- if (tms.INTCallback) tms.INTCallback (space->machine, tms.INT);
+ if (tms.INTCallback) tms.INTCallback (space->machine(), tms.INT);
}
tms.latch = 0;
return b;
@@ -287,7 +287,7 @@ WRITE8_HANDLER (TMS9928A_register_w) {
if (data & 0x80) {
/* register write */
reg = data & 7;
- change_register (space->machine, reg, tms.Addr & 0xff);
+ change_register (space->machine(), reg, tms.Addr & 0xff);
} else {
if ( !(data & 0x40) ) {
/* read ahead */
@@ -302,7 +302,7 @@ WRITE8_HANDLER (TMS9928A_register_w) {
}
}
-static void change_register (running_machine *machine, int reg, UINT8 val) {
+static void change_register (running_machine &machine, int reg, UINT8 val) {
static const UINT8 Mask[8] =
{ 0x03, 0xfb, 0x0f, 0xff, 0x07, 0x7f, 0x07, 0xff };
static const char *const modes[] = {
@@ -393,15 +393,15 @@ void TMS9928A_set_spriteslimit (int limit) {
SCREEN_UPDATE( tms9928a )
{
INT32 BackColour = tms.Regs[7] & 15;
- rgb_t oldcolor = palette_get_color(screen->machine, 0);
+ rgb_t oldcolor = palette_get_color(screen->machine(), 0);
if (!BackColour) BackColour=1;
/* note we preserve the alpha here; this is so that it can be controlled independently */
/* see cliffhgr.c for an example */
- palette_set_color(screen->machine, 0, (TMS9928A_palette[BackColour] & MAKE_ARGB(0,255,255,255)) | (oldcolor & MAKE_ARGB(255,0,0,0)));
+ palette_set_color(screen->machine(), 0, (TMS9928A_palette[BackColour] & MAKE_ARGB(0,255,255,255)) | (oldcolor & MAKE_ARGB(255,0,0,0)));
if (! (tms.Regs[1] & 0x40))
- bitmap_fill(bitmap, cliprect, screen->machine->pens[BackColour]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[BackColour]);
else
{
(*ModeHandlers[TMS_MODE])(screen, tms.tmpbmp, cliprect);
@@ -430,13 +430,13 @@ SCREEN_UPDATE( tms9928a )
return 0;
}
-int TMS9928A_interrupt(running_machine *machine) {
+int TMS9928A_interrupt(running_machine &machine) {
int b;
/* when skipping frames, calculate sprite collision */
- if (machine->video().skip_this_frame()) {
+ if (machine.video().skip_this_frame()) {
if (TMS_SPRITES_ENABLED) {
- draw_sprites (machine->primary_screen, NULL, NULL);
+ draw_sprites (machine.primary_screen, NULL, NULL);
}
}
@@ -456,7 +456,7 @@ static void draw_mode1 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
rectangle rt;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
@@ -491,7 +491,7 @@ static void draw_mode12 (device_t *screen, bitmap_t *bitmap, const rectangle *cl
const pen_t *pens;
rectangle rt;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
@@ -525,7 +525,7 @@ static void draw_mode0 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
UINT8 fg,bg,*patternptr;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -552,7 +552,7 @@ static void draw_mode2 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
const pen_t *pens;
UINT8 *colourptr,*patternptr;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -581,7 +581,7 @@ static void draw_mode3 (device_t *screen, bitmap_t *bitmap, const rectangle *cli
UINT8 fg,bg,*patternptr;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -611,7 +611,7 @@ static void draw_mode23 (device_t *screen, bitmap_t *bitmap, const rectangle *cl
UINT8 fg,bg,*patternptr;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
name = 0;
for (y=0;y<24;y++) {
for (x=0;x<32;x++) {
@@ -642,7 +642,7 @@ static void draw_modebogus (device_t *screen, bitmap_t *bitmap, const rectangle
int x,y,n,xx;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
fg = pens[tms.Regs[7] / 16];
bg = pens[tms.Regs[7] & 15];
@@ -673,7 +673,7 @@ static void draw_sprites (device_t *screen, bitmap_t *bitmap, const rectangle *c
UINT16 line,line2;
const pen_t *pens;
- pens = screen->machine->pens;
+ pens = screen->machine().pens;
attributeptr = tms.vMem + tms.spriteattribute;
size = (tms.Regs[1] & 2) ? 16 : 8;
large = (int)(tms.Regs[1] & 1);
diff --git a/src/emu/video/tms9928a.h b/src/emu/video/tms9928a.h
index d5bd15af7bc..62e24fe8e48 100644
--- a/src/emu/video/tms9928a.h
+++ b/src/emu/video/tms9928a.h
@@ -45,7 +45,7 @@ typedef struct TMS9928a_interface
tms9928a_model model; /* model: tms9929(a) runs at 50Hz instead of 60Hz */
int vram; /* VRAM size in bytes (4k, 8k or 16k) */
int borderx, bordery; /* number of border pixels to show in each direction */
- void (*int_callback)(running_machine *, int); /* callback which is called whenever the state
+ void (*int_callback)(running_machine &, int); /* callback which is called whenever the state
** of the INT output of the TMS9918A changes (may be NULL)*/
} TMS9928a_interface;
@@ -82,7 +82,7 @@ extern SCREEN_UPDATE( tms9928a );
** This next function must be called 50 (tms9929a) or 60 (tms99x8a) times per second,
** to generate the necessary interrupts
*/
-int TMS9928A_interrupt (running_machine *machine);
+int TMS9928A_interrupt (running_machine &machine);
/*
** The parameter is a function pointer. This function is called whenever
@@ -98,7 +98,7 @@ void TMS9928A_set_spriteslimit (int);
/*
** After loading a state, call this function
*/
-void TMS9928A_post_load (running_machine *machine);
+void TMS9928A_post_load (running_machine &machine);
/*
** MachineDriver video declarations for the TMS9928A chip
diff --git a/src/emu/video/v9938.c b/src/emu/video/v9938.c
index 2a0a639b681..292467e512e 100644
--- a/src/emu/video/v9938.c
+++ b/src/emu/video/v9938.c
@@ -34,7 +34,7 @@ typedef struct {
int vram_size;
/* interrupt */
UINT8 INT;
- void (*INTCallback)(running_machine *, int);
+ void (*INTCallback)(running_machine &, int);
int scanline;
/* blinking */
int blink, blink_count;
@@ -94,13 +94,13 @@ static const char *const v9938_modes[] = {
"UNKNOWN"
};
-static void v9938_register_write (running_machine *machine, int reg, int data);
+static void v9938_register_write (running_machine &machine, int reg, int data);
static void v9938_update_command (void);
static void v9938_cpu_to_vdp (UINT8 V);
static UINT8 v9938_command_unit_w (UINT8 Op);
static UINT8 v9938_vdp_to_cpu (void);
static void v9938_set_mode (void);
-static void v9938_refresh_line (running_machine *machine, bitmap_t *bmp, int line);
+static void v9938_refresh_line (running_machine &machine, bitmap_t *bmp, int line);
/***************************************************************************
@@ -435,7 +435,7 @@ READ8_HANDLER (v9938_1_vram_r)
return v9938_vram_r();
}
-static void v9938_command_w(running_machine *machine, UINT8 data)
+static void v9938_command_w(running_machine &machine, UINT8 data)
{
if (vdp->cmd_write_first)
{
@@ -463,13 +463,13 @@ static void v9938_command_w(running_machine *machine, UINT8 data)
WRITE8_HANDLER (v9938_0_command_w)
{
vdp = &vdps[0];
- v9938_command_w(space->machine, data);
+ v9938_command_w(space->machine(), data);
}
WRITE8_HANDLER (v9938_1_command_w)
{
vdp = &vdps[1];
- v9938_command_w(space->machine, data);
+ v9938_command_w(space->machine(), data);
}
/***************************************************************************
@@ -478,7 +478,7 @@ WRITE8_HANDLER (v9938_1_command_w)
***************************************************************************/
-void v9938_init (running_machine *machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) )
+void v9938_init (running_machine &machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine &, int) )
{
vdp = &vdps[which];
@@ -590,7 +590,7 @@ void v9938_reset (int which)
vdp->statReg[6] = 0xfc;
}
-static void v9938_check_int (running_machine *machine)
+static void v9938_check_int (running_machine &machine)
{
UINT8 n;
@@ -644,7 +644,7 @@ void v9938_set_resolution (int which, int i)
***************************************************************************/
-static void v9938_register_w(running_machine *machine, UINT8 data)
+static void v9938_register_w(running_machine &machine, UINT8 data)
{
int reg;
@@ -659,16 +659,16 @@ static void v9938_register_w(running_machine *machine, UINT8 data)
WRITE8_HANDLER (v9938_0_register_w)
{
vdp = &vdps[0];
- v9938_register_w(space->machine, data);
+ v9938_register_w(space->machine(), data);
}
WRITE8_HANDLER (v9938_1_register_w)
{
vdp = &vdps[1];
- v9938_register_w(space->machine, data);
+ v9938_register_w(space->machine(), data);
}
-static void v9938_register_write (running_machine *machine, int reg, int data)
+static void v9938_register_write (running_machine &machine, int reg, int data)
{
static UINT8 const reg_mask[] =
{
@@ -756,7 +756,7 @@ static void v9938_register_write (running_machine *machine, int reg, int data)
vdp->contReg[reg] = data;
}
-static UINT8 v9938_status_r(running_machine *machine)
+static UINT8 v9938_status_r(running_machine &machine)
{
int reg;
UINT8 ret;
@@ -790,7 +790,7 @@ static UINT8 v9938_status_r(running_machine *machine)
if ( (n < 28) || (n > 199) ) vdp.statReg[2] |= 0x20;
else vdp.statReg[2] &= ~0x20;
*/
- if (machine->rand() & 1) vdp->statReg[2] |= 0x20;
+ if (machine.rand() & 1) vdp->statReg[2] |= 0x20;
else vdp->statReg[2] &= ~0x20;
ret = vdp->statReg[2];
break;
@@ -830,13 +830,13 @@ static UINT8 v9938_status_r(running_machine *machine)
READ8_HANDLER( v9938_0_status_r )
{
vdp = &vdps[0];
- return v9938_status_r(space->machine);
+ return v9938_status_r(space->machine());
}
READ8_HANDLER( v9938_1_status_r )
{
vdp = &vdps[1];
- return v9938_status_r(space->machine);
+ return v9938_status_r(space->machine());
}
/***************************************************************************
@@ -1222,9 +1222,9 @@ static void v9938_set_mode (void)
vdp->mode = i;
}
-static void v9938_refresh_16 (running_machine *machine, bitmap_t *bmp, int line)
+static void v9938_refresh_16 (running_machine &machine, bitmap_t *bmp, int line)
{
- const pen_t *pens = machine->pens;
+ const pen_t *pens = machine.pens;
int i, double_lines;
UINT8 col[256];
UINT16 *ln, *ln2 = NULL;
@@ -1282,7 +1282,7 @@ static void v9938_refresh_16 (running_machine *machine, bitmap_t *bmp, int line)
memcpy (ln2, ln, (512 + 32) * 2);
}
-static void v9938_refresh_line (running_machine *machine, bitmap_t *bmp, int line)
+static void v9938_refresh_line (running_machine &machine, bitmap_t *bmp, int line)
{
int ind16, ind256;
@@ -1409,7 +1409,7 @@ I do not know the behaviour of FV when IE0=0. That is the part that I still
have to test.
*/
-static void v9938_interrupt_start_vblank (running_machine *machine)
+static void v9938_interrupt_start_vblank (running_machine &machine)
{
#if 0
if (input_code_pressed (machine, KEYCODE_D) )
@@ -1469,7 +1469,7 @@ static void v9938_interrupt_start_vblank (running_machine *machine)
vdp->size_now = -1;
}
-int v9938_interrupt (running_machine *machine, int which)
+int v9938_interrupt (running_machine &machine, int which)
{
int scanline, max, pal, scanline_start;
diff --git a/src/emu/video/v9938.h b/src/emu/video/v9938.h
index f7496ccdce6..f14072c85e0 100644
--- a/src/emu/video/v9938.h
+++ b/src/emu/video/v9938.h
@@ -14,9 +14,9 @@
#define RENDER_LOW (1)
#define RENDER_AUTO (2)
-void v9938_init (running_machine *machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine *, int) );
+void v9938_init (running_machine &machine, int which, screen_device &screen, bitmap_t *bitmap, int model, int vram_size, void (*callback)(running_machine &, int) );
void v9938_reset (int which);
-int v9938_interrupt (running_machine *machine, int which);
+int v9938_interrupt (running_machine &machine, int which);
void v9938_set_sprite_limit (int which, int);
void v9938_set_resolution (int which, int);
int v9938_get_transpen(int which);
diff --git a/src/emu/video/vector.c b/src/emu/video/vector.c
index 94eb76a669c..cf92011acbc 100644
--- a/src/emu/video/vector.c
+++ b/src/emu/video/vector.c
@@ -175,10 +175,10 @@ float vector_get_beam(void)
VIDEO_START( vector )
{
- beam_width = machine->options().beam();
+ beam_width = machine.options().beam();
/* Grab the settings for this session */
- vector_set_flicker(machine->options().flicker());
+ vector_set_flicker(machine.options().flicker());
vector_index = 0;
@@ -191,7 +191,7 @@ VIDEO_START( vector )
* Adds a line end point to the vertices list. The vector processor emulation
* needs to call this.
*/
-void vector_add_point (running_machine *machine, int x, int y, rgb_t color, int intensity)
+void vector_add_point (running_machine &machine, int x, int y, rgb_t color, int intensity)
{
point *newpoint;
@@ -200,7 +200,7 @@ void vector_add_point (running_machine *machine, int x, int y, rgb_t color, int
if (flicker && (intensity > 0))
{
- intensity += (intensity * (0x80-(machine->rand()&0xff)) * flicker)>>16;
+ intensity += (intensity * (0x80-(machine.rand()&0xff)) * flicker)>>16;
if (intensity < 0)
intensity = 0;
if (intensity > 0xff)
@@ -256,7 +256,7 @@ void vector_clear_list (void)
SCREEN_UPDATE( vector )
{
- UINT32 flags = PRIMFLAG_ANTIALIAS(screen->machine->options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD);
+ UINT32 flags = PRIMFLAG_ANTIALIAS(screen->machine().options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD);
const rectangle &visarea = screen->visible_area();
float xscale = 1.0f / (65536 * (visarea.max_x - visarea.min_x));
float yscale = 1.0f / (65536 * (visarea.max_y - visarea.min_y));
diff --git a/src/emu/video/vector.h b/src/emu/video/vector.h
index 8d4fc7d8353..9fe90bba9d6 100644
--- a/src/emu/video/vector.h
+++ b/src/emu/video/vector.h
@@ -14,7 +14,7 @@ VIDEO_START( vector );
SCREEN_UPDATE( vector );
void vector_clear_list(void);
-void vector_add_point(running_machine *machine, int x, int y, rgb_t color, int intensity);
+void vector_add_point(running_machine &machine, int x, int y, rgb_t color, int intensity);
void vector_add_clip(int minx, int miny, int maxx, int maxy);
void vector_set_flicker(float _flicker);
diff --git a/src/emu/video/voodoo.c b/src/emu/video/voodoo.c
index d275cff840b..13e09886b4f 100644
--- a/src/emu/video/voodoo.c
+++ b/src/emu/video/voodoo.c
@@ -416,7 +416,7 @@ int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
}
/* debugging! */
- if (input_code_pressed(device->machine, KEYCODE_L))
+ if (input_code_pressed(device->machine(), KEYCODE_L))
drawbuf = v->fbi.backbuf;
/* copy from the current front buffer */
@@ -430,7 +430,7 @@ int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
}
/* update stats display */
- statskey = (input_code_pressed(device->machine, KEYCODE_BACKSLASH) != 0);
+ statskey = (input_code_pressed(device->machine(), KEYCODE_BACKSLASH) != 0);
if (statskey && statskey != v->stats.lastkey)
v->stats.display = !v->stats.display;
v->stats.lastkey = statskey;
@@ -440,7 +440,7 @@ int voodoo_update(device_t *device, bitmap_t *bitmap, const rectangle *cliprect)
popmessage(v->stats.buffer, 0, 0);
/* update render override */
- v->stats.render_override = input_code_pressed(device->machine, KEYCODE_ENTER);
+ v->stats.render_override = input_code_pressed(device->machine(), KEYCODE_ENTER);
if (DEBUG_DEPTH && v->stats.render_override)
{
for (y = cliprect->min_y; y <= cliprect->max_y; y++)
@@ -523,7 +523,7 @@ static void init_fbi(voodoo_state *v, fbi_state *f, void *memory, int fbmem)
}
/* allocate a VBLANK timer */
- f->vblank_timer = v->device->machine->scheduler().timer_alloc(FUNC(vblank_callback), v);
+ f->vblank_timer = v->device->machine().scheduler().timer_alloc(FUNC(vblank_callback), v);
f->vblank = FALSE;
/* initialize the memory FIFO */
@@ -656,7 +656,7 @@ static void init_save_state(device_t *device)
voodoo_state *v = get_safe_token(device);
int index, subindex;
- device->machine->state().register_postload(voodoo_postload, v);
+ device->machine().state().register_postload(voodoo_postload, v);
/* register states: core */
device->save_item(NAME(v->extra_cycles));
@@ -910,13 +910,13 @@ static void swap_buffers(voodoo_state *v)
/* reset the last_op_time to now and start processing the next command */
if (v->pci.op_pending)
{
- v->pci.op_end_time = v->device->machine->time();
+ v->pci.op_end_time = v->device->machine().time();
flush_fifos(v, v->pci.op_end_time);
}
/* we may be able to unstall now */
if (v->pci.stall_state != NOT_STALLED)
- check_stalled_cpu(v, v->device->machine->time());
+ check_stalled_cpu(v, v->device->machine().time());
/* periodically log rasterizer info */
v->stats.swaps++;
@@ -1015,7 +1015,7 @@ static TIMER_CALLBACK( vblank_callback )
if (v->pci.op_pending)
{
if (LOG_VBLANK_SWAP) logerror("---- vblank flush begin\n");
- flush_fifos(v, machine->time());
+ flush_fifos(v, machine.time());
if (LOG_VBLANK_SWAP) logerror("---- vblank flush end\n");
}
@@ -1033,7 +1033,7 @@ static TIMER_CALLBACK( vblank_callback )
swap_buffers(v);
/* set a timer for the next off state */
- machine->scheduler().timer_set(v->screen->time_until_pos(0), FUNC(vblank_off_callback), 0, v);
+ machine.scheduler().timer_set(v->screen->time_until_pos(0), FUNC(vblank_off_callback), 0, v);
/* set internal state and call the client */
v->fbi.vblank = TRUE;
@@ -2002,10 +2002,10 @@ static void cmdfifo_w(voodoo_state *v, cmdfifo_info *f, offs_t offset, UINT32 da
if (cycles > 0)
{
v->pci.op_pending = TRUE;
- v->pci.op_end_time = v->device->machine->time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
+ v->pci.op_end_time = v->device->machine().time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index,
- v->device->machine->time().seconds, (UINT32)(v->device->machine->time().attoseconds >> 32), (UINT32)v->device->machine->time().attoseconds,
+ v->device->machine().time().seconds, (UINT32)(v->device->machine().time().attoseconds >> 32), (UINT32)v->device->machine().time().attoseconds,
v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
}
}
@@ -2022,7 +2022,7 @@ static void cmdfifo_w(voodoo_state *v, cmdfifo_info *f, offs_t offset, UINT32 da
static TIMER_CALLBACK( stall_cpu_callback )
{
- check_stalled_cpu((voodoo_state *)ptr, machine->time());
+ check_stalled_cpu((voodoo_state *)ptr, machine.time());
}
@@ -2069,7 +2069,7 @@ static void check_stalled_cpu(voodoo_state *v, attotime current_time)
if (v->pci.stall_callback)
(*v->pci.stall_callback)(v->device, FALSE);
else
- v->device->machine->scheduler().trigger(v->trigger);
+ v->device->machine().scheduler().trigger(v->trigger);
}
/* if not, set a timer for the next one */
@@ -3463,7 +3463,7 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
/* special handling for registers */
if ((offset & 0xc00000/4) == 0)
@@ -3543,10 +3543,10 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
if (cycles)
{
v->pci.op_pending = TRUE;
- v->pci.op_end_time = device->machine->time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
+ v->pci.op_end_time = device->machine().time() + attotime(0, (attoseconds_t)cycles * v->attoseconds_per_cycle);
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:direct write start at %d.%08X%08X end at %d.%08X%08X\n", v->index,
- device->machine->time().seconds, (UINT32)(device->machine->time().attoseconds >> 32), (UINT32)device->machine->time().attoseconds,
+ device->machine().time().seconds, (UINT32)(device->machine().time().attoseconds >> 32), (UINT32)device->machine().time().attoseconds,
v->pci.op_end_time.seconds, (UINT32)(v->pci.op_end_time.attoseconds >> 32), (UINT32)v->pci.op_end_time.attoseconds);
}
g_profiler.stop();
@@ -3596,7 +3596,7 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
fifo_items(&v->fbi.fifo) >= 2 * 32 * FBIINIT0_MEMORY_FIFO_HWM(v->reg[fbiInit0].u))
{
if (LOG_FIFO) logerror("VOODOO.%d.FIFO:voodoo_w hit memory FIFO HWM -- stalling\n", v->index);
- stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine->time());
+ stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine().time());
}
}
@@ -3605,14 +3605,14 @@ WRITE32_DEVICE_HANDLER( voodoo_w )
fifo_space(&v->pci.fifo) <= 2 * FBIINIT0_PCI_FIFO_LWM(v->reg[fbiInit0].u))
{
if (LOG_FIFO) logerror("VOODOO.%d.FIFO:voodoo_w hit PCI FIFO free LWM -- stalling\n", v->index);
- stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine->time());
+ stall_cpu(v, STALLED_UNTIL_FIFO_LWM, device->machine().time());
}
/* if we weren't ready, and this is a non-FIFO access, stall until the FIFOs are clear */
if (stall)
{
if (LOG_FIFO_VERBOSE) logerror("VOODOO.%d.FIFO:voodoo_w wrote non-FIFO register -- stalling until clear\n", v->index);
- stall_cpu(v, STALLED_UNTIL_FIFO_EMPTY, device->machine->time());
+ stall_cpu(v, STALLED_UNTIL_FIFO_EMPTY, device->machine().time());
}
g_profiler.stop();
@@ -3890,7 +3890,7 @@ READ32_DEVICE_HANDLER( voodoo_r )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
/* target the appropriate location */
if (!(offset & (0xc00000/4)))
@@ -3966,7 +3966,7 @@ static READ32_DEVICE_HANDLER( banshee_agp_r )
}
if (LOG_REGISTERS)
- logerror("%s:banshee_r(AGP:%s)\n", v->device->machine->describe_context(), banshee_agp_reg_name[offset]);
+ logerror("%s:banshee_r(AGP:%s)\n", v->device->machine().describe_context(), banshee_agp_reg_name[offset]);
return result;
}
@@ -3978,22 +3978,22 @@ READ32_DEVICE_HANDLER( banshee_r )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < 0x80000/4)
result = banshee_io_r(device, offset, mem_mask);
else if (offset < 0x100000/4)
result = banshee_agp_r(device, offset, mem_mask);
else if (offset < 0x200000/4)
- logerror("%s:banshee_r(2D:%X)\n", device->machine->describe_context(), (offset*4) & 0xfffff);
+ logerror("%s:banshee_r(2D:%X)\n", device->machine().describe_context(), (offset*4) & 0xfffff);
else if (offset < 0x600000/4)
result = register_r(v, offset & 0x1fffff/4);
else if (offset < 0x800000/4)
- logerror("%s:banshee_r(TEX:%X)\n", device->machine->describe_context(), (offset*4) & 0x1fffff);
+ logerror("%s:banshee_r(TEX:%X)\n", device->machine().describe_context(), (offset*4) & 0x1fffff);
else if (offset < 0xc00000/4)
- logerror("%s:banshee_r(RES:%X)\n", device->machine->describe_context(), (offset*4) & 0x3fffff);
+ logerror("%s:banshee_r(RES:%X)\n", device->machine().describe_context(), (offset*4) & 0x3fffff);
else if (offset < 0x1000000/4)
- logerror("%s:banshee_r(YUV:%X)\n", device->machine->describe_context(), (offset*4) & 0x3fffff);
+ logerror("%s:banshee_r(YUV:%X)\n", device->machine().describe_context(), (offset*4) & 0x3fffff);
else if (offset < 0x2000000/4)
{
UINT8 temp = v->fbi.lfb_stride;
@@ -4012,11 +4012,11 @@ READ32_DEVICE_HANDLER( banshee_fb_r )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < v->fbi.lfb_base)
{
- logerror("%s:banshee_fb_r(%X)\n", device->machine->describe_context(), offset*4);
+ logerror("%s:banshee_fb_r(%X)\n", device->machine().describe_context(), offset*4);
if (offset*4 <= v->fbi.mask)
result = ((UINT32 *)v->fbi.ram)[offset];
}
@@ -4041,7 +4041,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att))
result = v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_att_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3c1 & 0x1f]);
+ logerror("%s:banshee_att_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3c1 & 0x1f]);
break;
/* Input status 0 */
@@ -4054,7 +4054,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
*/
result = 0x00;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
/* Sequencer access */
@@ -4062,7 +4062,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq))
result = v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_seq_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3c4 & 0x1f]);
+ logerror("%s:banshee_seq_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3c4 & 0x1f]);
break;
/* Feature control */
@@ -4070,14 +4070,14 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
result = v->banshee.vga[0x3da & 0x1f];
v->banshee.attff = 0;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
/* Miscellaneous output */
case 0x3cc:
result = v->banshee.vga[0x3c2 & 0x1f];
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
/* Graphics controller access */
@@ -4085,7 +4085,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc))
result = v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_gc_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3ce & 0x1f]);
+ logerror("%s:banshee_gc_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3ce & 0x1f]);
break;
/* CRTC access */
@@ -4093,7 +4093,7 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc))
result = v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]];
if (LOG_REGISTERS)
- logerror("%s:banshee_crtc_r(%X)\n", device->machine->describe_context(), v->banshee.vga[0x3d4 & 0x1f]);
+ logerror("%s:banshee_crtc_r(%X)\n", device->machine().describe_context(), v->banshee.vga[0x3d4 & 0x1f]);
break;
/* Input status 1 */
@@ -4109,13 +4109,13 @@ static READ8_DEVICE_HANDLER( banshee_vga_r )
*/
result = 0x04;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
default:
result = v->banshee.vga[offset];
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_r(%X)\n", device->machine->describe_context(), 0x300+offset);
+ logerror("%s:banshee_vga_r(%X)\n", device->machine().describe_context(), 0x300+offset);
break;
}
return result;
@@ -4139,7 +4139,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
case io_dacData:
result = v->fbi.clut[v->banshee.io[io_dacAddr] & 0x1ff] = v->banshee.io[offset];
if (LOG_REGISTERS)
- logerror("%s:banshee_dac_r(%X)\n", device->machine->describe_context(), v->banshee.io[io_dacAddr] & 0x1ff);
+ logerror("%s:banshee_dac_r(%X)\n", device->machine().describe_context(), v->banshee.io[io_dacAddr] & 0x1ff);
break;
case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc:
@@ -4159,7 +4159,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
default:
result = v->banshee.io[offset];
if (LOG_REGISTERS)
- logerror("%s:banshee_io_r(%s)\n", device->machine->describe_context(), banshee_io_reg_name[offset]);
+ logerror("%s:banshee_io_r(%s)\n", device->machine().describe_context(), banshee_io_reg_name[offset]);
break;
}
@@ -4169,7 +4169,7 @@ READ32_DEVICE_HANDLER( banshee_io_r )
READ32_DEVICE_HANDLER( banshee_rom_r )
{
- logerror("%s:banshee_rom_r(%X)\n", device->machine->describe_context(), offset*4);
+ logerror("%s:banshee_rom_r(%X)\n", device->machine().describe_context(), offset*4);
return 0xffffffff;
}
@@ -4263,7 +4263,7 @@ static WRITE32_DEVICE_HANDLER( banshee_agp_w )
}
if (LOG_REGISTERS)
- logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", device->machine->describe_context(), banshee_agp_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_w(AGP:%s) = %08X & %08X\n", device->machine().describe_context(), banshee_agp_reg_name[offset], data, mem_mask);
}
@@ -4273,22 +4273,22 @@ WRITE32_DEVICE_HANDLER( banshee_w )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < 0x80000/4)
banshee_io_w(device, offset, data, mem_mask);
else if (offset < 0x100000/4)
banshee_agp_w(device, offset, data, mem_mask);
else if (offset < 0x200000/4)
- logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0xfffff, data, mem_mask);
+ logerror("%s:banshee_w(2D:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0xfffff, data, mem_mask);
else if (offset < 0x600000/4)
register_w(v, offset & 0x1fffff/4, data);
else if (offset < 0x800000/4)
- logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x1fffff, data, mem_mask);
+ logerror("%s:banshee_w(TEX:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0x1fffff, data, mem_mask);
else if (offset < 0xc00000/4)
- logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
+ logerror("%s:banshee_w(RES:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
else if (offset < 0x1000000/4)
- logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", device->machine->describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
+ logerror("%s:banshee_w(YUV:%X) = %08X & %08X\n", device->machine().describe_context(), (offset*4) & 0x3fffff, data, mem_mask);
else if (offset < 0x2000000/4)
{
UINT8 temp = v->fbi.lfb_stride;
@@ -4306,7 +4306,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w )
/* if we have something pending, flush the FIFOs up to the current time */
if (v->pci.op_pending)
- flush_fifos(v, device->machine->time());
+ flush_fifos(v, device->machine().time());
if (offset < v->fbi.lfb_base)
{
@@ -4318,7 +4318,7 @@ WRITE32_DEVICE_HANDLER( banshee_fb_w )
{
if (offset*4 <= v->fbi.mask)
COMBINE_DATA(&((UINT32 *)v->fbi.ram)[offset]);
- logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", device->machine->describe_context(), offset*4, data, mem_mask);
+ logerror("%s:banshee_fb_w(%X) = %08X & %08X\n", device->machine().describe_context(), offset*4, data, mem_mask);
}
}
else
@@ -4341,14 +4341,14 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
{
v->banshee.vga[0x3c1 & 0x1f] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine->describe_context(), 0x3c0+offset, data);
+ logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine().describe_context(), 0x3c0+offset, data);
}
else
{
if (v->banshee.vga[0x3c1 & 0x1f] < ARRAY_LENGTH(v->banshee.att))
v->banshee.att[v->banshee.vga[0x3c1 & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_att_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3c1 & 0x1f], data);
+ logerror("%s:banshee_att_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3c1 & 0x1f], data);
}
v->banshee.attff ^= 1;
break;
@@ -4358,7 +4358,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
if (v->banshee.vga[0x3c4 & 0x1f] < ARRAY_LENGTH(v->banshee.seq))
v->banshee.seq[v->banshee.vga[0x3c4 & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_seq_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3c4 & 0x1f], data);
+ logerror("%s:banshee_seq_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3c4 & 0x1f], data);
break;
/* Graphics controller access */
@@ -4366,7 +4366,7 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
if (v->banshee.vga[0x3ce & 0x1f] < ARRAY_LENGTH(v->banshee.gc))
v->banshee.gc[v->banshee.vga[0x3ce & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_gc_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3ce & 0x1f], data);
+ logerror("%s:banshee_gc_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3ce & 0x1f], data);
break;
/* CRTC access */
@@ -4374,13 +4374,13 @@ static WRITE8_DEVICE_HANDLER( banshee_vga_w )
if (v->banshee.vga[0x3d4 & 0x1f] < ARRAY_LENGTH(v->banshee.crtc))
v->banshee.crtc[v->banshee.vga[0x3d4 & 0x1f]] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_crtc_w(%X) = %02X\n", device->machine->describe_context(), v->banshee.vga[0x3d4 & 0x1f], data);
+ logerror("%s:banshee_crtc_w(%X) = %02X\n", device->machine().describe_context(), v->banshee.vga[0x3d4 & 0x1f], data);
break;
default:
v->banshee.vga[offset] = data;
if (LOG_REGISTERS)
- logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine->describe_context(), 0x3c0+offset, data);
+ logerror("%s:banshee_vga_w(%X) = %02X\n", device->machine().describe_context(), 0x3c0+offset, data);
break;
}
}
@@ -4402,7 +4402,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
if ((v->banshee.io[offset] ^ old) & 0x2800)
v->fbi.clut_dirty = TRUE;
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_dacData:
@@ -4413,14 +4413,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
v->fbi.clut_dirty = TRUE;
}
if (LOG_REGISTERS)
- logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", device->machine->describe_context(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
+ logerror("%s:banshee_dac_w(%X) = %08X & %08X\n", device->machine().describe_context(), v->banshee.io[io_dacAddr] & 0x1ff, data, mem_mask);
break;
case io_miscInit0:
COMBINE_DATA(&v->banshee.io[offset]);
v->fbi.yorigin = (data >> 18) & 0xfff;
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_vidScreenSize:
@@ -4434,14 +4434,14 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
v->screen->set_visible_area(0, v->fbi.width - 1, 0, v->fbi.height - 1);
adjust_vblank_timer(v);
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_lfbMemoryConfig:
v->fbi.lfb_base = (data & 0x1fff) << 10;
v->fbi.lfb_stride = ((data >> 13) & 7) + 9;
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
case io_vgab0: case io_vgab4: case io_vgab8: case io_vgabc:
@@ -4460,7 +4460,7 @@ WRITE32_DEVICE_HANDLER( banshee_io_w )
default:
COMBINE_DATA(&v->banshee.io[offset]);
if (LOG_REGISTERS)
- logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine->describe_context(), banshee_io_reg_name[offset], data, mem_mask);
+ logerror("%s:banshee_io_w(%s) = %08X & %08X\n", device->machine().describe_context(), banshee_io_reg_name[offset], data, mem_mask);
break;
}
}
@@ -4487,7 +4487,6 @@ static DEVICE_START( voodoo )
/* validate some basic stuff */
assert(device->baseconfig().static_config() == NULL);
assert(downcast<const legacy_device_config_base &>(device->baseconfig()).inline_config() != NULL);
- assert(device->machine != NULL);
/* validate configuration */
assert(config->screen != NULL);
@@ -4505,8 +4504,8 @@ static DEVICE_START( voodoo )
v->pci.stall_callback = config->stall;
/* create a multiprocessor work queue */
- v->poly = poly_alloc(device->machine, 64, sizeof(poly_extra_data), 0);
- v->thread_stats = auto_alloc_array(device->machine, stats_block, WORK_MAX_THREADS);
+ v->poly = poly_alloc(device->machine(), 64, sizeof(poly_extra_data), 0);
+ v->thread_stats = auto_alloc_array(device->machine(), stats_block, WORK_MAX_THREADS);
/* create a table of precomputed 1/n and log2(n) values */
/* n ranges from 1.0000 to 2.0000 */
@@ -4574,10 +4573,10 @@ static DEVICE_START( voodoo )
}
/* set the type, and initialize the chip mask */
- v->index = device->machine->m_devicelist.indexof(device->type(), device->tag());
- v->screen = downcast<screen_device *>(device->machine->device(config->screen));
+ v->index = device->machine().m_devicelist.indexof(device->type(), device->tag());
+ v->screen = downcast<screen_device *>(device->machine().device(config->screen));
assert_always(v->screen != NULL, "Unable to find screen attached to voodoo");
- v->cpu = device->machine->device(config->cputag);
+ v->cpu = device->machine().device(config->cputag);
assert_always(v->cpu != NULL, "Unable to find CPU attached to voodoo");
v->type = config->type;
v->chipmask = 0x01;
@@ -4593,21 +4592,21 @@ static DEVICE_START( voodoo )
v->pci.fifo.size = 64*2;
v->pci.fifo.in = v->pci.fifo.out = 0;
v->pci.stall_state = NOT_STALLED;
- v->pci.continue_timer = v->device->machine->scheduler().timer_alloc(FUNC(stall_cpu_callback), v);
+ v->pci.continue_timer = v->device->machine().scheduler().timer_alloc(FUNC(stall_cpu_callback), v);
/* allocate memory */
tmumem0 = config->tmumem0;
if (config->type <= VOODOO_2)
{
/* separate FB/TMU memory */
- fbmem = auto_alloc_array(device->machine, UINT8, config->fbmem << 20);
- tmumem[0] = auto_alloc_array(device->machine, UINT8, config->tmumem0 << 20);
- tmumem[1] = (config->tmumem1 != 0) ? auto_alloc_array(device->machine, UINT8, config->tmumem1 << 20) : NULL;
+ fbmem = auto_alloc_array(device->machine(), UINT8, config->fbmem << 20);
+ tmumem[0] = auto_alloc_array(device->machine(), UINT8, config->tmumem0 << 20);
+ tmumem[1] = (config->tmumem1 != 0) ? auto_alloc_array(device->machine(), UINT8, config->tmumem1 << 20) : NULL;
}
else
{
/* shared memory */
- tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(device->machine, UINT8, config->fbmem << 20);
+ tmumem[0] = tmumem[1] = fbmem = auto_alloc_array(device->machine(), UINT8, config->fbmem << 20);
tmumem0 = config->fbmem;
}
diff --git a/src/emu/watchdog.c b/src/emu/watchdog.c
index 130e2815378..564aebec2d3 100644
--- a/src/emu/watchdog.c
+++ b/src/emu/watchdog.c
@@ -36,16 +36,16 @@ static TIMER_CALLBACK( watchdog_callback );
watchdog_init - one time initialization
-------------------------------------------------*/
-void watchdog_init(running_machine *machine)
+void watchdog_init(running_machine &machine)
{
/* allocate a timer for the watchdog */
- watchdog_timer = machine->scheduler().timer_alloc(FUNC(watchdog_callback));
+ watchdog_timer = machine.scheduler().timer_alloc(FUNC(watchdog_callback));
- machine->add_notifier(MACHINE_NOTIFY_RESET, watchdog_internal_reset);
+ machine.add_notifier(MACHINE_NOTIFY_RESET, watchdog_internal_reset);
/* save some stuff in the default tag */
- machine->state().save_item(NAME(watchdog_enabled));
- machine->state().save_item(NAME(watchdog_counter));
+ machine.state().save_item(NAME(watchdog_enabled));
+ machine.state().save_item(NAME(watchdog_counter));
}
@@ -58,7 +58,7 @@ static void watchdog_internal_reset(running_machine &machine)
{
/* set up the watchdog timer; only start off enabled if explicitly configured */
watchdog_enabled = (machine.config().m_watchdog_vblank_count != 0 || machine.config().m_watchdog_time != attotime::zero);
- watchdog_reset(&machine);
+ watchdog_reset(machine);
watchdog_enabled = TRUE;
}
@@ -75,7 +75,7 @@ static TIMER_CALLBACK( watchdog_callback )
popmessage("Reset caused by the watchdog!!!\n");
#endif
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
}
@@ -90,12 +90,12 @@ static void on_vblank(screen_device &screen, void *param, bool vblank_state)
if (vblank_state && watchdog_enabled)
{
/* check the watchdog */
- if (screen.machine->config().m_watchdog_vblank_count != 0)
+ if (screen.machine().config().m_watchdog_vblank_count != 0)
{
watchdog_counter = watchdog_counter - 1;
if (watchdog_counter == 0)
- watchdog_callback(screen.machine, NULL, 0);
+ watchdog_callback(screen.machine(), NULL, 0);
}
}
}
@@ -105,25 +105,25 @@ static void on_vblank(screen_device &screen, void *param, bool vblank_state)
watchdog_reset - reset the watchdog timer
-------------------------------------------------*/
-void watchdog_reset(running_machine *machine)
+void watchdog_reset(running_machine &machine)
{
/* if we're not enabled, skip it */
if (!watchdog_enabled)
watchdog_timer->adjust(attotime::never);
/* VBLANK-based watchdog? */
- else if (machine->config().m_watchdog_vblank_count != 0)
+ else if (machine.config().m_watchdog_vblank_count != 0)
{
- watchdog_counter = machine->config().m_watchdog_vblank_count;
+ watchdog_counter = machine.config().m_watchdog_vblank_count;
/* register a VBLANK callback for the primary screen */
- if (machine->primary_screen != NULL)
- machine->primary_screen->register_vblank_callback(on_vblank, NULL);
+ if (machine.primary_screen != NULL)
+ machine.primary_screen->register_vblank_callback(on_vblank, NULL);
}
/* timer-based watchdog? */
- else if (machine->config().m_watchdog_time != attotime::zero)
- watchdog_timer->adjust(machine->config().m_watchdog_time);
+ else if (machine.config().m_watchdog_time != attotime::zero)
+ watchdog_timer->adjust(machine.config().m_watchdog_time);
/* default to an obscene amount of time (3 seconds) */
else
@@ -135,7 +135,7 @@ void watchdog_reset(running_machine *machine)
watchdog_enable - reset the watchdog timer
-------------------------------------------------*/
-void watchdog_enable(running_machine *machine, int enable)
+void watchdog_enable(running_machine &machine, int enable)
{
/* when re-enabled, we reset our state */
if (watchdog_enabled != enable)
diff --git a/src/emu/watchdog.h b/src/emu/watchdog.h
index acebfb96818..3787a729164 100644
--- a/src/emu/watchdog.h
+++ b/src/emu/watchdog.h
@@ -20,13 +20,13 @@
/* startup */
-void watchdog_init(running_machine *machine);
+void watchdog_init(running_machine &machine);
/* reset the watchdog */
-void watchdog_reset(running_machine *machine);
+void watchdog_reset(running_machine &machine);
/* enable/disable the watchdog */
-void watchdog_enable(running_machine *machine, int enable);
+void watchdog_enable(running_machine &machine, int enable);
#endif /* __WATCHDOG_H__ */
diff --git a/src/ldplayer/ldplayer.c b/src/ldplayer/ldplayer.c
index 6c84ed82492..467a02bfa6c 100644
--- a/src/ldplayer/ldplayer.c
+++ b/src/ldplayer/ldplayer.c
@@ -93,7 +93,7 @@ static chd_file *get_disc(device_t *device)
chd_file *image_chd = NULL;
/* open a path to the ROMs and find the first CHD file */
- file_enumerator path(device->machine->options().media_path());
+ file_enumerator path(device->machine().options().media_path());
const osd_directory_entry *dir;
/* iterate while we get new objects */
@@ -112,7 +112,7 @@ static chd_file *get_disc(device_t *device)
chd_error chderr;
/* open the file itself via our search path */
- image_file = auto_alloc(device->machine, emu_file(device->machine->options().media_path(), OPEN_FLAG_READ));
+ image_file = auto_alloc(device->machine(), emu_file(device->machine().options().media_path(), OPEN_FLAG_READ));
filerr = image_file->open(dir->name);
if (filerr == FILERR_NONE)
{
@@ -120,15 +120,15 @@ static chd_file *get_disc(device_t *device)
chderr = chd_open_file(*image_file, CHD_OPEN_READ, NULL, &image_chd);
if (chderr == CHDERR_NONE)
{
- set_disk_handle(*device->machine, "laserdisc", *image_file, *image_chd);
+ set_disk_handle(device->machine(), "laserdisc", *image_file, *image_chd);
filename.cpy(dir->name);
- device->machine->add_notifier(MACHINE_NOTIFY_EXIT, free_string);
+ device->machine().add_notifier(MACHINE_NOTIFY_EXIT, free_string);
break;
}
}
/* close the file on failure */
- auto_free(device->machine, image_file);
+ auto_free(device->machine(), image_file);
image_file = NULL;
}
}
@@ -137,7 +137,7 @@ static chd_file *get_disc(device_t *device)
if (image_file == NULL)
fatalerror("No valid image file found!\n");
- return get_disk_handle(device->machine, "laserdisc");
+ return get_disk_handle(device->machine(), "laserdisc");
}
@@ -150,7 +150,7 @@ static chd_file *get_disc(device_t *device)
static void process_commands(device_t *laserdisc)
{
- input_port_value controls = input_port_read(laserdisc->machine, "controls");
+ input_port_value controls = input_port_read(laserdisc->machine(), "controls");
int number;
/* step backwards */
@@ -223,7 +223,7 @@ static void process_commands(device_t *laserdisc)
static TIMER_CALLBACK( vsync_update )
{
- device_t *laserdisc = machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
int vblank_scanline;
attotime target;
@@ -232,9 +232,9 @@ static TIMER_CALLBACK( vsync_update )
process_commands(laserdisc);
/* set a timer to go off on the next VBLANK */
- vblank_scanline = machine->primary_screen->visible_area().max_y + 1;
- target = machine->primary_screen->time_until_pos(vblank_scanline);
- machine->scheduler().timer_set(target, FUNC(vsync_update));
+ vblank_scanline = machine.primary_screen->visible_area().max_y + 1;
+ target = machine.primary_screen->time_until_pos(vblank_scanline);
+ machine.scheduler().timer_set(target, FUNC(vsync_update));
}
@@ -246,7 +246,7 @@ static MACHINE_START( ldplayer )
static TIMER_CALLBACK( autoplay )
{
- device_t *laserdisc = machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
/* start playing */
(*execute_command)(laserdisc, CMD_PLAY);
@@ -257,7 +257,7 @@ static TIMER_CALLBACK( autoplay )
static MACHINE_RESET( ldplayer )
{
/* set up a timer to start playing immediately */
- machine->scheduler().timer_set(attotime::zero, FUNC(autoplay));
+ machine.scheduler().timer_set(attotime::zero, FUNC(autoplay));
/* indicate the name of the file we opened */
popmessage("Opened %s\n", filename.cstr());
@@ -299,7 +299,7 @@ static TIMER_CALLBACK( pr8210_bit_callback )
{
/* assert the line and set a timer for deassertion */
laserdisc_line_w(laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_usec(250), FUNC(pr8210_bit_off_callback), 0, ptr);
+ machine.scheduler().timer_set(attotime::from_usec(250), FUNC(pr8210_bit_off_callback), 0, ptr);
/* space 0 bits apart by 1msec, and 1 bits by 2msec */
duration = attotime::from_msec((data & 0x80) ? 2 : 1);
@@ -319,9 +319,9 @@ static TIMER_CALLBACK( pr8210_bit_callback )
static MACHINE_START( pr8210 )
{
- device_t *laserdisc = machine->m_devicelist.first(LASERDISC);
+ device_t *laserdisc = machine.m_devicelist.first(LASERDISC);
MACHINE_START_CALL(ldplayer);
- pr8210_bit_timer = machine->scheduler().timer_alloc(FUNC(pr8210_bit_callback), (void *)laserdisc);
+ pr8210_bit_timer = machine.scheduler().timer_alloc(FUNC(pr8210_bit_callback), (void *)laserdisc);
}
diff --git a/src/mame/audio/8080bw.c b/src/mame/audio/8080bw.c
index 922c17b6761..28de78be6ab 100644
--- a/src/mame/audio/8080bw.c
+++ b/src/mame/audio/8080bw.c
@@ -16,9 +16,9 @@
MACHINE_START( extra_8080bw_sh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
- state->speaker = machine->device("speaker");
+ state->speaker = machine.device("speaker");
state->save_item(NAME(state->port_1_last_extra));
state->save_item(NAME(state->port_2_last_extra));
@@ -33,7 +33,7 @@ MACHINE_START( extra_8080bw_sh )
WRITE8_HANDLER( invadpt2_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
sn76477_enable_w(state->sn, !(data & 0x01)); /* SAUCER SOUND */
@@ -45,7 +45,7 @@ WRITE8_HANDLER( invadpt2_sh_port_1_w )
state->screen_red = data & 0x04;
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->port_1_last_extra = data;
@@ -60,7 +60,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
D2 = 82K
D3 = 100K */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 3, 0); /* FLEET */
@@ -83,7 +83,7 @@ WRITE8_HANDLER( invadpt2_sh_port_2_w )
WRITE8_HANDLER( spcewars_sh_port_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
sn76477_enable_w(state->sn, !(data & 0x01)); /* Saucer Sound */
@@ -127,7 +127,7 @@ const samples_interface lrescue_samples_interface =
WRITE8_HANDLER( lrescue_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Thrust */
@@ -136,7 +136,7 @@ WRITE8_HANDLER( lrescue_sh_port_1_w )
if (rising_bits & 0x08) sample_start(state->samples, 1, 0, 0); /* Alien Hit */
if (rising_bits & 0x10) sample_start(state->samples, 2, 5, 0); /* Bonus Ship (not confirmed) */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x04;
@@ -145,7 +145,7 @@ WRITE8_HANDLER( lrescue_sh_port_1_w )
WRITE8_HANDLER( lrescue_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 8, 0); /* Footstep high tone */
@@ -185,7 +185,7 @@ WRITE8_HANDLER( cosmo_sh_port_2_w )
WRITE8_HANDLER( ballbomb_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 2, 0); /* Hit a balloon */
@@ -194,7 +194,7 @@ WRITE8_HANDLER( ballbomb_sh_port_1_w )
if (rising_bits & 0x08) sample_start(state->samples, 1, 7, 0); /* Hit a Bomb */
if (rising_bits & 0x10) sample_start(state->samples, 3, 8, 0); /* Bonus Base at 1500 points */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x04;
@@ -203,7 +203,7 @@ WRITE8_HANDLER( ballbomb_sh_port_1_w )
WRITE8_HANDLER( ballbomb_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (data & 0x01) sample_start(state->samples, 0, 7, 0); /* Indicates plane will drop bombs */
@@ -262,7 +262,7 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( indianbt_sh_port_1_w )
{
/* bit 4 occurs every 5.25 seconds during gameplay */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 7, 0); /* Death */
@@ -270,7 +270,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
if (rising_bits & 0x04) sample_start(state->samples, 2, 3, 0); /* Move */
if (rising_bits & 0x08) sample_start(state->samples, 3, 2, 0); /* Hit */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x01;
@@ -279,7 +279,7 @@ WRITE8_HANDLER( indianbt_sh_port_1_w )
WRITE8_HANDLER( indianbt_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 0, 0); /* Bird dropped an egg, Lasso used */
@@ -635,9 +635,9 @@ WRITE8_DEVICE_HANDLER( polaris_sh_port_2_w )
WRITE8_DEVICE_HANDLER( polaris_sh_port_3_w )
{
- _8080bw_state *state = device->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = device->machine().driver_data<_8080bw_state>();
- coin_lockout_global_w(device->machine, data & 0x04); /* SX8 */
+ coin_lockout_global_w(device->machine(), data & 0x04); /* SX8 */
state->c8080bw_flip_screen = data & 0x20; /* SX11 */
@@ -789,7 +789,7 @@ static const double schaser_effect_rc[8] =
WRITE8_HANDLER( schaser_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
int effect;
/* bit 0 - Dot Sound Enable (SX0)
@@ -862,21 +862,21 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
bit 4 - Field Control B (SX10)
bit 5 - Flip Screen */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
//printf( "schaser_sh_port_2_w: %02x\n", data );
discrete_sound_w(state->discrete, SCHASER_MUSIC_BIT, data & 0x01);
discrete_sound_w(state->discrete, SCHASER_SND_EN, data & 0x02);
- space->machine->sound().system_enable(data & 0x02);
+ space->machine().sound().system_enable(data & 0x02);
- coin_lockout_global_w(space->machine, data & 0x04);
+ coin_lockout_global_w(space->machine(), data & 0x04);
state->schaser_background_disable = (data >> 3) & 0x01;
state->schaser_background_select = (data >> 4) & 0x01;
- state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine, CABINET_PORT_TAG) & 0x01);
+ state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine(), CABINET_PORT_TAG) & 0x01);
state->port_2_last_extra = data;
}
@@ -884,7 +884,7 @@ WRITE8_HANDLER( schaser_sh_port_2_w )
static TIMER_CALLBACK( schaser_effect_555_cb )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
int effect = param;
attotime new_time;
/* Toggle 555 output */
@@ -909,7 +909,7 @@ static TIMER_CALLBACK( schaser_effect_555_cb )
static STATE_POSTLOAD( schaser_reinit_555_time_remain )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
state->schaser_effect_555_time_remain = attotime::from_double(state->schaser_effect_555_time_remain_savable);
schaser_sh_port_2_w(space, 0, state->port_2_last_extra);
@@ -918,22 +918,22 @@ static STATE_POSTLOAD( schaser_reinit_555_time_remain )
MACHINE_START( schaser_sh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
- state->schaser_effect_555_timer = machine->scheduler().timer_alloc(FUNC(schaser_effect_555_cb));
+ state->schaser_effect_555_timer = machine.scheduler().timer_alloc(FUNC(schaser_effect_555_cb));
state->save_item(NAME(state->schaser_explosion));
state->save_item(NAME(state->schaser_effect_555_is_low));
state->save_item(NAME(state->schaser_effect_555_time_remain_savable));
state->save_item(NAME(state->port_2_last_extra));
- machine->state().register_postload(schaser_reinit_555_time_remain, NULL);
+ machine.state().register_postload(schaser_reinit_555_time_remain, NULL);
}
MACHINE_RESET( schaser_sh )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
state->schaser_effect_555_is_low = 0;
state->schaser_effect_555_timer->adjust(attotime::never);
@@ -952,7 +952,7 @@ MACHINE_RESET( schaser_sh )
WRITE8_HANDLER( rollingc_sh_port_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_3_last_extra;
if (rising_bits & 0x02) sample_start(state->samples, 4, 0, 0); /* Steering */
@@ -976,7 +976,7 @@ WRITE8_HANDLER( rollingc_sh_port_w )
WRITE8_HANDLER( invrvnge_sh_port_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
switch (data)
{
@@ -1021,7 +1021,7 @@ WRITE8_HANDLER( invrvnge_sh_port_w )
WRITE8_HANDLER( lupin3_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 6, 0); /* Walking, get money */
@@ -1037,7 +1037,7 @@ WRITE8_HANDLER( lupin3_sh_port_1_w )
WRITE8_HANDLER( lupin3_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Lands on top of building, wife kicks man */
@@ -1048,7 +1048,7 @@ WRITE8_HANDLER( lupin3_sh_port_2_w )
state->color_map = data & 0x40;
- state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine, "IN2") & 0x04);
+ state->c8080bw_flip_screen = (data & 0x20) && (input_port_read(space->machine(), "IN2") & 0x04);
state->port_2_last_extra = data;
}
@@ -1066,7 +1066,7 @@ WRITE8_HANDLER( schasercv_sh_port_1_w )
bit 3 = 1st speedup
Death is a stream of ff's with some fe's thrown in */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x02) sample_start(state->samples, 1, 6, 0); /* Ran over a dot */
@@ -1077,11 +1077,11 @@ WRITE8_HANDLER( schasercv_sh_port_1_w )
WRITE8_HANDLER( schasercv_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
speaker_level_w(state->speaker, (data & 0x01) ? 1 : 0); /* End-of-Level */
- space->machine->sound().system_enable(data & 0x10);
+ space->machine().sound().system_enable(data & 0x10);
state->c8080bw_flip_screen = data & 0x20;
}
@@ -1094,7 +1094,7 @@ WRITE8_HANDLER( schasercv_sh_port_2_w )
WRITE8_HANDLER( yosakdon_sh_port_1_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 0, 3, 0); /* Game Over */
@@ -1103,14 +1103,14 @@ WRITE8_HANDLER( yosakdon_sh_port_1_w )
if (rising_bits & 0x08) sample_start(state->samples, 1, 2, 0); /* Man dead */
if (rising_bits & 0x10) sample_start(state->samples, 5, 8, 0); /* Bonus Man? */
- space->machine->sound().system_enable(data & 0x20);
+ space->machine().sound().system_enable(data & 0x20);
state->port_1_last_extra = data;
}
WRITE8_HANDLER( yosakdon_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 1, 6, 0); /* Ready? , Game Over */
@@ -1134,7 +1134,7 @@ WRITE8_HANDLER( yosakdon_sh_port_2_w )
WRITE8_HANDLER( shuttlei_sh_port_1_w )
{
/* bit 3 is high while you are alive and playing */
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last_extra;
if (rising_bits & 0x01) sample_start(state->samples, 4, 4, 0); /* Fleet move */
@@ -1147,7 +1147,7 @@ WRITE8_HANDLER( shuttlei_sh_port_1_w )
WRITE8_HANDLER( shuttlei_sh_port_2_w )
{
- _8080bw_state *state = space->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = space->machine().driver_data<_8080bw_state>();
switch (data)
{
diff --git a/src/mame/audio/amiga.c b/src/mame/audio/amiga.c
index 9ef03c75c03..1354af8506b 100644
--- a/src/mame/audio/amiga.c
+++ b/src/mame/audio/amiga.c
@@ -78,7 +78,7 @@ INLINE amiga_audio *get_safe_token( device_t *device )
static TIMER_CALLBACK( signal_irq )
{
- amiga_custom_w(machine->device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
+ amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | (0x80 << param), 0xffff);
}
@@ -124,7 +124,7 @@ void amiga_audio_update(device_t *device)
static STREAM_UPDATE( amiga_stream_update )
{
- amiga_state *state = device->machine->driver_data<amiga_state>();
+ amiga_state *state = device->machine().driver_data<amiga_state>();
amiga_audio *audio = (amiga_audio *)param;
int channum, sampoffs = 0;
@@ -242,7 +242,7 @@ static STREAM_UPDATE( amiga_stream_update )
/* if we're in manual mode, signal an interrupt once we latch the low byte */
if (!chan->dmaenabled && chan->manualmode && (chan->curlocation & 1))
{
- signal_irq(device->machine, NULL, channum);
+ signal_irq(device->machine(), NULL, channum);
chan->manualmode = FALSE;
}
}
@@ -270,11 +270,11 @@ static DEVICE_START( amiga_sound )
for (i = 0; i < 4; i++)
{
audio_state->channel[i].index = i;
- audio_state->channel[i].irq_timer = device->machine->scheduler().timer_alloc(FUNC(signal_irq));
+ audio_state->channel[i].irq_timer = device->machine().scheduler().timer_alloc(FUNC(signal_irq));
}
/* create the stream */
- audio_state->stream = device->machine->sound().stream_alloc(*device, 0, 4, device->clock() / CLOCK_DIVIDER, audio_state, amiga_stream_update);
+ audio_state->stream = device->machine().sound().stream_alloc(*device, 0, 4, device->clock() / CLOCK_DIVIDER, audio_state, amiga_stream_update);
}
diff --git a/src/mame/audio/astrof.c b/src/mame/audio/astrof.c
index 24a2ab782c7..f8709a57ef3 100644
--- a/src/mame/audio/astrof.c
+++ b/src/mame/audio/astrof.c
@@ -34,7 +34,7 @@
WRITE8_HANDLER( astrof_audio_1_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
UINT8 rising_bits = data & ~state->port_1_last;
if (state->astrof_death_playing)
@@ -72,7 +72,7 @@ WRITE8_HANDLER( astrof_audio_1_w )
/* D6 - don't know. Probably something to do with the explosion sounds */
/* D7 - sound enable bit */
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
state->port_1_last = data;
}
@@ -80,7 +80,7 @@ WRITE8_HANDLER( astrof_audio_1_w )
WRITE8_HANDLER( astrof_audio_2_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* D0-D2 - explosion select (triggered by D2 of the other port */
@@ -184,7 +184,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( tomahawk_audio_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
/* D0 - sonar */
@@ -202,7 +202,7 @@ WRITE8_HANDLER( tomahawk_audio_w )
/* D6 - explosion */
/* D7 - sound enable bit */
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
}
diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c
index 81968c8fcb6..9fcf4038393 100644
--- a/src/mame/audio/atarijsa.c
+++ b/src/mame/audio/atarijsa.c
@@ -71,7 +71,7 @@ static UINT8 oki6295_volume;
static UINT8 ym2151_ct1;
static UINT8 ym2151_ct2;
-static void update_all_volumes(running_machine *machine);
+static void update_all_volumes(running_machine &machine);
static READ8_HANDLER( jsa1_io_r );
static WRITE8_HANDLER( jsa1_io_w );
@@ -105,7 +105,7 @@ ADDRESS_MAP_END
*
*************************************/
-static void init_save_state(running_machine *machine)
+static void init_save_state(running_machine &machine)
{
state_save_register_global(machine, overall_volume);
state_save_register_global(machine, pokey_volume);
@@ -122,28 +122,28 @@ static void init_save_state(running_machine *machine)
*
*************************************/
-void atarijsa_init(running_machine *machine, const char *testport, int testmask)
+void atarijsa_init(running_machine &machine, const char *testport, int testmask)
{
UINT8 *rgn;
/* copy in the parameters */
- jsacpu = machine->device<cpu_device>("jsa");
+ jsacpu = machine.device<cpu_device>("jsa");
assert_always(jsacpu != NULL, "Could not find JSA CPU!");
test_port = testport;
test_mask = testmask;
/* predetermine the bank base */
- rgn = machine->region("jsa")->base();
+ rgn = machine.region("jsa")->base();
bank_base = &rgn[0x03000];
bank_source_data = &rgn[0x10000];
/* determine which sound hardware is installed */
- tms5220 = machine->device("tms");
- ym2151 = machine->device<ym2151_device>("ymsnd");
- pokey = machine->device<pokey_device>("pokey");
- oki6295 = machine->device<okim6295_device>("adpcm");
- oki6295_l = machine->device<okim6295_device>("adpcml");
- oki6295_r = machine->device<okim6295_device>("adpcmr");
+ tms5220 = machine.device("tms");
+ ym2151 = machine.device<ym2151_device>("ymsnd");
+ pokey = machine.device<pokey_device>("pokey");
+ oki6295 = machine.device<okim6295_device>("adpcm");
+ oki6295_l = machine.device<okim6295_device>("adpcml");
+ oki6295_r = machine.device<okim6295_device>("adpcmr");
/* install POKEY memory handlers */
if (pokey != NULL)
@@ -161,8 +161,8 @@ void atarijsa_init(running_machine *machine, const char *testport, int testmask)
/* the upper 128k is fixed, the lower 128k is bankswitched */
for (rgn = 0; rgn < ARRAY_LENGTH(regions); rgn++)
{
- UINT8 *base = machine->region(regions[rgn])->base();
- if (base != NULL && machine->region(regions[rgn])->bytes() >= 0x80000)
+ UINT8 *base = machine.region(regions[rgn])->base();
+ if (base != NULL && machine.region(regions[rgn])->bytes() >= 0x80000)
{
const char *bank = (rgn != 2) ? "bank12" : "bank14";
const char *bank_plus_1 = (rgn != 2) ? "bank13" : "bank15";
@@ -203,7 +203,7 @@ void atarijsa_reset(void)
static READ8_HANDLER( jsa1_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -227,8 +227,8 @@ static READ8_HANDLER( jsa1_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine, "JSAI");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x80;
+ result = input_port_read(space->machine(), "JSAI");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
if ((tms5220 != NULL) && (tms5220_readyq_r(tms5220) == 0))
@@ -298,11 +298,11 @@ static WRITE8_HANDLER( jsa1_io_w )
}
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
@@ -318,7 +318,7 @@ static WRITE8_HANDLER( jsa1_io_w )
tms5220_volume = ((data >> 6) & 3) * 100 / 3;
pokey_volume = ((data >> 4) & 3) * 100 / 3;
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -333,7 +333,7 @@ static WRITE8_HANDLER( jsa1_io_w )
static READ8_HANDLER( jsa2_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -360,8 +360,8 @@ static READ8_HANDLER( jsa2_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine, "JSAII");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x80;
+ result = input_port_read(space->machine(), "JSAII");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x80;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
break;
@@ -419,14 +419,14 @@ static WRITE8_HANDLER( jsa2_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
if (oki6295 != NULL)
@@ -443,7 +443,7 @@ static WRITE8_HANDLER( jsa2_io_w )
*/
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -458,7 +458,7 @@ static WRITE8_HANDLER( jsa2_io_w )
static READ8_HANDLER( jsa3_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -483,8 +483,8 @@ static READ8_HANDLER( jsa3_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = input_port_read(space->machine, "JSAIII");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x90;
+ result = input_port_read(space->machine(), "JSAIII");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
break;
@@ -511,7 +511,7 @@ static WRITE8_HANDLER( jsa3_io_w )
{
case 0x000: /* /RDV */
overall_volume = data * 100 / 127;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
case 0x002: /* /RDP */
@@ -544,18 +544,18 @@ static WRITE8_HANDLER( jsa3_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the OKI bank */
if (oki6295 != NULL)
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 2) | ((data >> 1) & 1));
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
if (oki6295 != NULL) oki6295->set_pin7(data & 8);
@@ -572,12 +572,12 @@ static WRITE8_HANDLER( jsa3_io_w )
/* update the OKI bank */
if (oki6295 != NULL)
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 1) | ((data >> 3) & 2));
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 1) | ((data >> 3) & 2));
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -592,7 +592,7 @@ static WRITE8_HANDLER( jsa3_io_w )
static READ8_HANDLER( jsa3s_io_r )
{
- atarigen_state *atarigen = space->machine->driver_data<atarigen_state>();
+ atarigen_state *atarigen = space->machine().driver_data<atarigen_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -617,8 +617,8 @@ static READ8_HANDLER( jsa3s_io_r )
0x02 = coin L (active high)
0x01 = coin R (active high)
*/
- result = input_port_read(space->machine, "JSAIII");
- if (!(input_port_read(space->machine, test_port) & test_mask)) result ^= 0x90;
+ result = input_port_read(space->machine(), "JSAIII");
+ if (!(input_port_read(space->machine(), test_port) & test_mask)) result ^= 0x90;
if (atarigen->cpu_to_sound_ready) result ^= 0x40;
if (atarigen->sound_to_cpu_ready) result ^= 0x20;
break;
@@ -645,7 +645,7 @@ static WRITE8_HANDLER( jsa3s_io_w )
{
case 0x000: /* /RDV */
overall_volume = data * 100 / 127;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
case 0x002: /* /RDP */
@@ -678,17 +678,17 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* reset the YM2151 if needed */
- if ((data&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if ((data&1) == 0) devtag_reset(space->machine(), "ymsnd");
/* update the OKI bank */
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 2) | ((data >> 1) & 1));
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 2) | ((data >> 1) & 1));
/* update the bank */
memcpy(bank_base, &bank_source_data[0x1000 * ((data >> 6) & 3)], 0x1000);
/* coin counters */
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
/* update the OKI frequency */
oki6295_l->set_pin7(data & 8);
@@ -705,13 +705,13 @@ static WRITE8_HANDLER( jsa3s_io_w )
*/
/* update the OKI bank */
- memory_set_bank(space->machine, "bank12", (memory_get_bank(space->machine, "bank12") & 1) | ((data >> 3) & 2));
- memory_set_bank(space->machine, "bank14", data >> 6);
+ memory_set_bank(space->machine(), "bank12", (memory_get_bank(space->machine(), "bank12") & 1) | ((data >> 3) & 2));
+ memory_set_bank(space->machine(), "bank14", data >> 6);
/* update the volumes */
ym2151_volume = ((data >> 1) & 7) * 100 / 7;
oki6295_volume = 50 + (data & 1) * 50;
- update_all_volumes(space->machine);
+ update_all_volumes(space->machine());
break;
}
}
@@ -720,7 +720,7 @@ static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
{
ym2151_ct1 = data&0x1;
ym2151_ct2 = (data&0x2)>>1;
- update_all_volumes(device->machine);
+ update_all_volumes(device->machine());
}
@@ -730,7 +730,7 @@ static WRITE8_DEVICE_HANDLER( ym2151_ctl_w )
*
*************************************/
-static void update_all_volumes(running_machine *machine )
+static void update_all_volumes(running_machine &machine )
{
if (pokey != NULL) atarigen_set_pokey_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1);
//if (pokey != NULL) atarigen_set_pokey_stereo_vol(machine, (overall_volume * pokey_volume / 100) * ym2151_ct1, (overall_volume * pokey_volume / 100) * ym2151_ct2);
diff --git a/src/mame/audio/atarijsa.h b/src/mame/audio/atarijsa.h
index c347fd8f359..ebae34fe4ed 100644
--- a/src/mame/audio/atarijsa.h
+++ b/src/mame/audio/atarijsa.h
@@ -5,7 +5,7 @@
****************************************************************************/
-void atarijsa_init(running_machine *machine, const char *testport, int testmask);
+void atarijsa_init(running_machine &machine, const char *testport, int testmask);
void atarijsa_reset(void);
diff --git a/src/mame/audio/aztarac.c b/src/mame/audio/aztarac.c
index f1fa6f77af1..247f2e796a3 100644
--- a/src/mame/audio/aztarac.c
+++ b/src/mame/audio/aztarac.c
@@ -11,26 +11,26 @@
READ16_HANDLER( aztarac_sound_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
return state->sound_status & 0x01;
}
WRITE16_HANDLER( aztarac_sound_w )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
if (ACCESSING_BITS_0_7)
{
data &= 0xff;
soundlatch_w(space, offset, data);
state->sound_status ^= 0x21;
if (state->sound_status & 0x20)
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
READ8_HANDLER( aztarac_snd_command_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
state->sound_status |= 0x01;
state->sound_status &= ~0x20;
return soundlatch_r(space,offset);
@@ -38,19 +38,19 @@ READ8_HANDLER( aztarac_snd_command_r )
READ8_HANDLER( aztarac_snd_status_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
return state->sound_status & ~0x01;
}
WRITE8_HANDLER( aztarac_snd_status_w )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
state->sound_status &= ~0x10;
}
INTERRUPT_GEN( aztarac_snd_timed_irq )
{
- aztarac_state *state = device->machine->driver_data<aztarac_state>();
+ aztarac_state *state = device->machine().driver_data<aztarac_state>();
state->sound_status ^= 0x10;
if (state->sound_status & 0x10)
diff --git a/src/mame/audio/beezer.c b/src/mame/audio/beezer.c
index 72799043bbe..ff63c6d0938 100644
--- a/src/mame/audio/beezer.c
+++ b/src/mame/audio/beezer.c
@@ -135,7 +135,7 @@ INLINE beezer_sound_state *get_safe_token(device_t *device)
/*static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
{
beezer_sound_state *sndstate = get_safe_token(device);
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, (sndstate->ptm_irq_state) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_IRQ_LINE, (sndstate->ptm_irq_state) ? ASSERT_LINE : CLEAR_LINE);
}*/
@@ -380,8 +380,8 @@ static DEVICE_START( common_sh_start )
state->sh6840_clocks_per_sample = (int)(((double)SH6840_CLOCK / (double)sample_rate) * (double)(1 << 24));
/* allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, NULL, beezer_stream_update);
- state->maincpu = device->machine->device("maincpu");
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, sample_rate, NULL, beezer_stream_update);
+ state->maincpu = device->machine().device("maincpu");
sh6840_register_state_globals(device);
}
diff --git a/src/mame/audio/blockade.c b/src/mame/audio/blockade.c
index b01097ee2a0..f0987226972 100644
--- a/src/mame/audio/blockade.c
+++ b/src/mame/audio/blockade.c
@@ -44,7 +44,7 @@ WRITE8_DEVICE_HANDLER( blockade_sound_freq_w )
WRITE8_HANDLER( blockade_env_on_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
if (BLOCKADE_LOG) mame_printf_debug("Boom Start\n");
sample_start(samples, 0,0,0);
return;
diff --git a/src/mame/audio/bzone.c b/src/mame/audio/bzone.c
index de88a21048e..74bf7a873ad 100644
--- a/src/mame/audio/bzone.c
+++ b/src/mame/audio/bzone.c
@@ -392,7 +392,7 @@ WRITE8_DEVICE_HANDLER( bzone_sounds_w )
discrete_sound_w(device, BZ_INPUT, data);
output_set_value("startled", (data >> 6) & 1);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
}
diff --git a/src/mame/audio/cage.c b/src/mame/audio/cage.c
index 00beada9528..e37d0d970c2 100644
--- a/src/mame/audio/cage.c
+++ b/src/mame/audio/cage.c
@@ -39,7 +39,7 @@ static attotime cage_cpu_h1_clock_period;
static UINT8 cpu_to_cage_ready;
static UINT8 cage_to_cpu_ready;
-static void (*cage_irqhandler)(running_machine *, int);
+static void (*cage_irqhandler)(running_machine &, int);
static attotime serial_period_per_word;
@@ -153,23 +153,23 @@ static WRITE32_HANDLER( speedup_w );
*
*************************************/
-void cage_init(running_machine *machine, offs_t speedup)
+void cage_init(running_machine &machine, offs_t speedup)
{
attotime cage_cpu_clock_period;
int chan;
cage_irqhandler = NULL;
- memory_set_bankptr(machine, "bank10", machine->region("cageboot")->base());
- memory_set_bankptr(machine, "bank11", machine->region("cage")->base());
+ memory_set_bankptr(machine, "bank10", machine.region("cageboot")->base());
+ memory_set_bankptr(machine, "bank11", machine.region("cage")->base());
- cage_cpu = machine->device<cpu_device>("cage");
+ cage_cpu = machine.device<cpu_device>("cage");
cage_cpu_clock_period = attotime::from_hz(cage_cpu->clock());
cage_cpu_h1_clock_period = cage_cpu_clock_period * 2;
- dma_timer = machine->device<timer_device>("cage_dma_timer");
- timer[0] = machine->device<timer_device>("cage_timer0");
- timer[1] = machine->device<timer_device>("cage_timer1");
+ dma_timer = machine.device<timer_device>("cage_dma_timer");
+ timer[0] = machine.device<timer_device>("cage_timer0");
+ timer[1] = machine.device<timer_device>("cage_timer1");
if (speedup)
speedup_ram = cage_cpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(speedup, speedup, FUNC(speedup_w));
@@ -178,7 +178,7 @@ void cage_init(running_machine *machine, offs_t speedup)
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
- dmadac[chan] = machine->device<dmadac_sound_device>(buffer);
+ dmadac[chan] = machine.device<dmadac_sound_device>(buffer);
}
state_save_register_global(machine, cpu_to_cage_ready);
@@ -192,7 +192,7 @@ void cage_init(running_machine *machine, offs_t speedup)
}
-void cage_set_irq_handler(void (*irqhandler)(running_machine *, int))
+void cage_set_irq_handler(void (*irqhandler)(running_machine &, int))
{
cage_irqhandler = irqhandler;
}
@@ -201,7 +201,7 @@ void cage_set_irq_handler(void (*irqhandler)(running_machine *, int))
void cage_reset_w(int state)
{
if (state)
- cage_control_w(cage_cpu->machine, 0);
+ cage_control_w(cage_cpu->machine(), 0);
device_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -342,7 +342,7 @@ static void update_timer(int which)
*
*************************************/
-static void update_serial(running_machine *machine)
+static void update_serial(running_machine &machine)
{
attotime serial_clock_period, bit_clock_period;
UINT32 freq;
@@ -438,7 +438,7 @@ static WRITE32_HANDLER( tms32031_io_w )
case SPORT_GLOBAL_CTL:
case SPORT_TIMER_CTL:
case SPORT_TIMER_PERIOD:
- update_serial(space->machine);
+ update_serial(space->machine());
break;
}
}
@@ -451,7 +451,7 @@ static WRITE32_HANDLER( tms32031_io_w )
*
*************************************/
-static void update_control_lines(running_machine *machine)
+static void update_control_lines(running_machine &machine)
{
int val;
@@ -482,7 +482,7 @@ static READ32_HANDLER( cage_from_main_r )
if (LOG_COMM)
logerror("%06X:CAGE read command = %04X\n", cpu_get_pc(space->cpu), cage_from_main);
cpu_to_cage_ready = 0;
- update_control_lines(space->machine);
+ update_control_lines(space->machine());
device_set_input_line(cage_cpu, TMS3203X_IRQ0, CLEAR_LINE);
return cage_from_main;
}
@@ -501,7 +501,7 @@ static WRITE32_HANDLER( cage_to_main_w )
logerror("%06X:Data from CAGE = %04X\n", cpu_get_pc(space->cpu), data);
soundlatch_word_w(space, 0, data, mem_mask);
cage_to_cpu_ready = 1;
- update_control_lines(space->machine);
+ update_control_lines(space->machine());
}
@@ -519,9 +519,9 @@ static READ32_HANDLER( cage_io_status_r )
UINT16 main_from_cage_r(address_space *space)
{
if (LOG_COMM)
- logerror("%s:main read data = %04X\n", space->machine->describe_context(), soundlatch_word_r(space, 0, 0));
+ logerror("%s:main read data = %04X\n", space->machine().describe_context(), soundlatch_word_r(space, 0, 0));
cage_to_cpu_ready = 0;
- update_control_lines(space->machine);
+ update_control_lines(space->machine());
return soundlatch_word_r(space, 0, 0xffff);
}
@@ -537,10 +537,10 @@ static TIMER_CALLBACK( deferred_cage_w )
void main_to_cage_w(UINT16 data)
{
- running_machine *machine = cage_cpu->machine;
+ running_machine &machine = cage_cpu->machine();
if (LOG_COMM)
- logerror("%s:Command to CAGE = %04X\n", machine->describe_context(), data);
- machine->scheduler().synchronize(FUNC(deferred_cage_w), data);
+ logerror("%s:Command to CAGE = %04X\n", machine.describe_context(), data);
+ machine.scheduler().synchronize(FUNC(deferred_cage_w), data);
}
@@ -557,7 +557,7 @@ UINT16 cage_control_r(void)
}
-void cage_control_w(running_machine *machine, UINT16 data)
+void cage_control_w(running_machine &machine, UINT16 data)
{
cage_control = data;
diff --git a/src/mame/audio/cage.h b/src/mame/audio/cage.h
index cfb2b8f10fb..56169307470 100644
--- a/src/mame/audio/cage.h
+++ b/src/mame/audio/cage.h
@@ -10,11 +10,11 @@
MACHINE_CONFIG_EXTERN( cage );
MACHINE_CONFIG_EXTERN( cage_seattle );
-void cage_init(running_machine *machine, offs_t speedup);
-void cage_set_irq_handler(void (*irqhandler)(running_machine *, int));
+void cage_init(running_machine &machine, offs_t speedup);
+void cage_set_irq_handler(void (*irqhandler)(running_machine &, int));
void cage_reset_w(int state);
UINT16 main_from_cage_r(address_space *space);
UINT16 cage_control_r(void);
void main_to_cage_w(UINT16 data);
-void cage_control_w(running_machine *machine, UINT16 data);
+void cage_control_w(running_machine &machine, UINT16 data);
diff --git a/src/mame/audio/carnival.c b/src/mame/audio/carnival.c
index 413396e055d..8d7f87e4836 100644
--- a/src/mame/audio/carnival.c
+++ b/src/mame/audio/carnival.c
@@ -127,7 +127,7 @@ static int psgData = 0;
WRITE8_HANDLER( carnival_audio_1_w )
{
static int port1State = 0;
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@@ -206,7 +206,7 @@ WRITE8_HANDLER( carnival_audio_1_w )
WRITE8_HANDLER( carnival_audio_2_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
@@ -236,7 +236,7 @@ WRITE8_HANDLER( carnival_audio_2_w )
if ( bitsGoneHigh & OUT_PORT_2_MUSIC_RESET )
/* reset output is no longer asserted active low */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE );
}
diff --git a/src/mame/audio/cchasm.c b/src/mame/audio/cchasm.c
index 61eef77b63f..d9e7bc4eb4c 100644
--- a/src/mame/audio/cchasm.c
+++ b/src/mame/audio/cchasm.c
@@ -14,7 +14,7 @@
WRITE8_HANDLER( cchasm_reset_coin_flag_w )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
if (state->coin_flag)
{
state->coin_flag = 0;
@@ -24,7 +24,7 @@ WRITE8_HANDLER( cchasm_reset_coin_flag_w )
INPUT_CHANGED( cchasm_set_coin_flag )
{
- cchasm_state *state = field->port->machine->driver_data<cchasm_state>();
+ cchasm_state *state = field->port->machine().driver_data<cchasm_state>();
if (!newval && !state->coin_flag)
{
state->coin_flag = 1;
@@ -34,14 +34,14 @@ INPUT_CHANGED( cchasm_set_coin_flag )
READ8_HANDLER( cchasm_coin_sound_r )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
- UINT8 coin = (input_port_read(space->machine, "IN3") >> 4) & 0x7;
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
+ UINT8 coin = (input_port_read(space->machine(), "IN3") >> 4) & 0x7;
return state->sound_flags | (state->coin_flag << 3) | coin;
}
READ8_HANDLER( cchasm_soundlatch2_r )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
state->sound_flags &= ~0x80;
z80ctc_trg2_w(state->ctc, 0);
return soundlatch2_r(space, offset);
@@ -49,15 +49,15 @@ READ8_HANDLER( cchasm_soundlatch2_r )
WRITE8_HANDLER( cchasm_soundlatch4_w )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
state->sound_flags |= 0x40;
soundlatch4_w(space, offset, data);
- cputag_set_input_line(space->machine, "maincpu", 1, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, HOLD_LINE);
}
WRITE16_HANDLER( cchasm_io_w )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
//static int led;
if (ACCESSING_BITS_8_15)
@@ -72,7 +72,7 @@ WRITE16_HANDLER( cchasm_io_w )
state->sound_flags |= 0x80;
soundlatch2_w (space, offset, data);
z80ctc_trg2_w(state->ctc, 1);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
case 2:
//led = data;
@@ -83,7 +83,7 @@ WRITE16_HANDLER( cchasm_io_w )
READ16_HANDLER( cchasm_io_r )
{
- cchasm_state *state = space->machine->driver_data<cchasm_state>();
+ cchasm_state *state = space->machine().driver_data<cchasm_state>();
switch (offset & 0xf)
{
case 0x0:
@@ -92,11 +92,11 @@ READ16_HANDLER( cchasm_io_r )
state->sound_flags &= ~0x40;
return soundlatch4_r (space,offset) << 8;
case 0x2:
- return (state->sound_flags| (input_port_read(space->machine, "IN3") & 0x07) | 0x08) << 8;
+ return (state->sound_flags| (input_port_read(space->machine(), "IN3") & 0x07) | 0x08) << 8;
case 0x5:
- return input_port_read(space->machine, "IN2") << 8;
+ return input_port_read(space->machine(), "IN2") << 8;
case 0x8:
- return input_port_read(space->machine, "IN1") << 8;
+ return input_port_read(space->machine(), "IN1") << 8;
default:
return 0xff << 8;
}
@@ -105,23 +105,23 @@ READ16_HANDLER( cchasm_io_r )
static WRITE_LINE_DEVICE_HANDLER( ctc_timer_1_w )
{
- cchasm_state *drvstate = device->machine->driver_data<cchasm_state>();
+ cchasm_state *drvstate = device->machine().driver_data<cchasm_state>();
if (state) /* rising edge */
{
drvstate->output[0] ^= 0x7f;
drvstate->channel_active[0] = 1;
- dac_data_w(device->machine->device("dac1"), drvstate->output[0]);
+ dac_data_w(device->machine().device("dac1"), drvstate->output[0]);
}
}
static WRITE_LINE_DEVICE_HANDLER( ctc_timer_2_w )
{
- cchasm_state *drvstate = device->machine->driver_data<cchasm_state>();
+ cchasm_state *drvstate = device->machine().driver_data<cchasm_state>();
if (state) /* rising edge */
{
drvstate->output[1] ^= 0x7f;
drvstate->channel_active[1] = 1;
- dac_data_w(device->machine->device("dac2"), drvstate->output[0]);
+ dac_data_w(device->machine().device("dac2"), drvstate->output[0]);
}
}
@@ -136,10 +136,10 @@ Z80CTC_INTERFACE( cchasm_ctc_intf )
SOUND_START( cchasm )
{
- cchasm_state *state = machine->driver_data<cchasm_state>();
+ cchasm_state *state = machine.driver_data<cchasm_state>();
state->coin_flag = 0;
state->sound_flags = 0;
state->output[0] = 0; state->output[1] = 0;
- state->ctc = machine->device("ctc");
+ state->ctc = machine.device("ctc");
}
diff --git a/src/mame/audio/cclimber.c b/src/mame/audio/cclimber.c
index a82f49ee781..497276fadc1 100644
--- a/src/mame/audio/cclimber.c
+++ b/src/mame/audio/cclimber.c
@@ -15,19 +15,19 @@ static INT16 *samplebuf; /* buffer to decode samples at run time */
static SAMPLES_START( cclimber_sh_start )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
samplebuf = 0;
- if (machine->region("samples")->base())
- samplebuf = auto_alloc_array(machine, INT16, 2 * machine->region("samples")->bytes());
+ if (machine.region("samples")->base())
+ samplebuf = auto_alloc_array(machine, INT16, 2 * machine.region("samples")->bytes());
}
-static void cclimber_play_sample(running_machine *machine, int start,int freq,int volume)
+static void cclimber_play_sample(running_machine &machine, int start,int freq,int volume)
{
int len;
- int romlen = machine->region("samples")->bytes();
- const UINT8 *rom = machine->region("samples")->base();
- device_t *samples = machine->device("samples");
+ int romlen = machine.region("samples")->bytes();
+ const UINT8 *rom = machine.region("samples")->base();
+ device_t *samples = machine.device("samples");
if (!rom) return;
@@ -74,7 +74,7 @@ WRITE8_HANDLER( cclimber_sample_trigger_w )
if (data == 0)
return;
- cclimber_play_sample(space->machine, 32 * sample_num,sample_freq,sample_volume);
+ cclimber_play_sample(space->machine(), 32 * sample_num,sample_freq,sample_volume);
}
diff --git a/src/mame/audio/cinemat.c b/src/mame/audio/cinemat.c
index 5da3bf54707..a2eb85dbd86 100644
--- a/src/mame/audio/cinemat.c
+++ b/src/mame/audio/cinemat.c
@@ -53,7 +53,7 @@
WRITE8_HANDLER( cinemat_sound_control_w )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
UINT8 oldval = state->sound_control;
/* form an 8-bit value with the new bit */
@@ -61,7 +61,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
/* if something changed, call the sound subroutine */
if ((state->sound_control != oldval) && state->sound_handler)
- (*state->sound_handler)(space->machine, state->sound_control, state->sound_control ^ oldval);
+ (*state->sound_handler)(space->machine(), state->sound_control, state->sound_control ^ oldval);
}
@@ -74,7 +74,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
static MACHINE_START( generic )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* register for save states */
state_save_register_global(machine, state->sound_control);
state_save_register_global(machine, state->current_shift);
@@ -89,9 +89,9 @@ static MACHINE_START( generic )
}
-static void generic_init(running_machine *machine, void (*callback)(running_machine *,UINT8, UINT8))
+static void generic_init(running_machine &machine, void (*callback)(running_machine &,UINT8, UINT8))
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* call the standard init */
MACHINE_RESET_CALL(cinemat);
@@ -141,17 +141,17 @@ static const samples_interface spacewar_samples_interface =
spacewar_sample_names
};
-static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void spacewar_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
- sample_start(samples, 0, (machine->rand() & 1) ? 0 : 6, 0);
+ sample_start(samples, 0, (machine.rand() & 1) ? 0 : 6, 0);
/* Fire sound - rising edge */
if (SOUNDVAL_RISING_EDGE(0x02))
- sample_start(samples, 1, (machine->rand() & 1) ? 1 : 7, 0);
+ sample_start(samples, 1, (machine.rand() & 1) ? 1 : 7, 0);
/* Player 1 thrust - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x04))
@@ -221,9 +221,9 @@ static const samples_interface barrier_samples_interface =
barrier_sample_names
};
-static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void barrier_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* Player die - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@@ -275,10 +275,10 @@ static const samples_interface speedfrk_samples_interface =
speedfrk_sample_names
};
-static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void speedfrk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
if (SOUNDVAL_FALLING_EDGE(0x08))
@@ -342,9 +342,9 @@ static const samples_interface starhawk_samples_interface =
starhawk_sample_names
};
-static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void starhawk_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* explosion - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -419,9 +419,9 @@ static const samples_interface sundance_samples_interface =
sundance_sample_names
};
-static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void sundance_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* bong - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -490,13 +490,13 @@ static const samples_interface tailg_samples_interface =
tailg_sample_names
};
-static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void tailg_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
if (SOUNDVAL_FALLING_EDGE(0x10))
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* update the shift register (actually just a simple mux) */
state->current_shift = (state->current_shift & ~(1 << (sound_val & 7))) | (((sound_val >> 3) & 1) << (sound_val & 7));
@@ -580,9 +580,9 @@ static const samples_interface warrior_samples_interface =
warrior_sample_names
};
-static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void warrior_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
/* normal level - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x01))
@@ -652,10 +652,10 @@ static const samples_interface armora_samples_interface =
armora_sample_names
};
-static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void armora_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -755,10 +755,10 @@ static const samples_interface ripoff_samples_interface =
ripoff_sample_names
};
-static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void ripoff_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x02))
@@ -844,10 +844,10 @@ static const samples_interface starcas_samples_interface =
starcas_sample_names
};
-static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void starcas_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -888,14 +888,14 @@ static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bit
target_pitch = 0x5800 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine->primary_screen->frame_number() > state->last_frame)
+ if (machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_pitch > target_pitch)
state->current_pitch -= 225;
if (state->current_pitch < target_pitch)
state->current_pitch += 150;
sample_set_freq(samples, 4, state->current_pitch);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* remember the previous value */
@@ -959,10 +959,10 @@ static const samples_interface solarq_samples_interface =
solarq_sample_names
};
-static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void solarq_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -993,7 +993,7 @@ static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits
state->target_volume = 0;
/* ramp the thrust volume */
- if (sample_playing(samples, 2) && machine->primary_screen->frame_number() > state->last_frame)
+ if (sample_playing(samples, 2) && machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_volume > state->target_volume)
state->current_volume -= 0.078f;
@@ -1003,7 +1003,7 @@ static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits
sample_set_volume(samples, 2, state->current_volume);
else
sample_stop(samples, 2);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* fire - falling edge */
@@ -1100,10 +1100,10 @@ static const samples_interface boxingb_samples_interface =
boxingb_sample_names
};
-static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void boxingb_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@@ -1233,10 +1233,10 @@ static const samples_interface wotw_samples_interface =
wotw_sample_names
};
-static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void wotw_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1277,14 +1277,14 @@ static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_c
target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine->primary_screen->frame_number() > state->last_frame)
+ if (machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_pitch > target_pitch)
state->current_pitch -= 300;
if (state->current_pitch < target_pitch)
state->current_pitch += 200;
sample_set_freq(samples, 4, state->current_pitch);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* remember the previous value */
@@ -1348,10 +1348,10 @@ static const samples_interface wotwc_samples_interface =
wotwc_sample_names
};
-static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void wotwc_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- device_t *samples = machine->device("samples");
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ device_t *samples = machine.device("samples");
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@@ -1392,14 +1392,14 @@ static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_
target_pitch = 0x10000 + (target_pitch << 12);
/* once per frame slide the pitch toward the target */
- if (machine->primary_screen->frame_number() > state->last_frame)
+ if (machine.primary_screen->frame_number() > state->last_frame)
{
if (state->current_pitch > target_pitch)
state->current_pitch -= 300;
if (state->current_pitch < target_pitch)
state->current_pitch += 200;
sample_set_freq(samples, 4, state->current_pitch);
- state->last_frame = machine->primary_screen->frame_number();
+ state->last_frame = machine.primary_screen->frame_number();
}
/* remember the previous value */
@@ -1445,26 +1445,26 @@ MACHINE_CONFIG_END
static TIMER_CALLBACK( synced_sound_w )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->sound_fifo[state->sound_fifo_in] = param;
state->sound_fifo_in = (state->sound_fifo_in + 1) % 16;
}
-static void demon_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
+static void demon_sound_w(running_machine &machine, UINT8 sound_val, UINT8 bits_changed)
{
/* all inputs are inverted */
sound_val = ~sound_val;
/* watch for a 0->1 edge on bit 4 ("shift in") to clock in the new data */
if ((bits_changed & 0x10) && (sound_val & 0x10))
- machine->scheduler().synchronize(FUNC(synced_sound_w), sound_val & 0x0f);
+ machine.scheduler().synchronize(FUNC(synced_sound_w), sound_val & 0x0f);
}
static READ8_DEVICE_HANDLER( sound_porta_r )
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
/* bits 0-3 are the sound data; bit 4 is the data ready */
return state->sound_fifo[state->sound_fifo_out] | ((state->sound_fifo_in != state->sound_fifo_out) << 4);
}
@@ -1472,14 +1472,14 @@ static READ8_DEVICE_HANDLER( sound_porta_r )
static READ8_DEVICE_HANDLER( sound_portb_r )
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
return state->last_portb_write;
}
static WRITE8_DEVICE_HANDLER( sound_portb_w )
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
/* watch for a 0->1 edge on bit 0 ("shift out") to advance the data pointer */
if ((data & 1) != (state->last_portb_write & 1) && (data & 1) != 0)
state->sound_fifo_out = (state->sound_fifo_out + 1) % 16;
@@ -1490,7 +1490,7 @@ static WRITE8_DEVICE_HANDLER( sound_portb_w )
/* bit 2 controls the global mute */
if ((data & 4) != (state->last_portb_write & 4))
- device->machine->sound().system_mute(data & 4);
+ device->machine().sound().system_mute(data & 4);
/* remember the last value written */
state->last_portb_write = data;
@@ -1536,7 +1536,7 @@ static Z80CTC_INTERFACE( demon_z80ctc_interface )
static MACHINE_RESET( demon_sound )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* generic init */
generic_init(machine, demon_sound_w);
@@ -1545,7 +1545,7 @@ static MACHINE_RESET( demon_sound )
state->last_portb_write = 0xff;
/* turn off channel A on AY8910 #0 because it is used as a low-pass filter */
- ay8910_set_volume(machine->device("ay1"), 0, 0);
+ ay8910_set_volume(machine.device("ay1"), 0, 0);
}
@@ -1614,19 +1614,19 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( qb3_sound_w )
{
- UINT16 rega = cpu_get_reg(space->machine->device("maincpu"), CCPU_A);
- demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
+ UINT16 rega = cpu_get_reg(space->machine().device("maincpu"), CCPU_A);
+ demon_sound_w(space->machine(), 0x00 | (~rega & 0x0f), 0x10);
}
static MACHINE_RESET( qb3_sound )
{
MACHINE_RESET_CALL(demon_sound);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x04, 0x04, FUNC(qb3_sound_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x04, 0x04, FUNC(qb3_sound_w));
/* this patch prevents the sound ROM from eating itself when command $0A is sent */
/* on a cube rotate */
- machine->region("audiocpu")->base()[0x11dc] = 0x09;
+ machine.region("audiocpu")->base()[0x11dc] = 0x09;
}
diff --git a/src/mame/audio/circus.c b/src/mame/audio/circus.c
index 52f037ae3c5..1c6b28b1eaa 100644
--- a/src/mame/audio/circus.c
+++ b/src/mame/audio/circus.c
@@ -172,10 +172,10 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( circus_clown_z_w )
{
- circus_state *state = space->machine->driver_data<circus_state>();
+ circus_state *state = space->machine().driver_data<circus_state>();
state->clown_z = (data & 0x0f);
- *(space->machine->region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
+ *(space->machine().region("maincpu")->base() + 0x8000) = data; logerror("Z:%02x\n",data); //DEBUG
/* Bits 4-6 enable/disable trigger different events */
switch (state->game_id)
@@ -275,5 +275,5 @@ WRITE8_HANDLER( circus_clown_z_w )
}
/* Bit 7 enables amplifier (0 = on) */
- space->machine->sound().system_mute(data & 0x80);
+ space->machine().sound().system_mute(data & 0x80);
}
diff --git a/src/mame/audio/copsnrob.c b/src/mame/audio/copsnrob.c
index 7fcaa492730..c25e364bb37 100644
--- a/src/mame/audio/copsnrob.c
+++ b/src/mame/audio/copsnrob.c
@@ -688,8 +688,8 @@ DISCRETE_SOUND_END
WRITE8_HANDLER( copsnrob_misc_w )
{
- device_t *device = space->machine->device("discrete");
- copsnrob_state *state = space->machine->driver_data<copsnrob_state>();
+ device_t *device = space->machine().device("discrete");
+ copsnrob_state *state = space->machine().driver_data<copsnrob_state>();
UINT8 latched_data = state->ic_h3_data;
UINT8 special_data = data & 0x01;
@@ -730,12 +730,12 @@ WRITE8_HANDLER( copsnrob_misc_w )
case 0x06:
/* One Start */
- set_led_status(space->machine, 0, !special_data);
+ set_led_status(space->machine(), 0, !special_data);
break;
case 0x07:
discrete_sound_w(device, COPSNROB_AUDIO_ENABLE, special_data);
- //space->machine->sound().system_mute(special_data);
+ //space->machine().sound().system_mute(special_data);
break;
}
diff --git a/src/mame/audio/cps3.c b/src/mame/audio/cps3.c
index 5d359db6246..d458d7b0204 100644
--- a/src/mame/audio/cps3.c
+++ b/src/mame/audio/cps3.c
@@ -40,7 +40,7 @@ static STREAM_UPDATE( cps3_stream_update )
// the actual 'user5' region only exists on the nocd sets, on the others it's allocated in the initialization.
// it's a shared gfx/sound region, so can't be allocated as part of the sound device.
- state->base = (INT8*)device->machine->driver_data<cps3_state>()->user5region;
+ state->base = (INT8*)device->machine().driver_data<cps3_state>()->user5region;
/* Clear the buffers */
memset(outputs[0], 0, samples*sizeof(*outputs[0]));
@@ -114,7 +114,7 @@ static DEVICE_START( cps3_sound )
cps3_sound_state *state = get_safe_token(device);
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock() / 384, NULL, cps3_stream_update);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock() / 384, NULL, cps3_stream_update);
}
DEVICE_GET_INFO( cps3_sound )
diff --git a/src/mame/audio/cyberbal.c b/src/mame/audio/cyberbal.c
index 0c0f5a8ade6..10c1350be8f 100644
--- a/src/mame/audio/cyberbal.c
+++ b/src/mame/audio/cyberbal.c
@@ -11,16 +11,16 @@
#include "includes/cyberbal.h"
-static void update_sound_68k_interrupts(running_machine *machine);
+static void update_sound_68k_interrupts(running_machine &machine);
-void cyberbal_sound_reset(running_machine *machine)
+void cyberbal_sound_reset(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
/* reset the sound system */
- state->bank_base = &machine->region("audiocpu")->base()[0x10000];
+ state->bank_base = &machine.region("audiocpu")->base()[0x10000];
memory_set_bankptr(machine, "soundbank", &state->bank_base[0x0000]);
state->fast_68k_int = state->io_68k_int = 0;
state->sound_data_from_68k = state->sound_data_from_6502 = 0;
@@ -37,9 +37,9 @@ void cyberbal_sound_reset(running_machine *machine)
READ8_HANDLER( cyberbal_special_port3_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- int temp = input_port_read(space->machine, "JSAII");
- if (!(input_port_read(space->machine, "IN0") & 0x8000)) temp ^= 0x80;
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ int temp = input_port_read(space->machine(), "JSAII");
+ if (!(input_port_read(space->machine(), "IN0") & 0x8000)) temp ^= 0x80;
if (state->cpu_to_sound_ready) temp ^= 0x40;
if (state->sound_to_cpu_ready) temp ^= 0x20;
return temp;
@@ -48,7 +48,7 @@ READ8_HANDLER( cyberbal_special_port3_r )
READ8_HANDLER( cyberbal_sound_6502_stat_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
int temp = 0xff;
if (state->sound_data_from_6502_ready) temp ^= 0x80;
if (state->sound_data_from_68k_ready) temp ^= 0x40;
@@ -58,18 +58,18 @@ READ8_HANDLER( cyberbal_sound_6502_stat_r )
WRITE8_HANDLER( cyberbal_sound_bank_select_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- memory_set_bankptr(space->machine, "soundbank", &state->bank_base[0x1000 * ((data >> 6) & 3)]);
- coin_counter_w(space->machine, 1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 4) & 1);
- cputag_set_input_line(space->machine, "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
- if (!(data & 0x01)) devtag_reset(space->machine, "ymsnd");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ memory_set_bankptr(space->machine(), "soundbank", &state->bank_base[0x1000 * ((data >> 6) & 3)]);
+ coin_counter_w(space->machine(), 1, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 4) & 1);
+ cputag_set_input_line(space->machine(), "dac", INPUT_LINE_RESET, (data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+ if (!(data & 0x01)) devtag_reset(space->machine(), "ymsnd");
}
READ8_HANDLER( cyberbal_sound_68k_6502_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
state->sound_data_from_68k_ready = 0;
return state->sound_data_from_68k;
}
@@ -77,7 +77,7 @@ READ8_HANDLER( cyberbal_sound_68k_6502_r )
WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
state->sound_data_from_6502 = data;
state->sound_data_from_6502_ready = 1;
@@ -85,7 +85,7 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
if (!state->io_68k_int)
{
state->io_68k_int = 1;
- update_sound_68k_interrupts(space->machine);
+ update_sound_68k_interrupts(space->machine());
}
}
@@ -97,9 +97,9 @@ WRITE8_HANDLER( cyberbal_sound_68k_6502_w )
*
*************************************/
-static void update_sound_68k_interrupts(running_machine *machine)
+static void update_sound_68k_interrupts(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
cputag_set_input_line(machine, "dac", 6, state->fast_68k_int ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "dac", 2, state->io_68k_int ? ASSERT_LINE : CLEAR_LINE);
}
@@ -107,29 +107,29 @@ static void update_sound_68k_interrupts(running_machine *machine)
INTERRUPT_GEN( cyberbal_sound_68k_irq_gen )
{
- cyberbal_state *state = device->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = device->machine().driver_data<cyberbal_state>();
if (!state->fast_68k_int)
{
state->fast_68k_int = 1;
- update_sound_68k_interrupts(device->machine);
+ update_sound_68k_interrupts(device->machine());
}
}
WRITE16_HANDLER( cyberbal_io_68k_irq_ack_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
if (state->io_68k_int)
{
state->io_68k_int = 0;
- update_sound_68k_interrupts(space->machine);
+ update_sound_68k_interrupts(space->machine());
}
}
READ16_HANDLER( cyberbal_sound_68k_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
int temp = (state->sound_data_from_6502 << 8) | 0xff;
state->sound_data_from_6502_ready = 0;
@@ -142,7 +142,7 @@ READ16_HANDLER( cyberbal_sound_68k_r )
WRITE16_HANDLER( cyberbal_sound_68k_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
if (ACCESSING_BITS_8_15)
{
state->sound_data_from_68k = (data >> 8) & 0xff;
@@ -153,13 +153,13 @@ WRITE16_HANDLER( cyberbal_sound_68k_w )
WRITE16_HANDLER( cyberbal_sound_68k_dac_w )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- device_t *dac = space->machine->device((offset & 8) ? "dac2" : "dac1");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ device_t *dac = space->machine().device((offset & 8) ? "dac2" : "dac1");
dac_data_16_w(dac, (((data >> 3) & 0x800) | ((data >> 2) & 0x7ff)) << 4);
if (state->fast_68k_int)
{
state->fast_68k_int = 0;
- update_sound_68k_interrupts(space->machine);
+ update_sound_68k_interrupts(space->machine());
}
}
diff --git a/src/mame/audio/dcs.c b/src/mame/audio/dcs.c
index 89b3bc929b4..66d93556192 100644
--- a/src/mame/audio/dcs.c
+++ b/src/mame/audio/dcs.c
@@ -321,8 +321,8 @@ struct _dcs_state
UINT8 last_output_full;
UINT8 last_input_empty;
UINT16 progflags;
- void (*output_full_cb)(running_machine *, int);
- void (*input_empty_cb)(running_machine *, int);
+ void (*output_full_cb)(running_machine &, int);
+ void (*input_empty_cb)(running_machine &, int);
UINT16 (*fifo_data_r)(device_t *device);
UINT16 (*fifo_status_r)(device_t *device);
@@ -385,7 +385,7 @@ static READ16_HANDLER( dcs_dataram_r );
static WRITE16_HANDLER( dcs_dataram_w );
static WRITE16_HANDLER( dcs_data_bank_select_w );
-static void sdrc_reset(running_machine *machine);
+static void sdrc_reset(running_machine &machine);
static READ16_HANDLER( sdrc_r );
static WRITE16_HANDLER( sdrc_w );
static STATE_POSTLOAD( sdrc_postload );
@@ -413,14 +413,14 @@ static void timer_enable_callback(adsp21xx_device &device, int enable);
static TIMER_DEVICE_CALLBACK( internal_timer_callback );
static TIMER_DEVICE_CALLBACK( dcs_irq );
static TIMER_DEVICE_CALLBACK( sport0_irq );
-static void recompute_sample_rate(running_machine *machine);
+static void recompute_sample_rate(running_machine &machine);
static void sound_tx_callback(adsp21xx_device &device, int port, INT32 data);
static READ16_HANDLER( dcs_polling_r );
static WRITE16_HANDLER( dcs_polling_w );
static TIMER_DEVICE_CALLBACK( transfer_watchdog_callback );
-static int preprocess_write(running_machine *machine, UINT16 data);
+static int preprocess_write(running_machine &machine, UINT16 data);
@@ -885,7 +885,7 @@ static TIMER_CALLBACK( dcs_reset )
*
*************************************/
-static void dcs_register_state(running_machine *machine)
+static void dcs_register_state(running_machine &machine)
{
state_save_register_global_array(machine, sdrc.reg);
state_save_register_global(machine, sdrc.seed);
@@ -935,33 +935,33 @@ static void dcs_register_state(running_machine *machine)
state_save_register_global_pointer(machine, dcs_sram, 0x8000*4 / sizeof(dcs_sram[0]));
if (dcs.rev == 2)
- machine->state().register_postload(sdrc_postload, NULL);
+ machine.state().register_postload(sdrc_postload, NULL);
}
-void dcs_init(running_machine *machine)
+void dcs_init(running_machine &machine)
{
memset(&dcs, 0, sizeof(dcs));
dcs_sram = NULL;
/* find the DCS CPU and the sound ROMs */
- dcs.cpu = machine->device<adsp21xx_device>("dcs");
+ dcs.cpu = machine.device<adsp21xx_device>("dcs");
dcs.program = dcs.cpu->space(AS_PROGRAM);
dcs.data = dcs.cpu->space(AS_DATA);
dcs.rev = 1;
dcs.channels = 1;
- dcs.dmadac[0] = machine->device<dmadac_sound_device>("dac");
+ dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac");
/* configure boot and sound ROMs */
- dcs.bootrom = (UINT16 *)machine->region("dcs")->base();
- dcs.bootrom_words = machine->region("dcs")->bytes() / 2;
+ dcs.bootrom = (UINT16 *)machine.region("dcs")->base();
+ dcs.bootrom_words = machine.region("dcs")->bytes() / 2;
dcs.sounddata = dcs.bootrom;
dcs.sounddata_words = dcs.bootrom_words;
dcs.sounddata_banks = dcs.sounddata_words / 0x1000;
memory_configure_bank(machine, "databank", 0, dcs.sounddata_banks, dcs.sounddata, 0x1000*2);
/* create the timers */
- dcs.internal_timer = machine->device<timer_device>("dcs_int_timer");
- dcs.reg_timer = machine->device<timer_device>("dcs_reg_timer");
+ dcs.internal_timer = machine.device<timer_device>("dcs_int_timer");
+ dcs.reg_timer = machine.device<timer_device>("dcs_reg_timer");
/* non-RAM based automatically acks */
dcs.auto_ack = TRUE;
@@ -974,37 +974,37 @@ void dcs_init(running_machine *machine)
}
-void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
+void dcs2_init(running_machine &machine, int dram_in_mb, offs_t polling_offset)
{
int soundbank_words;
memset(&dcs, 0, sizeof(dcs));
/* find the DCS CPU and the sound ROMs */
- dcs.cpu = machine->device<adsp21xx_device>("dcs2");
+ dcs.cpu = machine.device<adsp21xx_device>("dcs2");
dcs.rev = 2;
soundbank_words = 0x1000;
if (dcs.cpu == NULL)
{
- dcs.cpu = machine->device<adsp21xx_device>("dsio");
+ dcs.cpu = machine.device<adsp21xx_device>("dsio");
dcs.rev = 3;
soundbank_words = 0x400;
}
if (dcs.cpu == NULL)
{
- dcs.cpu = machine->device<adsp21xx_device>("denver");
+ dcs.cpu = machine.device<adsp21xx_device>("denver");
dcs.rev = 4;
soundbank_words = 0x800;
}
dcs.program = dcs.cpu->space(AS_PROGRAM);
dcs.data = dcs.cpu->space(AS_DATA);
dcs.channels = 2;
- dcs.dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- dcs.dmadac[1] = machine->device<dmadac_sound_device>("dac2");
+ dcs.dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ dcs.dmadac[1] = machine.device<dmadac_sound_device>("dac2");
/* always boot from the base of "dcs" */
- dcs.bootrom = (UINT16 *)machine->region("dcs")->base();
- dcs.bootrom_words = machine->region("dcs")->bytes() / 2;
+ dcs.bootrom = (UINT16 *)machine.region("dcs")->base();
+ dcs.bootrom_words = machine.region("dcs")->bytes() / 2;
/* supports both RAM and ROM variants */
if (dram_in_mb != 0)
@@ -1025,9 +1025,9 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
dcs_sram = auto_alloc_array(machine, UINT16, 0x8000*4/2);
/* create the timers */
- dcs.internal_timer = machine->device<timer_device>("dcs_int_timer");
- dcs.reg_timer = machine->device<timer_device>("dcs_reg_timer");
- dcs.sport_timer = machine->device<timer_device>("dcs_sport_timer");
+ dcs.internal_timer = machine.device<timer_device>("dcs_int_timer");
+ dcs.reg_timer = machine.device<timer_device>("dcs_reg_timer");
+ dcs.sport_timer = machine.device<timer_device>("dcs_sport_timer");
/* we don't do auto-ack by default */
dcs.auto_ack = FALSE;
@@ -1040,7 +1040,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
/* allocate a watchdog timer for HLE transfers */
transfer.hle_enabled = (ENABLE_HLE_TRANSFERS && dram_in_mb != 0);
if (transfer.hle_enabled)
- transfer.watchdog = machine->device<timer_device>("dcs_hle_timer");
+ transfer.watchdog = machine.device<timer_device>("dcs_hle_timer");
/* register for save states */
dcs_register_state(machine);
@@ -1080,11 +1080,11 @@ static WRITE16_HANDLER( dcs_dataram_w )
static WRITE16_HANDLER( dcs_data_bank_select_w )
{
dcs.sounddata_bank = data & 0x7ff;
- memory_set_bank(space->machine, "databank", dcs.sounddata_bank % dcs.sounddata_banks);
+ memory_set_bank(space->machine(), "databank", dcs.sounddata_bank % dcs.sounddata_banks);
/* bit 11 = sound board led */
#if 0
- set_led_status(space->machine, 2, data & 0x800);
+ set_led_status(space->machine(), 2, data & 0x800);
#endif
}
@@ -1096,7 +1096,7 @@ static WRITE16_HANDLER( dcs_data_bank_select_w )
*
*************************************/
-INLINE void sdrc_update_bank_pointers(running_machine *machine)
+INLINE void sdrc_update_bank_pointers(running_machine &machine)
{
if (SDRC_SM_EN != 0)
{
@@ -1121,7 +1121,7 @@ INLINE void sdrc_update_bank_pointers(running_machine *machine)
}
-static void sdrc_remap_memory(running_machine *machine)
+static void sdrc_remap_memory(running_machine &machine)
{
/* if SRAM disabled, clean it out */
if (SDRC_SM_EN == 0)
@@ -1184,7 +1184,7 @@ static STATE_POSTLOAD( sdrc_postload )
}
-static void sdrc_reset(running_machine *machine)
+static void sdrc_reset(running_machine &machine)
{
memset(sdrc.reg, 0, sizeof(sdrc.reg));
sdrc_remap_memory(machine);
@@ -1256,9 +1256,9 @@ static WRITE16_HANDLER( sdrc_w )
case 0:
sdrc.reg[0] = data;
if (diff & 0x1833)
- sdrc_remap_memory(space->machine);
+ sdrc_remap_memory(space->machine());
if (diff & 0x0380)
- sdrc_update_bank_pointers(space->machine);
+ sdrc_update_bank_pointers(space->machine());
break;
/* offset 1 controls RAM mapping */
@@ -1266,14 +1266,14 @@ static WRITE16_HANDLER( sdrc_w )
sdrc.reg[1] = data;
// dmadac_enable(&dcs.dmadac[0], dcs.channels, SDRC_MUTE);
if (diff & 0x0003)
- sdrc_remap_memory(space->machine);
+ sdrc_remap_memory(space->machine());
break;
/* offset 2 controls paging */
case 2:
sdrc.reg[2] = data;
if (diff & 0x1fff)
- sdrc_update_bank_pointers(space->machine);
+ sdrc_update_bank_pointers(space->machine());
break;
/* offset 3 controls security */
@@ -1352,13 +1352,13 @@ static WRITE16_HANDLER( dsio_w )
dmadac_enable(&dcs.dmadac[0], dcs.channels, DSIO_MUTE);
/* bit 0 resets the FIFO */
- midway_ioasic_fifo_reset_w(space->machine, DSIO_EMPTY_FIFO ^ 1);
+ midway_ioasic_fifo_reset_w(space->machine(), DSIO_EMPTY_FIFO ^ 1);
break;
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
- memory_set_bank(space->machine, "databank", DSIO_DM_PG % dcs.sounddata_banks);
+ memory_set_bank(space->machine(), "databank", DSIO_DM_PG % dcs.sounddata_banks);
break;
}
}
@@ -1412,24 +1412,24 @@ static WRITE16_HANDLER( denver_w )
{
char buffer[10];
sprintf(buffer, "dac%d", chan + 1);
- dcs.dmadac[chan] = space->machine->device<dmadac_sound_device>(buffer);
+ dcs.dmadac[chan] = space->machine().device<dmadac_sound_device>(buffer);
}
dmadac_enable(&dcs.dmadac[0], dcs.channels, enable);
if (dcs.channels < 6)
dmadac_enable(&dcs.dmadac[dcs.channels], 6 - dcs.channels, FALSE);
- recompute_sample_rate(space->machine);
+ recompute_sample_rate(space->machine());
}
break;
/* offset 2 controls RAM pages */
case 2:
dsio.reg[2] = data;
- memory_set_bank(space->machine, "databank", DENV_DM_PG % dcs.sounddata_bank);
+ memory_set_bank(space->machine(), "databank", DENV_DM_PG % dcs.sounddata_bank);
break;
/* offset 3 controls FIFO reset */
case 3:
- midway_ioasic_fifo_reset_w(space->machine, 1);
+ midway_ioasic_fifo_reset_w(space->machine(), 1);
break;
}
}
@@ -1490,7 +1490,7 @@ READ32_HANDLER( dsio_idma_data_r )
DCS COMMUNICATIONS
****************************************************************************/
-void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int))
+void dcs_set_io_callbacks(void (*output_full_cb)(running_machine &, int), void (*input_empty_cb)(running_machine &, int))
{
dcs.input_empty_cb = input_empty_cb;
dcs.output_full_cb = output_full_cb;
@@ -1508,7 +1508,7 @@ int dcs_control_r(void)
{
/* only boost for DCS2 boards */
if (!dcs.auto_ack && !transfer.hle_enabled)
- dcs.cpu->machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
+ dcs.cpu->machine().scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
return dcs.latch_control;
}
@@ -1518,10 +1518,10 @@ void dcs_reset_w(int state)
/* going high halts the CPU */
if (state)
{
- logerror("%s: DCS reset = %d\n", dcs.cpu->machine->describe_context(), state);
+ logerror("%s: DCS reset = %d\n", dcs.cpu->machine().describe_context(), state);
/* just run through the init code again */
- dcs.cpu->machine->scheduler().synchronize(FUNC(dcs_reset));
+ dcs.cpu->machine().scheduler().synchronize(FUNC(dcs_reset));
device_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
@@ -1560,13 +1560,13 @@ static READ16_HANDLER( fifo_input_r )
INPUT LATCH (data from host to DCS)
****************************************************************************/
-static void dcs_delayed_data_w(running_machine *machine, int data)
+static void dcs_delayed_data_w(running_machine &machine, int data)
{
if (LOG_DCS_IO)
- logerror("%s:dcs_data_w(%04X)\n", machine->describe_context(), data);
+ logerror("%s:dcs_data_w(%04X)\n", machine.describe_context(), data);
/* boost the interleave temporarily */
- machine->scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
+ machine.scheduler().boost_interleave(attotime::from_nsec(500), attotime::from_usec(5));
/* set the IRQ line on the ADSP */
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, ASSERT_LINE);
@@ -1590,21 +1590,21 @@ static TIMER_CALLBACK( dcs_delayed_data_w_callback )
void dcs_data_w(int data)
{
/* preprocess the write */
- if (preprocess_write(dcs.cpu->machine, data))
+ if (preprocess_write(dcs.cpu->machine(), data))
return;
/* if we are DCS1, set a timer to latch the data */
if (dcs.sport_timer == NULL)
- dcs.cpu->machine->scheduler().synchronize(FUNC(dcs_delayed_data_w_callback), data);
+ dcs.cpu->machine().scheduler().synchronize(FUNC(dcs_delayed_data_w_callback), data);
else
- dcs_delayed_data_w(dcs.cpu->machine, data);
+ dcs_delayed_data_w(dcs.cpu->machine(), data);
}
static WRITE16_HANDLER( input_latch_ack_w )
{
if (!dcs.last_input_empty && dcs.input_empty_cb)
- (*dcs.input_empty_cb)(space->machine, dcs.last_input_empty = 1);
+ (*dcs.input_empty_cb)(space->machine(), dcs.last_input_empty = 1);
SET_INPUT_EMPTY();
device_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
}
@@ -1638,7 +1638,7 @@ static WRITE16_HANDLER( output_latch_w )
{
if (LOG_DCS_IO)
logerror("%08X:output_latch_w(%04X) (empty=%d)\n", cpu_get_pc(space->cpu), data, IS_OUTPUT_EMPTY());
- space->machine->scheduler().synchronize(FUNC(latch_delayed_w), data);
+ space->machine().scheduler().synchronize(FUNC(latch_delayed_w), data);
}
@@ -1656,7 +1656,7 @@ static TIMER_CALLBACK( delayed_ack_w_callback )
void dcs_ack_w(void)
{
- dcs.cpu->machine->scheduler().synchronize(FUNC(delayed_ack_w_callback));
+ dcs.cpu->machine().scheduler().synchronize(FUNC(delayed_ack_w_callback));
}
@@ -1664,12 +1664,12 @@ int dcs_data_r(void)
{
/* data is actually only 8 bit (read from d8-d15) */
if (dcs.last_output_full && dcs.output_full_cb)
- (*dcs.output_full_cb)(dcs.cpu->machine, dcs.last_output_full = 0);
+ (*dcs.output_full_cb)(dcs.cpu->machine(), dcs.last_output_full = 0);
if (dcs.auto_ack)
delayed_ack_w();
if (LOG_DCS_IO)
- logerror("%s:dcs_data_r(%04X)\n", dcs.cpu->machine->describe_context(), dcs.output_data);
+ logerror("%s:dcs_data_r(%04X)\n", dcs.cpu->machine().describe_context(), dcs.output_data);
return dcs.output_data;
}
@@ -1692,7 +1692,7 @@ static WRITE16_HANDLER( output_control_w )
{
if (LOG_DCS_IO)
logerror("%04X:output_control = %04X\n", cpu_get_pc(space->cpu), data);
- space->machine->scheduler().synchronize(FUNC(output_control_delayed_w), data);
+ space->machine().scheduler().synchronize(FUNC(output_control_delayed_w), data);
}
@@ -1716,7 +1716,7 @@ int dcs_data2_r(void)
*
*************************************/
-static void update_timer_count(running_machine *machine)
+static void update_timer_count(running_machine &machine)
{
UINT64 periods_since_start;
UINT64 elapsed_cycles;
@@ -1765,7 +1765,7 @@ static TIMER_DEVICE_CALLBACK( internal_timer_callback )
}
-static void reset_timer(running_machine *machine)
+static void reset_timer(running_machine &machine)
{
/* if not enabled, skip */
if (!dcs.timer_enable)
@@ -1804,7 +1804,7 @@ static void timer_enable_callback(adsp21xx_device &device, int enable)
if (enable)
{
// mame_printf_debug("Timer enabled @ %d cycles/int, or %f Hz\n", dcs.timer_scale * (dcs.timer_period + 1), 1.0 / dcs.cpu->cycles_to_attotime(dcs.timer_scale * (dcs.timer_period + 1)));
- reset_timer(device.machine);
+ reset_timer(device.machine());
}
else
{
@@ -1855,7 +1855,7 @@ static READ16_HANDLER( adsp_control_r )
break;
case TIMER_COUNT_REG:
- update_timer_count(space->machine);
+ update_timer_count(space->machine());
result = dcs.control_regs[offset];
break;
@@ -1911,23 +1911,23 @@ static WRITE16_HANDLER( adsp_control_w )
data = (data & 0xff) + 1;
if (data != dcs.timer_scale)
{
- update_timer_count(space->machine);
+ update_timer_count(space->machine());
dcs.timer_scale = data;
- reset_timer(space->machine);
+ reset_timer(space->machine());
}
break;
case TIMER_COUNT_REG:
dcs.timer_start_count = data;
- reset_timer(space->machine);
+ reset_timer(space->machine());
break;
case TIMER_PERIOD_REG:
if (data != dcs.timer_period)
{
- update_timer_count(space->machine);
+ update_timer_count(space->machine());
dcs.timer_period = data;
- reset_timer(space->machine);
+ reset_timer(space->machine());
}
break;
@@ -1992,7 +1992,7 @@ static TIMER_DEVICE_CALLBACK( sport0_irq )
}
-static void recompute_sample_rate(running_machine *machine)
+static void recompute_sample_rate(running_machine &machine)
{
/* calculate how long until we generate an interrupt */
@@ -2050,7 +2050,7 @@ static void sound_tx_callback(adsp21xx_device &device, int port, INT32 data)
dcs.ireg_base = source;
/* recompute the sample rate and timer */
- recompute_sample_rate(device.machine);
+ recompute_sample_rate(device.machine());
return;
}
else
@@ -2104,7 +2104,7 @@ void dcs_fifo_notify(int count, int max)
if (transfer.state != 5 || transfer.fifo_entries == transfer.writes_left || transfer.fifo_entries >= 256)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
- preprocess_write(dcs.cpu->machine, (*dcs.fifo_data_r)(dcs.cpu));
+ preprocess_write(dcs.cpu->machine(), (*dcs.fifo_data_r)(dcs.cpu));
}
}
@@ -2116,7 +2116,7 @@ static TIMER_DEVICE_CALLBACK( transfer_watchdog_callback )
if (transfer.fifo_entries && starting_writes_left == transfer.writes_left)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
- preprocess_write(timer.machine, (*dcs.fifo_data_r)(dcs.cpu));
+ preprocess_write(timer.machine(), (*dcs.fifo_data_r)(dcs.cpu));
}
if (transfer.watchdog != NULL)
transfer.watchdog->adjust(attotime::from_msec(1), transfer.writes_left);
@@ -2128,7 +2128,7 @@ static TIMER_CALLBACK( s1_ack_callback2 )
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
return;
}
output_latch_w(dcs.cpu->memory().space(AS_PROGRAM), 0, 0x000a, 0xffff);
@@ -2140,17 +2140,17 @@ static TIMER_CALLBACK( s1_ack_callback1 )
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
return;
}
output_latch_w(dcs.cpu->memory().space(AS_PROGRAM), 0, param, 0xffff);
/* chain to the next word we need to write back */
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
}
-static int preprocess_stage_1(running_machine *machine, UINT16 data)
+static int preprocess_stage_1(running_machine &machine, UINT16 data)
{
switch (transfer.state)
{
@@ -2159,7 +2159,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
if (data == 0x001a)
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:DCS Transfer command %04X\n", machine->describe_context(), data);
+ logerror("%s:DCS Transfer command %04X\n", machine.describe_context(), data);
transfer.state++;
if (transfer.hle_enabled)
return 1;
@@ -2169,7 +2169,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
else if (data == 0x002a)
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:DCS State change %04X\n", machine->describe_context(), data);
+ logerror("%s:DCS State change %04X\n", machine.describe_context(), data);
transfer.dcs_state = 1;
}
@@ -2262,7 +2262,7 @@ static int preprocess_stage_1(running_machine *machine, UINT16 data)
/* if we're done, start a timer to send the response words */
if (transfer.state == 0)
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), transfer.sum);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), transfer.sum);
return 1;
}
break;
@@ -2278,7 +2278,7 @@ static TIMER_CALLBACK( s2_ack_callback )
/* if the output is full, stall for a usec */
if (IS_OUTPUT_FULL())
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), param);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), param);
return;
}
output_latch_w(space, 0, param, 0xffff);
@@ -2286,7 +2286,7 @@ static TIMER_CALLBACK( s2_ack_callback )
}
-static int preprocess_stage_2(running_machine *machine, UINT16 data)
+static int preprocess_stage_2(running_machine &machine, UINT16 data)
{
switch (transfer.state)
{
@@ -2295,7 +2295,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
if (data == 0x55d0 || data == 0x55d1)
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:DCS Transfer command %04X\n", machine->describe_context(), data);
+ logerror("%s:DCS Transfer command %04X\n", machine.describe_context(), data);
transfer.state++;
if (transfer.hle_enabled)
return 1;
@@ -2305,7 +2305,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
else
{
if (LOG_DCS_TRANSFERS)
- logerror("%s:Command: %04X\n", machine->describe_context(), data);
+ logerror("%s:Command: %04X\n", machine.describe_context(), data);
}
break;
@@ -2375,7 +2375,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
/* if we're done, start a timer to send the response words */
if (transfer.state == 0)
{
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), transfer.sum);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s2_ack_callback), transfer.sum);
transfer.watchdog->reset();
}
return 1;
@@ -2386,7 +2386,7 @@ static int preprocess_stage_2(running_machine *machine, UINT16 data)
}
-static int preprocess_write(running_machine *machine, UINT16 data)
+static int preprocess_write(running_machine &machine, UINT16 data)
{
int result;
diff --git a/src/mame/audio/dcs.h b/src/mame/audio/dcs.h
index 0066598a7dd..ae65cedd1ee 100644
--- a/src/mame/audio/dcs.h
+++ b/src/mame/audio/dcs.h
@@ -12,12 +12,12 @@ MACHINE_CONFIG_EXTERN( dcs2_audio_2104 );
MACHINE_CONFIG_EXTERN( dcs2_audio_dsio );
MACHINE_CONFIG_EXTERN( dcs2_audio_denver );
-void dcs_init(running_machine *machine);
-void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset);
+void dcs_init(running_machine &machine);
+void dcs2_init(running_machine &machine, int dram_in_mb, offs_t polling_offset);
void dcs_set_auto_ack(int state);
void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(device_t *device), UINT16 (*fifo_status_r)(device_t *device));
-void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int));
+void dcs_set_io_callbacks(void (*output_full_cb)(running_machine &, int), void (*input_empty_cb)(running_machine &, int));
int dcs_data_r(void);
void dcs_ack_w(void);
diff --git a/src/mame/audio/depthch.c b/src/mame/audio/depthch.c
index 1ba5cac8567..325dac17afc 100644
--- a/src/mame/audio/depthch.c
+++ b/src/mame/audio/depthch.c
@@ -56,7 +56,7 @@ enum
WRITE8_HANDLER( depthch_audio_w )
{
static int port1State = 0;
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
int bitsGoneHigh;
int bitsGoneLow;
diff --git a/src/mame/audio/dkong.c b/src/mame/audio/dkong.c
index ccfc0dd4111..77484d45b61 100644
--- a/src/mame/audio/dkong.c
+++ b/src/mame/audio/dkong.c
@@ -1114,9 +1114,9 @@ DISCRETE_SOUND_END
static SOUND_START( dkong)
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
- state->snd_rom = machine->region("soundcpu")->base();
+ state->snd_rom = machine.region("soundcpu")->base();
}
@@ -1244,7 +1244,7 @@ static READ8_DEVICE_HANDLER( dkong_voice_status_r )
static READ8_DEVICE_HANDLER( dkong_tune_r )
{
- dkong_state *state = device->machine->driver_data<dkong_state>();
+ dkong_state *state = device->machine().driver_data<dkong_state>();
UINT8 page = latch8_r(state->dev_vp2, 0) & 0x47;
if ( page & 0x40 )
@@ -1253,7 +1253,7 @@ static READ8_DEVICE_HANDLER( dkong_tune_r )
}
else
{
- /* printf("%s:rom access\n",device->machine->describe_context()); */
+ /* printf("%s:rom access\n",device->machine().describe_context()); */
return (state->snd_rom[0x1000 + (page & 7) * 256 + offset]);
}
}
@@ -1273,9 +1273,9 @@ static WRITE8_DEVICE_HANDLER( dkong_p1_w )
WRITE8_HANDLER( dkong_audio_irq_w )
{
if (data)
- cputag_set_input_line(space->machine, "soundcpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE);
}
diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c
index 09307278a6e..5ab0edd60c7 100644
--- a/src/mame/audio/exidy.c
+++ b/src/mame/audio/exidy.c
@@ -132,7 +132,7 @@ INLINE exidy_sound_state *get_safe_token(device_t *device)
static WRITE_LINE_DEVICE_HANDLER( update_irq_state )
{
exidy_sound_state *sndstate = get_safe_token(device);
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(sndstate->pia1) | sndstate->riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, (pia6821_get_irq_b(sndstate->pia1) | sndstate->riot_irq_state) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -401,8 +401,8 @@ static DEVICE_START( common_sh_start )
state->sh6840_clocks_per_sample = (int)((double)SH6840_CLOCK / (double)sample_rate * (double)(1 << 24));
/* allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, sample_rate, NULL, exidy_stream_update);
- state->maincpu = device->machine->device("maincpu");
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, sample_rate, NULL, exidy_stream_update);
+ state->maincpu = device->machine().device("maincpu");
sh6840_register_state_globals(device);
}
@@ -491,11 +491,11 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
{
exidy_sound_state *state = get_safe_token(device);
if (state->cvsd != NULL)
- cputag_set_input_line(device->machine, "cvsdcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "cvsdcpu", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
if (state->tms != NULL)
{
- logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine->time().as_double(), device->machine->describe_context(), riot6532_porta_out_get(state->riot));
+ logerror("(%f)%s:TMS5220 data write = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), riot6532_porta_out_get(state->riot));
tms5220_data_w(state->tms, 0, data);
}
}
@@ -505,7 +505,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
exidy_sound_state *state = get_safe_token(device);
if (state->tms != NULL)
{
- logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine->time().as_double(), device->machine->describe_context(), tms5220_status_r(state->tms, 0));
+ logerror("(%f)%s:TMS5220 status read = %02X\n", device->machine().time().as_double(), device->machine().describe_context(), tms5220_status_r(state->tms, 0));
return tms5220_status_r(state->tms, 0);
}
else
@@ -802,18 +802,18 @@ static const pia6821_interface venture_pia1_intf =
static DEVICE_START( venture_common_sh_start )
{
exidy_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
DEVICE_START_CALL(common_sh_start);
- state->riot = machine->device("riot");
+ state->riot = machine.device("riot");
state->has_sh8253 = TRUE;
state->tms = NULL;
- state->pia1 = device->machine->device("pia1");
+ state->pia1 = device->machine().device("pia1");
/* determine which sound hardware is installed */
- state->cvsd = device->machine->device("cvsd");
+ state->cvsd = device->machine().device("cvsd");
/* 8253 */
state->freq_to_step = (double)(1 << 24) / (double)SH8253_CLOCK;
@@ -836,8 +836,8 @@ static DEVICE_RESET( venture_sound )
DEVICE_RESET_CALL(common_sh_reset);
/* PIA */
- devtag_reset(device->machine, "pia0");
- devtag_reset(device->machine, "pia1");
+ devtag_reset(device->machine(), "pia0");
+ devtag_reset(device->machine(), "pia1");
/* 6532 */
state->riot->reset();
@@ -1008,7 +1008,7 @@ WRITE8_DEVICE_HANDLER( victory_sound_command_w )
if (VICTORY_LOG_SOUND) logerror("%04X:!!!! Sound command = %02X\n", cpu_get_previouspc(state->maincpu), data);
- device->machine->scheduler().synchronize(FUNC(delayed_command_w), data, state->pia1);
+ device->machine().scheduler().synchronize(FUNC(delayed_command_w), data, state->pia1);
}
@@ -1016,7 +1016,7 @@ static WRITE8_DEVICE_HANDLER( victory_sound_irq_clear_w )
{
exidy_sound_state *state = get_safe_token(device);
- if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", device->machine->describe_context(), data);
+ if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound IRQ clear = %02X\n", device->machine().describe_context(), data);
if (!data) pia6821_ca1_w(state->pia1, 1);
}
@@ -1026,7 +1026,7 @@ static WRITE8_DEVICE_HANDLER( victory_main_ack_w )
{
exidy_sound_state *state = get_safe_token(device);
- if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", device->machine->describe_context(), data);
+ if (VICTORY_LOG_SOUND) logerror("%s:!!!! Sound Main ACK W = %02X\n", device->machine().describe_context(), data);
if (state->victory_sound_response_ack_clk && !data)
pia6821_cb1_w(state->pia1, 1);
@@ -1060,7 +1060,7 @@ static DEVICE_START( victory_sound )
device->save_item(NAME(state->victory_sound_response_ack_clk));
DEVICE_START_CALL(venture_common_sh_start);
- state->tms = device->machine->device("tms");
+ state->tms = device->machine().device("tms");
}
diff --git a/src/mame/audio/exidy440.c b/src/mame/audio/exidy440.c
index 7ac9ebff735..b0c9de7f3df 100644
--- a/src/mame/audio/exidy440.c
+++ b/src/mame/audio/exidy440.c
@@ -110,12 +110,12 @@ static const int channel_bits[4] =
/* function prototypes */
static STREAM_UPDATE( channel_update );
static void m6844_finished(int ch);
-static void play_cvsd(running_machine *machine, int ch);
+static void play_cvsd(running_machine &machine, int ch);
static void stop_cvsd(int ch);
static void reset_sound_cache(void);
static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits, int frequency);
-static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address, int length, int bits, int frequency);
+static INT16 *find_or_add_to_sound_cache(running_machine &machine, int address, int length, int bits, int frequency);
static void decode_and_filter_cvsd(UINT8 *data, int bytes, int maskbits, int frequency, INT16 *dest);
static void fir_filter(INT32 *input, INT16 *output, int count);
@@ -130,7 +130,7 @@ static void fir_filter(INT32 *input, INT16 *output, int count);
static DEVICE_START( exidy440_sound )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, length;
/* reset the system */
@@ -159,10 +159,10 @@ static DEVICE_START( exidy440_sound )
channel_frequency[3] = device->clock()/2;
/* get stream channels */
- stream = device->machine->sound().stream_alloc(*device, 0, 2, device->clock(), NULL, channel_update);
+ stream = device->machine().sound().stream_alloc(*device, 0, 2, device->clock(), NULL, channel_update);
/* allocate the sample cache */
- length = machine->region("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
+ length = machine.region("cvsd")->bytes() * 16 + MAX_CACHE_ENTRIES * sizeof(sound_cache_entry);
sound_cache = (sound_cache_entry *)auto_alloc_array(machine, UINT8, length);
/* determine the hard end of the cache and reset */
@@ -336,14 +336,14 @@ static STREAM_UPDATE( channel_update )
static READ8_HANDLER( sound_command_r )
{
/* clear the FIRQ that got us here and acknowledge the read to the main CPU */
- cputag_set_input_line(space->machine, "audiocpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 1, CLEAR_LINE);
sound_command_ack = 1;
return sound_command;
}
-void exidy440_sound_command(running_machine *machine, UINT8 param)
+void exidy440_sound_command(running_machine &machine, UINT8 param)
{
sound_command = param;
sound_command_ack = 0;
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( sound_volume_w )
static WRITE8_HANDLER( sound_interrupt_clear_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
@@ -584,7 +584,7 @@ static WRITE8_HANDLER( m6844_w )
m6844_channel[i].start_counter = m6844_channel[i].counter;
/* generate and play the sample */
- play_cvsd(space->machine, i);
+ play_cvsd(space->machine(), i);
}
/* if we're going inactive... */
@@ -655,7 +655,7 @@ static INT16 *add_to_sound_cache(UINT8 *input, int address, int length, int bits
}
-static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address, int length, int bits, int frequency)
+static INT16 *find_or_add_to_sound_cache(running_machine &machine, int address, int length, int bits, int frequency)
{
sound_cache_entry *current;
@@ -663,7 +663,7 @@ static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address,
if (current->address == address && current->length == length && current->bits == bits && current->frequency == frequency)
return current->data;
- return add_to_sound_cache(&machine->region("cvsd")->base()[address], address, length, bits, frequency);
+ return add_to_sound_cache(&machine.region("cvsd")->base()[address], address, length, bits, frequency);
}
@@ -674,7 +674,7 @@ static INT16 *find_or_add_to_sound_cache(running_machine *machine, int address,
*
*************************************/
-static void play_cvsd(running_machine *machine, int ch)
+static void play_cvsd(running_machine &machine, int ch)
{
sound_channel_data *channel = &sound_channel[ch];
int address = m6844_channel[ch].address;
diff --git a/src/mame/audio/exidy440.h b/src/mame/audio/exidy440.h
index bee7f376d0b..15339153cb4 100644
--- a/src/mame/audio/exidy440.h
+++ b/src/mame/audio/exidy440.h
@@ -1,4 +1,4 @@
-void exidy440_sound_command(running_machine *machine, UINT8 param);
+void exidy440_sound_command(running_machine &machine, UINT8 param);
UINT8 exidy440_sound_command_ack(void);
MACHINE_CONFIG_EXTERN( exidy440_audio );
diff --git a/src/mame/audio/firetrk.c b/src/mame/audio/firetrk.c
index 88807617976..7703aae19f7 100644
--- a/src/mame/audio/firetrk.c
+++ b/src/mame/audio/firetrk.c
@@ -11,7 +11,7 @@
WRITE8_DEVICE_HANDLER( firetrk_skid_reset_w )
{
- firetrk_state *state = device->machine->driver_data<firetrk_state>();
+ firetrk_state *state = device->machine().driver_data<firetrk_state>();
state->skid[0] = 0;
state->skid[1] = 0;
diff --git a/src/mame/audio/flower.c b/src/mame/audio/flower.c
index d8f9f501a44..d744b934a52 100644
--- a/src/mame/audio/flower.c
+++ b/src/mame/audio/flower.c
@@ -68,7 +68,7 @@ static void make_mixer_table(device_t *device, int voices, int gain)
int i;
/* allocate memory */
- state->mixer_table = auto_alloc_array(device->machine, INT16, 256 * voices);
+ state->mixer_table = auto_alloc_array(device->machine(), INT16, 256 * voices);
/* find the middle of the table */
state->mixer_lookup = state->mixer_table + (128 * voices);
@@ -166,15 +166,15 @@ static STREAM_UPDATE( flower_update_mono )
static DEVICE_START( flower_sound )
{
flower_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
sound_channel *voice;
int i;
/* get stream channels */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, samplerate, 0, flower_update_mono);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, samplerate, 0, flower_update_mono);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
- state->mixer_buffer = auto_alloc_array(device->machine, short, 2 * samplerate);
+ state->mixer_buffer = auto_alloc_array(device->machine(), short, 2 * samplerate);
state->mixer_buffer_2 = state->mixer_buffer + samplerate;
/* build the mixer table */
@@ -184,8 +184,8 @@ static DEVICE_START( flower_sound )
state->num_voices = 8;
state->last_channel = state->channel_list + state->num_voices;
- state->sound_rom1 = machine->region("sound1")->base();
- state->sound_rom2 = machine->region("sound2")->base();
+ state->sound_rom1 = machine.region("sound1")->base();
+ state->sound_rom2 = machine.region("sound2")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;
diff --git a/src/mame/audio/geebee.c b/src/mame/audio/geebee.c
index 41d1c966a67..5c1af8bd050 100644
--- a/src/mame/audio/geebee.c
+++ b/src/mame/audio/geebee.c
@@ -129,7 +129,7 @@ static STREAM_UPDATE( geebee_sound_update )
static DEVICE_START( geebee_sound )
{
geebee_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i;
state->decay = auto_alloc_array(machine, UINT16, 32768);
@@ -138,10 +138,10 @@ static DEVICE_START( geebee_sound )
state->decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
/* 1V = HSYNC = 18.432MHz / 3 / 2 / 384 = 8000Hz */
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, 18432000 / 3 / 2 / 384, NULL, geebee_sound_update);
state->vcount = 0;
- state->volume_timer = machine->scheduler().timer_alloc(FUNC(volume_decay), state);
+ state->volume_timer = machine.scheduler().timer_alloc(FUNC(volume_decay), state);
}
DEVICE_GET_INFO( geebee_sound )
diff --git a/src/mame/audio/gomoku.c b/src/mame/audio/gomoku.c
index e72a239150a..83b30a3b163 100644
--- a/src/mame/audio/gomoku.c
+++ b/src/mame/audio/gomoku.c
@@ -69,7 +69,7 @@ static void make_mixer_table(device_t *device, int voices, int gain)
int i;
/* allocate memory */
- state->mixer_table = auto_alloc_array(device->machine, INT16, 256 * voices);
+ state->mixer_table = auto_alloc_array(device->machine(), INT16, 256 * voices);
/* find the middle of the table */
state->mixer_lookup = state->mixer_table + (128 * voices);
@@ -174,12 +174,12 @@ static STREAM_UPDATE( gomoku_update_mono )
static DEVICE_START( gomoku_sound )
{
gomoku_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
sound_channel *voice;
int ch;
/* get stream channels */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, samplerate, NULL, gomoku_update_mono);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, samplerate, NULL, gomoku_update_mono);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
state->mixer_buffer = auto_alloc_array(machine, short, 2 * samplerate);
@@ -192,7 +192,7 @@ static DEVICE_START( gomoku_sound )
state->num_voices = MAX_VOICES;
state->last_channel = state->channel_list + state->num_voices;
- state->sound_rom = machine->region("gomoku")->base();
+ state->sound_rom = machine.region("gomoku")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;
diff --git a/src/mame/audio/gorf.c b/src/mame/audio/gorf.c
index 78c0d6b845a..ebee3d46b8d 100644
--- a/src/mame/audio/gorf.c
+++ b/src/mame/audio/gorf.c
@@ -116,7 +116,7 @@ static int plural = 0;
READ8_HANDLER( gorf_speech_r )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int Phoneme,Intonation;
int i = 0;
@@ -182,6 +182,6 @@ READ8_HANDLER( gorf_speech_r )
CUSTOM_INPUT( gorf_speech_status_r )
{
- device_t *samples = field->port->machine->device("samples");
+ device_t *samples = field->port->machine().device("samples");
return !sample_playing(samples, 0);
}
diff --git a/src/mame/audio/gottlieb.c b/src/mame/audio/gottlieb.c
index ffc76c7e6ef..73a1a6bb696 100644
--- a/src/mame/audio/gottlieb.c
+++ b/src/mame/audio/gottlieb.c
@@ -43,7 +43,7 @@ static void trigger_sample(device_t *samples, UINT8 data);
WRITE8_HANDLER( gottlieb_sh_w )
{
- device_t *riot = space->machine->device("riot");
+ device_t *riot = space->machine().device("riot");
/* identify rev1 boards by the presence of a 6532 RIOT device */
if (riot != NULL)
@@ -62,7 +62,7 @@ WRITE8_HANDLER( gottlieb_sh_w )
static void gottlieb1_sh_w(device_t *riot, UINT8 data)
{
- device_t *samples = riot->machine->device("samples");
+ device_t *samples = riot->machine().device("samples");
int pa7 = (data & 0x0f) != 0xf;
int pa0_5 = ~data & 0x3f;
@@ -84,14 +84,14 @@ static void gottlieb1_sh_w(device_t *riot, UINT8 data)
static WRITE_LINE_DEVICE_HANDLER( snd_interrupt )
{
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, state);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, state);
}
static WRITE8_DEVICE_HANDLER( r6532_portb_w )
{
/* unsure if this is ever used, but the NMI is connected to the RIOT's PB7 */
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -131,9 +131,9 @@ static void play_sample(device_t *samples, const char *phonemes)
static void trigger_sample(device_t *samples, UINT8 data)
{
- gottlieb_state *state = samples->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = samples->machine().driver_data<gottlieb_state>();
/* Reactor samples */
- if (strcmp(samples->machine->system().name, "reactor") == 0)
+ if (strcmp(samples->machine().system().name, "reactor") == 0)
{
switch (data)
{
@@ -183,10 +183,10 @@ static void trigger_sample(device_t *samples, UINT8 data)
#ifdef UNUSED_FUNCTION
-void gottlieb_knocker(running_machine *machine)
+void gottlieb_knocker(running_machine &machine)
{
- device_t *samples = space->machine->device("samples");
- if (!strcmp(machine->system().name,"reactor")) /* reactor */
+ device_t *samples = space->machine().device("samples");
+ if (!strcmp(machine.system().name,"reactor")) /* reactor */
{
}
else if (samples != NULL) /* qbert */
@@ -211,7 +211,7 @@ static TIMER_CALLBACK( gottlieb_nmi_generate )
static WRITE8_HANDLER( vortrax_data_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
static const char *const PhonemeTable[0x40] =
{
"EH3", "EH2", "EH1", "PA0", "DT" , "A1" , "A2" , "ZH",
@@ -234,7 +234,7 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem
{
if (state->votrax_queuepos > 1)
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int last = -1;
int i;
char phonemes[200];
@@ -262,12 +262,12 @@ logerror("Votrax: intonation %d, phoneme %02x %s\n",data >> 6,data & 0x3f,Phonem
}
/* generate a NMI after a while to make the CPU continue to send data */
- space->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(gottlieb_nmi_generate));
+ space->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(gottlieb_nmi_generate));
}
static WRITE8_HANDLER( speech_clock_dac_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
if (data != state->last)
mame_printf_debug("clock = %02X\n", data);
state->last = data;
@@ -282,7 +282,7 @@ state->last = data;
static SOUND_START( gottlieb1 )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->score_sample = 7;
state->random_offset = 0;
@@ -362,7 +362,7 @@ INPUT_PORTS_END
static void gottlieb2_sh_w(address_space *space, UINT8 data)
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* when data is not 0xff, the transparent latch at A3 allows it to pass through unmolested */
if (data != 0xff)
{
@@ -373,8 +373,8 @@ static void gottlieb2_sh_w(address_space *space, UINT8 data)
/* if the previous data was 0xff, clock an IRQ on each */
if (state->last_command == 0xff)
{
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, ASSERT_LINE);
- cputag_set_input_line(space->machine, "speech", M6502_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "speech", M6502_IRQ_LINE, ASSERT_LINE);
}
}
state->last_command = data;
@@ -383,22 +383,22 @@ static void gottlieb2_sh_w(address_space *space, UINT8 data)
static READ8_HANDLER( speech_data_r )
{
- cputag_set_input_line(space->machine, "speech", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "speech", M6502_IRQ_LINE, CLEAR_LINE);
return soundlatch_r(space, offset);
}
static READ8_HANDLER( audio_data_r )
{
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
return soundlatch2_r(space, offset);
}
static WRITE8_HANDLER( signal_audio_nmi_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
}
@@ -409,17 +409,17 @@ static WRITE8_HANDLER( signal_audio_nmi_w )
*
*************************************/
-INLINE void nmi_timer_adjust(running_machine *machine)
+INLINE void nmi_timer_adjust(running_machine &machine)
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* adjust timer to go off in the future based on the current rate */
state->nmi_timer->adjust(attotime::from_hz(SOUND2_CLOCK/16) * (256 * (256 - state->nmi_rate)));
}
-INLINE void nmi_state_update(running_machine *machine)
+INLINE void nmi_state_update(running_machine &machine)
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* update the NMI line state based on the enable and state */
cputag_set_input_line(machine, "speech", INPUT_LINE_NMI, (state->nmi_state && (state->speech_control & 1)) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -427,7 +427,7 @@ INLINE void nmi_state_update(running_machine *machine)
static TIMER_CALLBACK( nmi_clear )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* clear the NMI state and update it */
state->nmi_state = 0;
nmi_state_update(machine);
@@ -436,13 +436,13 @@ static TIMER_CALLBACK( nmi_clear )
static TIMER_CALLBACK( nmi_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* assert the NMI if it is not disabled */
state->nmi_state = 1;
nmi_state_update(machine);
/* set a timer to turn it off again on hte next SOUND_CLOCK/16 */
- machine->scheduler().timer_set(attotime::from_hz(SOUND2_CLOCK/16), FUNC(nmi_clear));
+ machine.scheduler().timer_set(attotime::from_hz(SOUND2_CLOCK/16), FUNC(nmi_clear));
/* adjust the NMI timer for the next time */
nmi_timer_adjust(machine);
@@ -451,7 +451,7 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( nmi_rate_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* the new rate is picked up when the previous timer expires */
state->nmi_rate = data;
}
@@ -466,13 +466,13 @@ static WRITE8_HANDLER( nmi_rate_w )
static CUSTOM_INPUT( speech_drq_custom_r )
{
- return sp0250_drq_r(field->port->machine->device("spsnd"));
+ return sp0250_drq_r(field->port->machine().device("spsnd"));
}
static WRITE8_DEVICE_HANDLER( gottlieb_dac_w )
{
- gottlieb_state *state = device->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = device->machine().driver_data<gottlieb_state>();
/* dual DAC; the first DAC serves as the reference voltage for the
second, effectively scaling the output */
state->dac_data[offset] = data;
@@ -482,12 +482,12 @@ static WRITE8_DEVICE_HANDLER( gottlieb_dac_w )
static WRITE8_HANDLER( speech_control_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
UINT8 previous = state->speech_control;
state->speech_control = data;
/* bit 0 enables/disables the NMI line */
- nmi_state_update(space->machine);
+ nmi_state_update(space->machine());
/* bit 1 controls a LED on the sound board */
@@ -496,7 +496,7 @@ static WRITE8_HANDLER( speech_control_w )
{
/* bit 3 selects which of the two 8913 to enable */
/* bit 4 goes to the 8913 BC1 pin */
- device_t *ay = space->machine->device((data & 0x08) ? "ay1" : "ay2");
+ device_t *ay = space->machine().device((data & 0x08) ? "ay1" : "ay2");
ay8910_data_address_w(ay, data >> 4, *state->psg_latch);
}
@@ -505,13 +505,13 @@ static WRITE8_HANDLER( speech_control_w )
/* bit 6 = speech chip DATA PRESENT pin; high then low to make the chip read data */
if ((previous & 0x40) == 0 && (data & 0x40) != 0)
{
- device_t *sp = space->machine->device("spsnd");
+ device_t *sp = space->machine().device("spsnd");
sp0250_w(sp, 0, *state->sp0250_latch);
}
/* bit 7 goes to the speech chip RESET pin */
if ((previous ^ data) & 0x80)
- space->machine->device("spsnd")->reset();
+ space->machine().device("spsnd")->reset();
}
@@ -524,9 +524,9 @@ static WRITE8_HANDLER( speech_control_w )
static SOUND_START( gottlieb2 )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* set up the NMI timer */
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(nmi_callback));
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(nmi_callback));
state->nmi_rate = 0;
nmi_timer_adjust(machine);
diff --git a/src/mame/audio/gotya.c b/src/mame/audio/gotya.c
index 0504d69fc73..2577ade958e 100644
--- a/src/mame/audio/gotya.c
+++ b/src/mame/audio/gotya.c
@@ -41,7 +41,7 @@ static const struct gotya_sample gotya_samples[] =
WRITE8_HANDLER( gotya_soundlatch_w )
{
- gotya_state *state = space->machine->driver_data<gotya_state>();
+ gotya_state *state = space->machine().driver_data<gotya_state>();
int sample_number;
if (data == 0)
diff --git a/src/mame/audio/gridlee.c b/src/mame/audio/gridlee.c
index 3bca6d87163..b13437475fb 100644
--- a/src/mame/audio/gridlee.c
+++ b/src/mame/audio/gridlee.c
@@ -69,14 +69,14 @@ static STREAM_UPDATE( gridlee_stream_update )
static DEVICE_START( gridlee_sound )
{
gridlee_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
/* allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, machine->sample_rate(), NULL, gridlee_stream_update);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, machine.sample_rate(), NULL, gridlee_stream_update);
- state->samples = device->machine->device("samples");
+ state->samples = device->machine().device("samples");
- state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate();
+ state->freq_to_step = (double)(1 << 24) / (double)machine.sample_rate();
}
diff --git a/src/mame/audio/harddriv.c b/src/mame/audio/harddriv.c
index 620b2d7ab0f..650829cda4e 100644
--- a/src/mame/audio/harddriv.c
+++ b/src/mame/audio/harddriv.c
@@ -21,11 +21,11 @@
*
*************************************/
-void hdsnd_init(running_machine *machine)
+void hdsnd_init(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- state->rombase = (UINT8 *)machine->region("serialroms")->base();
- state->romsize = machine->region("serialroms")->bytes();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ state->rombase = (UINT8 *)machine.region("serialroms")->base();
+ state->romsize = machine.region("serialroms")->bytes();
}
@@ -36,9 +36,9 @@ void hdsnd_init(running_machine *machine)
*
*************************************/
-static void update_68k_interrupts(running_machine *machine)
+static void update_68k_interrupts(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
device_set_input_line(state->soundcpu, 1, state->mainflag ? ASSERT_LINE : CLEAR_LINE);
device_set_input_line(state->soundcpu, 3, state->irq68k ? ASSERT_LINE : CLEAR_LINE);
}
@@ -53,7 +53,7 @@ static void update_68k_interrupts(running_machine *machine)
READ16_HANDLER( hd68k_snd_data_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->soundflag = 0;
logerror("%06X:main read from sound=%04X\n", cpu_get_previouspc(space->cpu), state->sounddata);
return state->sounddata;
@@ -62,14 +62,14 @@ READ16_HANDLER( hd68k_snd_data_r )
READ16_HANDLER( hd68k_snd_status_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return (state->mainflag << 15) | (state->soundflag << 14) | 0x1fff;
}
static TIMER_CALLBACK( delayed_68k_w )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
state->maindata = param;
state->mainflag = 1;
update_68k_interrupts(machine);
@@ -78,18 +78,18 @@ static TIMER_CALLBACK( delayed_68k_w )
WRITE16_HANDLER( hd68k_snd_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_68k_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_68k_w), data);
logerror("%06X:main write to sound=%04X\n", cpu_get_previouspc(space->cpu), data);
}
WRITE16_HANDLER( hd68k_snd_reset_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, ASSERT_LINE);
device_set_input_line(state->soundcpu, INPUT_LINE_RESET, CLEAR_LINE);
state->mainflag = state->soundflag = 0;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
logerror("%06X:Reset sound\n", cpu_get_previouspc(space->cpu));
}
@@ -103,9 +103,9 @@ WRITE16_HANDLER( hd68k_snd_reset_w )
READ16_HANDLER( hdsnd68k_data_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->mainflag = 0;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
logerror("%06X:sound read from main=%04X\n", cpu_get_previouspc(space->cpu), state->maindata);
return state->maindata;
}
@@ -113,7 +113,7 @@ READ16_HANDLER( hdsnd68k_data_r )
WRITE16_HANDLER( hdsnd68k_data_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->sounddata);
state->soundflag = 1;
logerror("%06X:sound write to main=%04X\n", cpu_get_previouspc(space->cpu), data);
@@ -148,9 +148,9 @@ READ16_HANDLER( hdsnd68k_status_r )
// D14 = 'Sound Flag'
// D13 = Test Switch
// D12 = 5220 Ready Flag (0=Ready)
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
logerror("%06X:hdsnd68k_status_r(%04X)\n", cpu_get_previouspc(space->cpu), offset);
- return (state->mainflag << 15) | (state->soundflag << 14) | 0x2000 | 0;//((input_port_read(space->machine, "IN0") & 0x0020) << 8) | 0;
+ return (state->mainflag << 15) | (state->soundflag << 14) | 0x2000 | 0;//((input_port_read(space->machine(), "IN0") & 0x0020) << 8) | 0;
}
@@ -163,7 +163,7 @@ READ16_HANDLER( hdsnd68k_status_r )
WRITE16_HANDLER( hdsnd68k_latches_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
/* bit 3 selects the value; data is ignored */
data = (offset >> 3) & 1;
@@ -212,9 +212,9 @@ WRITE16_HANDLER( hdsnd68k_speech_w )
WRITE16_HANDLER( hdsnd68k_irqclr_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->irq68k = 0;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
}
@@ -227,21 +227,21 @@ WRITE16_HANDLER( hdsnd68k_irqclr_w )
READ16_HANDLER( hdsnd68k_320ram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->sounddsp_ram[offset & 0xfff];
}
WRITE16_HANDLER( hdsnd68k_320ram_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
COMBINE_DATA(&state->sounddsp_ram[offset & 0xfff]);
}
READ16_HANDLER( hdsnd68k_320ports_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
address_space *iospace = state->sounddsp->memory().space(AS_IO);
return iospace->read_word((offset & 7) << 1);
}
@@ -249,7 +249,7 @@ READ16_HANDLER( hdsnd68k_320ports_r )
WRITE16_HANDLER( hdsnd68k_320ports_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
address_space *iospace = state->sounddsp->memory().space(AS_IO);
iospace->write_word((offset & 7) << 1, data);
}
@@ -257,7 +257,7 @@ WRITE16_HANDLER( hdsnd68k_320ports_w )
READ16_HANDLER( hdsnd68k_320com_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->cramen)
return state->comram[offset & 0x1ff];
@@ -269,7 +269,7 @@ READ16_HANDLER( hdsnd68k_320com_r )
WRITE16_HANDLER( hdsnd68k_320com_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->cramen)
COMBINE_DATA(&state->comram[offset & 0x1ff]);
@@ -287,7 +287,7 @@ WRITE16_HANDLER( hdsnd68k_320com_w )
READ16_HANDLER( hdsnddsp_get_bio )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
UINT64 cycles_since_last_bio = state->sounddsp->total_cycles() - state->last_bio_cycles;
INT32 cycles_until_bio = CYCLES_PER_BIO - cycles_since_last_bio;
@@ -312,7 +312,7 @@ READ16_HANDLER( hdsnddsp_get_bio )
WRITE16_DEVICE_HANDLER( hdsnddsp_dac_w )
{
- harddriv_state *state = device->machine->driver_data<harddriv_state>();
+ harddriv_state *state = device->machine().driver_data<harddriv_state>();
/* DAC L */
if (!state->dacmute)
@@ -338,15 +338,15 @@ WRITE16_HANDLER( hdsnddsp_mute_w )
WRITE16_HANDLER( hdsnddsp_gen68kirq_w )
{
/* generate 68k IRQ */
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
state->irq68k = 1;
- update_68k_interrupts(space->machine);
+ update_68k_interrupts(space->machine());
}
WRITE16_HANDLER( hdsnddsp_soundaddr_w )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (offset == 0)
{
/* select sound ROM block */
@@ -362,7 +362,7 @@ WRITE16_HANDLER( hdsnddsp_soundaddr_w )
READ16_HANDLER( hdsnddsp_rom_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
if (state->sound_rom_offs < state->romsize)
return state->rombase[state->sound_rom_offs++] << 7;
state->sound_rom_offs++;
@@ -372,7 +372,7 @@ READ16_HANDLER( hdsnddsp_rom_r )
READ16_HANDLER( hdsnddsp_comram_r )
{
- harddriv_state *state = space->machine->driver_data<harddriv_state>();
+ harddriv_state *state = space->machine().driver_data<harddriv_state>();
return state->comram[state->sound_rom_offs++ & 0x1ff];
}
diff --git a/src/mame/audio/hyprolyb.c b/src/mame/audio/hyprolyb.c
index 62c49a2b79b..88948ff6fe4 100644
--- a/src/mame/audio/hyprolyb.c
+++ b/src/mame/audio/hyprolyb.c
@@ -25,8 +25,8 @@ static DEVICE_START( hyprolyb_adpcm )
{
hyprolyb_adpcm_state *state = get_safe_token(device);
- state->space = device->machine->device("audiocpu")->memory().space(AS_PROGRAM);
- state->msm = device->machine->device("msm");
+ state->space = device->machine().device("audiocpu")->memory().space(AS_PROGRAM);
+ state->msm = device->machine().device("msm");
device->save_item(NAME(state->adpcm_ready)); // only bootlegs
device->save_item(NAME(state->adpcm_busy));
device->save_item(NAME(state->vck_ready));
@@ -113,7 +113,7 @@ ADDRESS_MAP_END
static void adpcm_vck_callback( device_t *device )
{
- device_t *adpcm = device->machine->device("hyprolyb_adpcm");
+ device_t *adpcm = device->machine().device("hyprolyb_adpcm");
hyprolyb_adpcm_state *state = get_safe_token(adpcm);
state->vck_ready = 0x80;
diff --git a/src/mame/audio/invinco.c b/src/mame/audio/invinco.c
index 568daf8a91f..bb80fdfed69 100644
--- a/src/mame/audio/invinco.c
+++ b/src/mame/audio/invinco.c
@@ -66,7 +66,7 @@ enum
WRITE8_HANDLER( invinco_audio_w )
{
static int port2State = 0;
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
diff --git a/src/mame/audio/irem.c b/src/mame/audio/irem.c
index 9ab3bd6d02a..923aa4e6ccb 100644
--- a/src/mame/audio/irem.c
+++ b/src/mame/audio/irem.c
@@ -41,12 +41,12 @@ INLINE irem_audio_state *get_safe_token( device_t *device )
static DEVICE_START( irem_audio )
{
irem_audio_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
- state->adpcm1 = machine->device("msm1");
- state->adpcm2 = machine->device("msm2");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
+ state->adpcm1 = machine.device("msm1");
+ state->adpcm2 = machine.device("msm2");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
device->save_item(NAME(state->port1));
device->save_item(NAME(state->port2));
@@ -66,7 +66,7 @@ WRITE8_HANDLER( irem_sound_cmd_w )
if ((data & 0x80) == 0)
soundlatch_w(space, 0, data & 0x7f);
else
- cputag_set_input_line(space->machine, "iremsound", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "iremsound", 0, ASSERT_LINE);
}
@@ -180,7 +180,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_1_porta_w )
static WRITE8_HANDLER( sound_irq_ack_w )
{
- cputag_set_input_line(space->machine, "iremsound", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "iremsound", 0, CLEAR_LINE);
}
@@ -219,9 +219,9 @@ static WRITE8_DEVICE_HANDLER( m62_adpcm_w )
static void adpcm_int(device_t *device)
{
- device_t *adpcm2 = device->machine->device("msm2");
+ device_t *adpcm2 = device->machine().device("msm2");
- cputag_set_input_line(device->machine, "iremsound", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "iremsound", INPUT_LINE_NMI, PULSE_LINE);
/* the first MSM5205 clocks the second */
if (adpcm2 != NULL)
diff --git a/src/mame/audio/jaguar.c b/src/mame/audio/jaguar.c
index 9f70fd88a42..7d5e406b565 100644
--- a/src/mame/audio/jaguar.c
+++ b/src/mame/audio/jaguar.c
@@ -181,15 +181,15 @@ static WRITE32_HANDLER( dsp_flags_w );
*
*************************************/
-void jaguar_dsp_suspend(running_machine *machine)
+void jaguar_dsp_suspend(running_machine &machine)
{
- machine->device<cpu_device>("audiocpu")->suspend(SUSPEND_REASON_SPIN, 1);
+ machine.device<cpu_device>("audiocpu")->suspend(SUSPEND_REASON_SPIN, 1);
}
-void jaguar_dsp_resume(running_machine *machine)
+void jaguar_dsp_resume(running_machine &machine)
{
- machine->device<cpu_device>("audiocpu")->resume(SUSPEND_REASON_SPIN);
+ machine.device<cpu_device>("audiocpu")->resume(SUSPEND_REASON_SPIN);
}
@@ -200,7 +200,7 @@ void jaguar_dsp_resume(running_machine *machine)
*
*************************************/
-static void update_gpu_irq(running_machine *machine)
+static void update_gpu_irq(running_machine &machine)
{
if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f)
{
@@ -218,7 +218,7 @@ void jaguar_external_int(device_t *device, int state)
gpu_irq_state |= 1;
else
gpu_irq_state &= ~1;
- update_gpu_irq(device->machine);
+ update_gpu_irq(device->machine());
}
@@ -229,7 +229,7 @@ void jaguar_external_int(device_t *device, int state)
*
*************************************/
-void cojag_sound_init(running_machine *machine)
+void cojag_sound_init(running_machine &machine)
{
int i;
@@ -252,17 +252,17 @@ void cojag_sound_init(running_machine *machine)
jaguar_wave_rom[0x200 + i] = (int)(32767. * sin(2.0 * M_PI * (double)i / (double)0x80));
/* F1DA00 = traingle wave with noise */
- jaguar_wave_rom[0x280 + i] = jaguar_wave_rom[0x000 + i] * (machine->rand() % 32768) / 32768;
+ jaguar_wave_rom[0x280 + i] = jaguar_wave_rom[0x000 + i] * (machine.rand() % 32768) / 32768;
/* F1DC00 = spike */
jaguar_wave_rom[0x300 + i] = (i == 0x40) ? 32767 : 0;
/* F1DE00 = white noise */
- jaguar_wave_rom[0x380 + i] = machine->rand() % 32768;
+ jaguar_wave_rom[0x380 + i] = machine.rand() % 32768;
}
#if ENABLE_SPEEDUP_HACKS
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf1a100, 0xf1a103, FUNC(dsp_flags_w));
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf1a100, 0xf1a103, FUNC(dsp_flags_w));
#endif
}
@@ -299,7 +299,7 @@ WRITE16_HANDLER( jaguar_jerry_regs_w )
{
case JINTCTRL:
gpu_irq_state &= ~(dsp_regs[JINTCTRL] >> 8);
- update_gpu_irq(space->machine);
+ update_gpu_irq(space->machine());
break;
}
@@ -339,18 +339,18 @@ WRITE32_HANDLER( jaguar_jerry_regs32_w )
static WRITE32_HANDLER( dsp_flags_w )
{
/* write the data through */
- jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
+ jaguardsp_ctrl_w(space->machine().device("audiocpu"), offset, data, mem_mask);
/* if they were clearing the A2S interrupt, see if we are headed for the spin */
/* loop with R22 != 0; if we are, just start spinning again */
- if (space->cpu == space->machine->device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
+ if (space->cpu == space->machine().device("audiocpu") && ACCESSING_BITS_8_15 && (data & 0x400))
{
/* see if we're going back to the spin loop */
if (!(data & 0x04000) && cpu_get_reg(space->cpu, JAGUAR_R22) != 0)
{
UINT32 r30 = cpu_get_reg(space->cpu, JAGUAR_R30) & 0xffffff;
if (r30 >= 0xf1b124 && r30 <= 0xf1b126)
- jaguar_dsp_suspend(space->machine);
+ jaguar_dsp_suspend(space->machine());
}
}
}
@@ -370,8 +370,8 @@ static WRITE32_HANDLER( dsp_flags_w )
TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
{
/* assert the A2S IRQ on CPU #2 (DSP) */
- cputag_set_input_line(timer.machine, "audiocpu", 1, ASSERT_LINE);
- jaguar_dsp_resume(timer.machine);
+ cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
+ jaguar_dsp_resume(timer.machine());
/* fix flaky code in interrupt handler which thwarts our speedup */
if ((jaguar_dsp_ram[0x3e/4] & 0xffff) == 0xbfbc &&
@@ -389,8 +389,8 @@ TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
TIMER_DEVICE_CALLBACK( jaguar_serial_callback )
{
/* assert the A2S IRQ on CPU #2 (DSP) */
- cputag_set_input_line(timer.machine, "audiocpu", 1, ASSERT_LINE);
- jaguar_dsp_resume(timer.machine);
+ cputag_set_input_line(timer.machine(), "audiocpu", 1, ASSERT_LINE);
+ jaguar_dsp_resume(timer.machine());
}
#endif
@@ -416,12 +416,12 @@ WRITE32_HANDLER( jaguar_serial_w )
{
/* right DAC */
case 2:
- dac_signed_data_16_w(space->machine->device("dac2"), (data & 0xffff) ^ 0x8000);
+ dac_signed_data_16_w(space->machine().device("dac2"), (data & 0xffff) ^ 0x8000);
break;
/* left DAC */
case 3:
- dac_signed_data_16_w(space->machine->device("dac1"), (data & 0xffff) ^ 0x8000);
+ dac_signed_data_16_w(space->machine().device("dac1"), (data & 0xffff) ^ 0x8000);
break;
/* frequency register */
@@ -436,7 +436,7 @@ WRITE32_HANDLER( jaguar_serial_w )
if ((data & 0x3f) == 0x15)
{
attotime rate = attotime::from_hz(26000000) * (32 * 2 * (serial_frequency + 1));
- timer_device *serial_timer = space->machine->device<timer_device>("serial_timer");
+ timer_device *serial_timer = space->machine().device<timer_device>("serial_timer");
serial_timer->adjust(rate, 0, rate);
}
break;
diff --git a/src/mame/audio/jedi.c b/src/mame/audio/jedi.c
index 5aba809acd9..dd40be19e47 100644
--- a/src/mame/audio/jedi.c
+++ b/src/mame/audio/jedi.c
@@ -22,7 +22,7 @@
static SOUND_START( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* set up save state */
state->save_item(NAME(state->audio_latch));
@@ -40,7 +40,7 @@ static SOUND_START( jedi )
static SOUND_RESET( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* init globals */
state->audio_latch = 0;
@@ -60,7 +60,7 @@ static SOUND_RESET( jedi )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
}
@@ -73,13 +73,13 @@ static WRITE8_HANDLER( irq_ack_w )
WRITE8_HANDLER( jedi_audio_reset_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
static TIMER_CALLBACK( delayed_audio_latch_w )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
state->audio_latch = param;
*state->audio_comm_stat |= 0x80;
@@ -88,13 +88,13 @@ static TIMER_CALLBACK( delayed_audio_latch_w )
WRITE8_HANDLER( jedi_audio_latch_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_audio_latch_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_audio_latch_w), data);
}
static READ8_HANDLER( audio_latch_r )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
*state->audio_comm_stat &= ~0x80;
return state->audio_latch;
@@ -103,7 +103,7 @@ static READ8_HANDLER( audio_latch_r )
CUSTOM_INPUT( jedi_audio_comm_stat_r )
{
- jedi_state *state = field->port->machine->driver_data<jedi_state>();
+ jedi_state *state = field->port->machine().driver_data<jedi_state>();
return *state->audio_comm_stat >> 6;
}
@@ -117,7 +117,7 @@ CUSTOM_INPUT( jedi_audio_comm_stat_r )
READ8_HANDLER( jedi_audio_ack_latch_r )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
*state->audio_comm_stat &= ~0x40;
return state->audio_ack_latch;
@@ -126,7 +126,7 @@ READ8_HANDLER( jedi_audio_ack_latch_r )
static WRITE8_HANDLER( audio_ack_latch_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->audio_ack_latch = data;
*state->audio_comm_stat |= 0x40;
@@ -142,12 +142,12 @@ static WRITE8_HANDLER( audio_ack_latch_w )
static WRITE8_HANDLER( speech_strobe_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
int new_speech_strobe_state = (~offset >> 8) & 1;
if ((new_speech_strobe_state != state->speech_strobe_state) && new_speech_strobe_state)
{
- device_t *tms = space->machine->device("tms");
+ device_t *tms = space->machine().device("tms");
tms5220_data_w(tms, 0, *state->speech_data);
}
state->speech_strobe_state = new_speech_strobe_state;
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( speech_strobe_w )
static READ8_HANDLER( speech_ready_r )
{
- return (tms5220_readyq_r(space->machine->device("tms"))) << 7;
+ return (tms5220_readyq_r(space->machine().device("tms"))) << 7;
}
diff --git a/src/mame/audio/laserbat.c b/src/mame/audio/laserbat.c
index b6761b9824f..1c05d5b92b0 100644
--- a/src/mame/audio/laserbat.c
+++ b/src/mame/audio/laserbat.c
@@ -5,13 +5,13 @@
WRITE8_HANDLER( laserbat_csound1_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
state->csound1 = data;
}
WRITE8_HANDLER( laserbat_csound2_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
int ksound = 0;
if (data & 0x01)
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index e77eb0cd8d5..00c37d1d0ad 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -271,11 +271,11 @@ static DEVICE_START( leland_sound )
state->dac_bufout[0] = state->dac_bufout[1] = 0;
/* allocate the stream */
- state->dac_stream = device->machine->sound().stream_alloc(*device, 0, 1, 256*60, NULL, leland_update);
+ state->dac_stream = device->machine().sound().stream_alloc(*device, 0, 1, 256*60, NULL, leland_update);
/* allocate memory */
- state->dac_buffer[0] = auto_alloc_array(device->machine, UINT8, DAC_BUFFER_SIZE);
- state->dac_buffer[1] = auto_alloc_array(device->machine, UINT8, DAC_BUFFER_SIZE);
+ state->dac_buffer[0] = auto_alloc_array(device->machine(), UINT8, DAC_BUFFER_SIZE);
+ state->dac_buffer[1] = auto_alloc_array(device->machine(), UINT8, DAC_BUFFER_SIZE);
}
@@ -537,37 +537,37 @@ static TIMER_CALLBACK( dma_timer_callback );
static DEVICE_START( common_sh_start )
{
leland_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
- address_space *dmaspace = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ running_machine &machine = device->machine();
+ address_space *dmaspace = machine.device("audiocpu")->memory().space(AS_PROGRAM);
int i;
/* determine which sound hardware is installed */
- state->has_ym2151 = (device->machine->device("ymsnd") != NULL);
+ state->has_ym2151 = (device->machine().device("ymsnd") != NULL);
/* allocate separate streams for the DMA and non-DMA DACs */
- state->dma_stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update);
- state->nondma_stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update);
+ state->dma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, (void *)dmaspace, leland_80186_dma_update);
+ state->nondma_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_dac_update);
/* if we have a 2151, install an externally driven DAC stream */
if (state->has_ym2151)
{
- state->ext_base = machine->region("dac")->base();
- state->extern_stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
+ state->ext_base = machine.region("dac")->base();
+ state->extern_stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, leland_80186_extern_update);
}
/* create timers here so they stick around */
state->i80186.cpu = dmaspace->cpu;
- state->i80186.timer[0].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device);
- state->i80186.timer[1].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device);
- state->i80186.timer[2].int_timer = machine->scheduler().timer_alloc(FUNC(internal_timer_int), device);
- state->i80186.timer[0].time_timer = machine->scheduler().timer_alloc(FUNC(NULL));
- state->i80186.timer[1].time_timer = machine->scheduler().timer_alloc(FUNC(NULL));
- state->i80186.timer[2].time_timer = machine->scheduler().timer_alloc(FUNC(NULL));
- state->i80186.dma[0].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback), device);
- state->i80186.dma[1].finish_timer = machine->scheduler().timer_alloc(FUNC(dma_timer_callback), device);
+ state->i80186.timer[0].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device);
+ state->i80186.timer[1].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device);
+ state->i80186.timer[2].int_timer = machine.scheduler().timer_alloc(FUNC(internal_timer_int), device);
+ state->i80186.timer[0].time_timer = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->i80186.timer[1].time_timer = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->i80186.timer[2].time_timer = machine.scheduler().timer_alloc(FUNC(NULL));
+ state->i80186.dma[0].finish_timer = machine.scheduler().timer_alloc(FUNC(dma_timer_callback), device);
+ state->i80186.dma[1].finish_timer = machine.scheduler().timer_alloc(FUNC(dma_timer_callback), device);
for (i = 0; i < 9; i++)
- state->counter[i].timer = machine->scheduler().timer_alloc(FUNC(NULL));
+ state->counter[i].timer = machine.scheduler().timer_alloc(FUNC(NULL));
}
static DEVICE_START( leland_80186_sound )
@@ -693,8 +693,8 @@ static DEVICE_RESET( leland_80186_sound )
static IRQ_CALLBACK( int_callback )
{
- leland_sound_state *state = get_safe_token(device->machine->device("custom"));
- if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine->time().as_double(), state->i80186.intr.poll_status & 0x1f);
+ leland_sound_state *state = get_safe_token(device->machine().device("custom"));
+ if (LOG_INTERRUPTS) logerror("(%f) **** Acknowledged interrupt vector %02X\n", device->machine().time().as_double(), state->i80186.intr.poll_status & 0x1f);
/* clear the interrupt */
device_set_input_line(state->i80186.cpu, 0, CLEAR_LINE);
@@ -729,7 +729,7 @@ static IRQ_CALLBACK( int_callback )
static void update_interrupt_state(device_t *device)
{
leland_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, j, new_vector = 0;
if (LOG_INTERRUPTS) logerror("update_interrupt_status: req=%02X stat=%02X serv=%02X\n", state->i80186.intr.request, state->i80186.intr.status, state->i80186.intr.in_service);
@@ -809,14 +809,14 @@ generate_int:
if (!state->i80186.intr.pending)
cputag_set_input_line(machine, "audiocpu", 0, ASSERT_LINE);
state->i80186.intr.pending = 1;
- if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine->time().as_double(), new_vector);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Requesting interrupt vector %02X\n", machine.time().as_double(), new_vector);
}
static void handle_eoi(device_t *device, int data)
{
leland_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, j;
/* specific case */
@@ -834,9 +834,9 @@ static void handle_eoi(device_t *device, int data)
case 0x0d: state->i80186.intr.in_service &= ~0x20; break;
case 0x0e: state->i80186.intr.in_service &= ~0x40; break;
case 0x0f: state->i80186.intr.in_service &= ~0x80; break;
- default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", machine->describe_context(), data & 0x1f);
+ default: logerror("%s:ERROR - 80186 EOI with unknown vector %02X\n", machine.describe_context(), data & 0x1f);
}
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", machine->time().as_double(), data & 0x1f);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for vector %02X\n", machine.time().as_double(), data & 0x1f);
}
/* non-specific case */
@@ -849,7 +849,7 @@ static void handle_eoi(device_t *device, int data)
if ((state->i80186.intr.timer & 7) == i && (state->i80186.intr.in_service & 0x01))
{
state->i80186.intr.in_service &= ~0x01;
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", machine->time().as_double());
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for timer\n", machine.time().as_double());
return;
}
@@ -858,7 +858,7 @@ static void handle_eoi(device_t *device, int data)
if ((state->i80186.intr.dma[j] & 7) == i && (state->i80186.intr.in_service & (0x04 << j)))
{
state->i80186.intr.in_service &= ~(0x04 << j);
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", machine->time().as_double(), j);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for DMA%d\n", machine.time().as_double(), j);
return;
}
@@ -867,7 +867,7 @@ static void handle_eoi(device_t *device, int data)
if ((state->i80186.intr.ext[j] & 7) == i && (state->i80186.intr.in_service & (0x10 << j)))
{
state->i80186.intr.in_service &= ~(0x10 << j);
- if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", machine->time().as_double(), j);
+ if (LOG_INTERRUPTS) logerror("(%f) **** Got EOI for INT%d\n", machine.time().as_double(), j);
return;
}
}
@@ -1759,14 +1759,14 @@ WRITE8_DEVICE_HANDLER( leland_80186_control_w )
}
/* /RESET */
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
/* /NMI */
/* If the master CPU doesn't get a response by the time it's ready to send
the next command, it uses an NMI to force the issue; unfortunately, this
seems to really screw up the sound system. It turns out it's better to
just wait for the original interrupt to occur naturally */
-/* cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/
+/* cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/
/* INT0 */
if (data & 0x20)
@@ -1807,14 +1807,14 @@ static TIMER_CALLBACK( command_lo_sync )
{
device_t *device = (device_t *)ptr;
leland_sound_state *state = get_safe_token(device);
- if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", machine->describe_context(), param);
+ if (LOG_COMM) logerror("%s:Write sound command latch lo = %02X\n", machine.describe_context(), param);
state->sound_command = (state->sound_command & 0xff00) | param;
}
WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w )
{
- device->machine->scheduler().synchronize(FUNC(command_lo_sync), data, device);
+ device->machine().scheduler().synchronize(FUNC(command_lo_sync), data, device);
}
@@ -1846,7 +1846,7 @@ static TIMER_CALLBACK( delayed_response_r )
{
device_t *device = (device_t *)ptr;
leland_sound_state *state = get_safe_token(device);
- cpu_device *master = machine->device<cpu_device>("master");
+ cpu_device *master = machine.device<cpu_device>("master");
int checkpc = param;
int pc = master->pc();
int oldaf = master->state(Z80_AF);
@@ -1877,7 +1877,7 @@ READ8_DEVICE_HANDLER( leland_80186_response_r )
if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, state->sound_response);
/* synchronize the response */
- device->machine->scheduler().synchronize(FUNC(delayed_response_r), pc + 2, device);
+ device->machine().scheduler().synchronize(FUNC(delayed_response_r), pc + 2, device);
return state->sound_response;
}
@@ -2124,7 +2124,7 @@ static READ16_DEVICE_HANDLER( peripheral_r )
if (!state->has_ym2151)
return pit8254_r(device, offset | 0x40, mem_mask);
else
- return ym2151_r(device->machine->device("ymsnd"), offset);
+ return ym2151_r(device->machine().device("ymsnd"), offset);
case 4:
if (state->is_redline)
@@ -2161,7 +2161,7 @@ static WRITE16_DEVICE_HANDLER( peripheral_w )
if (!state->has_ym2151)
pit8254_w(device, offset | 0x40, data, mem_mask);
else
- ym2151_w(device->machine->device("ymsnd"), offset, data);
+ ym2151_w(device->machine().device("ymsnd"), offset, data);
break;
case 4:
diff --git a/src/mame/audio/m72.c b/src/mame/audio/m72.c
index 0f9981c569e..0fbe57ff755 100644
--- a/src/mame/audio/m72.c
+++ b/src/mame/audio/m72.c
@@ -118,9 +118,9 @@ SOUND_RESET( m72 )
void m72_ym2151_irq_handler(device_t *device, int irq)
{
if (irq)
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
}
WRITE16_HANDLER( m72_sound_command_w )
@@ -128,19 +128,19 @@ WRITE16_HANDLER( m72_sound_command_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space,offset,data);
- space->machine->scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
}
}
WRITE8_HANDLER( m72_sound_command_byte_w )
{
soundlatch_w(space,offset,data);
- space->machine->scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_ASSERT);
}
WRITE8_HANDLER( m72_sound_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), Z80_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), Z80_CLEAR);
}
@@ -200,11 +200,11 @@ WRITE8_HANDLER( poundfor_sample_addr_w )
READ8_HANDLER( m72_sample_r )
{
- return space->machine->region("samples")->base()[sample_addr];
+ return space->machine().region("samples")->base()[sample_addr];
}
WRITE8_DEVICE_HANDLER( m72_sample_w )
{
dac_signed_data_w(device, data);
- sample_addr = (sample_addr + 1) & (device->machine->region("samples")->bytes() - 1);
+ sample_addr = (sample_addr + 1) & (device->machine().region("samples")->bytes() - 1);
}
diff --git a/src/mame/audio/mario.c b/src/mame/audio/mario.c
index cdf729c2567..0317914161d 100644
--- a/src/mame/audio/mario.c
+++ b/src/mame/audio/mario.c
@@ -398,11 +398,11 @@ DISCRETE_SOUND_END
static void set_ea(address_space *space, int ea)
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
//printf("ea: %d\n", ea);
//cputag_set_input_line(machine, "audiocpu", MCS48_INPUT_EA, (ea) ? ASSERT_LINE : CLEAR_LINE);
if (state->eabank != NULL)
- memory_set_bank(space->machine, state->eabank, ea);
+ memory_set_bank(space->machine(), state->eabank, ea);
}
/****************************************************************
@@ -413,10 +413,10 @@ static void set_ea(address_space *space, int ea)
static SOUND_START( mario )
{
- mario_state *state = machine->driver_data<mario_state>();
- device_t *audiocpu = machine->device("audiocpu");
+ mario_state *state = machine.driver_data<mario_state>();
+ device_t *audiocpu = machine.device("audiocpu");
#if USE_8039
- UINT8 *SND = machine->region("audiocpu")->base();
+ UINT8 *SND = machine.region("audiocpu")->base();
SND[0x1001] = 0x01;
#endif
@@ -426,8 +426,8 @@ static SOUND_START( mario )
{
state->eabank = "bank1";
audiocpu->memory().space(AS_PROGRAM)->install_read_bank(0x000, 0x7ff, "bank1");
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("audiocpu")->base(), 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("audiocpu")->base() + 0x1000, 0x800);
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("audiocpu")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("audiocpu")->base() + 0x1000, 0x800);
}
state->save_item(NAME(state->last));
@@ -436,8 +436,8 @@ static SOUND_START( mario )
static SOUND_RESET( mario )
{
- mario_state *state = machine->driver_data<mario_state>();
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ mario_state *state = machine.driver_data<mario_state>();
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
#if USE_8039
set_ea(machine, 1);
@@ -482,8 +482,8 @@ static READ8_HANDLER( mario_sh_t1_r )
static READ8_HANDLER( mario_sh_tune_r )
{
- UINT8 *SND = space->machine->region("audiocpu")->base();
- UINT16 mask = space->machine->region("audiocpu")->bytes()-1;
+ UINT8 *SND = space->machine().region("audiocpu")->base();
+ UINT16 mask = space->machine().region("audiocpu")->bytes()-1;
UINT8 p2 = I8035_P2_R(space);
if ((p2 >> 7) & 1)
@@ -515,12 +515,12 @@ static WRITE8_HANDLER( mario_sh_p2_w )
WRITE8_HANDLER( masao_sh_irqtrigger_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
if (state->last == 1 && data == 0)
{
/* setting bit 0 high then low triggers IRQ on the sound CPU */
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff);
}
state->last = data;
@@ -548,15 +548,15 @@ WRITE8_DEVICE_HANDLER( mario_sh2_w )
/* Misc samples */
WRITE8_HANDLER( mario_sh3_w )
{
- mario_state *state = space->machine->driver_data<mario_state>();
+ mario_state *state = space->machine().driver_data<mario_state>();
switch (offset)
{
case 0: /* death */
if (data)
- cputag_set_input_line(space->machine, "audiocpu",0,ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu",0,ASSERT_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu",0,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu",0,CLEAR_LINE);
break;
case 1: /* get coin */
I8035_T_W_AH(space, 0,data & 1);
@@ -577,7 +577,7 @@ WRITE8_HANDLER( mario_sh3_w )
I8035_P1_W_AH(space, 3, data & 1);
break;
case 7: /* skid */
- discrete_sound_w(space->machine->device("discrete"), DS_SOUND7_INP, data & 1);
+ discrete_sound_w(space->machine().device("discrete"), DS_SOUND7_INP, data & 1);
break;
}
}
diff --git a/src/mame/audio/mcr.c b/src/mame/audio/mcr.c
index 424bb6cf7dc..095c11ee698 100644
--- a/src/mame/audio/mcr.c
+++ b/src/mame/audio/mcr.c
@@ -91,7 +91,7 @@ static UINT8 squawkntalk_tms_strobes;
*
*************************************/
-static void ssio_compute_ay8910_modulation(running_machine *machine);
+static void ssio_compute_ay8910_modulation(running_machine &machine);
@@ -101,14 +101,14 @@ static void ssio_compute_ay8910_modulation(running_machine *machine);
*
*************************************/
-void mcr_sound_init(running_machine *machine, UINT8 config)
+void mcr_sound_init(running_machine &machine, UINT8 config)
{
mcr_sound_config = config;
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
{
- ssio_sound_cpu = machine->device("ssiocpu");
+ ssio_sound_cpu = machine.device("ssiocpu");
ssio_compute_ay8910_modulation(machine);
state_save_register_global_array(machine, ssio_data);
state_save_register_global(machine, ssio_status);
@@ -121,28 +121,28 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Turbo Chip Squeak */
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
{
- turbocs_sound_cpu = machine->device("tcscpu");
+ turbocs_sound_cpu = machine.device("tcscpu");
state_save_register_global(machine, turbocs_status);
}
/* Chip Squeak Deluxe */
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
{
- csdeluxe_sound_cpu = machine->device("csdcpu");
+ csdeluxe_sound_cpu = machine.device("csdcpu");
state_save_register_global(machine, csdeluxe_status);
}
/* Sounds Good */
if (mcr_sound_config & MCR_SOUNDS_GOOD)
{
- soundsgood_sound_cpu = machine->device("sgcpu");
+ soundsgood_sound_cpu = machine.device("sgcpu");
state_save_register_global(machine, soundsgood_status);
}
/* Squawk n Talk */
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
{
- squawkntalk_sound_cpu = machine->device("sntcpu");
+ squawkntalk_sound_cpu = machine.device("sntcpu");
state_save_register_global(machine, squawkntalk_tms_command);
state_save_register_global(machine, squawkntalk_tms_strobes);
}
@@ -153,7 +153,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
}
-void mcr_sound_reset(running_machine *machine)
+void mcr_sound_reset(running_machine &machine)
{
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
@@ -240,9 +240,9 @@ void mcr_sound_reset(running_machine *machine)
frequency of sound output. So we simply apply a volume
adjustment to each voice according to the duty cycle.
*/
-static void ssio_compute_ay8910_modulation(running_machine *machine)
+static void ssio_compute_ay8910_modulation(running_machine &machine)
{
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
int volval;
/* loop over all possible values of the duty cycle */
@@ -314,10 +314,10 @@ static TIMER_CALLBACK( ssio_delayed_data_w )
ssio_data[param >> 8] = param & 0xff;
}
-static void ssio_update_volumes(running_machine *machine)
+static void ssio_update_volumes(running_machine &machine)
{
- device_t *ay0 = machine->device("ssio.1");
- device_t *ay1 = machine->device("ssio.2");
+ device_t *ay0 = machine.device("ssio.1");
+ device_t *ay1 = machine.device("ssio.2");
ay8910_set_volume(ay0, 0, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][0]]);
ay8910_set_volume(ay0, 1, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][1]]);
ay8910_set_volume(ay0, 2, ssio_mute ? 0 : ssio_ayvolume_lookup[ssio_duty_cycle[0][2]]);
@@ -330,21 +330,21 @@ static WRITE8_DEVICE_HANDLER( ssio_porta0_w )
{
ssio_duty_cycle[0][0] = data & 15;
ssio_duty_cycle[0][1] = data >> 4;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
static WRITE8_DEVICE_HANDLER( ssio_portb0_w )
{
ssio_duty_cycle[0][2] = data & 15;
ssio_overall[0] = (data >> 4) & 7;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
static WRITE8_DEVICE_HANDLER( ssio_porta1_w )
{
ssio_duty_cycle[1][0] = data & 15;
ssio_duty_cycle[1][1] = data >> 4;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
static WRITE8_DEVICE_HANDLER( ssio_portb1_w )
@@ -352,13 +352,13 @@ static WRITE8_DEVICE_HANDLER( ssio_portb1_w )
ssio_duty_cycle[1][2] = data & 15;
ssio_overall[1] = (data >> 4) & 7;
ssio_mute = data & 0x80;
- ssio_update_volumes(device->machine);
+ ssio_update_volumes(device->machine());
}
/********* external interfaces ***********/
WRITE8_HANDLER( ssio_data_w )
{
- space->machine->scheduler().synchronize(FUNC(ssio_delayed_data_w), (offset << 8) | (data & 0xff));
+ space->machine().scheduler().synchronize(FUNC(ssio_delayed_data_w), (offset << 8) | (data & 0xff));
}
READ8_HANDLER( ssio_status_r )
@@ -366,7 +366,7 @@ READ8_HANDLER( ssio_status_r )
return ssio_status;
}
-void ssio_reset_w(running_machine *machine, int state)
+void ssio_reset_w(running_machine &machine, int state)
{
/* going high halts the CPU */
if (state)
@@ -389,7 +389,7 @@ void ssio_reset_w(running_machine *machine, int state)
READ8_HANDLER( ssio_input_port_r )
{
static const char *const port[] = { "SSIO.IP0", "SSIO.IP1", "SSIO.IP2", "SSIO.IP3", "SSIO.IP4" };
- UINT8 result = input_port_read_safe(space->machine, port[offset], 0xff);
+ UINT8 result = input_port_read_safe(space->machine(), port[offset], 0xff);
if (ssio_custom_input[offset])
result = (result & ~ssio_custom_input_mask[offset]) |
((*ssio_custom_input[offset])(space, offset) & ssio_custom_input_mask[offset]);
@@ -491,7 +491,7 @@ MACHINE_CONFIG_END
static WRITE8_DEVICE_HANDLER( csdeluxe_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
- dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("csddac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
@@ -499,7 +499,7 @@ static WRITE8_DEVICE_HANDLER( csdeluxe_portb_w )
UINT8 z_mask = pia6821_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
- dac_signed_data_16_w(device->machine->device("csddac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("csddac"), dacval << 6);
if (~z_mask & 0x10) csdeluxe_status = (csdeluxe_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) csdeluxe_status = (csdeluxe_status & ~2) | ((data >> 4) & 2);
@@ -514,14 +514,14 @@ static WRITE_LINE_DEVICE_HANDLER( csdeluxe_irq )
static TIMER_CALLBACK( csdeluxe_delayed_data_w )
{
- device_t *pia = machine->device("csdpia");
+ device_t *pia = machine.device("csdpia");
pia6821_portb_w(pia, 0, param & 0x0f);
pia6821_ca1_w(pia, ~param & 0x10);
/* oftentimes games will write one nibble at a time; the sync on this is very */
/* important, so we boost the interleave briefly while this happens */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static READ16_DEVICE_HANDLER( csdeluxe_pia_r )
@@ -548,7 +548,7 @@ static WRITE16_DEVICE_HANDLER( csdeluxe_pia_w )
/********* external interfaces ***********/
WRITE8_HANDLER( csdeluxe_data_w )
{
- space->machine->scheduler().synchronize(FUNC(csdeluxe_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(csdeluxe_delayed_data_w), data);
}
READ8_HANDLER( csdeluxe_status_r )
@@ -556,7 +556,7 @@ READ8_HANDLER( csdeluxe_status_r )
return csdeluxe_status;
}
-void csdeluxe_reset_w(running_machine *machine, int state)
+void csdeluxe_reset_w(running_machine &machine, int state)
{
device_set_input_line(csdeluxe_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -629,7 +629,7 @@ MACHINE_CONFIG_END
static WRITE8_DEVICE_HANDLER( soundsgood_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
- dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("sgdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
@@ -637,7 +637,7 @@ static WRITE8_DEVICE_HANDLER( soundsgood_portb_w )
UINT8 z_mask = pia6821_get_port_b_z_mask(device);
dacval = (dacval & ~0x003) | (data >> 6);
- dac_signed_data_16_w(device->machine->device("sgdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("sgdac"), dacval << 6);
if (~z_mask & 0x10) soundsgood_status = (soundsgood_status & ~1) | ((data >> 4) & 1);
if (~z_mask & 0x20) soundsgood_status = (soundsgood_status & ~2) | ((data >> 4) & 2);
@@ -652,21 +652,21 @@ static WRITE_LINE_DEVICE_HANDLER( soundsgood_irq )
static TIMER_CALLBACK( soundsgood_delayed_data_w )
{
- device_t *pia = machine->device("sgpia");
+ device_t *pia = machine.device("sgpia");
pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
pia6821_ca1_w(pia, ~param & 0x01);
/* oftentimes games will write one nibble at a time; the sync on this is very */
/* important, so we boost the interleave briefly while this happens */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
}
/********* external interfaces ***********/
WRITE8_HANDLER( soundsgood_data_w )
{
- space->machine->scheduler().synchronize(FUNC(soundsgood_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(soundsgood_delayed_data_w), data);
}
READ8_HANDLER( soundsgood_status_r )
@@ -674,7 +674,7 @@ READ8_HANDLER( soundsgood_status_r )
return soundsgood_status;
}
-void soundsgood_reset_w(running_machine *machine, int state)
+void soundsgood_reset_w(running_machine &machine, int state)
{
//if (state) mame_printf_debug("SG Reset\n");
device_set_input_line(soundsgood_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
@@ -737,13 +737,13 @@ MACHINE_CONFIG_END
static WRITE8_DEVICE_HANDLER( turbocs_porta_w )
{
dacval = (dacval & ~0x3fc) | (data << 2);
- dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("tcsdac"), dacval << 6);
}
static WRITE8_DEVICE_HANDLER( turbocs_portb_w )
{
dacval = (dacval & ~0x003) | (data >> 6);
- dac_signed_data_16_w(device->machine->device("tcsdac"), dacval << 6);
+ dac_signed_data_16_w(device->machine().device("tcsdac"), dacval << 6);
turbocs_status = (data >> 4) & 3;
}
@@ -756,21 +756,21 @@ static WRITE_LINE_DEVICE_HANDLER( turbocs_irq )
static TIMER_CALLBACK( turbocs_delayed_data_w )
{
- device_t *pia = machine->device("tcspia");
+ device_t *pia = machine.device("tcspia");
pia6821_portb_w(pia, 0, (param >> 1) & 0x0f);
pia6821_ca1_w(pia, ~param & 0x01);
/* oftentimes games will write one nibble at a time; the sync on this is very */
/* important, so we boost the interleave briefly while this happens */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
/********* external interfaces ***********/
WRITE8_HANDLER( turbocs_data_w )
{
- space->machine->scheduler().synchronize(FUNC(turbocs_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(turbocs_delayed_data_w), data);
}
READ8_HANDLER( turbocs_status_r )
@@ -778,7 +778,7 @@ READ8_HANDLER( turbocs_status_r )
return turbocs_status;
}
-void turbocs_reset_w(running_machine *machine, int state)
+void turbocs_reset_w(running_machine &machine, int state)
{
device_set_input_line(turbocs_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -853,7 +853,7 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_porta2_w )
static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
{
- device_t *tms = device->machine->device("sntspeech");
+ device_t *tms = device->machine().device("sntspeech");
/* bits 0-1 select read/write strobes on the TMS5200 */
data &= 0x03;
@@ -884,8 +884,8 @@ static WRITE8_DEVICE_HANDLER( squawkntalk_portb2_w )
static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
{
- device_t *pia0 = device->machine->device("sntpia0");
- device_t *pia1 = device->machine->device("sntpia1");
+ device_t *pia0 = device->machine().device("sntpia0");
+ device_t *pia1 = device->machine().device("sntpia1");
int combined_state = pia6821_get_irq_a(pia0) | pia6821_get_irq_b(pia0) | pia6821_get_irq_a(pia1) | pia6821_get_irq_b(pia1);
device_set_input_line(squawkntalk_sound_cpu, M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
@@ -893,7 +893,7 @@ static WRITE_LINE_DEVICE_HANDLER( squawkntalk_irq )
static TIMER_CALLBACK( squawkntalk_delayed_data_w )
{
- device_t *pia0 = machine->device("sntpia0");
+ device_t *pia0 = machine.device("sntpia0");
pia6821_porta_w(pia0, 0, ~param & 0x0f);
pia6821_cb1_w(pia0, ~param & 0x10);
@@ -903,10 +903,10 @@ static TIMER_CALLBACK( squawkntalk_delayed_data_w )
/********* external interfaces ***********/
WRITE8_HANDLER( squawkntalk_data_w )
{
- space->machine->scheduler().synchronize(FUNC(squawkntalk_delayed_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(squawkntalk_delayed_data_w), data);
}
-void squawkntalk_reset_w(running_machine *machine, int state)
+void squawkntalk_reset_w(running_machine &machine, int state)
{
device_set_input_line(squawkntalk_sound_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/audio/mcr.h b/src/mame/audio/mcr.h
index 87f11e469d6..bde55c17505 100644
--- a/src/mame/audio/mcr.h
+++ b/src/mame/audio/mcr.h
@@ -12,31 +12,31 @@
/************ Generic MCR routines ***************/
-void mcr_sound_init(running_machine *machine, UINT8 config);
-void mcr_sound_reset(running_machine *machine);
+void mcr_sound_init(running_machine &machine, UINT8 config);
+void mcr_sound_reset(running_machine &machine);
WRITE8_HANDLER( ssio_data_w );
READ8_HANDLER( ssio_status_r );
READ8_HANDLER( ssio_input_port_r );
WRITE8_HANDLER( ssio_output_port_w );
-void ssio_reset_w(running_machine *machine, int state);
+void ssio_reset_w(running_machine &machine, int state);
void ssio_set_custom_input(int which, int mask, read8_space_func handler);
void ssio_set_custom_output(int which, int mask, write8_space_func handler);
WRITE8_HANDLER( csdeluxe_data_w );
READ8_HANDLER( csdeluxe_status_r );
-void csdeluxe_reset_w(running_machine *machine, int state);
+void csdeluxe_reset_w(running_machine &machine, int state);
WRITE8_HANDLER( turbocs_data_w );
READ8_HANDLER( turbocs_status_r );
-void turbocs_reset_w(running_machine *machine, int state);
+void turbocs_reset_w(running_machine &machine, int state);
WRITE8_HANDLER( soundsgood_data_w );
READ8_HANDLER( soundsgood_status_r );
-void soundsgood_reset_w(running_machine *machine, int state);
+void soundsgood_reset_w(running_machine &machine, int state);
WRITE8_HANDLER( squawkntalk_data_w );
-void squawkntalk_reset_w(running_machine *machine, int state);
+void squawkntalk_reset_w(running_machine &machine, int state);
diff --git a/src/mame/audio/meadows.c b/src/mame/audio/meadows.c
index 2fb65f965f0..88cad32251f 100644
--- a/src/mame/audio/meadows.c
+++ b/src/mame/audio/meadows.c
@@ -30,7 +30,7 @@ static const INT16 waveform[2] = { -120*256, 120*256 };
/************************************/
SAMPLES_START( meadows_sh_start )
{
- meadows_state *state = device->machine->driver_data<meadows_state>();
+ meadows_state *state = device->machine().driver_data<meadows_state>();
state->_0c00 = state->_0c01 = state->_0c02 = state->_0c03 = 0;
state->dac = 0;
state->dac_enable = 0;
@@ -47,10 +47,10 @@ SAMPLES_START( meadows_sh_start )
/************************************/
/* Sound handler update */
/************************************/
-void meadows_sh_update(running_machine *machine)
+void meadows_sh_update(running_machine &machine)
{
- meadows_state *state = machine->driver_data<meadows_state>();
- device_t *samples = machine->device("samples");
+ meadows_state *state = machine.driver_data<meadows_state>();
+ device_t *samples = machine.device("samples");
int preset, amp;
if (state->latched_0c01 != state->_0c01 || state->latched_0c03 != state->_0c03)
@@ -58,7 +58,7 @@ void meadows_sh_update(running_machine *machine)
/* amplitude is a combination of the upper 4 bits of 0c01 */
/* and bit 4 merged from S2650's flag output */
amp = ((state->_0c03 & ENABLE_CTR1) == 0) ? 0 : (state->_0c01 & 0xf0) >> 1;
- if( cpu_get_reg(machine->device("maincpu"), S2650_FO) )
+ if( cpu_get_reg(machine.device("maincpu"), S2650_FO) )
amp += 0x80;
/* calculate frequency for counter #1 */
/* bit 0..3 of 0c01 are ctr preset */
@@ -94,9 +94,9 @@ void meadows_sh_update(running_machine *machine)
state->dac_enable = state->_0c03 & ENABLE_DAC;
if (state->dac_enable)
- dac_data_w(machine->device("dac"), state->dac);
+ dac_data_w(machine.device("dac"), state->dac);
else
- dac_data_w(machine->device("dac"), 0);
+ dac_data_w(machine.device("dac"), 0);
}
state->latched_0c01 = state->_0c01;
@@ -107,14 +107,14 @@ void meadows_sh_update(running_machine *machine)
/************************************/
/* Write DAC value */
/************************************/
-void meadows_sh_dac_w(running_machine *machine, int data)
+void meadows_sh_dac_w(running_machine &machine, int data)
{
- meadows_state *state = machine->driver_data<meadows_state>();
+ meadows_state *state = machine.driver_data<meadows_state>();
state->dac = data;
if (state->dac_enable)
- dac_data_w(machine->device("dac"), state->dac);
+ dac_data_w(machine.device("dac"), state->dac);
else
- dac_data_w(machine->device("dac"), 0);
+ dac_data_w(machine.device("dac"), 0);
}
diff --git a/src/mame/audio/micro3d.c b/src/mame/audio/micro3d.c
index b3ef279284e..93588a92f43 100644
--- a/src/mame/audio/micro3d.c
+++ b/src/mame/audio/micro3d.c
@@ -99,7 +99,7 @@ INLINE double step_cr_filter(filter_state *state, double input)
*
*************************************/
-static void filter_init(running_machine *machine, lp_filter *iir, double fs)
+static void filter_init(running_machine &machine, lp_filter *iir, double fs)
{
/* Section 1 */
iir->ProtoCoef[0].a0 = 1.0;
@@ -178,13 +178,13 @@ static void recompute_filter(lp_filter *iir, double k, double q, double fc)
iir->coef[0] = k;
}
-void micro3d_noise_sh_w(running_machine *machine, UINT8 data)
+void micro3d_noise_sh_w(running_machine &machine, UINT8 data)
{
- micro3d_state *state = machine->driver_data<micro3d_state>();
+ micro3d_state *state = machine.driver_data<micro3d_state>();
if (~data & 8)
{
- device_t *device = machine->device(data & 4 ? "noise_2" : "noise_1");
+ device_t *device = machine.device(data & 4 ? "noise_2" : "noise_1");
noise_state *nstate = (noise_state *)downcast<legacy_device_base *>(device)->token();
if (state->dac_data != nstate->dac[data & 3])
@@ -310,12 +310,12 @@ static STREAM_UPDATE( micro3d_stream_update )
static DEVICE_START( micro3d_sound )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
noise_state *state = get_safe_token(device);
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), state, micro3d_stream_update);
- filter_init(machine, &state->filter, machine->sample_rate());
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), state, micro3d_stream_update);
+ filter_init(machine, &state->filter, machine.sample_rate());
configure_filter(&state->noise_filters[0], 2.7e3 + 2.7e3, 1.0e-6);
configure_filter(&state->noise_filters[1], 2.7e3 + 1e3, 0.30e-6);
@@ -372,7 +372,7 @@ DEVICE_GET_INFO( micro3d_sound )
WRITE8_HANDLER( micro3d_snd_dac_a )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->dac_data = data;
}
@@ -383,7 +383,7 @@ WRITE8_HANDLER( micro3d_snd_dac_b )
WRITE8_HANDLER( micro3d_sound_io_w )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
state->sound_port_latch[offset] = data;
@@ -391,12 +391,12 @@ WRITE8_HANDLER( micro3d_sound_io_w )
{
case 0x01:
{
- micro3d_noise_sh_w(space->machine, data);
+ micro3d_noise_sh_w(space->machine(), data);
break;
}
case 0x03:
{
- device_t *upd = space->machine->device("upd7759");
+ device_t *upd = space->machine().device("upd7759");
upd7759_set_bank_base(upd, (data & 0x4) ? 0x20000 : 0);
upd7759_reset_w(upd, (data & 0x10) ? 0 : 1);
break;
@@ -406,12 +406,12 @@ WRITE8_HANDLER( micro3d_sound_io_w )
READ8_HANDLER( micro3d_sound_io_r )
{
- micro3d_state *state = space->machine->driver_data<micro3d_state>();
+ micro3d_state *state = space->machine().driver_data<micro3d_state>();
switch (offset)
{
- case 0x01: return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine, "SOUND_SW");
- case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine->device("upd7759")) ? 0x08 : 0);
+ case 0x01: return (state->sound_port_latch[offset] & 0x7f) | input_port_read(space->machine(), "SOUND_SW");
+ case 0x03: return (state->sound_port_latch[offset] & 0xf7) | (upd7759_busy_r(space->machine().device("upd7759")) ? 0x08 : 0);
default: return 0;
}
}
diff --git a/src/mame/audio/mw8080bw.c b/src/mame/audio/mw8080bw.c
index 1fef144e856..96464eeb8d1 100644
--- a/src/mame/audio/mw8080bw.c
+++ b/src/mame/audio/mw8080bw.c
@@ -19,7 +19,7 @@
static SOUND_START( samples )
{
- mw8080bw_state *state = machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = machine.driver_data<mw8080bw_state>();
/* setup for save states */
state->save_item(NAME(state->port_1_last));
@@ -165,7 +165,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( seawolf_audio_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* if (data & 0x01) enable SHIP HIT sound */
@@ -183,7 +183,7 @@ WRITE8_HANDLER( seawolf_audio_w )
/* if (data & 0x10) enable MINE HIT sound */
if (rising_bits & 0x10) sample_start(state->samples, 4, 4, 0);
- coin_counter_w(space->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
@@ -231,11 +231,11 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( gunfight_audio_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
/* D0 and D1 are just tied to 1k resistors */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
/* the 74175 latches and inverts the top 4 bits */
switch ((~data >> 4) & 0x0f)
@@ -343,7 +343,7 @@ WRITE8_DEVICE_HANDLER( tornbase_audio_w )
/* if (data & 0x10) enable CHEER sound */
- if (tornbase_get_cabinet_type(device->machine) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
+ if (tornbase_get_cabinet_type(device->machine()) == TORNBASE_CAB_TYPE_UPRIGHT_OLD)
{
/* if (data & 0x20) enable WHISTLE sound */
@@ -356,7 +356,7 @@ WRITE8_DEVICE_HANDLER( tornbase_audio_w )
/* if (data & 0x40) enable WHISTLE sound */
}
- coin_counter_w(device->machine, 0, (data >> 7) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 7) & 0x01);
}
@@ -397,7 +397,7 @@ WRITE8_HANDLER( zzzap_audio_2_w )
before it appears again, not sure what
it is supposed to sound like) */
- coin_counter_w(space->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 0x01);
/* D4, D6 and D7 are not connected */
}
@@ -580,7 +580,7 @@ MACHINE_CONFIG_END
void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
{
/* controls need to be active low */
- int controls = ~input_port_read(device->machine, "IN0") & 0xff;
+ int controls = ~input_port_read(device->machine(), "IN0") & 0xff;
discrete_sound_w(device, MAZE_TONE_TIMING, maze_tone_timing_state);
discrete_sound_w(device, MAZE_P1_DATA, controls & 0x0f);
@@ -592,7 +592,7 @@ void maze_write_discrete(device_t *device, UINT8 maze_tone_timing_state)
/* A better option might be to update it at vblank or set a timer to do it. */
/* The only noticeable difference doing it here, is that the controls don't */
/* imediately start making tones if pressed right after the coin is inserted. */
- discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine, "IN1") >> 3) & 0x01);
+ discrete_sound_w(device, MAZE_COIN, (~input_port_read(device->machine(), "IN1") >> 3) & 0x01);
}
@@ -828,7 +828,7 @@ WRITE8_DEVICE_HANDLER( boothill_audio_w )
{
/* D0 and D1 are not connected */
- coin_counter_w(device->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
discrete_sound_w(device, BOOTHILL_GAME_ON_EN, (data >> 3) & 0x01);
@@ -1059,9 +1059,9 @@ WRITE8_DEVICE_HANDLER( checkmat_audio_w )
discrete_sound_w(device, CHECKMAT_BOOM_EN, (data >> 1) & 0x01);
- coin_counter_w(device->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
- device->machine->sound().system_enable((data >> 3) & 0x01);
+ device->machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, CHECKMAT_TONE_DATA_45, (data >> 4) & 0x03);
discrete_sound_w(device, CHECKMAT_TONE_DATA_67, (data >> 6) & 0x03);
@@ -1268,7 +1268,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
{
/* D0 and D1 are not connected */
- coin_counter_w(device->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 2) & 0x01);
discrete_sound_w(device, DESERTGU_GAME_ON_EN, (data >> 3) & 0x01);
@@ -1284,7 +1284,7 @@ WRITE8_DEVICE_HANDLER( desertgu_audio_1_w )
WRITE8_DEVICE_HANDLER( desertgu_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
discrete_sound_w(device, DESERTGU_ROADRUNNER_BEEP_BEEP_EN, (data >> 0) & 0x01);
@@ -1543,7 +1543,7 @@ WRITE8_DEVICE_HANDLER( dplay_audio_w )
discrete_sound_w(device, DPLAY_GAME_ON_EN, (data >> 4) & 0x01);
- coin_counter_w(device->machine, 0, (data >> 5) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 5) & 0x01);
/* D6 and D7 are not connected */
}
@@ -1593,14 +1593,14 @@ WRITE8_HANDLER( gmissile_audio_1_w )
reversed (D5=R, D7=L), but the software confirms that
ours is right */
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* D0 and D1 are not connected */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
- space->machine->sound().system_enable((data >> 3) & 0x01);
+ space->machine().sound().system_enable((data >> 3) & 0x01);
/* if (data & 0x10) enable RIGHT MISSILE sound (goes to right speaker) */
if (rising_bits & 0x10) sample_start(state->samples2, 0, 0, 0);
@@ -1688,14 +1688,14 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( m4_audio_1_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* D0 and D1 are not connected */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
- space->machine->sound().system_enable((data >> 3) & 0x01);
+ space->machine().sound().system_enable((data >> 3) & 0x01);
/* if (data & 0x10) enable LEFT PLAYER SHOT sound (goes to left speaker) */
if (rising_bits & 0x10) sample_start(state->samples1, 0, 0, 0);
@@ -1715,7 +1715,7 @@ WRITE8_HANDLER( m4_audio_1_w )
WRITE8_HANDLER( m4_audio_2_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* if (data & 0x01) enable LEFT PLAYER EXPLOSION sound via 510K res (goes to left speaker) */
@@ -1950,8 +1950,8 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( clowns_audio_1_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
- coin_counter_w(space->machine, 0, (data >> 0) & 0x01);
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
+ coin_counter_w(space->machine(), 0, (data >> 0) & 0x01);
state->clowns_controller_select = (data >> 1) & 0x01;
@@ -1961,7 +1961,7 @@ WRITE8_HANDLER( clowns_audio_1_w )
WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
discrete_sound_w(device, CLOWNS_POP_BOTTOM_EN, (data >> 0) & 0x01);
@@ -1970,7 +1970,7 @@ WRITE8_DEVICE_HANDLER( clowns_audio_2_w )
discrete_sound_w(device, CLOWNS_POP_TOP_EN, (data >> 2) & 0x01);
- device->machine->sound().system_enable((data >> 3) & 0x01);
+ device->machine().sound().system_enable((data >> 3) & 0x01);
discrete_sound_w(device, CLOWNS_SPRINGBOARD_HIT_EN, (data >> 4) & 0x01);
@@ -2317,13 +2317,13 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( spacwalk_audio_1_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
- coin_counter_w(device->machine, 0, (data >> 0) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 0) & 0x01);
state->clowns_controller_select = (data >> 1) & 0x01;
- device->machine->sound().system_enable((data >> 2) & 0x01);
+ device->machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, SPACWALK_SPACE_SHIP_EN, (data >> 3) & 0x01);
}
@@ -2553,7 +2553,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_1_w )
discrete_sound_w(device, SHUFFLE_ROLLOVER_EN, (data >> 1) & 0x01);
- device->machine->sound().system_enable((data >> 2) & 0x01);
+ device->machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, NODE_29, (data >> 3) & 0x07);
@@ -2569,7 +2569,7 @@ WRITE8_DEVICE_HANDLER( shuffle_audio_2_w )
{
discrete_sound_w(device, SHUFFLE_FOUL_EN, (data >> 0) & 0x01);
- coin_counter_w(device->machine, 0, (data >> 1) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
/* D2-D7 are not connected */
}
@@ -2615,9 +2615,9 @@ WRITE8_HANDLER( dogpatch_audio_w )
{
/* D0 and D1 are most likely not used */
- coin_counter_w(space->machine, 0, (data >> 2) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 2) & 0x01);
- space->machine->sound().system_enable((data >> 3) & 0x01);
+ space->machine().sound().system_enable((data >> 3) & 0x01);
/* if (data & 0x10) enable LEFT SHOOT sound */
@@ -3152,7 +3152,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
{
- device->machine->sound().system_enable((data >> 0) & 0x01);
+ device->machine().sound().system_enable((data >> 0) & 0x01);
/* D1 is marked as 'OPTIONAL SWITCH VIDEO FOR COCKTAIL',
but it is never set by the software */
@@ -3165,7 +3165,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_1_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
/* set WIND SOUND FREQ(data & 0x0f) 0, if no wind */
@@ -3181,7 +3181,7 @@ WRITE8_DEVICE_HANDLER( spcenctr_audio_2_w )
WRITE8_DEVICE_HANDLER( spcenctr_audio_3_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
/* if (data & 0x01) enable SCREECH (hit the sides) sound */
@@ -3234,7 +3234,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( phantom2_audio_1_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_1_last;
/* if (data & 0x01) enable PLAYER SHOT sound */
@@ -3242,10 +3242,10 @@ WRITE8_HANDLER( phantom2_audio_1_w )
/* if (data & 0x02) enable ENEMY SHOT sound */
- space->machine->sound().system_mute(!(data & 0x20));
- space->machine->sound().system_enable((data >> 2) & 0x01);
+ space->machine().sound().system_mute(!(data & 0x20));
+ space->machine().sound().system_enable((data >> 2) & 0x01);
- coin_counter_w(space->machine, 0, (data >> 3) & 0x01);
+ coin_counter_w(space->machine(), 0, (data >> 3) & 0x01);
/* if (data & 0x10) enable RADAR sound */
@@ -3257,7 +3257,7 @@ WRITE8_HANDLER( phantom2_audio_1_w )
WRITE8_HANDLER( phantom2_audio_2_w )
{
- mw8080bw_state *state = space->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = space->machine().driver_data<mw8080bw_state>();
UINT8 rising_bits = data & ~state->port_2_last;
/* D0-D2 are not connected */
@@ -3366,9 +3366,9 @@ WRITE8_DEVICE_HANDLER( bowler_audio_1_w )
{
/* D0 - selects controller on the cocktail PCB */
- coin_counter_w(device->machine, 0, (data >> 1) & 0x01);
+ coin_counter_w(device->machine(), 0, (data >> 1) & 0x01);
- device->machine->sound().system_enable((data >> 2) & 0x01);
+ device->machine().sound().system_enable((data >> 2) & 0x01);
discrete_sound_w(device, BOWLER_FOWL_EN, (data >> 3) & 0x01);
@@ -4088,7 +4088,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn, (~data >> 0) & 0x01); /* saucer sound */
@@ -4097,7 +4097,7 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
/* D6 and D7 are not connected */
}
@@ -4105,13 +4105,13 @@ WRITE8_DEVICE_HANDLER( invaders_audio_1_w )
WRITE8_DEVICE_HANDLER( invaders_audio_2_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
discrete_sound_w(device, INVADERS_NODE(INVADERS_FLEET_DATA, 1), data & 0x0f);
discrete_sound_w(device, INVADERS_NODE(INVADERS_SAUCER_HIT_EN, 1), data & 0x10);
/* the flip screen line is only connected on the cocktail PCB */
- if (invaders_is_cabinet_cocktail(device->machine))
+ if (invaders_is_cabinet_cocktail(device->machine()))
{
state->invaders_flip_screen = (data >> 5) & 0x01;
}
@@ -4721,7 +4721,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn1, (~data >> 0) & 0x01); /* saucer sound */
@@ -4730,7 +4730,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_1_w )
discrete_sound_w(device, INVADERS_NODE(INVADERS_INVADER_HIT_EN, 1), data & 0x08);
discrete_sound_w(device, INVADERS_NODE(INVADERS_BONUS_MISSLE_BASE_EN, 1), data & 0x10);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
/* D6 and D7 are not connected */
}
@@ -4747,7 +4747,7 @@ WRITE8_DEVICE_HANDLER( invad2ct_audio_2_w )
WRITE8_DEVICE_HANDLER( invad2ct_audio_3_w )
{
- mw8080bw_state *state = device->machine->driver_data<mw8080bw_state>();
+ mw8080bw_state *state = device->machine().driver_data<mw8080bw_state>();
sn76477_enable_w(state->sn2, (~data >> 0) & 0x01); /* saucer sound */
diff --git a/src/mame/audio/n8080.c b/src/mame/audio/n8080.c
index 4538eabc672..73b1c2e1308 100644
--- a/src/mame/audio/n8080.c
+++ b/src/mame/audio/n8080.c
@@ -71,7 +71,7 @@ static const sn76477_interface spacefev_sn76477_interface =
static void spacefev_update_SN76477_status( device_t *sn )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
double dblR0 = RES_M(1.0);
double dblR1 = RES_M(1.5);
@@ -101,7 +101,7 @@ static void spacefev_update_SN76477_status( device_t *sn )
static void sheriff_update_SN76477_status( device_t *sn )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
if (state->mono_flop[1])
{
sn76477_vco_voltage_w(sn, 5);
@@ -123,7 +123,7 @@ static void sheriff_update_SN76477_status( device_t *sn )
static void update_SN76477_status( device_t *device )
{
- n8080_state *state = device->machine->driver_data<n8080_state>();
+ n8080_state *state = device->machine().driver_data<n8080_state>();
if (state->n8080_hardware == 1)
{
spacefev_update_SN76477_status(device);
@@ -137,7 +137,7 @@ static void update_SN76477_status( device_t *device )
static void start_mono_flop( device_t *sn, int n, attotime expire )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
state->mono_flop[n] = 1;
update_SN76477_status(sn);
@@ -148,7 +148,7 @@ static void start_mono_flop( device_t *sn, int n, attotime expire )
static void stop_mono_flop( device_t *sn, int n )
{
- n8080_state *state = sn->machine->driver_data<n8080_state>();
+ n8080_state *state = sn->machine().driver_data<n8080_state>();
state->mono_flop[n] = 0;
update_SN76477_status(sn);
@@ -159,14 +159,14 @@ static void stop_mono_flop( device_t *sn, int n )
static TIMER_CALLBACK( stop_mono_flop_callback )
{
- stop_mono_flop(machine->device("snsnd"), param);
+ stop_mono_flop(machine.device("snsnd"), param);
}
-static void spacefev_sound_pins_changed( running_machine *machine )
+static void spacefev_sound_pins_changed( running_machine &machine )
{
- device_t *sn = machine->device("snsnd");
- n8080_state *state = machine->driver_data<n8080_state>();
+ device_t *sn = machine.device("snsnd");
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
if (changes & (1 << 0x3))
@@ -191,15 +191,15 @@ static void spacefev_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
- generic_pulse_irq_line(machine->device("audiocpu"), 0);
+ generic_pulse_irq_line(machine.device("audiocpu"), 0);
}
}
-static void sheriff_sound_pins_changed( running_machine *machine )
+static void sheriff_sound_pins_changed( running_machine &machine )
{
- device_t *sn = machine->device("snsnd");
- n8080_state *state = machine->driver_data<n8080_state>();
+ device_t *sn = machine.device("snsnd");
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
if (changes & (1 << 0x6))
@@ -216,14 +216,14 @@ static void sheriff_sound_pins_changed( running_machine *machine )
}
if (changes & ((1 << 0x2) | (1 << 0x3) | (1 << 0x5)))
{
- generic_pulse_irq_line(machine->device("audiocpu"), 0);
+ generic_pulse_irq_line(machine.device("audiocpu"), 0);
}
}
-static void helifire_sound_pins_changed( running_machine *machine )
+static void helifire_sound_pins_changed( running_machine &machine )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
UINT16 changes = ~state->curr_sound_pins & state->prev_sound_pins;
/* ((state->curr_sound_pins >> 0xa) & 1) not emulated */
@@ -232,14 +232,14 @@ static void helifire_sound_pins_changed( running_machine *machine )
if (changes & (1 << 6))
{
- generic_pulse_irq_line(machine->device("audiocpu"), 0);
+ generic_pulse_irq_line(machine.device("audiocpu"), 0);
}
}
-static void sound_pins_changed( running_machine *machine )
+static void sound_pins_changed( running_machine &machine )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
if (state->n8080_hardware == 1)
spacefev_sound_pins_changed(machine);
@@ -252,9 +252,9 @@ static void sound_pins_changed( running_machine *machine )
}
-static void delayed_sound_1( running_machine *machine, int data )
+static void delayed_sound_1( running_machine &machine, int data )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->curr_sound_pins &= ~(
(1 << 0x7) |
@@ -293,9 +293,9 @@ static TIMER_CALLBACK( delayed_sound_1_callback )
}
-static void delayed_sound_2( running_machine *machine, int data )
+static void delayed_sound_2( running_machine &machine, int data )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->curr_sound_pins &= ~(
(1 << 0x8) |
@@ -329,18 +329,18 @@ static TIMER_CALLBACK( delayed_sound_2_callback )
WRITE8_HANDLER( n8080_sound_1_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_1_callback), data); /* force CPUs to sync */
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_1_callback), data); /* force CPUs to sync */
}
WRITE8_HANDLER( n8080_sound_2_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_2_callback), data); /* force CPUs to sync */
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_2_callback), data); /* force CPUs to sync */
}
static READ8_HANDLER( n8080_8035_p1_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
UINT8 val = 0;
if ((state->curr_sound_pins >> 0xb) & 1) val |= 0x01;
@@ -358,31 +358,31 @@ static READ8_HANDLER( n8080_8035_p1_r )
static READ8_HANDLER( n8080_8035_t0_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x7) & 1;
}
static READ8_HANDLER( n8080_8035_t1_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0xc) & 1;
}
static READ8_HANDLER( helifire_8035_t0_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x3) & 1;
}
static READ8_HANDLER( helifire_8035_t1_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return (state->curr_sound_pins >> 0x4) & 1;
}
static READ8_HANDLER( helifire_8035_external_ram_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
UINT8 val = 0;
if ((state->curr_sound_pins >> 0x7) & 1) val |= 0x01;
@@ -396,27 +396,27 @@ static READ8_HANDLER( helifire_8035_external_ram_r )
static READ8_HANDLER( helifire_8035_p2_r )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
return ((state->curr_sound_pins >> 0xc) & 1) ? 0x10 : 0x00; /* not used */
}
static WRITE8_HANDLER( n8080_dac_w )
{
- dac_data_w(space->machine->device("dac"), data & 0x80);
+ dac_data_w(space->machine().device("dac"), data & 0x80);
}
static WRITE8_HANDLER( helifire_dac_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
- dac_data_w(space->machine->device("dac"), data * state->helifire_dac_volume);
+ n8080_state *state = space->machine().driver_data<n8080_state>();
+ dac_data_w(space->machine().device("dac"), data * state->helifire_dac_volume);
}
static WRITE8_HANDLER( helifire_sound_ctrl_w )
{
- n8080_state *state = space->machine->driver_data<n8080_state>();
+ n8080_state *state = space->machine().driver_data<n8080_state>();
state->helifire_dac_phase = data & 0x80;
/* data & 0x40 not emulated */
@@ -431,14 +431,14 @@ static WRITE8_HANDLER( helifire_sound_ctrl_w )
state->helifire_dac_timing = DECAY_RATE * log(state->helifire_dac_volume);
}
- state->helifire_dac_timing += space->machine->time().as_double();
+ state->helifire_dac_timing += space->machine().time().as_double();
}
static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
{
- device_t *sn = timer.machine->device("snsnd");
- n8080_state *state = timer.machine->driver_data<n8080_state>();
+ device_t *sn = timer.machine().device("snsnd");
+ n8080_state *state = timer.machine().driver_data<n8080_state>();
double voltage = 0;
if (state->mono_flop[2])
@@ -452,8 +452,8 @@ static TIMER_DEVICE_CALLBACK( spacefev_vco_voltage_timer )
static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
{
- n8080_state *state = timer.machine->driver_data<n8080_state>();
- double t = state->helifire_dac_timing - timer.machine->time().as_double();
+ n8080_state *state = timer.machine().driver_data<n8080_state>();
+ double t = state->helifire_dac_timing - timer.machine().time().as_double();
if (state->helifire_dac_phase)
{
@@ -468,11 +468,11 @@ static TIMER_DEVICE_CALLBACK( helifire_dac_volume_timer )
MACHINE_START( spacefev_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
- state->sound_timer[0] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
- state->sound_timer[1] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
- state->sound_timer[2] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[0] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[1] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[2] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
state->save_item(NAME(state->prev_snd_data));
state->save_item(NAME(state->prev_sound_pins));
@@ -483,7 +483,7 @@ MACHINE_START( spacefev_sound )
MACHINE_RESET( spacefev_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->n8080_hardware = 1;
state->mono_flop[0] = 0;
@@ -500,10 +500,10 @@ MACHINE_RESET( spacefev_sound )
MACHINE_START( sheriff_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
- state->sound_timer[0] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
- state->sound_timer[1] = machine->scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[0] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
+ state->sound_timer[1] = machine.scheduler().timer_alloc(FUNC(stop_mono_flop_callback));
state->save_item(NAME(state->prev_snd_data));
state->save_item(NAME(state->prev_sound_pins));
@@ -514,7 +514,7 @@ MACHINE_START( sheriff_sound )
MACHINE_RESET( sheriff_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->n8080_hardware = 2;
state->mono_flop[0] = 0;
@@ -530,7 +530,7 @@ MACHINE_RESET( sheriff_sound )
MACHINE_START( helifire_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->save_item(NAME(state->prev_snd_data));
state->save_item(NAME(state->prev_sound_pins));
@@ -543,7 +543,7 @@ MACHINE_START( helifire_sound )
MACHINE_RESET( helifire_sound )
{
- n8080_state *state = machine->driver_data<n8080_state>();
+ n8080_state *state = machine.driver_data<n8080_state>();
state->n8080_hardware = 3;
state->helifire_dac_volume = 1;
diff --git a/src/mame/audio/namco52.c b/src/mame/audio/namco52.c
index 40db760d817..4aaba9585e3 100644
--- a/src/mame/audio/namco52.c
+++ b/src/mame/audio/namco52.c
@@ -142,7 +142,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
{
namco_52xx_state *state = get_safe_token(device);
- device->machine->scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(namco_52xx_latch_callback), data, (void *)device);
device_set_input_line(state->cpu, 0, ASSERT_LINE);
@@ -154,7 +154,7 @@ WRITE8_DEVICE_HANDLER( namco_52xx_write )
/* the 52xx uses TSTI to check for an interrupt; it also may be handling
a timer interrupt, so we need to ensure the IRQ line is held long enough */
- device->machine->scheduler().timer_set(attotime::from_usec(5*21), FUNC(namco_52xx_irq_clear), 0, (void *)device);
+ device->machine().scheduler().timer_set(attotime::from_usec(5*21), FUNC(namco_52xx_irq_clear), 0, (void *)device);
}
@@ -210,7 +210,7 @@ static DEVICE_START( namco_52xx )
/* find the attached discrete sound device */
assert(intf->discrete != NULL);
- state->discrete = device->machine->device(intf->discrete);
+ state->discrete = device->machine().device(intf->discrete);
assert(state->discrete != NULL);
state->basenode = intf->firstnode;
@@ -220,7 +220,7 @@ static DEVICE_START( namco_52xx )
/* start the external clock */
if (intf->extclock != 0)
- device->machine->scheduler().timer_pulse(attotime(0, intf->extclock), FUNC(external_clock_pulse), 0, device);
+ device->machine().scheduler().timer_pulse(attotime(0, intf->extclock), FUNC(external_clock_pulse), 0, device);
}
diff --git a/src/mame/audio/namco54.c b/src/mame/audio/namco54.c
index 89c90620cb1..633b1a2328d 100644
--- a/src/mame/audio/namco54.c
+++ b/src/mame/audio/namco54.c
@@ -120,7 +120,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
{
namco_54xx_state *state = get_safe_token(device);
- device->machine->scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(namco_54xx_latch_callback), data, (void *)device);
device_set_input_line(state->cpu, 0, ASSERT_LINE);
@@ -129,7 +129,7 @@ WRITE8_DEVICE_HANDLER( namco_54xx_write )
// The input clock to the 06XX interface chip is 64H, that is
// 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
// asserted for one clock cycle ~= 21us.
- device->machine->scheduler().timer_set(attotime::from_usec(21), FUNC(namco_54xx_irq_clear), 0, (void *)device);
+ device->machine().scheduler().timer_set(attotime::from_usec(21), FUNC(namco_54xx_irq_clear), 0, (void *)device);
}
@@ -174,7 +174,7 @@ static DEVICE_START( namco_54xx )
/* find the attached discrete sound device */
assert(config->discrete != NULL);
- state->discrete = device->machine->device(config->discrete);
+ state->discrete = device->machine().device(config->discrete);
assert(state->discrete != NULL);
state->basenode = config->firstnode;
}
diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c
index fcb52ac4e63..1fcb4fdac81 100644
--- a/src/mame/audio/namcoc7x.c
+++ b/src/mame/audio/namcoc7x.c
@@ -77,9 +77,9 @@ void namcoc7x_sound_write16(UINT16 command, UINT32 offset)
namcoc7x_mcuram[offset] = command;
}
-void namcoc7x_on_driver_init(running_machine *machine)
+void namcoc7x_on_driver_init(running_machine &machine)
{
- UINT8 *pROM = (UINT8 *)machine->region("c7x")->base();
+ UINT8 *pROM = (UINT8 *)machine.region("c7x")->base();
device_t *cpu;
// clear the two 16-bits magic values at the start of the rom
@@ -88,7 +88,7 @@ void namcoc7x_on_driver_init(running_machine *machine)
memset(pROM, 0, 4);
// install speedup cheat
- for (cpu = machine->device("maincpu"); cpu != NULL; cpu = cpu->typenext())
+ for (cpu = machine.device("maincpu"); cpu != NULL; cpu = cpu->typenext())
if (cpu->type() == M37702)
cpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x82, 0x83, FUNC(speedup_r), FUNC(speedup_w));
}
diff --git a/src/mame/audio/namcoc7x.h b/src/mame/audio/namcoc7x.h
index f1ba9d7b915..362d9fb443a 100644
--- a/src/mame/audio/namcoc7x.h
+++ b/src/mame/audio/namcoc7x.h
@@ -25,7 +25,7 @@ WRITE32_HANDLER(namcoc7x_soundram32_w);
READ32_HANDLER(namcoc7x_soundram32_r);
void namcoc7x_sound_write16(UINT16 command, UINT32 offset);
-void namcoc7x_on_driver_init(running_machine *machine);
+void namcoc7x_on_driver_init(running_machine &machine);
void namcoc7x_set_host_ram(UINT32 *hostram);
/* BIOS from Prop Cycle used as a substitute until we can trojan the real BIOSes for these games */
diff --git a/src/mame/audio/phoenix.c b/src/mame/audio/phoenix.c
index 4834e937a60..ca5f126c9a9 100644
--- a/src/mame/audio/phoenix.c
+++ b/src/mame/audio/phoenix.c
@@ -225,7 +225,7 @@ INLINE int noise(phoenix_sound_state *state, int samplerate)
static STREAM_UPDATE( phoenix_sound_update )
{
phoenix_sound_state *state = get_safe_token(device);
- int samplerate = device->machine->sample_rate();
+ int samplerate = device->machine().sample_rate();
stream_sample_t *buffer = outputs[0];
while( samples-- > 0 )
@@ -546,10 +546,10 @@ static DEVICE_START( phoenix_sound )
memset(&state->c25_state, 0, sizeof(state->c25_state));
memset(&state->noise_state, 0, sizeof(state->noise_state));
- state->discrete = device->machine->device("discrete");
- state->tms = device->machine->device("tms");
+ state->discrete = device->machine().device("discrete");
+ state->tms = device->machine().device("tms");
- state->poly18 = auto_alloc_array(device->machine, UINT32, 1ul << (18-5));
+ state->poly18 = auto_alloc_array(device->machine(), UINT32, 1ul << (18-5));
shiftreg = 0;
for( i = 0; i < (1ul << (18-5)); i++ )
@@ -566,7 +566,7 @@ static DEVICE_START( phoenix_sound )
state->poly18[i] = bits;
}
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), 0, phoenix_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), 0, phoenix_sound_update);
register_state(device);
}
diff --git a/src/mame/audio/pleiads.c b/src/mame/audio/pleiads.c
index 50e2a59d906..6e7cb2d64fc 100644
--- a/src/mame/audio/pleiads.c
+++ b/src/mame/audio/pleiads.c
@@ -409,7 +409,7 @@ INLINE int noise(pleiads_sound_state *state, int samplerate)
static STREAM_UPDATE( pleiads_sound_update )
{
pleiads_sound_state *state = get_safe_token(device);
- int rate = device->machine->sample_rate();
+ int rate = device->machine().sample_rate();
stream_sample_t *buffer = outputs[0];
while( samples-- > 0 )
@@ -478,8 +478,8 @@ static DEVICE_START( common_sh_start )
UINT32 shiftreg;
state->pc4.level = PC4_MIN;
- state->tms = device->machine->device("tms");
- state->poly18 = auto_alloc_array(device->machine, UINT32, 1ul << (18-5));
+ state->tms = device->machine().device("tms");
+ state->poly18 = auto_alloc_array(device->machine(), UINT32, 1ul << (18-5));
shiftreg = 0;
for( i = 0; i < (1ul << (18-5)); i++ )
@@ -496,7 +496,7 @@ static DEVICE_START( common_sh_start )
state->poly18[i] = bits;
}
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->machine->sample_rate(), NULL, pleiads_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->machine().sample_rate(), NULL, pleiads_sound_update);
}
static DEVICE_START( pleiads_sound )
diff --git a/src/mame/audio/polepos.c b/src/mame/audio/polepos.c
index 8d00f1e7779..e5f80598bed 100644
--- a/src/mame/audio/polepos.c
+++ b/src/mame/audio/polepos.c
@@ -74,13 +74,13 @@ static STREAM_UPDATE( engine_sound_update )
}
/* determine the effective clock rate */
- clock = (device->machine->device("maincpu")->unscaled_clock() / 16) * ((state->sample_msb + 1) * 64 + state->sample_lsb + 1) / (64*64);
+ clock = (device->machine().device("maincpu")->unscaled_clock() / 16) * ((state->sample_msb + 1) * 64 + state->sample_lsb + 1) / (64*64);
step = (clock << 12) / OUTPUT_RATE;
/* determine the volume */
slot = (state->sample_msb >> 3) & 7;
volume = volume_table[slot];
- base = &device->machine->region("engine")->base()[slot * 0x800];
+ base = &device->machine().region("engine")->base()[slot * 0x800];
/* fill in the sample */
while (samples--)
@@ -113,7 +113,7 @@ static STREAM_UPDATE( engine_sound_update )
static DEVICE_START( polepos_sound )
{
polepos_sound_state *state = get_safe_token(device);
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, engine_sound_update);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, NULL, engine_sound_update);
state->sample_msb = state->sample_lsb = 0;
state->sample_enable = 0;
diff --git a/src/mame/audio/polyplay.c b/src/mame/audio/polyplay.c
index 61eb3f0dda9..ad4724ddbc2 100644
--- a/src/mame/audio/polyplay.c
+++ b/src/mame/audio/polyplay.c
@@ -20,7 +20,7 @@
SAMPLES_START( polyplay_sh_start )
{
- polyplay_state *state = device->machine->driver_data<polyplay_state>();
+ polyplay_state *state = device->machine().driver_data<polyplay_state>();
int i;
for (i = 0; i < SAMPLE_LENGTH / 2; i++) {
@@ -34,22 +34,22 @@ SAMPLES_START( polyplay_sh_start )
state->channel_playing2 = 0;
}
-void polyplay_set_channel1(running_machine *machine, int active)
+void polyplay_set_channel1(running_machine &machine, int active)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
+ polyplay_state *state = machine.driver_data<polyplay_state>();
state->channel_playing1 = active;
}
-void polyplay_set_channel2(running_machine *machine, int active)
+void polyplay_set_channel2(running_machine &machine, int active)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
+ polyplay_state *state = machine.driver_data<polyplay_state>();
state->channel_playing2 = active;
}
-void polyplay_play_channel1(running_machine *machine, int data)
+void polyplay_play_channel1(running_machine &machine, int data)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
- device_t *samples = machine->device("samples");
+ polyplay_state *state = machine.driver_data<polyplay_state>();
+ device_t *samples = machine.device("samples");
if (data) {
state->freq1 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 0, state->channel_playing1 * 1.0);
@@ -61,10 +61,10 @@ void polyplay_play_channel1(running_machine *machine, int data)
}
}
-void polyplay_play_channel2(running_machine *machine, int data)
+void polyplay_play_channel2(running_machine &machine, int data)
{
- polyplay_state *state = machine->driver_data<polyplay_state>();
- device_t *samples = machine->device("samples");
+ polyplay_state *state = machine.driver_data<polyplay_state>();
+ device_t *samples = machine.device("samples");
if (data) {
state->freq2 = 2457600 / 16 / data / 8;
sample_set_volume(samples, 1, state->channel_playing2 * 1.0);
diff --git a/src/mame/audio/pulsar.c b/src/mame/audio/pulsar.c
index 3ca90171c6e..94d44018bae 100644
--- a/src/mame/audio/pulsar.c
+++ b/src/mame/audio/pulsar.c
@@ -88,7 +88,7 @@ static int port1State = 0;
WRITE8_HANDLER( pulsar_audio_1_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int bitsChanged;
//int bitsGoneHigh;
int bitsGoneLow;
@@ -139,7 +139,7 @@ WRITE8_HANDLER( pulsar_audio_1_w )
WRITE8_HANDLER( pulsar_audio_2_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
static int port2State = 0;
int bitsChanged;
int bitsGoneHigh;
diff --git a/src/mame/audio/qix.c b/src/mame/audio/qix.c
index 7853e643cab..d424542eed5 100644
--- a/src/mame/audio/qix.c
+++ b/src/mame/audio/qix.c
@@ -109,14 +109,14 @@ static TIMER_CALLBACK( deferred_sndpia1_porta_w )
static WRITE8_DEVICE_HANDLER( sync_sndpia1_porta_w )
{
/* we need to synchronize this so the sound CPU doesn't drop anything important */
- device->machine->scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)device);
+ device->machine().scheduler().synchronize(FUNC(deferred_sndpia1_porta_w), data, (void *)device);
}
static WRITE8_DEVICE_HANDLER( slither_coinctl_w )
{
- coin_lockout_w(device->machine, 0, (~data >> 6) & 1);
- coin_counter_w(device->machine, 0, (data >> 5) & 1);
+ coin_lockout_w(device->machine(), 0, (~data >> 6) & 1);
+ coin_counter_w(device->machine(), 0, (data >> 5) & 1);
}
@@ -132,7 +132,7 @@ static WRITE_LINE_DEVICE_HANDLER( qix_pia_dint )
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
/* DINT is connected to the data CPU's IRQ line */
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -141,7 +141,7 @@ static WRITE_LINE_DEVICE_HANDLER( qix_pia_sint )
int combined_state = pia6821_get_irq_a(device) | pia6821_get_irq_b(device);
/* SINT is connected to the sound CPU's IRQ line */
- cputag_set_input_line(device->machine, "audiocpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6800_IRQ_LINE, combined_state ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c
index 3a58961e1b8..5ecbf9f113f 100644
--- a/src/mame/audio/redalert.c
+++ b/src/mame/audio/redalert.c
@@ -70,13 +70,13 @@ WRITE8_HANDLER( redalert_audio_command_w )
/* D7 is also connected to the NMI input of the CPU -
the NMI is actually toggled by a 74121 */
if ((data & 0x80) == 0x00)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
+ redalert_state *state = device->machine().driver_data<redalert_state>();
/* BC2 is connected to a pull-up resistor, so BC2=1 always */
switch (data & 0x03)
{
@@ -102,14 +102,14 @@ static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
static READ8_HANDLER( redalert_ay8910_latch_1_r )
{
- redalert_state *state = space->machine->driver_data<redalert_state>();
+ redalert_state *state = space->machine().driver_data<redalert_state>();
return state->ay8910_latch_1;
}
static WRITE8_HANDLER( redalert_ay8910_latch_2_w )
{
- redalert_state *state = space->machine->driver_data<redalert_state>();
+ redalert_state *state = space->machine().driver_data<redalert_state>();
state->ay8910_latch_2 = data;
}
@@ -142,7 +142,7 @@ ADDRESS_MAP_END
static SOUND_START( redalert_audio )
{
- redalert_state *state = machine->driver_data<redalert_state>();
+ redalert_state *state = machine.driver_data<redalert_state>();
state->save_item(NAME(state->ay8910_latch_1));
state->save_item(NAME(state->ay8910_latch_2));
}
@@ -157,19 +157,19 @@ static SOUND_START( redalert_audio )
WRITE8_HANDLER( redalert_voice_command_w )
{
soundlatch2_w(space, 0, (data & 0x78) >> 3);
- cputag_set_input_line(space->machine, "voice", I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "voice", I8085_RST75_LINE, (~data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( sod_callback )
{
- hc55516_digit_w(device->machine->device("cvsd"), state);
+ hc55516_digit_w(device->machine().device("cvsd"), state);
}
static READ_LINE_DEVICE_HANDLER( sid_callback )
{
- return hc55516_clock_state_r(device->machine->device("cvsd"));
+ return hc55516_clock_state_r(device->machine().device("cvsd"));
}
@@ -284,29 +284,29 @@ WRITE8_HANDLER( demoneye_audio_command_w )
{
/* the byte is connected to port A of the AY8910 */
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_latch_1_w )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
+ redalert_state *state = device->machine().driver_data<redalert_state>();
state->ay8910_latch_1 = data;
}
static READ8_DEVICE_HANDLER( demoneye_ay8910_latch_2_r )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
+ redalert_state *state = device->machine().driver_data<redalert_state>();
return state->ay8910_latch_2;
}
static WRITE8_DEVICE_HANDLER( demoneye_ay8910_data_w )
{
- redalert_state *state = device->machine->driver_data<redalert_state>();
- device_t *ay1 = device->machine->device("ay1");
- device_t *ay2 = device->machine->device("ay2");
+ redalert_state *state = device->machine().driver_data<redalert_state>();
+ device_t *ay1 = device->machine().device("ay1");
+ device_t *ay2 = device->machine().device("ay2");
switch (state->ay8910_latch_1 & 0x03)
{
@@ -389,7 +389,7 @@ static const pia6821_interface demoneye_pia_intf =
static SOUND_START( demoneye )
{
- redalert_state *state = machine->driver_data<redalert_state>();
+ redalert_state *state = machine.driver_data<redalert_state>();
state->save_item(NAME(state->ay8910_latch_1));
state->save_item(NAME(state->ay8910_latch_2));
}
diff --git a/src/mame/audio/redbaron.c b/src/mame/audio/redbaron.c
index 6f1dd670731..96f2958b171 100644
--- a/src/mame/audio/redbaron.c
+++ b/src/mame/audio/redbaron.c
@@ -189,7 +189,7 @@ static DEVICE_START( redbaron_sound )
redbaron_sound_state *state = get_safe_token(device);
int i;
- state->vol_lookup = auto_alloc_array(device->machine, INT16, 32768);
+ state->vol_lookup = auto_alloc_array(device->machine(), INT16, 32768);
for( i = 0; i < 0x8000; i++ )
state->vol_lookup[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
@@ -223,7 +223,7 @@ static DEVICE_START( redbaron_sound )
state->vol_crash[i] = 32767 * r0 / (r0 + r1);
}
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, 0, redbaron_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, OUTPUT_RATE, 0, redbaron_sound_update);
}
diff --git a/src/mame/audio/scramble.c b/src/mame/audio/scramble.c
index a080ebdb067..d985de1c285 100644
--- a/src/mame/audio/scramble.c
+++ b/src/mame/audio/scramble.c
@@ -45,7 +45,7 @@ static const int scramble_timer[10] =
READ8_DEVICE_HANDLER( scramble_portB_r )
{
- return scramble_timer[(device->machine->device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
+ return scramble_timer[(device->machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
@@ -74,23 +74,23 @@ static const int frogger_timer[10] =
READ8_DEVICE_HANDLER( frogger_portB_r )
{
- return frogger_timer[(device->machine->device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
+ return frogger_timer[(device->machine().device<cpu_device>("audiocpu")->total_cycles()/512) % 10];
}
WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
{
- device_t *target = device->machine->device("konami_7474");
+ device_t *target = device->machine().device("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
ttl7474_clock_w(target, (~data & 0x08) >> 3);
/* bit 4 is sound disable */
- device->machine->sound().system_mute((data & 0x10) >> 4);
+ device->machine().sound().system_mute((data & 0x10) >> 4);
}
WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
{
- device_t *target = device->machine->device("konami_7474");
+ device_t *target = device->machine().device("konami_7474");
/* the complement of bit 3 is connected to the flip-flop's clock */
ttl7474_clock_w(target, (~data & 0x08) >> 3);
@@ -98,7 +98,7 @@ WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
static IRQ_CALLBACK(scramble_sh_irq_callback)
{
- device_t *target = device->machine->device("konami_7474");
+ device_t *target = device->machine().device("konami_7474");
/* interrupt acknowledge clears the flip-flop --
we need to pulse the CLR line because MAME's core never clears this
@@ -114,18 +114,18 @@ WRITE_LINE_DEVICE_HANDLER( scramble_sh_7474_q_callback )
{
/* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */
- cputag_set_input_line(device->machine, "audiocpu", 0, !state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, !state ? ASSERT_LINE : CLEAR_LINE);
}
WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
READ8_DEVICE_HANDLER( hotshock_soundlatch_r )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
- return soundlatch_r(device->machine->device("audiocpu")->memory().space(AS_PROGRAM),0);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE);
+ return soundlatch_r(device->machine().device("audiocpu")->memory().space(AS_PROGRAM),0);
}
static void filter_w(device_t *device, int data)
@@ -144,27 +144,27 @@ static void filter_w(device_t *device, int data)
WRITE8_HANDLER( scramble_filter_w )
{
- filter_w(space->machine->device("filter.1.0"), (offset >> 0) & 3);
- filter_w(space->machine->device("filter.1.1"), (offset >> 2) & 3);
- filter_w(space->machine->device("filter.1.2"), (offset >> 4) & 3);
- filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3);
- filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3);
- filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
+ filter_w(space->machine().device("filter.1.0"), (offset >> 0) & 3);
+ filter_w(space->machine().device("filter.1.1"), (offset >> 2) & 3);
+ filter_w(space->machine().device("filter.1.2"), (offset >> 4) & 3);
+ filter_w(space->machine().device("filter.0.0"), (offset >> 6) & 3);
+ filter_w(space->machine().device("filter.0.1"), (offset >> 8) & 3);
+ filter_w(space->machine().device("filter.0.2"), (offset >> 10) & 3);
}
WRITE8_HANDLER( frogger_filter_w )
{
- filter_w(space->machine->device("filter.0.0"), (offset >> 6) & 3);
- filter_w(space->machine->device("filter.0.1"), (offset >> 8) & 3);
- filter_w(space->machine->device("filter.0.2"), (offset >> 10) & 3);
+ filter_w(space->machine().device("filter.0.0"), (offset >> 6) & 3);
+ filter_w(space->machine().device("filter.0.1"), (offset >> 8) & 3);
+ filter_w(space->machine().device("filter.0.2"), (offset >> 10) & 3);
}
-void scramble_sh_init(running_machine *machine)
+void scramble_sh_init(running_machine &machine)
{
- device_set_irq_callback(machine->device("audiocpu"), scramble_sh_irq_callback);
+ device_set_irq_callback(machine.device("audiocpu"), scramble_sh_irq_callback);
/* PR is always 0, D is always 1 */
- ttl7474_d_w(machine->device("konami_7474"), 1);
+ ttl7474_d_w(machine.device("konami_7474"), 1);
}
diff --git a/src/mame/audio/segag80r.c b/src/mame/audio/segag80r.c
index f5c6b6cb579..f80d9fbce89 100644
--- a/src/mame/audio/segag80r.c
+++ b/src/mame/audio/segag80r.c
@@ -205,7 +205,7 @@ MACHINE_CONFIG_END
static SOUND_START( astrob )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
state_save_register_global(machine, state->sound_rate);
}
@@ -220,12 +220,12 @@ static SOUND_START( astrob )
WRITE8_HANDLER( astrob_sound_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
static const float attack_resistor[10] =
{
120.0f, 82.0f, 62.0f, 56.0f, 47.0f, 39.0f, 33.0f, 27.0f, 24.0f, 22.0f
};
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
float freq_factor;
UINT8 diff = data ^ state->sound_state[offset];
@@ -255,7 +255,7 @@ WRITE8_HANDLER( astrob_sound_w )
if ((data & 0x10) && sample_playing(samples, 4)) sample_stop(samples, 4);
/* MUTE */
- space->machine->sound().system_mute(data & 0x20);
+ space->machine().sound().system_mute(data & 0x20);
/* REFILL: channel 5 */
if (!(data & 0x40) && !sample_playing(samples, 5)) sample_start(samples, 5, 9, FALSE);
@@ -440,7 +440,7 @@ MACHINE_CONFIG_END
static SOUND_START( sega005 )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
state_save_register_global(machine, state->sound_addr);
state_save_register_global(machine, state->sound_data);
@@ -458,8 +458,8 @@ static SOUND_START( sega005 )
static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- device_t *samples = device->machine->device("samples");
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -488,10 +488,10 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_a_w )
}
-INLINE void sega005_update_sound_data(running_machine *machine)
+INLINE void sega005_update_sound_data(running_machine &machine)
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
- UINT8 newval = machine->region("005")->base()[state->sound_addr];
+ segag80r_state *state = machine.driver_data<segag80r_state>();
+ UINT8 newval = machine.region("005")->base()[state->sound_addr];
UINT8 diff = newval ^ state->sound_data;
//mame_printf_debug(" [%03X] = %02X\n", state->sound_addr, newval);
@@ -517,7 +517,7 @@ INLINE void sega005_update_sound_data(running_machine *machine)
static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/*
D6: manual timer clock (0->1)
D5: 0 = manual timer, 1 = auto timer
@@ -547,7 +547,7 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
state->sound_addr = (state->sound_addr & 0x780) | ((state->sound_addr + 1) & 0x07f);
/* update the sound data */
- sega005_update_sound_data(device->machine);
+ sega005_update_sound_data(device->machine());
}
@@ -560,14 +560,14 @@ static WRITE8_DEVICE_HANDLER( sega005_sound_b_w )
static DEVICE_START( sega005_sound )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- running_machine *machine = device->machine;
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ running_machine &machine = device->machine();
/* create the stream */
- state->sega005_stream = device->machine->sound().stream_alloc(*device, 0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update);
+ state->sega005_stream = device->machine().sound().stream_alloc(*device, 0, 1, SEGA005_COUNTER_FREQ, NULL, sega005_stream_update);
/* create a timer for the 555 */
- state->sega005_sound_timer = machine->scheduler().timer_alloc(FUNC(sega005_auto_timer));
+ state->sega005_sound_timer = machine.scheduler().timer_alloc(FUNC(sega005_auto_timer));
/* set the initial sound data */
state->sound_data = 0x00;
@@ -591,8 +591,8 @@ DEVICE_GET_INFO( sega005_sound )
static STREAM_UPDATE( sega005_stream_update )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- const UINT8 *sound_prom = device->machine->region("proms")->base();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ const UINT8 *sound_prom = device->machine().region("proms")->base();
int i;
/* no implementation yet */
@@ -614,7 +614,7 @@ static STREAM_UPDATE( sega005_stream_update )
static TIMER_CALLBACK( sega005_auto_timer )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
/* force an update then clock the sound address if not held in reset */
state->sega005_stream->update();
if ((state->sound_state[1] & 0x20) && !(state->sound_state[1] & 0x10))
@@ -679,7 +679,7 @@ MACHINE_CONFIG_END
static SOUND_START( spaceod )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
}
@@ -693,8 +693,8 @@ static SOUND_START( spaceod )
WRITE8_HANDLER( spaceod_sound_w )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
- device_t *samples = space->machine->device("samples");
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
+ device_t *samples = space->machine().device("samples");
UINT8 diff = data ^ state->sound_state[offset];
state->sound_state[offset] = data;
@@ -863,7 +863,7 @@ MACHINE_CONFIG_END
static SOUND_START( monsterb )
{
- segag80r_state *state = machine->driver_data<segag80r_state>();
+ segag80r_state *state = machine.driver_data<segag80r_state>();
state_save_register_global_array(machine, state->sound_state);
state_save_register_global(machine, state->sound_addr);
state_save_register_global(machine, state->n7751_command);
@@ -880,14 +880,14 @@ static SOUND_START( monsterb )
static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
{
- device_t *tms = device->machine->device("music");
+ device_t *tms = device->machine().device("music");
int enable_val;
/* Lower four data lines get decoded into 13 control lines */
tms36xx_note_w(tms, 0, data & 15);
/* Top four data lines address an 82S123 ROM that enables/disables voices */
- enable_val = device->machine->region("prom")->base()[(data & 0xF0) >> 4];
+ enable_val = device->machine().region("prom")->base()[(data & 0xF0) >> 4];
tms3617_enable_w(tms, enable_val >> 2);
}
@@ -901,8 +901,8 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_a_w )
static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
- device_t *samples = device->machine->device("samples");
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -925,14 +925,14 @@ static WRITE8_DEVICE_HANDLER( monsterb_sound_b_w )
static READ8_DEVICE_HANDLER( n7751_status_r )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
return state->n7751_busy << 4;
}
static WRITE8_DEVICE_HANDLER( n7751_command_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/*
Z80 7751 control port
@@ -940,14 +940,14 @@ static WRITE8_DEVICE_HANDLER( n7751_command_w )
D3 = /INT line
*/
state->n7751_command = data & 0x07;
- cputag_set_input_line(device->machine, "audiocpu", 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ cputag_set_input_line(device->machine(), "audiocpu", 0, ((data & 0x08) == 0) ? ASSERT_LINE : CLEAR_LINE);
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/* P4 - address lines 0-3 */
/* P5 - address lines 4-7 */
/* P6 - address lines 8-11 */
@@ -969,7 +969,7 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
case 3:
state->sound_addr &= 0xfff;
{
- int numroms = device->machine->region("n7751")->bytes() / 0x1000;
+ int numroms = device->machine().region("n7751")->bytes() / 0x1000;
if (!(data & 0x01) && numroms >= 1) state->sound_addr |= 0x0000;
if (!(data & 0x02) && numroms >= 2) state->sound_addr |= 0x1000;
if (!(data & 0x04) && numroms >= 3) state->sound_addr |= 0x2000;
@@ -982,15 +982,15 @@ static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
static READ8_HANDLER( n7751_rom_r )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* read from BUS */
- return space->machine->region("n7751")->base()[state->sound_addr];
+ return space->machine().region("n7751")->base()[state->sound_addr];
}
static READ8_HANDLER( n7751_command_r )
{
- segag80r_state *state = space->machine->driver_data<segag80r_state>();
+ segag80r_state *state = space->machine().driver_data<segag80r_state>();
/* read from P2 - 8255's PC0-2 connects to 7751's S0-2 (P24-P26 on an 8048) */
/* bit 0x80 is an alternate way to control the sample on/off; doesn't appear to be used */
return 0x80 | ((state->n7751_command & 0x07) << 4);
@@ -999,7 +999,7 @@ static READ8_HANDLER( n7751_command_r )
static WRITE8_DEVICE_HANDLER( n7751_p2_w )
{
- segag80r_state *state = device->machine->driver_data<segag80r_state>();
+ segag80r_state *state = device->machine().driver_data<segag80r_state>();
/* write to P2; low 4 bits go to 8243 */
i8243_p2_w(device, offset, data & 0x0f);
diff --git a/src/mame/audio/segag80v.c b/src/mame/audio/segag80v.c
index c18ab02adae..606c69deb5f 100644
--- a/src/mame/audio/segag80v.c
+++ b/src/mame/audio/segag80v.c
@@ -137,7 +137,7 @@ d0 crafts joining
WRITE8_HANDLER( elim1_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* Play fireball sample */
@@ -171,7 +171,7 @@ WRITE8_HANDLER( elim1_sh_w )
WRITE8_HANDLER( elim2_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* Play thrust sample */
@@ -198,7 +198,7 @@ WRITE8_HANDLER( elim2_sh_w )
WRITE8_HANDLER( zektor1_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
@@ -233,7 +233,7 @@ WRITE8_HANDLER( zektor1_sh_w )
WRITE8_HANDLER( zektor2_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* Play thrust sample */
@@ -261,7 +261,7 @@ WRITE8_HANDLER( zektor2_sh_w )
WRITE8_HANDLER( spacfury1_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* craft growing */
@@ -298,7 +298,7 @@ WRITE8_HANDLER( spacfury1_sh_w )
WRITE8_HANDLER( spacfury2_sh_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
data ^= 0xff;
/* craft joining */
diff --git a/src/mame/audio/segasnd.c b/src/mame/audio/segasnd.c
index 50388ed8e50..d6ba0410c1f 100644
--- a/src/mame/audio/segasnd.c
+++ b/src/mame/audio/segasnd.c
@@ -168,7 +168,7 @@ static READ8_HANDLER( speech_p1_r )
static READ8_HANDLER( speech_rom_r )
{
- return space->machine->region("speech")->base()[0x100 * (speech_p2 & 0x3f) + offset];
+ return space->machine().region("speech")->base()[0x100 * (speech_p2 & 0x3f) + offset];
}
static WRITE8_HANDLER( speech_p1_w )
@@ -222,7 +222,7 @@ static TIMER_CALLBACK( delayed_speech_w )
WRITE8_HANDLER( sega_speech_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_speech_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_speech_w), data);
}
@@ -308,7 +308,7 @@ static TIMER_DEVICE_CALLBACK( increment_t1_clock )
}
-void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask)
+void sega_usb_reset(running_machine &machine, UINT8 t1_clock_mask)
{
/* halt the USB CPU at reset time */
device_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE);
@@ -356,10 +356,10 @@ static TIMER_CALLBACK( delayed_usb_data_w )
WRITE8_HANDLER( sega_usb_data_w )
{
LOG(("%04X:usb_data_w = %02X\n", cpu_get_pc(space->cpu), data));
- space->machine->scheduler().synchronize(FUNC(delayed_usb_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_usb_data_w), data);
/* boost the interleave so that sequences can be sent */
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(250));
}
@@ -638,19 +638,19 @@ static STREAM_UPDATE( usb_stream_update )
static DEVICE_START( usb_sound )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
filter_state temp;
int tchan, tgroup;
/* find the CPU we are associated with */
- usb.cpu = machine->device("usbcpu");
+ usb.cpu = machine.device("usbcpu");
assert(usb.cpu != NULL);
/* allocate work RAM */
usb.work_ram = auto_alloc_array(machine, UINT8, 0x400);
/* create a sound stream */
- usb.stream = device->machine->sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, usb_stream_update);
+ usb.stream = device->machine().sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, usb_stream_update);
/* initialize state */
usb.noise_shift = 0x15555;
diff --git a/src/mame/audio/segasnd.h b/src/mame/audio/segasnd.h
index cd17b92bc4b..2690a8d0d61 100644
--- a/src/mame/audio/segasnd.h
+++ b/src/mame/audio/segasnd.h
@@ -14,7 +14,7 @@ WRITE8_HANDLER( sega_speech_control_w );
MACHINE_CONFIG_EXTERN( sega_universal_sound_board );
MACHINE_CONFIG_EXTERN( sega_universal_sound_board_rom );
-void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask);
+void sega_usb_reset(running_machine &machine, UINT8 t1_clock_mask);
READ8_HANDLER( sega_usb_status_r );
WRITE8_HANDLER( sega_usb_data_w );
diff --git a/src/mame/audio/seibu.c b/src/mame/audio/seibu.c
index 74337dc95e7..8a6de3f282c 100644
--- a/src/mame/audio/seibu.c
+++ b/src/mame/audio/seibu.c
@@ -101,11 +101,11 @@ static UINT8 decrypt_opcode(int a,int src)
return src;
}
-void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length)
+void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length)
{
- address_space *space = machine->device(cpu)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
- UINT8 *rom = machine->region(cpu)->base();
+ UINT8 *rom = machine.region(cpu)->base();
int i;
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
@@ -170,12 +170,12 @@ static STREAM_UPDATE( seibu_adpcm_callback )
static DEVICE_START( seibu_adpcm )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<legacy_device_base *>(device)->token();
state->playing = 0;
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
- state->base = machine->region("adpcm")->base();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, seibu_adpcm_callback);
+ state->base = machine.region("adpcm")->base();
state->adpcm.reset();
}
@@ -200,10 +200,10 @@ DEVICE_GET_INFO( seibu_adpcm )
// simplify PCB layout/routing rather than intentional protection, but it
// still fits, especially since the Z80s for all these games are truly encrypted.
-void seibu_adpcm_decrypt(running_machine *machine, const char *region)
+void seibu_adpcm_decrypt(running_machine &machine, const char *region)
{
- UINT8 *ROM = machine->region(region)->base();
- int len = machine->region(region)->bytes();
+ UINT8 *ROM = machine.region(region)->base();
+ int len = machine.region(region)->bytes();
int i;
for (i = 0; i < len; i++)
@@ -263,7 +263,7 @@ enum
RST18_CLEAR
};
-static void update_irq_lines(running_machine *machine, int param)
+static void update_irq_lines(running_machine &machine, int param)
{
static int irq1,irq2;
@@ -299,7 +299,7 @@ static void update_irq_lines(running_machine *machine, int param)
WRITE8_HANDLER( seibu_irq_clear_w )
{
/* Denjin Makai and SD Gundam doesn't like this, it's tied to the rst18 ack ONLY so it could be related to it. */
- //update_irq_lines(space->machine, VECTOR_INIT);
+ //update_irq_lines(space->machine(), VECTOR_INIT);
}
WRITE8_HANDLER( seibu_rst10_ack_w )
@@ -309,32 +309,32 @@ WRITE8_HANDLER( seibu_rst10_ack_w )
WRITE8_HANDLER( seibu_rst18_ack_w )
{
- update_irq_lines(space->machine, RST18_CLEAR);
+ update_irq_lines(space->machine(), RST18_CLEAR);
}
void seibu_ym3812_irqhandler(device_t *device, int linestate)
{
- update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR);
+ update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
}
void seibu_ym2151_irqhandler(device_t *device, int linestate)
{
- update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR);
+ update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
}
void seibu_ym2203_irqhandler(device_t *device, int linestate)
{
- update_irq_lines(device->machine, linestate ? RST10_ASSERT : RST10_CLEAR);
+ update_irq_lines(device->machine(), linestate ? RST10_ASSERT : RST10_CLEAR);
}
/***************************************************************************/
MACHINE_RESET( seibu_sound )
{
- int romlength = machine->region("audiocpu")->bytes();
- UINT8 *rom = machine->region("audiocpu")->base();
+ int romlength = machine.region("audiocpu")->bytes();
+ UINT8 *rom = machine.region("audiocpu")->base();
- sound_cpu = machine->device("audiocpu");
+ sound_cpu = machine.device("audiocpu");
update_irq_lines(machine, VECTOR_INIT);
if (romlength > 0x10000)
{
@@ -352,13 +352,13 @@ static int main2sub_pending,sub2main_pending;
WRITE8_HANDLER( seibu_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
WRITE8_HANDLER( seibu_coin_w )
{
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 2);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 2);
}
READ8_HANDLER( seibu_soundlatch_r )
@@ -411,7 +411,7 @@ WRITE16_HANDLER( seibu_main_word_w )
main2sub[offset] = data;
break;
case 4:
- update_irq_lines(space->machine, RST18_ASSERT);
+ update_irq_lines(space->machine(), RST18_ASSERT);
break;
case 2: //Sengoku Mahjong writes here
case 6:
@@ -443,7 +443,7 @@ WRITE16_HANDLER( seibu_main_mustb_w )
// logerror("seibu_main_mustb_w: %x -> %x %x\n", data, main2sub[0], main2sub[1]);
- update_irq_lines(space->machine, RST18_ASSERT);
+ update_irq_lines(space->machine(), RST18_ASSERT);
}
/***************************************************************************/
diff --git a/src/mame/audio/seibu.h b/src/mame/audio/seibu.h
index 9cead069e8f..0ac388fa6e1 100644
--- a/src/mame/audio/seibu.h
+++ b/src/mame/audio/seibu.h
@@ -57,9 +57,9 @@ READ8_HANDLER( seibu_soundlatch_r );
READ8_HANDLER( seibu_main_data_pending_r );
WRITE8_HANDLER( seibu_main_data_w );
MACHINE_RESET( seibu_sound );
-void seibu_sound_decrypt(running_machine *machine,const char *cpu,int length);
+void seibu_sound_decrypt(running_machine &machine,const char *cpu,int length);
-void seibu_adpcm_decrypt(running_machine *machine, const char *region);
+void seibu_adpcm_decrypt(running_machine &machine, const char *region);
WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w );
WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w );
diff --git a/src/mame/audio/senjyo.c b/src/mame/audio/senjyo.c
index 99a7ddf314e..4d91e70d33b 100644
--- a/src/mame/audio/senjyo.c
+++ b/src/mame/audio/senjyo.c
@@ -19,7 +19,7 @@ const z80_daisy_config senjyo_daisy_chain[] =
static READ8_DEVICE_HANDLER( pio_pa_r )
{
- senjyo_state *state = device->machine->driver_data<senjyo_state>();
+ senjyo_state *state = device->machine().driver_data<senjyo_state>();
return state->sound_cmd;
}
@@ -48,8 +48,8 @@ Z80CTC_INTERFACE( senjyo_ctc_intf )
WRITE8_HANDLER( senjyo_volume_w )
{
- senjyo_state *state = space->machine->driver_data<senjyo_state>();
- samples_device *samples = space->machine->device<samples_device>("samples");
+ senjyo_state *state = space->machine().driver_data<senjyo_state>();
+ samples_device *samples = space->machine().device<samples_device>("samples");
state->single_volume = data & 0x0f;
sample_set_volume(samples, 0, state->single_volume / 15.0);
@@ -58,11 +58,11 @@ WRITE8_HANDLER( senjyo_volume_w )
static TIMER_CALLBACK( senjyo_sh_update )
{
- device_t *samples = machine->device("samples");
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ device_t *samples = machine.device("samples");
+ senjyo_state *state = machine.driver_data<senjyo_state>();
/* ctc2 timer single tone generator frequency */
- z80ctc_device *ctc = machine->device<z80ctc_device>("z80ctc");
+ z80ctc_device *ctc = machine.device<z80ctc_device>("z80ctc");
attotime period = ctc->period(2);
if (period != attotime::zero)
state->single_rate = ATTOSECONDS_TO_HZ(period.attoseconds);
@@ -75,8 +75,8 @@ static TIMER_CALLBACK( senjyo_sh_update )
SAMPLES_START( senjyo_sh_start )
{
- running_machine *machine = device->machine;
- senjyo_state *state = machine->driver_data<senjyo_state>();
+ running_machine &machine = device->machine();
+ senjyo_state *state = machine.driver_data<senjyo_state>();
int i;
state->single_data = auto_alloc_array(machine, INT16, SINGLE_LENGTH);
@@ -90,5 +90,5 @@ SAMPLES_START( senjyo_sh_start )
sample_set_volume(device, 0, state->single_volume / 15.0);
sample_start_raw(device, 0, state->single_data, SINGLE_LENGTH, state->single_rate, 1);
- machine->scheduler().timer_pulse(machine->primary_screen->frame_period(), FUNC(senjyo_sh_update));
+ machine.scheduler().timer_pulse(machine.primary_screen->frame_period(), FUNC(senjyo_sh_update));
}
diff --git a/src/mame/audio/skyraid.c b/src/mame/audio/skyraid.c
index c091c7e2f2d..9e11c7e1b2a 100644
--- a/src/mame/audio/skyraid.c
+++ b/src/mame/audio/skyraid.c
@@ -295,7 +295,7 @@ WRITE8_DEVICE_HANDLER( skyraid_sound_w )
discrete_sound_w(device, SKYRAID_PLANE_SWEEP_EN, data & 0x01);
discrete_sound_w(device, SKYRAID_MISSILE_EN, data & 0x02);
discrete_sound_w(device, SKYRAID_EXPLOSION_EN, data & 0x04);
- set_led_status(device->machine, 0, !(data & 0x08));
+ set_led_status(device->machine(), 0, !(data & 0x08));
discrete_sound_w(device, SKYRAID_PLANE_ON_EN, data & 0x10);
discrete_sound_w(device, SKYRAID_ATTRACT_EN, data & 0x20);
}
diff --git a/src/mame/audio/snes_snd.c b/src/mame/audio/snes_snd.c
index bcf621323fe..b5bc396f691 100644
--- a/src/mame/audio/snes_snd.c
+++ b/src/mame/audio/snes_snd.c
@@ -1171,7 +1171,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
if ((data & 0x80) != (spc700->ram[0xf1] & 0x80))
{
if (data & 0x80)
- memcpy(spc700->ipl_region, device->machine->region("user5")->base(), 64);
+ memcpy(spc700->ipl_region, device->machine().region("user5")->base(), 64);
else
memcpy(spc700->ipl_region, &spc700->ram[0xffc0], 64);
}
@@ -1188,7 +1188,7 @@ WRITE8_DEVICE_HANDLER( spc_io_w )
case 0x7: /* Port 3 */
// mame_printf_debug("SPC: %02x to APU @ %d (PC=%x)\n", data, offset & 3, cpu_get_pc(space->cpu));
spc700->port_out[offset - 4] = data;
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(20));
break;
case 0xa: /* Timer 0 */
case 0xb: /* Timer 1 */
@@ -1309,26 +1309,26 @@ static void state_register( device_t *device )
static DEVICE_START( snes_sound )
{
snes_sound_state *spc700 = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
- spc700->channel = device->machine->sound().stream_alloc(*device, 0, 2, 32000, 0, snes_sh_update);
+ spc700->channel = device->machine().sound().stream_alloc(*device, 0, 2, 32000, 0, snes_sh_update);
- spc700->ram = auto_alloc_array_clear(device->machine, UINT8, SNES_SPCRAM_SIZE);
+ spc700->ram = auto_alloc_array_clear(device->machine(), UINT8, SNES_SPCRAM_SIZE);
/* default to ROM visible */
spc700->ram[0xf1] = 0x80;
/* put IPL image at the top of RAM */
- memcpy(spc700->ipl_region, machine->region("user5")->base(), 64);
+ memcpy(spc700->ipl_region, machine.region("user5")->base(), 64);
/* Initialize the timers */
- spc700->timer[0] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
+ spc700->timer[0] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
spc700->timer[0]->adjust(attotime::from_hz(8000), 0, attotime::from_hz(8000));
spc700->timer[0]->enable(false);
- spc700->timer[1] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
+ spc700->timer[1] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
spc700->timer[1]->adjust(attotime::from_hz(8000), 1, attotime::from_hz(8000));
spc700->timer[1]->enable(false);
- spc700->timer[2] = machine->scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
+ spc700->timer[2] = machine.scheduler().timer_alloc(FUNC(snes_spc_timer), spc700);
spc700->timer[2]->adjust(attotime::from_hz(64000), 2, attotime::from_hz(64000));
spc700->timer[2]->enable(false);
diff --git a/src/mame/audio/snk6502.c b/src/mame/audio/snk6502.c
index 01669f4d1fb..5ccdb7d356b 100644
--- a/src/mame/audio/snk6502.c
+++ b/src/mame/audio/snk6502.c
@@ -618,9 +618,9 @@ static void build_waveform(snk6502_sound_state *state, int channel, int mask)
tone_channels[channel].form[i] *= 65535 / 160;
}
-void snk6502_set_music_freq(running_machine *machine, int freq)
+void snk6502_set_music_freq(running_machine &machine, int freq)
{
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->tone_channels;
@@ -640,9 +640,9 @@ void snk6502_set_music_freq(running_machine *machine, int freq)
}
}
-void snk6502_set_music_clock(running_machine *machine, double clock_time)
+void snk6502_set_music_clock(running_machine &machine, double clock_time)
{
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
state->tone_clock_expire = clock_time * SAMPLE_RATE * FRAC_ONE;
@@ -653,16 +653,16 @@ static DEVICE_START( snk6502_sound )
{
snk6502_sound_state *state = get_safe_token(device);
- state->samples = device->machine->device("samples");
- state->ROM = device->machine->region("snk6502")->base();
+ state->samples = device->machine().device("samples");
+ state->ROM = device->machine().region("snk6502")->base();
// adjusted
- snk6502_set_music_freq(device->machine, 43000);
+ snk6502_set_music_freq(device->machine(), 43000);
// 38.99 Hz update (according to schematic)
- snk6502_set_music_clock(device->machine, M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));
+ snk6502_set_music_clock(device->machine(), M_LN2 * (RES_K(18) * 2 + RES_K(1)) * CAP_U(1));
- state->tone_stream = device->machine->sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, snk6502_tone_update);
+ state->tone_stream = device->machine().sound().stream_alloc(*device, 0, 1, SAMPLE_RATE, NULL, snk6502_tone_update);
}
DEVICE_GET_INFO( snk6502_sound )
@@ -681,9 +681,9 @@ DEVICE_GET_INFO( snk6502_sound )
}
}
-int snk6502_music0_playing(running_machine *machine)
+int snk6502_music0_playing(running_machine &machine)
{
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->tone_channels;
@@ -693,7 +693,7 @@ int snk6502_music0_playing(running_machine *machine)
WRITE8_HANDLER( sasuke_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
TONE *tone_channels = state->tone_channels;
@@ -763,7 +763,7 @@ WRITE8_HANDLER( sasuke_sound_w )
WRITE8_HANDLER( satansat_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
TONE *tone_channels = state->tone_channels;
@@ -830,7 +830,7 @@ WRITE8_HANDLER( satansat_sound_w )
WRITE8_HANDLER( vanguard_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
TONE *tone_channels = state->tone_channels;
@@ -880,7 +880,7 @@ WRITE8_HANDLER( vanguard_sound_w )
}
/* SHOT B */
- sn76477_enable_w(space->machine->device("sn76477.2"), (data & 0x40) ? 0 : 1);
+ sn76477_enable_w(space->machine().device("sn76477.2"), (data & 0x40) ? 0 : 1);
state->LastPort1 = data;
break;
@@ -931,7 +931,7 @@ WRITE8_HANDLER( vanguard_sound_w )
WRITE8_HANDLER( fantasy_sound_w )
{
- device_t *device = space->machine->device("snk6502");
+ device_t *device = space->machine().device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
TONE *tone_channels = state->tone_channels;
@@ -974,7 +974,7 @@ WRITE8_HANDLER( fantasy_sound_w )
}
/* BOMB */
- discrete_sound_w(space->machine->device("discrete"), FANTASY_BOMB_EN, data & 0x80);
+ discrete_sound_w(space->machine().device("discrete"), FANTASY_BOMB_EN, data & 0x80);
state->LastPort1 = data;
break;
@@ -1070,7 +1070,7 @@ WRITE8_HANDLER( fantasy_sound_w )
#define HD68880_SYBS 0x0f
-static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16 *table, int start)
+static void snk6502_speech_w(running_machine &machine, UINT8 data, const UINT16 *table, int start)
{
/*
bit description
@@ -1084,7 +1084,7 @@ static void snk6502_speech_w(running_machine *machine, UINT8 data, const UINT16
7
*/
- device_t *device = machine->device("snk6502");
+ device_t *device = machine.device("snk6502");
snk6502_sound_state *state = get_safe_token(device);
device_t *samples = state->samples;
@@ -1237,7 +1237,7 @@ WRITE8_HANDLER( vanguard_speech_w )
0x054ce
};
- snk6502_speech_w(space->machine, data, vanguard_table, 2);
+ snk6502_speech_w(space->machine(), data, vanguard_table, 2);
}
WRITE8_HANDLER( fantasy_speech_w )
@@ -1262,7 +1262,7 @@ WRITE8_HANDLER( fantasy_speech_w )
0
};
- snk6502_speech_w(space->machine, data, fantasy_table, 0);
+ snk6502_speech_w(space->machine(), data, fantasy_table, 0);
}
diff --git a/src/mame/audio/spacefb.c b/src/mame/audio/spacefb.c
index 27e9c12a3ea..5ebba454cb9 100644
--- a/src/mame/audio/spacefb.c
+++ b/src/mame/audio/spacefb.c
@@ -13,31 +13,31 @@
READ8_HANDLER( spacefb_audio_p2_r )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
return (state->sound_latch & 0x18) << 1;
}
READ8_HANDLER( spacefb_audio_t0_r )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
return state->sound_latch & 0x20;
}
READ8_HANDLER( spacefb_audio_t1_r )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
return state->sound_latch & 0x04;
}
WRITE8_HANDLER( spacefb_port_1_w )
{
- spacefb_state *state = space->machine->driver_data<spacefb_state>();
- device_t *samples = space->machine->device("samples");
+ spacefb_state *state = space->machine().driver_data<spacefb_state>();
+ device_t *samples = space->machine().device("samples");
- cputag_set_input_line(space->machine, "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (data & 0x02) ? CLEAR_LINE : ASSERT_LINE);
/* enemy killed */
if (!(data & 0x01) && (state->sound_latch & 0x01)) sample_start(samples, 0,0,0);
diff --git a/src/mame/audio/starwars.c b/src/mame/audio/starwars.c
index 48f883f64a9..76e1c2d0123 100644
--- a/src/mame/audio/starwars.c
+++ b/src/mame/audio/starwars.c
@@ -18,8 +18,8 @@
SOUND_START( starwars )
{
- starwars_state *state = machine->driver_data<starwars_state>();
- state->riot = machine->device("riot");
+ starwars_state *state = machine.driver_data<starwars_state>();
+ state->riot = machine.device("riot");
}
@@ -44,7 +44,7 @@ static READ8_DEVICE_HANDLER( r6532_porta_r )
/* Note: bit 4 is always set to avoid sound self test */
UINT8 olddata = riot6532_porta_in_get(device);
- return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine->device("tms")) << 2);
+ return (olddata & 0xc0) | 0x10 | (tms5220_readyq_r(device->machine().device("tms")) << 2);
}
@@ -59,7 +59,7 @@ static WRITE8_DEVICE_HANDLER( r6532_porta_w )
static WRITE_LINE_DEVICE_HANDLER( snd_interrupt )
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, state);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_IRQ_LINE, state);
}
@@ -83,16 +83,16 @@ const riot6532_interface starwars_riot6532_intf =
static TIMER_CALLBACK( sound_callback )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x40, 0x40);
state->main_data = param;
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
READ8_HANDLER( starwars_sin_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x00, 0x80);
return state->sound_data;
}
@@ -100,7 +100,7 @@ READ8_HANDLER( starwars_sin_r )
WRITE8_HANDLER( starwars_sout_w )
{
- space->machine->scheduler().synchronize(FUNC(sound_callback), data);
+ space->machine().scheduler().synchronize(FUNC(sound_callback), data);
}
@@ -113,7 +113,7 @@ WRITE8_HANDLER( starwars_sout_w )
READ8_HANDLER( starwars_main_read_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x00, 0x40);
return state->main_data;
}
@@ -121,32 +121,32 @@ READ8_HANDLER( starwars_main_read_r )
READ8_HANDLER( starwars_main_ready_flag_r )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
return riot6532_porta_in_get(state->riot) & 0xc0; /* only upper two flag bits mapped */
}
static TIMER_CALLBACK( main_callback )
{
- starwars_state *state = machine->driver_data<starwars_state>();
+ starwars_state *state = machine.driver_data<starwars_state>();
if (riot6532_porta_in_get(state->riot) & 0x80)
logerror("Sound data not read %x\n",state->sound_data);
riot6532_porta_in_set(state->riot, 0x80, 0x80);
state->sound_data = param;
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
WRITE8_HANDLER( starwars_main_wr_w )
{
- space->machine->scheduler().synchronize(FUNC(main_callback), data);
+ space->machine().scheduler().synchronize(FUNC(main_callback), data);
}
WRITE8_HANDLER( starwars_soundrst_w )
{
- starwars_state *state = space->machine->driver_data<starwars_state>();
+ starwars_state *state = space->machine().driver_data<starwars_state>();
riot6532_porta_in_set(state->riot, 0x00, 0xc0);
/* reset sound CPU here */
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, PULSE_LINE);
}
diff --git a/src/mame/audio/suna8.c b/src/mame/audio/suna8.c
index 85fa45cc5a0..05275dbcc1b 100644
--- a/src/mame/audio/suna8.c
+++ b/src/mame/audio/suna8.c
@@ -13,7 +13,7 @@
WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
if( data )
{
if( ~data & 0x10 )
@@ -30,7 +30,7 @@ WRITE8_DEVICE_HANDLER( suna8_play_samples_w )
WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
if( data )
{
if(( state->sample != 0 ) && ( ~data & 0x30 )) // don't play state->sample zero when the bit is active
@@ -42,16 +42,16 @@ WRITE8_DEVICE_HANDLER( rranger_play_samples_w )
WRITE8_DEVICE_HANDLER( suna8_samples_number_w )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
state->sample = data & 0xf;
}
SAMPLES_START( suna8_sh_start )
{
- suna8_state *state = device->machine->driver_data<suna8_state>();
- running_machine *machine = device->machine;
- int i, len = machine->region("samples")->bytes();
- UINT8 *ROM = machine->region("samples")->base();
+ suna8_state *state = device->machine().driver_data<suna8_state>();
+ running_machine &machine = device->machine();
+ int i, len = machine.region("samples")->bytes();
+ UINT8 *ROM = machine.region("samples")->base();
state->samplebuf = auto_alloc_array(machine, INT16, len);
diff --git a/src/mame/audio/t5182.c b/src/mame/audio/t5182.c
index 432501def0f..46e263e74cd 100644
--- a/src/mame/audio/t5182.c
+++ b/src/mame/audio/t5182.c
@@ -199,7 +199,7 @@ static TIMER_CALLBACK( setirq_callback )
break;
}
- cpu = machine->device(CPUTAG_T5182);
+ cpu = machine.device(CPUTAG_T5182);
if (cpu == NULL)
return;
@@ -214,25 +214,25 @@ static TIMER_CALLBACK( setirq_callback )
WRITE8_HANDLER( t5182_sound_irq_w )
{
- space->machine->scheduler().synchronize(FUNC(setirq_callback), CPU_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setirq_callback), CPU_ASSERT);
}
static WRITE8_HANDLER( t5182_ym2151_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setirq_callback), YM2151_ACK);
+ space->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ACK);
}
static WRITE8_HANDLER( t5182_cpu_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setirq_callback), CPU_CLEAR);
}
static void t5182_ym2151_irq_handler(device_t *device, int irq)
{
if (irq)
- device->machine->scheduler().synchronize(FUNC(setirq_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setirq_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setirq_callback), YM2151_CLEAR);
}
diff --git a/src/mame/audio/taito_en.c b/src/mame/audio/taito_en.c
index 2dac10af581..3f6936cc780 100644
--- a/src/mame/audio/taito_en.c
+++ b/src/mame/audio/taito_en.c
@@ -44,7 +44,7 @@ static WRITE16_HANDLER(f3_68000_share_w)
static WRITE16_HANDLER( f3_es5505_bank_w )
{
- UINT32 max_banks_this_game=(space->machine->region("ensoniq.0")->bytes()/0x200000)-1;
+ UINT32 max_banks_this_game=(space->machine().region("ensoniq.0")->bytes()/0x200000)-1;
#if 0
{
@@ -56,7 +56,7 @@ static WRITE16_HANDLER( f3_es5505_bank_w )
/* mask out unused bits */
data &= max_banks_this_game;
- es5505_voice_bank_w(space->machine->device("ensoniq"),offset,data<<20);
+ es5505_voice_bank_w(space->machine().device("ensoniq"),offset,data<<20);
}
static WRITE16_HANDLER( f3_volume_w )
@@ -82,8 +82,8 @@ static TIMER_DEVICE_CALLBACK( taito_en_timer_callback )
/* Only cause IRQ if the mask is set to allow it */
if (m68681_imr & 0x08)
{
- device_set_input_line_vector(timer.machine->device("audiocpu"), 6, vector_reg);
- cputag_set_input_line(timer.machine, "audiocpu", 6, ASSERT_LINE);
+ device_set_input_line_vector(timer.machine().device("audiocpu"), 6, vector_reg);
+ cputag_set_input_line(timer.machine(), "audiocpu", 6, ASSERT_LINE);
imr_status |= 0x08;
}
}
@@ -103,7 +103,7 @@ static READ16_HANDLER(f3_68681_r)
/* IRQ ack */
if (offset == 0x0f)
{
- cputag_set_input_line(space->machine, "audiocpu", 6, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 6, CLEAR_LINE);
return 0;
}
@@ -128,7 +128,7 @@ static WRITE16_HANDLER(f3_68681_w)
case 3:
logerror("Counter: X1/Clk - divided by 16, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter*16);
timer_mode=TIMER_SINGLESHOT;
- timer = space->machine->device<timer_device>("timer_68681");
+ timer = space->machine().device<timer_device>("timer_68681");
timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter*16));
break;
case 4:
@@ -140,7 +140,7 @@ static WRITE16_HANDLER(f3_68681_w)
case 6:
logerror("Timer: X1/Clk, counter is %04x, so interrupt every %d cycles\n",counter,(M68000_CLOCK/M68681_CLOCK)*counter);
timer_mode=TIMER_PULSE;
- timer = space->machine->device<timer_device>("timer_68681");
+ timer = space->machine().device<timer_device>("timer_68681");
timer->adjust(downcast<cpu_device *>(space->cpu)->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter), 0, downcast<cpu_device *>(space->cpu)->cycles_to_attotime((M68000_CLOCK/M68681_CLOCK)*counter));
break;
case 7:
@@ -187,7 +187,7 @@ static READ16_HANDLER(es5510_dsp_r)
*/
// offset<<=1;
-//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space->machine->rand()%0xffff;
+//if (offset<7 && es5510_dsp_ram[0]!=0xff) return space->machine().rand()%0xffff;
if (offset==0x12) return 0;
@@ -199,7 +199,7 @@ static READ16_HANDLER(es5510_dsp_r)
static WRITE16_HANDLER(es5510_dsp_w)
{
- UINT8 *snd_mem = (UINT8 *)space->machine->region("ensoniq.0")->base();
+ UINT8 *snd_mem = (UINT8 *)space->machine().region("ensoniq.0")->base();
// if (offset>4 && offset!=0x80 && offset!=0xa0 && offset!=0xc0 && offset!=0xe0)
// logerror("%06x: DSP write offset %04x %04x\n",cpu_get_pc(space->cpu),offset,data);
@@ -257,7 +257,7 @@ ADDRESS_MAP_END
SOUND_RESET( taito_f3_soundsystem_reset )
{
/* Sound cpu program loads to 0xc00000 so we use a bank */
- UINT16 *ROM = (UINT16 *)machine->region("audiocpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("audiocpu")->base();
memory_set_bankptr(machine, "bank1",&ROM[0x80000]);
memory_set_bankptr(machine, "bank2",&ROM[0x90000]);
memory_set_bankptr(machine, "bank3",&ROM[0xa0000]);
@@ -268,10 +268,10 @@ SOUND_RESET( taito_f3_soundsystem_reset )
sound_ram[3]=ROM[0x80003];
/* reset CPU to catch any banking of startup vectors */
- machine->device("audiocpu")->reset();
+ machine.device("audiocpu")->reset();
//cputag_set_input_line(machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
- f3_shared_ram = (UINT32 *)memory_get_shared(*machine, "f3_shared");
+ f3_shared_ram = (UINT32 *)memory_get_shared(machine, "f3_shared");
}
static const es5505_interface es5505_taito_f3_config =
diff --git a/src/mame/audio/taitosnd.c b/src/mame/audio/taitosnd.c
index 6c87c9fb287..3bca8a8a6fe 100644
--- a/src/mame/audio/taitosnd.c
+++ b/src/mame/audio/taitosnd.c
@@ -290,8 +290,8 @@ static DEVICE_START( tc0140syt )
const tc0140syt_interface *intf = get_interface(device);
/* use the given gfx set */
- tc0140syt->mastercpu = device->machine->device(intf->master);
- tc0140syt->slavecpu = device->machine->device(intf->slave);
+ tc0140syt->mastercpu = device->machine().device(intf->master);
+ tc0140syt->slavecpu = device->machine().device(intf->slave);
device->save_item(NAME(tc0140syt->mainmode));
device->save_item(NAME(tc0140syt->submode));
diff --git a/src/mame/audio/targ.c b/src/mame/audio/targ.c
index 49be8db1ef6..e86b4330a98 100644
--- a/src/mame/audio/targ.c
+++ b/src/mame/audio/targ.c
@@ -61,11 +61,11 @@ static void adjust_sample(device_t *samples, UINT8 freq)
WRITE8_HANDLER( targ_audio_1_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
/* CPU music */
if ((data & 0x01) != (port_1_last & 0x01))
- dac_data_w(space->machine->device("dac"),(data & 0x01) * 0xff);
+ dac_data_w(space->machine().device("dac"),(data & 0x01) * 0xff);
/* shot */
if (FALLING_EDGE(0x02) && !sample_playing(samples, 0)) sample_start(samples, 0,1,0);
@@ -114,8 +114,8 @@ WRITE8_HANDLER( targ_audio_2_w )
{
if ((data & 0x01) && !(port_2_last & 0x01))
{
- device_t *samples = space->machine->device("samples");
- UINT8 *prom = space->machine->region("targ")->base();
+ device_t *samples = space->machine().device("samples");
+ UINT8 *prom = space->machine().region("targ")->base();
tone_pointer = (tone_pointer + 1) & 0x0f;
@@ -128,7 +128,7 @@ WRITE8_HANDLER( targ_audio_2_w )
WRITE8_HANDLER( spectar_audio_2_w )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
adjust_sample(samples, data);
}
@@ -145,9 +145,9 @@ static const char *const sample_names[] =
};
-static void common_audio_start(running_machine *machine, int freq)
+static void common_audio_start(running_machine &machine, int freq)
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
max_freq = freq;
tone_freq = 0;
@@ -165,14 +165,14 @@ static void common_audio_start(running_machine *machine, int freq)
static SAMPLES_START( spectar_audio_start )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
common_audio_start(machine, SPECTAR_MAXFREQ);
}
static SAMPLES_START( targ_audio_start )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
common_audio_start(machine, TARG_MAXFREQ);
tone_pointer = 0;
diff --git a/src/mame/audio/tiamc1.c b/src/mame/audio/tiamc1.c
index cfbf1c7e89d..15428631c2c 100644
--- a/src/mame/audio/tiamc1.c
+++ b/src/mame/audio/tiamc1.c
@@ -300,13 +300,13 @@ static STREAM_UPDATE( tiamc1_sound_update )
static DEVICE_START( tiamc1_sound )
{
tiamc1_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i, j;
timer8253_reset(&state->timer0);
timer8253_reset(&state->timer1);
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, 0, tiamc1_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, device->clock() / CLOCK_DIVIDER, 0, tiamc1_sound_update);
state->timer1_divider = 0;
diff --git a/src/mame/audio/timeplt.c b/src/mame/audio/timeplt.c
index 87e2f93d3f4..1cfa9c8d9ac 100644
--- a/src/mame/audio/timeplt.c
+++ b/src/mame/audio/timeplt.c
@@ -50,16 +50,16 @@ INLINE timeplt_audio_state *get_safe_token( device_t *device )
static DEVICE_START( timeplt_audio )
{
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
timeplt_audio_state *state = get_safe_token(device);
- state->soundcpu = machine->device<cpu_device>("tpsound");
- state->filter_0_0 = machine->device("filter.0.0");
- state->filter_0_1 = machine->device("filter.0.1");
- state->filter_0_2 = machine->device("filter.0.2");
- state->filter_1_0 = machine->device("filter.1.0");
- state->filter_1_1 = machine->device("filter.1.1");
- state->filter_1_2 = machine->device("filter.1.2");
+ state->soundcpu = machine.device<cpu_device>("tpsound");
+ state->filter_0_0 = machine.device("filter.0.0");
+ state->filter_0_1 = machine.device("filter.0.1");
+ state->filter_0_2 = machine.device("filter.0.2");
+ state->filter_1_0 = machine.device("filter.1.0");
+ state->filter_1_1 = machine.device("filter.1.1");
+ state->filter_1_2 = machine.device("filter.1.2");
state->last_irq_state = 0;
device->save_item(NAME(state->last_irq_state));
@@ -145,7 +145,7 @@ static WRITE8_DEVICE_HANDLER( timeplt_filter_w )
WRITE8_HANDLER( timeplt_sh_irqtrigger_w )
{
- device_t *audio = space->machine->device("timeplt_audio");
+ device_t *audio = space->machine().device("timeplt_audio");
timeplt_audio_state *state = get_safe_token(audio);
if (state->last_irq_state == 0 && data)
diff --git a/src/mame/audio/trackfld.c b/src/mame/audio/trackfld.c
index 7b5c98f2575..0fa832aa6a2 100644
--- a/src/mame/audio/trackfld.c
+++ b/src/mame/audio/trackfld.c
@@ -42,8 +42,8 @@ static DEVICE_START( trackfld_audio )
{
trackfld_audio_state *state = get_safe_token(device);
- state->audiocpu = device->machine->device<cpu_device>("audiocpu");
- state->vlm = device->machine->device("vlm");
+ state->audiocpu = device->machine().device<cpu_device>("audiocpu");
+ state->vlm = device->machine().device("vlm");
/* sound */
device->save_item(NAME(state->SN76496_latch));
@@ -75,7 +75,7 @@ static DEVICE_RESET( trackfld_audio )
READ8_HANDLER( trackfld_sh_timer_r )
{
- UINT32 clock = space->machine->device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE;
+ UINT32 clock = space->machine().device<cpu_device>("audiocpu")->total_cycles() / TIMER_RATE;
return clock & 0xF;
}
@@ -87,7 +87,7 @@ READ8_DEVICE_HANDLER( trackfld_speech_r )
WRITE8_DEVICE_HANDLER( trackfld_sound_w )
{
- device_t *audio = device->machine->device("trackfld_audio");
+ device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
int changes = offset ^ state->last_addr;
@@ -108,7 +108,7 @@ WRITE8_DEVICE_HANDLER( trackfld_sound_w )
READ8_HANDLER( hyperspt_sh_timer_r )
{
- device_t *audio = space->machine->device("trackfld_audio");
+ device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
UINT32 clock = state->audiocpu->total_cycles() / TIMER_RATE;
@@ -120,7 +120,7 @@ READ8_HANDLER( hyperspt_sh_timer_r )
WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
{
- device_t *audio = device->machine->device("trackfld_audio");
+ device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
int changes = offset ^ state->last_addr;
@@ -146,7 +146,7 @@ WRITE8_DEVICE_HANDLER( hyperspt_sound_w )
WRITE8_HANDLER( konami_sh_irqtrigger_w )
{
- device_t *audio = space->machine->device("trackfld_audio");
+ device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
if (state->last_irq == 0 && data)
{
@@ -160,7 +160,7 @@ WRITE8_HANDLER( konami_sh_irqtrigger_w )
WRITE8_HANDLER( konami_SN76496_latch_w )
{
- device_t *audio = space->machine->device("trackfld_audio");
+ device_t *audio = space->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
state->SN76496_latch = data;
}
@@ -168,7 +168,7 @@ WRITE8_HANDLER( konami_SN76496_latch_w )
WRITE8_DEVICE_HANDLER( konami_SN76496_w )
{
- device_t *audio = device->machine->device("trackfld_audio");
+ device_t *audio = device->machine().device("trackfld_audio");
trackfld_audio_state *state = get_safe_token(audio);
sn76496_w(device, offset, state->SN76496_latch);
}
diff --git a/src/mame/audio/turbo.c b/src/mame/audio/turbo.c
index 94fa637667c..4d19580f7e8 100644
--- a/src/mame/audio/turbo.c
+++ b/src/mame/audio/turbo.c
@@ -39,7 +39,7 @@ static void turbo_update_samples(turbo_state *state, device_t *samples)
static TIMER_CALLBACK( update_sound_a )
{
- device_t *discrete = machine->device("discrete");
+ device_t *discrete = machine.device("discrete");
int data = param;
/* missing short crash sample, but I've never seen it triggered */
@@ -72,9 +72,9 @@ if (!((data >> 4) & 1)) mame_printf_debug("/TRIG4\n");
WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
{
#if (!DISCRETE_TEST)
- device_t *samples = device->machine->device("samples");
+ device_t *samples = device->machine().device("samples");
#endif
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -110,7 +110,7 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
#else
if (((data ^ state->last_sound_a) & 0x1e) && (state->last_sound_a & 0x1e) != 0x1e)
- space->machine->scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
+ space->machine().scheduler().timer_set(attotime::from_hz(20000), FUNC(update_sound_a), data);
else
update_sound_a(data);
@@ -122,8 +122,8 @@ WRITE8_DEVICE_HANDLER( turbo_sound_a_w )
WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -145,8 +145,8 @@ WRITE8_DEVICE_HANDLER( turbo_sound_b_w )
WRITE8_DEVICE_HANDLER( turbo_sound_c_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
/* OSEL1-2 */
state->turbo_osel = (state->turbo_osel & 1) | ((data & 3) << 1);
@@ -296,7 +296,7 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( subroc3d_sound_a_w )
{
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ turbo_state *state = device->machine().driver_data<turbo_state>();
state->sound_state[0] = data;
/* DIS0-3 contained in bits 0-3 */
@@ -326,8 +326,8 @@ INLINE void subroc3d_update_volume(device_t *samples, int leftchan, UINT8 dis, U
WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -382,8 +382,8 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_b_w )
WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@@ -414,7 +414,7 @@ WRITE8_DEVICE_HANDLER( subroc3d_sound_c_w )
sample_set_volume(samples, 11, (data & 0x40) ? 0 : 1.0);
/* /GAME START */
- device->machine->sound().system_mute(data & 0x80);
+ device->machine().sound().system_mute(data & 0x80);
}
@@ -507,8 +507,8 @@ static void buckrog_update_samples(turbo_state *state, device_t *samples)
WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -533,8 +533,8 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_a_w )
WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
{
- device_t *samples = device->machine->device("samples");
- turbo_state *state = device->machine->driver_data<turbo_state>();
+ device_t *samples = device->machine().device("samples");
+ turbo_state *state = device->machine().driver_data<turbo_state>();
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -569,7 +569,7 @@ WRITE8_DEVICE_HANDLER( buckrog_sound_b_w )
if ((diff & 0x40) && !(data & 0x40) && sample_playing(samples, 5)) sample_stop(samples, 5);
/* GAME ON */
- device->machine->sound().system_enable(data & 0x80);
+ device->machine().sound().system_enable(data & 0x80);
}
diff --git a/src/mame/audio/tx1.c b/src/mame/audio/tx1.c
index ec883bce3d1..f38e183b613 100644
--- a/src/mame/audio/tx1.c
+++ b/src/mame/audio/tx1.c
@@ -294,15 +294,15 @@ static STREAM_UPDATE( tx1_stream_update )
static DEVICE_START( tx1_sound )
{
tx1_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
static const int r0[4] = { 390e3, 180e3, 180e3, 180e3 };
static const int r1[3] = { 180e3, 390e3, 56e3 };
static const int r2[3] = { 390e3, 390e3, 180e3 };
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), NULL, tx1_stream_update);
- state->freq_to_step = (double)(1 << TX1_FRAC) / (double)machine->sample_rate();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), NULL, tx1_stream_update);
+ state->freq_to_step = (double)(1 << TX1_FRAC) / (double)machine.sample_rate();
/* Compute the engine resistor weights */
compute_resistor_weights(0, 10000, -1.0,
@@ -434,18 +434,18 @@ WRITE8_DEVICE_HANDLER( bb_ym2_a_w )
WRITE8_DEVICE_HANDLER( bb_ym2_b_w )
{
tx1_sound_state *state = get_safe_token(device);
- device_t *ym1 = device->machine->device("ym1");
- device_t *ym2 = device->machine->device("ym2");
+ device_t *ym1 = device->machine().device("ym1");
+ device_t *ym2 = device->machine().device("ym2");
double gain;
state->stream->update();
state->ym2_outputb = data ^ 0xff;
- if (!strcmp(device->machine->system().name, "buggyboyjr"))
+ if (!strcmp(device->machine().system().name, "buggyboyjr"))
{
- coin_counter_w(device->machine, 0, data & 0x01);
- coin_counter_w(device->machine, 1, data & 0x02);
+ coin_counter_w(device->machine(), 0, data & 0x01);
+ coin_counter_w(device->machine(), 1, data & 0x02);
}
/*
@@ -489,7 +489,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
step_0 = state->pit8253.counts[0].val ? (BUGGYBOY_PIT_CLOCK / state->pit8253.counts[0].val) * state->freq_to_step : 0;
step_1 = state->pit8253.counts[1].val ? (BUGGYBOY_PIT_CLOCK / state->pit8253.counts[1].val) * state->freq_to_step : 0;
- if (!strcmp(device->machine->system().name, "buggyboyjr"))
+ if (!strcmp(device->machine().system().name, "buggyboyjr"))
gain0 = BIT(state->ym2_outputb, 3) ? 1.0 : 2.0;
else
gain0 = BIT(state->ym1_outputa, 3) ? 1.0 : 2.0;
@@ -508,7 +508,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
pit1 = state->eng_voltages[(state->step1 >> 24) & 0xf];
/* Calculate the tyre screech noise source */
- for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine->sample_rate(); ++i)
+ for (i = 0; i < BUGGYBOY_NOISE_CLOCK / device->machine().sample_rate(); ++i)
{
/* CD4006 is a 4-4-1-4-4-1 shift register */
int p13 = BIT(state->noise_lfsra, 3);
@@ -554,7 +554,7 @@ static STREAM_UPDATE( buggyboy_stream_update )
static DEVICE_START( buggyboy_sound )
{
tx1_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
static const int resistors[4] = { 330000, 220000, 330000, 220000 };
double aweights[4];
int i;
@@ -572,8 +572,8 @@ static DEVICE_START( buggyboy_sound )
state->eng_voltages[i] = combine_4_weights(aweights, BIT(tmp[i], 0), BIT(tmp[i], 1), BIT(tmp[i], 2), BIT(tmp[i], 3));
/* Allocate the stream */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 2, machine->sample_rate(), NULL, buggyboy_stream_update);
- state->freq_to_step = (double)(1 << 24) / (double)machine->sample_rate();
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 2, machine.sample_rate(), NULL, buggyboy_stream_update);
+ state->freq_to_step = (double)(1 << 24) / (double)machine.sample_rate();
}
static DEVICE_RESET( buggyboy_sound )
diff --git a/src/mame/audio/vicdual.c b/src/mame/audio/vicdual.c
index 0272d1ff9de..dce5a79bfda 100644
--- a/src/mame/audio/vicdual.c
+++ b/src/mame/audio/vicdual.c
@@ -132,21 +132,21 @@ MACHINE_CONFIG_END
static TIMER_CALLBACK( frogs_croak_callback )
{
- device_t *samples = machine->device("samples");
+ device_t *samples = machine.device("samples");
sample_stop(samples, 2);
}
MACHINE_START( frogs_audio )
{
- frogs_croak_timer = machine->scheduler().timer_alloc(FUNC(frogs_croak_callback));
+ frogs_croak_timer = machine.scheduler().timer_alloc(FUNC(frogs_croak_callback));
}
WRITE8_HANDLER( frogs_audio_w )
{
- device_t *samples = space->machine->device("samples");
- device_t *discrete = space->machine->device("discrete");
+ device_t *samples = space->machine().device("samples");
+ device_t *discrete = space->machine().device("discrete");
static int last_croak = 0;
static int last_buzzz = 0;
int new_croak = data & 0x08;
@@ -462,7 +462,7 @@ MACHINE_CONFIG_END
WRITE8_HANDLER( headon_audio_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
if (discrete == NULL)
return;
discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x01);
@@ -477,7 +477,7 @@ WRITE8_HANDLER( headon_audio_w )
WRITE8_HANDLER( invho2_audio_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
if (discrete == NULL)
return;
discrete_sound_w(discrete, HEADON_HISPEED_PC_EN, data & 0x10);
diff --git a/src/mame/audio/warpwarp.c b/src/mame/audio/warpwarp.c
index b9b85267da1..56295fc974d 100644
--- a/src/mame/audio/warpwarp.c
+++ b/src/mame/audio/warpwarp.c
@@ -226,7 +226,7 @@ static STREAM_UPDATE( warpwarp_sound_update )
static DEVICE_START( warpwarp_sound )
{
warpwarp_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
int i;
state->decay = auto_alloc_array(machine, INT16, 32768);
@@ -234,10 +234,10 @@ static DEVICE_START( warpwarp_sound )
for( i = 0; i < 0x8000; i++ )
state->decay[0x7fff-i] = (INT16) (0x7fff/exp(1.0*i/4096));
- state->channel = device->machine->sound().stream_alloc(*device, 0, 1, CLOCK_16H, NULL, warpwarp_sound_update);
+ state->channel = device->machine().sound().stream_alloc(*device, 0, 1, CLOCK_16H, NULL, warpwarp_sound_update);
- state->sound_volume_timer = machine->scheduler().timer_alloc(FUNC(sound_volume_decay), state);
- state->music_volume_timer = machine->scheduler().timer_alloc(FUNC(music_volume_decay), state);
+ state->sound_volume_timer = machine.scheduler().timer_alloc(FUNC(sound_volume_decay), state);
+ state->music_volume_timer = machine.scheduler().timer_alloc(FUNC(music_volume_decay), state);
}
diff --git a/src/mame/audio/williams.c b/src/mame/audio/williams.c
index 0a01f345577..ca5c807e25e 100644
--- a/src/mame/audio/williams.c
+++ b/src/mame/audio/williams.c
@@ -61,7 +61,7 @@ static device_t *soundalt_cpu;
FUNCTION PROTOTYPES
****************************************************************************/
-static void init_audio_state(running_machine *machine);
+static void init_audio_state(running_machine &machine);
static void cvsd_ym2151_irq(device_t *device, int state);
static void adpcm_ym2151_irq(device_t *device, int state);
@@ -264,17 +264,17 @@ MACHINE_CONFIG_END
INITIALIZATION
****************************************************************************/
-void williams_cvsd_init(running_machine *machine)
+void williams_cvsd_init(running_machine &machine)
{
UINT8 *ROM;
int bank;
/* configure the CPU */
- sound_cpu = machine->device("cvsdcpu");
+ sound_cpu = machine.device("cvsdcpu");
soundalt_cpu = NULL;
/* configure master CPU banks */
- ROM = machine->region("cvsdcpu")->base();
+ ROM = machine.region("cvsdcpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@@ -288,7 +288,7 @@ void williams_cvsd_init(running_machine *machine)
memory_set_bank(machine, "bank5", 0);
/* reset the IRQ state */
- pia6821_ca1_w(machine->device("cvsdpia"), 1);
+ pia6821_ca1_w(machine.device("cvsdpia"), 1);
/* register for save states */
state_save_register_global(machine, williams_sound_int_state);
@@ -296,17 +296,17 @@ void williams_cvsd_init(running_machine *machine)
}
-void williams_narc_init(running_machine *machine)
+void williams_narc_init(running_machine &machine)
{
UINT8 *ROM;
int bank;
/* configure the CPU */
- sound_cpu = machine->device("narc1cpu");
- soundalt_cpu = machine->device("narc2cpu");
+ sound_cpu = machine.device("narc1cpu");
+ soundalt_cpu = machine.device("narc2cpu");
/* configure master CPU banks */
- ROM = machine->region("narc1cpu")->base();
+ ROM = machine.region("narc1cpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@@ -320,7 +320,7 @@ void williams_narc_init(running_machine *machine)
memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* configure slave CPU banks */
- ROM = machine->region("narc2cpu")->base();
+ ROM = machine.region("narc2cpu")->base();
for (bank = 0; bank < 16; bank++)
{
/*
@@ -340,22 +340,22 @@ void williams_narc_init(running_machine *machine)
}
-void williams_adpcm_init(running_machine *machine)
+void williams_adpcm_init(running_machine &machine)
{
UINT8 *ROM;
/* configure the CPU */
- sound_cpu = machine->device("adpcm");
+ sound_cpu = machine.device("adpcm");
soundalt_cpu = NULL;
/* configure banks */
- ROM = machine->region("adpcm")->base();
+ ROM = machine.region("adpcm")->base();
memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x10000], 0x8000);
memory_set_bankptr(machine, "bank6", &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
/* expand ADPCM data */
/* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
- ROM = machine->region("oki")->base();
+ ROM = machine.region("oki")->base();
memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */
memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000);
memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000);
@@ -378,7 +378,7 @@ void williams_adpcm_init(running_machine *machine)
}
-static void init_audio_state(running_machine *machine)
+static void init_audio_state(running_machine &machine)
{
/* reset the YM2151 state */
devtag_reset(machine, "ymsnd");
@@ -407,7 +407,7 @@ static void init_audio_state(running_machine *machine)
static void cvsd_ym2151_irq(device_t *device, int state)
{
- pia6821_ca1_w(device->machine->device("cvsdpia"), !state);
+ pia6821_ca1_w(device->machine().device("cvsdpia"), !state);
}
@@ -441,7 +441,7 @@ static void adpcm_ym2151_irq(device_t *device, int state)
static WRITE8_HANDLER( cvsd_bank_select_w )
{
- memory_set_bank(space->machine, "bank5", data & 0x0f);
+ memory_set_bank(space->machine(), "bank5", data & 0x0f);
}
@@ -471,16 +471,16 @@ static WRITE8_DEVICE_HANDLER( cvsd_clock_set_w )
static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
{
- device_t *pia = machine->device("cvsdpia");
+ device_t *pia = machine.device("cvsdpia");
pia6821_portb_w(pia, 0, param & 0xff);
pia6821_cb1_w(pia, (param >> 8) & 1);
pia6821_cb2_w(pia, (param >> 9) & 1);
}
-void williams_cvsd_data_w(running_machine *machine, int data)
+void williams_cvsd_data_w(running_machine &machine, int data)
{
- machine->scheduler().synchronize(FUNC(williams_cvsd_delayed_data_w), data);
+ machine.scheduler().synchronize(FUNC(williams_cvsd_delayed_data_w), data);
}
@@ -492,7 +492,7 @@ void williams_cvsd_reset_w(int state)
if (state)
{
cvsd_bank_select_w(space, 0, 0);
- init_audio_state(space->machine);
+ init_audio_state(space->machine());
device_set_input_line(space->cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
/* going low resets and reactivates the CPU */
@@ -508,13 +508,13 @@ void williams_cvsd_reset_w(int state)
static WRITE8_HANDLER( narc_master_bank_select_w )
{
- memory_set_bank(space->machine, "bank5", data & 0x0f);
+ memory_set_bank(space->machine(), "bank5", data & 0x0f);
}
static WRITE8_HANDLER( narc_slave_bank_select_w )
{
- memory_set_bank(space->machine, "bank7", data & 0x0f);
+ memory_set_bank(space->machine(), "bank7", data & 0x0f);
}
@@ -554,7 +554,7 @@ static TIMER_CALLBACK( narc_sync_clear )
static WRITE8_HANDLER( narc_master_sync_w )
{
- space->machine->scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x01);
+ space->machine().scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x01);
audio_sync |= 0x01;
logerror("Master sync = %02X\n", data);
}
@@ -568,7 +568,7 @@ static WRITE8_HANDLER( narc_slave_talkback_w )
static WRITE8_HANDLER( narc_slave_sync_w )
{
- space->machine->scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x02);
+ space->machine().scheduler().timer_set(attotime::from_double(TIME_OF_74LS123(180000, 0.000001)), FUNC(narc_sync_clear), 0x02);
audio_sync |= 0x02;
logerror("Slave sync = %02X\n", data);
}
@@ -601,7 +601,7 @@ void williams_narc_reset_w(int state)
address_space *space = sound_cpu->memory().space(AS_PROGRAM);
narc_master_bank_select_w(space, 0, 0);
narc_slave_bank_select_w(space, 0, 0);
- init_audio_state(space->machine);
+ init_audio_state(space->machine());
device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
device_set_input_line(soundalt_cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
@@ -627,7 +627,7 @@ int williams_narc_talkback_r(void)
static WRITE8_HANDLER( adpcm_bank_select_w )
{
- memory_set_bank(space->machine, "bank5", data & 0x07);
+ memory_set_bank(space->machine(), "bank5", data & 0x07);
}
@@ -649,7 +649,7 @@ static READ8_HANDLER( adpcm_command_r )
/* don't clear the external IRQ state for a short while; this allows the
self-tests to pass */
- space->machine->scheduler().timer_set(attotime::from_usec(10), FUNC(clear_irq_state));
+ space->machine().scheduler().timer_set(attotime::from_usec(10), FUNC(clear_irq_state));
return soundlatch_r(space, 0);
}
@@ -674,7 +674,7 @@ void williams_adpcm_data_w(int data)
{
device_set_input_line(sound_cpu, M6809_IRQ_LINE, ASSERT_LINE);
williams_sound_int_state = 1;
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100));
}
}
@@ -686,7 +686,7 @@ void williams_adpcm_reset_w(int state)
{
address_space *space = sound_cpu->memory().space(AS_PROGRAM);
adpcm_bank_select_w(space, 0, 0);
- init_audio_state(space->machine);
+ init_audio_state(space->machine());
device_set_input_line(sound_cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
/* going low resets and reactivates the CPU */
diff --git a/src/mame/audio/williams.h b/src/mame/audio/williams.h
index dc66bbf1584..1a79bbbb7df 100644
--- a/src/mame/audio/williams.h
+++ b/src/mame/audio/williams.h
@@ -8,16 +8,16 @@ MACHINE_CONFIG_EXTERN( williams_cvsd_sound );
MACHINE_CONFIG_EXTERN( williams_adpcm_sound );
MACHINE_CONFIG_EXTERN( williams_narc_sound );
-void williams_cvsd_init(running_machine *machine);
-void williams_cvsd_data_w(running_machine *machine, int data);
+void williams_cvsd_init(running_machine &machine);
+void williams_cvsd_data_w(running_machine &machine, int data);
void williams_cvsd_reset_w(int state);
-void williams_adpcm_init(running_machine *machine);
+void williams_adpcm_init(running_machine &machine);
void williams_adpcm_data_w(int data);
void williams_adpcm_reset_w(int state);
int williams_adpcm_sound_irq_r(void);
-void williams_narc_init(running_machine *machine);
+void williams_narc_init(running_machine &machine);
void williams_narc_data_w(int data);
void williams_narc_reset_w(int state);
int williams_narc_talkback_r(void);
diff --git a/src/mame/audio/wiping.c b/src/mame/audio/wiping.c
index 20e0b26ac7e..a5404f50061 100644
--- a/src/mame/audio/wiping.c
+++ b/src/mame/audio/wiping.c
@@ -71,7 +71,7 @@ static void make_mixer_table(device_t *device, int voices, int gain)
int i;
/* allocate memory */
- state->mixer_table = auto_alloc_array(device->machine, INT16, 256 * voices);
+ state->mixer_table = auto_alloc_array(device->machine(), INT16, 256 * voices);
/* find the middle of the table */
state->mixer_lookup = state->mixer_table + (128 * voices);
@@ -175,11 +175,11 @@ static STREAM_UPDATE( wiping_update_mono )
static DEVICE_START( wiping_sound )
{
wiping_sound_state *state = get_safe_token(device);
- running_machine *machine = device->machine;
+ running_machine &machine = device->machine();
sound_channel *voice;
/* get stream channels */
- state->stream = device->machine->sound().stream_alloc(*device, 0, 1, samplerate, NULL, wiping_update_mono);
+ state->stream = device->machine().sound().stream_alloc(*device, 0, 1, samplerate, NULL, wiping_update_mono);
/* allocate a pair of buffers to mix into - 1 second's worth should be more than enough */
state->mixer_buffer = auto_alloc_array(machine, short, 2 * samplerate);
@@ -192,8 +192,8 @@ static DEVICE_START( wiping_sound )
state->num_voices = 8;
state->last_channel = state->channel_list + state->num_voices;
- state->sound_rom = machine->region("samples")->base();
- state->sound_prom = machine->region("soundproms")->base();
+ state->sound_rom = machine.region("samples")->base();
+ state->sound_prom = machine.region("soundproms")->base();
/* start with sound enabled, many games don't have a sound enable register */
state->sound_enable = 1;
diff --git a/src/mame/audio/wow.c b/src/mame/audio/wow.c
index 68c9cb33d3f..052e47fbb5e 100644
--- a/src/mame/audio/wow.c
+++ b/src/mame/audio/wow.c
@@ -108,7 +108,7 @@ static int plural;
READ8_HANDLER( wow_speech_r )
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
int Phoneme/*, Intonation*/;
int i = 0;
@@ -177,6 +177,6 @@ READ8_HANDLER( wow_speech_r )
CUSTOM_INPUT( wow_speech_status_r )
{
- device_t *samples = field->port->machine->device("samples");
+ device_t *samples = field->port->machine().device("samples");
return !sample_playing(samples, 0);
}
diff --git a/src/mame/audio/zaxxon.c b/src/mame/audio/zaxxon.c
index 577e2b9affb..875a87df9ab 100644
--- a/src/mame/audio/zaxxon.c
+++ b/src/mame/audio/zaxxon.c
@@ -113,8 +113,8 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[0];
state->sound_state[0] = data;
@@ -149,8 +149,8 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_a_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -167,8 +167,8 @@ WRITE8_DEVICE_HANDLER( zaxxon_sound_b_w )
WRITE8_DEVICE_HANDLER( zaxxon_sound_c_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
@@ -225,8 +225,8 @@ MACHINE_CONFIG_END
WRITE8_DEVICE_HANDLER( congo_sound_b_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[1];
state->sound_state[1] = data;
@@ -239,8 +239,8 @@ WRITE8_DEVICE_HANDLER( congo_sound_b_w )
WRITE8_DEVICE_HANDLER( congo_sound_c_w )
{
- zaxxon_state *state = device->machine->driver_data<zaxxon_state>();
- device_t *samples = device->machine->device("samples");
+ zaxxon_state *state = device->machine().driver_data<zaxxon_state>();
+ device_t *samples = device->machine().device("samples");
UINT8 diff = data ^ state->sound_state[2];
state->sound_state[2] = data;
diff --git a/src/mame/drivers/1942.c b/src/mame/drivers/1942.c
index 205d76fa691..029f351be78 100644
--- a/src/mame/drivers/1942.c
+++ b/src/mame/drivers/1942.c
@@ -71,7 +71,7 @@ correctly.
static WRITE8_HANDLER( c1942_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static TIMER_DEVICE_CALLBACK( c1942_scanline )
@@ -79,10 +79,10 @@ static TIMER_DEVICE_CALLBACK( c1942_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h - vblank */
if(scanline == 0) // unknown irq event, presumably vblank-in or a periodic one (writes to the soundlatch and drives freeze dip-switch)
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
}
@@ -238,9 +238,9 @@ GFXDECODE_END
static MACHINE_START( 1942 )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->palette_bank));
state->save_item(NAME(state->scroll));
@@ -248,7 +248,7 @@ static MACHINE_START( 1942 )
static MACHINE_RESET( 1942 )
{
- _1942_state *state = machine->driver_data<_1942_state>();
+ _1942_state *state = machine.driver_data<_1942_state>();
state->palette_bank = 0;
state->scroll[0] = 0;
@@ -506,7 +506,7 @@ ROM_END
static DRIVER_INIT( 1942 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x4000);
}
diff --git a/src/mame/drivers/1943.c b/src/mame/drivers/1943.c
index b4185095240..89d1ca92957 100644
--- a/src/mame/drivers/1943.c
+++ b/src/mame/drivers/1943.c
@@ -248,7 +248,7 @@ GFXDECODE_END
static MACHINE_RESET( 1943 )
{
- _1943_state *state = machine->driver_data<_1943_state>();
+ _1943_state *state = machine.driver_data<_1943_state>();
state->char_on = 0;
state->obj_on = 0;
@@ -589,7 +589,7 @@ ROM_END
static DRIVER_INIT( 1943 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 29, &ROM[0x10000], 0x1000);
memory_configure_bank(machine, "bank2", 0, 29, &ROM[0x11000], 0x1000);
memory_configure_bank(machine, "bank3", 0, 29, &ROM[0x12000], 0x1000);
@@ -603,7 +603,7 @@ static DRIVER_INIT( 1943b )
DRIVER_INIT_CALL( 1943 );
//it expects 0x00 to be returned from the protection reads because the protection has been patched out.
//AM_RANGE(0xc007, 0xc007) AM_READ(c1943_protection_r)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc007, 0xc007, FUNC(_1943b_c007_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc007, 0xc007, FUNC(_1943b_c007_r));
}
diff --git a/src/mame/drivers/1945kiii.c b/src/mame/drivers/1945kiii.c
index 5e8c92a2b5f..1ecb6528cda 100644
--- a/src/mame/drivers/1945kiii.c
+++ b/src/mame/drivers/1945kiii.c
@@ -72,28 +72,28 @@ public:
static WRITE16_HANDLER( k3_bgram_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
COMBINE_DATA(&state->bgram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_k3_bg_tile_info )
{
- k3_state *state = machine->driver_data<k3_state>();
+ k3_state *state = machine.driver_data<k3_state>();
int tileno = state->bgram[tile_index];
SET_TILE_INFO(1, tileno, 0, 0);
}
static VIDEO_START(k3)
{
- k3_state *state = machine->driver_data<k3_state>();
+ k3_state *state = machine.driver_data<k3_state>();
state->bg_tilemap = tilemap_create(machine, get_k3_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 64);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- k3_state *state = machine->driver_data<k3_state>();
- const gfx_element *gfx = machine->gfx[0];
+ k3_state *state = machine.driver_data<k3_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT16 *source = state->spriteram_1;
UINT16 *source2 = state->spriteram_2;
UINT16 *finish = source + 0x1000 / 2;
@@ -118,28 +118,28 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(k3)
{
- k3_state *state = screen->machine->driver_data<k3_state>();
+ k3_state *state = screen->machine().driver_data<k3_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE16_HANDLER( k3_scrollx_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, data);
}
static WRITE16_HANDLER( k3_scrolly_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, data);
}
static WRITE16_HANDLER( k3_soundbanks_w )
{
- k3_state *state = space->machine->driver_data<k3_state>();
+ k3_state *state = space->machine().driver_data<k3_state>();
state->oki1->set_bank_base((data & 4) ? 0x40000 : 0);
state->oki2->set_bank_base((data & 2) ? 0x40000 : 0);
}
diff --git a/src/mame/drivers/20pacgal.c b/src/mame/drivers/20pacgal.c
index 7420a705e93..0b8594a2cca 100644
--- a/src/mame/drivers/20pacgal.c
+++ b/src/mame/drivers/20pacgal.c
@@ -76,7 +76,7 @@
static WRITE8_HANDLER( irqack_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
int bit = data & 1;
cpu_interrupt_enable(state->maincpu, bit);
@@ -87,7 +87,7 @@ static WRITE8_HANDLER( irqack_w )
static WRITE8_HANDLER( timer_pulse_w )
{
- //_20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ //_20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
//printf("timer pulse %02x\n", data);
}
@@ -131,7 +131,7 @@ static const eeprom_interface _20pacgal_eeprom_intf =
static WRITE8_HANDLER( _20pacgal_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
@@ -142,12 +142,12 @@ static WRITE8_HANDLER( _20pacgal_coin_counter_w )
*
*************************************/
-static void set_bankptr(running_machine *machine)
+static void set_bankptr(running_machine &machine)
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
if (state->game_selected == 0)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", rom + 0x08000);
}
else
@@ -156,15 +156,15 @@ static void set_bankptr(running_machine *machine)
static WRITE8_HANDLER( ram_bank_select_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->game_selected = data & 1;
- set_bankptr(space->machine);
+ set_bankptr(space->machine());
}
static WRITE8_HANDLER( ram_48000_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
if (state->game_selected)
{
@@ -188,19 +188,19 @@ static STATE_POSTLOAD( postload_20pacgal )
static WRITE8_HANDLER( sprite_gfx_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->sprite_gfx_ram[offset] = data;
}
static WRITE8_HANDLER( sprite_ram_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->sprite_ram[offset] = data;
}
static WRITE8_HANDLER( sprite_lookup_w )
{
- _20pacgal_state *state = space->machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = space->machine().driver_data<_20pacgal_state>();
state->sprite_color_lookup[offset] = data;
}
@@ -331,19 +331,19 @@ INPUT_PORTS_END
static MACHINE_START( 20pacgal )
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
- state->maincpu = machine->device("maincpu");
- state->eeprom = machine->device("eeprom");
+ state->maincpu = machine.device("maincpu");
+ state->eeprom = machine.device("eeprom");
state->save_item(NAME(state->game_selected));
state->save_item(NAME(state->ram_48000));
- machine->state().register_postload(postload_20pacgal, NULL);
+ machine.state().register_postload(postload_20pacgal, NULL);
}
static MACHINE_RESET( 20pacgal )
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
state->game_selected = 0;
}
@@ -451,14 +451,14 @@ ROM_END
static DRIVER_INIT(20pacgal)
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
state->sprite_pal_base = 0x00<<2;
}
static DRIVER_INIT(25pacman)
{
- _20pacgal_state *state = machine->driver_data<_20pacgal_state>();
+ _20pacgal_state *state = machine.driver_data<_20pacgal_state>();
state->sprite_pal_base = 0x20<<2;
}
diff --git a/src/mame/drivers/2mindril.c b/src/mame/drivers/2mindril.c
index 311457b00d7..af9efdfc56e 100644
--- a/src/mame/drivers/2mindril.c
+++ b/src/mame/drivers/2mindril.c
@@ -83,7 +83,7 @@ public:
UINT16 data0 = map[y * 128 + x * 2]; \
UINT16 data1 = map[y * 128 + x * 2 + 1]; \
drawgfx_transpen(bitmap, \
- cliprect,screen->machine->gfx[0], data1, \
+ cliprect,screen->machine().gfx[0], data1, \
data0 & 0xff, \
data0 & 0x4000, data0 & 0x8000, \
x * 16 - 512 /*+(((INT16)(state->unkram[0x60000 / 2 + num])) / 32)*/, \
@@ -93,7 +93,7 @@ public:
static SCREEN_UPDATE( drill )
{
- _2mindril_state *state = screen->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = screen->machine().driver_data<_2mindril_state>();
bitmap_fill(bitmap, NULL, 0);
DRAW_MAP(state->map1ram, 0)
@@ -108,7 +108,7 @@ static SCREEN_UPDATE( drill )
{
drawgfx_transpen( bitmap,
cliprect,
- screen->machine->gfx[1],
+ screen->machine().gfx[1],
state->textram[y * 64 + x] & 0xff, //1ff ??
((state->textram[y * 64 + x] >> 9) & 0xf),
0, 0,
@@ -122,15 +122,15 @@ static SCREEN_UPDATE( drill )
static VIDEO_START( drill )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
- machine->gfx[0]->color_granularity = 16;
- gfx_element_set_source(machine->gfx[1], (UINT8 *)state->charram);
+ machine.gfx[0]->color_granularity = 16;
+ gfx_element_set_source(machine.gfx[1], (UINT8 *)state->charram);
}
static READ16_HANDLER( drill_io_r )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
// if (offset * 2 == 0x4)
/*popmessage("PC=%08x %04x %04x %04x %04x %04x %04x %04x %04x", cpu_get_pc(space->cpu), state->iodata[0/2], state->iodata[2/2], state->iodata[4/2], state->iodata[6/2],
@@ -138,10 +138,10 @@ static READ16_HANDLER( drill_io_r )
switch(offset)
{
- case 0x0/2: return input_port_read(space->machine, "DSW");
+ case 0x0/2: return input_port_read(space->machine(), "DSW");
case 0x2/2:
{
- int arm_pwr = input_port_read(space->machine, "IN0");//throw
+ int arm_pwr = input_port_read(space->machine(), "IN0");//throw
//popmessage("PC=%08x %02x",cpu_get_pc(space->cpu),arm_pwr);
if(arm_pwr > 0xe0) return ~0x1800;
@@ -151,7 +151,7 @@ static READ16_HANDLER( drill_io_r )
else return ~0x0000;
}
case 0x4/2: return (state->defender_sensor) | (state->shutter_sensor);
- case 0xe/2: return input_port_read(space->machine, "IN2");//coins
+ case 0xe/2: return input_port_read(space->machine(), "IN2");//coins
// default: printf("PC=%08x [%04x] -> %04x R\n", cpu_get_pc(space->cpu), offset * 2, state->iodata[offset]);
}
@@ -160,16 +160,16 @@ static READ16_HANDLER( drill_io_r )
static WRITE16_HANDLER( drill_io_w )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
COMBINE_DATA(&state->iodata[offset]);
switch(offset)
{
case 0x8/2:
- coin_counter_w(space->machine, 0, state->iodata[offset] & 0x0400);
- coin_counter_w(space->machine, 1, state->iodata[offset] & 0x0800);
- coin_lockout_w(space->machine, 0, ~state->iodata[offset] & 0x0100);
- coin_lockout_w(space->machine, 1, ~state->iodata[offset] & 0x0200);
+ coin_counter_w(space->machine(), 0, state->iodata[offset] & 0x0400);
+ coin_counter_w(space->machine(), 1, state->iodata[offset] & 0x0800);
+ coin_lockout_w(space->machine(), 0, ~state->iodata[offset] & 0x0100);
+ coin_lockout_w(space->machine(), 1, ~state->iodata[offset] & 0x0200);
break;
}
@@ -194,52 +194,52 @@ static WRITE16_HANDLER( drill_io_w )
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( shutter_req )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
state->shutter_sensor = param;
}
static TIMER_CALLBACK( defender_req )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
state->defender_sensor = param;
}
#endif
static WRITE16_HANDLER( sensors_w )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
/*---- xxxx ---- ---- select "lamps" (guess)*/
/*---- ---- ---- -x-- lamp*/
if (data & 1)
{
- //space->machine->scheduler().timer_set(attotime::from_seconds(2), FUNC(shutter_req ), 0x100);
+ //space->machine().scheduler().timer_set(attotime::from_seconds(2), FUNC(shutter_req ), 0x100);
state->shutter_sensor = 0x100;
}
else if (data & 2)
{
- //space->machine->scheduler().timer_set( attotime::from_seconds(2), FUNC(shutter_req ), 0x200);
+ //space->machine().scheduler().timer_set( attotime::from_seconds(2), FUNC(shutter_req ), 0x200);
state->shutter_sensor = 0x200;
}
if (data & 0x1000 || data & 0x4000)
{
- //space->machine->scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x800);
+ //space->machine().scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x800);
state->defender_sensor = 0x800;
}
else if (data & 0x2000 || data & 0x8000)
{
- //space->machine->scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x400);
+ //space->machine().scheduler().timer_set( attotime::from_seconds(2), FUNC(defender_req ), 0x400);
state->defender_sensor = 0x400;
}
}
static WRITE16_HANDLER( charram_w )
{
- _2mindril_state *state = space->machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = space->machine().driver_data<_2mindril_state>();
COMBINE_DATA(&state->charram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[1], offset / 16);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset / 16);
}
static ADDRESS_MAP_START( drill_map, AS_PROGRAM, 16 )
@@ -414,7 +414,7 @@ static INTERRUPT_GEN( drill_interrupt )
/* WRONG,it does something with 60000c & 700002,likely to be called when the player throws the ball.*/
static void irqhandler(device_t *device, int irq)
{
-// _2mindril_state *state = machine->driver_data<_2mindril_state>();
+// _2mindril_state *state = machine.driver_data<_2mindril_state>();
// device_set_input_line(state->maincpu, 5, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -426,9 +426,9 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( drill )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->defender_sensor));
state->save_item(NAME(state->shutter_sensor));
@@ -436,7 +436,7 @@ static MACHINE_START( drill )
static MACHINE_RESET( drill )
{
- _2mindril_state *state = machine->driver_data<_2mindril_state>();
+ _2mindril_state *state = machine.driver_data<_2mindril_state>();
state->defender_sensor = 0;
state->shutter_sensor = 0;
@@ -494,9 +494,9 @@ ROM_END
static DRIVER_INIT( drill )
{
// rearrange gfx roms to something we can decode, two of the roms form 4bpp of the graphics, the third forms another 2bpp but is in a different format
- UINT32 *src = (UINT32*)machine->region( "gfx2" )->base();
- UINT32 *dst = (UINT32*)machine->region( "gfx1" )->base();// + 0x400000;
-// UINT8 *rom = machine->region( "maincpu" )->base();
+ UINT32 *src = (UINT32*)machine.region( "gfx2" )->base();
+ UINT32 *dst = (UINT32*)machine.region( "gfx1" )->base();// + 0x400000;
+// UINT8 *rom = machine.region( "maincpu" )->base();
int i;
for (i = 0; i < 0x400000 / 4; i++)
diff --git a/src/mame/drivers/39in1.c b/src/mame/drivers/39in1.c
index 930cedfa9ee..246e5ad10ac 100644
--- a/src/mame/drivers/39in1.c
+++ b/src/mame/drivers/39in1.c
@@ -57,20 +57,20 @@ public:
};
-static void pxa255_dma_irq_check(running_machine* machine);
+static void pxa255_dma_irq_check(running_machine& machine);
static READ32_HANDLER( pxa255_dma_r );
static WRITE32_HANDLER( pxa255_dma_w );
static READ32_HANDLER( pxa255_i2s_r );
static WRITE32_HANDLER( pxa255_i2s_w );
-static void pxa255_ostimer_irq_check(running_machine* machine);
+static void pxa255_ostimer_irq_check(running_machine& machine);
static TIMER_CALLBACK( pxa255_ostimer_match );
static READ32_HANDLER( pxa255_ostimer_r );
static WRITE32_HANDLER( pxa255_ostimer_w );
-static void pxa255_update_interrupts(running_machine* machine);
-static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int state);
+static void pxa255_update_interrupts(running_machine& machine);
+static void pxa255_set_irq_line(running_machine& machine, UINT32 line, int state);
static READ32_HANDLER( pxa255_intc_r );
static WRITE32_HANDLER( pxa255_intc_w );
@@ -78,15 +78,15 @@ static READ32_HANDLER( pxa255_gpio_r );
static WRITE32_HANDLER( pxa255_gpio_w );
static void pxa255_lcd_load_dma_descriptor(address_space* space, UINT32 address, int channel);
-static void pxa255_lcd_irq_check(running_machine* machine);
-static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel);
-static void pxa255_lcd_check_load_next_branch(running_machine* machine, int channel);
+static void pxa255_lcd_irq_check(running_machine& machine);
+static void pxa255_lcd_dma_kickoff(running_machine& machine, int channel);
+static void pxa255_lcd_check_load_next_branch(running_machine& machine, int channel);
static READ32_HANDLER( pxa255_lcd_r );
static WRITE32_HANDLER( pxa255_lcd_w );
#define VERBOSE_LEVEL ( 3 )
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level, const char* s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine& machine, int n_level, const char* s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -95,8 +95,8 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
- //printf( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
+ //printf( "%s: %s", machine.describe_context(), buf );
}
}
@@ -110,34 +110,34 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine* machine, int n_level,
static READ32_HANDLER( pxa255_i2s_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_I2S_Regs *i2s_regs = &state->i2s_regs;
switch(PXA255_I2S_BASE_ADDR | (offset << 2))
{
case PXA255_SACR0:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Controller Global Control Register: %08x & %08x\n", i2s_regs->sacr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Controller Global Control Register: %08x & %08x\n", i2s_regs->sacr0, mem_mask );
return i2s_regs->sacr0;
case PXA255_SACR1:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", i2s_regs->sacr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", i2s_regs->sacr1, mem_mask );
return i2s_regs->sacr1;
case PXA255_SASR0:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", i2s_regs->sasr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", i2s_regs->sasr0, mem_mask );
return i2s_regs->sasr0;
case PXA255_SAIMR:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Interrupt Mask Register: %08x & %08x\n", i2s_regs->saimr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Interrupt Mask Register: %08x & %08x\n", i2s_regs->saimr, mem_mask );
return i2s_regs->saimr;
case PXA255_SAICR:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Interrupt Clear Register: %08x & %08x\n", i2s_regs->saicr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Interrupt Clear Register: %08x & %08x\n", i2s_regs->saicr, mem_mask );
return i2s_regs->saicr;
case PXA255_SADIV:
- verboselog( space->machine, 3, "pxa255_i2s_r: Serial Audio Clock Divider Register: %08x & %08x\n", i2s_regs->sadiv, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_r: Serial Audio Clock Divider Register: %08x & %08x\n", i2s_regs->sadiv, mem_mask );
return i2s_regs->sadiv;
case PXA255_SADR:
- verboselog( space->machine, 5, "pxa255_i2s_r: Serial Audio Data Register: %08x & %08x\n", i2s_regs->sadr, mem_mask );
+ verboselog( space->machine(), 5, "pxa255_i2s_r: Serial Audio Data Register: %08x & %08x\n", i2s_regs->sadr, mem_mask );
return i2s_regs->sadr;
default:
- verboselog( space->machine, 0, "pxa255_i2s_r: Unknown address: %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_i2s_r: Unknown address: %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -145,7 +145,7 @@ static READ32_HANDLER( pxa255_i2s_r )
static WRITE32_HANDLER( pxa255_i2s_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_I2S_Regs *i2s_regs = &state->i2s_regs;
#if 0
@@ -166,23 +166,23 @@ static WRITE32_HANDLER( pxa255_i2s_w )
switch(PXA255_I2S_BASE_ADDR | (offset << 2))
{
case PXA255_SACR0:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Controller Global Control Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Controller Global Control Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sacr0 = data & 0x0000ff3d;
break;
case PXA255_SACR1:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Control Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sacr1 = data & 0x00000039;
break;
case PXA255_SASR0:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Controller I2S/MSB-Justified Status Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sasr0 = data & 0x0000ff7f;
break;
case PXA255_SAIMR:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Interrupt Mask Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Interrupt Mask Register: %08x & %08x\n", data, mem_mask );
i2s_regs->saimr = data & 0x00000078;
break;
case PXA255_SAICR:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Interrupt Clear Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Interrupt Clear Register: %08x & %08x\n", data, mem_mask );
if(i2s_regs->saicr & PXA255_SAICR_ROR)
{
i2s_regs->sasr0 &= ~PXA255_SASR0_ROR;
@@ -193,13 +193,13 @@ static WRITE32_HANDLER( pxa255_i2s_w )
}
break;
case PXA255_SADIV:
- verboselog( space->machine, 3, "pxa255_i2s_w: Serial Audio Clock Divider Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_i2s_w: Serial Audio Clock Divider Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sadiv = data & 0x0000007f;
dmadac_set_frequency(&state->dmadac[0], 2, ((double)147600000 / (double)i2s_regs->sadiv) / 256.0);
dmadac_enable(&state->dmadac[0], 2, 1);
break;
case PXA255_SADR:
- verboselog( space->machine, 4, "pxa255_i2s_w: Serial Audio Data Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_i2s_w: Serial Audio Data Register: %08x & %08x\n", data, mem_mask );
i2s_regs->sadr = data;
#if 0
if(audio_dump)
@@ -209,7 +209,7 @@ static WRITE32_HANDLER( pxa255_i2s_w )
#endif
break;
default:
- verboselog( space->machine, 0, "pxa255_i2s_w: Unknown address: %08x = %08x & %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_i2s_w: Unknown address: %08x = %08x & %08x\n", PXA255_I2S_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -222,9 +222,9 @@ static WRITE32_HANDLER( pxa255_i2s_w )
*/
-static void pxa255_dma_irq_check(running_machine* machine)
+static void pxa255_dma_irq_check(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
int channel = 0;
int set_intr = 0;
@@ -245,9 +245,9 @@ static void pxa255_dma_irq_check(running_machine* machine)
pxa255_set_irq_line(machine, PXA255_INT_DMA, set_intr);
}
-static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int channel)
+static void pxa255_dma_load_descriptor_and_start(running_machine& machine, int channel)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
attotime period;
@@ -260,7 +260,7 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c
// Load the next descriptor
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
dma_regs->dsadr[channel] = space->read_dword(dma_regs->ddadr[channel] + 0x4);
dma_regs->dtadr[channel] = space->read_dword(dma_regs->ddadr[channel] + 0x8);
dma_regs->dcmd[channel] = space->read_dword(dma_regs->ddadr[channel] + 0xc);
@@ -290,7 +290,7 @@ static void pxa255_dma_load_descriptor_and_start(running_machine* machine, int c
static TIMER_CALLBACK( pxa255_dma_dma_end )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
UINT32 sadr = dma_regs->dsadr[param];
UINT32 tadr = dma_regs->dtadr[param];
@@ -300,7 +300,7 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
UINT16 temp16;
UINT32 temp32;
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
switch(param)
{
case 3:
@@ -401,7 +401,7 @@ static TIMER_CALLBACK( pxa255_dma_dma_end )
static READ32_HANDLER( pxa255_dma_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
switch(PXA255_DMA_BASE_ADDR | (offset << 2))
@@ -410,10 +410,10 @@ static READ32_HANDLER( pxa255_dma_r )
case PXA255_DCSR4: case PXA255_DCSR5: case PXA255_DCSR6: case PXA255_DCSR7:
case PXA255_DCSR8: case PXA255_DCSR9: case PXA255_DCSR10: case PXA255_DCSR11:
case PXA255_DCSR12: case PXA255_DCSR13: case PXA255_DCSR14: case PXA255_DCSR15:
- verboselog( space->machine, 4, "pxa255_dma_r: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, dma_regs->dcsr[offset], mem_mask );
+ verboselog( space->machine(), 4, "pxa255_dma_r: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, dma_regs->dcsr[offset], mem_mask );
return dma_regs->dcsr[offset];
case PXA255_DINT:
- if (0) verboselog( space->machine, 3, "pxa255_dma_r: DMA Interrupt Register: %08x & %08x\n", dma_regs->dint, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_dma_r: DMA Interrupt Register: %08x & %08x\n", dma_regs->dint, mem_mask );
return dma_regs->dint;
case PXA255_DRCMR0: case PXA255_DRCMR1: case PXA255_DRCMR2: case PXA255_DRCMR3:
case PXA255_DRCMR4: case PXA255_DRCMR5: case PXA255_DRCMR6: case PXA255_DRCMR7:
@@ -425,34 +425,34 @@ static READ32_HANDLER( pxa255_dma_r )
case PXA255_DRCMR28: case PXA255_DRCMR29: case PXA255_DRCMR30: case PXA255_DRCMR31:
case PXA255_DRCMR32: case PXA255_DRCMR33: case PXA255_DRCMR34: case PXA255_DRCMR35:
case PXA255_DRCMR36: case PXA255_DRCMR37: case PXA255_DRCMR38: case PXA255_DRCMR39:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), 0, mem_mask );
return dma_regs->drcmr[offset - (0x100 >> 2)];
case PXA255_DDADR0: case PXA255_DDADR1: case PXA255_DDADR2: case PXA255_DDADR3:
case PXA255_DDADR4: case PXA255_DDADR5: case PXA255_DDADR6: case PXA255_DDADR7:
case PXA255_DDADR8: case PXA255_DDADR9: case PXA255_DDADR10: case PXA255_DDADR11:
case PXA255_DDADR12: case PXA255_DDADR13: case PXA255_DDADR14: case PXA255_DDADR15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->ddadr[(offset - (0x200 >> 2)) >> 2];
case PXA255_DSADR0: case PXA255_DSADR1: case PXA255_DSADR2: case PXA255_DSADR3:
case PXA255_DSADR4: case PXA255_DSADR5: case PXA255_DSADR6: case PXA255_DSADR7:
case PXA255_DSADR8: case PXA255_DSADR9: case PXA255_DSADR10: case PXA255_DSADR11:
case PXA255_DSADR12: case PXA255_DSADR13: case PXA255_DSADR14: case PXA255_DSADR15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->dsadr[(offset - (0x200 >> 2)) >> 2];
case PXA255_DTADR0: case PXA255_DTADR1: case PXA255_DTADR2: case PXA255_DTADR3:
case PXA255_DTADR4: case PXA255_DTADR5: case PXA255_DTADR6: case PXA255_DTADR7:
case PXA255_DTADR8: case PXA255_DTADR9: case PXA255_DTADR10: case PXA255_DTADR11:
case PXA255_DTADR12: case PXA255_DTADR13: case PXA255_DTADR14: case PXA255_DTADR15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->dtadr[(offset - (0x200 >> 2)) >> 2];
case PXA255_DCMD0: case PXA255_DCMD1: case PXA255_DCMD2: case PXA255_DCMD3:
case PXA255_DCMD4: case PXA255_DCMD5: case PXA255_DCMD6: case PXA255_DCMD7:
case PXA255_DCMD8: case PXA255_DCMD9: case PXA255_DCMD10: case PXA255_DCMD11:
case PXA255_DCMD12: case PXA255_DCMD13: case PXA255_DCMD14: case PXA255_DCMD15:
- verboselog( space->machine, 3, "pxa255_dma_r: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_r: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, 0, mem_mask );
return dma_regs->dcmd[(offset - (0x200 >> 2)) >> 2];
default:
- verboselog( space->machine, 0, "pxa255_dma_r: Unknown address: %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_dma_r: Unknown address: %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -460,7 +460,7 @@ static READ32_HANDLER( pxa255_dma_r )
static WRITE32_HANDLER( pxa255_dma_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_DMA_Regs *dma_regs = &state->dma_regs;
switch(PXA255_DMA_BASE_ADDR | (offset << 2))
@@ -469,7 +469,7 @@ static WRITE32_HANDLER( pxa255_dma_w )
case PXA255_DCSR4: case PXA255_DCSR5: case PXA255_DCSR6: case PXA255_DCSR7:
case PXA255_DCSR8: case PXA255_DCSR9: case PXA255_DCSR10: case PXA255_DCSR11:
case PXA255_DCSR12: case PXA255_DCSR13: case PXA255_DCSR14: case PXA255_DCSR15:
- if (0) verboselog( space->machine, 3, "pxa255_dma_w: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_dma_w: DMA Channel Control/Status Register %d: %08x & %08x\n", offset, data, mem_mask );
dma_regs->dcsr[offset] &= ~(data & 0x00000007);
dma_regs->dcsr[offset] &= ~0x60000000;
dma_regs->dcsr[offset] |= data & 0x60000000;
@@ -478,21 +478,21 @@ static WRITE32_HANDLER( pxa255_dma_w )
dma_regs->dcsr[offset] |= PXA255_DCSR_RUN;
if(data & PXA255_DCSR_NODESCFETCH)
{
- verboselog( space->machine, 0, " No-Descriptor-Fetch mode is not supported.\n" );
+ verboselog( space->machine(), 0, " No-Descriptor-Fetch mode is not supported.\n" );
break;
}
- pxa255_dma_load_descriptor_and_start(space->machine, offset);
+ pxa255_dma_load_descriptor_and_start(space->machine(), offset);
}
else if(!(data & PXA255_DCSR_RUN))
{
dma_regs->dcsr[offset] &= ~PXA255_DCSR_RUN;
}
- pxa255_dma_irq_check(space->machine);
+ pxa255_dma_irq_check(space->machine());
break;
case PXA255_DINT:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Interrupt Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Interrupt Register: %08x & %08x\n", data, mem_mask );
dma_regs->dint &= ~data;
break;
case PXA255_DRCMR0: case PXA255_DRCMR1: case PXA255_DRCMR2: case PXA255_DRCMR3:
@@ -505,39 +505,39 @@ static WRITE32_HANDLER( pxa255_dma_w )
case PXA255_DRCMR28: case PXA255_DRCMR29: case PXA255_DRCMR30: case PXA255_DRCMR31:
case PXA255_DRCMR32: case PXA255_DRCMR33: case PXA255_DRCMR34: case PXA255_DRCMR35:
case PXA255_DRCMR36: case PXA255_DRCMR37: case PXA255_DRCMR38: case PXA255_DRCMR39:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Request to Channel Map Register %d: %08x & %08x\n", offset - (0x100 >> 2), data, mem_mask );
dma_regs->drcmr[offset - (0x100 >> 2)] = data & 0x0000008f;
break;
case PXA255_DDADR0: case PXA255_DDADR1: case PXA255_DDADR2: case PXA255_DDADR3:
case PXA255_DDADR4: case PXA255_DDADR5: case PXA255_DDADR6: case PXA255_DDADR7:
case PXA255_DDADR8: case PXA255_DDADR9: case PXA255_DDADR10: case PXA255_DDADR11:
case PXA255_DDADR12: case PXA255_DDADR13: case PXA255_DDADR14: case PXA255_DDADR15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Descriptor Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->ddadr[(offset - (0x200 >> 2)) >> 2] = data & 0xfffffff1;
break;
case PXA255_DSADR0: case PXA255_DSADR1: case PXA255_DSADR2: case PXA255_DSADR3:
case PXA255_DSADR4: case PXA255_DSADR5: case PXA255_DSADR6: case PXA255_DSADR7:
case PXA255_DSADR8: case PXA255_DSADR9: case PXA255_DSADR10: case PXA255_DSADR11:
case PXA255_DSADR12: case PXA255_DSADR13: case PXA255_DSADR14: case PXA255_DSADR15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Source Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->dsadr[(offset - (0x200 >> 2)) >> 2] = data & 0xfffffffc;
break;
case PXA255_DTADR0: case PXA255_DTADR1: case PXA255_DTADR2: case PXA255_DTADR3:
case PXA255_DTADR4: case PXA255_DTADR5: case PXA255_DTADR6: case PXA255_DTADR7:
case PXA255_DTADR8: case PXA255_DTADR9: case PXA255_DTADR10: case PXA255_DTADR11:
case PXA255_DTADR12: case PXA255_DTADR13: case PXA255_DTADR14: case PXA255_DTADR15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Target Address Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->dtadr[(offset - (0x200 >> 2)) >> 2] = data & 0xfffffffc;
break;
case PXA255_DCMD0: case PXA255_DCMD1: case PXA255_DCMD2: case PXA255_DCMD3:
case PXA255_DCMD4: case PXA255_DCMD5: case PXA255_DCMD6: case PXA255_DCMD7:
case PXA255_DCMD8: case PXA255_DCMD9: case PXA255_DCMD10: case PXA255_DCMD11:
case PXA255_DCMD12: case PXA255_DCMD13: case PXA255_DCMD14: case PXA255_DCMD15:
- verboselog( space->machine, 3, "pxa255_dma_w: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_dma_w: DMA Command Register %d: %08x & %08x\n", (offset - (0x200 >> 2)) >> 2, data, mem_mask );
dma_regs->dcmd[(offset - (0x200 >> 2)) >> 2] = data & 0xf067dfff;
break;
default:
- verboselog( space->machine, 0, "pxa255_dma_w: Unknown address: %08x = %08x & %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_dma_w: Unknown address: %08x = %08x & %08x\n", PXA255_DMA_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -550,9 +550,9 @@ static WRITE32_HANDLER( pxa255_dma_w )
*/
-static void pxa255_ostimer_irq_check(running_machine* machine)
+static void pxa255_ostimer_irq_check(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
pxa255_set_irq_line(machine, PXA255_INT_OSTIMER0, (ostimer_regs->oier & PXA255_OIER_E0) ? ((ostimer_regs->ossr & PXA255_OSSR_M0) ? 1 : 0) : 0);
@@ -563,7 +563,7 @@ static void pxa255_ostimer_irq_check(running_machine* machine)
static TIMER_CALLBACK( pxa255_ostimer_match )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
if (0) verboselog(machine, 3, "pxa255_ostimer_match channel %d\n", param);
@@ -574,39 +574,39 @@ static TIMER_CALLBACK( pxa255_ostimer_match )
static READ32_HANDLER( pxa255_ostimer_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
switch(PXA255_OSTMR_BASE_ADDR | (offset << 2))
{
case PXA255_OSMR0:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 0: %08x & %08x\n", ostimer_regs->osmr[0], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 0: %08x & %08x\n", ostimer_regs->osmr[0], mem_mask );
return ostimer_regs->osmr[0];
case PXA255_OSMR1:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 1: %08x & %08x\n", ostimer_regs->osmr[1], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 1: %08x & %08x\n", ostimer_regs->osmr[1], mem_mask );
return ostimer_regs->osmr[1];
case PXA255_OSMR2:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 2: %08x & %08x\n", ostimer_regs->osmr[2], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 2: %08x & %08x\n", ostimer_regs->osmr[2], mem_mask );
return ostimer_regs->osmr[2];
case PXA255_OSMR3:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Match Register 3: %08x & %08x\n", ostimer_regs->osmr[3], mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Match Register 3: %08x & %08x\n", ostimer_regs->osmr[3], mem_mask );
return ostimer_regs->osmr[3];
case PXA255_OSCR:
- if (0) verboselog( space->machine, 4, "pxa255_ostimer_r: OS Timer Count Register: %08x & %08x\n", ostimer_regs->oscr, mem_mask );
+ if (0) verboselog( space->machine(), 4, "pxa255_ostimer_r: OS Timer Count Register: %08x & %08x\n", ostimer_regs->oscr, mem_mask );
// free-running 3.something MHz counter. this is a complete hack.
ostimer_regs->oscr += 0x300;
return ostimer_regs->oscr;
case PXA255_OSSR:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Status Register: %08x & %08x\n", ostimer_regs->ossr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Status Register: %08x & %08x\n", ostimer_regs->ossr, mem_mask );
return ostimer_regs->ossr;
case PXA255_OWER:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Watchdog Match Enable Register: %08x & %08x\n", ostimer_regs->ower, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Watchdog Match Enable Register: %08x & %08x\n", ostimer_regs->ower, mem_mask );
return ostimer_regs->ower;
case PXA255_OIER:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_r: OS Timer Interrupt Enable Register: %08x & %08x\n", ostimer_regs->oier, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_r: OS Timer Interrupt Enable Register: %08x & %08x\n", ostimer_regs->oier, mem_mask );
return ostimer_regs->oier;
default:
- if (0) verboselog( space->machine, 0, "pxa255_ostimer_r: Unknown address: %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2));
+ if (0) verboselog( space->machine(), 0, "pxa255_ostimer_r: Unknown address: %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -614,13 +614,13 @@ static READ32_HANDLER( pxa255_ostimer_r )
static WRITE32_HANDLER( pxa255_ostimer_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_OSTMR_Regs *ostimer_regs = &state->ostimer_regs;
switch(PXA255_OSTMR_BASE_ADDR | (offset << 2))
{
case PXA255_OSMR0:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 0: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 0: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[0] = data;
if(ostimer_regs->oier & PXA255_OIER_E0)
{
@@ -631,7 +631,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSMR1:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 1: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 1: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[1] = data;
if(ostimer_regs->oier & PXA255_OIER_E1)
{
@@ -641,7 +641,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSMR2:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 2: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 2: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[2] = data;
if(ostimer_regs->oier & PXA255_OIER_E2)
{
@@ -651,7 +651,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSMR3:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Match Register 3: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Match Register 3: %08x & %08x\n", data, mem_mask );
ostimer_regs->osmr[3] = data;
if(ostimer_regs->oier & PXA255_OIER_E3)
{
@@ -661,22 +661,22 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
}
break;
case PXA255_OSCR:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Count Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Count Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->oscr = data;
break;
case PXA255_OSSR:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Status Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Status Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->ossr &= ~data;
- pxa255_ostimer_irq_check(space->machine);
+ pxa255_ostimer_irq_check(space->machine());
break;
case PXA255_OWER:
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Watchdog Enable Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Watchdog Enable Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->ower = data & 0x00000001;
break;
case PXA255_OIER:
{
int index = 0;
- if (0) verboselog( space->machine, 3, "pxa255_ostimer_w: OS Timer Interrupt Enable Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_ostimer_w: OS Timer Interrupt Enable Register: %08x & %08x\n", data, mem_mask );
ostimer_regs->oier = data & 0x0000000f;
for(index = 0; index < 4; index++)
{
@@ -691,7 +691,7 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
break;
}
default:
- verboselog( space->machine, 0, "pxa255_ostimer_w: Unknown address: %08x = %08x & %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_ostimer_w: Unknown address: %08x = %08x & %08x\n", PXA255_OSTMR_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -704,9 +704,9 @@ static WRITE32_HANDLER( pxa255_ostimer_w )
*/
-static void pxa255_update_interrupts(running_machine* machine)
+static void pxa255_update_interrupts(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
intc_regs->icfp = (intc_regs->icpr & intc_regs->icmr) & intc_regs->iclr;
@@ -715,9 +715,9 @@ static void pxa255_update_interrupts(running_machine* machine)
cputag_set_input_line(machine, "maincpu", ARM7_IRQ_LINE, intc_regs->icip ? ASSERT_LINE : CLEAR_LINE);
}
-static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int irq_state)
+static void pxa255_set_irq_line(running_machine& machine, UINT32 line, int irq_state)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
intc_regs->icpr &= ~line;
@@ -728,31 +728,31 @@ static void pxa255_set_irq_line(running_machine* machine, UINT32 line, int irq_s
static READ32_HANDLER( pxa255_intc_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
switch(PXA255_INTC_BASE_ADDR | (offset << 2))
{
case PXA255_ICIP:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller IRQ Pending Register: %08x & %08x\n", intc_regs->icip, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller IRQ Pending Register: %08x & %08x\n", intc_regs->icip, mem_mask );
return intc_regs->icip;
case PXA255_ICMR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Mask Register: %08x & %08x\n", intc_regs->icmr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Mask Register: %08x & %08x\n", intc_regs->icmr, mem_mask );
return intc_regs->icmr;
case PXA255_ICLR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Level Register: %08x & %08x\n", intc_regs->iclr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Level Register: %08x & %08x\n", intc_regs->iclr, mem_mask );
return intc_regs->iclr;
case PXA255_ICFP:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller FIQ Pending Register: %08x & %08x\n", intc_regs->icfp, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller FIQ Pending Register: %08x & %08x\n", intc_regs->icfp, mem_mask );
return intc_regs->icfp;
case PXA255_ICPR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Pending Register: %08x & %08x\n", intc_regs->icpr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Pending Register: %08x & %08x\n", intc_regs->icpr, mem_mask );
return intc_regs->icpr;
case PXA255_ICCR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_r: Interrupt Controller Control Register: %08x & %08x\n", intc_regs->iccr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_r: Interrupt Controller Control Register: %08x & %08x\n", intc_regs->iccr, mem_mask );
return intc_regs->iccr;
default:
- verboselog( space->machine, 0, "pxa255_intc_r: Unknown address: %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_intc_r: Unknown address: %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -760,34 +760,34 @@ static READ32_HANDLER( pxa255_intc_r )
static WRITE32_HANDLER( pxa255_intc_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_INTC_Regs *intc_regs = &state->intc_regs;
switch(PXA255_INTC_BASE_ADDR | (offset << 2))
{
case PXA255_ICIP:
- verboselog( space->machine, 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller IRQ Pending Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller IRQ Pending Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_ICMR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: Interrupt Controller Mask Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: Interrupt Controller Mask Register: %08x & %08x\n", data, mem_mask );
intc_regs->icmr = data & 0xfffe7f00;
break;
case PXA255_ICLR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: Interrupt Controller Level Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: Interrupt Controller Level Register: %08x & %08x\n", data, mem_mask );
intc_regs->iclr = data & 0xfffe7f00;
break;
case PXA255_ICFP:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller FIQ Pending Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller FIQ Pending Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_ICPR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller Pending Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: (Invalid Write) Interrupt Controller Pending Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_ICCR:
- if (0) verboselog( space->machine, 3, "pxa255_intc_w: Interrupt Controller Control Register: %08x & %08x\n", data, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_intc_w: Interrupt Controller Control Register: %08x & %08x\n", data, mem_mask );
intc_regs->iccr = data & 0x00000001;
break;
default:
- verboselog( space->machine, 0, "pxa255_intc_w: Unknown address: %08x = %08x & %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_intc_w: Unknown address: %08x = %08x & %08x\n", PXA255_INTC_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -802,97 +802,97 @@ static WRITE32_HANDLER( pxa255_intc_w )
static READ32_HANDLER( pxa255_gpio_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_GPIO_Regs *gpio_regs = &state->gpio_regs;
switch(PXA255_GPIO_BASE_ADDR | (offset << 2))
{
case PXA255_GPLR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin-Level Register 0: %08x & %08x\n", gpio_regs->gplr0 | (1 << 1), mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin-Level Register 0: %08x & %08x\n", gpio_regs->gplr0 | (1 << 1), mem_mask );
return gpio_regs->gplr0 | (1 << 1) | (eeprom_read_bit(state->eeprom) << 5); // Must be on. Probably a DIP switch.
case PXA255_GPLR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 1: %08x & %08x\n", gpio_regs->gplr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 1: %08x & %08x\n", gpio_regs->gplr1, mem_mask );
return 0xff9fffff;
/*
0x200000 = flip screen
*/
case PXA255_GPLR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 2: %08x & %08x\n", gpio_regs->gplr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: *Not Yet Implemented* GPIO Pin-Level Register 2: %08x & %08x\n", gpio_regs->gplr2, mem_mask );
return gpio_regs->gplr2;
case PXA255_GPDR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin Direction Register 0: %08x & %08x\n", gpio_regs->gpdr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin Direction Register 0: %08x & %08x\n", gpio_regs->gpdr0, mem_mask );
return gpio_regs->gpdr0;
case PXA255_GPDR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin Direction Register 1: %08x & %08x\n", gpio_regs->gpdr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin Direction Register 1: %08x & %08x\n", gpio_regs->gpdr1, mem_mask );
return gpio_regs->gpdr1;
case PXA255_GPDR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Pin Direction Register 2: %08x & %08x\n", gpio_regs->gpdr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Pin Direction Register 2: %08x & %08x\n", gpio_regs->gpdr2, mem_mask );
return gpio_regs->gpdr2;
case PXA255_GPSR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 0: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 0: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPSR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 1: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 1: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPSR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 2: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Set Register 2: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPCR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 0: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 0: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPCR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 1: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 1: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GPCR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 2: %08x & %08x\n", space->machine->rand(), mem_mask );
- return space->machine->rand();
+ verboselog( space->machine(), 3, "pxa255_gpio_r: (Invalid Read) GPIO Pin Output Clear Register 2: %08x & %08x\n", space->machine().rand(), mem_mask );
+ return space->machine().rand();
case PXA255_GRER0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->grer0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->grer0, mem_mask );
return gpio_regs->grer0;
case PXA255_GRER1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->grer1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->grer1, mem_mask );
return gpio_regs->grer1;
case PXA255_GRER2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->grer2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->grer2, mem_mask );
return gpio_regs->grer2;
case PXA255_GFER0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->gfer0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", gpio_regs->gfer0, mem_mask );
return gpio_regs->gfer0;
case PXA255_GFER1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->gfer1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", gpio_regs->gfer1, mem_mask );
return gpio_regs->gfer1;
case PXA255_GFER2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->gfer2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", gpio_regs->gfer2, mem_mask );
return gpio_regs->gfer2;
case PXA255_GEDR0:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
return gpio_regs->gedr0;
case PXA255_GEDR1:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
return gpio_regs->gedr1;
case PXA255_GEDR2:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
return gpio_regs->gedr2;
case PXA255_GAFR0_L:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
return gpio_regs->gafr0l;
case PXA255_GAFR0_U:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
return gpio_regs->gafr0u;
case PXA255_GAFR1_L:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
return gpio_regs->gafr1l;
case PXA255_GAFR1_U:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
return gpio_regs->gafr1u;
case PXA255_GAFR2_L:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
return gpio_regs->gafr2l;
case PXA255_GAFR2_U:
- verboselog( space->machine, 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_r: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
return gpio_regs->gafr2u;
default:
- verboselog( space->machine, 0, "pxa255_gpio_r: Unknown address: %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_gpio_r: Unknown address: %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -900,34 +900,34 @@ static READ32_HANDLER( pxa255_gpio_r )
static WRITE32_HANDLER( pxa255_gpio_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_GPIO_Regs *gpio_regs = &state->gpio_regs;
switch(PXA255_GPIO_BASE_ADDR | (offset << 2))
{
case PXA255_GPLR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_GPLR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 1: %08x & %08x\n", data, mem_mask );
break;
case PXA255_GPLR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: (Invalid Write) GPIO Pin-Level Register 2: %08x & %08x\n", data, mem_mask );
break;
case PXA255_GPDR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Direction Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Direction Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gpdr0 = data;
break;
case PXA255_GPDR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Direction Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Direction Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gpdr1 = data;
break;
case PXA255_GPDR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Direction Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Direction Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gpdr2 = data;
break;
case PXA255_GPSR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Set Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Set Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr0 |= data & gpio_regs->gpdr0;
if(data & 0x00000004)
{
@@ -943,15 +943,15 @@ static WRITE32_HANDLER( pxa255_gpio_w )
}
break;
case PXA255_GPSR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Set Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Set Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr1 |= data & gpio_regs->gpdr1;
break;
case PXA255_GPSR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Set Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Set Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr2 |= data & gpio_regs->gpdr2;
break;
case PXA255_GPCR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr0 &= ~(data & gpio_regs->gpdr0);
if(data & 0x00000004)
{
@@ -967,75 +967,75 @@ static WRITE32_HANDLER( pxa255_gpio_w )
}
break;
case PXA255_GPCR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr1 &= ~(data & gpio_regs->gpdr1);
break;
case PXA255_GPCR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Pin Output Clear Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gpsr2 &= ~(data & gpio_regs->gpdr2);
break;
case PXA255_GRER0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->grer0 = data;
break;
case PXA255_GRER1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->grer1 = data;
break;
case PXA255_GRER2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Rising Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->grer2 = data;
break;
case PXA255_GFER0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 0: %08x & %08x\n", data, mem_mask );
gpio_regs->gfer0 = data;
break;
case PXA255_GFER1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 1: %08x & %08x\n", data, mem_mask );
gpio_regs->gfer1 = data;
break;
case PXA255_GFER2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Falling Edge Detect Enable Register 2: %08x & %08x\n", data, mem_mask );
gpio_regs->gfer2 = data;
break;
case PXA255_GEDR0:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 0: %08x & %08x\n", gpio_regs->gedr0, mem_mask );
gpio_regs->gedr0 &= ~data;
break;
case PXA255_GEDR1:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 1: %08x & %08x\n", gpio_regs->gedr1, mem_mask );
gpio_regs->gedr1 &= ~data;
break;
case PXA255_GEDR2:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Edge Detect Status Register 2: %08x & %08x\n", gpio_regs->gedr2, mem_mask );
gpio_regs->gedr2 &= ~data;
break;
case PXA255_GAFR0_L:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Lower: %08x & %08x\n", gpio_regs->gafr0l, mem_mask );
gpio_regs->gafr0l = data;
break;
case PXA255_GAFR0_U:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 0 Upper: %08x & %08x\n", gpio_regs->gafr0u, mem_mask );
gpio_regs->gafr0u = data;
break;
case PXA255_GAFR1_L:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Lower: %08x & %08x\n", gpio_regs->gafr1l, mem_mask );
gpio_regs->gafr1l = data;
break;
case PXA255_GAFR1_U:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 1 Upper: %08x & %08x\n", gpio_regs->gafr1u, mem_mask );
gpio_regs->gafr1u = data;
break;
case PXA255_GAFR2_L:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Lower: %08x & %08x\n", gpio_regs->gafr2l, mem_mask );
gpio_regs->gafr2l = data;
break;
case PXA255_GAFR2_U:
- verboselog( space->machine, 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_gpio_w: GPIO Alternate Function Register 2 Upper: %08x & %08x\n", gpio_regs->gafr2u, mem_mask );
gpio_regs->gafr2u = data;
break;
default:
- verboselog( space->machine, 0, "pxa255_gpio_w: Unknown address: %08x = %08x & %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_gpio_w: Unknown address: %08x = %08x & %08x\n", PXA255_GPIO_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -1050,23 +1050,23 @@ static WRITE32_HANDLER( pxa255_gpio_w )
static void pxa255_lcd_load_dma_descriptor(address_space* space, UINT32 address, int channel)
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
lcd_regs->dma[channel].fdadr = space->read_dword(address);
lcd_regs->dma[channel].fsadr = space->read_dword(address + 0x04);
lcd_regs->dma[channel].fidr = space->read_dword(address + 0x08);
lcd_regs->dma[channel].ldcmd = space->read_dword(address + 0x0c);
- verboselog( space->machine, 4, "pxa255_lcd_load_dma_descriptor, address = %08x, channel = %d\n", address, channel);
- verboselog( space->machine, 4, " DMA Frame Descriptor: %08x\n", lcd_regs->dma[channel].fdadr );
- verboselog( space->machine, 4, " DMA Frame Source Address: %08x\n", lcd_regs->dma[channel].fsadr );
- verboselog( space->machine, 4, " DMA Frame ID: %08x\n", lcd_regs->dma[channel].fidr );
- verboselog( space->machine, 4, " DMA Command: %08x\n", lcd_regs->dma[channel].ldcmd );
+ verboselog( space->machine(), 4, "pxa255_lcd_load_dma_descriptor, address = %08x, channel = %d\n", address, channel);
+ verboselog( space->machine(), 4, " DMA Frame Descriptor: %08x\n", lcd_regs->dma[channel].fdadr );
+ verboselog( space->machine(), 4, " DMA Frame Source Address: %08x\n", lcd_regs->dma[channel].fsadr );
+ verboselog( space->machine(), 4, " DMA Frame ID: %08x\n", lcd_regs->dma[channel].fidr );
+ verboselog( space->machine(), 4, " DMA Command: %08x\n", lcd_regs->dma[channel].ldcmd );
}
-static void pxa255_lcd_irq_check(running_machine* machine)
+static void pxa255_lcd_irq_check(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(((lcd_regs->lcsr & PXA255_LCSR_BS) != 0 && (lcd_regs->lccr0 & PXA255_LCCR0_BM) == 0) ||
@@ -1081,9 +1081,9 @@ static void pxa255_lcd_irq_check(running_machine* machine)
}
}
-static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
+static void pxa255_lcd_dma_kickoff(running_machine& machine, int channel)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(lcd_regs->dma[channel].fdadr != 0)
@@ -1101,7 +1101,7 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
if(lcd_regs->dma[channel].ldcmd & PXA255_LDCMD_PAL)
{
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
int length = lcd_regs->dma[channel].ldcmd & 0x000fffff;
int index = 0;
for(index = 0; index < length; index += 2)
@@ -1113,7 +1113,7 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
}
else
{
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
int length = lcd_regs->dma[channel].ldcmd & 0x000fffff;
int index = 0;
for(index = 0; index < length; index++)
@@ -1124,16 +1124,16 @@ static void pxa255_lcd_dma_kickoff(running_machine* machine, int channel)
}
}
-static void pxa255_lcd_check_load_next_branch(running_machine* machine, int channel)
+static void pxa255_lcd_check_load_next_branch(running_machine& machine, int channel)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if(lcd_regs->fbr[channel] & 1)
{
verboselog( machine, 4, "pxa255_lcd_check_load_next_branch: Taking branch\n" );
lcd_regs->fbr[channel] &= ~1;
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
//lcd_regs->fbr[channel] = (space->read_dword(lcd_regs->fbr[channel] & 0xfffffff0) & 0xfffffff0) | (lcd_regs->fbr[channel] & 0x00000003);
//printf( "%08x\n", lcd_regs->fbr[channel] );
pxa255_lcd_load_dma_descriptor(space, lcd_regs->fbr[channel] & 0xfffffff0, 0);
@@ -1156,7 +1156,7 @@ static void pxa255_lcd_check_load_next_branch(running_machine* machine, int chan
static TIMER_CALLBACK( pxa255_lcd_dma_eof )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
if (0) verboselog( machine, 3, "End of frame callback\n" );
@@ -1171,67 +1171,67 @@ static TIMER_CALLBACK( pxa255_lcd_dma_eof )
static READ32_HANDLER( pxa255_lcd_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
switch(PXA255_LCD_BASE_ADDR | (offset << 2))
{
case PXA255_LCCR0: // 0x44000000
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 0: %08x & %08x\n", lcd_regs->lccr0, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 0: %08x & %08x\n", lcd_regs->lccr0, mem_mask );
return lcd_regs->lccr0;
case PXA255_LCCR1: // 0x44000004
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 1: %08x & %08x\n", lcd_regs->lccr1, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 1: %08x & %08x\n", lcd_regs->lccr1, mem_mask );
return lcd_regs->lccr1;
case PXA255_LCCR2: // 0x44000008
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 2: %08x & %08x\n", lcd_regs->lccr2, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 2: %08x & %08x\n", lcd_regs->lccr2, mem_mask );
return lcd_regs->lccr2;
case PXA255_LCCR3: // 0x4400000c
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Control 3: %08x & %08x\n", lcd_regs->lccr3, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Control 3: %08x & %08x\n", lcd_regs->lccr3, mem_mask );
return lcd_regs->lccr3;
case PXA255_FBR0: // 0x44000020
- verboselog( space->machine, 4, "pxa255_lcd_r: LCD Frame Branch Register 0: %08x & %08x\n", lcd_regs->fbr[0], mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_r: LCD Frame Branch Register 0: %08x & %08x\n", lcd_regs->fbr[0], mem_mask );
return lcd_regs->fbr[0];
case PXA255_FBR1: // 0x44000024
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Frame Branch Register 1: %08x & %08x\n", lcd_regs->fbr[1], mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Frame Branch Register 1: %08x & %08x\n", lcd_regs->fbr[1], mem_mask );
return lcd_regs->fbr[1];
case PXA255_LCSR: // 0x44000038
- verboselog( space->machine, 4, "pxa255_lcd_r: LCD Status Register: %08x & %08x\n", lcd_regs->lcsr, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_r: LCD Status Register: %08x & %08x\n", lcd_regs->lcsr, mem_mask );
return lcd_regs->lcsr;
case PXA255_LIIDR: // 0x4400003c
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD Interrupt ID Register: %08x & %08x\n", lcd_regs->liidr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD Interrupt ID Register: %08x & %08x\n", lcd_regs->liidr, mem_mask );
return lcd_regs->liidr;
case PXA255_TRGBR: // 0x44000040
- verboselog( space->machine, 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->trgbr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->trgbr, mem_mask );
return lcd_regs->trgbr;
case PXA255_TCR: // 0x44000044
- verboselog( space->machine, 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->tcr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: TMED RGB Seed Register: %08x & %08x\n", lcd_regs->tcr, mem_mask );
return lcd_regs->tcr;
case PXA255_FDADR0: // 0x44000200
- if (0) verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fdadr, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fdadr, mem_mask );
return lcd_regs->dma[0].fdadr;
case PXA255_FSADR0: // 0x44000204
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fsadr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 0: %08x & %08x\n", lcd_regs->dma[0].fsadr, mem_mask );
return lcd_regs->dma[0].fsadr;
case PXA255_FIDR0: // 0x44000208
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame ID Register 0: %08x & %08x\n", lcd_regs->dma[0].fidr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame ID Register 0: %08x & %08x\n", lcd_regs->dma[0].fidr, mem_mask );
return lcd_regs->dma[0].fidr;
case PXA255_LDCMD0: // 0x4400020c
- if (0) verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Command Register 0: %08x & %08x\n", lcd_regs->dma[0].ldcmd & 0xfff00000, mem_mask );
+ if (0) verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Command Register 0: %08x & %08x\n", lcd_regs->dma[0].ldcmd & 0xfff00000, mem_mask );
return lcd_regs->dma[0].ldcmd & 0xfff00000;
case PXA255_FDADR1: // 0x44000210
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fdadr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fdadr, mem_mask );
return lcd_regs->dma[1].fdadr;
case PXA255_FSADR1: // 0x44000214
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fsadr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame Source Address Register 1: %08x & %08x\n", lcd_regs->dma[1].fsadr, mem_mask );
return lcd_regs->dma[1].fsadr;
case PXA255_FIDR1: // 0x44000218
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Frame ID Register 1: %08x & %08x\n", lcd_regs->dma[1].fidr, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Frame ID Register 1: %08x & %08x\n", lcd_regs->dma[1].fidr, mem_mask );
return lcd_regs->dma[1].fidr;
case PXA255_LDCMD1: // 0x4400021c
- verboselog( space->machine, 3, "pxa255_lcd_r: LCD DMA Command Register 1: %08x & %08x\n", lcd_regs->dma[1].ldcmd & 0xfff00000, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_r: LCD DMA Command Register 1: %08x & %08x\n", lcd_regs->dma[1].ldcmd & 0xfff00000, mem_mask );
return lcd_regs->dma[1].ldcmd & 0xfff00000;
default:
- verboselog( space->machine, 0, "pxa255_lcd_r: Unknown address: %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2));
+ verboselog( space->machine(), 0, "pxa255_lcd_r: Unknown address: %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2));
break;
}
return 0;
@@ -1239,65 +1239,65 @@ static READ32_HANDLER( pxa255_lcd_r )
static WRITE32_HANDLER( pxa255_lcd_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
PXA255_LCD_Regs *lcd_regs = &state->lcd_regs;
switch(PXA255_LCD_BASE_ADDR | (offset << 2))
{
case PXA255_LCCR0: // 0x44000000
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 0: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr0 = data & 0x00fffeff;
break;
case PXA255_LCCR1: // 0x44000004
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 1: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr1 = data;
break;
case PXA255_LCCR2: // 0x44000008
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 2: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 2: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr2 = data;
break;
case PXA255_LCCR3: // 0x4400000c
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Control 3: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Control 3: %08x & %08x\n", data, mem_mask );
lcd_regs->lccr3 = data;
break;
case PXA255_FBR0: // 0x44000020
- verboselog( space->machine, 4l, "pxa255_lcd_w: LCD Frame Branch Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4l, "pxa255_lcd_w: LCD Frame Branch Register 0: %08x & %08x\n", data, mem_mask );
lcd_regs->fbr[0] = data & 0xfffffff3;
if(!lcd_regs->dma[0].eof->enabled())
{
- if (0) verboselog( space->machine, 3, "ch0 EOF timer is not enabled, taking branch now\n" );
- pxa255_lcd_check_load_next_branch(space->machine, 0);
- pxa255_lcd_irq_check(space->machine);
+ if (0) verboselog( space->machine(), 3, "ch0 EOF timer is not enabled, taking branch now\n" );
+ pxa255_lcd_check_load_next_branch(space->machine(), 0);
+ pxa255_lcd_irq_check(space->machine());
}
break;
case PXA255_FBR1: // 0x44000024
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Frame Branch Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Frame Branch Register 1: %08x & %08x\n", data, mem_mask );
lcd_regs->fbr[1] = data & 0xfffffff3;
if(!lcd_regs->dma[1].eof->enabled())
{
- verboselog( space->machine, 3, "ch1 EOF timer is not enabled, taking branch now\n" );
- pxa255_lcd_check_load_next_branch(space->machine, 1);
- pxa255_lcd_irq_check(space->machine);
+ verboselog( space->machine(), 3, "ch1 EOF timer is not enabled, taking branch now\n" );
+ pxa255_lcd_check_load_next_branch(space->machine(), 1);
+ pxa255_lcd_irq_check(space->machine());
}
break;
case PXA255_LCSR: // 0x44000038
- verboselog( space->machine, 4, "pxa255_lcd_w: LCD Controller Status Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: LCD Controller Status Register: %08x & %08x\n", data, mem_mask );
lcd_regs->lcsr &= ~data;
- pxa255_lcd_irq_check(space->machine);
+ pxa255_lcd_irq_check(space->machine());
break;
case PXA255_LIIDR: // 0x4400003c
- verboselog( space->machine, 3, "pxa255_lcd_w: LCD Controller Interrupt ID Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: LCD Controller Interrupt ID Register: %08x & %08x\n", data, mem_mask );
break;
case PXA255_TRGBR: // 0x44000040
- verboselog( space->machine, 3, "pxa255_lcd_w: TMED RGB Seed Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: TMED RGB Seed Register: %08x & %08x\n", data, mem_mask );
lcd_regs->trgbr = data & 0x00ffffff;
break;
case PXA255_TCR: // 0x44000044
- verboselog( space->machine, 3, "pxa255_lcd_w: TMED Control Register: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 3, "pxa255_lcd_w: TMED Control Register: %08x & %08x\n", data, mem_mask );
lcd_regs->tcr = data & 0x00004fff;
break;
case PXA255_FDADR0: // 0x44000200
- verboselog( space->machine, 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 0: %08x & %08x\n", data, mem_mask );
if(!lcd_regs->dma[0].eof->enabled())
{
pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 0);
@@ -1309,16 +1309,16 @@ static WRITE32_HANDLER( pxa255_lcd_w )
}
break;
case PXA255_FSADR0: // 0x44000204
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_FIDR0: // 0x44000208
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_LDCMD0: // 0x4400020c
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 0: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 0: %08x & %08x\n", data, mem_mask );
break;
case PXA255_FDADR1: // 0x44000210
- verboselog( space->machine, 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: LCD DMA Frame Descriptor Address Register 1: %08x & %08x\n", data, mem_mask );
if(!lcd_regs->dma[1].eof->enabled())
{
pxa255_lcd_load_dma_descriptor(space, data & 0xfffffff0, 1);
@@ -1330,16 +1330,16 @@ static WRITE32_HANDLER( pxa255_lcd_w )
}
break;
case PXA255_FSADR1: // 0x44000214
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame Source Address Register 1: %08x & %08x\n", data, mem_mask );
break;
case PXA255_FIDR1: // 0x44000218
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Frame ID Register 1: %08x & %08x\n", data, mem_mask );
break;
case PXA255_LDCMD1: // 0x4400021c
- verboselog( space->machine, 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 1: %08x & %08x\n", data, mem_mask );
+ verboselog( space->machine(), 4, "pxa255_lcd_w: (Invalid Write) LCD DMA Command Register 1: %08x & %08x\n", data, mem_mask );
break;
default:
- verboselog( space->machine, 0, "pxa255_lcd_w: Unknown address: %08x = %08x & %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2), data, mem_mask);
+ verboselog( space->machine(), 0, "pxa255_lcd_w: Unknown address: %08x = %08x & %08x\n", PXA255_LCD_BASE_ADDR | (offset << 2), data, mem_mask);
break;
}
}
@@ -1362,7 +1362,7 @@ static READ32_HANDLER( unknown_r )
static READ32_HANDLER( cpld_r )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
//if (cpu_get_pc(space->cpu) != 0xe3af4) printf("CPLD read @ %x (PC %x state %d)\n", offset, cpu_get_pc(space->cpu), state);
@@ -1372,7 +1372,7 @@ static READ32_HANDLER( cpld_r )
}
else if (cpu_get_pc(space->cpu) == 0xe3af4)
{
- return input_port_read(space->machine, "MCUIPT");
+ return input_port_read(space->machine(), "MCUIPT");
}
else
{
@@ -1419,7 +1419,7 @@ static READ32_HANDLER( cpld_r )
static WRITE32_HANDLER( cpld_w )
{
- _39in1_state *state = space->machine->driver_data<_39in1_state>();
+ _39in1_state *state = space->machine().driver_data<_39in1_state>();
if (mem_mask == 0xffff)
{
@@ -1453,13 +1453,13 @@ static READ32_HANDLER( prot_cheater_r )
static DRIVER_INIT( 39in1 )
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
- state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
- state->eeprom = machine->device<eeprom_device>("eeprom");
+ state->dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ state->dmadac[1] = machine.device<dmadac_sound_device>("dac2");
+ state->eeprom = machine.device<eeprom_device>("eeprom");
- address_space *space = machine->device<pxa255_device>("maincpu")->space(AS_PROGRAM);
+ address_space *space = machine.device<pxa255_device>("maincpu")->space(AS_PROGRAM);
space->install_legacy_read_handler (0xa0151648, 0xa015164b, FUNC(prot_cheater_r));
}
@@ -1514,7 +1514,7 @@ INPUT_PORTS_END
static SCREEN_UPDATE( 39in1 )
{
- _39in1_state *state = screen->machine->driver_data<_39in1_state>();
+ _39in1_state *state = screen->machine().driver_data<_39in1_state>();
int x = 0;
int y = 0;
@@ -1530,9 +1530,9 @@ static SCREEN_UPDATE( 39in1 )
}
/* To be moved to DEVICE_START( pxa255 ) upon completion */
-static void pxa255_start(running_machine* machine)
+static void pxa255_start(running_machine& machine)
{
- _39in1_state *state = machine->driver_data<_39in1_state>();
+ _39in1_state *state = machine.driver_data<_39in1_state>();
int index = 0;
//pxa255_t* pxa255 = pxa255_get_safe_token( device );
@@ -1542,21 +1542,21 @@ static void pxa255_start(running_machine* machine)
for(index = 0; index < 16; index++)
{
state->dma_regs.dcsr[index] = 0x00000008;
- state->dma_regs.timer[index] = machine->scheduler().timer_alloc(FUNC(pxa255_dma_dma_end));
+ state->dma_regs.timer[index] = machine.scheduler().timer_alloc(FUNC(pxa255_dma_dma_end));
}
memset(&state->ostimer_regs, 0, sizeof(state->ostimer_regs));
for(index = 0; index < 4; index++)
{
state->ostimer_regs.osmr[index] = 0;
- state->ostimer_regs.timer[index] = machine->scheduler().timer_alloc(FUNC(pxa255_ostimer_match));
+ state->ostimer_regs.timer[index] = machine.scheduler().timer_alloc(FUNC(pxa255_ostimer_match));
}
memset(&state->intc_regs, 0, sizeof(state->intc_regs));
memset(&state->lcd_regs, 0, sizeof(state->lcd_regs));
- state->lcd_regs.dma[0].eof = machine->scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
- state->lcd_regs.dma[1].eof = machine->scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
+ state->lcd_regs.dma[0].eof = machine.scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
+ state->lcd_regs.dma[1].eof = machine.scheduler().timer_alloc(FUNC(pxa255_lcd_dma_eof));
state->lcd_regs.trgbr = 0x00aa5500;
state->lcd_regs.tcr = 0x0000754f;
@@ -1565,7 +1565,7 @@ static void pxa255_start(running_machine* machine)
static MACHINE_START(39in1)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x80000; i += 2)
diff --git a/src/mame/drivers/40love.c b/src/mame/drivers/40love.c
index 0a52436f331..e1f7fa0c388 100644
--- a/src/mame/drivers/40love.c
+++ b/src/mame/drivers/40love.c
@@ -227,7 +227,7 @@ Notes - Has jumper setting for 122HZ or 61HZ)
static TIMER_CALLBACK( nmi_callback )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -237,18 +237,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -262,7 +262,7 @@ static WRITE8_HANDLER( nmi_enable_w )
#if 0
static WRITE8_HANDLER( fortyl_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
#endif
@@ -276,12 +276,12 @@ static WRITE8_HANDLER( bank_select_w )
// popmessage("WRONG BANK SELECT = %x !!!!\n",data);
}
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER( pix1_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
// if (data > 7)
// logerror("pix1 = %2x\n", data);
@@ -290,7 +290,7 @@ static WRITE8_HANDLER( pix1_w )
static WRITE8_DEVICE_HANDLER( pix1_mcu_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
// if (data > 7)
// logerror("pix1 = %2x\n", data);
@@ -299,7 +299,7 @@ static WRITE8_DEVICE_HANDLER( pix1_mcu_w )
static WRITE8_HANDLER( pix2_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
// if ((data!=0x00) && (data != 0xff))
// logerror("pix2 = %2x\n", data);
@@ -310,14 +310,14 @@ static WRITE8_HANDLER( pix2_w )
#if 0
static READ8_HANDLER( pix1_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
return state->pix1;
}
#endif
static READ8_HANDLER( pix2_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
int res;
int d1 = state->pix1 & 7;
@@ -395,7 +395,7 @@ static const UINT8 mcu_data2[0x80] =
static WRITE8_HANDLER( undoukai_mcu_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
int ram_adr = state->mcu_ram[0x1b5] * 0x100 + state->mcu_ram[0x1b4];
int d, i;
@@ -555,7 +555,7 @@ static WRITE8_HANDLER( undoukai_mcu_w )
static READ8_HANDLER( undoukai_mcu_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
// logerror("mcu_r %02x\n", state->from_mcu);
@@ -573,8 +573,8 @@ static READ8_HANDLER( undoukai_mcu_status_r )
static DRIVER_INIT( undoukai )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
state->pix_color[0] = 0x000;
@@ -585,15 +585,15 @@ static DRIVER_INIT( undoukai )
static DRIVER_INIT( 40love )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x2000);
#if 0
/* character ROM hack
to show a white line on the opponent side */
- UINT8 *ROM = machine->region("gfx2")->base();
+ UINT8 *ROM = machine.region("gfx2")->base();
int adr = 0x10 * 0x022b;
ROM[adr + 0x000a] = 0x00;
ROM[adr + 0x000b] = 0x00;
@@ -611,20 +611,20 @@ static DRIVER_INIT( 40love )
static READ8_HANDLER( from_snd_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->snd_flag = 0;
return state->snd_data;
}
static READ8_HANDLER( snd_flag_r )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
return state->snd_flag | 0xfd;
}
static WRITE8_HANDLER( to_main_w )
{
- fortyl_state *state = space->machine->driver_data<fortyl_state>();
+ fortyl_state *state = space->machine().driver_data<fortyl_state>();
state->snd_data = data;
state->snd_flag = 2;
}
@@ -683,7 +683,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ta7630 )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int i;
double db = 0.0;
@@ -708,7 +708,7 @@ static MACHINE_RESET( ta7630 )
static WRITE8_DEVICE_HANDLER( sound_control_0_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
state->snd_ctrl0 = data & 0xff;
// popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -723,7 +723,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_0_w )
}
static WRITE8_DEVICE_HANDLER( sound_control_1_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
state->snd_ctrl1 = data & 0xff;
// popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
device_sound_interface *sound;
@@ -736,7 +736,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_1_w )
static WRITE8_DEVICE_HANDLER( sound_control_2_w )
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
int i;
state->snd_ctrl2 = data & 0xff;
// popmessage("SND2 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -749,7 +749,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_2_w )
static WRITE8_DEVICE_HANDLER( sound_control_3_w ) /* unknown */
{
- fortyl_state *state = device->machine->driver_data<fortyl_state>();
+ fortyl_state *state = device->machine().driver_data<fortyl_state>();
state->snd_ctrl3 = data & 0xff;
// popmessage("SND3 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
}
@@ -986,9 +986,9 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( 40love )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
/* video */
state->save_item(NAME(state->pix1));
@@ -1007,7 +1007,7 @@ static MACHINE_START( 40love )
static MACHINE_START( undoukai )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
MACHINE_START_CALL(40love);
@@ -1022,7 +1022,7 @@ static MACHINE_START( undoukai )
static MACHINE_RESET( common )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
MACHINE_RESET_CALL(ta7630);
@@ -1050,7 +1050,7 @@ static MACHINE_RESET( 40love )
static MACHINE_RESET( undoukai )
{
- fortyl_state *state = machine->driver_data<fortyl_state>();
+ fortyl_state *state = machine.driver_data<fortyl_state>();
int i;
MACHINE_RESET_CALL(common);
diff --git a/src/mame/drivers/4enraya.c b/src/mame/drivers/4enraya.c
index f0a38ee4789..ac76432b14e 100644
--- a/src/mame/drivers/4enraya.c
+++ b/src/mame/drivers/4enraya.c
@@ -55,13 +55,13 @@ Sound :
static WRITE8_HANDLER( sound_data_w )
{
- _4enraya_state *state = space->machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = space->machine().driver_data<_4enraya_state>();
state->soundlatch = data;
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- _4enraya_state *state = device->machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = device->machine().driver_data<_4enraya_state>();
if ((state->last_snd_ctrl & 0x04) == 0x04 && (data & 0x4) == 0x00)
ay8910_data_address_w(device, state->last_snd_ctrl, state->soundlatch);
@@ -150,7 +150,7 @@ GFXDECODE_END
static MACHINE_START( 4enraya )
{
- _4enraya_state *state = machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = machine.driver_data<_4enraya_state>();
state->save_item(NAME(state->soundlatch));
state->save_item(NAME(state->last_snd_ctrl));
@@ -158,7 +158,7 @@ static MACHINE_START( 4enraya )
static MACHINE_RESET( 4enraya )
{
- _4enraya_state *state = machine->driver_data<_4enraya_state>();
+ _4enraya_state *state = machine.driver_data<_4enraya_state>();
state->soundlatch = 0;
state->last_snd_ctrl = 0;
diff --git a/src/mame/drivers/5clown.c b/src/mame/drivers/5clown.c
index af26718f6c2..e5334aa6ef4 100644
--- a/src/mame/drivers/5clown.c
+++ b/src/mame/drivers/5clown.c
@@ -479,14 +479,14 @@ public:
static WRITE8_HANDLER( fclown_videoram_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( fclown_colorram_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -494,7 +494,7 @@ static WRITE8_HANDLER( fclown_colorram_w )
static TILE_GET_INFO( get_fclown_tile_info )
{
- _5clown_state *state = machine->driver_data<_5clown_state>();
+ _5clown_state *state = machine.driver_data<_5clown_state>();
/* - bits -
7654 3210
@@ -516,14 +516,14 @@ static TILE_GET_INFO( get_fclown_tile_info )
static VIDEO_START(fclown)
{
- _5clown_state *state = machine->driver_data<_5clown_state>();
+ _5clown_state *state = machine.driver_data<_5clown_state>();
state->bg_tilemap = tilemap_create(machine, get_fclown_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( fclown )
{
- _5clown_state *state = screen->machine->driver_data<_5clown_state>();
+ _5clown_state *state = screen->machine().driver_data<_5clown_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -544,7 +544,7 @@ static PALETTE_INIT( fclown )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -580,13 +580,13 @@ static PALETTE_INIT( fclown )
*/
static READ8_DEVICE_HANDLER( mux_port_r )
{
- _5clown_state *state = device->machine->driver_data<_5clown_state>();
+ _5clown_state *state = device->machine().driver_data<_5clown_state>();
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
return 0xff;
@@ -595,7 +595,7 @@ static READ8_DEVICE_HANDLER( mux_port_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- _5clown_state *state = device->machine->driver_data<_5clown_state>();
+ _5clown_state *state = device->machine().driver_data<_5clown_state>();
state->mux_data = data ^ 0xff; /* Inverted */
}
@@ -611,10 +611,10 @@ static WRITE8_DEVICE_HANDLER( counters_w )
-x-- ---- Unknown (increments at start).
x--- ---- Unknown (increments at start).
*/
- coin_counter_w(device->machine, 0, data & 0x10); /* Key In */
- coin_counter_w(device->machine, 1, data & 0x20); /* Payout */
- coin_counter_w(device->machine, 2, data & 0x40); /* unknown */
- coin_counter_w(device->machine, 3, data & 0x80); /* unknown */
+ coin_counter_w(device->machine(), 0, data & 0x10); /* Key In */
+ coin_counter_w(device->machine(), 1, data & 0x20); /* Payout */
+ coin_counter_w(device->machine(), 2, data & 0x40); /* unknown */
+ coin_counter_w(device->machine(), 3, data & 0x80); /* unknown */
}
@@ -627,12 +627,12 @@ static WRITE8_DEVICE_HANDLER( trigsnd_w )
if ( (data & 0x0f) == 0x07 )
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE );
}
else
{
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE );
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE );
}
}
@@ -660,7 +660,7 @@ static WRITE8_HANDLER( cpu_c048_w)
static WRITE8_HANDLER( cpu_d800_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
logerror("Main: Write to $D800: %02x\n", data);
state->main_latch_d800 = data;
}
@@ -683,14 +683,14 @@ static WRITE8_DEVICE_HANDLER( fclown_ay8910_w )
static READ8_HANDLER( snd_e06_r )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
logerror("Sound: Read from $0E06 \n");
return state->main_latch_d800;
}
static WRITE8_HANDLER( snd_800_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->snd_latch_0800 = data;
if (state->snd_latch_0a02 == 0xc0)
@@ -706,7 +706,7 @@ static WRITE8_HANDLER( snd_800_w )
static WRITE8_HANDLER( snd_a02_w )
{
- _5clown_state *state = space->machine->driver_data<_5clown_state>();
+ _5clown_state *state = space->machine().driver_data<_5clown_state>();
state->snd_latch_0a02 = data & 0xff;
logerror("Sound: Write to $0A02: %02x\n", state->snd_latch_0a02);
}
@@ -1198,11 +1198,11 @@ ROM_END
static DRIVER_INIT( fclown )
{
- _5clown_state *state = machine->driver_data<_5clown_state>();
+ _5clown_state *state = machine.driver_data<_5clown_state>();
/* Decrypting main program */
int x;
- UINT8 *src = machine->region( "maincpu" )->base();
+ UINT8 *src = machine.region( "maincpu" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
@@ -1212,8 +1212,8 @@ static DRIVER_INIT( fclown )
/* Decrypting GFX by segments */
- UINT8 *gfx1_src = machine->region( "gfx1" )->base();
- UINT8 *gfx2_src = machine->region( "gfx2" )->base();
+ UINT8 *gfx1_src = machine.region( "gfx1" )->base();
+ UINT8 *gfx2_src = machine.region( "gfx2" )->base();
for (x = 0x2000; x < 0x3000; x++)
{
@@ -1233,7 +1233,7 @@ static DRIVER_INIT( fclown )
/* Decrypting sound samples */
- UINT8 *samples_src = machine->region( "oki6295" )->base();
+ UINT8 *samples_src = machine.region( "oki6295" )->base();
for (x = 0x0000; x < 0x10000; x++)
{
@@ -1251,7 +1251,7 @@ static DRIVER_INIT( fclown )
/* Assigning AY-3-8910 sound device */
- state->ay8910 = machine->device("ay8910");
+ state->ay8910 = machine.device("ay8910");
}
diff --git a/src/mame/drivers/8080bw.c b/src/mame/drivers/8080bw.c
index 17227028144..42c9a560ef0 100644
--- a/src/mame/drivers/8080bw.c
+++ b/src/mame/drivers/8080bw.c
@@ -1156,7 +1156,7 @@ MACHINE_CONFIG_END
static CUSTOM_INPUT( sflush_80_r )
{
- return (field->port->machine->primary_screen->vpos() & 0x80) ? 1 : 0;
+ return (field->port->machine().primary_screen->vpos() & 0x80) ? 1 : 0;
}
static ADDRESS_MAP_START( sflush_map, AS_PROGRAM, 8 )
@@ -1361,7 +1361,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( polaris_interrupt )
{
- _8080bw_state *state = device->machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = device->machine().driver_data<_8080bw_state>();
state->polaris_cloud_speed++;
if (state->polaris_cloud_speed >= 4) /* every 4 frames - this was verified against real machine */
@@ -1373,7 +1373,7 @@ static INTERRUPT_GEN( polaris_interrupt )
static MACHINE_START( polaris )
{
- _8080bw_state *state = machine->driver_data<_8080bw_state>();
+ _8080bw_state *state = machine.driver_data<_8080bw_state>();
state->save_item(NAME(state->polaris_cloud_speed));
state->save_item(NAME(state->polaris_cloud_pos));
@@ -1736,7 +1736,7 @@ static READ8_HANDLER(indianbt_r)
case 0x5ffc: return 0;
}
logerror("unknown port 0 read @ %x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( indianbt_io_map, AS_IO, 8 )
@@ -1782,7 +1782,7 @@ MACHINE_CONFIG_END
static WRITE8_HANDLER( steelwkr_sh_port_3_w )
{
- coin_lockout_global_w(space->machine, !(~data & 0x03)); /* possibly */
+ coin_lockout_global_w(space->machine(), !(~data & 0x03)); /* possibly */
}
static ADDRESS_MAP_START( steelwkr_io_map, AS_IO, 8 )
@@ -2166,8 +2166,8 @@ MACHINE_CONFIG_END
/* decrypt function for vortex */
static DRIVER_INIT( vortex )
{
- UINT8 *rom = machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
for (x = 0; x < length; x++)
diff --git a/src/mame/drivers/86lions.c b/src/mame/drivers/86lions.c
index 798484d772f..60faefe19a6 100644
--- a/src/mame/drivers/86lions.c
+++ b/src/mame/drivers/86lions.c
@@ -51,8 +51,8 @@ static VIDEO_START(lions)
static SCREEN_UPDATE(lions)
{
- _86lions_state *state = screen->machine->driver_data<_86lions_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ _86lions_state *state = screen->machine().driver_data<_86lions_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0;
int y,x;
@@ -81,7 +81,7 @@ static SCREEN_UPDATE(lions)
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
@@ -226,39 +226,39 @@ static const ay8910_interface ay8910_config =
//static READ8_DEVICE_HANDLER( input_a )
//{
//return input_port_read(machine, "IN0");
-// return device->machine->rand();
+// return device->machine().rand();
//return 0xff;
//}
//static READ8_DEVICE_HANDLER( input_b )
//{
//return input_port_read(machine, "IN1");
-// return device->machine->rand();
+// return device->machine().rand();
//return 0xff;
//}
static READ8_DEVICE_HANDLER( input_ca1 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
static READ8_DEVICE_HANDLER( input_cb1 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
static READ8_DEVICE_HANDLER( input_ca2 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
static READ8_DEVICE_HANDLER( input_cb2 )
{
-// return device->machine->rand();
+// return device->machine().rand();
return 0x00;
}
@@ -331,7 +331,7 @@ static PALETTE_INIT( lions )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
diff --git a/src/mame/drivers/88games.c b/src/mame/drivers/88games.c
index 2cae66c1b51..afbdb47bb6b 100644
--- a/src/mame/drivers/88games.c
+++ b/src/mame/drivers/88games.c
@@ -24,7 +24,7 @@
static INTERRUPT_GEN( k88games_interrupt )
{
- _88games_state *state = device->machine->driver_data<_88games_state>();
+ _88games_state *state = device->machine().driver_data<_88games_state>();
if (k052109_is_irq_enabled(state->k052109))
irq0_line_hold(device);
@@ -32,7 +32,7 @@ static INTERRUPT_GEN( k88games_interrupt )
static READ8_HANDLER( bankedram_r )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (state->videobank)
return state->ram[offset];
@@ -47,7 +47,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (state->videobank)
state->ram[offset] = data;
@@ -57,11 +57,11 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( k88games_5f84_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
/* bits 0/1 coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 enables ROM reading from the 051316 */
/* also 5fce == 2 read roms, == 3 read ram */
@@ -73,14 +73,14 @@ static WRITE8_HANDLER( k88games_5f84_w )
static WRITE8_HANDLER( k88games_sh_irqtrigger_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( speech_control_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
device_t *upd;
state->speech_chip = (data & 4) ? 1 : 0;
@@ -92,7 +92,7 @@ static WRITE8_HANDLER( speech_control_w )
static WRITE8_HANDLER( speech_msg_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
device_t *upd = state->speech_chip ? state->upd_2 : state->upd_1;
upd7759_port_w(upd, 0, data);
@@ -101,7 +101,7 @@ static WRITE8_HANDLER( speech_msg_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -118,7 +118,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- _88games_state *state = space->machine->driver_data<_88games_state>();
+ _88games_state *state = space->machine().driver_data<_88games_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -273,8 +273,8 @@ INPUT_PORTS_END
static KONAMI_SETLINES_CALLBACK( k88games_banking )
{
- _88games_state *state = device->machine->driver_data<_88games_state>();
- UINT8 *RAM = device->machine->region("maincpu")->base();
+ _88games_state *state = device->machine().driver_data<_88games_state>();
+ UINT8 *RAM = device->machine().region("maincpu")->base();
int offs;
logerror("%04x: bank select %02x\n", cpu_get_pc(device), lines);
@@ -286,18 +286,18 @@ static KONAMI_SETLINES_CALLBACK( k88games_banking )
memcpy(state->banked_rom, &RAM[offs], 0x1000);
if (lines & 0x08)
{
- if (device->machine->generic.paletteram.u8 != state->paletteram_1000)
+ if (device->machine().generic.paletteram.u8 != state->paletteram_1000)
{
- memcpy(state->paletteram_1000, device->machine->generic.paletteram.u8, 0x1000);
- device->machine->generic.paletteram.u8 = state->paletteram_1000;
+ memcpy(state->paletteram_1000, device->machine().generic.paletteram.u8, 0x1000);
+ device->machine().generic.paletteram.u8 = state->paletteram_1000;
}
}
else
{
- if (device->machine->generic.paletteram.u8 != &RAM[0x20000])
+ if (device->machine().generic.paletteram.u8 != &RAM[0x20000])
{
- memcpy(&RAM[0x20000], device->machine->generic.paletteram.u8, 0x1000);
- device->machine->generic.paletteram.u8 = &RAM[0x20000];
+ memcpy(&RAM[0x20000], device->machine().generic.paletteram.u8, 0x1000);
+ device->machine().generic.paletteram.u8 = &RAM[0x20000];
}
memcpy(state->paletteram_1000, &RAM[offs+0x1000], 0x1000);
}
@@ -315,14 +315,14 @@ static KONAMI_SETLINES_CALLBACK( k88games_banking )
static MACHINE_START( 88games )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k051316 = machine->device("k051316");
- state->upd_1 = machine->device("upd1");
- state->upd_2 = machine->device("upd2");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k051316 = machine.device("k051316");
+ state->upd_1 = machine.device("upd1");
+ state->upd_2 = machine.device("upd2");
state->save_item(NAME(state->videobank));
state->save_item(NAME(state->zoomreadroms));
@@ -335,10 +335,10 @@ static MACHINE_START( 88games )
static MACHINE_RESET( 88games )
{
- _88games_state *state = machine->driver_data<_88games_state>();
+ _88games_state *state = machine.driver_data<_88games_state>();
- konami_configure_set_lines(machine->device("maincpu"), k88games_banking);
- machine->generic.paletteram.u8 = &machine->region("maincpu")->base()[0x20000];
+ konami_configure_set_lines(machine.device("maincpu"), k88games_banking);
+ machine.generic.paletteram.u8 = &machine.region("maincpu")->base()[0x20000];
state->videobank = 0;
state->zoomreadroms = 0;
diff --git a/src/mame/drivers/ace.c b/src/mame/drivers/ace.c
index bf01411bd9d..fb4dda2dfac 100644
--- a/src/mame/drivers/ace.c
+++ b/src/mame/drivers/ace.c
@@ -61,48 +61,48 @@ public:
static WRITE8_HANDLER( ace_objpos_w )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
state->objpos[offset] = data;
}
#if 0
static READ8_HANDLER( ace_objpos_r )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
return state->objpos[offset];
}
#endif
static VIDEO_START( ace )
{
- ace_state *state = machine->driver_data<ace_state>();
- gfx_element_set_source(machine->gfx[1], state->characterram);
- gfx_element_set_source(machine->gfx[2], state->characterram);
- gfx_element_set_source(machine->gfx[3], state->characterram);
- gfx_element_set_source(machine->gfx[4], state->scoreram);
+ ace_state *state = machine.driver_data<ace_state>();
+ gfx_element_set_source(machine.gfx[1], state->characterram);
+ gfx_element_set_source(machine.gfx[2], state->characterram);
+ gfx_element_set_source(machine.gfx[3], state->characterram);
+ gfx_element_set_source(machine.gfx[4], state->scoreram);
}
static SCREEN_UPDATE( ace )
{
- ace_state *state = screen->machine->driver_data<ace_state>();
+ ace_state *state = screen->machine().driver_data<ace_state>();
int offs;
/* first of all, fill the screen with the background color */
bitmap_fill(bitmap, cliprect, 0);
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1],
0,
0,
0, 0,
state->objpos[0], state->objpos[1]);
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[2],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[2],
0,
0,
0, 0,
state->objpos[2], state->objpos[3]);
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[3],
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[3],
0,
0,
0, 0,
@@ -111,7 +111,7 @@ static SCREEN_UPDATE( ace )
for (offs = 0; offs < 8; offs++)
{
drawgfx_opaque(bitmap,/* ?? */
- cliprect, screen->machine->gfx[4],
+ cliprect, screen->machine().gfx[4],
offs,
0,
0, 0,
@@ -130,7 +130,7 @@ static PALETTE_INIT( ace )
static WRITE8_HANDLER( ace_characterram_w )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
if (state->characterram[offset] != data)
{
if (data & ~0x07)
@@ -139,22 +139,22 @@ static WRITE8_HANDLER( ace_characterram_w )
popmessage("write to %04x data = %02x\n", 0x8000 + offset, data);
}
state->characterram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], 0);
- gfx_element_mark_dirty(space->machine->gfx[2], 0);
- gfx_element_mark_dirty(space->machine->gfx[3], 0);
+ gfx_element_mark_dirty(space->machine().gfx[1], 0);
+ gfx_element_mark_dirty(space->machine().gfx[2], 0);
+ gfx_element_mark_dirty(space->machine().gfx[3], 0);
}
}
static WRITE8_HANDLER( ace_scoreram_w )
{
- ace_state *state = space->machine->driver_data<ace_state>();
+ ace_state *state = space->machine().driver_data<ace_state>();
state->scoreram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[4], offset / 32);
+ gfx_element_mark_dirty(space->machine().gfx[4], offset / 32);
}
static READ8_HANDLER( unk_r )
{
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
@@ -319,22 +319,22 @@ GFXDECODE_END
static STATE_POSTLOAD( ace_postload )
{
- gfx_element_mark_dirty(machine->gfx[1], 0);
- gfx_element_mark_dirty(machine->gfx[2], 0);
- gfx_element_mark_dirty(machine->gfx[3], 0);
- gfx_element_mark_dirty(machine->gfx[4], 0);
+ gfx_element_mark_dirty(machine.gfx[1], 0);
+ gfx_element_mark_dirty(machine.gfx[2], 0);
+ gfx_element_mark_dirty(machine.gfx[3], 0);
+ gfx_element_mark_dirty(machine.gfx[4], 0);
}
static MACHINE_START( ace )
{
- ace_state *state = machine->driver_data<ace_state>();
+ ace_state *state = machine.driver_data<ace_state>();
state->save_item(NAME(state->objpos));
- machine->state().register_postload(ace_postload, NULL);
+ machine.state().register_postload(ace_postload, NULL);
}
static MACHINE_RESET( ace )
{
- ace_state *state = machine->driver_data<ace_state>();
+ ace_state *state = machine.driver_data<ace_state>();
int i;
for (i = 0; i < 8; i++)
diff --git a/src/mame/drivers/acefruit.c b/src/mame/drivers/acefruit.c
index 3201d2653f9..afe8ce74102 100644
--- a/src/mame/drivers/acefruit.c
+++ b/src/mame/drivers/acefruit.c
@@ -29,9 +29,9 @@ public:
-static void acefruit_update_irq(running_machine *machine, int vpos )
+static void acefruit_update_irq(running_machine &machine, int vpos )
{
- acefruit_state *state = machine->driver_data<acefruit_state>();
+ acefruit_state *state = machine.driver_data<acefruit_state>();
int col;
int row = vpos / 8;
@@ -52,33 +52,33 @@ static void acefruit_update_irq(running_machine *machine, int vpos )
static TIMER_CALLBACK( acefruit_refresh )
{
- acefruit_state *state = machine->driver_data<acefruit_state>();
- int vpos = machine->primary_screen->vpos();
+ acefruit_state *state = machine.driver_data<acefruit_state>();
+ int vpos = machine.primary_screen->vpos();
- machine->primary_screen->update_partial(vpos );
+ machine.primary_screen->update_partial(vpos );
acefruit_update_irq(machine, vpos );
vpos = ( ( vpos / 8 ) + 1 ) * 8;
- state->refresh_timer->adjust( machine->primary_screen->time_until_pos(vpos) );
+ state->refresh_timer->adjust( machine.primary_screen->time_until_pos(vpos) );
}
static VIDEO_START( acefruit )
{
- acefruit_state *state = machine->driver_data<acefruit_state>();
- state->refresh_timer = machine->scheduler().timer_alloc(FUNC(acefruit_refresh));
+ acefruit_state *state = machine.driver_data<acefruit_state>();
+ state->refresh_timer = machine.scheduler().timer_alloc(FUNC(acefruit_refresh));
}
static INTERRUPT_GEN( acefruit_vblank )
{
- acefruit_state *state = device->machine->driver_data<acefruit_state>();
+ acefruit_state *state = device->machine().driver_data<acefruit_state>();
device_set_input_line(device, 0, HOLD_LINE );
state->refresh_timer->adjust( attotime::zero );
}
static SCREEN_UPDATE( acefruit )
{
- acefruit_state *state = screen->machine->driver_data<acefruit_state>();
+ acefruit_state *state = screen->machine().driver_data<acefruit_state>();
int startrow = cliprect->min_y / 8;
int endrow = cliprect->max_y / 8;
int row;
@@ -98,7 +98,7 @@ static SCREEN_UPDATE( acefruit )
if( color < 0x4 )
{
- drawgfx_opaque( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
+ drawgfx_opaque( bitmap, cliprect, screen->machine().gfx[ 1 ], code, color, 0, 0, col * 16, row * 8 );
}
else if( color >= 0x5 && color <= 0x7 )
{
@@ -106,7 +106,7 @@ static SCREEN_UPDATE( acefruit )
int x;
static const int spriteskip[] = { 1, 2, 4 };
int spritesize = spriteskip[ color - 5 ];
- const gfx_element *gfx = screen->machine->gfx[ 0 ];
+ const gfx_element *gfx = screen->machine().gfx[ 0 ];
for( x = 0; x < 16; x++ )
{
@@ -168,9 +168,9 @@ static CUSTOM_INPUT( sidewndr_payout_r )
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 1);
default:
logerror("sidewndr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -184,13 +184,13 @@ static CUSTOM_INPUT( starspnr_coinage_r )
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 1);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 2);
case 0x08:
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 3);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 3);
default:
logerror("starspnr_coinage_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -204,11 +204,11 @@ static CUSTOM_INPUT( starspnr_payout_r )
switch (bit_mask)
{
case 0x01:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 0);
case 0x02:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 1);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 1);
case 0x04:
- return ((input_port_read(field->port->machine, "PAYOUT") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "PAYOUT") & bit_mask) >> 2);
default:
logerror("starspnr_payout_r : invalid %02X bit_mask\n",bit_mask);
return 0;
@@ -217,7 +217,7 @@ static CUSTOM_INPUT( starspnr_payout_r )
static WRITE8_HANDLER( acefruit_colorram_w )
{
- acefruit_state *state = space->machine->driver_data<acefruit_state>();
+ acefruit_state *state = space->machine().driver_data<acefruit_state>();
state->colorram[ offset ] = data & 0xf;
}
@@ -595,7 +595,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( sidewndr )
{
- UINT8 *ROM = machine->region( "maincpu" )->base();
+ UINT8 *ROM = machine.region( "maincpu" )->base();
/* replace "ret nc" ( 0xd0 ) with "di" */
ROM[ 0 ] = 0xf3;
/* this is either a bad dump or the cpu core should set the carry flag on reset */
diff --git a/src/mame/drivers/acommand.c b/src/mame/drivers/acommand.c
index f405e6a872f..dc1571ae5ae 100644
--- a/src/mame/drivers/acommand.c
+++ b/src/mame/drivers/acommand.c
@@ -90,7 +90,7 @@ static TILEMAP_MAPPER( bg_scan )
static TILE_GET_INFO( ac_get_bg_tile_info )
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
int code = state->ac_bgvram[tile_index];
SET_TILE_INFO(
1,
@@ -101,7 +101,7 @@ static TILE_GET_INFO( ac_get_bg_tile_info )
static TILE_GET_INFO( ac_get_tx_tile_info )
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
int code = state->ac_txvram[tile_index];
SET_TILE_INFO(
0,
@@ -110,9 +110,9 @@ static TILE_GET_INFO( ac_get_tx_tile_info )
0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int pri_mask)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int pri_mask)
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
UINT16 *spriteram16 = state->spriteram;
int offs;
@@ -152,7 +152,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
xx = w;
do
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, flipy,
@@ -171,7 +171,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static VIDEO_START( acommand )
{
- acommand_state *state = machine->driver_data<acommand_state>();
+ acommand_state *state = machine.driver_data<acommand_state>();
state->tx_tilemap = tilemap_create(machine, ac_get_tx_tile_info,tilemap_scan_cols,8,8,512,32);
state->bg_tilemap = tilemap_create(machine, ac_get_bg_tile_info,bg_scan,16,16,256,16);
@@ -240,9 +240,9 @@ static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value)
static SCREEN_UPDATE( acommand )
{
- acommand_state *state = screen->machine->driver_data<acommand_state>();
+ acommand_state *state = screen->machine().driver_data<acommand_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect,0,0);
+ draw_sprites(screen->machine(),bitmap,cliprect,0,0);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
/*Order might be wrong,but these for sure are the led numbers tested*/
@@ -259,21 +259,21 @@ static SCREEN_UPDATE( acommand )
static WRITE16_HANDLER( ac_bgvram_w )
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
COMBINE_DATA(&state->ac_bgvram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE16_HANDLER( ac_txvram_w )
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
COMBINE_DATA(&state->ac_txvram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
static WRITE16_HANDLER(ac_bgscroll_w)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
switch(offset)
{
case 0: tilemap_set_scrollx(state->bg_tilemap,0,data); break;
@@ -284,7 +284,7 @@ static WRITE16_HANDLER(ac_bgscroll_w)
static WRITE16_HANDLER(ac_txscroll_w)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
switch(offset)
{
case 0: tilemap_set_scrollx(state->tx_tilemap,0,data); break;
@@ -298,7 +298,7 @@ static WRITE16_HANDLER(ac_txscroll_w)
static READ16_HANDLER(ac_devices_r)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
logerror("(PC=%06x) read at %04x\n",cpu_get_pc(space->cpu),offset*2);
switch(offset)
@@ -316,13 +316,13 @@ static READ16_HANDLER(ac_devices_r)
---- ---- ---- --x- (Activate Test)
---- ---- ---- ---x (Advance Thru Tests)
*/
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x0014/2:
case 0x0016/2:
- return space->machine->device<okim6295_device>("oki1")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki1")->read(*space,0);
case 0x0018/2:
case 0x001a/2:
- return space->machine->device<okim6295_device>("oki2")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki2")->read(*space,0);
case 0x0040/2:
/*
"Upper switch / Under Switch"
@@ -387,22 +387,22 @@ static READ16_HANDLER(ac_devices_r)
xxxx xxxx ---- ---- DIPSW4
---- ---- xxxx xxxx DIPSW3
*/
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
return state->ac_devram[offset];
}
static WRITE16_HANDLER(ac_devices_w)
{
- acommand_state *state = space->machine->driver_data<acommand_state>();
+ acommand_state *state = space->machine().driver_data<acommand_state>();
COMBINE_DATA(&state->ac_devram[offset]);
switch(offset)
{
case 0x00/2:
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(0x40000 * (data & 0x3));
oki2->set_bank_base(0x40000 * (data & 0x30) >> 4);
}
@@ -411,7 +411,7 @@ static WRITE16_HANDLER(ac_devices_w)
case 0x16/2:
if(ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
oki1->write(*space,0,data);
}
break;
@@ -419,7 +419,7 @@ static WRITE16_HANDLER(ac_devices_w)
case 0x1a/2:
if(ACCESSING_BITS_0_7)
{
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki2->write(*space,0,data);
}
break;
@@ -585,10 +585,10 @@ static TIMER_DEVICE_CALLBACK( acommand_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line(timer.machine, "maincpu", 2, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 2, HOLD_LINE);
if(scanline == 0) // vblank-in irq? (update palette and layers)
- cputag_set_input_line(timer.machine, "maincpu", 3, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 3, HOLD_LINE);
}
static MACHINE_CONFIG_START( acommand, acommand_state )
diff --git a/src/mame/drivers/actfancr.c b/src/mame/drivers/actfancr.c
index 474b9e8629c..c282dd1c486 100644
--- a/src/mame/drivers/actfancr.c
+++ b/src/mame/drivers/actfancr.c
@@ -36,20 +36,20 @@
static WRITE8_HANDLER( triothep_control_select_w )
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
state->trio_control_select = data;
}
static READ8_HANDLER( triothep_control_r )
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
switch (state->trio_control_select)
{
- case 0: return input_port_read(space->machine, "P1");
- case 1: return input_port_read(space->machine, "P2");
- case 2: return input_port_read(space->machine, "DSW1");
- case 3: return input_port_read(space->machine, "DSW2");
- case 4: return input_port_read(space->machine, "SYSTEM"); /* VBL */
+ case 0: return input_port_read(space->machine(), "P1");
+ case 1: return input_port_read(space->machine(), "P2");
+ case 2: return input_port_read(space->machine(), "DSW1");
+ case 3: return input_port_read(space->machine(), "DSW2");
+ case 4: return input_port_read(space->machine(), "SYSTEM"); /* VBL */
}
return 0xff;
@@ -57,7 +57,7 @@ static READ8_HANDLER( triothep_control_r )
static WRITE8_HANDLER( actfancr_sound_w )
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -66,11 +66,11 @@ static WRITE8_HANDLER( actfancr_sound_w )
static WRITE8_HANDLER( actfancr_buffer_spriteram_w)
{
- actfancr_state *state = space->machine->driver_data<actfancr_state>();
+ actfancr_state *state = space->machine().driver_data<actfancr_state>();
- UINT8* buffered_spriteram = space->machine->generic.buffered_spriteram.u8;
+ UINT8* buffered_spriteram = space->machine().generic.buffered_spriteram.u8;
// make a buffered copy
- memcpy(buffered_spriteram, space->machine->generic.spriteram.u8, 0x800);
+ memcpy(buffered_spriteram, space->machine().generic.spriteram.u8, 0x800);
// copy to a 16-bit region for our sprite draw code too
for (int i=0;i<0x800/2;i++)
{
@@ -284,7 +284,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int linestate)
{
- actfancr_state *state = device->machine->driver_data<actfancr_state>();
+ actfancr_state *state = device->machine().driver_data<actfancr_state>();
device_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
}
@@ -297,15 +297,15 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( actfancr )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_START( triothep )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
MACHINE_START_CALL(actfancr);
@@ -314,13 +314,13 @@ static MACHINE_START( triothep )
static MACHINE_RESET( actfancr )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
state->flipscreen = 0;
}
static MACHINE_RESET( triothep )
{
- actfancr_state *state = machine->driver_data<actfancr_state>();
+ actfancr_state *state = machine.driver_data<actfancr_state>();
MACHINE_RESET_CALL(actfancr);
state->trio_control_select = 0;
diff --git a/src/mame/drivers/adp.c b/src/mame/drivers/adp.c
index 271c46ceb1f..bed48e9e8d6 100644
--- a/src/mame/drivers/adp.c
+++ b/src/mame/drivers/adp.c
@@ -178,7 +178,7 @@ public:
static void duart_irq_handler( device_t *device, UINT8 vector )
{
- adp_state *state = device->machine->driver_data<adp_state>();
+ adp_state *state = device->machine().driver_data<adp_state>();
device_set_input_line_and_vector(state->maincpu, 4, HOLD_LINE, vector);
};
@@ -190,25 +190,25 @@ static void duart_tx( device_t *device, int channel, UINT8 data )
}
};
-static void microtouch_tx( running_machine *machine, UINT8 data )
+static void microtouch_tx( running_machine &machine, UINT8 data )
{
- adp_state *state = machine->driver_data<adp_state>();
+ adp_state *state = machine.driver_data<adp_state>();
duart68681_rx_data(state->duart, 0, data);
}
static UINT8 duart_input( device_t *device )
{
- return input_port_read(device->machine, "DSW1");
+ return input_port_read(device->machine(), "DSW1");
}
static MACHINE_START( skattv )
{
- adp_state *state = machine->driver_data<adp_state>();
+ adp_state *state = machine.driver_data<adp_state>();
microtouch_init(machine, microtouch_tx, 0);
- state->maincpu = machine->device("maincpu");
- state->duart = machine->device("duart68681");
- state->hd63484 = machine->device("hd63484");
+ state->maincpu = machine.device("maincpu");
+ state->duart = machine.device("duart68681");
+ state->hd63484 = machine.device("hd63484");
state->save_item(NAME(state->mux_data));
state->save_item(NAME(state->register_active));
@@ -224,10 +224,10 @@ static MACHINE_START( skattv )
// hack to handle acrt rom
{
- UINT16 *rom = (UINT16*)machine->region("gfx1")->base();
+ UINT16 *rom = (UINT16*)machine.region("gfx1")->base();
int i;
- device_t *hd63484 = machine->device("hd63484");
+ device_t *hd63484 = machine.device("hd63484");
for(i = 0; i < 0x40000/2; ++i)
{
@@ -241,7 +241,7 @@ static MACHINE_START( skattv )
static MACHINE_RESET( skattv )
{
- adp_state *state = machine->driver_data<adp_state>();
+ adp_state *state = machine.driver_data<adp_state>();
state->mux_data = 0;
state->register_active = 0;
@@ -259,7 +259,7 @@ static PALETTE_INIT( adp )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -291,34 +291,34 @@ static VIDEO_START(adp)
static SCREEN_UPDATE( adp )
{
- adp_state *state = screen->machine->driver_data<adp_state>();
+ adp_state *state = screen->machine().driver_data<adp_state>();
int x, y, b, src;
b = ((hd63484_regs_r(state->hd63484, 0xcc/2, 0xffff) & 0x000f) << 16) + hd63484_regs_r(state->hd63484, 0xce/2, 0xffff);
#if 1
- if (input_code_pressed(screen->machine, KEYCODE_M)) b = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) b += 0x2000 * 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) b += 0x2000 * 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) b += 0x2000 * 3;
- if (input_code_pressed(screen->machine, KEYCODE_R)) b += 0x2000 * 4;
- if (input_code_pressed(screen->machine, KEYCODE_T)) b += 0x2000 * 5;
- if (input_code_pressed(screen->machine, KEYCODE_Y)) b += 0x2000 * 6;
- if (input_code_pressed(screen->machine, KEYCODE_U)) b += 0x2000 * 7;
- if (input_code_pressed(screen->machine, KEYCODE_I)) b += 0x2000 * 8;
- if (input_code_pressed(screen->machine, KEYCODE_A)) b += 0x2000 * 9;
- if (input_code_pressed(screen->machine, KEYCODE_S)) b += 0x2000 * 10;
- if (input_code_pressed(screen->machine, KEYCODE_D)) b += 0x2000 * 11;
- if (input_code_pressed(screen->machine, KEYCODE_F)) b += 0x2000 * 12;
- if (input_code_pressed(screen->machine, KEYCODE_G)) b += 0x2000 * 13;
- if (input_code_pressed(screen->machine, KEYCODE_H)) b += 0x2000 * 14;
- if (input_code_pressed(screen->machine, KEYCODE_J)) b += 0x2000 * 15;
- if (input_code_pressed(screen->machine, KEYCODE_K)) b += 0x2000 * 16;
- if (input_code_pressed(screen->machine, KEYCODE_Z)) b += 0x2000 * 17;
- if (input_code_pressed(screen->machine, KEYCODE_X)) b += 0x2000 * 18;
- if (input_code_pressed(screen->machine, KEYCODE_C)) b += 0x2000 * 19;
- if (input_code_pressed(screen->machine, KEYCODE_V)) b += 0x2000 * 20;
- if (input_code_pressed(screen->machine, KEYCODE_B)) b += 0x2000 * 21;
- if (input_code_pressed(screen->machine, KEYCODE_N)) b += 0x2000 * 22;
+ if (input_code_pressed(screen->machine(), KEYCODE_M)) b = 0;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) b += 0x2000 * 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) b += 0x2000 * 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) b += 0x2000 * 3;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) b += 0x2000 * 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) b += 0x2000 * 5;
+ if (input_code_pressed(screen->machine(), KEYCODE_Y)) b += 0x2000 * 6;
+ if (input_code_pressed(screen->machine(), KEYCODE_U)) b += 0x2000 * 7;
+ if (input_code_pressed(screen->machine(), KEYCODE_I)) b += 0x2000 * 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) b += 0x2000 * 9;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) b += 0x2000 * 10;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) b += 0x2000 * 11;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) b += 0x2000 * 12;
+ if (input_code_pressed(screen->machine(), KEYCODE_G)) b += 0x2000 * 13;
+ if (input_code_pressed(screen->machine(), KEYCODE_H)) b += 0x2000 * 14;
+ if (input_code_pressed(screen->machine(), KEYCODE_J)) b += 0x2000 * 15;
+ if (input_code_pressed(screen->machine(), KEYCODE_K)) b += 0x2000 * 16;
+ if (input_code_pressed(screen->machine(), KEYCODE_Z)) b += 0x2000 * 17;
+ if (input_code_pressed(screen->machine(), KEYCODE_X)) b += 0x2000 * 18;
+ if (input_code_pressed(screen->machine(), KEYCODE_C)) b += 0x2000 * 19;
+ if (input_code_pressed(screen->machine(), KEYCODE_V)) b += 0x2000 * 20;
+ if (input_code_pressed(screen->machine(), KEYCODE_B)) b += 0x2000 * 21;
+ if (input_code_pressed(screen->machine(), KEYCODE_N)) b += 0x2000 * 22;
#endif
for (y = 0;y < 280;y++)
{
@@ -333,7 +333,7 @@ static SCREEN_UPDATE( adp )
b++;
}
}
-if (!input_code_pressed(screen->machine, KEYCODE_O)) // debug: toggle window
+if (!input_code_pressed(screen->machine(), KEYCODE_O)) // debug: toggle window
if ((hd63484_regs_r(state->hd63484, 0x06/2, 0xffff) & 0x0300) == 0x0300)
{
int sy = (hd63484_regs_r(state->hd63484, 0x94/2, 0xffff) & 0x0fff) - (hd63484_regs_r(state->hd63484, 0x88/2, 0xffff) >> 8);
@@ -368,49 +368,49 @@ if (!input_code_pressed(screen->machine, KEYCODE_O)) // debug: toggle window
static READ16_HANDLER( test_r )
{
- adp_state *state = space->machine->driver_data<adp_state>();
+ adp_state *state = space->machine().driver_data<adp_state>();
int value = 0xffff;
switch (state->mux_data)
{
- case 0x00: value = input_port_read(space->machine, "x0"); break;
- case 0x01: value = input_port_read(space->machine, "x1"); break;
- case 0x02: value = input_port_read(space->machine, "x2"); break;
- case 0x03: value = input_port_read(space->machine, "1P_UP"); break;
- case 0x04: value = input_port_read(space->machine, "1P_B1"); break;
- case 0x05: value = input_port_read(space->machine, "x5"); break;
- case 0x06: value = input_port_read(space->machine, "1P_RIGHT"); break;
- case 0x07: value = input_port_read(space->machine, "1P_DOWN"); break;
- case 0x08: value = input_port_read(space->machine, "1P_LEFT"); break;
- case 0x09: value = input_port_read(space->machine, "x9"); break;
- case 0x0a: value = input_port_read(space->machine, "x10"); break;
- case 0x0b: value = input_port_read(space->machine, "x11"); break;
- case 0x0c: value = input_port_read(space->machine, "x12"); break;
- case 0x0d: value = input_port_read(space->machine, "x13"); break;
- case 0x0e: value = input_port_read(space->machine, "1P_START"); break;
- case 0x0f: value = input_port_read(space->machine, "1P_COIN"); break;
+ case 0x00: value = input_port_read(space->machine(), "x0"); break;
+ case 0x01: value = input_port_read(space->machine(), "x1"); break;
+ case 0x02: value = input_port_read(space->machine(), "x2"); break;
+ case 0x03: value = input_port_read(space->machine(), "1P_UP"); break;
+ case 0x04: value = input_port_read(space->machine(), "1P_B1"); break;
+ case 0x05: value = input_port_read(space->machine(), "x5"); break;
+ case 0x06: value = input_port_read(space->machine(), "1P_RIGHT"); break;
+ case 0x07: value = input_port_read(space->machine(), "1P_DOWN"); break;
+ case 0x08: value = input_port_read(space->machine(), "1P_LEFT"); break;
+ case 0x09: value = input_port_read(space->machine(), "x9"); break;
+ case 0x0a: value = input_port_read(space->machine(), "x10"); break;
+ case 0x0b: value = input_port_read(space->machine(), "x11"); break;
+ case 0x0c: value = input_port_read(space->machine(), "x12"); break;
+ case 0x0d: value = input_port_read(space->machine(), "x13"); break;
+ case 0x0e: value = input_port_read(space->machine(), "1P_START"); break;
+ case 0x0f: value = input_port_read(space->machine(), "1P_COIN"); break;
}
state->mux_data++;
state->mux_data &= 0xf;
/*
- switch (space->machine->rand() & 3)
+ switch (space->machine().rand() & 3)
{
case 0:
return 0;
case 1:
return 0xffff;
default:
- return space->machine->rand() & 0xffff;
+ return space->machine().rand() & 0xffff;
}
*/
- return value | (space->machine->rand() & 0x0000);
+ return value | (space->machine().rand() & 0x0000);
}
/*???*/
static WRITE16_HANDLER(wh2_w)
{
- adp_state *state = space->machine->driver_data<adp_state>();
+ adp_state *state = space->machine().driver_data<adp_state>();
state->register_active = data;
}
@@ -419,15 +419,15 @@ static READ8_DEVICE_HANDLER(t2_r)
UINT8 res;
int h,w;
res = 0;
- h = device->machine->primary_screen->height();
- w = device->machine->primary_screen->width();
+ h = device->machine().primary_screen->height();
+ w = device->machine().primary_screen->width();
// popmessage("%d %d",h,w);
- if (device->machine->primary_screen->hpos() > h)
+ if (device->machine().primary_screen->hpos() > h)
res|= 0x20; //hblank
- if (device->machine->primary_screen->vpos() > w)
+ if (device->machine().primary_screen->vpos() > w)
res|= 0x40; //vblank
return res;
@@ -465,7 +465,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( ramdac_io_w )
{
- adp_state *state = space->machine->driver_data<adp_state>();
+ adp_state *state = space->machine().driver_data<adp_state>();
switch(offset)
{
case 0:
@@ -488,7 +488,7 @@ static WRITE8_HANDLER( ramdac_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
state->pal.offs&=0xff;
diff --git a/src/mame/drivers/aeroboto.c b/src/mame/drivers/aeroboto.c
index 34f8db6f119..fd8cc241814 100644
--- a/src/mame/drivers/aeroboto.c
+++ b/src/mame/drivers/aeroboto.c
@@ -30,7 +30,7 @@ Revisions:
static READ8_HANDLER( aeroboto_201_r )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
/* if you keep a button pressed during boot, the game will expect this */
/* serie of values to be returned from 3004, and display "PASS 201" if it is */
static const UINT8 res[4] = { 0xff, 0x9f, 0x1b, 0x03 };
@@ -42,7 +42,7 @@ static READ8_HANDLER( aeroboto_201_r )
static INTERRUPT_GEN( aeroboto_interrupt )
{
- aeroboto_state *state = device->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = device->machine().driver_data<aeroboto_state>();
if (!state->disable_irq)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -52,13 +52,13 @@ static INTERRUPT_GEN( aeroboto_interrupt )
static READ8_HANDLER( aeroboto_irq_ack_r )
{
- cputag_set_input_line(space->machine,"maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(),"maincpu", 0, CLEAR_LINE);
return 0xff;
}
static READ8_HANDLER( aeroboto_2973_r )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
state->mainram[0x02be] = 0;
return 0xff;
@@ -66,7 +66,7 @@ static READ8_HANDLER( aeroboto_2973_r )
static WRITE8_HANDLER ( aeroboto_1a2_w )
{
- aeroboto_state *state = space->machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = space->machine().driver_data<aeroboto_state>();
state->mainram[0x01a2] = data;
if (data)
@@ -228,10 +228,10 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( formatz )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
- state->stars_rom = machine->region("gfx2")->base();
- state->stars_length = machine->region("gfx2")->bytes();
+ state->stars_rom = machine.region("gfx2")->base();
+ state->stars_length = machine.region("gfx2")->bytes();
state->save_item(NAME(state->disable_irq));
state->save_item(NAME(state->count));
@@ -239,7 +239,7 @@ static MACHINE_START( formatz )
static MACHINE_RESET( formatz )
{
- aeroboto_state *state = machine->driver_data<aeroboto_state>();
+ aeroboto_state *state = machine.driver_data<aeroboto_state>();
state->disable_irq = 0;
state->count = 0;
diff --git a/src/mame/drivers/aerofgt.c b/src/mame/drivers/aerofgt.c
index 34a92e24d60..edcd2cf1a46 100644
--- a/src/mame/drivers/aerofgt.c
+++ b/src/mame/drivers/aerofgt.c
@@ -68,7 +68,7 @@ Verification still needed for the other PCBs.
static WRITE16_HANDLER( sound_command_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
@@ -79,7 +79,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( turbofrc_sound_command_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if (ACCESSING_BITS_8_15)
{
state->pending_command = 1;
@@ -90,7 +90,7 @@ static WRITE16_HANDLER( turbofrc_sound_command_w )
static WRITE16_HANDLER( aerfboot_soundlatch_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
if(ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data >> 8) & 0xff);
@@ -100,19 +100,19 @@ static WRITE16_HANDLER( aerfboot_soundlatch_w )
static READ16_HANDLER( pending_command_r )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
return state->pending_command;
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- aerofgt_state *state = space->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = space->machine().driver_data<aerofgt_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( aerofgt_sh_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
@@ -134,7 +134,7 @@ static WRITE16_DEVICE_HANDLER( aerfboo2_okim6295_banking_w )
static WRITE8_HANDLER( aerfboot_okim6295_banking_w )
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
/*bit 2 (0x4) setted too?*/
if (data & 0x4)
memcpy(&oki[0x20000], &oki[((data & 0x3) * 0x20000) + 0x40000], 0x20000);
@@ -1282,7 +1282,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- aerofgt_state *state = device->machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = device->machine().driver_data<aerofgt_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1299,15 +1299,15 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( common )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->pending_command));
}
static MACHINE_START( aerofgt )
{
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rom[0x10000], 0x8000);
@@ -1316,7 +1316,7 @@ static MACHINE_START( aerofgt )
static MACHINE_RESET( common )
{
- aerofgt_state *state = machine->driver_data<aerofgt_state>();
+ aerofgt_state *state = machine.driver_data<aerofgt_state>();
state->pending_command = 0;
}
diff --git a/src/mame/drivers/airbustr.c b/src/mame/drivers/airbustr.c
index 18b4f21d3ad..04c9d015470 100644
--- a/src/mame/drivers/airbustr.c
+++ b/src/mame/drivers/airbustr.c
@@ -228,7 +228,7 @@ Code at 505: waits for bit 1 to go low, writes command, waits for bit
/* Read/Write Handlers */
static READ8_HANDLER( devram_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
// There's an MCU here, possibly
switch (offset)
@@ -254,7 +254,7 @@ static READ8_HANDLER( devram_r )
/* Reading eff4, F0 times must yield at most 80-1 consecutive
equal values */
case 0xff4:
- return space->machine->rand();
+ return space->machine().rand();
default:
return state->devram[offset];
@@ -263,22 +263,22 @@ static READ8_HANDLER( devram_r )
static WRITE8_HANDLER( master_nmi_trigger_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( master_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static WRITE8_HANDLER( slave_bankswitch_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
// used at the end of levels, after defeating the boss, to leave trails
pandora_set_clear_bitmap(state->pandora, data & 0x20);
@@ -286,12 +286,12 @@ static WRITE8_HANDLER( slave_bankswitch_w )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank3", data & 0x07);
+ memory_set_bank(space->machine(), "bank3", data & 0x07);
}
static READ8_HANDLER( soundcommand_status_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
// bits: 2 <-> ? 1 <-> soundlatch full 0 <-> soundlatch2 empty
return 4 + state->soundlatch_status * 2 + (1 - state->soundlatch2_status);
@@ -299,21 +299,21 @@ static READ8_HANDLER( soundcommand_status_r )
static READ8_HANDLER( soundcommand_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->soundlatch_status = 0; // soundlatch has been read
return soundlatch_r(space, 0);
}
static READ8_HANDLER( soundcommand2_r )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
state->soundlatch2_status = 0; // soundlatch2 has been read
return soundlatch2_r(space, 0);
}
static WRITE8_HANDLER( soundcommand_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
soundlatch_w(space, 0, data);
state->soundlatch_status = 1; // soundlatch has been written
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE); // cause a nmi to sub cpu
@@ -321,14 +321,14 @@ static WRITE8_HANDLER( soundcommand_w )
static WRITE8_HANDLER( soundcommand2_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
soundlatch2_w(space, 0, data);
state->soundlatch2_status = 1; // soundlatch2 has been written
}
static WRITE8_HANDLER( airbustr_paletteram_w )
{
- airbustr_state *state = space->machine->driver_data<airbustr_state>();
+ airbustr_state *state = space->machine().driver_data<airbustr_state>();
int val;
/* ! byte 1 ! ! byte 0 ! */
@@ -338,15 +338,15 @@ static WRITE8_HANDLER( airbustr_paletteram_w )
state->paletteram[offset] = data;
val = (state->paletteram[offset | 1] << 8) | state->paletteram[offset & ~1];
- palette_set_color_rgb(space->machine, offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
+ palette_set_color_rgb(space->machine(), offset / 2, pal5bit(val >> 5), pal5bit(val >> 10), pal5bit(val >> 0));
}
static WRITE8_HANDLER( airbustr_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
- coin_lockout_w(space->machine, 0, ~data & 4);
- coin_lockout_w(space->machine, 1, ~data & 8);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
+ coin_lockout_w(space->machine(), 0, ~data & 4);
+ coin_lockout_w(space->machine(), 1, ~data & 8);
}
/* Memory Maps */
@@ -559,14 +559,14 @@ static const ym2203_interface ym2203_config =
static INTERRUPT_GEN( master_interrupt )
{
- airbustr_state *state = device->machine->driver_data<airbustr_state>();
+ airbustr_state *state = device->machine().driver_data<airbustr_state>();
state->master_addr ^= 0x02;
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->master_addr);
}
static INTERRUPT_GEN( slave_interrupt )
{
- airbustr_state *state = device->machine->driver_data<airbustr_state>();
+ airbustr_state *state = device->machine().driver_data<airbustr_state>();
state->slave_addr ^= 0x02;
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->slave_addr);
}
@@ -575,10 +575,10 @@ static INTERRUPT_GEN( slave_interrupt )
static MACHINE_START( airbustr )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
- UINT8 *MASTER = machine->region("master")->base();
- UINT8 *SLAVE = machine->region("slave")->base();
- UINT8 *AUDIO = machine->region("audiocpu")->base();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
+ UINT8 *MASTER = machine.region("master")->base();
+ UINT8 *SLAVE = machine.region("slave")->base();
+ UINT8 *AUDIO = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &MASTER[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 3, 5, &MASTER[0x10000], 0x4000);
@@ -587,10 +587,10 @@ static MACHINE_START( airbustr )
memory_configure_bank(machine, "bank3", 0, 3, &AUDIO[0x00000], 0x4000);
memory_configure_bank(machine, "bank3", 3, 5, &AUDIO[0x10000], 0x4000);
- state->master = machine->device("master");
- state->slave = machine->device("slave");
- state->audiocpu = machine->device("audiocpu");
- state->pandora = machine->device("pandora");
+ state->master = machine.device("master");
+ state->slave = machine.device("slave");
+ state->audiocpu = machine.device("audiocpu");
+ state->pandora = machine.device("pandora");
state->save_item(NAME(state->soundlatch_status));
state->save_item(NAME(state->soundlatch2_status));
@@ -605,7 +605,7 @@ static MACHINE_START( airbustr )
static MACHINE_RESET( airbustr )
{
- airbustr_state *state = machine->driver_data<airbustr_state>();
+ airbustr_state *state = machine.driver_data<airbustr_state>();
state->soundlatch_status = state->soundlatch2_status = 0;
state->master_addr = 0xff;
@@ -798,7 +798,7 @@ ROM_END
static DRIVER_INIT( airbustr )
{
- machine->device("master")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe000, 0xefff, FUNC(devram_r)); // protection device lives here
+ machine.device("master")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe000, 0xefff, FUNC(devram_r)); // protection device lives here
}
diff --git a/src/mame/drivers/ajax.c b/src/mame/drivers/ajax.c
index 01c80cbce51..963a89515c9 100644
--- a/src/mame/drivers/ajax.c
+++ b/src/mame/drivers/ajax.c
@@ -137,7 +137,7 @@ INPUT_PORTS_END
static WRITE8_HANDLER( sound_bank_w )
{
- ajax_state *state = space->machine->driver_data<ajax_state>();
+ ajax_state *state = space->machine().driver_data<ajax_state>();
int bank_A, bank_B;
/* banks # for the 007232 (chip 1) */
diff --git a/src/mame/drivers/albazc.c b/src/mame/drivers/albazc.c
index 5178f1f87e2..95770d5bf4b 100644
--- a/src/mame/drivers/albazc.c
+++ b/src/mame/drivers/albazc.c
@@ -51,9 +51,9 @@ static VIDEO_START( hanaroku )
{
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- albazc_state *state = machine->driver_data<albazc_state>();
+ albazc_state *state = machine.driver_data<albazc_state>();
int i;
for (i = 511; i >= 0; i--)
@@ -72,7 +72,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0], code, color, flipx, flipy,
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0], code, color, flipx, flipy,
sx, sy, 0);
}
}
@@ -80,7 +80,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(hanaroku)
{
bitmap_fill(bitmap, cliprect, 0x1f0); // ???
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -99,11 +99,11 @@ static WRITE8_HANDLER( hanaroku_out_0_w )
7 meter5 (start)
*/
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_counter_w(space->machine, 2, data & 0x04);
- coin_counter_w(space->machine, 3, data & 0x08);
- coin_counter_w(space->machine, 4, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_counter_w(space->machine(), 2, data & 0x04);
+ coin_counter_w(space->machine(), 3, data & 0x08);
+ coin_counter_w(space->machine(), 4, data & 0x80);
}
static WRITE8_HANDLER( hanaroku_out_1_w )
@@ -129,7 +129,7 @@ static WRITE8_HANDLER( hanaroku_out_2_w )
static WRITE8_HANDLER( albazc_vregs_w )
{
- albazc_state *state = space->machine->driver_data<albazc_state>();
+ albazc_state *state = space->machine().driver_data<albazc_state>();
#ifdef UNUSED_FUNCTION
{
@@ -142,7 +142,7 @@ static WRITE8_HANDLER( albazc_vregs_w )
if(offset == 0)
{
/* core bug with this? */
- //flip_screen_set(space->machine, (data & 0x40) >> 6);
+ //flip_screen_set(space->machine(), (data & 0x40) >> 6);
state->flip_bit = (data & 0x40) >> 6;
}
}
diff --git a/src/mame/drivers/albazg.c b/src/mame/drivers/albazg.c
index 320bf0b21bf..dd5f101ebf3 100644
--- a/src/mame/drivers/albazg.c
+++ b/src/mame/drivers/albazg.c
@@ -88,7 +88,7 @@ public:
static TILE_GET_INFO( y_get_bg_tile_info )
{
- albazg_state *state = machine->driver_data<albazg_state>();
+ albazg_state *state = machine.driver_data<albazg_state>();
int code = state->videoram[tile_index];
int color = state->colorram[tile_index];
@@ -102,13 +102,13 @@ static TILE_GET_INFO( y_get_bg_tile_info )
static VIDEO_START( yumefuda )
{
- albazg_state *state = machine->driver_data<albazg_state>();
+ albazg_state *state = machine.driver_data<albazg_state>();
state->bg_tilemap = tilemap_create(machine, y_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( yumefuda )
{
- albazg_state *state = screen->machine->driver_data<albazg_state>();
+ albazg_state *state = screen->machine().driver_data<albazg_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -133,14 +133,14 @@ GFXDECODE_END
static WRITE8_HANDLER( yumefuda_vram_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( yumefuda_cram_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -148,14 +148,14 @@ static WRITE8_HANDLER( yumefuda_cram_w )
/*Custom RAM (Thrash Protection)*/
static READ8_HANDLER( custom_ram_r )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
// logerror("Custom RAM read at %02x PC = %x\n", offset + 0xaf80, cpu_get_pc(space->cpu));
return state->cus_ram[offset];// ^ 0x55;
}
static WRITE8_HANDLER( custom_ram_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
// logerror("Custom RAM write at %02x : %02x PC = %x\n", offset + 0xaf80, data, cpu_get_pc(space->cpu));
if(state->prot_lock)
state->cus_ram[offset] = data;
@@ -164,23 +164,23 @@ static WRITE8_HANDLER( custom_ram_w )
/*this might be used as NVRAM commands btw*/
static WRITE8_HANDLER( prot_lock_w )
{
- albazg_state *state = space->machine->driver_data<albazg_state>();
+ albazg_state *state = space->machine().driver_data<albazg_state>();
// logerror("PC %04x Prot lock value written %02x\n", cpu_get_pc(space->cpu), data);
state->prot_lock = data;
}
static READ8_DEVICE_HANDLER( mux_r )
{
- albazg_state *state = device->machine->driver_data<albazg_state>();
+ albazg_state *state = device->machine().driver_data<albazg_state>();
switch(state->mux_data)
{
- case 0x00: return input_port_read(device->machine, "IN0");
- case 0x01: return input_port_read(device->machine, "IN1");
- case 0x02: return input_port_read(device->machine, "IN2");
- case 0x04: return input_port_read(device->machine, "IN3");
- case 0x08: return input_port_read(device->machine, "IN4");
- case 0x10: return input_port_read(device->machine, "IN5");
- case 0x20: return input_port_read(device->machine, "IN6");
+ case 0x00: return input_port_read(device->machine(), "IN0");
+ case 0x01: return input_port_read(device->machine(), "IN1");
+ case 0x02: return input_port_read(device->machine(), "IN2");
+ case 0x04: return input_port_read(device->machine(), "IN3");
+ case 0x08: return input_port_read(device->machine(), "IN4");
+ case 0x10: return input_port_read(device->machine(), "IN5");
+ case 0x20: return input_port_read(device->machine(), "IN6");
}
return 0xff;
@@ -188,7 +188,7 @@ static READ8_DEVICE_HANDLER( mux_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- albazg_state *state = device->machine->driver_data<albazg_state>();
+ albazg_state *state = device->machine().driver_data<albazg_state>();
int new_bank = (data & 0xc0) >> 6;
//0x10000 "Learn Mode"
@@ -198,7 +198,7 @@ static WRITE8_DEVICE_HANDLER( mux_w )
if( state->bank != new_bank)
{
state->bank = new_bank;
- memory_set_bank(device->machine, "bank1", state->bank);
+ memory_set_bank(device->machine(), "bank1", state->bank);
}
state->mux_data = data & ~0xc0;
@@ -206,12 +206,12 @@ static WRITE8_DEVICE_HANDLER( mux_w )
static WRITE8_DEVICE_HANDLER( yumefuda_output_w )
{
- coin_counter_w(device->machine, 0, ~data & 4);
- coin_counter_w(device->machine, 1, ~data & 2);
- coin_lockout_global_w(device->machine, data & 1);
+ coin_counter_w(device->machine(), 0, ~data & 4);
+ coin_counter_w(device->machine(), 1, ~data & 2);
+ coin_lockout_global_w(device->machine(), data & 1);
//data & 0x10 hopper-c (active LOW)
//data & 0x08 divider (active HIGH)
- flip_screen_set(device->machine, ~data & 0x20);
+ flip_screen_set(device->machine(), ~data & 0x20);
}
static const ay8910_interface ay8910_config =
@@ -375,8 +375,8 @@ INPUT_PORTS_END
static MACHINE_START( yumefuda )
{
- albazg_state *state = machine->driver_data<albazg_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ albazg_state *state = machine.driver_data<albazg_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
@@ -387,7 +387,7 @@ static MACHINE_START( yumefuda )
static MACHINE_RESET( yumefuda )
{
- albazg_state *state = machine->driver_data<albazg_state>();
+ albazg_state *state = machine.driver_data<albazg_state>();
state->mux_data = 0;
state->bank = -1;
state->prot_lock = 0;
diff --git a/src/mame/drivers/aleck64.c b/src/mame/drivers/aleck64.c
index 6c8b46ff09f..92f917d3e32 100644
--- a/src/mame/drivers/aleck64.c
+++ b/src/mame/drivers/aleck64.c
@@ -174,9 +174,9 @@ Notes:
static READ32_HANDLER( aleck_dips_r )
{
if (offset == 0)
- return (input_port_read(space->machine, "IN0")); /* mtetrisc has regular inputs here */
+ return (input_port_read(space->machine(), "IN0")); /* mtetrisc has regular inputs here */
else if (offset == 1)
- return (input_port_read(space->machine, "IN1"));
+ return (input_port_read(space->machine(), "IN1"));
return 0;
}
@@ -563,7 +563,7 @@ static const mips3_config vr4300_config =
static INTERRUPT_GEN( n64_vblank )
{
- signal_rcp_interrupt(device->machine, VI_INTERRUPT);
+ signal_rcp_interrupt(device->machine(), VI_INTERRUPT);
}
static MACHINE_CONFIG_START( aleck64, _n64_state )
@@ -603,7 +603,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( aleck64 )
{
- UINT8 *rom = machine->region("user2")->base();
+ UINT8 *rom = machine.region("user2")->base();
rom[0x67c] = 0;
rom[0x67d] = 0;
diff --git a/src/mame/drivers/alg.c b/src/mame/drivers/alg.c
index 1e6552a44d7..2818fbdcd4e 100644
--- a/src/mame/drivers/alg.c
+++ b/src/mame/drivers/alg.c
@@ -56,8 +56,8 @@ static int get_lightgun_pos(screen_device &screen, int player, int *x, int *y)
{
const rectangle &visarea = screen.visible_area();
- int xpos = input_port_read_safe(screen.machine, (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff);
- int ypos = input_port_read_safe(screen.machine, (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff);
+ int xpos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1X" : "GUN2X", 0xffffffff);
+ int ypos = input_port_read_safe(screen.machine(), (player == 0) ? "GUN1Y" : "GUN2Y", 0xffffffff);
if (xpos == -1 || ypos == -1)
return FALSE;
@@ -95,10 +95,10 @@ static VIDEO_START( alg )
static MACHINE_START( alg )
{
- alg_state *state = machine->driver_data<alg_state>();
- state->laserdisc = machine->device("laserdisc");
+ alg_state *state = machine.driver_data<alg_state>();
+ state->laserdisc = machine.device("laserdisc");
- state->serial_timer = machine->scheduler().timer_alloc(FUNC(response_timer));
+ state->serial_timer = machine.scheduler().timer_alloc(FUNC(response_timer));
state->serial_timer_active = FALSE;
}
@@ -118,7 +118,7 @@ static MACHINE_RESET( alg )
static TIMER_CALLBACK( response_timer )
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* if we still have data to send, do it now */
if (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
@@ -137,9 +137,9 @@ static TIMER_CALLBACK( response_timer )
}
-static void vsync_callback(running_machine *machine)
+static void vsync_callback(running_machine &machine)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* if we have data available, set a timer to read it */
if (!state->serial_timer_active && laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
@@ -150,9 +150,9 @@ static void vsync_callback(running_machine *machine)
}
-static void serial_w(running_machine *machine, UINT16 data)
+static void serial_w(running_machine &machine, UINT16 data)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* write to the laserdisc player */
laserdisc_data_w(state->laserdisc, data & 0xff);
@@ -173,9 +173,9 @@ static void serial_w(running_machine *machine, UINT16 data)
*
*************************************/
-static void alg_potgo_w(running_machine *machine, UINT16 data)
+static void alg_potgo_w(running_machine &machine, UINT16 data)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
/* bit 15 controls whether pin 9 is input/output */
/* bit 14 controls the value, which selects which player's controls to read */
@@ -185,30 +185,30 @@ static void alg_potgo_w(running_machine *machine, UINT16 data)
static CUSTOM_INPUT( lightgun_pos_r )
{
- alg_state *state = field->port->machine->driver_data<alg_state>();
+ alg_state *state = field->port->machine().driver_data<alg_state>();
int x = 0, y = 0;
/* get the position based on the input select */
- get_lightgun_pos(*field->port->machine->primary_screen, state->input_select, &x, &y);
+ get_lightgun_pos(*field->port->machine().primary_screen, state->input_select, &x, &y);
return (y << 8) | (x >> 2);
}
static CUSTOM_INPUT( lightgun_trigger_r )
{
- alg_state *state = field->port->machine->driver_data<alg_state>();
+ alg_state *state = field->port->machine().driver_data<alg_state>();
/* read the trigger control based on the input select */
- return (input_port_read(field->port->machine, "TRIGGERS") >> state->input_select) & 1;
+ return (input_port_read(field->port->machine(), "TRIGGERS") >> state->input_select) & 1;
}
static CUSTOM_INPUT( lightgun_holster_r )
{
- alg_state *state = field->port->machine->driver_data<alg_state>();
+ alg_state *state = field->port->machine().driver_data<alg_state>();
/* read the holster control based on the input select */
- return (input_port_read(field->port->machine, "TRIGGERS") >> (2 + state->input_select)) & 1;
+ return (input_port_read(field->port->machine(), "TRIGGERS") >> (2 + state->input_select)) & 1;
}
@@ -221,10 +221,10 @@ static CUSTOM_INPUT( lightgun_holster_r )
static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* switch banks as appropriate */
- memory_set_bank(device->machine, "bank1", data & 1);
+ memory_set_bank(device->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
@@ -239,13 +239,13 @@ static WRITE8_DEVICE_HANDLER( alg_cia_0_porta_w )
static READ8_DEVICE_HANDLER( alg_cia_0_porta_r )
{
- return input_port_read(device->machine, "FIRE") | 0x3f;
+ return input_port_read(device->machine(), "FIRE") | 0x3f;
}
static READ8_DEVICE_HANDLER( alg_cia_0_portb_r )
{
- logerror("%s:alg_cia_0_portb_r\n", device->machine->describe_context());
+ logerror("%s:alg_cia_0_portb_r\n", device->machine().describe_context());
return 0xff;
}
@@ -253,20 +253,20 @@ static READ8_DEVICE_HANDLER( alg_cia_0_portb_r )
static WRITE8_DEVICE_HANDLER( alg_cia_0_portb_w )
{
/* parallel port */
- logerror("%s:alg_cia_0_portb_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:alg_cia_0_portb_w(%02x)\n", device->machine().describe_context(), data);
}
static READ8_DEVICE_HANDLER( alg_cia_1_porta_r )
{
- logerror("%s:alg_cia_1_porta_r\n", device->machine->describe_context());
+ logerror("%s:alg_cia_1_porta_r\n", device->machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( alg_cia_1_porta_w )
{
- logerror("%s:alg_cia_1_porta_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:alg_cia_1_porta_w(%02x)\n", device->machine().describe_context(), data);
}
@@ -678,9 +678,9 @@ ROM_END
*
*************************************/
-static void alg_init(running_machine *machine)
+static void alg_init(running_machine &machine)
{
- alg_state *state = machine->driver_data<alg_state>();
+ alg_state *state = machine.driver_data<alg_state>();
static const amiga_machine_interface alg_intf =
{
ANGUS_CHIP_RAM_MASK,
@@ -696,7 +696,7 @@ static void alg_init(running_machine *machine)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
}
@@ -709,8 +709,8 @@ static void alg_init(running_machine *machine)
static DRIVER_INIT( palr1 )
{
- UINT32 length = machine->region("user2")->bytes();
- UINT8 *rom = machine->region("user2")->base();
+ UINT32 length = machine.region("user2")->bytes();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -729,8 +729,8 @@ static DRIVER_INIT( palr1 )
static DRIVER_INIT( palr3 )
{
- UINT32 length = machine->region("user2")->bytes();
- UINT8 *rom = machine->region("user2")->base();
+ UINT32 length = machine.region("user2")->bytes();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -748,8 +748,8 @@ static DRIVER_INIT( palr3 )
static DRIVER_INIT( palr6 )
{
- UINT32 length = machine->region("user2")->bytes();
- UINT8 *rom = machine->region("user2")->base();
+ UINT32 length = machine.region("user2")->bytes();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *original = auto_alloc_array(machine, UINT8, length);
UINT32 srcaddr;
@@ -770,7 +770,7 @@ static DRIVER_INIT( palr6 )
static DRIVER_INIT( aplatoon )
{
/* NOT DONE TODO FIGURE OUT THE RIGHT ORDER!!!! */
- UINT8 *rom = machine->region("user2")->base();
+ UINT8 *rom = machine.region("user2")->base();
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x40000);
int i;
diff --git a/src/mame/drivers/aliens.c b/src/mame/drivers/aliens.c
index 709887dfeaf..27803f2f3cd 100644
--- a/src/mame/drivers/aliens.c
+++ b/src/mame/drivers/aliens.c
@@ -21,7 +21,7 @@ static KONAMI_SETLINES_CALLBACK( aliens_banking );
static INTERRUPT_GEN( aliens_interrupt )
{
- aliens_state *state = device->machine->driver_data<aliens_state>();
+ aliens_state *state = device->machine().driver_data<aliens_state>();
if (k051960_is_irq_enabled(state->k051960))
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -29,17 +29,17 @@ static INTERRUPT_GEN( aliens_interrupt )
static READ8_HANDLER( bankedram_r )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -49,11 +49,11 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( aliens_coin_counter_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
/* bits 0-1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 5 = select work RAM or palette */
state->palette_selected = data & 0x20;
@@ -73,7 +73,7 @@ static WRITE8_HANDLER( aliens_coin_counter_w )
static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( aliens_sh_irqtrigger_w )
static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
{
- aliens_state *state = device->machine->driver_data<aliens_state>();
+ aliens_state *state = device->machine().driver_data<aliens_state>();
/* b1: bank for chanel A */
/* b0: bank for chanel B */
@@ -95,7 +95,7 @@ static WRITE8_DEVICE_HANDLER( aliens_snd_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -112,7 +112,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- aliens_state *state = space->machine->driver_data<aliens_state>();
+ aliens_state *state = space->machine().driver_data<aliens_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -237,26 +237,26 @@ static const k051960_interface aliens_k051960_intf =
static MACHINE_START( aliens )
{
- aliens_state *state = machine->driver_data<aliens_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ aliens_state *state = machine.driver_data<aliens_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 20, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->palette_selected));
}
static MACHINE_RESET( aliens )
{
- aliens_state *state = machine->driver_data<aliens_state>();
+ aliens_state *state = machine.driver_data<aliens_state>();
- konami_configure_set_lines(machine->device("maincpu"), aliens_banking);
+ konami_configure_set_lines(machine.device("maincpu"), aliens_banking);
state->palette_selected = 0;
}
@@ -554,7 +554,7 @@ static KONAMI_SETLINES_CALLBACK( aliens_banking )
bank -= 4;
bank += (lines & 0x0f);
- memory_set_bank(device->machine, "bank1", bank);
+ memory_set_bank(device->machine(), "bank1", bank);
}
GAME( 1990, aliens, 0, aliens, aliens, 0, ROT0, "Konami", "Aliens (World set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/alpha68k.c b/src/mame/drivers/alpha68k.c
index a3bbc190729..430fa1a5ea0 100644
--- a/src/mame/drivers/alpha68k.c
+++ b/src/mame/drivers/alpha68k.c
@@ -206,14 +206,14 @@ DIP locations verified from manuals for:
static WRITE16_HANDLER( tnextspc_coin_counters_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
static WRITE16_HANDLER( tnextspc_unknown_w )
{
logerror("tnextspc_unknown_w : PC = %04x - offset = %04x - data = %04x\n", cpu_get_pc(space->cpu), offset, data);
if (offset == 0)
- alpha68k_flipscreen_w(space->machine, data & 0x100);
+ alpha68k_flipscreen_w(space->machine(), data & 0x100);
}
static WRITE16_HANDLER( alpha_microcontroller_w )
@@ -221,72 +221,72 @@ static WRITE16_HANDLER( alpha_microcontroller_w )
logerror("%04x: Alpha write trigger at %04x (%04x)\n", cpu_get_pc(space->cpu), offset, data);
/* 0x44 = coin clear signal to microcontroller? */
if (offset == 0x2d && ACCESSING_BITS_0_7)
- alpha68k_flipscreen_w(space->machine, data & 1);
+ alpha68k_flipscreen_w(space->machine(), data & 1);
}
/******************************************************************************/
static READ16_HANDLER( kyros_dip_r )
{
- return input_port_read(space->machine, "IN1") << 8;
+ return input_port_read(space->machine(), "IN1") << 8;
}
static READ16_HANDLER( control_1_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~(input_port_read(space->machine, "IN0") + (input_port_read(space->machine, "IN1") << 8));
+ return ~(input_port_read(space->machine(), "IN0") + (input_port_read(space->machine(), "IN1") << 8));
- return (input_port_read(space->machine, "IN0") + (input_port_read(space->machine, "IN1") << 8));
+ return (input_port_read(space->machine(), "IN0") + (input_port_read(space->machine(), "IN1") << 8));
}
static READ16_HANDLER( control_2_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~(input_port_read(space->machine, "IN3") + ((~(1 << input_port_read(space->machine, "IN5"))) << 8));
+ return ~(input_port_read(space->machine(), "IN3") + ((~(1 << input_port_read(space->machine(), "IN5"))) << 8));
- return input_port_read(space->machine, "IN3") + /* Low byte of CN1 */
- ((~(1 << input_port_read(space->machine, "IN5"))) << 8);
+ return input_port_read(space->machine(), "IN3") + /* Low byte of CN1 */
+ ((~(1 << input_port_read(space->machine(), "IN5"))) << 8);
}
static READ16_HANDLER( control_2_V_r )
{
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
static READ16_HANDLER( control_3_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~(((~(1 << input_port_read(space->machine, "IN6"))) << 8) & 0xff00);
+ return ~(((~(1 << input_port_read(space->machine(), "IN6"))) << 8) & 0xff00);
- return ((~(1 << input_port_read(space->machine, "IN6"))) << 8) & 0xff00;
+ return ((~(1 << input_port_read(space->machine(), "IN6"))) << 8) & 0xff00;
}
/* High 4 bits of CN1 & CN2 */
static READ16_HANDLER( control_4_r )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (state->invert_controls)
- return ~((((~(1 << input_port_read(space->machine, "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(space->machine, "IN5")))) & 0x0f00));
+ return ~((((~(1 << input_port_read(space->machine(), "IN6"))) << 4) & 0xf000)
+ + (((~(1 << input_port_read(space->machine(), "IN5")))) & 0x0f00));
- return (((~(1 << input_port_read(space->machine, "IN6"))) << 4) & 0xf000)
- + (((~(1 << input_port_read(space->machine, "IN5")))) & 0x0f00);
+ return (((~(1 << input_port_read(space->machine(), "IN6"))) << 4) & 0xf000)
+ + (((~(1 << input_port_read(space->machine(), "IN5")))) & 0x0f00);
}
static READ16_HANDLER( jongbou_inputs_r )
{
- UINT8 inp1 = input_port_read(space->machine, "IN3");
- UINT8 inp2 = input_port_read(space->machine, "IN4");
+ UINT8 inp1 = input_port_read(space->machine(), "IN3");
+ UINT8 inp2 = input_port_read(space->machine(), "IN4");
inp1 = ((inp1 & 0x01) << 3) + ((inp1 & 0x02) << 1) + ((inp1 & 0x04) >> 1) + ((inp1 & 0x08) >> 3);
inp2 = ((inp2 & 0x01) << 3) + ((inp2 & 0x02) << 1) + ((inp2 & 0x04) >> 1) + ((inp2 & 0x08) >> 3);
- return input_port_read(space->machine, "IN0") | inp1 | inp2 << 4;
+ return input_port_read(space->machine(), "IN0") | inp1 | inp2 << 4;
}
@@ -310,12 +310,12 @@ static WRITE16_HANDLER( alpha68k_V_sound_w )
if(ACCESSING_BITS_0_7)
soundlatch_w(space, 0, data & 0xff);
if(ACCESSING_BITS_8_15)
- alpha68k_V_video_bank_w(space->machine, (data >> 8) & 0xff);
+ alpha68k_V_video_bank_w(space->machine(), (data >> 8) & 0xff);
}
//AT
static WRITE16_HANDLER( paddlema_soundlatch_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
@@ -326,7 +326,7 @@ static WRITE16_HANDLER( paddlema_soundlatch_w )
static WRITE16_HANDLER( tnextspc_soundlatch_w )
{
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
if (ACCESSING_BITS_0_7)
{
@@ -345,7 +345,7 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
*/
static const UINT8 coinage1[8][2]={{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2]={{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
@@ -355,15 +355,15 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
return 0;
case 0x29: /* Query microcontroller for coin insert */
state->trigstate++;
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
state->latch = 1;
- state->coinvalue = (~input_port_read(space->machine, "IN1") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN1") >> 1) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
{
@@ -373,13 +373,13 @@ static READ16_HANDLER( kyros_alpha_trigger_r )
else
state->credits = 0;
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id >> 8); // coinB
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
state->latch = 1;
- state->coinvalue = (~input_port_read(space->machine, "IN1") >>1 ) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN1") >>1 ) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
{
@@ -427,13 +427,13 @@ static READ16_HANDLER( alpha_II_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,2}, {1,3}, {1,4}, {1,5}, {1,6}, {2,3}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {2,1}, {3,1}, {4,1}, {5,1}, {6,1}, {7,1}, {8,1}};
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
{
case 0: /* Dipswitch 2 */
- state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine, "IN4");
+ state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
return 0;
case 0x22: /* Coin value */
@@ -441,9 +441,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -452,9 +452,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((state->coin_id & 0xff) == 0x22)
{
if (state->game_id == ALPHA68K_BTLFIELDB)
- state->coinvalue = (input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (input_port_read(space->machine(), "IN4") >> 0) & 7;
else
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 0) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
@@ -466,7 +466,7 @@ static READ16_HANDLER( alpha_II_trigger_r )
state->credits = 0;
}
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id >> 8); // coinB
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -475,9 +475,9 @@ static READ16_HANDLER( alpha_II_trigger_r )
if ((state->coin_id >> 8) == 0x22)
{
if (state->game_id == ALPHA68K_BTLFIELDB)
- state->coinvalue = (input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (input_port_read(space->machine(), "IN4") >> 0) & 7;
else
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 0) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 0) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
@@ -522,21 +522,21 @@ static READ16_HANDLER( alpha_V_trigger_r )
*/
static const UINT8 coinage1[8][2] = {{1,1}, {1,5}, {1,3}, {2,3}, {1,2}, {1,6}, {1,4}, {3,2}};
static const UINT8 coinage2[8][2] = {{1,1}, {5,1}, {3,1}, {7,1}, {2,1}, {6,1}, {4,1}, {8,1}};
- alpha68k_state *state = space->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = space->machine().driver_data<alpha68k_state>();
int source = state->shared_ram[offset];
switch (offset)
{
case 0: /* Dipswitch 1 */
- state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine, "IN4");
+ state->shared_ram[0] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
return 0;
case 0x22: /* Coin value */
state->shared_ram[0x22] = (source & 0xff00) | (state->credits & 0x00ff);
return 0;
case 0x29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -544,7 +544,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id & 0xff) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
{
@@ -555,7 +555,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
state->credits = 0;
}
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x29] = (source & 0xff00) | (state->coin_id>>8); // coinB
state->shared_ram[0x22] = (source & 0xff00) | 0x0;
@@ -563,7 +563,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id >> 8) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
{
@@ -589,12 +589,12 @@ static READ16_HANDLER( alpha_V_trigger_r )
break;
case 0x1f00: /* Dipswitch 1 */
- state->shared_ram[0x1f00] = (source & 0xff00) | input_port_read(space->machine, "IN4");
+ state->shared_ram[0x1f00] = (source & 0xff00) | input_port_read(space->machine(), "IN4");
return 0;
case 0x1f29: /* Query microcontroller for coin insert */
- if ((input_port_read(space->machine, "IN2") & 0x3) == 3)
+ if ((input_port_read(space->machine(), "IN2") & 0x3) == 3)
state->latch = 0;
- if ((input_port_read(space->machine, "IN2") & 0x1) == 0 && !state->latch)
+ if ((input_port_read(space->machine(), "IN2") & 0x1) == 0 && !state->latch)
{
state->shared_ram[0x1f29] = (source & 0xff00) | (state->coin_id & 0xff); // coinA
state->shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@@ -602,7 +602,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id & 0xff) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits1++;
if (state->deposits1 == coinage1[state->coinvalue][0])
{
@@ -613,7 +613,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
state->credits = 0;
}
}
- else if ((input_port_read(space->machine, "IN2") & 0x2) == 0 && !state->latch)
+ else if ((input_port_read(space->machine(), "IN2") & 0x2) == 0 && !state->latch)
{
state->shared_ram[0x1f29] = (source & 0xff00) | (state->coin_id >> 8); // coinB
state->shared_ram[0x1f22] = (source & 0xff00) | 0x0;
@@ -621,7 +621,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
if ((state->coin_id >> 8) == 0x22)
{
- state->coinvalue = (~input_port_read(space->machine, "IN4") >> 1) & 7;
+ state->coinvalue = (~input_port_read(space->machine(), "IN4") >> 1) & 7;
state->deposits2++;
if (state->deposits2 == coinage2[state->coinvalue][0])
{
@@ -642,7 +642,7 @@ static READ16_HANDLER( alpha_V_trigger_r )
the microcontroller supplies it (it does for all the other games,
but usually to 0x0 in RAM) when 0x21 is read (code at 0x009332) */
source = state->shared_ram[0x0163];
- state->shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(space->machine, "IN4") << 8);
+ state->shared_ram[0x0163] = (source & 0x00ff) | (input_port_read(space->machine(), "IN4") << 8);
return 0;
case 0x1ffe: /* Custom ID check */
@@ -742,7 +742,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( sound_bank_w )
{
- memory_set_bank(space->machine, "bank7", data);
+ memory_set_bank(space->machine(), "bank7", data);
}
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8 )
@@ -1841,7 +1841,7 @@ static const ym2203_interface ym2203_config =
static void YM3812_irq( device_t *device, int param )
{
- alpha68k_state *state = device->machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = device->machine().driver_data<alpha68k_state>();
device_set_input_line(state->audiocpu, 0, (param) ? HOLD_LINE : CLEAR_LINE);
}
@@ -1864,9 +1864,9 @@ static INTERRUPT_GEN( alpha68k_interrupt )
static MACHINE_START( common )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->trigstate));
state->save_item(NAME(state->deposits1));
@@ -1880,7 +1880,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->trigstate = 0;
state->deposits1 = 0;
@@ -1894,8 +1894,8 @@ static MACHINE_RESET( common )
static MACHINE_START( alpha68k_V )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank7", 0, 32, &ROM[0x10000], 0x4000);
@@ -1907,7 +1907,7 @@ static MACHINE_START( alpha68k_V )
static MACHINE_RESET( alpha68k_V )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
MACHINE_RESET_CALL(common);
@@ -1917,7 +1917,7 @@ static MACHINE_RESET( alpha68k_V )
static MACHINE_RESET( alpha68k_II )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
MACHINE_RESET_CALL(common);
@@ -1930,8 +1930,8 @@ static MACHINE_RESET( alpha68k_II )
static MACHINE_START( alpha68k_II )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank7", 0, 28, &ROM[0x10000], 0x4000);
@@ -3089,7 +3089,7 @@ ROM_END
static DRIVER_INIT( sstingry )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x00ff;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3098,7 +3098,7 @@ static DRIVER_INIT( sstingry )
static DRIVER_INIT( kyros )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x0012;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3107,8 +3107,8 @@ static DRIVER_INIT( kyros )
static DRIVER_INIT( jongbou )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0c0000, 0x0c0001, FUNC(jongbou_inputs_r));
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0c0000, 0x0c0001, FUNC(jongbou_inputs_r));
state->invert_controls = 0;
state->microcontroller_id = 0x00ff;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3117,7 +3117,7 @@ static DRIVER_INIT( jongbou )
static DRIVER_INIT( paddlema )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->microcontroller_id = 0;
state->coin_id = 0; // Not needed !
state->game_id = 0;
@@ -3125,7 +3125,7 @@ static DRIVER_INIT( paddlema )
static DRIVER_INIT( timesold )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3134,7 +3134,7 @@ static DRIVER_INIT( timesold )
static DRIVER_INIT( timesold1 )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3143,7 +3143,7 @@ static DRIVER_INIT( timesold1 )
static DRIVER_INIT( btlfield )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3152,7 +3152,7 @@ static DRIVER_INIT( btlfield )
static DRIVER_INIT( btlfieldb )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 1;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8); //not checked
@@ -3161,8 +3161,8 @@ static DRIVER_INIT( btlfieldb )
static DRIVER_INIT( skysoldr )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", (machine->region("user1")->base()) + 0x40000);
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", (machine.region("user1")->base()) + 0x40000);
state->invert_controls = 0;
state->microcontroller_id = 0;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3171,7 +3171,7 @@ static DRIVER_INIT( skysoldr )
static DRIVER_INIT( goldmedl )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //AT
state->coin_id = 0x23 | (0x24 << 8);
@@ -3180,8 +3180,8 @@ static DRIVER_INIT( goldmedl )
static DRIVER_INIT( goldmedla )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", machine->region("maincpu")->base() + 0x20000);
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", machine.region("maincpu")->base() + 0x20000);
state->invert_controls = 0;
state->microcontroller_id = 0x8803; //Guess - routine to handle coinage is the same as in 'goldmedl'
state->coin_id = 0x23 | (0x24 << 8);
@@ -3190,7 +3190,7 @@ static DRIVER_INIT( goldmedla )
static DRIVER_INIT( skyadvnt )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8814;
state->coin_id = 0x22 | (0x22 << 8);
@@ -3199,7 +3199,7 @@ static DRIVER_INIT( skyadvnt )
static DRIVER_INIT( skyadvntu )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x8814;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3208,8 +3208,8 @@ static DRIVER_INIT( skyadvntu )
static DRIVER_INIT( gangwarsu )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", machine->region("user1")->base());
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", machine.region("user1")->base());
state->invert_controls = 0;
state->microcontroller_id = 0x8512;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3218,8 +3218,8 @@ static DRIVER_INIT( gangwarsu )
static DRIVER_INIT( gangwars )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- memory_set_bankptr(machine, "bank8", machine->region("user1")->base());
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ memory_set_bankptr(machine, "bank8", machine.region("user1")->base());
state->invert_controls = 0;
state->microcontroller_id = 0x8512;
state->coin_id = 0x23 | (0x24 << 8);
@@ -3228,8 +3228,8 @@ static DRIVER_INIT( gangwars )
static DRIVER_INIT( sbasebal )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
/* Patch protection check, it does a divide by zero because the MCU is trying to
calculate the ball speed when a strike is scored, notice that current emulation
@@ -3258,7 +3258,7 @@ static DRIVER_INIT( sbasebal )
static DRIVER_INIT( tnextspc )
{
- alpha68k_state *state = machine->driver_data<alpha68k_state>();
+ alpha68k_state *state = machine.driver_data<alpha68k_state>();
state->invert_controls = 0;
state->microcontroller_id = 0x890a;
state->coin_id = 0; // Not needed !
diff --git a/src/mame/drivers/ambush.c b/src/mame/drivers/ambush.c
index 45e800affb7..a423fb341de 100644
--- a/src/mame/drivers/ambush.c
+++ b/src/mame/drivers/ambush.c
@@ -47,13 +47,13 @@
static WRITE8_HANDLER( ambush_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
diff --git a/src/mame/drivers/ampoker2.c b/src/mame/drivers/ampoker2.c
index b3a310904d7..8fc578c721e 100644
--- a/src/mame/drivers/ampoker2.c
+++ b/src/mame/drivers/ampoker2.c
@@ -588,7 +588,7 @@ static WRITE8_HANDLER( ampoker2_watchdog_reset_w )
if (((data >> 3) & 0x01) == 0) /* check for refresh value (0x08) */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
// popmessage("%02x", data);
}
else
@@ -1406,8 +1406,8 @@ ROM_END
static DRIVER_INIT( rabbitpk )
{
- UINT8 *rom = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0;
int i;
@@ -1458,7 +1458,7 @@ static DRIVER_INIT( piccolop )
*/
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* NOP'ing the mortal jump... */
rom[0x154b] = 0x00;
diff --git a/src/mame/drivers/amspdwy.c b/src/mame/drivers/amspdwy.c
index 2faa0a29ad6..cc4cc96c226 100644
--- a/src/mame/drivers/amspdwy.c
+++ b/src/mame/drivers/amspdwy.c
@@ -34,9 +34,9 @@ Sound: YM2151
Or last value when wheel delta = 0
*/
-static UINT8 amspdwy_wheel_r( running_machine *machine, int index )
+static UINT8 amspdwy_wheel_r( running_machine &machine, int index )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
static const char *const portnames[] = { "WHEEL1", "WHEEL2", "AN1", "AN2" };
UINT8 wheel = input_port_read(machine, portnames[2 + index]);
if (wheel != state->wheel_old[index])
@@ -54,22 +54,22 @@ static UINT8 amspdwy_wheel_r( running_machine *machine, int index )
static READ8_HANDLER( amspdwy_wheel_0_r )
{
- return amspdwy_wheel_r(space->machine, 0);
+ return amspdwy_wheel_r(space->machine(), 0);
}
static READ8_HANDLER( amspdwy_wheel_1_r )
{
- return amspdwy_wheel_r(space->machine, 1);
+ return amspdwy_wheel_r(space->machine(), 1);
}
static READ8_DEVICE_HANDLER( amspdwy_sound_r )
{
- return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine, "IN0");
+ return (ym2151_status_port_r(device, 0) & ~ 0x30) | input_port_read(device->machine(), "IN0");
}
static WRITE8_HANDLER( amspdwy_sound_w )
{
- amspdwy_state *state = space->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = space->machine().driver_data<amspdwy_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -94,7 +94,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( amspdwy_port_r )
{
- UINT8 *tracks = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *tracks = space->machine().region("maincpu")->base() + 0x10000;
return tracks[offset];
}
@@ -241,7 +241,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq )
{
- amspdwy_state *state = device->machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = device->machine().driver_data<amspdwy_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -252,9 +252,9 @@ static const ym2151_interface amspdwy_ym2151_interface =
static MACHINE_START( amspdwy )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->wheel_old));
@@ -263,7 +263,7 @@ static MACHINE_START( amspdwy )
static MACHINE_RESET( amspdwy )
{
- amspdwy_state *state = machine->driver_data<amspdwy_state>();
+ amspdwy_state *state = machine.driver_data<amspdwy_state>();
state->flipscreen = 0;
state->wheel_old[0] = 0;
state->wheel_old[1] = 0;
diff --git a/src/mame/drivers/angelkds.c b/src/mame/drivers/angelkds.c
index 91ecf2dfb8a..0f7743d8306 100644
--- a/src/mame/drivers/angelkds.c
+++ b/src/mame/drivers/angelkds.c
@@ -141,7 +141,7 @@ static WRITE8_HANDLER( angelkds_sub_sound_w );
static WRITE8_HANDLER( angelkds_cpu_bank_write )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)?
+ memory_set_bank(space->machine(), "bank1", data & 0x0f); // shall we check (data & 0x0f) < # of available banks (8 or 10 resp.)?
}
@@ -161,9 +161,9 @@ static READ8_HANDLER( angelkds_input_r )
static const char *const portnames[] = { "I81", "I82" };
static const char *const fakenames[] = { "FAKE1", "FAKE2" };
- fake = input_port_read(space->machine, fakenames[offset]);
+ fake = input_port_read(space->machine(), fakenames[offset]);
- return ((fake & 0x01) ? fake : input_port_read(space->machine, portnames[offset]));
+ return ((fake & 0x01) ? fake : input_port_read(space->machine(), portnames[offset]));
}
#else
@@ -172,7 +172,7 @@ static READ8_HANDLER( angelkds_input_r )
{
static const char *const portnames[] = { "I81", "I82" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
#endif
@@ -489,32 +489,32 @@ sound related ?
static WRITE8_HANDLER( angelkds_main_sound_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->sound[offset] = data;
}
static READ8_HANDLER( angelkds_main_sound_r )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
return state->sound2[offset];
}
static WRITE8_HANDLER( angelkds_sub_sound_w )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
state->sound2[offset] = data;
}
static READ8_HANDLER( angelkds_sub_sound_r )
{
- angelkds_state *state = space->machine->driver_data<angelkds_state>();
+ angelkds_state *state = space->machine().driver_data<angelkds_state>();
return state->sound[offset];
}
static void irqhandler( device_t *device, int irq )
{
- angelkds_state *state = device->machine->driver_data<angelkds_state>();
+ angelkds_state *state = device->machine().driver_data<angelkds_state>();
device_set_input_line(state->subcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -575,9 +575,9 @@ GFXDECODE_END
static MACHINE_START( angelkds )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->layer_ctrl));
state->save_item(NAME(state->txbank));
@@ -589,7 +589,7 @@ static MACHINE_START( angelkds )
static MACHINE_RESET( angelkds )
{
- angelkds_state *state = machine->driver_data<angelkds_state>();
+ angelkds_state *state = machine.driver_data<angelkds_state>();
int i;
for (i = 0; i < 4; i++)
@@ -750,13 +750,13 @@ ROM_END
static DRIVER_INIT( angelkds )
{
- UINT8 *RAM = machine->region("user1")->base();
+ UINT8 *RAM = machine.region("user1")->base();
memory_configure_bank(machine, "bank1", 0, 8, &RAM[0x0000], 0x4000);
}
static DRIVER_INIT( spcpostn )
{
- UINT8 *RAM = machine->region("user1")->base();
+ UINT8 *RAM = machine.region("user1")->base();
sega_317_0005_decode(machine, "maincpu");
memory_configure_bank(machine, "bank1", 0, 10, &RAM[0x0000], 0x4000);
diff --git a/src/mame/drivers/appoooh.c b/src/mame/drivers/appoooh.c
index ef6f0ff2fbd..830788948e2 100644
--- a/src/mame/drivers/appoooh.c
+++ b/src/mame/drivers/appoooh.c
@@ -171,13 +171,13 @@ Language
static void appoooh_adpcm_int(device_t *device)
{
- appoooh_state *state = device->machine->driver_data<appoooh_state>();
+ appoooh_state *state = device->machine().driver_data<appoooh_state>();
if (state->adpcm_address != 0xffffffff)
{
if (state->adpcm_data == 0xffffffff)
{
- UINT8 *RAM = device->machine->region("adpcm")->base();
+ UINT8 *RAM = device->machine().region("adpcm")->base();
state->adpcm_data = RAM[state->adpcm_address++];
msm5205_data_w(device, state->adpcm_data >> 4);
@@ -199,7 +199,7 @@ static void appoooh_adpcm_int(device_t *device)
/* adpcm address write */
static WRITE8_HANDLER( appoooh_adpcm_w )
{
- appoooh_state *state = space->machine->driver_data<appoooh_state>();
+ appoooh_state *state = space->machine().driver_data<appoooh_state>();
state->adpcm_address = data << 8;
msm5205_reset_w(state->adpcm, 0);
@@ -402,9 +402,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( appoooh )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
- state->adpcm = machine->device("msm");
+ state->adpcm = machine.device("msm");
state->save_item(NAME(state->adpcm_data));
state->save_item(NAME(state->adpcm_address));
@@ -413,7 +413,7 @@ static MACHINE_START( appoooh )
static MACHINE_RESET( appoooh )
{
- appoooh_state *state = machine->driver_data<appoooh_state>();
+ appoooh_state *state = machine.driver_data<appoooh_state>();
state->adpcm_address = 0xffffffff;
state->adpcm_data = 0;
@@ -598,8 +598,8 @@ static DRIVER_INIT(robowres)
static DRIVER_INIT(robowresb)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x1c000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x1c000);
}
diff --git a/src/mame/drivers/aquarium.c b/src/mame/drivers/aquarium.c
index c4734b5d432..89e0d0f0014 100644
--- a/src/mame/drivers/aquarium.c
+++ b/src/mame/drivers/aquarium.c
@@ -62,7 +62,7 @@ Stephh's notes (based on the game M68000 code and some tests) :
#if AQUARIUS_HACK
static MACHINE_RESET( aquarium_hack )
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
int data = input_port_read(machine, "FAKE");
/* Language : 0x0000 = Japanese - Other value = English */
@@ -74,10 +74,10 @@ static MACHINE_RESET( aquarium_hack )
static READ16_HANDLER( aquarium_coins_r )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
int data;
- data = (input_port_read(space->machine, "SYSTEM") & 0x7fff);
+ data = (input_port_read(space->machine(), "SYSTEM") & 0x7fff);
data |= state->aquarium_snd_ack;
state->aquarium_snd_ack = 0;
@@ -86,14 +86,14 @@ static READ16_HANDLER( aquarium_coins_r )
static WRITE8_HANDLER( aquarium_snd_ack_w )
{
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
state->aquarium_snd_ack = 0x8000;
}
static WRITE16_HANDLER( aquarium_sound_w )
{
// popmessage("sound write %04x",data);
- aquarium_state *state = space->machine->driver_data<aquarium_state>();
+ aquarium_state *state = space->machine().driver_data<aquarium_state>();
soundlatch_w(space, 1, data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE );
@@ -101,7 +101,7 @@ static WRITE16_HANDLER( aquarium_sound_w )
static WRITE8_HANDLER( aquarium_z80_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static UINT8 aquarium_snd_bitswap( UINT8 scrambled_data )
@@ -122,14 +122,14 @@ static UINT8 aquarium_snd_bitswap( UINT8 scrambled_data )
static READ8_HANDLER( aquarium_oki_r )
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
return aquarium_snd_bitswap(oki->read(*space, offset));
}
static WRITE8_HANDLER( aquarium_oki_w )
{
- logerror("%s:Writing %04x to the OKI M6295\n", space->machine->describe_context(), aquarium_snd_bitswap(data));
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ logerror("%s:Writing %04x to the OKI M6295\n", space->machine().describe_context(), aquarium_snd_bitswap(data));
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->write(*space, offset, (aquarium_snd_bitswap(data)));
}
@@ -279,13 +279,13 @@ static const gfx_layout tilelayout =
static DRIVER_INIT( aquarium )
{
- UINT8 *Z80 = machine->region("audiocpu")->base();
+ UINT8 *Z80 = machine.region("audiocpu")->base();
/* The BG tiles are 5bpp, this rearranges the data from
the roms containing the 1bpp data so we can decode it
correctly */
- UINT8 *DAT2 = machine->region("gfx1")->base() + 0x080000;
- UINT8 *DAT = machine->region("user1")->base();
+ UINT8 *DAT2 = machine.region("gfx1")->base() + 0x080000;
+ UINT8 *DAT = machine.region("user1")->base();
int len = 0x0200000;
for (len = 0; len < 0x020000; len++)
@@ -300,8 +300,8 @@ static DRIVER_INIT( aquarium )
DAT2[len * 4 + 2] |= (DAT[len] & 0x01) << 3;
}
- DAT2 = machine->region("gfx4")->base() + 0x080000;
- DAT = machine->region("user2")->base();
+ DAT2 = machine.region("gfx4")->base() + 0x080000;
+ DAT = machine.region("user2")->base();
for (len = 0; len < 0x020000; len++)
{
@@ -330,7 +330,7 @@ GFXDECODE_END
static void irq_handler( device_t *device, int irq )
{
- aquarium_state *state = device->machine->driver_data<aquarium_state>();
+ aquarium_state *state = device->machine().driver_data<aquarium_state>();
device_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -342,16 +342,16 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( aquarium )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->aquarium_snd_ack));
}
static MACHINE_RESET( aquarium )
{
- aquarium_state *state = machine->driver_data<aquarium_state>();
+ aquarium_state *state = machine.driver_data<aquarium_state>();
state->aquarium_snd_ack = 0;
#if AQUARIUS_HACK
diff --git a/src/mame/drivers/arabian.c b/src/mame/drivers/arabian.c
index ac9b7f64991..8bbc1573c9e 100644
--- a/src/mame/drivers/arabian.c
+++ b/src/mame/drivers/arabian.c
@@ -60,7 +60,7 @@
static WRITE8_DEVICE_HANDLER( ay8910_porta_w )
{
- arabian_state *state = device->machine->driver_data<arabian_state>();
+ arabian_state *state = device->machine().driver_data<arabian_state>();
/*
bit 7 = ENA
@@ -82,12 +82,12 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
bit 0 = coin 1 counter
*/
- cputag_set_input_line(device->machine, "mcu", MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(device->machine, "mcu", INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "mcu", MB88_IRQ_LINE, data & 0x20 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "mcu", INPUT_LINE_RESET, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
/* clock the coin counters */
- coin_counter_w(device->machine, 1, ~data & 0x02);
- coin_counter_w(device->machine, 0, ~data & 0x01);
+ coin_counter_w(device->machine(), 1, ~data & 0x02);
+ coin_counter_w(device->machine(), 0, ~data & 0x01);
}
@@ -100,7 +100,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_portb_w )
static READ8_HANDLER( mcu_port_r_r )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 val = state->mcu_port_r[offset];
@@ -113,7 +113,7 @@ static READ8_HANDLER( mcu_port_r_r )
static WRITE8_HANDLER( mcu_port_r_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
if (offset == 0)
{
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( mcu_port_r_w )
static READ8_HANDLER( mcu_portk_r )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 val = 0xf;
if (~state->mcu_port_r[0] & 1)
@@ -148,7 +148,7 @@ static READ8_HANDLER( mcu_portk_r )
{
if (~sel & (1 << i))
{
- val = input_port_read(space->machine, comnames[i]);
+ val = input_port_read(space->machine(), comnames[i]);
break;
}
}
@@ -159,7 +159,7 @@ static READ8_HANDLER( mcu_portk_r )
static WRITE8_HANDLER( mcu_port_o_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
UINT8 out = data & 0x0f;
if (data & 0x10)
@@ -170,7 +170,7 @@ static WRITE8_HANDLER( mcu_port_o_w )
static WRITE8_HANDLER( mcu_port_p_w )
{
- arabian_state *state = space->machine->driver_data<arabian_state>();
+ arabian_state *state = space->machine().driver_data<arabian_state>();
state->mcu_port_p = data & 0x0f;
}
@@ -348,7 +348,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( arabian )
{
- arabian_state *state = machine->driver_data<arabian_state>();
+ arabian_state *state = machine.driver_data<arabian_state>();
state->save_item(NAME(state->mcu_port_o));
state->save_item(NAME(state->mcu_port_p));
@@ -357,7 +357,7 @@ static MACHINE_START( arabian )
static MACHINE_RESET( arabian )
{
- arabian_state *state = machine->driver_data<arabian_state>();
+ arabian_state *state = machine.driver_data<arabian_state>();
state->video_control = 0;
}
diff --git a/src/mame/drivers/arcadecl.c b/src/mame/drivers/arcadecl.c
index 3f6572b5f2d..5e238c00a94 100644
--- a/src/mame/drivers/arcadecl.c
+++ b/src/mame/drivers/arcadecl.c
@@ -81,9 +81,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- arcadecl_state *state = machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = machine.driver_data<arcadecl_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -92,7 +92,7 @@ static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
if ((scanline & 32) == 0)
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
@@ -111,11 +111,11 @@ static MACHINE_START( arcadecl )
static MACHINE_RESET( arcadecl )
{
- arcadecl_state *state = machine->driver_data<arcadecl_state>();
+ arcadecl_state *state = machine.driver_data<arcadecl_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
}
@@ -137,9 +137,9 @@ static WRITE16_HANDLER( latch_w )
/* lower byte being modified? */
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x80) ? 0x40000 : 0x00000);
- atarigen_set_oki6295_vol(space->machine, (data & 0x001f) * 100 / 0x1f);
+ atarigen_set_oki6295_vol(space->machine(), (data & 0x001f) * 100 / 0x1f);
}
}
@@ -398,7 +398,7 @@ ROM_END
static DRIVER_INIT( sparkz )
{
- memset(machine->region("gfx1")->base(), 0, machine->region("gfx1")->bytes());
+ memset(machine.region("gfx1")->base(), 0, machine.region("gfx1")->bytes());
}
diff --git a/src/mame/drivers/arcadia.c b/src/mame/drivers/arcadia.c
index 6e8b8a512f1..76b9fdd20da 100644
--- a/src/mame/drivers/arcadia.c
+++ b/src/mame/drivers/arcadia.c
@@ -100,19 +100,19 @@ static WRITE16_HANDLER( arcadia_multibios_change_game )
static WRITE8_DEVICE_HANDLER( arcadia_cia_0_porta_w )
{
/* switch banks as appropriate */
- memory_set_bank(device->machine, "bank1", data & 1);
+ memory_set_bank(device->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->install_write_bank(0x000000, 0x07ffff, "bank1");
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
- device->machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
+ device->machine().device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x000000, 0x07ffff);
/* bit 2 = Power Led on Amiga */
- set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
+ set_led_status(device->machine(), 0, (data & 2) ? 0 : 1);
}
@@ -137,7 +137,7 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_portb_w )
/* writing a 0 in the low bit clears one of the coins */
if ((data & 1) == 0)
{
- UINT8 *coin_counter = device->machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = device->machine().driver_data<arcadia_state>()->coin_counter;
if (coin_counter[0] > 0)
coin_counter[0]--;
@@ -157,7 +157,7 @@ static WRITE8_DEVICE_HANDLER( arcadia_cia_0_portb_w )
static CUSTOM_INPUT( coin_counter_r )
{
int coin = (FPTR)param;
- UINT8 *coin_counter = field->port->machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = field->port->machine().driver_data<arcadia_state>()->coin_counter;
/* return coin counter values */
return coin_counter[coin] & 3;
@@ -167,7 +167,7 @@ static CUSTOM_INPUT( coin_counter_r )
static INPUT_CHANGED( coin_changed_callback )
{
int coin = (FPTR)param;
- UINT8 *coin_counter = field->port->machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = field->port->machine().driver_data<arcadia_state>()->coin_counter;
/* check for a 0 -> 1 transition */
if (!oldval && newval && coin_counter[coin] < 3)
@@ -175,9 +175,9 @@ static INPUT_CHANGED( coin_changed_callback )
}
-static void arcadia_reset_coins(running_machine *machine)
+static void arcadia_reset_coins(running_machine &machine)
{
- UINT8 *coin_counter = machine->driver_data<arcadia_state>()->coin_counter;
+ UINT8 *coin_counter = machine.driver_data<arcadia_state>()->coin_counter;
/* reset coin counters */
coin_counter[0] = coin_counter[1] = 0;
@@ -726,9 +726,9 @@ ROM_END
*
*************************************/
-INLINE void generic_decode(running_machine *machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
+INLINE void generic_decode(running_machine &machine, const char *tag, int bit7, int bit6, int bit5, int bit4, int bit3, int bit2, int bit1, int bit0)
{
- UINT16 *rom = (UINT16 *)machine->region(tag)->base();
+ UINT16 *rom = (UINT16 *)machine.region(tag)->base();
int i;
/* only the low byte of ROMs are encrypted in these games */
@@ -737,12 +737,12 @@ INLINE void generic_decode(running_machine *machine, const char *tag, int bit7,
#if 0
{
- UINT8 *ROM = machine->region(tag)->base();
- int size = machine->region(tag)->bytes();
+ UINT8 *ROM = machine.region(tag)->base();
+ int size = machine.region(tag)->bytes();
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -761,9 +761,9 @@ INLINE void generic_decode(running_machine *machine, const char *tag, int bit7,
*
*************************************/
-static void arcadia_init(running_machine *machine)
+static void arcadia_init(running_machine &machine)
{
- arcadia_state *state = machine->driver_data<arcadia_state>();
+ arcadia_state *state = machine.driver_data<arcadia_state>();
static const amiga_machine_interface arcadia_intf =
{
ANGUS_CHIP_RAM_MASK,
@@ -780,10 +780,10 @@ static void arcadia_init(running_machine *machine)
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
/* OnePlay bios is encrypted, TenPlay is not */
- biosrom = (UINT16 *)machine->region("user2")->base();
+ biosrom = (UINT16 *)machine.region("user2")->base();
if (biosrom[0] != 0x4afc)
generic_decode(machine, "user2", 6, 1, 0, 2, 3, 4, 5, 7);
}
diff --git a/src/mame/drivers/argus.c b/src/mame/drivers/argus.c
index faaf72990ff..e6a084ce297 100644
--- a/src/mame/drivers/argus.c
+++ b/src/mame/drivers/argus.c
@@ -143,7 +143,7 @@ static INTERRUPT_GEN( argus_interrupt )
/* Handler called by the YM2203 emulator when the internal timers cause an IRQ */
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_config =
@@ -165,11 +165,11 @@ static const ym2203_interface ym2203_config =
static WRITE8_HANDLER( argus_bankselect_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
int bankaddress;
bankaddress = 0x10000 + ((data & 7) * 0x4000);
- memory_set_bankptr(space->machine, "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
+ memory_set_bankptr(space->machine(), "bank1", &RAM[bankaddress]); /* Select 8 banks of 16k */
}
diff --git a/src/mame/drivers/aristmk4.c b/src/mame/drivers/aristmk4.c
index 0e396a73e63..03c1c7a6751 100644
--- a/src/mame/drivers/aristmk4.c
+++ b/src/mame/drivers/aristmk4.c
@@ -224,15 +224,15 @@ static const UINT8 cashcade_p[] ={0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
static VIDEO_START(aristmk4)
{
int tile;
- for (tile = 0; tile < machine->gfx[0]->total_elements; tile++)
+ for (tile = 0; tile < machine.gfx[0]->total_elements; tile++)
{
- gfx_element_decode(machine->gfx[0], tile);
+ gfx_element_decode(machine.gfx[0], tile);
}
}
-INLINE void uBackgroundColour(running_machine *machine)
+INLINE void uBackgroundColour(running_machine &machine)
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
/* SW7 can be set when the main door is open, this allows the colours for the background
to be adjusted whilst the machine is running.
@@ -266,8 +266,8 @@ INLINE void uBackgroundColour(running_machine *machine)
static SCREEN_UPDATE(aristmk4)
{
- aristmk4_state *state = screen->machine->driver_data<aristmk4_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ aristmk4_state *state = screen->machine().driver_data<aristmk4_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int x,y;
int count = 0;
int color;
@@ -283,7 +283,7 @@ static SCREEN_UPDATE(aristmk4)
color = ((state->mkiv_vram[count]) & 0xe0) >> 5;
tile = (state->mkiv_vram[count+1]|state->mkiv_vram[count]<<8) & 0x3ff;
bgtile = (state->mkiv_vram[count+1]|state->mkiv_vram[count]<<8) & 0xff; // first 256 tiles
- uBackgroundColour(screen->machine); // read sw7
+ uBackgroundColour(screen->machine()); // read sw7
gfx_element_decode(gfx, bgtile); // force the machine to update only the first 256 tiles.
// as we only update the background, not the entire display.
flipx = ((state->mkiv_vram[count]) & 0x04);
@@ -297,19 +297,19 @@ static SCREEN_UPDATE(aristmk4)
static READ8_HANDLER(ldsw)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
- int U3_p2_ret= input_port_read(space->machine, "5002");
+ int U3_p2_ret= input_port_read(space->machine(), "5002");
if(U3_p2_ret & 0x1)
{
return 0;
}
- return state->cgdrsw = input_port_read(space->machine, "CGDRSW");
+ return state->cgdrsw = input_port_read(space->machine(), "CGDRSW");
}
static READ8_HANDLER(cgdrr)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
if(state->cgdrsw) // is the LC closed
{
@@ -320,7 +320,7 @@ static READ8_HANDLER(cgdrr)
static WRITE8_HANDLER(cgdrw)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
state->ripple = data;
@@ -328,7 +328,7 @@ static WRITE8_HANDLER(cgdrw)
static WRITE8_HANDLER(u3_p0)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
state->u3_p0_w = data;
//logerror("u3_p0_w: %02X\n",state->u3_p0_w);
@@ -337,10 +337,10 @@ static WRITE8_HANDLER(u3_p0)
static READ8_HANDLER(u3_p2)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
- int u3_p2_ret= input_port_read(space->machine, "5002");
- int u3_p3_ret= input_port_read(space->machine, "5003");
+ int u3_p2_ret= input_port_read(space->machine(), "5002");
+ int u3_p3_ret= input_port_read(space->machine(), "5003");
output_set_lamp_value(19, (u3_p2_ret >> 4) & 1); //auditkey light
output_set_lamp_value(20, (u3_p3_ret >> 2) & 1); //jackpotkey light
@@ -353,7 +353,7 @@ static READ8_HANDLER(u3_p2)
if (state->inscrd==0)
{
- state->inscrd=input_port_read(space->machine, "insertcoin");
+ state->inscrd=input_port_read(space->machine(), "insertcoin");
}
if (state->inscrd==1)
@@ -391,7 +391,7 @@ static READ8_HANDLER(mkiv_pia_ina)
{
/* uncomment this code once RTC is fixed */
- //return space->machine->device<mc146818_device>("rtc")->read(*space,1);
+ //return space->machine().device<mc146818_device>("rtc")->read(*space,1);
return 0; // OK for now, the aussie version has no RTC on the MB so this is valid.
}
@@ -399,8 +399,8 @@ static READ8_HANDLER(mkiv_pia_ina)
static WRITE8_HANDLER(mkiv_pia_outa)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
- mc146818_device *mc = space->machine->device<mc146818_device>("rtc");
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
+ mc146818_device *mc = space->machine().device<mc146818_device>("rtc");
if(state->rtc_data_strobe)
{
mc->write(*space,1,data);
@@ -419,7 +419,7 @@ static WRITE8_HANDLER(mkiv_pia_outa)
//output ca2
static WRITE8_DEVICE_HANDLER(mkiv_pia_ca2)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
state->rtc_address_strobe = data;
// logerror("address strobe %02X\n", address_strobe);
}
@@ -428,7 +428,7 @@ static WRITE8_DEVICE_HANDLER(mkiv_pia_ca2)
//output cb2
static WRITE8_DEVICE_HANDLER(mkiv_pia_cb2)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
state->rtc_data_strobe = data;
//logerror("data strobe: %02X\n", data);
}
@@ -438,7 +438,7 @@ static WRITE8_DEVICE_HANDLER(mkiv_pia_cb2)
//output b
static WRITE8_DEVICE_HANDLER(mkiv_pia_outb)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
UINT8 emet[5];
int i = 0;
@@ -489,7 +489,7 @@ VERSATILE INTERFACE ADAPTER CONFIGURATION
static TIMER_CALLBACK(coin_input_reset)
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
state->inscrd=0; //reset credit input after 150msec
@@ -497,7 +497,7 @@ static TIMER_CALLBACK(coin_input_reset)
static TIMER_CALLBACK(hopper_reset)
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
state->hopper_motor=0x01;
@@ -508,18 +508,18 @@ static TIMER_CALLBACK(hopper_reset)
static READ8_DEVICE_HANDLER(via_a_r)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
int psg_ret=0;
if (state->ay8910_1&0x03) // SW1 read.
{
- psg_ret = ay8910_r(device->machine->device("ay1"), 0);
+ psg_ret = ay8910_r(device->machine().device("ay1"), 0);
//logerror("PSG porta ay1 returned %02X\n",psg_ret);
}
else if (state->ay8910_2&0x03) //i don't think we read anything from Port A on ay2, Can be removed once game works ok.
{
- psg_ret = ay8910_r(device->machine->device("ay2"), 0);
+ psg_ret = ay8910_r(device->machine().device("ay2"), 0);
//logerror("PSG porta ay2 returned %02X\n",psg_ret);
}
return psg_ret;
@@ -529,9 +529,9 @@ static READ8_DEVICE_HANDLER(via_a_r)
static READ8_DEVICE_HANDLER(via_b_r)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
- int ret=input_port_read(device->machine, "via_port_b");
+ int ret=input_port_read(device->machine(), "via_port_b");
// Not expecting to read anything from port B on the AY8910's ( controls BC1, BC2 and BDIR )
// However there are extra 4 bits not going to the AY8910's on the schematics, which get read from here.
@@ -556,7 +556,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
case 0x02:
ret=ret^0x20;
state->inscrd++;
- device->machine->scheduler().timer_set(attotime::from_msec(150), FUNC(coin_input_reset));
+ device->machine().scheduler().timer_set(attotime::from_msec(150), FUNC(coin_input_reset));
break;
default:
@@ -570,7 +570,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
{
case 0x00:
ret=ret^0x40;
- device->machine->scheduler().timer_set(attotime::from_msec(175), FUNC(hopper_reset));
+ device->machine().scheduler().timer_set(attotime::from_msec(175), FUNC(hopper_reset));
state->hopper_motor=0x02;
break;
case 0x01:
@@ -587,7 +587,7 @@ static READ8_DEVICE_HANDLER(via_b_r)
static WRITE8_DEVICE_HANDLER(via_a_w)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>(); //via_b_w will handle sending the data to the ay8910, so just write the data for it to use later
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>(); //via_b_w will handle sending the data to the ay8910, so just write the data for it to use later
//logerror("VIA port A write %02X\n",data);
state->psg_data = data;
@@ -596,7 +596,7 @@ static WRITE8_DEVICE_HANDLER(via_a_w)
static WRITE8_DEVICE_HANDLER(via_b_w)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
state->ay8910_1 = ( data & 0x0F ) ; //only need first 4 bits per schematics
//NOTE: when bit 4 is off, we write to AY1, when bit 4 is on, we write to AY2
state->ay8910_2 = state->ay8910_1;
@@ -629,14 +629,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w)
case 0x06: //WRITE
{
- ay8910_data_w( device->machine->device("ay1"), 0 , state->psg_data );
+ ay8910_data_w( device->machine().device("ay1"), 0 , state->psg_data );
//logerror("VIA Port A write data ay1: %02X\n",state->psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
- ay8910_address_w( device->machine->device("ay1"), 0 , state->psg_data );
+ ay8910_address_w( device->machine().device("ay1"), 0 , state->psg_data );
//logerror("VIA Port B write register ay1: %02X\n",state->psg_data);
break;
}
@@ -662,14 +662,14 @@ static WRITE8_DEVICE_HANDLER(via_b_w)
case 0x06: //WRITE
{
- ay8910_data_w( device->machine->device("ay2"), 0 , state->psg_data );
+ ay8910_data_w( device->machine().device("ay2"), 0 , state->psg_data );
//logerror("VIA Port A write data ay2: %02X\n",state->psg_data);
break;
}
case 0x07: //LATCH Address (set register)
{
- ay8910_address_w( device->machine->device("ay2"), 0 , state->psg_data );
+ ay8910_address_w( device->machine().device("ay2"), 0 , state->psg_data );
//logerror("VIA Port B write register ay2: %02X\n",state->psg_data);
break;
}
@@ -709,7 +709,7 @@ static WRITE8_DEVICE_HANDLER(via_ca2_w)
static WRITE8_DEVICE_HANDLER(via_cb2_w)
{
- aristmk4_state *state = device->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = device->machine().driver_data<aristmk4_state>();
// CB2 = hopper motor (HOPMO1). When it is 0x01, it is not running (active low)
// when it goes to 0, we're expecting to coins to be paid out, handled in via_b_r
// as soon as it is 1, HOPCO1 to remain 'ON'
@@ -771,7 +771,7 @@ static WRITE8_DEVICE_HANDLER(zn434_w)
static READ8_HANDLER(cashcade_r)
{
- aristmk4_state *state = space->machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = space->machine().driver_data<aristmk4_state>();
/* work around for cashcade games */
return cashcade_p[(state->cashcade_c++)%15];
}
@@ -1330,7 +1330,7 @@ static const ay8910_interface ay8910_config2 =
static WRITE8_DEVICE_HANDLER(firq)
{
- cputag_set_input_line(device->machine, "maincpu", M6809_FIRQ_LINE, data ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_FIRQ_LINE, data ? ASSERT_LINE : CLEAR_LINE);
}
static const via6522_interface via_interface =
@@ -1381,12 +1381,12 @@ static const mc6845_interface mc6845_intf =
static READ8_DEVICE_HANDLER(pa1_r)
{
- return (input_port_read(device->machine, "SW3") << 4) + input_port_read(device->machine, "SW4");
+ return (input_port_read(device->machine(), "SW3") << 4) + input_port_read(device->machine(), "SW4");
}
static READ8_DEVICE_HANDLER(pb1_r)
{
- return (input_port_read(device->machine, "SW5") << 4) + input_port_read(device->machine, "SW6");
+ return (input_port_read(device->machine(), "SW5") << 4) + input_port_read(device->machine(), "SW6");
}
static READ8_DEVICE_HANDLER(pc1_r)
@@ -1409,7 +1409,7 @@ static PALETTE_INIT( aristmk4 )
{
int i;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0,bit1,bit2,r,g,b;
@@ -1434,17 +1434,17 @@ static PALETTE_INIT( aristmk4 )
static DRIVER_INIT( aristmk4 )
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
- state->shapeRomPtr = (UINT8 *)machine->region("tile_gfx")->base();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
+ state->shapeRomPtr = (UINT8 *)machine.region("tile_gfx")->base();
memcpy(state->shapeRom,state->shapeRomPtr,sizeof(state->shapeRom)); // back up
state->nvram = auto_alloc_array(machine, UINT8, 0x1000);
}
static MACHINE_START( aristmk4 )
{
- aristmk4_state *state = machine->driver_data<aristmk4_state>();
+ aristmk4_state *state = machine.driver_data<aristmk4_state>();
- state->samples = machine->device("samples");
+ state->samples = machine.device("samples");
state_save_register_global_pointer(machine, state->nvram, 0x1000); // state->nvram
}
@@ -1455,10 +1455,10 @@ static MACHINE_RESET( aristmk4 )
switch(input_port_read(machine, "LK13")) // cpu speed control... 3mhz or 1.5mhz
{
case 0x00:
- machine->device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 Mhz
+ machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/4); // 3 Mhz
break;
case 0x10:
- machine->device("maincpu")->set_unscaled_clock(MAIN_CLOCK/8); // 1.5 Mhz
+ machine.device("maincpu")->set_unscaled_clock(MAIN_CLOCK/8); // 1.5 Mhz
break;
}
@@ -1483,9 +1483,9 @@ static TIMER_DEVICE_CALLBACK( aristmk4_pf )
*/
- if(input_port_read(timer.machine, "powerfail")) // send NMI signal if L pressed
+ if(input_port_read(timer.machine(), "powerfail")) // send NMI signal if L pressed
{
- cputag_set_input_line( timer.machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
+ cputag_set_input_line( timer.machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE );
}
}
diff --git a/src/mame/drivers/aristmk5.c b/src/mame/drivers/aristmk5.c
index 04b57e1507c..24e59d75492 100644
--- a/src/mame/drivers/aristmk5.c
+++ b/src/mame/drivers/aristmk5.c
@@ -79,14 +79,14 @@ public:
static WRITE32_HANDLER( mk5_ext_latch_w )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
/* this banks "something" */
state->ext_latch = data & 1;
}
static READ32_HANDLER( ext_timer_latch_r )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
/* reset 2KHz timer */
ioc_regs[IRQ_STATUS_A] &= 0xfe;
state->mk5_2KHz_timer->adjust(attotime::from_hz(2000));
@@ -97,7 +97,7 @@ static READ32_HANDLER( ext_timer_latch_r )
/* same as plain AA but with the I2C unconnected */
static READ32_HANDLER( mk5_ioc_r )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
UINT32 ioc_addr;
ioc_addr = offset*4;
@@ -108,10 +108,10 @@ static READ32_HANDLER( mk5_ioc_r )
{
int vert_pos;
- vert_pos = space->machine->primary_screen->vpos();
+ vert_pos = space->machine().primary_screen->vpos();
state->flyback = (vert_pos <= vidc_regs[VIDC_VDSR] || vert_pos >= vidc_regs[VIDC_VDER]) ? 0x80 : 0x00;
- //i2c_data = (i2cmem_sda_read(space->machine->device("i2cmem")) & 1);
+ //i2c_data = (i2cmem_sda_read(space->machine().device("i2cmem")) & 1);
return (state->flyback) | (ioc_regs[CONTROL] & 0x7c) | (1<<1) | 1;
}
@@ -121,7 +121,7 @@ static READ32_HANDLER( mk5_ioc_r )
static WRITE32_HANDLER( mk5_ioc_w )
{
- aristmk5_state *state = space->machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = space->machine().driver_data<aristmk5_state>();
UINT32 ioc_addr;
ioc_addr = offset*4;
@@ -186,7 +186,7 @@ static WRITE32_HANDLER( sram_banksel_w )
write: 03010420 00 select bank 0
*/
- memory_set_bank(space->machine,"sram_bank", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(),"sram_bank", (data & 0xc0) >> 6);
}
static ADDRESS_MAP_START( aristmk5_map, AS_PROGRAM, 32 )
@@ -225,7 +225,7 @@ INPUT_PORTS_END
static DRIVER_INIT( aristmk5 )
{
- UINT8 *SRAM = machine->region("sram")->base();
+ UINT8 *SRAM = machine.region("sram")->base();
archimedes_driver_init(machine);
memory_configure_bank(machine, "sram_bank", 0, 4, &SRAM[0], 0x8000);
@@ -233,7 +233,7 @@ static DRIVER_INIT( aristmk5 )
static TIMER_CALLBACK( mk5_2KHz_callback )
{
- aristmk5_state *state = machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = machine.driver_data<aristmk5_state>();
ioc_regs[IRQ_STATUS_A] |= 1;
state->mk5_2KHz_timer->adjust(attotime::never);
@@ -241,18 +241,18 @@ static TIMER_CALLBACK( mk5_2KHz_callback )
static MACHINE_START( aristmk5 )
{
- aristmk5_state *state = machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = machine.driver_data<aristmk5_state>();
archimedes_init(machine);
// reset the DAC to centerline
- //dac_signed_data_w(machine->device("dac"), 0x80);
+ //dac_signed_data_w(machine.device("dac"), 0x80);
- state->mk5_2KHz_timer = machine->scheduler().timer_alloc(FUNC(mk5_2KHz_callback));
+ state->mk5_2KHz_timer = machine.scheduler().timer_alloc(FUNC(mk5_2KHz_callback));
}
static MACHINE_RESET( aristmk5 )
{
- aristmk5_state *state = machine->driver_data<aristmk5_state>();
+ aristmk5_state *state = machine.driver_data<aristmk5_state>();
archimedes_reset(machine);
state->mk5_2KHz_timer->adjust(attotime::from_hz(2000));
@@ -260,15 +260,15 @@ static MACHINE_RESET( aristmk5 )
/* load the roms according to what the operator wants */
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *PRG;// = machine->region("prg_code")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *PRG;// = machine.region("prg_code")->base();
int i;
UINT8 op_mode;
static const char *const rom_region[] = { "set_chip_4.04", "set_chip_4.4", "game_prg", "game_prg" };
op_mode = input_port_read(machine, "ROM_LOAD");
- PRG = machine->region(rom_region[op_mode & 3])->base();
+ PRG = machine.region(rom_region[op_mode & 3])->base();
for(i=0;i<0x300000;i++)
ROM[i] = PRG[i];
diff --git a/src/mame/drivers/arkanoid.c b/src/mame/drivers/arkanoid.c
index 668deed3cdd..9ae6939566a 100644
--- a/src/mame/drivers/arkanoid.c
+++ b/src/mame/drivers/arkanoid.c
@@ -914,9 +914,9 @@ static const ay8910_interface hexa_ay8910_config =
static MACHINE_START( arkanoid )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
- state->mcu = machine->device("mcu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->bootleg_cmd));
@@ -939,7 +939,7 @@ static MACHINE_START( arkanoid )
static MACHINE_RESET( arkanoid )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->port_a_in = 0;
state->port_a_out = 0;
@@ -1444,34 +1444,34 @@ ROM_END
/* Driver Initialization */
-static void arkanoid_bootleg_init( running_machine *machine )
+static void arkanoid_bootleg_init( running_machine &machine )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf000, 0xf000, FUNC(arkanoid_bootleg_f000_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf002, 0xf002, FUNC(arkanoid_bootleg_f002_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd018, 0xd018, FUNC(arkanoid_bootleg_d018_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd008, 0xd008, FUNC(arkanoid_bootleg_d008_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf000, 0xf000, FUNC(arkanoid_bootleg_f000_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf002, 0xf002, FUNC(arkanoid_bootleg_f002_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd018, 0xd018, FUNC(arkanoid_bootleg_d018_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd008, 0xd008, FUNC(arkanoid_bootleg_d008_r) );
}
static DRIVER_INIT( arkangc )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKANGC;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkangc2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKANGC2;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( block2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
// the graphics on this bootleg have the data scrambled
int tile;
- UINT8* srcgfx = machine->region("gfx1")->base();
+ UINT8* srcgfx = machine.region("gfx1")->base();
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x18000);
for (tile = 0; tile < 0x3000; tile++)
@@ -1504,28 +1504,28 @@ static DRIVER_INIT( block2 )
static DRIVER_INIT( arkblock )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKBLOCK;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkbloc2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKBLOC2;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( arkgcbl )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = ARKGCBL;
arkanoid_bootleg_init(machine);
}
static DRIVER_INIT( paddle2 )
{
- arkanoid_state *state = machine->driver_data<arkanoid_state>();
+ arkanoid_state *state = machine.driver_data<arkanoid_state>();
state->bootleg_id = PADDLE2;
arkanoid_bootleg_init(machine);
}
@@ -1533,7 +1533,7 @@ static DRIVER_INIT( paddle2 )
static DRIVER_INIT( tetrsark )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int x;
for (x = 0; x < 0x8000; x++)
@@ -1541,13 +1541,13 @@ static DRIVER_INIT( tetrsark )
ROM[x] = ROM[x] ^ 0x94;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd008, 0xd008, FUNC(tetrsark_d008_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd008, 0xd008, FUNC(tetrsark_d008_w) );
}
static DRIVER_INIT( hexa )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
#if 0
diff --git a/src/mame/drivers/armedf.c b/src/mame/drivers/armedf.c
index 5e0c9ac54d0..6d81540535e 100644
--- a/src/mame/drivers/armedf.c
+++ b/src/mame/drivers/armedf.c
@@ -176,22 +176,22 @@ Stephh's notes (based on the games M68000 code and some tests) :
static WRITE16_HANDLER( io_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
}
static WRITE16_HANDLER( terraf_io_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
if ((state->vreg & 0x4000) && !(state->vreg & 0x0100))
{
@@ -209,12 +209,12 @@ static WRITE16_HANDLER( terraf_io_w )
static WRITE16_HANDLER( kodure_io_w )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
/* This is a temporary condition specification. */
if (!(state->vreg & 0x0080))
@@ -242,7 +242,7 @@ static READ8_HANDLER( soundlatch_clear_r )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( legion_command_c )
{
- armedf_state *state = space->machine->driver_data<armedf_state>();
+ armedf_state *state = space->machine().driver_data<armedf_state>();
COMBINE_DATA(&state->legion_cmd[offset]);
//logerror("Legion CMD %04x=%04x", offset, data);
@@ -761,7 +761,7 @@ GFXDECODE_END
static MACHINE_START( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->save_item(NAME(state->mcu_mode));
state->save_item(NAME(state->old_mcu_mode));
@@ -776,7 +776,7 @@ static MACHINE_START( armedf )
static MACHINE_RESET( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->mcu_mode = 0;
state->old_mcu_mode = 0;
@@ -1508,36 +1508,36 @@ ROM_END
static DRIVER_INIT( terraf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 0;
}
static DRIVER_INIT( terrafu )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 5;
}
static DRIVER_INIT( armedf )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 1;
}
static DRIVER_INIT( kodure )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 2;
}
static DRIVER_INIT( legion )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x0001d6 / 2] = 0x0001;
/* To avoid checksum error */
RAM[0x000488 / 2] = 0x4e71;
@@ -1548,11 +1548,11 @@ static DRIVER_INIT( legion )
static DRIVER_INIT( legiono )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
#if LEGION_HACK
/* This is a hack to allow you to use the extra features
of 3 of the "Unused" Dip Switches (see notes above). */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x0001d6/2] = 0x0001;
/* No need to patch the checksum routine (see notes) ! */
#endif
@@ -1562,7 +1562,7 @@ static DRIVER_INIT( legiono )
static DRIVER_INIT( cclimbr2 )
{
- armedf_state *state = machine->driver_data<armedf_state>();
+ armedf_state *state = machine.driver_data<armedf_state>();
state->scroll_type = 4;
}
diff --git a/src/mame/drivers/artmagic.c b/src/mame/drivers/artmagic.c
index a22db8b3c76..46b45bf81a2 100644
--- a/src/mame/drivers/artmagic.c
+++ b/src/mame/drivers/artmagic.c
@@ -42,9 +42,9 @@
*
*************************************/
-static void update_irq_state(running_machine *machine)
+static void update_irq_state(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
cputag_set_input_line(machine, "maincpu", 4, state->tms_irq ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->hack_irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -52,9 +52,9 @@ static void update_irq_state(running_machine *machine)
static void m68k_gen_int(device_t *device, int state)
{
- artmagic_state *drvstate = device->machine->driver_data<artmagic_state>();
+ artmagic_state *drvstate = device->machine().driver_data<artmagic_state>();
drvstate->tms_irq = state;
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
@@ -67,7 +67,7 @@ static void m68k_gen_int(device_t *device, int state)
static MACHINE_START( artmagic )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
state_save_register_global(machine, state->tms_irq);
state_save_register_global(machine, state->hack_irq);
state_save_register_global(machine, state->prot_input_index);
@@ -81,7 +81,7 @@ static MACHINE_START( artmagic )
static MACHINE_RESET( artmagic )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
state->tms_irq = state->hack_irq = 0;
update_irq_state(machine);
}
@@ -96,13 +96,13 @@ static MACHINE_RESET( artmagic )
static READ16_HANDLER( tms_host_r )
{
- return tms34010_host_r(space->machine->device("tms"), offset);
+ return tms34010_host_r(space->machine().device("tms"), offset);
}
static WRITE16_HANDLER( tms_host_w )
{
- tms34010_host_w(space->machine->device("tms"), offset, data);
+ tms34010_host_w(space->machine().device("tms"), offset, data);
}
@@ -115,13 +115,13 @@ static WRITE16_HANDLER( tms_host_w )
static WRITE16_HANDLER( control_w )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
COMBINE_DATA(&state->control[offset]);
/* OKI banking here */
if (offset == 0)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((((data >> 4) & 1) * 0x40000) % oki->region()->bytes());
}
@@ -138,23 +138,23 @@ static WRITE16_HANDLER( control_w )
static TIMER_CALLBACK( irq_off )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
state->hack_irq = 0;
update_irq_state(machine);
}
static READ16_HANDLER( ultennis_hack_r )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
/* IRQ5 points to: jsr (a5); rte */
UINT32 pc = cpu_get_pc(space->cpu);
if (pc == 0x18c2 || pc == 0x18e4)
{
state->hack_irq = 1;
- update_irq_state(space->machine);
- space->machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
+ update_irq_state(space->machine());
+ space->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
}
- return input_port_read(space->machine, "300000");
+ return input_port_read(space->machine(), "300000");
}
@@ -165,15 +165,15 @@ static READ16_HANDLER( ultennis_hack_r )
*
*************************************/
-static void ultennis_protection(running_machine *machine)
+static void ultennis_protection(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* check the command byte */
switch (state->prot_input[0])
{
case 0x00: /* reset */
state->prot_input_index = state->prot_output_index = 0;
- state->prot_output[0] = machine->rand();
+ state->prot_output[0] = machine.rand();
break;
case 0x01: /* 01 aaaa bbbb cccc dddd (xxxx) */
@@ -256,15 +256,15 @@ static void ultennis_protection(running_machine *machine)
}
-static void cheesech_protection(running_machine *machine)
+static void cheesech_protection(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* check the command byte */
switch (state->prot_input[0])
{
case 0x00: /* reset */
state->prot_input_index = state->prot_output_index = 0;
- state->prot_output[0] = machine->rand();
+ state->prot_output[0] = machine.rand();
break;
case 0x01: /* 01 aaaa bbbb (xxxx) */
@@ -317,9 +317,9 @@ static void cheesech_protection(running_machine *machine)
}
-static void stonebal_protection(running_machine *machine)
+static void stonebal_protection(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* check the command byte */
switch (state->prot_input[0])
{
@@ -387,14 +387,14 @@ static void stonebal_protection(running_machine *machine)
static CUSTOM_INPUT( prot_r )
{
- artmagic_state *state = field->port->machine->driver_data<artmagic_state>();
+ artmagic_state *state = field->port->machine().driver_data<artmagic_state>();
return state->prot_output_bit;
}
static WRITE16_HANDLER( protection_bit_w )
{
- artmagic_state *state = space->machine->driver_data<artmagic_state>();
+ artmagic_state *state = space->machine().driver_data<artmagic_state>();
/* shift in the new bit based on the offset */
state->prot_input[state->prot_input_index] <<= 1;
state->prot_input[state->prot_input_index] |= offset;
@@ -412,7 +412,7 @@ static WRITE16_HANDLER( protection_bit_w )
state->prot_bit_index = 0;
/* update the protection state */
- (*state->protection_handler)(space->machine);
+ (*state->protection_handler)(space->machine());
}
}
@@ -461,7 +461,7 @@ ADDRESS_MAP_END
static READ16_HANDLER(unk_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( shtstar_map, AS_PROGRAM, 16 )
@@ -1130,9 +1130,9 @@ ROM_END
*
*************************************/
-static void decrypt_ultennis(running_machine *machine)
+static void decrypt_ultennis(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
int i;
/* set up the parameters for the blitter data decryption which will happen at runtime */
@@ -1147,9 +1147,9 @@ static void decrypt_ultennis(running_machine *machine)
}
-static void decrypt_cheesech(running_machine *machine)
+static void decrypt_cheesech(running_machine &machine)
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
int i;
/* set up the parameters for the blitter data decryption which will happen at runtime */
@@ -1166,19 +1166,19 @@ static void decrypt_cheesech(running_machine *machine)
static DRIVER_INIT( ultennis )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
decrypt_ultennis(machine);
state->is_stoneball = 0;
state->protection_handler = ultennis_protection;
/* additional (protection?) hack */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x300000, 0x300001, FUNC(ultennis_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x300000, 0x300001, FUNC(ultennis_hack_r));
}
static DRIVER_INIT( cheesech )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
decrypt_cheesech(machine);
state->is_stoneball = 0;
state->protection_handler = cheesech_protection;
@@ -1187,7 +1187,7 @@ static DRIVER_INIT( cheesech )
static DRIVER_INIT( stonebal )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
decrypt_ultennis(machine);
state->is_stoneball = 1; /* blits 1 line high are NOT encrypted, also different first pixel decrypt */
state->protection_handler = stonebal_protection;
@@ -1195,7 +1195,7 @@ static DRIVER_INIT( stonebal )
static DRIVER_INIT( shtstar )
{
- artmagic_state *state = machine->driver_data<artmagic_state>();
+ artmagic_state *state = machine.driver_data<artmagic_state>();
/* wrong */
decrypt_ultennis(machine);
state->is_stoneball =0;
diff --git a/src/mame/drivers/ashnojoe.c b/src/mame/drivers/ashnojoe.c
index f907e7c4b83..b3567819903 100644
--- a/src/mame/drivers/ashnojoe.c
+++ b/src/mame/drivers/ashnojoe.c
@@ -88,7 +88,7 @@ static READ16_HANDLER(fake_4a00a_r)
static WRITE16_HANDLER( ashnojoe_soundlatch_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
if (ACCESSING_BITS_0_7)
{
state->soundlatch_status = 1;
@@ -121,20 +121,20 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( adpcm_w )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->adpcm_byte = data;
}
static READ8_HANDLER( sound_latch_r )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
state->soundlatch_status = 0;
return soundlatch_r(space, 0);
}
static READ8_HANDLER( sound_latch_status_r )
{
- ashnojoe_state *state = space->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = space->machine().driver_data<ashnojoe_state>();
return state->soundlatch_status;
}
@@ -276,7 +276,7 @@ GFXDECODE_END
static void ym2203_irq_handler( device_t *device, int irq )
{
- ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = device->machine().driver_data<ashnojoe_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -291,7 +291,7 @@ static WRITE8_DEVICE_HANDLER( ym2203_write_a )
static WRITE8_DEVICE_HANDLER( ym2203_write_b )
{
- memory_set_bank(device->machine, "bank4", data & 0x0f);
+ memory_set_bank(device->machine(), "bank4", data & 0x0f);
}
static const ym2203_interface ym2203_config =
@@ -309,7 +309,7 @@ static const ym2203_interface ym2203_config =
static void ashnojoe_vclk_cb( device_t *device )
{
- ashnojoe_state *state = device->machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = device->machine().driver_data<ashnojoe_state>();
if (state->msm5205_vclk_toggle == 0)
{
msm5205_data_w(device, state->adpcm_byte >> 4);
@@ -332,9 +332,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( ashnojoe )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->adpcm_byte));
state->save_item(NAME(state->soundlatch_status));
@@ -343,7 +343,7 @@ static MACHINE_START( ashnojoe )
static MACHINE_RESET( ashnojoe )
{
- ashnojoe_state *state = machine->driver_data<ashnojoe_state>();
+ ashnojoe_state *state = machine.driver_data<ashnojoe_state>();
state->adpcm_byte = 0;
state->soundlatch_status = 0;
@@ -467,7 +467,7 @@ ROM_END
static DRIVER_INIT( ashnojoe )
{
- UINT8 *ROM = machine->region("adpcm")->base();
+ UINT8 *ROM = machine.region("adpcm")->base();
memory_configure_bank(machine, "bank4", 0, 16, &ROM[0x00000], 0x8000);
memory_set_bank(machine, "bank4", 0);
diff --git a/src/mame/drivers/asterix.c b/src/mame/drivers/asterix.c
index 2ba276af382..041d466edf9 100644
--- a/src/mame/drivers/asterix.c
+++ b/src/mame/drivers/asterix.c
@@ -33,14 +33,14 @@ static const eeprom_interface eeprom_intf =
#if 0
static READ16_HANDLER( control2_r )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
return state->cur_control2;
}
#endif
static WRITE16_HANDLER( control2_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
if (ACCESSING_BITS_0_7)
{
@@ -48,7 +48,7 @@ static WRITE16_HANDLER( control2_w )
/* bit 0 is data */
/* bit 1 is cs (active low) */
/* bit 2 is clock (active high) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
/* bit 5 is select tile bank */
k056832_set_tile_bank(state->k056832, (data & 0x20) >> 5);
@@ -57,7 +57,7 @@ static WRITE16_HANDLER( control2_w )
static INTERRUPT_GEN( asterix_interrupt )
{
- asterix_state *state = device->machine->driver_data<asterix_state>();
+ asterix_state *state = device->machine().driver_data<asterix_state>();
// global interrupt masking
if (!k056832_is_irq_enabled(state->k056832, 0))
@@ -73,21 +73,21 @@ static READ8_DEVICE_HANDLER( asterix_sound_r )
static TIMER_CALLBACK( nmi_callback )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_arm_nmi_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
- space->machine->scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
+ space->machine().scheduler().timer_set(attotime::from_usec(5), FUNC(nmi_callback));
}
static WRITE16_HANDLER( sound_irq_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -97,7 +97,7 @@ static WRITE16_HANDLER( sound_irq_w )
#if 0
static WRITE16_HANDLER( protection_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
COMBINE_DATA(state->prot + offset);
if (offset == 1)
@@ -136,7 +136,7 @@ static WRITE16_HANDLER( protection_w )
static WRITE16_HANDLER( protection_w )
{
- asterix_state *state = space->machine->driver_data<asterix_state>();
+ asterix_state *state = space->machine().driver_data<asterix_state>();
COMBINE_DATA(state->prot + offset);
if (offset == 1)
@@ -250,14 +250,14 @@ static const k05324x_interface asterix_k05324x_intf =
static MACHINE_START( asterix )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053260 = machine->device("k053260");
- state->k056832 = machine->device("k056832");
- state->k053244 = machine->device("k053244");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053260 = machine.device("k053260");
+ state->k056832 = machine.device("k056832");
+ state->k053244 = machine.device("k053244");
+ state->k053251 = machine.device("k053251");
state->save_item(NAME(state->cur_control2));
state->save_item(NAME(state->prot));
@@ -272,7 +272,7 @@ static MACHINE_START( asterix )
static MACHINE_RESET( asterix )
{
- asterix_state *state = machine->driver_data<asterix_state>();
+ asterix_state *state = machine.driver_data<asterix_state>();
int i;
state->cur_control2 = 0;
@@ -467,8 +467,8 @@ ROM_END
static DRIVER_INIT( asterix )
{
#if 0
- *(UINT16 *)(machine->region("maincpu")->base() + 0x07f34) = 0x602a;
- *(UINT16 *)(machine->region("maincpu")->base() + 0x00008) = 0x0400;
+ *(UINT16 *)(machine.region("maincpu")->base() + 0x07f34) = 0x602a;
+ *(UINT16 *)(machine.region("maincpu")->base() + 0x00008) = 0x0400;
#endif
}
diff --git a/src/mame/drivers/asteroid.c b/src/mame/drivers/asteroid.c
index 5d40efaa74d..168f2b61a5b 100644
--- a/src/mame/drivers/asteroid.c
+++ b/src/mame/drivers/asteroid.c
@@ -204,7 +204,7 @@ There is not a rev 03 known or dumped. An Asteroids rev 03 is not mentioned in a
static WRITE8_HANDLER( astdelux_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
@@ -308,7 +308,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( clock_r )
{
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
static INPUT_PORTS_START( asteroid )
@@ -921,14 +921,14 @@ ROM_END
static DRIVER_INIT( asteroidb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2000, 0x2000, "IN0");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2003, 0x2003, "HS");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2000, 0x2000, "IN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2003, 0x2003, "HS");
}
static DRIVER_INIT( asterock )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2000, 0x2007, FUNC(asterock_IN0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2000, 0x2007, FUNC(asterock_IN0_r));
}
diff --git a/src/mame/drivers/astinvad.c b/src/mame/drivers/astinvad.c
index 8ea7ca741d8..4d35d53fdbd 100644
--- a/src/mame/drivers/astinvad.c
+++ b/src/mame/drivers/astinvad.c
@@ -104,7 +104,7 @@ static const ppi8255_interface ppi8255_intf[2] =
static VIDEO_START( spaceint )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
state->colorram = auto_alloc_array(machine, UINT8, state->videoram_size);
state->save_item(NAME(state->color_latch));
@@ -114,14 +114,14 @@ static VIDEO_START( spaceint )
static WRITE8_HANDLER( color_latch_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
state->color_latch = data & 0x0f;
}
static WRITE8_HANDLER( spaceint_videoram_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
state->videoram[offset] = data;
state->colorram[offset] = state->color_latch;
}
@@ -134,9 +134,9 @@ static WRITE8_HANDLER( spaceint_videoram_w )
*
*************************************/
-static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color )
+static void plot_byte( running_machine &machine, bitmap_t *bitmap, UINT8 y, UINT8 x, UINT8 data, UINT8 color )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
pen_t fore_pen = MAKE_RGB(pal1bit(color >> 0), pal1bit(color >> 2), pal1bit(color >> 1));
UINT8 flip_xor = state->screen_flip & 7;
@@ -153,8 +153,8 @@ static void plot_byte( running_machine *machine, bitmap_t *bitmap, UINT8 y, UINT
static SCREEN_UPDATE( astinvad )
{
- astinvad_state *state = screen->machine->driver_data<astinvad_state>();
- const UINT8 *color_prom = screen->machine->region("proms")->base();
+ astinvad_state *state = screen->machine().driver_data<astinvad_state>();
+ const UINT8 *color_prom = screen->machine().region("proms")->base();
UINT8 yoffs = state->flip_yoffs & state->screen_flip;
int x, y;
@@ -164,7 +164,7 @@ static SCREEN_UPDATE( astinvad )
{
UINT8 color = color_prom[((y & 0xf8) << 2) | (x >> 3)] >> (state->screen_flip ? 0 : 4);
UINT8 data = state->videoram[(((y ^ state->screen_flip) + yoffs) << 5) | ((x ^ state->screen_flip) >> 3)];
- plot_byte(screen->machine, bitmap, y, x, data, state->screen_red ? 1 : color);
+ plot_byte(screen->machine(), bitmap, y, x, data, state->screen_red ? 1 : color);
}
return 0;
@@ -173,8 +173,8 @@ static SCREEN_UPDATE( astinvad )
static SCREEN_UPDATE( spaceint )
{
- astinvad_state *state = screen->machine->driver_data<astinvad_state>();
- const UINT8 *color_prom = screen->machine->region("proms")->base();
+ astinvad_state *state = screen->machine().driver_data<astinvad_state>();
+ const UINT8 *color_prom = screen->machine().region("proms")->base();
int offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -189,7 +189,7 @@ static SCREEN_UPDATE( spaceint )
offs_t n = ((offs >> 5) & 0xf0) | color;
color = color_prom[n] & 0x07;
- plot_byte(screen->machine, bitmap, y, x, data, color);
+ plot_byte(screen->machine(), bitmap, y, x, data, color);
}
return 0;
@@ -205,35 +205,35 @@ static SCREEN_UPDATE( spaceint )
static TIMER_CALLBACK( kamikaze_int_off )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
static TIMER_CALLBACK( kamizake_int_gen )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
/* interrupts are asserted on every state change of the 128V line */
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
param ^= 128;
- state->int_timer->adjust(machine->primary_screen->time_until_pos(param), param);
+ state->int_timer->adjust(machine.primary_screen->time_until_pos(param), param);
/* an RC circuit turns the interrupt off after a short amount of time */
- machine->scheduler().timer_set(attotime::from_double(300 * 0.1e-6), FUNC(kamikaze_int_off));
+ machine.scheduler().timer_set(attotime::from_double(300 * 0.1e-6), FUNC(kamikaze_int_off));
}
static MACHINE_START( kamikaze )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
- state->maincpu = machine->device("maincpu");
- state->ppi8255_0 = machine->device("ppi8255_0");
- state->ppi8255_1 = machine->device("ppi8255_1");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->ppi8255_0 = machine.device("ppi8255_0");
+ state->ppi8255_1 = machine.device("ppi8255_1");
+ state->samples = machine.device("samples");
- state->int_timer = machine->scheduler().timer_alloc(FUNC(kamizake_int_gen));
- state->int_timer->adjust(machine->primary_screen->time_until_pos(128), 128);
+ state->int_timer = machine.scheduler().timer_alloc(FUNC(kamizake_int_gen));
+ state->int_timer->adjust(machine.primary_screen->time_until_pos(128), 128);
state->save_item(NAME(state->screen_flip));
state->save_item(NAME(state->screen_red));
@@ -242,7 +242,7 @@ static MACHINE_START( kamikaze )
static MACHINE_RESET( kamikaze )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
state->screen_flip = 0;
state->screen_red = 0;
@@ -253,10 +253,10 @@ static MACHINE_RESET( kamikaze )
static MACHINE_START( spaceint )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->screen_flip));
state->save_item(NAME(state->sound_state));
@@ -264,7 +264,7 @@ static MACHINE_START( spaceint )
static MACHINE_RESET( spaceint )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
state->screen_flip = 0;
state->sound_state[0] = 0;
@@ -275,7 +275,7 @@ static MACHINE_RESET( spaceint )
static INPUT_CHANGED( spaceint_coin_inserted )
{
- astinvad_state *state = field->port->machine->driver_data<astinvad_state>();
+ astinvad_state *state = field->port->machine().driver_data<astinvad_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@@ -290,7 +290,7 @@ static INPUT_CHANGED( spaceint_coin_inserted )
static READ8_HANDLER( kamikaze_ppi_r )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
UINT8 result = 0xff;
/* the address lines are used for /CS; yes, they can overlap! */
@@ -304,7 +304,7 @@ static READ8_HANDLER( kamikaze_ppi_r )
static WRITE8_HANDLER( kamikaze_ppi_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
/* the address lines are used for /CS; yes, they can overlap! */
if (!(offset & 4))
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( kamikaze_ppi_w )
static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
{
- astinvad_state *state = device->machine->driver_data<astinvad_state>();
+ astinvad_state *state = device->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[0];
state->sound_state[0] = data;
@@ -333,14 +333,14 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound1_w )
if (bits_gone_hi & 0x04) sample_start(state->samples, 2, SND_BASEHIT, 0);
if (bits_gone_hi & 0x08) sample_start(state->samples, 3, SND_INVADERHIT, 0);
- device->machine->sound().system_enable(data & 0x20);
+ device->machine().sound().system_enable(data & 0x20);
state->screen_red = data & 0x04;
}
static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
{
- astinvad_state *state = device->machine->driver_data<astinvad_state>();
+ astinvad_state *state = device->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[1];
state->sound_state[1] = data;
@@ -350,13 +350,13 @@ static WRITE8_DEVICE_HANDLER( astinvad_sound2_w )
if (bits_gone_hi & 0x08) sample_start(state->samples, 5, SND_FLEET4, 0);
if (bits_gone_hi & 0x10) sample_start(state->samples, 4, SND_UFOHIT, 0);
- state->screen_flip = (input_port_read(device->machine, "CABINET") & data & 0x20) ? 0xff : 0x00;
+ state->screen_flip = (input_port_read(device->machine(), "CABINET") & data & 0x20) ? 0xff : 0x00;
}
static WRITE8_HANDLER( spaceint_sound1_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[0];
state->sound_state[0] = data;
@@ -375,15 +375,15 @@ static WRITE8_HANDLER( spaceint_sound1_w )
static WRITE8_HANDLER( spaceint_sound2_w )
{
- astinvad_state *state = space->machine->driver_data<astinvad_state>();
+ astinvad_state *state = space->machine().driver_data<astinvad_state>();
int bits_gone_hi = data & ~state->sound_state[1];
state->sound_state[1] = data;
- space->machine->sound().system_enable(data & 0x02);
+ space->machine().sound().system_enable(data & 0x02);
if (bits_gone_hi & 0x04) sample_start(state->samples, 3, SND_INVADERHIT, 0);
- state->screen_flip = (input_port_read(space->machine, "CABINET") & data & 0x80) ? 0xff : 0x00;
+ state->screen_flip = (input_port_read(space->machine(), "CABINET") & data & 0x80) ? 0xff : 0x00;
}
@@ -743,7 +743,7 @@ ROM_END
static DRIVER_INIT( kamikaze )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
/* the flip screen logic adds 32 to the Y after flipping */
state->flip_yoffs = 32;
@@ -752,7 +752,7 @@ static DRIVER_INIT( kamikaze )
static DRIVER_INIT( spcking2 )
{
- astinvad_state *state = machine->driver_data<astinvad_state>();
+ astinvad_state *state = machine.driver_data<astinvad_state>();
/* don't have the schematics, but the blanking must center the screen here */
state->flip_yoffs = 0;
diff --git a/src/mame/drivers/astrocde.c b/src/mame/drivers/astrocde.c
index a67109fe466..935ef6f09b5 100644
--- a/src/mame/drivers/astrocde.c
+++ b/src/mame/drivers/astrocde.c
@@ -210,7 +210,7 @@ static WRITE8_HANDLER( seawolf2_lamps_w )
static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~port_1_last;
port_1_last = data;
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( seawolf2_sound_1_w ) // Port 40
static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
{
- device_t *samples = space->machine->device("samples");
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~port_2_last;
port_2_last = data;
@@ -250,7 +250,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
if (rising_bits & 0x10) sample_start(samples, 8, 3, 0); /* Right Sonar */
if (rising_bits & 0x20) sample_start(samples, 3, 3, 0); /* Left Sonar */
- coin_counter_w(space->machine, 0, data & 0x40); /* Coin Counter */
+ coin_counter_w(space->machine(), 0, data & 0x40); /* Coin Counter */
}
@@ -264,7 +264,7 @@ static WRITE8_HANDLER( seawolf2_sound_2_w ) // Port 41
static CUSTOM_INPUT( ebases_trackball_r )
{
static const char *const names[] = { "TRACKX2", "TRACKY2", "TRACKX1", "TRACKY1" };
- return input_port_read(field->port->machine, names[input_select]);
+ return input_port_read(field->port->machine(), names[input_select]);
}
@@ -276,7 +276,7 @@ static WRITE8_HANDLER( ebases_trackball_select_w )
static WRITE8_HANDLER( ebases_coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
@@ -289,9 +289,9 @@ static WRITE8_HANDLER( ebases_coin_w )
static READ8_HANDLER( spacezap_io_r )
{
- coin_counter_w(space->machine, 0, (offset >> 8) & 1);
- coin_counter_w(space->machine, 1, (offset >> 9) & 1);
- return input_port_read_safe(space->machine, "P3HANDLE", 0xff);
+ coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
+ return input_port_read_safe(space->machine(), "P3HANDLE", 0xff);
}
@@ -308,13 +308,13 @@ static READ8_HANDLER( wow_io_r )
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine, 0, data); break;
- case 1: coin_counter_w(space->machine, 1, data); break;
+ case 0: coin_counter_w(space->machine(), 0, data); break;
+ case 1: coin_counter_w(space->machine(), 1, data); break;
case 2: astrocade_sparkle[0] = data; break;
case 3: astrocade_sparkle[1] = data; break;
case 4: astrocade_sparkle[2] = data; break;
case 5: astrocade_sparkle[3] = data; break;
- case 7: coin_counter_w(space->machine, 2, data); break;
+ case 7: coin_counter_w(space->machine(), 2, data); break;
}
return 0xff;
}
@@ -333,15 +333,15 @@ static READ8_HANDLER( gorf_io_1_r )
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine, 0, data); break;
- case 1: coin_counter_w(space->machine, 1, data); break;
+ case 0: coin_counter_w(space->machine(), 0, data); break;
+ case 1: coin_counter_w(space->machine(), 1, data); break;
case 2: astrocade_sparkle[0] = data; break;
case 3: astrocade_sparkle[1] = data; break;
case 4: astrocade_sparkle[2] = data; break;
case 5: astrocade_sparkle[3] = data; break;
case 6:
- space->machine->device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
- space->machine->device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
+ space->machine().device<astrocade_device>("astrocade1")->set_output_gain(0, data ? 0.0 : 1.0);
+ space->machine().device<samples_device>("samples")->set_output_gain(0, data ? 1.0 : 0.0);
break;
case 7: mame_printf_debug("io_1:%d\n", data); break;
}
@@ -381,11 +381,11 @@ static READ8_HANDLER( robby_io_r )
switch ((offset >> 9) & 7)
{
- case 0: coin_counter_w(space->machine, 0, data); break;
- case 1: coin_counter_w(space->machine, 1, data); break;
- case 2: coin_counter_w(space->machine, 2, data); break;
- case 6: set_led_status(space->machine, 0, data); break;
- case 7: set_led_status(space->machine, 1, data); break;
+ case 0: coin_counter_w(space->machine(), 0, data); break;
+ case 1: coin_counter_w(space->machine(), 1, data); break;
+ case 2: coin_counter_w(space->machine(), 2, data); break;
+ case 6: set_led_status(space->machine(), 0, data); break;
+ case 7: set_led_status(space->machine(), 1, data); break;
}
return 0xff;
}
@@ -400,10 +400,10 @@ static READ8_HANDLER( robby_io_r )
static READ8_HANDLER( profpac_io_1_r )
{
- coin_counter_w(space->machine, 0, (offset >> 8) & 1);
- coin_counter_w(space->machine, 1, (offset >> 9) & 1);
- set_led_status(space->machine, 0, (offset >> 10) & 1);
- set_led_status(space->machine, 1, (offset >> 11) & 1);
+ coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
+ set_led_status(space->machine(), 0, (offset >> 10) & 1);
+ set_led_status(space->machine(), 1, (offset >> 11) & 1);
return 0xff;
}
@@ -432,14 +432,14 @@ static WRITE8_HANDLER( profpac_banksw_w )
/* set the main banking */
space->install_read_bank(0x4000, 0xbfff, "bank1");
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user1")->base() + 0x8000 * bank);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user1")->base() + 0x8000 * bank);
/* bank 0 reads video RAM in the 4000-7FFF range */
if (bank == 0)
space->install_legacy_read_handler(0x4000, 0x7fff, FUNC(profpac_videoram_r));
/* if we have a 640k EPROM board, map that on top of the 4000-7FFF range if specified */
- if ((data & 0x80) && space->machine->region("user2")->base() != NULL)
+ if ((data & 0x80) && space->machine().region("user2")->base() != NULL)
{
/* Note: There is a jumper which could change the base offset to 0xa8 instead */
bank = data - 0x80;
@@ -448,7 +448,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
if (bank < 0x28)
{
space->install_read_bank(0x4000, 0x7fff, "bank2");
- memory_set_bankptr(space->machine, "bank2", space->machine->region("user2")->base() + 0x4000 * bank);
+ memory_set_bankptr(space->machine(), "bank2", space->machine().region("user2")->base() + 0x4000 * bank);
}
else
space->unmap_read(0x4000, 0x7fff);
@@ -458,7 +458,7 @@ static WRITE8_HANDLER( profpac_banksw_w )
static STATE_POSTLOAD( profbank_banksw_restore )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
profpac_banksw_w(space, 0, profpac_bank);
}
@@ -473,10 +473,10 @@ static STATE_POSTLOAD( profbank_banksw_restore )
static READ8_HANDLER( demndrgn_io_r )
{
- coin_counter_w(space->machine, 0, (offset >> 8) & 1);
- coin_counter_w(space->machine, 1, (offset >> 9) & 1);
- set_led_status(space->machine, 0, (offset >> 10) & 1);
- set_led_status(space->machine, 1, (offset >> 11) & 1);
+ coin_counter_w(space->machine(), 0, (offset >> 8) & 1);
+ coin_counter_w(space->machine(), 1, (offset >> 9) & 1);
+ set_led_status(space->machine(), 0, (offset >> 10) & 1);
+ set_led_status(space->machine(), 1, (offset >> 11) & 1);
input_select = (offset >> 12) & 1;
return 0xff;
}
@@ -485,7 +485,7 @@ static READ8_HANDLER( demndrgn_io_r )
static CUSTOM_INPUT( demndragn_joystick_r )
{
static const char *const names[] = { "MOVEX", "MOVEY" };
- return input_port_read(field->port->machine, names[input_select]);
+ return input_port_read(field->port->machine(), names[input_select]);
}
@@ -526,7 +526,7 @@ static const ay8910_interface ay8912_interface =
static WRITE8_HANDLER( tenpindx_sound_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE);
}
@@ -554,7 +554,7 @@ static WRITE8_HANDLER( tenpindx_lamp_w )
static WRITE8_HANDLER( tenpindx_counter_w )
{
- coin_counter_w(space->machine, 0, (data >> 0) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 0) & 1);
if (data & 0xfc) mame_printf_debug("tenpindx_counter_w = %02X\n", data);
}
@@ -1729,54 +1729,54 @@ ROM_END
static DRIVER_INIT( seawolf2 )
{
astrocade_video_config = 0x00;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x40, 0, 0xff18, FUNC(seawolf2_sound_1_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x41, 0x41, 0, 0xff18, FUNC(seawolf2_sound_2_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x42, 0x43, 0, 0xff18, FUNC(seawolf2_lamps_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x40, 0x40, 0, 0xff18, FUNC(seawolf2_sound_1_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x41, 0x41, 0, 0xff18, FUNC(seawolf2_sound_2_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x42, 0x43, 0, 0xff18, FUNC(seawolf2_lamps_w));
}
static DRIVER_INIT( ebases )
{
astrocade_video_config = AC_SOUND_PRESENT;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, 0, 0xff07, FUNC(ebases_coin_w));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x28, 0x28, 0, 0xff07, FUNC(ebases_trackball_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x20, 0x20, 0, 0xff07, FUNC(ebases_coin_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x28, 0x28, 0, 0xff07, FUNC(ebases_trackball_select_w));
}
static DRIVER_INIT( spacezap )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_MONITOR_BW;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x13, 0x13, 0x03ff, 0xff00, FUNC(spacezap_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x13, 0x13, 0x03ff, 0xff00, FUNC(spacezap_io_r));
}
static DRIVER_INIT( wow )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(wow_io_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(wow_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(wow_speech_r));
}
static DRIVER_INIT( gorf )
{
astrocade_video_config = AC_SOUND_PRESENT | AC_LIGHTPEN_INTS | AC_STARS;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(gorf_io_1_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, 0x0fff, 0xff00, FUNC(gorf_io_2_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(gorf_io_1_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, 0x0fff, 0xff00, FUNC(gorf_io_2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, 0xffff, 0xff00, FUNC(gorf_speech_r));
}
static DRIVER_INIT( robby )
{
astrocade_video_config = AC_SOUND_PRESENT;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(robby_io_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x15, 0x15, 0x0fff, 0xff00, FUNC(robby_io_r));
}
static DRIVER_INIT( profpac )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
astrocade_video_config = AC_SOUND_PRESENT;
iospace->install_legacy_read_handler(0x14, 0x14, 0x0fff, 0xff00, FUNC(profpac_io_1_r));
@@ -1784,13 +1784,13 @@ static DRIVER_INIT( profpac )
/* reset banking */
profpac_banksw_w(iospace, 0, 0);
- machine->state().register_postload(profbank_banksw_restore, NULL);
+ machine.state().register_postload(profbank_banksw_restore, NULL);
}
static DRIVER_INIT( demndrgn )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
astrocade_video_config = 0x00;
iospace->install_legacy_read_handler(0x14, 0x14, 0x1fff, 0xff00, FUNC(demndrgn_io_r));
@@ -1800,13 +1800,13 @@ static DRIVER_INIT( demndrgn )
/* reset banking */
profpac_banksw_w(iospace, 0, 0);
- machine->state().register_postload(profbank_banksw_restore, NULL);
+ machine.state().register_postload(profbank_banksw_restore, NULL);
}
static DRIVER_INIT( tenpindx )
{
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
astrocade_video_config = 0x00;
iospace->install_read_port(0x60, 0x60, 0x0000, 0xff00, "P60");
@@ -1821,7 +1821,7 @@ static DRIVER_INIT( tenpindx )
/* reset banking */
profpac_banksw_w(iospace, 0, 0);
- machine->state().register_postload(profbank_banksw_restore, NULL);
+ machine.state().register_postload(profbank_banksw_restore, NULL);
}
diff --git a/src/mame/drivers/astrocorp.c b/src/mame/drivers/astrocorp.c
index df79c961569..e6d6ec11142 100644
--- a/src/mame/drivers/astrocorp.c
+++ b/src/mame/drivers/astrocorp.c
@@ -60,9 +60,9 @@ public:
static VIDEO_START( astrocorp )
{
- astrocorp_state *state = machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = machine.driver_data<astrocorp_state>();
- state->bitmap = machine->primary_screen->alloc_compatible_bitmap();
+ state->bitmap = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->bitmap));
state->save_item (NAME(state->screen_enable));
@@ -91,9 +91,9 @@ static VIDEO_START( astrocorp )
***************************************************************************/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- astrocorp_state *state = machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = machine.driver_data<astrocorp_state>();
UINT16 *source = state->spriteram;
UINT16 *finish = state->spriteram + state->spriteram_size / 2;
@@ -127,7 +127,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
for (xwrap = 0 ; xwrap <= 0x200 ; xwrap += 0x200)
{
- drawgfx_transpen(bitmap,cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect, machine.gfx[0],
code, 0,
0, 0,
sx + x * 16 - xwrap, sy + y * 16 - ywrap, 0xff);
@@ -141,12 +141,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(astrocorp)
{
- astrocorp_state *state = screen->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = screen->machine().driver_data<astrocorp_state>();
if (state->screen_enable & 1)
copybitmap(bitmap, state->bitmap, 0,0,0,0, cliprect);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -158,20 +158,20 @@ static SCREEN_UPDATE(astrocorp)
static WRITE16_HANDLER( astrocorp_draw_sprites_w )
{
- astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = space->machine().driver_data<astrocorp_state>();
UINT16 old = state->draw_sprites;
UINT16 now = COMBINE_DATA(&state->draw_sprites);
if (!old && now)
- draw_sprites(space->machine, state->bitmap, &space->machine->primary_screen->visible_area());
+ draw_sprites(space->machine(), state->bitmap, &space->machine().primary_screen->visible_area());
}
static WRITE16_HANDLER( astrocorp_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -199,18 +199,18 @@ static WRITE16_HANDLER( showhand_outputs_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, (data & 0x0004)); // coin counter
- set_led_status(space->machine, 0, (data & 0x0008)); // you win
- if ((data & 0x0010)) increment_dispensed_tickets(space->machine, 1); // coin out
- set_led_status(space->machine, 1, (data & 0x0020)); // coin/hopper jam
+ coin_counter_w(space->machine(), 0, (data & 0x0004)); // coin counter
+ set_led_status(space->machine(), 0, (data & 0x0008)); // you win
+ if ((data & 0x0010)) increment_dispensed_tickets(space->machine(), 1); // coin out
+ set_led_status(space->machine(), 1, (data & 0x0020)); // coin/hopper jam
}
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 2, (data & 0x0100)); // bet
- set_led_status(space->machine, 3, (data & 0x0800)); // start
- set_led_status(space->machine, 4, (data & 0x1000)); // ? select/choose
- set_led_status(space->machine, 5, (data & 0x2000)); // ? select/choose
- set_led_status(space->machine, 6, (data & 0x4000)); // look
+ set_led_status(space->machine(), 2, (data & 0x0100)); // bet
+ set_led_status(space->machine(), 3, (data & 0x0800)); // start
+ set_led_status(space->machine(), 4, (data & 0x1000)); // ? select/choose
+ set_led_status(space->machine(), 5, (data & 0x2000)); // ? select/choose
+ set_led_status(space->machine(), 6, (data & 0x4000)); // look
}
// popmessage("%04X",data);
}
@@ -235,23 +235,23 @@ static WRITE16_HANDLER( skilldrp_outputs_w )
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, (data & 0x0001)); // key in |
- coin_counter_w(space->machine, 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter
- coin_counter_w(space->machine, 1, (data & 0x0004)); // key out |
- ticket_dispenser_w(space->machine->device("hopper"), 0, (data & 0x0008)<<4); // hopper motor?
+ coin_counter_w(space->machine(), 0, (data & 0x0001)); // key in |
+ coin_counter_w(space->machine(), 0, (data & 0x0002)); // coin in |- manual shows 1 in- and 1 out- counter
+ coin_counter_w(space->machine(), 1, (data & 0x0004)); // key out |
+ ticket_dispenser_w(space->machine().device("hopper"), 0, (data & 0x0008)<<4); // hopper motor?
// (data & 0x0010) // hopper?
- set_led_status(space->machine, 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant")
- ticket_dispenser_w(space->machine->device("ticket"), 0, data & 0x0080); // ticket motor?
+ set_led_status(space->machine(), 0, (data & 0x0020)); // error lamp (coin/hopper jam: "call attendant")
+ ticket_dispenser_w(space->machine().device("ticket"), 0, data & 0x0080); // ticket motor?
}
if (ACCESSING_BITS_8_15)
{
// lamps:
- set_led_status(space->machine, 1, (data & 0x0100)); // select
- set_led_status(space->machine, 2, (data & 0x0400)); // take
- set_led_status(space->machine, 3, (data & 0x0800)); // bet
- set_led_status(space->machine, 4, (data & 0x1000)); // start
- set_led_status(space->machine, 5, (data & 0x4000)); // win / test
- set_led_status(space->machine, 6, (data & 0x8000)); // ticket?
+ set_led_status(space->machine(), 1, (data & 0x0100)); // select
+ set_led_status(space->machine(), 2, (data & 0x0400)); // take
+ set_led_status(space->machine(), 3, (data & 0x0800)); // bet
+ set_led_status(space->machine(), 4, (data & 0x1000)); // start
+ set_led_status(space->machine(), 5, (data & 0x4000)); // win / test
+ set_led_status(space->machine(), 6, (data & 0x8000)); // ticket?
}
// popmessage("%04X",data);
@@ -259,7 +259,7 @@ static WRITE16_HANDLER( skilldrp_outputs_w )
static WRITE16_HANDLER( astrocorp_screen_enable_w )
{
- astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = space->machine().driver_data<astrocorp_state>();
COMBINE_DATA(&state->screen_enable);
// popmessage("%04X",data);
if (state->screen_enable & (~1))
@@ -274,9 +274,9 @@ static READ16_HANDLER( astrocorp_unk_r )
// 5-6-5 Palette: BBBBB-GGGGGG-RRRRR
static WRITE16_HANDLER( astrocorp_palette_w )
{
- astrocorp_state *state = space->machine->driver_data<astrocorp_state>();
+ astrocorp_state *state = space->machine().driver_data<astrocorp_state>();
COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb(space->machine, offset,
+ palette_set_color_rgb(space->machine(), offset,
pal5bit((state->paletteram[offset] >> 0) & 0x1f),
pal6bit((state->paletteram[offset] >> 5) & 0x3f),
pal5bit((state->paletteram[offset] >> 11) & 0x1f)
@@ -1004,7 +1004,7 @@ ROM_END
static DRIVER_INIT( showhand )
{
#if 0
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
rom[0x0a1a/2] = 0x6000; // hopper jam
@@ -1020,7 +1020,7 @@ static DRIVER_INIT( showhand )
static DRIVER_INIT( showhanc )
{
#if 0
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
rom[0x14d4/2] = 0x4e71; // enable full test mode
rom[0x14d6/2] = 0x4e71; // ""
diff --git a/src/mame/drivers/astrof.c b/src/mame/drivers/astrof.c
index 167c8313a74..dbde20a4347 100644
--- a/src/mame/drivers/astrof.c
+++ b/src/mame/drivers/astrof.c
@@ -81,7 +81,7 @@
static READ8_HANDLER( irq_clear_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@@ -90,7 +90,7 @@ static READ8_HANDLER( irq_clear_r )
static TIMER_DEVICE_CALLBACK( irq_callback )
{
- astrof_state *state = timer.machine->driver_data<astrof_state>();
+ astrof_state *state = timer.machine().driver_data<astrof_state>();
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
}
@@ -104,17 +104,17 @@ static TIMER_DEVICE_CALLBACK( irq_callback )
static INPUT_CHANGED( coin_inserted )
{
- astrof_state *state = field->port->machine->driver_data<astrof_state>();
+ astrof_state *state = field->port->machine().driver_data<astrof_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
- coin_counter_w(field->port->machine, 0, newval);
+ coin_counter_w(field->port->machine(), 0, newval);
}
static INPUT_CHANGED( service_coin_inserted )
{
- astrof_state *state = field->port->machine->driver_data<astrof_state>();
+ astrof_state *state = field->port->machine().driver_data<astrof_state>();
/* service coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
@@ -123,7 +123,7 @@ static INPUT_CHANGED( service_coin_inserted )
static CUSTOM_INPUT( astrof_p1_controls_r )
{
- return input_port_read(field->port->machine, "P1");
+ return input_port_read(field->port->machine(), "P1");
}
@@ -134,10 +134,10 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
/* on an upright cabinet, a single set of controls
is connected to both sets of pins on the edge
connector */
- if (input_port_read(field->port->machine, "CAB"))
- ret = input_port_read(field->port->machine, "P2");
+ if (input_port_read(field->port->machine(), "CAB"))
+ ret = input_port_read(field->port->machine(), "P2");
else
- ret = input_port_read(field->port->machine, "P1");
+ ret = input_port_read(field->port->machine(), "P1");
return ret;
}
@@ -146,16 +146,16 @@ static CUSTOM_INPUT( astrof_p2_controls_r )
static CUSTOM_INPUT( tomahawk_controls_r )
{
UINT32 ret;
- astrof_state *state = field->port->machine->driver_data<astrof_state>();
+ astrof_state *state = field->port->machine().driver_data<astrof_state>();
/* on a cocktail cabinet, two sets of controls are
multiplexed on a single set of inputs
(not verified on pcb) */
if (state->flipscreen)
- ret = input_port_read(field->port->machine, "P2");
+ ret = input_port_read(field->port->machine(), "P2");
else
- ret = input_port_read(field->port->machine, "P1");
+ ret = input_port_read(field->port->machine(), "P1");
return ret;
}
@@ -174,7 +174,7 @@ static CUSTOM_INPUT( tomahawk_controls_r )
static VIDEO_START( astrof )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* allocate the color RAM -- half the size of the video RAM as A0 is not connected */
state->colorram = auto_alloc_array(machine, UINT8, state->videoram_size / 2);
@@ -182,9 +182,9 @@ static VIDEO_START( astrof )
}
-static rgb_t make_pen( running_machine *machine, UINT8 data )
+static rgb_t make_pen( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
UINT8 r1_bit = state->red_on ? 0x01 : (data >> 0) & 0x01;
UINT8 r2_bit = state->red_on ? 0x01 : (data >> 1) & 0x01;
@@ -203,13 +203,13 @@ static rgb_t make_pen( running_machine *machine, UINT8 data )
}
-static void astrof_get_pens( running_machine *machine, pen_t *pens )
+static void astrof_get_pens( running_machine &machine, pen_t *pens )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
offs_t i;
UINT8 bank = (state->astrof_palette_bank ? 0x10 : 0x00);
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
/* a common wire hack to the pcb causes the prom halves to be inverted */
/* this results in e.g. astrof background being black */
@@ -240,10 +240,10 @@ static void astrof_get_pens( running_machine *machine, pen_t *pens )
}
-static void tomahawk_get_pens( running_machine *machine, pen_t *pens )
+static void tomahawk_get_pens( running_machine &machine, pen_t *pens )
{
offs_t i;
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *prom = machine.region("proms")->base();
UINT8 config = input_port_read_safe(machine, "FAKE", 0x00);
for (i = 0; i < TOMAHAWK_NUM_PENS; i++)
@@ -282,7 +282,7 @@ static void tomahawk_get_pens( running_machine *machine, pen_t *pens )
static WRITE8_HANDLER( astrof_videoram_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->videoram[offset] = data;
state->colorram[offset >> 1] = *state->astrof_color & 0x0e;
@@ -291,7 +291,7 @@ static WRITE8_HANDLER( astrof_videoram_w )
static WRITE8_HANDLER( tomahawk_videoram_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->videoram[offset] = data;
state->colorram[offset >> 1] = (*state->astrof_color & 0x0e) | ((*state->astrof_color & 0x01) << 4);
@@ -300,9 +300,9 @@ static WRITE8_HANDLER( tomahawk_videoram_w )
static WRITE8_HANDLER( video_control_1_w )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
- state->flipscreen = ((data >> 0) & 0x01) & input_port_read(space->machine, "CAB");
+ state->flipscreen = ((data >> 0) & 0x01) & input_port_read(space->machine(), "CAB");
/* this ties to the CLR pin of the shift registers */
state->screen_off = (data & 0x02) ? TRUE : FALSE;
@@ -310,13 +310,13 @@ static WRITE8_HANDLER( video_control_1_w )
/* D2 - not connected in the schematics, but at one point Astro Fighter sets it to 1 */
/* D3-D7 - not connected */
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void astrof_set_video_control_2( running_machine *machine, UINT8 data )
+static void astrof_set_video_control_2( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@@ -332,14 +332,14 @@ static void astrof_set_video_control_2( running_machine *machine, UINT8 data )
static WRITE8_HANDLER( astrof_video_control_2_w )
{
- astrof_set_video_control_2(space->machine, data);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ astrof_set_video_control_2(space->machine(), data);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void spfghmk2_set_video_control_2( running_machine *machine, UINT8 data )
+static void spfghmk2_set_video_control_2( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@@ -352,14 +352,14 @@ static void spfghmk2_set_video_control_2( running_machine *machine, UINT8 data )
static WRITE8_HANDLER( spfghmk2_video_control_2_w )
{
- spfghmk2_set_video_control_2(space->machine, data);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ spfghmk2_set_video_control_2(space->machine(), data);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void tomahawk_set_video_control_2( running_machine *machine, UINT8 data )
+static void tomahawk_set_video_control_2( running_machine &machine, UINT8 data )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* D0 - OUT0 - goes to edge conn. pin A10 - was perhaps meant to be a start lamp */
/* D1 - OUT1 - goes to edge conn. pin A11 - was perhaps meant to be a start lamp */
@@ -371,14 +371,14 @@ static void tomahawk_set_video_control_2( running_machine *machine, UINT8 data )
static WRITE8_HANDLER( tomahawk_video_control_2_w )
{
- tomahawk_set_video_control_2(space->machine, data);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ tomahawk_set_video_control_2(space->machine(), data);
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
-static void video_update_common( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, pen_t *pens )
+static void video_update_common( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, pen_t *pens )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -425,9 +425,9 @@ static SCREEN_UPDATE( astrof )
{
pen_t pens[ASTROF_NUM_PENS];
- astrof_get_pens(screen->machine, pens);
+ astrof_get_pens(screen->machine(), pens);
- video_update_common(screen->machine, bitmap, cliprect, pens);
+ video_update_common(screen->machine(), bitmap, cliprect, pens);
return 0;
}
@@ -437,9 +437,9 @@ static SCREEN_UPDATE( tomahawk )
{
pen_t pens[TOMAHAWK_NUM_PENS];
- tomahawk_get_pens(screen->machine, pens);
+ tomahawk_get_pens(screen->machine(), pens);
- video_update_common(screen->machine, bitmap, cliprect, pens);
+ video_update_common(screen->machine(), bitmap, cliprect, pens);
return 0;
}
@@ -455,13 +455,13 @@ static SCREEN_UPDATE( tomahawk )
static READ8_HANDLER( shoot_r )
{
/* not really sure about this */
- return space->machine->rand() & 8;
+ return space->machine().rand() & 8;
}
static READ8_HANDLER( abattle_coin_prot_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->abattle_count = (state->abattle_count + 1) % 0x0101;
return state->abattle_count ? 0x07 : 0x00;
@@ -470,7 +470,7 @@ static READ8_HANDLER( abattle_coin_prot_r )
static READ8_HANDLER( afire_coin_prot_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
state->abattle_count = state->abattle_count ^ 0x01;
return state->abattle_count ? 0x07 : 0x00;
@@ -479,7 +479,7 @@ static READ8_HANDLER( afire_coin_prot_r )
static READ8_HANDLER( tomahawk_protection_r )
{
- astrof_state *state = space->machine->driver_data<astrof_state>();
+ astrof_state *state = space->machine().driver_data<astrof_state>();
/* flip the byte */
return BITSWAP8(*state->tomahawk_protection, 0, 1, 2, 3, 4, 5, 6, 7);
@@ -495,13 +495,13 @@ static READ8_HANDLER( tomahawk_protection_r )
static MACHINE_START( astrof )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
astrof_set_video_control_2(machine, 0xff);
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
/* register for state saving */
state->save_item(NAME(state->red_on));
@@ -518,7 +518,7 @@ static MACHINE_START( astrof )
static MACHINE_START( abattle )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* register for state saving */
state->save_item(NAME(state->abattle_count));
@@ -529,12 +529,12 @@ static MACHINE_START( abattle )
static MACHINE_START( spfghmk2 )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
spfghmk2_set_video_control_2(machine, 0xff);
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
/* the red background circuit is disabled */
state->red_on = FALSE;
@@ -548,13 +548,13 @@ static MACHINE_START( spfghmk2 )
static MACHINE_START( tomahawk )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
/* the 74175 outputs all HI's if not otherwise set */
tomahawk_set_video_control_2(machine, 0xff);
- state->maincpu = machine->device("maincpu");
- state->sn = machine->device("snsnd");
+ state->maincpu = machine.device("maincpu");
+ state->sn = machine.device("snsnd");
/* register for state saving */
state->save_item(NAME(state->red_on));
@@ -572,7 +572,7 @@ static MACHINE_START( tomahawk )
static MACHINE_RESET( abattle )
{
- astrof_state *state = machine->driver_data<astrof_state>();
+ astrof_state *state = machine.driver_data<astrof_state>();
state->abattle_count = 0;
}
@@ -1300,44 +1300,44 @@ ROM_END
static DRIVER_INIT( abattle )
{
/* use the protection PROM to decrypt the ROMs */
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *prom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *prom = machine.region("user1")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
rom[i] = prom[rom[i]];
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
}
static DRIVER_INIT( afire )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
rom[i] = ~rom[i];
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(afire_coin_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(afire_coin_prot_r));
}
static DRIVER_INIT( sstarbtl )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for(i = 0xd000; i < 0x10000; i++)
rom[i] = ~rom[i];
/* set up protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa003, 0xa003, FUNC(shoot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa004, 0xa004, FUNC(abattle_coin_prot_r));
}
diff --git a/src/mame/drivers/asuka.c b/src/mame/drivers/asuka.c
index bafa45db5e2..6ea6cf9ca0d 100644
--- a/src/mame/drivers/asuka.c
+++ b/src/mame/drivers/asuka.c
@@ -232,13 +232,13 @@ DIP locations verified for:
static TIMER_CALLBACK( cadash_interrupt5 )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE);
}
static INTERRUPT_GEN( cadash_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(cadash_interrupt5));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(cadash_interrupt5));
device_set_input_line(device, 4, HOLD_LINE); /* interrupt vector 4 */
}
@@ -249,19 +249,19 @@ static INTERRUPT_GEN( cadash_interrupt )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_2151_w )
{
- memory_set_bank(device->machine, "bank1", data & 0x03);
+ memory_set_bank(device->machine(), "bank1", data & 0x03);
}
static void asuka_msm5205_vck( device_t *device )
{
- asuka_state *state = device->machine->driver_data<asuka_state>();
+ asuka_state *state = device->machine().driver_data<asuka_state>();
if (state->adpcm_data != -1)
{
@@ -270,7 +270,7 @@ static void asuka_msm5205_vck( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("ymsnd")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("ymsnd")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->adpcm_data >> 4);
}
@@ -278,7 +278,7 @@ static void asuka_msm5205_vck( device_t *device )
static WRITE8_HANDLER( asuka_msm5205_address_w )
{
- asuka_state *state = space->machine->driver_data<asuka_state>();
+ asuka_state *state = space->machine().driver_data<asuka_state>();
state->adpcm_pos = (state->adpcm_pos & 0x00ff) | (data << 8);
}
@@ -289,7 +289,7 @@ static WRITE8_DEVICE_HANDLER( asuka_msm5205_start_w )
static WRITE8_DEVICE_HANDLER( asuka_msm5205_stop_w )
{
- asuka_state *state = device->machine->driver_data<asuka_state>();
+ asuka_state *state = device->machine().driver_data<asuka_state>();
msm5205_reset_w(device, 1);
state->adpcm_pos &= 0xff00;
}
@@ -771,7 +771,7 @@ GFXDECODE_END
static void irq_handler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -835,16 +835,16 @@ static const tc0110pcr_interface asuka_tc0110pcr_intf =
static MACHINE_START( asuka )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->pc090oj = machine->device("pc090oj");
- state->tc0100scn = machine->device("tc0100scn");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->pc090oj = machine.device("pc090oj");
+ state->tc0100scn = machine.device("tc0100scn");
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 1, machine->region("audiocpu")->base(), 0);
- memory_configure_bank(machine, "bank1", 1, 3, machine->region("audiocpu")->base() + 0x10000, 0x04000);
+ memory_configure_bank(machine, "bank1", 0, 1, machine.region("audiocpu")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 3, machine.region("audiocpu")->base() + 0x10000, 0x04000);
state->save_item(NAME(state->adpcm_pos));
state->save_item(NAME(state->adpcm_data));
@@ -860,7 +860,7 @@ static MACHINE_START( asuka )
static MACHINE_RESET( asuka )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
state->adpcm_pos = 0;
state->adpcm_data = -1;
@@ -876,7 +876,7 @@ static MACHINE_RESET( asuka )
static SCREEN_EOF( asuka )
{
- asuka_state *state = machine->driver_data<asuka_state>();
+ asuka_state *state = machine.driver_data<asuka_state>();
pc090oj_eof_callback(state->pc090oj);
}
diff --git a/src/mame/drivers/atarifb.c b/src/mame/drivers/atarifb.c
index 742f3eb7889..bebca222abb 100644
--- a/src/mame/drivers/atarifb.c
+++ b/src/mame/drivers/atarifb.c
@@ -507,9 +507,9 @@ GFXDECODE_END
static MACHINE_START( atarifb )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->CTRLD));
state->save_item(NAME(state->sign_x_1));
@@ -532,7 +532,7 @@ static MACHINE_START( atarifb )
static MACHINE_RESET( atarifb )
{
- atarifb_state *state = machine->driver_data<atarifb_state>();
+ atarifb_state *state = machine.driver_data<atarifb_state>();
state->CTRLD = 0;
state->sign_x_1 = 0;
diff --git a/src/mame/drivers/atarig1.c b/src/mame/drivers/atarig1.c
index ebebbfcced4..e66e5477efc 100644
--- a/src/mame/drivers/atarig1.c
+++ b/src/mame/drivers/atarig1.c
@@ -32,9 +32,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( atarig1 )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
atarigen_init(machine);
state->save_item(NAME(state->which_input));
}
@@ -50,12 +50,12 @@ static MACHINE_START( atarig1 )
static MACHINE_RESET( atarig1 )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarig1_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarig1_scanline_update, 8);
atarijsa_reset();
}
@@ -71,7 +71,7 @@ static WRITE16_HANDLER( mo_control_w )
{
if (ACCESSING_BITS_0_7)
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
atarirle_control_w(state->rle, data & 7);
}
}
@@ -79,7 +79,7 @@ static WRITE16_HANDLER( mo_control_w )
static WRITE16_HANDLER( mo_command_w )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
COMBINE_DATA(state->mo_command);
atarirle_command_w(state->rle, (data == 0 && state->is_pitfight) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@@ -94,8 +94,8 @@ static WRITE16_HANDLER( mo_command_w )
static READ16_HANDLER( special_port0_r )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
- int temp = input_port_read(space->machine, "IN0");
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
+ int temp = input_port_read(space->machine(), "IN0");
if (state->cpu_to_sound_ready) temp ^= 0x1000;
temp ^= 0x2000; /* A2DOK always high for now */
return temp;
@@ -104,7 +104,7 @@ static READ16_HANDLER( special_port0_r )
static WRITE16_HANDLER( a2d_select_w )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
state->which_input = offset;
}
@@ -112,15 +112,15 @@ static WRITE16_HANDLER( a2d_select_w )
static READ16_HANDLER( a2d_data_r )
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2" };
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
/* Pit Fighter has no A2D, just another input port */
if (state->is_pitfight)
- return input_port_read(space->machine, "ADC0");
+ return input_port_read(space->machine(), "ADC0");
/* otherwise, assume it's hydra */
if (state->which_input < 3)
- return input_port_read(space->machine, adcnames[state->which_input]) << 8;
+ return input_port_read(space->machine(), adcnames[state->which_input]) << 8;
return 0;
}
@@ -152,7 +152,7 @@ INLINE void update_bank(atarig1_state *state, int bank)
static STATE_POSTLOAD( pitfightb_state_postload )
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
int bank = state->bslapstic_bank;
state->bslapstic_bank = -1;
update_bank(state, bank);
@@ -161,7 +161,7 @@ static STATE_POSTLOAD( pitfightb_state_postload )
static READ16_HANDLER( pitfightb_cheap_slapstic_r )
{
- atarig1_state *state = space->machine->driver_data<atarig1_state>();
+ atarig1_state *state = space->machine().driver_data<atarig1_state>();
int result = state->bslapstic_base[offset & 0xfff];
/* the cheap replacement slapstic just triggers on the simple banking */
@@ -187,12 +187,12 @@ static READ16_HANDLER( pitfightb_cheap_slapstic_r )
}
-static void pitfightb_cheap_slapstic_init(running_machine *machine)
+static void pitfightb_cheap_slapstic_init(running_machine &machine)
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
/* install a read handler */
- state->bslapstic_base = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x038000, 0x03ffff, FUNC(pitfightb_cheap_slapstic_r));
+ state->bslapstic_base = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x038000, 0x03ffff, FUNC(pitfightb_cheap_slapstic_r));
/* allocate memory for a copy of bank 0 */
state->bslapstic_bank0 = auto_alloc_array(machine, UINT8, 0x2000);
@@ -1218,9 +1218,9 @@ ROM_END
*
*************************************/
-static void init_g1_common(running_machine *machine, offs_t slapstic_base, int slapstic, int is_pitfight)
+static void init_g1_common(running_machine &machine, offs_t slapstic_base, int slapstic, int is_pitfight)
{
- atarig1_state *state = machine->driver_data<atarig1_state>();
+ atarig1_state *state = machine.driver_data<atarig1_state>();
state->eeprom_default = NULL;
if (slapstic == -1)
@@ -1228,10 +1228,10 @@ static void init_g1_common(running_machine *machine, offs_t slapstic_base, int s
pitfightb_cheap_slapstic_init(machine);
state->save_item(NAME(state->bslapstic_bank));
state->save_item(NAME(state->bslapstic_primed));
- machine->state().register_postload(pitfightb_state_postload, NULL);
+ machine.state().register_postload(pitfightb_state_postload, NULL);
}
else if (slapstic != 0)
- atarigen_slapstic_init(machine->device("maincpu"), slapstic_base, 0, slapstic);
+ atarigen_slapstic_init(machine.device("maincpu"), slapstic_base, 0, slapstic);
atarijsa_init(machine, "IN0", 0x4000);
state->is_pitfight = is_pitfight;
diff --git a/src/mame/drivers/atarig42.c b/src/mame/drivers/atarig42.c
index 4073b7f3d06..f0a74aa0919 100644
--- a/src/mame/drivers/atarig42.c
+++ b/src/mame/drivers/atarig42.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -41,7 +41,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( atarig42 )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarigen_init(machine);
state->save_item(NAME(state->analog_data));
@@ -54,11 +54,11 @@ static MACHINE_START( atarig42 )
static MACHINE_RESET( atarig42 )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarig42_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarig42_scanline_update, 8);
atarijsa_reset();
}
@@ -72,8 +72,8 @@ static MACHINE_RESET( atarig42 )
static READ16_HANDLER( special_port2_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
- int temp = input_port_read(space->machine, "IN2");
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
+ int temp = input_port_read(space->machine(), "IN2");
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -84,15 +84,15 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( a2d_select_w )
{
static const char *const portnames[] = { "A2D0", "A2D1" };
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
- state->analog_data = input_port_read(space->machine, portnames[offset != 0]);
+ state->analog_data = input_port_read(space->machine(), portnames[offset != 0]);
}
static READ16_HANDLER( a2d_data_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
return state->analog_data << 8;
}
@@ -102,10 +102,10 @@ static WRITE16_HANDLER( io_latch_w )
/* upper byte */
if (ACCESSING_BITS_8_15)
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
/* bit 14 controls the ASIC65 reset line */
- asic65_reset(space->machine, (~data >> 14) & 1);
+ asic65_reset(space->machine(), (~data >> 14) & 1);
/* bits 13-11 are the MO control bits */
atarirle_control_w(state->rle, (data >> 11) & 7);
@@ -115,7 +115,7 @@ static WRITE16_HANDLER( io_latch_w )
if (ACCESSING_BITS_0_7)
{
/* bit 4 resets the sound CPU */
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
if (!(data & 0x10)) atarijsa_reset();
/* bit 5 is /XRESET, probably related to the ASIC */
@@ -127,7 +127,7 @@ static WRITE16_HANDLER( io_latch_w )
static WRITE16_HANDLER( mo_command_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
COMBINE_DATA(state->mo_command);
atarirle_command_w(state->rle, (data == 0) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
}
@@ -266,7 +266,7 @@ static void roadriot_sloop_tweak(atarig42_state *state, int offset)
static READ16_HANDLER( roadriot_sloop_data_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
roadriot_sloop_tweak(state, offset);
if (offset < 0x78000/2)
return state->sloop_base[offset];
@@ -277,7 +277,7 @@ static READ16_HANDLER( roadriot_sloop_data_r )
static WRITE16_HANDLER( roadriot_sloop_data_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
roadriot_sloop_tweak(state, offset);
}
@@ -325,7 +325,7 @@ static void guardians_sloop_tweak(atarig42_state *state, int offset)
static READ16_HANDLER( guardians_sloop_data_r )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
guardians_sloop_tweak(state, offset);
if (offset < 0x78000/2)
return state->sloop_base[offset];
@@ -336,7 +336,7 @@ static READ16_HANDLER( guardians_sloop_data_r )
static WRITE16_HANDLER( guardians_sloop_data_w )
{
- atarig42_state *state = space->machine->driver_data<atarig42_state>();
+ atarig42_state *state = space->machine().driver_data<atarig42_state>();
guardians_sloop_tweak(state, offset);
}
@@ -795,14 +795,14 @@ ROM_END
static DRIVER_INIT( roadriot )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarijsa_init(machine, "IN2", 0x0040);
state->playfield_base = 0x400;
- address_space *main = machine->device<m68000_device>("maincpu")->space(AS_PROGRAM);
+ address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM);
state->sloop_base = main->install_legacy_readwrite_handler(0x000000, 0x07ffff, FUNC(roadriot_sloop_data_r), FUNC(roadriot_sloop_data_w));
- main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, *machine));
+ main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, machine));
asic65_config(machine, ASIC65_ROMBASED);
/*
@@ -830,18 +830,18 @@ static DRIVER_INIT( roadriot )
static DRIVER_INIT( guardian )
{
- atarig42_state *state = machine->driver_data<atarig42_state>();
+ atarig42_state *state = machine.driver_data<atarig42_state>();
atarijsa_init(machine, "IN2", 0x0040);
state->playfield_base = 0x000;
/* it looks like they jsr to $80000 as some kind of protection */
/* put an RTS there so we don't die */
- *(UINT16 *)&machine->region("maincpu")->base()[0x80000] = 0x4E75;
+ *(UINT16 *)&machine.region("maincpu")->base()[0x80000] = 0x4E75;
- address_space *main = machine->device<m68000_device>("maincpu")->space(AS_PROGRAM);
+ address_space *main = machine.device<m68000_device>("maincpu")->space(AS_PROGRAM);
state->sloop_base = main->install_legacy_readwrite_handler(0x000000, 0x07ffff, FUNC(guardians_sloop_data_r), FUNC(guardians_sloop_data_w));
- main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, *machine));
+ main->set_direct_update_handler(direct_update_delegate_create_static(atarig42_sloop_direct_handler, machine));
asic65_config(machine, ASIC65_GUARDIANS);
/*
diff --git a/src/mame/drivers/atarigt.c b/src/mame/drivers/atarigt.c
index 4922c82088c..559f6ff65a5 100644
--- a/src/mame/drivers/atarigt.c
+++ b/src/mame/drivers/atarigt.c
@@ -37,7 +37,7 @@
*
*************************************/
-static void cage_irq_callback(running_machine *machine, int reason);
+static void cage_irq_callback(running_machine &machine, int reason);
@@ -47,9 +47,9 @@ static void cage_irq_callback(running_machine *machine, int reason);
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
cputag_set_input_line(machine, "maincpu", 3, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -64,11 +64,11 @@ static MACHINE_START( atarigt )
static MACHINE_RESET( atarigt )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarigt_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarigt_scanline_update, 8);
}
@@ -79,12 +79,12 @@ static MACHINE_RESET( atarigt )
*
*************************************/
-static void cage_irq_callback(running_machine *machine, int reason)
+static void cage_irq_callback(running_machine &machine, int reason)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if (reason)
- atarigen_sound_int_gen(machine->device("maincpu"));
+ atarigen_sound_int_gen(machine.device("maincpu"));
else
atarigen_sound_int_ack_w(space,0,0,0xffff);
}
@@ -99,7 +99,7 @@ static void cage_irq_callback(running_machine *machine, int reason)
static READ32_HANDLER( special_port2_r )
{
- int temp = input_port_read(space->machine, "SERVICE");
+ int temp = input_port_read(space->machine(), "SERVICE");
temp ^= 0x0001; /* /A2DRDY always high for now */
temp ^= 0x0008; /* A2D.EOC always high for now */
return (temp << 16) | temp;
@@ -108,8 +108,8 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
- int temp = input_port_read(space->machine, "COIN");
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
+ int temp = input_port_read(space->machine(), "COIN");
if (state->video_int_state) temp ^= 0x0001;
if (state->scanline_int_state) temp ^= 0x0002;
return (temp << 16) | temp;
@@ -156,7 +156,7 @@ static READ32_HANDLER( analog_port0_r )
compute_fake_pots(pots);
return (pots[0] << 24) | (pots[3] << 8);
#else
- return (input_port_read(space->machine, "AN1") << 24) | (input_port_read(space->machine, "AN2") << 8);
+ return (input_port_read(space->machine(), "AN1") << 24) | (input_port_read(space->machine(), "AN2") << 8);
#endif
}
@@ -168,7 +168,7 @@ static READ32_HANDLER( analog_port1_r )
compute_fake_pots(pots);
return (pots[2] << 24) | (pots[1] << 8);
#else
- return (input_port_read(space->machine, "AN3") << 24) | (input_port_read(space->machine, "AN4") << 8);
+ return (input_port_read(space->machine(), "AN3") << 24) | (input_port_read(space->machine(), "AN4") << 8);
#endif
}
@@ -196,7 +196,7 @@ static WRITE32_HANDLER( latch_w )
/* upper byte */
if (ACCESSING_BITS_24_31)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
/* bits 13-11 are the MO control bits */
atarirle_control_w(state->rle, (data >> 27) & 7);
@@ -205,15 +205,15 @@ static WRITE32_HANDLER( latch_w )
if (ACCESSING_BITS_16_23)
{
// cage_reset_w(data & 0x00100000);
- coin_counter_w(space->machine, 0, data & 0x00080000);
- coin_counter_w(space->machine, 1, data & 0x00010000);
+ coin_counter_w(space->machine(), 0, data & 0x00080000);
+ coin_counter_w(space->machine(), 1, data & 0x00010000);
}
}
static WRITE32_HANDLER( mo_command_w )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
COMBINE_DATA(state->mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(state->rle, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
@@ -248,7 +248,7 @@ static READ32_HANDLER( sound_data_r )
static WRITE32_HANDLER( sound_data_w )
{
if (ACCESSING_BITS_0_15)
- cage_control_w(space->machine, data);
+ cage_control_w(space->machine(), data);
if (ACCESSING_BITS_16_31)
main_to_cage_w(data >> 16);
}
@@ -277,7 +277,7 @@ static void tmek_update_mode(atarigt_state *state, offs_t offset)
static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
/*
T-Mek init:
($387C0) = $0001
@@ -301,7 +301,7 @@ static void tmek_protection_w(address_space *space, offs_t offset, UINT16 data)
static void tmek_protection_r(address_space *space, offs_t offset, UINT16 *data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
if (LOG_PROTECTION) logerror("%06X:Protection R@%06X\n", cpu_get_previouspc(space->cpu), offset);
/* track accesses */
@@ -368,7 +368,7 @@ static void primage_update_mode(atarigt_state *state, offs_t offset)
static void primrage_protection_w(address_space *space, offs_t offset, UINT16 data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
if (LOG_PROTECTION)
{
UINT32 pc = cpu_get_previouspc(space->cpu);
@@ -439,7 +439,7 @@ static void primrage_protection_w(address_space *space, offs_t offset, UINT16 da
static void primrage_protection_r(address_space *space, offs_t offset, UINT16 *data)
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
/* track accesses */
primage_update_mode(state, offset);
@@ -554,7 +554,7 @@ if (LOG_PROTECTION)
static READ32_HANDLER( colorram_protection_r )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
offs_t address = 0xd80000 + offset * 4;
UINT32 result32 = 0;
UINT16 result;
@@ -578,7 +578,7 @@ static READ32_HANDLER( colorram_protection_r )
static WRITE32_HANDLER( colorram_protection_w )
{
- atarigt_state *state = space->machine->driver_data<atarigt_state>();
+ atarigt_state *state = space->machine().driver_data<atarigt_state>();
offs_t address = 0xd80000 + offset * 4;
if (ACCESSING_BITS_16_31)
@@ -1269,7 +1269,7 @@ static WRITE32_HANDLER( tmek_pf_w )
static DRIVER_INIT( tmek )
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
state->eeprom_default = NULL;
state->is_primrage = 0;
@@ -1282,13 +1282,13 @@ static DRIVER_INIT( tmek )
state->protection_w = tmek_protection_w;
/* temp hack */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd72000, 0xd75fff, FUNC(tmek_pf_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xd72000, 0xd75fff, FUNC(tmek_pf_w));
}
-static void primrage_init_common(running_machine *machine, offs_t cage_speedup)
+static void primrage_init_common(running_machine &machine, offs_t cage_speedup)
{
- atarigt_state *state = machine->driver_data<atarigt_state>();
+ atarigt_state *state = machine.driver_data<atarigt_state>();
state->eeprom_default = NULL;
state->is_primrage = 1;
diff --git a/src/mame/drivers/atarigx2.c b/src/mame/drivers/atarigx2.c
index 11c0ae73da0..b70a5124428 100644
--- a/src/mame/drivers/atarigx2.c
+++ b/src/mame/drivers/atarigx2.c
@@ -33,9 +33,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -49,11 +49,11 @@ static MACHINE_START( atarigx2 )
static MACHINE_RESET( atarigx2 )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, atarigx2_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, atarigx2_scanline_update, 8);
atarijsa_reset();
}
@@ -67,8 +67,8 @@ static MACHINE_RESET( atarigx2 )
static READ32_HANDLER( special_port2_r )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
- int temp = input_port_read(space->machine, "SERVICE");
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
+ int temp = input_port_read(space->machine(), "SERVICE");
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
temp ^= 0x0008; /* A2D.EOC always high for now */
@@ -78,7 +78,7 @@ static READ32_HANDLER( special_port2_r )
static READ32_HANDLER( special_port3_r )
{
- int temp = input_port_read(space->machine, "SPECIAL");
+ int temp = input_port_read(space->machine(), "SPECIAL");
return (temp << 16) | temp;
}
@@ -90,9 +90,9 @@ static READ32_HANDLER( a2d_data_r )
switch (offset)
{
case 0:
- return (input_port_read(space->machine, "A2D0") << 24) | (input_port_read(space->machine, "A2D1") << 8);
+ return (input_port_read(space->machine(), "A2D0") << 24) | (input_port_read(space->machine(), "A2D1") << 8);
case 1:
- return (input_port_read(space->machine, "A2D2") << 24) | (input_port_read(space->machine, "A2D3") << 8);
+ return (input_port_read(space->machine(), "A2D2") << 24) | (input_port_read(space->machine(), "A2D3") << 8);
}
return 0;
@@ -117,7 +117,7 @@ static WRITE32_HANDLER( latch_w )
/* upper byte */
if (ACCESSING_BITS_24_31)
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
/* bits 13-11 are the MO control bits */
atarirle_control_w(state->rle, (data >> 27) & 7);
@@ -125,13 +125,13 @@ static WRITE32_HANDLER( latch_w )
/* lower byte */
if (ACCESSING_BITS_16_23)
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, (data & 0x100000) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE32_HANDLER( mo_command_w )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
COMBINE_DATA(state->mo_command);
if (ACCESSING_BITS_0_15)
atarirle_command_w(state->rle, ((data & 0xffff) == 2) ? ATARIRLE_COMMAND_CHECKSUM : ATARIRLE_COMMAND_DRAW);
@@ -148,7 +148,7 @@ static WRITE32_HANDLER( mo_command_w )
static WRITE32_HANDLER( atarigx2_protection_w )
{
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
{
int pc = cpu_get_previouspc(space->cpu);
// if (pc == 0x11cbe || pc == 0x11c30)
@@ -1105,7 +1105,7 @@ static READ32_HANDLER( atarigx2_protection_r )
{ 0xffffffff, 0xffff }
};
- atarigx2_state *state = space->machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = space->machine().driver_data<atarigx2_state>();
UINT32 result = state->protection_base[offset];
if (offset == 0x300)
@@ -1128,7 +1128,7 @@ static READ32_HANDLER( atarigx2_protection_r )
if (lookup_table[i][0] == 0xffffffff)
{
if (state->last_write_offset*2 >= 0x700 && state->last_write_offset*2 < 0x720)
- result = space->machine->rand() << 16;
+ result = space->machine().rand() << 16;
else
result = 0xffff << 16;
logerror("%06X:Unhandled protection R@%04X = %04X\n", cpu_get_previouspc(space->cpu), offset, result);
@@ -2194,7 +2194,7 @@ ROM_END
static DRIVER_INIT( spclords )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
@@ -2204,7 +2204,7 @@ static DRIVER_INIT( spclords )
static DRIVER_INIT( motofren )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
@@ -2240,13 +2240,13 @@ static READ32_HANDLER( rrreveng_prot_r )
static DRIVER_INIT( rrreveng )
{
- atarigx2_state *state = machine->driver_data<atarigx2_state>();
+ atarigx2_state *state = machine.driver_data<atarigx2_state>();
atarijsa_init(machine, "SERVICE", 0x0040);
state->playfield_base = 0x000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xca0fc0, 0xca0fc3, FUNC(rrreveng_prot_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xca0fc0, 0xca0fc3, FUNC(rrreveng_prot_r));
}
diff --git a/src/mame/drivers/atarisy1.c b/src/mame/drivers/atarisy1.c
index 05f3e4fc7ff..c9d902fc643 100644
--- a/src/mame/drivers/atarisy1.c
+++ b/src/mame/drivers/atarisy1.c
@@ -206,9 +206,9 @@ RoadBlasters (aka Future Vette):005*
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
cputag_set_input_line(machine, "maincpu", 2, state->joystick_int && state->joystick_int_enable ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -218,7 +218,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( atarisy1 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
atarigen_init(machine);
state->save_item(NAME(state->joystick_int));
@@ -229,13 +229,13 @@ static MACHINE_START( atarisy1 )
static MACHINE_RESET( atarisy1 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
/* initialize the system */
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_sound_io_reset(machine.device("audiocpu"));
/* reset the joystick parameters */
state->joystick_value = 0;
@@ -253,30 +253,30 @@ static MACHINE_RESET( atarisy1 )
static TIMER_DEVICE_CALLBACK( delayed_joystick_int )
{
- atarisy1_state *state = timer.machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = timer.machine().driver_data<atarisy1_state>();
state->joystick_value = param;
state->joystick_int = 1;
- atarigen_update_interrupts(timer.machine);
+ atarigen_update_interrupts(timer.machine());
}
static READ16_HANDLER( joystick_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
int newval = 0xff;
static const char *const portnames[] = { "IN0", "IN1" };
/* digital joystick type */
if (state->joystick_type == 1)
- newval = (input_port_read(space->machine, "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
+ newval = (input_port_read(space->machine(), "IN0") & (0x80 >> offset)) ? 0xf0 : 0x00;
/* Hall-effect analog joystick */
else if (state->joystick_type == 2)
- newval = input_port_read(space->machine, portnames[offset & 1]);
+ newval = input_port_read(space->machine(), portnames[offset & 1]);
/* Road Blasters gas pedal */
else if (state->joystick_type == 3)
- newval = input_port_read(space->machine, "IN1");
+ newval = input_port_read(space->machine(), "IN1");
/* the A4 bit enables/disables joystick IRQs */
state->joystick_int_enable = ((offset >> 3) & 1) ^ 1;
@@ -284,7 +284,7 @@ static READ16_HANDLER( joystick_r )
/* clear any existing interrupt and set a timer for a new one */
state->joystick_int = 0;
state->joystick_timer->adjust(attotime::from_usec(50), newval);
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
return state->joystick_value;
}
@@ -293,7 +293,7 @@ static READ16_HANDLER( joystick_r )
static WRITE16_HANDLER( joystick_w )
{
/* the A4 bit enables/disables joystick IRQs */
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
state->joystick_int_enable = ((offset >> 3) & 1) ^ 1;
}
@@ -307,7 +307,7 @@ static WRITE16_HANDLER( joystick_w )
static READ16_HANDLER( trakball_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
int result = 0xff;
/* Marble Madness trackball type -- rotated 45 degrees! */
@@ -323,13 +323,13 @@ static READ16_HANDLER( trakball_r )
if (player == 0)
{
- posx = (INT8)input_port_read(space->machine, "IN0");
- posy = (INT8)input_port_read(space->machine, "IN1");
+ posx = (INT8)input_port_read(space->machine(), "IN0");
+ posy = (INT8)input_port_read(space->machine(), "IN1");
}
else
{
- posx = (INT8)input_port_read(space->machine, "IN2");
- posy = (INT8)input_port_read(space->machine, "IN3");
+ posx = (INT8)input_port_read(space->machine(), "IN2");
+ posy = (INT8)input_port_read(space->machine(), "IN3");
}
state->cur[player][0] = posx + posy;
@@ -341,7 +341,7 @@ static READ16_HANDLER( trakball_r )
/* Road Blasters steering wheel */
else if (state->trackball_type == 2)
- result = input_port_read(space->machine, "IN0");
+ result = input_port_read(space->machine(), "IN0");
return result;
}
@@ -356,8 +356,8 @@ static READ16_HANDLER( trakball_r )
static READ16_HANDLER( port4_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
- int temp = input_port_read(space->machine, "F60000");
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ int temp = input_port_read(space->machine(), "F60000");
if (state->cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -372,12 +372,12 @@ static READ16_HANDLER( port4_r )
static READ8_HANDLER( switch_6502_r )
{
- atarisy1_state *state = space->machine->driver_data<atarisy1_state>();
- int temp = input_port_read(space->machine, "1820");
+ atarisy1_state *state = space->machine().driver_data<atarisy1_state>();
+ int temp = input_port_read(space->machine(), "1820");
if (state->cpu_to_sound_ready) temp ^= 0x08;
if (state->sound_to_cpu_ready) temp ^= 0x10;
- if (!(input_port_read(space->machine, "F60000") & 0x0040)) temp ^= 0x80;
+ if (!(input_port_read(space->machine(), "F60000") & 0x0040)) temp ^= 0x80;
return temp;
}
@@ -407,33 +407,33 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_DEVICE_HANDLER( via_pa_w )
{
- tms5220_data_w(device->machine->device("tms"), 0, data);
+ tms5220_data_w(device->machine().device("tms"), 0, data);
}
static READ8_DEVICE_HANDLER( via_pa_r )
{
- return tms5220_status_r(device->machine->device("tms"), 0);
+ return tms5220_status_r(device->machine().device("tms"), 0);
}
static WRITE8_DEVICE_HANDLER( via_pb_w )
{
/* write strobe */
- tms5220_wsq_w(device->machine->device("tms"), data & 1);
+ tms5220_wsq_w(device->machine().device("tms"), data & 1);
/* read strobe */
- tms5220_rsq_w(device->machine->device("tms"), (data & 2)>>1);
+ tms5220_rsq_w(device->machine().device("tms"), (data & 2)>>1);
/* bit 4 is connected to an up-counter, clocked by SYCLKB */
data = 5 | ((data >> 3) & 2);
- tms5220_set_frequency(device->machine->device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
+ tms5220_set_frequency(device->machine().device("tms"), ATARI_CLOCK_14MHz/2 / (16 - data));
}
static READ8_DEVICE_HANDLER( via_pb_r )
{
- return (tms5220_readyq_r(device->machine->device("tms")) << 2) | (tms5220_intq_r(device->machine->device("tms")) << 3);
+ return (tms5220_readyq_r(device->machine().device("tms")) << 2) | (tms5220_intq_r(device->machine().device("tms")) << 3);
}
@@ -456,7 +456,7 @@ static const via6522_interface via_interface =
static WRITE8_HANDLER( led_w )
{
- set_led_status(space->machine, offset, ~data & 1);
+ set_led_status(space->machine(), offset, ~data & 1);
}
@@ -2343,9 +2343,9 @@ ROM_END
static DRIVER_INIT( marble )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 103);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 103);
state->joystick_type = 0; /* none */
state->trackball_type = 1; /* rotated */
@@ -2354,9 +2354,9 @@ static DRIVER_INIT( marble )
static DRIVER_INIT( peterpak )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 107);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 107);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@@ -2365,9 +2365,9 @@ static DRIVER_INIT( peterpak )
static DRIVER_INIT( indytemp )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 105);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 105);
state->joystick_type = 1; /* digital */
state->trackball_type = 0; /* none */
@@ -2376,9 +2376,9 @@ static DRIVER_INIT( indytemp )
static DRIVER_INIT( roadrunn )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 108);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 108);
state->joystick_type = 2; /* analog */
state->trackball_type = 0; /* none */
@@ -2387,9 +2387,9 @@ static DRIVER_INIT( roadrunn )
static DRIVER_INIT( roadb109 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 109);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 109);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */
@@ -2398,9 +2398,9 @@ static DRIVER_INIT( roadb109 )
static DRIVER_INIT( roadb110 )
{
- atarisy1_state *state = machine->driver_data<atarisy1_state>();
+ atarisy1_state *state = machine.driver_data<atarisy1_state>();
- atarigen_slapstic_init(machine->device("maincpu"), 0x080000, 0, 110);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x080000, 0, 110);
state->joystick_type = 3; /* pedal */
state->trackball_type = 2; /* steering wheel */
diff --git a/src/mame/drivers/atarisy2.c b/src/mame/drivers/atarisy2.c
index 6117c0fed48..97cd7e18996 100644
--- a/src/mame/drivers/atarisy2.c
+++ b/src/mame/drivers/atarisy2.c
@@ -155,9 +155,9 @@ static STATE_POSTLOAD( bankselect_postload );
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
if (state->video_int_state)
cputag_set_input_line(machine, "maincpu", 3, ASSERT_LINE);
@@ -190,13 +190,13 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
- atarisy2_state *state = screen.machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = screen.machine().driver_data<atarisy2_state>();
if (scanline <= screen.height())
{
/* generate the 32V interrupt (IRQ 2) */
if ((scanline % 64) == 0)
if (state->interrupt_enable & 4)
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
}
@@ -223,30 +223,30 @@ DIRECT_UPDATE_HANDLER( atarisy2_direct_handler )
static MACHINE_START( atarisy2 )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
atarigen_init(machine);
state->save_item(NAME(state->interrupt_enable));
state->save_item(NAME(state->which_adc));
state->save_item(NAME(state->p2portwr_state));
state->save_item(NAME(state->p2portrd_state));
- machine->state().register_postload(bankselect_postload, NULL);
+ machine.state().register_postload(bankselect_postload, NULL);
state->save_item(NAME(state->sound_reset_state));
}
static MACHINE_RESET( atarisy2 )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
atarigen_eeprom_reset(state);
slapstic_reset();
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_sound_io_reset(machine->device("soundcpu"));
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 64);
+ atarigen_sound_io_reset(machine.device("soundcpu"));
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 64);
- address_space *main = machine->device<t11_device>("maincpu")->space(AS_PROGRAM);
- main->set_direct_update_handler(direct_update_delegate_create_static(atarisy2_direct_handler, *machine));
+ address_space *main = machine.device<t11_device>("maincpu")->space(AS_PROGRAM);
+ main->set_direct_update_handler(direct_update_delegate_create_static(atarisy2_direct_handler, machine));
state->p2portwr_state = 0;
state->p2portrd_state = 0;
@@ -264,7 +264,7 @@ static MACHINE_RESET( atarisy2 )
static INTERRUPT_GEN( vblank_int )
{
- atarisy2_state *state = device->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = device->machine().driver_data<atarisy2_state>();
/* clock the VBLANK through */
if (state->interrupt_enable & 8)
@@ -275,9 +275,9 @@ static INTERRUPT_GEN( vblank_int )
static WRITE16_HANDLER( int0_ack_w )
{
/* reset sound IRQ */
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
state->p2portrd_state = 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
}
@@ -285,13 +285,13 @@ static WRITE16_HANDLER( int1_ack_w )
{
/* reset sound CPU */
if (ACCESSING_BITS_0_7)
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
}
static TIMER_CALLBACK( delayed_int_enable_w )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
state->interrupt_enable = param;
}
@@ -299,7 +299,7 @@ static TIMER_CALLBACK( delayed_int_enable_w )
static WRITE16_HANDLER( int_enable_w )
{
if (offset == 0 && ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_int_enable_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_int_enable_w), data);
}
@@ -332,22 +332,22 @@ static WRITE16_HANDLER( bankselect_w )
0x8e000, 0x86000, 0x7e000, 0x76000
};
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
int newword = state->bankselect[offset];
UINT8 *base;
COMBINE_DATA(&newword);
state->bankselect[offset] = newword;
- base = &space->machine->region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
+ base = &space->machine().region("maincpu")->base()[bankoffset[(newword >> 10) & 0x3f]];
memcpy(offset ? state->rombank2 : state->rombank1, base, 0x2000);
}
static STATE_POSTLOAD( bankselect_postload )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
bankselect_w(space, 0, state->bankselect[0], 0xffff);
bankselect_w(space, 1, state->bankselect[1], 0xffff);
@@ -363,8 +363,8 @@ static STATE_POSTLOAD( bankselect_postload )
static READ16_HANDLER( switch_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
- int result = input_port_read(space->machine, "1800") | (input_port_read(space->machine, "1801") << 8);
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ int result = input_port_read(space->machine(), "1800") | (input_port_read(space->machine(), "1801") << 8);
if (state->cpu_to_sound_ready) result ^= 0x20;
if (state->sound_to_cpu_ready) result ^= 0x10;
@@ -375,14 +375,14 @@ static READ16_HANDLER( switch_r )
static READ8_HANDLER( switch_6502_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
- int result = input_port_read(space->machine, "1840");
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
+ int result = input_port_read(space->machine(), "1840");
if (state->cpu_to_sound_ready) result |= 0x01;
if (state->sound_to_cpu_ready) result |= 0x02;
- if ((state->has_tms5220) && (tms5220_readyq_r(space->machine->device("tms")) == 0))
+ if ((state->has_tms5220) && (tms5220_readyq_r(space->machine().device("tms")) == 0))
result &= ~0x04;
- if (!(input_port_read(space->machine, "1801") & 0x80)) result |= 0x10;
+ if (!(input_port_read(space->machine(), "1801") & 0x80)) result |= 0x10;
return result;
}
@@ -390,12 +390,12 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_HANDLER( switch_6502_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->has_tms5220)
{
data = 12 | ((data >> 5) & 1);
- tms5220_set_frequency(space->machine->device("tms"), MASTER_CLOCK/4 / (16 - data) / 2);
+ tms5220_set_frequency(space->machine().device("tms"), MASTER_CLOCK/4 / (16 - data) / 2);
}
}
@@ -409,7 +409,7 @@ static WRITE8_HANDLER( switch_6502_w )
static WRITE16_HANDLER( adc_strobe_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
state->which_adc = offset & 3;
}
@@ -417,23 +417,23 @@ static WRITE16_HANDLER( adc_strobe_w )
static READ16_HANDLER( adc_r )
{
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->which_adc < state->pedal_count)
- return ~input_port_read(space->machine, adcnames[state->which_adc]);
+ return ~input_port_read(space->machine(), adcnames[state->which_adc]);
- return input_port_read(space->machine, adcnames[state->which_adc]) | 0xff00;
+ return input_port_read(space->machine(), adcnames[state->which_adc]) | 0xff00;
}
static READ8_HANDLER( leta_r )
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (offset <= 1 && state->pedal_count == -1) /* 720 */
{
- switch (input_port_read(space->machine, "SELECT"))
+ switch (input_port_read(space->machine(), "SELECT"))
{
case 0: /* Real */
break;
@@ -441,8 +441,8 @@ static READ8_HANDLER( leta_r )
case 1: /* Fake Joystick */
/* special thanks to MAME Analog+ for the mapping code */
{
- int analogx = input_port_read(space->machine, "FAKE_JOY_X") - 128;
- int analogy = input_port_read(space->machine, "FAKE_JOY_Y") - 128;
+ int analogx = input_port_read(space->machine(), "FAKE_JOY_X") - 128;
+ int analogy = input_port_read(space->machine(), "FAKE_JOY_Y") - 128;
double angle;
/* if the joystick is centered, leave the rest of this alone */
@@ -481,7 +481,7 @@ static READ8_HANDLER( leta_r )
{
INT32 diff;
UINT32 temp;
- UINT32 rotate_count = input_port_read(space->machine, "FAKE_SPINNER") & 0xffff;
+ UINT32 rotate_count = input_port_read(space->machine(), "FAKE_SPINNER") & 0xffff;
/* rotate_count behaves the same as the real LEAT1 Rotate encoder
* we use it to generate the LETA0 Center encoder count
*/
@@ -559,7 +559,7 @@ static READ8_HANDLER( leta_r )
return 0xff;
}
}
- return input_port_read(space->machine, letanames[offset]);
+ return input_port_read(space->machine(), letanames[offset]);
}
@@ -669,7 +669,7 @@ static WRITE8_HANDLER( mixer_w )
if (!(data & 0x02)) rbott += 1.0/47;
if (!(data & 0x04)) rbott += 1.0/22;
gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
- atarigen_set_ym2151_vol(space->machine, gain * 100);
+ atarigen_set_ym2151_vol(space->machine(), gain * 100);
/* bits 3-4 control the volume of the POKEYs, using 47k and 100k resistors */
rtop = 1.0/(1.0/100 + 1.0/100);
@@ -677,7 +677,7 @@ static WRITE8_HANDLER( mixer_w )
if (!(data & 0x08)) rbott += 1.0/47;
if (!(data & 0x10)) rbott += 1.0/22;
gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
- atarigen_set_pokey_vol(space->machine, gain * 100);
+ atarigen_set_pokey_vol(space->machine(), gain * 100);
/* bits 5-7 control the volume of the TMS5220, using 22k, 47k, and 100k resistors */
rtop = 1.0/(1.0/100 + 1.0/100);
@@ -686,13 +686,13 @@ static WRITE8_HANDLER( mixer_w )
if (!(data & 0x40)) rbott += 1.0/47;
if (!(data & 0x80)) rbott += 1.0/22;
gain = (rbott == 0) ? 1.0 : ((1.0/rbott) / (rtop + (1.0/rbott)));
- atarigen_set_tms5220_vol(space->machine, gain * 100);
+ atarigen_set_tms5220_vol(space->machine(), gain * 100);
}
static WRITE8_HANDLER( sound_reset_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* if no change, do nothing */
if ((data & 1) == state->sound_reset_state)
@@ -704,11 +704,11 @@ static WRITE8_HANDLER( sound_reset_w )
return;
/* a large number of signals are reset when this happens */
- atarigen_sound_io_reset(space->machine->device("soundcpu"));
- devtag_reset(space->machine, "ymsnd");
+ atarigen_sound_io_reset(space->machine().device("soundcpu"));
+ devtag_reset(space->machine(), "ymsnd");
if (state->has_tms5220)
{
- devtag_reset(space->machine, "tms"); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
+ devtag_reset(space->machine(), "tms"); // technically what happens is the tms5220 gets a long stream of 0xFF written to it when sound_reset_state is 0 which halts the chip after a few frames, but this works just as well, even if it isn't exactly true to hardware... The hardware may not have worked either, the resistors to pull input to 0xFF are fighting against the ls263 gate holding the latched value to be sent to the chip.
}
mixer_w(space, 0, 0);
}
@@ -716,11 +716,11 @@ static WRITE8_HANDLER( sound_reset_w )
static READ16_HANDLER( sound_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* clear the p2portwr state on a p1portrd */
state->p2portwr_state = 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
/* handle it normally otherwise */
return atarigen_sound_r(space,offset,0xffff);
@@ -729,11 +729,11 @@ static READ16_HANDLER( sound_r )
static WRITE8_HANDLER( sound_6502_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* clock the state through */
state->p2portwr_state = (state->interrupt_enable & 2) != 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
/* handle it normally otherwise */
atarigen_6502_sound_w(space, offset, data);
@@ -742,11 +742,11 @@ static WRITE8_HANDLER( sound_6502_w )
static READ8_HANDLER( sound_6502_r )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
/* clock the state through */
state->p2portrd_state = (state->interrupt_enable & 1) != 0;
- atarigen_update_interrupts(space->machine);
+ atarigen_update_interrupts(space->machine());
/* handle it normally otherwise */
return atarigen_6502_sound_r(space, offset);
@@ -762,19 +762,19 @@ static READ8_HANDLER( sound_6502_r )
static WRITE8_HANDLER( tms5220_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->has_tms5220)
{
- tms5220_data_w(space->machine->device("tms"), 0, data);
+ tms5220_data_w(space->machine().device("tms"), 0, data);
}
}
static WRITE8_HANDLER( tms5220_strobe_w )
{
- atarisy2_state *state = space->machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = space->machine().driver_data<atarisy2_state>();
if (state->has_tms5220)
{
- tms5220_wsq_w(space->machine->device("tms"), 1-(offset & 1));
+ tms5220_wsq_w(space->machine().device("tms"), 1-(offset & 1));
}
}
@@ -786,8 +786,8 @@ static WRITE8_HANDLER( tms5220_strobe_w )
static WRITE8_HANDLER( coincount_w )
{
- coin_counter_w(space->machine, 0, (data >> 0) & 1);
- coin_counter_w(space->machine, 1, (data >> 1) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 0) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 1) & 1);
}
@@ -3195,8 +3195,8 @@ ROM_END
static DRIVER_INIT( paperboy )
{
int i;
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
- UINT8 *cpu1 = machine->region("maincpu")->base();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
+ UINT8 *cpu1 = machine.region("maincpu")->base();
slapstic_init(machine, 105);
@@ -3210,7 +3210,7 @@ static DRIVER_INIT( paperboy )
state->pedal_count = 0;
state->has_tms5220 = 1;
- tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
+ tms5220_rsq_w(machine.device("tms"), 1); // /RS is tied high on sys2 hw
}
@@ -3219,20 +3219,20 @@ static DRIVER_INIT( 720 )
/* without the default EEPROM, 720 hangs at startup due to communication
issues with the sound CPU; temporarily increasing the sound CPU frequency
to ~2.2MHz "fixes" the problem */
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
slapstic_init(machine, 107);
state->pedal_count = -1;
state->has_tms5220 = 1;
- tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
+ tms5220_rsq_w(machine.device("tms"), 1); // /RS is tied high on sys2 hw
}
static DRIVER_INIT( ssprint )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
int i;
- UINT8 *cpu1 = machine->region("maincpu")->base();
+ UINT8 *cpu1 = machine.region("maincpu")->base();
slapstic_init(machine, 108);
@@ -3248,8 +3248,8 @@ static DRIVER_INIT( ssprint )
static DRIVER_INIT( csprint )
{
int i;
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
- UINT8 *cpu1 = machine->region("maincpu")->base();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
+ UINT8 *cpu1 = machine.region("maincpu")->base();
slapstic_init(machine, 109);
@@ -3264,13 +3264,13 @@ static DRIVER_INIT( csprint )
static DRIVER_INIT( apb )
{
- atarisy2_state *state = machine->driver_data<atarisy2_state>();
+ atarisy2_state *state = machine.driver_data<atarisy2_state>();
slapstic_init(machine, 110);
state->pedal_count = 2;
state->has_tms5220 = 1;
- tms5220_rsq_w(machine->device("tms"), 1); // /RS is tied high on sys2 hw
+ tms5220_rsq_w(machine.device("tms"), 1); // /RS is tied high on sys2 hw
}
diff --git a/src/mame/drivers/atarisy4.c b/src/mame/drivers/atarisy4.c
index 274330bb287..115ed20c090 100644
--- a/src/mame/drivers/atarisy4.c
+++ b/src/mame/drivers/atarisy4.c
@@ -125,7 +125,7 @@ static MACHINE_RESET( airrace );
static VIDEO_START( atarisy4 )
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
state->poly = poly_alloc(machine, 1024, sizeof(poly_extra_data), POLYFLAG_NO_WORK_QUEUE);
}
@@ -136,7 +136,7 @@ static VIDEO_RESET( atarisy4 )
static SCREEN_UPDATE( atarisy4 )
{
- atarisy4_state *state = screen->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = screen->machine().driver_data<atarisy4_state>();
int y;
UINT32 offset = 0;
@@ -161,8 +161,8 @@ static SCREEN_UPDATE( atarisy4 )
{
UINT16 data = *src++;
- *dest++ = screen->machine->pens[data & 0xff];
- *dest++ = screen->machine->pens[data >> 8];
+ *dest++ = screen->machine().pens[data & 0xff];
+ *dest++ = screen->machine().pens[data >> 8];
}
}
return 0;
@@ -304,9 +304,9 @@ static void draw_polygon(atarisy4_state *state, UINT16 color)
PFVR 0x2B Polygon vector relative
PFC 0x2C Polygon close
*/
-void execute_gpu_command(running_machine *machine)
+void execute_gpu_command(running_machine &machine)
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
switch (gpu.ecr)
{
case 0x04:
@@ -457,7 +457,7 @@ static WRITE16_HANDLER( gpu_w )
case 0x17:
{
gpu.ecr = data;
- execute_gpu_command(space->machine);
+ execute_gpu_command(space->machine());
break;
}
case 0x1a: gpu.far = data; break;
@@ -466,7 +466,7 @@ static WRITE16_HANDLER( gpu_w )
gpu.mcr = data;
if (~data & 0x08)
- cputag_set_input_line(space->machine, "maincpu", 6, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 6, CLEAR_LINE);
break;
}
@@ -501,7 +501,7 @@ static READ16_HANDLER( gpu_r )
static INTERRUPT_GEN( vblank_int )
{
if (gpu.mcr & 0x08)
- cputag_set_input_line(device->machine, "maincpu", 6, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 6, ASSERT_LINE);
}
@@ -513,7 +513,7 @@ static INTERRUPT_GEN( vblank_int )
static READ16_HANDLER( m68k_shared_0_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[0], 3))
return (state->shared_ram[0][offset]);
else
@@ -522,14 +522,14 @@ static READ16_HANDLER( m68k_shared_0_r )
static WRITE16_HANDLER( m68k_shared_0_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[0], 3))
COMBINE_DATA(&state->shared_ram[0][offset]);
}
static READ16_HANDLER( m68k_shared_1_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[1], 3))
return (state->shared_ram[1][offset]);
else
@@ -538,35 +538,35 @@ static READ16_HANDLER( m68k_shared_1_r )
static WRITE16_HANDLER( m68k_shared_1_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (!BIT(state->csr[1], 3))
COMBINE_DATA(&state->shared_ram[1][offset]);
}
static READ16_HANDLER( dsp0_status_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return state->csr[0];
}
static WRITE16_HANDLER( dsp0_control_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
- cputag_set_input_line(space->machine, "dsp0", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp0", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
+ cputag_set_input_line(space->machine(), "dsp0", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp0", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
state->csr[0] = data;
}
static READ16_HANDLER( dsp0_bio_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return BIT(state->csr[0], 2);
}
static WRITE16_HANDLER( dsp0_bank_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (data & 0x4000)
{
/* Set TIDONE bit */
@@ -577,34 +577,34 @@ static WRITE16_HANDLER( dsp0_bank_w )
}
data &= 0x3800;
- memory_set_bankptr(space->machine, "dsp0_bank1", &state->shared_ram[0][data]);
+ memory_set_bankptr(space->machine(), "dsp0_bank1", &state->shared_ram[0][data]);
state->dsp_bank[0] = data;
}
static READ16_HANDLER( dsp1_status_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return state->csr[1];
}
static WRITE16_HANDLER( dsp1_control_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
- cputag_set_input_line(space->machine, "dsp1", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp1", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
+ cputag_set_input_line(space->machine(), "dsp1", INPUT_LINE_RESET, data & 0x01 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp1", 0, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
state->csr[1] = data;
}
static READ16_HANDLER( dsp1_bio_r )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
return BIT(state->csr[1], 2);
}
static WRITE16_HANDLER( dsp1_bank_w )
{
- atarisy4_state *state = space->machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = space->machine().driver_data<atarisy4_state>();
if (data & 0x4000)
{
/* Set TIDONE bit */
@@ -615,7 +615,7 @@ static WRITE16_HANDLER( dsp1_bank_w )
}
data &= 0x3800;
- memory_set_bankptr(space->machine, "dsp1_bank1", &state->shared_ram[1][data]);
+ memory_set_bankptr(space->machine(), "dsp1_bank1", &state->shared_ram[1][data]);
state->dsp_bank[1] = data;
}
@@ -685,7 +685,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( analog_r )
{
- return (input_port_read(space->machine, "STICKX") << 8) | input_port_read(space->machine, "STICKY");
+ return (input_port_read(space->machine(), "STICKX") << 8) | input_port_read(space->machine(), "STICKY");
}
static INPUT_PORTS_START( atarisy4 )
@@ -961,41 +961,41 @@ next_line:
static DRIVER_INIT( laststar )
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
- address_space *main = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
+ address_space *main = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Allocate 16kB of shared RAM */
state->shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x2000);
/* Populate the 68000 address space with data from the HEX files */
- load_hexfile(main, machine->region("code")->base());
- load_hexfile(main, machine->region("data")->base());
+ load_hexfile(main, machine.region("code")->base());
+ load_hexfile(main, machine.region("data")->base());
/* Set up the DSP */
memory_set_bankptr(machine, "dsp0_bank0", state->shared_ram[0]);
memory_set_bankptr(machine, "dsp0_bank1", &state->shared_ram[0][0x800]);
- load_ldafile(machine->device("dsp0")->memory().space(AS_PROGRAM), machine->region("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
}
static DRIVER_INIT( airrace )
{
- atarisy4_state *state = machine->driver_data<atarisy4_state>();
+ atarisy4_state *state = machine.driver_data<atarisy4_state>();
/* Allocate two sets of 32kB shared RAM */
state->shared_ram[0] = auto_alloc_array_clear(machine, UINT16, 0x4000);
state->shared_ram[1] = auto_alloc_array_clear(machine, UINT16, 0x4000);
/* Populate RAM with data from the HEX files */
- load_hexfile(machine->device("maincpu")->memory().space(AS_PROGRAM), machine->region("code")->base());
+ load_hexfile(machine.device("maincpu")->memory().space(AS_PROGRAM), machine.region("code")->base());
/* Set up the first DSP */
memory_set_bankptr(machine, "dsp0_bank0", state->shared_ram[0]);
memory_set_bankptr(machine, "dsp0_bank1", &state->shared_ram[0][0x800]);
- load_ldafile(machine->device("dsp0")->memory().space(AS_PROGRAM), machine->region("dsp")->base());
+ load_ldafile(machine.device("dsp0")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
/* Set up the second DSP */
memory_set_bankptr(machine, "dsp1_bank0", state->shared_ram[1]);
memory_set_bankptr(machine, "dsp1_bank1", &state->shared_ram[1][0x800]);
- load_ldafile(machine->device("dsp1")->memory().space(AS_PROGRAM), machine->region("dsp")->base());
+ load_ldafile(machine.device("dsp1")->memory().space(AS_PROGRAM), machine.region("dsp")->base());
}
static MACHINE_RESET( atarisy4 )
diff --git a/src/mame/drivers/ataxx.c b/src/mame/drivers/ataxx.c
index f2cff6bb05a..2eda507727b 100644
--- a/src/mame/drivers/ataxx.c
+++ b/src/mame/drivers/ataxx.c
@@ -711,7 +711,7 @@ static DRIVER_INIT( ataxx )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
}
@@ -721,7 +721,7 @@ static DRIVER_INIT( ataxxj )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(ataxx_trackball_r));
}
@@ -731,9 +731,9 @@ static DRIVER_INIT( wsf )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1_P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P3_P4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "BUTTONS");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1_P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P3_P4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "BUTTONS");
}
@@ -743,14 +743,14 @@ static DRIVER_INIT( indyheat )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x02, FUNC(indyheat_wheel_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x08, 0x0b, FUNC(indyheat_analog_r));
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x02, FUNC(indyheat_wheel_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x08, 0x0b, FUNC(indyheat_analog_r));
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P1");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
/* set up additional output ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_write_handler(0x08, 0x0b, FUNC(indyheat_analog_w));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_write_handler(0x08, 0x0b, FUNC(indyheat_analog_w));
}
@@ -760,9 +760,9 @@ static DRIVER_INIT( brutforc )
leland_rotate_memory(machine, "slave");
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
}
@@ -772,12 +772,12 @@ static DRIVER_INIT( asylum )
leland_rotate_memory(machine, "slave");
/* asylum appears to have some extra RAM for the slave CPU */
- machine->device("slave")->memory().space(AS_PROGRAM)->install_ram(0xf000, 0xfffb);
+ machine.device("slave")->memory().space(AS_PROGRAM)->install_ram(0xf000, 0xfffb);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0d, 0x0d, "P2");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0e, 0x0e, "P1");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x0f, 0x0f, "P3");
}
diff --git a/src/mame/drivers/atetris.c b/src/mame/drivers/atetris.c
index 926142d8efd..971fa59d42d 100644
--- a/src/mame/drivers/atetris.c
+++ b/src/mame/drivers/atetris.c
@@ -68,7 +68,7 @@
static TIMER_CALLBACK( interrupt_gen )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
int scanline = param;
/* assert/deassert the interrupt */
@@ -78,13 +78,13 @@ static TIMER_CALLBACK( interrupt_gen )
scanline += 32;
if (scanline >= 256)
scanline -= 256;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -95,9 +95,9 @@ static WRITE8_HANDLER( irq_ack_w )
*
*************************************/
-static void reset_bank(running_machine *machine)
+static void reset_bank(running_machine &machine)
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
memcpy(state->slapstic_base, &state->slapstic_source[state->current_bank * 0x4000], 0x4000);
}
@@ -111,21 +111,21 @@ static STATE_POSTLOAD( atetris_postload )
static MACHINE_START( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
/* Allocate interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_gen));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_gen));
/* Set up save state */
state->save_item(NAME(state->current_bank));
state->save_item(NAME(state->nvram_write_enable));
- machine->state().register_postload(atetris_postload, NULL);
+ machine.state().register_postload(atetris_postload, NULL);
}
static MACHINE_RESET( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
+ atetris_state *state = machine.driver_data<atetris_state>();
/* reset the slapstic */
slapstic_reset();
@@ -133,7 +133,7 @@ static MACHINE_RESET( atetris )
reset_bank(machine);
/* start interrupts going (32V clocked by 16V) */
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(48), 48);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(48), 48);
}
@@ -146,7 +146,7 @@ static MACHINE_RESET( atetris )
static READ8_HANDLER( atetris_slapstic_r )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
int result = state->slapstic_base[0x2000 + offset];
int new_bank = slapstic_tweak(space, offset) & 1;
@@ -169,8 +169,8 @@ static READ8_HANDLER( atetris_slapstic_r )
static WRITE8_HANDLER( coincount_w )
{
- coin_counter_w(space->machine, 0, (data >> 5) & 1);
- coin_counter_w(space->machine, 1, (data >> 4) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 5) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 4) & 1);
}
@@ -183,7 +183,7 @@ static WRITE8_HANDLER( coincount_w )
static WRITE8_HANDLER( nvram_w )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
if (state->nvram_write_enable)
state->m_nvram[offset] = data;
@@ -193,7 +193,7 @@ static WRITE8_HANDLER( nvram_w )
static WRITE8_HANDLER( nvram_enable_w )
{
- atetris_state *state = space->machine->driver_data<atetris_state>();
+ atetris_state *state = space->machine().driver_data<atetris_state>();
state->nvram_write_enable = 1;
}
@@ -496,8 +496,8 @@ ROM_END
static DRIVER_INIT( atetris )
{
- atetris_state *state = machine->driver_data<atetris_state>();
- UINT8 *rgn = machine->region("maincpu")->base();
+ atetris_state *state = machine.driver_data<atetris_state>();
+ UINT8 *rgn = machine.region("maincpu")->base();
slapstic_init(machine, 101);
state->slapstic_source = &rgn[0x10000];
diff --git a/src/mame/drivers/attckufo.c b/src/mame/drivers/attckufo.c
index d07a991fbfb..90712d1d183 100644
--- a/src/mame/drivers/attckufo.c
+++ b/src/mame/drivers/attckufo.c
@@ -99,8 +99,8 @@ static READ8_HANDLER(attckufo_io_r)
{
switch(offset)
{
- case 0: return input_port_read(space->machine, "DSW");
- case 2: return input_port_read(space->machine, "INPUT");
+ case 0: return input_port_read(space->machine(), "DSW");
+ case 2: return input_port_read(space->machine(), "INPUT");
}
return 0xff;
}
@@ -156,26 +156,26 @@ INPUT_PORTS_END
static INTERRUPT_GEN( attckufo_raster_interrupt )
{
- attckufo_state *state = device->machine->driver_data<attckufo_state>();
+ attckufo_state *state = device->machine().driver_data<attckufo_state>();
mos6560_raster_interrupt_gen(state->mos6560);
}
static SCREEN_UPDATE( attckufo )
{
- attckufo_state *state = screen->machine->driver_data<attckufo_state>();
+ attckufo_state *state = screen->machine().driver_data<attckufo_state>();
mos6560_video_update(state->mos6560, bitmap, cliprect);
return 0;
}
-static int attckufo_dma_read( running_machine *machine, int offset )
+static int attckufo_dma_read( running_machine &machine, int offset )
{
- attckufo_state *state = machine->driver_data<attckufo_state>();
+ attckufo_state *state = machine.driver_data<attckufo_state>();
return state->maincpu->space(AS_PROGRAM)->read_byte(offset);
}
-static int attckufo_dma_read_color( running_machine *machine, int offset )
+static int attckufo_dma_read_color( running_machine &machine, int offset )
{
- attckufo_state *state = machine->driver_data<attckufo_state>();
+ attckufo_state *state = machine.driver_data<attckufo_state>();
return state->maincpu->space(AS_PROGRAM)->read_byte(offset + 0x400);
}
diff --git a/src/mame/drivers/avalnche.c b/src/mame/drivers/avalnche.c
index 2c8b087afe7..4c8f335962d 100644
--- a/src/mame/drivers/avalnche.c
+++ b/src/mame/drivers/avalnche.c
@@ -47,7 +47,7 @@
static SCREEN_UPDATE( avalnche )
{
- avalnche_state *state = screen->machine->driver_data<avalnche_state>();
+ avalnche_state *state = screen->machine().driver_data<avalnche_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -86,29 +86,29 @@ static SCREEN_UPDATE( avalnche )
static WRITE8_HANDLER( avalance_video_invert_w )
{
- avalnche_state *state = space->machine->driver_data<avalnche_state>();
+ avalnche_state *state = space->machine().driver_data<avalnche_state>();
state->avalance_video_inverted = data & 0x01;
}
static WRITE8_HANDLER( catch_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE8_HANDLER( avalance_credit_1_lamp_w )
{
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
}
static WRITE8_HANDLER( avalance_credit_2_lamp_w )
{
- set_led_status(space->machine, 1, data & 1);
+ set_led_status(space->machine(), 1, data & 1);
}
static WRITE8_HANDLER( avalance_start_lamp_w )
{
- set_led_status(space->machine, 2, data & 1);
+ set_led_status(space->machine(), 2, data & 1);
}
static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8 )
@@ -241,14 +241,14 @@ static INTERRUPT_GEN( avalnche_interrupt )
static MACHINE_START( avalnche )
{
- avalnche_state *state = machine->driver_data<avalnche_state>();
+ avalnche_state *state = machine.driver_data<avalnche_state>();
state->save_item(NAME(state->avalance_video_inverted));
}
static MACHINE_RESET( avalnche )
{
- avalnche_state *state = machine->driver_data<avalnche_state>();
+ avalnche_state *state = machine.driver_data<avalnche_state>();
state->avalance_video_inverted = 0;
}
diff --git a/src/mame/drivers/avt.c b/src/mame/drivers/avt.c
index ad8b77ed4b3..2e492e3f2a4 100644
--- a/src/mame/drivers/avt.c
+++ b/src/mame/drivers/avt.c
@@ -434,7 +434,7 @@ public:
static WRITE8_HANDLER( avt_videoram_w )
{
- avt_state *state = space->machine->driver_data<avt_state>();
+ avt_state *state = space->machine().driver_data<avt_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -442,7 +442,7 @@ static WRITE8_HANDLER( avt_videoram_w )
static WRITE8_HANDLER( avt_colorram_w )
{
- avt_state *state = space->machine->driver_data<avt_state>();
+ avt_state *state = space->machine().driver_data<avt_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -450,7 +450,7 @@ static WRITE8_HANDLER( avt_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- avt_state *state = machine->driver_data<avt_state>();
+ avt_state *state = machine.driver_data<avt_state>();
/* - bits -
7654 3210
xxxx ---- color code.
@@ -466,14 +466,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( avt )
{
- avt_state *state = machine->driver_data<avt_state>();
+ avt_state *state = machine.driver_data<avt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 28, 32);
}
static SCREEN_UPDATE( avt )
{
- avt_state *state = screen->machine->driver_data<avt_state>();
+ avt_state *state = screen->machine().driver_data<avt_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -494,7 +494,7 @@ static PALETTE_INIT( avt )
/* 0000BGRI */
if (color_prom == 0) return;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int bit1, bit2, bit3, r, g, b, inten, intenmin, intenmax, i;
diff --git a/src/mame/drivers/aztarac.c b/src/mame/drivers/aztarac.c
index 43d1f306433..0e231e13905 100644
--- a/src/mame/drivers/aztarac.c
+++ b/src/mame/drivers/aztarac.c
@@ -37,7 +37,7 @@ static IRQ_CALLBACK(aztarac_irq_callback)
static MACHINE_RESET( aztarac )
{
- device_set_irq_callback(machine->device("maincpu"), aztarac_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), aztarac_irq_callback);
}
@@ -50,7 +50,7 @@ static MACHINE_RESET( aztarac )
static READ16_HANDLER( nvram_r )
{
- aztarac_state *state = space->machine->driver_data<aztarac_state>();
+ aztarac_state *state = space->machine().driver_data<aztarac_state>();
return state->m_nvram[offset] | 0xfff0;
}
@@ -64,8 +64,8 @@ static READ16_HANDLER( nvram_r )
static READ16_HANDLER( joystick_r )
{
- return (((input_port_read(space->machine, "STICKZ") - 0xf) << 8) |
- ((input_port_read(space->machine, "STICKY") - 0xf) & 0xff));
+ return (((input_port_read(space->machine(), "STICKZ") - 0xf) << 8) |
+ ((input_port_read(space->machine(), "STICKY") - 0xf) & 0xff));
}
diff --git a/src/mame/drivers/backfire.c b/src/mame/drivers/backfire.c
index bc86e0d1e7a..318cf502ae0 100644
--- a/src/mame/drivers/backfire.c
+++ b/src/mame/drivers/backfire.c
@@ -59,7 +59,7 @@ public:
/* I'm using the functions in deco16ic.c ... same chips, why duplicate code? */
static VIDEO_START( backfire )
{
- backfire_state *state = machine->driver_data<backfire_state>();
+ backfire_state *state = machine.driver_data<backfire_state>();
state->spriteram_1 = auto_alloc_array(machine, UINT16, 0x2000/2);
state->spriteram_2 = auto_alloc_array(machine, UINT16, 0x2000/2);
@@ -84,10 +84,10 @@ static VIDEO_START( backfire )
static SCREEN_UPDATE( backfire )
{
- backfire_state *state = screen->machine->driver_data<backfire_state>();
+ backfire_state *state = screen->machine().driver_data<backfire_state>();
//FIXME: flip_screen_x should not be written!
- flip_screen_set_no_update(screen->machine, 1);
+ flip_screen_set_no_update(screen->machine(), 1);
/* screen 1 uses pf1 as the forground and pf3 as the background */
/* screen 2 uses pf2 as the foreground and pf4 as the background */
@@ -97,40 +97,40 @@ static SCREEN_UPDATE( backfire )
if (screen == state->lscreen)
{
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap, cliprect, 0x100);
if (state->left_priority[0] == 0)
{
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 1);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 0x800);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_1, 0x800);
}
else if (state->left_priority[0] == 2)
{
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
deco16ic_tilemap_1_draw(state->deco_tilegen2, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_1, 0x800);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_1, 0x800);
}
else
popmessage( "unknown left priority %08x", state->left_priority[0]);
}
else if (screen == state->rscreen)
{
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap, cliprect, 0x500);
if (state->right_priority[0] == 0)
{
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 1);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 0x800);
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_2, 0x800);
}
else if (state->right_priority[0] == 2)
{
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
deco16ic_tilemap_2_draw(state->deco_tilegen2, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen2")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram_2, 0x800);
+ screen->machine().device<decospr_device>("spritegen2")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram_2, 0x800);
}
else
popmessage( "unknown right priority %08x", state->right_priority[0]);
@@ -143,34 +143,34 @@ static SCREEN_UPDATE( backfire )
static READ32_DEVICE_HANDLER( backfire_eeprom_r )
{
/* some kind of screen indicator? checked by backfirea set before it will boot */
- int backfire_screen = device->machine->rand() & 1;
- return ((eeprom_read_bit(device) << 24) | input_port_read(device->machine, "IN0")
- | ((input_port_read(device->machine, "IN2") & 0xbf) << 16)
- | ((input_port_read(device->machine, "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
+ int backfire_screen = device->machine().rand() & 1;
+ return ((eeprom_read_bit(device) << 24) | input_port_read(device->machine(), "IN0")
+ | ((input_port_read(device->machine(), "IN2") & 0xbf) << 16)
+ | ((input_port_read(device->machine(), "IN3") & 0x40) << 16)) ^ (backfire_screen << 26) ;
}
static READ32_HANDLER( backfire_control2_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
- return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine, "IN1") | (input_port_read(space->machine, "IN1") << 16);
+ return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine(), "IN1") | (input_port_read(space->machine(), "IN1") << 16);
}
#ifdef UNUSED_FUNCTION
static READ32_HANDLER(backfire_control3_r)
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
// logerror("%08x:Read eprom %08x (%08x)\n", cpu_get_pc(space->cpu), offset << 1, mem_mask);
- return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine, "IN2") | (input_port_read(space->machine, "IN2") << 16);
+ return (eeprom_read_bit(state->eeprom) << 24) | input_port_read(space->machine(), "IN2") | (input_port_read(space->machine(), "IN2") << 16);
}
#endif
static WRITE32_DEVICE_HANDLER(backfire_eeprom_w)
{
- logerror("%s:write eprom %08x (%08x) %08x\n",device->machine->describe_context(),offset<<1,mem_mask,data);
+ logerror("%s:write eprom %08x (%08x) %08x\n",device->machine().describe_context(),offset<<1,mem_mask,data);
if (ACCESSING_BITS_0_7)
{
eeprom_set_clock_line(device, BIT(data, 1) ? ASSERT_LINE : CLEAR_LINE);
@@ -182,49 +182,49 @@ static WRITE32_DEVICE_HANDLER(backfire_eeprom_w)
static WRITE32_HANDLER(backfire_nonbuffered_palette_w)
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> 0),pal5bit(space->machine().generic.paletteram.u32[offset] >> 5),pal5bit(space->machine().generic.paletteram.u32[offset] >> 10));
}
/* map 32-bit writes to 16-bit */
-static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = space->machine->driver_data<backfire_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
-static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
-static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
-static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
-static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = space->machine->driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
+static READ32_HANDLER( backfire_pf1_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( backfire_pf2_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( backfire_pf3_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf3_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( backfire_pf4_rowscroll_r ) { backfire_state *state = space->machine().driver_data<backfire_state>(); return state->pf4_rowscroll[offset] ^ 0xffff0000; }
+static WRITE32_HANDLER( backfire_pf1_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
+static WRITE32_HANDLER( backfire_pf2_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
+static WRITE32_HANDLER( backfire_pf3_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
+static WRITE32_HANDLER( backfire_pf4_rowscroll_w ) { backfire_state *state = space->machine().driver_data<backfire_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
#ifdef UNUSED_FUNCTION
READ32_HANDLER( backfire_unknown_wheel_r )
{
- return input_port_read(space->machine, "PADDLE0");
+ return input_port_read(space->machine(), "PADDLE0");
}
READ32_HANDLER( backfire_wheel1_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
READ32_HANDLER( backfire_wheel2_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
static READ32_HANDLER( backfire_spriteram1_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
return state->spriteram_1[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( backfire_spriteram1_w )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -233,13 +233,13 @@ static WRITE32_HANDLER( backfire_spriteram1_w )
static READ32_HANDLER( backfire_spriteram2_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
return state->spriteram_2[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( backfire_spriteram2_w )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
@@ -440,14 +440,14 @@ static const deco16ic_interface backfire_deco16ic_tilegen2_intf =
static MACHINE_START( backfire )
{
- backfire_state *state = machine->driver_data<backfire_state>();
-
- state->maincpu = machine->device("maincpu");
- state->deco_tilegen1 = machine->device("tilegen1");
- state->deco_tilegen2 = machine->device("tilegen2");
- state->lscreen = machine->device("lscreen");
- state->rscreen = machine->device("rscreen");
- state->eeprom = machine->device("eeprom");
+ backfire_state *state = machine.driver_data<backfire_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
+ state->deco_tilegen2 = machine.device("tilegen2");
+ state->lscreen = machine.device("lscreen");
+ state->rscreen = machine.device("rscreen");
+ state->eeprom = machine.device("eeprom");
}
UINT16 backfire_pri_callback(UINT16 x)
@@ -639,9 +639,9 @@ ROM_START( backfirea )
ROM_LOAD( "mbz-06.19l", 0x200000, 0x080000, CRC(4a38c635) SHA1(7f0fb6a7a4aa6774c04fa38e53ceff8744fe1e9f) )
ROM_END
-static void descramble_sound( running_machine *machine )
+static void descramble_sound( running_machine &machine )
{
- UINT8 *rom = machine->region("ymz")->base();
+ UINT8 *rom = machine.region("ymz")->base();
int length = 0x200000; // only the first rom is swapped on backfire!
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
@@ -667,7 +667,7 @@ static void descramble_sound( running_machine *machine )
static READ32_HANDLER( backfire_speedup_r )
{
- backfire_state *state = space->machine->driver_data<backfire_state>();
+ backfire_state *state = space->machine().driver_data<backfire_state>();
//mame_printf_debug( "%08x\n",cpu_get_pc(space->cpu));
@@ -683,9 +683,9 @@ static DRIVER_INIT( backfire )
deco56_decrypt_gfx(machine, "gfx1"); /* 141 */
deco56_decrypt_gfx(machine, "gfx2"); /* 141 */
deco156_decrypt(machine);
- machine->device("maincpu")->set_clock_scale(4.0f); /* core timings aren't accurate */
+ machine.device("maincpu")->set_clock_scale(4.0f); /* core timings aren't accurate */
descramble_sound(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0170018, 0x017001b, FUNC(backfire_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0170018, 0x017001b, FUNC(backfire_speedup_r) );
}
GAME( 1995, backfire, 0, backfire, backfire, backfire, ROT0, "Data East Corporation", "Backfire! (set 1)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/badlands.c b/src/mame/drivers/badlands.c
index fce8e50410c..01052bb1fda 100644
--- a/src/mame/drivers/badlands.c
+++ b/src/mame/drivers/badlands.c
@@ -176,9 +176,9 @@ Measurements -
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -186,19 +186,19 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
- address_space *space = screen.machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* sound IRQ is on 32V */
if (scanline & 32)
atarigen_6502_irq_ack_r(space, 0);
- else if (!(input_port_read(screen.machine, "FE4000") & 0x40))
- atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
+ else if (!(input_port_read(screen.machine(), "FE4000") & 0x40))
+ atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
}
static MACHINE_START( badlands )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
atarigen_init(machine);
@@ -208,15 +208,15 @@ static MACHINE_START( badlands )
static MACHINE_RESET( badlands )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
state->pedal_value[0] = state->pedal_value[1] = 0x80;
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_sound_io_reset(machine.device("audiocpu"));
memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}
@@ -230,8 +230,8 @@ static MACHINE_RESET( badlands )
static INTERRUPT_GEN( vblank_int )
{
- badlands_state *state = device->machine->driver_data<badlands_state>();
- int pedal_state = input_port_read(device->machine, "PEDALS");
+ badlands_state *state = device->machine().driver_data<badlands_state>();
+ int pedal_state = input_port_read(device->machine(), "PEDALS");
int i;
/* update the pedals once per frame */
@@ -255,7 +255,7 @@ static INTERRUPT_GEN( vblank_int )
static READ16_HANDLER( sound_busy_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
int temp = 0xfeff;
if (state->cpu_to_sound_ready) temp ^= 0x0100;
return temp;
@@ -264,14 +264,14 @@ static READ16_HANDLER( sound_busy_r )
static READ16_HANDLER( pedal_0_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
return state->pedal_value[0];
}
static READ16_HANDLER( pedal_1_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
return state->pedal_value[1];
}
@@ -285,7 +285,7 @@ static READ16_HANDLER( pedal_1_r )
static READ8_HANDLER( audio_io_r )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
int result = 0xff;
switch (offset & 0x206)
@@ -309,8 +309,8 @@ static READ8_HANDLER( audio_io_r )
0x02 = coin 2
0x01 = coin 1
*/
- result = input_port_read(space->machine, "AUDIO");
- if (!(input_port_read(space->machine, "FE4000") & 0x0080)) result ^= 0x90;
+ result = input_port_read(space->machine(), "AUDIO");
+ if (!(input_port_read(space->machine(), "FE4000") & 0x0080)) result ^= 0x90;
if (state->cpu_to_sound_ready) result ^= 0x40;
if (state->sound_to_cpu_ready) result ^= 0x20;
result ^= 0x10;
@@ -334,7 +334,7 @@ static READ8_HANDLER( audio_io_r )
static WRITE8_HANDLER( audio_io_w )
{
- badlands_state *state = space->machine->driver_data<badlands_state>();
+ badlands_state *state = space->machine().driver_data<badlands_state>();
switch (offset & 0x206)
{
@@ -588,11 +588,11 @@ ROM_END
static DRIVER_INIT( badlands )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
/* initialize the audio system */
- state->bank_base = &machine->region("audiocpu")->base()[0x03000];
- state->bank_source_data = &machine->region("audiocpu")->base()[0x10000];
+ state->bank_base = &machine.region("audiocpu")->base()[0x03000];
+ state->bank_source_data = &machine.region("audiocpu")->base()[0x10000];
}
@@ -681,9 +681,9 @@ static GFXDECODE_START( badlandsb )
GFXDECODE_ENTRY( "gfx2", 0, molayout, 128, 8 )
GFXDECODE_END
-static void update_interrupts_bootleg(running_machine *machine)
+static void update_interrupts_bootleg(running_machine &machine)
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -692,23 +692,23 @@ static void scanline_update_bootleg(screen_device &screen, int scanline)
{
/* sound IRQ is on 32V */
// if (scanline & 32)
-// atarigen_6502_irq_ack_r(screen->machine, 0);
+// atarigen_6502_irq_ack_r(screen->machine(), 0);
// else if (!(input_port_read(machine, "FE4000") & 0x40))
-// atarigen_6502_irq_gen(screen->machine->device("audiocpu"));
+// atarigen_6502_irq_gen(screen->machine().device("audiocpu"));
}
static MACHINE_RESET( badlandsb )
{
- badlands_state *state = machine->driver_data<badlands_state>();
+ badlands_state *state = machine.driver_data<badlands_state>();
// state->pedal_value[0] = state->pedal_value[1] = 0x80;
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts_bootleg);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update_bootleg, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update_bootleg, 32);
-// atarigen_sound_io_reset(machine->device("audiocpu"));
+// atarigen_sound_io_reset(machine.device("audiocpu"));
// memcpy(state->bank_base, &state->bank_source_data[0x0000], 0x1000);
}
diff --git a/src/mame/drivers/bagman.c b/src/mame/drivers/bagman.c
index 8037504551b..9b57f01d39a 100644
--- a/src/mame/drivers/bagman.c
+++ b/src/mame/drivers/bagman.c
@@ -69,8 +69,8 @@ DIP locations verified for:
static WRITE8_DEVICE_HANDLER( bagman_ls259_w )
{
- bagman_state *state = device->machine->driver_data<bagman_state>();
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ bagman_state *state = device->machine().driver_data<bagman_state>();
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
bagman_pal16r6_w(space, offset,data); /*this is just a simulation*/
if (state->ls259_buf[offset] != (data&1) )
@@ -99,7 +99,7 @@ static WRITE8_DEVICE_HANDLER( bagman_ls259_w )
static WRITE8_HANDLER( bagman_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
static WRITE8_DEVICE_HANDLER( bagman_interrupt_w )
@@ -378,10 +378,10 @@ static const ay8910_interface ay8910_config =
I don't know if the following is correct, there can possbily be multiple solutions for the same problem. */
static READ8_DEVICE_HANDLER( dial_input_p1_r )
{
- bagman_state *state = device->machine->driver_data<bagman_state>();
+ bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val;
- dial_val = input_port_read(device->machine, "DIAL_P1");
+ dial_val = input_port_read(device->machine(), "DIAL_P1");
if(state->p1_res != 0x60)
state->p1_res = 0x60;
@@ -394,15 +394,15 @@ static READ8_DEVICE_HANDLER( dial_input_p1_r )
state->p1_old_val = dial_val;
- return (input_port_read(device->machine, "P1") & 0x9f) | (state->p1_res);
+ return (input_port_read(device->machine(), "P1") & 0x9f) | (state->p1_res);
}
static READ8_DEVICE_HANDLER( dial_input_p2_r )
{
- bagman_state *state = device->machine->driver_data<bagman_state>();
+ bagman_state *state = device->machine().driver_data<bagman_state>();
UINT8 dial_val;
- dial_val = input_port_read(device->machine, "DIAL_P2");
+ dial_val = input_port_read(device->machine(), "DIAL_P2");
if(state->p2_res != 0x60)
state->p2_res = 0x60;
@@ -415,7 +415,7 @@ static READ8_DEVICE_HANDLER( dial_input_p2_r )
state->p2_old_val = dial_val;
- return (input_port_read(device->machine, "P2") & 0x9f) | (state->p2_res);
+ return (input_port_read(device->machine(), "P2") & 0x9f) | (state->p2_res);
}
static const ay8910_interface ay8910_dial_config =
@@ -930,11 +930,11 @@ ROM_END
static DRIVER_INIT( bagman )
{
- bagman_state *state = machine->driver_data<bagman_state>();
+ bagman_state *state = machine.driver_data<bagman_state>();
/* Unmap video enable register, not available on earlier hardware revision(s)
Bagman is supposed to have glitches during screen transitions */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xa003, 0xa003);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0xa003, 0xa003);
*state->video_enable = 1;
}
diff --git a/src/mame/drivers/balsente.c b/src/mame/drivers/balsente.c
index 0d120ed7826..493a4599e48 100644
--- a/src/mame/drivers/balsente.c
+++ b/src/mame/drivers/balsente.c
@@ -2038,7 +2038,7 @@ ROM_END
#define EXPAND_NONE 0x3f
#define SWAP_HALVES 0x80
-static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
+static void expand_roms(running_machine &machine, UINT8 cd_rom_mask)
{
/* load AB bank data from 0x10000-0x20000 */
/* load CD bank data from 0x20000-0x2e000 */
@@ -2047,8 +2047,8 @@ static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
UINT8 *temp = auto_alloc_array(machine, UINT8, 0x20000);
{
- UINT8 *rom = machine->region("maincpu")->base();
- UINT32 len = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT32 len = machine.region("maincpu")->bytes();
UINT32 base;
for (base = 0x10000; base < len; base += 0x30000)
@@ -2104,9 +2104,9 @@ static void expand_roms(running_machine *machine, UINT8 cd_rom_mask)
}
}
-INLINE void config_shooter_adc(running_machine *machine, UINT8 shooter, UINT8 adc_shift)
+INLINE void config_shooter_adc(running_machine &machine, UINT8 shooter, UINT8 adc_shift)
{
- balsente_state *state = machine->driver_data<balsente_state>();
+ balsente_state *state = machine.driver_data<balsente_state>();
state->shooter = shooter;
state->adc_shift = adc_shift;
}
@@ -2122,7 +2122,7 @@ static DRIVER_INIT( stocker ) { expand_roms(machine, EXPAND_ALL); config_shoot
static DRIVER_INIT( triviag1 ) { expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( triviag2 )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memcpy(&rom[0x20000], &rom[0x28000], 0x4000);
memcpy(&rom[0x24000], &rom[0x28000], 0x4000);
expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0 /* noanalog */);
@@ -2134,48 +2134,48 @@ static DRIVER_INIT( minigolf2 ) { expand_roms(machine, 0x0c); config_shoo
static DRIVER_INIT( toggle ) { expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( nametune )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine, FALSE, 0 /* noanalog */);
}
static DRIVER_INIT( nstocker )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_NONE | SWAP_HALVES); config_shooter_adc(machine, TRUE, 1);
}
static DRIVER_INIT( sfootbal )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine, FALSE, 0);
}
static DRIVER_INIT( spiker )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_readwrite_handler(0x9f80, 0x9f8f, FUNC(spiker_expand_r), FUNC(spiker_expand_w));
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, EXPAND_ALL | SWAP_HALVES); config_shooter_adc(machine, FALSE, 1);
}
static DRIVER_INIT( stompin )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_write_handler(0x9f00, 0x9f00, FUNC(balsente_rombank2_select_w));
expand_roms(machine, 0x0c | SWAP_HALVES); config_shooter_adc(machine, FALSE, 32);
}
static DRIVER_INIT( rescraid ) { expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0 /* noanalog */); }
static DRIVER_INIT( grudge )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_read_handler(0x9400, 0x9400, FUNC(grudge_steering_r));
expand_roms(machine, EXPAND_NONE); config_shooter_adc(machine, FALSE, 0);
}
static DRIVER_INIT( shrike )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_legacy_readwrite_handler(0x9e00, 0x9fff, FUNC(shrike_shared_6809_r), FUNC(shrike_shared_6809_w));
space->install_legacy_write_handler(0x9e01, 0x9e01, FUNC(shrike_sprite_select_w) );
- machine->device("68k")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x10000, 0x1001f, FUNC(shrike_io_68k_r), FUNC(shrike_io_68k_w));
+ machine.device("68k")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x10000, 0x1001f, FUNC(shrike_io_68k_r), FUNC(shrike_io_68k_w));
expand_roms(machine, EXPAND_ALL); config_shooter_adc(machine, FALSE, 32);
}
diff --git a/src/mame/drivers/bankp.c b/src/mame/drivers/bankp.c
index ef3763f07cc..77a9af2dca4 100644
--- a/src/mame/drivers/bankp.c
+++ b/src/mame/drivers/bankp.c
@@ -261,7 +261,7 @@ GFXDECODE_END
static MACHINE_RESET( bankp )
{
- bankp_state *state = machine->driver_data<bankp_state>();
+ bankp_state *state = machine.driver_data<bankp_state>();
state->scroll_x = 0;
state->priority = 0;
diff --git a/src/mame/drivers/baraduke.c b/src/mame/drivers/baraduke.c
index 081da1797ae..90161364850 100644
--- a/src/mame/drivers/baraduke.c
+++ b/src/mame/drivers/baraduke.c
@@ -113,36 +113,36 @@ DIP locations verified for:
static WRITE8_HANDLER( inputport_select_w )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
if ((data & 0xe0) == 0x60)
state->inputport_selected = data & 0x07;
else if ((data & 0xe0) == 0xc0)
{
- coin_lockout_global_w(space->machine, ~data & 1);
- coin_counter_w(space->machine, 0,data & 2);
- coin_counter_w(space->machine, 1,data & 4);
+ coin_lockout_global_w(space->machine(), ~data & 1);
+ coin_counter_w(space->machine(), 0,data & 2);
+ coin_counter_w(space->machine(), 1,data & 4);
}
}
static READ8_HANDLER( inputport_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
switch (state->inputport_selected)
{
case 0x00: /* DSW A (bits 0-4) */
- return (input_port_read(space->machine, "DSWA") & 0xf8) >> 3;
+ return (input_port_read(space->machine(), "DSWA") & 0xf8) >> 3;
case 0x01: /* DSW A (bits 5-7), DSW B (bits 0-1) */
- return ((input_port_read(space->machine, "DSWA") & 0x07) << 2) | ((input_port_read(space->machine, "DSWB") & 0xc0) >> 6);
+ return ((input_port_read(space->machine(), "DSWA") & 0x07) << 2) | ((input_port_read(space->machine(), "DSWB") & 0xc0) >> 6);
case 0x02: /* DSW B (bits 2-6) */
- return (input_port_read(space->machine, "DSWB") & 0x3e) >> 1;
+ return (input_port_read(space->machine(), "DSWB") & 0x3e) >> 1;
case 0x03: /* DSW B (bit 7), DSW C (bits 0-3) */
- return ((input_port_read(space->machine, "DSWB") & 0x01) << 4) | (input_port_read(space->machine, "EDGE") & 0x0f);
+ return ((input_port_read(space->machine(), "DSWB") & 0x01) << 4) | (input_port_read(space->machine(), "EDGE") & 0x0f);
case 0x04: /* coins, start */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x05: /* 2P controls */
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x06: /* 1P controls */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
default:
return 0xff;
}
@@ -150,13 +150,13 @@ static READ8_HANDLER( inputport_r )
static WRITE8_HANDLER( baraduke_lamps_w )
{
- set_led_status(space->machine, 0,data & 0x08);
- set_led_status(space->machine, 1,data & 0x10);
+ set_led_status(space->machine(), 0,data & 0x08);
+ set_led_status(space->machine(), 1,data & 0x10);
}
static WRITE8_HANDLER( baraduke_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -175,7 +175,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( soundkludge_r )
{
- baraduke_state *state = space->machine->driver_data<baraduke_state>();
+ baraduke_state *state = space->machine().driver_data<baraduke_state>();
return ((state->counter++) >> 4) & 0xff;
}
@@ -539,7 +539,7 @@ static DRIVER_INIT( baraduke )
int i;
/* unpack the third tile ROM */
- rom = machine->region("gfx2")->base() + 0x8000;
+ rom = machine.region("gfx2")->base() + 0x8000;
for (i = 0x2000;i < 0x4000;i++)
{
rom[i + 0x2000] = rom[i];
diff --git a/src/mame/drivers/batman.c b/src/mame/drivers/batman.c
index 1016a1e93f2..764b816d15c 100644
--- a/src/mame/drivers/batman.c
+++ b/src/mame/drivers/batman.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
cputag_set_input_line(machine, "maincpu", 4, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -40,7 +40,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( batman )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
atarigen_init(machine);
state->save_item(NAME(state->latch_data));
@@ -50,12 +50,12 @@ static MACHINE_START( batman )
static MACHINE_RESET( batman )
{
- batman_state *state = machine->driver_data<batman_state>();
+ batman_state *state = machine.driver_data<batman_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarivc_reset(*machine->primary_screen, state->atarivc_eof_data, 2);
- atarigen_scanline_timer_reset(*machine->primary_screen, batman_scanline_update, 8);
+ atarivc_reset(*machine.primary_screen, state->atarivc_eof_data, 2);
+ atarigen_scanline_timer_reset(*machine.primary_screen, batman_scanline_update, 8);
atarijsa_reset();
}
@@ -69,13 +69,13 @@ static MACHINE_RESET( batman )
static READ16_HANDLER( batman_atarivc_r )
{
- return atarivc_r(*space->machine->primary_screen, offset);
+ return atarivc_r(*space->machine().primary_screen, offset);
}
static WRITE16_HANDLER( batman_atarivc_w )
{
- atarivc_w(*space->machine->primary_screen, offset, data, mem_mask);
+ atarivc_w(*space->machine().primary_screen, offset, data, mem_mask);
}
@@ -88,8 +88,8 @@ static WRITE16_HANDLER( batman_atarivc_w )
static READ16_HANDLER( special_port2_r )
{
- batman_state *state = space->machine->driver_data<batman_state>();
- int result = input_port_read(space->machine, "260010");
+ batman_state *state = space->machine().driver_data<batman_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->sound_to_cpu_ready) result ^= 0x0010;
if (state->cpu_to_sound_ready) result ^= 0x0020;
return result;
@@ -98,20 +98,20 @@ static READ16_HANDLER( special_port2_r )
static WRITE16_HANDLER( latch_w )
{
- batman_state *state = space->machine->driver_data<batman_state>();
+ batman_state *state = space->machine().driver_data<batman_state>();
int oldword = state->latch_data;
COMBINE_DATA(&state->latch_data);
/* bit 4 is connected to the /RESET pin on the 6502 */
if (state->latch_data & 0x0010)
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "jsa", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "jsa", INPUT_LINE_RESET, ASSERT_LINE);
/* alpha bank is selected by the upper 4 bits */
if ((oldword ^ state->latch_data) & 0x7000)
{
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
tilemap_mark_all_tiles_dirty(state->alpha_tilemap);
state->alpha_tile_bank = (state->latch_data >> 12) & 7;
}
diff --git a/src/mame/drivers/battlane.c b/src/mame/drivers/battlane.c
index 01d5a783753..94a1b790380 100644
--- a/src/mame/drivers/battlane.c
+++ b/src/mame/drivers/battlane.c
@@ -22,7 +22,7 @@
static WRITE8_HANDLER( battlane_cpu_command_w )
{
- battlane_state *state = space->machine->driver_data<battlane_state>();
+ battlane_state *state = space->machine().driver_data<battlane_state>();
state->cpu_control = data;
@@ -36,7 +36,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
0x01 = Y Scroll MSB
*/
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
/*
I think that the NMI is an inhibitor. It is constantly set
@@ -81,7 +81,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
static INTERRUPT_GEN( battlane_cpu1_interrupt )
{
- battlane_state *state = device->machine->driver_data<battlane_state>();
+ battlane_state *state = device->machine().driver_data<battlane_state>();
/* See note in battlane_cpu_command_w */
if (~state->cpu_control & 0x08)
@@ -258,7 +258,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- battlane_state *state = device->machine->driver_data<battlane_state>();
+ battlane_state *state = device->machine().driver_data<battlane_state>();
device_set_input_line(state->maincpu, M6809_FIRQ_LINE, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -276,10 +276,10 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( battlane )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->video_ctrl));
state->save_item(NAME(state->cpu_control));
@@ -287,7 +287,7 @@ static MACHINE_START( battlane )
static MACHINE_RESET( battlane )
{
- battlane_state *state = machine->driver_data<battlane_state>();
+ battlane_state *state = machine.driver_data<battlane_state>();
state->video_ctrl = 0;
state->cpu_control = 0;
diff --git a/src/mame/drivers/battlera.c b/src/mame/drivers/battlera.c
index f8f80199025..6856bfba569 100644
--- a/src/mame/drivers/battlera.c
+++ b/src/mame/drivers/battlera.c
@@ -36,7 +36,7 @@ static WRITE8_HANDLER( battlera_sound_w )
if (offset == 0)
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
}
@@ -44,20 +44,20 @@ static WRITE8_HANDLER( battlera_sound_w )
static WRITE8_HANDLER( control_data_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
state->control_port_select=data;
}
static READ8_HANDLER( control_data_r )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
switch (state->control_port_select)
{
- case 0xfe: return input_port_read(space->machine, "IN0"); /* Player 1 */
- case 0xfd: return input_port_read(space->machine, "IN1"); /* Player 2 */
- case 0xfb: return input_port_read(space->machine, "IN2"); /* Coins */
- case 0xf7: return input_port_read(space->machine, "DSW2"); /* Dip 2 */
- case 0xef: return input_port_read(space->machine, "DSW1"); /* Dip 1 */
+ case 0xfe: return input_port_read(space->machine(), "IN0"); /* Player 1 */
+ case 0xfd: return input_port_read(space->machine(), "IN1"); /* Player 2 */
+ case 0xfb: return input_port_read(space->machine(), "IN2"); /* Coins */
+ case 0xf7: return input_port_read(space->machine(), "DSW2"); /* Dip 2 */
+ case 0xef: return input_port_read(space->machine(), "DSW1"); /* Dip 1 */
}
return 0xff;
@@ -87,19 +87,19 @@ ADDRESS_MAP_END
static void battlera_adpcm_int(device_t *device)
{
- battlera_state *state = device->machine->driver_data<battlera_state>();
+ battlera_state *state = device->machine().driver_data<battlera_state>();
msm5205_data_w(device,state->msm5205next >> 4);
state->msm5205next <<= 4;
state->toggle = 1 - state->toggle;
if (state->toggle)
- cputag_set_input_line(device->machine, "audiocpu", 1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 1, HOLD_LINE);
}
static WRITE8_HANDLER( battlera_adpcm_data_w )
{
- battlera_state *state = space->machine->driver_data<battlera_state>();
+ battlera_state *state = space->machine().driver_data<battlera_state>();
state->msm5205next = data;
}
diff --git a/src/mame/drivers/battlex.c b/src/mame/drivers/battlex.c
index 4731c08b3e8..e2e8a368bc4 100644
--- a/src/mame/drivers/battlex.c
+++ b/src/mame/drivers/battlex.c
@@ -51,18 +51,18 @@
static INTERRUPT_GEN( battlex_interrupt )
{
- battlex_state *state = device->machine->driver_data<battlex_state>();
+ battlex_state *state = device->machine().driver_data<battlex_state>();
state->in0_b4 = 1;
device_set_input_line(device, 0, ASSERT_LINE);
}
static CUSTOM_INPUT( battlex_in0_b4_r )
{
- battlex_state *state = field->port->machine->driver_data<battlex_state>();
+ battlex_state *state = field->port->machine().driver_data<battlex_state>();
UINT32 ret = state->in0_b4;
if (state->in0_b4)
{
- cputag_set_input_line(field->port->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", 0, CLEAR_LINE);
state->in0_b4 = 0;
}
@@ -229,7 +229,7 @@ static const ay8910_interface battlex_ay8910_interface =
static MACHINE_START( battlex )
{
- battlex_state *state = machine->driver_data<battlex_state>();
+ battlex_state *state = machine.driver_data<battlex_state>();
/* register for save states */
state->save_item(NAME(state->scroll_lsb));
@@ -240,7 +240,7 @@ static MACHINE_START( battlex )
static MACHINE_RESET( battlex )
{
- battlex_state *state = machine->driver_data<battlex_state>();
+ battlex_state *state = machine.driver_data<battlex_state>();
state->scroll_lsb = 0;
state->scroll_msb = 0;
@@ -318,9 +318,9 @@ ROM_END
static DRIVER_INIT( battlex )
{
- UINT8 *colormask = machine->region("user1")->base();
- UINT8 *gfxdata = machine->region("user2")->base();
- UINT8 *dest = machine->region("gfx1")->base();
+ UINT8 *colormask = machine.region("user1")->base();
+ UINT8 *gfxdata = machine.region("user2")->base();
+ UINT8 *dest = machine.region("gfx1")->base();
int tile, line, bit;
diff --git a/src/mame/drivers/battlnts.c b/src/mame/drivers/battlnts.c
index 37ed70e1e81..c0342e10b45 100644
--- a/src/mame/drivers/battlnts.c
+++ b/src/mame/drivers/battlnts.c
@@ -27,25 +27,25 @@
static INTERRUPT_GEN( battlnts_interrupt )
{
- battlnts_state *state = device->machine->driver_data<battlnts_state>();
+ battlnts_state *state = device->machine().driver_data<battlnts_state>();
if (k007342_is_int_enabled(state->k007342))
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( battlnts_sh_irqtrigger_w )
{
- battlnts_state *state = space->machine->driver_data<battlnts_state>();
+ battlnts_state *state = space->machine().driver_data<battlnts_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( battlnts_bankswitch_w )
{
/* bits 6 & 7 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(), "bank1", (data & 0xc0) >> 6);
/* bits 4 & 5 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
/* other bits unknown */
}
@@ -220,14 +220,14 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( battlnts )
{
- battlnts_state *state = machine->driver_data<battlnts_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ battlnts_state *state = machine.driver_data<battlnts_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
- state->k007342 = machine->device("k007342");
- state->k007420 = machine->device("k007420");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007342 = machine.device("k007342");
+ state->k007420 = machine.device("k007420");
state->save_item(NAME(state->spritebank));
state->save_item(NAME(state->layer_colorbase));
@@ -235,7 +235,7 @@ static MACHINE_START( battlnts )
static MACHINE_RESET( battlnts )
{
- battlnts_state *state = machine->driver_data<battlnts_state>();
+ battlnts_state *state = machine.driver_data<battlnts_state>();
state->layer_colorbase[0] = 0;
state->layer_colorbase[1] = 0;
@@ -402,7 +402,7 @@ static void shuffle( UINT8 *buf, int len )
static DRIVER_INIT( rackemup )
{
/* rearrange char ROM */
- shuffle(machine->region("gfx1")->base(), machine->region("gfx1")->bytes());
+ shuffle(machine.region("gfx1")->base(), machine.region("gfx1")->bytes());
}
diff --git a/src/mame/drivers/bbusters.c b/src/mame/drivers/bbusters.c
index a8394091df1..e469a57c667 100644
--- a/src/mame/drivers/bbusters.c
+++ b/src/mame/drivers/bbusters.c
@@ -239,14 +239,14 @@ Country :
static READ16_HANDLER( sound_status_r )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
return state->sound_status;
}
static WRITE8_HANDLER( sound_status_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
state->sound_status = data;
}
@@ -256,24 +256,24 @@ static WRITE16_HANDLER( sound_cpu_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data&0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
/* Eprom is byte wide, top half of word _must_ be 0xff */
static READ16_HANDLER( eprom_r )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
return (state->eprom_data[offset]&0xff) | 0xff00;
}
static READ16_HANDLER( control_3_r )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
static const char *const port[] = { "GUNX1", "GUNY1", "GUNX2", "GUNY2", "GUNX3", "GUNY3" };
- UINT16 retdata = input_port_read(space->machine, port[state->gun_select]);
+ UINT16 retdata = input_port_read(space->machine(), port[state->gun_select]);
retdata >>=1; // by lowering the precision of the gun reading hardware the game seems to work better
@@ -282,7 +282,7 @@ static READ16_HANDLER( control_3_r )
static WRITE16_HANDLER( gun_select_w )
{
- bbusters_state *state = space->machine->driver_data<bbusters_state>();
+ bbusters_state *state = space->machine().driver_data<bbusters_state>();
logerror("%08x: gun r\n",cpu_get_pc(space->cpu));
@@ -314,8 +314,8 @@ static READ16_HANDLER( mechatt_gun_r )
{
int x, y;
- x = input_port_read(space->machine, offset ? "GUNX2" : "GUNX1");
- y = input_port_read(space->machine, offset ? "GUNY2" : "GUNY1");
+ x = input_port_read(space->machine(), offset ? "GUNX2" : "GUNX1");
+ y = input_port_read(space->machine(), offset ? "GUNY2" : "GUNY1");
/* Todo - does the hardware really clamp like this? */
x += 0x18;
@@ -644,7 +644,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int irq )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2608_interface ym2608_config =
@@ -666,7 +666,7 @@ static const ym2610_interface ym2610_config =
static SCREEN_EOF( bbuster )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
buffer_spriteram16_2_w(space,0,0,0xffff);
@@ -674,7 +674,7 @@ static SCREEN_EOF( bbuster )
static SCREEN_EOF( mechatt )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space,0,0,0xffff);
}
diff --git a/src/mame/drivers/beaminv.c b/src/mame/drivers/beaminv.c
index b2e6c087728..b00e80401e2 100644
--- a/src/mame/drivers/beaminv.c
+++ b/src/mame/drivers/beaminv.c
@@ -92,7 +92,7 @@ static const int interrupt_lines[INTERRUPTS_PER_FRAME] = { 0x00, 0x80 };
static TIMER_CALLBACK( interrupt_callback )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
int interrupt_number = param;
int next_interrupt_number;
int next_vpos;
@@ -103,22 +103,22 @@ static TIMER_CALLBACK( interrupt_callback )
next_interrupt_number = (interrupt_number + 1) % INTERRUPTS_PER_FRAME;
next_vpos = interrupt_lines[next_interrupt_number];
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_interrupt_number);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(next_vpos), next_interrupt_number);
}
-static void create_interrupt_timer( running_machine *machine )
+static void create_interrupt_timer( running_machine &machine )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(interrupt_callback));
+ beaminv_state *state = machine.driver_data<beaminv_state>();
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(interrupt_callback));
}
-static void start_interrupt_timer( running_machine *machine )
+static void start_interrupt_timer( running_machine &machine )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
int vpos = interrupt_lines[0];
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -131,10 +131,10 @@ static void start_interrupt_timer( running_machine *machine )
static MACHINE_START( beaminv )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
create_interrupt_timer(machine);
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
/* setup for save states */
state->save_item(NAME(state->controller_select));
@@ -150,7 +150,7 @@ static MACHINE_START( beaminv )
static MACHINE_RESET( beaminv )
{
- beaminv_state *state = machine->driver_data<beaminv_state>();
+ beaminv_state *state = machine.driver_data<beaminv_state>();
start_interrupt_timer(machine);
state->controller_select = 0;
@@ -166,7 +166,7 @@ static MACHINE_RESET( beaminv )
static SCREEN_UPDATE( beaminv )
{
- beaminv_state *state = screen->machine->driver_data<beaminv_state>();
+ beaminv_state *state = screen->machine().driver_data<beaminv_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -193,7 +193,7 @@ static SCREEN_UPDATE( beaminv )
static READ8_HANDLER( v128_r )
{
- return (space->machine->primary_screen->vpos() >> 7) & 0x01;
+ return (space->machine().primary_screen->vpos() >> 7) & 0x01;
}
@@ -210,7 +210,7 @@ static READ8_HANDLER( v128_r )
static WRITE8_HANDLER( controller_select_w )
{
- beaminv_state *state = space->machine->driver_data<beaminv_state>();
+ beaminv_state *state = space->machine().driver_data<beaminv_state>();
/* 0x01 (player 1) or 0x02 (player 2) */
state->controller_select = data;
}
@@ -218,8 +218,8 @@ static WRITE8_HANDLER( controller_select_w )
static READ8_HANDLER( controller_r )
{
- beaminv_state *state = space->machine->driver_data<beaminv_state>();
- return input_port_read(space->machine, (state->controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
+ beaminv_state *state = space->machine().driver_data<beaminv_state>();
+ return input_port_read(space->machine(), (state->controller_select == 1) ? P1_CONTROL_PORT_TAG : P2_CONTROL_PORT_TAG);
}
diff --git a/src/mame/drivers/beathead.c b/src/mame/drivers/beathead.c
index 4a60d20e403..026c8b219d7 100644
--- a/src/mame/drivers/beathead.c
+++ b/src/mame/drivers/beathead.c
@@ -116,15 +116,15 @@
static TIMER_DEVICE_CALLBACK( scanline_callback )
{
- beathead_state *state = timer.machine->driver_data<beathead_state>();
+ beathead_state *state = timer.machine().driver_data<beathead_state>();
int scanline = param;
/* update the video */
- timer.machine->primary_screen->update_now();
+ timer.machine().primary_screen->update_now();
/* on scanline zero, clear any halt condition */
if (scanline == 0)
- cputag_set_input_line(timer.machine, "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", INPUT_LINE_HALT, CLEAR_LINE);
/* wrap around at 262 */
scanline++;
@@ -136,17 +136,17 @@ static TIMER_DEVICE_CALLBACK( scanline_callback )
state->update_interrupts();
/* set the timer for the next one */
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline) - state->m_hblank_offset, scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline) - state->m_hblank_offset, scanline);
}
void beathead_state::machine_start()
{
- atarigen_init(&m_machine);
+ atarigen_init(m_machine);
}
-static void update_interrupts(running_machine *machine) { machine->driver_data<beathead_state>()->update_interrupts(); }
+static void update_interrupts(running_machine &machine) { machine.driver_data<beathead_state>()->update_interrupts(); }
void beathead_state::machine_reset()
{
/* reset the common subsystems */
@@ -192,7 +192,7 @@ void beathead_state::update_interrupts()
{
m_irq_line_state = gen_int;
//if (m_irq_line_state != CLEAR_LINE)
- cputag_set_input_line(&m_machine, "maincpu", ASAP_IRQ0, m_irq_line_state);
+ cputag_set_input_line(m_machine, "maincpu", ASAP_IRQ0, m_irq_line_state);
//else
//asap_set_irq_line(ASAP_IRQ0, m_irq_line_state);
}
@@ -257,7 +257,7 @@ WRITE32_MEMBER( beathead_state::eeprom_enable_w )
READ32_MEMBER( beathead_state::input_2_r )
{
- int result = input_port_read(&m_machine, "IN2");
+ int result = input_port_read(m_machine, "IN2");
if (sound_to_cpu_ready) result ^= 0x10;
if (cpu_to_sound_ready) result ^= 0x20;
return result;
@@ -287,7 +287,7 @@ WRITE32_MEMBER( beathead_state::sound_data_w )
WRITE32_MEMBER( beathead_state::sound_reset_w )
{
logerror("Sound reset = %d\n", !offset);
- cputag_set_input_line(&m_machine, "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(m_machine, "jsa", INPUT_LINE_RESET, offset ? CLEAR_LINE : ASSERT_LINE);
}
@@ -300,7 +300,7 @@ WRITE32_MEMBER( beathead_state::sound_reset_w )
WRITE32_MEMBER( beathead_state::coin_count_w )
{
- coin_counter_w(&m_machine, 0, !offset);
+ coin_counter_w(m_machine, 0, !offset);
}
@@ -497,7 +497,7 @@ READ32_MEMBER( beathead_state::movie_speedup_r )
static DRIVER_INIT( beathead )
{
- beathead_state *state = machine->driver_data<beathead_state>();
+ beathead_state *state = machine.driver_data<beathead_state>();
/* initialize the common systems */
atarijsa_init(machine, "IN2", 0x0040);
diff --git a/src/mame/drivers/berzerk.c b/src/mame/drivers/berzerk.c
index 41ca0e44afe..79a4908978d 100644
--- a/src/mame/drivers/berzerk.c
+++ b/src/mame/drivers/berzerk.c
@@ -72,7 +72,7 @@ static const UINT8 nmi_trigger_v256s [NMIS_PER_FRAME] = { 0x00, 0x00, 0x00, 0x00
static READ8_HANDLER( led_on_r )
{
- set_led_status(space->machine, 0, 1);
+ set_led_status(space->machine(), 0, 1);
return 0;
}
@@ -80,13 +80,13 @@ static READ8_HANDLER( led_on_r )
static WRITE8_HANDLER( led_on_w )
{
- set_led_status(space->machine, 0, 1);
+ set_led_status(space->machine(), 0, 1);
}
static READ8_HANDLER( led_off_r )
{
- set_led_status(space->machine, 0, 0);
+ set_led_status(space->machine(), 0, 0);
return 0;
}
@@ -94,7 +94,7 @@ static READ8_HANDLER( led_off_r )
static WRITE8_HANDLER( led_off_w )
{
- set_led_status(space->machine, 0, 0);
+ set_led_status(space->machine(), 0, 0);
}
@@ -155,14 +155,14 @@ static int vsync_chain_counter_to_vpos(UINT8 counter, UINT8 v256)
static WRITE8_HANDLER( irq_enable_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->irq_enabled = data & 0x01;
}
static TIMER_CALLBACK( irq_callback )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int irq_number = param;
UINT8 next_counter;
UINT8 next_v256;
@@ -179,22 +179,22 @@ static TIMER_CALLBACK( irq_callback )
next_v256 = irq_trigger_v256s[next_irq_number];
next_vpos = vsync_chain_counter_to_vpos(next_counter, next_v256);
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_irq_number);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(next_vpos), next_irq_number);
}
-static void create_irq_timer(running_machine *machine)
+static void create_irq_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_callback));
+ berzerk_state *state = machine.driver_data<berzerk_state>();
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_callback));
}
-static void start_irq_timer(running_machine *machine)
+static void start_irq_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int vpos = vsync_chain_counter_to_vpos(irq_trigger_counts[0], irq_trigger_v256s[0]);
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -214,21 +214,21 @@ static void start_irq_timer(running_machine *machine)
static WRITE8_HANDLER( nmi_enable_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 1;
}
static WRITE8_HANDLER( nmi_disable_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 0;
}
static READ8_HANDLER( nmi_enable_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 1;
return 0;
@@ -237,7 +237,7 @@ static READ8_HANDLER( nmi_enable_r )
static READ8_HANDLER( nmi_disable_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
state->nmi_enabled = 0;
return 0;
@@ -246,7 +246,7 @@ static READ8_HANDLER( nmi_disable_r )
static TIMER_CALLBACK( nmi_callback )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int nmi_number = param;
UINT8 next_counter;
UINT8 next_v256;
@@ -263,22 +263,22 @@ static TIMER_CALLBACK( nmi_callback )
next_v256 = nmi_trigger_v256s[next_nmi_number];
next_vpos = vsync_chain_counter_to_vpos(next_counter, next_v256);
- state->nmi_timer->adjust(machine->primary_screen->time_until_pos(next_vpos), next_nmi_number);
+ state->nmi_timer->adjust(machine.primary_screen->time_until_pos(next_vpos), next_nmi_number);
}
-static void create_nmi_timer(running_machine *machine)
+static void create_nmi_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(nmi_callback));
+ berzerk_state *state = machine.driver_data<berzerk_state>();
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(nmi_callback));
}
-static void start_nmi_timer(running_machine *machine)
+static void start_nmi_timer(running_machine &machine)
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
int vpos = vsync_chain_counter_to_vpos(nmi_trigger_counts[0], nmi_trigger_v256s[0]);
- state->nmi_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->nmi_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
@@ -291,7 +291,7 @@ static void start_nmi_timer(running_machine *machine)
static MACHINE_START( berzerk )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
create_irq_timer(machine);
create_nmi_timer(machine);
@@ -313,7 +313,7 @@ static MACHINE_START( berzerk )
static MACHINE_RESET( berzerk )
{
- berzerk_state *state = machine->driver_data<berzerk_state>();
+ berzerk_state *state = machine.driver_data<berzerk_state>();
state->irq_enabled = 0;
state->nmi_enabled = 0;
set_led_status(machine, 0, 0);
@@ -349,7 +349,7 @@ static VIDEO_START( berzerk )
static WRITE8_HANDLER( magicram_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
UINT8 alu_output;
UINT8 current_video_data = state->videoram[offset];
@@ -388,7 +388,7 @@ static WRITE8_HANDLER( magicram_w )
static WRITE8_HANDLER( magicram_control_w )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
/* save the control byte, clear the shift data latch,
and set the intercept flip-flop */
state->magicram_control = data;
@@ -399,17 +399,17 @@ static WRITE8_HANDLER( magicram_control_w )
static READ8_HANDLER( intercept_v256_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
UINT8 counter;
UINT8 v256;
- vpos_to_vsync_chain_counter(space->machine->primary_screen->vpos(), &counter, &v256);
+ vpos_to_vsync_chain_counter(space->machine().primary_screen->vpos(), &counter, &v256);
return (!state->intercept << 7) | v256;
}
-static void get_pens(running_machine *machine, pen_t *pens)
+static void get_pens(running_machine &machine, pen_t *pens)
{
static const int resistances_wg[] = { 750, 0 };
static const int resistances_el[] = { 1.0 / ((1.0 / 750.0) + (1.0 / 360.0)), 0 };
@@ -446,11 +446,11 @@ static void get_pens(running_machine *machine, pen_t *pens)
static SCREEN_UPDATE( berzerk )
{
- berzerk_state *state = screen->machine->driver_data<berzerk_state>();
+ berzerk_state *state = screen->machine().driver_data<berzerk_state>();
pen_t pens[NUM_PENS];
offs_t offs;
- get_pens(screen->machine, pens);
+ get_pens(screen->machine(), pens);
for (offs = 0; offs < state->videoram_size; offs++)
{
@@ -501,7 +501,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
{
/* offset 4 writes to the S14001A */
case 4:
- device = space->machine->device("speech");
+ device = space->machine().device("speech");
switch (data >> 6)
{
/* write data to the S14001 */
@@ -519,7 +519,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
break;
case 1:
- device = space->machine->device("speech");
+ device = space->machine().device("speech");
/* volume */
s14001a_set_volume(device, ((data & 0x38) >> 3) + 1);
@@ -537,12 +537,12 @@ static WRITE8_HANDLER( berzerk_audio_w )
/* offset 6 writes to the sfxcontrol latch */
case 6:
- exidy_sfxctrl_w(space->machine->device("exidy"), data >> 6, data);
+ exidy_sfxctrl_w(space->machine().device("exidy"), data >> 6, data);
break;
/* everything else writes to the 6840 */
default:
- exidy_sh6840_w(space->machine->device("exidy"), offset, data);
+ exidy_sh6840_w(space->machine().device("exidy"), offset, data);
break;
}
@@ -551,7 +551,7 @@ static WRITE8_HANDLER( berzerk_audio_w )
static READ8_HANDLER( berzerk_audio_r )
{
- device_t *device = space->machine->device("speech");
+ device_t *device = space->machine().device("speech");
switch (offset)
{
/* offset 4 reads from the S14001A */
@@ -563,7 +563,7 @@ static READ8_HANDLER( berzerk_audio_r )
return 0;
/* everything else reads from the 6840 */
default:
- return exidy_sh6840_r(space->machine->device("exidy"), offset);
+ return exidy_sh6840_r(space->machine().device("exidy"), offset);
}
}
@@ -571,7 +571,7 @@ static READ8_HANDLER( berzerk_audio_r )
static SOUND_RESET(berzerk)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
/* clears the flip-flop controlling the volume and freq on the speech chip */
berzerk_audio_w(space, 4, 0x40);
}
@@ -887,16 +887,16 @@ INPUT_PORTS_END
static READ8_HANDLER( moonwarp_p1_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
// This seems to be the same type of dial as the later 'moon war 2' set uses
// see http://www.cityofberwyn.com/schematics/stern/MoonWar_opto.tiff for schematic
// I.e. a 74ls161 counts from 0 to 15 which is the absolute number of bars passed on the quadrature
// one difference is it lacks the strobe input (does it?), which if not active causes
// the dial input to go open bus. This is used in moon war 2 to switch between player 1
// and player 2 dials, which share a single port. moonwarp uses separate ports for the dials.
- signed char dialread = input_port_read(space->machine,"P1_DIAL");
+ signed char dialread = input_port_read(space->machine(),"P1_DIAL");
UINT8 ret;
- UINT8 buttons = (input_port_read(space->machine,"P1")&0xe0);
+ UINT8 buttons = (input_port_read(space->machine(),"P1")&0xe0);
if (dialread < 0) state->p1_direction = 0;
else if (dialread > 0) state->p1_direction = 0x10;
state->p1_counter_74ls161 += abs(dialread);
@@ -908,11 +908,11 @@ static READ8_HANDLER( moonwarp_p1_r )
static READ8_HANDLER( moonwarp_p2_r )
{
- berzerk_state *state = space->machine->driver_data<berzerk_state>();
+ berzerk_state *state = space->machine().driver_data<berzerk_state>();
// same as above, but for player 2 in cocktail mode
- signed char dialread = input_port_read(space->machine,"P2_DIAL");
+ signed char dialread = input_port_read(space->machine(),"P2_DIAL");
UINT8 ret;
- UINT8 buttons = (input_port_read(space->machine,"P2")&0xe0);
+ UINT8 buttons = (input_port_read(space->machine(),"P2")&0xe0);
if (dialread < 0) state->p2_direction = 0;
else if (dialread > 0) state->p2_direction = 0x10;
state->p2_counter_74ls161 += abs(dialread);
@@ -1209,7 +1209,7 @@ ROM_END
static DRIVER_INIT( moonwarp )
{
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
io->install_legacy_read_handler (0x48, 0x48, FUNC(moonwarp_p1_r));
io->install_legacy_read_handler (0x4a, 0x4a, FUNC(moonwarp_p2_r));
}
diff --git a/src/mame/drivers/bestleag.c b/src/mame/drivers/bestleag.c
index 4c429abf262..b2cdc7e07d9 100644
--- a/src/mame/drivers/bestleag.c
+++ b/src/mame/drivers/bestleag.c
@@ -46,7 +46,7 @@ public:
static TILE_GET_INFO( get_tx_tile_info )
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
int code = state->txram[tile_index];
SET_TILE_INFO(
@@ -58,7 +58,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
int code = state->bgram[tile_index];
SET_TILE_INFO(
@@ -70,7 +70,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
int code = state->fgram[tile_index];
SET_TILE_INFO(
@@ -93,7 +93,7 @@ static TILEMAP_MAPPER( bsb_bg_scan )
static VIDEO_START(bestleag)
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_cols,8,8,256, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,bsb_bg_scan,16,16,128, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,bsb_bg_scan,16,16,128, 64);
@@ -107,9 +107,9 @@ Note: sprite chip is different than the other Big Striker sets and they
include several similiarities with other Playmark games (including
the sprite end code and the data being offset (i.e. spriteram starting from 0x16/2))
*/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- bestleag_state *state = machine->driver_data<bestleag_state>();
+ bestleag_state *state = machine.driver_data<bestleag_state>();
UINT16 *spriteram16 = state->spriteram;
/*
@@ -136,26 +136,26 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
if(state->vregs[0x00/2] & 0x1000)
color &= 7;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, 0,
flipx ? (sx+16) : (sx),sy,15);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code+1,
color,
flipx, 0,
flipx ? (sx) : (sx+16),sy,15);
/* wraparound x */
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code,
color,
flipx, 0,
flipx ? (sx+16 - 512) : (sx - 512),sy,15);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[2],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[2],
code+1,
color,
flipx, 0,
@@ -165,7 +165,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static SCREEN_UPDATE(bestleag)
{
- bestleag_state *state = screen->machine->driver_data<bestleag_state>();
+ bestleag_state *state = screen->machine().driver_data<bestleag_state>();
tilemap_set_scrollx(state->bg_tilemap,0,(state->vregs[0x00/2] & 0xfff) + (state->vregs[0x08/2] & 0x7) - 3);
tilemap_set_scrolly(state->bg_tilemap,0,state->vregs[0x02/2]);
tilemap_set_scrollx(state->tx_tilemap,0,state->vregs[0x04/2]);
@@ -175,14 +175,14 @@ static SCREEN_UPDATE(bestleag)
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
static SCREEN_UPDATE(bestleaw)
{
- bestleag_state *state = screen->machine->driver_data<bestleag_state>();
+ bestleag_state *state = screen->machine().driver_data<bestleag_state>();
tilemap_set_scrollx(state->bg_tilemap,0,state->vregs[0x08/2]);
tilemap_set_scrolly(state->bg_tilemap,0,state->vregs[0x0a/2]);
tilemap_set_scrollx(state->tx_tilemap,0,state->vregs[0x00/2]);
@@ -192,28 +192,28 @@ static SCREEN_UPDATE(bestleaw)
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->tx_tilemap,0,0);
return 0;
}
static WRITE16_HANDLER( bestleag_txram_w )
{
- bestleag_state *state = space->machine->driver_data<bestleag_state>();
+ bestleag_state *state = space->machine().driver_data<bestleag_state>();
state->txram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
static WRITE16_HANDLER( bestleag_bgram_w )
{
- bestleag_state *state = space->machine->driver_data<bestleag_state>();
+ bestleag_state *state = space->machine().driver_data<bestleag_state>();
state->bgram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE16_HANDLER( bestleag_fgram_w )
{
- bestleag_state *state = space->machine->driver_data<bestleag_state>();
+ bestleag_state *state = space->machine().driver_data<bestleag_state>();
state->fgram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
diff --git a/src/mame/drivers/bfcobra.c b/src/mame/drivers/bfcobra.c
index c0f13dd5b18..142fb2f4c64 100644
--- a/src/mame/drivers/bfcobra.c
+++ b/src/mame/drivers/bfcobra.c
@@ -92,7 +92,7 @@
/*
Function prototypes
*/
-INLINE void z80_bank(running_machine *machine, int num, int data);
+INLINE void z80_bank(running_machine &machine, int num, int data);
/***************************************************************************
@@ -319,7 +319,7 @@ static const UINT8 col76index[] = {0, 2, 4, 7};
static VIDEO_START( bfcobra )
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
int i;
memcpy(state->col4bit, col4bit_default, sizeof(state->col4bit));
@@ -341,7 +341,7 @@ static VIDEO_START( bfcobra )
static SCREEN_UPDATE( bfcobra )
{
- bfcobra_state *state = screen->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = screen->machine().driver_data<bfcobra_state>();
int x, y;
UINT8 *src;
UINT32 *dest;
@@ -385,13 +385,13 @@ static SCREEN_UPDATE( bfcobra )
if ( ( state->videomode & 0x81 ) == 1 || (state->videomode & 0x80 && pen & 0x80) )
{
- *dest++ = screen->machine->pens[hirescol[pen & 0x0f]];
- *dest++ = screen->machine->pens[hirescol[(pen >> 4) & 0x0f]];
+ *dest++ = screen->machine().pens[hirescol[pen & 0x0f]];
+ *dest++ = screen->machine().pens[hirescol[(pen >> 4) & 0x0f]];
}
else
{
- *dest++ = screen->machine->pens[lorescol[pen]];
- *dest++ = screen->machine->pens[lorescol[pen]];
+ *dest++ = screen->machine().pens[lorescol[pen]];
+ *dest++ = screen->machine().pens[lorescol[pen]];
}
}
}
@@ -399,20 +399,20 @@ static SCREEN_UPDATE( bfcobra )
return 0;
}
-INLINE UINT8* blitter_get_addr(running_machine *machine, UINT32 addr)
+INLINE UINT8* blitter_get_addr(running_machine &machine, UINT32 addr)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
if (addr < 0x10000)
{
/* Is this region fixed? */
- return (UINT8*)(machine->region("user1")->base() + addr);
+ return (UINT8*)(machine.region("user1")->base() + addr);
}
else if(addr < 0x20000)
{
addr &= 0xffff;
addr += (state->bank_data[0] & 1) ? 0x10000 : 0;
- return (UINT8*)(machine->region("user1")->base() + addr + ((state->bank_data[0] >> 1) * 0x20000));
+ return (UINT8*)(machine.region("user1")->base() + addr + ((state->bank_data[0] >> 1) * 0x20000));
}
else if (addr >= 0x20000 && addr < 0x40000)
{
@@ -432,9 +432,9 @@ INLINE UINT8* blitter_get_addr(running_machine *machine, UINT32 addr)
*/
static void RunBlit(address_space *space)
{
-#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space->machine, blitter.program.addr++))
+#define BLITPRG_READ(x) blitter.x = *(blitter_get_addr(space->machine(), blitter.program.addr++))
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct blitter_t &blitter = state->blitter;
int cycles_used = 0;
@@ -462,7 +462,7 @@ static void RunBlit(address_space *space)
/* This debug is now wrong ! */
if (DEBUG_BLITTER)
{
- mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine->describe_context(), blitter.program.addr - 12);
+ mame_printf_debug("\n%s:Blitter: Running command from 0x%.5x\n\n", device->machine().describe_context(), blitter.program.addr - 12);
mame_printf_debug("Command Reg %.2x", blitter.command);
mame_printf_debug(" %s %s %s %s %s %s %s\n",
blitter.command & CMD_RUN ? "RUN" : " ",
@@ -544,7 +544,7 @@ static void RunBlit(address_space *space)
blitter.source.addr0 -=blitter.step;
}
- *blitter_get_addr(space->machine, blitter.dest.addr) = blitter.pattern;
+ *blitter_get_addr(space->machine(), blitter.dest.addr) = blitter.pattern;
cycles_used++;
} while (--innercnt);
@@ -558,7 +558,7 @@ static void RunBlit(address_space *space)
if (LOOPTYPE == 3 && innercnt == blitter.innercnt)
{
- srcdata = *(blitter_get_addr(space->machine, blitter.source.addr & 0xfffff));
+ srcdata = *(blitter_get_addr(space->machine(), blitter.source.addr & 0xfffff));
blitter.source.loword++;
cycles_used++;
}
@@ -568,7 +568,7 @@ static void RunBlit(address_space *space)
{
if (LOOPTYPE == 0 || LOOPTYPE == 1)
{
- srcdata = *(blitter_get_addr(space->machine, blitter.source.addr & 0xfffff));
+ srcdata = *(blitter_get_addr(space->machine(), blitter.source.addr & 0xfffff));
cycles_used++;
if (blitter.modectl & MODE_SSIGN)
@@ -583,7 +583,7 @@ static void RunBlit(address_space *space)
/* Read destination pixel? */
if (LOOPTYPE == 0)
{
- dstdata = *blitter_get_addr(space->machine, blitter.dest.addr & 0xfffff);
+ dstdata = *blitter_get_addr(space->machine(), blitter.dest.addr & 0xfffff);
cycles_used++;
}
@@ -652,10 +652,10 @@ static void RunBlit(address_space *space)
The existing destination pixel is used as a lookup
into the table and the colours is replaced.
*/
- UINT8 dest = *blitter_get_addr(space->machine, blitter.dest.addr);
- UINT8 newcol = *(blitter_get_addr(space->machine, (blitter.source.addr + dest) & 0xfffff));
+ UINT8 dest = *blitter_get_addr(space->machine(), blitter.dest.addr);
+ UINT8 newcol = *(blitter_get_addr(space->machine(), (blitter.source.addr + dest) & 0xfffff));
- *blitter_get_addr(space->machine, blitter.dest.addr) = newcol;
+ *blitter_get_addr(space->machine(), blitter.dest.addr) = newcol;
cycles_used += 3;
}
else
@@ -674,7 +674,7 @@ static void RunBlit(address_space *space)
if (blitter.compfunc & CMPFUNC_LOG0)
final_result |= ~result & ~dstdata;
- *blitter_get_addr(space->machine, blitter.dest.addr) = final_result;
+ *blitter_get_addr(space->machine(), blitter.dest.addr) = final_result;
cycles_used++;
}
}
@@ -720,7 +720,7 @@ static void RunBlit(address_space *space)
static READ8_HANDLER( ramdac_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct ramdac_t &ramdac = state->ramdac;
UINT8 val = 0xff;
@@ -733,7 +733,7 @@ static READ8_HANDLER( ramdac_r )
if (*count == 0)
{
rgb_t color;
- color = palette_get_color(space->machine, ramdac.addr_r);
+ color = palette_get_color(space->machine(), ramdac.addr_r);
ramdac.color_r[0] = RGB_RED(color);
ramdac.color_r[1] = RGB_GREEN(color);
@@ -763,7 +763,7 @@ static READ8_HANDLER( ramdac_r )
static WRITE8_HANDLER( ramdac_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct ramdac_t &ramdac = state->ramdac;
switch (offset & 3)
@@ -779,7 +779,7 @@ static WRITE8_HANDLER( ramdac_w )
ramdac.color_w[ramdac.count_w] = pal6bit(data);
if (++ramdac.count_w == 3)
{
- palette_set_color_rgb(space->machine, ramdac.addr_w, ramdac.color_w[0], ramdac.color_w[1], ramdac.color_w[2]);
+ palette_set_color_rgb(space->machine(), ramdac.addr_w, ramdac.color_w[0], ramdac.color_w[1], ramdac.color_w[2]);
ramdac.count_w = 0;
ramdac.addr_w++;
}
@@ -847,9 +847,9 @@ static WRITE8_HANDLER( ramdac_w )
***************************************************************************/
-static void update_irqs(running_machine *machine)
+static void update_irqs(running_machine &machine)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
int newstate = state->blitter_irq || state->vblank_irq || state->acia_irq;
if (newstate != state->irq_state)
@@ -861,7 +861,7 @@ static void update_irqs(running_machine *machine)
static READ8_HANDLER( chipset_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
UINT8 val = 0xff;
switch(offset)
@@ -885,7 +885,7 @@ static READ8_HANDLER( chipset_r )
val = 0x1;
/* TODO */
- update_irqs(space->machine);
+ update_irqs(space->machine());
break;
}
case 0x1C:
@@ -902,7 +902,7 @@ static READ8_HANDLER( chipset_r )
}
case 0x22:
{
- val = 0x40 | input_port_read(space->machine, "JOYSTICK");
+ val = 0x40 | input_port_read(space->machine(), "JOYSTICK");
break;
}
default:
@@ -916,7 +916,7 @@ static READ8_HANDLER( chipset_r )
static WRITE8_HANDLER( chipset_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
switch (offset)
{
case 0x01:
@@ -928,7 +928,7 @@ static WRITE8_HANDLER( chipset_w )
data &= 0x3f;
state->bank_data[offset] = data;
- z80_bank(space->machine, offset, data);
+ z80_bank(space->machine(), offset, data);
break;
}
@@ -1003,16 +1003,16 @@ static WRITE8_HANDLER( chipset_w )
}
}
-INLINE void z80_bank(running_machine *machine, int num, int data)
+INLINE void z80_bank(running_machine &machine, int num, int data)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
static const char * const bank_names[] = { "bank1", "bank2", "bank3" };
if (data < 0x08)
{
UINT32 offset = ((state->bank_data[0] >> 1) * 0x20000) + ((0x4000 * data) ^ ((state->bank_data[0] & 1) ? 0 : 0x10000));
- memory_set_bankptr(machine, bank_names[num - 1], machine->region("user1")->base() + offset);
+ memory_set_bankptr(machine, bank_names[num - 1], machine.region("user1")->base() + offset);
}
else if (data < 0x10)
{
@@ -1026,11 +1026,11 @@ INLINE void z80_bank(running_machine *machine, int num, int data)
static WRITE8_HANDLER( rombank_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
state->bank_data[0] = data;
- z80_bank(space->machine, 1, state->bank_data[1]);
- z80_bank(space->machine, 2, state->bank_data[2]);
- z80_bank(space->machine, 3, state->bank_data[3]);
+ z80_bank(space->machine(), 1, state->bank_data[1]);
+ z80_bank(space->machine(), 2, state->bank_data[2]);
+ z80_bank(space->machine(), 3, state->bank_data[3]);
}
@@ -1079,9 +1079,9 @@ enum command
SCAN_HIGH_OR_EQUAL = 29
};
-static void reset_fdc(running_machine *machine)
+static void reset_fdc(running_machine &machine)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
memset(&state->fdc, 0, sizeof(state->fdc));
state->fdc.MSR = 0x80;
@@ -1090,7 +1090,7 @@ static void reset_fdc(running_machine *machine)
static READ8_HANDLER( fdctrl_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
UINT8 val = 0;
val = state->fdc.MSR;
@@ -1100,7 +1100,7 @@ static READ8_HANDLER( fdctrl_r )
static READ8_HANDLER( fddata_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct fdc_t &fdc = state->fdc;
#define BPS 1024
#define SPT 10
@@ -1130,7 +1130,7 @@ static READ8_HANDLER( fddata_r )
}
fdc.offset = (BPT * fdc.track*2) + (fdc.side ? BPT : 0) + (BPS * (fdc.sector-1)) + fdc.byte_pos++;
- val = *(space->machine->region("user2")->base() + fdc.offset);
+ val = *(space->machine().region("user2")->base() + fdc.offset);
/* Move on to next sector? */
if (fdc.byte_pos == 1024)
@@ -1174,7 +1174,7 @@ static READ8_HANDLER( fddata_r )
static WRITE8_HANDLER( fdctrl_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
struct fdc_t &fdc = state->fdc;
switch (fdc.phase)
{
@@ -1304,7 +1304,7 @@ WRITE8_HANDLER( fd_ctrl_w )
static MACHINE_RESET( bfcobra )
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
unsigned int pal;
for (pal = 0; pal < 256; ++pal)
@@ -1376,14 +1376,14 @@ static READ8_HANDLER( int_latch_r )
/* TODO */
static READ8_HANDLER( meter_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
return state->meter_latch;
}
/* TODO: This is borrowed from Scorpion 1 */
static WRITE8_HANDLER( meter_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
int i;
int changed = state->meter_latch ^ data;
@@ -1406,13 +1406,13 @@ static WRITE8_HANDLER( meter_w )
/* TODO */
static READ8_HANDLER( latch_r )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
return state->mux_input;
}
static WRITE8_HANDLER( latch_w )
{
- bfcobra_state *state = space->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = space->machine().driver_data<bfcobra_state>();
/* TODO: This is borrowed from Scorpion 1 */
switch(offset)
{
@@ -1430,7 +1430,7 @@ static WRITE8_HANDLER( latch_w )
/* Clock is low */
if (!(data & 0x08))
- state->mux_input = input_port_read(space->machine, port[input_strobe]);
+ state->mux_input = input_port_read(space->machine(), port[input_strobe]);
}
break;
}
@@ -1587,9 +1587,9 @@ INPUT_PORTS_END
/*
Allocate work RAM and video RAM shared by the Z80 and chipset.
*/
-static void init_ram(running_machine *machine)
+static void init_ram(running_machine &machine)
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
/* 768kB work RAM */
state->work_ram = auto_alloc_array_clear(machine, UINT8, 0xC0000);
@@ -1603,21 +1603,21 @@ static void init_ram(running_machine *machine)
static READ_LINE_DEVICE_HANDLER( z80_acia_rx_r )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
return state->m6809_z80_line;
}
static WRITE_LINE_DEVICE_HANDLER( z80_acia_tx_w )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->z80_m6809_line = state;
}
static WRITE_LINE_DEVICE_HANDLER( z80_acia_irq )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->acia_irq = state ? CLEAR_LINE : ASSERT_LINE;
- update_irqs(device->machine);
+ update_irqs(device->machine());
}
static ACIA6850_INTERFACE( z80_acia_if )
@@ -1634,19 +1634,19 @@ static ACIA6850_INTERFACE( z80_acia_if )
static READ_LINE_DEVICE_HANDLER( m6809_acia_rx_r )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
return state->z80_m6809_line;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_acia_tx_w )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->m6809_z80_line = state;
}
static WRITE_LINE_DEVICE_HANDLER( m6809_data_irq )
{
- cputag_set_input_line(device->machine, "audiocpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6809_IRQ_LINE, state ? CLEAR_LINE : ASSERT_LINE);
}
static ACIA6850_INTERFACE( m6809_acia_if )
@@ -1663,13 +1663,13 @@ static ACIA6850_INTERFACE( m6809_acia_if )
static READ_LINE_DEVICE_HANDLER( data_acia_rx_r )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
return state->data_r;
}
static WRITE_LINE_DEVICE_HANDLER( data_acia_tx_w )
{
- bfcobra_state *drvstate = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *drvstate = device->machine().driver_data<bfcobra_state>();
drvstate->data_t = state;
}
@@ -1690,7 +1690,7 @@ static ACIA6850_INTERFACE( data_acia_if )
/* TODO: Driver vs Machine Init */
static DRIVER_INIT( bfcobra )
{
- bfcobra_state *state = machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = machine.driver_data<bfcobra_state>();
/*
6809 ROM address and data lines are scrambled.
This is the same scrambling as Scorpion 2.
@@ -1703,7 +1703,7 @@ static DRIVER_INIT( bfcobra )
UINT8 *tmp;
tmp = auto_alloc_array(machine, UINT8, 0x8000);
- rom = machine->region("audiocpu")->base() + 0x8000;
+ rom = machine.region("audiocpu")->base() + 0x8000;
memcpy(tmp, rom, 0x8000);
for (i = 0; i < 0x8000; i++)
@@ -1732,7 +1732,7 @@ static DRIVER_INIT( bfcobra )
state->bank_data[3] = 0;
/* Fixed 16kB ROM region */
- memory_set_bankptr(machine, "bank4", machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank4", machine.region("user1")->base());
/* TODO: Properly sort out the data ACIA */
state->data_r = 1;
@@ -1762,9 +1762,9 @@ static INTERRUPT_GEN( timer_irq )
/* TODO */
static INTERRUPT_GEN( vblank_gen )
{
- bfcobra_state *state = device->machine->driver_data<bfcobra_state>();
+ bfcobra_state *state = device->machine().driver_data<bfcobra_state>();
state->vblank_irq = 1;
- update_irqs(device->machine);
+ update_irqs(device->machine());
}
static MACHINE_CONFIG_START( bfcobra, bfcobra_state )
diff --git a/src/mame/drivers/bfm_sc1.c b/src/mame/drivers/bfm_sc1.c
index 65846373d2a..ce735e23ebd 100644
--- a/src/mame/drivers/bfm_sc1.c
+++ b/src/mame/drivers/bfm_sc1.c
@@ -156,14 +156,14 @@ static int Scorpion1_GetSwitchState(bfm_sc1_state *drvstate, int strobe, int dat
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine,"bank1",data & 0x03);
+ memory_set_bank(space->machine(),"bank1",data & 0x03);
}
///////////////////////////////////////////////////////////////////////////
static INTERRUPT_GEN( timer_irq )
{
- bfm_sc1_state *state = device->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = device->machine().driver_data<bfm_sc1_state>();
if ( state->watchdog_kicked )
{
state->watchdog_cnt = 0;
@@ -174,7 +174,7 @@ static INTERRUPT_GEN( timer_irq )
state->watchdog_cnt++;
if ( state->watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine
{ // reset board
- device->machine->schedule_soft_reset();// reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
+ device->machine().schedule_soft_reset();// reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
return;
}
}
@@ -183,9 +183,9 @@ static INTERRUPT_GEN( timer_irq )
{
state->irq_status = 0x01 |0x02; //0xff;
- state->sc1_Inputs[2] = input_port_read(device->machine,"STROBE0");
+ state->sc1_Inputs[2] = input_port_read(device->machine(),"STROBE0");
- generic_pulse_irq_line(device->machine->device("maincpu"), M6809_IRQ_LINE);
+ generic_pulse_irq_line(device->machine().device("maincpu"), M6809_IRQ_LINE);
}
}
@@ -193,7 +193,7 @@ static INTERRUPT_GEN( timer_irq )
static READ8_HANDLER( irqlatch_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int result = state->irq_status | 0x02;
state->irq_status = 0;
@@ -205,7 +205,7 @@ static READ8_HANDLER( irqlatch_r )
static WRITE8_HANDLER( reel12_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
if ( state->locked & 0x01 )
{ // hardware is still state->locked,
if ( data == 0x46 ) state->locked &= ~0x01;
@@ -228,7 +228,7 @@ static WRITE8_HANDLER( reel12_w )
static WRITE8_HANDLER( reel34_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
if ( state->locked & 0x02 )
{ // hardware is still state->locked,
if ( data == 0x42 ) state->locked &= ~0x02;
@@ -251,7 +251,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( reel56_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
if ( stepper_update(4, (data>>4)&0x0f) ) state->reel_changed |= 0x10;
if ( stepper_update(5, data&0x0f ) ) state->reel_changed |= 0x20;
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( reel56_w )
static WRITE8_HANDLER( mmtr_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int i;
if ( state->locked & 0x04 )
{ // hardware is still state->locked,
@@ -286,7 +286,7 @@ static WRITE8_HANDLER( mmtr_w )
if ( changed & (1 << i) )
{
MechMtr_update(i, data & (1 << i) );
- generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
+ generic_pulse_irq_line(space->machine().device("maincpu"), M6809_FIRQ_LINE);
}
}
}
@@ -296,7 +296,7 @@ static WRITE8_HANDLER( mmtr_w )
static READ8_HANDLER( mmtr_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->mmtr_latch;
}
@@ -304,7 +304,7 @@ static READ8_HANDLER( mmtr_r )
static READ8_HANDLER( dipcoin_r )
{
- return input_port_read(space->machine,"STROBE0") & 0x1F;
+ return input_port_read(space->machine(),"STROBE0") & 0x1F;
}
///////////////////////////////////////////////////////////////////////////
@@ -318,7 +318,7 @@ static READ8_DEVICE_HANDLER( nec_r )
static WRITE8_HANDLER( vfd_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int changed = state->vfd_latch ^ data;
state->vfd_latch = data;
@@ -380,7 +380,7 @@ static const UINT8 BFM_strcnv[] =
static READ8_HANDLER( mux1latch_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->mux1_input;
}
@@ -402,7 +402,7 @@ static READ8_HANDLER( mux1dathi_r )
static WRITE8_HANDLER( mux1latch_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int changed = state->mux1_outputlatch ^ data;
static const char *const portnames[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7" };
state->mux1_outputlatch = data;
@@ -438,7 +438,7 @@ static WRITE8_HANDLER( mux1latch_w )
if ( !(data & 0x08) )
{
- state->sc1_Inputs[ input_strobe ] = input_port_read(space->machine,portnames[input_strobe]);
+ state->sc1_Inputs[ input_strobe ] = input_port_read(space->machine(),portnames[input_strobe]);
state->mux1_input = state->sc1_Inputs[ input_strobe ];
}
@@ -449,7 +449,7 @@ static WRITE8_HANDLER( mux1latch_w )
static WRITE8_HANDLER( mux1datlo_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux1_datalo = data;
}
@@ -457,7 +457,7 @@ static WRITE8_HANDLER( mux1datlo_w )
static WRITE8_HANDLER( mux1dathi_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux1_datahi = data;
}
@@ -465,7 +465,7 @@ static WRITE8_HANDLER( mux1dathi_w )
static READ8_HANDLER( mux2latch_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->mux2_input;
}
@@ -487,7 +487,7 @@ static READ8_HANDLER( mux2dathi_r )
static WRITE8_HANDLER( mux2latch_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
int changed = state->mux2_outputlatch ^ data;
state->mux2_outputlatch = data;
@@ -523,7 +523,7 @@ static WRITE8_HANDLER( mux2latch_w )
static WRITE8_HANDLER( mux2datlo_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux2_datalo = data;
}
@@ -531,7 +531,7 @@ static WRITE8_HANDLER( mux2datlo_w )
static WRITE8_HANDLER( mux2dathi_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->mux2_datahi = data;
}
@@ -539,7 +539,7 @@ static WRITE8_HANDLER( mux2dathi_w )
static WRITE8_HANDLER( watchdog_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->watchdog_kicked = 1;
}
@@ -561,7 +561,7 @@ static WRITE8_HANDLER( aciadata_w )
static READ8_HANDLER( aciastat_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->acia_status;
}
@@ -578,7 +578,7 @@ static READ8_HANDLER( aciadata_r )
static WRITE8_HANDLER( triac_w )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
state->triac_latch = data;
}
@@ -586,7 +586,7 @@ static WRITE8_HANDLER( triac_w )
static READ8_HANDLER( triac_r )
{
- bfm_sc1_state *state = space->machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = space->machine().driver_data<bfm_sc1_state>();
return state->triac_latch;
}
@@ -611,7 +611,7 @@ static WRITE8_DEVICE_HANDLER( nec_latch_w )
static WRITE8_HANDLER( vid_uart_tx_w )
{
adder2_send(data);
- cputag_set_input_line(space->machine, "adder2", M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ
+ cputag_set_input_line(space->machine(), "adder2", M6809_IRQ_LINE, ASSERT_LINE );//HOLD_LINE);// trigger IRQ
}
///////////////////////////////////////////////////////////////////////////
@@ -653,12 +653,12 @@ static const UINT8 DataDecode[]=
-static void decode_sc1(running_machine *machine,const char *rom_region)
+static void decode_sc1(running_machine &machine,const char *rom_region)
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
UINT8 *tmp, *rom;
- rom = machine->region(rom_region)->base();
+ rom = machine.region(rom_region)->base();
tmp = auto_alloc_array(machine, UINT8, 0x10000);
@@ -709,7 +709,7 @@ static void decode_sc1(running_machine *machine,const char *rom_region)
static MACHINE_RESET( bfm_sc1 )
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
BFM_BD1_init(0);
state->vfd_latch = 0;
state->mmtr_latch = 0;
@@ -749,7 +749,7 @@ static MACHINE_RESET( bfm_sc1 )
// init rom bank ////////////////////////////////////////////////////////////////////
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_configure_bank(machine,"bank1", 0, 1, &rom[0x10000], 0);
memory_configure_bank(machine,"bank1", 1, 3, &rom[0x02000], 0x02000);
@@ -1332,12 +1332,12 @@ ROM_END
/////////////////////////////////////////////////////////////////////////////////////
-static void sc1_common_init(running_machine *machine, int reels, int decrypt)
+static void sc1_common_init(running_machine &machine, int reels, int decrypt)
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
UINT8 *rom, i;
- rom = machine->region("maincpu")->base();
+ rom = machine.region("maincpu")->base();
if ( rom )
{
memcpy(&rom[0x10000], &rom[0x00000], 0x2000);
@@ -1389,7 +1389,7 @@ static DRIVER_INIT(rou029)
static DRIVER_INIT(clatt)
{
- bfm_sc1_state *state = machine->driver_data<bfm_sc1_state>();
+ bfm_sc1_state *state = machine.driver_data<bfm_sc1_state>();
sc1_common_init(machine,6,1);
MechMtr_config(machine,8);
diff --git a/src/mame/drivers/bfm_sc2.c b/src/mame/drivers/bfm_sc2.c
index 53b11567e34..faef1f9b5ef 100644
--- a/src/mame/drivers/bfm_sc2.c
+++ b/src/mame/drivers/bfm_sc2.c
@@ -237,8 +237,8 @@ public:
// local prototypes ///////////////////////////////////////////////////////
-static int read_e2ram(running_machine *machine);
-static void e2ram_reset(running_machine *machine);
+static int read_e2ram(running_machine &machine);
+static void e2ram_reset(running_machine &machine);
/* INPUTS layout
@@ -262,9 +262,9 @@ static void e2ram_reset(running_machine *machine);
// called if board is reset ///////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-static void on_scorpion2_reset(running_machine *machine)
+static void on_scorpion2_reset(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
state->vfd1_latch = 0;
state->vfd2_latch = 0;
state->mmtr_latch = 0;
@@ -330,7 +330,7 @@ send data to them, although obviously there's no response. */
// init rom bank ////////////////////////////////////////////////////////
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 1, &rom[0x10000], 0);
memory_configure_bank(machine, "bank1", 1, 3, &rom[0x02000], 0x02000);
@@ -341,9 +341,9 @@ send data to them, although obviously there's no response. */
///////////////////////////////////////////////////////////////////////////
-void Scorpion2_SetSwitchState(running_machine *machine, int strobe, int data, int state)
+void Scorpion2_SetSwitchState(running_machine &machine, int strobe, int data, int state)
{
- bfm_sc2_state *drvstate = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *drvstate = machine.driver_data<bfm_sc2_state>();
if ( strobe < 11 && data < 8 )
{
if ( strobe < 8 )
@@ -375,9 +375,9 @@ void Scorpion2_SetSwitchState(running_machine *machine, int strobe, int data, in
///////////////////////////////////////////////////////////////////////////
-int Scorpion2_GetSwitchState(running_machine *machine, int strobe, int data)
+int Scorpion2_GetSwitchState(running_machine &machine, int strobe, int data)
{
- bfm_sc2_state *drvstate = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *drvstate = machine.driver_data<bfm_sc2_state>();
int state = 0;
if ( strobe < 11 && data < 8 )
@@ -405,7 +405,7 @@ int Scorpion2_GetSwitchState(running_machine *machine, int strobe, int data)
static NVRAM_HANDLER( bfm_sc2 )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
static const UINT8 init_e2ram[10] = { 1, 4, 10, 20, 0, 1, 1, 4, 10, 20 };
if ( read_or_write )
{ // writing
@@ -429,7 +429,7 @@ static NVRAM_HANDLER( bfm_sc2 )
static WRITE8_HANDLER( watchdog_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->watchdog_kicked = 1;
}
@@ -437,14 +437,14 @@ static WRITE8_HANDLER( watchdog_w )
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1",data & 0x03);
+ memory_set_bank(space->machine(), "bank1",data & 0x03);
}
///////////////////////////////////////////////////////////////////////////
static INTERRUPT_GEN( timer_irq )
{
- bfm_sc2_state *state = device->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = device->machine().driver_data<bfm_sc2_state>();
state->timercnt++;
if ( state->watchdog_kicked )
@@ -457,8 +457,8 @@ static INTERRUPT_GEN( timer_irq )
state->watchdog_cnt++;
if ( state->watchdog_cnt > 2 ) // this is a hack, i don't know what the watchdog timeout is, 3 IRQ's works fine
{ // reset board
- device->machine->schedule_soft_reset(); // reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
- on_scorpion2_reset(device->machine);
+ device->machine().schedule_soft_reset(); // reset entire machine. CPU 0 should be enough, but that doesn't seem to work !!
+ on_scorpion2_reset(device->machine());
return;
}
}
@@ -476,7 +476,7 @@ static INTERRUPT_GEN( timer_irq )
static WRITE8_HANDLER( reel12_vid_w ) // in a video cabinet this is used to drive a hopper
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel12_latch = data;
if ( state->has_hopper )
@@ -512,7 +512,7 @@ static WRITE8_HANDLER( reel12_vid_w ) // in a video cabinet this is used to dri
static WRITE8_HANDLER( reel34_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel34_latch = data;
if ( stepper_update(2, data&0x0f ) ) state->reel_changed |= 0x04;
@@ -531,7 +531,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( reel56_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel56_latch = data;
if ( stepper_update(4, data&0x0f ) ) state->reel_changed |= 0x10;
@@ -552,7 +552,7 @@ static WRITE8_HANDLER( reel56_w )
static WRITE8_HANDLER( mmtr_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int i;
int changed = state->mmtr_latch ^ data;
@@ -565,14 +565,14 @@ static WRITE8_HANDLER( mmtr_w )
MechMtr_update(i, data & (1 << i) );
}
}
- if ( data & 0x1F ) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
+ if ( data & 0x1F ) cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( mux_output_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int i;
int off = offset<<3;
@@ -593,7 +593,7 @@ static WRITE8_HANDLER( mux_output_w )
static READ8_HANDLER( mux_input_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int result = 0xFF,t1,t2;
static const char *const port[] = { "STROBE0", "STROBE1", "STROBE2", "STROBE3", "STROBE4", "STROBE5", "STROBE6", "STROBE7", "STROBE8", "STROBE9", "STROBE10", "STROBE11" };
@@ -603,11 +603,11 @@ static READ8_HANDLER( mux_input_r )
t1 = state->input_override[offset]; // strobe 0-7 data 0-4
t2 = state->input_override[offset+idx]; // strobe 8-B data 0-4
- t1 = (state->sc2_Inputs[offset] & t1) | ( ( input_port_read(space->machine, port[offset]) & ~t1) & 0x1F);
+ t1 = (state->sc2_Inputs[offset] & t1) | ( ( input_port_read(space->machine(), port[offset]) & ~t1) & 0x1F);
if (idx == 8)
- t2 = (state->sc2_Inputs[offset+8] & t2) | ( ( input_port_read(space->machine, port[offset+8]) & ~t2) << 5);
+ t2 = (state->sc2_Inputs[offset+8] & t2) | ( ( input_port_read(space->machine(), port[offset+8]) & ~t2) << 5);
else
- t2 = (state->sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read(space->machine, port[offset+4]) & ~t2) << 2) & 0x60);
+ t2 = (state->sc2_Inputs[offset+4] & t2) | ( ( ( input_port_read(space->machine(), port[offset+4]) & ~t2) << 2) & 0x60);
state->sc2_Inputs[offset] = (state->sc2_Inputs[offset] & ~0x1F) | t1;
state->sc2_Inputs[offset+idx] = (state->sc2_Inputs[offset+idx] & ~0x60) | t2;
@@ -645,15 +645,15 @@ static WRITE8_HANDLER( unknown_w )
static WRITE8_HANDLER( volume_override_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int old = state->volume_override;
state->volume_override = data?1:0;
if ( old != state->volume_override )
{
- ym2413_device *ym = space->machine->device<ym2413_device>("ymsnd");
- upd7759_device *upd = space->machine->device<upd7759_device>("upd");
+ ym2413_device *ym = space->machine().device<ym2413_device>("ymsnd");
+ upd7759_device *upd = space->machine().device<upd7759_device>("upd");
float percent = state->volume_override? 1.0f : (32-state->global_volume)/32.0f;
ym->set_output_gain(0, percent);
@@ -674,7 +674,7 @@ static WRITE8_DEVICE_HANDLER( nec_reset_w )
static WRITE8_DEVICE_HANDLER( nec_latch_w )
{
- bfm_sc2_state *state = device->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = device->machine().driver_data<bfm_sc2_state>();
int bank = 0;
if ( data & 0x80 ) bank |= 0x01;
@@ -691,7 +691,7 @@ static WRITE8_DEVICE_HANDLER( nec_latch_w )
static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are connected to this
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
// b7 = NEC busy
// b6 = alpha busy (also matrix board)
// b5 - b0 = reel optics
@@ -715,7 +715,7 @@ static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are co
}
}
- if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80; // update sound busy input
+ if ( !upd7759_busy_r(space->machine().device("upd")) ) result |= 0x80; // update sound busy input
return result;
}
@@ -724,7 +724,7 @@ static READ8_HANDLER( vfd_status_hop_r ) // on video games, hopper inputs are co
static WRITE8_HANDLER( expansion_latch_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int changed = state->expansion_latch^data;
state->expansion_latch = data;
@@ -752,8 +752,8 @@ static WRITE8_HANDLER( expansion_latch_w )
}
{
- ym2413_device *ym = space->machine->device<ym2413_device>("ymsnd");
- upd7759_device *upd = space->machine->device<upd7759_device>("upd");
+ ym2413_device *ym = space->machine().device<ym2413_device>("ymsnd");
+ upd7759_device *upd = space->machine().device<upd7759_device>("upd");
float percent = state->volume_override ? 1.0f : (32-state->global_volume)/32.0f;
ym->set_output_gain(0, percent);
@@ -781,7 +781,7 @@ static WRITE8_HANDLER( muxena_w )
static WRITE8_HANDLER( timerirq_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->is_timer_enabled = data & 1;
}
@@ -789,7 +789,7 @@ static WRITE8_HANDLER( timerirq_w )
static READ8_HANDLER( timerirqclr_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->irq_timer_stat = 0;
state->irq_status = 0;
@@ -800,7 +800,7 @@ static READ8_HANDLER( timerirqclr_r )
static READ8_HANDLER( irqstatus_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int result = state->irq_status | state->irq_timer_stat | 0x80; // 0x80 = ~MUXERROR
state->irq_timer_stat = 0;
@@ -812,7 +812,7 @@ static READ8_HANDLER( irqstatus_r )
static WRITE8_HANDLER( coininhib_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int changed = state->coin_inhibits^data,i,p;
state->coin_inhibits = data;
@@ -824,7 +824,7 @@ static WRITE8_HANDLER( coininhib_w )
{
if ( changed & p )
{ // this inhibit line has changed
- coin_lockout_w(space->machine, i, (~data & p) ); // update lockouts
+ coin_lockout_w(space->machine(), i, (~data & p) ); // update lockouts
changed &= ~p;
}
@@ -837,14 +837,14 @@ static WRITE8_HANDLER( coininhib_w )
static READ8_HANDLER( coin_input_r )
{
- return input_port_read(space->machine, "COINS");
+ return input_port_read(space->machine(), "COINS");
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( payout_latch_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->pay_latch = data;
}
@@ -852,7 +852,7 @@ static WRITE8_HANDLER( payout_latch_w )
static WRITE8_HANDLER( payout_triac_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
if ( state->triac_select == 0x57 )
{
int slide = 0;
@@ -888,7 +888,7 @@ static WRITE8_HANDLER( payout_triac_w )
{
int strobe = state->slide_pay_sensor[slide]>>4, data = state->slide_pay_sensor[slide]&0x0F;
- Scorpion2_SetSwitchState(space->machine, strobe, data, 0);
+ Scorpion2_SetSwitchState(space->machine(), strobe, data, 0);
}
state->slide_states[slide] = 1;
}
@@ -901,7 +901,7 @@ static WRITE8_HANDLER( payout_triac_w )
{
int strobe = state->slide_pay_sensor[slide]>>4, data = state->slide_pay_sensor[slide]&0x0F;
- Scorpion2_SetSwitchState(space->machine, strobe, data, 1);
+ Scorpion2_SetSwitchState(space->machine(), strobe, data, 1);
}
state->slide_states[slide] = 0;
}
@@ -914,7 +914,7 @@ static WRITE8_HANDLER( payout_triac_w )
static WRITE8_HANDLER( payout_select_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->triac_select = data;
}
@@ -922,7 +922,7 @@ static WRITE8_HANDLER( payout_select_w )
static WRITE8_HANDLER( vfd1_data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->vfd1_latch = data;
BFM_BD1_newdata(0, data);
BFM_BD1_draw(0);
@@ -932,7 +932,7 @@ static WRITE8_HANDLER( vfd1_data_w )
static WRITE8_HANDLER( vfd2_data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->vfd2_latch = data;
BFM_BD1_newdata(1, data);
BFM_BD1_draw(1);
@@ -954,7 +954,7 @@ static WRITE8_HANDLER( vfd_reset_w )
static READ8_HANDLER( uart1stat_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int status = 0x06;
if ( state->data_to_uart1 ) status |= 0x01;
@@ -966,7 +966,7 @@ static READ8_HANDLER( uart1stat_r )
static READ8_HANDLER( uart1data_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
return state->uart1_data;
}
@@ -980,7 +980,7 @@ static WRITE8_HANDLER( uart1ctrl_w )
static WRITE8_HANDLER( uart1data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->data_to_uart2 = 1;
state->uart1_data = data;
UART_LOG(("uart1:%x\n", data));
@@ -989,7 +989,7 @@ static WRITE8_HANDLER( uart1data_w )
static READ8_HANDLER( uart2stat_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int status = 0x06;
if ( state->data_to_uart2 ) status |= 0x01;
@@ -1001,7 +1001,7 @@ static READ8_HANDLER( uart2stat_r )
static READ8_HANDLER( uart2data_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
return state->uart2_data;
}
@@ -1016,7 +1016,7 @@ static WRITE8_HANDLER( uart2ctrl_w )
static WRITE8_HANDLER( uart2data_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->data_to_uart1 = 1;
state->uart2_data = data;
UART_LOG(("uart2:%x\n", data));
@@ -1027,7 +1027,7 @@ static WRITE8_HANDLER( uart2data_w )
static WRITE8_HANDLER( vid_uart_tx_w )
{
adder2_send(data);
- cputag_set_input_line(space->machine, "adder2", M6809_IRQ_LINE, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "adder2", M6809_IRQ_LINE, HOLD_LINE );
LOG_SERIAL(("sadder %02X (%c)\n",data, data ));
}
@@ -1060,12 +1060,12 @@ static READ8_HANDLER( vid_uart_ctrl_r )
static READ8_HANDLER( key_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
int result = state->key[ offset ];
if ( offset == 7 )
{
- result = (result & 0xFE) | read_e2ram(space->machine);
+ result = (result & 0xFE) | read_e2ram(space->machine());
}
return result;
@@ -1088,9 +1088,9 @@ on a simple two wire bus.
#define SDA 0x02 //SDA pin (data)
-static void e2ram_reset(running_machine *machine)
+static void e2ram_reset(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
state->e2reg = 0;
state->e2state = 0;
state->e2address = 0;
@@ -1154,7 +1154,7 @@ static int recAck(int changed, int data)
//
static WRITE8_HANDLER( e2ram_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>(); // b0 = clock b1 = data
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>(); // b0 = clock b1 = data
int changed, ack;
@@ -1361,9 +1361,9 @@ static WRITE8_HANDLER( e2ram_w )
}
}
-static int read_e2ram(running_machine *machine)
+static int read_e2ram(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
LOG(("e2ram: r %d (%02X) \n", state->e2data_pin, state->e2data_to_read ));
return state->e2data_pin;
@@ -1384,12 +1384,12 @@ static const UINT8 DataDecode[]=
///////////////////////////////////////////////////////////////////////////
-static void decode_mainrom(running_machine *machine, const char *rom_region)
+static void decode_mainrom(running_machine &machine, const char *rom_region)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *tmp, *rom;
- rom = machine->region(rom_region)->base();
+ rom = machine.region(rom_region)->base();
tmp = auto_alloc_array(machine, UINT8, 0x10000);
{
@@ -1453,10 +1453,10 @@ static MACHINE_RESET( init )
static SCREEN_UPDATE( addersc2 )
{
- bfm_sc2_state *state = screen->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = screen->machine().driver_data<bfm_sc2_state>();
if ( state->sc2_show_door )
{
- output_set_value("door",( Scorpion2_GetSwitchState(screen->machine,state->sc2_door_state>>4, state->sc2_door_state & 0x0F) ) );
+ output_set_value("door",( Scorpion2_GetSwitchState(screen->machine(),state->sc2_door_state>>4, state->sc2_door_state & 0x0F) ) );
}
return SCREEN_UPDATE_CALL(adder2);
@@ -2211,14 +2211,14 @@ static MACHINE_CONFIG_START( scorpion2_vid, bfm_sc2_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0)
MACHINE_CONFIG_END
-static void sc2_common_init(running_machine *machine, int decrypt)
+static void sc2_common_init(running_machine &machine, int decrypt)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *rom;
if (decrypt) decode_mainrom(machine, "maincpu"); // decode main rom
- rom = machine->region("maincpu")->base();
+ rom = machine.region("maincpu")->base();
if ( rom )
{
memcpy(&rom[0x10000], &rom[0x00000], 0x2000);
@@ -2227,12 +2227,12 @@ static void sc2_common_init(running_machine *machine, int decrypt)
memset(state->sc2_Inputs, 0, sizeof(state->sc2_Inputs)); // clear all inputs
}
-static void adder2_common_init(running_machine *machine)
+static void adder2_common_init(running_machine &machine)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
UINT8 *pal;
- pal = machine->region("proms")->base();
+ pal = machine.region("proms")->base();
if ( pal )
{
memcpy(state->key, pal, 8);
@@ -2243,7 +2243,7 @@ static void adder2_common_init(running_machine *machine)
static DRIVER_INIT (quintoon)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine);
MechMtr_config(machine,8); // setup mech meters
@@ -2265,7 +2265,7 @@ static DRIVER_INIT (quintoon)
static DRIVER_INIT( pyramid )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2283,7 +2283,7 @@ static DRIVER_INIT( pyramid )
static DRIVER_INIT( sltsbelg )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2298,7 +2298,7 @@ static DRIVER_INIT( sltsbelg )
static DRIVER_INIT( adder_dutch )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2317,7 +2317,7 @@ static DRIVER_INIT( adder_dutch )
static DRIVER_INIT( gldncrwn )
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2_common_init(machine, 1);
adder2_decode_char_roms(machine); // decode GFX roms
adder2_common_init(machine);
@@ -2609,7 +2609,7 @@ GAMEL( 1997, gldncrwn, 0, scorpion2_vid, gldncrwn, gldncrwn, 0, "BFM
/* Reels 1 and 2 */
static WRITE8_HANDLER( reel12_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->reel12_latch = data;
if ( stepper_update(0, data&0x0f ) ) state->reel_changed |= 0x01;
@@ -2628,14 +2628,14 @@ static WRITE8_HANDLER( reel12_w )
/* VFD Status */
static READ8_HANDLER( vfd_status_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
/* b7 = NEC busy */
/* b6 = alpha busy (also matrix board) */
/* b5 - b0 = reel optics */
int result = state->optic_pattern;
- if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
+ if ( !upd7759_busy_r(space->machine().device("upd")) ) result |= 0x80;
return result;
}
@@ -2643,14 +2643,14 @@ static READ8_HANDLER( vfd_status_r )
/* VFD Status and data */
static READ8_HANDLER( vfd_status_dm01_r )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
/* b7 = NEC busy */
/* b6 = alpha busy (also matrix board) */
/* b5 - b0 = reel optics */
int result = state->optic_pattern;
- if ( !upd7759_busy_r(space->machine->device("upd")) ) result |= 0x80;
+ if ( !upd7759_busy_r(space->machine().device("upd")) ) result |= 0x80;
if ( BFM_dm01_busy() ) result |= 0x40;
@@ -2660,9 +2660,9 @@ static READ8_HANDLER( vfd_status_dm01_r )
static WRITE8_HANDLER( vfd1_data_dm01_w )
{
- bfm_sc2_state *state = space->machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = space->machine().driver_data<bfm_sc2_state>();
state->vfd1_latch = data;
- BFM_dm01_writedata(space->machine,data);
+ BFM_dm01_writedata(space->machine(),data);
}
@@ -3991,7 +3991,7 @@ static MACHINE_CONFIG_START( scorpion2_dm01, bfm_sc2_state )
MCFG_CPU_PERIODIC_INT(bfm_dm01_vbl, 1500 ) /* generate 1500 NMI's per second ?? what is the exact freq?? */
MACHINE_CONFIG_END
-static void sc2awp_common_init(running_machine *machine,int reels, int decrypt)
+static void sc2awp_common_init(running_machine &machine,int reels, int decrypt)
{
int n;
sc2_common_init(machine, decrypt);
@@ -4008,7 +4008,7 @@ static void sc2awp_common_init(running_machine *machine,int reels, int decrypt)
static DRIVER_INIT (bbrkfst)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,5, 1);
MechMtr_config(machine,8);
@@ -4031,7 +4031,7 @@ static DRIVER_INIT (bbrkfst)
static DRIVER_INIT (drwho)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,4, 1);
MechMtr_config(machine,8);
@@ -4052,7 +4052,7 @@ static DRIVER_INIT (drwho)
static DRIVER_INIT (drwhon)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,4, 0);
MechMtr_config(machine,8);
@@ -4082,7 +4082,7 @@ static DRIVER_INIT (focus)
static DRIVER_INIT (cpeno1)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,6, 1);
MechMtr_config(machine,5);
@@ -4127,7 +4127,7 @@ static DRIVER_INIT (cpeno1)
static DRIVER_INIT (bfmcgslm)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,6, 1);
MechMtr_config(machine,8);
BFM_BD1_init(0);
@@ -4136,7 +4136,7 @@ static DRIVER_INIT (bfmcgslm)
static DRIVER_INIT (luvjub)
{
- bfm_sc2_state *state = machine->driver_data<bfm_sc2_state>();
+ bfm_sc2_state *state = machine.driver_data<bfm_sc2_state>();
sc2awp_common_init(machine,6, 1);
MechMtr_config(machine,8);
state->has_hopper = 0;
diff --git a/src/mame/drivers/bfmsys85.c b/src/mame/drivers/bfmsys85.c
index d4d70cf4840..8b5ceadcf03 100644
--- a/src/mame/drivers/bfmsys85.c
+++ b/src/mame/drivers/bfmsys85.c
@@ -106,13 +106,13 @@ public:
static READ_LINE_DEVICE_HANDLER( sys85_data_r )
{
- bfmsys85_state *state = device->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = device->machine().driver_data<bfmsys85_state>();
return state->sys85_data_line_r;
}
static WRITE_LINE_DEVICE_HANDLER( sys85_data_w )
{
- bfmsys85_state *drvstate = device->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *drvstate = device->machine().driver_data<bfmsys85_state>();
drvstate->sys85_data_line_t = state;
}
@@ -131,7 +131,7 @@ static ACIA6850_INTERFACE( m6809_acia_if )
static MACHINE_RESET( bfm_sys85 )
{
- bfmsys85_state *state = machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = machine.driver_data<bfmsys85_state>();
state->vfd_latch = 0;
state->mmtr_latch = 0;
state->triac_latch = 0;
@@ -168,7 +168,7 @@ static WRITE8_HANDLER( watchdog_w )
static INTERRUPT_GEN( timer_irq )
{
- bfmsys85_state *state = device->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = device->machine().driver_data<bfmsys85_state>();
if ( state->is_timer_enabled )
{
state->irq_status = 0x01 |0x02; //0xff;
@@ -180,7 +180,7 @@ static INTERRUPT_GEN( timer_irq )
static READ8_HANDLER( irqlatch_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int result = state->irq_status | 0x02;
state->irq_status = 0;
@@ -192,7 +192,7 @@ static READ8_HANDLER( irqlatch_r )
static WRITE8_HANDLER( reel12_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
if ( stepper_update(0, (data>>4)&0x0f) ) state->reel_changed |= 0x01;
if ( stepper_update(1, data&0x0f ) ) state->reel_changed |= 0x02;
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( reel12_w )
static WRITE8_HANDLER( reel34_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
if ( stepper_update(2, (data>>4)&0x0f) ) state->reel_changed |= 0x04;
if ( stepper_update(3, data&0x0f ) ) state->reel_changed |= 0x08;
@@ -226,7 +226,7 @@ static WRITE8_HANDLER( reel34_w )
static WRITE8_HANDLER( mmtr_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int i;
int changed = state->mmtr_latch ^ data;
@@ -235,20 +235,20 @@ static WRITE8_HANDLER( mmtr_w )
for (i=0; i<8; i++)
if ( changed & (1 << i) ) MechMtr_update(i, data & (1 << i) );
- if ( data ) generic_pulse_irq_line(space->machine->device("maincpu"), M6809_FIRQ_LINE);
+ if ( data ) generic_pulse_irq_line(space->machine().device("maincpu"), M6809_FIRQ_LINE);
}
///////////////////////////////////////////////////////////////////////////
static READ8_HANDLER( mmtr_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
return state->mmtr_latch;
}
///////////////////////////////////////////////////////////////////////////
static WRITE8_HANDLER( vfd_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int changed = state->vfd_latch ^ data;
state->vfd_latch = data;
@@ -305,7 +305,7 @@ static const UINT8 BFM_strcnv85[] =
static WRITE8_HANDLER( mux_ctrl_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
switch ( data & 0xF0 )
{
case 0x10:
@@ -348,7 +348,7 @@ static READ8_HANDLER( mux_ctrl_r )
static WRITE8_HANDLER( mux_data_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
int pattern = 0x01, i,
off = state->mux_output_strobe<<4;
@@ -370,7 +370,7 @@ static WRITE8_HANDLER( mux_data_w )
static READ8_HANDLER( mux_data_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
return state->mux_input;
}
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( mux_enable_w )
static WRITE8_HANDLER( triac_w )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
state->triac_latch = data;
}
@@ -394,7 +394,7 @@ static WRITE8_HANDLER( triac_w )
static READ8_HANDLER( triac_r )
{
- bfmsys85_state *state = space->machine->driver_data<bfmsys85_state>();
+ bfmsys85_state *state = space->machine().driver_data<bfmsys85_state>();
return state->triac_latch;
}
diff --git a/src/mame/drivers/big10.c b/src/mame/drivers/big10.c
index e5e9a2cbd37..20a2a3d0d7c 100644
--- a/src/mame/drivers/big10.c
+++ b/src/mame/drivers/big10.c
@@ -81,21 +81,21 @@ public:
* Interrupt handling & Video *
***************************************/
-static void big10_vdp_interrupt(running_machine *machine, int i)
+static void big10_vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line (machine, "maincpu", 0, (i ? ASSERT_LINE : CLEAR_LINE));
}
static INTERRUPT_GEN( big10_interrupt )
{
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static VIDEO_START( big10 )
{
VIDEO_START_CALL(generic_bitmapped);
- v9938_init (machine, 0, *machine->primary_screen, machine->generic.tmpbitmap, MODEL_V9938, VDP_MEM, big10_vdp_interrupt);
+ v9938_init (machine, 0, *machine.primary_screen, machine.generic.tmpbitmap, MODEL_V9938, VDP_MEM, big10_vdp_interrupt);
v9938_reset(0);
}
@@ -117,18 +117,18 @@ static MACHINE_RESET(big10)
static WRITE8_DEVICE_HANDLER( mux_w )
{
- big10_state *state = device->machine->driver_data<big10_state>();
+ big10_state *state = device->machine().driver_data<big10_state>();
state->mux_data = ~data;
}
static READ8_HANDLER( mux_r )
{
- big10_state *state = space->machine->driver_data<big10_state>();
+ big10_state *state = space->machine().driver_data<big10_state>();
switch(state->mux_data)
{
- case 1: return input_port_read(space->machine, "IN1");
- case 2: return input_port_read(space->machine, "IN2");
- case 4: return input_port_read(space->machine, "IN3");
+ case 1: return input_port_read(space->machine(), "IN1");
+ case 2: return input_port_read(space->machine(), "IN2");
+ case 4: return input_port_read(space->machine(), "IN3");
}
return state->mux_data;
diff --git a/src/mame/drivers/bigevglf.c b/src/mame/drivers/bigevglf.c
index 87081c940db..645f5bcb195 100644
--- a/src/mame/drivers/bigevglf.c
+++ b/src/mame/drivers/bigevglf.c
@@ -66,55 +66,55 @@ J1100072A
static WRITE8_HANDLER( beg_banking_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->beg_bank = data;
/* d0-d3 connect to A11-A14 of the ROMs (via ls273 latch)
d4-d7 select one of ROMs (via ls273(above) and then ls154)
*/
- memory_set_bank(space->machine, "bank1", state->beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
+ memory_set_bank(space->machine(), "bank1", state->beg_bank & 0xff); /* empty sockets for IC37-IC44 ROMS */
}
static TIMER_CALLBACK( from_sound_latch_callback )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
state->from_sound = param & 0xff;
state->sound_state |= 2;
}
static WRITE8_HANDLER( beg_fromsound_w ) /* write to D800 sets bit 1 in status */
{
- space->machine->scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(space->cpu) << 16) | data);
+ space->machine().scheduler().synchronize(FUNC(from_sound_latch_callback), (cpu_get_pc(space->cpu) << 16) | data);
}
static READ8_HANDLER( beg_fromsound_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return state->from_sound;
}
static READ8_HANDLER( beg_soundstate_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
UINT8 ret = state->sound_state;
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
state->sound_state &= ~2; /* read from port 21 clears bit 1 in status */
return ret;
}
static READ8_HANDLER( soundstate_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return state->sound_state;
}
static TIMER_CALLBACK( nmi_callback )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -125,27 +125,27 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w ) /* write to port 20 clears bit 0 in status */
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->for_sound = data;
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static READ8_HANDLER( sound_command_r ) /* read from D800 sets bit 0 in status */
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->sound_state |= 1;
return state->for_sound;
}
static WRITE8_HANDLER( nmi_disable_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static TIMER_CALLBACK( deferred_ls74_w )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
int offs = (param >> 8) & 255;
int data = param & 255;
state->beg13_ls74[offs] = data;
@@ -165,27 +165,27 @@ static TIMER_CALLBACK( deferred_ls74_w )
/* do this on a timer to let the CPUs synchronize */
static WRITE8_HANDLER( beg13_a_clr_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 0);
}
static WRITE8_HANDLER( beg13_b_clr_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 0);
}
static WRITE8_HANDLER( beg13_a_set_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (0 << 8) | 1);
}
static WRITE8_HANDLER( beg13_b_set_w )
{
- space->machine->scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1);
+ space->machine().scheduler().synchronize(FUNC(deferred_ls74_w), (1 << 8) | 1);
}
static READ8_HANDLER( beg_status_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/* d0 = Q of 74ls74 IC13(partA)
d1 = Q of 74ls74 IC13(partB)
@@ -197,30 +197,30 @@ static READ8_HANDLER( beg_status_r )
*/
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
return (state->beg13_ls74[0] << 0) | (state->beg13_ls74[1] << 1);
}
static READ8_HANDLER( beg_trackball_x_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
static const char *const portx_name[2] = { "P1X", "P2X" };
- return input_port_read(space->machine, portx_name[state->port_select]);
+ return input_port_read(space->machine(), portx_name[state->port_select]);
}
static READ8_HANDLER( beg_trackball_y_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
static const char *const porty_name[2] = { "P1Y", "P2Y" };
- return input_port_read(space->machine, porty_name[state->port_select]);
+ return input_port_read(space->machine(), porty_name[state->port_select]);
}
static WRITE8_HANDLER( beg_port08_w )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
state->port_select = (data & 0x04) >> 2;
}
@@ -342,7 +342,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
{
- bigevglf_state *state = space->machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = space->machine().driver_data<bigevglf_state>();
/*
bit 0 and bit 1 = coin inputs
bit 3 and bit 4 = MCU status
@@ -350,7 +350,7 @@ static READ8_HANDLER( sub_cpu_mcu_coin_port_r )
*/
state->mcu_coin_bit5 ^= 0x20;
- return bigevglf_mcu_status_r(space, 0) | (input_port_read(space->machine, "PORT04") & 3) | state->mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
+ return bigevglf_mcu_status_r(space, 0) | (input_port_read(space->machine(), "PORT04") & 3) | state->mcu_coin_bit5; /* bit 0 and bit 1 - coin inputs */
}
static ADDRESS_MAP_START( bigevglf_sub_portmap, AS_IO, 8 )
@@ -432,10 +432,10 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( bigevglf )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->vidram_bank));
state->save_item(NAME(state->plane_selected));
@@ -469,7 +469,7 @@ static MACHINE_START( bigevglf )
static MACHINE_RESET( bigevglf )
{
- bigevglf_state *state = machine->driver_data<bigevglf_state>();
+ bigevglf_state *state = machine.driver_data<bigevglf_state>();
state->vidram_bank = 0;
state->plane_selected = 0;
@@ -634,7 +634,7 @@ ROM_END
static DRIVER_INIT( bigevglf )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0xff, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/bigfghtr.c b/src/mame/drivers/bigfghtr.c
index 0ec1be0b0c4..0173058fa35 100644
--- a/src/mame/drivers/bigfghtr.c
+++ b/src/mame/drivers/bigfghtr.c
@@ -146,7 +146,7 @@ public:
static TILE_GET_INFO( get_fg_tile_info )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
int data = state->fg_videoram[tile_index];
SET_TILE_INFO(
1,
@@ -158,7 +158,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static TILE_GET_INFO( get_bg_tile_info )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
int data = state->bg_videoram[tile_index];
SET_TILE_INFO(
2,
@@ -169,7 +169,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_tx_tile_info )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
int tile_number = state->text_videoram[tile_index] & 0xff;
int attributes;
@@ -184,7 +184,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static VIDEO_START( bigfghtr )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_cols, 16, 16, 64, 32);
@@ -196,7 +196,7 @@ static VIDEO_START( bigfghtr )
static WRITE16_HANDLER(text_videoram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->text_videoram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap, offset & 0x7ff);
@@ -204,7 +204,7 @@ static WRITE16_HANDLER(text_videoram_w )
static WRITE16_HANDLER( fg_videoram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -212,7 +212,7 @@ static WRITE16_HANDLER( fg_videoram_w )
static WRITE16_HANDLER( bg_videoram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -220,19 +220,19 @@ static WRITE16_HANDLER( bg_videoram_w )
static WRITE16_HANDLER( fg_scrollx_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_scrollx);
}
static WRITE16_HANDLER( fg_scrolly_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->fg_scrolly);
}
static WRITE16_HANDLER( bg_scrollx_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->scroll_x);
tilemap_set_scrollx(state->bg_tilemap, 0, state->scroll_x);
@@ -240,17 +240,17 @@ static WRITE16_HANDLER( bg_scrollx_w )
static WRITE16_HANDLER( bg_scrolly_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->scroll_y);
tilemap_set_scrolly(state->bg_tilemap, 0, state->scroll_y);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority )
{
- UINT16 *buffered_spriteram = machine->generic.buffered_spriteram.u16;
+ UINT16 *buffered_spriteram = machine.generic.buffered_spriteram.u16;
int offs;
- for (offs = 0; offs < machine->generic.spriteram_size / 2; offs += 4)
+ for (offs = 0; offs < machine.generic.spriteram_size / 2; offs += 4)
{
int code = buffered_spriteram[offs + 1]; /* ??YX?TTTTTTTTTTT */
int flipx = code & 0x2000;
@@ -261,7 +261,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (((buffered_spriteram[offs + 0] & 0x3000) >> 12) == priority)
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[3],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[3],
code & 0xfff,
color,
flipx,flipy,
@@ -273,7 +273,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( bigfghtr )
{
- bigfghtr_state *state = screen->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = screen->machine().driver_data<bigfghtr_state>();
int sprite_enable = state->vreg & 0x200;
tilemap_set_enable(state->bg_tilemap, state->vreg & 0x800);
@@ -286,20 +286,20 @@ static SCREEN_UPDATE( bigfghtr )
if (state->vreg & 0x0800)
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
else
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if(sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 2);
+ draw_sprites(screen->machine(), bitmap, cliprect, 2);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
if(sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 1);
+ draw_sprites(screen->machine(), bitmap, cliprect, 1);
tilemap_draw(bitmap, cliprect, state->tx_tilemap, 0, 0);
if (sprite_enable)
- draw_sprites(screen->machine, bitmap, cliprect, 0);
+ draw_sprites(screen->machine(), bitmap, cliprect, 0);
return 0;
}
@@ -308,7 +308,7 @@ static SCREEN_UPDATE( bigfghtr )
static SCREEN_EOF( bigfghtr )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram16_w(space, 0, 0, 0xffff);
}
@@ -321,16 +321,16 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( io_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->vreg);
- flip_screen_set(space->machine, state->vreg & 0x1000);
+ flip_screen_set(space->machine(), state->vreg & 0x1000);
}
static WRITE16_HANDLER( sharedram_w )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
COMBINE_DATA(&state->sharedram[offset]);
switch(offset)
@@ -344,7 +344,7 @@ static WRITE16_HANDLER( sharedram_w )
static READ16_HANDLER(sharedram_r)
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
if(state->mcu_input_snippet)
{
@@ -354,21 +354,21 @@ static READ16_HANDLER(sharedram_r)
if(state->read_latch)
{
state->read_latch = 0;
- return space->machine->rand(); // TODO
+ return space->machine().rand(); // TODO
}
break;
case 0x642/2:
- return (input_port_read(space->machine, "DSW0") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW0") & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(space->machine, "DSW1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW1") & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(space->machine, "P1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P1") & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(space->machine, "P2") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P2") & 0xffff) ^ 0xffff;
}
}
@@ -380,20 +380,20 @@ static READ16_HANDLER(sharedram_r)
if(state->read_latch)
{
state->read_latch = 0;
- return space->machine->rand(); // TODO
+ return space->machine().rand(); // TODO
}
break;
case 0x642/2:
- return (input_port_read(space->machine, "DSW0") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW0") & 0xffff) ^ 0xffff;
case 0x644/2:
- return (input_port_read(space->machine, "DSW1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "DSW1") & 0xffff) ^ 0xffff;
case 0x646/2:
- return (input_port_read(space->machine, "P1") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P1") & 0xffff) ^ 0xffff;
case 0x648/2:
- return (input_port_read(space->machine, "P2") & 0xffff) ^ 0xffff;
+ return (input_port_read(space->machine(), "P2") & 0xffff) ^ 0xffff;
/*
protection controls where the program code should jump to.
@@ -475,7 +475,7 @@ static READ16_HANDLER(sharedram_r)
static READ16_HANDLER( latch_r )
{
- bigfghtr_state *state = space->machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = space->machine().driver_data<bigfghtr_state>();
state->read_latch = 1;
return 0;
@@ -655,7 +655,7 @@ GFXDECODE_END
static MACHINE_START( bigfghtr )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
state->save_item(NAME(state->fg_scrollx));
state->save_item(NAME(state->fg_scrolly));
@@ -667,7 +667,7 @@ static MACHINE_START( bigfghtr )
static MACHINE_RESET( bigfghtr )
{
- bigfghtr_state *state = machine->driver_data<bigfghtr_state>();
+ bigfghtr_state *state = machine.driver_data<bigfghtr_state>();
state->fg_scrollx = 0;
state->fg_scrolly = 0;
diff --git a/src/mame/drivers/bingoc.c b/src/mame/drivers/bingoc.c
index bd97227c695..e57c22b610d 100644
--- a/src/mame/drivers/bingoc.c
+++ b/src/mame/drivers/bingoc.c
@@ -70,15 +70,15 @@ static READ16_HANDLER( bingoc_rand_r )
*/
static READ8_HANDLER( sound_test_r )
{
- bingoc_state *state = space->machine->driver_data<bingoc_state>();
+ bingoc_state *state = space->machine().driver_data<bingoc_state>();
- if(input_code_pressed_once(space->machine, KEYCODE_Z))
+ if(input_code_pressed_once(space->machine(), KEYCODE_Z))
state->x++;
- if(input_code_pressed_once(space->machine, KEYCODE_X))
+ if(input_code_pressed_once(space->machine(), KEYCODE_X))
state->x--;
- if(input_code_pressed_once(space->machine, KEYCODE_A))
+ if(input_code_pressed_once(space->machine(), KEYCODE_A))
return 0xff;
popmessage("%02x",state->x);
@@ -88,7 +88,7 @@ static READ8_HANDLER( sound_test_r )
static WRITE16_HANDLER( main_sound_latch_w )
{
soundlatch_w(space,0,data&0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
#endif
@@ -98,7 +98,7 @@ static WRITE8_DEVICE_HANDLER( bingoc_play_w )
---- --x- sound rom banking
---- ---x start-stop sample
*/
- UINT8 *upd = device->machine->region("upd")->base();
+ UINT8 *upd = device->machine().region("upd")->base();
memcpy(&upd[0x00000], &upd[0x20000 + (((data & 2)>>1) * 0x20000)], 0x20000);
upd7759_start_w(device, data & 1);
// printf("%02x\n",data);
diff --git a/src/mame/drivers/bingor.c b/src/mame/drivers/bingor.c
index f302824d4fa..498414626d0 100644
--- a/src/mame/drivers/bingor.c
+++ b/src/mame/drivers/bingor.c
@@ -459,10 +459,10 @@ static VIDEO_START(bingor)
static SCREEN_UPDATE(bingor)
{
- bingor_state *state = screen->machine->driver_data<bingor_state>();
+ bingor_state *state = screen->machine().driver_data<bingor_state>();
int x,y,count;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (0x2000/2);
@@ -475,22 +475,22 @@ static SCREEN_UPDATE(bingor)
color = (state->blit_ram[count] & 0xf000)>>12;
if((x+3)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+3) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+3) = screen->machine().pens[color];
color = (state->blit_ram[count] & 0x0f00)>>8;
if((x+2)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+2) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+2) = screen->machine().pens[color];
color = (state->blit_ram[count] & 0x00f0)>>4;
if((x+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+1) = screen->machine().pens[color];
color = (state->blit_ram[count] & 0x000f)>>0;
if((x+0)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+0) = screen->machine().pens[color];
count++;
}
@@ -502,7 +502,7 @@ static SCREEN_UPDATE(bingor)
#if 0
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
@@ -523,7 +523,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( test8_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( pic_io_map, AS_IO, 8 )
diff --git a/src/mame/drivers/bionicc.c b/src/mame/drivers/bionicc.c
index b89cf4db002..e6c6cd40fff 100644
--- a/src/mame/drivers/bionicc.c
+++ b/src/mame/drivers/bionicc.c
@@ -73,7 +73,7 @@
static WRITE16_HANDLER( hacked_controls_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
logerror("%06x: hacked_controls_w %04x %02x\n", cpu_get_pc(space->cpu), offset, data);
COMBINE_DATA(&state->inp[offset]);
@@ -81,7 +81,7 @@ static WRITE16_HANDLER( hacked_controls_w )
static READ16_HANDLER( hacked_controls_r )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
logerror("%06x: hacked_controls_r %04x %04x\n", cpu_get_pc(space->cpu), offset, state->inp[offset]);
return state->inp[offset];
@@ -89,22 +89,22 @@ static READ16_HANDLER( hacked_controls_r )
static WRITE16_HANDLER( bionicc_mpu_trigger_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
- data = input_port_read(space->machine, "SYSTEM") >> 12;
+ data = input_port_read(space->machine(), "SYSTEM") >> 12;
state->inp[0] = data ^ 0x0f;
- data = input_port_read(space->machine, "P2");
+ data = input_port_read(space->machine(), "P2");
state->inp[1] = data ^ 0xff;
- data = input_port_read(space->machine, "P1");
+ data = input_port_read(space->machine(), "P1");
state->inp[2] = data ^ 0xff;
}
static WRITE16_HANDLER( hacked_soundcommand_w )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
COMBINE_DATA(&state->soundcommand);
soundlatch_w(space, 0, state->soundcommand & 0xff);
@@ -112,7 +112,7 @@ static WRITE16_HANDLER( hacked_soundcommand_w )
static READ16_HANDLER( hacked_soundcommand_r )
{
- bionicc_state *state = space->machine->driver_data<bionicc_state>();
+ bionicc_state *state = space->machine().driver_data<bionicc_state>();
return state->soundcommand;
}
@@ -335,7 +335,7 @@ GFXDECODE_END
static MACHINE_START( bionicc )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
state->save_item(NAME(state->soundcommand));
state->save_item(NAME(state->inp));
@@ -344,7 +344,7 @@ static MACHINE_START( bionicc )
static MACHINE_RESET( bionicc )
{
- bionicc_state *state = machine->driver_data<bionicc_state>();
+ bionicc_state *state = machine.driver_data<bionicc_state>();
state->inp[0] = 0;
state->inp[1] = 0;
diff --git a/src/mame/drivers/bishi.c b/src/mame/drivers/bishi.c
index 2c861498c0a..e8fd7c32820 100644
--- a/src/mame/drivers/bishi.c
+++ b/src/mame/drivers/bishi.c
@@ -92,27 +92,27 @@ Notes:
static READ16_HANDLER( control_r )
{
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
return state->cur_control;
}
static WRITE16_HANDLER( control_w )
{
// bit 8 = interrupt gate
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
COMBINE_DATA(&state->cur_control);
}
static WRITE16_HANDLER( control2_w )
{
// bit 12 = part of the banking calculation for the K056832 ROM readback
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
COMBINE_DATA(&state->cur_control2);
}
static INTERRUPT_GEN(bishi_interrupt)
{
- bishi_state *state = device->machine->driver_data<bishi_state>();
+ bishi_state *state = device->machine().driver_data<bishi_state>();
if (state->cur_control & 0x800)
{
switch (cpu_getiloops(device))
@@ -131,12 +131,12 @@ static INTERRUPT_GEN(bishi_interrupt)
/* compensate for a bug in the ram/rom test */
static READ16_HANDLER( bishi_mirror_r )
{
- return space->machine->generic.paletteram.u16[offset];
+ return space->machine().generic.paletteram.u16[offset];
}
static READ16_HANDLER( bishi_K056832_rom_r )
{
- bishi_state *state = space->machine->driver_data<bishi_state>();
+ bishi_state *state = space->machine().driver_data<bishi_state>();
UINT16 ouroffs;
ouroffs = (offset >> 1) * 8;
@@ -369,7 +369,7 @@ INPUT_PORTS_END
static void sound_irq_gen(device_t *device, int state)
{
- bishi_state *bishi = device->machine->driver_data<bishi_state>();
+ bishi_state *bishi = device->machine().driver_data<bishi_state>();
if (state)
device_set_input_line(bishi->maincpu, M68K_IRQ_1, ASSERT_LINE);
else
@@ -400,12 +400,12 @@ static const k054338_interface bishi_k054338_intf =
static MACHINE_START( bishi )
{
- bishi_state *state = machine->driver_data<bishi_state>();
+ bishi_state *state = machine.driver_data<bishi_state>();
- state->maincpu = machine->device("maincpu");
- state->k056832 = machine->device("k056832");
- state->k054338 = machine->device("k054338");
- state->k055555 = machine->device("k055555");
+ state->maincpu = machine.device("maincpu");
+ state->k056832 = machine.device("k056832");
+ state->k054338 = machine.device("k054338");
+ state->k055555 = machine.device("k055555");
state->save_item(NAME(state->cur_control));
state->save_item(NAME(state->cur_control2));
@@ -413,7 +413,7 @@ static MACHINE_START( bishi )
static MACHINE_RESET( bishi )
{
- bishi_state *state = machine->driver_data<bishi_state>();
+ bishi_state *state = machine.driver_data<bishi_state>();
state->cur_control = 0;
state->cur_control2 = 0;
}
diff --git a/src/mame/drivers/bking.c b/src/mame/drivers/bking.c
index 67e9586ce45..1db824f7548 100644
--- a/src/mame/drivers/bking.c
+++ b/src/mame/drivers/bking.c
@@ -25,20 +25,20 @@ DIP Locations verified for:
static READ8_HANDLER( bking_sndnmi_disable_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->sound_nmi_enable = 0;
return 0;
}
static WRITE8_HANDLER( bking_sndnmi_enable_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->sound_nmi_enable = 1;
}
static WRITE8_HANDLER( bking_soundlatch_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
int i, code = 0;
for (i = 0;i < 8;i++)
@@ -52,20 +52,20 @@ static WRITE8_HANDLER( bking_soundlatch_w )
static WRITE8_HANDLER( bking3_addr_l_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->addr_l = data;
}
static WRITE8_HANDLER( bking3_addr_h_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->addr_h = data;
}
static READ8_HANDLER( bking3_extrarom_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
- UINT8 *rom = space->machine->region("user2")->base();
+ bking_state *state = space->machine().driver_data<bking_state>();
+ UINT8 *rom = space->machine().region("user2")->base();
return rom[state->addr_h * 256 + state->addr_l];
}
@@ -147,40 +147,40 @@ ADDRESS_MAP_END
#if 0
static READ8_HANDLER( bking3_68705_port_a_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
//printf("port_a_r = %02X\n",(state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a));
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
static WRITE8_HANDLER( bking3_68705_port_a_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->port_a_out = data;
// printf("port_a_out = %02X\n",data);
}
static WRITE8_HANDLER( bking3_68705_ddr_a_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->ddr_a = data;
}
static READ8_HANDLER( bking3_68705_port_b_r )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
return (state->port_b_out & state->ddr_b) | (state->port_b_in & ~state->ddr_b);
}
static WRITE8_HANDLER( bking3_68705_port_b_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
// if(data != 0xff)
// printf("port_b_out = %02X\n",data);
if (~data & 0x02)
{
state->port_a_in = from_main;
- if (main_sent) cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ if (main_sent) cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
main_sent = 0;
}
@@ -199,7 +199,7 @@ static WRITE8_HANDLER( bking3_68705_port_b_w )
static WRITE8_HANDLER( bking3_68705_ddr_b_w )
{
- bking_state *state = space->machine->driver_data<bking_state>();
+ bking_state *state = space->machine().driver_data<bking_state>();
state->ddr_b = data;
}
@@ -402,9 +402,9 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( bking )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
/* video */
state->save_item(NAME(state->pc3259_output));
@@ -428,7 +428,7 @@ static MACHINE_START( bking )
static MACHINE_START( bking3 )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
MACHINE_START_CALL(bking);
@@ -440,7 +440,7 @@ static MACHINE_START( bking3 )
static MACHINE_RESET( bking )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
/* video */
state->pc3259_output[0] = 0;
@@ -467,7 +467,7 @@ static MACHINE_RESET( bking )
static MACHINE_RESET( bking3 )
{
- bking_state *state = machine->driver_data<bking_state>();
+ bking_state *state = machine.driver_data<bking_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
diff --git a/src/mame/drivers/blackt96.c b/src/mame/drivers/blackt96.c
index 1c1548617cd..80407aa1782 100644
--- a/src/mame/drivers/blackt96.c
+++ b/src/mame/drivers/blackt96.c
@@ -68,11 +68,11 @@ static VIDEO_START( blackt96 )
{
}
-static void draw_strip(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int stripnum, int xbase, int ybase, int bg)
+static void draw_strip(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int stripnum, int xbase, int ybase, int bg)
{
- blackt96_state *state = machine->driver_data<blackt96_state>();
- const gfx_element *gfxspr = machine->gfx[1];
- const gfx_element *gfxbg = machine->gfx[0];
+ blackt96_state *state = machine.driver_data<blackt96_state>();
+ const gfx_element *gfxspr = machine.gfx[1];
+ const gfx_element *gfxbg = machine.gfx[0];
int base = stripnum;
int count = 0;
@@ -98,9 +98,9 @@ static void draw_strip(running_machine *machine, bitmap_t *bitmap, const rectang
}
-static void draw_main(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int bg)
+static void draw_main(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int bg)
{
- blackt96_state *state = machine->driver_data<blackt96_state>();
+ blackt96_state *state = machine.driver_data<blackt96_state>();
int x;
@@ -130,15 +130,15 @@ static void draw_main(running_machine *machine, bitmap_t *bitmap, const rectangl
static SCREEN_UPDATE( blackt96 )
{
- blackt96_state *state = screen->machine->driver_data<blackt96_state>();
+ blackt96_state *state = screen->machine().driver_data<blackt96_state>();
int count;
int x,y;
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
- draw_main(screen->machine,bitmap,cliprect,1);
- draw_main(screen->machine,bitmap,cliprect,0);
+ draw_main(screen->machine(),bitmap,cliprect,1);
+ draw_main(screen->machine(),bitmap,cliprect,0);
/* Text Layer */
count = 0;
@@ -455,7 +455,7 @@ static WRITE8_HANDLER( blackt96_soundio_port00_w )
static READ8_HANDLER( blackt96_soundio_port01_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( blackt96_soundio_port01_w )
@@ -465,7 +465,7 @@ static WRITE8_HANDLER( blackt96_soundio_port01_w )
static READ8_HANDLER( blackt96_soundio_port02_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( blackt96_soundio_port02_w )
diff --git a/src/mame/drivers/bladestl.c b/src/mame/drivers/bladestl.c
index 93efc8a03dd..83fe17b214a 100644
--- a/src/mame/drivers/bladestl.c
+++ b/src/mame/drivers/bladestl.c
@@ -38,7 +38,7 @@
static INTERRUPT_GEN( bladestl_interrupt )
{
- bladestl_state *state = device->machine->driver_data<bladestl_state>();
+ bladestl_state *state = device->machine().driver_data<bladestl_state>();
if (cpu_getiloops(device) == 0)
{
@@ -59,11 +59,11 @@ static INTERRUPT_GEN( bladestl_interrupt )
static READ8_HANDLER( trackball_r )
{
- bladestl_state *state = space->machine->driver_data<bladestl_state>();
+ bladestl_state *state = space->machine().driver_data<bladestl_state>();
static const char *const port[] = { "TRACKBALL_P1_1", "TRACKBALL_P1_2", "TRACKBALL_P2_1", "TRACKBALL_P1_2" };
int curr, delta;
- curr = input_port_read(space->machine, port[offset]);
+ curr = input_port_read(space->machine(), port[offset]);
delta = (curr - state->last_track[offset]) & 0xff;
state->last_track[offset] = curr;
@@ -72,20 +72,20 @@ static READ8_HANDLER( trackball_r )
static WRITE8_HANDLER( bladestl_bankswitch_w )
{
- bladestl_state *state = space->machine->driver_data<bladestl_state>();
+ bladestl_state *state = space->machine().driver_data<bladestl_state>();
/* bits 0 & 1 = coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bits 2 & 3 = lamps */
- set_led_status(space->machine, 0,data & 0x04);
- set_led_status(space->machine, 1,data & 0x08);
+ set_led_status(space->machine(), 0,data & 0x04);
+ set_led_status(space->machine(), 1,data & 0x08);
/* bit 4 = relay (???) */
/* bits 5-6 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0x60) >> 5);
+ memory_set_bank(space->machine(), "bank1", (data & 0x60) >> 5);
/* bit 7 = select sprite bank */
state->spritebank = (data & 0x80) << 3;
@@ -94,7 +94,7 @@ static WRITE8_HANDLER( bladestl_bankswitch_w )
static WRITE8_HANDLER( bladestl_sh_irqtrigger_w )
{
- bladestl_state *state = space->machine->driver_data<bladestl_state>();
+ bladestl_state *state = space->machine().driver_data<bladestl_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
@@ -306,14 +306,14 @@ static const k007420_interface bladestl_k007420_intf =
static MACHINE_START( bladestl )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007342 = machine->device("k007342");
- state->k007420 = machine->device("k007420");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007342 = machine.device("k007342");
+ state->k007420 = machine.device("k007420");
state->save_item(NAME(state->spritebank));
state->save_item(NAME(state->layer_colorbase));
@@ -322,7 +322,7 @@ static MACHINE_START( bladestl )
static MACHINE_RESET( bladestl )
{
- bladestl_state *state = machine->driver_data<bladestl_state>();
+ bladestl_state *state = machine.driver_data<bladestl_state>();
int i;
state->layer_colorbase[0] = 0;
diff --git a/src/mame/drivers/blitz.c b/src/mame/drivers/blitz.c
index fcca0adc0f0..33cf5d196d4 100644
--- a/src/mame/drivers/blitz.c
+++ b/src/mame/drivers/blitz.c
@@ -313,14 +313,14 @@ public:
static WRITE8_HANDLER( megadpkr_videoram_w )
{
- blitz_state *state = space->machine->driver_data<blitz_state>();
+ blitz_state *state = space->machine().driver_data<blitz_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( megadpkr_colorram_w )
{
- blitz_state *state = space->machine->driver_data<blitz_state>();
+ blitz_state *state = space->machine().driver_data<blitz_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -328,7 +328,7 @@ static WRITE8_HANDLER( megadpkr_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- blitz_state *state = machine->driver_data<blitz_state>();
+ blitz_state *state = machine.driver_data<blitz_state>();
/* - bits -
7654 3210
--xx xx-- tiles color.
@@ -348,13 +348,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( megadpkr )
{
- blitz_state *state = machine->driver_data<blitz_state>();
+ blitz_state *state = machine.driver_data<blitz_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( megadpkr )
{
- blitz_state *state = screen->machine->driver_data<blitz_state>();
+ blitz_state *state = screen->machine().driver_data<blitz_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -380,7 +380,7 @@ static PALETTE_INIT( megadpkr )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -416,13 +416,13 @@ static PALETTE_INIT( megadpkr )
*/
static READ8_DEVICE_HANDLER( megadpkr_mux_port_r )
{
- blitz_state *state = device->machine->driver_data<blitz_state>();
+ blitz_state *state = device->machine().driver_data<blitz_state>();
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
return 0xff;
}
@@ -430,7 +430,7 @@ static READ8_DEVICE_HANDLER( megadpkr_mux_port_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- blitz_state *state = device->machine->driver_data<blitz_state>();
+ blitz_state *state = device->machine().driver_data<blitz_state>();
state->mux_data = data ^ 0xff; /* inverted */
}
@@ -449,9 +449,9 @@ static WRITE8_DEVICE_HANDLER( lamps_a_w )
// output_set_lamp_value(4, 1 - ((data >> 4) & 1)); /* Lamp 4 */
// popmessage("written : %02X", data);
-// coin_counter_w(device->machine, 0, data & 0x40); /* counter1 */
-// coin_counter_w(device->machine, 1, data & 0x80); /* counter2 */
-// coin_counter_w(device->machine, 2, data & 0x20); /* counter3 */
+// coin_counter_w(device->machine(), 0, data & 0x40); /* counter1 */
+// coin_counter_w(device->machine(), 1, data & 0x80); /* counter2 */
+// coin_counter_w(device->machine(), 2, data & 0x20); /* counter3 */
/* Counters:
diff --git a/src/mame/drivers/blitz68k.c b/src/mame/drivers/blitz68k.c
index 33bf829dfbd..b8901047a03 100644
--- a/src/mame/drivers/blitz68k.c
+++ b/src/mame/drivers/blitz68k.c
@@ -78,7 +78,7 @@ struct blit_t
static VIDEO_START(blitz68k)
{
- blitz68k_state *state = machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = machine.driver_data<blitz68k_state>();
state->blit_buffer = auto_alloc_array(machine, UINT8, 512*256);
blit.addr_factor = 2;
}
@@ -91,7 +91,7 @@ static VIDEO_START(blitz68k_addr_factor1)
static SCREEN_UPDATE(blitz68k)
{
- blitz68k_state *state = screen->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = screen->machine().driver_data<blitz68k_state>();
int x,y;
UINT8 *src = state->blit_buffer;
@@ -100,7 +100,7 @@ static SCREEN_UPDATE(blitz68k)
{
for(x = 0; x < 512; x++)
{
- *BITMAP_ADDR32(bitmap, y, x) = screen->machine->pens[*src++];
+ *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[*src++];
}
}
@@ -112,7 +112,7 @@ static SCREEN_UPDATE(blitz68k)
static SCREEN_UPDATE(blitz68k_noblit)
{
- blitz68k_state *state = screen->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = screen->machine().driver_data<blitz68k_state>();
int x,y;
UINT16 *src = state->frame_buffer;
@@ -122,10 +122,10 @@ static SCREEN_UPDATE(blitz68k_noblit)
for(x = 0; x < 512; )
{
UINT16 pen = *src++;
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 8) & 0xf];
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 12) & 0xf];
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 0) & 0xf];
- *BITMAP_ADDR32(bitmap, y, x++) = screen->machine->pens[(pen >> 4) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 8) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 12) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 0) & 0xf];
+ *BITMAP_ADDR32(bitmap, y, x++) = screen->machine().pens[(pen >> 4) & 0xf];
}
}
@@ -140,7 +140,7 @@ static SCREEN_UPDATE(blitz68k_noblit)
static WRITE16_HANDLER( paletteram_io_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
int pal_data;
switch(offset*2)
@@ -167,7 +167,7 @@ static WRITE16_HANDLER( paletteram_io_w )
case 2:
pal_data = (data & 0xff00) >> 8;
state->pal.b = ((pal_data & 0x3f) << 2) | ((pal_data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -187,7 +187,7 @@ static WRITE16_HANDLER( paletteram_io_w )
static WRITE8_HANDLER( paletteram_bt476_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
switch(offset)
{
case 0:
@@ -213,7 +213,7 @@ static WRITE8_HANDLER( paletteram_bt476_w )
break;
case 2:
state->btpal.b = data << 2;
- palette_set_color(space->machine, state->btpal.offs, MAKE_RGB(state->btpal.r, state->btpal.g, state->btpal.b));
+ palette_set_color(space->machine(), state->btpal.offs, MAKE_RGB(state->btpal.r, state->btpal.g, state->btpal.b));
state->btpal.offs_internal = 0;
state->btpal.offs++;
break;
@@ -224,7 +224,7 @@ static WRITE8_HANDLER( paletteram_bt476_w )
static READ8_HANDLER( paletteram_bt476_r )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
UINT8 ret = 0xff;
switch(offset)
@@ -267,8 +267,8 @@ static READ8_HANDLER( paletteram_bt476_r )
static WRITE16_HANDLER( blit_copy_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
- UINT8 *blit_rom = space->machine->region("blitter")->base();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
+ UINT8 *blit_rom = space->machine().region("blitter")->base();
UINT32 blit_dst_xpos;
UINT32 blit_dst_ypos;
int x,y,x_size,y_size;
@@ -456,15 +456,15 @@ static WRITE8_HANDLER( blit_flags_w )
static WRITE8_HANDLER( blit_draw_w )
{
- blitz68k_state *state = space->machine->driver_data<blitz68k_state>();
- UINT8 *blit_rom = space->machine->region("blitter")->base();
- int blit_romsize = space->machine->region("blitter")->bytes();
+ blitz68k_state *state = space->machine().driver_data<blitz68k_state>();
+ UINT8 *blit_rom = space->machine().region("blitter")->base();
+ int blit_romsize = space->machine().region("blitter")->bytes();
UINT32 blit_dst_xpos;
UINT32 blit_dst_ypos;
int x, y, x_size, y_size;
UINT32 src;
- logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", space->machine->describe_context(),
+ logerror("%s: blit x=%02x y=%02x w=%02x h=%02x addr=%02x%02x%02x pens=%02x %02x %02x %02x flag=%02x %02x %02x %02x - %02x %02x %02x %02x\n", space->machine().describe_context(),
blit.x, blit.y, blit.w, blit.h,
blit.addr[2], blit.addr[1], blit.addr[0],
blit.pen[0], blit.pen[1], blit.pen[2], blit.pen[3],
@@ -577,14 +577,14 @@ static WRITE16_HANDLER( lamps_w )
static READ16_HANDLER( test_r )
{
- return 0xffff;//space->machine->rand();
+ return 0xffff;//space->machine().rand();
}
#if 0
static WRITE16_HANDLER( irq_callback_w )
{
// popmessage("%02x",data);
- cputag_set_input_line(space->machine, "maincpu", 3, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "maincpu", 3, HOLD_LINE );
}
static WRITE16_HANDLER( sound_write_w )
@@ -657,14 +657,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( bankrob_mcu1_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( bankrob_mcu2_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -680,11 +680,11 @@ static READ8_HANDLER( bankrob_mcu_status_write_r )
static WRITE8_HANDLER( bankrob_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( bankrob_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( bankrob_map, AS_PROGRAM, 16 )
@@ -740,14 +740,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( bankroba_mcu1_r )
{
- UINT8 ret = space->machine->rand(); // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = space->machine().rand(); // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( bankroba_mcu2_r )
{
- UINT8 ret = space->machine->rand(); // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = space->machine().rand(); // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -762,11 +762,11 @@ static READ8_HANDLER( bankroba_mcu2_status_write_r )
static WRITE8_HANDLER( bankroba_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( bankroba_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( bankroba_map, AS_PROGRAM, 16 )
@@ -828,14 +828,14 @@ static WRITE16_HANDLER( cjffruit_leds1_w )
data = COMBINE_DATA(leds1);
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100); // coin in
- set_led_status(space->machine, 0, data & 0x0200); // win???
+ coin_counter_w(space->machine(), 0, data & 0x0100); // coin in
+ set_led_status(space->machine(), 0, data & 0x0200); // win???
// 1 data & 0x0400 // win???
- set_led_status(space->machine, 2, data & 0x0800); // small
- set_led_status(space->machine, 3, data & 0x1000); // big
- set_led_status(space->machine, 4, data & 0x2000); // take
- set_led_status(space->machine, 5, data & 0x4000); // double up
- set_led_status(space->machine, 6, data & 0x8000); // cancel
+ set_led_status(space->machine(), 2, data & 0x0800); // small
+ set_led_status(space->machine(), 3, data & 0x1000); // big
+ set_led_status(space->machine(), 4, data & 0x2000); // take
+ set_led_status(space->machine(), 5, data & 0x4000); // double up
+ set_led_status(space->machine(), 6, data & 0x8000); // cancel
show_leds123();
}
}
@@ -845,14 +845,14 @@ static WRITE16_HANDLER( cjffruit_leds2_w )
data = COMBINE_DATA(leds2);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 7, data & 0x0100); // start
- set_led_status(space->machine, 8, data & 0x0200); // bet
- set_led_status(space->machine, 9, data & 0x0400); // hold 5
- set_led_status(space->machine, 10, data & 0x0800); // hold 4
- set_led_status(space->machine, 11, data & 0x1000); // hold 3
- set_led_status(space->machine, 12, data & 0x2000); // hold 2
- set_led_status(space->machine, 13, data & 0x4000); // collect
- set_led_status(space->machine, 14, data & 0x8000); // call attendant
+ set_led_status(space->machine(), 7, data & 0x0100); // start
+ set_led_status(space->machine(), 8, data & 0x0200); // bet
+ set_led_status(space->machine(), 9, data & 0x0400); // hold 5
+ set_led_status(space->machine(), 10, data & 0x0800); // hold 4
+ set_led_status(space->machine(), 11, data & 0x1000); // hold 3
+ set_led_status(space->machine(), 12, data & 0x2000); // hold 2
+ set_led_status(space->machine(), 13, data & 0x4000); // collect
+ set_led_status(space->machine(), 14, data & 0x8000); // call attendant
show_leds123();
}
}
@@ -862,8 +862,8 @@ static WRITE16_HANDLER( cjffruit_leds3_w )
data = COMBINE_DATA(leds3);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 15, data & 0x0100); // hopper coins?
- set_led_status(space->machine, 16, data & 0x0400); // coin out?
+ set_led_status(space->machine(), 15, data & 0x0100); // hopper coins?
+ set_led_status(space->machine(), 16, data & 0x0400); // coin out?
show_leds123();
}
}
@@ -896,14 +896,14 @@ static WRITE16_DEVICE_HANDLER( crtc_lpen_w )
// MCU simulation (to be done)
static READ16_HANDLER( cjffruit_mcu_r )
{
- UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0x00; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu reads %02x\n", space->machine().describe_context(), ret);
return ret << 8;
}
static WRITE16_HANDLER( cjffruit_mcu_w )
{
- logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8);
+ logerror("%s: mcu written with %02x\n", space->machine().describe_context(),data >> 8);
}
static ADDRESS_MAP_START( cjffruit_map, AS_PROGRAM, 16 )
@@ -947,14 +947,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ16_HANDLER( deucesw2_mcu_r )
{
- UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0x00; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu reads %02x\n", space->machine().describe_context(), ret);
return ret << 8;
}
static WRITE16_HANDLER( deucesw2_mcu_w )
{
- logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8);
+ logerror("%s: mcu written with %02x\n", space->machine().describe_context(),data >> 8);
}
static WRITE16_HANDLER( deucesw2_leds1_w )
@@ -962,14 +962,14 @@ static WRITE16_HANDLER( deucesw2_leds1_w )
data = COMBINE_DATA(leds1);
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100); // coin in
- set_led_status(space->machine, 0, data & 0x0200); // win???
+ coin_counter_w(space->machine(), 0, data & 0x0100); // coin in
+ set_led_status(space->machine(), 0, data & 0x0200); // win???
// 1 data & 0x0400 // win???
- set_led_status(space->machine, 2, data & 0x0800); // small
- set_led_status(space->machine, 3, data & 0x1000); // big
- set_led_status(space->machine, 4, data & 0x2000); // take
- set_led_status(space->machine, 5, data & 0x4000); // double up
- set_led_status(space->machine, 6, data & 0x8000); // cancel
+ set_led_status(space->machine(), 2, data & 0x0800); // small
+ set_led_status(space->machine(), 3, data & 0x1000); // big
+ set_led_status(space->machine(), 4, data & 0x2000); // take
+ set_led_status(space->machine(), 5, data & 0x4000); // double up
+ set_led_status(space->machine(), 6, data & 0x8000); // cancel
show_leds123();
}
}
@@ -979,14 +979,14 @@ static WRITE16_HANDLER( deucesw2_leds2_w )
data = COMBINE_DATA(leds2);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 7, data & 0x0100); // start
- set_led_status(space->machine, 8, data & 0x0200); // bet
- set_led_status(space->machine, 9, data & 0x0400); // hold 5
- set_led_status(space->machine, 10, data & 0x0800); // hold 4
- set_led_status(space->machine, 11, data & 0x1000); // hold 3
- set_led_status(space->machine, 12, data & 0x2000); // hold 2
- set_led_status(space->machine, 13, data & 0x4000); // hold 1
- set_led_status(space->machine, 14, data & 0x8000); // call attendant
+ set_led_status(space->machine(), 7, data & 0x0100); // start
+ set_led_status(space->machine(), 8, data & 0x0200); // bet
+ set_led_status(space->machine(), 9, data & 0x0400); // hold 5
+ set_led_status(space->machine(), 10, data & 0x0800); // hold 4
+ set_led_status(space->machine(), 11, data & 0x1000); // hold 3
+ set_led_status(space->machine(), 12, data & 0x2000); // hold 2
+ set_led_status(space->machine(), 13, data & 0x4000); // hold 1
+ set_led_status(space->machine(), 14, data & 0x8000); // call attendant
show_leds123();
}
}
@@ -996,8 +996,8 @@ static WRITE16_HANDLER( deucesw2_leds3_w )
data = COMBINE_DATA(leds3);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 15, data & 0x0100); // hopper coins?
- set_led_status(space->machine, 16, data & 0x0400); // coin out?
+ set_led_status(space->machine(), 15, data & 0x0100); // hopper coins?
+ set_led_status(space->machine(), 16, data & 0x0400); // coin out?
show_leds123();
}
}
@@ -1043,14 +1043,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( dualgame_mcu1_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( dualgame_mcu2_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -1066,11 +1066,11 @@ static READ8_HANDLER( dualgame_mcu_status_write_r )
static WRITE8_HANDLER( dualgame_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( dualgame_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( dualgame_map, AS_PROGRAM, 16 )
@@ -1131,14 +1131,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ16_HANDLER( hermit_mcu_r )
{
- UINT8 ret = 0x00; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0x00; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu reads %02x\n", space->machine().describe_context(), ret);
return ret << 8;
}
static WRITE16_HANDLER( hermit_mcu_w )
{
- logerror("%s: mcu written with %02x\n", space->machine->describe_context(),data >> 8);
+ logerror("%s: mcu written with %02x\n", space->machine().describe_context(),data >> 8);
}
static WRITE16_HANDLER( hermit_leds1_w )
@@ -1146,7 +1146,7 @@ static WRITE16_HANDLER( hermit_leds1_w )
data = COMBINE_DATA(leds1);
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100); // coin in
+ coin_counter_w(space->machine(), 0, data & 0x0100); // coin in
show_leds12();
}
}
@@ -1156,7 +1156,7 @@ static WRITE16_HANDLER( hermit_leds2_w )
data = COMBINE_DATA(leds2);
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 7, data & 0x0100); // button
+ set_led_status(space->machine(), 7, data & 0x0100); // button
show_leds12();
}
}
@@ -1164,12 +1164,12 @@ static WRITE16_HANDLER( hermit_leds2_w )
static READ16_HANDLER( hermit_track_r )
{
#ifdef MAME_DEBUG
-// popmessage("track %02x %02x", input_port_read(space->machine, "TRACK_X"), input_port_read(space->machine, "TRACK_Y"));
+// popmessage("track %02x %02x", input_port_read(space->machine(), "TRACK_X"), input_port_read(space->machine(), "TRACK_Y"));
#endif
return
- ((0xf - ((input_port_read(space->machine, "TRACK_Y") + 0x7) & 0xf)) << 12) |
- ((0xf - ((input_port_read(space->machine, "TRACK_X") + 0x7) & 0xf)) << 8) ;
+ ((0xf - ((input_port_read(space->machine(), "TRACK_Y") + 0x7) & 0xf)) << 12) |
+ ((0xf - ((input_port_read(space->machine(), "TRACK_X") + 0x7) & 0xf)) << 8) ;
}
static ADDRESS_MAP_START( hermit_map, AS_PROGRAM, 16 )
@@ -1210,14 +1210,14 @@ ADDRESS_MAP_END
// MCU simulation (to be done)
static READ8_HANDLER( maxidbl_mcu1_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu1 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu1 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
static READ8_HANDLER( maxidbl_mcu2_r )
{
- UINT8 ret = 0; // space->machine->rand() gives "interesting" results
- logerror("%s: mcu2 reads %02x\n", space->machine->describe_context(), ret);
+ UINT8 ret = 0; // space->machine().rand() gives "interesting" results
+ logerror("%s: mcu2 reads %02x\n", space->machine().describe_context(), ret);
return ret;
}
@@ -1233,11 +1233,11 @@ static READ8_HANDLER( maxidbl_mcu_status_write_r )
static WRITE8_HANDLER( maxidbl_mcu1_w )
{
- logerror("%s: mcu1 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu1 written with %02x\n", space->machine().describe_context(), data);
}
static WRITE8_HANDLER( maxidbl_mcu2_w )
{
- logerror("%s: mcu2 written with %02x\n", space->machine->describe_context(), data);
+ logerror("%s: mcu2 written with %02x\n", space->machine().describe_context(), data);
}
static ADDRESS_MAP_START( maxidbl_map, AS_PROGRAM, 16 )
@@ -1622,17 +1622,17 @@ static MC6845_ON_UPDATE_ADDR_CHANGED(crtc_addr)
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync_irq1)
{
- cputag_set_input_line(device->machine, "maincpu", 1, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 1, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync_irq3)
{
- cputag_set_input_line(device->machine, "maincpu", 3, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 3, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER(crtc_vsync_irq5)
{
- cputag_set_input_line(device->machine, "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 5, state ? ASSERT_LINE : CLEAR_LINE);
}
const mc6845_interface mc6845_intf_irq1 =
@@ -1721,7 +1721,7 @@ MACHINE_CONFIG_END
static TIMER_DEVICE_CALLBACK( steaser_mcu_sim )
{
- blitz68k_state *state = timer.machine->driver_data<blitz68k_state>();
+ blitz68k_state *state = timer.machine().driver_data<blitz68k_state>();
// static int i;
/*first off, signal the "MCU is running" flag*/
state->m_nvram[0x932/2] = 0xffff;
@@ -1729,14 +1729,14 @@ static TIMER_DEVICE_CALLBACK( steaser_mcu_sim )
// for(i=0;i<8;i+=2)
// state->m_nvram[((0x8a0)+i)/2] = 0;
/*finally, read the inputs*/
- state->m_nvram[0x89e/2] = input_port_read(timer.machine, "MENU") & 0xffff;
- state->m_nvram[0x8a0/2] = input_port_read(timer.machine, "STAT") & 0xffff;
- state->m_nvram[0x8a2/2] = input_port_read(timer.machine, "BET_DEAL") & 0xffff;
- state->m_nvram[0x8a4/2] = input_port_read(timer.machine, "TAKE_DOUBLE") & 0xffff;
- state->m_nvram[0x8a6/2] = input_port_read(timer.machine, "SMALL_BIG") & 0xffff;
- state->m_nvram[0x8a8/2] = input_port_read(timer.machine, "CANCEL_HOLD1") & 0xffff;
- state->m_nvram[0x8aa/2] = input_port_read(timer.machine, "HOLD2_HOLD3") & 0xffff;
- state->m_nvram[0x8ac/2] = input_port_read(timer.machine, "HOLD4_HOLD5") & 0xffff;
+ state->m_nvram[0x89e/2] = input_port_read(timer.machine(), "MENU") & 0xffff;
+ state->m_nvram[0x8a0/2] = input_port_read(timer.machine(), "STAT") & 0xffff;
+ state->m_nvram[0x8a2/2] = input_port_read(timer.machine(), "BET_DEAL") & 0xffff;
+ state->m_nvram[0x8a4/2] = input_port_read(timer.machine(), "TAKE_DOUBLE") & 0xffff;
+ state->m_nvram[0x8a6/2] = input_port_read(timer.machine(), "SMALL_BIG") & 0xffff;
+ state->m_nvram[0x8a8/2] = input_port_read(timer.machine(), "CANCEL_HOLD1") & 0xffff;
+ state->m_nvram[0x8aa/2] = input_port_read(timer.machine(), "HOLD2_HOLD3") & 0xffff;
+ state->m_nvram[0x8ac/2] = input_port_read(timer.machine(), "HOLD4_HOLD5") & 0xffff;
}
/* TODO: remove this hack.*/
@@ -2688,7 +2688,7 @@ ROM_END
static DRIVER_INIT( bankrob )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xb5e0/2] = 0x6028;
@@ -2703,7 +2703,7 @@ static DRIVER_INIT( bankrob )
static DRIVER_INIT( bankroba )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0x11e4e/2] = 0x6028;
@@ -2718,7 +2718,7 @@ static DRIVER_INIT( bankroba )
static DRIVER_INIT( cjffruit )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xf564/2] = 0x6028;
@@ -2729,7 +2729,7 @@ static DRIVER_INIT( cjffruit )
static DRIVER_INIT( deucesw2 )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0x8fe4/2] = 0x6020;
@@ -2740,7 +2740,7 @@ static DRIVER_INIT( deucesw2 )
static DRIVER_INIT( dualgame )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xa518/2] = 0x6024;
@@ -2751,7 +2751,7 @@ static DRIVER_INIT( dualgame )
static DRIVER_INIT( hermit )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xdeba/2] = 0x602e;
@@ -2768,7 +2768,7 @@ static DRIVER_INIT( hermit )
static DRIVER_INIT( maxidbl )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xb384/2] = 0x6036;
@@ -2779,7 +2779,7 @@ static DRIVER_INIT( maxidbl )
static DRIVER_INIT( megadblj )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xe21c/2] = 0x6040;
@@ -2790,7 +2790,7 @@ static DRIVER_INIT( megadblj )
static DRIVER_INIT( megadble )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
// WRONG C8 #1
ROM[0xcfc2/2] = 0x4e71;
diff --git a/src/mame/drivers/blktiger.c b/src/mame/drivers/blktiger.c
index 38609168b2b..668221349b0 100644
--- a/src/mame/drivers/blktiger.c
+++ b/src/mame/drivers/blktiger.c
@@ -28,20 +28,20 @@ Protection comms between main cpu and i8751
static READ8_HANDLER( blktiger_from_mcu_r )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
return state->i8751_latch;
}
static WRITE8_HANDLER( blktiger_to_mcu_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
device_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE);
state->z80_latch = data;
}
static READ8_HANDLER( blktiger_from_main_r )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
device_set_input_line(state->mcu, MCS51_INT1_LINE, CLEAR_LINE);
//printf("%02x read\n",latch);
return state->z80_latch;
@@ -49,7 +49,7 @@ static READ8_HANDLER( blktiger_from_main_r )
static WRITE8_HANDLER( blktiger_to_main_w )
{
- blktiger_state *state = space->machine->driver_data<blktiger_state>();
+ blktiger_state *state = space->machine().driver_data<blktiger_state>();
//printf("%02x write\n",data);
state->i8751_latch = data;
}
@@ -58,15 +58,15 @@ static WRITE8_HANDLER( blktiger_to_main_w )
static WRITE8_HANDLER( blktiger_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( blktiger_coinlockout_w )
{
- if (input_port_read(space->machine, "COIN_LOCKOUT") & 0x01)
+ if (input_port_read(space->machine(), "COIN_LOCKOUT") & 0x01)
{
- coin_lockout_w(space->machine, 0,~data & 0x01);
- coin_lockout_w(space->machine, 1,~data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x01);
+ coin_lockout_w(space->machine(), 1,~data & 0x02);
}
}
@@ -265,7 +265,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- blktiger_state *state = device->machine->driver_data<blktiger_state>();
+ blktiger_state *state = device->machine().driver_data<blktiger_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -281,13 +281,13 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( blktiger )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
/* configure bankswitching */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->scroll_bank));
state->save_item(NAME(state->screen_layout));
@@ -302,10 +302,10 @@ static MACHINE_START( blktiger )
static MACHINE_RESET( blktiger )
{
- blktiger_state *state = machine->driver_data<blktiger_state>();
+ blktiger_state *state = machine.driver_data<blktiger_state>();
/* configure bankswitching */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->scroll_x[0] = 0;
state->scroll_x[1] = 0;
diff --git a/src/mame/drivers/blmbycar.c b/src/mame/drivers/blmbycar.c
index 7d0928aceec..c448941df8f 100644
--- a/src/mame/drivers/blmbycar.c
+++ b/src/mame/drivers/blmbycar.c
@@ -43,7 +43,7 @@ static WRITE16_HANDLER( blmbycar_okibank_w )
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
memcpy(&RAM[0x30000], &RAM[0x40000 + 0x10000 * (data & 0xf)], 0x10000);
}
}
@@ -60,15 +60,15 @@ static WRITE16_HANDLER( blmbycar_okibank_w )
static WRITE16_HANDLER( blmbycar_pot_wheel_reset_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
- state->pot_wheel = ~input_port_read(space->machine, "WHEEL") & 0xff;
+ state->pot_wheel = ~input_port_read(space->machine(), "WHEEL") & 0xff;
}
static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
if (ACCESSING_BITS_0_7)
{
@@ -80,8 +80,8 @@ static WRITE16_HANDLER( blmbycar_pot_wheel_shift_w )
static READ16_HANDLER( blmbycar_pot_wheel_r )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
- return ((state->pot_wheel & 0x80) ? 0x04 : 0) | (space->machine->rand() & 0x08);
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
+ return ((state->pot_wheel & 0x80) ? 0x04 : 0) | (space->machine().rand() & 0x08);
}
@@ -89,7 +89,7 @@ static READ16_HANDLER( blmbycar_pot_wheel_r )
static READ16_HANDLER( blmbycar_opt_wheel_r )
{
- return (~input_port_read(space->machine, "WHEEL") & 0xff) << 8;
+ return (~input_port_read(space->machine(), "WHEEL") & 0xff) << 8;
}
@@ -130,7 +130,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( waterball_unk_r )
{
- blmbycar_state *state = space->machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = space->machine().driver_data<blmbycar_state>();
state->retvalue ^= 0x0008; // must toggle.. but not vblank?
return state->retvalue;
@@ -341,7 +341,7 @@ GFXDECODE_END
static MACHINE_START( blmbycar )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->save_item(NAME(state->pot_wheel));
state->save_item(NAME(state->old_val));
@@ -349,7 +349,7 @@ static MACHINE_START( blmbycar )
static MACHINE_RESET( blmbycar )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->pot_wheel = 0;
state->old_val = 0;
@@ -391,14 +391,14 @@ MACHINE_CONFIG_END
static MACHINE_START( watrball )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->save_item(NAME(state->retvalue));
}
static MACHINE_RESET( watrball )
{
- blmbycar_state *state = machine->driver_data<blmbycar_state>();
+ blmbycar_state *state = machine.driver_data<blmbycar_state>();
state->retvalue = 0;
}
@@ -527,8 +527,8 @@ ROM_END
static DRIVER_INIT( blmbycar )
{
- UINT16 *RAM = (UINT16 *) machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes() / 2;
+ UINT16 *RAM = (UINT16 *) machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes() / 2;
int i;
for (i = 0; i < size; i++)
diff --git a/src/mame/drivers/blockade.c b/src/mame/drivers/blockade.c
index 3c84bb81967..dd193d24cec 100644
--- a/src/mame/drivers/blockade.c
+++ b/src/mame/drivers/blockade.c
@@ -60,10 +60,10 @@
static INTERRUPT_GEN( blockade_interrupt )
{
- blockade_state *state = device->machine->driver_data<blockade_state>();
+ blockade_state *state = device->machine().driver_data<blockade_state>();
device_resume(device, SUSPEND_ANY_REASON);
- if ((input_port_read(device->machine, "IN0") & 0x80) == 0)
+ if ((input_port_read(device->machine(), "IN0") & 0x80) == 0)
{
state->just_been_reset = 1;
device_set_input_line(device, INPUT_LINE_RESET, PULSE_LINE);
@@ -78,16 +78,16 @@ static INTERRUPT_GEN( blockade_interrupt )
static READ8_HANDLER( blockade_input_port_0_r )
{
- blockade_state *state = space->machine->driver_data<blockade_state>();
+ blockade_state *state = space->machine().driver_data<blockade_state>();
/* coin latch is bit 7 */
- UINT8 temp = (input_port_read(space->machine, "IN0") & 0x7f);
+ UINT8 temp = (input_port_read(space->machine(), "IN0") & 0x7f);
return (state->coin_latch << 7) | temp;
}
static WRITE8_HANDLER( blockade_coin_latch_w )
{
- blockade_state *state = space->machine->driver_data<blockade_state>();
+ blockade_state *state = space->machine().driver_data<blockade_state>();
if (data & 0x80)
{
@@ -456,7 +456,7 @@ static PALETTE_INIT( blockade )
static MACHINE_START( blockade )
{
- blockade_state *state = machine->driver_data<blockade_state>();
+ blockade_state *state = machine.driver_data<blockade_state>();
state->save_item(NAME(state->coin_latch));
state->save_item(NAME(state->just_been_reset));
@@ -464,7 +464,7 @@ static MACHINE_START( blockade )
static MACHINE_RESET( blockade )
{
- blockade_state *state = machine->driver_data<blockade_state>();
+ blockade_state *state = machine.driver_data<blockade_state>();
state->coin_latch = 1;
state->just_been_reset = 0;
diff --git a/src/mame/drivers/blockhl.c b/src/mame/drivers/blockhl.c
index 381761c6e20..131534a78e6 100644
--- a/src/mame/drivers/blockhl.c
+++ b/src/mame/drivers/blockhl.c
@@ -32,7 +32,7 @@ static KONAMI_SETLINES_CALLBACK( blockhl_banking );
static INTERRUPT_GEN( blockhl_interrupt )
{
- blockhl_state *state = device->machine->driver_data<blockhl_state>();
+ blockhl_state *state = device->machine().driver_data<blockhl_state>();
if (k052109_is_irq_enabled(state->k052109) && state->rombank == 0) /* kludge to prevent crashes */
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -40,17 +40,17 @@ static INTERRUPT_GEN( blockhl_interrupt )
static READ8_HANDLER( bankedram_r )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -60,7 +60,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -68,7 +68,7 @@ static WRITE8_HANDLER( blockhl_sh_irqtrigger_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -85,7 +85,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- blockhl_state *state = space->machine->driver_data<blockhl_state>();
+ blockhl_state *state = space->machine().driver_data<blockhl_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -193,15 +193,15 @@ static const k051960_interface blockhl_k051960_intf =
static MACHINE_START( blockhl )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->palette_selected));
state->save_item(NAME(state->rombank));
@@ -209,9 +209,9 @@ static MACHINE_START( blockhl )
static MACHINE_RESET( blockhl )
{
- blockhl_state *state = machine->driver_data<blockhl_state>();
+ blockhl_state *state = machine.driver_data<blockhl_state>();
- konami_configure_set_lines(machine->device("maincpu"), blockhl_banking);
+ konami_configure_set_lines(machine.device("maincpu"), blockhl_banking);
state->palette_selected = 0;
state->rombank = 0;
@@ -320,15 +320,15 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( blockhl_banking )
{
- blockhl_state *state = device->machine->driver_data<blockhl_state>();
+ blockhl_state *state = device->machine().driver_data<blockhl_state>();
/* bits 0-1 = ROM bank */
state->rombank = lines & 0x03;
- memory_set_bank(device->machine, "bank1", state->rombank);
+ memory_set_bank(device->machine(), "bank1", state->rombank);
/* bits 3/4 = coin counters */
- coin_counter_w(device->machine, 0, lines & 0x08);
- coin_counter_w(device->machine, 1, lines & 0x10);
+ coin_counter_w(device->machine(), 0, lines & 0x08);
+ coin_counter_w(device->machine(), 1, lines & 0x10);
/* bit 5 = select palette RAM or work RAM at 5800-5fff */
state->palette_selected = ~lines & 0x20;
diff --git a/src/mame/drivers/blockout.c b/src/mame/drivers/blockout.c
index eabacbd0bb7..a02b7483228 100644
--- a/src/mame/drivers/blockout.c
+++ b/src/mame/drivers/blockout.c
@@ -83,7 +83,7 @@ static INTERRUPT_GEN( blockout_interrupt )
static WRITE16_HANDLER( blockout_sound_command_w )
{
- blockout_state *state = space->machine->driver_data<blockout_state>();
+ blockout_state *state = space->machine().driver_data<blockout_state>();
if (ACCESSING_BITS_0_7)
{
@@ -237,7 +237,7 @@ INPUT_PORTS_END
/* handler called by the 2151 emulator when the internal timers cause an IRQ */
static void blockout_irq_handler(device_t *device, int irq)
{
- blockout_state *state = device->machine->driver_data<blockout_state>();
+ blockout_state *state = device->machine().driver_data<blockout_state>();
device_set_input_line_and_vector(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xff);
}
@@ -255,16 +255,16 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( blockout )
{
- blockout_state *state = machine->driver_data<blockout_state>();
+ blockout_state *state = machine.driver_data<blockout_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->color));
}
static MACHINE_RESET( blockout )
{
- blockout_state *state = machine->driver_data<blockout_state>();
+ blockout_state *state = machine.driver_data<blockout_state>();
state->color = 0;
}
diff --git a/src/mame/drivers/blstroid.c b/src/mame/drivers/blstroid.c
index 9d4dd98fa55..87e0a0780bc 100644
--- a/src/mame/drivers/blstroid.c
+++ b/src/mame/drivers/blstroid.c
@@ -31,9 +31,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- blstroid_state *state = machine->driver_data<blstroid_state>();
+ blstroid_state *state = machine.driver_data<blstroid_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 4, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -42,7 +42,7 @@ static void update_interrupts(running_machine *machine)
static WRITE16_HANDLER( blstroid_halt_until_hblank_0_w )
{
- atarigen_halt_until_hblank_0(*space->machine->primary_screen);
+ atarigen_halt_until_hblank_0(*space->machine().primary_screen);
}
@@ -54,11 +54,11 @@ static MACHINE_START( blstroid )
static MACHINE_RESET( blstroid )
{
- blstroid_state *state = machine->driver_data<blstroid_state>();
+ blstroid_state *state = machine.driver_data<blstroid_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, blstroid_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, blstroid_scanline_update, 8);
atarijsa_reset();
}
@@ -73,11 +73,11 @@ static MACHINE_RESET( blstroid )
static READ16_HANDLER( inputs_r )
{
static const char *const iptnames[] = { "IN0", "IN1" };
- blstroid_state *state = space->machine->driver_data<blstroid_state>();
- int temp = input_port_read(space->machine, iptnames[offset & 1]);
+ blstroid_state *state = space->machine().driver_data<blstroid_state>();
+ int temp = input_port_read(space->machine(), iptnames[offset & 1]);
if (state->cpu_to_sound_ready) temp ^= 0x0040;
- if (atarigen_get_hblank(*space->machine->primary_screen)) temp ^= 0x0010;
+ if (atarigen_get_hblank(*space->machine().primary_screen)) temp ^= 0x0010;
return temp;
}
diff --git a/src/mame/drivers/blueprnt.c b/src/mame/drivers/blueprnt.c
index 53e19343d8f..9d7f2a68603 100644
--- a/src/mame/drivers/blueprnt.c
+++ b/src/mame/drivers/blueprnt.c
@@ -60,27 +60,27 @@
static WRITE8_DEVICE_HANDLER( dipsw_w )
{
- blueprnt_state *state = device->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = device->machine().driver_data<blueprnt_state>();
state->dipsw = data;
}
static READ8_HANDLER( blueprnt_sh_dipsw_r )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
return state->dipsw;
}
static WRITE8_HANDLER( blueprnt_sound_command_w )
{
- blueprnt_state *state = space->machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = space->machine().driver_data<blueprnt_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( blueprnt_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
/*************************************
@@ -281,16 +281,16 @@ static const ay8910_interface ay8910_interface_2 =
static MACHINE_START( blueprnt )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->dipsw));
}
static MACHINE_RESET( blueprnt )
{
- blueprnt_state *state = machine->driver_data<blueprnt_state>();
+ blueprnt_state *state = machine.driver_data<blueprnt_state>();
state->gfx_bank = 0;
state->dipsw = 0;
diff --git a/src/mame/drivers/bmcbowl.c b/src/mame/drivers/bmcbowl.c
index 2fe318c084d..e4573186c20 100644
--- a/src/mame/drivers/bmcbowl.c
+++ b/src/mame/drivers/bmcbowl.c
@@ -134,14 +134,14 @@ static VIDEO_START( bmcbowl )
static SCREEN_UPDATE( bmcbowl )
{
- bmcbowl_state *state = screen->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = screen->machine().driver_data<bmcbowl_state>();
/*
280x230,4 bitmap layers, 8bpp,
missing scroll and priorities (maybe fixed ones)
*/
int x,y,z,pixdat;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
z=0;
for (y=0;y<230;y++)
@@ -184,7 +184,7 @@ static SCREEN_UPDATE( bmcbowl )
static READ16_HANDLER( bmc_random_read )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ16_HANDLER( bmc_protection_r )
@@ -201,20 +201,20 @@ static READ16_HANDLER( bmc_protection_r )
break;
}
logerror("Protection read @ %X\n",cpu_get_previouspc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE16_HANDLER( bmc_RAMDAC_offset_w )
{
- bmcbowl_state *state = space->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = space->machine().driver_data<bmcbowl_state>();
state->clr_offset=data*3;
}
static WRITE16_HANDLER( bmc_RAMDAC_color_w )
{
- bmcbowl_state *state = space->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = space->machine().driver_data<bmcbowl_state>();
state->bmc_colorram[state->clr_offset]=data;
- palette_set_color_rgb(space->machine,state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
+ palette_set_color_rgb(space->machine(),state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
state->clr_offset=(state->clr_offset+1)%768;
}
@@ -226,7 +226,7 @@ static WRITE16_HANDLER( scroll_w )
static READ8_DEVICE_HANDLER(via_b_in)
{
- return input_port_read(device->machine, "IN3");
+ return input_port_read(device->machine(), "IN3");
}
@@ -299,7 +299,7 @@ static void init_stats(bmcbowl_state *state, const UINT8 *table, int table_len,
static NVRAM_HANDLER( bmcbowl )
{
- bmcbowl_state *state = machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = machine.driver_data<bmcbowl_state>();
int i;
if (read_or_write)
@@ -446,20 +446,20 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER(dips1_r)
{
- bmcbowl_state *state = device->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = device->machine().driver_data<bmcbowl_state>();
switch(state->bmc_input)
{
- case 0x00: return input_port_read(device->machine, "IN1");
- case 0x40: return input_port_read(device->machine, "IN2");
+ case 0x00: return input_port_read(device->machine(), "IN1");
+ case 0x40: return input_port_read(device->machine(), "IN2");
}
- logerror("%s:unknown input - %X\n",device->machine->describe_context(),state->bmc_input);
+ logerror("%s:unknown input - %X\n",device->machine().describe_context(),state->bmc_input);
return 0xff;
}
static WRITE8_DEVICE_HANDLER(input_mux_w)
{
- bmcbowl_state *state = device->machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = device->machine().driver_data<bmcbowl_state>();
state->bmc_input=data;
}
@@ -552,7 +552,7 @@ ROM_END
static DRIVER_INIT(bmcbowl)
{
- bmcbowl_state *state = machine->driver_data<bmcbowl_state>();
+ bmcbowl_state *state = machine.driver_data<bmcbowl_state>();
state->bmc_colorram = auto_alloc_array(machine, UINT8, 768);
}
diff --git a/src/mame/drivers/bnstars.c b/src/mame/drivers/bnstars.c
index 27370e7297b..25c2d8723c9 100644
--- a/src/mame/drivers/bnstars.c
+++ b/src/mame/drivers/bnstars.c
@@ -127,7 +127,7 @@ public:
static TILE_GET_INFO( get_ms32_tx0_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno, colour;
tileno = state->ms32_tx0_ram[tile_index *2+0] & 0x0000ffff;
@@ -138,7 +138,7 @@ static TILE_GET_INFO( get_ms32_tx0_tile_info )
static TILE_GET_INFO( get_ms32_tx1_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno, colour;
tileno = state->ms32_tx1_ram[tile_index *2+0] & 0x0000ffff;
@@ -149,14 +149,14 @@ static TILE_GET_INFO( get_ms32_tx1_tile_info )
static WRITE32_HANDLER( ms32_tx0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_tx0_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_tx_tilemap[0],offset/2);
}
static WRITE32_HANDLER( ms32_tx1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_tx1_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_tx_tilemap[1],offset/2);
}
@@ -165,7 +165,7 @@ static WRITE32_HANDLER( ms32_tx1_ram_w )
static TILE_GET_INFO( get_ms32_bg0_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_bg0_ram[tile_index *2+0] & 0x0000ffff;
@@ -176,7 +176,7 @@ static TILE_GET_INFO( get_ms32_bg0_tile_info )
static TILE_GET_INFO( get_ms32_bg1_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_bg1_ram[tile_index *2+0] & 0x0000ffff;
@@ -187,23 +187,23 @@ static TILE_GET_INFO( get_ms32_bg1_tile_info )
static WRITE32_HANDLER( ms32_bg0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_bg0_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_bg_tilemap[0],offset/2);
}
static WRITE32_HANDLER( ms32_bg1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_bg1_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_bg_tilemap[1],offset/2);
}
/* ROZ Layers */
-static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int chip)
+static void draw_roz(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int priority, int chip)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
/* TODO: registers 0x40/4 / 0x44/4 and 0x50/4 / 0x54/4 are used, meaning unknown */
if (state->ms32_roz_ctrl[chip][0x5c/4] & 1) /* "super" mode */
@@ -289,7 +289,7 @@ static void draw_roz(running_machine *machine, bitmap_t *bitmap, const rectangle
static TILE_GET_INFO( get_ms32_roz0_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_roz0_ram[tile_index *2+0] & 0x0000ffff;
@@ -300,7 +300,7 @@ static TILE_GET_INFO( get_ms32_roz0_tile_info )
static TILE_GET_INFO( get_ms32_roz1_tile_info )
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int tileno,colour;
tileno = state->ms32_roz1_ram[tile_index *2+0] & 0x0000ffff;
@@ -311,22 +311,22 @@ static TILE_GET_INFO( get_ms32_roz1_tile_info )
static WRITE32_HANDLER( ms32_roz0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_roz0_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_roz_tilemap[0],offset/2);
}
static WRITE32_HANDLER( ms32_roz1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_roz1_ram[offset]);
tilemap_mark_tile_dirty(state->ms32_roz_tilemap[1],offset/2);
}
-static void update_color(running_machine *machine, int color, int screen)
+static void update_color(running_machine &machine, int color, int screen)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
int r,g,b;
r = ((state->ms32_pal_ram[screen][color*2] & 0xff00) >>8 );
@@ -338,23 +338,23 @@ static void update_color(running_machine *machine, int color, int screen)
static WRITE32_HANDLER( ms32_pal0_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_pal_ram[0][offset]);
- update_color(space->machine, offset/2, 0);
+ update_color(space->machine(), offset/2, 0);
}
static WRITE32_HANDLER( ms32_pal1_ram_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_pal_ram[1][offset]);
- update_color(space->machine, offset/2, 1);
+ update_color(space->machine(), offset/2, 1);
}
/* SPRITES based on tetrisp2 for now, readd priority bits later */
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 *sprram_top, size_t sprram_size, int region)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, UINT32 *sprram_top, size_t sprram_size, int region)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
/***************************************************************************
@@ -395,7 +395,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int tx, ty, sx, sy, flipx, flipy;
int xsize, ysize, xzoom, yzoom;
int code, attr, color, size, pri, pri_mask;
- gfx_element *gfx = machine->gfx[region];
+ gfx_element *gfx = machine.gfx[region];
UINT32 *source = sprram_top;
const UINT32 *finish = sprram_top + (sprram_size - 0x10) / 4;
@@ -474,7 +474,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
color,
flipx, flipy,
sx,sy,
- xzoom, yzoom, machine->priority_bitmap,pri_mask, 0);
+ xzoom, yzoom, machine.priority_bitmap,pri_mask, 0);
} /* end sprite loop */
}
@@ -482,14 +482,14 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static WRITE32_HANDLER( ms32_spramx_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
COMBINE_DATA(&state->ms32_spram[offset]);
}
static VIDEO_START(bnstars)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
state->ms32_tx_tilemap[0] = tilemap_create(machine, get_ms32_tx0_tile_info,tilemap_scan_rows, 8, 8,64,64);
state->ms32_tx_tilemap[1] = tilemap_create(machine, get_ms32_tx1_tile_info,tilemap_scan_rows, 8, 8,64,64);
tilemap_set_transparent_pen(state->ms32_tx_tilemap[0],0);
@@ -514,11 +514,11 @@ static VIDEO_START(bnstars)
static SCREEN_UPDATE(bnstars)
{
- bnstars_state *state = screen->machine->driver_data<bnstars_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ bnstars_state *state = screen->machine().driver_data<bnstars_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
if (screen==left_screen)
{
@@ -529,14 +529,14 @@ static SCREEN_UPDATE(bnstars)
tilemap_set_scrolly(state->ms32_bg_tilemap[0], 0, state->ms32_bg0_scroll[0x0c/4] + state->ms32_bg0_scroll[0x14/4] );
tilemap_draw(bitmap,cliprect,state->ms32_bg_tilemap[0],0,1);
- draw_roz(screen->machine,bitmap,cliprect,2,0);
+ draw_roz(screen->machine(),bitmap,cliprect,2,0);
tilemap_set_scrollx(state->ms32_tx_tilemap[0], 0, state->ms32_tx0_scroll[0x00/4] + state->ms32_tx0_scroll[0x08/4] + 0x18);
tilemap_set_scrolly(state->ms32_tx_tilemap[0], 0, state->ms32_tx0_scroll[0x0c/4] + state->ms32_tx0_scroll[0x14/4]);
tilemap_draw(bitmap,cliprect,state->ms32_tx_tilemap[0],0,4);
- draw_sprites(screen->machine,bitmap,cliprect, state->ms32_spram, 0x20000, 0);
+ draw_sprites(screen->machine(),bitmap,cliprect, state->ms32_spram, 0x20000, 0);
}
else if (screen == right_screen)
{
@@ -547,13 +547,13 @@ static SCREEN_UPDATE(bnstars)
tilemap_set_scrolly(state->ms32_bg_tilemap[1], 0, state->ms32_bg1_scroll[0x0c/4] + state->ms32_bg1_scroll[0x14/4] );
tilemap_draw(bitmap,cliprect,state->ms32_bg_tilemap[1],0,1);
- draw_roz(screen->machine,bitmap,cliprect,2,1);
+ draw_roz(screen->machine(),bitmap,cliprect,2,1);
tilemap_set_scrollx(state->ms32_tx_tilemap[1], 0, state->ms32_tx1_scroll[0x00/4] + state->ms32_tx1_scroll[0x08/4] + 0x18);
tilemap_set_scrolly(state->ms32_tx_tilemap[1], 0, state->ms32_tx1_scroll[0x0c/4] + state->ms32_tx1_scroll[0x14/4]);
tilemap_draw(bitmap,cliprect,state->ms32_tx_tilemap[1],0,4);
- draw_sprites(screen->machine,bitmap,cliprect, state->ms32_spram+(0x20000/4), 0x20000, 4);
+ draw_sprites(screen->machine(),bitmap,cliprect, state->ms32_spram+(0x20000/4), 0x20000, 4);
}
return 0;
@@ -1221,7 +1221,7 @@ GFXDECODE_END
static READ32_HANDLER( bnstars1_r )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
switch (state->bnstars1_mahjong_select & 0x2080)
{
default:
@@ -1229,33 +1229,33 @@ static READ32_HANDLER( bnstars1_r )
return 0xffffffff;
case 0x0000:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x0080:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x2000:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x2080:
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
}
static READ32_HANDLER( bnstars2_r )
{
- return input_port_read(space->machine, "IN4");
+ return input_port_read(space->machine(), "IN4");
}
static READ32_HANDLER( bnstars3_r )
{
- return input_port_read(space->machine, "IN5");
+ return input_port_read(space->machine(), "IN5");
}
static WRITE32_HANDLER( bnstars1_mahjong_select_w )
{
- bnstars_state *state = space->machine->driver_data<bnstars_state>();
+ bnstars_state *state = space->machine().driver_data<bnstars_state>();
state->bnstars1_mahjong_select = data;
// printf("%08x\n",state->bnstars1_mahjong_select);
}
@@ -1308,7 +1308,7 @@ ADDRESS_MAP_END
static IRQ_CALLBACK(irq_callback)
{
- bnstars_state *state = device->machine->driver_data<bnstars_state>();
+ bnstars_state *state = device->machine().driver_data<bnstars_state>();
int i;
for(i=15; i>=0 && !(state->irqreq & (1<<i)); i--);
state->irqreq &= ~(1<<i);
@@ -1317,17 +1317,17 @@ static IRQ_CALLBACK(irq_callback)
return i;
}
-static void irq_init(running_machine *machine)
+static void irq_init(running_machine &machine)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
state->irqreq = 0;
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
-static void irq_raise(running_machine *machine, int level)
+static void irq_raise(running_machine &machine, int level)
{
- bnstars_state *state = machine->driver_data<bnstars_state>();
+ bnstars_state *state = machine.driver_data<bnstars_state>();
state->irqreq |= (1<<level);
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
@@ -1335,8 +1335,8 @@ static void irq_raise(running_machine *machine, int level)
static INTERRUPT_GEN(ms32_interrupt)
{
- if( cpu_getiloops(device) == 0 ) irq_raise(device->machine, 10);
- if( cpu_getiloops(device) == 1 ) irq_raise(device->machine, 9);
+ if( cpu_getiloops(device) == 0 ) irq_raise(device->machine(), 10);
+ if( cpu_getiloops(device) == 1 ) irq_raise(device->machine(), 9);
/* hayaosi1 needs at least 12 IRQ 0 per frame to work (see code at FFE02289)
kirarast needs it too, at least 8 per frame, but waits for a variable amount
47pi2 needs ?? per frame (otherwise it hangs when you lose)
@@ -1345,7 +1345,7 @@ static INTERRUPT_GEN(ms32_interrupt)
desertwr
p47aces
*/
- if( cpu_getiloops(device) >= 3 && cpu_getiloops(device) <= 32 ) irq_raise(device->machine, 0);
+ if( cpu_getiloops(device) >= 3 && cpu_getiloops(device) <= 32 ) irq_raise(device->machine(), 0);
}
static MACHINE_RESET( ms32 )
@@ -1472,7 +1472,7 @@ static DRIVER_INIT (bnstars)
decrypt_ms32_tx(machine, 0x00020,0x7e, "gfx7");
decrypt_ms32_bg(machine, 0x00001,0x9b, "gfx6");
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
}
GAME( 1997, bnstars1, 0, bnstars, bnstars, bnstars, ROT0, "Jaleco", "Vs. Janshi Brandnew Stars", GAME_NO_SOUND )
diff --git a/src/mame/drivers/bogeyman.c b/src/mame/drivers/bogeyman.c
index 6bbf08d429c..b5938c51f4d 100644
--- a/src/mame/drivers/bogeyman.c
+++ b/src/mame/drivers/bogeyman.c
@@ -24,24 +24,24 @@
static WRITE8_HANDLER( bogeyman_8910_latch_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
state->psg_latch = data;
}
static WRITE8_HANDLER( bogeyman_8910_control_w )
{
- bogeyman_state *state = space->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = space->machine().driver_data<bogeyman_state>();
// bit 0 is flipscreen
- flip_screen_set(space->machine, data & 0x01);
+ flip_screen_set(space->machine(), data & 0x01);
// bit 5 goes to 8910 #0 BDIR pin
if ((state->last_write & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(space->machine->device("ay1"), state->last_write >> 4, state->psg_latch);
+ ay8910_data_address_w(space->machine().device("ay1"), state->last_write >> 4, state->psg_latch);
// bit 7 goes to 8910 #1 BDIR pin
if ((state->last_write & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(space->machine->device("ay2"), state->last_write >> 6, state->psg_latch);
+ ay8910_data_address_w(space->machine().device("ay2"), state->last_write >> 6, state->psg_latch);
state->last_write = data;
}
@@ -207,7 +207,7 @@ GFXDECODE_END
static MACHINE_START( bogeyman )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
state->save_item(NAME(state->psg_latch));
state->save_item(NAME(state->last_write));
@@ -215,7 +215,7 @@ static MACHINE_START( bogeyman )
static MACHINE_RESET( bogeyman )
{
- bogeyman_state *state = machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = machine.driver_data<bogeyman_state>();
state->psg_latch = 0;
state->last_write = 0;
@@ -223,7 +223,7 @@ static MACHINE_RESET( bogeyman )
static WRITE8_DEVICE_HANDLER( bogeyman_colbank_w )
{
- bogeyman_state *state = device->machine->driver_data<bogeyman_state>();
+ bogeyman_state *state = device->machine().driver_data<bogeyman_state>();
if((data & 1) != (state->colbank & 1))
{
diff --git a/src/mame/drivers/bombjack.c b/src/mame/drivers/bombjack.c
index 29a6e7ddcc7..eb17472b19e 100644
--- a/src/mame/drivers/bombjack.c
+++ b/src/mame/drivers/bombjack.c
@@ -103,19 +103,19 @@ Dip Locations and factory settings verified with manual
static TIMER_CALLBACK( soundlatch_callback )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->latch = param;
}
static WRITE8_HANDLER( bombjack_soundlatch_w )
{
/* make all the CPUs synchronize, and only AFTER that write the new command to the latch */
- space->machine->scheduler().synchronize(FUNC(soundlatch_callback), data);
+ space->machine().scheduler().synchronize(FUNC(soundlatch_callback), data);
}
static READ8_HANDLER( bombjack_soundlatch_r )
{
- bombjack_state *state = space->machine->driver_data<bombjack_state>();
+ bombjack_state *state = space->machine().driver_data<bombjack_state>();
int res;
res = state->latch;
@@ -328,7 +328,7 @@ GFXDECODE_END
static MACHINE_START( bombjack )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->save_item(NAME(state->latch));
state->save_item(NAME(state->background_image));
@@ -337,7 +337,7 @@ static MACHINE_START( bombjack )
static MACHINE_RESET( bombjack )
{
- bombjack_state *state = machine->driver_data<bombjack_state>();
+ bombjack_state *state = machine.driver_data<bombjack_state>();
state->latch = 0;
state->background_image = 0;
diff --git a/src/mame/drivers/boogwing.c b/src/mame/drivers/boogwing.c
index 2f945cc722f..aebcb094a50 100644
--- a/src/mame/drivers/boogwing.c
+++ b/src/mame/drivers/boogwing.c
@@ -276,13 +276,13 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- boogwing_state *driver_state = device->machine->driver_data<boogwing_state>();
+ boogwing_state *driver_state = device->machine().driver_data<boogwing_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- boogwing_state *state = device->machine->driver_data<boogwing_state>();
+ boogwing_state *state = device->machine().driver_data<boogwing_state>();
state->oki2->set_bank_base(((data & 2) >> 1) * 0x40000);
state->oki1->set_bank_base((data & 1) * 0x40000);
}
@@ -564,8 +564,8 @@ ROM_END
static DRIVER_INIT( boogwing )
{
- const UINT8* src = machine->region("gfx6")->base();
- UINT8* dst = machine->region("tiles2")->base() + 0x200000;
+ const UINT8* src = machine.region("gfx6")->base();
+ UINT8* dst = machine.region("tiles2")->base() + 0x200000;
deco56_decrypt_gfx(machine, "tiles1");
deco56_decrypt_gfx(machine, "tiles2");
diff --git a/src/mame/drivers/bottom9.c b/src/mame/drivers/bottom9.c
index ff5f5b05961..c3eb2f25d43 100644
--- a/src/mame/drivers/bottom9.c
+++ b/src/mame/drivers/bottom9.c
@@ -23,7 +23,7 @@
static INTERRUPT_GEN( bottom9_interrupt )
{
- bottom9_state *state = device->machine->driver_data<bottom9_state>();
+ bottom9_state *state = device->machine().driver_data<bottom9_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, 0, HOLD_LINE);
@@ -31,7 +31,7 @@ static INTERRUPT_GEN( bottom9_interrupt )
static READ8_HANDLER( k052109_051960_r )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -48,7 +48,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -60,7 +60,7 @@ static WRITE8_HANDLER( k052109_051960_w )
static READ8_HANDLER( bottom9_bankedram1_r )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
return k052109_051960_r(space, offset);
@@ -75,7 +75,7 @@ static READ8_HANDLER( bottom9_bankedram1_r )
static WRITE8_HANDLER( bottom9_bankedram1_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
k052109_051960_w(space, offset, data);
@@ -85,17 +85,17 @@ static WRITE8_HANDLER( bottom9_bankedram1_w )
static READ8_HANDLER( bottom9_bankedram2_r )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
return k052109_051960_r(space, offset + 0x2000);
else
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
static WRITE8_HANDLER( bottom9_bankedram2_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
if (state->k052109_selected)
k052109_051960_w(space, offset + 0x2000, data);
@@ -117,16 +117,16 @@ static WRITE8_HANDLER( bankswitch_w )
else
bank = ((data & 0x0e) >> 1);
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
static WRITE8_HANDLER( bottom9_1f90_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x04) ? ASSERT_LINE : CLEAR_LINE);
@@ -143,26 +143,26 @@ static WRITE8_HANDLER( bottom9_1f90_w )
static WRITE8_HANDLER( bottom9_sh_irqtrigger_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static INTERRUPT_GEN( bottom9_sound_interrupt )
{
- bottom9_state *state = device->machine->driver_data<bottom9_state>();
+ bottom9_state *state = device->machine().driver_data<bottom9_state>();
if (state->nmienable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( nmi_enable_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
state->nmienable = data;
}
static WRITE8_HANDLER( sound_bank_w )
{
- bottom9_state *state = space->machine->driver_data<bottom9_state>();
+ bottom9_state *state = space->machine().driver_data<bottom9_state>();
int bank_A, bank_B;
bank_A = ((data >> 0) & 0x03);
@@ -332,18 +332,18 @@ static const k051316_interface bottom9_k051316_intf =
static MACHINE_START( bottom9 )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k051316 = machine->device("k051316");
- state->k007232_1 = machine->device("k007232_1");
- state->k007232_2 = machine->device("k007232_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k051316 = machine.device("k051316");
+ state->k007232_1 = machine.device("k007232_1");
+ state->k007232_2 = machine.device("k007232_2");
state->save_item(NAME(state->video_enable));
state->save_item(NAME(state->zoomreadroms));
@@ -353,7 +353,7 @@ static MACHINE_START( bottom9 )
static MACHINE_RESET( bottom9 )
{
- bottom9_state *state = machine->driver_data<bottom9_state>();
+ bottom9_state *state = machine.driver_data<bottom9_state>();
state->video_enable = 0;
state->zoomreadroms = 0;
diff --git a/src/mame/drivers/boxer.c b/src/mame/drivers/boxer.c
index 803bb6d2495..dbb80c530de 100644
--- a/src/mame/drivers/boxer.c
+++ b/src/mame/drivers/boxer.c
@@ -46,7 +46,7 @@ public:
static TIMER_CALLBACK( pot_interrupt )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
int mask = param;
if (state->pot_latch & mask)
@@ -58,7 +58,7 @@ static TIMER_CALLBACK( pot_interrupt )
static TIMER_CALLBACK( periodic_callback )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
int scanline = param;
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
@@ -80,7 +80,7 @@ static TIMER_CALLBACK( periodic_callback )
for (i = 1; i < 256; i++)
if (mask[i] != 0)
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(i), FUNC(pot_interrupt), mask[i]);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(i), FUNC(pot_interrupt), mask[i]);
state->pot_state = 0;
}
@@ -90,7 +90,7 @@ static TIMER_CALLBACK( periodic_callback )
if (scanline >= 262)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
}
@@ -109,14 +109,14 @@ static PALETTE_INIT( boxer )
palette_set_color(machine,3, MAKE_RGB(0x00,0x00,0x00));
}
-static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectangle* cliprect )
+static void draw_boxer( running_machine &machine, bitmap_t* bitmap, const rectangle* cliprect )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
int n;
for (n = 0; n < 2; n++)
{
- const UINT8* p = machine->region(n == 0 ? "user1" : "user2")->base();
+ const UINT8* p = machine.region(n == 0 ? "user1" : "user2")->base();
int i, j;
@@ -135,7 +135,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
code = p[32 * l + 4 * i + j];
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[n],
+ machine.gfx[n],
code,
0,
code & 0x80, 0,
@@ -145,7 +145,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
code = p[32 * r + 4 * i - j + 3];
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[n],
+ machine.gfx[n],
code,
0,
!(code & 0x80), 0,
@@ -159,7 +159,7 @@ static void draw_boxer( running_machine *machine, bitmap_t* bitmap, const rectan
static SCREEN_UPDATE( boxer )
{
- boxer_state *state = screen->machine->driver_data<boxer_state>();
+ boxer_state *state = screen->machine().driver_data<boxer_state>();
int i, j;
bitmap_fill(bitmap, cliprect, 1);
@@ -171,7 +171,7 @@ static SCREEN_UPDATE( boxer )
UINT8 code = state->tile_ram[32 * i + j];
drawgfx_transpen(bitmap, cliprect,
- screen->machine->gfx[2],
+ screen->machine().gfx[2],
code,
0,
code & 0x40, code & 0x40,
@@ -180,7 +180,7 @@ static SCREEN_UPDATE( boxer )
}
}
- draw_boxer(screen->machine, bitmap, cliprect);
+ draw_boxer(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -193,9 +193,9 @@ static SCREEN_UPDATE( boxer )
static READ8_HANDLER( boxer_input_r )
{
- UINT8 val = input_port_read(space->machine, "IN0");
+ UINT8 val = input_port_read(space->machine(), "IN0");
- if (input_port_read(space->machine, "IN3") < space->machine->primary_screen->vpos())
+ if (input_port_read(space->machine(), "IN3") < space->machine().primary_screen->vpos())
val |= 0x02;
return (val << ((offset & 7) ^ 7)) & 0x80;
@@ -204,7 +204,7 @@ static READ8_HANDLER( boxer_input_r )
static READ8_HANDLER( boxer_misc_r )
{
- boxer_state *state = space->machine->driver_data<boxer_state>();
+ boxer_state *state = space->machine().driver_data<boxer_state>();
UINT8 val = 0;
switch (offset & 3)
@@ -214,15 +214,15 @@ static READ8_HANDLER( boxer_misc_r )
break;
case 1:
- val = space->machine->primary_screen->vpos();
+ val = space->machine().primary_screen->vpos();
break;
case 2:
- val = input_port_read(space->machine, "IN1");
+ val = input_port_read(space->machine(), "IN1");
break;
case 3:
- val = input_port_read(space->machine, "IN2");
+ val = input_port_read(space->machine(), "IN2");
break;
}
@@ -244,7 +244,7 @@ static WRITE8_HANDLER( boxer_sound_w )
static WRITE8_HANDLER( boxer_pot_w )
{
- boxer_state *state = space->machine->driver_data<boxer_state>();
+ boxer_state *state = space->machine().driver_data<boxer_state>();
/* BIT0 => HPOT1 */
/* BIT1 => VPOT1 */
/* BIT2 => RPOT1 */
@@ -260,7 +260,7 @@ static WRITE8_HANDLER( boxer_pot_w )
static WRITE8_HANDLER( boxer_irq_reset_w )
{
- boxer_state *state = space->machine->driver_data<boxer_state>();
+ boxer_state *state = space->machine().driver_data<boxer_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@@ -272,14 +272,14 @@ static WRITE8_HANDLER( boxer_crowd_w )
/* BIT2 => CROWD-2 */
/* BIT3 => CROWD-3 */
- coin_lockout_global_w(space->machine, data & 1);
+ coin_lockout_global_w(space->machine(), data & 1);
}
static WRITE8_HANDLER( boxer_led_w )
{
- set_led_status(space->machine, 1, !(data & 1));
- set_led_status(space->machine, 0, !(data & 2));
+ set_led_status(space->machine(), 1, !(data & 1));
+ set_led_status(space->machine(), 0, !(data & 2));
}
@@ -417,9 +417,9 @@ GFXDECODE_END
static MACHINE_START( boxer )
{
- boxer_state *state = machine->driver_data<boxer_state>();
+ boxer_state *state = machine.driver_data<boxer_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->pot_state));
state->save_item(NAME(state->pot_latch));
@@ -427,8 +427,8 @@ static MACHINE_START( boxer )
static MACHINE_RESET( boxer )
{
- boxer_state *state = machine->driver_data<boxer_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(periodic_callback));
+ boxer_state *state = machine.driver_data<boxer_state>();
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(periodic_callback));
state->pot_state = 0;
state->pot_latch = 0;
diff --git a/src/mame/drivers/brkthru.c b/src/mame/drivers/brkthru.c
index 02d8f2c7d81..fdbd13d57bd 100644
--- a/src/mame/drivers/brkthru.c
+++ b/src/mame/drivers/brkthru.c
@@ -67,7 +67,7 @@
static WRITE8_HANDLER( brkthru_1803_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
/* bit 0 = NMI enable */
cpu_interrupt_enable(state->maincpu, ~data & 1);
@@ -75,7 +75,7 @@ static WRITE8_HANDLER( brkthru_1803_w )
}
static WRITE8_HANDLER( darwin_0803_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
/* bit 0 = NMI enable */
/*cpu_interrupt_enable(state->audiocpu, ~data & 1);*/
logerror("0803 %02X\n",data);
@@ -85,14 +85,14 @@ static WRITE8_HANDLER( darwin_0803_w )
static WRITE8_HANDLER( brkthru_soundlatch_w )
{
- brkthru_state *state = space->machine->driver_data<brkthru_state>();
+ brkthru_state *state = space->machine().driver_data<brkthru_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static INPUT_CHANGED( coin_inserted )
{
- brkthru_state *state = field->port->machine->driver_data<brkthru_state>();
+ brkthru_state *state = field->port->machine().driver_data<brkthru_state>();
/* coin insertion causes an IRQ */
device_set_input_line(state->maincpu, 0, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -346,7 +346,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int linestate )
{
- brkthru_state *state = device->machine->driver_data<brkthru_state>();
+ brkthru_state *state = device->machine().driver_data<brkthru_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, linestate);
}
@@ -365,10 +365,10 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( brkthru )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->bgscroll));
state->save_item(NAME(state->bgbasecolor));
@@ -377,7 +377,7 @@ static MACHINE_START( brkthru )
static MACHINE_RESET( brkthru )
{
- brkthru_state *state = machine->driver_data<brkthru_state>();
+ brkthru_state *state = machine.driver_data<brkthru_state>();
state->bgscroll = 0;
state->bgbasecolor = 0;
@@ -654,7 +654,7 @@ ROM_END
static DRIVER_INIT( brkthru )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
}
diff --git a/src/mame/drivers/bsktball.c b/src/mame/drivers/bsktball.c
index 028aa31f01e..6f5f13bff43 100644
--- a/src/mame/drivers/bsktball.c
+++ b/src/mame/drivers/bsktball.c
@@ -40,29 +40,29 @@ static PALETTE_INIT( bsktball )
{
int i;
- machine->colortable = colortable_alloc(machine, 4);
+ machine.colortable = colortable_alloc(machine, 4);
- colortable_palette_set_color(machine->colortable,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
- colortable_palette_set_color(machine->colortable,1,MAKE_RGB(0x80,0x80,0x80)); /* LIGHT GREY */
- colortable_palette_set_color(machine->colortable,2,MAKE_RGB(0x50,0x50,0x50)); /* DARK GREY */
- colortable_palette_set_color(machine->colortable,3,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
+ colortable_palette_set_color(machine.colortable,0,MAKE_RGB(0x00,0x00,0x00)); /* BLACK */
+ colortable_palette_set_color(machine.colortable,1,MAKE_RGB(0x80,0x80,0x80)); /* LIGHT GREY */
+ colortable_palette_set_color(machine.colortable,2,MAKE_RGB(0x50,0x50,0x50)); /* DARK GREY */
+ colortable_palette_set_color(machine.colortable,3,MAKE_RGB(0xff,0xff,0xff)); /* WHITE */
/* playfield */
for (i = 0; i < 2; i++)
{
- colortable_entry_set_value(machine->colortable, i*4 + 0, 1);
- colortable_entry_set_value(machine->colortable, i*4 + 1, 3 * i);
- colortable_entry_set_value(machine->colortable, i*4 + 2, 3 * i);
- colortable_entry_set_value(machine->colortable, i*4 + 3, 3 * i);
+ colortable_entry_set_value(machine.colortable, i*4 + 0, 1);
+ colortable_entry_set_value(machine.colortable, i*4 + 1, 3 * i);
+ colortable_entry_set_value(machine.colortable, i*4 + 2, 3 * i);
+ colortable_entry_set_value(machine.colortable, i*4 + 3, 3 * i);
}
/* motion */
for (i = 0; i < 4*4*4; i++)
{
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 0, 1);
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 1, (i >> 2) & 3);
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 2, (i >> 0) & 3);
- colortable_entry_set_value(machine->colortable, 2*4 + i*4 + 3, (i >> 4) & 3);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 0, 1);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 1, (i >> 2) & 3);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 2, (i >> 0) & 3);
+ colortable_entry_set_value(machine.colortable, 2*4 + i*4 + 3, (i >> 4) & 3);
}
}
@@ -212,7 +212,7 @@ GFXDECODE_END
static MACHINE_START( bsktball )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
state->save_item(NAME(state->nmi_on));
state->save_item(NAME(state->i256v));
@@ -230,7 +230,7 @@ static MACHINE_START( bsktball )
static MACHINE_RESET( bsktball )
{
- bsktball_state *state = machine->driver_data<bsktball_state>();
+ bsktball_state *state = machine.driver_data<bsktball_state>();
state->nmi_on = 0;
state->i256v = 0;
diff --git a/src/mame/drivers/btime.c b/src/mame/drivers/btime.c
index f5d74c05f75..cc34b03b65d 100644
--- a/src/mame/drivers/btime.c
+++ b/src/mame/drivers/btime.c
@@ -166,7 +166,7 @@ static UINT8 *decrypted;
static WRITE8_HANDLER( audio_nmi_enable_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
/* for most games, this serves as the NMI enable for the audio CPU; however,
lnc and disco use bit 0 of the first AY-8910's port A instead; many other
@@ -180,7 +180,7 @@ static WRITE8_HANDLER( audio_nmi_enable_w )
static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w )
{
- btime_state *state = device->machine->driver_data<btime_state>();
+ btime_state *state = device->machine().driver_data<btime_state>();
/* port A bit 0, when 1, inhibits the NMI */
if (state->audio_nmi_enable_type == AUDIO_ENABLE_AY8910)
@@ -192,7 +192,7 @@ static WRITE8_DEVICE_HANDLER( ay_audio_nmi_enable_w )
static TIMER_DEVICE_CALLBACK( audio_nmi_gen )
{
- btime_state *state = timer.machine->driver_data<btime_state>();
+ btime_state *state = timer.machine().driver_data<btime_state>();
int scanline = param;
state->audio_nmi_state = scanline & 8;
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, (state->audio_nmi_enabled && state->audio_nmi_state) ? ASSERT_LINE : CLEAR_LINE);
@@ -208,7 +208,7 @@ INLINE UINT8 swap_bits_5_6(UINT8 data)
static void btime_decrypt( address_space *space )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
UINT8 *src, *src1;
int addr, addr1;
@@ -224,12 +224,12 @@ static void btime_decrypt( address_space *space )
/* however if the previous instruction was JSR (which caused a write to */
/* the stack), fetch the address of the next instruction. */
addr1 = cpu_get_previouspc(space->cpu);
- src1 = (addr1 < 0x9000) ? state->rambase : space->machine->region("maincpu")->base();
+ src1 = (addr1 < 0x9000) ? state->rambase : space->machine().region("maincpu")->base();
if (decrypted[addr1] == 0x20) /* JSR $xxxx */
addr = src1[addr1 + 1] + 256 * src1[addr1 + 2];
/* If the address of the next instruction is xxxx xxx1 xxxx x1xx, decode it. */
- src = (addr < 0x9000) ? state->rambase : space->machine->region("maincpu")->base();
+ src = (addr < 0x9000) ? state->rambase : space->machine().region("maincpu")->base();
if ((addr & 0x0104) == 0x0104)
{
/* 76543210 -> 65342710 bit rotation */
@@ -239,7 +239,7 @@ static void btime_decrypt( address_space *space )
static WRITE8_HANDLER( lnc_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x3bff) ;
else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
@@ -260,7 +260,7 @@ static WRITE8_HANDLER( lnc_w )
static WRITE8_HANDLER( mmonkey_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x3bff) ;
else if (offset >= 0x3c00 && offset <= 0x3fff) { lnc_videoram_w(space, offset - 0x3c00, data); return; }
@@ -280,7 +280,7 @@ static WRITE8_HANDLER( mmonkey_w )
static WRITE8_HANDLER( btime_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
@@ -299,7 +299,7 @@ static WRITE8_HANDLER( btime_w )
static WRITE8_HANDLER( tisland_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x0c00 && offset <= 0x0c0f) btime_paletteram_w(space, offset - 0x0c00, data);
@@ -320,7 +320,7 @@ static WRITE8_HANDLER( tisland_w )
static WRITE8_HANDLER( zoar_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x07ff) ;
else if (offset >= 0x8000 && offset <= 0x87ff) ;
@@ -340,7 +340,7 @@ static WRITE8_HANDLER( zoar_w )
static WRITE8_HANDLER( disco_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
if (offset <= 0x04ff) ;
else if (offset >= 0x2000 && offset <= 0x7fff) deco_charram_w(space, offset - 0x2000, data);
@@ -525,7 +525,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted_irq_hi )
{
- btime_state *state = field->port->machine->driver_data<btime_state>();
+ btime_state *state = field->port->machine().driver_data<btime_state>();
if (newval)
device_set_input_line(state->maincpu, 0, HOLD_LINE);
@@ -533,7 +533,7 @@ static INPUT_CHANGED( coin_inserted_irq_hi )
static INPUT_CHANGED( coin_inserted_irq_lo )
{
- btime_state *state = field->port->machine->driver_data<btime_state>();
+ btime_state *state = field->port->machine().driver_data<btime_state>();
if (!newval)
device_set_input_line(state->maincpu, 0, HOLD_LINE);
@@ -541,28 +541,28 @@ static INPUT_CHANGED( coin_inserted_irq_lo )
static INPUT_CHANGED( coin_inserted_nmi_lo )
{
- btime_state *state = field->port->machine->driver_data<btime_state>();
+ btime_state *state = field->port->machine().driver_data<btime_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_HANDLER( audio_command_w )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
}
static READ8_HANDLER( audio_command_r )
{
- btime_state *state = space->machine->driver_data<btime_state>();
+ btime_state *state = space->machine().driver_data<btime_state>();
device_set_input_line(state->audiocpu, 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
static READ8_HANDLER( zoar_dsw1_read )
{
- return (!space->machine->primary_screen->vblank() << 7) | (input_port_read(space->machine, "DSW1") & 0x7f);
+ return (!space->machine().primary_screen->vblank() << 7) | (input_port_read(space->machine(), "DSW1") & 0x7f);
}
static INPUT_PORTS_START( btime )
@@ -1425,10 +1425,10 @@ DISCRETE_SOUND_END
static MACHINE_START( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->btime_palette));
state->save_item(NAME(state->bnj_scroll1));
@@ -1440,7 +1440,7 @@ static MACHINE_START( btime )
static MACHINE_START( mmonkey )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
MACHINE_START_CALL(btime);
@@ -1452,7 +1452,7 @@ static MACHINE_START( mmonkey )
static MACHINE_RESET( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
/* by default, the audio NMI is disabled, except for bootlegs which don't use the enable */
state->audio_nmi_enabled = (state->audio_nmi_enable_type == AUDIO_ENABLE_NONE);
@@ -1469,7 +1469,7 @@ static MACHINE_RESET( btime )
static MACHINE_RESET( lnc )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
*state->lnc_charbank = 1;
MACHINE_RESET_CALL(btime);
@@ -1477,7 +1477,7 @@ static MACHINE_RESET( lnc )
static MACHINE_RESET( mmonkey )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
MACHINE_RESET_CALL(lnc);
@@ -2069,11 +2069,11 @@ ROM_START( sdtennis )
ROM_LOAD( "ao_04.10f", 0x1000, 0x1000, CRC(921952af) SHA1(4e9248f3493a5f4651278f27c11f507571242317) )
ROM_END
-static void decrypt_C10707_cpu(running_machine *machine, const char *cputag)
+static void decrypt_C10707_cpu(running_machine &machine, const char *cputag)
{
- address_space *space = machine->device(cputag)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cputag)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine->region(cputag)->base();
+ UINT8 *rom = machine.region(cputag)->base();
offs_t addr;
space->set_decrypted_region(0x0000, 0xffff, decrypt);
@@ -2082,13 +2082,13 @@ static void decrypt_C10707_cpu(running_machine *machine, const char *cputag)
for (addr = 0; addr < 0x10000; addr++)
decrypt[addr] = swap_bits_5_6(rom[addr]);
- if (space->cpu == machine->device("maincpu"))
+ if (space->cpu == machine.device("maincpu"))
decrypted = decrypt;
}
static READ8_HANDLER( wtennis_reset_hack_r )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
/* Otherwise the game goes into test mode and there is no way out that I
can see. I'm not sure how it can work, it probably somehow has to do
@@ -2099,10 +2099,10 @@ static READ8_HANDLER( wtennis_reset_hack_r )
return RAM[0xc15f];
}
-static void init_rom1(running_machine *machine)
+static void init_rom1(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -2115,15 +2115,15 @@ static void init_rom1(running_machine *machine)
static DRIVER_INIT( btime )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
init_rom1(machine);
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( zoar )
{
- btime_state *state = machine->driver_data<btime_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ btime_state *state = machine.driver_data<btime_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
/* At location 0xD50A is what looks like an undocumented opcode. I tried
implementing it given what opcode 0x23 should do, but it still didn't
@@ -2137,8 +2137,8 @@ static DRIVER_INIT( zoar )
static DRIVER_INIT( tisland )
{
- btime_state *state = machine->driver_data<btime_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ btime_state *state = machine.driver_data<btime_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
/* At location 0xa2b6 there's a strange RLA followed by a BPL that reads from an
unmapped area that causes the game to fail in several circumstances.On the Cassette
@@ -2152,57 +2152,57 @@ static DRIVER_INIT( tisland )
static DRIVER_INIT( lnc )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( bnj )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( disco )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
DRIVER_INIT_CALL(btime);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( cookrace )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
- memory_set_bankptr(machine, "bank10", machine->region("audiocpu")->base() + 0xe200);
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
+ memory_set_bankptr(machine, "bank10", machine.region("audiocpu")->base() + 0xe200);
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
}
static DRIVER_INIT( protennb )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
DRIVER_INIT_CALL(btime);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( wtennis )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc15f, 0xc15f, FUNC(wtennis_reset_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc15f, 0xc15f, FUNC(wtennis_reset_hack_r));
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
- memory_set_bankptr(machine, "bank10", machine->region("audiocpu")->base() + 0xe200);
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0200, 0x0fff, "bank10");
+ memory_set_bankptr(machine, "bank10", machine.region("audiocpu")->base() + 0xe200);
state->audio_nmi_enable_type = AUDIO_ENABLE_AY8910;
}
static DRIVER_INIT( sdtennis )
{
- btime_state *state = machine->driver_data<btime_state>();
+ btime_state *state = machine.driver_data<btime_state>();
decrypt_C10707_cpu(machine, "maincpu");
decrypt_C10707_cpu(machine, "audiocpu");
state->audio_nmi_enable_type = AUDIO_ENABLE_DIRECT;
diff --git a/src/mame/drivers/btoads.c b/src/mame/drivers/btoads.c
index 4dc65524735..865ef658741 100644
--- a/src/mame/drivers/btoads.c
+++ b/src/mame/drivers/btoads.c
@@ -29,7 +29,7 @@
static MACHINE_START( btoads )
{
- btoads_state *state = machine->driver_data<btoads_state>();
+ btoads_state *state = machine.driver_data<btoads_state>();
state_save_register_global(machine, state->main_to_sound_data);
state_save_register_global(machine, state->main_to_sound_ready);
state_save_register_global(machine, state->sound_to_main_data);
@@ -47,26 +47,26 @@ static MACHINE_START( btoads )
static TIMER_CALLBACK( delayed_sound_w )
{
- btoads_state *state = machine->driver_data<btoads_state>();
+ btoads_state *state = machine.driver_data<btoads_state>();
state->main_to_sound_data = param;
state->main_to_sound_ready = 1;
- device_triggerint(machine->device("audiocpu"));
+ device_triggerint(machine.device("audiocpu"));
/* use a timer to make long transfers faster */
- machine->scheduler().timer_set(attotime::from_usec(50), FUNC(NULL));
+ machine.scheduler().timer_set(attotime::from_usec(50), FUNC(NULL));
}
static WRITE16_HANDLER( main_sound_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
static READ16_HANDLER( main_sound_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
state->sound_to_main_ready = 0;
return state->sound_to_main_data;
}
@@ -74,14 +74,14 @@ static READ16_HANDLER( main_sound_r )
static CUSTOM_INPUT( main_to_sound_r )
{
- btoads_state *state = field->port->machine->driver_data<btoads_state>();
+ btoads_state *state = field->port->machine().driver_data<btoads_state>();
return state->main_to_sound_ready;
}
static CUSTOM_INPUT( sound_to_main_r )
{
- btoads_state *state = field->port->machine->driver_data<btoads_state>();
+ btoads_state *state = field->port->machine().driver_data<btoads_state>();
return state->sound_to_main_ready;
}
@@ -94,7 +94,7 @@ static CUSTOM_INPUT( sound_to_main_r )
static WRITE8_HANDLER( sound_data_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
state->sound_to_main_data = data;
state->sound_to_main_ready = 1;
}
@@ -102,7 +102,7 @@ static WRITE8_HANDLER( sound_data_w )
static READ8_HANDLER( sound_data_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
state->main_to_sound_ready = 0;
return state->main_to_sound_data;
}
@@ -110,14 +110,14 @@ static READ8_HANDLER( sound_data_r )
static READ8_HANDLER( sound_ready_to_send_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
return state->sound_to_main_ready ? 0x00 : 0x80;
}
static READ8_HANDLER( sound_data_ready_r )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
if (cpu_get_pc(space->cpu) == 0xd50 && !state->main_to_sound_ready)
device_spin_until_interrupt(space->cpu);
return state->main_to_sound_ready ? 0x00 : 0x80;
@@ -133,13 +133,13 @@ static READ8_HANDLER( sound_data_ready_r )
static WRITE8_HANDLER( sound_int_state_w )
{
- btoads_state *state = space->machine->driver_data<btoads_state>();
+ btoads_state *state = space->machine().driver_data<btoads_state>();
/* top bit controls BSMT2000 reset */
if (!(state->sound_int_state & 0x80) && (data & 0x80))
- devtag_reset(space->machine, "bsmt");
+ devtag_reset(space->machine(), "bsmt");
/* also clears interrupts */
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
state->sound_int_state = data;
}
@@ -153,14 +153,14 @@ static WRITE8_HANDLER( sound_int_state_w )
static READ8_HANDLER( bsmt_ready_r )
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
static WRITE8_HANDLER( bsmt2000_port_w )
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
bsmt->write_reg(offset >> 8);
bsmt->write_data(((offset & 0xff) << 8) | data);
}
diff --git a/src/mame/drivers/bublbobl.c b/src/mame/drivers/bublbobl.c
index d675f681de0..110cad563ab 100644
--- a/src/mame/drivers/bublbobl.c
+++ b/src/mame/drivers/bublbobl.c
@@ -699,7 +699,7 @@ GFXDECODE_END
// handler called by the 2203 emulator when the internal timers cause an IRQ
static void irqhandler(device_t *device, int irq)
{
- bublbobl_state *state = device->machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = device->machine().driver_data<bublbobl_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -723,12 +723,12 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( common )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
- state->maincpu = machine->device("maincpu");
- state->mcu = machine->device("mcu");
- state->audiocpu = machine->device("audiocpu");
- state->slave = machine->device("slave");
+ state->maincpu = machine.device("maincpu");
+ state->mcu = machine.device("mcu");
+ state->audiocpu = machine.device("audiocpu");
+ state->slave = machine.device("slave");
state->save_item(NAME(state->sound_nmi_enable));
state->save_item(NAME(state->pending_nmi));
@@ -738,7 +738,7 @@ static MACHINE_START( common )
static MACHINE_RESET( common )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
state->sound_nmi_enable = 0;
state->pending_nmi = 0;
@@ -748,7 +748,7 @@ static MACHINE_RESET( common )
static MACHINE_START( tokio )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -757,7 +757,7 @@ static MACHINE_START( tokio )
static MACHINE_RESET( tokio )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -806,7 +806,7 @@ MACHINE_CONFIG_END
static MACHINE_START( bublbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -826,7 +826,7 @@ static MACHINE_START( bublbobl )
static MACHINE_RESET( bublbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -890,7 +890,7 @@ MACHINE_CONFIG_END
static MACHINE_START( boblbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -900,7 +900,7 @@ static MACHINE_START( boblbobl )
static MACHINE_RESET( boblbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -923,7 +923,7 @@ MACHINE_CONFIG_END
static MACHINE_START( bub68705 )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_START_CALL(common);
@@ -939,7 +939,7 @@ static MACHINE_START( bub68705 )
static MACHINE_RESET( bub68705 )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
MACHINE_RESET_CALL(common);
@@ -1525,15 +1525,15 @@ ROM_END
*
*************************************/
-static void configure_banks( running_machine* machine )
+static void configure_banks( running_machine& machine )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
}
static DRIVER_INIT( bublbobl )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
configure_banks(machine);
@@ -1543,7 +1543,7 @@ static DRIVER_INIT( bublbobl )
static DRIVER_INIT( tokio )
{
- bublbobl_state *state = machine->driver_data<bublbobl_state>();
+ bublbobl_state *state = machine.driver_data<bublbobl_state>();
configure_banks(machine);
/* preemptively enable video, the bit is not mapped for this game and */
@@ -1555,14 +1555,14 @@ static DRIVER_INIT( tokiob )
{
DRIVER_INIT_CALL(tokio);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe00, 0xfe00, FUNC(tokiob_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe00, 0xfe00, FUNC(tokiob_mcu_r) );
}
static DRIVER_INIT( dland )
{
// rearrange gfx to original format
int i;
- UINT8* src = machine->region("gfx1")->base();
+ UINT8* src = machine.region("gfx1")->base();
for (i = 0; i < 0x40000; i++)
src[i] = BITSWAP8(src[i],7,6,5,4,0,1,2,3);
diff --git a/src/mame/drivers/buggychl.c b/src/mame/drivers/buggychl.c
index bda227bba3b..2f0bd683f2d 100644
--- a/src/mame/drivers/buggychl.c
+++ b/src/mame/drivers/buggychl.c
@@ -89,12 +89,12 @@ Dip locations and factory settings verified from dip listing
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07); // shall we check if data&7 < # banks?
+ memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check if data&7 < # banks?
}
static TIMER_CALLBACK( nmi_callback )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -105,18 +105,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- buggychl_state *state = space->machine->driver_data<buggychl_state>();
+ buggychl_state *state = space->machine().driver_data<buggychl_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -127,7 +127,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static WRITE8_HANDLER( sound_enable_w )
{
- space->machine->sound().system_enable(data & 1);
+ space->machine().sound().system_enable(data & 1);
}
@@ -361,12 +361,12 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( buggychl )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sound_nmi_enable));
state->save_item(NAME(state->pending_nmi));
@@ -380,7 +380,7 @@ static MACHINE_START( buggychl )
static MACHINE_RESET( buggychl )
{
- buggychl_state *state = machine->driver_data<buggychl_state>();
+ buggychl_state *state = machine.driver_data<buggychl_state>();
cputag_set_input_line(machine, "mcu", 0, CLEAR_LINE);
diff --git a/src/mame/drivers/buster.c b/src/mame/drivers/buster.c
index 3e6f15a78ba..5a68893c9c8 100644
--- a/src/mame/drivers/buster.c
+++ b/src/mame/drivers/buster.c
@@ -28,8 +28,8 @@ static VIDEO_START(buster)
static SCREEN_UPDATE(buster)
{
- buster_state *state = screen->machine->driver_data<buster_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ buster_state *state = screen->machine().driver_data<buster_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x0000;
int y,x;
@@ -122,8 +122,8 @@ ROM_END
static DRIVER_INIT( buster )
{
- buster_state *state = machine->driver_data<buster_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ buster_state *state = machine.driver_data<buster_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
// vram = auto_alloc_array(machine, UINT8, 0x2000);
memcpy(state->rom, ROM, 0x4000);
}
diff --git a/src/mame/drivers/bwidow.c b/src/mame/drivers/bwidow.c
index d86dcd15c04..e672a6155a9 100644
--- a/src/mame/drivers/bwidow.c
+++ b/src/mame/drivers/bwidow.c
@@ -270,9 +270,9 @@ static READ8_HANDLER( spacduel_IN3_r )
int res2;
int res3;
- res1 = input_port_read(space->machine, "IN3");
- res2 = input_port_read(space->machine, "IN4");
- res3 = input_port_read_safe(space->machine, "DSW2", 0);
+ res1 = input_port_read(space->machine(), "IN3");
+ res2 = input_port_read(space->machine(), "IN4");
+ res3 = input_port_read_safe(space->machine(), "DSW2", 0);
res = 0x00;
switch (offset & 0x07)
@@ -316,7 +316,7 @@ static READ8_HANDLER( spacduel_IN3_r )
static CUSTOM_INPUT( clock_r )
{
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
@@ -328,7 +328,7 @@ static CUSTOM_INPUT( clock_r )
static WRITE8_HANDLER( bwidow_misc_w )
{
- bwidow_state *state = space->machine->driver_data<bwidow_state>();
+ bwidow_state *state = space->machine().driver_data<bwidow_state>();
/*
0x10 = p1 led
0x20 = p2 led
@@ -337,10 +337,10 @@ static WRITE8_HANDLER( bwidow_misc_w )
*/
if (data == state->lastdata) return;
- set_led_status(space->machine, 0,~data & 0x10);
- set_led_status(space->machine, 1,~data & 0x20);
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ set_led_status(space->machine(), 0,~data & 0x10);
+ set_led_status(space->machine(), 1,~data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
state->lastdata = data;
}
@@ -352,7 +352,7 @@ static WRITE8_HANDLER( bwidow_misc_w )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
diff --git a/src/mame/drivers/bwing.c b/src/mame/drivers/bwing.c
index 8a6b8474862..9db568d352d 100644
--- a/src/mame/drivers/bwing.c
+++ b/src/mame/drivers/bwing.c
@@ -36,7 +36,7 @@ Known issues:
static INTERRUPT_GEN ( bwp1_interrupt )
{
- bwing_state *state = device->machine->driver_data<bwing_state>();
+ bwing_state *state = device->machine().driver_data<bwing_state>();
UINT8 latch_data;
switch (cpu_getiloops(device))
@@ -53,7 +53,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
break;
case 1:
- if (~input_port_read(device->machine, "IN2") & 0x03)
+ if (~input_port_read(device->machine(), "IN2") & 0x03)
{
if (!state->coin)
{
@@ -66,7 +66,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
break;
case 2:
- if (input_port_read(device->machine, "IN3"))
+ if (input_port_read(device->machine(), "IN3"))
device_set_input_line(device, M6809_FIRQ_LINE, ASSERT_LINE);
break;
}
@@ -75,7 +75,7 @@ static INTERRUPT_GEN ( bwp1_interrupt )
static INTERRUPT_GEN ( bwp3_interrupt )
{
- bwing_state *state = device->machine->driver_data<bwing_state>();
+ bwing_state *state = device->machine().driver_data<bwing_state>();
if (!state->bwp3_nmimask)
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
@@ -86,38 +86,38 @@ static INTERRUPT_GEN ( bwp3_interrupt )
static WRITE8_HANDLER( bwp12_sharedram1_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->bwp1_sharedram1[offset] = state->bwp2_sharedram1[offset] = data;
}
static WRITE8_HANDLER( bwp3_u8F_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->bwp3_u8F_d = data; // prepares custom chip for various operations
}
static WRITE8_HANDLER( bwp3_nmimask_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
state->bwp3_nmimask = data & 0x80;
}
static WRITE8_HANDLER( bwp3_nmiack_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
}
static READ8_HANDLER( bwp1_io_r )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
- if (offset == 0) return(input_port_read(space->machine, "DSW0"));
- if (offset == 1) return(input_port_read(space->machine, "DSW1"));
- if (offset == 2) return(input_port_read(space->machine, "IN0"));
- if (offset == 3) return(input_port_read(space->machine, "IN1"));
- if (offset == 4) return(input_port_read(space->machine, "IN2"));
+ if (offset == 0) return(input_port_read(space->machine(), "DSW0"));
+ if (offset == 1) return(input_port_read(space->machine(), "DSW1"));
+ if (offset == 2) return(input_port_read(space->machine(), "IN0"));
+ if (offset == 3) return(input_port_read(space->machine(), "IN1"));
+ if (offset == 4) return(input_port_read(space->machine(), "IN2"));
return((state->bwp123_membase[0])[0x1b00 + offset]);
}
@@ -125,7 +125,7 @@ static READ8_HANDLER( bwp1_io_r )
static WRITE8_HANDLER( bwp1_ctrl_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
switch (offset)
{
@@ -171,7 +171,7 @@ static WRITE8_HANDLER( bwp1_ctrl_w )
static WRITE8_HANDLER( bwp2_ctrl_w )
{
- bwing_state *state = space->machine->driver_data<bwing_state>();
+ bwing_state *state = space->machine().driver_data<bwing_state>();
switch (offset)
{
case 0: device_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE); break; // SMSTB
@@ -374,11 +374,11 @@ GFXDECODE_END
static MACHINE_START( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->coin));
state->save_item(NAME(state->palatch));
@@ -397,7 +397,7 @@ static MACHINE_START( bwing )
static MACHINE_RESET( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
int i;
state->coin = 0;
@@ -624,9 +624,9 @@ ROM_END
//****************************************************************************
// Initializations
-static void fix_bwp3( running_machine *machine )
+static void fix_bwp3( running_machine &machine )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
UINT8 *rom = state->bwp3_rombase;
int i, j = state->bwp3_romsize;
UINT8 ah, al;
@@ -642,11 +642,11 @@ static void fix_bwp3( running_machine *machine )
static DRIVER_INIT( bwing )
{
- bwing_state *state = machine->driver_data<bwing_state>();
+ bwing_state *state = machine.driver_data<bwing_state>();
- state->bwp123_membase[0] = machine->region("maincpu")->base();
- state->bwp123_membase[1] = machine->region("sub")->base();
- state->bwp123_membase[2] = machine->region("audiocpu")->base();
+ state->bwp123_membase[0] = machine.region("maincpu")->base();
+ state->bwp123_membase[1] = machine.region("sub")->base();
+ state->bwp123_membase[2] = machine.region("audiocpu")->base();
fix_bwp3(machine);
}
diff --git a/src/mame/drivers/bzone.c b/src/mame/drivers/bzone.c
index 4737ecaac13..5fdc9959808 100644
--- a/src/mame/drivers/bzone.c
+++ b/src/mame/drivers/bzone.c
@@ -222,14 +222,14 @@
static MACHINE_START( bzone )
{
- bzone_state *state = machine->driver_data<bzone_state>();
+ bzone_state *state = machine.driver_data<bzone_state>();
state_save_register_global(machine, state->analog_data);
}
static MACHINE_START( redbaron )
{
- bzone_state *state = machine->driver_data<bzone_state>();
+ bzone_state *state = machine.driver_data<bzone_state>();
state_save_register_global(machine, state->analog_data);
state_save_register_global(machine, state->rb_input_select);
}
@@ -244,7 +244,7 @@ static MACHINE_START( redbaron )
static INTERRUPT_GEN( bzone_interrupt )
{
- if (input_port_read(device->machine, "IN0") & 0x10)
+ if (input_port_read(device->machine(), "IN0") & 0x10)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -258,13 +258,13 @@ static INTERRUPT_GEN( bzone_interrupt )
static CUSTOM_INPUT( clock_r )
{
- return (field->port->machine->device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
+ return (field->port->machine().device<cpu_device>("maincpu")->total_cycles() & 0x100) ? 1 : 0;
}
static WRITE8_HANDLER( bzone_coin_counter_w )
{
- coin_counter_w(space->machine, offset,data);
+ coin_counter_w(space->machine(), offset,data);
}
@@ -277,13 +277,13 @@ static WRITE8_HANDLER( bzone_coin_counter_w )
static READ8_DEVICE_HANDLER( redbaron_joy_r )
{
- bzone_state *state = device->machine->driver_data<bzone_state>();
- return input_port_read(device->machine, state->rb_input_select ? "FAKE1" : "FAKE2");
+ bzone_state *state = device->machine().driver_data<bzone_state>();
+ return input_port_read(device->machine(), state->rb_input_select ? "FAKE1" : "FAKE2");
}
static WRITE8_DEVICE_HANDLER( redbaron_joysound_w )
{
- bzone_state *state = device->machine->driver_data<bzone_state>();
+ bzone_state *state = device->machine().driver_data<bzone_state>();
state->rb_input_select = data & 1;
redbaron_sounds_w(device, offset, data);
}
@@ -780,24 +780,24 @@ ROM_END
static READ8_HANDLER( analog_data_r )
{
- bzone_state *state = space->machine->driver_data<bzone_state>();
+ bzone_state *state = space->machine().driver_data<bzone_state>();
return state->analog_data;
}
static WRITE8_HANDLER( analog_select_w )
{
- bzone_state *state = space->machine->driver_data<bzone_state>();
+ bzone_state *state = space->machine().driver_data<bzone_state>();
static const char *const analog_port[] = { "AN0", "AN1", "AN2" };
if (offset <= 2)
- state->analog_data = input_port_read(space->machine, analog_port[offset]);
+ state->analog_data = input_port_read(space->machine(), analog_port[offset]);
}
static DRIVER_INIT( bradley )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->install_ram(0x400, 0x7ff);
space->install_read_port(0x1808, 0x1808, "1808");
space->install_read_port(0x1809, 0x1809, "1809");
diff --git a/src/mame/drivers/cabal.c b/src/mame/drivers/cabal.c
index 68868a069a1..77686440b79 100644
--- a/src/mame/drivers/cabal.c
+++ b/src/mame/drivers/cabal.c
@@ -54,7 +54,7 @@ Dip locations verified with Fabtek manual for the trackball version
static MACHINE_RESET( cabalbl )
{
- cabal_state *state = machine->driver_data<cabal_state>();
+ cabal_state *state = machine.driver_data<cabal_state>();
state->sound_command1 = state->sound_command2 = 0xff;
}
@@ -63,7 +63,7 @@ static MACHINE_RESET( cabalbl )
static WRITE16_HANDLER( cabalbl_sndcmd_w )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
switch (offset)
{
@@ -81,25 +81,25 @@ static WRITE16_HANDLER( cabalbl_sndcmd_w )
static WRITE16_HANDLER( track_reset_w )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
int i;
static const char *const track_names[] = { "IN0", "IN1", "IN2", "IN3" };
for (i = 0; i < 4; i++)
- state->last[i] = input_port_read(space->machine, track_names[i]);
+ state->last[i] = input_port_read(space->machine(), track_names[i]);
}
static READ16_HANDLER( track_r )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
switch (offset)
{
default:
- case 0: return (( input_port_read(space->machine, "IN0") - state->last[0]) & 0x00ff) | (((input_port_read(space->machine, "IN2") - state->last[2]) & 0x00ff) << 8); /* X lo */
- case 1: return (((input_port_read(space->machine, "IN0") - state->last[0]) & 0xff00) >> 8) | (( input_port_read(space->machine, "IN2") - state->last[2]) & 0xff00); /* X hi */
- case 2: return (( input_port_read(space->machine, "IN1") - state->last[1]) & 0x00ff) | (((input_port_read(space->machine, "IN3") - state->last[3]) & 0x00ff) << 8); /* Y lo */
- case 3: return (((input_port_read(space->machine, "IN1") - state->last[1]) & 0xff00) >> 8) | (( input_port_read(space->machine, "IN3") - state->last[3]) & 0xff00); /* Y hi */
+ case 0: return (( input_port_read(space->machine(), "IN0") - state->last[0]) & 0x00ff) | (((input_port_read(space->machine(), "IN2") - state->last[2]) & 0x00ff) << 8); /* X lo */
+ case 1: return (((input_port_read(space->machine(), "IN0") - state->last[0]) & 0xff00) >> 8) | (( input_port_read(space->machine(), "IN2") - state->last[2]) & 0xff00); /* X hi */
+ case 2: return (( input_port_read(space->machine(), "IN1") - state->last[1]) & 0x00ff) | (((input_port_read(space->machine(), "IN3") - state->last[3]) & 0x00ff) << 8); /* Y lo */
+ case 3: return (((input_port_read(space->machine(), "IN1") - state->last[1]) & 0xff00) >> 8) | (( input_port_read(space->machine(), "IN3") - state->last[3]) & 0xff00); /* Y hi */
}
}
@@ -114,7 +114,7 @@ static WRITE16_HANDLER( cabal_sound_irq_trigger_word_w )
static WRITE16_HANDLER( cabalbl_sound_irq_trigger_word_w )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE );
}
@@ -162,22 +162,22 @@ ADDRESS_MAP_END
static READ8_HANDLER( cabalbl_snd2_r )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
return BITSWAP8(state->sound_command2, 7,2,4,5,3,6,1,0);
}
static READ8_HANDLER( cabalbl_snd1_r )
{
- cabal_state *state = space->machine->driver_data<cabal_state>();
+ cabal_state *state = space->machine().driver_data<cabal_state>();
return BITSWAP8(state->sound_command1, 7,2,4,5,3,6,1,0);
}
static WRITE8_HANDLER( cabalbl_coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
//data & 0x40? video enable?
}
@@ -464,7 +464,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface cabalbl_ym2151_interface =
@@ -835,11 +835,11 @@ ROM_END
-static void seibu_sound_bootleg(running_machine *machine,const char *cpu,int length)
+static void seibu_sound_bootleg(running_machine &machine,const char *cpu,int length)
{
- address_space *space = machine->device(cpu)->memory().space(AS_PROGRAM);
+ address_space *space = machine.device(cpu)->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, length);
- UINT8 *rom = machine->region(cpu)->base();
+ UINT8 *rom = machine.region(cpu)->base();
space->set_decrypted_region(0x0000, (length < 0x10000) ? (length - 1) : 0x1fff, decrypt);
diff --git a/src/mame/drivers/cabaret.c b/src/mame/drivers/cabaret.c
index 364c0cbe06f..452aed60295 100644
--- a/src/mame/drivers/cabaret.c
+++ b/src/mame/drivers/cabaret.c
@@ -53,28 +53,28 @@ public:
static WRITE8_HANDLER( bg_scroll_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->bg_scroll[offset] = data;
tilemap_set_scrolly(state->bg_tilemap,offset,data);
}
static WRITE8_HANDLER( bg_tile_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->bg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
int code = state->bg_tile_ram[tile_index];
SET_TILE_INFO(1, code & 0xff, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
int tile = code & 0x1fff;
SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
@@ -82,21 +82,21 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( fg_tile_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static VIDEO_START(cabaret)
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 64, 8);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -106,8 +106,8 @@ static VIDEO_START(cabaret)
static SCREEN_UPDATE(cabaret)
{
- cabaret_state *state = screen->machine->driver_data<cabaret_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ cabaret_state *state = screen->machine().driver_data<cabaret_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -131,19 +131,19 @@ static void show_out(cabaret_state *state)
static WRITE8_HANDLER( cabaret_nmi_and_coins_w )
{
- cabaret_state *state = space->machine->driver_data<cabaret_state>();
+ cabaret_state *state = space->machine().driver_data<cabaret_state>();
if ((state->nmi_enable ^ data) & (~0xdd))
{
logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(space->cpu),data);
// popmessage("%02x",data);
}
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x40); // led for coin state->out / hopper active
+ set_led_status(space->machine(), 6, data & 0x40); // led for coin state->out / hopper active
state->nmi_enable = data; // data & 0x80 // nmi enable?
@@ -314,13 +314,13 @@ GFXDECODE_END
static MACHINE_RESET( cabaret )
{
- cabaret_state *state = machine->driver_data<cabaret_state>();
+ cabaret_state *state = machine.driver_data<cabaret_state>();
state->nmi_enable = 0;
}
static INTERRUPT_GEN( cabaret_interrupt )
{
- cabaret_state *state = device->machine->driver_data<cabaret_state>();
+ cabaret_state *state = device->machine().driver_data<cabaret_state>();
if (state->nmi_enable & 0x80)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -357,7 +357,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( cabaret )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
diff --git a/src/mame/drivers/calchase.c b/src/mame/drivers/calchase.c
index 7bbc0462448..f5ca27678b4 100644
--- a/src/mame/drivers/calchase.c
+++ b/src/mame/drivers/calchase.c
@@ -129,10 +129,10 @@ static VIDEO_START(calchase)
static SCREEN_UPDATE(calchase)
{
- calchase_state *state = screen->machine->driver_data<calchase_state>();
+ calchase_state *state = screen->machine().driver_data<calchase_state>();
int x,y,count,i;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (0);
@@ -147,7 +147,7 @@ static SCREEN_UPDATE(calchase)
color = (state->vga_vram[count])>>(32-i) & 0x1;
if((x+i)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x+(32-i)) = screen->machine().pens[color];
}
@@ -182,7 +182,7 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
static READ8_HANDLER(at_page8_r)
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8) {
@@ -205,7 +205,7 @@ static READ8_HANDLER(at_page8_r)
static WRITE8_HANDLER(at_page8_w)
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8) {
@@ -227,7 +227,7 @@ static WRITE8_HANDLER(at_page8_w)
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -236,7 +236,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -246,7 +246,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -255,7 +255,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static void set_dma_channel(device_t *device, int channel, int state)
{
- calchase_state *drvstate = device->machine->driver_data<calchase_state>();
+ calchase_state *drvstate = device->machine().driver_data<calchase_state>();
if (!state) drvstate->dma_channel = channel;
}
@@ -322,7 +322,7 @@ static WRITE32_DEVICE_HANDLER( fdc_w )
static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
// mame_printf_debug("MXTC: read %d, %02X\n", function, reg);
return state->mxtc_config_reg[reg];
@@ -330,8 +330,8 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function,
static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
-// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data);
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
+// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data);
switch(reg)
{
@@ -339,11 +339,11 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- memory_set_bankptr(busdevice->machine, "bank1", state->bios_ram);
+ memory_set_bankptr(busdevice->machine(), "bank1", state->bios_ram);
}
else // disable RAM access (reads go to BIOS ROM)
{
- memory_set_bankptr(busdevice->machine, "bank1", busdevice->machine->region("bios")->base() + 0x10000);
+ memory_set_bankptr(busdevice->machine(), "bank1", busdevice->machine().region("bios")->base() + 0x10000);
}
break;
}
@@ -352,9 +352,9 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
state->mxtc_config_reg[reg] = data;
}
-static void intel82439tx_init(running_machine *machine)
+static void intel82439tx_init(running_machine &machine)
{
- calchase_state *state = machine->driver_data<calchase_state>();
+ calchase_state *state = machine.driver_data<calchase_state>();
state->mxtc_config_reg[0x60] = 0x02;
state->mxtc_config_reg[0x61] = 0x02;
state->mxtc_config_reg[0x62] = 0x02;
@@ -409,15 +409,15 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi
static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
// mame_printf_debug("PIIX4: read %d, %02X\n", function, reg);
return state->piix4_config_reg[function][reg];
}
static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- calchase_state *state = busdevice->machine->driver_data<calchase_state>();
-// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine->describe_context(), function, reg, data);
+ calchase_state *state = busdevice->machine().driver_data<calchase_state>();
+// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", machine.describe_context(), function, reg, data);
state->piix4_config_reg[function][reg] = data;
}
@@ -465,7 +465,7 @@ static void intel82371ab_pci_w(device_t *busdevice, device_t *device, int functi
static WRITE32_HANDLER(bios_ram_w)
{
- calchase_state *state = space->machine->driver_data<calchase_state>();
+ calchase_state *state = space->machine().driver_data<calchase_state>();
if (state->mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
COMBINE_DATA(state->bios_ram + offset);
@@ -565,7 +565,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- calchase_state *state = device->machine->driver_data<calchase_state>();
+ calchase_state *state = device->machine().driver_data<calchase_state>();
int r = 0;
r = pic8259_acknowledge( state->pic8259_2);
if (r==0)
@@ -577,14 +577,14 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(calchase)
{
- calchase_state *state = machine->driver_data<calchase_state>();
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ calchase_state *state = machine.driver_data<calchase_state>();
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
- state->pit8254 = machine->device( "pit8254" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ state->pit8254 = machine.device( "pit8254" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
}
/*************************************************************
@@ -595,7 +595,7 @@ static MACHINE_START(calchase)
static WRITE_LINE_DEVICE_HANDLER( calchase_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface calchase_pic8259_1_config =
@@ -636,29 +636,29 @@ static const struct pit8253_config calchase_pit8254_config =
static MACHINE_RESET(calchase)
{
- memory_set_bankptr(machine, "bank1", machine->region("bios")->base() + 0x10000);
+ memory_set_bankptr(machine, "bank1", machine.region("bios")->base() + 0x10000);
}
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- calchase_state *drvstate = machine->driver_data<calchase_state>();
+ calchase_state *drvstate = machine.driver_data<calchase_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static void ide_interrupt(device_t *device, int state)
{
- calchase_state *drvstate = device->machine->driver_data<calchase_state>();
+ calchase_state *drvstate = device->machine().driver_data<calchase_state>();
pic8259_ir6_w(drvstate->pic8259_2, state);
}
-static int calchase_get_out2(running_machine *machine)
+static int calchase_get_out2(running_machine &machine)
{
- calchase_state *state = machine->driver_data<calchase_state>();
+ calchase_state *state = machine.driver_data<calchase_state>();
return pit8253_get_output(state->pit8254, 2 );
}
@@ -667,9 +667,9 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, calchase_get_out2
};
-static void calchase_set_keyb_int(running_machine *machine, int state)
+static void calchase_set_keyb_int(running_machine &machine, int state)
{
- calchase_state *drvstate = machine->driver_data<calchase_state>();
+ calchase_state *drvstate = machine.driver_data<calchase_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
@@ -709,7 +709,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( calchase )
{
- calchase_state *state = machine->driver_data<calchase_state>();
+ calchase_state *state = machine.driver_data<calchase_state>();
state->bios_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, calchase_set_keyb_int);
diff --git a/src/mame/drivers/calomega.c b/src/mame/drivers/calomega.c
index ac9c209e048..04458e136bb 100644
--- a/src/mame/drivers/calomega.c
+++ b/src/mame/drivers/calomega.c
@@ -660,7 +660,7 @@
static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
{
int trx_clk;
- UINT8 dsw2 = input_port_read(device->machine, "SW2");
+ UINT8 dsw2 = input_port_read(device->machine(), "SW2");
trx_clk = UART_CLOCK * dsw2 / 128;
acia6850_set_rx_clock(device, trx_clk);
acia6850_set_tx_clock(device, trx_clk);
@@ -669,21 +669,21 @@ static WRITE_LINE_DEVICE_HANDLER( tx_rx_clk )
static READ8_DEVICE_HANDLER( s903_mux_port_r )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
switch( state->s903_mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
- return input_port_read(device->machine, "FRQ"); /* bit7 used for 50/60 Hz selector */
+ return input_port_read(device->machine(), "FRQ"); /* bit7 used for 50/60 Hz selector */
}
static WRITE8_DEVICE_HANDLER( s903_mux_w )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
state->s903_mux_data = data ^ 0xff; /* inverted */
}
@@ -691,21 +691,21 @@ static WRITE8_DEVICE_HANDLER( s903_mux_w )
static READ8_DEVICE_HANDLER( s905_mux_port_r )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
switch( state->s905_mux_data & 0x0f ) /* bits 0-3 */
{
- case 0x01: return input_port_read(device->machine, "IN0-0");
- case 0x02: return input_port_read(device->machine, "IN0-1");
- case 0x04: return input_port_read(device->machine, "IN0-2");
- case 0x08: return input_port_read(device->machine, "IN0-3");
+ case 0x01: return input_port_read(device->machine(), "IN0-0");
+ case 0x02: return input_port_read(device->machine(), "IN0-1");
+ case 0x04: return input_port_read(device->machine(), "IN0-2");
+ case 0x08: return input_port_read(device->machine(), "IN0-3");
}
- return input_port_read(device->machine, "FRQ"); /* bit6 used for 50/60 Hz selector */
+ return input_port_read(device->machine(), "FRQ"); /* bit6 used for 50/60 Hz selector */
}
static WRITE8_DEVICE_HANDLER( s905_mux_w )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
state->s905_mux_data = data ^ 0xff; /* inverted */
}
@@ -716,7 +716,7 @@ static READ8_DEVICE_HANDLER( pia0_ain_r )
{
/* Valid input port. Each polled value is stored at $0538 */
logerror("PIA0: Port A in\n");
- return input_port_read(device->machine, "IN0");
+ return input_port_read(device->machine(), "IN0");
}
static READ8_DEVICE_HANDLER( pia0_bin_r )
@@ -2654,13 +2654,13 @@ static const pia6821_interface sys906_pia1_intf =
static READ_LINE_DEVICE_HANDLER( acia_rx_r )
{
- calomega_state *state = device->machine->driver_data<calomega_state>();
+ calomega_state *state = device->machine().driver_data<calomega_state>();
return state->rx_line;
}
static WRITE_LINE_DEVICE_HANDLER( acia_tx_w )
{
- calomega_state *drvstate = device->machine->driver_data<calomega_state>();
+ calomega_state *drvstate = device->machine().driver_data<calomega_state>();
drvstate->tx_line = state;
}
@@ -3916,7 +3916,7 @@ static DRIVER_INIT( standard )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3928,7 +3928,7 @@ static DRIVER_INIT( standard )
static DRIVER_INIT( elgrande )
{
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
/* background color is adjusted through RGB pots */
for (x = 0x0000; x < 0x0400; x++)
@@ -3942,7 +3942,7 @@ static DRIVER_INIT( jjpoker )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3955,7 +3955,7 @@ static DRIVER_INIT( comg080 )
{
/* background color is adjusted through RGB pots */
int x;
- UINT8 *BPR = machine->region( "proms" )->base();
+ UINT8 *BPR = machine.region( "proms" )->base();
for (x = 0x0000; x < 0x0400; x++)
{
@@ -3967,7 +3967,7 @@ static DRIVER_INIT( comg080 )
Start = $2042; NMI = $26f8;
Also a fake vector at $3ff8-$3ff9. The code checks these values to continue.
*/
- UINT8 *PRGROM = machine->region( "maincpu" )->base();
+ UINT8 *PRGROM = machine.region( "maincpu" )->base();
PRGROM[0x3ff8] = 0x8e; /* checked by code */
PRGROM[0x3ff9] = 0x97; /* checked by code */
diff --git a/src/mame/drivers/calorie.c b/src/mame/drivers/calorie.c
index 7709052c30b..9aefcdfdb5a 100644
--- a/src/mame/drivers/calorie.c
+++ b/src/mame/drivers/calorie.c
@@ -108,8 +108,8 @@ public:
static TILE_GET_INFO( get_bg_tile_info )
{
- calorie_state *state = machine->driver_data<calorie_state>();
- UINT8 *src = machine->region("user1")->base();
+ calorie_state *state = machine.driver_data<calorie_state>();
+ UINT8 *src = machine.region("user1")->base();
int bg_base = (state->bg_bank & 0x0f) * 0x200;
int code = src[bg_base + tile_index] | (((src[bg_base + tile_index + 0x100]) & 0x10) << 4);
int color = src[bg_base + tile_index + 0x100] & 0x0f;
@@ -120,7 +120,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
int code = ((state->fg_ram[tile_index + 0x400] & 0x30) << 4) | state->fg_ram[tile_index];
int color = state->fg_ram[tile_index + 0x400] & 0x0f;
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( calorie )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 16, 16);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -140,7 +140,7 @@ static VIDEO_START( calorie )
static SCREEN_UPDATE( calorie )
{
- calorie_state *state = screen->machine->driver_data<calorie_state>();
+ calorie_state *state = screen->machine().driver_data<calorie_state>();
int x;
if (state->bg_bank & 0x10)
@@ -165,7 +165,7 @@ static SCREEN_UPDATE( calorie )
ypos = 0xff - state->sprites[x + 2];
xpos = state->sprites[x + 3];
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
if (state->sprites[x + 1] & 0x10)
ypos = 0xff - ypos + 32;
@@ -180,12 +180,12 @@ static SCREEN_UPDATE( calorie )
if (state->sprites[x + 1] & 0x10)
{
/* 32x32 sprites */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], tileno | 0x40, color, flipx, flipy, xpos, ypos - 31, 0);
}
else
{
/* 16x16 sprites */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], tileno, color, flipx, flipy, xpos, ypos - 15, 0);
}
}
return 0;
@@ -199,14 +199,14 @@ static SCREEN_UPDATE( calorie )
static WRITE8_HANDLER( fg_ram_w )
{
- calorie_state *state = space->machine->driver_data<calorie_state>();
+ calorie_state *state = space->machine().driver_data<calorie_state>();
state->fg_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset & 0x3ff);
}
static WRITE8_HANDLER( bg_bank_w )
{
- calorie_state *state = space->machine->driver_data<calorie_state>();
+ calorie_state *state = space->machine().driver_data<calorie_state>();
if((state->bg_bank & ~0x10) != (data & ~0x10))
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
@@ -215,7 +215,7 @@ static WRITE8_HANDLER( bg_bank_w )
static WRITE8_HANDLER( calorie_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static READ8_HANDLER( calorie_soundlatch_r )
@@ -416,14 +416,14 @@ GFXDECODE_END
static MACHINE_START( calorie )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
state->save_item(NAME(state->bg_bank));
}
static MACHINE_RESET( calorie )
{
- calorie_state *state = machine->driver_data<calorie_state>();
+ calorie_state *state = machine.driver_data<calorie_state>();
state->bg_bank = 0;
}
@@ -550,8 +550,8 @@ static DRIVER_INIT( calorie )
static DRIVER_INIT( calorieb )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0x7fff, machine->region("maincpu")->base() + 0x10000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0x7fff, machine.region("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/canyon.c b/src/mame/drivers/canyon.c
index d061581944f..fde3eca8472 100644
--- a/src/mame/drivers/canyon.c
+++ b/src/mame/drivers/canyon.c
@@ -67,10 +67,10 @@ static READ8_HANDLER( canyon_switches_r )
{
UINT8 val = 0;
- if ((input_port_read(space->machine, "IN2") >> (offset & 7)) & 1)
+ if ((input_port_read(space->machine(), "IN2") >> (offset & 7)) & 1)
val |= 0x80;
- if ((input_port_read(space->machine, "IN1") >> (offset & 3)) & 1)
+ if ((input_port_read(space->machine(), "IN1") >> (offset & 3)) & 1)
val |= 0x01;
return val;
@@ -79,7 +79,7 @@ static READ8_HANDLER( canyon_switches_r )
static READ8_HANDLER( canyon_options_r )
{
- return (input_port_read(space->machine, "DSW") >> (2 * (~offset & 3))) & 3;
+ return (input_port_read(space->machine(), "DSW") >> (2 * (~offset & 3))) & 3;
}
@@ -93,7 +93,7 @@ static READ8_HANDLER( canyon_options_r )
static WRITE8_HANDLER( canyon_led_w )
{
- set_led_status(space->machine, offset & 0x01, offset & 0x02);
+ set_led_status(space->machine(), offset & 0x01, offset & 0x02);
}
diff --git a/src/mame/drivers/capbowl.c b/src/mame/drivers/capbowl.c
index 4121d401800..d46b8c4cc1b 100644
--- a/src/mame/drivers/capbowl.c
+++ b/src/mame/drivers/capbowl.c
@@ -107,7 +107,7 @@
static INTERRUPT_GEN( capbowl_interrupt )
{
- if (input_port_read(device->machine, "SERVICE") & 1) /* get status of the F2 key */
+ if (input_port_read(device->machine(), "SERVICE") & 1) /* get status of the F2 key */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); /* trigger self test */
}
@@ -123,10 +123,10 @@ static TIMER_CALLBACK( capbowl_update )
{
int scanline = param;
- machine->primary_screen->update_partial(scanline - 1);
+ machine.primary_screen->update_partial(scanline - 1);
scanline += 32;
if (scanline > 240) scanline = 32;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(capbowl_update), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(capbowl_update), scanline);
}
@@ -139,7 +139,7 @@ static TIMER_CALLBACK( capbowl_update )
static WRITE8_HANDLER( capbowl_rom_select_w )
{
// 2009-11 FP: shall we add a check to be sure that bank < 6?
- memory_set_bank(space->machine, "bank1", ((data & 0x0c) >> 1) + (data & 0x01));
+ memory_set_bank(space->machine(), "bank1", ((data & 0x0c) >> 1) + (data & 0x01));
}
@@ -152,25 +152,25 @@ static WRITE8_HANDLER( capbowl_rom_select_w )
static READ8_HANDLER( track_0_r )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
- return (input_port_read(space->machine, "IN0") & 0xf0) | ((input_port_read(space->machine, "TRACKY") - state->last_trackball_val[0]) & 0x0f);
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
+ return (input_port_read(space->machine(), "IN0") & 0xf0) | ((input_port_read(space->machine(), "TRACKY") - state->last_trackball_val[0]) & 0x0f);
}
static READ8_HANDLER( track_1_r )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
- return (input_port_read(space->machine, "IN1") & 0xf0) | ((input_port_read(space->machine, "TRACKX") - state->last_trackball_val[1]) & 0x0f);
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
+ return (input_port_read(space->machine(), "IN1") & 0xf0) | ((input_port_read(space->machine(), "TRACKX") - state->last_trackball_val[1]) & 0x0f);
}
static WRITE8_HANDLER( track_reset_w )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
/* reset the trackball counters */
- state->last_trackball_val[0] = input_port_read(space->machine, "TRACKY");
- state->last_trackball_val[1] = input_port_read(space->machine, "TRACKX");
+ state->last_trackball_val[0] = input_port_read(space->machine(), "TRACKY");
+ state->last_trackball_val[1] = input_port_read(space->machine(), "TRACKX");
watchdog_reset_w(space, offset, data);
}
@@ -185,7 +185,7 @@ static WRITE8_HANDLER( track_reset_w )
static WRITE8_HANDLER( capbowl_sndcmd_w )
{
- capbowl_state *state = space->machine->driver_data<capbowl_state>();
+ capbowl_state *state = space->machine().driver_data<capbowl_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
soundlatch_w(space, offset, data);
}
@@ -201,7 +201,7 @@ static WRITE8_HANDLER( capbowl_sndcmd_w )
static void firqhandler( device_t *device, int irq )
{
- capbowl_state *state = device->machine->driver_data<capbowl_state>();
+ capbowl_state *state = device->machine().driver_data<capbowl_state>();
device_set_input_line(state->audiocpu, 1, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -340,10 +340,10 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( capbowl )
{
- capbowl_state *state = machine->driver_data<capbowl_state>();
+ capbowl_state *state = machine.driver_data<capbowl_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->blitter_addr));
state->save_item(NAME(state->last_trackball_val[0]));
@@ -352,9 +352,9 @@ static MACHINE_START( capbowl )
static MACHINE_RESET( capbowl )
{
- capbowl_state *state = machine->driver_data<capbowl_state>();
+ capbowl_state *state = machine.driver_data<capbowl_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(32), FUNC(capbowl_update), 32);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(32), FUNC(capbowl_update), 32);
state->blitter_addr = 0;
state->last_trackball_val[0] = 0;
@@ -504,7 +504,7 @@ ROM_END
static DRIVER_INIT( capbowl )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* configure ROM banks in 0x0000-0x3fff */
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
diff --git a/src/mame/drivers/cardline.c b/src/mame/drivers/cardline.c
index 1667fb2c317..76a30bdae25 100644
--- a/src/mame/drivers/cardline.c
+++ b/src/mame/drivers/cardline.c
@@ -37,7 +37,7 @@ public:
-#define DRAW_TILE(machine, offset, transparency) drawgfx_transpen(bitmap, cliprect, machine->gfx[0],\
+#define DRAW_TILE(machine, offset, transparency) drawgfx_transpen(bitmap, cliprect, (machine).gfx[0],\
(state->videoram[index+offset] | (state->colorram[index+offset]<<8))&0x3fff,\
(state->colorram[index+offset]&0x80)>>7,\
0,0,\
@@ -46,7 +46,7 @@ public:
static SCREEN_UPDATE( cardline )
{
- cardline_state *state = screen->machine->driver_data<cardline_state>();
+ cardline_state *state = screen->machine().driver_data<cardline_state>();
int x,y;
bitmap_fill(bitmap,cliprect,0);
for(y=0;y<32;y++)
@@ -56,14 +56,14 @@ static SCREEN_UPDATE( cardline )
int index=y*64+x;
if(state->video&1)
{
- DRAW_TILE(screen->machine,0,0);
- DRAW_TILE(screen->machine,0x800,1);
+ DRAW_TILE(screen->machine(),0,0);
+ DRAW_TILE(screen->machine(),0x800,1);
}
if(state->video&2)
{
- DRAW_TILE(screen->machine,0x1000,0);
- DRAW_TILE(screen->machine,0x1800,1);
+ DRAW_TILE(screen->machine(),0x1000,0);
+ DRAW_TILE(screen->machine(),0x1800,1);
}
}
}
@@ -72,27 +72,27 @@ static SCREEN_UPDATE( cardline )
static WRITE8_HANDLER(vram_w)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
offset+=0x1000*((state->video&2)>>1);
state->videoram[offset]=data;
}
static WRITE8_HANDLER(attr_w)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
offset+=0x1000*((state->video&2)>>1);
state->colorram[offset]=data;
}
static WRITE8_HANDLER(video_w)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
state->video=data;
}
static READ8_HANDLER(unk_r)
{
- cardline_state *state = space->machine->driver_data<cardline_state>();
+ cardline_state *state = space->machine().driver_data<cardline_state>();
state->var^=0x10;
//printf("var %d\n",state->var);
return state->var;
@@ -185,7 +185,7 @@ static PALETTE_INIT(cardline)
{
int i,r,g,b,data;
int bit0,bit1,bit2;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
data=color_prom[i];
diff --git a/src/mame/drivers/carjmbre.c b/src/mame/drivers/carjmbre.c
index 3e5b01d6cc0..d34957f49d2 100644
--- a/src/mame/drivers/carjmbre.c
+++ b/src/mame/drivers/carjmbre.c
@@ -178,7 +178,7 @@ GFXDECODE_END
static MACHINE_RESET( carjmbre )
{
- carjmbre_state *state = machine->driver_data<carjmbre_state>();
+ carjmbre_state *state = machine.driver_data<carjmbre_state>();
state->flipscreen = 0;
state->bgcolor = 0;
diff --git a/src/mame/drivers/carpolo.c b/src/mame/drivers/carpolo.c
index 37d7714e7df..a4145761c67 100644
--- a/src/mame/drivers/carpolo.c
+++ b/src/mame/drivers/carpolo.c
@@ -332,8 +332,8 @@ static DRIVER_INIT( carpolo )
/* invert gfx PROM since the bits are active LO */
- ROM = machine->region("gfx2")->base();
- len = machine->region("gfx2")->bytes();
+ ROM = machine.region("gfx2")->base();
+ len = machine.region("gfx2")->bytes();
for (i = 0;i < len; i++)
ROM[i] ^= 0x0f;
}
diff --git a/src/mame/drivers/carrera.c b/src/mame/drivers/carrera.c
index 2220c95d129..61a83806e6f 100644
--- a/src/mame/drivers/carrera.c
+++ b/src/mame/drivers/carrera.c
@@ -246,7 +246,7 @@ GFXDECODE_END
static SCREEN_UPDATE(carrera)
{
- carrera_state *state = screen->machine->driver_data<carrera_state>();
+ carrera_state *state = screen->machine().driver_data<carrera_state>();
int x,y;
int count = 0;
@@ -257,7 +257,7 @@ static SCREEN_UPDATE(carrera)
{
int tile = state->tileram[count&0x7ff] | state->tileram[(count&0x7ff)+0x800]<<8;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x*8,y*8);
count++;
}
}
@@ -266,7 +266,7 @@ static SCREEN_UPDATE(carrera)
static READ8_DEVICE_HANDLER( unknown_r )
{
- return device->machine->rand();
+ return device->machine().rand();
}
/* these are set as input, but I have no idea which input port it uses is for the AY */
diff --git a/src/mame/drivers/caswin.c b/src/mame/drivers/caswin.c
index c4a732fbae9..56adb4c7ca1 100644
--- a/src/mame/drivers/caswin.c
+++ b/src/mame/drivers/caswin.c
@@ -62,7 +62,7 @@ public:
static TILE_GET_INFO( get_sc0_tile_info )
{
- caswin_state *state = machine->driver_data<caswin_state>();
+ caswin_state *state = machine.driver_data<caswin_state>();
int tile = (state->sc0_vram[tile_index] | ((state->sc0_attr[tile_index] & 0x70)<<4)) & 0x7ff;
int colour = state->sc0_attr[tile_index] & 0xf;
@@ -75,27 +75,27 @@ static TILE_GET_INFO( get_sc0_tile_info )
static VIDEO_START(vvillage)
{
- caswin_state *state = machine->driver_data<caswin_state>();
+ caswin_state *state = machine.driver_data<caswin_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,32);
}
static SCREEN_UPDATE(vvillage)
{
- caswin_state *state = screen->machine->driver_data<caswin_state>();
+ caswin_state *state = screen->machine().driver_data<caswin_state>();
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
return 0;
}
static WRITE8_HANDLER( sc0_vram_w )
{
- caswin_state *state = space->machine->driver_data<caswin_state>();
+ caswin_state *state = space->machine().driver_data<caswin_state>();
state->sc0_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( sc0_attr_w )
{
- caswin_state *state = space->machine->driver_data<caswin_state>();
+ caswin_state *state = space->machine().driver_data<caswin_state>();
state->sc0_attr[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
@@ -110,7 +110,7 @@ static WRITE8_HANDLER( vvillage_scroll_w )
/*---- ---x flip screen */
static WRITE8_HANDLER( vvillage_vregs_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
/**********************
@@ -121,16 +121,16 @@ static WRITE8_HANDLER( vvillage_vregs_w )
static READ8_HANDLER( vvillage_rng_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( vvillage_output_w )
{
- coin_counter_w(space->machine, 0,data & 1);
- coin_counter_w(space->machine, 1,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
+ coin_counter_w(space->machine(), 1,data & 1);
// data & 4 payout counter
- coin_lockout_w(space->machine, 0,data & 0x20);
- coin_lockout_w(space->machine, 1,data & 0x20);
+ coin_lockout_w(space->machine(), 0,data & 0x20);
+ coin_lockout_w(space->machine(), 1,data & 0x20);
}
static WRITE8_HANDLER( vvillage_lamps_w )
@@ -142,11 +142,11 @@ static WRITE8_HANDLER( vvillage_lamps_w )
---- --x- lamp button 2
---- ---x lamp button 1
*/
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- set_led_status(space->machine, 2, data & 0x04);
- set_led_status(space->machine, 3, data & 0x08);
- set_led_status(space->machine, 4, data & 0x10);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ set_led_status(space->machine(), 2, data & 0x04);
+ set_led_status(space->machine(), 3, data & 0x08);
+ set_led_status(space->machine(), 4, data & 0x10);
}
static ADDRESS_MAP_START( vvillage_mem, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/cave.c b/src/mame/drivers/cave.c
index 7cd94df18f4..a1f84f58fbc 100644
--- a/src/mame/drivers/cave.c
+++ b/src/mame/drivers/cave.c
@@ -93,9 +93,9 @@ Versions known to exist but not dumped:
/* Update the IRQ state based on all possible causes */
-static void update_irq_state( running_machine *machine )
+static void update_irq_state( running_machine &machine )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
if (state->vblank_irq || state->sound_irq || state->unknown_irq)
device_set_input_line(state->maincpu, state->irq_level, ASSERT_LINE);
else
@@ -104,7 +104,7 @@ static void update_irq_state( running_machine *machine )
static TIMER_CALLBACK( cave_vblank_end )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
if (state->kludge == 3) /* mazinger metmqstr */
{
state->unknown_irq = 1;
@@ -115,27 +115,27 @@ static TIMER_CALLBACK( cave_vblank_end )
static TIMER_DEVICE_CALLBACK( cave_vblank_start )
{
- cave_state *state = timer.machine->driver_data<cave_state>();
+ cave_state *state = timer.machine().driver_data<cave_state>();
state->vblank_irq = 1;
- update_irq_state(timer.machine);
- cave_get_sprite_info(timer.machine);
+ update_irq_state(timer.machine());
+ cave_get_sprite_info(timer.machine());
state->agallet_vblank_irq = 1;
- timer.machine->scheduler().timer_set(attotime::from_usec(2000), FUNC(cave_vblank_end));
+ timer.machine().scheduler().timer_set(attotime::from_usec(2000), FUNC(cave_vblank_end));
}
/* Called once/frame to generate the VBLANK interrupt */
static INTERRUPT_GEN( cave_interrupt )
{
- cave_state *state = device->machine->driver_data<cave_state>();
+ cave_state *state = device->machine().driver_data<cave_state>();
state->int_timer->adjust(attotime::from_usec(17376 - state->time_vblank_irq));
}
/* Called by the YMZ280B to set the IRQ state */
static void sound_irq_gen( device_t *device, int state )
{
- cave_state *cave = device->machine->driver_data<cave_state>();
+ cave_state *cave = device->machine().driver_data<cave_state>();
cave->sound_irq = (state != 0);
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
@@ -157,7 +157,7 @@ static void sound_irq_gen( device_t *device, int state )
static READ16_HANDLER( cave_irq_cause_r )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
int result = 0x0003;
if (state->vblank_irq)
@@ -170,7 +170,7 @@ static READ16_HANDLER( cave_irq_cause_r )
if (offset == 6/2)
state->unknown_irq = 0;
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
/*
sailormn and agallet wait for bit 2 of $b80001 to go 1 -> 0.
@@ -202,7 +202,7 @@ static READ8_HANDLER( soundflags_r )
{
// bit 2 is low: can read command (lo)
// bit 3 is low: can read command (hi)
-// cave_state *state = space->machine->driver_data<cave_state>();
+// cave_state *state = space->machine().driver_data<cave_state>();
// return (state->sound_flag1 ? 0 : 4) |
// (state->sound_flag2 ? 0 : 8) ;
return 0;
@@ -212,7 +212,7 @@ static READ16_HANDLER( soundflags_ack_r )
{
// bit 0 is low: can write command
// bit 1 is low: can read answer
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
// return ((state->sound_flag1 | state->sound_flag2) ? 1 : 0) |
// ((state->soundbuf_len > 0) ? 0 : 2) ;
@@ -222,7 +222,7 @@ static READ16_HANDLER( soundflags_ack_r )
/* Main CPU: write a 16 bit sound latch and generate a NMI on the sound CPU */
static WRITE16_HANDLER( sound_cmd_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
// state->sound_flag1 = 1;
// state->sound_flag2 = 1;
soundlatch_word_w(space, offset, data, mem_mask);
@@ -233,7 +233,7 @@ static WRITE16_HANDLER( sound_cmd_w )
/* Sound CPU: read the low 8 bits of the 16 bit sound latch */
static READ8_HANDLER( soundlatch_lo_r )
{
-// cave_state *state = space->machine->driver_data<cave_state>();
+// cave_state *state = space->machine().driver_data<cave_state>();
// state->sound_flag1 = 0;
return soundlatch_word_r(space, offset, 0x00ff) & 0xff;
}
@@ -241,7 +241,7 @@ static READ8_HANDLER( soundlatch_lo_r )
/* Sound CPU: read the high 8 bits of the 16 bit sound latch */
static READ8_HANDLER( soundlatch_hi_r )
{
-// cave_state *state = space->machine->driver_data<cave_state>();
+// cave_state *state = space->machine().driver_data<cave_state>();
// state->sound_flag2 = 0;
return soundlatch_word_r(space, offset, 0xff00) >> 8;
}
@@ -249,7 +249,7 @@ static READ8_HANDLER( soundlatch_hi_r )
/* Main CPU: read the latch written by the sound CPU (acknowledge) */
static READ16_HANDLER( soundlatch_ack_r )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
if (state->soundbuf_len > 0)
{
UINT8 data = state->soundbuf_data[0];
@@ -268,7 +268,7 @@ static READ16_HANDLER( soundlatch_ack_r )
/* Sound CPU: write latch for the main CPU (acknowledge) */
static WRITE8_HANDLER( soundlatch_ack_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
state->soundbuf_data[state->soundbuf_len] = data;
if (state->soundbuf_len < 32)
state->soundbuf_len++;
@@ -289,14 +289,14 @@ static WRITE8_HANDLER( soundlatch_ack_w )
static WRITE16_DEVICE_HANDLER( cave_eeprom_msb_w )
{
if (data & ~0xfe00)
- logerror("%s: Unknown EEPROM bit written %04X\n", device->machine->describe_context(), data);
+ logerror("%s: Unknown EEPROM bit written %04X\n", device->machine().describe_context(), data);
if (ACCESSING_BITS_8_15) // even address
{
- coin_lockout_w(device->machine, 1,~data & 0x8000);
- coin_lockout_w(device->machine, 0,~data & 0x4000);
- coin_counter_w(device->machine, 1, data & 0x2000);
- coin_counter_w(device->machine, 0, data & 0x1000);
+ coin_lockout_w(device->machine(), 1,~data & 0x8000);
+ coin_lockout_w(device->machine(), 0,~data & 0x4000);
+ coin_counter_w(device->machine(), 1, data & 0x2000);
+ coin_counter_w(device->machine(), 0, data & 0x1000);
// latch the bit
eeprom_write_bit(device, data & 0x0800);
@@ -311,7 +311,7 @@ static WRITE16_DEVICE_HANDLER( cave_eeprom_msb_w )
static WRITE16_DEVICE_HANDLER( sailormn_eeprom_msb_w )
{
- sailormn_tilebank_w(device->machine, data & 0x0100);
+ sailormn_tilebank_w(device->machine(), data & 0x0100);
cave_eeprom_msb_w(device, offset, data & ~0x0100, mem_mask);
}
@@ -333,14 +333,14 @@ static WRITE16_DEVICE_HANDLER( hotdogst_eeprom_msb_w )
static WRITE16_DEVICE_HANDLER( cave_eeprom_lsb_w )
{
if (data & ~0x00ef)
- logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
if (ACCESSING_BITS_0_7) // odd address
{
- coin_lockout_w(device->machine, 1, ~data & 0x0008);
- coin_lockout_w(device->machine, 0, ~data & 0x0004);
- coin_counter_w(device->machine, 1, data & 0x0002);
- coin_counter_w(device->machine, 0, data & 0x0001);
+ coin_lockout_w(device->machine(), 1, ~data & 0x0008);
+ coin_lockout_w(device->machine(), 0, ~data & 0x0004);
+ coin_counter_w(device->machine(), 1, data & 0x0002);
+ coin_counter_w(device->machine(), 0, data & 0x0001);
// latch the bit
eeprom_write_bit(device, data & 0x80);
@@ -358,8 +358,8 @@ static WRITE16_HANDLER( gaia_coin_lsb_w )
{
if (ACCESSING_BITS_0_7) // odd address
{
- coin_counter_w(space->machine, 1, data & 0x0002);
- coin_counter_w(space->machine, 0, data & 0x0001);
+ coin_counter_w(space->machine(), 1, data & 0x0002);
+ coin_counter_w(space->machine(), 0, data & 0x0001);
}
}
@@ -368,12 +368,12 @@ static WRITE16_HANDLER( gaia_coin_lsb_w )
static WRITE16_DEVICE_HANDLER( metmqstr_eeprom_msb_w )
{
if (data & ~0xff00)
- logerror("%s: Unknown EEPROM bit written %04X\n", device->machine->describe_context(), data);
+ logerror("%s: Unknown EEPROM bit written %04X\n", device->machine().describe_context(), data);
if (ACCESSING_BITS_8_15) // even address
{
- coin_counter_w(device->machine, 1, data & 0x2000);
- coin_counter_w(device->machine, 0, data & 0x1000);
+ coin_counter_w(device->machine(), 1, data & 0x2000);
+ coin_counter_w(device->machine(), 0, data & 0x1000);
if (~data & 0x0100)
{
@@ -501,7 +501,7 @@ static READ16_HANDLER( donpachi_videoregs_r )
#if 0
WRITE16_HANDLER( donpachi_videoregs_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
COMBINE_DATA(&state->videoregs[offset]);
switch (offset)
@@ -646,47 +646,47 @@ ADDRESS_MAP_END
Koro Koro Quest
***************************************************************************/
-static void show_leds(running_machine *machine)
+static void show_leds(running_machine &machine)
{
#ifdef MAME_DEBUG
-// cave_state *state = machine->driver_data<cave_state>();
+// cave_state *state = machine.driver_data<cave_state>();
// popmessage("led %04X eep %02X", state->leds[0], (state->leds[1] >> 8) & ~0x70);
#endif
}
static WRITE16_HANDLER( korokoro_leds_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
COMBINE_DATA(&state->leds[0]);
- set_led_status(space->machine, 0, data & 0x8000);
- set_led_status(space->machine, 1, data & 0x4000);
- set_led_status(space->machine, 2, data & 0x1000); // square button
- set_led_status(space->machine, 3, data & 0x0800); // round button
-// coin_lockout_w(space->machine, 1, ~data & 0x0200); // coin lockouts?
-// coin_lockout_w(space->machine, 0, ~data & 0x0100);
+ set_led_status(space->machine(), 0, data & 0x8000);
+ set_led_status(space->machine(), 1, data & 0x4000);
+ set_led_status(space->machine(), 2, data & 0x1000); // square button
+ set_led_status(space->machine(), 3, data & 0x0800); // round button
+// coin_lockout_w(space->machine(), 1, ~data & 0x0200); // coin lockouts?
+// coin_lockout_w(space->machine(), 0, ~data & 0x0100);
-// coin_counter_w(space->machine, 2, data & 0x0080);
-// coin_counter_w(space->machine, 1, data & 0x0020);
- coin_counter_w(space->machine, 0, data & 0x0010);
+// coin_counter_w(space->machine(), 2, data & 0x0080);
+// coin_counter_w(space->machine(), 1, data & 0x0020);
+ coin_counter_w(space->machine(), 0, data & 0x0010);
- set_led_status(space->machine, 5, data & 0x0008);
- set_led_status(space->machine, 6, data & 0x0004);
- set_led_status(space->machine, 7, data & 0x0002);
- set_led_status(space->machine, 8, data & 0x0001);
+ set_led_status(space->machine(), 5, data & 0x0008);
+ set_led_status(space->machine(), 6, data & 0x0004);
+ set_led_status(space->machine(), 7, data & 0x0002);
+ set_led_status(space->machine(), 8, data & 0x0001);
- show_leds(space->machine);
+ show_leds(space->machine());
}
static WRITE16_DEVICE_HANDLER( korokoro_eeprom_msb_w )
{
- cave_state *state = device->machine->driver_data<cave_state>();
+ cave_state *state = device->machine().driver_data<cave_state>();
if (data & ~0x7000)
{
- logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
COMBINE_DATA(&state->leds[1]);
- show_leds(device->machine);
+ show_leds(device->machine());
}
if (ACCESSING_BITS_8_15) // even address
@@ -706,7 +706,7 @@ static WRITE16_DEVICE_HANDLER( korokoro_eeprom_msb_w )
static CUSTOM_INPUT( korokoro_hopper_r )
{
- cave_state *state = field->port->machine->driver_data<cave_state>();
+ cave_state *state = field->port->machine().driver_data<cave_state>();
return state->hopper ? 1 : 0;
}
@@ -827,10 +827,10 @@ INLINE void vctrl_w(UINT16 *VCTRL, ATTR_UNUSED offs_t offset, ATTR_UNUSED UINT16
}
COMBINE_DATA(&VCTRL[offset]);
}
-static WRITE16_HANDLER( pwrinst2_vctrl_0_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_0, offset, data, mem_mask); }
-static WRITE16_HANDLER( pwrinst2_vctrl_1_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_1, offset, data, mem_mask); }
-static WRITE16_HANDLER( pwrinst2_vctrl_2_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_2, offset, data, mem_mask); }
-static WRITE16_HANDLER( pwrinst2_vctrl_3_w ) { cave_state *state = space->machine->driver_data<cave_state>(); vctrl_w(state->vctrl_3, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_0_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_0, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_1_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_1, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_2_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_2, offset, data, mem_mask); }
+static WRITE16_HANDLER( pwrinst2_vctrl_3_w ) { cave_state *state = space->machine().driver_data<cave_state>(); vctrl_w(state->vctrl_3, offset, data, mem_mask); }
static ADDRESS_MAP_START( pwrinst2_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x1fffff) AM_ROM // ROM
@@ -865,7 +865,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( sailormn_input0_r )
{
// watchdog_reset16_r(0, 0); // written too rarely for mame.
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static ADDRESS_MAP_START( sailormn_map, AS_PROGRAM, 16 )
@@ -905,7 +905,7 @@ ADDRESS_MAP_END
static WRITE16_DEVICE_HANDLER( tjumpman_eeprom_lsb_w )
{
if (data & ~0x0038)
- logerror("%s: Unknown EEPROM bit written %04X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %04X\n",device->machine().describe_context(),data);
if (ACCESSING_BITS_0_7) // odd address
{
@@ -922,17 +922,17 @@ static WRITE16_DEVICE_HANDLER( tjumpman_eeprom_lsb_w )
static WRITE16_HANDLER( tjumpman_leds_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine, 0, data & 0x0001); // suru
- set_led_status(space->machine, 1, data & 0x0002); // shinai
- set_led_status(space->machine, 2, data & 0x0004); // payout
- set_led_status(space->machine, 3, data & 0x0008); // go
- set_led_status(space->machine, 4, data & 0x0010); // 1 bet
- set_led_status(space->machine, 5, data & 0x0020); // medal
+ set_led_status(space->machine(), 0, data & 0x0001); // suru
+ set_led_status(space->machine(), 1, data & 0x0002); // shinai
+ set_led_status(space->machine(), 2, data & 0x0004); // payout
+ set_led_status(space->machine(), 3, data & 0x0008); // go
+ set_led_status(space->machine(), 4, data & 0x0010); // 1 bet
+ set_led_status(space->machine(), 5, data & 0x0020); // medal
state->hopper = data & 0x0040; // hopper
- set_led_status(space->machine, 6, data & 0x0080); // 3 bet
+ set_led_status(space->machine(), 6, data & 0x0080); // 3 bet
}
// popmessage("led %04X", data);
@@ -940,8 +940,8 @@ static WRITE16_HANDLER( tjumpman_leds_w )
static CUSTOM_INPUT( tjumpman_hopper_r )
{
- cave_state *state = field->port->machine->driver_data<cave_state>();
- return (state->hopper && !(field->port->machine->primary_screen->frame_number() % 10)) ? 0 : 1;
+ cave_state *state = field->port->machine().driver_data<cave_state>();
+ return (state->hopper && !(field->port->machine().primary_screen->frame_number() % 10)) ? 0 : 1;
}
static ADDRESS_MAP_START( tjumpman_map, AS_PROGRAM, 16 )
@@ -970,15 +970,15 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( pacslot_leds_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
if (ACCESSING_BITS_0_7)
{
- set_led_status(space->machine, 0, data & 0x0001); // pac-man
- set_led_status(space->machine, 1, data & 0x0002); // ms. pac-man
- set_led_status(space->machine, 2, data & 0x0004); // payout
- set_led_status(space->machine, 3, data & 0x0008); // start
- set_led_status(space->machine, 4, data & 0x0010); // bet
- set_led_status(space->machine, 5, data & 0x0020); // medal
+ set_led_status(space->machine(), 0, data & 0x0001); // pac-man
+ set_led_status(space->machine(), 1, data & 0x0002); // ms. pac-man
+ set_led_status(space->machine(), 2, data & 0x0004); // payout
+ set_led_status(space->machine(), 3, data & 0x0008); // start
+ set_led_status(space->machine(), 4, data & 0x0010); // bet
+ set_led_status(space->machine(), 5, data & 0x0020); // medal
state->hopper = data & 0x0040; // hopper
}
@@ -1055,15 +1055,15 @@ static WRITE8_HANDLER( hotdogst_rombank_w )
if (data & ~0x0f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank2", data & 0x0f);
+ memory_set_bank(space->machine(), "bank2", data & 0x0f);
}
static WRITE8_HANDLER( hotdogst_okibank_w )
{
int bank1 = (data >> 0) & 0x3;
int bank2 = (data >> 4) & 0x3;
- memory_set_bank(space->machine, "bank3", bank1);
- memory_set_bank(space->machine, "bank4", bank2);
+ memory_set_bank(space->machine(), "bank3", bank1);
+ memory_set_bank(space->machine(), "bank4", bank2);
}
static ADDRESS_MAP_START( hotdogst_sound_map, AS_PROGRAM, 8 )
@@ -1092,7 +1092,7 @@ static WRITE8_HANDLER( mazinger_rombank_w )
if (data & ~0x07)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
}
static ADDRESS_MAP_START( mazinger_sound_map, AS_PROGRAM, 8 )
@@ -1123,23 +1123,23 @@ static WRITE8_HANDLER( metmqstr_rombank_w )
if (data & ~0x0f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( metmqstr_okibank0_w )
{
int bank1 = (data >> 0) & 0x7;
int bank2 = (data >> 4) & 0x7;
- memory_set_bank(space->machine, "bank3", bank1);
- memory_set_bank(space->machine, "bank4", bank2);
+ memory_set_bank(space->machine(), "bank3", bank1);
+ memory_set_bank(space->machine(), "bank4", bank2);
}
static WRITE8_HANDLER( metmqstr_okibank1_w )
{
int bank1 = (data >> 0) & 0x7;
int bank2 = (data >> 4) & 0x7;
- memory_set_bank(space->machine, "bank5", bank1);
- memory_set_bank(space->machine, "bank6", bank2);
+ memory_set_bank(space->machine(), "bank5", bank1);
+ memory_set_bank(space->machine(), "bank6", bank2);
}
static ADDRESS_MAP_START( metmqstr_sound_map, AS_PROGRAM, 8 )
@@ -1171,7 +1171,7 @@ static WRITE8_HANDLER( pwrinst2_rombank_w )
if (data & ~0x07)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static ADDRESS_MAP_START( pwrinst2_sound_map, AS_PROGRAM, 8 )
@@ -1200,13 +1200,13 @@ ADDRESS_MAP_END
static READ8_HANDLER( mirror_ram_r )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
return state->mirror_ram[offset];
}
static WRITE8_HANDLER( mirror_ram_w )
{
- cave_state *state = space->machine->driver_data<cave_state>();
+ cave_state *state = space->machine().driver_data<cave_state>();
state->mirror_ram[offset] = data;
}
@@ -1215,23 +1215,23 @@ static WRITE8_HANDLER( sailormn_rombank_w )
if (data & ~0x1f)
logerror("CPU #1 - PC %04X: Bank %02X\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
static WRITE8_HANDLER( sailormn_okibank0_w )
{
int bank1 = (data >> 0) & 0xf;
int bank2 = (data >> 4) & 0xf;
- memory_set_bank(space->machine, "bank3", bank1);
- memory_set_bank(space->machine, "bank4", bank2);
+ memory_set_bank(space->machine(), "bank3", bank1);
+ memory_set_bank(space->machine(), "bank4", bank2);
}
static WRITE8_HANDLER( sailormn_okibank1_w )
{
int bank1 = (data >> 0) & 0xf;
int bank2 = (data >> 4) & 0xf;
- memory_set_bank(space->machine, "bank5", bank1);
- memory_set_bank(space->machine, "bank6", bank2);
+ memory_set_bank(space->machine(), "bank5", bank1);
+ memory_set_bank(space->machine(), "bank6", bank2);
}
static ADDRESS_MAP_START( sailormn_sound_map, AS_PROGRAM, 8 )
@@ -1799,10 +1799,10 @@ GFXDECODE_END
static MACHINE_START( cave )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->soundbuf_len));
state->save_item(NAME(state->soundbuf_data));
@@ -1815,7 +1815,7 @@ static MACHINE_START( cave )
static MACHINE_RESET( cave )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
memset(state->soundbuf_data, 0, 32);
state->soundbuf_len = 0;
@@ -1833,7 +1833,7 @@ static const ymz280b_interface ymz280b_intf =
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
@@ -2608,10 +2608,10 @@ MACHINE_CONFIG_END
***************************************************************************/
/* 4 bits -> 8 bits. Even and odd pixels are swapped */
-static void unpack_sprites(running_machine *machine)
+static void unpack_sprites(running_machine &machine)
{
- const UINT32 len = machine->region("sprites")->bytes();
- UINT8 *rgn = machine->region ("sprites")->base();
+ const UINT32 len = machine.region("sprites")->bytes();
+ UINT8 *rgn = machine.region ("sprites")->base();
UINT8 *src = rgn + len / 2 - 1;
UINT8 *dst = rgn + len - 1;
@@ -2625,10 +2625,10 @@ static void unpack_sprites(running_machine *machine)
/* 4 bits -> 8 bits. Even and odd pixels and even and odd words, are swapped */
-static void ddonpach_unpack_sprites(running_machine *machine)
+static void ddonpach_unpack_sprites(running_machine &machine)
{
- const UINT32 len = machine->region("sprites")->bytes();
- UINT8 *rgn = machine->region ("sprites")->base();
+ const UINT32 len = machine.region("sprites")->bytes();
+ UINT8 *rgn = machine.region ("sprites")->base();
UINT8 *src = rgn + len / 2 - 1;
UINT8 *dst = rgn + len - 1;
@@ -2649,10 +2649,10 @@ static void ddonpach_unpack_sprites(running_machine *machine)
/* 2 pages of 4 bits -> 8 bits */
-static void esprade_unpack_sprites(running_machine *machine)
+static void esprade_unpack_sprites(running_machine &machine)
{
- UINT8 *src = machine->region("sprites")->base();
- UINT8 *dst = src + machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ UINT8 *dst = src + machine.region("sprites")->bytes();
while(src < dst)
{
@@ -4365,10 +4365,10 @@ ROM_END
/* Tiles are 6 bit, 4 bits stored in one rom, 2 bits in the other.
Expand the 2 bit part into a 4 bit layout, so we can decode it */
-static void sailormn_unpack_tiles( running_machine *machine, const char *region )
+static void sailormn_unpack_tiles( running_machine &machine, const char *region )
{
- const UINT32 len = machine->region(region)->bytes();
- UINT8 *rgn = machine->region(region)->base();
+ const UINT32 len = machine.region(region)->bytes();
+ UINT8 *rgn = machine.region(region)->base();
UINT8 *src = rgn + (len/4)*3 - 1;
UINT8 *dst = rgn + (len/4)*4 - 2;
@@ -4384,9 +4384,9 @@ static void sailormn_unpack_tiles( running_machine *machine, const char *region
}
}
-static void init_cave(running_machine *machine)
+static void init_cave(running_machine &machine)
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
state->spritetype[0] = 0; // Normal sprites
state->kludge = 0;
@@ -4398,17 +4398,17 @@ static void init_cave(running_machine *machine)
static DRIVER_INIT( agallet )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
init_cave(machine);
memory_configure_bank(machine, "bank1", 0, 0x02, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki1")->base();
+ ROM = machine.region("oki1")->base();
memory_configure_bank(machine, "bank3", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 0x10, &ROM[0x00000], 0x20000);
- ROM = machine->region("oki2")->base();
+ ROM = machine.region("oki2")->base();
memory_configure_bank(machine, "bank5", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank6", 0, 0x10, &ROM[0x00000], 0x20000);
@@ -4419,7 +4419,7 @@ static DRIVER_INIT( agallet )
static DRIVER_INIT( dfeveron )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4428,7 +4428,7 @@ static DRIVER_INIT( dfeveron )
static DRIVER_INIT( feversos )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4437,7 +4437,7 @@ static DRIVER_INIT( feversos )
static DRIVER_INIT( ddonpach )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
ddonpach_unpack_sprites(machine);
@@ -4447,7 +4447,7 @@ static DRIVER_INIT( ddonpach )
static DRIVER_INIT( donpachi )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
ddonpach_unpack_sprites(machine);
@@ -4458,7 +4458,7 @@ static DRIVER_INIT( donpachi )
static DRIVER_INIT( esprade )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
esprade_unpack_sprites(machine);
@@ -4466,7 +4466,7 @@ static DRIVER_INIT( esprade )
#if 0 //ROM PATCH
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x118A/2] = 0x4e71; //palette fix 118A: 5548 SUBQ.W #2,A0 --> NOP
}
#endif
@@ -4474,7 +4474,7 @@ static DRIVER_INIT( esprade )
static DRIVER_INIT( gaia )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
/* No EEPROM */
@@ -4486,7 +4486,7 @@ static DRIVER_INIT( gaia )
static DRIVER_INIT( guwange )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
esprade_unpack_sprites(machine);
@@ -4495,15 +4495,15 @@ static DRIVER_INIT( guwange )
static DRIVER_INIT( hotdogst )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
init_cave(machine);
memory_configure_bank(machine, "bank2", 0, 0x2, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank2", 2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki")->base();
+ ROM = machine.region("oki")->base();
memory_configure_bank(machine, "bank3", 0, 4, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 4, &ROM[0x00000], 0x20000);
@@ -4514,18 +4514,18 @@ static DRIVER_INIT( hotdogst )
static DRIVER_INIT( mazinger )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine->region("sprites")->base();
- int len = machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ int len = machine.region("sprites")->bytes();
init_cave(machine);
memory_configure_bank(machine, "bank2", 0, 2, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank2", 2, 6, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki")->base();
+ ROM = machine.region("oki")->base();
memory_configure_bank(machine, "bank3", 0, 4, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 4, &ROM[0x00000], 0x20000);
@@ -4545,25 +4545,25 @@ static DRIVER_INIT( mazinger )
state->time_vblank_irq = 2100;
/* setup extra ROM */
- memory_set_bankptr(machine, "bank1",machine->region("user1")->base());
+ memory_set_bankptr(machine, "bank1",machine.region("user1")->base());
}
static DRIVER_INIT( metmqstr )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
init_cave(machine);
memory_configure_bank(machine, "bank1", 0, 0x2, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 2, 0xe, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki1")->base();
+ ROM = machine.region("oki1")->base();
memory_configure_bank(machine, "bank3", 0, 8, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 8, &ROM[0x00000], 0x20000);
- ROM = machine->region("oki2")->base();
+ ROM = machine.region("oki2")->base();
memory_configure_bank(machine, "bank5", 0, 8, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank6", 0, 8, &ROM[0x00000], 0x20000);
@@ -4576,11 +4576,11 @@ static DRIVER_INIT( metmqstr )
static DRIVER_INIT( pwrinst2j )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine->region("sprites")->base();
- int len = machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ int len = machine.region("sprites")->bytes();
int i, j;
init_cave(machine);
@@ -4616,7 +4616,7 @@ static DRIVER_INIT( pwrinst2 )
#if 1 //ROM PATCH
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0xd46c / 2] = 0xd482; // kurara dash fix 0xd400 -> 0xd482
}
#endif
@@ -4625,22 +4625,22 @@ static DRIVER_INIT( pwrinst2 )
static DRIVER_INIT( sailormn )
{
- cave_state *state = machine->driver_data<cave_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ cave_state *state = machine.driver_data<cave_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
UINT8 *buffer;
- UINT8 *src = machine->region("sprites")->base();
- int len = machine->region("sprites")->bytes();
+ UINT8 *src = machine.region("sprites")->base();
+ int len = machine.region("sprites")->bytes();
init_cave(machine);
memory_configure_bank(machine, "bank1", 0, 0x02, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 2, 0x1e, &ROM[0x10000], 0x4000);
- ROM = machine->region("oki1")->base();
+ ROM = machine.region("oki1")->base();
memory_configure_bank(machine, "bank3", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank4", 0, 0x10, &ROM[0x00000], 0x20000);
- ROM = machine->region("oki2")->base();
+ ROM = machine.region("oki2")->base();
memory_configure_bank(machine, "bank5", 0, 0x10, &ROM[0x00000], 0x20000);
memory_configure_bank(machine, "bank6", 0, 0x10, &ROM[0x00000], 0x20000);
@@ -4667,7 +4667,7 @@ static DRIVER_INIT( sailormn )
static DRIVER_INIT( tjumpman )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4681,7 +4681,7 @@ static DRIVER_INIT( tjumpman )
static DRIVER_INIT( uopoko )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
unpack_sprites(machine);
@@ -4691,7 +4691,7 @@ static DRIVER_INIT( uopoko )
static DRIVER_INIT( korokoro )
{
- cave_state *state = machine->driver_data<cave_state>();
+ cave_state *state = machine.driver_data<cave_state>();
init_cave(machine);
state->irq_level = 2;
diff --git a/src/mame/drivers/cb2001.c b/src/mame/drivers/cb2001.c
index 19ee10a73a0..6261419abde 100644
--- a/src/mame/drivers/cb2001.c
+++ b/src/mame/drivers/cb2001.c
@@ -329,9 +329,9 @@ static const rectangle visible3 = { 0*8, (14+48)*8-1, 17*8, (17+7)*8-1 };
static SCREEN_UPDATE(cb2001)
{
- cb2001_state *state = screen->machine->driver_data<cb2001_state>();
+ cb2001_state *state = screen->machine().driver_data<cb2001_state>();
int count,x,y;
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = 0x0000;
@@ -352,7 +352,7 @@ static SCREEN_UPDATE(cb2001)
tile += state->videobank*0x2000;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,colour,0,0,x*8,y*8);
count++;
}
@@ -413,7 +413,7 @@ static SCREEN_UPDATE(cb2001)
tile += 0x1000;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],tile,colour,0,0,x*8,y*8,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],tile,colour,0,0,x*8,y*8,0);
count++;
}
}
@@ -429,7 +429,7 @@ static SCREEN_UPDATE(cb2001)
is being executed incorrectly */
WRITE16_HANDLER( cb2001_vidctrl_w )
{
- cb2001_state *state = space->machine->driver_data<cb2001_state>();
+ cb2001_state *state = space->machine().driver_data<cb2001_state>();
if (mem_mask&0xff00) // video control?
{
printf("cb2001_vidctrl_w %04x %04x\n", data, mem_mask);
@@ -441,7 +441,7 @@ WRITE16_HANDLER( cb2001_vidctrl_w )
WRITE16_HANDLER( cb2001_vidctrl2_w )
{
- cb2001_state *state = space->machine->driver_data<cb2001_state>();
+ cb2001_state *state = space->machine().driver_data<cb2001_state>();
if (mem_mask&0xff00) // video control?
{
printf("cb2001_vidctrl2_w %04x %04x\n", data, mem_mask); // i think this switches to 'reels' mode
@@ -456,7 +456,7 @@ WRITE16_HANDLER( cb2001_vidctrl2_w )
static TILE_GET_INFO( get_cb2001_reel1_tile_info )
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
int code = state->vram_bg[(0x0000/2) + tile_index/2];
if (tile_index&1)
@@ -475,7 +475,7 @@ static TILE_GET_INFO( get_cb2001_reel1_tile_info )
static TILE_GET_INFO( get_cb2001_reel2_tile_info )
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
int code = state->vram_bg[(0x0200/2) + tile_index/2];
if (tile_index&1)
@@ -495,7 +495,7 @@ static TILE_GET_INFO( get_cb2001_reel2_tile_info )
static TILE_GET_INFO( get_cb2001_reel3_tile_info )
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
int code = state->vram_bg[(0x0400/2) + tile_index/2];
int colour = 0;//(cb2001_out_c&0x7) + 8;
@@ -514,7 +514,7 @@ static TILE_GET_INFO( get_cb2001_reel3_tile_info )
static VIDEO_START(cb2001)
{
- cb2001_state *state = machine->driver_data<cb2001_state>();
+ cb2001_state *state = machine.driver_data<cb2001_state>();
state->reel1_tilemap = tilemap_create(machine,get_cb2001_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_cb2001_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel3_tilemap = tilemap_create(machine,get_cb2001_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
@@ -526,7 +526,7 @@ static VIDEO_START(cb2001)
WRITE16_HANDLER( cb2001_bg_w )
{
- cb2001_state *state = space->machine->driver_data<cb2001_state>();
+ cb2001_state *state = space->machine().driver_data<cb2001_state>();
COMBINE_DATA(&state->vram_bg[offset]);
// also used for the reel tilemaps in a different mode
@@ -778,8 +778,8 @@ static PALETTE_INIT(cb2001)
{
int r,g,b;
- UINT8*proms = machine->region("proms")->base();
- int length = machine->region("proms")->bytes();
+ UINT8*proms = machine.region("proms")->base();
+ int length = machine.region("proms")->bytes();
UINT16 dat;
dat = (proms[0x000+i] << 8) | proms[0x200+i];
diff --git a/src/mame/drivers/cball.c b/src/mame/drivers/cball.c
index f473937a1c2..64504e30080 100644
--- a/src/mame/drivers/cball.c
+++ b/src/mame/drivers/cball.c
@@ -27,7 +27,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- cball_state *state = machine->driver_data<cball_state>();
+ cball_state *state = machine.driver_data<cball_state>();
UINT8 code = state->video_ram[tile_index];
SET_TILE_INFO(0, code, code >> 7, 0);
@@ -36,7 +36,7 @@ static TILE_GET_INFO( get_tile_info )
static WRITE8_HANDLER( cball_vram_w )
{
- cball_state *state = space->machine->driver_data<cball_state>();
+ cball_state *state = space->machine().driver_data<cball_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -45,20 +45,20 @@ static WRITE8_HANDLER( cball_vram_w )
static VIDEO_START( cball )
{
- cball_state *state = machine->driver_data<cball_state>();
+ cball_state *state = machine.driver_data<cball_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( cball )
{
- cball_state *state = screen->machine->driver_data<cball_state>();
+ cball_state *state = screen->machine().driver_data<cball_state>();
/* draw playfield */
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
/* draw sprite */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1],
state->video_ram[0x399] >> 4,
0,
0, 0,
@@ -70,7 +70,7 @@ static SCREEN_UPDATE( cball )
static TIMER_CALLBACK( interrupt_callback )
{
- cball_state *state = machine->driver_data<cball_state>();
+ cball_state *state = machine.driver_data<cball_state>();
int scanline = param;
generic_pulse_irq_line(state->maincpu, 0);
@@ -80,19 +80,19 @@ static TIMER_CALLBACK( interrupt_callback )
if (scanline >= 262)
scanline = 16;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback), scanline);
}
static MACHINE_START( cball )
{
- cball_state *state = machine->driver_data<cball_state>();
- state->maincpu = machine->device("maincpu");
+ cball_state *state = machine.driver_data<cball_state>();
+ state->maincpu = machine.device("maincpu");
}
static MACHINE_RESET( cball )
{
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(16), FUNC(interrupt_callback), 16);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(16), FUNC(interrupt_callback), 16);
}
@@ -109,7 +109,7 @@ static PALETTE_INIT( cball )
static READ8_HANDLER( cball_wram_r )
{
- cball_state *state = space->machine->driver_data<cball_state>();
+ cball_state *state = space->machine().driver_data<cball_state>();
return state->video_ram[0x380 + offset];
}
@@ -117,7 +117,7 @@ static READ8_HANDLER( cball_wram_r )
static WRITE8_HANDLER( cball_wram_w )
{
- cball_state *state = space->machine->driver_data<cball_state>();
+ cball_state *state = space->machine().driver_data<cball_state>();
state->video_ram[0x380 + offset] = data;
}
diff --git a/src/mame/drivers/cbasebal.c b/src/mame/drivers/cbasebal.c
index ed38648d1f5..16eb995f883 100644
--- a/src/mame/drivers/cbasebal.c
+++ b/src/mame/drivers/cbasebal.c
@@ -29,11 +29,11 @@
static WRITE8_HANDLER( cbasebal_bankswitch_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
/* bits 0-4 select ROM bank */
//logerror("%04x: bankswitch %02x\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
/* bit 5 used but unknown */
@@ -44,7 +44,7 @@ static WRITE8_HANDLER( cbasebal_bankswitch_w )
static READ8_HANDLER( bankedram_r )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
switch (state->rambank)
{
@@ -52,7 +52,7 @@ static READ8_HANDLER( bankedram_r )
return cbasebal_textram_r(space, offset); /* VRAM */
case 1:
if (offset < 0x800)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return 0;
break;
@@ -63,7 +63,7 @@ static READ8_HANDLER( bankedram_r )
static WRITE8_HANDLER( bankedram_w )
{
- cbasebal_state *state = space->machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = space->machine().driver_data<cbasebal_state>();
switch (state->rambank)
{
@@ -82,10 +82,10 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( cbasebal_coinctrl_w )
{
- coin_lockout_w(space->machine, 0, ~data & 0x04);
- coin_lockout_w(space->machine, 1, ~data & 0x08);
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_lockout_w(space->machine(), 0, ~data & 0x04);
+ coin_lockout_w(space->machine(), 1, ~data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
@@ -244,9 +244,9 @@ GFXDECODE_END
static MACHINE_START( cbasebal )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
- memory_configure_bank(machine, "bank1", 0, 32, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 32, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->rambank));
state->save_item(NAME(state->tilebank));
@@ -261,7 +261,7 @@ static MACHINE_START( cbasebal )
static MACHINE_RESET( cbasebal )
{
- cbasebal_state *state = machine->driver_data<cbasebal_state>();
+ cbasebal_state *state = machine.driver_data<cbasebal_state>();
state->rambank = 0;
state->tilebank = 0;
diff --git a/src/mame/drivers/cbuster.c b/src/mame/drivers/cbuster.c
index a9fede405df..67d2ad8d3e4 100644
--- a/src/mame/drivers/cbuster.c
+++ b/src/mame/drivers/cbuster.c
@@ -28,7 +28,7 @@
static WRITE16_HANDLER( twocrude_control_w )
{
- cbuster_state *state = space->machine->driver_data<cbuster_state>();
+ cbuster_state *state = space->machine().driver_data<cbuster_state>();
switch (offset << 1)
{
@@ -81,22 +81,22 @@ static WRITE16_HANDLER( twocrude_control_w )
static READ16_HANDLER( twocrude_control_r )
{
- cbuster_state *state = space->machine->driver_data<cbuster_state>();
+ cbuster_state *state = space->machine().driver_data<cbuster_state>();
switch (offset << 1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 2: /* Dip Switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 4: /* Protection */
logerror("%04x : protection control read at 30c000 %d\n", cpu_get_pc(space->cpu), offset);
return state->prot;
case 6: /* Credits, VBL in byte 7 */
- return input_port_read(space->machine, "COINS");
+ return input_port_read(space->machine(), "COINS");
}
return ~0;
@@ -266,7 +266,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cbuster_state *driver_state = device->machine->driver_data<cbuster_state>();
+ cbuster_state *driver_state = device->machine().driver_data<cbuster_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -306,12 +306,12 @@ static const deco16ic_interface twocrude_deco16ic_tilegen2_intf =
static MACHINE_START( cbuster )
{
- cbuster_state *state = machine->driver_data<cbuster_state>();
+ cbuster_state *state = machine.driver_data<cbuster_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
- state->deco_tilegen2 = machine->device("tilegen2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
+ state->deco_tilegen2 = machine.device("tilegen2");
state->save_item(NAME(state->prot));
state->save_item(NAME(state->pri));
@@ -319,7 +319,7 @@ static MACHINE_START( cbuster )
static MACHINE_RESET( cbuster )
{
- cbuster_state *state = machine->driver_data<cbuster_state>();
+ cbuster_state *state = machine.driver_data<cbuster_state>();
state->prot = 0;
state->pri = 0;
@@ -533,7 +533,7 @@ ROM_END
static DRIVER_INIT( twocrude )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
UINT8 *PTR;
int i, j;
@@ -550,8 +550,8 @@ static DRIVER_INIT( twocrude )
}
/* Rearrange the 'extra' sprite bank to be in the same format as main sprites */
- RAM = machine->region("gfx3")->base() + 0x080000;
- PTR = machine->region("gfx3")->base() + 0x140000;
+ RAM = machine.region("gfx3")->base() + 0x080000;
+ PTR = machine.region("gfx3")->base() + 0x140000;
for (i = 0; i < 0x20000; i += 64)
{
for (j = 0; j < 16; j += 1)
diff --git a/src/mame/drivers/ccastles.c b/src/mame/drivers/ccastles.c
index 8ba4bc0592f..fd79d138ba7 100644
--- a/src/mame/drivers/ccastles.c
+++ b/src/mame/drivers/ccastles.c
@@ -138,9 +138,9 @@
*
*************************************/
-INLINE void schedule_next_irq( running_machine *machine, int curscanline )
+INLINE void schedule_next_irq( running_machine &machine, int curscanline )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
/* scan for a rising edge on the IRQCK signal */
for (curscanline++; ; curscanline = (curscanline + 1) & 0xff)
@@ -148,13 +148,13 @@ INLINE void schedule_next_irq( running_machine *machine, int curscanline )
break;
/* next one at the start of this scanline */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(curscanline), curscanline);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(curscanline), curscanline);
}
static TIMER_CALLBACK( clock_irq )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
/* assert the IRQ if not already asserted */
if (!state->irq_state)
@@ -164,7 +164,7 @@ static TIMER_CALLBACK( clock_irq )
}
/* force an update now */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* find the next edge */
schedule_next_irq(machine, param);
@@ -173,8 +173,8 @@ static TIMER_CALLBACK( clock_irq )
static CUSTOM_INPUT( get_vblank )
{
- ccastles_state *state = field->port->machine->driver_data<ccastles_state>();
- int scanline = field->port->machine->primary_screen->vpos();
+ ccastles_state *state = field->port->machine().driver_data<ccastles_state>();
+ int scanline = field->port->machine().primary_screen->vpos();
return state->syncprom[scanline & 0xff] & 1;
}
@@ -188,11 +188,11 @@ static CUSTOM_INPUT( get_vblank )
static MACHINE_START( ccastles )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
rectangle visarea;
/* initialize globals */
- state->syncprom = machine->region("proms")->base() + 0x000;
+ state->syncprom = machine.region("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->vblank_start = 0; state->vblank_start < 256; state->vblank_start++)
@@ -214,13 +214,13 @@ static MACHINE_START( ccastles )
visarea.max_x = 255;
visarea.min_y = state->vblank_end;
visarea.max_y = state->vblank_start - 1;
- machine->primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
+ machine.primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
/* configure the ROM banking */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0xa000, 0x6000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0xa000, 0x6000);
/* create a timer for IRQs and set up the first callback */
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(clock_irq));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(clock_irq));
state->irq_state = 0;
schedule_next_irq(machine, 0);
@@ -232,7 +232,7 @@ static MACHINE_START( ccastles )
static MACHINE_RESET( ccastles )
{
- ccastles_state *state = machine->driver_data<ccastles_state>();
+ ccastles_state *state = machine.driver_data<ccastles_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->irq_state = 0;
}
@@ -247,7 +247,7 @@ static MACHINE_RESET( ccastles )
static WRITE8_HANDLER( irq_ack_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
if (state->irq_state)
{
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -258,19 +258,19 @@ static WRITE8_HANDLER( irq_ack_w )
static WRITE8_HANDLER( led_w )
{
- set_led_status(space->machine, offset, ~data & 1);
+ set_led_status(space->machine(), offset, ~data & 1);
}
static WRITE8_HANDLER( ccounter_w )
{
- coin_counter_w(space->machine, offset, data & 1);
+ coin_counter_w(space->machine(), offset, data & 1);
}
static WRITE8_HANDLER( bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
@@ -278,7 +278,7 @@ static READ8_HANDLER( leta_r )
{
static const char *const letanames[] = { "LETA0", "LETA1", "LETA2", "LETA3" };
- return input_port_read(space->machine, letanames[offset]);
+ return input_port_read(space->machine(), letanames[offset]);
}
@@ -291,7 +291,7 @@ static READ8_HANDLER( leta_r )
static WRITE8_HANDLER( nvram_recall_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->nvram_4b->recall(0);
state->nvram_4b->recall(1);
state->nvram_4b->recall(0);
@@ -303,7 +303,7 @@ static WRITE8_HANDLER( nvram_recall_w )
static WRITE8_HANDLER( nvram_store_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->nvram_store[offset] = data & 1;
state->nvram_4b->store(~state->nvram_store[0] & state->nvram_store[1]);
state->nvram_4a->store(~state->nvram_store[0] & state->nvram_store[1]);
@@ -312,14 +312,14 @@ static WRITE8_HANDLER( nvram_store_w )
static READ8_HANDLER( nvram_r )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
return (state->nvram_4b->read(*space, offset) & 0x0f) | (state->nvram_4a->read(*space, offset) << 4);
}
static WRITE8_HANDLER( nvram_w )
{
- ccastles_state *state = space->machine->driver_data<ccastles_state>();
+ ccastles_state *state = space->machine().driver_data<ccastles_state>();
state->nvram_4b->write(*space, offset, data);
state->nvram_4a->write(*space, offset, data >> 4);
}
diff --git a/src/mame/drivers/cchance.c b/src/mame/drivers/cchance.c
index df156b3f151..f3f684c0724 100644
--- a/src/mame/drivers/cchance.c
+++ b/src/mame/drivers/cchance.c
@@ -53,21 +53,21 @@ static WRITE8_HANDLER( output_0_w )
{
//---- --x- divider?
- coin_lockout_w(space->machine, 0, ~data & 1);
+ coin_lockout_w(space->machine(), 0, ~data & 1);
-// coin_counter_w(space->machine, 0, ~data & 1);
+// coin_counter_w(space->machine(), 0, ~data & 1);
}
static READ8_HANDLER( input_1_r )
{
- cchance_state *state = space->machine->driver_data<cchance_state>();
- return (state->hop_io) | (state->bell_io) | (input_port_read(space->machine, "SP") & 0xff);
+ cchance_state *state = space->machine().driver_data<cchance_state>();
+ return (state->hop_io) | (state->bell_io) | (input_port_read(space->machine(), "SP") & 0xff);
}
static WRITE8_HANDLER( output_1_w )
{
- cchance_state *state = space->machine->driver_data<cchance_state>();
+ cchance_state *state = space->machine().driver_data<cchance_state>();
state->hop_io = (data & 0x40)>>4;
state->bell_io = (data & 0x80)>>4;
@@ -195,7 +195,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( cchance )
{
- cchance_state *state = machine->driver_data<cchance_state>();
+ cchance_state *state = machine.driver_data<cchance_state>();
state->mcu = NULL;
state->save_item(NAME(state->screenflip));
@@ -205,7 +205,7 @@ static MACHINE_START( cchance )
static MACHINE_RESET( cchance )
{
- cchance_state *state = machine->driver_data<cchance_state>();
+ cchance_state *state = machine.driver_data<cchance_state>();
state->screenflip = 0;
state->mcu_type = -1;
diff --git a/src/mame/drivers/cchasm.c b/src/mame/drivers/cchasm.c
index c065d3281d9..7318b317746 100644
--- a/src/mame/drivers/cchasm.c
+++ b/src/mame/drivers/cchasm.c
@@ -69,7 +69,7 @@ ADDRESS_MAP_END
static WRITE_LINE_DEVICE_HANDLER( cchasm_6840_irq )
{
- cputag_set_input_line(device->machine, "maincpu", 4, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 4, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface cchasm_6840_intf =
diff --git a/src/mame/drivers/cclimber.c b/src/mame/drivers/cclimber.c
index 7be66555323..ddb46371f92 100644
--- a/src/mame/drivers/cclimber.c
+++ b/src/mame/drivers/cclimber.c
@@ -217,60 +217,60 @@ Dip location verified from manual for: cclimber, guzzler, swimmer
static WRITE8_HANDLER( swimmer_sh_soundlatch_w )
{
soundlatch_w(space,offset,data);
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( yamato_p0_w )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->yamato_p0 = data;
}
static WRITE8_HANDLER( yamato_p1_w )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->yamato_p1 = data;
}
static READ8_HANDLER( yamato_p0_r )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
return state->yamato_p0;
}
static READ8_HANDLER( yamato_p1_r )
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
return state->yamato_p1;
}
static WRITE8_HANDLER(toprollr_rombank_w)
{
- cclimber_state *state = space->machine->driver_data<cclimber_state>();
+ cclimber_state *state = space->machine().driver_data<cclimber_state>();
state->toprollr_rombank &= ~(1 << offset);
state->toprollr_rombank |= (data & 1) << offset;
if (state->toprollr_rombank < 3)
- memory_set_bank(space->machine, "bank1", state->toprollr_rombank);
+ memory_set_bank(space->machine(), "bank1", state->toprollr_rombank);
}
static TIMER_CALLBACK( disable_interrupts )
{
- cpu_interrupt_enable(machine->device("maincpu"), 0);
+ cpu_interrupt_enable(machine.device("maincpu"), 0);
}
static MACHINE_RESET( cclimber )
{
- cclimber_state *state = machine->driver_data<cclimber_state>();
+ cclimber_state *state = machine.driver_data<cclimber_state>();
/* Disable interrupts, River Patrol / Silver Land needs this */
/* we must do this on a timer in order to have it take effect */
/* otherwise, the reset process will override our changes */
- machine->scheduler().synchronize(FUNC(disable_interrupts));
+ machine.scheduler().synchronize(FUNC(disable_interrupts));
state->toprollr_rombank = 0;
}
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index 0e097900e95..af92b1ca24e 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -46,7 +46,7 @@
#define MGNUMBER_USE_JOY 1
-static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8 dra);
+static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra);
static WRITE32_HANDLER( aga_overlay_w )
{
@@ -55,7 +55,7 @@ static WRITE32_HANDLER( aga_overlay_w )
data = (data >> 16) & 1;
/* switch banks as appropriate */
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
@@ -85,12 +85,12 @@ static WRITE32_HANDLER( aga_overlay_w )
static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
{
/* bit 1 = cd audio mute */
- device->machine->device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
+ device->machine().device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
/* bit 2 = Power Led on Amiga */
- set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
+ set_led_status(device->machine(), 0, (data & 2) ? 0 : 1);
- handle_cd32_joystick_cia(device->machine, data, mos6526_r(device, 2));
+ handle_cd32_joystick_cia(device->machine(), data, mos6526_r(device, 2));
}
/*************************************
@@ -111,14 +111,14 @@ static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
static READ8_DEVICE_HANDLER( cd32_cia_0_portb_r )
{
/* parallel port */
- logerror("%s:CIA0_portb_r\n", device->machine->describe_context());
+ logerror("%s:CIA0_portb_r\n", device->machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( cd32_cia_0_portb_w )
{
/* parallel port */
- logerror("%s:CIA0_portb_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:CIA0_portb_w(%02x)\n", device->machine().describe_context(), data);
}
static ADDRESS_MAP_START( cd32_map, AS_PROGRAM, 32 )
@@ -141,9 +141,9 @@ ADDRESS_MAP_END
*
*************************************/
-static void cd32_potgo_w(running_machine *machine, UINT16 data)
+static void cd32_potgo_w(running_machine &machine, UINT16 data)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
int i;
if (state->input_hack != NULL)
@@ -171,9 +171,9 @@ static void cd32_potgo_w(running_machine *machine, UINT16 data)
}
}
-static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8 dra)
+static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
int i;
for (i = 0; i < 2; i++)
@@ -198,9 +198,9 @@ static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8
}
}
-static UINT16 handle_joystick_potgor(running_machine *machine, UINT16 potgor)
+static UINT16 handle_joystick_potgor(running_machine &machine, UINT16 potgor)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
static const char *const player_portname[] = { "P2", "P1" };
int i;
@@ -230,8 +230,8 @@ static UINT16 handle_joystick_potgor(running_machine *machine, UINT16 potgor)
static CUSTOM_INPUT(cubo_input)
{
- cd32_state *state = field->port->machine->driver_data<cd32_state>();
- return handle_joystick_potgor(field->port->machine, state->potgo_value) >> 10;
+ cd32_state *state = field->port->machine().driver_data<cd32_state>();
+ return handle_joystick_potgor(field->port->machine(), state->potgo_value) >> 10;
}
static INPUT_PORTS_START( cd32 )
@@ -825,7 +825,7 @@ ROM_END
static DRIVER_INIT( cd32 )
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
static const amiga_machine_interface cd32_intf =
{
AGA_CHIP_RAM_MASK,
@@ -841,7 +841,7 @@ static DRIVER_INIT( cd32 )
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
/* input hack */
state->input_hack = NULL;
@@ -1221,35 +1221,35 @@ ROM_END
*
*************************************/
-static void cndypuzl_input_hack(running_machine *machine)
+static void cndypuzl_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//(*state->chip_ram_w)(0x051c02, 0x0000);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
(*state->chip_ram_w)(state, r_A5 - 0x7ebe, 0x0000);
}
}
static DRIVER_INIT(cndypuzl)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = cndypuzl_input_hack;
}
-static void haremchl_input_hack(running_machine *machine)
+static void haremchl_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x002907, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7f00 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7f00 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x1f, 0x00);
}
@@ -1257,20 +1257,20 @@ static void haremchl_input_hack(running_machine *machine)
static DRIVER_INIT(haremchl)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = haremchl_input_hack;
}
-static void lsrquiz_input_hack(running_machine *machine)
+static void lsrquiz_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x001e1b, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fe0 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fe0 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x13, 0x00);
}
@@ -1278,21 +1278,21 @@ static void lsrquiz_input_hack(running_machine *machine)
static DRIVER_INIT(lsrquiz)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lsrquiz_input_hack;
}
/* The hack isn't working if you exit the test mode with P1 button 2 ! */
-static void lsrquiz2_input_hack(running_machine *machine)
+static void lsrquiz2_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x046107, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fdc + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fdc + 2));
amiga_chip_ram_w8(state, r_A2 + 0x17, 0x00);
}
@@ -1300,20 +1300,20 @@ static void lsrquiz2_input_hack(running_machine *machine)
static DRIVER_INIT(lsrquiz2)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lsrquiz2_input_hack;
}
-static void lasstixx_input_hack(running_machine *machine)
+static void lasstixx_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x00281c, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fa2 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fa2 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x24, 0x00);
}
@@ -1321,47 +1321,47 @@ static void lasstixx_input_hack(running_machine *machine)
static DRIVER_INIT(lasstixx)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lasstixx_input_hack;
}
-static void mgnumber_input_hack(running_machine *machine)
+static void mgnumber_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//(*state->chip_ram_w)(0x04bfa0, 0x0000);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
(*state->chip_ram_w)(state, r_A5 - 0x7ed8, 0x0000);
}
}
static DRIVER_INIT(mgnumber)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = mgnumber_input_hack;
}
-static void mgprem11_input_hack(running_machine *machine)
+static void mgprem11_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x044f7e, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
amiga_chip_ram_w8(state, r_A5 - 0x7eca, 0x00);
}
}
static DRIVER_INIT(mgprem11)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = mgprem11_input_hack;
}
diff --git a/src/mame/drivers/cdi.c b/src/mame/drivers/cdi.c
index 192ecf72a60..82d80d93c72 100644
--- a/src/mame/drivers/cdi.c
+++ b/src/mame/drivers/cdi.c
@@ -35,7 +35,7 @@ TODO:
#include "imagedev/chd_cd.h"
#if ENABLE_VERBOSE_LOG
-INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
+INLINE void verboselog(running_machine &machine, int n_level, const char *s_fmt, ...)
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -44,7 +44,7 @@ INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%08x: %s", cpu_get_pc(machine->device("maincpu")), buf );
+ logerror( "%08x: %s", cpu_get_pc(machine.device("maincpu")), buf );
}
}
#else
@@ -81,49 +81,49 @@ ADDRESS_MAP_END
static INPUT_CHANGED( mcu_input )
{
- cdi_state *state = field->port->machine->driver_data<cdi_state>();
+ cdi_state *state = field->port->machine().driver_data<cdi_state>();
scc68070_regs_t *scc68070 = &state->scc68070_regs;
bool send = false;
switch((FPTR)param)
{
case 0x39:
- if(input_port_read(field->port->machine, "INPUT1") & 0x01) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x01) send = true;
break;
case 0x37:
- if(input_port_read(field->port->machine, "INPUT1") & 0x02) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x02) send = true;
break;
case 0x31:
- if(input_port_read(field->port->machine, "INPUT1") & 0x04) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x04) send = true;
break;
case 0x32:
- if(input_port_read(field->port->machine, "INPUT1") & 0x08) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x08) send = true;
break;
case 0x33:
- if(input_port_read(field->port->machine, "INPUT1") & 0x10) send = true;
+ if(input_port_read(field->port->machine(), "INPUT1") & 0x10) send = true;
break;
case 0x30:
- if(input_port_read(field->port->machine, "INPUT2") & 0x01) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x01) send = true;
break;
case 0x38:
- if(input_port_read(field->port->machine, "INPUT2") & 0x02) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x02) send = true;
break;
case 0x34:
- if(input_port_read(field->port->machine, "INPUT2") & 0x04) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x04) send = true;
break;
case 0x35:
- if(input_port_read(field->port->machine, "INPUT2") & 0x08) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x08) send = true;
break;
case 0x36:
- if(input_port_read(field->port->machine, "INPUT2") & 0x10) send = true;
+ if(input_port_read(field->port->machine(), "INPUT2") & 0x10) send = true;
break;
}
if(send)
{
UINT8 data = (UINT8)((FPTR)param & 0x000000ff);
- scc68070_quizard_rx(field->port->machine, scc68070, data);
+ scc68070_quizard_rx(field->port->machine(), scc68070, data);
}
}
@@ -192,25 +192,25 @@ INPUT_PORTS_END
static MACHINE_START( cdi )
{
- cdi_state *state = machine->driver_data<cdi_state>();
+ cdi_state *state = machine.driver_data<cdi_state>();
scc68070_register_globals(machine, &state->scc68070_regs);
}
static MACHINE_RESET( cdi )
{
- cdi_state *state = machine->driver_data<cdi_state>();
- UINT16 *src = (UINT16*)machine->region("maincpu")->base();
+ cdi_state *state = machine.driver_data<cdi_state>();
+ UINT16 *src = (UINT16*)machine.region("maincpu")->base();
UINT16 *dst = state->planea;
- //device_t *cdrom_dev = machine->device("cdrom");
+ //device_t *cdrom_dev = machine.device("cdrom");
memcpy(dst, src, 0x8);
scc68070_init(machine, &state->scc68070_regs);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
- state->dmadac[0] = machine->device<dmadac_sound_device>("dac1");
- state->dmadac[1] = machine->device<dmadac_sound_device>("dac2");
+ state->dmadac[0] = machine.device<dmadac_sound_device>("dac1");
+ state->dmadac[1] = machine.device<dmadac_sound_device>("dac2");
}
static MACHINE_RESET( quizrd12 )
diff --git a/src/mame/drivers/centiped.c b/src/mame/drivers/centiped.c
index 3f179a9120c..f23994c57d3 100644
--- a/src/mame/drivers/centiped.c
+++ b/src/mame/drivers/centiped.c
@@ -446,16 +446,16 @@ static TIMER_DEVICE_CALLBACK( generate_interrupt )
/* IRQ is clocked on the rising edge of 16V, equal to the previous 32V */
if (scanline & 16)
- cputag_set_input_line(timer.machine, "maincpu", 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", 0, ((scanline - 1) & 32) ? ASSERT_LINE : CLEAR_LINE);
/* do a partial update now to handle sprite multiplexing (Maze Invaders) */
- timer.machine->primary_screen->update_partial(scanline);
+ timer.machine().primary_screen->update_partial(scanline);
}
static MACHINE_START( centiped )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->save_item(NAME(state->oldpos));
state->save_item(NAME(state->sign));
@@ -465,7 +465,7 @@ static MACHINE_START( centiped )
static MACHINE_RESET( centiped )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->dsw_select = 0;
@@ -475,7 +475,7 @@ static MACHINE_RESET( centiped )
static MACHINE_RESET( magworm )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
MACHINE_RESET_CALL(centiped);
@@ -486,7 +486,7 @@ static MACHINE_RESET( magworm )
static WRITE8_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -515,9 +515,9 @@ static WRITE8_HANDLER( irq_ack_w )
* to prevent the counter from wrapping around between reads.
*/
-INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
+INLINE int read_trackball(running_machine &machine, int idx, int switch_port)
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
UINT8 newpos;
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
static const char *const tracknames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
@@ -545,25 +545,25 @@ INLINE int read_trackball(running_machine *machine, int idx, int switch_port)
static READ8_HANDLER( centiped_IN0_r )
{
- return read_trackball(space->machine, 0, 0);
+ return read_trackball(space->machine(), 0, 0);
}
static READ8_HANDLER( centiped_IN2_r )
{
- return read_trackball(space->machine, 1, 2);
+ return read_trackball(space->machine(), 1, 2);
}
static READ8_HANDLER( milliped_IN1_r )
{
- return read_trackball(space->machine, 1, 1);
+ return read_trackball(space->machine(), 1, 1);
}
static READ8_HANDLER( milliped_IN2_r )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
- UINT8 data = input_port_read(space->machine, "IN2");
+ centiped_state *state = space->machine().driver_data<centiped_state>();
+ UINT8 data = input_port_read(space->machine(), "IN2");
/* MSH - 15 Feb, 2007
* The P2 X Joystick inputs are not properly handled in
@@ -574,7 +574,7 @@ static READ8_HANDLER( milliped_IN2_r )
*/
if (0 != state->control_select) {
/* Bottom 4 bits is our joystick inputs */
- UINT8 joy2data = input_port_read(space->machine, "IN3") & 0x0f;
+ UINT8 joy2data = input_port_read(space->machine(), "IN3") & 0x0f;
data = data & 0xf0; /* Keep the top 4 bits */
data |= (joy2data & 0x0a) >> 1; /* flip left and up */
data |= (joy2data & 0x05) << 1; /* flip right and down */
@@ -584,7 +584,7 @@ static READ8_HANDLER( milliped_IN2_r )
static WRITE8_HANDLER( input_select_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->dsw_select = (~data >> 7) & 1;
}
@@ -592,7 +592,7 @@ static WRITE8_HANDLER( input_select_w )
/* used P2 controls if 1, P1 controls if 0 */
static WRITE8_HANDLER( control_select_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->control_select = (data >> 7) & 1;
}
@@ -600,16 +600,16 @@ static WRITE8_HANDLER( control_select_w )
static READ8_HANDLER( mazeinv_input_r )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
static const char *const sticknames[] = { "STICK0", "STICK1", "STICK2", "STICK3" };
- return input_port_read(space->machine, sticknames[state->control_select]);
+ return input_port_read(space->machine(), sticknames[state->control_select]);
}
static WRITE8_HANDLER( mazeinv_input_select_w )
{
- centiped_state *state = space->machine->driver_data<centiped_state>();
+ centiped_state *state = space->machine().driver_data<centiped_state>();
state->control_select = offset & 3;
}
@@ -636,25 +636,25 @@ static READ8_HANDLER( bullsdrt_data_port_r )
static WRITE8_HANDLER( led_w )
{
- set_led_status(space->machine, offset, ~data & 0x80);
+ set_led_status(space->machine(), offset, ~data & 0x80);
}
static READ8_DEVICE_HANDLER( caterplr_rand_r )
{
- return device->machine->rand() % 0xff;
+ return device->machine().rand() % 0xff;
}
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static WRITE8_HANDLER( bullsdrt_coin_count_w )
{
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
}
@@ -1985,8 +1985,8 @@ ROM_END
static DRIVER_INIT( caterplr )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- device_t *device = machine->device("pokey");
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ device_t *device = machine.device("pokey");
space->install_legacy_readwrite_handler(*device, 0x1000, 0x100f, FUNC(caterplr_AY8910_r), FUNC(caterplr_AY8910_w));
space->install_legacy_read_handler(*device, 0x1780, 0x1780, FUNC(caterplr_rand_r));
}
@@ -1994,8 +1994,8 @@ static DRIVER_INIT( caterplr )
static DRIVER_INIT( magworm )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- device_t *device = machine->device("pokey");
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ device_t *device = machine.device("pokey");
space->install_legacy_write_handler(*device, 0x1001, 0x1001, FUNC(ay8910_address_w));
space->install_legacy_readwrite_handler(*device, 0x1003, 0x1003, FUNC(ay8910_r), FUNC(ay8910_data_w));
}
@@ -2003,7 +2003,7 @@ static DRIVER_INIT( magworm )
static DRIVER_INIT( bullsdrt )
{
- centiped_state *state = machine->driver_data<centiped_state>();
+ centiped_state *state = machine.driver_data<centiped_state>();
state->dsw_select = 0;
}
diff --git a/src/mame/drivers/chaknpop.c b/src/mame/drivers/chaknpop.c
index 64d541e1e2b..d03030aa1bd 100644
--- a/src/mame/drivers/chaknpop.c
+++ b/src/mame/drivers/chaknpop.c
@@ -18,12 +18,12 @@
static WRITE8_DEVICE_HANDLER ( unknown_port_1_w )
{
- //logerror("%s: write to unknow port 1: 0x%02x\n", device->machine->describe_context(), data);
+ //logerror("%s: write to unknow port 1: 0x%02x\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER ( unknown_port_2_w )
{
- //logerror("%s: write to unknow port 2: 0x%02x\n", device->machine->describe_context(), data);
+ //logerror("%s: write to unknow port 2: 0x%02x\n", device->machine().describe_context(), data);
}
static WRITE8_HANDLER ( coinlock_w )
@@ -243,8 +243,8 @@ GFXDECODE_END
static MACHINE_START( chaknpop )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
@@ -259,7 +259,7 @@ static MACHINE_START( chaknpop )
static MACHINE_RESET( chaknpop )
{
- chaknpop_state *state = machine->driver_data<chaknpop_state>();
+ chaknpop_state *state = machine.driver_data<chaknpop_state>();
state->gfxmode = 0;
state->flip_x = 0;
diff --git a/src/mame/drivers/cham24.c b/src/mame/drivers/cham24.c
index 19a85a8aa0f..f0b7a1ee7c2 100644
--- a/src/mame/drivers/cham24.c
+++ b/src/mame/drivers/cham24.c
@@ -77,9 +77,9 @@ public:
-static void cham24_set_mirroring( running_machine *machine, int mirroring )
+static void cham24_set_mirroring( running_machine &machine, int mirroring )
{
- cham24_state *state = machine->driver_data<cham24_state>();
+ cham24_state *state = machine.driver_data<cham24_state>();
switch(mirroring)
{
case PPU_MIRROR_LOW:
@@ -112,14 +112,14 @@ static void cham24_set_mirroring( running_machine *machine, int mirroring )
static WRITE8_HANDLER( nt_w )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
int page = ((offset & 0xc00) >> 10);
state->nt_page[page][offset & 0x3ff] = data;
}
static READ8_HANDLER( nt_r )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
int page = ((offset & 0xc00) >> 10);
return state->nt_page[page][offset & 0x3ff];
@@ -128,7 +128,7 @@ static READ8_HANDLER( nt_r )
static WRITE8_HANDLER( sprite_dma_w )
{
int source = (data & 7);
- ppu2c0x_spriteram_dma(space, space->machine->device("ppu"), source);
+ ppu2c0x_spriteram_dma(space, space->machine().device("ppu"), source);
}
static READ8_DEVICE_HANDLER( psg_4015_r )
@@ -149,13 +149,13 @@ static WRITE8_DEVICE_HANDLER( psg_4017_w )
static READ8_HANDLER( cham24_IN0_r )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
return ((state->in_0 >> state->in_0_shift++) & 0x01) | 0x40;
}
static WRITE8_HANDLER( cham24_IN0_w )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
if (data & 0xfe)
{
//logerror("Unhandled cham24_IN0_w write: data = %02X\n", data);
@@ -169,14 +169,14 @@ static WRITE8_HANDLER( cham24_IN0_w )
state->in_0_shift = 0;
state->in_1_shift = 0;
- state->in_0 = input_port_read(space->machine, "P1");
- state->in_1 = input_port_read(space->machine, "P2");
+ state->in_0 = input_port_read(space->machine(), "P1");
+ state->in_1 = input_port_read(space->machine(), "P2");
}
static READ8_HANDLER( cham24_IN1_r )
{
- cham24_state *state = space->machine->driver_data<cham24_state>();
+ cham24_state *state = space->machine().driver_data<cham24_state>();
return ((state->in_1 >> state->in_1_shift++) & 0x01) | 0x40;
}
@@ -188,14 +188,14 @@ static WRITE8_HANDLER( cham24_mapper_w )
UINT32 prg_bank_page_size = (offset >> 12) & 0x01;
UINT32 gfx_mirroring = (offset >> 13) & 0x01;
- UINT8* dst = space->machine->region("maincpu")->base();
- UINT8* src = space->machine->region("user1")->base();
+ UINT8* dst = space->machine().region("maincpu")->base();
+ UINT8* src = space->machine().region("user1")->base();
// switch PPU VROM bank
- memory_set_bankptr(space->machine, "bank1", space->machine->region("gfx1")->base() + (0x2000 * gfx_bank));
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("gfx1")->base() + (0x2000 * gfx_bank));
// set gfx mirroring
- cham24_set_mirroring(space->machine, gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ cham24_set_mirroring(space->machine(), gfx_mirroring != 0 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
// switch PRG bank
if (prg_bank_page_size == 0)
@@ -269,7 +269,7 @@ static PALETTE_INIT( cham24 )
static void ppu_irq( device_t *device, int *ppu_regs )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
/* our ppu interface */
@@ -288,24 +288,24 @@ static VIDEO_START( cham24 )
static SCREEN_UPDATE( cham24 )
{
/* render the ppu */
- ppu2c0x_render(screen->machine->device("ppu"), bitmap, 0, 0, 0, 0);
+ ppu2c0x_render(screen->machine().device("ppu"), bitmap, 0, 0, 0, 0);
return 0;
}
static MACHINE_START( cham24 )
{
- cham24_state *state = machine->driver_data<cham24_state>();
+ cham24_state *state = machine.driver_data<cham24_state>();
/* switch PRG rom */
- UINT8* dst = machine->region("maincpu")->base();
- UINT8* src = machine->region("user1")->base();
+ UINT8* dst = machine.region("maincpu")->base();
+ UINT8* src = machine.region("user1")->base();
memcpy(&dst[0x8000], &src[0x0f8000], 0x4000);
memcpy(&dst[0xc000], &src[0x0f8000], 0x4000);
/* uses 8K swapping, all ROM!*/
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("gfx1")->base());
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("gfx1")->base());
/* need nametable ram, though. I doubt this uses more than 2k, but it starts up configured for 4 */
state->nt_ram = auto_alloc_array(machine, UINT8, 0x1000);
@@ -315,7 +315,7 @@ static MACHINE_START( cham24 )
state->nt_page[3] = state->nt_ram + 0xc00;
/* and read/write handlers */
- machine->device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nt_r), FUNC(nt_w));
+ machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nt_r), FUNC(nt_w));
}
static DRIVER_INIT( cham24 )
diff --git a/src/mame/drivers/champbas.c b/src/mame/drivers/champbas.c
index d6ce2f98d73..6b8154834db 100644
--- a/src/mame/drivers/champbas.c
+++ b/src/mame/drivers/champbas.c
@@ -97,11 +97,11 @@ TODO:
static SCREEN_EOF( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
state->watchdog_count++;
if (state->watchdog_count == 0x10)
- machine->schedule_soft_reset();
+ machine.schedule_soft_reset();
}
@@ -113,20 +113,20 @@ static SCREEN_EOF( champbas )
static WRITE8_HANDLER( champbas_watchdog_reset_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
state->watchdog_count = 0;
}
static CUSTOM_INPUT( champbas_watchdog_bit2 )
{
- champbas_state *state = field->port->machine->driver_data<champbas_state>();
+ champbas_state *state = field->port->machine().driver_data<champbas_state>();
return BIT(state->watchdog_count, 2);
}
static WRITE8_HANDLER( irq_enable_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
int bit = data & 1;
cpu_interrupt_enable(state->maincpu, bit);
@@ -136,7 +136,7 @@ static WRITE8_HANDLER( irq_enable_w )
static TIMER_CALLBACK( exctsccr_fm_callback )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -161,7 +161,7 @@ static WRITE8_HANDLER( champbas_mcu_switch_w )
static WRITE8_HANDLER( champbas_mcu_halt_w )
{
- champbas_state *state = space->machine->driver_data<champbas_state>();
+ champbas_state *state = space->machine().driver_data<champbas_state>();
// MCU not present/not used in champbas
if (state->mcu == NULL)
@@ -566,10 +566,10 @@ GFXDECODE_END
static MACHINE_START( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
- state->maincpu = machine->device("maincpu");
- state->mcu = machine->device(CPUTAG_MCU);
+ state->maincpu = machine.device("maincpu");
+ state->mcu = machine.device(CPUTAG_MCU);
state->save_item(NAME(state->watchdog_count));
state->save_item(NAME(state->palette_bank));
@@ -578,11 +578,11 @@ static MACHINE_START( champbas )
static MACHINE_START( exctsccr )
{
- champbas_state *state = machine->driver_data<champbas_state>();
- state->audiocpu = machine->device("audiocpu");
+ champbas_state *state = machine.driver_data<champbas_state>();
+ state->audiocpu = machine.device("audiocpu");
// FIXME
- machine->scheduler().timer_pulse(attotime::from_hz(75), FUNC(exctsccr_fm_callback)); /* updates fm */
+ machine.scheduler().timer_pulse(attotime::from_hz(75), FUNC(exctsccr_fm_callback)); /* updates fm */
MACHINE_START_CALL(champbas);
}
@@ -590,7 +590,7 @@ static MACHINE_START( exctsccr )
static MACHINE_RESET( champbas )
{
- champbas_state *state = machine->driver_data<champbas_state>();
+ champbas_state *state = machine.driver_data<champbas_state>();
state->palette_bank = 0;
state->gfx_bank = 0; // talbot has only 1 bank
@@ -1173,9 +1173,9 @@ ROM_END
static DRIVER_INIT(champbas)
{
// chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
- UINT8 *rom1 = machine->region("gfx1")->base();
- UINT8 *rom2 = machine->region("gfx2")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom1 = machine.region("gfx1")->base();
+ UINT8 *rom2 = machine.region("gfx2")->base();
+ int len = machine.region("gfx1")->bytes();
int i;
for (i = 0; i < len/2; ++i)
@@ -1190,8 +1190,8 @@ static DRIVER_INIT(champbas)
static DRIVER_INIT( exctsccr )
{
// chars and sprites are mixed in the same ROMs, so rearrange them for easier decoding
- UINT8 *rom1 = machine->region("gfx1")->base();
- UINT8 *rom2 = machine->region("gfx2")->base();
+ UINT8 *rom1 = machine.region("gfx1")->base();
+ UINT8 *rom2 = machine.region("gfx2")->base();
int i;
// planes 0,1
diff --git a/src/mame/drivers/champbwl.c b/src/mame/drivers/champbwl.c
index 7b762bf06d2..c94e100cd02 100644
--- a/src/mame/drivers/champbwl.c
+++ b/src/mame/drivers/champbwl.c
@@ -171,10 +171,10 @@ public:
static READ8_HANDLER( trackball_r )
{
- champbwl_state *state = space->machine->driver_data<champbwl_state>();
+ champbwl_state *state = space->machine().driver_data<champbwl_state>();
UINT8 ret;
- UINT8 port4 = input_port_read(space->machine, "FAKEX");
- UINT8 port5 = input_port_read(space->machine, "FAKEY");
+ UINT8 port4 = input_port_read(space->machine(), "FAKEX");
+ UINT8 port5 = input_port_read(space->machine(), "FAKEY");
ret = (((port4 - state->last_trackball_val[0]) & 0x0f)<<4) | ((port5 - state->last_trackball_val[1]) & 0x0f);
@@ -186,18 +186,18 @@ static READ8_HANDLER( trackball_r )
static WRITE8_HANDLER( champbwl_misc_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
- coin_lockout_w(space->machine, 0, ~data & 8);
- coin_lockout_w(space->machine, 1, ~data & 4);
+ coin_lockout_w(space->machine(), 0, ~data & 8);
+ coin_lockout_w(space->machine(), 1, ~data & 4);
- memory_set_bank(space->machine, "bank1", (data & 0x30) >> 4);
+ memory_set_bank(space->machine(), "bank1", (data & 0x30) >> 4);
}
static WRITE8_HANDLER( champbwl_objctrl_w )
{
- champbwl_state *state = space->machine->driver_data<champbwl_state>();
+ champbwl_state *state = space->machine().driver_data<champbwl_state>();
if(offset != 0)
data ^= 0xff;
@@ -345,8 +345,8 @@ static const x1_010_interface champbwl_sound_intf =
static MACHINE_START( champbwl )
{
- champbwl_state *state = machine->driver_data<champbwl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ champbwl_state *state = machine.driver_data<champbwl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
state->mcu = NULL;
@@ -358,7 +358,7 @@ static MACHINE_START( champbwl )
static MACHINE_RESET( champbwl )
{
- champbwl_state *state = machine->driver_data<champbwl_state>();
+ champbwl_state *state = machine.driver_data<champbwl_state>();
state->screenflip = 0;
state->mcu_type = -1;
diff --git a/src/mame/drivers/chanbara.c b/src/mame/drivers/chanbara.c
index 62464ddeaa6..0fd90deec8c 100644
--- a/src/mame/drivers/chanbara.c
+++ b/src/mame/drivers/chanbara.c
@@ -77,11 +77,11 @@ static PALETTE_INIT( chanbara )
{
int i, red, green, blue;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
red = color_prom[i];
- green = color_prom[machine->total_colors() + i];
- blue = color_prom[2 * machine->total_colors() + i];
+ green = color_prom[machine.total_colors() + i];
+ blue = color_prom[2 * machine.total_colors() + i];
palette_set_color_rgb(machine, i, pal4bit(red << 1), pal4bit(green << 1), pal4bit(blue << 1));
}
@@ -89,7 +89,7 @@ static PALETTE_INIT( chanbara )
static WRITE8_HANDLER( chanbara_videoram_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -97,7 +97,7 @@ static WRITE8_HANDLER( chanbara_videoram_w )
static WRITE8_HANDLER( chanbara_colorram_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -105,7 +105,7 @@ static WRITE8_HANDLER( chanbara_colorram_w )
static WRITE8_HANDLER( chanbara_videoram2_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
@@ -113,7 +113,7 @@ static WRITE8_HANDLER( chanbara_videoram2_w )
static WRITE8_HANDLER( chanbara_colorram2_w )
{
- chanbara_state *state = space->machine->driver_data<chanbara_state>();
+ chanbara_state *state = space->machine().driver_data<chanbara_state>();
state->colorram2[offset] = data;
tilemap_mark_tile_dirty(state->bg2_tilemap, offset);
@@ -122,7 +122,7 @@ static WRITE8_HANDLER( chanbara_colorram2_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
int code = state->videoram[tile_index] + ((state->colorram[tile_index] & 1) << 8);
int color = (state->colorram[tile_index] >> 1) & 0x1f;
@@ -131,7 +131,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_bg2_tile_info )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
int code = state->videoram2[tile_index];
int color = (state->colorram2[tile_index] >> 1) & 0x1f;
@@ -140,15 +140,15 @@ static TILE_GET_INFO( get_bg2_tile_info )
static VIDEO_START(chanbara )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows,8, 8, 32, 32);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows,16, 16, 16, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
int offs;
for (offs = 0; offs < 0x80; offs += 4)
@@ -173,18 +173,18 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
{
if (!flipy)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy-16, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code+1, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy-16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code+1, color, flipx, flipy, sx, sy, 0);
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code+1, color, flipx, flipy, sx, sy-16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code+1, color, flipx, flipy, sx, sy-16, 0);
}
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
}
}
}
@@ -192,11 +192,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( chanbara )
{
- chanbara_state *state = screen->machine->driver_data<chanbara_state>();
+ chanbara_state *state = screen->machine().driver_data<chanbara_state>();
tilemap_set_scrolly(state->bg2_tilemap, 0, state->scroll | (state->scrollhi << 8));
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -325,7 +325,7 @@ GFXDECODE_END
static WRITE8_DEVICE_HANDLER( chanbara_ay_out_0_w )
{
- chanbara_state *state = device->machine->driver_data<chanbara_state>();
+ chanbara_state *state = device->machine().driver_data<chanbara_state>();
//printf("chanbara_ay_out_0_w %02x\n",data);
state->scroll = data;
@@ -333,19 +333,19 @@ static WRITE8_DEVICE_HANDLER( chanbara_ay_out_0_w )
static WRITE8_DEVICE_HANDLER( chanbara_ay_out_1_w )
{
- chanbara_state *state = device->machine->driver_data<chanbara_state>();
+ chanbara_state *state = device->machine().driver_data<chanbara_state>();
//printf("chanbara_ay_out_1_w %02x\n",data);
state->scrollhi = data & 0x03;
- memory_set_bank(device->machine, "bank1", (data & 0x04) >> 2);
+ memory_set_bank(device->machine(), "bank1", (data & 0x04) >> 2);
//if (data & 0xf8) printf("chanbara_ay_out_1_w unused bits set %02x\n", data & 0xf8);
}
static void sound_irq( device_t *device, int linestate )
{
- chanbara_state *state = device->machine->driver_data<chanbara_state>();
+ chanbara_state *state = device->machine().driver_data<chanbara_state>();
device_set_input_line(state->maincpu, 0, linestate);
}
@@ -366,9 +366,9 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( chanbara )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->scroll));
state->save_item(NAME(state->scrollhi));
@@ -376,7 +376,7 @@ static MACHINE_START( chanbara )
static MACHINE_RESET( chanbara )
{
- chanbara_state *state = machine->driver_data<chanbara_state>();
+ chanbara_state *state = machine.driver_data<chanbara_state>();
state->scroll = 0;
state->scrollhi = 0;
@@ -453,9 +453,9 @@ ROM_END
static DRIVER_INIT(chanbara )
{
- UINT8 *src = machine->region("gfx4")->base();
- UINT8 *dst = machine->region("gfx3")->base() + 0x4000;
- UINT8 *bg = machine->region("user1")->base();
+ UINT8 *src = machine.region("gfx4")->base();
+ UINT8 *dst = machine.region("gfx3")->base() + 0x4000;
+ UINT8 *bg = machine.region("user1")->base();
int i;
for (i = 0; i < 0x1000; i++)
diff --git a/src/mame/drivers/changela.c b/src/mame/drivers/changela.c
index 7b7c8ff0542..4fedf0d7b61 100644
--- a/src/mame/drivers/changela.c
+++ b/src/mame/drivers/changela.c
@@ -20,7 +20,7 @@ Tomasz Slanina
static READ8_HANDLER( mcu_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
//mame_printf_debug("Z80 MCU R = %x\n", state->mcu_out);
return state->mcu_out;
@@ -29,7 +29,7 @@ static READ8_HANDLER( mcu_r )
/* latch LS374 at U39 */
static WRITE8_HANDLER( mcu_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->mcu_in = data;
}
@@ -40,49 +40,49 @@ static WRITE8_HANDLER( mcu_w )
static READ8_HANDLER( changela_68705_port_a_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return (state->port_a_out & state->ddr_a) | (state->port_a_in & ~state->ddr_a);
}
static WRITE8_HANDLER( changela_68705_port_a_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->port_a_out = data;
}
static WRITE8_HANDLER( changela_68705_ddr_a_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->ddr_a = data;
}
static READ8_HANDLER( changela_68705_port_b_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
- return (state->port_b_out & state->ddr_b) | (input_port_read(space->machine, "MCU") & ~state->ddr_b);
+ changela_state *state = space->machine().driver_data<changela_state>();
+ return (state->port_b_out & state->ddr_b) | (input_port_read(space->machine(), "MCU") & ~state->ddr_b);
}
static WRITE8_HANDLER( changela_68705_port_b_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->port_b_out = data;
}
static WRITE8_HANDLER( changela_68705_ddr_b_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->ddr_b = data;
}
static READ8_HANDLER( changela_68705_port_c_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return (state->port_c_out & state->ddr_c) | (state->port_c_in & ~state->ddr_c);
}
static WRITE8_HANDLER( changela_68705_port_c_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
/* PC3 is connected to the CLOCK input of the LS374,
so we latch the data on positive going edge of the clock */
@@ -99,7 +99,7 @@ static WRITE8_HANDLER( changela_68705_port_c_w )
static WRITE8_HANDLER( changela_68705_ddr_c_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->ddr_c = data;
}
@@ -123,29 +123,29 @@ ADDRESS_MAP_END
/* U30 */
static READ8_HANDLER( changela_24_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
return ((state->port_c_out & 2) << 2) | 7; /* bits 2,1,0-N/C inputs */
}
static READ8_HANDLER( changela_25_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
//collisions on bits 3,2, bits 1,0-N/C inputs
return (state->tree1_col << 3) | (state->tree0_col << 2) | 0x03;
}
static READ8_HANDLER( changela_30_r )
{
- return input_port_read(space->machine, "WHEEL") & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
+ return input_port_read(space->machine(), "WHEEL") & 0x0f; //wheel control (clocked input) signal on bits 3,2,1,0
}
static READ8_HANDLER( changela_31_r )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
/* If the new value is less than the old value, and it did not wrap around,
or if the new value is greater than the old value, and it did wrap around,
then we are moving LEFT. */
- UINT8 curr_value = input_port_read(space->machine, "WHEEL");
+ UINT8 curr_value = input_port_read(space->machine(), "WHEEL");
if ((curr_value < state->prev_value_31 && (state->prev_value_31 - curr_value) < 0x80)
|| (curr_value > state->prev_value_31 && (curr_value - state->prev_value_31) > 0x80))
@@ -162,7 +162,7 @@ static READ8_HANDLER( changela_31_r )
static READ8_HANDLER( changela_2c_r )
{
- int val = input_port_read(space->machine, "IN0");
+ int val = input_port_read(space->machine(), "IN0");
val = (val & 0x30) | ((val & 1) << 7) | (((val & 1) ^ 1) << 6);
@@ -175,11 +175,11 @@ static READ8_HANDLER( changela_2d_r )
int v8 = 0;
int gas;
- if ((space->machine->primary_screen->vpos() & 0xf8) == 0xf8)
+ if ((space->machine().primary_screen->vpos() & 0xf8) == 0xf8)
v8 = 1;
/* Gas pedal is made up of 2 switches, 1 active low, 1 active high */
- switch (input_port_read(space->machine, "IN1") & 0x03)
+ switch (input_port_read(space->machine(), "IN1") & 0x03)
{
case 0x02:
gas = 0x80;
@@ -192,30 +192,30 @@ static READ8_HANDLER( changela_2d_r )
break;
}
- return (input_port_read(space->machine, "IN1") & 0x20) | gas | (v8 << 4);
+ return (input_port_read(space->machine(), "IN1") & 0x20) | gas | (v8 << 4);
}
static WRITE8_HANDLER( mcu_pc_0_w )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->port_c_in = (state->port_c_in & 0xfe) | (data & 1);
}
static WRITE8_HANDLER( changela_collision_reset_0 )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->collision_reset = data & 0x01;
}
static WRITE8_HANDLER( changela_collision_reset_1 )
{
- changela_state *state = space->machine->driver_data<changela_state>();
+ changela_state *state = space->machine().driver_data<changela_state>();
state->tree_collision_reset = data & 0x01;
}
static WRITE8_HANDLER( changela_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
@@ -422,10 +422,10 @@ static const ay8910_interface ay8910_interface_2 =
static INTERRUPT_GEN( chl_interrupt )
{
- changela_state *state = device->machine->driver_data<changela_state>();
- int vector = device->machine->primary_screen->vblank() ? 0xdf : 0xcf; /* 4 irqs per frame: 3 times 0xcf, 1 time 0xdf */
+ changela_state *state = device->machine().driver_data<changela_state>();
+ int vector = device->machine().primary_screen->vblank() ? 0xdf : 0xcf; /* 4 irqs per frame: 3 times 0xcf, 1 time 0xdf */
-// device->machine->primary_screen->update_partial(device->machine->primary_screen->vpos());
+// device->machine().primary_screen->update_partial(device->machine().primary_screen->vpos());
device_set_input_line_and_vector(device, 0, HOLD_LINE, vector);
@@ -439,9 +439,9 @@ static INTERRUPT_GEN( chl_interrupt )
static MACHINE_START(changela)
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
- state->mcu = machine->device("mcu");
+ state->mcu = machine.device("mcu");
/* video */
state->save_item(NAME(state->slopeROM_bank));
@@ -481,7 +481,7 @@ static MACHINE_START(changela)
static MACHINE_RESET (changela)
{
- changela_state *state = machine->driver_data<changela_state>();
+ changela_state *state = machine.driver_data<changela_state>();
/* video */
state->slopeROM_bank = 0;
diff --git a/src/mame/drivers/cheekyms.c b/src/mame/drivers/cheekyms.c
index 7145187fbe5..210ea066b8b 100644
--- a/src/mame/drivers/cheekyms.c
+++ b/src/mame/drivers/cheekyms.c
@@ -14,7 +14,7 @@
static INPUT_CHANGED( coin_inserted )
{
- cheekyms_state *state = field->port->machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = field->port->machine().driver_data<cheekyms_state>();
/* this starts a 556 one-shot timer (and triggers a sound effect) */
if (newval)
@@ -111,10 +111,10 @@ GFXDECODE_END
static MACHINE_START( cheekyms )
{
- cheekyms_state *state = machine->driver_data<cheekyms_state>();
+ cheekyms_state *state = machine.driver_data<cheekyms_state>();
- state->maincpu = machine->device("maincpu");
- state->dac = machine->device("dac");
+ state->maincpu = machine.device("maincpu");
+ state->dac = machine.device("dac");
}
static MACHINE_CONFIG_START( cheekyms, cheekyms_state )
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 91927860eda..61f2c2d637b 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -332,7 +332,7 @@ St. Instr. Comment
*/
/* jamtable disassembler */
-static void jamtable_disasm(running_machine *machine, address_space *space,UINT32 address,UINT32 size) // 0xff000080 == fff00080
+static void jamtable_disasm(running_machine &machine, address_space *space,UINT32 address,UINT32 size) // 0xff000080 == fff00080
{
UINT32 base,addr;
UINT32 opcode,op1,op2;
@@ -426,9 +426,9 @@ static void jamtable_disasm(running_machine *machine, address_space *space,UINT3
}
}
-void jamtable_disasm_command(running_machine *machine, int ref, int params, const char **param)
+void jamtable_disasm_command(running_machine &machine, int ref, int params, const char **param)
{
- address_space *space=machine->firstcpu->space();
+ address_space *space=machine.firstcpu->space();
UINT64 addr,size;
if (params < 2)
@@ -569,7 +569,7 @@ INPUT_PORTS_END
static MACHINE_START( chihiro )
{
smbus_register_device(0x45,smbus_cx25871);
- if (machine->debug_flags & DEBUG_FLAG_ENABLED)
+ if (machine.debug_flags & DEBUG_FLAG_ENABLED)
debug_console_register_command(machine,"jamdis",CMDFLAG_NONE,0,2,3,jamtable_disasm_command);
}
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index 9269835ebc8..4f6b4c16542 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -110,15 +110,15 @@ INLINE int scanline_to_vcount( int scanline )
static TIMER_DEVICE_CALLBACK( chinagat_scanline )
{
- ddragon_state *state = timer.machine->driver_data<ddragon_state>();
+ ddragon_state *state = timer.machine().driver_data<ddragon_state>();
int scanline = param;
- int screen_height = timer.machine->primary_screen->height();
+ int screen_height = timer.machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
/* on the rising edge of VBLK (vcount == F8), signal an NMI */
if (vcount == 0xf8)
@@ -135,7 +135,7 @@ static TIMER_DEVICE_CALLBACK( chinagat_scanline )
static WRITE8_HANDLER( chinagat_interrupt_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
switch (offset)
{
@@ -170,31 +170,31 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
---- -x-- Flip screen
--x- ---- Enable video ???
****************************/
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->scrolly_hi = ((data & 0x02) >> 1);
state->scrollx_hi = data & 0x01;
- flip_screen_set(space->machine, ~data & 0x04);
+ flip_screen_set(space->machine(), ~data & 0x04);
}
static WRITE8_HANDLER( chinagat_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
+ memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
}
static WRITE8_HANDLER( chinagat_sub_bankswitch_w )
{
- memory_set_bank(space->machine, "bank4", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
+ memory_set_bank(space->machine(), "bank4", data & 0x07); // shall we check (data & 7) < 6 (# of banks)?
}
static READ8_HANDLER( saiyugoub1_mcu_command_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
#if 0
if (state->mcu_command == 0x78)
{
- space->machine->device<cpu_device>("mcu")->suspend(SUSPEND_REASON_HALT, 1); /* Suspend (speed up) */
+ space->machine().device<cpu_device>("mcu")->suspend(SUSPEND_REASON_HALT, 1); /* Suspend (speed up) */
}
#endif
return state->mcu_command;
@@ -202,29 +202,29 @@ static READ8_HANDLER( saiyugoub1_mcu_command_r )
static WRITE8_HANDLER( saiyugoub1_mcu_command_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->mcu_command = data;
#if 0
if (data != 0x78)
{
- space->machine->device<cpu_device>("mcu")->resume(SUSPEND_REASON_HALT); /* Wake up */
+ space->machine().device<cpu_device>("mcu")->resume(SUSPEND_REASON_HALT); /* Wake up */
}
#endif
}
static WRITE8_HANDLER( saiyugoub1_adpcm_rom_addr_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
/* i8748 Port 1 write */
state->i8748_P1 = data;
}
static WRITE8_DEVICE_HANDLER( saiyugoub1_adpcm_control_w )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
/* i8748 Port 2 write */
- UINT8 *saiyugoub1_adpcm_rom = device->machine->region("adpcm")->base();
+ UINT8 *saiyugoub1_adpcm_rom = device->machine().region("adpcm")->base();
if (data & 0x80) /* Reset m5205 and disable ADPCM ROM outputs */
{
@@ -275,7 +275,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
/* Actually, T0 output clk mode is not supported by the i8048 core */
#if 0
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
state->m5205_clk++;
if (state->m5205_clk == 8)
@@ -290,7 +290,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
static READ8_HANDLER( saiyugoub1_m5205_irq_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
if (state->adpcm_sound_irq)
{
state->adpcm_sound_irq = 0;
@@ -301,7 +301,7 @@ static READ8_HANDLER( saiyugoub1_m5205_irq_r )
static void saiyugoub1_m5205_irq_w( device_t *device )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
state->adpcm_sound_irq = 1;
}
@@ -494,7 +494,7 @@ GFXDECODE_END
static void chinagat_irq_handler( device_t *device, int irq )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
device_set_input_line(state->snd_cpu, 0, irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -524,14 +524,14 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
- state->maincpu = machine->device("maincpu");
- state->sub_cpu = machine->device("sub");
- state->snd_cpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->sub_cpu = machine.device("sub");
+ state->snd_cpu = machine.device("audiocpu");
/* configure banks */
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* register for save states */
state->save_item(NAME(state->scrollx_hi));
@@ -551,7 +551,7 @@ static MACHINE_START( chinagat )
static MACHINE_RESET( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->scrollx_hi = 0;
state->scrolly_hi = 0;
@@ -914,9 +914,9 @@ ROM_END
static DRIVER_INIT( chinagat )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SUB = machine->region("sub")->base();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SUB = machine.region("sub")->base();
state->technos_video_hw = 1;
state->sprite_irq = M6809_IRQ_LINE;
diff --git a/src/mame/drivers/chinsan.c b/src/mame/drivers/chinsan.c
index f5c8009f295..6f8b496514a 100644
--- a/src/mame/drivers/chinsan.c
+++ b/src/mame/drivers/chinsan.c
@@ -72,7 +72,7 @@ public:
static PALETTE_INIT( chinsan )
{
- UINT8 *src = machine->region( "color_proms" )->base();
+ UINT8 *src = machine.region( "color_proms" )->base();
int i;
for (i = 0; i < 0x100; i++)
@@ -85,7 +85,7 @@ static VIDEO_START( chinsan )
static SCREEN_UPDATE( chinsan )
{
- chinsan_state *state = screen->machine->driver_data<chinsan_state>();
+ chinsan_state *state = screen->machine().driver_data<chinsan_state>();
int y, x, count;
count = 0;
for (y = 0; y < 32; y++)
@@ -95,7 +95,7 @@ static SCREEN_UPDATE( chinsan )
int tileno, colour;
tileno = state->video[count] | (state->video[count + 0x800] << 8);
colour = state->video[count + 0x1000] >> 3;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tileno,colour,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tileno,colour,0,0,x*8,y*8);
count++;
}
}
@@ -113,7 +113,7 @@ static SCREEN_UPDATE( chinsan )
static WRITE8_HANDLER( ctrl_w )
{
- memory_set_bank(space->machine, "bank1", data >> 6);
+ memory_set_bank(space->machine(), "bank1", data >> 6);
}
static WRITE8_DEVICE_HANDLER( ym_port_w1 )
@@ -142,7 +142,7 @@ static const ym2203_interface ym2203_config =
static WRITE8_HANDLER( chinsan_port00_w )
{
- chinsan_state *state = space->machine->driver_data<chinsan_state>();
+ chinsan_state *state = space->machine().driver_data<chinsan_state>();
state->port_select = data;
@@ -160,7 +160,7 @@ static WRITE8_HANDLER( chinsan_port00_w )
static READ8_HANDLER( chinsan_input_port_0_r )
{
- chinsan_state *state = space->machine->driver_data<chinsan_state>();
+ chinsan_state *state = space->machine().driver_data<chinsan_state>();
//return 0xff; // the inputs don't seem to work, so just return ff for now
@@ -169,62 +169,62 @@ static READ8_HANDLER( chinsan_input_port_0_r )
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return input_port_read(space->machine, "MAHJONG_P2_1");
+ return input_port_read(space->machine(), "MAHJONG_P2_1");
case 0x53:
- return input_port_read(space->machine, "MAHJONG_P2_2");
+ return input_port_read(space->machine(), "MAHJONG_P2_2");
case 0x57:
- return input_port_read(space->machine, "MAHJONG_P2_3");
+ return input_port_read(space->machine(), "MAHJONG_P2_3");
case 0x5b:
- return input_port_read(space->machine, "MAHJONG_P2_4");
+ return input_port_read(space->machine(), "MAHJONG_P2_4");
case 0x5d:
- return input_port_read(space->machine, "MAHJONG_P2_5");
+ return input_port_read(space->machine(), "MAHJONG_P2_5");
case 0x5e:
- return input_port_read(space->machine, "MAHJONG_P2_6");
+ return input_port_read(space->machine(), "MAHJONG_P2_6");
}
printf("chinsan_input_port_0_r unk_r %02x\n", state->port_select);
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER( chinsan_input_port_1_r )
{
- chinsan_state *state = space->machine->driver_data<chinsan_state>();
+ chinsan_state *state = space->machine().driver_data<chinsan_state>();
switch (state->port_select)
{
/* i doubt these are both really the same.. */
case 0x40:
case 0x4f:
- return input_port_read(space->machine, "MAHJONG_P1_1");
+ return input_port_read(space->machine(), "MAHJONG_P1_1");
case 0x53:
- return input_port_read(space->machine, "MAHJONG_P1_2");
+ return input_port_read(space->machine(), "MAHJONG_P1_2");
case 0x57:
- return input_port_read(space->machine, "MAHJONG_P1_3");
+ return input_port_read(space->machine(), "MAHJONG_P1_3");
case 0x5b:
- return input_port_read(space->machine, "MAHJONG_P1_4");
+ return input_port_read(space->machine(), "MAHJONG_P1_4");
case 0x5d:
- return input_port_read(space->machine, "MAHJONG_P1_5");
+ return input_port_read(space->machine(), "MAHJONG_P1_5");
case 0x5e:
- return input_port_read(space->machine, "MAHJONG_P1_6");
+ return input_port_read(space->machine(), "MAHJONG_P1_6");
}
printf("chinsan_input_port_1_r unk_r %02x\n", state->port_select);
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_DEVICE_HANDLER( chin_adpcm_w )
{
- chinsan_state *state = device->machine->driver_data<chinsan_state>();
+ chinsan_state *state = device->machine().driver_data<chinsan_state>();
state->adpcm_pos = (data & 0xff) * 0x100;
state->adpcm_idle = 0;
msm5205_reset_w(device, 0);
@@ -528,7 +528,7 @@ GFXDECODE_END
static void chin_adpcm_int( device_t *device )
{
- chinsan_state *state = device->machine->driver_data<chinsan_state>();
+ chinsan_state *state = device->machine().driver_data<chinsan_state>();
if (state->adpcm_pos >= 0x10000 || state->adpcm_idle)
{
@@ -538,7 +538,7 @@ static void chin_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
@@ -566,9 +566,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( chinsan )
{
- chinsan_state *state = machine->driver_data<chinsan_state>();
+ chinsan_state *state = machine.driver_data<chinsan_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->adpcm_idle));
state->save_item(NAME(state->port_select));
@@ -579,7 +579,7 @@ static MACHINE_START( chinsan )
static MACHINE_RESET( chinsan )
{
- chinsan_state *state = machine->driver_data<chinsan_state>();
+ chinsan_state *state = machine.driver_data<chinsan_state>();
state->adpcm_idle = 1;
state->port_select = 0;
diff --git a/src/mame/drivers/chqflag.c b/src/mame/drivers/chqflag.c
index d095d4ff698..270a0abfefd 100644
--- a/src/mame/drivers/chqflag.c
+++ b/src/mame/drivers/chqflag.c
@@ -28,7 +28,7 @@ static WRITE8_DEVICE_HANDLER( k007232_extvolume_w );
static INTERRUPT_GEN( chqflag_interrupt )
{
- chqflag_state *state = device->machine->driver_data<chqflag_state>();
+ chqflag_state *state = device->machine().driver_data<chqflag_state>();
if (cpu_getiloops(device) == 0)
{
@@ -44,20 +44,20 @@ static INTERRUPT_GEN( chqflag_interrupt )
static WRITE8_HANDLER( chqflag_bankswitch_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
int bankaddress;
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
/* bits 0-4 = ROM bank # (0x00-0x11) */
bankaddress = 0x10000 + (data & 0x1f) * 0x4000;
- memory_set_bankptr(space->machine, "bank4", &RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank4", &RAM[bankaddress]);
/* bit 5 = memory bank select */
if (data & 0x20)
{
space->install_read_bank(0x1800, 0x1fff, "bank5");
space->install_legacy_write_handler(0x1800, 0x1fff, FUNC(paletteram_xBBBBBGGGGGRRRRR_be_w));
- memory_set_bankptr(space->machine, "bank5", space->machine->generic.paletteram.v);
+ memory_set_bankptr(space->machine(), "bank5", space->machine().generic.paletteram.v);
if (state->k051316_readroms)
space->install_legacy_readwrite_handler(*state->k051316_1, 0x1000, 0x17ff, FUNC(k051316_rom_r), FUNC(k051316_w)); /* 051316 #1 (ROM test) */
@@ -75,11 +75,11 @@ static WRITE8_HANDLER( chqflag_bankswitch_w )
static WRITE8_HANDLER( chqflag_vreg_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
/* bits 0 & 1 = coin counters */
- coin_counter_w(space->machine, 1, data & 0x01);
- coin_counter_w(space->machine, 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x02);
/* bit 4 = enable rom reading thru K051316 #1 & #2 */
state->k051316_readroms = (data & 0x10);
@@ -95,9 +95,9 @@ static WRITE8_HANDLER( chqflag_vreg_w )
/* the headlight (which have the shadow bit set) become highlights */
/* Maybe one of the bits inverts the SHAD line while the other darkens the background. */
if (data & 0x08)
- palette_set_shadow_factor(space->machine, 1 / PALETTE_DEFAULT_SHADOW_FACTOR);
+ palette_set_shadow_factor(space->machine(), 1 / PALETTE_DEFAULT_SHADOW_FACTOR);
else
- palette_set_shadow_factor(space->machine, PALETTE_DEFAULT_SHADOW_FACTOR);
+ palette_set_shadow_factor(space->machine(), PALETTE_DEFAULT_SHADOW_FACTOR);
if ((data & 0x80) != state->last_vreg)
{
@@ -108,7 +108,7 @@ static WRITE8_HANDLER( chqflag_vreg_w )
/* only affect the background */
for (i = 512; i < 1024; i++)
- palette_set_pen_contrast(space->machine, i, brt);
+ palette_set_pen_contrast(space->machine(), i, brt);
}
//if ((data & 0xf8) && (data & 0xf8) != 0x88)
@@ -120,17 +120,17 @@ static WRITE8_HANDLER( chqflag_vreg_w )
static WRITE8_HANDLER( select_analog_ctrl_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
state->analog_ctrl = data;
}
static READ8_HANDLER( analog_read_r )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
switch (state->analog_ctrl & 0x03)
{
- case 0x00: return (state->accel = input_port_read(space->machine, "IN3")); /* accelerator */
- case 0x01: return (state->wheel = input_port_read(space->machine, "IN4")); /* steering */
+ case 0x00: return (state->accel = input_port_read(space->machine(), "IN3")); /* accelerator */
+ case 0x01: return (state->wheel = input_port_read(space->machine(), "IN4")); /* steering */
case 0x02: return state->accel; /* accelerator (previous?) */
case 0x03: return state->wheel; /* steering (previous?) */
}
@@ -140,7 +140,7 @@ static READ8_HANDLER( analog_read_r )
static WRITE8_HANDLER( chqflag_sh_irqtrigger_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
soundlatch2_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -176,7 +176,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( k007232_bankswitch_w )
{
- chqflag_state *state = space->machine->driver_data<chqflag_state>();
+ chqflag_state *state = space->machine().driver_data<chqflag_state>();
int bank_A, bank_B;
/* banks # for the 007232 (chip 1) */
@@ -292,7 +292,7 @@ INPUT_PORTS_END
static void chqflag_ym2151_irq_w( device_t *device, int data )
{
- chqflag_state *state = device->machine->driver_data<chqflag_state>();
+ chqflag_state *state = device->machine().driver_data<chqflag_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, data ? ASSERT_LINE : CLEAR_LINE);
}
@@ -354,18 +354,18 @@ static const k051316_interface chqflag_k051316_intf_2 =
static MACHINE_START( chqflag )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k051316_1 = machine->device("k051316_1");
- state->k051316_2 = machine->device("k051316_2");
- state->k051960 = machine->device("k051960");
- state->k007232_1 = machine->device("k007232_1");
- state->k007232_2 = machine->device("k007232_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k051316_1 = machine.device("k051316_1");
+ state->k051316_2 = machine.device("k051316_2");
+ state->k051960 = machine.device("k051960");
+ state->k007232_1 = machine.device("k007232_1");
+ state->k007232_2 = machine.device("k007232_2");
state->save_item(NAME(state->k051316_readroms));
state->save_item(NAME(state->last_vreg));
@@ -376,7 +376,7 @@ static MACHINE_START( chqflag )
static MACHINE_RESET( chqflag )
{
- chqflag_state *state = machine->driver_data<chqflag_state>();
+ chqflag_state *state = machine.driver_data<chqflag_state>();
state->k051316_readroms = 0;
state->last_vreg = 0;
diff --git a/src/mame/drivers/chsuper.c b/src/mame/drivers/chsuper.c
index 1df9be71702..e470e99255d 100644
--- a/src/mame/drivers/chsuper.c
+++ b/src/mame/drivers/chsuper.c
@@ -34,9 +34,9 @@ static VIDEO_START(chsuper)
static SCREEN_UPDATE(chsuper)
{
- //chsuper_state *state = screen->machine->driver_data<chsuper_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
- UINT8 *vram = screen->machine->region("vram")->base();
+ //chsuper_state *state = screen->machine().driver_data<chsuper_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
+ UINT8 *vram = screen->machine().region("vram")->base();
int count = 0x0000;
int y,x;
@@ -58,7 +58,7 @@ static SCREEN_UPDATE(chsuper)
static WRITE8_HANDLER( paletteram_io_w )
{
- chsuper_state *state = space->machine->driver_data<chsuper_state>();
+ chsuper_state *state = space->machine().driver_data<chsuper_state>();
switch(offset)
{
case 0:
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( paletteram_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -97,7 +97,7 @@ static READ8_HANDLER( ff_r )
static WRITE8_HANDLER( chsuper_vram_w )
{
- UINT8 *vram = space->machine->region("vram")->base();
+ UINT8 *vram = space->machine().region("vram")->base();
vram[offset] = data;
}
@@ -280,9 +280,9 @@ ROM_END
static DRIVER_INIT( chsuper2 )
{
- chsuper_state *state = machine->driver_data<chsuper_state>();
+ chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
state->tilexor = 0x7f00;
@@ -305,9 +305,9 @@ static DRIVER_INIT( chsuper2 )
static DRIVER_INIT( chsuper3 )
{
- chsuper_state *state = machine->driver_data<chsuper_state>();
+ chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
state->tilexor = 0x0e00;
@@ -330,9 +330,9 @@ static DRIVER_INIT( chsuper3 )
static DRIVER_INIT( chmpnum )
{
- chsuper_state *state = machine->driver_data<chsuper_state>();
+ chsuper_state *state = machine.driver_data<chsuper_state>();
UINT8 *buffer;
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
state->tilexor = 0x1800;
diff --git a/src/mame/drivers/cidelsa.c b/src/mame/drivers/cidelsa.c
index 4ecd55cbe1e..71708627a30 100644
--- a/src/mame/drivers/cidelsa.c
+++ b/src/mame/drivers/cidelsa.c
@@ -54,7 +54,7 @@ WRITE8_MEMBER( cidelsa_state::draco_sound_bankswitch_w )
int bank = BIT(data, 3);
- memory_set_bank(&m_machine, "bank1", bank);
+ memory_set_bank(m_machine, "bank1", bank);
}
WRITE8_MEMBER( cidelsa_state::draco_sound_g_w )
@@ -136,9 +136,9 @@ WRITE8_MEMBER( cidelsa_state::altair_out1_w )
7 CONT. M1
*/
- set_led_status(&m_machine, 0, data & 0x08); // 1P
- set_led_status(&m_machine, 1, data & 0x10); // 2P
- set_led_status(&m_machine, 2, data & 0x20); // FIRE
+ set_led_status(m_machine, 0, data & 0x08); // 1P
+ set_led_status(m_machine, 1, data & 0x10); // 2P
+ set_led_status(m_machine, 2, data & 0x20); // FIRE
}
WRITE8_MEMBER( cidelsa_state::draco_out1_w )
@@ -281,14 +281,14 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( cdp1869_pcb_r )
{
- cidelsa_state *state = field->port->machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = field->port->machine().driver_data<cidelsa_state>();
return state->m_cdp1869_pcb;
}
static INPUT_CHANGED( ef_w )
{
- cputag_set_input_line(field->port->machine, CDP1802_TAG, (int)(FPTR)param, newval);
+ cputag_set_input_line(field->port->machine(), CDP1802_TAG, (int)(FPTR)param, newval);
}
static INPUT_PORTS_START( destryer )
@@ -437,14 +437,14 @@ INPUT_PORTS_END
static TIMER_CALLBACK( set_cpu_mode )
{
- cidelsa_state *state = machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = machine.driver_data<cidelsa_state>();
state->m_reset = 1;
}
static MACHINE_START( cidelsa )
{
- cidelsa_state *state = machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = machine.driver_data<cidelsa_state>();
/* register for state saving */
state->save_item(NAME(state->m_reset));
@@ -452,12 +452,12 @@ static MACHINE_START( cidelsa )
static MACHINE_START( draco )
{
- cidelsa_state *state = machine->driver_data<cidelsa_state>();
+ cidelsa_state *state = machine.driver_data<cidelsa_state>();
MACHINE_START_CALL( cidelsa );
/* setup COP402 memory banking */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region(COP402N_TAG)->base(), 0x400);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region(COP402N_TAG)->base(), 0x400);
memory_set_bank(machine, "bank1", 0);
/* register for state saving */
diff --git a/src/mame/drivers/cinemat.c b/src/mame/drivers/cinemat.c
index 6abaaa799d0..bc235779738 100644
--- a/src/mame/drivers/cinemat.c
+++ b/src/mame/drivers/cinemat.c
@@ -51,7 +51,7 @@
static MACHINE_START( cinemat )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state_save_register_global(machine, state->coin_detected);
state_save_register_global(machine, state->coin_last_reset);
state_save_register_global(machine, state->mux_select);
@@ -60,7 +60,7 @@ static MACHINE_START( cinemat )
MACHINE_RESET( cinemat )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
/* reset the coin states */
state->coin_detected = 0;
state->coin_last_reset = 0;
@@ -79,14 +79,14 @@ MACHINE_RESET( cinemat )
static READ8_HANDLER( inputs_r )
{
- return (input_port_read(space->machine, "INPUTS") >> offset) & 1;
+ return (input_port_read(space->machine(), "INPUTS") >> offset) & 1;
}
static READ8_HANDLER( switches_r )
{
static const UINT8 switch_shuffle[8] = { 2,5,4,3,0,1,6,7 };
- return (input_port_read(space->machine, "SWITCHES") >> switch_shuffle[offset]) & 1;
+ return (input_port_read(space->machine(), "SWITCHES") >> switch_shuffle[offset]) & 1;
}
@@ -99,7 +99,7 @@ static READ8_HANDLER( switches_r )
static INPUT_CHANGED( coin_inserted )
{
- cinemat_state *state = field->port->machine->driver_data<cinemat_state>();
+ cinemat_state *state = field->port->machine().driver_data<cinemat_state>();
/* on the falling edge of a new coin, set the coin_detected flag */
if (newval == 0)
state->coin_detected = 1;
@@ -108,7 +108,7 @@ static INPUT_CHANGED( coin_inserted )
static READ8_HANDLER( coin_input_r )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
return !state->coin_detected;
}
@@ -122,7 +122,7 @@ static READ8_HANDLER( coin_input_r )
static WRITE8_HANDLER( coin_reset_w )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
/* on the rising edge of a coin reset, clear the coin_detected flag */
if (state->coin_last_reset != data && data != 0)
state->coin_detected = 0;
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( coin_reset_w )
static WRITE8_HANDLER( mux_select_w )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
state->mux_select = data;
cinemat_sound_control_w(space, 0x07, data);
}
@@ -147,13 +147,13 @@ static WRITE8_HANDLER( mux_select_w )
static UINT8 joystick_read(device_t *device)
{
- cinemat_state *state = device->machine->driver_data<cinemat_state>();
- if (device->machine->phase() != MACHINE_PHASE_RUNNING)
+ cinemat_state *state = device->machine().driver_data<cinemat_state>();
+ if (device->machine().phase() != MACHINE_PHASE_RUNNING)
return 0;
else
{
int xval = (INT16)(cpu_get_reg(device, CCPU_X) << 4) >> 4;
- return (input_port_read_safe(device->machine, state->mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800;
+ return (input_port_read_safe(device->machine(), state->mux_select ? "ANALOGX" : "ANALOGY", 0) - xval) < 0x800;
}
}
@@ -171,7 +171,7 @@ static READ8_HANDLER( speedfrk_wheel_r )
int delta_wheel;
/* the shift register is cleared once per 'frame' */
- delta_wheel = (INT8)input_port_read(space->machine, "WHEEL") / 8;
+ delta_wheel = (INT8)input_port_read(space->machine(), "WHEEL") / 8;
if (delta_wheel > 3)
delta_wheel = 3;
else if (delta_wheel < -3)
@@ -183,15 +183,15 @@ static READ8_HANDLER( speedfrk_wheel_r )
static READ8_HANDLER( speedfrk_gear_r )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
- int gearval = input_port_read(space->machine, "GEAR");
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
+ int gearval = input_port_read(space->machine(), "GEAR");
/* check the fake gear input port and determine the bit settings for the gear */
if ((gearval & 0x0f) != 0x0f)
state->gear = gearval & 0x0f;
/* add the start key into the mix -- note that it overlaps 4th gear */
- if (!(input_port_read(space->machine, "INPUTS") & 0x80))
+ if (!(input_port_read(space->machine(), "INPUTS") & 0x80))
state->gear &= ~0x08;
return (state->gear >> offset) & 1;
@@ -237,9 +237,9 @@ static READ8_HANDLER( sundance_inputs_r )
{
/* handle special keys first */
if (sundance_port_map[offset].portname)
- return (input_port_read(space->machine, sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
+ return (input_port_read(space->machine(), sundance_port_map[offset].portname) & sundance_port_map[offset].bitmask) ? 0 : 1;
else
- return (input_port_read(space->machine, "INPUTS") >> offset) & 1;
+ return (input_port_read(space->machine(), "INPUTS") >> offset) & 1;
}
@@ -252,8 +252,8 @@ static READ8_HANDLER( sundance_inputs_r )
static READ8_HANDLER( boxingb_dial_r )
{
- cinemat_state *state = space->machine->driver_data<cinemat_state>();
- int value = input_port_read(space->machine, "DIAL");
+ cinemat_state *state = space->machine().driver_data<cinemat_state>();
+ int value = input_port_read(space->machine(), "DIAL");
if (!state->mux_select) offset += 4;
return (value >> offset) & 1;
}
@@ -268,8 +268,8 @@ static READ8_HANDLER( boxingb_dial_r )
static READ8_HANDLER( qb3_frame_r )
{
- attotime next_update = space->machine->primary_screen->time_until_update();
- attotime frame_period = space->machine->primary_screen->frame_period();
+ attotime next_update = space->machine().primary_screen->time_until_update();
+ attotime frame_period = space->machine().primary_screen->frame_period();
int percent = next_update.attoseconds / (frame_period.attoseconds / 100);
/* note this is just an approximation... */
@@ -279,7 +279,7 @@ static READ8_HANDLER( qb3_frame_r )
static WRITE8_HANDLER( qb3_ram_bank_w )
{
- memory_set_bank(space->machine, "bank1", cpu_get_reg(space->machine->device("maincpu"), CCPU_P) & 3);
+ memory_set_bank(space->machine(), "bank1", cpu_get_reg(space->machine().device("maincpu"), CCPU_P) & 3);
}
@@ -1458,37 +1458,37 @@ ROM_END
static DRIVER_INIT( speedfrk )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
+ cinemat_state *state = machine.driver_data<cinemat_state>();
state->gear = 0xe;
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(speedfrk_wheel_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x06, FUNC(speedfrk_gear_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x03, FUNC(speedfrk_wheel_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x04, 0x06, FUNC(speedfrk_gear_r));
}
static DRIVER_INIT( sundance )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x0f, FUNC(sundance_inputs_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x00, 0x0f, FUNC(sundance_inputs_r));
}
static DRIVER_INIT( tailg )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
}
static DRIVER_INIT( boxingb )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0c, 0x0f, FUNC(boxingb_dial_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0c, 0x0f, FUNC(boxingb_dial_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x07, 0x07, FUNC(mux_select_w));
}
static DRIVER_INIT( qb3 )
{
- cinemat_state *state = machine->driver_data<cinemat_state>();
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0f, 0x0f, FUNC(qb3_frame_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x00, 0x00, FUNC(qb3_ram_bank_w));
+ cinemat_state *state = machine.driver_data<cinemat_state>();
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0f, 0x0f, FUNC(qb3_frame_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x00, 0x00, FUNC(qb3_ram_bank_w));
memory_configure_bank(machine, "bank1", 0, 4, state->rambase, 0x100*2);
}
diff --git a/src/mame/drivers/circus.c b/src/mame/drivers/circus.c
index 5e2211439bf..8428c222b0c 100644
--- a/src/mame/drivers/circus.c
+++ b/src/mame/drivers/circus.c
@@ -54,8 +54,8 @@ D000 Paddle Position and Interrupt Reset (where applicable)
static READ8_HANDLER( circus_paddle_r )
{
// also clears irq
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
- return input_port_read(space->machine, "PADDLE");
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ return input_port_read(space->machine(), "PADDLE");
}
static ADDRESS_MAP_START( circus_map, AS_PROGRAM, 8 )
@@ -264,11 +264,11 @@ GFXDECODE_END
***************************************************************************/
static MACHINE_START( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
- state->maincpu = machine->device("maincpu");
- state->samples = machine->device("samples");
- state->discrete = machine->device("discrete");
+ state->maincpu = machine.device("maincpu");
+ state->samples = machine.device("samples");
+ state->discrete = machine.device("discrete");
state->save_item(NAME(state->clown_x));
state->save_item(NAME(state->clown_y));
@@ -277,7 +277,7 @@ static MACHINE_START( circus )
static MACHINE_RESET( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->clown_x = 0;
state->clown_y = 0;
@@ -573,23 +573,23 @@ ROM_END
static DRIVER_INIT( circus )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 1;
}
static DRIVER_INIT( robotbwl )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 2;
}
static DRIVER_INIT( crash )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 3;
}
static DRIVER_INIT( ripcord )
{
- circus_state *state = machine->driver_data<circus_state>();
+ circus_state *state = machine.driver_data<circus_state>();
state->game_id = 4;
}
diff --git a/src/mame/drivers/circusc.c b/src/mame/drivers/circusc.c
index 4392f4c9373..f52260b59f3 100644
--- a/src/mame/drivers/circusc.c
+++ b/src/mame/drivers/circusc.c
@@ -59,20 +59,20 @@ To enter service mode, keep 1&2 pressed on reset
static MACHINE_START( circusc )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->sn1 = machine->device("sn1");
- state->sn2 = machine->device("sn2");
- state->dac = machine->device("dac");
- state->discrete = machine->device("fltdisc");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->sn1 = machine.device("sn1");
+ state->sn2 = machine.device("sn2");
+ state->dac = machine.device("dac");
+ state->discrete = machine.device("fltdisc");
state->save_item(NAME(state->sn_latch));
}
static MACHINE_RESET( circusc )
{
- circusc_state *state = machine->driver_data<circusc_state>();
+ circusc_state *state = machine.driver_data<circusc_state>();
state->sn_latch = 0;
}
@@ -89,7 +89,7 @@ static READ8_HANDLER( circusc_sh_timer_r )
* Can be shortened to:
*/
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
int clock;
clock = state->audiocpu->total_cycles() >> 9;
@@ -99,18 +99,18 @@ static READ8_HANDLER( circusc_sh_timer_r )
static WRITE8_HANDLER( circusc_sh_irqtrigger_w )
{
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( circusc_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static WRITE8_HANDLER(circusc_sound_w)
{
- circusc_state *state = space->machine->driver_data<circusc_state>();
+ circusc_state *state = space->machine().driver_data<circusc_state>();
switch (offset & 7)
{
diff --git a/src/mame/drivers/cischeat.c b/src/mame/drivers/cischeat.c
index 32ee60d4bb3..7ca7c470038 100644
--- a/src/mame/drivers/cischeat.c
+++ b/src/mame/drivers/cischeat.c
@@ -188,43 +188,43 @@ Cisco Heat.
static READ16_HANDLER( sharedram1_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->sharedram1[offset];
}
static READ16_HANDLER( sharedram2_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->sharedram2[offset];
}
static WRITE16_HANDLER( sharedram1_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->sharedram1[offset]);
}
static WRITE16_HANDLER( sharedram2_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->sharedram2[offset]);
}
static READ16_HANDLER( rom_1_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->rom_1[offset];
}
static READ16_HANDLER( rom_2_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->rom_2[offset];
}
static READ16_HANDLER( rom_3_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->rom_3[offset];
}
@@ -235,23 +235,23 @@ static READ16_HANDLER( rom_3_r )
static WRITE16_HANDLER( bigrun_paletteram16_w )
{
- UINT16 word = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 word = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((word >> 11) & 0x1E ) | ((word >> 3) & 0x01));
int g = pal5bit(((word >> 7 ) & 0x1E ) | ((word >> 2) & 0x01));
int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x0e00/2) && (offset <= 0x0fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x0e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x0e00/2) && (offset <= 0x0fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x0e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 1
- if ( (offset >= 0x1600/2) && (offset <= 0x17ff/2) ) { palette_set_color(space->machine, 0x100 + offset - 0x1600/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1600/2) && (offset <= 0x17ff/2) ) { palette_set_color(space->machine(), 0x100 + offset - 0x1600/2, MAKE_RGB(r,g,b) ); return;}
// Road 0
- if ( (offset >= 0x1800/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x1800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1800/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x1800/2, MAKE_RGB(r,g,b) ); return;}
// Road 1
- if ( (offset >= 0x2000/2) && (offset <= 0x27ff/2) ) { palette_set_color(space->machine, 0x600 + offset - 0x2000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2000/2) && (offset <= 0x27ff/2) ) { palette_set_color(space->machine(), 0x600 + offset - 0x2000/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x2800/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine, 0xa00 + offset - 0x2800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2800/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine(), 0xa00 + offset - 0x2800/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x3600/2) && (offset <= 0x37ff/2) ) { palette_set_color(space->machine, 0xe00 + offset - 0x3600/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3600/2) && (offset <= 0x37ff/2) ) { palette_set_color(space->machine(), 0xe00 + offset - 0x3600/2, MAKE_RGB(r,g,b) ); return;}
}
static ADDRESS_MAP_START( bigrun_map, AS_PROGRAM, 16 )
@@ -288,23 +288,23 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( cischeat_paletteram16_w )
{
- UINT16 word = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 word = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((word >> 11) & 0x1E ) | ((word >> 3) & 0x01));
int g = pal5bit(((word >> 7 ) & 0x1E ) | ((word >> 2) & 0x01));
int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x1c00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x1c00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1c00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x1c00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 1
- if ( (offset >= 0x2c00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x2c00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2c00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x2c00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x6c00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine, 0x400 + offset - 0x6c00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x6c00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine(), 0x400 + offset - 0x6c00/2, MAKE_RGB(r,g,b) ); return;}
// Road 0
- if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine, 0x600 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine(), 0x600 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
// Road 1
- if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine, 0xa00 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine(), 0xa00 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine, 0xe00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine(), 0xe00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
}
static ADDRESS_MAP_START( cischeat_map, AS_PROGRAM, 16 )
@@ -340,23 +340,23 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( f1gpstar_paletteram16_w )
{
- UINT16 word = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ UINT16 word = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((word >> 11) & 0x1E ) | ((word >> 3) & 0x01));
int g = pal5bit(((word >> 7 ) & 0x1E ) | ((word >> 2) & 0x01));
int b = pal5bit(((word >> 3 ) & 0x1E ) | ((word >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 1
- if ( (offset >= 0x2e00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine, 0x100 + offset - 0x2e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x2e00/2) && (offset <= 0x2fff/2) ) { palette_set_color(space->machine(), 0x100 + offset - 0x2e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x6e00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x6e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x6e00/2) && (offset <= 0x6fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x6e00/2, MAKE_RGB(r,g,b) ); return;}
// Road 0
- if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine, 0x300 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3800/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine(), 0x300 + offset - 0x3800/2, MAKE_RGB(r,g,b) ); return;}
// Road 1
- if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine, 0x700 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x4800/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine(), 0x700 + offset - 0x4800/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine, 0xb00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x5000/2) && (offset <= 0x5fff/2) ) { palette_set_color(space->machine(), 0xb00 + offset - 0x5000/2, MAKE_RGB(r,g,b) ); return;}
}
/* F1 GP Star tests:
@@ -420,18 +420,18 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( scudhamm_paletteram16_w )
{
- int newword = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ int newword = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
int r = pal5bit(((newword >> 11) & 0x1E ) | ((newword >> 3) & 0x01));
int g = pal5bit(((newword >> 7 ) & 0x1E ) | ((newword >> 2) & 0x01));
int b = pal5bit(((newword >> 3 ) & 0x1E ) | ((newword >> 1) & 0x01));
// Scroll 0
- if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine, 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x1e00/2) && (offset <= 0x1fff/2) ) { palette_set_color(space->machine(), 0x000 + offset - 0x1e00/2, MAKE_RGB(r,g,b) ); return;}
// Scroll 2
- if ( (offset >= 0x4e00/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine, 0x100 + offset - 0x4e00/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x4e00/2) && (offset <= 0x4fff/2) ) { palette_set_color(space->machine(), 0x100 + offset - 0x4e00/2, MAKE_RGB(r,g,b) ); return;}
// Sprites
- if ( (offset >= 0x3000/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine, 0x200 + offset - 0x3000/2, MAKE_RGB(r,g,b) ); return;}
+ if ( (offset >= 0x3000/2) && (offset <= 0x3fff/2) ) { palette_set_color(space->machine(), 0x200 + offset - 0x3000/2, MAKE_RGB(r,g,b) ); return;}
}
@@ -446,7 +446,7 @@ static WRITE16_HANDLER( scudhamm_paletteram16_w )
READ16_HANDLER( scudhamm_motor_status_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->scudhamm_motor_command; // Motor Status
}
@@ -467,15 +467,15 @@ READ16_HANDLER( scudhamm_motor_pos_r )
static WRITE16_HANDLER( scudhamm_motor_command_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA( &state->scudhamm_motor_command );
}
READ16_HANDLER( scudhamm_analog_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
- int i=input_port_read(space->machine, "IN1"),j;
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
+ int i=input_port_read(space->machine(), "IN1"),j;
if ((i^state->prev)&0x4000) {
if (i<state->prev) state->prev-=0x8000;
@@ -503,15 +503,15 @@ static WRITE16_HANDLER( scudhamm_leds_w )
{
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 0, data & 0x0100); // 3 buttons
- set_led_status(space->machine, 1, data & 0x0200);
- set_led_status(space->machine, 2, data & 0x0400);
+ set_led_status(space->machine(), 0, data & 0x0100); // 3 buttons
+ set_led_status(space->machine(), 1, data & 0x0200);
+ set_led_status(space->machine(), 2, data & 0x0400);
}
if (ACCESSING_BITS_0_7)
{
-// set_led_status(space->machine, 3, data & 0x0010); // if we had more leds..
-// set_led_status(space->machine, 4, data & 0x0020);
+// set_led_status(space->machine(), 3, data & 0x0010); // if we had more leds..
+// set_led_status(space->machine(), 4, data & 0x0020);
}
}
@@ -529,8 +529,8 @@ static WRITE16_HANDLER( scudhamm_oki_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(0x40000 * ((data >> 0) & 0x3) );
oki2->set_bank_base(0x40000 * ((data >> 4) & 0x3) );
}
@@ -566,26 +566,26 @@ static READ16_HANDLER( armchmp2_motor_status_r )
static WRITE16_HANDLER( armchmp2_motor_command_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA( &state->scudhamm_motor_command );
}
static READ16_HANDLER( armchmp2_analog_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
int armdelta;
- armdelta = input_port_read(space->machine, "IN1") - state->armold;
- state->armold = input_port_read(space->machine, "IN1");
+ armdelta = input_port_read(space->machine(), "IN1") - state->armold;
+ state->armold = input_port_read(space->machine(), "IN1");
return ~( state->scudhamm_motor_command + armdelta ); // + x : x<=0 and player loses, x>0 and player wins
}
static READ16_HANDLER( armchmp2_buttons_r )
{
- int arm_x = input_port_read(space->machine, "IN1");
+ int arm_x = input_port_read(space->machine(), "IN1");
- UINT16 ret = input_port_read(space->machine, "IN0");
+ UINT16 ret = input_port_read(space->machine(), "IN0");
if (arm_x < 0x40) ret &= ~1;
else if (arm_x > 0xc0) ret &= ~2;
@@ -606,16 +606,16 @@ static WRITE16_HANDLER( armchmp2_leds_w )
{
if (ACCESSING_BITS_8_15)
{
- set_led_status(space->machine, 0, data & 0x0100);
- set_led_status(space->machine, 1, data & 0x1000);
- set_led_status(space->machine, 2, data & 0x2000);
- set_led_status(space->machine, 3, data & 0x4000);
+ set_led_status(space->machine(), 0, data & 0x0100);
+ set_led_status(space->machine(), 1, data & 0x1000);
+ set_led_status(space->machine(), 2, data & 0x2000);
+ set_led_status(space->machine(), 3, data & 0x4000);
}
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x0040);
- coin_counter_w(space->machine, 1, data & 0x0080);
+ coin_counter_w(space->machine(), 0, data & 0x0040);
+ coin_counter_w(space->machine(), 1, data & 0x0080);
}
}
@@ -727,8 +727,8 @@ static WRITE16_HANDLER( bigrun_soundbank_w )
{
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki1 = space->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = space->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = space->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = space->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(0x40000 * ((data >> 0) & 1) );
oki2->set_bank_base(0x40000 * ((data >> 4) & 1) );
}
@@ -810,13 +810,13 @@ ADDRESS_MAP_END
static READ16_HANDLER ( f1gpstr2_io_r )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
return state->vregs[offset + 0x1000/2];
}
static WRITE16_HANDLER( f1gpstr2_io_w )
{
- cischeat_state *state = space->machine->driver_data<cischeat_state>();
+ cischeat_state *state = space->machine().driver_data<cischeat_state>();
COMBINE_DATA(&state->vregs[offset + 0x1000/2]);
}
@@ -1832,10 +1832,10 @@ MACHINE_CONFIG_END
We need to untangle it
*/
-static void cischeat_untangle_sprites(running_machine *machine, const char *region)
+static void cischeat_untangle_sprites(running_machine &machine, const char *region)
{
- UINT8 *src = machine->region(region)->base();
- const UINT8 *end = src + machine->region(region)->bytes();
+ UINT8 *src = machine.region(region)->base();
+ const UINT8 *end = src + machine.region(region)->bytes();
while (src < end)
{
@@ -1987,9 +1987,9 @@ ROM_END
static DRIVER_INIT( bigrun )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
/* Split ROMs */
- state->rom_1 = (UINT16 *) machine->region("user1")->base();
+ state->rom_1 = (UINT16 *) machine.region("user1")->base();
cischeat_untangle_sprites(machine, "gfx4"); // Untangle sprites
phantasm_rom_decode(machine, "soundcpu"); // Decrypt sound cpu code
@@ -2110,19 +2110,19 @@ ROM_END
static DRIVER_INIT( cischeat )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
/* Split ROMs */
- state->rom_1 = (UINT16 *) (machine->region("user1")->base() + 0x00000);
- state->rom_2 = (UINT16 *) (machine->region("cpu2")->base() + 0x40000);
- state->rom_3 = (UINT16 *) (machine->region("cpu3")->base() + 0x40000);
+ state->rom_1 = (UINT16 *) (machine.region("user1")->base() + 0x00000);
+ state->rom_2 = (UINT16 *) (machine.region("cpu2")->base() + 0x40000);
+ state->rom_3 = (UINT16 *) (machine.region("cpu3")->base() + 0x40000);
- memcpy(machine->region("user1")->base() + 0x80000, state->rom_2, 0x40000);
+ memcpy(machine.region("user1")->base() + 0x80000, state->rom_2, 0x40000);
memset(state->rom_2, 0, 0x40000);
- state->rom_2 = (UINT16 *) (machine->region("user1")->base() + 0x80000);
+ state->rom_2 = (UINT16 *) (machine.region("user1")->base() + 0x80000);
- memcpy(machine->region("user1")->base() + 0xc0000, state->rom_3, 0x40000);
+ memcpy(machine.region("user1")->base() + 0xc0000, state->rom_3, 0x40000);
memset(state->rom_3, 0, 0x40000);
- state->rom_3 = (UINT16 *) (machine->region("user1")->base() + 0xc0000);
+ state->rom_3 = (UINT16 *) (machine.region("user1")->base() + 0xc0000);
cischeat_untangle_sprites(machine, "gfx4"); // Untangle sprites
astyanax_rom_decode(machine, "soundcpu"); // Decrypt sound cpu code
@@ -2338,9 +2338,9 @@ ROM_END
static DRIVER_INIT( f1gpstar )
{
- cischeat_state *state = machine->driver_data<cischeat_state>();
+ cischeat_state *state = machine.driver_data<cischeat_state>();
/* Split ROMs */
- state->rom_1 = (UINT16 *) machine->region("user1")->base();
+ state->rom_1 = (UINT16 *) machine.region("user1")->base();
cischeat_untangle_sprites(machine, "gfx4");
}
@@ -2554,7 +2554,7 @@ ROM_END
static DRIVER_INIT( wildplt )
{
- machine->device("cpu1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x080000, 0x087fff, FUNC(wildplt_vregs_r) );
+ machine.device("cpu1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x080000, 0x087fff, FUNC(wildplt_vregs_r) );
DRIVER_INIT_CALL(f1gpstar);
}
diff --git a/src/mame/drivers/citycon.c b/src/mame/drivers/citycon.c
index 97b17e85a58..41d3fdea51e 100644
--- a/src/mame/drivers/citycon.c
+++ b/src/mame/drivers/citycon.c
@@ -16,12 +16,12 @@ Dip locations added from dip listing at crazykong.com
static READ8_HANDLER( citycon_in_r )
{
- return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1");
+ return input_port_read(space->machine(), flip_screen_get(space->machine()) ? "P2" : "P1");
}
static READ8_HANDLER( citycon_irq_ack_r )
{
- citycon_state *state = space->machine->driver_data<citycon_state>();
+ citycon_state *state = space->machine().driver_data<citycon_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@@ -189,16 +189,16 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( citycon )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->bg_image));
}
static MACHINE_RESET( citycon )
{
- citycon_state *state = machine->driver_data<citycon_state>();
+ citycon_state *state = machine.driver_data<citycon_state>();
state->bg_image = 0;
}
@@ -340,7 +340,7 @@ ROM_END
static DRIVER_INIT( citycon )
{
- UINT8 *rom = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("gfx1")->base();
int i;
/*
diff --git a/src/mame/drivers/clayshoo.c b/src/mame/drivers/clayshoo.c
index 7b73482d23d..a075b5add0b 100644
--- a/src/mame/drivers/clayshoo.c
+++ b/src/mame/drivers/clayshoo.c
@@ -42,12 +42,12 @@ public:
static WRITE8_DEVICE_HANDLER( input_port_select_w )
{
- clayshoo_state *state = device->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = device->machine().driver_data<clayshoo_state>();
state->input_port_select = data;
}
-static UINT8 difficulty_input_port_r( running_machine *machine, int bit )
+static UINT8 difficulty_input_port_r( running_machine &machine, int bit )
{
UINT8 ret = 0;
@@ -67,16 +67,16 @@ static UINT8 difficulty_input_port_r( running_machine *machine, int bit )
static READ8_DEVICE_HANDLER( input_port_r )
{
- clayshoo_state *state = device->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = device->machine().driver_data<clayshoo_state>();
UINT8 ret = 0;
switch (state->input_port_select)
{
- case 0x01: ret = input_port_read(device->machine, "IN0"); break;
- case 0x02: ret = input_port_read(device->machine, "IN1"); break;
- case 0x04: ret = (input_port_read(device->machine, "IN2") & 0xf0) | difficulty_input_port_r(device->machine, 0) |
- (difficulty_input_port_r(device->machine, 3) << 2); break;
- case 0x08: ret = input_port_read(device->machine, "IN3"); break;
+ case 0x01: ret = input_port_read(device->machine(), "IN0"); break;
+ case 0x02: ret = input_port_read(device->machine(), "IN1"); break;
+ case 0x04: ret = (input_port_read(device->machine(), "IN2") & 0xf0) | difficulty_input_port_r(device->machine(), 0) |
+ (difficulty_input_port_r(device->machine(), 3) << 2); break;
+ case 0x08: ret = input_port_read(device->machine(), "IN3"); break;
case 0x10:
case 0x20: break; /* these two are not really used */
default: logerror("Unexpected port read: %02X\n", state->input_port_select);
@@ -94,7 +94,7 @@ static READ8_DEVICE_HANDLER( input_port_r )
static TIMER_CALLBACK( reset_analog_bit )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
state->analog_port_val &= ~param;
}
@@ -109,7 +109,7 @@ static attotime compute_duration( device_t *device, int analog_pos )
static WRITE8_HANDLER( analog_reset_w )
{
- clayshoo_state *state = space->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = space->machine().driver_data<clayshoo_state>();
/* reset the analog value, and start the two times that will fire
off in a short period proportional to the position of the
@@ -117,23 +117,23 @@ static WRITE8_HANDLER( analog_reset_w )
state->analog_port_val = 0xff;
- state->analog_timer_1->adjust(compute_duration(space->cpu, input_port_read(space->machine, "AN1")), 0x02);
- state->analog_timer_2->adjust(compute_duration(space->cpu, input_port_read(space->machine, "AN2")), 0x01);
+ state->analog_timer_1->adjust(compute_duration(space->cpu, input_port_read(space->machine(), "AN1")), 0x02);
+ state->analog_timer_2->adjust(compute_duration(space->cpu, input_port_read(space->machine(), "AN2")), 0x01);
}
static READ8_HANDLER( analog_r )
{
- clayshoo_state *state = space->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = space->machine().driver_data<clayshoo_state>();
return state->analog_port_val;
}
-static void create_analog_timers( running_machine *machine )
+static void create_analog_timers( running_machine &machine )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
- state->analog_timer_1 = machine->scheduler().timer_alloc(FUNC(reset_analog_bit));
- state->analog_timer_2 = machine->scheduler().timer_alloc(FUNC(reset_analog_bit));
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
+ state->analog_timer_1 = machine.scheduler().timer_alloc(FUNC(reset_analog_bit));
+ state->analog_timer_2 = machine.scheduler().timer_alloc(FUNC(reset_analog_bit));
}
@@ -167,7 +167,7 @@ static const ppi8255_interface ppi8255_intf[2] =
static MACHINE_START( clayshoo )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
create_analog_timers(machine);
/* register for state saving */
@@ -185,7 +185,7 @@ static MACHINE_START( clayshoo )
static SCREEN_UPDATE( clayshoo )
{
- clayshoo_state *state = screen->machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = screen->machine().driver_data<clayshoo_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -315,7 +315,7 @@ INPUT_PORTS_END
static MACHINE_RESET( clayshoo )
{
- clayshoo_state *state = machine->driver_data<clayshoo_state>();
+ clayshoo_state *state = machine.driver_data<clayshoo_state>();
state->input_port_select = 0;
state->analog_port_val = 0;
diff --git a/src/mame/drivers/cliffhgr.c b/src/mame/drivers/cliffhgr.c
index 905bb63d645..4d230215879 100644
--- a/src/mame/drivers/cliffhgr.c
+++ b/src/mame/drivers/cliffhgr.c
@@ -95,7 +95,7 @@ static emu_timer *irq_timer;
static WRITE8_HANDLER( cliff_test_led_w )
{
- set_led_status(space->machine, 0, offset ^ 1);
+ set_led_status(space->machine(), 0, offset ^ 1);
}
static WRITE8_HANDLER( cliff_port_bank_w )
@@ -112,7 +112,7 @@ static READ8_HANDLER( cliff_port_r )
static const char *const banknames[] = { "BANK0", "BANK1", "BANK2", "BANK3", "BANK4", "BANK5", "BANK6" };
if (port_bank < 7)
- return input_port_read(space->machine, banknames[port_bank]);
+ return input_port_read(space->machine(), banknames[port_bank]);
/* output is pulled up for non-mapped ports */
return 0xff;
@@ -133,13 +133,13 @@ static WRITE8_HANDLER( cliff_phillips_clear_w )
static WRITE8_HANDLER( cliff_coin_counter_w )
{
- coin_counter_w(space->machine, 0, (data & 0x40) ? 1 : 0 );
+ coin_counter_w(space->machine(), 0, (data & 0x40) ? 1 : 0 );
}
static READ8_HANDLER( cliff_irq_ack_r )
{
/* deassert IRQ on the CPU */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
return 0x00;
}
@@ -152,13 +152,13 @@ static WRITE8_DEVICE_HANDLER( cliff_sound_overlay_w )
/* configure pen 0 and 1 as transparent in the renderer and use it as the compositing color */
if (overlay)
{
- palette_set_color(device->machine, 0, palette_get_color(device->machine, 0) & MAKE_ARGB(0,255,255,255));
- palette_set_color(device->machine, 1, palette_get_color(device->machine, 1) & MAKE_ARGB(0,255,255,255));
+ palette_set_color(device->machine(), 0, palette_get_color(device->machine(), 0) & MAKE_ARGB(0,255,255,255));
+ palette_set_color(device->machine(), 1, palette_get_color(device->machine(), 1) & MAKE_ARGB(0,255,255,255));
}
else
{
- palette_set_color(device->machine, 0, palette_get_color(device->machine, 0) | MAKE_ARGB(255,0,0,0));
- palette_set_color(device->machine, 1, palette_get_color(device->machine, 1) | MAKE_ARGB(255,0,0,0));
+ palette_set_color(device->machine(), 0, palette_get_color(device->machine(), 0) | MAKE_ARGB(255,0,0,0));
+ palette_set_color(device->machine(), 1, palette_get_color(device->machine(), 1) | MAKE_ARGB(255,0,0,0));
}
/* audio */
@@ -177,7 +177,7 @@ static WRITE8_HANDLER( cliff_ldwire_w )
static INTERRUPT_GEN( cliff_vsync )
{
/* clock the video chip every 60Hz */
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
static TIMER_CALLBACK( cliff_irq_callback )
@@ -204,10 +204,10 @@ static TIMER_CALLBACK( cliff_irq_callback )
cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
}
- irq_timer->adjust(machine->primary_screen->time_until_pos(param * 2), param);
+ irq_timer->adjust(machine.primary_screen->time_until_pos(param * 2), param);
}
-static void vdp_interrupt(running_machine *machine, int state)
+static void vdp_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -216,15 +216,15 @@ static void vdp_interrupt(running_machine *machine, int state)
static MACHINE_START( cliffhgr )
{
- laserdisc = machine->device("laserdisc");
- irq_timer = machine->scheduler().timer_alloc(FUNC(cliff_irq_callback));
+ laserdisc = machine.device("laserdisc");
+ irq_timer = machine.scheduler().timer_alloc(FUNC(cliff_irq_callback));
}
static MACHINE_RESET( cliffhgr )
{
port_bank = 0;
phillips_code = 0;
- irq_timer->adjust(machine->primary_screen->time_until_pos(17), 17);
+ irq_timer->adjust(machine.primary_screen->time_until_pos(17), 17);
}
/********************************************************/
diff --git a/src/mame/drivers/cloak.c b/src/mame/drivers/cloak.c
index 8cb68018fad..a3a9e147754 100644
--- a/src/mame/drivers/cloak.c
+++ b/src/mame/drivers/cloak.c
@@ -129,12 +129,12 @@
static WRITE8_HANDLER( cloak_led_w )
{
- set_led_status(space->machine, 1 - offset, ~data & 0x80);
+ set_led_status(space->machine(), 1 - offset, ~data & 0x80);
}
static WRITE8_HANDLER( cloak_coin_counter_w )
{
- coin_counter_w(space->machine, 1 - offset, data & 0x80);
+ coin_counter_w(space->machine(), 1 - offset, data & 0x80);
}
static WRITE8_HANDLER( cloak_custom_w )
@@ -143,17 +143,17 @@ static WRITE8_HANDLER( cloak_custom_w )
static WRITE8_HANDLER( cloak_irq_reset_0_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( cloak_irq_reset_1_w )
{
- cputag_set_input_line(space->machine, "slave", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "slave", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( cloak_nvram_enable_w )
{
- cloak_state *state = space->machine->driver_data<cloak_state>();
+ cloak_state *state = space->machine().driver_data<cloak_state>();
state->nvram_enabled = data & 0x01;
}
diff --git a/src/mame/drivers/cloud9.c b/src/mame/drivers/cloud9.c
index 448781bb7ba..0822b944256 100644
--- a/src/mame/drivers/cloud9.c
+++ b/src/mame/drivers/cloud9.c
@@ -110,21 +110,21 @@
*
*************************************/
-INLINE void schedule_next_irq(running_machine *machine, int curscanline)
+INLINE void schedule_next_irq(running_machine &machine, int curscanline)
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
/* IRQ is clocked by /32V, so every 64 scanlines */
curscanline = (curscanline + 64) & 255;
/* next one at the start of this scanline */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(curscanline), curscanline);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(curscanline), curscanline);
}
static TIMER_CALLBACK( clock_irq )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
/* assert the IRQ if not already asserted */
if (!state->irq_state)
{
@@ -133,7 +133,7 @@ static TIMER_CALLBACK( clock_irq )
}
/* force an update now */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* find the next edge */
schedule_next_irq(machine, param);
@@ -142,8 +142,8 @@ static TIMER_CALLBACK( clock_irq )
static CUSTOM_INPUT( get_vblank )
{
- cloud9_state *state = field->port->machine->driver_data<cloud9_state>();
- int scanline = field->port->machine->primary_screen->vpos();
+ cloud9_state *state = field->port->machine().driver_data<cloud9_state>();
+ int scanline = field->port->machine().primary_screen->vpos();
return (~state->syncprom[scanline & 0xff] >> 1) & 1;
}
@@ -157,11 +157,11 @@ static CUSTOM_INPUT( get_vblank )
static MACHINE_START( cloud9 )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
rectangle visarea;
/* initialize globals */
- state->syncprom = machine->region("proms")->base() + 0x000;
+ state->syncprom = machine.region("proms")->base() + 0x000;
/* find the start of VBLANK in the SYNC PROM */
for (state->vblank_start = 0; state->vblank_start < 256; state->vblank_start++)
@@ -183,10 +183,10 @@ static MACHINE_START( cloud9 )
visarea.max_x = 255;
visarea.min_y = state->vblank_end + 1;
visarea.max_y = state->vblank_start;
- machine->primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
+ machine.primary_screen->configure(320, 256, visarea, HZ_TO_ATTOSECONDS(PIXEL_CLOCK) * VTOTAL * HTOTAL);
/* create a timer for IRQs and set up the first callback */
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(clock_irq));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(clock_irq));
state->irq_state = 0;
schedule_next_irq(machine, 0-64);
@@ -197,7 +197,7 @@ static MACHINE_START( cloud9 )
static MACHINE_RESET( cloud9 )
{
- cloud9_state *state = machine->driver_data<cloud9_state>();
+ cloud9_state *state = machine.driver_data<cloud9_state>();
cputag_set_input_line(machine, "maincpu", 0, CLEAR_LINE);
state->irq_state = 0;
}
@@ -212,7 +212,7 @@ static MACHINE_RESET( cloud9 )
static WRITE8_HANDLER( irq_ack_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
if (state->irq_state)
{
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -223,19 +223,19 @@ static WRITE8_HANDLER( irq_ack_w )
static WRITE8_HANDLER( cloud9_led_w )
{
- set_led_status(space->machine, offset, ~data & 0x80);
+ set_led_status(space->machine(), offset, ~data & 0x80);
}
static WRITE8_HANDLER( cloud9_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 0x80);
+ coin_counter_w(space->machine(), offset, data & 0x80);
}
static READ8_HANDLER( leta_r )
{
- return input_port_read(space->machine, offset ? "TRACKX" : "TRACKY");
+ return input_port_read(space->machine(), offset ? "TRACKX" : "TRACKY");
}
@@ -248,7 +248,7 @@ static READ8_HANDLER( leta_r )
static WRITE8_HANDLER( nvram_recall_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
state->nvram->recall(0);
state->nvram->recall(1);
state->nvram->recall(0);
@@ -257,7 +257,7 @@ static WRITE8_HANDLER( nvram_recall_w )
static WRITE8_HANDLER( nvram_store_w )
{
- cloud9_state *state = space->machine->driver_data<cloud9_state>();
+ cloud9_state *state = space->machine().driver_data<cloud9_state>();
state->nvram->store(0);
state->nvram->store(1);
state->nvram->store(0);
diff --git a/src/mame/drivers/clshroad.c b/src/mame/drivers/clshroad.c
index 026453daa76..5e26ff5f35b 100644
--- a/src/mame/drivers/clshroad.c
+++ b/src/mame/drivers/clshroad.c
@@ -30,10 +30,10 @@ static MACHINE_RESET( clshroad )
static READ8_HANDLER( clshroad_input_r )
{
- return ((~input_port_read(space->machine, "P1") & (1 << offset)) ? 1 : 0) |
- ((~input_port_read(space->machine, "P2") & (1 << offset)) ? 2 : 0) |
- ((~input_port_read(space->machine, "DSW1") & (1 << offset)) ? 4 : 0) |
- ((~input_port_read(space->machine, "DSW2") & (1 << offset)) ? 8 : 0) ;
+ return ((~input_port_read(space->machine(), "P1") & (1 << offset)) ? 1 : 0) |
+ ((~input_port_read(space->machine(), "P2") & (1 << offset)) ? 2 : 0) |
+ ((~input_port_read(space->machine(), "DSW1") & (1 << offset)) ? 4 : 0) |
+ ((~input_port_read(space->machine(), "DSW2") & (1 << offset)) ? 8 : 0) ;
}
@@ -473,7 +473,7 @@ without this the death sequence never ends so the game is unplayable after you
die once, it would be nice to avoid the hack however
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x05C6] = 0xc3;
ROM[0x05C7] = 0x8d;
diff --git a/src/mame/drivers/cmmb.c b/src/mame/drivers/cmmb.c
index a6a26a1ec3f..0d420f8c6cb 100644
--- a/src/mame/drivers/cmmb.c
+++ b/src/mame/drivers/cmmb.c
@@ -60,9 +60,9 @@ static VIDEO_START( cmmb )
static SCREEN_UPDATE( cmmb )
{
- cmmb_state *state = screen->machine->driver_data<cmmb_state>();
+ cmmb_state *state = screen->machine().driver_data<cmmb_state>();
UINT8 *videoram = state->videoram;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x00000;
int y,x;
@@ -85,22 +85,22 @@ static SCREEN_UPDATE( cmmb )
static READ8_HANDLER( cmmb_charram_r )
{
- UINT8 *GFX = space->machine->region("gfx")->base();
+ UINT8 *GFX = space->machine().region("gfx")->base();
return GFX[offset];
}
static WRITE8_HANDLER( cmmb_charram_w )
{
- UINT8 *GFX = space->machine->region("gfx")->base();
+ UINT8 *GFX = space->machine().region("gfx")->base();
GFX[offset] = data;
offset&=0xfff;
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[0], offset >> 4);
- gfx_element_mark_dirty(space->machine->gfx[1], offset >> 5);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset >> 4);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset >> 5);
}
@@ -115,10 +115,10 @@ static READ8_HANDLER( cmmb_input_r )
//printf("%02x R\n",offset);
switch(offset)
{
- case 0x00: return input_port_read(space->machine, "IN2");
+ case 0x00: return input_port_read(space->machine(), "IN2");
case 0x03: return 4; //eeprom?
- case 0x0e: return input_port_read(space->machine, "IN0");
- case 0x0f: return input_port_read(space->machine, "IN1");
+ case 0x0e: return input_port_read(space->machine(), "IN0");
+ case 0x0f: return input_port_read(space->machine(), "IN1");
}
return 0xff;
@@ -127,27 +127,27 @@ static READ8_HANDLER( cmmb_input_r )
/*
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000 + (0x10000 * (data & 0x03));
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
*/
static WRITE8_HANDLER( cmmb_output_w )
{
- cmmb_state *state = space->machine->driver_data<cmmb_state>();
+ cmmb_state *state = space->machine().driver_data<cmmb_state>();
//printf("%02x -> [%02x] W\n",data,offset);
switch(offset)
{
case 0x01:
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x1c000 + (0x10000 * (data & 0x03));
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
break;
case 0x03:
@@ -160,7 +160,7 @@ static WRITE8_HANDLER( cmmb_output_w )
static READ8_HANDLER( kludge_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
/* overlap empty addresses */
@@ -288,7 +288,7 @@ GFXDECODE_END
static INTERRUPT_GEN( cmmb_irq )
{
- //if(input_code_pressed_once(device->machine, KEYCODE_Z))
+ //if(input_code_pressed_once(device->machine(), KEYCODE_Z))
// device_set_input_line(device, 0, HOLD_LINE);
}
diff --git a/src/mame/drivers/cninja.c b/src/mame/drivers/cninja.c
index f37330361c5..2e86edee9f9 100644
--- a/src/mame/drivers/cninja.c
+++ b/src/mame/drivers/cninja.c
@@ -56,7 +56,7 @@ Note about version levels using Mutant Fighter as the example:
static WRITE16_HANDLER( cninja_sound_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
@@ -64,7 +64,7 @@ static WRITE16_HANDLER( cninja_sound_w )
static WRITE16_HANDLER( stoneage_sound_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -72,7 +72,7 @@ static WRITE16_HANDLER( stoneage_sound_w )
static TIMER_DEVICE_CALLBACK( interrupt_gen )
{
- cninja_state *state = timer.machine->driver_data<cninja_state>();
+ cninja_state *state = timer.machine().driver_data<cninja_state>();
device_set_input_line(state->maincpu, (state->irq_mask & 0x10) ? 3 : 4, ASSERT_LINE);
state->raster_irq_timer->reset();
@@ -80,7 +80,7 @@ static TIMER_DEVICE_CALLBACK( interrupt_gen )
static READ16_HANDLER( cninja_irq_r )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
switch (offset)
{
@@ -100,7 +100,7 @@ static READ16_HANDLER( cninja_irq_r )
static WRITE16_HANDLER( cninja_irq_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
switch (offset)
{
@@ -118,7 +118,7 @@ static WRITE16_HANDLER( cninja_irq_w )
state->scanline = data & 0xff;
if (!BIT(state->irq_mask, 1) && state->scanline > 0 && state->scanline < 240)
- state->raster_irq_timer->adjust(space->machine->primary_screen->time_until_pos(state->scanline), state->scanline);
+ state->raster_irq_timer->adjust(space->machine().primary_screen->time_until_pos(state->scanline), state->scanline);
else
state->raster_irq_timer->reset();
return;
@@ -135,11 +135,11 @@ static READ16_HANDLER( robocop2_prot_r )
switch (offset << 1)
{
case 0x41a: /* Player 1 & 2 input ports */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x320: /* Coins */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x4e6: /* Dip switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0x504: /* PC: 6b6. b4, 2c, 36 written before read */
logerror("Protection PC %06x: warning - read unmapped memory address %04x\n", cpu_get_pc(space->cpu), offset);
return 0x84;
@@ -152,17 +152,17 @@ static READ16_HANDLER( robocop2_prot_r )
static WRITE16_HANDLER( cninja_pf12_control_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
deco16ic_pf_control_w(state->deco_tilegen1, offset, data, mem_mask);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
static WRITE16_HANDLER( cninja_pf34_control_w )
{
- cninja_state *state = space->machine->driver_data<cninja_state>();
+ cninja_state *state = space->machine().driver_data<cninja_state>();
deco16ic_pf_control_w(state->deco_tilegen2, offset, data, mem_mask);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
@@ -722,19 +722,19 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cninja_state *driver_state = device->machine->driver_data<cninja_state>();
+ cninja_state *driver_state = device->machine().driver_data<cninja_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
static void sound_irq2(device_t *device, int state)
{
- cninja_state *driver_state = device->machine->driver_data<cninja_state>();
+ cninja_state *driver_state = device->machine().driver_data<cninja_state>();
device_set_input_line(driver_state->audiocpu, 0, state);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- cninja_state *state = device->machine->driver_data<cninja_state>();
+ cninja_state *state = device->machine().driver_data<cninja_state>();
/* the second OKIM6295 ROM is bank switched */
state->oki2->set_bank_base((data & 1) * 0x40000);
@@ -883,7 +883,7 @@ static const deco16ic_interface mutantf_deco16ic_tilegen2_intf =
static MACHINE_START( cninja )
{
- cninja_state *state = machine->driver_data<cninja_state>();
+ cninja_state *state = machine.driver_data<cninja_state>();
state->save_item(NAME(state->scanline));
state->save_item(NAME(state->irq_mask));
@@ -891,7 +891,7 @@ static MACHINE_START( cninja )
static MACHINE_RESET( cninja )
{
- cninja_state *state = machine->driver_data<cninja_state>();
+ cninja_state *state = machine.driver_data<cninja_state>();
state->scanline = 0;
state->irq_mask = 0;
@@ -2002,9 +2002,9 @@ ROM_END
/**********************************************************************************/
-static void cninja_patch( running_machine *machine )
+static void cninja_patch( running_machine &machine )
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x80000 / 2; i++)
@@ -2032,19 +2032,19 @@ static void cninja_patch( running_machine *machine )
static DRIVER_INIT( cninja )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(cninja_sound_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(cninja_sound_w));
cninja_patch(machine);
}
static DRIVER_INIT( stoneage )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(stoneage_sound_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1bc0a8, 0x1bc0a9, FUNC(stoneage_sound_w));
}
static DRIVER_INIT( mutantf )
{
- const UINT8 *src = machine->region("gfx2")->base();
- UINT8 *dst = machine->region("gfx1")->base();
+ const UINT8 *src = machine.region("gfx2")->base();
+ UINT8 *dst = machine.region("gfx1")->base();
/* The 16x16 graphic has some 8x8 chars in it - decode them in GFX1 */
memcpy(dst + 0x50000, dst + 0x10000, 0x10000);
diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c
index f0da1441214..a5bfdde9ef5 100644
--- a/src/mame/drivers/cntsteer.c
+++ b/src/mame/drivers/cntsteer.c
@@ -63,7 +63,7 @@ public:
static PALETTE_INIT( zerotrgt )
{
int i;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2, r, g, b;
@@ -89,7 +89,7 @@ static PALETTE_INIT( zerotrgt )
static TILE_GET_INFO( get_bg_tile_info )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int code = state->videoram2[tile_index];
SET_TILE_INFO(2, code + state->bg_bank, state->bg_color_bank, 0);
@@ -97,7 +97,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int code = state->videoram[tile_index];
int attr = state->colorram[tile_index];
@@ -108,7 +108,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( cntsteer )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_cols, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows_flip_x, 8, 8, 32, 32);
@@ -119,7 +119,7 @@ static VIDEO_START( cntsteer )
static VIDEO_START( zerotrgt )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 64, 64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows_flip_x, 8, 8, 32, 32);
@@ -141,9 +141,9 @@ Sprite list:
[2] xxxx xxxx X attribute
[3] xxxx xxxx sprite number
*/
-static void zerotrgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void zerotrgt_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int offs;
for (offs = 0; offs < 0x200; offs += 4)
@@ -176,17 +176,17 @@ static void zerotrgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
{
if (fy)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy - 16, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy, 0);
}
}
else
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
}
}
@@ -199,9 +199,9 @@ static void zerotrgt_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
---- --xx tile bank
*/
-static void cntsteer_draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void cntsteer_draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
int offs;
for (offs = 0; offs < 0x80; offs += 4)
@@ -234,26 +234,26 @@ static void cntsteer_draw_sprites( running_machine *machine, bitmap_t *bitmap, c
{
if (fy)
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy - 16, 0);
}
else
{
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy - 16, 0);
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code + 1, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy - 16, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code + 1, color, fx, fy, sx, sy, 0);
}
}
else
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, fx, fy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, fx, fy, sx, sy, 0);
}
}
static SCREEN_UPDATE( zerotrgt )
{
- cntsteer_state *state = screen->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = screen->machine().driver_data<cntsteer_state>();
if (state->disable_roz)
- bitmap_fill(bitmap, cliprect, screen->machine->pens[8 * state->bg_color_bank]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[8 * state->bg_color_bank]);
else
{
int p1, p2, p3, p4;
@@ -293,7 +293,7 @@ static SCREEN_UPDATE( zerotrgt )
0, 0);
}
- zerotrgt_draw_sprites(screen->machine, bitmap, cliprect);
+ zerotrgt_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -301,10 +301,10 @@ static SCREEN_UPDATE( zerotrgt )
static SCREEN_UPDATE( cntsteer )
{
- cntsteer_state *state = screen->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = screen->machine().driver_data<cntsteer_state>();
if (state->disable_roz)
- bitmap_fill(bitmap, cliprect, screen->machine->pens[8 * state->bg_color_bank]);
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[8 * state->bg_color_bank]);
else
{
int p1, p2, p3, p4;
@@ -342,7 +342,7 @@ static SCREEN_UPDATE( cntsteer )
0, 0);
}
- cntsteer_draw_sprites(screen->machine, bitmap, cliprect);
+ cntsteer_draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -362,7 +362,7 @@ static SCREEN_UPDATE( cntsteer )
*/
static WRITE8_HANDLER(zerotrgt_vregs_w)
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
// static UINT8 test[5];
// test[offset] = data;
@@ -378,7 +378,7 @@ static WRITE8_HANDLER(zerotrgt_vregs_w)
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
break;
case 3: state->rotation_sign = (data & 1);
- flip_screen_set(space->machine, !(data & 4));
+ flip_screen_set(space->machine(), !(data & 4));
state->scrolly_hi = (data & 0x30) << 4;
state->scrollx_hi = (data & 0xc0) << 2;
break;
@@ -388,7 +388,7 @@ static WRITE8_HANDLER(zerotrgt_vregs_w)
static WRITE8_HANDLER(cntsteer_vregs_w)
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
// static UINT8 test[5];
// test[offset] = data;
@@ -413,21 +413,21 @@ static WRITE8_HANDLER(cntsteer_vregs_w)
static WRITE8_HANDLER( cntsteer_foreground_vram_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE8_HANDLER( cntsteer_foreground_attr_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE8_HANDLER( cntsteer_background_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -440,20 +440,20 @@ static WRITE8_HANDLER( cntsteer_background_w )
static WRITE8_HANDLER( gekitsui_sub_irq_ack )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
device_set_input_line(state->subcpu, M6809_IRQ_LINE, CLEAR_LINE);
}
static WRITE8_HANDLER( cntsteer_sound_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static WRITE8_HANDLER( zerotrgt_ctrl_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
/*TODO: check this.*/
logerror("CTRL: %04x: %04x: %04x\n", cpu_get_pc(space->cpu), offset, data);
// if (offset == 0) device_set_input_line(state->subcpu, INPUT_LINE_RESET, ASSERT_LINE);
@@ -465,7 +465,7 @@ static WRITE8_HANDLER( zerotrgt_ctrl_w )
static WRITE8_HANDLER( cntsteer_sub_irq_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
device_set_input_line(state->subcpu, M6809_IRQ_LINE, ASSERT_LINE);
// printf("%02x IRQ\n", data);
}
@@ -479,7 +479,7 @@ static WRITE8_HANDLER( cntsteer_sub_nmi_w )
static WRITE8_HANDLER( cntsteer_main_irq_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, HOLD_LINE);
}
@@ -487,7 +487,7 @@ static WRITE8_HANDLER( cntsteer_main_irq_w )
static READ8_HANDLER( cntsteer_adx_r )
{
UINT8 res = 0, adx_val;
- adx_val = input_port_read(space->machine, "AN_STEERING");
+ adx_val = input_port_read(space->machine(), "AN_STEERING");
if (adx_val >= 0x70 && adx_val <= 0x90)
res = 0xff;
@@ -572,13 +572,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( nmimask_w )
{
- cntsteer_state *state = space->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = space->machine().driver_data<cntsteer_state>();
state->nmimask = data & 0x80;
}
static INTERRUPT_GEN ( sound_interrupt )
{
- cntsteer_state *state = device->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = device->machine().driver_data<cntsteer_state>();
if (!state->nmimask)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -667,7 +667,7 @@ INPUT_PORTS_END
static INPUT_CHANGED( coin_inserted )
{
- cntsteer_state *state = field->port->machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = field->port->machine().driver_data<cntsteer_state>();
device_set_input_line(state->subcpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -800,11 +800,11 @@ GFXDECODE_END
static MACHINE_START( cntsteer )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("subcpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("subcpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->bg_bank));
@@ -821,7 +821,7 @@ static MACHINE_START( cntsteer )
static MACHINE_START( zerotrgt )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->save_item(NAME(state->nmimask));
MACHINE_START_CALL(cntsteer);
@@ -830,7 +830,7 @@ static MACHINE_START( zerotrgt )
static MACHINE_RESET( cntsteer )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->flipscreen = 0;
state->bg_bank = 0;
@@ -848,7 +848,7 @@ static MACHINE_RESET( cntsteer )
static MACHINE_RESET( zerotrgt )
{
- cntsteer_state *state = machine->driver_data<cntsteer_state>();
+ cntsteer_state *state = machine.driver_data<cntsteer_state>();
state->nmimask = 0;
MACHINE_RESET_CALL(cntsteer);
@@ -1132,10 +1132,10 @@ ROM_END
/***************************************************************************/
-static void zerotrgt_rearrange_gfx( running_machine *machine, int romsize, int romarea )
+static void zerotrgt_rearrange_gfx( running_machine &machine, int romsize, int romarea )
{
- UINT8 *src = machine->region("gfx4")->base();
- UINT8 *dst = machine->region("gfx3")->base();
+ UINT8 *src = machine.region("gfx4")->base();
+ UINT8 *dst = machine.region("gfx3")->base();
int rm;
int cnt1;
@@ -1154,7 +1154,7 @@ static void zerotrgt_rearrange_gfx( running_machine *machine, int romsize, int r
#if 0
static DRIVER_INIT( cntsteer )
{
- UINT8 *RAM = machine->region("subcpu")->base();
+ UINT8 *RAM = machine.region("subcpu")->base();
RAM[0xc2cf] = 0x43; /* Patch out Cpu 1 ram test - it never ends..?! */
RAM[0xc2d0] = 0x43;
diff --git a/src/mame/drivers/coinmstr.c b/src/mame/drivers/coinmstr.c
index fe4acd4a060..c69b20b4782 100644
--- a/src/mame/drivers/coinmstr.c
+++ b/src/mame/drivers/coinmstr.c
@@ -46,7 +46,7 @@ public:
static WRITE8_HANDLER( quizmstr_bg_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
UINT8 *videoram = state->videoram;
videoram[offset] = data;
@@ -55,7 +55,7 @@ static WRITE8_HANDLER( quizmstr_bg_w )
}
-static void coinmstr_set_pal(running_machine *machine, UINT32 paldat, int col)
+static void coinmstr_set_pal(running_machine &machine, UINT32 paldat, int col)
{
col = col *4;
@@ -90,7 +90,7 @@ static void coinmstr_set_pal(running_machine *machine, UINT32 paldat, int col)
static WRITE8_HANDLER( quizmstr_attr1_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
state->attr_ram1[offset] = data;
if(offset >= 0x0240)
@@ -99,14 +99,14 @@ static WRITE8_HANDLER( quizmstr_attr1_w )
UINT32 paldata = (state->attr_ram1[offset] & 0x7f) | ((state->attr_ram2[offset] & 0x7f) << 7);
tilemap_mark_tile_dirty(state->bg_tilemap, offset - 0x0240);
- coinmstr_set_pal(space->machine, paldata, offset - 0x240);
+ coinmstr_set_pal(space->machine(), paldata, offset - 0x240);
}
}
static WRITE8_HANDLER( quizmstr_attr2_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
state->attr_ram2[offset] = data;
if(offset >= 0x0240)
@@ -115,14 +115,14 @@ static WRITE8_HANDLER( quizmstr_attr2_w )
UINT32 paldata = (state->attr_ram1[offset] & 0x7f) | ((state->attr_ram2[offset] & 0x7f) << 7);
tilemap_mark_tile_dirty(state->bg_tilemap, offset - 0x0240);
- coinmstr_set_pal(space->machine, paldata, offset - 0x240);
+ coinmstr_set_pal(space->machine(), paldata, offset - 0x240);
}
}
static WRITE8_HANDLER( quizmstr_attr3_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
state->attr_ram3[offset] = data;
if(offset >= 0x0240)
@@ -133,9 +133,9 @@ static WRITE8_HANDLER( quizmstr_attr3_w )
static READ8_HANDLER( question_r )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
int address;
- UINT8 *questions = space->machine->region("user1")->base();
+ UINT8 *questions = space->machine().region("user1")->base();
switch(state->question_adr[2])
{
@@ -182,7 +182,7 @@ static READ8_HANDLER( question_r )
static WRITE8_HANDLER( question_w )
{
- coinmstr_state *state = space->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = space->machine().driver_data<coinmstr_state>();
if(data != state->question_adr[offset])
{
logerror("offset = %d data = %02X\n",offset,data);
@@ -895,7 +895,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_bg_tile_info )
{
- coinmstr_state *state = machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = machine.driver_data<coinmstr_state>();
UINT8 *videoram = state->videoram;
int tile = videoram[tile_index + 0x0240];
int color = tile_index;
@@ -910,13 +910,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( coinmstr )
{
- coinmstr_state *state = machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = machine.driver_data<coinmstr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 46, 32);
}
static SCREEN_UPDATE( coinmstr )
{
- coinmstr_state *state = screen->machine->driver_data<coinmstr_state>();
+ coinmstr_state *state = screen->machine().driver_data<coinmstr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -1211,8 +1211,8 @@ ROM_END
static DRIVER_INIT( coinmstr )
{
- UINT8 *rom = machine->region("user1")->base();
- int length = machine->region("user1")->bytes();
+ UINT8 *rom = machine.region("user1")->base();
+ int length = machine.region("user1")->bytes();
UINT8 *buf = auto_alloc_array(machine, UINT8, length);
int i;
diff --git a/src/mame/drivers/coinmvga.c b/src/mame/drivers/coinmvga.c
index afc32265ba6..829d6de082a 100644
--- a/src/mame/drivers/coinmvga.c
+++ b/src/mame/drivers/coinmvga.c
@@ -242,8 +242,8 @@ static VIDEO_START( coinmvga )
static SCREEN_UPDATE( coinmvga )
{
- coinmvga_state *state = screen->machine->driver_data<coinmvga_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ coinmvga_state *state = screen->machine().driver_data<coinmvga_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x04000/2;
int y,x;
@@ -283,7 +283,7 @@ static PALETTE_INIT( coinmvga )
static WRITE16_HANDLER( ramdac_bg_w )
{
- coinmvga_state *state = space->machine->driver_data<coinmvga_state>();
+ coinmvga_state *state = space->machine().driver_data<coinmvga_state>();
if(ACCESSING_BITS_8_15)
{
state->bgpal.offs = data >> 8;
@@ -303,7 +303,7 @@ static WRITE16_HANDLER( ramdac_bg_w )
break;
case 2:
state->bgpal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->bgpal.offs, MAKE_RGB(state->bgpal.r, state->bgpal.g, state->bgpal.b));
+ palette_set_color(space->machine(), state->bgpal.offs, MAKE_RGB(state->bgpal.r, state->bgpal.g, state->bgpal.b));
state->bgpal.offs_internal = 0;
state->bgpal.offs++;
break;
@@ -314,7 +314,7 @@ static WRITE16_HANDLER( ramdac_bg_w )
static WRITE16_HANDLER( ramdac_fg_w )
{
- coinmvga_state *state = space->machine->driver_data<coinmvga_state>();
+ coinmvga_state *state = space->machine().driver_data<coinmvga_state>();
if(ACCESSING_BITS_8_15)
{
state->fgpal.offs = data >> 8;
@@ -334,7 +334,7 @@ static WRITE16_HANDLER( ramdac_fg_w )
break;
case 2:
state->fgpal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, 0x100+state->fgpal.offs, MAKE_RGB(state->fgpal.r, state->fgpal.g, state->fgpal.b));
+ palette_set_color(space->machine(), 0x100+state->fgpal.offs, MAKE_RGB(state->fgpal.r, state->fgpal.g, state->fgpal.b));
state->fgpal.offs_internal = 0;
state->fgpal.offs++;
break;
@@ -345,7 +345,7 @@ static WRITE16_HANDLER( ramdac_fg_w )
/*
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}*/
/*************************
@@ -870,7 +870,7 @@ ROM_END
static DRIVER_INIT( colorama )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine->region("maincpu")->base();
+ ROM = (UINT16 *)machine.region("maincpu")->base();
// rte in non-irq routines? wtf? patch them to rts...
ROM[0x02B476/2] = 0x5470;
@@ -887,7 +887,7 @@ static DRIVER_INIT( colorama )
static DRIVER_INIT( cmrltv75 )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine->region("maincpu")->base();
+ ROM = (UINT16 *)machine.region("maincpu")->base();
// rte in non-irq routines? wtf? patch them to rts...
ROM[0x056fd6/2] = 0x5470;
diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c
index 8a905906b02..7dee9ba9932 100644
--- a/src/mame/drivers/cojag.c
+++ b/src/mame/drivers/cojag.c
@@ -361,8 +361,8 @@ UINT8 cojag_is_r3000;
static MACHINE_RESET( cojag )
{
- cojag_state *state = machine->driver_data<cojag_state>();
- UINT8 *rom = machine->region("user2")->base();
+ cojag_state *state = machine.driver_data<cojag_state>();
+ UINT8 *rom = machine.region("user2")->base();
/* 68020 only: copy the interrupt vectors into RAM */
if (!cojag_is_r3000)
@@ -392,8 +392,8 @@ static MACHINE_RESET( cojag )
jaguar_dsp_resume(machine);
/* halt the CPUs */
- jaguargpu_ctrl_w(machine->device("gpu"), G_CTRL, 0, 0xffffffff);
- jaguardsp_ctrl_w(machine->device("audiocpu"), D_CTRL, 0, 0xffffffff);
+ jaguargpu_ctrl_w(machine.device("gpu"), G_CTRL, 0, 0xffffffff);
+ jaguardsp_ctrl_w(machine.device("audiocpu"), D_CTRL, 0, 0xffffffff);
/* set blitter idle flag */
blitter_status = 1;
@@ -409,7 +409,7 @@ static MACHINE_RESET( cojag )
static READ32_HANDLER( misc_control_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
/* D7 = board reset (low)
D6 = audio must & reset (high)
D5 = volume control data (invert on write)
@@ -423,7 +423,7 @@ static READ32_HANDLER( misc_control_r )
static WRITE32_HANDLER( misc_control_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
logerror("%08X:misc_control_w(%02X)\n", cpu_get_previouspc(space->cpu), data);
/* D7 = board reset (low)
@@ -437,19 +437,19 @@ static WRITE32_HANDLER( misc_control_w )
if (!(data & 0x80))
{
/* clear any spinuntil stuff */
- jaguar_gpu_resume(space->machine);
- jaguar_dsp_resume(space->machine);
+ jaguar_gpu_resume(space->machine());
+ jaguar_dsp_resume(space->machine());
/* halt the CPUs */
- jaguargpu_ctrl_w(space->machine->device("gpu"), G_CTRL, 0, 0xffffffff);
- jaguardsp_ctrl_w(space->machine->device("audiocpu"), D_CTRL, 0, 0xffffffff);
+ jaguargpu_ctrl_w(space->machine().device("gpu"), G_CTRL, 0, 0xffffffff);
+ jaguardsp_ctrl_w(space->machine().device("audiocpu"), D_CTRL, 0, 0xffffffff);
}
/* adjust banking */
- if (space->machine->region("user2")->base())
+ if (space->machine().region("user2")->base())
{
- memory_set_bank(space->machine, "bank2", (data >> 1) & 7);
- memory_set_bank(space->machine, "bank9", (data >> 1) & 7);
+ memory_set_bank(space->machine(), "bank2", (data >> 1) & 7);
+ memory_set_bank(space->machine(), "bank9", (data >> 1) & 7);
}
COMBINE_DATA(&state->misc_control_data);
@@ -465,13 +465,13 @@ static WRITE32_HANDLER( misc_control_w )
static READ32_HANDLER( gpuctrl_r )
{
- return jaguargpu_ctrl_r(space->machine->device("gpu"), offset);
+ return jaguargpu_ctrl_r(space->machine().device("gpu"), offset);
}
static WRITE32_HANDLER( gpuctrl_w )
{
- jaguargpu_ctrl_w(space->machine->device("gpu"), offset, data, mem_mask);
+ jaguargpu_ctrl_w(space->machine().device("gpu"), offset, data, mem_mask);
}
@@ -484,13 +484,13 @@ static WRITE32_HANDLER( gpuctrl_w )
static READ32_HANDLER( dspctrl_r )
{
- return jaguardsp_ctrl_r(space->machine->device("audiocpu"), offset);
+ return jaguardsp_ctrl_r(space->machine().device("audiocpu"), offset);
}
static WRITE32_HANDLER( dspctrl_w )
{
- jaguardsp_ctrl_w(space->machine->device("audiocpu"), offset, data, mem_mask);
+ jaguardsp_ctrl_w(space->machine().device("audiocpu"), offset, data, mem_mask);
}
@@ -512,11 +512,11 @@ static WRITE32_HANDLER( latch_w )
logerror("%08X:latch_w(%X)\n", cpu_get_previouspc(space->cpu), data);
/* adjust banking */
- if (space->machine->region("user2")->base())
+ if (space->machine().region("user2")->base())
{
if (cojag_is_r3000)
- memory_set_bank(space->machine, "bank1", data & 1);
- memory_set_bank(space->machine, "bank8", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank8", data & 1);
}
}
@@ -530,7 +530,7 @@ static WRITE32_HANDLER( latch_w )
static READ32_HANDLER( eeprom_data_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
if (cojag_is_r3000)
return state->m_nvram[offset] | 0xffffff00;
else
@@ -540,14 +540,14 @@ static READ32_HANDLER( eeprom_data_r )
static WRITE32_HANDLER( eeprom_enable_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
state->eeprom_enable = 1;
}
static WRITE32_HANDLER( eeprom_data_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
// if (state->eeprom_enable)
{
if (cojag_is_r3000)
@@ -592,39 +592,39 @@ static WRITE32_HANDLER( eeprom_data_w )
static TIMER_CALLBACK( gpu_sync_timer )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
/* if a command is still pending, and we haven't maxed out our timer, set a new one */
if (state->gpu_command_pending && param < 1000)
- machine->scheduler().timer_set(attotime::from_usec(50), FUNC(gpu_sync_timer), ++param);
+ machine.scheduler().timer_set(attotime::from_usec(50), FUNC(gpu_sync_timer), ++param);
}
static WRITE32_HANDLER( gpu_jump_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
/* update the data in memory */
COMBINE_DATA(state->gpu_jump_address);
logerror("%08X:GPU jump address = %08X\n", cpu_get_previouspc(space->cpu), *state->gpu_jump_address);
/* if the GPU is suspended, release it now */
- jaguar_gpu_resume(space->machine);
+ jaguar_gpu_resume(space->machine());
/* start the sync timer going, and note that there is a command pending */
- space->machine->scheduler().synchronize(FUNC(gpu_sync_timer));
+ space->machine().scheduler().synchronize(FUNC(gpu_sync_timer));
state->gpu_command_pending = 1;
}
static READ32_HANDLER( gpu_jump_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
/* if the current GPU command is just pointing back to the spin loop, and */
/* we're reading it from the spin loop, we can optimize */
if (*state->gpu_jump_address == state->gpu_spin_pc && cpu_get_previouspc(space->cpu) == state->gpu_spin_pc)
{
#if ENABLE_SPEEDUP_HACKS
/* spin if we're allowed */
- jaguar_gpu_suspend(space->machine);
+ jaguar_gpu_suspend(space->machine());
#endif
/* no command is pending */
@@ -659,7 +659,7 @@ static READ32_HANDLER( gpu_jump_r )
static READ32_HANDLER( cojagr3k_main_speedup_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
UINT64 curcycles = state->main_cpu->total_cycles();
/* if it's been less than main_speedup_max_cycles cycles since the last time */
@@ -708,7 +708,7 @@ static READ32_HANDLER( cojagr3k_main_speedup_r )
static READ32_HANDLER( main_gpu_wait_r )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
if (state->gpu_command_pending)
device_spin_until_interrupt(space->cpu);
return *state->main_gpu_wait;
@@ -735,7 +735,7 @@ static READ32_HANDLER( main_gpu_wait_r )
static WRITE32_HANDLER( area51_main_speedup_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
UINT64 curcycles = state->main_cpu->total_cycles();
/* store the data */
@@ -770,7 +770,7 @@ static WRITE32_HANDLER( area51_main_speedup_w )
static WRITE32_HANDLER( area51mx_main_speedup_w )
{
- cojag_state *state = space->machine->driver_data<cojag_state>();
+ cojag_state *state = space->machine().driver_data<cojag_state>();
UINT64 curcycles = state->main_cpu->total_cycles();
/* store the data */
@@ -1527,19 +1527,19 @@ ROM_END
*
*************************************/
-static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
+static void cojag_common_init(running_machine &machine, UINT16 gpu_jump_offs, UINT16 spin_pc)
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
/* copy over the ROM */
- state->main_cpu = machine->device<cpu_device>("maincpu");
+ state->main_cpu = machine.device<cpu_device>("maincpu");
cojag_is_r3000 = (state->main_cpu->type() == R3041BE);
/* install synchronization hooks for GPU */
if (cojag_is_r3000)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04f0b000 + gpu_jump_offs, 0x04f0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
else
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
- machine->device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf0b000 + gpu_jump_offs, 0xf0b003 + gpu_jump_offs, FUNC(gpu_jump_w));
+ machine.device("gpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf03000 + gpu_jump_offs, 0xf03003 + gpu_jump_offs, FUNC(gpu_jump_r));
state->gpu_jump_address = &jaguar_gpu_ram[gpu_jump_offs/4];
state->gpu_spin_pc = 0xf03000 + spin_pc;
@@ -1550,31 +1550,31 @@ static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UI
static DRIVER_INIT( area51a )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x5c4, 0x5a0);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa02030, 0xa02033, FUNC(area51_main_speedup_w));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa02030, 0xa02033, FUNC(area51_main_speedup_w));
#endif
}
static DRIVER_INIT( area51 )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 120;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100062e8, 0x100062eb, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x100062e8, 0x100062eb, FUNC(cojagr3k_main_speedup_r));
#endif
}
static DRIVER_INIT( maxforce )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
/* patch the protection */
@@ -1583,14 +1583,14 @@ static DRIVER_INIT( maxforce )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 120;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1000865c, 0x1000865f, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x1000865c, 0x1000865f, FUNC(cojagr3k_main_speedup_r));
#endif
}
static DRIVER_INIT( area51mx )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
/* patch the protection */
@@ -1598,14 +1598,14 @@ static DRIVER_INIT( area51mx )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa19550, 0xa19557, FUNC(area51mx_main_speedup_w));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xa19550, 0xa19557, FUNC(area51mx_main_speedup_w));
#endif
}
static DRIVER_INIT( a51mxr3k )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0c0, 0x09e);
/* patch the protection */
@@ -1614,35 +1614,35 @@ static DRIVER_INIT( a51mxr3k )
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 120;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10006f0c, 0x10006f0f, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10006f0c, 0x10006f0f, FUNC(cojagr3k_main_speedup_r));
#endif
}
static DRIVER_INIT( fishfren )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x578, 0x554);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 200;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10021b60, 0x10021b63, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10021b60, 0x10021b63, FUNC(cojagr3k_main_speedup_r));
#endif
}
-static void init_freeze_common(running_machine *machine, offs_t main_speedup_addr)
+static void init_freeze_common(running_machine &machine, offs_t main_speedup_addr)
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x0bc, 0x09c);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 200;
if (main_speedup_addr != 0)
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r));
- state->main_gpu_wait = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(main_speedup_addr, main_speedup_addr + 3, FUNC(cojagr3k_main_speedup_r));
+ state->main_gpu_wait = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x0400d900, 0x0400d900 + 3, FUNC(main_gpu_wait_r));
#endif
}
@@ -1656,13 +1656,13 @@ static DRIVER_INIT( freezeat6 ) { init_freeze_common(machine, 0x10019684); }
static DRIVER_INIT( vcircle )
{
- cojag_state *state = machine->driver_data<cojag_state>();
+ cojag_state *state = machine.driver_data<cojag_state>();
cojag_common_init(machine, 0x5c0, 0x5a0);
#if ENABLE_SPEEDUP_HACKS
/* install speedup for main CPU */
state->main_speedup_max_cycles = 50;
- state->main_speedup = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x12005b34, 0x12005b37, FUNC(cojagr3k_main_speedup_r));
+ state->main_speedup = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x12005b34, 0x12005b37, FUNC(cojagr3k_main_speedup_r));
#endif
}
diff --git a/src/mame/drivers/combatsc.c b/src/mame/drivers/combatsc.c
index 829c007a706..bb4e6968d80 100644
--- a/src/mame/drivers/combatsc.c
+++ b/src/mame/drivers/combatsc.c
@@ -138,7 +138,7 @@ Dip location and recommended settings verified with the US manual
static WRITE8_HANDLER( combatsc_vreg_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (data != state->vreg)
{
tilemap_mark_all_tiles_dirty(state->textlayer);
@@ -152,7 +152,7 @@ static WRITE8_HANDLER( combatsc_vreg_w )
static WRITE8_HANDLER( combatscb_sh_irqtrigger_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -161,12 +161,12 @@ static READ8_HANDLER( combatscb_io_r )
{
static const char *const portnames[] = { "IN0", "IN1", "DSW1", "DSW2" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
static WRITE8_HANDLER( combatscb_priority_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (data & 0x40)
{
@@ -186,7 +186,7 @@ static WRITE8_HANDLER( combatscb_priority_w )
static WRITE8_HANDLER( combatsc_bankselect_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
state->priority = data & 0x20;
@@ -204,14 +204,14 @@ static WRITE8_HANDLER( combatsc_bankselect_w )
}
if (data & 0x10)
- memory_set_bank(space->machine, "bank1", (data & 0x0e) >> 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0e) >> 1);
else
- memory_set_bank(space->machine, "bank1", 8 + (data & 1));
+ memory_set_bank(space->machine(), "bank1", 8 + (data & 1));
}
static WRITE8_HANDLER( combatscb_io_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
switch (offset)
{
@@ -224,7 +224,7 @@ static WRITE8_HANDLER( combatscb_io_w )
static WRITE8_HANDLER( combatscb_bankselect_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (data & 0x40)
{
@@ -244,13 +244,13 @@ static WRITE8_HANDLER( combatscb_bankselect_w )
state->bank_select = data;
if (data & 0x10)
- memory_set_bank(space->machine, "bank1", (data & 0x0e) >> 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0e) >> 1);
else
- memory_set_bank(space->machine, "bank1", 8 + (data & 1));
+ memory_set_bank(space->machine(), "bank1", 8 + (data & 1));
if (data == 0x1f)
{
- memory_set_bank(space->machine, "bank1", 8 + (data & 1));
+ memory_set_bank(space->machine(), "bank1", 8 + (data & 1));
space->install_legacy_write_handler(0x4000, 0x7fff, FUNC(combatscb_io_w));
space->install_legacy_read_handler(0x4400, 0x4403, FUNC(combatscb_io_r));/* IO RAM & Video Registers */
}
@@ -270,13 +270,13 @@ static WRITE8_HANDLER( combatsc_coin_counter_w )
/* b1: coin counter 2 */
/* b0: coin counter 1 */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static READ8_HANDLER( trackball_r )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
if (offset == 0)
{
@@ -287,7 +287,7 @@ static READ8_HANDLER( trackball_r )
{
UINT8 curr;
- curr = input_port_read_safe(space->machine, tracknames[i], 0xff);
+ curr = input_port_read_safe(space->machine(), tracknames[i], 0xff);
dir[i] = curr - state->pos[i];
state->sign[i] = dir[i] & 0x80;
@@ -314,12 +314,12 @@ static READ8_HANDLER( trackball_r )
/* the protection is a simple multiply */
static WRITE8_HANDLER( protection_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
state->prot[offset] = data;
}
static READ8_HANDLER( protection_r )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
return ((state->prot[0] * state->prot[1]) >> (offset * 8)) & 0xff;
}
static WRITE8_HANDLER( protection_clock_w )
@@ -332,7 +332,7 @@ static WRITE8_HANDLER( protection_clock_w )
static WRITE8_HANDLER( combatsc_sh_irqtrigger_w )
{
- combatsc_state *state = space->machine->driver_data<combatsc_state>();
+ combatsc_state *state = space->machine().driver_data<combatsc_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -358,7 +358,7 @@ static WRITE8_DEVICE_HANDLER( combatsc_portA_w )
static READ8_DEVICE_HANDLER ( combatsc_ym2203_r )
{
- combatsc_state *state = device->machine->driver_data<combatsc_state>();
+ combatsc_state *state = device->machine().driver_data<combatsc_state>();
int status = ym2203_r(device,offset);
if (cpu_get_pc(state->audiocpu) == 0x334)
@@ -682,20 +682,20 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( combatsc )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
- UINT8 *MEM = machine->region("maincpu")->base() + 0x38000;
+ combatsc_state *state = machine.driver_data<combatsc_state>();
+ UINT8 *MEM = machine.region("maincpu")->base() + 0x38000;
state->io_ram = MEM + 0x0000;
state->page[0] = MEM + 0x4000;
state->page[1] = MEM + 0x6000;
- state->interleave_timer = machine->scheduler().timer_alloc(FUNC(NULL));
+ state->interleave_timer = machine.scheduler().timer_alloc(FUNC(NULL));
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->k007121_1 = machine->device("k007121_1");
- state->k007121_2 = machine->device("k007121_2");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->k007121_1 = machine.device("k007121_1");
+ state->k007121_2 = machine.device("k007121_2");
- memory_configure_bank(machine, "bank1", 0, 10, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 10, machine.region("maincpu")->base() + 0x10000, 0x4000);
state->save_item(NAME(state->priority));
state->save_item(NAME(state->vreg));
@@ -710,8 +710,8 @@ static MACHINE_START( combatsc )
static MACHINE_RESET( combatsc )
{
- combatsc_state *state = machine->driver_data<combatsc_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ combatsc_state *state = machine.driver_data<combatsc_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
memset(state->io_ram, 0x00, 0x4000);
@@ -995,7 +995,7 @@ ROM_END
static DRIVER_INIT( combatsc )
{
/* joystick instead of trackball */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0404, 0x0404, "IN1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x0404, 0x0404, "IN1");
}
diff --git a/src/mame/drivers/commando.c b/src/mame/drivers/commando.c
index 2e6cad05f92..815dc908065 100644
--- a/src/mame/drivers/commando.c
+++ b/src/mame/drivers/commando.c
@@ -226,9 +226,9 @@ static INTERRUPT_GEN( commando_interrupt )
static MACHINE_START( commando )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->scroll_x));
state->save_item(NAME(state->scroll_y));
@@ -236,7 +236,7 @@ static MACHINE_START( commando )
static MACHINE_RESET( commando )
{
- commando_state *state = machine->driver_data<commando_state>();
+ commando_state *state = machine.driver_data<commando_state>();
state->scroll_x[0] = 0;
state->scroll_x[1] = 0;
@@ -518,8 +518,8 @@ ROM_END
static DRIVER_INIT( commando )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0xc000);
int A;
@@ -538,8 +538,8 @@ static DRIVER_INIT( commando )
static DRIVER_INIT( spaceinv )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0xc000);
int A;
diff --git a/src/mame/drivers/compgolf.c b/src/mame/drivers/compgolf.c
index 5ad89de2e39..cf7261b6e53 100644
--- a/src/mame/drivers/compgolf.c
+++ b/src/mame/drivers/compgolf.c
@@ -24,19 +24,19 @@
static WRITE8_DEVICE_HANDLER( compgolf_scrollx_lo_w )
{
- compgolf_state *state = device->machine->driver_data<compgolf_state>();
+ compgolf_state *state = device->machine().driver_data<compgolf_state>();
state->scrollx_lo = data;
}
static WRITE8_DEVICE_HANDLER( compgolf_scrolly_lo_w )
{
- compgolf_state *state = device->machine->driver_data<compgolf_state>();
+ compgolf_state *state = device->machine().driver_data<compgolf_state>();
state->scrolly_lo = data;
}
static WRITE8_HANDLER( compgolf_ctrl_w )
{
- compgolf_state *state = space->machine->driver_data<compgolf_state>();
+ compgolf_state *state = space->machine().driver_data<compgolf_state>();
/* bit 4 and 6 are always set */
@@ -45,7 +45,7 @@ static WRITE8_HANDLER( compgolf_ctrl_w )
if (state->bank != new_bank)
{
state->bank = new_bank;
- memory_set_bank(space->machine, "bank1", state->bank);
+ memory_set_bank(space->machine(), "bank1", state->bank);
}
state->scrollx_hi = (data & 1) << 8;
@@ -203,7 +203,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "maincpu", 0, linestate);
+ cputag_set_input_line(device->machine(), "maincpu", 0, linestate);
}
static const ym2203_interface ym2203_config =
@@ -228,7 +228,7 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( compgolf )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
state->save_item(NAME(state->bank));
state->save_item(NAME(state->scrollx_lo));
@@ -239,7 +239,7 @@ static MACHINE_START( compgolf )
static MACHINE_RESET( compgolf )
{
- compgolf_state *state = machine->driver_data<compgolf_state>();
+ compgolf_state *state = machine.driver_data<compgolf_state>();
state->bank = -1;
state->scrollx_lo = 0;
@@ -346,10 +346,10 @@ ROM_END
*
*************************************/
-static void compgolf_expand_bg(running_machine *machine)
+static void compgolf_expand_bg(running_machine &machine)
{
- UINT8 *GFXDST = machine->region("gfx2")->base();
- UINT8 *GFXSRC = machine->region("gfx4")->base();
+ UINT8 *GFXDST = machine.region("gfx2")->base();
+ UINT8 *GFXSRC = machine.region("gfx4")->base();
int x;
@@ -362,7 +362,7 @@ static void compgolf_expand_bg(running_machine *machine)
static DRIVER_INIT( compgolf )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("user1")->base(), 0x4000);
compgolf_expand_bg(machine);
}
diff --git a/src/mame/drivers/contra.c b/src/mame/drivers/contra.c
index c88ea38d37a..7506310a41e 100644
--- a/src/mame/drivers/contra.c
+++ b/src/mame/drivers/contra.c
@@ -27,29 +27,29 @@ Dip locations and factory settings verified with manual
static INTERRUPT_GEN( contra_interrupt )
{
- contra_state *state = device->machine->driver_data<contra_state>();
+ contra_state *state = device->machine().driver_data<contra_state>();
if (k007121_ctrlram_r(state->k007121_1, 7) & 0x02)
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( contra_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( contra_sh_irqtrigger_w )
{
- contra_state *state = space->machine->driver_data<contra_state>();
+ contra_state *state = space->machine().driver_data<contra_state>();
device_set_input_line(state->audiocpu, M6809_IRQ_LINE, HOLD_LINE);
}
static WRITE8_HANDLER( contra_coin_counter_w )
{
if (data & 0x01)
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
if (data & 0x02)
- coin_counter_w(space->machine, 1, (data & 0x02) >> 1);
+ coin_counter_w(space->machine(), 1, (data & 0x02) >> 1);
}
static WRITE8_HANDLER( cpu_sound_command_w )
@@ -178,14 +178,14 @@ GFXDECODE_END
static MACHINE_START( contra )
{
- contra_state *state = machine->driver_data<contra_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ contra_state *state = machine.driver_data<contra_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007121_1 = machine->device("k007121_1");
- state->k007121_2 = machine->device("k007121_2");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007121_1 = machine.device("k007121_1");
+ state->k007121_2 = machine.device("k007121_2");
}
static MACHINE_CONFIG_START( contra, contra_state )
diff --git a/src/mame/drivers/coolpool.c b/src/mame/drivers/coolpool.c
index 9d4630e3558..17e1195152a 100644
--- a/src/mame/drivers/coolpool.c
+++ b/src/mame/drivers/coolpool.c
@@ -56,7 +56,7 @@ static const UINT16 nvram_unlock_seq[] =
static void amerdart_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- coolpool_state *state = screen.machine->driver_data<coolpool_state>();
+ coolpool_state *state = screen.machine().driver_data<coolpool_state>();
UINT16 *vram = &state->vram_base[(params->rowaddr << 8) & 0xff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
@@ -85,11 +85,11 @@ static void amerdart_scanline(screen_device &screen, bitmap_t *bitmap, int scanl
static void coolpool_scanline(screen_device &screen, bitmap_t *bitmap, int scanline, const tms34010_display_params *params)
{
- coolpool_state *state = screen.machine->driver_data<coolpool_state>();
+ coolpool_state *state = screen.machine().driver_data<coolpool_state>();
UINT16 *vram = &state->vram_base[(params->rowaddr << 8) & 0x1ff00];
UINT32 *dest = BITMAP_ADDR32(bitmap, scanline, 0);
- const rgb_t *pens = tlc34076_get_pens(screen.machine->device("tlc34076"));
+ const rgb_t *pens = tlc34076_get_pens(screen.machine().device("tlc34076"));
int coladdr = params->coladdr;
int x;
@@ -111,7 +111,7 @@ static void coolpool_scanline(screen_device &screen, bitmap_t *bitmap, int scanl
static void coolpool_to_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
memcpy(shiftreg, &state->vram_base[TOWORD(address) & ~TOWORD(0xfff)], TOBYTE(0x1000));
}
@@ -119,7 +119,7 @@ static void coolpool_to_shiftreg(address_space *space, UINT32 address, UINT16 *s
static void coolpool_from_shiftreg(address_space *space, UINT32 address, UINT16 *shiftreg)
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
memcpy(&state->vram_base[TOWORD(address) & ~TOWORD(0xfff)], shiftreg, TOBYTE(0x1000));
}
@@ -134,10 +134,10 @@ static void coolpool_from_shiftreg(address_space *space, UINT32 address, UINT16
static MACHINE_RESET( amerdart )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
- state->maincpu = machine->device("maincpu");
- state->dsp = machine->device("dsp");
+ state->maincpu = machine.device("maincpu");
+ state->dsp = machine.device("dsp");
state->nvram_write_enable = 0;
}
@@ -145,7 +145,7 @@ static MACHINE_RESET( amerdart )
static MACHINE_RESET( coolpool )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->nvram_write_enable = 0;
}
@@ -159,14 +159,14 @@ static MACHINE_RESET( coolpool )
static TIMER_DEVICE_CALLBACK( nvram_write_timeout )
{
- coolpool_state *state = timer.machine->driver_data<coolpool_state>();
+ coolpool_state *state = timer.machine().driver_data<coolpool_state>();
state->nvram_write_enable = 0;
}
static WRITE16_HANDLER( nvram_thrash_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
/* keep track of the last few writes */
memmove(&state->nvram_write_seq[0], &state->nvram_write_seq[1], (NVRAM_UNLOCK_SEQ_LEN - 1) * sizeof(state->nvram_write_seq[0]));
state->nvram_write_seq[NVRAM_UNLOCK_SEQ_LEN - 1] = offset & 0x3ff;
@@ -175,7 +175,7 @@ static WRITE16_HANDLER( nvram_thrash_w )
if (!memcmp(nvram_unlock_seq, state->nvram_write_seq, sizeof(nvram_unlock_seq)))
{
state->nvram_write_enable = 1;
- timer_device *nvram_timer = space->machine->device<timer_device>("nvram_timer");
+ timer_device *nvram_timer = space->machine().device<timer_device>("nvram_timer");
nvram_timer->adjust(attotime::from_msec(1000));
}
}
@@ -183,7 +183,7 @@ static WRITE16_HANDLER( nvram_thrash_w )
static WRITE16_HANDLER( nvram_data_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
/* only the low 8 bits matter */
if (ACCESSING_BITS_0_7)
{
@@ -211,7 +211,7 @@ static WRITE16_HANDLER( nvram_thrash_data_w )
static TIMER_DEVICE_CALLBACK( amerdart_audio_int_gen )
{
- coolpool_state *state = timer.machine->driver_data<coolpool_state>();
+ coolpool_state *state = timer.machine().driver_data<coolpool_state>();
device_set_input_line(state->dsp, 0, ASSERT_LINE);
device_set_input_line(state->dsp, 0, CLEAR_LINE);
@@ -222,17 +222,17 @@ static WRITE16_HANDLER( amerdart_misc_w )
{
logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(space->cpu),data);
- coin_counter_w(space->machine, 0, ~data & 0x0001);
- coin_counter_w(space->machine, 1, ~data & 0x0002);
+ coin_counter_w(space->machine(), 0, ~data & 0x0001);
+ coin_counter_w(space->machine(), 1, ~data & 0x0002);
/* bits 10-15 are counted down over time */
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
}
static READ16_HANDLER( amerdart_dsp_bio_line_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
/* Skip idle checking */
if (state->old_cmd == state->cmd_pending)
@@ -252,17 +252,17 @@ static READ16_HANDLER( amerdart_dsp_bio_line_r )
static READ16_HANDLER( amerdart_iop_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),state->iop_answer);
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
return state->iop_answer;
}
static WRITE16_HANDLER( amerdart_iop_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data);
COMBINE_DATA(&state->iop_cmd);
@@ -271,7 +271,7 @@ static WRITE16_HANDLER( amerdart_iop_w )
static READ16_HANDLER( amerdart_dsp_cmd_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:DSP cmd_r %04x\n", cpu_get_pc(space->cpu), state->iop_cmd);
state->cmd_pending = 0;
@@ -280,11 +280,11 @@ static READ16_HANDLER( amerdart_dsp_cmd_r )
static WRITE16_HANDLER( amerdart_dsp_answer_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
// logerror("%08x:DSP answer %04x\n", cpu_get_pc(space->cpu), data);
state->iop_answer = data;
- cputag_set_input_line(space->machine, "maincpu", 1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, ASSERT_LINE);
}
@@ -319,7 +319,7 @@ static int amerdart_trackball_dec(int data)
static int amerdart_trackball_direction(address_space *space, int num, int data)
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
UINT16 result_x = (data & 0x0c) >> 2;
UINT16 result_y = (data & 0x03) >> 0;
@@ -409,15 +409,15 @@ static READ16_HANDLER( amerdart_trackball_r )
*/
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
state->result = (state->lastresult | 0x00ff);
- state->newx[1] = input_port_read(space->machine, "XAXIS1"); /* Trackball 1 Left - Right */
- state->newy[1] = input_port_read(space->machine, "YAXIS1"); /* Trackball 1 Up - Down */
- state->newx[2] = input_port_read(space->machine, "XAXIS2"); /* Trackball 2 Left - Right */
- state->newy[2] = input_port_read(space->machine, "YAXIS2"); /* Trackball 2 Up - Down */
+ state->newx[1] = input_port_read(space->machine(), "XAXIS1"); /* Trackball 1 Left - Right */
+ state->newy[1] = input_port_read(space->machine(), "YAXIS1"); /* Trackball 1 Up - Down */
+ state->newx[2] = input_port_read(space->machine(), "XAXIS2"); /* Trackball 2 Left - Right */
+ state->newy[2] = input_port_read(space->machine(), "YAXIS2"); /* Trackball 2 Up - Down */
state->dx[1] = (INT8)(state->newx[1] - state->oldx[1]);
state->dy[1] = (INT8)(state->newy[1] - state->oldy[1]);
@@ -449,10 +449,10 @@ static WRITE16_HANDLER( coolpool_misc_w )
{
logerror("%08x:IOP_system_w %04x\n",cpu_get_pc(space->cpu),data);
- coin_counter_w(space->machine, 0, ~data & 0x0001);
- coin_counter_w(space->machine, 1, ~data & 0x0002);
+ coin_counter_w(space->machine(), 0, ~data & 0x0001);
+ coin_counter_w(space->machine(), 1, ~data & 0x0002);
- cputag_set_input_line(space->machine, "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "dsp", INPUT_LINE_RESET, (data & 0x0400) ? ASSERT_LINE : CLEAR_LINE);
}
@@ -466,30 +466,30 @@ static WRITE16_HANDLER( coolpool_misc_w )
static TIMER_CALLBACK( deferred_iop_w )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->iop_cmd = param;
state->cmd_pending = 1;
cputag_set_input_line(machine, "dsp", 0, HOLD_LINE); /* ??? I have no idea who should generate this! */
/* the DSP polls the status bit so it isn't strictly */
/* necessary to also have an IRQ */
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
static WRITE16_HANDLER( coolpool_iop_w )
{
logerror("%08x:IOP write %04x\n", cpu_get_pc(space->cpu), data);
- space->machine->scheduler().synchronize(FUNC(deferred_iop_w), data);
+ space->machine().scheduler().synchronize(FUNC(deferred_iop_w), data);
}
static READ16_HANDLER( coolpool_iop_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
logerror("%08x:IOP read %04x\n",cpu_get_pc(space->cpu),state->iop_answer);
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
return state->iop_answer;
}
@@ -505,7 +505,7 @@ static READ16_HANDLER( coolpool_iop_r )
static READ16_HANDLER( dsp_cmd_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
state->cmd_pending = 0;
logerror("%08x:IOP cmd_r %04x\n", cpu_get_pc(space->cpu), state->iop_cmd);
@@ -515,17 +515,17 @@ static READ16_HANDLER( dsp_cmd_r )
static WRITE16_HANDLER( dsp_answer_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
logerror("%08x:IOP answer %04x\n", cpu_get_pc(space->cpu), data);
state->iop_answer = data;
- cputag_set_input_line(space->machine, "maincpu", 1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, ASSERT_LINE);
}
static READ16_HANDLER( dsp_bio_line_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
return state->cmd_pending ? CLEAR_LINE : ASSERT_LINE;
}
@@ -546,16 +546,16 @@ static READ16_HANDLER( dsp_hold_line_r )
static READ16_HANDLER( dsp_rom_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
- UINT8 *rom = space->machine->region("user2")->base();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
+ UINT8 *rom = space->machine().region("user2")->base();
- return rom[state->iop_romaddr & (space->machine->region("user2")->bytes() - 1)];
+ return rom[state->iop_romaddr & (space->machine().region("user2")->bytes() - 1)];
}
static WRITE16_HANDLER( dsp_romaddr_w )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
switch (offset)
{
@@ -585,11 +585,11 @@ static WRITE16_DEVICE_HANDLER( dsp_dac_w )
static READ16_HANDLER( coolpool_input_r )
{
- coolpool_state *state = space->machine->driver_data<coolpool_state>();
+ coolpool_state *state = space->machine().driver_data<coolpool_state>();
- state->result = (input_port_read(space->machine, "IN1") & 0x00ff) | (state->lastresult & 0xff00);
- state->newx[1] = input_port_read(space->machine, "XAXIS");
- state->newy[1] = input_port_read(space->machine, "YAXIS");
+ state->result = (input_port_read(space->machine(), "IN1") & 0x00ff) | (state->lastresult & 0xff00);
+ state->newx[1] = input_port_read(space->machine(), "XAXIS");
+ state->newy[1] = input_port_read(space->machine(), "YAXIS");
state->dx[1] = (INT8)(state->newx[1] - state->oldx[1]);
state->dy[1] = (INT8)(state->newy[1] - state->oldy[1]);
@@ -1172,9 +1172,9 @@ ROM_END
*
*************************************/
-static void register_state_save(running_machine *machine)
+static void register_state_save(running_machine &machine)
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->save_item(NAME(state->oldx));
state->save_item(NAME(state->oldy));
@@ -1191,7 +1191,7 @@ static void register_state_save(running_machine *machine)
static DRIVER_INIT( amerdart )
{
- coolpool_state *state = machine->driver_data<coolpool_state>();
+ coolpool_state *state = machine.driver_data<coolpool_state>();
state->lastresult = 0xffff;
@@ -1200,7 +1200,7 @@ static DRIVER_INIT( amerdart )
static DRIVER_INIT( coolpool )
{
- machine->device("dsp")->memory().space(AS_IO)->install_legacy_read_handler(0x07, 0x07, FUNC(coolpool_input_r));
+ machine.device("dsp")->memory().space(AS_IO)->install_legacy_read_handler(0x07, 0x07, FUNC(coolpool_input_r));
register_state_save(machine);
}
@@ -1212,8 +1212,8 @@ static DRIVER_INIT( 9ballsht )
UINT16 *rom;
/* decrypt the main program ROMs */
- rom = (UINT16 *)machine->region("user1")->base();
- len = machine->region("user1")->bytes();
+ rom = (UINT16 *)machine.region("user1")->base();
+ len = machine.region("user1")->bytes();
for (a = 0;a < len/2;a++)
{
int hi,lo,nhi,nlo;
@@ -1236,8 +1236,8 @@ static DRIVER_INIT( 9ballsht )
}
/* decrypt the sub data ROMs */
- rom = (UINT16 *)machine->region("user2")->base();
- len = machine->region("user2")->bytes();
+ rom = (UINT16 *)machine.region("user2")->base();
+ len = machine.region("user2")->bytes();
for (a = 1;a < len/2;a+=4)
{
/* just swap bits 1 and 2 of the address */
diff --git a/src/mame/drivers/coolridr.c b/src/mame/drivers/coolridr.c
index c4d0f2b14c5..7cc327c350f 100644
--- a/src/mame/drivers/coolridr.c
+++ b/src/mame/drivers/coolridr.c
@@ -284,9 +284,9 @@ public:
static VIDEO_START(coolridr)
{
- coolridr_state *state = machine->driver_data<coolridr_state>();
- int width = machine->primary_screen->width();
- int height = machine->primary_screen->height();
+ coolridr_state *state = machine.driver_data<coolridr_state>();
+ int width = machine.primary_screen->width();
+ int height = machine.primary_screen->height();
state->temp_bitmap_sprites = auto_bitmap_alloc(machine, width, height, BITMAP_FORMAT_RGB32);
state->test_offs = 0x2000;
@@ -294,35 +294,35 @@ static VIDEO_START(coolridr)
static SCREEN_UPDATE(coolridr)
{
- coolridr_state *state = screen->machine->driver_data<coolridr_state>();
+ coolridr_state *state = screen->machine().driver_data<coolridr_state>();
/* planes seems to basically be at 0x8000 and 0x28000... */
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
UINT32 count;
int y,x;
- if(input_code_pressed(screen->machine,KEYCODE_Z))
+ if(input_code_pressed(screen->machine(),KEYCODE_Z))
state->test_offs+=4;
- if(input_code_pressed(screen->machine,KEYCODE_X))
+ if(input_code_pressed(screen->machine(),KEYCODE_X))
state->test_offs-=4;
- if(input_code_pressed(screen->machine,KEYCODE_C))
+ if(input_code_pressed(screen->machine(),KEYCODE_C))
state->test_offs+=0x40;
- if(input_code_pressed(screen->machine,KEYCODE_V))
+ if(input_code_pressed(screen->machine(),KEYCODE_V))
state->test_offs-=0x40;
- if(input_code_pressed(screen->machine,KEYCODE_B))
+ if(input_code_pressed(screen->machine(),KEYCODE_B))
state->test_offs+=0x400;
- if(input_code_pressed(screen->machine,KEYCODE_N))
+ if(input_code_pressed(screen->machine(),KEYCODE_N))
state->test_offs-=0x400;
- if(input_code_pressed_once(screen->machine,KEYCODE_A))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_A))
state->color++;
- if(input_code_pressed_once(screen->machine,KEYCODE_S))
+ if(input_code_pressed_once(screen->machine(),KEYCODE_S))
state->color--;
if(state->test_offs > 0x100000*4)
@@ -360,7 +360,7 @@ static SCREEN_UPDATE(coolridr)
/* unknown purpose */
static READ32_HANDLER(sysh1_unk_r)
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
switch(offset)
{
case 0x08/4:
@@ -380,7 +380,7 @@ static READ32_HANDLER(sysh1_unk_r)
static WRITE32_HANDLER(sysh1_unk_w)
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->h1_unk[offset]);
}
@@ -388,7 +388,7 @@ static WRITE32_HANDLER(sysh1_unk_w)
#if 0
static READ32_HANDLER(sysh1_ioga_r)
{
- //return space->machine->rand();//h1_ioga[offset];
+ //return space->machine().rand();//h1_ioga[offset];
return h1_ioga[offset];
}
@@ -429,7 +429,7 @@ CMD = ac90 PARAM = 0001 DATA = 03f40170
/* this looks like an exotic I/O-based tilemap / sprite blitter, very unusual from Sega... */
static WRITE32_HANDLER( sysh1_txt_blit_w )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->sysh1_txt_blit[offset]);
@@ -464,7 +464,7 @@ static WRITE32_HANDLER( sysh1_txt_blit_w )
{
int x2,y2;
- const gfx_element *gfx = space->machine->gfx[1];
+ const gfx_element *gfx = space->machine().gfx[1];
rectangle clip;
y2 = (state->attr_buff[9] & 0x01ff0000) >> 16;
@@ -505,23 +505,23 @@ static WRITE32_HANDLER( sysh1_txt_blit_w )
static WRITE32_HANDLER( sysh1_pal_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
-
- r = ((space->machine->generic.paletteram.u32[offset] & 0x00007c00) >> 10);
- g = ((space->machine->generic.paletteram.u32[offset] & 0x000003e0) >> 5);
- b = ((space->machine->generic.paletteram.u32[offset] & 0x0000001f) >> 0);
- palette_set_color_rgb(space->machine,(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
- r = ((space->machine->generic.paletteram.u32[offset] & 0x7c000000) >> 26);
- g = ((space->machine->generic.paletteram.u32[offset] & 0x03e00000) >> 21);
- b = ((space->machine->generic.paletteram.u32[offset] & 0x001f0000) >> 16);
- palette_set_color_rgb(space->machine,offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x00007c00) >> 10);
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x000003e0) >> 5);
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x0000001f) >> 0);
+ palette_set_color_rgb(space->machine(),(offset*2)+1,pal5bit(r),pal5bit(g),pal5bit(b));
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x7c000000) >> 26);
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x03e00000) >> 21);
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x001f0000) >> 16);
+ palette_set_color_rgb(space->machine(),offset*2,pal5bit(r),pal5bit(g),pal5bit(b));
}
/* FIXME: this seems to do a hell lot of stuff, it's not ST-V SCU but still somewhat complex :/ */
static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
UINT32 src,dst,size,type,s_i;
UINT8 end_dma_mark;
@@ -570,7 +570,7 @@ static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
//size/=2;
if((src & 0xff00000) == 0x3e00000)
return; //FIXME: kludge to avoid palette corruption
- //debugger_break(space->machine);
+ //debugger_break(space->machine());
}
if(type == 0xc || type == 0xd || type == 0xe)
@@ -597,7 +597,7 @@ static void sysh1_dma_transfer( address_space *space, UINT16 dma_index )
static WRITE32_HANDLER( sysh1_dma_w )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->framebuffer_vram[offset]);
if(offset*4 == 0x000)
@@ -609,18 +609,18 @@ static WRITE32_HANDLER( sysh1_dma_w )
static WRITE32_HANDLER( sysh1_char_w )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
COMBINE_DATA(&state->h1_charram[offset]);
{
- UINT8 *gfx = space->machine->region("ram_gfx")->base();
+ UINT8 *gfx = space->machine().region("ram_gfx")->base();
gfx[offset*4+0] = (state->h1_charram[offset] & 0xff000000) >> 24;
gfx[offset*4+1] = (state->h1_charram[offset] & 0x00ff0000) >> 16;
gfx[offset*4+2] = (state->h1_charram[offset] & 0x0000ff00) >> 8;
gfx[offset*4+3] = (state->h1_charram[offset] & 0x000000ff) >> 0;
- gfx_element_mark_dirty(space->machine->gfx[2], offset/64); //*4/256
+ gfx_element_mark_dirty(space->machine().gfx[2], offset/64); //*4/256
}
}
@@ -1166,7 +1166,7 @@ ROM_END
#if 0
static READ32_HANDLER( coolridr_hack1_r )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
offs_t pc = downcast<cpu_device *>(space->cpu)->pc();
if(pc == 0x6012374 || pc == 0x6012392)
return 0;
@@ -1177,7 +1177,7 @@ static READ32_HANDLER( coolridr_hack1_r )
static READ32_HANDLER( coolridr_hack2_r )
{
- coolridr_state *state = space->machine->driver_data<coolridr_state>();
+ coolridr_state *state = space->machine().driver_data<coolridr_state>();
offs_t pc = downcast<cpu_device *>(space->cpu)->pc();
if(pc == 0x6002cba || pc == 0x6002d42)
return 0;
@@ -1187,8 +1187,8 @@ static READ32_HANDLER( coolridr_hack2_r )
static DRIVER_INIT( coolridr )
{
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d8894, 0x060d8897, FUNC(coolridr_hack2_r) );
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d88a4, 0x060d88a7, FUNC(coolridr_hack1_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x60d8894, 0x060d8897, FUNC(coolridr_hack2_r) );
}
GAME( 1995, coolridr, 0, coolridr, coolridr, coolridr, ROT0, "Sega", "Cool Riders (US)",GAME_NOT_WORKING|GAME_NO_SOUND )
diff --git a/src/mame/drivers/cop01.c b/src/mame/drivers/cop01.c
index 55584366989..57e6a200ed7 100644
--- a/src/mame/drivers/cop01.c
+++ b/src/mame/drivers/cop01.c
@@ -68,14 +68,14 @@ Mighty Guy board layout:
static WRITE8_HANDLER( cop01_sound_command_w )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static READ8_HANDLER( cop01_sound_command_r )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
int res = (soundlatch_r(space, offset) & 0x7f) << 1;
/* bit 0 seems to be a timer */
@@ -96,7 +96,7 @@ static READ8_HANDLER( cop01_sound_command_r )
static CUSTOM_INPUT( mightguy_area_r )
{
int bit_mask = (FPTR)param;
- return (input_port_read(field->port->machine, "FAKE") & bit_mask) ? 0x01 : 0x00;
+ return (input_port_read(field->port->machine(), "FAKE") & bit_mask) ? 0x01 : 0x00;
}
@@ -156,7 +156,7 @@ ADDRESS_MAP_END
/* this just gets some garbage out of the YM3526 */
static READ8_HANDLER( kludge )
{
- cop01_state *state = space->machine->driver_data<cop01_state>();
+ cop01_state *state = space->machine().driver_data<cop01_state>();
return state->timer++;
}
@@ -414,9 +414,9 @@ GFXDECODE_END
static MACHINE_START( cop01 )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
state->save_item(NAME(state->pulse));
state->save_item(NAME(state->timer));
@@ -425,7 +425,7 @@ static MACHINE_START( cop01 )
static MACHINE_RESET( cop01 )
{
- cop01_state *state = machine->driver_data<cop01_state>();
+ cop01_state *state = machine.driver_data<cop01_state>();
state->pulse = 0;
state->timer = 0;
@@ -641,7 +641,7 @@ static DRIVER_INIT( mightguy )
#if MIGHTGUY_HACK
/* This is a hack to fix the game code to get a fully working
"Starting Area" fake Dip Switch */
- UINT8 *RAM = (UINT8 *)machine->region("maincpu")->base();
+ UINT8 *RAM = (UINT8 *)machine.region("maincpu")->base();
RAM[0x00e4] = 0x07; // rlca
RAM[0x00e5] = 0x07; // rlca
RAM[0x00e6] = 0x07; // rlca
diff --git a/src/mame/drivers/copsnrob.c b/src/mame/drivers/copsnrob.c
index 48cdbd88e1d..f7dc0079d8a 100644
--- a/src/mame/drivers/copsnrob.c
+++ b/src/mame/drivers/copsnrob.c
@@ -81,16 +81,16 @@ static PALETTE_INIT( copsnrob )
static READ8_HANDLER( copsnrob_misc_r )
{
- return input_port_read(space->machine, "IN0") & 0x80;
+ return input_port_read(space->machine(), "IN0") & 0x80;
}
static WRITE8_HANDLER( copsnrob_misc2_w )
{
- copsnrob_state *state = space->machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = space->machine().driver_data<copsnrob_state>();
state->misc = data & 0x7f;
/* Multi Player Start */
- set_led_status(space->machine, 1, !((data >> 6) & 0x01));
+ set_led_status(space->machine(), 1, !((data >> 6) & 0x01));
}
@@ -251,7 +251,7 @@ GFXDECODE_END
static MACHINE_START( copsnrob )
{
- copsnrob_state *state = machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = machine.driver_data<copsnrob_state>();
state->save_item(NAME(state->ic_h3_data));
state->save_item(NAME(state->misc));
@@ -259,7 +259,7 @@ static MACHINE_START( copsnrob )
static MACHINE_RESET( copsnrob )
{
- copsnrob_state *state = machine->driver_data<copsnrob_state>();
+ copsnrob_state *state = machine.driver_data<copsnrob_state>();
state->ic_h3_data = 0;
state->misc = 0;
diff --git a/src/mame/drivers/corona.c b/src/mame/drivers/corona.c
index 485b8d9c226..5ddd1acc646 100644
--- a/src/mame/drivers/corona.c
+++ b/src/mame/drivers/corona.c
@@ -380,13 +380,13 @@ static WRITE8_HANDLER( blitter_aux_w )
static READ8_HANDLER( blitter_status_r )
{
/* code checks bit 6 and/or bit 7 */
- //return space->machine->rand() & 0xc0;
+ //return space->machine().rand() & 0xc0;
/*
x--- ---- blitter busy
-x-- ---- vblank
*/
- return 0x80 | ((space->machine->primary_screen->vblank() & 1) << 6);
+ return 0x80 | ((space->machine().primary_screen->vblank() & 1) << 6);
}
static void blitter_execute(int x, int y, int color, int width, int flag)
@@ -463,12 +463,12 @@ static SCREEN_UPDATE(luckyrlt)
static WRITE8_HANDLER( sound_latch_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, ASSERT_LINE);
}
static READ8_HANDLER( sound_latch_r )
{
- cputag_set_input_line(space->machine, "soundcpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", 0, CLEAR_LINE);
return soundlatch_r(space, 0);
}
@@ -491,12 +491,12 @@ static READ8_HANDLER( mux_port_r )
{
switch( input_selector )
{
- case 0x01: return input_port_read(space->machine, "IN0-1");
- case 0x02: return input_port_read(space->machine, "IN0-2");
- case 0x04: return input_port_read(space->machine, "IN0-3");
- case 0x08: return input_port_read(space->machine, "IN0-4");
- case 0x10: return input_port_read(space->machine, "IN0-5");
- case 0x20: return input_port_read(space->machine, "IN0-6");
+ case 0x01: return input_port_read(space->machine(), "IN0-1");
+ case 0x02: return input_port_read(space->machine(), "IN0-2");
+ case 0x04: return input_port_read(space->machine(), "IN0-3");
+ case 0x08: return input_port_read(space->machine(), "IN0-4");
+ case 0x10: return input_port_read(space->machine(), "IN0-5");
+ case 0x20: return input_port_read(space->machine(), "IN0-6");
}
return 0xff;
@@ -515,8 +515,8 @@ static WRITE8_HANDLER( mux_port_w )
*/
input_selector = (data ^ 0xff) & 0x3f; /* Input Selector, */
- coin_counter_w(space->machine, 0, (data ^ 0xff) & 0x40); /* Credits In (mechanical meters) */
- coin_counter_w(space->machine, 1, (data ^ 0xff) & 0x80); /* Credits Out (mechanical meters) */
+ coin_counter_w(space->machine(), 0, (data ^ 0xff) & 0x40); /* Credits In (mechanical meters) */
+ coin_counter_w(space->machine(), 1, (data ^ 0xff) & 0x80); /* Credits Out (mechanical meters) */
// logerror("muxsel: %02x \n", input_selector);
}
@@ -534,9 +534,9 @@ static WRITE8_HANDLER( wc_meters_w )
Data is written inverted.
*/
- coin_counter_w(space->machine, 0, (data ^ 0xff) & 0x01); /* Credits In */
- coin_counter_w(space->machine, 1, (data ^ 0xff) & 0x02); /* Credits In (through Coin 3) */
- coin_counter_w(space->machine, 2, (data ^ 0xff) & 0x04); /* Credits Out */
+ coin_counter_w(space->machine(), 0, (data ^ 0xff) & 0x01); /* Credits In */
+ coin_counter_w(space->machine(), 1, (data ^ 0xff) & 0x02); /* Credits In (through Coin 3) */
+ coin_counter_w(space->machine(), 2, (data ^ 0xff) & 0x04); /* Credits Out */
// popmessage("meters: %02x", (data ^ 0xff));
}
diff --git a/src/mame/drivers/cosmic.c b/src/mame/drivers/cosmic.c
index 3fc698cd07a..ade1987d744 100644
--- a/src/mame/drivers/cosmic.c
+++ b/src/mame/drivers/cosmic.c
@@ -39,7 +39,7 @@ a physical DSW B but only read when SWA:3,4 are both set to OFF. Currently,
static WRITE8_HANDLER( panic_sound_output_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
/* Sound Enable / Disable */
if (offset == 11)
@@ -115,7 +115,7 @@ static WRITE8_HANDLER( panic_sound_output2_w )
static WRITE8_HANDLER( cosmicg_output_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
/* Sound Enable / Disable */
if (offset == 12)
@@ -179,7 +179,7 @@ static WRITE8_HANDLER( cosmicg_output_w )
static WRITE8_HANDLER( cosmica_sound_output_w )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
/* Sound Enable / Disable */
if (offset == 11)
@@ -318,7 +318,7 @@ static INTERRUPT_GEN( panic_interrupt )
/* mostly not noticed since sound is */
/* only enabled if game in progress! */
- if ((input_port_read(device->machine, "SYSTEM") & 0xc0) != 0xc0)
+ if ((input_port_read(device->machine(), "SYSTEM") & 0xc0) != 0xc0)
panic_sound_output_w(device->memory().space(AS_PROGRAM), 17, 1);
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xcf); /* RST 08h */
@@ -329,12 +329,12 @@ static INTERRUPT_GEN( panic_interrupt )
static INTERRUPT_GEN( cosmica_interrupt )
{
- cosmic_state *state = device->machine->driver_data<cosmic_state>();
+ cosmic_state *state = device->machine().driver_data<cosmic_state>();
state->pixel_clock = (state->pixel_clock + 2) & 0x3f;
if (state->pixel_clock == 0)
{
- if (input_port_read(device->machine, "FAKE") & 1) /* Left Coin */
+ if (input_port_read(device->machine(), "FAKE") & 1) /* Left Coin */
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -348,7 +348,7 @@ static INTERRUPT_GEN( cosmicg_interrupt )
It makes sense and works fine, but I cannot be 100% sure this is correct,
as I have no Cosmic Guerilla console :-) . */
- if ((input_port_read(device->machine, "IN2") & 1)) /* Coin */
+ if ((input_port_read(device->machine(), "IN2") & 1)) /* Coin */
/* on tms9980, a 6 on the interrupt bus means level 4 interrupt */
device_set_input_line_and_vector(device, 0, ASSERT_LINE, 6);
else
@@ -358,35 +358,35 @@ static INTERRUPT_GEN( cosmicg_interrupt )
static INTERRUPT_GEN( magspot_interrupt )
{
/* Coin 1 causes an IRQ, Coin 2 an NMI */
- if (input_port_read(device->machine, "COINS") & 0x01)
+ if (input_port_read(device->machine(), "COINS") & 0x01)
device_set_input_line(device, 0, HOLD_LINE);
- else if (input_port_read(device->machine, "COINS") & 0x02)
+ else if (input_port_read(device->machine(), "COINS") & 0x02)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static INTERRUPT_GEN( nomnlnd_interrupt )
{
/* Coin causes an NMI */
- if (input_port_read(device->machine, "COIN") & 0x01)
+ if (input_port_read(device->machine(), "COIN") & 0x01)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( cosmica_pixel_clock_r )
{
- cosmic_state *state = space->machine->driver_data<cosmic_state>();
+ cosmic_state *state = space->machine().driver_data<cosmic_state>();
return state->pixel_clock;
}
static READ8_HANDLER( cosmicg_port_0_r )
{
/* The top four address lines from the CRTC are bits 0-3 */
- return (input_port_read(space->machine, "IN0") & 0xf0) | ((space->machine->primary_screen->vpos() & 0xf0) >> 4);
+ return (input_port_read(space->machine(), "IN0") & 0xf0) | ((space->machine().primary_screen->vpos() & 0xf0) >> 4);
}
static READ8_HANDLER( magspot_coinage_dip_r )
{
- return (input_port_read_safe(space->machine, "DSW", 0) & (1 << (7 - offset))) ? 0 : 1;
+ return (input_port_read_safe(space->machine(), "DSW", 0) & (1 << (7 - offset))) ? 0 : 1;
}
@@ -394,8 +394,8 @@ static READ8_HANDLER( magspot_coinage_dip_r )
static READ8_HANDLER( nomnlnd_port_0_1_r )
{
- int control = input_port_read(space->machine, offset ? "IN1" : "IN0");
- int fire = input_port_read(space->machine, "IN3");
+ int control = input_port_read(space->machine(), offset ? "IN1" : "IN0");
+ int fire = input_port_read(space->machine(), "IN3");
/* If firing - stop tank */
if ((fire & 0xc0) == 0) return 0xff;
@@ -413,7 +413,7 @@ static READ8_HANDLER( nomnlnd_port_0_1_r )
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data & 0x80);
+ flip_screen_set(space->machine(), data & 0x80);
}
@@ -1012,10 +1012,10 @@ static const samples_interface cosmicg_samples_interface =
static MACHINE_START( cosmic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
- state->samples = machine->device("samples");
- state->dac = machine->device("dac");
+ state->samples = machine.device("samples");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->sound_enabled));
state->save_item(NAME(state->march_select));
@@ -1029,7 +1029,7 @@ static MACHINE_START( cosmic )
static MACHINE_RESET( cosmic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
state->pixel_clock = 0;
state->background_enable = 0;
@@ -1563,11 +1563,11 @@ ROM_END
static DRIVER_INIT( cosmicg )
{
/* Program ROMs have data pins connected different from normal */
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
offs_t offs, len;
UINT8 *rom;
- len = machine->region("maincpu")->bytes();
- rom = machine->region("maincpu")->base();
+ len = machine.region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
for (offs = 0; offs < len; offs++)
{
UINT8 scrambled = rom[offs];
@@ -1588,7 +1588,7 @@ static DRIVER_INIT( cosmicg )
static DRIVER_INIT( cosmica )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
state->sound_enabled = 1;
state->dive_bomb_b_select = 0;
}
@@ -1596,22 +1596,22 @@ static DRIVER_INIT( cosmica )
static DRIVER_INIT( devzone )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
}
static DRIVER_INIT( nomnlnd )
{
- device_t *dac = machine->device("dac");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5000, 0x5001, FUNC(nomnlnd_port_0_1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x4800, 0x4800);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x480a, 0x480a, FUNC(dac_w));
+ device_t *dac = machine.device("dac");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x5000, 0x5001, FUNC(nomnlnd_port_0_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x4800, 0x4800);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x4807, 0x4807, FUNC(cosmic_background_enable_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x480a, 0x480a, FUNC(dac_w));
}
static DRIVER_INIT( panic )
{
- cosmic_state *state = machine->driver_data<cosmic_state>();
+ cosmic_state *state = machine.driver_data<cosmic_state>();
state->sound_enabled = 1;
}
diff --git a/src/mame/drivers/cps1.c b/src/mame/drivers/cps1.c
index 95fd98c71a2..f63d7246aaf 100644
--- a/src/mame/drivers/cps1.c
+++ b/src/mame/drivers/cps1.c
@@ -247,45 +247,45 @@ Stephh's log (2006.09.20) :
READ16_HANDLER( cps1_dsw_r )
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
- int in = input_port_read(space->machine, dswname[offset]);
+ int in = input_port_read(space->machine(), dswname[offset]);
return (in << 8) | 0xff;
}
static READ16_HANDLER( cps1_hack_dsw_r )
{
static const char *const dswname[] = { "IN0", "DSWA", "DSWB", "DSWC" };
- int in = input_port_read(space->machine, dswname[offset]);
+ int in = input_port_read(space->machine(), dswname[offset]);
return (in << 8) | in;
}
static READ16_HANDLER( forgottn_dial_0_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- return ((input_port_read(space->machine, "DIAL0") - state->dial[0]) >> (8 * offset)) & 0xff;
+ cps_state *state = space->machine().driver_data<cps_state>();
+ return ((input_port_read(space->machine(), "DIAL0") - state->dial[0]) >> (8 * offset)) & 0xff;
}
static READ16_HANDLER( forgottn_dial_1_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- return ((input_port_read(space->machine, "DIAL1") - state->dial[1]) >> (8 * offset)) & 0xff;
+ cps_state *state = space->machine().driver_data<cps_state>();
+ return ((input_port_read(space->machine(), "DIAL1") - state->dial[1]) >> (8 * offset)) & 0xff;
}
static WRITE16_HANDLER( forgottn_dial_0_reset_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- state->dial[0] = input_port_read(space->machine, "DIAL0");
+ cps_state *state = space->machine().driver_data<cps_state>();
+ state->dial[0] = input_port_read(space->machine(), "DIAL0");
}
static WRITE16_HANDLER( forgottn_dial_1_reset_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
- state->dial[1] = input_port_read(space->machine, "DIAL1");
+ cps_state *state = space->machine().driver_data<cps_state>();
+ state->dial[1] = input_port_read(space->machine(), "DIAL1");
}
static WRITE8_HANDLER( cps1_snd_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE8_DEVICE_HANDLER( cps1_oki_pin7_w )
@@ -309,10 +309,10 @@ WRITE16_HANDLER( cps1_coinctrl_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, ~data & 0x0400);
- coin_lockout_w(space->machine, 1, ~data & 0x0800);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, ~data & 0x0400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x0800);
// bit 15 = CPS-A custom reset?
}
@@ -322,10 +322,10 @@ static WRITE16_HANDLER( cpsq_coinctrl2_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 2, data & 0x01);
- coin_lockout_w(space->machine, 2, ~data & 0x02);
- coin_counter_w(space->machine, 3, data & 0x04);
- coin_lockout_w(space->machine, 3, ~data & 0x08);
+ coin_counter_w(space->machine(), 2, data & 0x01);
+ coin_lockout_w(space->machine(), 2, ~data & 0x02);
+ coin_counter_w(space->machine(), 3, data & 0x04);
+ coin_lockout_w(space->machine(), 3, ~data & 0x08);
}
}
@@ -352,7 +352,7 @@ static INTERRUPT_GEN( cps1_qsound_interrupt )
static READ16_HANDLER( qsound_rom_r )
{
- UINT8 *rom = space->machine->region("user1")->base();
+ UINT8 *rom = space->machine().region("user1")->base();
if (rom)
return rom[offset] | 0xff00;
@@ -365,13 +365,13 @@ static READ16_HANDLER( qsound_rom_r )
READ16_HANDLER( qsound_sharedram1_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
return state->qsound_sharedram1[offset] | 0xff00;
}
WRITE16_HANDLER( qsound_sharedram1_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
state->qsound_sharedram1[offset] = data;
@@ -379,13 +379,13 @@ WRITE16_HANDLER( qsound_sharedram1_w )
static READ16_HANDLER( qsound_sharedram2_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
return state->qsound_sharedram2[offset] | 0xff00;
}
static WRITE16_HANDLER( qsound_sharedram2_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
state->qsound_sharedram2[offset] = data;
@@ -395,13 +395,13 @@ static WRITE8_HANDLER( qsound_banksw_w )
{
/* Z80 bank register for music note data. It's odd that it isn't encrypted though. */
int bank = data & 0x0f;
- if ((0x10000 + (bank * 0x4000)) >= space->machine->region("audiocpu")->bytes())
+ if ((0x10000 + (bank * 0x4000)) >= space->machine().region("audiocpu")->bytes())
{
logerror("WARNING: Q sound bank overflow (%02x)\n", data);
bank = 0;
}
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
@@ -2922,7 +2922,7 @@ GFXDECODE_END
static void cps1_irq_handler_mus(device_t *device, int irq)
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -2944,22 +2944,22 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( common )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_START( cps1 )
{
MACHINE_START_CALL(common);
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_START( qsound )
{
MACHINE_START_CALL(common);
- memory_configure_bank(machine, "bank1", 0, 6, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 6, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
static MACHINE_CONFIG_START( cps1_10MHz, cps_state )
@@ -9961,14 +9961,14 @@ ROM_END
static DRIVER_INIT( forgottn )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
/* Forgotten Worlds has a NEC uPD4701AC on the B-board handling dial inputs from the CN-MOWS connector. */
/* The memory mapping is handled by PAL LWIO */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800040, 0x800041, FUNC(forgottn_dial_0_reset_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800048, 0x800049, FUNC(forgottn_dial_1_reset_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800052, 0x800055, FUNC(forgottn_dial_0_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80005a, 0x80005d, FUNC(forgottn_dial_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800040, 0x800041, FUNC(forgottn_dial_0_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x800048, 0x800049, FUNC(forgottn_dial_1_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800052, 0x800055, FUNC(forgottn_dial_0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80005a, 0x80005d, FUNC(forgottn_dial_1_r));
state->save_item(NAME(state->dial));
@@ -9982,8 +9982,8 @@ static DRIVER_INIT( sf2ee )
{
/* This specific revision of SF2 has the CPS-B custom mapped at a different address. */
/* The mapping is handled by the PAL IOB2 on the B-board */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x800140, 0x80017f);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_readwrite(0x800140, 0x80017f);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
DRIVER_INIT_CALL(cps1);
}
@@ -9991,7 +9991,7 @@ static DRIVER_INIT( sf2ee )
static DRIVER_INIT( sf2thndr )
{
/* This particular hack uses a modified B-board PAL which mirrors the CPS-B registers at an alternate address */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x8001c0, 0x8001ff, FUNC(cps1_cps_b_r), FUNC(cps1_cps_b_w));
DRIVER_INIT_CALL(cps1);
}
@@ -9999,7 +9999,7 @@ static DRIVER_INIT( sf2thndr )
static DRIVER_INIT( sf2hack )
{
/* some SF2 hacks have some inputs wired to the LSB instead of MSB */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800018, 0x80001f, FUNC(cps1_hack_dsw_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x800018, 0x80001f, FUNC(cps1_hack_dsw_r));
DRIVER_INIT_CALL(cps1);
}
@@ -10032,14 +10032,14 @@ static DRIVER_INIT( pang3n )
{
/* Pang 3 is the only non-QSound game to have an EEPROM. */
/* It is mapped in the CPS-B address range so probably is on the C-board. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_port(0x80017a, 0x80017b, "EEPROMIN", "EEPROMOUT");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_readwrite_port(0x80017a, 0x80017b, "EEPROMIN", "EEPROMOUT");
DRIVER_INIT_CALL(cps1);
}
static DRIVER_INIT( pang3 )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
int A, src, dst;
for (A = 0x80000; A < 0x100000; A += 2)
@@ -10070,8 +10070,8 @@ static READ16_HANDLER( sf2mdt_r )
static DRIVER_INIT( sf2mdt )
{
int i;
- UINT32 gfx_size = machine->region( "gfx" )->bytes();
- UINT8 *rom = machine->region( "gfx" )->base();
+ UINT32 gfx_size = machine.region( "gfx" )->bytes();
+ UINT8 *rom = machine.region( "gfx" )->base();
UINT8 tmp;
for( i = 0; i < gfx_size; i += 8 )
@@ -10083,11 +10083,11 @@ static DRIVER_INIT( sf2mdt )
rom[i + 3] = rom[i + 6];
rom[i + 6] = tmp;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01a, 0x70c01b, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01c, 0x70c01d, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01e, 0x70c01f, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c010, 0x70c011, FUNC(sf2mdt_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c018, 0x70c019, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01a, 0x70c01b, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01c, 0x70c01d, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c01e, 0x70c01f, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c010, 0x70c011, FUNC(sf2mdt_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x70c018, 0x70c019, FUNC(sf2mdt_r));
DRIVER_INIT_CALL(cps1);
}
@@ -10095,7 +10095,7 @@ static DRIVER_INIT( sf2mdt )
static DRIVER_INIT( dinohunt )
{
// is this shared with the new sound hw?
- UINT8* ram = (UINT8*)machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xf18000, 0xf19fff);
+ UINT8* ram = (UINT8*)machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xf18000, 0xf19fff);
memset(ram,0xff,0x2000);
DRIVER_INIT_CALL(cps1);
}
diff --git a/src/mame/drivers/cps2.c b/src/mame/drivers/cps2.c
index b5a08555481..b03851712ca 100644
--- a/src/mame/drivers/cps2.c
+++ b/src/mame/drivers/cps2.c
@@ -624,7 +624,7 @@ Stephh's inputs notes (based on some tests on the "parent" set) :
static INTERRUPT_GEN( cps2_interrupt )
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
/* 2 is vblank, 4 is some sort of scanline interrupt, 6 is both at the same time. */
if (state->scancount >= 258)
@@ -647,8 +647,8 @@ static INTERRUPT_GEN( cps2_interrupt )
{
state->cps_b_regs[0x10/2] = 0;
device_set_input_line(device, 4, HOLD_LINE);
- cps2_set_sprite_priorities(device->machine);
- device->machine->primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
+ cps2_set_sprite_priorities(device->machine());
+ device->machine().primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
state->scancalls++;
// popmessage("IRQ4 scancounter = %04i", state->scancount);
}
@@ -658,8 +658,8 @@ static INTERRUPT_GEN( cps2_interrupt )
{
state->cps_b_regs[0x12 / 2] = 0;
device_set_input_line(device, 4, HOLD_LINE);
- cps2_set_sprite_priorities(device->machine);
- device->machine->primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
+ cps2_set_sprite_priorities(device->machine());
+ device->machine().primary_screen->update_partial(16 - 10 + state->scancount); /* visarea.min_y - [first visible line?] + scancount */
state->scancalls++;
// popmessage("IRQ4 scancounter = %04i",scancount);
}
@@ -671,10 +671,10 @@ static INTERRUPT_GEN( cps2_interrupt )
device_set_input_line(device, 2, HOLD_LINE);
if(state->scancalls)
{
- cps2_set_sprite_priorities(device->machine);
- device->machine->primary_screen->update_partial(256);
+ cps2_set_sprite_priorities(device->machine());
+ device->machine().primary_screen->update_partial(256);
}
- cps2_objram_latch(device->machine);
+ cps2_objram_latch(device->machine());
}
//popmessage("Raster calls = %i", state->scancalls);
}
@@ -697,7 +697,7 @@ static const eeprom_interface cps2_eeprom_interface =
static WRITE16_HANDLER( cps2_eeprom_port_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_8_15)
{
@@ -711,7 +711,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
/* bit 7 - */
/* EEPROM */
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
}
if (ACCESSING_BITS_0_7)
@@ -729,37 +729,37 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
if (state->audiocpu != NULL)
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 0x0008) ? CLEAR_LINE : ASSERT_LINE);
- coin_counter_w(space->machine, 0, data & 0x0001);
- if ((strncmp(space->machine->system().name, "pzloop2", 8) == 0) ||
- (strncmp(space->machine->system().name, "pzloop2j", 8) == 0))
+ coin_counter_w(space->machine(), 0, data & 0x0001);
+ if ((strncmp(space->machine().system().name, "pzloop2", 8) == 0) ||
+ (strncmp(space->machine().system().name, "pzloop2j", 8) == 0))
{
// Puzz Loop 2 uses coin counter 2 input to switch between stick and paddle controls
state->readpaddle = data & 0x0002;
}
else
{
- coin_counter_w(space->machine, 1, data & 0x0002);
+ coin_counter_w(space->machine(), 1, data & 0x0002);
}
- if (strncmp(space->machine->system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
+ if (strncmp(space->machine().system().name, "mmatrix", 7) == 0) // Mars Matrix seems to require the coin lockout bit to be reversed
{
- coin_lockout_w(space->machine, 0, data & 0x0010);
- coin_lockout_w(space->machine, 1, data & 0x0020);
- coin_lockout_w(space->machine, 2, data & 0x0040);
- coin_lockout_w(space->machine, 3, data & 0x0080);
+ coin_lockout_w(space->machine(), 0, data & 0x0010);
+ coin_lockout_w(space->machine(), 1, data & 0x0020);
+ coin_lockout_w(space->machine(), 2, data & 0x0040);
+ coin_lockout_w(space->machine(), 3, data & 0x0080);
}
else
{
- coin_lockout_w(space->machine, 0, ~data & 0x0010);
- coin_lockout_w(space->machine, 1, ~data & 0x0020);
- coin_lockout_w(space->machine, 2, ~data & 0x0040);
- coin_lockout_w(space->machine, 3, ~data & 0x0080);
+ coin_lockout_w(space->machine(), 0, ~data & 0x0010);
+ coin_lockout_w(space->machine(), 1, ~data & 0x0020);
+ coin_lockout_w(space->machine(), 2, ~data & 0x0040);
+ coin_lockout_w(space->machine(), 3, ~data & 0x0080);
}
/*
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x10);
- set_led_status(space->machine, 2, data & 0x20);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x10);
+ set_led_status(space->machine(), 2, data & 0x20);
*/
}
}
@@ -773,7 +773,7 @@ static WRITE16_HANDLER( cps2_eeprom_port_w )
static READ16_HANDLER( cps2_qsound_volume_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
/* Extra adapter memory (0x660000-0x663fff) available when bit 14 = 0 */
/* Network adapter (ssf2tb) present when bit 15 = 0 */
@@ -799,12 +799,12 @@ static READ16_HANDLER( kludge_r )
static READ16_HANDLER( joy_or_paddle_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (state->readpaddle != 0)
- return (input_port_read(space->machine, "IN0"));
+ return (input_port_read(space->machine(), "IN0"));
else
- return (input_port_read(space->machine, "PADDLE1") & 0xff) | (input_port_read(space->machine, "PADDLE2") << 8);
+ return (input_port_read(space->machine(), "PADDLE1") & 0xff) | (input_port_read(space->machine(), "PADDLE2") << 8);
}
@@ -1201,15 +1201,15 @@ GFXDECODE_END
static MACHINE_START( cps2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->scancount));
if (state->audiocpu != NULL) // gigamn2 has no audiocpu
- memory_configure_bank(machine, "bank1", 0, (QSOUND_SIZE - 0x10000) / 0x4000, machine->region("audiocpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, (QSOUND_SIZE - 0x10000) / 0x4000, machine.region("audiocpu")->base() + 0x10000, 0x4000);
}
@@ -7974,7 +7974,7 @@ ROM_END
static DRIVER_INIT( cps2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
/* Decrypt the game - see machine/cps2crpt.c */
DRIVER_INIT_CALL(cps2crpt);
@@ -7985,12 +7985,12 @@ static DRIVER_INIT( cps2 )
state->scancount = 0;
state->cps2networkpresent = 0;
- machine->device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
+ machine.device("maincpu")->set_clock_scale(0.7375f); /* RAM access waitstates etc. aren't emulated - slow the CPU to compensate */
}
static DRIVER_INIT( ssf2tb )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
DRIVER_INIT_CALL(cps2);
@@ -8004,7 +8004,7 @@ static DRIVER_INIT( ssf2tb )
static DRIVER_INIT ( pzloop2 )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
DRIVER_INIT_CALL(cps2);
@@ -8012,36 +8012,36 @@ static DRIVER_INIT ( pzloop2 )
state->save_item(NAME(state->readpaddle));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x804000, 0x804001, FUNC(joy_or_paddle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x804000, 0x804001, FUNC(joy_or_paddle_r));
}
static READ16_HANDLER( gigamn2_dummyqsound_r )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
return state->gigamn2_dummyqsound_ram[offset];
};
static WRITE16_HANDLER( gigamn2_dummyqsound_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->gigamn2_dummyqsound_ram[offset] = data;
};
static DRIVER_INIT( gigamn2 )
{
- cps_state *state = machine->driver_data<cps_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
- int length = machine->region("maincpu")->bytes();
+ cps_state *state = machine.driver_data<cps_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
DRIVER_INIT_CALL(cps2);
state->gigamn2_dummyqsound_ram = auto_alloc_array(machine, UINT16, 0x20000 / 2);
state->save_pointer(NAME(state->gigamn2_dummyqsound_ram), 0x20000 / 2);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigamn2_dummyqsound_r), FUNC(gigamn2_dummyqsound_w)); // no qsound..
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x618000, 0x619fff, FUNC(gigamn2_dummyqsound_r), FUNC(gigamn2_dummyqsound_w)); // no qsound..
space->set_decrypted_region(0x000000, (length) - 1, &rom[length/4]);
- m68k_set_encrypted_opcode_range(machine->device("maincpu"), 0, length);
+ m68k_set_encrypted_opcode_range(machine.device("maincpu"), 0, length);
}
diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c
index eb1a5a97a94..f599336c5a5 100644
--- a/src/mame/drivers/cps3.c
+++ b/src/mame/drivers/cps3.c
@@ -345,14 +345,14 @@ Notes:
#define CPS3_TRANSPARENCY_PEN_INDEX 2
#define CPS3_TRANSPARENCY_PEN_INDEX_BLEND 3
-static void copy_from_nvram(running_machine *machine);
+static void copy_from_nvram(running_machine &machine);
INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_element *gfx,
unsigned int code,unsigned int color,int flipx,int flipy,int sx,int sy,
int transparency,int transparent_color,
int scalex, int scaley,bitmap_t *pri_buffer,UINT32 pri_mask)
{
- cps3_state *state = gfx->machine->driver_data<cps3_state>();
+ cps3_state *state = gfx->machine().driver_data<cps3_state>();
rectangle myclip;
// UINT8 al;
@@ -549,7 +549,7 @@ INLINE void cps3_drawgfxzoom(bitmap_t *dest_bmp,const rectangle *clip,const gfx_
if (c&0x02) dest[x] |= 0x4000;
if (c&0x04) dest[x] |= 0x8000;
if (c&0x08) dest[x] |= 0x10000;
- if (c&0xf0) dest[x] |= gfx->machine->rand(); // ?? not used?
+ if (c&0xf0) dest[x] |= gfx->machine().rand(); // ?? not used?
}
else
{
@@ -616,13 +616,13 @@ static UINT32 cps3_mask(UINT32 address, UINT32 key1, UINT32 key2)
return val | (val << 16);
}
-static void cps3_decrypt_bios(running_machine *machine)
+static void cps3_decrypt_bios(running_machine &machine)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int i;
- UINT32 *coderegion = (UINT32*)machine->region("user1")->base();
+ UINT32 *coderegion = (UINT32*)machine.region("user1")->base();
- state->decrypted_bios = (UINT32*)machine->region("user1")->base();
+ state->decrypted_bios = (UINT32*)machine.region("user1")->base();
for (i=0;i<0x80000;i+=4)
{
@@ -634,7 +634,7 @@ static void cps3_decrypt_bios(running_machine *machine)
/* Dump to file */
{
FILE *fp;
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
char filename[256];
sprintf(filename, "%s_bios.dump", gamename);
@@ -649,23 +649,23 @@ static void cps3_decrypt_bios(running_machine *machine)
}
-static void init_common(running_machine *machine, UINT32 key1, UINT32 key2, int altEncryption)
+static void init_common(running_machine &machine, UINT32 key1, UINT32 key2, int altEncryption)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
state->key1 = key1;
state->key2 = key2;
state->altEncryption = altEncryption;
// cache pointers to regions
- state->user4region = machine->region("user4")->base();
- state->user5region = machine->region("user5")->base();
+ state->user4region = machine.region("user4")->base();
+ state->user5region = machine.region("user5")->base();
if (!state->user4region) state->user4region = auto_alloc_array(machine, UINT8, USER4REGION_LENGTH);
if (!state->user5region) state->user5region = auto_alloc_array(machine, UINT8, USER5REGION_LENGTH);
// set strict verify
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_STRICT_VERIFY);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_STRICT_VERIFY);
cps3_decrypt_bios(machine);
state->decrypted_gamerom = auto_alloc_array(machine, UINT32, 0x1000000/4);
@@ -678,17 +678,17 @@ static void init_common(running_machine *machine, UINT32 key1, UINT32 key2, int
state->_0xc0000000_ram_decrypted = auto_alloc_array(machine, UINT32, 0x400/4);
- address_space *main = machine->device<sh2_device>("maincpu")->space(AS_PROGRAM);
- main->set_direct_update_handler(direct_update_delegate_create_static(cps3_direct_handler, *machine));
+ address_space *main = machine.device<sh2_device>("maincpu")->space(AS_PROGRAM);
+ main->set_direct_update_handler(direct_update_delegate_create_static(cps3_direct_handler, machine));
// flash roms
astring tempstr;
for (int simmnum = 0; simmnum < 7; simmnum++)
for (int chipnum = 0; chipnum < 8; chipnum++)
- state->simm[simmnum][chipnum] = machine->device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum));
+ state->simm[simmnum][chipnum] = machine.device<fujitsu_29f016a_device>(tempstr.format("simm%d.%d", simmnum + 1, chipnum));
state->eeprom = auto_alloc_array(machine, UINT32, 0x400/4);
- machine->device<nvram_device>("eeprom")->set_base(state->eeprom, 0x400);
+ machine.device<nvram_device>("eeprom")->set_base(state->eeprom, 0x400);
}
static DRIVER_INIT( jojo ) { init_common(machine, 0x02203ee3, 0x01301972, 0); }
@@ -729,9 +729,9 @@ static const gfx_layout cps3_tiles8x8_layout =
};
-static void cps3_set_mame_colours(running_machine *machine, int colournum, UINT16 data, UINT32 fadeval)
+static void cps3_set_mame_colours(running_machine &machine, int colournum, UINT16 data, UINT32 fadeval)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int r,g,b;
UINT16* dst = (UINT16*)state->colourram;
@@ -771,7 +771,7 @@ static void cps3_set_mame_colours(running_machine *machine, int colournum, UINT1
static VIDEO_START(cps3)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
state->ss_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
memset(state->ss_ram, 0x00, 0x10000);
state_save_register_global_pointer(machine, state->ss_ram, 0x10000/4);
@@ -781,13 +781,13 @@ static VIDEO_START(cps3)
state_save_register_global_pointer(machine, state->char_ram, 0x800000 /4);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[0] = gfx_element_alloc(machine, &cps3_tiles8x8_layout, (UINT8 *)state->ss_ram, machine->total_colors() / 16, 0);
+ machine.gfx[0] = gfx_element_alloc(machine, &cps3_tiles8x8_layout, (UINT8 *)state->ss_ram, machine.total_colors() / 16, 0);
//decode_ssram();
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[1] = gfx_element_alloc(machine, &cps3_tiles16x16_layout, (UINT8 *)state->char_ram, machine->total_colors() / 64, 0);
- machine->gfx[1]->color_granularity = 64;
+ machine.gfx[1] = gfx_element_alloc(machine, &cps3_tiles16x16_layout, (UINT8 *)state->char_ram, machine.total_colors() / 64, 0);
+ machine.gfx[1]->color_granularity = 64;
//decode_charram();
@@ -798,7 +798,7 @@ static VIDEO_START(cps3)
// the renderbuffer can be twice the size of the screen, this allows us to handle framebuffer zoom values
// between 0x00 and 0x80 (0x40 is normal, 0x80 would be 'view twice as much', 0x20 is 'view half as much')
- state->renderbuffer_bitmap = auto_bitmap_alloc(machine,512*2,224*2,machine->primary_screen->format());
+ state->renderbuffer_bitmap = auto_bitmap_alloc(machine,512*2,224*2,machine.primary_screen->format());
state->renderbuffer_clip.min_x = 0;
state->renderbuffer_clip.max_x = state->screenwidth-1;
@@ -811,9 +811,9 @@ static VIDEO_START(cps3)
// the 0x400 bit in the tilemap regs is "draw it upside-down" (bios tilemap during flashing, otherwise capcom logo is flipped)
-static void cps3_draw_tilemapsprite_line(running_machine *machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
+static void cps3_draw_tilemapsprite_line(running_machine &machine, int tmnum, int drawline, bitmap_t *bitmap, const rectangle *cliprect )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT32* tmapregs[4] = { state->tilemap20_regs_base, state->tilemap30_regs_base, state->tilemap40_regs_base, state->tilemap50_regs_base };
UINT32* regs;
int line;
@@ -886,17 +886,17 @@ static void cps3_draw_tilemapsprite_line(running_machine *machine, int tmnum, in
yflip = (dat & 0x00000800)>>11;
xflip = (dat & 0x00001000)>>12;
- if (!bpp) machine->gfx[1]->color_granularity=256;
- else machine->gfx[1]->color_granularity=64;
+ if (!bpp) machine.gfx[1]->color_granularity=256;
+ else machine.gfx[1]->color_granularity=64;
- cps3_drawgfxzoom(bitmap,&clip,machine->gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
+ cps3_drawgfxzoom(bitmap,&clip,machine.gfx[1],tileno,colour,xflip,yflip,(x*16)-scrollx%16,drawline-tilesubline,CPS3_TRANSPARENCY_PEN_INDEX,0, 0x10000, 0x10000, NULL, 0);
}
}
}
static SCREEN_UPDATE(cps3)
{
- cps3_state *state = screen->machine->driver_data<cps3_state>();
+ cps3_state *state = screen->machine().driver_data<cps3_state>();
int y,x, count;
attoseconds_t period = screen->frame_period().attoseconds;
rectangle visarea = screen->visible_area();
@@ -1046,7 +1046,7 @@ static SCREEN_UPDATE(cps3)
{
for (uu=0;uu<1023;uu++)
{
- cps3_draw_tilemapsprite_line(screen->machine, tilemapnum, uu, state->renderbuffer_bitmap, &state->renderbuffer_clip );
+ cps3_draw_tilemapsprite_line(screen->machine(), tilemapnum, uu, state->renderbuffer_bitmap, &state->renderbuffer_clip );
}
}
bg_drawn[tilemapnum] = 1;
@@ -1104,7 +1104,7 @@ static SCREEN_UPDATE(cps3)
if (current_ypos&0x200) current_ypos-=0x400;
- //if ( (whichbpp) && (machine->primary_screen->frame_number() & 1)) continue;
+ //if ( (whichbpp) && (machine.primary_screen->frame_number() & 1)) continue;
/* use the palette value from the main list or the sublists? */
if (whichpal)
@@ -1119,13 +1119,13 @@ static SCREEN_UPDATE(cps3)
/* use the bpp value from the main list or the sublists? */
if (whichbpp)
{
- if (!global_bpp) screen->machine->gfx[1]->color_granularity=256;
- else screen->machine->gfx[1]->color_granularity=64;
+ if (!global_bpp) screen->machine().gfx[1]->color_granularity=256;
+ else screen->machine().gfx[1]->color_granularity=64;
}
else
{
- if (!bpp) screen->machine->gfx[1]->color_granularity=256;
- else screen->machine->gfx[1]->color_granularity=64;
+ if (!bpp) screen->machine().gfx[1]->color_granularity=256;
+ else screen->machine().gfx[1]->color_granularity=64;
}
{
@@ -1133,11 +1133,11 @@ static SCREEN_UPDATE(cps3)
if (global_alpha || alpha)
{
- cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
+ cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX_BLEND,0,xinc,yinc, NULL, 0);
}
else
{
- cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine->gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
+ cps3_drawgfxzoom(state->renderbuffer_bitmap,&state->renderbuffer_clip,screen->machine().gfx[1],realtileno,actualpal,0^flipx,0^flipy,current_xpos,current_ypos,CPS3_TRANSPARENCY_PEN_INDEX,0,xinc,yinc, NULL, 0);
}
count++;
}
@@ -1203,7 +1203,7 @@ static SCREEN_UPDATE(cps3)
pal += state->ss_pal_base << 5;
tile+=0x200;
- cps3_drawgfxzoom(bitmap, cliprect, screen->machine->gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
+ cps3_drawgfxzoom(bitmap, cliprect, screen->machine().gfx[0],tile,pal,flipx,flipy,x*8,y*8,CPS3_TRANSPARENCY_PEN,0,0x10000,0x10000,NULL,0);
count++;
}
}
@@ -1213,7 +1213,7 @@ static SCREEN_UPDATE(cps3)
static READ32_HANDLER( cps3_ssram_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (offset>0x8000/4)
return LITTLE_ENDIANIZE_INT32(state->ss_ram[offset]);
else
@@ -1222,13 +1222,13 @@ static READ32_HANDLER( cps3_ssram_r )
static WRITE32_HANDLER( cps3_ssram_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (offset>0x8000/4)
{
// we only want to endian-flip the character data, the tilemap info is fine
data = LITTLE_ENDIANIZE_INT32(data);
mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask);
- gfx_element_mark_dirty(space->machine->gfx[0], offset/16);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset/16);
}
COMBINE_DATA(&state->ss_ram[offset]);
@@ -1236,7 +1236,7 @@ static WRITE32_HANDLER( cps3_ssram_w )
static WRITE32_HANDLER( cps3_0xc0000000_ram_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
COMBINE_DATA( &state->_0xc0000000_ram[offset] );
// store a decrypted copy
state->_0xc0000000_ram_decrypted[offset] = state->_0xc0000000_ram[offset]^cps3_mask(offset*4+0xc0000000, state->key1, state->key2);
@@ -1252,7 +1252,7 @@ DIRECT_UPDATE_HANDLER( cps3_direct_handler )
/* BIOS ROM */
if (address < 0x80000)
{
- direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().m_machine.region("user1"));
+ direct.explicit_configure(0x00000, 0x7ffff, 0x7ffff, *direct.space().machine().region("user1"));
return ~0;
}
/* RAM */
@@ -1282,7 +1282,7 @@ DIRECT_UPDATE_HANDLER( cps3_direct_handler )
static WRITE32_HANDLER( cram_bank_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (ACCESSING_BITS_0_7)
{
// this seems to be related to accesses to the 0x04100000 region
@@ -1312,7 +1312,7 @@ static WRITE32_HANDLER( cram_bank_w )
static READ32_HANDLER( cram_data_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 fulloffset = (((state->cram_bank&0x7)*0x100000)/4) + offset;
return LITTLE_ENDIANIZE_INT32(state->char_ram[fulloffset]);
@@ -1320,19 +1320,19 @@ static READ32_HANDLER( cram_data_r )
static WRITE32_HANDLER( cram_data_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 fulloffset = (((state->cram_bank&0x7)*0x100000)/4) + offset;
mem_mask = LITTLE_ENDIANIZE_INT32(mem_mask);
data = LITTLE_ENDIANIZE_INT32(data);
COMBINE_DATA(&state->char_ram[fulloffset]);
- gfx_element_mark_dirty(space->machine->gfx[1], fulloffset/0x40);
+ gfx_element_mark_dirty(space->machine().gfx[1], fulloffset/0x40);
}
/* FLASH ROM ACCESS */
static READ32_HANDLER( cps3_gfxflash_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 result = 0;
if (state->cram_gfxflash_bank&1) offset += 0x200000/4;
@@ -1371,7 +1371,7 @@ static READ32_HANDLER( cps3_gfxflash_r )
static WRITE32_HANDLER( cps3_gfxflash_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
int command;
if (state->cram_gfxflash_bank&1) offset += 0x200000/4;
@@ -1430,7 +1430,7 @@ static WRITE32_HANDLER( cps3_gfxflash_w )
static UINT32 cps3_flashmain_r(address_space *space, int which, UINT32 offset, UINT32 mem_mask)
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 result = 0;
if (state->simm[which][0] == NULL || state->simm[which][1] == NULL || state->simm[which][2] == NULL || state->simm[which][3] == NULL)
@@ -1466,7 +1466,7 @@ static UINT32 cps3_flashmain_r(address_space *space, int which, UINT32 offset, U
static READ32_HANDLER( cps3_flash1_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 retvalue = cps3_flashmain_r(space, 0, offset,mem_mask);
if (state->altEncryption) return retvalue;
@@ -1477,7 +1477,7 @@ static READ32_HANDLER( cps3_flash1_r )
static READ32_HANDLER( cps3_flash2_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT32 retvalue = cps3_flashmain_r(space, 1, offset,mem_mask);
if (state->altEncryption) return retvalue;
@@ -1486,9 +1486,9 @@ static READ32_HANDLER( cps3_flash2_r )
return retvalue;
}
-static void cps3_flashmain_w(running_machine *machine, int which, UINT32 offset, UINT32 data, UINT32 mem_mask)
+static void cps3_flashmain_w(running_machine &machine, int which, UINT32 offset, UINT32 data, UINT32 mem_mask)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int command;
if (state->simm[which][0] == NULL || state->simm[which][1] == NULL || state->simm[which][2] == NULL || state->simm[which][3] == NULL)
@@ -1549,17 +1549,17 @@ static void cps3_flashmain_w(running_machine *machine, int which, UINT32 offset,
static WRITE32_HANDLER( cps3_flash1_w )
{
- cps3_flashmain_w(space->machine,0,offset,data,mem_mask);
+ cps3_flashmain_w(space->machine(),0,offset,data,mem_mask);
}
static WRITE32_HANDLER( cps3_flash2_w )
{
- cps3_flashmain_w(space->machine,1,offset,data,mem_mask);
+ cps3_flashmain_w(space->machine(),1,offset,data,mem_mask);
}
static WRITE32_HANDLER( cram_gfxflash_bank_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (ACCESSING_BITS_24_31)
{
//printf("cram_gfxflash_bank_w MSB32 %08x\n",data);
@@ -1640,7 +1640,7 @@ static READ32_HANDLER( cps3_40C0004_r )
static READ32_HANDLER( cps3_eeprom_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
int addr = offset*4;
if (addr>=0x100 && addr<=0x17f)
@@ -1670,7 +1670,7 @@ static READ32_HANDLER( cps3_eeprom_r )
static WRITE32_HANDLER( cps3_eeprom_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
int addr = offset*4;
if (addr>=0x080 && addr<=0x0ff)
@@ -1723,7 +1723,7 @@ static WRITE32_HANDLER( cps3_cdrom_w )
static WRITE32_HANDLER( cps3_ss_bank_base_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
// might be scroll registers or something else..
// used to display bank with 'insert coin' on during sfiii2 attract intro
COMBINE_DATA(&state->ss_bank_base);
@@ -1733,7 +1733,7 @@ static WRITE32_HANDLER( cps3_ss_bank_base_w )
static WRITE32_HANDLER( cps3_ss_pal_base_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if(DEBUG_PRINTF) printf ("cps3_ss_pal_base_w %08x %08x\n", data, mem_mask);
if(ACCESSING_BITS_24_31)
@@ -1754,7 +1754,7 @@ static WRITE32_HANDLER( cps3_ss_pal_base_w )
static WRITE32_HANDLER( cps3_palettedma_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if (offset==0)
{
COMBINE_DATA(&state->paldma_source);
@@ -1790,11 +1790,11 @@ static WRITE32_HANDLER( cps3_palettedma_w )
//if (state->paldma_fade!=0) printf("%08x\n",state->paldma_fade);
- cps3_set_mame_colours(space->machine, (state->paldma_dest+i)^1, coldata, state->paldma_fade);
+ cps3_set_mame_colours(space->machine(), (state->paldma_dest+i)^1, coldata, state->paldma_fade);
}
- cputag_set_input_line(space->machine, "maincpu", 10, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 10, ASSERT_LINE);
}
@@ -1809,9 +1809,9 @@ static WRITE32_HANDLER( cps3_palettedma_w )
-static UINT32 process_byte( running_machine *machine, UINT8 real_byte, UINT32 destination, int max_length )
+static UINT32 process_byte( running_machine &machine, UINT8 real_byte, UINT32 destination, int max_length )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* dest = (UINT8*)state->char_ram;
//printf("process byte for destination %08x\n", destination);
@@ -1830,7 +1830,7 @@ static UINT32 process_byte( running_machine *machine, UINT8 real_byte, UINT32 de
while (state->rle_length)
{
dest[((destination+tranfercount)&0x7fffff)^3] = (state->last_normal_byte&0x3f);
- gfx_element_mark_dirty(machine->gfx[1], ((destination+tranfercount)&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], ((destination+tranfercount)&0x7fffff)/0x100);
//printf("RLE WRite Byte %08x, %02x\n", destination+tranfercount, real_byte);
tranfercount++;
@@ -1849,14 +1849,14 @@ static UINT32 process_byte( running_machine *machine, UINT8 real_byte, UINT32 de
//printf("Write Normal Data\n");
dest[(destination&0x7fffff)^3] = real_byte;
state->last_normal_byte = real_byte;
- gfx_element_mark_dirty(machine->gfx[1], (destination&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], (destination&0x7fffff)/0x100);
return 1;
}
}
-static void cps3_do_char_dma( running_machine *machine, UINT32 real_source, UINT32 real_destination, UINT32 real_length )
+static void cps3_do_char_dma( running_machine &machine, UINT32 real_source, UINT32 real_destination, UINT32 real_length )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* sourcedata = (UINT8*)state->user5region;
int length_remaining;
@@ -1906,9 +1906,9 @@ static void cps3_do_char_dma( running_machine *machine, UINT32 real_source, UINT
}
}
-static UINT32 ProcessByte8(running_machine *machine,UINT8 b,UINT32 dst_offset)
+static UINT32 ProcessByte8(running_machine &machine,UINT8 b,UINT32 dst_offset)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* destRAM = (UINT8*)state->char_ram;
int l=0;
@@ -1920,7 +1920,7 @@ static UINT32 ProcessByte8(running_machine *machine,UINT8 b,UINT32 dst_offset)
for(i=0;i<rle;++i)
{
destRAM[(dst_offset&0x7fffff)^3] = state->lastb;
- gfx_element_mark_dirty(machine->gfx[1], (dst_offset&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], (dst_offset&0x7fffff)/0x100);
dst_offset++;
++l;
@@ -1934,14 +1934,14 @@ static UINT32 ProcessByte8(running_machine *machine,UINT8 b,UINT32 dst_offset)
state->lastb2=state->lastb;
state->lastb=b;
destRAM[(dst_offset&0x7fffff)^3] = b;
- gfx_element_mark_dirty(machine->gfx[1], (dst_offset&0x7fffff)/0x100);
+ gfx_element_mark_dirty(machine.gfx[1], (dst_offset&0x7fffff)/0x100);
return 1;
}
}
-static void cps3_do_alt_char_dma( running_machine *machine, UINT32 src, UINT32 real_dest, UINT32 real_length )
+static void cps3_do_alt_char_dma( running_machine &machine, UINT32 src, UINT32 real_dest, UINT32 real_length )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT8* px = (UINT8*)state->user5region;
UINT32 start = real_dest;
UINT32 ds = real_dest;
@@ -1981,9 +1981,9 @@ static void cps3_do_alt_char_dma( running_machine *machine, UINT32 src, UINT32 r
}
}
-static void cps3_process_character_dma(running_machine *machine, UINT32 address)
+static void cps3_process_character_dma(running_machine &machine, UINT32 address)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
int i;
//printf("charDMA start:\n");
@@ -2036,7 +2036,7 @@ static void cps3_process_character_dma(running_machine *machine, UINT32 address)
static WRITE32_HANDLER( cps3_characterdma_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
if(DEBUG_PRINTF) printf("chardma_w %08x %08x %08x\n", offset, data, mem_mask);
if (offset==0)
@@ -2063,7 +2063,7 @@ static WRITE32_HANDLER( cps3_characterdma_w )
list_address = (state->chardma_source | ((state->chardma_other&0x003f0000)));
//printf("chardma_w activated %08x %08x (address = cram %08x)\n", state->chardma_source, state->chardma_other, list_address*4 );
- cps3_process_character_dma(space->machine, list_address);
+ cps3_process_character_dma(space->machine(), list_address);
}
else
{
@@ -2082,23 +2082,23 @@ static WRITE32_HANDLER( cps3_characterdma_w )
static WRITE32_HANDLER( cps3_irq10_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 10, CLEAR_LINE); return;
+ cputag_set_input_line(space->machine(), "maincpu", 10, CLEAR_LINE); return;
}
static WRITE32_HANDLER( cps3_irq12_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 12, CLEAR_LINE); return;
+ cputag_set_input_line(space->machine(), "maincpu", 12, CLEAR_LINE); return;
}
static WRITE32_HANDLER( cps3_unk_vidregs_w )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
COMBINE_DATA(&state->unk_vidregs[offset]);
}
static READ32_HANDLER( cps3_colourram_r )
{
- cps3_state *state = space->machine->driver_data<cps3_state>();
+ cps3_state *state = space->machine().driver_data<cps3_state>();
UINT16* src = (UINT16*)state->colourram;
return src[offset*2+1] | (src[offset*2+0]<<16);
@@ -2106,17 +2106,17 @@ static READ32_HANDLER( cps3_colourram_r )
static WRITE32_HANDLER( cps3_colourram_w )
{
- //cps3_state *state = space->machine->driver_data<cps3_state>();
+ //cps3_state *state = space->machine().driver_data<cps3_state>();
// COMBINE_DATA(&state->colourram[offset]);
if (ACCESSING_BITS_24_31)
{
- cps3_set_mame_colours(space->machine, offset*2, (data & 0xffff0000) >> 16, 0);
+ cps3_set_mame_colours(space->machine(), offset*2, (data & 0xffff0000) >> 16, 0);
}
if (ACCESSING_BITS_0_7)
{
- cps3_set_mame_colours(space->machine, offset*2+1, (data & 0x0000ffff) >> 0, 0);
+ cps3_set_mame_colours(space->machine(), offset*2+1, (data & 0x0000ffff) >> 0, 0);
}
}
@@ -2266,12 +2266,12 @@ static void cps3_exit(running_machine &machine)
static MACHINE_START( cps3 )
{
wd33c93_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, cps3_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, cps3_exit);
}
static MACHINE_RESET( cps3 )
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
state->current_table_address = -1;
// copy data from flashroms back into user regions + decrypt into regions we execute/draw from.
@@ -2281,9 +2281,9 @@ static MACHINE_RESET( cps3 )
// make a copy in the regions we execute code / draw gfx from
-static void copy_from_nvram(running_machine *machine)
+static void copy_from_nvram(running_machine &machine)
{
- cps3_state *state = machine->driver_data<cps3_state>();
+ cps3_state *state = machine.driver_data<cps3_state>();
UINT32* romdata = (UINT32*)state->user4region;
UINT32* romdata2 = (UINT32*)state->decrypted_gamerom;
int i;
@@ -2353,7 +2353,7 @@ static void copy_from_nvram(running_machine *machine)
/*
{
FILE *fp;
- const char *gamename = machine->system().name;
+ const char *gamename = machine.system().name;
char filename[256];
sprintf(filename, "%s_bios.dump", gamename);
@@ -2371,7 +2371,7 @@ static void copy_from_nvram(running_machine *machine)
static int cps3_dma_callback(device_t *device, UINT32 src, UINT32 dst, UINT32 data, int size)
{
- cps3_state *state = device->machine->driver_data<cps3_state>();
+ cps3_state *state = device->machine().driver_data<cps3_state>();
/*
on the actual CPS3 hardware the SH2 DMA bypasses the encryption.
@@ -2408,7 +2408,7 @@ static int cps3_dma_callback(device_t *device, UINT32 src, UINT32 dst, UINT32 da
}
else
{
- //printf("%s :src %08x, dst %08x, returning %08x\n", machine->describe_context(), src, dst, data);
+ //printf("%s :src %08x, dst %08x, returning %08x\n", machine.describe_context(), src, dst, data);
}
/* I doubt this is endian safe.. needs checking / fixing */
@@ -3095,7 +3095,7 @@ ROM_END
DEVELOPMENT VERSION add 0x70 mask!
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region hack (clear jpn)
rom[0x1fec8/4]^=0x00000004; // region
@@ -3120,7 +3120,7 @@ ROM_END
DEVELOPMENT VERSION add 0x70 mask!
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear jpn)
rom[0x1fec8/4]^=0x00000002; // region
rom[0x1fec8/4]^=0x00000070; // DEV mode
@@ -3141,7 +3141,7 @@ ROM_END
OCEANIA 7
ASIA NCD 8
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fed8/4]^=0x00000001; // clear region to 0 (invalid)
rom[0x1fed8/4]^=0x00000008; // region 8 - ASIA NO CD - doesn't actually skip the CD
// test on startup, only during game, must be another flag
@@ -3166,7 +3166,7 @@ ROM_END
// bios rom also lists korea, but game rom does not.
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear region)
rom[0x1fec8/4]^=0x00000008; // region
rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
@@ -3188,7 +3188,7 @@ ROM_END
OCEANIA 7
ASIA 8
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000001; // region (clear region)
rom[0x1fec8/4]^=0x00000008; // region
rom[0x1fecc/4]^=0x01000000; // nocd - this ONLY skips the cd check in the bios test
@@ -3210,7 +3210,7 @@ ROM_END
BRAZIL 6
OCEANIA 7
- UINT32 *rom = (UINT32*)machine->region ( "user1" )->base();
+ UINT32 *rom = (UINT32*)machine.region ( "user1" )->base();
rom[0x1fec8/4]^=0x00000004; // region (clear region)
rom[0x1fec8/4]^=0x00000001; // region
rom[0x1fecc/4]^=0x01000000; // nocd
diff --git a/src/mame/drivers/crbaloon.c b/src/mame/drivers/crbaloon.c
index c78e025fa46..4b4476a6ca6 100644
--- a/src/mame/drivers/crbaloon.c
+++ b/src/mame/drivers/crbaloon.c
@@ -50,36 +50,36 @@ static void pc3092_reset(void)
}
-static void pc3092_update(running_machine *machine)
+static void pc3092_update(running_machine &machine)
{
- crbaloon_state *state = machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = machine.driver_data<crbaloon_state>();
flip_screen_set(machine, (state->pc3092_data[1] & 0x01) ? TRUE : FALSE);
}
static WRITE8_HANDLER( pc3092_w )
{
- crbaloon_state *state = space->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = space->machine().driver_data<crbaloon_state>();
state->pc3092_data[offset] = data & 0x0f;
if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", cpu_get_pc(space->cpu), offset, state->pc3092_data[offset]);
- pc3092_update(space->machine);
+ pc3092_update(space->machine());
}
static CUSTOM_INPUT( pc3092_r )
{
- crbaloon_state *state = field->port->machine->driver_data<crbaloon_state>();
+ crbaloon_state *state = field->port->machine().driver_data<crbaloon_state>();
UINT32 ret;
/* enable coin & start input? Wild guess!!! */
if (state->pc3092_data[1] & 0x02)
- ret = input_port_read(field->port->machine, "PC3092");
+ ret = input_port_read(field->port->machine(), "PC3092");
else
ret = 0x00;
- if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field->port->machine->describe_context(), ret);
+ if (LOG_PC3092) logerror("%s: read PC3092 = 0x%02x\n", field->port->machine().describe_context(), ret);
return ret;
}
@@ -120,7 +120,7 @@ static READ8_HANDLER( pc3259_r )
UINT8 ret = 0;
UINT8 reg = offset >> 2;
- UINT16 collision_address = crbaloon_get_collision_address(space->machine);
+ UINT16 collision_address = crbaloon_get_collision_address(space->machine());
int collided = (collision_address != 0xffff);
switch (reg)
@@ -145,7 +145,7 @@ static READ8_HANDLER( pc3259_r )
if (LOG_PC3259) logerror("%04X: read PC3259 #%d = 0x%02x\n", cpu_get_pc(space->cpu), reg, ret);
- return ret | (input_port_read(space->machine, "DSW1") & 0xf0);
+ return ret | (input_port_read(space->machine(), "DSW1") & 0xf0);
}
@@ -158,15 +158,15 @@ static READ8_HANDLER( pc3259_r )
static WRITE8_HANDLER( port_sound_w )
{
- device_t *discrete = space->machine->device("discrete");
- device_t *sn = space->machine->device("snsnd");
+ device_t *discrete = space->machine().device("discrete");
+ device_t *sn = space->machine().device("snsnd");
/* D0 - interrupt enable - also goes to PC3259 as /HTCTRL */
- cpu_interrupt_enable(space->machine->device("maincpu"), (data & 0x01) ? TRUE : FALSE);
- crbaloon_set_clear_collision_address(space->machine, (data & 0x01) ? TRUE : FALSE);
+ cpu_interrupt_enable(space->machine().device("maincpu"), (data & 0x01) ? TRUE : FALSE);
+ crbaloon_set_clear_collision_address(space->machine(), (data & 0x01) ? TRUE : FALSE);
/* D1 - SOUND STOP */
- space->machine->sound().system_enable((data & 0x02) ? TRUE : FALSE);
+ space->machine().sound().system_enable((data & 0x02) ? TRUE : FALSE);
/* D2 - unlabeled - music enable */
crbaloon_audio_set_music_enable(discrete, 0, (data & 0x04) ? TRUE : FALSE);
@@ -341,8 +341,8 @@ GFXDECODE_END
static MACHINE_RESET( crballoon )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_IO);
- device_t *discrete = machine->device("discrete");
+ address_space *space = machine.device("maincpu")->memory().space(AS_IO);
+ device_t *discrete = machine.device("discrete");
pc3092_reset();
port_sound_w(space, 0, 0);
diff --git a/src/mame/drivers/crgolf.c b/src/mame/drivers/crgolf.c
index cc0648e98b3..02a5a348a5f 100644
--- a/src/mame/drivers/crgolf.c
+++ b/src/mame/drivers/crgolf.c
@@ -44,19 +44,19 @@
static WRITE8_HANDLER( rom_bank_select_w )
{
- memory_set_bank(space->machine, "bank1", data & 15);
+ memory_set_bank(space->machine(), "bank1", data & 15);
}
static MACHINE_START( crgolf )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
/* configure the banking */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
memory_set_bank(machine, "bank1", 0);
/* register for save states */
@@ -70,7 +70,7 @@ static MACHINE_START( crgolf )
static MACHINE_RESET( crgolf )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
state->port_select = 0;
state->main_to_sound_data = 0;
@@ -89,21 +89,21 @@ static MACHINE_RESET( crgolf )
static READ8_HANDLER( switch_input_r )
{
static const char *const portnames[] = { "IN0", "IN1", "P1", "P2", "DSW", "UNUSED0", "UNUSED1" };
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
- return input_port_read(space->machine, portnames[state->port_select]);
+ return input_port_read(space->machine(), portnames[state->port_select]);
}
static READ8_HANDLER( analog_input_r )
{
- return ((input_port_read(space->machine, "STICK0") >> 4) | (input_port_read(space->machine, "STICK1") & 0xf0)) ^ 0x88;
+ return ((input_port_read(space->machine(), "STICK0") >> 4) | (input_port_read(space->machine(), "STICK1") & 0xf0)) ^ 0x88;
}
static WRITE8_HANDLER( switch_input_select_w )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
if (!(data & 0x40)) state->port_select = 6;
if (!(data & 0x20)) state->port_select = 5;
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( unknown_w )
static TIMER_CALLBACK( main_to_sound_callback )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, ASSERT_LINE);
state->main_to_sound_data = param;
@@ -139,13 +139,13 @@ static TIMER_CALLBACK( main_to_sound_callback )
static WRITE8_HANDLER( main_to_sound_w )
{
- space->machine->scheduler().synchronize(FUNC(main_to_sound_callback), data);
+ space->machine().scheduler().synchronize(FUNC(main_to_sound_callback), data);
}
static READ8_HANDLER( main_to_sound_r )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, CLEAR_LINE);
return state->main_to_sound_data;
@@ -161,7 +161,7 @@ static READ8_HANDLER( main_to_sound_r )
static TIMER_CALLBACK( sound_to_main_callback )
{
- crgolf_state *state = machine->driver_data<crgolf_state>();
+ crgolf_state *state = machine.driver_data<crgolf_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, ASSERT_LINE);
state->sound_to_main_data = param;
@@ -170,13 +170,13 @@ static TIMER_CALLBACK( sound_to_main_callback )
static WRITE8_HANDLER( sound_to_main_w )
{
- space->machine->scheduler().synchronize(FUNC(sound_to_main_callback), data);
+ space->machine().scheduler().synchronize(FUNC(sound_to_main_callback), data);
}
static READ8_HANDLER( sound_to_main_r )
{
- crgolf_state *state = space->machine->driver_data<crgolf_state>();
+ crgolf_state *state = space->machine().driver_data<crgolf_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE);
return state->sound_to_main_data;
@@ -192,12 +192,12 @@ static READ8_HANDLER( sound_to_main_r )
static void vck_callback( device_t *device )
{
- crgolf_state *state = device->machine->driver_data<crgolf_state>();
+ crgolf_state *state = device->machine().driver_data<crgolf_state>();
/* only play back if we have data remaining */
if (state->sample_count != 0xff)
{
- UINT8 data = device->machine->region("adpcm")->base()[state->sample_offset >> 1];
+ UINT8 data = device->machine().region("adpcm")->base()[state->sample_offset >> 1];
/* write the next nibble and advance */
msm5205_data_w(device, (data >> (4 * (~state->sample_offset & 1))) & 0x0f);
@@ -218,7 +218,7 @@ static void vck_callback( device_t *device )
static WRITE8_DEVICE_HANDLER( crgolfhi_sample_w )
{
- crgolf_state *state = device->machine->driver_data<crgolf_state>();
+ crgolf_state *state = device->machine().driver_data<crgolf_state>();
switch (offset)
{
@@ -599,8 +599,8 @@ ROM_END
static DRIVER_INIT( crgolfhi )
{
- device_t *msm = machine->device("msm");
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*msm, 0xa000, 0xa003, FUNC(crgolfhi_sample_w));
+ device_t *msm = machine.device("msm");
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*msm, 0xa000, 0xa003, FUNC(crgolfhi_sample_w));
}
diff --git a/src/mame/drivers/crimfght.c b/src/mame/drivers/crimfght.c
index 24759bfafbc..3cf888484cf 100644
--- a/src/mame/drivers/crimfght.c
+++ b/src/mame/drivers/crimfght.c
@@ -26,13 +26,13 @@ static KONAMI_SETLINES_CALLBACK( crimfght_banking );
static WRITE8_HANDLER( crimfght_coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE8_HANDLER( crimfght_sh_irqtrigger_w )
{
- crimfght_state *state = space->machine->driver_data<crimfght_state>();
+ crimfght_state *state = space->machine().driver_data<crimfght_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -42,7 +42,7 @@ static WRITE8_DEVICE_HANDLER( crimfght_snd_bankswitch_w )
/* b1: bank for channel A */
/* b0: bank for channel B */
- crimfght_state *state = device->machine->driver_data<crimfght_state>();
+ crimfght_state *state = device->machine().driver_data<crimfght_state>();
int bank_A = BIT(data, 1);
int bank_B = BIT(data, 0);
@@ -51,7 +51,7 @@ static WRITE8_DEVICE_HANDLER( crimfght_snd_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- crimfght_state *state = space->machine->driver_data<crimfght_state>();
+ crimfght_state *state = space->machine().driver_data<crimfght_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -68,7 +68,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- crimfght_state *state = space->machine->driver_data<crimfght_state>();
+ crimfght_state *state = space->machine().driver_data<crimfght_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -257,22 +257,22 @@ static const k051960_interface crimfght_k051960_intf =
static MACHINE_START( crimfght )
{
- crimfght_state *state = machine->driver_data<crimfght_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ crimfght_state *state = machine.driver_data<crimfght_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank2", 0, 12, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank2", 0);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k007232 = machine->device("k007232");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k007232 = machine.device("k007232");
}
static MACHINE_RESET( crimfght )
{
- konami_configure_set_lines(machine->device("maincpu"), crimfght_banking);
+ konami_configure_set_lines(machine.device("maincpu"), crimfght_banking);
}
static MACHINE_CONFIG_START( crimfght, crimfght_state )
@@ -405,14 +405,14 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( crimfght_banking )
{
- crimfght_state *state = device->machine->driver_data<crimfght_state>();
+ crimfght_state *state = device->machine().driver_data<crimfght_state>();
/* bit 5 = select work RAM or palette */
if (lines & 0x20)
{
device->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank3");
device->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0000, 0x03ff, FUNC(paletteram_xBBBBBGGGGGRRRRR_be_w));
- memory_set_bankptr(device->machine, "bank3", device->machine->generic.paletteram.v);
+ memory_set_bankptr(device->machine(), "bank3", device->machine().generic.paletteram.v);
}
else
device->memory().space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */
@@ -420,7 +420,7 @@ static KONAMI_SETLINES_CALLBACK( crimfght_banking )
/* bit 6 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (lines & 0x40) ? ASSERT_LINE : CLEAR_LINE);
- memory_set_bank(device->machine, "bank2", lines & 0x0f);
+ memory_set_bank(device->machine(), "bank2", lines & 0x0f);
}
GAME( 1989, crimfght, 0, crimfght, crimfght, 0, ROT0, "Konami", "Crime Fighters (US 4 players)", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/crospang.c b/src/mame/drivers/crospang.c
index 72743cc4d0a..ae3c5aaa01b 100644
--- a/src/mame/drivers/crospang.c
+++ b/src/mame/drivers/crospang.c
@@ -313,7 +313,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- crospang_state *state = device->machine->driver_data<crospang_state>();
+ crospang_state *state = device->machine().driver_data<crospang_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -325,9 +325,9 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( crospang )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->bestri_tilebank));
state->save_item(NAME(state->xsproff));
@@ -336,7 +336,7 @@ static MACHINE_START( crospang )
static MACHINE_RESET( crospang )
{
- crospang_state *state = machine->driver_data<crospang_state>();
+ crospang_state *state = machine.driver_data<crospang_state>();
state->bestri_tilebank = 0;
// state->xsproff = 4;
@@ -586,10 +586,10 @@ ROM_START( bestri )
ROM_END
-static void tumblepb_gfx1_rearrange(running_machine *machine)
+static void tumblepb_gfx1_rearrange(running_machine &machine)
{
- UINT8 *rom = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
int i;
/* gfx data is in the wrong order */
diff --git a/src/mame/drivers/crshrace.c b/src/mame/drivers/crshrace.c
index 45341d1ad83..1055dd56067 100644
--- a/src/mame/drivers/crshrace.c
+++ b/src/mame/drivers/crshrace.c
@@ -139,7 +139,7 @@ Dip locations verified with Service Mode.
static READ16_HANDLER( extrarom1_r )
{
- UINT8 *rom = space->machine->region("user1")->base();
+ UINT8 *rom = space->machine().region("user1")->base();
offset *= 2;
@@ -148,7 +148,7 @@ static READ16_HANDLER( extrarom1_r )
static READ16_HANDLER( extrarom2_r )
{
- UINT8 *rom = space->machine->region("user2")->base();
+ UINT8 *rom = space->machine().region("user2")->base();
offset *= 2;
@@ -157,12 +157,12 @@ static READ16_HANDLER( extrarom2_r )
static WRITE8_HANDLER( crshrace_sh_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE16_HANDLER( sound_command_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
if (ACCESSING_BITS_0_7)
{
@@ -174,13 +174,13 @@ static WRITE16_HANDLER( sound_command_w )
static CUSTOM_INPUT( country_sndpending_r )
{
- crshrace_state *state = field->port->machine->driver_data<crshrace_state>();
+ crshrace_state *state = field->port->machine().driver_data<crshrace_state>();
return state->pending_command;
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- crshrace_state *state = space->machine->driver_data<crshrace_state>();
+ crshrace_state *state = space->machine().driver_data<crshrace_state>();
state->pending_command = 0;
}
@@ -427,7 +427,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- crshrace_state *state = device->machine->driver_data<crshrace_state>();
+ crshrace_state *state = device->machine().driver_data<crshrace_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -444,12 +444,12 @@ static const k053936_interface crshrace_k053936_intf =
static MACHINE_START( crshrace )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
- state->audiocpu = machine->device("audiocpu");
- state->k053936 = machine->device("k053936");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936 = machine.device("k053936");
state->save_item(NAME(state->roz_bank));
state->save_item(NAME(state->gfxctrl));
@@ -459,7 +459,7 @@ static MACHINE_START( crshrace )
static MACHINE_RESET( crshrace )
{
- crshrace_state *state = machine->driver_data<crshrace_state>();
+ crshrace_state *state = machine.driver_data<crshrace_state>();
state->roz_bank = 0;
state->gfxctrl = 0;
@@ -584,7 +584,7 @@ ROM_END
void crshrace_patch_code( UINT16 offset )
{
/* A hack which shows 3 player mode in code which is disabled */
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[(offset + 0)/2] = 0x4e71;
RAM[(offset + 2)/2] = 0x4e71;
RAM[(offset + 4)/2] = 0x4e71;
diff --git a/src/mame/drivers/crystal.c b/src/mame/drivers/crystal.c
index 7946f567dc6..13d95bb8628 100644
--- a/src/mame/drivers/crystal.c
+++ b/src/mame/drivers/crystal.c
@@ -157,9 +157,9 @@ public:
device_t *vr0video;
};
-static void IntReq( running_machine *machine, int num )
+static void IntReq( running_machine &machine, int num )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
UINT32 IntEn = space->read_dword(0x01800c08);
UINT32 IntPend = space->read_dword(0x01800c0c);
@@ -177,7 +177,7 @@ static void IntReq( running_machine *machine, int num )
static READ32_HANDLER( FlipCount_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
#ifdef IDLE_LOOP_SPEEDUP
UINT32 IntPend = space->read_dword(0x01800c0c);
@@ -190,7 +190,7 @@ static READ32_HANDLER( FlipCount_r )
static WRITE32_HANDLER( FlipCount_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (mem_mask & 0x00ff0000)
{
@@ -204,28 +204,28 @@ static WRITE32_HANDLER( FlipCount_w )
static READ32_HANDLER( Input_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (offset == 0)
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
else if (offset == 1)
- return input_port_read(space->machine, "P3_P4");
+ return input_port_read(space->machine(), "P3_P4");
else if( offset == 2)
{
- UINT8 Port4 = input_port_read(space->machine, "SYSTEM");
+ UINT8 Port4 = input_port_read(space->machine(), "SYSTEM");
if (!(Port4 & 0x10) && ((state->OldPort4 ^ Port4) & 0x10)) //coin buttons trigger IRQs
- IntReq(space->machine, 12);
+ IntReq(space->machine(), 12);
if (!(Port4 & 0x20) && ((state->OldPort4 ^ Port4) & 0x20))
- IntReq(space->machine, 19);
+ IntReq(space->machine(), 19);
state->OldPort4 = Port4;
- return /*dips*/input_port_read(space->machine, "DSW") | (Port4 << 16);
+ return /*dips*/input_port_read(space->machine(), "DSW") | (Port4 << 16);
}
return 0;
}
static WRITE32_HANDLER( IntAck_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
UINT32 IntPend = space->read_dword(0x01800c0c);
if (mem_mask & 0xff)
@@ -241,7 +241,7 @@ static WRITE32_HANDLER( IntAck_w )
static IRQ_CALLBACK( icallback )
{
- crystal_state *state = device->machine->driver_data<crystal_state>();
+ crystal_state *state = device->machine().driver_data<crystal_state>();
address_space *space = device->memory().space(AS_PROGRAM);
UINT32 IntPend = space->read_dword(0x01800c0c);
int i;
@@ -258,18 +258,18 @@ static IRQ_CALLBACK( icallback )
static WRITE32_HANDLER( Banksw_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
state->Bank = (data >> 1) & 7;
if (state->Bank <= 2)
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user1")->base() + state->Bank * 0x1000000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user1")->base() + state->Bank * 0x1000000);
else
- memory_set_bankptr(space->machine, "bank1", space->machine->region("user2")->base());
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("user2")->base());
}
static TIMER_CALLBACK( Timercb )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
int which = (int)(FPTR)ptr;
static const int num[] = { 0, 1, 9, 10 };
@@ -281,7 +281,7 @@ static TIMER_CALLBACK( Timercb )
INLINE void Timer_w( address_space *space, int which, UINT32 data, UINT32 mem_mask )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (((data ^ state->Timerctrl[which]) & 1) && (data & 1)) //Timer activate
{
@@ -304,7 +304,7 @@ static WRITE32_HANDLER( Timer0_w )
static READ32_HANDLER( Timer0_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[0];
}
@@ -315,7 +315,7 @@ static WRITE32_HANDLER( Timer1_w )
static READ32_HANDLER( Timer1_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[1];
}
@@ -326,7 +326,7 @@ static WRITE32_HANDLER( Timer2_w )
static READ32_HANDLER( Timer2_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[2];
}
@@ -337,19 +337,19 @@ static WRITE32_HANDLER( Timer3_w )
static READ32_HANDLER( Timer3_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->Timerctrl[3];
}
static READ32_HANDLER( FlashCmd_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if ((state->FlashCmd & 0xff) == 0xff)
{
if (state->Bank <= 2)
{
- UINT32 *ptr = (UINT32*)(space->machine->region("user1")->base() + state->Bank * 0x1000000);
+ UINT32 *ptr = (UINT32*)(space->machine().region("user1")->base() + state->Bank * 0x1000000);
return ptr[0];
}
else
@@ -367,19 +367,19 @@ static READ32_HANDLER( FlashCmd_r )
static WRITE32_HANDLER( FlashCmd_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
state->FlashCmd = data;
}
static READ32_HANDLER( PIO_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->PIO;
}
static WRITE32_HANDLER( PIO_w )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
UINT32 RST = data & 0x01000000;
UINT32 CLK = data & 0x02000000;
UINT32 DAT = data & 0x10000000;
@@ -400,7 +400,7 @@ static WRITE32_HANDLER( PIO_w )
INLINE void DMA_w( address_space *space, int which, UINT32 data, UINT32 mem_mask )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
if (((data ^ state->DMActrl[which]) & (1 << 10)) && (data & (1 << 10))) //DMAOn
{
@@ -436,14 +436,14 @@ INLINE void DMA_w( address_space *space, int which, UINT32 data, UINT32 mem_mask
}
data &= ~(1 << 10);
space->write_dword(0x0180080C + which * 0x10, 0);
- IntReq(space->machine, 7 + which);
+ IntReq(space->machine(), 7 + which);
}
COMBINE_DATA(&state->DMActrl[which]);
}
static READ32_HANDLER( DMA0_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->DMActrl[0];
}
@@ -454,7 +454,7 @@ static WRITE32_HANDLER( DMA0_w )
static READ32_HANDLER( DMA1_r )
{
- crystal_state *state = space->machine->driver_data<crystal_state>();
+ crystal_state *state = space->machine().driver_data<crystal_state>();
return state->DMActrl[1];
}
@@ -498,7 +498,7 @@ static ADDRESS_MAP_START( crystal_mem, AS_PROGRAM, 32 )
ADDRESS_MAP_END
-static void PatchReset( running_machine *machine )
+static void PatchReset( running_machine &machine )
{
//The test menu reset routine seems buggy
//it reads the reset vector from 0x02000000 but it should be
@@ -522,7 +522,7 @@ loop:
JMP Loop1
*/
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
#if 1
static const UINT32 Patch[] =
@@ -550,26 +550,26 @@ loop:
static STATE_POSTLOAD( crystal_banksw_postload )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
if (state->Bank <= 2)
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + state->Bank * 0x1000000);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + state->Bank * 0x1000000);
else
- memory_set_bankptr(machine, "bank1", machine->region("user2")->base());
+ memory_set_bankptr(machine, "bank1", machine.region("user2")->base());
}
static MACHINE_START( crystal )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
int i;
- state->maincpu = machine->device("maincpu");
- state->ds1302 = machine->device("rtc");
- state->vr0video = machine->device("vr0");
+ state->maincpu = machine.device("maincpu");
+ state->ds1302 = machine.device("rtc");
+ state->vr0video = machine.device("vr0");
- device_set_irq_callback(machine->device("maincpu"), icallback);
+ device_set_irq_callback(machine.device("maincpu"), icallback);
for (i = 0; i < 4; i++)
- state->Timer[i] = machine->scheduler().timer_alloc(FUNC(Timercb), (void*)(FPTR)i);
+ state->Timer[i] = machine.scheduler().timer_alloc(FUNC(Timercb), (void*)(FPTR)i);
PatchReset(machine);
@@ -585,21 +585,21 @@ static MACHINE_START( crystal )
state->save_item(NAME(state->PIO));
state->save_item(NAME(state->DMActrl));
state->save_item(NAME(state->OldPort4));
- machine->state().register_postload(crystal_banksw_postload, NULL);
+ machine.state().register_postload(crystal_banksw_postload, NULL);
}
static MACHINE_RESET( crystal )
{
- crystal_state *state = machine->driver_data<crystal_state>();
+ crystal_state *state = machine.driver_data<crystal_state>();
int i;
memset(state->sysregs, 0, 0x10000);
memset(state->vidregs, 0, 0x10000);
state->FlipCount = 0;
state->IntHigh = 0;
- device_set_irq_callback(machine->device("maincpu"), icallback);
+ device_set_irq_callback(machine.device("maincpu"), icallback);
state->Bank = 0;
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + 0);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + 0);
state->FlashCmd = 0xff;
state->OldPort4 = 0;
@@ -612,7 +612,7 @@ static MACHINE_RESET( crystal )
state->Timer[i]->adjust(attotime::never);
}
- vr0_snd_set_areas(machine->device("vrender"), state->textureram, state->frameram);
+ vr0_snd_set_areas(machine.device("vrender"), state->textureram, state->frameram);
#ifdef IDLE_LOOP_SPEEDUP
state->FlipCntRead = 0;
#endif
@@ -633,8 +633,8 @@ static void SetVidReg( address_space *space, UINT16 reg, UINT16 val )
static SCREEN_UPDATE( crystal )
{
- crystal_state *state = screen->machine->driver_data<crystal_state>();
- address_space *space = screen->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ crystal_state *state = screen->machine().driver_data<crystal_state>();
+ address_space *space = screen->machine().device("maincpu")->memory().space(AS_PROGRAM);
int DoFlip;
UINT32 B0 = 0x0;
@@ -694,8 +694,8 @@ static SCREEN_UPDATE( crystal )
static SCREEN_EOF(crystal)
{
- crystal_state *state = machine->driver_data<crystal_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ crystal_state *state = machine.driver_data<crystal_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 head, tail;
int DoFlip = 0;
@@ -722,7 +722,7 @@ static SCREEN_EOF(crystal)
static INTERRUPT_GEN(crystal_interrupt)
{
- IntReq(device->machine, 24); //VRender0 VBlank
+ IntReq(device->machine(), 24); //VRender0 VBlank
}
static INPUT_PORTS_START(crystal)
@@ -927,7 +927,7 @@ ROM_END
static DRIVER_INIT(crysking)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
//patch the data feed by the protection
@@ -946,7 +946,7 @@ static DRIVER_INIT(crysking)
static DRIVER_INIT(evosocc)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
Rom += 0x1000000 * 2 / 2;
Rom[WORD_XOR_LE(0x97388E/2)] = 0x90FC; //PUSH R2..R7
@@ -964,7 +964,7 @@ static DRIVER_INIT(evosocc)
static DRIVER_INIT(topbladv)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
Rom[WORD_XOR_LE(0x12d7a/2)] = 0x90FC; //PUSH R7-R6-R5-R4-R3-R2
Rom[WORD_XOR_LE(0x12d7c/2)] = 0x9001; //PUSH R0
@@ -982,7 +982,7 @@ static DRIVER_INIT(topbladv)
static DRIVER_INIT(officeye)
{
- UINT16 *Rom = (UINT16*) machine->region("user1")->base();
+ UINT16 *Rom = (UINT16*) machine.region("user1")->base();
Rom[WORD_XOR_LE(0x9c9e/2)] = 0x901C; //PUSH R4-R3-R2
Rom[WORD_XOR_LE(0x9ca0/2)] = 0x9001; //PUSH R0
diff --git a/src/mame/drivers/cshooter.c b/src/mame/drivers/cshooter.c
index f83145476d7..fc984866707 100644
--- a/src/mame/drivers/cshooter.c
+++ b/src/mame/drivers/cshooter.c
@@ -109,9 +109,9 @@ public:
#if 0
-static void ar_coin_hack(running_machine *machine)
+static void ar_coin_hack(running_machine &machine)
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
if(input_port_read(machine, "COIN") & 1)
{
if(state->coin_stat==0)
@@ -135,7 +135,7 @@ static void ar_coin_hack(running_machine *machine)
static TILE_GET_INFO( get_cstx_tile_info )
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
int code = (state->txram[tile_index*2]);
int attr = (state->txram[tile_index*2+1]);
int rg;
@@ -152,22 +152,22 @@ static TILE_GET_INFO( get_cstx_tile_info )
static WRITE8_HANDLER(cshooter_txram_w)
{
- cshooter_state *state = space->machine->driver_data<cshooter_state>();
+ cshooter_state *state = space->machine().driver_data<cshooter_state>();
state->txram[offset] = data;
tilemap_mark_tile_dirty(state->txtilemap,offset/2);
}
static VIDEO_START(cshooter)
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
state->txtilemap = tilemap_create(machine, get_cstx_tile_info,tilemap_scan_rows, 8,8,32, 32);
tilemap_set_transparent_pen(state->txtilemap, 3);
}
static SCREEN_UPDATE(cshooter)
{
- cshooter_state *state = screen->machine->driver_data<cshooter_state>();
- bitmap_fill(bitmap, cliprect, 0/*get_black_pen(screen->screen->machine)*/);
+ cshooter_state *state = screen->machine().driver_data<cshooter_state>();
+ bitmap_fill(bitmap, cliprect, 0/*get_black_pen(screen->screen->machine())*/);
tilemap_mark_all_tiles_dirty(state->txtilemap);
//sprites
@@ -180,25 +180,25 @@ static SCREEN_UPDATE(cshooter)
{
int tile=0x30+((spriteram[i]>>2)&0x1f);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
spriteram[i+3],spriteram[i+2],3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
spriteram[i+3]+8,spriteram[i+2],3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
spriteram[i+3]+8,spriteram[i+2]+8,3);
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],
tile,
spriteram[i+1],
0, 0,
@@ -217,21 +217,21 @@ static SCREEN_UPDATE(cshooter)
static INTERRUPT_GEN( cshooter_interrupt )
{
- //cshooter_state *state = device->machine->driver_data<cshooter_state>();
+ //cshooter_state *state = device->machine().driver_data<cshooter_state>();
if(cpu_getiloops(device))
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x08);
else
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x10);
// if(state->mainram!=NULL)
-// ar_coin_hack(device->machine);
+// ar_coin_hack(device->machine());
}
static MACHINE_RESET( cshooter )
{
- cshooter_state *state = machine->driver_data<cshooter_state>();
+ cshooter_state *state = machine.driver_data<cshooter_state>();
state->counter = 0;
}
@@ -242,11 +242,11 @@ static MACHINE_RESET( airraid )
static READ8_HANDLER ( cshooter_coin_r )
{
- cshooter_state *state = space->machine->driver_data<cshooter_state>();
+ cshooter_state *state = space->machine().driver_data<cshooter_state>();
/* Even reads must return 0xff - Odd reads must return the contents of input port 5.
Code at 0x5061 is executed once during P.O.S.T. where there is one read.
Code at 0x50b4 is then executed each frame (not sure) where there are 2 reads. */
- return ( (state->counter++ & 1) ? 0xff : input_port_read(space->machine, "COIN") );
+ return ( (state->counter++ & 1) ? 0xff : input_port_read(space->machine(), "COIN") );
}
static WRITE8_HANDLER ( cshooter_c500_w )
@@ -259,27 +259,27 @@ static WRITE8_HANDLER ( cshooter_c700_w )
static WRITE8_HANDLER ( bank_w )
{
- memory_set_bankptr(space->machine, "bank1",&space->machine->region("user1")->base()[0x4000*((data>>4)&3)]);
+ memory_set_bankptr(space->machine(), "bank1",&space->machine().region("user1")->base()[0x4000*((data>>4)&3)]);
}
static WRITE8_HANDLER(pal_w)
{
- space->machine->generic.paletteram.u8[offset]=data;
+ space->machine().generic.paletteram.u8[offset]=data;
offset&=0xff;
- palette_set_color_rgb(space->machine, offset, pal4bit(space->machine->generic.paletteram.u8[offset] >> 4), pal4bit(space->machine->generic.paletteram.u8[offset]), pal4bit(space->machine->generic.paletteram.u8[offset+0x100]));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(space->machine().generic.paletteram.u8[offset] >> 4), pal4bit(space->machine().generic.paletteram.u8[offset]), pal4bit(space->machine().generic.paletteram.u8[offset+0x100]));
}
static WRITE8_HANDLER(pal2_w)
{
- space->machine->generic.paletteram.u8[offset]=data;
+ space->machine().generic.paletteram.u8[offset]=data;
offset&=0x1ff;
- palette_set_color_rgb(space->machine, offset, pal4bit(space->machine->generic.paletteram.u8[offset] >> 4), pal4bit(space->machine->generic.paletteram.u8[offset]), pal4bit(space->machine->generic.paletteram.u8[offset+0x200]));
+ palette_set_color_rgb(space->machine(), offset, pal4bit(space->machine().generic.paletteram.u8[offset] >> 4), pal4bit(space->machine().generic.paletteram.u8[offset]), pal4bit(space->machine().generic.paletteram.u8[offset+0x200]));
}
static READ8_HANDLER(pal_r)
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
static ADDRESS_MAP_START( cshooter_map, AS_PROGRAM, 8 )
@@ -687,19 +687,19 @@ ROM_END
static DRIVER_INIT( cshooter )
{
/* temp so it boots */
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0xa2] = 0x00;
rom[0xa3] = 0x00;
rom[0xa4] = 0x00;
- memory_set_bankptr(machine, "bank1",&machine->region("user1")->base()[0]);
+ memory_set_bankptr(machine, "bank1",&machine.region("user1")->base()[0]);
}
static DRIVER_INIT( cshootere )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
@@ -729,7 +729,7 @@ static DRIVER_INIT( cshootere )
rom[A] = BITSWAP8(rom[A],7,6,1,4,3,2,5,0);
}
- memory_set_bankptr(machine, "bank1",&machine->region("user1")->base()[0]);
+ memory_set_bankptr(machine, "bank1",&machine.region("user1")->base()[0]);
seibu_sound_decrypt(machine,"audiocpu",0x2000);
}
diff --git a/src/mame/drivers/csplayh5.c b/src/mame/drivers/csplayh5.c
index 1d023078858..7e9a9e0ff33 100644
--- a/src/mame/drivers/csplayh5.c
+++ b/src/mame/drivers/csplayh5.c
@@ -50,7 +50,7 @@ public:
#define MSX2_VISIBLE_XBORDER_PIXELS 8 * 2
#define MSX2_VISIBLE_YBORDER_PIXELS 14 * 2
-static void csplayh5_vdp0_interrupt(running_machine *machine, int i)
+static void csplayh5_vdp0_interrupt(running_machine &machine, int i)
{
/* this is not used as the v9938 interrupt callbacks are broken
interrupts seem to be fired quite randomly */
@@ -58,16 +58,16 @@ static void csplayh5_vdp0_interrupt(running_machine *machine, int i)
static VIDEO_START( csplayh5 )
{
- csplayh5_state *state = machine->driver_data<csplayh5_state>();
- state->vdp0_bitmap = machine->primary_screen->alloc_compatible_bitmap();
- v9938_init (machine, 0, *machine->primary_screen, state->vdp0_bitmap, MODEL_V9958, 0x20000, csplayh5_vdp0_interrupt);
+ csplayh5_state *state = machine.driver_data<csplayh5_state>();
+ state->vdp0_bitmap = machine.primary_screen->alloc_compatible_bitmap();
+ v9938_init (machine, 0, *machine.primary_screen, state->vdp0_bitmap, MODEL_V9958, 0x20000, csplayh5_vdp0_interrupt);
v9938_reset(0);
}
static SCREEN_UPDATE( csplayh5 )
{
- csplayh5_state *state = screen->machine->driver_data<csplayh5_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ csplayh5_state *state = screen->machine().driver_data<csplayh5_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
copybitmap(bitmap, state->vdp0_bitmap, 0, 0, 0, 0, cliprect);
@@ -77,14 +77,14 @@ static SCREEN_UPDATE( csplayh5 )
static READ16_HANDLER( csplayh5_mux_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(space->machine, "KEY0");
- case 0x02: return input_port_read(space->machine, "KEY1");
- case 0x04: return input_port_read(space->machine, "KEY2");
- case 0x08: return input_port_read(space->machine, "KEY3");
- case 0x10: return input_port_read(space->machine, "KEY4");
+ case 0x01: return input_port_read(space->machine(), "KEY0");
+ case 0x02: return input_port_read(space->machine(), "KEY1");
+ case 0x04: return input_port_read(space->machine(), "KEY2");
+ case 0x08: return input_port_read(space->machine(), "KEY3");
+ case 0x10: return input_port_read(space->machine(), "KEY4");
}
return 0xffff;
@@ -92,7 +92,7 @@ static READ16_HANDLER( csplayh5_mux_r )
static WRITE16_HANDLER( csplayh5_mux_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->mux_data = (~data & 0x1f);
}
@@ -124,7 +124,7 @@ ADDRESS_MAP_END
#if USE_H8
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( csplayh5_sub_map, AS_PROGRAM, 16 )
@@ -157,9 +157,9 @@ sound HW is identical to Niyanpai
#define DAC_WRITE dac_w
#endif
-static void csplayh5_soundbank_w(running_machine *machine, int data)
+static void csplayh5_soundbank_w(running_machine &machine, int data)
{
- UINT8 *SNDROM = machine->region("audiocpu")->base();
+ UINT8 *SNDROM = machine.region("audiocpu")->base();
memory_set_bankptr(machine, "bank1", &SNDROM[0x08000 + (0x8000 * (data & 0x03))]);
}
@@ -197,7 +197,7 @@ static READ8_HANDLER( tmpz84c011_pio_r )
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine->describe_context(), offset);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Read %02X\n", space->machine().describe_context(), offset);
portdata = 0xff;
break;
}
@@ -210,13 +210,13 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
switch (offset)
{
case 0: /* PA_0 */
- csplayh5_soundbank_w(space->machine, data & 0x03);
+ csplayh5_soundbank_w(space->machine(), data & 0x03);
break;
case 1: /* PB_0 */
- DAC_WRITE(space->machine->device("dac2"), 0, data);
+ DAC_WRITE(space->machine().device("dac2"), 0, data);
break;
case 2: /* PC_0 */
- DAC_WRITE(space->machine->device("dac1"), 0, data);
+ DAC_WRITE(space->machine().device("dac1"), 0, data);
break;
case 3: /* PD_0 */
break;
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
break;
default:
- logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine->describe_context(), offset, data);
+ logerror("%s: TMPZ84C011_PIO Unknown Port Write %02X, %02X\n", space->machine().describe_context(), offset, data);
break;
}
}
@@ -234,65 +234,65 @@ static WRITE8_HANDLER( tmpz84c011_pio_w)
/* CPU interface */
static READ8_HANDLER( tmpz84c011_0_pa_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,0) & ~state->pio_dir[0]) | (state->pio_latch[0] & state->pio_dir[0]);
}
static READ8_HANDLER( tmpz84c011_0_pb_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,1) & ~state->pio_dir[1]) | (state->pio_latch[1] & state->pio_dir[1]);
}
static READ8_HANDLER( tmpz84c011_0_pc_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,2) & ~state->pio_dir[2]) | (state->pio_latch[2] & state->pio_dir[2]);
}
static READ8_HANDLER( tmpz84c011_0_pd_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,3) & ~state->pio_dir[3]) | (state->pio_latch[3] & state->pio_dir[3]);
}
static READ8_HANDLER( tmpz84c011_0_pe_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return (tmpz84c011_pio_r(space,4) & ~state->pio_dir[4]) | (state->pio_latch[4] & state->pio_dir[4]);
}
static WRITE8_HANDLER( tmpz84c011_0_pa_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[0] = data;
tmpz84c011_pio_w(space, 0, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pb_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[1] = data;
tmpz84c011_pio_w(space, 1, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pc_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[2] = data;
tmpz84c011_pio_w(space, 2, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pd_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[3] = data;
tmpz84c011_pio_w(space, 3, data);
}
static WRITE8_HANDLER( tmpz84c011_0_pe_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_latch[4] = data;
tmpz84c011_pio_w(space, 4, data);
}
@@ -300,62 +300,62 @@ static WRITE8_HANDLER( tmpz84c011_0_pe_w )
static READ8_HANDLER( tmpz84c011_0_dir_pa_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[0];
}
static READ8_HANDLER( tmpz84c011_0_dir_pb_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[1];
}
static READ8_HANDLER( tmpz84c011_0_dir_pc_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[2];
}
static READ8_HANDLER( tmpz84c011_0_dir_pd_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[3];
}
static READ8_HANDLER( tmpz84c011_0_dir_pe_r )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
return state->pio_dir[4];
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pa_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[0] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pb_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[1] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pc_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[2] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pd_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[3] = data;
}
static WRITE8_HANDLER( tmpz84c011_0_dir_pe_w )
{
- csplayh5_state *state = space->machine->driver_data<csplayh5_state>();
+ csplayh5_state *state = space->machine().driver_data<csplayh5_state>();
state->pio_dir[4] = data;
}
@@ -586,8 +586,8 @@ static Z80CTC_INTERFACE( ctc_intf )
static MACHINE_RESET( csplayh5 )
{
- csplayh5_state *state = machine->driver_data<csplayh5_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ csplayh5_state *state = machine.driver_data<csplayh5_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
// initialize TMPZ84C011 PIO
@@ -602,7 +602,7 @@ static INTERRUPT_GEN( scanline_irq )
{
v9938_set_sprite_limit(0, 0);
v9938_set_resolution(0, RENDER_HIGH);
- v9938_interrupt(device->machine, 0);
+ v9938_interrupt(device->machine(), 0);
}
static INTERRUPT_GEN( csplayh5_irq )
@@ -680,8 +680,8 @@ MACHINE_CONFIG_END
static DRIVER_INIT( csplayh5 )
{
- UINT16 *MAINROM = (UINT16 *)machine->region("maincpu")->base();
- UINT8 *SNDROM = machine->region("audiocpu")->base();
+ UINT16 *MAINROM = (UINT16 *)machine.region("maincpu")->base();
+ UINT8 *SNDROM = machine.region("audiocpu")->base();
// initialize sound rom bank
csplayh5_soundbank_w(machine, 0);
diff --git a/src/mame/drivers/cubeqst.c b/src/mame/drivers/cubeqst.c
index c1efdf65c22..e73e9951685 100644
--- a/src/mame/drivers/cubeqst.c
+++ b/src/mame/drivers/cubeqst.c
@@ -62,7 +62,7 @@ static const rectangle overlay_clip = { 0, 320-1, 0, 256-8 };
static VIDEO_START( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
state->video_field = 0;
state->depth_buffer = auto_alloc_array(machine, UINT8, 512);
}
@@ -70,7 +70,7 @@ static VIDEO_START( cubeqst )
/* TODO: Use resistor values */
static PALETTE_INIT( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
int i;
state->colormap = auto_alloc_array(machine, rgb_t, 65536);
@@ -90,14 +90,14 @@ static PALETTE_INIT( cubeqst )
static WRITE16_HANDLER( palette_w )
{
- space->machine->primary_screen->update_now();
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ space->machine().primary_screen->update_now();
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
}
/* TODO: This is a simplified version of what actually happens */
static SCREEN_UPDATE( cubeqst )
{
- cubeqst_state *state = screen->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = screen->machine().driver_data<cubeqst_state>();
int y;
/*
@@ -112,8 +112,8 @@ static SCREEN_UPDATE( cubeqst )
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
{
int i;
- int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine->device("line_cpu"), y);
- UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine->device("line_cpu"));
+ int num_entries = cubeqcpu_get_ptr_ram_val(screen->machine().device("line_cpu"), y);
+ UINT32 *stk_ram = cubeqcpu_get_stack_ram(screen->machine().device("line_cpu"));
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT32 pen;
@@ -155,7 +155,7 @@ static SCREEN_UPDATE( cubeqst )
}
/* Draw the span, testing for depth */
- pen = state->colormap[screen->machine->generic.paletteram.u16[color]];
+ pen = state->colormap[screen->machine().generic.paletteram.u16[color]];
for (x = h1; x <= h2; ++x)
{
if (!(state->depth_buffer[x] < depth))
@@ -174,12 +174,12 @@ static SCREEN_UPDATE( cubeqst )
static READ16_HANDLER( line_r )
{
/* I think this is unusued */
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
static INTERRUPT_GEN( vblank )
{
- cubeqst_state *state = device->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = device->machine().driver_data<cubeqst_state>();
int int_level = state->video_field == 0 ? 5 : 6;
device_set_input_line(device, int_level, HOLD_LINE);
@@ -197,7 +197,7 @@ static INTERRUPT_GEN( vblank )
static WRITE16_HANDLER( laserdisc_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
laserdisc_data_w(state->laserdisc, data & 0xff);
}
@@ -207,7 +207,7 @@ static WRITE16_HANDLER( laserdisc_w )
*/
static READ16_HANDLER( laserdisc_r )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
int ldp_command_flag = (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_READY) == ASSERT_LINE) ? 0 : 1;
int ldp_seek_status = (laserdisc_line_r(state->laserdisc, LASERDISC_LINE_STATUS) == ASSERT_LINE) ? 1 : 0;
@@ -218,7 +218,7 @@ static READ16_HANDLER( laserdisc_r )
/* LDP audio squelch control */
static WRITE16_HANDLER( ldaud_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
simutrek_set_audio_squelch(state->laserdisc, data & 1 ? ASSERT_LINE : CLEAR_LINE);
}
@@ -234,7 +234,7 @@ static WRITE16_HANDLER( ldaud_w )
*/
static WRITE16_HANDLER( control_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
laserdisc_video_enable(state->laserdisc, data & 1);
}
@@ -247,17 +247,17 @@ static WRITE16_HANDLER( control_w )
static TIMER_CALLBACK( delayed_bank_swap )
{
- cubeqcpu_swap_line_banks(machine->device("line_cpu"));
+ cubeqcpu_swap_line_banks(machine.device("line_cpu"));
/* TODO: This is a little dubious */
- cubeqcpu_clear_stack(machine->device("line_cpu"));
+ cubeqcpu_clear_stack(machine.device("line_cpu"));
}
-static void swap_linecpu_banks(running_machine *machine)
+static void swap_linecpu_banks(running_machine &machine)
{
/* Best sync up before we switch banks around */
- machine->scheduler().synchronize(FUNC(delayed_bank_swap));
+ machine.scheduler().synchronize(FUNC(delayed_bank_swap));
}
@@ -271,14 +271,14 @@ static void swap_linecpu_banks(running_machine *machine)
*/
static WRITE16_HANDLER( reset_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
- cputag_set_input_line(space->machine, "rotate_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "line_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "sound_cpu", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
+ cputag_set_input_line(space->machine(), "rotate_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "line_cpu", INPUT_LINE_RESET, data & 1 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
/* Swap stack and pointer RAM banks on rising edge of display reset */
if (!BIT(state->reset_latch, 0) && BIT(data, 0))
- swap_linecpu_banks(space->machine);
+ swap_linecpu_banks(space->machine());
if (!BIT(data, 2))
state->laserdisc->reset();
@@ -295,7 +295,7 @@ static WRITE16_HANDLER( reset_w )
static WRITE16_HANDLER( io_w )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
/*
0: Spare lamp
1: Spare driver
@@ -322,8 +322,8 @@ static WRITE16_HANDLER( io_w )
static READ16_HANDLER( io_r )
{
- cubeqst_state *state = space->machine->driver_data<cubeqst_state>();
- UINT16 port_data = input_port_read(space->machine, "IO");
+ cubeqst_state *state = space->machine().driver_data<cubeqst_state>();
+ UINT16 port_data = input_port_read(space->machine(), "IO");
/*
Certain bits depend on Q7 of the IO latch:
@@ -344,7 +344,7 @@ static READ16_HANDLER( io_r )
/* Trackball ('CHOP') */
static READ16_HANDLER( chop_r )
{
- return (input_port_read(space->machine, "TRACK_X") << 8) | input_port_read(space->machine, "TRACK_Y");
+ return (input_port_read(space->machine(), "TRACK_X") << 8) | input_port_read(space->machine(), "TRACK_Y");
}
@@ -385,22 +385,22 @@ INPUT_PORTS_END
static READ16_HANDLER( read_rotram )
{
- return cubeqcpu_rotram_r(space->machine->device("rotate_cpu"), offset, mem_mask);
+ return cubeqcpu_rotram_r(space->machine().device("rotate_cpu"), offset, mem_mask);
}
static WRITE16_HANDLER( write_rotram )
{
- cubeqcpu_rotram_w(space->machine->device("rotate_cpu"), offset, data, mem_mask);
+ cubeqcpu_rotram_w(space->machine().device("rotate_cpu"), offset, data, mem_mask);
}
static READ16_HANDLER( read_sndram )
{
- return cubeqcpu_sndram_r(space->machine->device("sound_cpu"), offset, mem_mask);
+ return cubeqcpu_sndram_r(space->machine().device("sound_cpu"), offset, mem_mask);
}
static WRITE16_HANDLER( write_sndram )
{
- cubeqcpu_sndram_w(space->machine->device("sound_cpu"), offset, data, mem_mask);
+ cubeqcpu_sndram_w(space->machine().device("sound_cpu"), offset, data, mem_mask);
}
static ADDRESS_MAP_START( m68k_program_map, AS_PROGRAM, 16 )
@@ -437,13 +437,13 @@ ADDRESS_MAP_END
static MACHINE_START( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
- state->laserdisc = machine->device("laserdisc");
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
+ state->laserdisc = machine.device("laserdisc");
}
static MACHINE_RESET( cubeqst )
{
- cubeqst_state *state = machine->driver_data<cubeqst_state>();
+ cubeqst_state *state = machine.driver_data<cubeqst_state>();
state->reset_latch = 0;
/* Auxillary CPUs are held in reset */
@@ -479,7 +479,7 @@ static void sound_dac_w(device_t *device, UINT16 data)
"rdac6", "ldac6",
"rdac7", "ldac7"
};
- dac_signed_data_16_w(device->machine->device(dacs[data & 15]), (data & 0xfff0) ^ 0x8000);
+ dac_signed_data_16_w(device->machine().device(dacs[data & 15]), (data & 0xfff0) ^ 0x8000);
}
static const cubeqst_snd_config snd_config =
diff --git a/src/mame/drivers/cultures.c b/src/mame/drivers/cultures.c
index 63fcaf10ef7..61b00d75259 100644
--- a/src/mame/drivers/cultures.c
+++ b/src/mame/drivers/cultures.c
@@ -42,30 +42,30 @@ public:
static TILE_GET_INFO( get_bg1_tile_info )
{
- cultures_state *state = machine->driver_data<cultures_state>();
- UINT8 *region = machine->region("gfx3")->base() + 0x200000 + 0x80000 * state->bg1_bank;
+ cultures_state *state = machine.driver_data<cultures_state>();
+ UINT8 *region = machine.region("gfx3")->base() + 0x200000 + 0x80000 * state->bg1_bank;
int code = region[tile_index * 2] + (region[tile_index * 2 + 1] << 8);
SET_TILE_INFO(2, code, code >> 12, 0);
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- cultures_state *state = machine->driver_data<cultures_state>();
- UINT8 *region = machine->region("gfx2")->base() + 0x200000 + 0x80000 * state->bg2_bank;
+ cultures_state *state = machine.driver_data<cultures_state>();
+ UINT8 *region = machine.region("gfx2")->base() + 0x200000 + 0x80000 * state->bg2_bank;
int code = region[tile_index * 2] + (region[tile_index * 2 + 1] << 8);
SET_TILE_INFO(1, code, code >> 12, 0);
}
static TILE_GET_INFO( get_bg0_tile_info )
{
- cultures_state *state = machine->driver_data<cultures_state>();
+ cultures_state *state = machine.driver_data<cultures_state>();
int code = state->bg0_videoram[tile_index * 2] + (state->bg0_videoram[tile_index * 2 + 1] << 8);
SET_TILE_INFO(0, code, code >> 12, 0);
}
static VIDEO_START( cultures )
{
- cultures_state *state = machine->driver_data<cultures_state>();
+ cultures_state *state = machine.driver_data<cultures_state>();
state->bg0_tilemap = tilemap_create(machine, get_bg0_tile_info,tilemap_scan_rows, 8, 8, 64, 128);
state->bg1_tilemap = tilemap_create(machine, get_bg1_tile_info,tilemap_scan_rows, 8, 8, 512, 512);
state->bg2_tilemap = tilemap_create(machine, get_bg2_tile_info,tilemap_scan_rows, 8, 8, 512, 512);
@@ -84,7 +84,7 @@ static VIDEO_START( cultures )
static SCREEN_UPDATE( cultures )
{
- cultures_state *state = screen->machine->driver_data<cultures_state>();
+ cultures_state *state = screen->machine().driver_data<cultures_state>();
int attr;
// tilemaps attributes
@@ -114,14 +114,14 @@ static SCREEN_UPDATE( cultures )
static WRITE8_HANDLER( cpu_bankswitch_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ cultures_state *state = space->machine().driver_data<cultures_state>();
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
state->video_bank = ~data & 0x20;
}
static WRITE8_HANDLER( bg0_videoram_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
+ cultures_state *state = space->machine().driver_data<cultures_state>();
if (state->video_bank == 0)
{
int r, g, b, datax;
@@ -133,7 +133,7 @@ static WRITE8_HANDLER( bg0_videoram_w )
g = ((datax >> 3) & 0x1e) | ((datax & 0x2000) ? 0x1 : 0);
b = ((datax << 1) & 0x1e) | ((datax & 0x1000) ? 0x1 : 0);
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
else
{
@@ -144,14 +144,14 @@ static WRITE8_HANDLER( bg0_videoram_w )
static WRITE8_HANDLER( misc_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
+ cultures_state *state = space->machine().driver_data<cultures_state>();
int new_bank = data & 0xf;
if (state->old_bank != new_bank)
{
// oki banking
- UINT8 *src = space->machine->region("oki")->base() + 0x40000 + 0x20000 * new_bank;
- UINT8 *dst = space->machine->region("oki")->base() + 0x20000;
+ UINT8 *src = space->machine().region("oki")->base() + 0x40000 + 0x20000 * new_bank;
+ UINT8 *dst = space->machine().region("oki")->base() + 0x20000;
memcpy(dst, src, 0x20000);
state->old_bank = new_bank;
@@ -162,7 +162,7 @@ static WRITE8_HANDLER( misc_w )
static WRITE8_HANDLER( bg_bank_w )
{
- cultures_state *state = space->machine->driver_data<cultures_state>();
+ cultures_state *state = space->machine().driver_data<cultures_state>();
if (state->bg1_bank != (data & 3))
{
state->bg1_bank = data & 3;
@@ -174,7 +174,7 @@ static WRITE8_HANDLER( bg_bank_w )
state->bg2_bank = (data & 0xc) >> 2;
tilemap_mark_all_tiles_dirty(state->bg2_tilemap);
}
- coin_counter_w(space->machine, 0, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x10);
}
static ADDRESS_MAP_START( cultures_map, AS_PROGRAM, 8 )
@@ -352,15 +352,15 @@ GFXDECODE_END
static INTERRUPT_GEN( cultures_interrupt )
{
- cultures_state *state = device->machine->driver_data<cultures_state>();
+ cultures_state *state = device->machine().driver_data<cultures_state>();
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
}
static MACHINE_START( cultures )
{
- cultures_state *state = machine->driver_data<cultures_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ cultures_state *state = machine.driver_data<cultures_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x0000], 0x4000);
@@ -374,7 +374,7 @@ static MACHINE_START( cultures )
static MACHINE_RESET( cultures )
{
- cultures_state *state = machine->driver_data<cultures_state>();
+ cultures_state *state = machine.driver_data<cultures_state>();
state->old_bank = -1;
state->video_bank = 0;
state->irq_enable = 0;
diff --git a/src/mame/drivers/cvs.c b/src/mame/drivers/cvs.c
index 9d5cfd3f904..d783314b7de 100644
--- a/src/mame/drivers/cvs.c
+++ b/src/mame/drivers/cvs.c
@@ -114,7 +114,7 @@ Todo & FIXME:
READ8_HANDLER( cvs_video_or_color_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->video_ram[offset];
@@ -124,7 +124,7 @@ READ8_HANDLER( cvs_video_or_color_ram_r )
WRITE8_HANDLER( cvs_video_or_color_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
state->video_ram[offset] = data;
@@ -135,7 +135,7 @@ WRITE8_HANDLER( cvs_video_or_color_ram_w )
READ8_HANDLER( cvs_bullet_ram_or_palette_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->palette_ram[offset & 0x0f];
@@ -145,7 +145,7 @@ READ8_HANDLER( cvs_bullet_ram_or_palette_r )
WRITE8_HANDLER( cvs_bullet_ram_or_palette_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
state->palette_ram[offset & 0x0f] = data;
@@ -156,7 +156,7 @@ WRITE8_HANDLER( cvs_bullet_ram_or_palette_w )
READ8_HANDLER( cvs_s2636_0_or_character_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->character_ram[(0 * 0x800) | 0x400 | state->character_ram_page_start | offset];
@@ -166,13 +166,13 @@ READ8_HANDLER( cvs_s2636_0_or_character_ram_r )
WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
{
offset |= (0 * 0x800) | 0x400 | state->character_ram_page_start;
state->character_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 8) % 256);
}
else
s2636_work_ram_w(state->s2636_0, offset, data);
@@ -181,7 +181,7 @@ WRITE8_HANDLER( cvs_s2636_0_or_character_ram_w )
READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->character_ram[(1 * 0x800) | 0x400 | state->character_ram_page_start | offset];
@@ -191,13 +191,13 @@ READ8_HANDLER( cvs_s2636_1_or_character_ram_r )
WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
{
offset |= (1 * 0x800) | 0x400 | state->character_ram_page_start;
state->character_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 8) % 256);
}
else
s2636_work_ram_w(state->s2636_1, offset, data);
@@ -206,7 +206,7 @@ WRITE8_HANDLER( cvs_s2636_1_or_character_ram_w )
READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
return state->character_ram[(2 * 0x800) | 0x400 | state->character_ram_page_start | offset];
@@ -216,13 +216,13 @@ READ8_HANDLER( cvs_s2636_2_or_character_ram_r )
WRITE8_HANDLER( cvs_s2636_2_or_character_ram_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
if (*state->fo_state)
{
offset |= (2 * 0x800) | 0x400 | state->character_ram_page_start;
state->character_ram[offset] = data;
- gfx_element_mark_dirty(space->machine->gfx[1], (offset / 8) % 256);
+ gfx_element_mark_dirty(space->machine().gfx[1], (offset / 8) % 256);
}
else
s2636_work_ram_w(state->s2636_2, offset, data);
@@ -241,7 +241,7 @@ static INTERRUPT_GEN( cvs_main_cpu_interrupt )
device_set_input_line_vector(device, 0, 0x03);
generic_pulse_irq_line(device, 0);
- cvs_scroll_stars(device->machine);
+ cvs_scroll_stars(device->machine());
}
@@ -262,7 +262,7 @@ static void cvs_slave_cpu_interrupt( device_t *cpu, int state )
static READ8_HANDLER( cvs_input_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
UINT8 ret = 0;
/* the upper 4 bits of the address is used to select the character banking attributes */
@@ -272,12 +272,12 @@ static READ8_HANDLER( cvs_input_r )
/* the lower 4 (or 3?) bits select the port to read */
switch (offset & 0x0f) /* might be 0x07 */
{
- case 0x00: ret = input_port_read(space->machine, "IN0"); break;
- case 0x02: ret = input_port_read(space->machine, "IN1"); break;
- case 0x03: ret = input_port_read(space->machine, "IN2"); break;
- case 0x04: ret = input_port_read(space->machine, "IN3"); break;
- case 0x06: ret = input_port_read(space->machine, "DSW3"); break;
- case 0x07: ret = input_port_read(space->machine, "DSW2"); break;
+ case 0x00: ret = input_port_read(space->machine(), "IN0"); break;
+ case 0x02: ret = input_port_read(space->machine(), "IN1"); break;
+ case 0x03: ret = input_port_read(space->machine(), "IN2"); break;
+ case 0x04: ret = input_port_read(space->machine(), "IN3"); break;
+ case 0x06: ret = input_port_read(space->machine(), "DSW3"); break;
+ case 0x07: ret = input_port_read(space->machine(), "DSW2"); break;
default: logerror("%04x : CVS: Reading unmapped input port 0x%02x\n", cpu_get_pc(space->cpu), offset & 0x0f); break;
}
@@ -294,7 +294,7 @@ static READ8_HANDLER( cvs_input_r )
#if 0
static READ8_HANDLER( cvs_393hz_clock_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
return state->cvs_393hz_clock ? 0x80 : 0;
}
#endif
@@ -306,7 +306,7 @@ static READ8_DEVICE_HANDLER( tms_clock_r )
static TIMER_CALLBACK( cvs_393hz_timer_cb )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
state->cvs_393hz_clock = !state->cvs_393hz_clock;
/* quasar.c games use this timer but have no dac3! */
@@ -318,10 +318,10 @@ static TIMER_CALLBACK( cvs_393hz_timer_cb )
}
-static void start_393hz_timer(running_machine *machine)
+static void start_393hz_timer(running_machine &machine)
{
- cvs_state *state = machine->driver_data<cvs_state>();
- state->cvs_393hz_timer = machine->scheduler().timer_alloc(FUNC(cvs_393hz_timer_cb));
+ cvs_state *state = machine.driver_data<cvs_state>();
+ state->cvs_393hz_timer = machine.scheduler().timer_alloc(FUNC(cvs_393hz_timer_cb));
state->cvs_393hz_timer->adjust(attotime::from_hz(30*393), 0, attotime::from_hz(30*393));
}
@@ -335,7 +335,7 @@ static void start_393hz_timer(running_machine *machine)
static WRITE8_DEVICE_HANDLER( cvs_4_bit_dac_data_w )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
UINT8 dac_value;
static int old_data[4] = {0,0,0,0};
@@ -358,7 +358,7 @@ static WRITE8_DEVICE_HANDLER( cvs_4_bit_dac_data_w )
static WRITE8_DEVICE_HANDLER( cvs_unknown_w )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
/* offset 2 is used in 8ball
* offset 0 is used in spacefrt
@@ -385,7 +385,7 @@ static WRITE8_DEVICE_HANDLER( cvs_unknown_w )
static WRITE8_HANDLER( cvs_speech_rom_address_lo_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
/* assuming that d0-d2 are cleared here */
state->speech_rom_bit_address = (state->speech_rom_bit_address & 0xf800) | (data << 3);
@@ -394,7 +394,7 @@ static WRITE8_HANDLER( cvs_speech_rom_address_lo_w )
static WRITE8_HANDLER( cvs_speech_rom_address_hi_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
state->speech_rom_bit_address = (state->speech_rom_bit_address & 0x07ff) | (data << 11);
LOG(("%04x : CVS: Speech Hi %02x Address = %04x\n", cpu_get_pc(space->cpu), data, state->speech_rom_bit_address >> 3));
}
@@ -402,7 +402,7 @@ static WRITE8_HANDLER( cvs_speech_rom_address_hi_w )
static READ8_HANDLER( cvs_speech_command_r )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
/* FIXME: this was by observation on board ???
* -bit 7 is TMS status (active LO) */
@@ -412,7 +412,7 @@ static READ8_HANDLER( cvs_speech_command_r )
static WRITE8_DEVICE_HANDLER( cvs_tms5110_ctl_w )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
UINT8 ctl;
/*
* offset 0: CS ?
@@ -439,13 +439,13 @@ static WRITE8_DEVICE_HANDLER( cvs_tms5110_pdc_w )
static int speech_rom_read_bit( device_t *device )
{
- cvs_state *state = device->machine->driver_data<cvs_state>();
- running_machine *machine = device->machine;
- UINT8 *ROM = machine->region("speechdata")->base();
+ cvs_state *state = device->machine().driver_data<cvs_state>();
+ running_machine &machine = device->machine();
+ UINT8 *ROM = machine.region("speechdata")->base();
int bit;
/* before reading the bit, clamp the address to the region length */
- state->speech_rom_bit_address = state->speech_rom_bit_address & ((machine->region("speechdata")->bytes() * 8) - 1);
+ state->speech_rom_bit_address = state->speech_rom_bit_address & ((machine.region("speechdata")->bytes() * 8) - 1);
bit = (ROM[state->speech_rom_bit_address >> 3] >> (state->speech_rom_bit_address & 0x07)) & 0x01;
/* prepare for next bit */
@@ -471,7 +471,7 @@ static const tms5110_interface tms5100_interface =
static WRITE8_HANDLER( audio_command_w )
{
- cvs_state *state = space->machine->driver_data<cvs_state>();
+ cvs_state *state = space->machine().driver_data<cvs_state>();
LOG(("data %02x\n", data));
/* cause interrupt on audio CPU if bit 7 set */
@@ -1007,23 +1007,23 @@ static const s2636_interface s2636_2_config =
MACHINE_START( cvs )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
/* allocate memory */
- if (machine->gfx[1] != NULL)
- gfx_element_set_source(machine->gfx[1], state->character_ram);
+ if (machine.gfx[1] != NULL)
+ gfx_element_set_source(machine.gfx[1], state->character_ram);
start_393hz_timer(machine);
/* set devices */
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->speech = machine->device("speech");
- state->dac3 = machine->device("dac3");
- state->tms = machine->device("tms");
- state->s2636_0 = machine->device("s2636_0");
- state->s2636_1 = machine->device("s2636_1");
- state->s2636_2 = machine->device("s2636_2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->speech = machine.device("speech");
+ state->dac3 = machine.device("dac3");
+ state->tms = machine.device("tms");
+ state->s2636_0 = machine.device("s2636_0");
+ state->s2636_1 = machine.device("s2636_1");
+ state->s2636_2 = machine.device("s2636_2");
/* register state save */
state->save_item(NAME(state->color_ram));
@@ -1042,7 +1042,7 @@ MACHINE_START( cvs )
MACHINE_RESET( cvs )
{
- cvs_state *state = machine->driver_data<cvs_state>();
+ cvs_state *state = machine.driver_data<cvs_state>();
state->character_banking_mode = 0;
state->character_ram_page_start = 0;
@@ -1592,7 +1592,7 @@ ROM_END
static DRIVER_INIT( huncholy )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* patch out protection */
ROM[0x0082] = 0xc0;
@@ -1612,7 +1612,7 @@ static DRIVER_INIT( huncholy )
static DRIVER_INIT( hunchbaka )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
offs_t offs;
@@ -1624,7 +1624,7 @@ static DRIVER_INIT( hunchbaka )
static DRIVER_INIT( superbik )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* patch out protection */
ROM[0x0079] = 0xc0;
@@ -1652,7 +1652,7 @@ static DRIVER_INIT( superbik )
static DRIVER_INIT( hero )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* patch out protection */
ROM[0x0087] = 0xc0;
@@ -1674,7 +1674,7 @@ static DRIVER_INIT( hero )
static DRIVER_INIT( raiders )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
offs_t offs;
diff --git a/src/mame/drivers/cyberbal.c b/src/mame/drivers/cyberbal.c
index 4721c0a6f52..3b19c45c4d6 100644
--- a/src/mame/drivers/cyberbal.c
+++ b/src/mame/drivers/cyberbal.c
@@ -35,9 +35,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
cputag_set_input_line(machine, "maincpu", 1, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "extra", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -45,7 +45,7 @@ static void update_interrupts(running_machine *machine)
static MACHINE_START( cyberbal )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
atarigen_init(machine);
state->save_item(NAME(state->fast_68k_int));
@@ -59,13 +59,13 @@ static MACHINE_START( cyberbal )
static MACHINE_RESET( cyberbal )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, cyberbal_scanline_update, 8);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_scanline_timer_reset(*machine.primary_screen, cyberbal_scanline_update, 8);
+ atarigen_sound_io_reset(machine.device("audiocpu"));
cyberbal_sound_reset(machine);
@@ -74,9 +74,9 @@ static MACHINE_RESET( cyberbal )
}
-static void cyberbal2p_update_interrupts(running_machine *machine)
+static void cyberbal2p_update_interrupts(running_machine &machine)
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
cputag_set_input_line(machine, "maincpu", 1, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -84,11 +84,11 @@ static void cyberbal2p_update_interrupts(running_machine *machine)
static MACHINE_RESET( cyberbal2p )
{
- cyberbal_state *state = machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = machine.driver_data<cyberbal_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, cyberbal2p_update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, cyberbal_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, cyberbal_scanline_update, 8);
atarijsa_reset();
}
@@ -102,8 +102,8 @@ static MACHINE_RESET( cyberbal2p )
static READ16_HANDLER( special_port0_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- int temp = input_port_read(space->machine, "IN0");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ int temp = input_port_read(space->machine(), "IN0");
if (state->cpu_to_sound_ready) temp ^= 0x0080;
return temp;
}
@@ -111,8 +111,8 @@ static READ16_HANDLER( special_port0_r )
static READ16_HANDLER( special_port2_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
- int temp = input_port_read(space->machine, "IN2");
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
+ int temp = input_port_read(space->machine(), "IN2");
if (state->cpu_to_sound_ready) temp ^= 0x2000;
return temp;
}
@@ -120,7 +120,7 @@ static READ16_HANDLER( special_port2_r )
static READ16_HANDLER( sound_state_r )
{
- cyberbal_state *state = space->machine->driver_data<cyberbal_state>();
+ cyberbal_state *state = space->machine().driver_data<cyberbal_state>();
int temp = 0xffff;
if (state->cpu_to_sound_ready) temp ^= 0xffff;
return temp;
@@ -136,7 +136,7 @@ static READ16_HANDLER( sound_state_r )
static WRITE16_HANDLER( p2_reset_w )
{
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, CLEAR_LINE);
}
@@ -1009,13 +1009,13 @@ ROM_END
static DRIVER_INIT( cyberbal )
{
- atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 0);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x018000, 0, 0);
}
static DRIVER_INIT( cyberbalt )
{
- atarigen_slapstic_init(machine->device("maincpu"), 0x018000, 0, 116);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x018000, 0, 116);
}
diff --git a/src/mame/drivers/cybertnk.c b/src/mame/drivers/cybertnk.c
index 90407cec5f8..c72b547cd3f 100644
--- a/src/mame/drivers/cybertnk.c
+++ b/src/mame/drivers/cybertnk.c
@@ -190,7 +190,7 @@ public:
static TILE_GET_INFO( get_tx_tile_info )
{
- cybertnk_state *state = machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = machine.driver_data<cybertnk_state>();
int code = state->tx_vram[tile_index];
SET_TILE_INFO(
0,
@@ -201,7 +201,7 @@ static TILE_GET_INFO( get_tx_tile_info )
static VIDEO_START( cybertnk )
{
- cybertnk_state *state = machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = machine.driver_data<cybertnk_state>();
state->tx_tilemap = tilemap_create(machine, get_tx_tile_info,tilemap_scan_rows,8,8,128,32);
tilemap_set_transparent_pen(state->tx_tilemap,0);
}
@@ -218,9 +218,9 @@ static void draw_pixel( bitmap_t* bitmap, const rectangle *cliprect, int y, int
static SCREEN_UPDATE( cybertnk )
{
- cybertnk_state *state = screen->machine->driver_data<cybertnk_state>();
- device_t *left_screen = screen->machine->device("lscreen");
- device_t *right_screen = screen->machine->device("rscreen");
+ cybertnk_state *state = screen->machine().driver_data<cybertnk_state>();
+ device_t *left_screen = screen->machine().device("lscreen");
+ device_t *right_screen = screen->machine().device("rscreen");
int screen_shift = 0;
if (screen==left_screen)
@@ -236,11 +236,11 @@ static SCREEN_UPDATE( cybertnk )
tilemap_set_scrolldx(state->tx_tilemap, screen_shift, screen_shift);
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
{
int i;
- const gfx_element *gfx = screen->machine->gfx[3];
+ const gfx_element *gfx = screen->machine().gfx[3];
for (i=0;i<0x1000/4;i+=4)
@@ -258,7 +258,7 @@ static SCREEN_UPDATE( cybertnk )
{
int count,x,y;
- const gfx_element *gfx = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[2];
count = 0;
@@ -279,7 +279,7 @@ static SCREEN_UPDATE( cybertnk )
{
int count,x,y;
- const gfx_element *gfx = screen->machine->gfx[1];
+ const gfx_element *gfx = screen->machine().gfx[1];
count = 0;
@@ -301,7 +301,7 @@ static SCREEN_UPDATE( cybertnk )
/* non-tile based spriteram (BARE-BONES, looks pretty complex) */
if(1)
{
- const UINT8 *blit_ram = screen->machine->region("spr_gfx")->base();
+ const UINT8 *blit_ram = screen->machine().region("spr_gfx")->base();
int offs,x,y,z,xsize,ysize,yi,xi,col_bank,fx,zoom;
UINT32 spr_offs,spr_offs_helper;
int xf,yf,xz,yz;
@@ -354,11 +354,11 @@ static SCREEN_UPDATE( cybertnk )
dot|= col_bank<<4;
if(fx)
{
- draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine().pens[dot]);
}
else
{
- draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine().pens[dot]);
}
}
xf+=zoom;
@@ -386,11 +386,11 @@ static SCREEN_UPDATE( cybertnk )
dot|= col_bank<<4;
if(fx)
{
- draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xsize-(xz)+screen_shift, screen->machine().pens[dot]);
}
else
{
- draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine->pens[dot]);
+ draw_pixel(bitmap, cliprect, y+yz, x+xz+screen_shift, screen->machine().pens[dot]);
}
}
xf+=zoom;
@@ -433,47 +433,47 @@ static SCREEN_UPDATE( cybertnk )
if(0) //sprite gfx debug viewer
{
int x,y,count;
- const UINT8 *blit_ram = screen->machine->region("spr_gfx")->base();
+ const UINT8 *blit_ram = screen->machine().region("spr_gfx")->base();
- if(input_code_pressed(screen->machine, KEYCODE_Z))
+ if(input_code_pressed(screen->machine(), KEYCODE_Z))
state->test_x++;
- if(input_code_pressed(screen->machine, KEYCODE_X))
+ if(input_code_pressed(screen->machine(), KEYCODE_X))
state->test_x--;
- if(input_code_pressed(screen->machine, KEYCODE_A))
+ if(input_code_pressed(screen->machine(), KEYCODE_A))
state->test_y++;
- if(input_code_pressed(screen->machine, KEYCODE_S))
+ if(input_code_pressed(screen->machine(), KEYCODE_S))
state->test_y--;
- if(input_code_pressed(screen->machine, KEYCODE_Q))
+ if(input_code_pressed(screen->machine(), KEYCODE_Q))
state->start_offs+=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_W))
+ if(input_code_pressed(screen->machine(), KEYCODE_W))
state->start_offs-=0x200;
- if(input_code_pressed_once(screen->machine, KEYCODE_T))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_T))
state->start_offs+=0x20000;
- if(input_code_pressed_once(screen->machine, KEYCODE_Y))
+ if(input_code_pressed_once(screen->machine(), KEYCODE_Y))
state->start_offs-=0x20000;
- if(input_code_pressed(screen->machine, KEYCODE_E))
+ if(input_code_pressed(screen->machine(), KEYCODE_E))
state->start_offs+=4;
- if(input_code_pressed(screen->machine, KEYCODE_R))
+ if(input_code_pressed(screen->machine(), KEYCODE_R))
state->start_offs-=4;
- if(input_code_pressed(screen->machine, KEYCODE_D))
+ if(input_code_pressed(screen->machine(), KEYCODE_D))
state->color_pen++;
- if(input_code_pressed(screen->machine, KEYCODE_F))
+ if(input_code_pressed(screen->machine(), KEYCODE_F))
state->color_pen--;
popmessage("%02x %02x %04x %02x",state->test_x,state->test_y,state->start_offs,state->color_pen);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (state->start_offs);
@@ -490,28 +490,28 @@ static SCREEN_UPDATE( cybertnk )
color|= ((blit_ram[count+3] & 0xff) << 0);
dot = (color & 0xf0000000) >> 28;
- *BITMAP_ADDR16(bitmap, y, x+0) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+0) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x0f000000) >> 24;
- *BITMAP_ADDR16(bitmap, y, x+4) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+4) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x00f00000) >> 20;
- *BITMAP_ADDR16(bitmap, y, x+1) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+1) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x000f0000) >> 16;
- *BITMAP_ADDR16(bitmap, y, x+5) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+5) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x0000f000) >> 12;
- *BITMAP_ADDR16(bitmap, y, x+2) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+2) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x00000f00) >> 8;
- *BITMAP_ADDR16(bitmap, y, x+6) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+6) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x000000f0) >> 4;
- *BITMAP_ADDR16(bitmap, y, x+3) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+3) = screen->machine().pens[dot+(state->color_pen<<4)];
dot = (color & 0x0000000f) >> 0;
- *BITMAP_ADDR16(bitmap, y, x+7) = screen->machine->pens[dot+(state->color_pen<<4)];
+ *BITMAP_ADDR16(bitmap, y, x+7) = screen->machine().pens[dot+(state->color_pen<<4)];
count+=4;
}
@@ -526,18 +526,18 @@ static SCREEN_UPDATE( cybertnk )
static WRITE16_HANDLER( tx_vram_w )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
COMBINE_DATA(&state->tx_vram[offset]);
tilemap_mark_tile_dirty(state->tx_tilemap,offset);
}
static READ16_HANDLER( io_r )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
switch( offset )
{
case 2/2:
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
// 0x00110007 is controller device select
// 0x001100D5 is controller data
@@ -546,15 +546,15 @@ static READ16_HANDLER( io_r )
switch( (state->io_ram[6/2]) & 0xff )
{
case 0:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "TRAVERSE");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "TRAVERSE");
break;
case 0x20:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "ELEVATE");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "ELEVATE");
break;
case 0x40:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "ACCEL");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "ACCEL");
break;
case 0x42:
@@ -566,7 +566,7 @@ static READ16_HANDLER( io_r )
break;
case 0x60:
- state->io_ram[0xd4/2] = input_port_read(space->machine, "HANDLE");
+ state->io_ram[0xd4/2] = input_port_read(space->machine(), "HANDLE");
break;
//default:
@@ -575,13 +575,13 @@ static READ16_HANDLER( io_r )
return 0;
case 6/2:
- return input_port_read(space->machine, "IN0"); // high half
+ return input_port_read(space->machine(), "IN0"); // high half
case 8/2:
- return input_port_read(space->machine, "IN0"); // low half
+ return input_port_read(space->machine(), "IN0"); // low half
case 0xa/2:
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
case 0xd4/2:
return state->io_ram[offset]; // controller data
@@ -596,7 +596,7 @@ static READ16_HANDLER( io_r )
static WRITE16_HANDLER( io_w )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
COMBINE_DATA(&state->io_ram[offset]);
switch( offset )
@@ -604,7 +604,7 @@ static WRITE16_HANDLER( io_w )
case 0/2:
// sound data
if (ACCESSING_BITS_0_7)
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
else
LOG_UNKNOWN_WRITE
break;
@@ -669,7 +669,7 @@ static WRITE16_HANDLER( io_w )
static READ8_HANDLER( soundport_r )
{
- cybertnk_state *state = space->machine->driver_data<cybertnk_state>();
+ cybertnk_state *state = space->machine().driver_data<cybertnk_state>();
return state->io_ram[0] & 0xff;
}
@@ -1003,7 +1003,7 @@ DRIVER_INIT( cybertnk )
UINT8* road_data;
int i;
- road_data = machine->region("road_data")->base();
+ road_data = machine.region("road_data")->base();
for (i=0;i < 0x40000;i++)
{
road_data[i] = BITSWAP8(road_data[i],3,2,1,0,7,6,5,4);
diff --git a/src/mame/drivers/cyclemb.c b/src/mame/drivers/cyclemb.c
index 78964e5ba17..04ed58d9311 100644
--- a/src/mame/drivers/cyclemb.c
+++ b/src/mame/drivers/cyclemb.c
@@ -123,10 +123,10 @@ static VIDEO_START( cyclemb )
static SCREEN_UPDATE( cyclemb )
{
- cyclemb_state *state = screen->machine->driver_data<cyclemb_state>();
+ cyclemb_state *state = screen->machine().driver_data<cyclemb_state>();
int x,y,count;
- const gfx_element *gfx = screen->machine->gfx[0];
- UINT8 flip_screen = flip_screen_get(screen->machine);
+ const gfx_element *gfx = screen->machine().gfx[0];
+ UINT8 flip_screen = flip_screen_get(screen->machine());
count = 0;
@@ -208,7 +208,7 @@ static SCREEN_UPDATE( cyclemb )
fx = !fx;
fy = !fy;
}
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[region],spr_offs,col,fx,fy,x,y,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[region],spr_offs,col,fx,fy,x,y,0);
}
}
@@ -217,14 +217,14 @@ static SCREEN_UPDATE( cyclemb )
static WRITE8_HANDLER( cyclemb_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 3);
+ memory_set_bank(space->machine(), "bank1", data & 3);
}
#if 0
static WRITE8_HANDLER( sound_cmd_w )
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
#endif
@@ -238,13 +238,13 @@ static READ8_HANDLER( mcu_status_r )
static WRITE8_HANDLER( sound_cmd_w ) //actually ciom
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
#endif
static WRITE8_HANDLER( cyclemb_flip_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
// a bunch of other things are setted here
}
@@ -604,7 +604,7 @@ ROM_END
static DRIVER_INIT( cyclemb )
{
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x1000);
}
GAME( 1984, cyclemb, 0, cyclemb, cyclemb, cyclemb, ROT0, "Taito Corporation", "Cycle Mahbou (Japan)", GAME_NOT_WORKING )
diff --git a/src/mame/drivers/d9final.c b/src/mame/drivers/d9final.c
index fab6513221e..23fb7ecc8d8 100644
--- a/src/mame/drivers/d9final.c
+++ b/src/mame/drivers/d9final.c
@@ -40,7 +40,7 @@ public:
static TILE_GET_INFO( get_sc0_tile_info )
{
- d9final_state *state = machine->driver_data<d9final_state>();
+ d9final_state *state = machine.driver_data<d9final_state>();
int tile = ((state->hi_vram[tile_index] & 0x3f)<<8) | state->lo_vram[tile_index];
int color = state->cram[tile_index] & 0x3f;
@@ -53,45 +53,45 @@ static TILE_GET_INFO( get_sc0_tile_info )
static VIDEO_START(d9final)
{
- d9final_state *state = machine->driver_data<d9final_state>();
+ d9final_state *state = machine.driver_data<d9final_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,64,32);
}
static SCREEN_UPDATE(d9final)
{
- d9final_state *state = screen->machine->driver_data<d9final_state>();
+ d9final_state *state = screen->machine().driver_data<d9final_state>();
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
return 0;
}
static WRITE8_HANDLER( sc0_lovram )
{
- d9final_state *state = space->machine->driver_data<d9final_state>();
+ d9final_state *state = space->machine().driver_data<d9final_state>();
state->lo_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( sc0_hivram )
{
- d9final_state *state = space->machine->driver_data<d9final_state>();
+ d9final_state *state = space->machine().driver_data<d9final_state>();
state->hi_vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( sc0_cram )
{
- d9final_state *state = space->machine->driver_data<d9final_state>();
+ d9final_state *state = space->machine().driver_data<d9final_state>();
state->cram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
}
static WRITE8_HANDLER( d9final_bank_w )
{
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
UINT32 bankaddress;
bankaddress = 0x10000+(0x4000 * (data & 0x7));
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
/* game checks this after three attract cycles, otherwise coin inputs stop to work. */
@@ -268,7 +268,7 @@ GFXDECODE_END
static MACHINE_RESET( d9final )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1", &ROM[0x10000]);
}
diff --git a/src/mame/drivers/dacholer.c b/src/mame/drivers/dacholer.c
index 8a730738598..eafc26817fd 100644
--- a/src/mame/drivers/dacholer.c
+++ b/src/mame/drivers/dacholer.c
@@ -56,43 +56,43 @@ public:
static WRITE8_HANDLER( background_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->bgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( foreground_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->fgvideoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
}
static WRITE8_HANDLER( bg_bank_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
if ((data & 3) != state->bg_bank)
{
state->bg_bank = data & 3;
tilemap_mark_all_tiles_dirty(state->bg_tilemap);
}
- flip_screen_set(space->machine, data & 0xc); // probably one bit for flipx and one for flipy
+ flip_screen_set(space->machine(), data & 0xc); // probably one bit for flipx and one for flipy
}
static WRITE8_HANDLER( coins_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
- set_led_status(space->machine, 0, data & 4);
- set_led_status(space->machine, 1, data & 8);
+ set_led_status(space->machine(), 0, data & 4);
+ set_led_status(space->machine(), 1, data & 8);
}
static WRITE8_HANDLER(snd_w)
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -128,32 +128,32 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( adpcm_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->msm_data = data;
state->msm_toggle = 0;
}
static WRITE8_HANDLER( snd_ack_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->snd_ack = data;
}
static CUSTOM_INPUT( snd_ack_r )
{
- dacholer_state *state = field->port->machine->driver_data<dacholer_state>();
+ dacholer_state *state = field->port->machine().driver_data<dacholer_state>();
return state->snd_ack; //guess ...
}
static WRITE8_HANDLER( snd_irq_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->snd_interrupt_enable = data;
}
static WRITE8_HANDLER( music_irq_w )
{
- dacholer_state *state = space->machine->driver_data<dacholer_state>();
+ dacholer_state *state = space->machine().driver_data<dacholer_state>();
state->music_interrupt_enable = data;
}
@@ -311,28 +311,28 @@ INPUT_PORTS_END
static TILE_GET_INFO( get_bg_tile_info )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
SET_TILE_INFO(1, state->bgvideoram[tile_index] + state->bg_bank * 0x100, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
SET_TILE_INFO(0, state->fgvideoram[tile_index], 0, 0);
}
static VIDEO_START( dacholer )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
int offs, code, attr, sx, sy, flipx, flipy;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -354,7 +354,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[2],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[2],
code,
0,
flipx,flipy,
@@ -364,10 +364,10 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(dacholer)
{
- dacholer_state *state = screen->machine->driver_data<dacholer_state>();
+ dacholer_state *state = screen->machine().driver_data<dacholer_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -403,7 +403,7 @@ GFXDECODE_END
static INTERRUPT_GEN( sound_irq )
{
- dacholer_state *state = device->machine->driver_data<dacholer_state>();
+ dacholer_state *state = device->machine().driver_data<dacholer_state>();
if (state->music_interrupt_enable == 1)
{
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0x30);
@@ -412,7 +412,7 @@ static INTERRUPT_GEN( sound_irq )
static void adpcm_int( device_t *device )
{
- dacholer_state *state = device->machine->driver_data<dacholer_state>();
+ dacholer_state *state = device->machine().driver_data<dacholer_state>();
if (state->snd_interrupt_enable == 1 || (state->snd_interrupt_enable == 0 && state->msm_toggle == 1))
{
msm5205_data_w(device, state->msm_data >> 4);
@@ -435,9 +435,9 @@ static const msm5205_interface msm_interface =
static MACHINE_START( dacholer )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->bg_bank));
state->save_item(NAME(state->msm_data));
@@ -449,7 +449,7 @@ static MACHINE_START( dacholer )
static MACHINE_RESET( dacholer )
{
- dacholer_state *state = machine->driver_data<dacholer_state>();
+ dacholer_state *state = machine.driver_data<dacholer_state>();
state->msm_data = 0;
state->msm_toggle = 0;
@@ -474,7 +474,7 @@ static PALETTE_INIT( dacholer )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
diff --git a/src/mame/drivers/dai3wksi.c b/src/mame/drivers/dai3wksi.c
index f0a0fc2f4de..216baf7e3b6 100644
--- a/src/mame/drivers/dai3wksi.c
+++ b/src/mame/drivers/dai3wksi.c
@@ -125,7 +125,7 @@ static void dai3wksi_get_pens(pen_t *pens)
static SCREEN_UPDATE( dai3wksi )
{
- dai3wksi_state *state = screen->machine->driver_data<dai3wksi_state>();
+ dai3wksi_state *state = screen->machine().driver_data<dai3wksi_state>();
offs_t offs;
pen_t pens[8];
@@ -147,7 +147,7 @@ static SCREEN_UPDATE( dai3wksi )
}
else
{
- if (input_port_read(screen->machine, "IN2") & 0x03)
+ if (input_port_read(screen->machine(), "IN2") & 0x03)
color = vr_prom2[value];
else
color = vr_prom1[value];
@@ -196,8 +196,8 @@ static SCREEN_UPDATE( dai3wksi )
#if (USE_SAMPLES)
static WRITE8_HANDLER( dai3wksi_audio_1_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *samples = space->machine->device("samples");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~state->port_last1;
state->enabled_sound = data & 0x80;
@@ -217,8 +217,8 @@ static WRITE8_HANDLER( dai3wksi_audio_1_w )
static WRITE8_HANDLER( dai3wksi_audio_2_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *samples = space->machine->device("samples");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *samples = space->machine().device("samples");
UINT8 rising_bits = data & ~state->port_last2;
state->dai3wksi_flipscreen = data & 0x10;
@@ -246,8 +246,8 @@ static WRITE8_HANDLER( dai3wksi_audio_2_w )
static WRITE8_HANDLER( dai3wksi_audio_3_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *samples = space->machine->device("samples");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *samples = space->machine().device("samples");
if (state->enabled_sound)
{
@@ -284,9 +284,9 @@ static const samples_interface dai3wksi_samples_interface =
static WRITE8_HANDLER( dai3wksi_audio_1_w )
{
- device_t *ic79 = space->machine->device("ic79");
+ device_t *ic79 = space->machine().device("ic79");
- space->machine->sound().system_enable(data & 0x80);
+ space->machine().sound().system_enable(data & 0x80);
sn76477_enable_w(ic79, (~data >> 5) & 0x01); /* invader movement enable */
sn76477_envelope_1_w(ic79, (~data >> 2) & 0x01); /* invader movement envelope control*/
@@ -295,10 +295,10 @@ static WRITE8_HANDLER( dai3wksi_audio_1_w )
static WRITE8_HANDLER( dai3wksi_audio_2_w )
{
- dai3wksi_state *state = space->machine->driver_data<dai3wksi_state>();
- device_t *ic77 = space->machine->device("ic77");
- device_t *ic78 = space->machine->device("ic78");
- device_t *ic80 = space->machine->device("ic80");
+ dai3wksi_state *state = space->machine().driver_data<dai3wksi_state>();
+ device_t *ic77 = space->machine().device("ic77");
+ device_t *ic78 = space->machine().device("ic78");
+ device_t *ic80 = space->machine().device("ic80");
state->dai3wksi_flipscreen = data & 0x10;
state->dai3wksi_redscreen = ~data & 0x20;
@@ -312,7 +312,7 @@ static WRITE8_HANDLER( dai3wksi_audio_2_w )
static WRITE8_HANDLER( dai3wksi_audio_3_w )
{
- device_t *ic81 = space->machine->device("ic81");
+ device_t *ic81 = space->machine().device("ic81");
sn76477_enable_w(ic81, (~data >> 2) & 0x01); /* player shoot enable */
sn76477_vco_w(ic81, (~data >> 3) & 0x01); /* player shoot vco control */
@@ -564,7 +564,7 @@ INPUT_PORTS_END
static MACHINE_START( dai3wksi )
{
- dai3wksi_state *state = machine->driver_data<dai3wksi_state>();
+ dai3wksi_state *state = machine.driver_data<dai3wksi_state>();
/* Set up save state */
state->save_item(NAME(state->dai3wksi_flipscreen));
@@ -578,7 +578,7 @@ static MACHINE_START( dai3wksi )
static MACHINE_RESET( dai3wksi )
{
- dai3wksi_state *state = machine->driver_data<dai3wksi_state>();
+ dai3wksi_state *state = machine.driver_data<dai3wksi_state>();
state->port_last1 = 0;
state->port_last2 = 0;
diff --git a/src/mame/drivers/dambustr.c b/src/mame/drivers/dambustr.c
index f3c32cbe6a3..aa62f1b5141 100644
--- a/src/mame/drivers/dambustr.c
+++ b/src/mame/drivers/dambustr.c
@@ -68,7 +68,7 @@ public:
/* FIXME: Really needed? - Should be handled by either interface */
static WRITE8_DEVICE_HANDLER( dambustr_noise_enable_w )
{
- dambustr_state *state = device->machine->driver_data<dambustr_state>();
+ dambustr_state *state = device->machine().driver_data<dambustr_state>();
if (data != state->noise_data) {
state->noise_data = data;
galaxian_noise_enable_w(device, offset, data);
@@ -205,9 +205,9 @@ static DRIVER_INIT(dambustr)
{
int i, j, tmp;
int tmpram[16];
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *usr = machine->region("user1")->base();
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *usr = machine.region("user1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
// Bit swap addresses
for(i=0; i<4096*4; i++) {
diff --git a/src/mame/drivers/darius.c b/src/mame/drivers/darius.c
index 4e248a47bee..8821568e1de 100644
--- a/src/mame/drivers/darius.c
+++ b/src/mame/drivers/darius.c
@@ -139,25 +139,25 @@ sounds.
#include "darius.lh"
-static void parse_control( running_machine *machine ) /* assumes Z80 sandwiched between 68Ks */
+static void parse_control( running_machine &machine ) /* assumes Z80 sandwiched between 68Ks */
{
/* bit 0 enables cpu B */
/* however this fails when recovering from a save state
if cpu B is disabled !! */
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
device_set_input_line(state->cpub, INPUT_LINE_RESET, (state->cpua_ctrl & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE16_HANDLER( cpua_ctrl_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
if ((data & 0xff00) && ((data & 0xff) == 0))
data = data >> 8;
state->cpua_ctrl = data;
- parse_control(space->machine);
+ parse_control(space->machine());
logerror("CPU #0 PC %06x: write %04x to cpu control\n", cpu_get_pc(space->cpu), data);
}
@@ -174,7 +174,7 @@ static WRITE16_HANDLER( darius_watchdog_w )
static READ16_HANDLER( darius_ioc_r )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
switch (offset)
{
@@ -182,19 +182,19 @@ static READ16_HANDLER( darius_ioc_r )
return (tc0140syt_comm_r(state->tc0140syt, 0) & 0xff); /* sound interface read */
case 0x04:
- return input_port_read(space->machine, "P1");
+ return input_port_read(space->machine(), "P1");
case 0x05:
- return input_port_read(space->machine, "P2");
+ return input_port_read(space->machine(), "P2");
case 0x06:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x07:
return state->coin_word; /* bits 3&4 coin lockouts, must return zero */
case 0x08:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(space->cpu),offset);
@@ -204,7 +204,7 @@ logerror("CPU #0 PC %06x: warning - read unmapped ioc offset %06x\n",cpu_get_pc(
static WRITE16_HANDLER( darius_ioc_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
switch (offset)
{
@@ -225,10 +225,10 @@ static WRITE16_HANDLER( darius_ioc_w )
case 0x30: /* coin control */
/* bits 7,5,4,0 used on reset */
/* bit 4 used whenever bg is blanked ? */
- coin_lockout_w(space->machine, 0, ~data & 0x02);
- coin_lockout_w(space->machine, 1, ~data & 0x04);
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_lockout_w(space->machine(), 0, ~data & 0x02);
+ coin_lockout_w(space->machine(), 1, ~data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x40);
state->coin_word = data & 0xffff;
//popmessage(" address %04x value %04x",offset,data);
return;
@@ -274,25 +274,25 @@ ADDRESS_MAP_END
SOUND
*****************************************************/
-static void reset_sound_region( running_machine *machine )
+static void reset_sound_region( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
memory_set_bank(machine, "bank1", state->banknum);
}
static WRITE8_HANDLER( sound_bankswitch_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->banknum = data & 0x03;
- reset_sound_region(space->machine);
+ reset_sound_region(space->machine());
// banknum = data;
// reset_sound_region();
}
static WRITE8_HANDLER( adpcm_command_w )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->adpcm_command = data;
/* logerror("#ADPCM command write =%2x\n",data); */
}
@@ -309,9 +309,9 @@ static WRITE8_HANDLER( display_value )
Sound mixer/pan control
*****************************************************/
-static void update_fm0( running_machine *machine )
+static void update_fm0( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int left = ( state->pan[0] * state->vol[6]) >> 8;
int right = ((0xff - state->pan[0]) * state->vol[6]) >> 8;
@@ -321,9 +321,9 @@ static void update_fm0( running_machine *machine )
flt_volume_set_volume(state->filter0_3r, right / 100.0); /* FM #0 */
}
-static void update_fm1( running_machine *machine )
+static void update_fm1( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int left = ( state->pan[1] * state->vol[7]) >> 8;
int right = ((0xff - state->pan[1]) * state->vol[7]) >> 8;
@@ -333,9 +333,9 @@ static void update_fm1( running_machine *machine )
flt_volume_set_volume(state->filter1_3r, right / 100.0); /* FM #1 */
}
-static void update_psg0( running_machine *machine, int port )
+static void update_psg0( running_machine &machine, int port )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
device_t *lvol = NULL, *rvol = NULL;
int left, right;
@@ -356,9 +356,9 @@ static void update_psg0( running_machine *machine, int port )
flt_volume_set_volume(rvol, right / 100.0);
}
-static void update_psg1( running_machine *machine, int port )
+static void update_psg1( running_machine &machine, int port )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
device_t *lvol = NULL, *rvol = NULL;
int left, right;
@@ -379,9 +379,9 @@ static void update_psg1( running_machine *machine, int port )
flt_volume_set_volume(rvol, right / 100.0);
}
-static void update_da( running_machine *machine )
+static void update_da( running_machine &machine )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int left = state->def_vol[(state->pan[4] >> 4) & 0x0f];
int right = state->def_vol[(state->pan[4] >> 0) & 0x0f];
@@ -393,48 +393,48 @@ static void update_da( running_machine *machine )
static WRITE8_HANDLER( darius_fm0_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[0] = data & 0xff; /* data 0x00:right 0xff:left */
- update_fm0(space->machine);
+ update_fm0(space->machine());
}
static WRITE8_HANDLER( darius_fm1_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[1] = data & 0xff;
- update_fm1(space->machine);
+ update_fm1(space->machine());
}
static WRITE8_HANDLER( darius_psg0_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[2] = data & 0xff;
- update_psg0(space->machine, 0);
- update_psg0(space->machine, 1);
- update_psg0(space->machine, 2);
+ update_psg0(space->machine(), 0);
+ update_psg0(space->machine(), 1);
+ update_psg0(space->machine(), 2);
}
static WRITE8_HANDLER( darius_psg1_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[3] = data & 0xff;
- update_psg1(space->machine, 0);
- update_psg1(space->machine, 1);
- update_psg1(space->machine, 2);
+ update_psg1(space->machine(), 0);
+ update_psg1(space->machine(), 1);
+ update_psg1(space->machine(), 2);
}
static WRITE8_HANDLER( darius_da_pan )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->pan[4] = data & 0xff;
- update_da(space->machine);
+ update_da(space->machine());
}
/**** Mixer Control ****/
static WRITE8_DEVICE_HANDLER( darius_write_portA0 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control FM #0 PSG #0 A
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
@@ -442,47 +442,47 @@ static WRITE8_DEVICE_HANDLER( darius_write_portA0 )
state->vol[0] = state->def_vol[(data >> 4) & 0x0f];
state->vol[6] = state->def_vol[(data >> 0) & 0x0f];
- update_fm0(device->machine);
- update_psg0(device->machine, 0);
+ update_fm0(device->machine());
+ update_psg0(device->machine(), 0);
}
static WRITE8_DEVICE_HANDLER( darius_write_portA1 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control FM #1 PSG #1 A
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
state->vol[3] = state->def_vol[(data >> 4) & 0x0f];
state->vol[7] = state->def_vol[(data >> 0) & 0x0f];
- update_fm1(device->machine);
- update_psg1(device->machine, 0);
+ update_fm1(device->machine());
+ update_psg1(device->machine(), 0);
}
static WRITE8_DEVICE_HANDLER( darius_write_portB0 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control PSG #0 B/C
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
state->vol[1] = state->def_vol[(data >> 4) & 0x0f];
state->vol[2] = state->def_vol[(data >> 0) & 0x0f];
- update_psg0(device->machine, 1);
- update_psg0(device->machine, 2);
+ update_psg0(device->machine(), 1);
+ update_psg0(device->machine(), 2);
}
static WRITE8_DEVICE_HANDLER( darius_write_portB1 )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
// volume control PSG #1 B/C
//popmessage(" pan %02x %02x %02x %02x %02x", state->pan[0], state->pan[1], state->pan[2], state->pan[3], state->pan[4] );
state->vol[4] = state->def_vol[(data >> 4) & 0x0f];
state->vol[5] = state->def_vol[(data >> 0) & 0x0f];
- update_psg1(device->machine, 1);
- update_psg1(device->machine, 2);
+ update_psg1(device->machine(), 1);
+ update_psg1(device->machine(), 2);
}
@@ -515,7 +515,7 @@ ADDRESS_MAP_END
static void darius_adpcm_int( device_t *device )
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
if (state->nmi_enable)
device_set_input_line(state->adpcm, INPUT_LINE_NMI, PULSE_LINE);
@@ -529,7 +529,7 @@ static const msm5205_interface msm5205_config =
static READ8_HANDLER( adpcm_command_read )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
/* logerror("read port 0: %02x PC=%4x\n",adpcm_command, cpu_get_pc(space->cpu) ); */
return state->adpcm_command;
@@ -547,7 +547,7 @@ static READ8_HANDLER( readport3 )
static WRITE8_HANDLER( adpcm_nmi_disable )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->nmi_enable = 0;
/* logerror("write port 0: NMI DISABLE PC=%4x\n", data, cpu_get_pc(space->cpu) ); */
@@ -555,7 +555,7 @@ static WRITE8_HANDLER( adpcm_nmi_disable )
static WRITE8_HANDLER( adpcm_nmi_enable )
{
- darius_state *state = space->machine->driver_data<darius_state>();
+ darius_state *state = space->machine().driver_data<darius_state>();
state->nmi_enable = 1;
/* logerror("write port 1: NMI ENABLE PC=%4x\n", cpu_get_pc(space->cpu) ); */
}
@@ -800,7 +800,7 @@ GFXDECODE_END
/* handler called by the YM2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq ) /* assumes Z80 sandwiched between 68Ks */
{
- darius_state *state = device->machine->driver_data<darius_state>();
+ darius_state *state = device->machine().driver_data<darius_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -853,43 +853,43 @@ static STATE_POSTLOAD( darius_postload )
static MACHINE_START( darius )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("audiocpu")->base() + 0x10000, 0x8000);
- memory_configure_bank(machine, "bank1", 4, 1, machine->region("audiocpu")->base(), 0x8000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("audiocpu")->base() + 0x10000, 0x8000);
+ memory_configure_bank(machine, "bank1", 4, 1, machine.region("audiocpu")->base(), 0x8000);
memory_set_bank(machine, "bank1", 4);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->cpub = machine->device("cpub");
- state->adpcm = machine->device("adpcm");
- state->pc080sn = machine->device("pc080sn");
- state->tc0140syt = machine->device("tc0140syt");
-
- state->lscreen = machine->device("lscreen");
- state->mscreen = machine->device("mscreen");
- state->rscreen = machine->device("rscreen");
-
- state->filter0_0l = machine->device("filter0.0l");
- state->filter0_0r = machine->device("filter0.0r");
- state->filter0_1l = machine->device("filter0.1l");
- state->filter0_1r = machine->device("filter0.1r");
- state->filter0_2l = machine->device("filter0.2l");
- state->filter0_2r = machine->device("filter0.2r");
- state->filter0_3l = machine->device("filter0.3l");
- state->filter0_3r = machine->device("filter0.3r");
-
- state->filter1_0l = machine->device("filter1.0l");
- state->filter1_0r = machine->device("filter1.0r");
- state->filter1_1l = machine->device("filter1.1l");
- state->filter1_1r = machine->device("filter1.1r");
- state->filter1_2l = machine->device("filter1.2l");
- state->filter1_2r = machine->device("filter1.2r");
- state->filter1_3l = machine->device("filter1.3l");
- state->filter1_3r = machine->device("filter1.3r");
-
- state->msm5205_l = machine->device("msm5205.l");
- state->msm5205_r = machine->device("msm5205.r");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->cpub = machine.device("cpub");
+ state->adpcm = machine.device("adpcm");
+ state->pc080sn = machine.device("pc080sn");
+ state->tc0140syt = machine.device("tc0140syt");
+
+ state->lscreen = machine.device("lscreen");
+ state->mscreen = machine.device("mscreen");
+ state->rscreen = machine.device("rscreen");
+
+ state->filter0_0l = machine.device("filter0.0l");
+ state->filter0_0r = machine.device("filter0.0r");
+ state->filter0_1l = machine.device("filter0.1l");
+ state->filter0_1r = machine.device("filter0.1r");
+ state->filter0_2l = machine.device("filter0.2l");
+ state->filter0_2r = machine.device("filter0.2r");
+ state->filter0_3l = machine.device("filter0.3l");
+ state->filter0_3r = machine.device("filter0.3r");
+
+ state->filter1_0l = machine.device("filter1.0l");
+ state->filter1_0r = machine.device("filter1.0r");
+ state->filter1_1l = machine.device("filter1.1l");
+ state->filter1_1r = machine.device("filter1.1r");
+ state->filter1_2l = machine.device("filter1.2l");
+ state->filter1_2r = machine.device("filter1.2r");
+ state->filter1_3l = machine.device("filter1.3l");
+ state->filter1_3r = machine.device("filter1.3r");
+
+ state->msm5205_l = machine.device("msm5205.l");
+ state->msm5205_r = machine.device("msm5205.r");
state->save_item(NAME(state->cpua_ctrl));
state->save_item(NAME(state->coin_word));
@@ -899,13 +899,13 @@ static MACHINE_START( darius )
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->vol));
state->save_item(NAME(state->pan));
- machine->state().register_postload(darius_postload, NULL);
+ machine.state().register_postload(darius_postload, NULL);
}
static MACHINE_RESET( darius )
{
- darius_state *state = machine->driver_data<darius_state>();
+ darius_state *state = machine.driver_data<darius_state>();
int i;
state->cpua_ctrl = 0xff;
@@ -914,7 +914,7 @@ static MACHINE_RESET( darius )
state->adpcm_command = 0;
state->nmi_enable = 0;
- machine->sound().system_enable(true); /* mixer enabled */
+ machine.sound().system_enable(true); /* mixer enabled */
for (i = 0; i < DARIUS_VOL_MAX; i++)
state->vol[i] = 0x00; /* min volume */
@@ -1291,7 +1291,7 @@ ROM_END
static DRIVER_INIT( darius )
{
/**** setup sound bank image ****/
- UINT8 *RAM = machine->region("audiocpu")->base();
+ UINT8 *RAM = machine.region("audiocpu")->base();
int i;
for (i = 3; i >= 0; i--)
diff --git a/src/mame/drivers/darkhors.c b/src/mame/drivers/darkhors.c
index 1f82fdecd15..34d620461ed 100644
--- a/src/mame/drivers/darkhors.c
+++ b/src/mame/drivers/darkhors.c
@@ -99,7 +99,7 @@ static SCREEN_UPDATE( darkhors );
static TILE_GET_INFO( get_tile_info_0 )
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
UINT16 tile = state->tmapram[tile_index] >> 16;
UINT16 color = state->tmapram[tile_index] & 0xffff;
SET_TILE_INFO(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0);
@@ -107,7 +107,7 @@ static TILE_GET_INFO( get_tile_info_0 )
static TILE_GET_INFO( get_tile_info_1 )
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
UINT16 tile = state->tmapram2[tile_index] >> 16;
UINT16 color = state->tmapram2[tile_index] & 0xffff;
SET_TILE_INFO(0, tile/2, (color & 0x200) ? (color & 0x1ff) : ((color & 0x0ff) * 4) , 0);
@@ -115,20 +115,20 @@ static TILE_GET_INFO( get_tile_info_1 )
static WRITE32_HANDLER( darkhors_tmapram_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->tmapram[offset]);
tilemap_mark_tile_dirty(state->tmap, offset);
}
static WRITE32_HANDLER( darkhors_tmapram2_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->tmapram2[offset]);
tilemap_mark_tile_dirty(state->tmap2, offset);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
UINT32 *s = state->spriteram;
UINT32 *end = state->spriteram + 0x02000/4;
@@ -155,7 +155,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sy = -sy;
sy += 0xf8;
- drawgfx_transpen( bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen( bitmap, cliprect, machine.gfx[0],
code/2, color,
flipx, flipy, sx, sy, 0);
}
@@ -163,7 +163,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
static VIDEO_START( darkhors )
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
state->tmap = tilemap_create( machine, get_tile_info_0, tilemap_scan_rows,
16,16, 0x40,0x40 );
@@ -173,26 +173,26 @@ static VIDEO_START( darkhors )
tilemap_set_transparent_pen(state->tmap, 0);
tilemap_set_transparent_pen(state->tmap2, 0);
- machine->gfx[0]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
+ machine.gfx[0]->color_granularity = 64; /* 256 colour sprites with palette selectable on 64 colour boundaries */
}
static SCREEN_UPDATE( darkhors )
{
- darkhors_state *state = screen->machine->driver_data<darkhors_state>();
+ darkhors_state *state = screen->machine().driver_data<darkhors_state>();
int layers_ctrl = -1;
#if DARKHORS_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_set_scrollx(state->tmap,0, (state->tmapscroll[0] >> 16) - 5);
tilemap_set_scrolly(state->tmap,0, (state->tmapscroll[0] & 0xffff) - 0xff );
@@ -202,7 +202,7 @@ static SCREEN_UPDATE( darkhors )
tilemap_set_scrolly(state->tmap2,0, (state->tmapscroll2[0] & 0xffff) - 0xff );
if (layers_ctrl & 2) tilemap_draw(bitmap,cliprect, state->tmap2, 0, 0);
- if (layers_ctrl & 4) draw_sprites(screen->machine,bitmap,cliprect);
+ if (layers_ctrl & 4) draw_sprites(screen->machine(),bitmap,cliprect);
#if DARKHORS_DEBUG
#if 0
@@ -244,7 +244,7 @@ static const eeprom_interface eeprom_intf =
static WRITE32_DEVICE_HANDLER( darkhors_eeprom_w )
{
if (data & ~0xff000000)
- logerror("%s: Unknown EEPROM bit written %08X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %08X\n",device->machine().describe_context(),data);
if ( ACCESSING_BITS_24_31 )
{
@@ -267,7 +267,7 @@ static WRITE32_HANDLER( paletteram32_xBBBBBGGGGGRRRRR_dword_w )
static WRITE32_HANDLER( darkhors_input_sel_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->input_sel);
// if (ACCESSING_BITS_16_31) popmessage("%04X",data >> 16);
}
@@ -290,14 +290,14 @@ static int mask_to_bit( int mask )
static READ32_HANDLER( darkhors_input_sel_r )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
// from bit mask to bit number
int bit_p1 = mask_to_bit((state->input_sel & 0x00ff0000) >> 16);
int bit_p2 = mask_to_bit((state->input_sel & 0xff000000) >> 24);
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" };
- return (input_port_read(space->machine, portnames[bit_p1]) & 0x00ffffff) |
- (input_port_read(space->machine, portnames[bit_p2]) & 0xff000000) ;
+ return (input_port_read(space->machine(), portnames[bit_p1]) & 0x00ffffff) |
+ (input_port_read(space->machine(), portnames[bit_p2]) & 0xff000000) ;
}
static WRITE32_HANDLER( darkhors_unk1_w )
@@ -336,9 +336,9 @@ ADDRESS_MAP_END
static WRITE32_HANDLER( jclub2_tileram_w )
{
- darkhors_state *state = space->machine->driver_data<darkhors_state>();
+ darkhors_state *state = space->machine().driver_data<darkhors_state>();
COMBINE_DATA(&state->jclub2_tileram[offset]);
- gfx_element_mark_dirty(space->machine->gfx[state->jclub2_gfx_index], offset/(256/4));
+ gfx_element_mark_dirty(space->machine().gfx[state->jclub2_gfx_index], offset/(256/4));
}
@@ -677,16 +677,16 @@ MACHINE_CONFIG_END
static VIDEO_START(jclub2)
{
- darkhors_state *state = machine->driver_data<darkhors_state>();
+ darkhors_state *state = machine.driver_data<darkhors_state>();
/* find first empty slot to decode gfx */
for (state->jclub2_gfx_index = 0; state->jclub2_gfx_index < MAX_GFX_ELEMENTS; state->jclub2_gfx_index++)
- if (machine->gfx[state->jclub2_gfx_index] == 0)
+ if (machine.gfx[state->jclub2_gfx_index] == 0)
break;
assert(state->jclub2_gfx_index != MAX_GFX_ELEMENTS);
/* create the char set (gfx will then be updated dynamically from RAM) */
- machine->gfx[state->jclub2_gfx_index] = gfx_element_alloc(machine, &layout_16x16x8_jclub2, (UINT8 *)state->jclub2_tileram, machine->total_colors() / 16, 0);
+ machine.gfx[state->jclub2_gfx_index] = gfx_element_alloc(machine, &layout_16x16x8_jclub2, (UINT8 *)state->jclub2_tileram, machine.total_colors() / 16, 0);
}
@@ -945,8 +945,8 @@ ROM_END
static DRIVER_INIT( darkhors )
{
- UINT32 *rom = (UINT32 *) machine->region("maincpu")->base();
- UINT8 *eeprom = (UINT8 *) machine->region("eeprom")->base();
+ UINT32 *rom = (UINT32 *) machine.region("maincpu")->base();
+ UINT8 *eeprom = (UINT8 *) machine.region("eeprom")->base();
int i;
#if 1
diff --git a/src/mame/drivers/darkmist.c b/src/mame/drivers/darkmist.c
index 3ba30535e54..ab2094934e5 100644
--- a/src/mame/drivers/darkmist.c
+++ b/src/mame/drivers/darkmist.c
@@ -32,9 +32,9 @@ TODO:
static WRITE8_HANDLER(darkmist_hw_w)
{
- darkmist_state *state = space->machine->driver_data<darkmist_state>();
+ darkmist_state *state = space->machine().driver_data<darkmist_state>();
state->hw=data;
- memory_set_bankptr(space->machine, "bank1",&space->machine->region("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
+ memory_set_bankptr(space->machine(), "bank1",&space->machine().region("maincpu")->base()[0x010000+((data&0x80)?0x4000:0)]);
}
static ADDRESS_MAP_START( memmap, AS_PROGRAM, 8 )
@@ -313,15 +313,15 @@ ROM_START( darkmist )
ROM_END
-static void decrypt_gfx(running_machine *machine)
+static void decrypt_gfx(running_machine &machine)
{
UINT8 *buf = auto_alloc_array(machine, UINT8, 0x40000);
UINT8 *rom;
int size;
int i;
- rom = machine->region("gfx1")->base();
- size = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ size = machine.region("gfx1")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -343,8 +343,8 @@ static void decrypt_gfx(running_machine *machine)
}
- rom = machine->region("gfx2")->base();
- size = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ size = machine.region("gfx2")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -366,8 +366,8 @@ static void decrypt_gfx(running_machine *machine)
}
- rom = machine->region("gfx3")->base();
- size = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ size = machine.region("gfx3")->bytes();
/* data lines */
for (i = 0;i < size/2;i++)
@@ -391,10 +391,10 @@ static void decrypt_gfx(running_machine *machine)
auto_free(machine, buf);
}
-static void decrypt_snd(running_machine *machine)
+static void decrypt_snd(running_machine &machine)
{
int i;
- UINT8 *ROM = machine->region("t5182")->base();
+ UINT8 *ROM = machine.region("t5182")->base();
for(i=0x8000;i<0x10000;i++)
ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
@@ -402,9 +402,9 @@ static void decrypt_snd(running_machine *machine)
static DRIVER_INIT(darkmist)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i, len;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
UINT8 *buffer = auto_alloc_array(machine, UINT8, 0x10000);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
@@ -437,11 +437,11 @@ static DRIVER_INIT(darkmist)
}
space->set_decrypted_region(0x0000, 0x7fff, decrypt);
- memory_set_bankptr(space->machine, "bank1",&ROM[0x010000]);
+ memory_set_bankptr(space->machine(), "bank1",&ROM[0x010000]);
/* adr line swaps */
- ROM = machine->region("user1")->base();
- len = machine->region("user1")->bytes();
+ ROM = machine.region("user1")->base();
+ len = machine.region("user1")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
@@ -449,24 +449,24 @@ static DRIVER_INIT(darkmist)
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)];
}
- ROM = machine->region("user2")->base();
- len = machine->region("user2")->bytes();
+ ROM = machine.region("user2")->base();
+ len = machine.region("user2")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,6,5,4,3,2,14,13,12,11,8,7,1,0,10,9)];
}
- ROM = machine->region("user3")->base();
- len = machine->region("user3")->bytes();
+ ROM = machine.region("user3")->base();
+ len = machine.region("user3")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
ROM[i]=buffer[BITSWAP24(i,23,22,21,20,19,18,17,16,15,14 ,5,4,3,2,11,10,9,8,13,12,1,0,7,6)];
}
- ROM = machine->region("user4")->base();
- len = machine->region("user4")->bytes();
+ ROM = machine.region("user4")->base();
+ len = machine.region("user4")->bytes();
memcpy( buffer, ROM, len );
for(i=0;i<len;i++)
{
diff --git a/src/mame/drivers/darkseal.c b/src/mame/drivers/darkseal.c
index 31e34434a3b..c1046888617 100644
--- a/src/mame/drivers/darkseal.c
+++ b/src/mame/drivers/darkseal.c
@@ -33,7 +33,7 @@ static WRITE16_HANDLER( darkseal_control_w )
return;
case 8: /* Sound CPU write */
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
return;
case 0xa: /* IRQ Ack (VBL) */
return;
@@ -45,13 +45,13 @@ static READ16_HANDLER( darkseal_control_r )
switch (offset<<1)
{
case 0:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 2:
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 4:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
return ~0;
@@ -224,7 +224,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
+ cputag_set_input_line(device->machine(), "audiocpu", 1, state); /* IRQ 2 */
}
static const ym2151_interface ym2151_config =
@@ -475,7 +475,7 @@ ROM_END
static DRIVER_INIT( darkseal )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
for (i=0x00000; i<0x80000; i++)
diff --git a/src/mame/drivers/dassault.c b/src/mame/drivers/dassault.c
index 5f03dce4651..98fd42ca4f6 100644
--- a/src/mame/drivers/dassault.c
+++ b/src/mame/drivers/dassault.c
@@ -138,19 +138,19 @@ static READ16_HANDLER( dassault_control_r )
switch (offset << 1)
{
case 0: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 2: /* Player 3 & Player 4 joysticks & fire buttons */
- return input_port_read(space->machine, "P3_P4");
+ return input_port_read(space->machine(), "P3_P4");
case 4: /* Dip 1 (stored at 0x3f8035) */
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
case 6: /* Dip 2 (stored at 0x3f8034) */
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
case 8: /* VBL, Credits */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
return 0xffff;
@@ -158,19 +158,19 @@ static READ16_HANDLER( dassault_control_r )
static WRITE16_HANDLER( dassault_control_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (data & 0xfffe)
logerror("Coin cointrol %04x\n", data);
}
static READ16_HANDLER( dassault_sub_control_r )
{
- return input_port_read(space->machine, "VBLANK1");
+ return input_port_read(space->machine(), "VBLANK1");
}
static WRITE16_HANDLER( dassault_sound_w )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 0, HOLD_LINE); /* IRQ1 */
}
@@ -178,7 +178,7 @@ static WRITE16_HANDLER( dassault_sound_w )
/* The CPU-CPU irq controller is overlaid onto the end of the shared memory */
static READ16_HANDLER( dassault_irq_r )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
switch (offset)
{
case 0: device_set_input_line(state->maincpu, 5, CLEAR_LINE); break;
@@ -189,7 +189,7 @@ static READ16_HANDLER( dassault_irq_r )
static WRITE16_HANDLER( dassault_irq_w )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
switch (offset)
{
case 0: device_set_input_line(state->maincpu, 5, ASSERT_LINE); break;
@@ -201,13 +201,13 @@ static WRITE16_HANDLER( dassault_irq_w )
static WRITE16_HANDLER( shared_ram_w )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
COMBINE_DATA(&state->shared_ram[offset]);
}
static READ16_HANDLER( shared_ram_r )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
return state->shared_ram[offset];
}
@@ -513,13 +513,13 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- dassault_state *driver_state = device->machine->driver_data<dassault_state>();
+ dassault_state *driver_state = device->machine().driver_data<dassault_state>();
device_set_input_line(driver_state->audiocpu, 1, state);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- dassault_state *state = device->machine->driver_data<dassault_state>();
+ dassault_state *state = device->machine().driver_data<dassault_state>();
/* the second OKIM6295 ROM is bank switched */
state->oki2->set_bank_base((data & 1) * 0x40000);
@@ -828,7 +828,7 @@ ROM_END
static READ16_HANDLER( dassault_main_skip )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
int ret = state->ram[0];
if (cpu_get_previouspc(space->cpu) == 0x1170 && ret & 0x8000)
@@ -839,7 +839,7 @@ static READ16_HANDLER( dassault_main_skip )
static READ16_HANDLER( thndzone_main_skip )
{
- dassault_state *state = space->machine->driver_data<dassault_state>();
+ dassault_state *state = space->machine().driver_data<dassault_state>();
int ret = state->ram[0];
if (cpu_get_pc(space->cpu) == 0x114c && ret & 0x8000)
@@ -850,8 +850,8 @@ static READ16_HANDLER( thndzone_main_skip )
static DRIVER_INIT( dassault )
{
- const UINT8 *src = machine->region("gfx1")->base();
- UINT8 *dst = machine->region("gfx2")->base();
+ const UINT8 *src = machine.region("gfx1")->base();
+ UINT8 *dst = machine.region("gfx2")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Playfield 4 also has access to the char graphics, make things easier
@@ -865,13 +865,13 @@ static DRIVER_INIT( dassault )
auto_free(machine, tmp);
/* Save time waiting on vblank bit */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(dassault_main_skip));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(dassault_main_skip));
}
static DRIVER_INIT( thndzone )
{
- const UINT8 *src = machine->region("gfx1")->base();
- UINT8 *dst = machine->region("gfx2")->base();
+ const UINT8 *src = machine.region("gfx1")->base();
+ UINT8 *dst = machine.region("gfx2")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Playfield 4 also has access to the char graphics, make things easier
@@ -885,7 +885,7 @@ static DRIVER_INIT( thndzone )
auto_free(machine, tmp);
/* Save time waiting on vblank bit */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(thndzone_main_skip));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3f8000, 0x3f8001, FUNC(thndzone_main_skip));
}
/**********************************************************************************/
diff --git a/src/mame/drivers/dblewing.c b/src/mame/drivers/dblewing.c
index 6403f10a565..5a2ca651c01 100644
--- a/src/mame/drivers/dblewing.c
+++ b/src/mame/drivers/dblewing.c
@@ -89,18 +89,18 @@ UINT16 dblwings_pri_callback(UINT16 x)
static SCREEN_UPDATE(dblewing)
{
- dblewing_state *state = screen->machine->driver_data<dblewing_state>();
+ dblewing_state *state = screen->machine().driver_data<dblewing_state>();
UINT16 flip = deco16ic_pf_control_r(state->deco_tilegen1, 0, 0xffff);
- flip_screen_set(screen->machine, BIT(flip, 7));
+ flip_screen_set(screen->machine(), BIT(flip, 7));
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
bitmap_fill(bitmap, cliprect, 0); /* not Confirmed */
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, 0, 2);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 4);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x400);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x400);
return 0;
}
@@ -116,7 +116,7 @@ static SCREEN_UPDATE(dblewing)
*/
static READ16_HANDLER ( dblewing_prot_r )
{
- dblewing_state *state = space->machine->driver_data<dblewing_state>();
+ dblewing_state *state = space->machine().driver_data<dblewing_state>();
switch (offset * 2)
{
@@ -135,11 +135,11 @@ static READ16_HANDLER ( dblewing_prot_r )
case 0x330: return 0; // controls bonuses such as shoot type,bombs etc.
case 0x1d4: return state->_70c_data; //controls restart points
- case 0x0ac: return (input_port_read(space->machine, "DSW") & 0x40) << 4;//flip screen
+ case 0x0ac: return (input_port_read(space->machine(), "DSW") & 0x40) << 4;//flip screen
case 0x4b0: return state->_608_data;//coinage
case 0x068:
{
- switch (input_port_read(space->machine, "DSW") & 0x0300) //I don't know how to relationate this...
+ switch (input_port_read(space->machine(), "DSW") & 0x0300) //I don't know how to relationate this...
{
case 0x0000: return 0x000;//0
case 0x0100: return 0x060;//3
@@ -149,12 +149,12 @@ static READ16_HANDLER ( dblewing_prot_r )
}
case 0x094: return state->_104_data;// p1 inputs select screen OK
case 0x24c: return state->_008_data;//read DSW (mirror for coinage/territory)
- case 0x298: return input_port_read(space->machine, "SYSTEM");//vblank
- case 0x476: return input_port_read(space->machine, "SYSTEM");//mirror for coins
- case 0x506: return input_port_read(space->machine, "DSW");
+ case 0x298: return input_port_read(space->machine(), "SYSTEM");//vblank
+ case 0x476: return input_port_read(space->machine(), "SYSTEM");//mirror for coins
+ case 0x506: return input_port_read(space->machine(), "DSW");
case 0x5d8: return state->_406_data;
- case 0x2b4: return input_port_read(space->machine, "P1_P2");
- case 0x1a8: return (input_port_read(space->machine, "DSW") & 0x4000) >> 12;//allow continue
+ case 0x2b4: return input_port_read(space->machine(), "P1_P2");
+ case 0x1a8: return (input_port_read(space->machine(), "DSW") & 0x4000) >> 12;//allow continue
case 0x3ec: return state->_70c_data; //score entry
case 0x246: return state->_580_data; // these three controls "perfect bonus" I suppose...
case 0x52e: return state->_580_data;
@@ -175,12 +175,12 @@ static READ16_HANDLER ( dblewing_prot_r )
mame_printf_debug("dblewing prot r %08x, %04x, %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask);
- return 0;//space->machine->rand();
+ return 0;//space->machine().rand();
}
static WRITE16_HANDLER( dblewing_prot_w )
{
- dblewing_state *state = space->machine->driver_data<dblewing_state>();
+ dblewing_state *state = space->machine().driver_data<dblewing_state>();
// if (offset * 2 != 0x380)
// printf("dblewing prot w %08x, %04x, %04x %04x\n", cpu_get_pc(space->cpu), offset * 2, mem_mask, data);
@@ -328,7 +328,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(irq_latch_r)
{
- dblewing_state *state = space->machine->driver_data<dblewing_state>();
+ dblewing_state *state = space->machine().driver_data<dblewing_state>();
/* bit 1 of dblewing_sound_irq specifies IRQ command writes */
state->sound_irq &= ~0x02;
@@ -520,7 +520,7 @@ INPUT_PORTS_END
static void sound_irq( device_t *device, int state )
{
- dblewing_state *driver_state = device->machine->driver_data<dblewing_state>();
+ dblewing_state *driver_state = device->machine().driver_data<dblewing_state>();
/* bit 0 of dblewing_sound_irq specifies IRQ from sound chip */
if (state)
@@ -554,11 +554,11 @@ static const deco16ic_interface dblewing_deco16ic_tilegen1_intf =
static MACHINE_START( dblewing )
{
- dblewing_state *state = machine->driver_data<dblewing_state>();
+ dblewing_state *state = machine.driver_data<dblewing_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
state->save_item(NAME(state->_008_data));
state->save_item(NAME(state->_104_data));
@@ -593,7 +593,7 @@ static MACHINE_START( dblewing )
static MACHINE_RESET( dblewing )
{
- dblewing_state *state = machine->driver_data<dblewing_state>();
+ dblewing_state *state = machine.driver_data<dblewing_state>();
state->_008_data = 0;
state->_104_data = 0;
diff --git a/src/mame/drivers/dbz.c b/src/mame/drivers/dbz.c
index d9d84ec39fc..f7745f9b2c2 100644
--- a/src/mame/drivers/dbz.c
+++ b/src/mame/drivers/dbz.c
@@ -63,7 +63,7 @@ Notes:
static INTERRUPT_GEN( dbz_interrupt )
{
- dbz_state *state = device->machine->driver_data<dbz_state>();
+ dbz_state *state = device->machine().driver_data<dbz_state>();
switch (cpu_getiloops(device))
{
@@ -81,14 +81,14 @@ static INTERRUPT_GEN( dbz_interrupt )
#if 0
static READ16_HANDLER( dbzcontrol_r )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
return state->control;
}
#endif
static WRITE16_HANDLER( dbzcontrol_w )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
/* bit 10 = enable '246 readback */
COMBINE_DATA(&state->control);
@@ -98,8 +98,8 @@ static WRITE16_HANDLER( dbzcontrol_w )
else
k053246_set_objcha_line(state->k053246, CLEAR_LINE);
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static WRITE16_HANDLER( dbz_sound_command_w )
@@ -109,13 +109,13 @@ static WRITE16_HANDLER( dbz_sound_command_w )
static WRITE16_HANDLER( dbz_sound_cause_nmi )
{
- dbz_state *state = space->machine->driver_data<dbz_state>();
+ dbz_state *state = space->machine().driver_data<dbz_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static void dbz_sound_irq( device_t *device, int irq )
{
- dbz_state *state = device->machine->driver_data<dbz_state>();
+ dbz_state *state = device->machine().driver_data<dbz_state>();
if (irq)
device_set_input_line(state->audiocpu, 0, ASSERT_LINE);
@@ -338,15 +338,15 @@ static const k053936_interface dbz_k053936_intf =
static MACHINE_START( dbz )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k053936_1 = machine->device("k053936_1");
- state->k053936_2 = machine->device("k053936_2");
- state->k056832 = machine->device("k056832");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936_1 = machine.device("k053936_1");
+ state->k053936_2 = machine.device("k053936_2");
+ state->k056832 = machine.device("k056832");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
state->save_item(NAME(state->control));
state->save_item(NAME(state->sprite_colorbase));
@@ -356,7 +356,7 @@ static MACHINE_START( dbz )
static MACHINE_RESET( dbz )
{
- dbz_state *state = machine->driver_data<dbz_state>();
+ dbz_state *state = machine.driver_data<dbz_state>();
int i;
for (i = 0; i < 5; i++)
@@ -500,7 +500,7 @@ static DRIVER_INIT( dbz )
{
UINT16 *ROM;
- ROM = (UINT16 *)machine->region("maincpu")->base();
+ ROM = (UINT16 *)machine.region("maincpu")->base();
// nop out dbz1's mask rom test
// tile ROM test
diff --git a/src/mame/drivers/dcheese.c b/src/mame/drivers/dcheese.c
index 01dff9aee56..902bce0950d 100644
--- a/src/mame/drivers/dcheese.c
+++ b/src/mame/drivers/dcheese.c
@@ -49,7 +49,7 @@
static void update_irq_state( device_t *cpu )
{
- dcheese_state *state = cpu->machine->driver_data<dcheese_state>();
+ dcheese_state *state = cpu->machine().driver_data<dcheese_state>();
int i;
for (i = 1; i < 5; i++)
@@ -59,7 +59,7 @@ static void update_irq_state( device_t *cpu )
static IRQ_CALLBACK( irq_callback )
{
- dcheese_state *state = device->machine->driver_data<dcheese_state>();
+ dcheese_state *state = device->machine().driver_data<dcheese_state>();
/* auto-ack the IRQ */
state->irq_state[irqline] = 0;
@@ -70,9 +70,9 @@ static IRQ_CALLBACK( irq_callback )
}
-void dcheese_signal_irq( running_machine *machine, int which )
+void dcheese_signal_irq( running_machine &machine, int which )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
state->irq_state[which] = 1;
update_irq_state(state->maincpu);
@@ -82,7 +82,7 @@ void dcheese_signal_irq( running_machine *machine, int which )
static INTERRUPT_GEN( dcheese_vblank )
{
logerror("---- VBLANK ----\n");
- dcheese_signal_irq(device->machine, 4);
+ dcheese_signal_irq(device->machine(), 4);
}
@@ -95,11 +95,11 @@ static INTERRUPT_GEN( dcheese_vblank )
static MACHINE_START( dcheese )
{
- dcheese_state *state = machine->driver_data<dcheese_state>();
+ dcheese_state *state = machine.driver_data<dcheese_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->bsmt = machine->device("bsmt");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->bsmt = machine.device("bsmt");
device_set_irq_callback(state->maincpu, irq_callback);
@@ -119,7 +119,7 @@ static MACHINE_START( dcheese )
static CUSTOM_INPUT( sound_latch_state_r )
{
- dcheese_state *state = field->port->machine->driver_data<dcheese_state>();
+ dcheese_state *state = field->port->machine().driver_data<dcheese_state>();
return state->soundlatch_full;
}
@@ -130,15 +130,15 @@ static WRITE16_HANDLER( eeprom_control_w )
/* bits $0080-$0010 are probably lamps */
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
- ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 1) << 7);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, (data & 1) << 7);
}
}
static WRITE16_HANDLER( sound_command_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
if (ACCESSING_BITS_0_7)
{
@@ -159,7 +159,7 @@ static WRITE16_HANDLER( sound_command_w )
static READ8_HANDLER( sound_command_r )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
/* read the latch and clear the IRQ */
state->soundlatch_full = 0;
@@ -171,14 +171,14 @@ static READ8_HANDLER( sound_command_r )
static READ8_HANDLER( sound_status_r )
{
/* seems to be ready signal on BSMT or latching hardware */
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
static WRITE8_HANDLER( sound_control_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
UINT8 diff = data ^ state->sound_control;
state->sound_control = data;
@@ -193,8 +193,8 @@ static WRITE8_HANDLER( sound_control_w )
static WRITE8_HANDLER( bsmt_data_w )
{
- dcheese_state *state = space->machine->driver_data<dcheese_state>();
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ dcheese_state *state = space->machine().driver_data<dcheese_state>();
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
/* writes come in pairs; even bytes latch, odd bytes write */
if (offset % 2 == 0)
diff --git a/src/mame/drivers/dcon.c b/src/mame/drivers/dcon.c
index fde7fb71412..667403a1e5a 100644
--- a/src/mame/drivers/dcon.c
+++ b/src/mame/drivers/dcon.c
@@ -377,7 +377,7 @@ ROM_END
/***************************************************************************/
static DRIVER_INIT( sdgndmps )
{
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
RAM[0x1356/2] = 0x4e71; /* beq -> nop */
RAM[0x1358/2] = 0x4e71;
diff --git a/src/mame/drivers/dday.c b/src/mame/drivers/dday.c
index 4ed374cf353..5bf851b2869 100644
--- a/src/mame/drivers/dday.c
+++ b/src/mame/drivers/dday.c
@@ -222,9 +222,9 @@ GFXDECODE_END
static MACHINE_START( dday )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
- state->ay1 = machine->device("ay1");
+ state->ay1 = machine.device("ay1");
state->save_item(NAME(state->control));
state->save_item(NAME(state->sl_enable));
@@ -234,7 +234,7 @@ static MACHINE_START( dday )
static MACHINE_RESET( dday )
{
- dday_state *state = machine->driver_data<dday_state>();
+ dday_state *state = machine.driver_data<dday_state>();
state->control = 0;
state->sl_enable = 0;
diff --git a/src/mame/drivers/ddayjlc.c b/src/mame/drivers/ddayjlc.c
index 6d20860c514..568a574f2c2 100644
--- a/src/mame/drivers/ddayjlc.c
+++ b/src/mame/drivers/ddayjlc.c
@@ -130,25 +130,25 @@ static const UINT8 prot_data[0x10] =
static CUSTOM_INPUT( prot_r )
{
- ddayjlc_state *state = field->port->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = field->port->machine().driver_data<ddayjlc_state>();
return prot_data[state->prot_addr];
}
static WRITE8_HANDLER( prot_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->prot_addr = (state->prot_addr & (~(1 << offset))) | ((data & 1) << offset);
}
static WRITE8_HANDLER( char_bank_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->char_bank = data;
}
static WRITE8_HANDLER( ddayjlc_bgram_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
if (!offset)
tilemap_set_scrollx(state->bg_tilemap, 0, data + 8);
@@ -159,49 +159,49 @@ static WRITE8_HANDLER( ddayjlc_bgram_w )
static WRITE8_HANDLER( ddayjlc_videoram_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->videoram[offset] = data;
}
static WRITE8_HANDLER(sound_nmi_w)
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->sound_nmi_enable = data;
}
static WRITE8_HANDLER(main_nmi_w)
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->main_nmi_enable = data;
}
static WRITE8_HANDLER( bg0_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->bgadr = (state->bgadr & 0xfe) | (data & 1);
}
static WRITE8_HANDLER( bg1_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->bgadr = (state->bgadr & 0xfd) | ((data & 1) << 1);
}
static WRITE8_HANDLER( bg2_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->bgadr = (state->bgadr & 0xfb) | ((data & 1) << 2);
if (state->bgadr > 2)
state->bgadr = 0;
- memory_set_bank(space->machine, "bank1", state->bgadr);
+ memory_set_bank(space->machine(), "bank1", state->bgadr);
}
static WRITE8_HANDLER( sound_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
soundlatch_w(space, offset, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
@@ -209,7 +209,7 @@ static WRITE8_HANDLER( sound_w )
static WRITE8_HANDLER( i8257_CH0_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
state->e00x_d[offset][state->e00x_l[offset]] = data;
state->e00x_l[offset] ^= 1;
@@ -217,7 +217,7 @@ static WRITE8_HANDLER( i8257_CH0_w )
static WRITE8_HANDLER( i8257_LMSR_w )
{
- ddayjlc_state *state = space->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = space->machine().driver_data<ddayjlc_state>();
if (!data)
{
@@ -366,7 +366,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_tile_info_bg )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
int code = state->bgram[tile_index] + ((state->bgram[tile_index + 0x400] & 0x08) << 5);
int color = (state->bgram[tile_index + 0x400] & 0x7);
color |= (state->bgram[tile_index + 0x400] & 0x40) >> 3;
@@ -376,13 +376,13 @@ static TILE_GET_INFO( get_tile_info_bg )
static VIDEO_START( ddayjlc )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info_bg, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( ddayjlc )
{
- ddayjlc_state *state = screen->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = screen->machine().driver_data<ddayjlc_state>();
UINT32 i;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -398,7 +398,7 @@ static SCREEN_UPDATE( ddayjlc )
code = (code & 0x7f) | ((flags & 0x30) << 3);
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], code, color, xflip, yflip, x, y, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], code, color, xflip, yflip, x, y, 0);
}
{
@@ -409,9 +409,9 @@ static SCREEN_UPDATE( ddayjlc )
{
c = state->videoram[y * 32 + x];
if (x > 1 && x < 30)
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8, 0);
else
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], c + state->char_bank * 0x100, 2, 0, 0, x*8, y*8);
}
}
return 0;
@@ -429,14 +429,14 @@ static const ay8910_interface ay8910_config =
static INTERRUPT_GEN( ddayjlc_interrupt )
{
- ddayjlc_state *state = device->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = device->machine().driver_data<ddayjlc_state>();
if(state->main_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static INTERRUPT_GEN( ddayjlc_snd_interrupt )
{
- ddayjlc_state *state = device->machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = device->machine().driver_data<ddayjlc_state>();
if(state->sound_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -444,9 +444,9 @@ static INTERRUPT_GEN( ddayjlc_snd_interrupt )
static MACHINE_START( ddayjlc )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->char_bank));
state->save_item(NAME(state->bgadr));
@@ -463,7 +463,7 @@ static MACHINE_START( ddayjlc )
static MACHINE_RESET( ddayjlc )
{
- ddayjlc_state *state = machine->driver_data<ddayjlc_state>();
+ ddayjlc_state *state = machine.driver_data<ddayjlc_state>();
int i;
state->char_bank = 0;
@@ -671,8 +671,8 @@ static DRIVER_INIT( ddayjlc )
UINT8 *src, *dst, *temp;
temp = auto_alloc_array(machine, UINT8, 0x10000);
src = temp;
- dst = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ dst = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
memcpy(src, dst, length);
newadr = 0;
oldaddr = 0;
@@ -686,7 +686,7 @@ static DRIVER_INIT( ddayjlc )
auto_free(machine, temp);
}
- memory_configure_bank(machine, "bank1", 0, 3, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 3, machine.region("user1")->base(), 0x4000);
memory_set_bank(machine, "bank1", 0);
}
diff --git a/src/mame/drivers/ddealer.c b/src/mame/drivers/ddealer.c
index 5bc0eecb8d3..882bf8d8c3c 100644
--- a/src/mame/drivers/ddealer.c
+++ b/src/mame/drivers/ddealer.c
@@ -144,13 +144,13 @@ public:
static WRITE16_HANDLER( ddealer_flipscreen_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
state->flipscreen = data & 0x01;
}
static TILE_GET_INFO( get_back_tile_info )
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
int code = state->back_vram[tile_index];
SET_TILE_INFO(
0,
@@ -161,14 +161,14 @@ static TILE_GET_INFO( get_back_tile_info )
static VIDEO_START( ddealer )
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
state->flipscreen = 0;
state->back_tilemap = tilemap_create(machine, get_back_tile_info, tilemap_scan_cols, 8, 8, 64, 32);
}
-static void ddealer_draw_video_layer( running_machine *machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle *cliprect, int flipy)
+static void ddealer_draw_video_layer( running_machine &machine, UINT16* vreg_base, UINT16* top, UINT16* bottom, bitmap_t* bitmap, const rectangle *cliprect, int flipy)
{
- const gfx_element *gfx = machine->gfx[1];
+ const gfx_element *gfx = machine.gfx[1];
INT16 sx, sy;
int x,y, count;
@@ -251,7 +251,7 @@ static void ddealer_draw_video_layer( running_machine *machine, UINT16* vreg_bas
static SCREEN_UPDATE( ddealer )
{
- ddealer_state *state = screen->machine->driver_data<ddealer_state>();
+ ddealer_state *state = screen->machine().driver_data<ddealer_state>();
tilemap_set_scrollx(state->back_tilemap, 0, state->flipscreen ? -192 : -64);
tilemap_set_flip(state->back_tilemap, state->flipscreen ? TILEMAP_FLIPY | TILEMAP_FLIPX : 0);
tilemap_draw(bitmap, cliprect, state->back_tilemap, 0, 0);
@@ -266,24 +266,24 @@ static SCREEN_UPDATE( ddealer )
{
if (state->vregs[0xcc / 2] & 0x80)
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
- ddealer_draw_video_layer(screen->machine, &state->vregs[0xcc / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0xcc / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
else
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
}
else
{
if (state->vregs[0xcc / 2] & 0x80)
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0xcc / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0xcc / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->right_fg_vram_top, state->right_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
else
{
- ddealer_draw_video_layer(screen->machine, &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
+ ddealer_draw_video_layer(screen->machine(), &state->vregs[0x1e0 / 2], state->left_fg_vram_top, state->left_fg_vram_bottom, bitmap, cliprect, state->flipscreen);
}
}
@@ -293,11 +293,11 @@ static SCREEN_UPDATE( ddealer )
static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
{
- ddealer_state *state = timer.machine->driver_data<ddealer_state>();
+ ddealer_state *state = timer.machine().driver_data<ddealer_state>();
/*coin/credit simulation*/
/*$fe002 is used,might be for multiple coins for one credit settings.*/
- state->coin_input = (~(input_port_read(timer.machine, "IN0")));
+ state->coin_input = (~(input_port_read(timer.machine(), "IN0")));
if (state->coin_input & 0x01)//coin 1
{
@@ -350,17 +350,17 @@ static TIMER_DEVICE_CALLBACK( ddealer_mcu_sim )
}
/*random number generators,controls order of cards*/
- state->mcu_shared_ram[0x10 / 2] = timer.machine->rand() & 0xffff;
- state->mcu_shared_ram[0x12 / 2] = timer.machine->rand() & 0xffff;
- state->mcu_shared_ram[0x14 / 2] = timer.machine->rand() & 0xffff;
- state->mcu_shared_ram[0x16 / 2] = timer.machine->rand() & 0xffff;
+ state->mcu_shared_ram[0x10 / 2] = timer.machine().rand() & 0xffff;
+ state->mcu_shared_ram[0x12 / 2] = timer.machine().rand() & 0xffff;
+ state->mcu_shared_ram[0x14 / 2] = timer.machine().rand() & 0xffff;
+ state->mcu_shared_ram[0x16 / 2] = timer.machine().rand() & 0xffff;
}
static WRITE16_HANDLER( back_vram_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
COMBINE_DATA(&state->back_vram[offset]);
tilemap_mark_tile_dirty(state->back_tilemap, offset);
}
@@ -368,7 +368,7 @@ static WRITE16_HANDLER( back_vram_w )
static WRITE16_HANDLER( ddealer_vregs_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
COMBINE_DATA(&state->vregs[offset]);
}
@@ -396,7 +396,7 @@ Protection handling,identical to Hacha Mecha Fighter / Thunder Dragon with diffe
static WRITE16_HANDLER( ddealer_mcu_shared_w )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
COMBINE_DATA(&state->mcu_shared_ram[offset]);
switch(offset)
@@ -590,7 +590,7 @@ GFXDECODE_END
static MACHINE_START( ddealer )
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
state->save_item(NAME(state->respcount));
state->save_item(NAME(state->flipscreen));
@@ -600,7 +600,7 @@ static MACHINE_START( ddealer )
static MACHINE_RESET (ddealer)
{
- ddealer_state *state = machine->driver_data<ddealer_state>();
+ ddealer_state *state = machine.driver_data<ddealer_state>();
state->respcount = 0;
state->flipscreen = 0;
@@ -650,7 +650,7 @@ MACHINE_CONFIG_END
static READ16_HANDLER( ddealer_mcu_r )
{
- ddealer_state *state = space->machine->driver_data<ddealer_state>();
+ ddealer_state *state = space->machine().driver_data<ddealer_state>();
static const int resp[] =
{
0x93, 0xc7, 0x00, 0x8000,
@@ -671,7 +671,7 @@ static READ16_HANDLER( ddealer_mcu_r )
static DRIVER_INIT( ddealer )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe01c, 0xfe01d, FUNC(ddealer_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfe01c, 0xfe01d, FUNC(ddealer_mcu_r) );
}
ROM_START( ddealer )
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index c052a7466c1..98773504c81 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -139,7 +139,7 @@ static const int mjflove_commands[8] = { BLIT_STOP, BLIT_CHANGE_PEN, BLIT_CHANGE
VIDEO_START( ddenlovr )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int i;
for (i = 0; i < 8; i++)
@@ -237,7 +237,7 @@ VIDEO_START( ddenlovr )
static VIDEO_START( mmpanic )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(ddenlovr);
@@ -246,7 +246,7 @@ static VIDEO_START( mmpanic )
static VIDEO_START( hanakanz )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(ddenlovr);
@@ -256,7 +256,7 @@ static VIDEO_START( hanakanz )
static VIDEO_START( mjflove )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
VIDEO_START_CALL(ddenlovr);
@@ -268,9 +268,9 @@ static void ddenlovr_flipscreen_w( UINT8 data )
logerror("flipscreen = %02x (%s)\n", data, (data & 1) ? "off" : "on");
}
-static void ddenlovr_blit_flip_w( running_machine *machine, UINT8 data )
+static void ddenlovr_blit_flip_w( running_machine &machine, UINT8 data )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
if ((data ^ state->ddenlovr_blit_flip) & 0xec)
{
@@ -285,13 +285,13 @@ static void ddenlovr_blit_flip_w( running_machine *machine, UINT8 data )
WRITE8_HANDLER( ddenlovr_bgcolor_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_bgcolor = data;
}
static WRITE8_HANDLER( ddenlovr_bgcolor2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_bgcolor2 = data;
}
@@ -304,13 +304,13 @@ static WRITE16_HANDLER( ddenlovr16_bgcolor_w )
WRITE8_HANDLER( ddenlovr_priority_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_priority = data;
}
static WRITE8_HANDLER( ddenlovr_priority2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_priority2 = data;
}
@@ -323,13 +323,13 @@ static WRITE16_HANDLER( ddenlovr16_priority_w )
WRITE8_HANDLER( ddenlovr_layer_enable_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_layer_enable = data;
}
static WRITE8_HANDLER( ddenlovr_layer_enable2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_layer_enable2 = data;
}
@@ -342,9 +342,9 @@ static WRITE16_HANDLER( ddenlovr16_layer_enable_w )
-static void do_plot( running_machine *machine, int x, int y, int pen )
+static void do_plot( running_machine &machine, int x, int y, int pen )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int addr, temp;
int xclip, yclip;
@@ -433,11 +433,11 @@ INLINE void log_draw_error( int src, int cmd )
06 blit_pen_mode (replace values stored in ROM)
*/
-static int blit_draw( running_machine *machine, int src, int sx )
+static int blit_draw( running_machine &machine, int src, int sx )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *src_data = machine->region("blitter")->base();
- int src_len = machine->region("blitter")->bytes();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *src_data = machine.region("blitter")->base();
+ int src_len = machine.region("blitter")->bytes();
int bit_addr = (src & 0xffffff) * state->ddenlovr_blit_rom_bits; /* convert to bit address */
int pen_size, arg_size, cmd;
int x;
@@ -528,9 +528,9 @@ static int blit_draw( running_machine *machine, int src, int sx )
/* Draw a simple rectangle
*/
-static void blit_rect_xywh( running_machine *machine )
+static void blit_rect_xywh( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int x, y;
#ifdef MAME_DEBUG
@@ -555,9 +555,9 @@ static void blit_rect_xywh( running_machine *machine )
04 blit_pen
0c line_length - always 0?
*/
-static void blit_rect_yh( running_machine *machine )
+static void blit_rect_yh( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int start = 512 * state->ddenlovr_blit_y;
int length = 512 * (state->ddenlovr_rect_height + 1);
@@ -595,9 +595,9 @@ static void blit_rect_yh( running_machine *machine )
02 Y
04 blit_pen
*/
-static void blit_fill_xy( running_machine *machine, int x, int y )
+static void blit_fill_xy( running_machine &machine, int x, int y )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int start = 512 * y + x;
#ifdef MAME_DEBUG
@@ -630,9 +630,9 @@ static void blit_fill_xy( running_machine *machine, int x, int y )
04 blit_pen
ddenlovr_blit_x and ddenlovr_blit_y are left pointing to the last pixel at the end of the command
*/
-static void blit_horiz_line( running_machine *machine )
+static void blit_horiz_line( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int i;
#ifdef MAME_DEBUG
@@ -661,9 +661,9 @@ static void blit_horiz_line( running_machine *machine )
04 blit_pen
ddenlovr_blit_x and ddenlovr_blit_y are left pointing to the last pixel at the end of the command
*/
-static void blit_vert_line( running_machine *machine )
+static void blit_vert_line( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int i;
#ifdef MAME_DEBUG
@@ -680,13 +680,13 @@ static void blit_vert_line( running_machine *machine )
-INLINE void log_blit( running_machine *machine, int data )
+INLINE void log_blit( running_machine &machine, int data )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
#if 1
logerror("%s: blit src %06x x %03x y %03x flags %02x layer %02x pen %02x penmode %02x w %03x h %03x linelen %03x flip %02x clip: ctrl %x xy %03x %03x wh %03x %03x\n",
- machine->describe_context(),
+ machine.describe_context(),
state->ddenlovr_blit_address, state->ddenlovr_blit_x, state->ddenlovr_blit_y, data,
state->ddenlovr_dest_layer, state->ddenlovr_blit_pen, state->ddenlovr_blit_pen_mode, state->ddenlovr_rect_width, state->ddenlovr_rect_height, state->ddenlovr_line_length, state->ddenlovr_blit_flip,
state->ddenlovr_clip_ctrl, state->ddenlovr_clip_x, state->ddenlovr_clip_y, state->ddenlovr_clip_width, state->ddenlovr_clip_height);
@@ -695,7 +695,7 @@ INLINE void log_blit( running_machine *machine, int data )
static void blitter_w( address_space *space, int blitter, offs_t offset, UINT8 data, int irq_vector )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -725,7 +725,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
case 0x03:
- ddenlovr_blit_flip_w(space->machine, data);
+ ddenlovr_blit_flip_w(space->machine(), data);
break;
case 0x04:
@@ -794,31 +794,31 @@ g_profiler.start(PROFILER_VIDEO);
case 0x24:
- log_blit(space->machine, data);
+ log_blit(space->machine(), data);
switch (data)
{
- case 0x04: blit_fill_xy(space->machine, 0, 0);
+ case 0x04: blit_fill_xy(space->machine(), 0, 0);
break;
- case 0x14: blit_fill_xy(space->machine, state->ddenlovr_blit_x, state->ddenlovr_blit_y);
+ case 0x14: blit_fill_xy(space->machine(), state->ddenlovr_blit_x, state->ddenlovr_blit_y);
break;
- case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine, state->ddenlovr_blit_address, state->ddenlovr_blit_x);
+ case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine(), state->ddenlovr_blit_address, state->ddenlovr_blit_x);
break;
- case 0x13: blit_horiz_line(space->machine);
+ case 0x13: blit_horiz_line(space->machine());
break;
- case 0x1b: blit_vert_line(space->machine);
+ case 0x1b: blit_vert_line(space->machine());
break;
- case 0x1c: blit_rect_xywh(space->machine);
+ case 0x1c: blit_rect_xywh(space->machine());
break;
// These two are issued one after the other (43 then 8c)
// 8c is issued immediately after 43 has finished, without
// changing any argument
case 0x43: break;
- case 0x8c: blit_rect_yh(space->machine);
+ case 0x8c: blit_rect_yh(space->machine());
break;
default:
@@ -856,9 +856,9 @@ g_profiler.stop();
// differences wrt blitter_data_w: slightly different blitter commands
-static void blitter_w_funkyfig( running_machine *machine, int blitter, offs_t offset, UINT8 data, int irq_vector )
+static void blitter_w_funkyfig( running_machine &machine, int blitter, offs_t offset, UINT8 data, int irq_vector )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -994,7 +994,7 @@ g_profiler.start(PROFILER_VIDEO);
;
#ifdef MAME_DEBUG
popmessage("unknown blitter command %02x", data);
- logerror("%s: unknown blitter command %02x\n", machine->describe_context(), data);
+ logerror("%s: unknown blitter command %02x\n", machine.describe_context(), data);
#endif
}
@@ -1002,7 +1002,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
default:
- logerror("%s: Blitter %d reg %02x = %02x\n", machine->describe_context(), blitter, state->ddenlovr_blit_regs[blitter], data);
+ logerror("%s: Blitter %d reg %02x = %02x\n", machine.describe_context(), blitter, state->ddenlovr_blit_regs[blitter], data);
break;
}
}
@@ -1015,14 +1015,14 @@ g_profiler.stop();
static WRITE8_HANDLER( hanakanz_blitter_reg_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_blit_latch = data;
}
// differences wrt blitter_data_w: registers are shuffled around, hi_bits in the low bits, clip_w/h, includes layers registers
static WRITE8_HANDLER( hanakanz_blitter_data_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int hi_bits;
g_profiler.start(PROFILER_VIDEO);
@@ -1044,7 +1044,7 @@ g_profiler.start(PROFILER_VIDEO);
break;
case 0x0c:
- ddenlovr_blit_flip_w(space->machine, data);
+ ddenlovr_blit_flip_w(space->machine(), data);
break;
case 0x10:
@@ -1163,31 +1163,31 @@ g_profiler.start(PROFILER_VIDEO);
case 0x90:
- log_blit(space->machine, data);
+ log_blit(space->machine(), data);
switch (data)
{
- case 0x04: blit_fill_xy(space->machine, 0, 0);
+ case 0x04: blit_fill_xy(space->machine(), 0, 0);
break;
- case 0x14: blit_fill_xy(space->machine, state->ddenlovr_blit_x, state->ddenlovr_blit_y);
+ case 0x14: blit_fill_xy(space->machine(), state->ddenlovr_blit_x, state->ddenlovr_blit_y);
break;
- case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine, state->ddenlovr_blit_address, state->ddenlovr_blit_x);
+ case 0x10: state->ddenlovr_blit_address = blit_draw(space->machine(), state->ddenlovr_blit_address, state->ddenlovr_blit_x);
break;
- case 0x13: blit_horiz_line(space->machine);
+ case 0x13: blit_horiz_line(space->machine());
break;
- case 0x1b: blit_vert_line(space->machine);
+ case 0x1b: blit_vert_line(space->machine());
break;
- case 0x1c: blit_rect_xywh(space->machine);
+ case 0x1c: blit_rect_xywh(space->machine());
break;
// These two are issued one after the other (43 then 8c)
// 8c is issued immediately after 43 has finished, without
// changing any argument
case 0x43: break;
- case 0x8c: blit_rect_yh(space->machine);
+ case 0x8c: blit_rect_yh(space->machine());
break;
default:
@@ -1225,7 +1225,7 @@ static WRITE16_HANDLER( ddenlovr_blitter_w )
static WRITE16_HANDLER( ddenlovr_blitter_irq_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1244,9 +1244,9 @@ static WRITE16_HANDLER( ddenlovr_blitter_irq_ack_w )
static READ8_HANDLER( rongrong_gfxrom_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("blitter")->base();
- size_t size = space->machine->region("blitter")->bytes();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("blitter")->base();
+ size_t size = space->machine().region("blitter")->bytes();
int address = state->ddenlovr_blit_address;
if (address >= size)
@@ -1266,9 +1266,9 @@ static READ16_HANDLER( ddenlovr_gfxrom_r )
}
-static void copylayer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void copylayer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int x,y;
int scrollx = state->ddenlovr_scroll[layer / 4 * 8 + (layer % 4) + 0];
int scrolly = state->ddenlovr_scroll[layer / 4 * 8 + (layer % 4) + 4];
@@ -1302,7 +1302,7 @@ static void copylayer(running_machine *machine, bitmap_t *bitmap, const rectangl
SCREEN_UPDATE(ddenlovr)
{
- dynax_state *state = screen->machine->driver_data<dynax_state>();
+ dynax_state *state = screen->machine().driver_data<dynax_state>();
static const int order[24][4] =
{
@@ -1319,7 +1319,7 @@ SCREEN_UPDATE(ddenlovr)
#if 0
static int base = 0x0;
- const UINT8 *gfx = screen->machine->region("blitter")->base();
+ const UINT8 *gfx = screen->machine().region("blitter")->base();
int next;
memset(state->ddenlovr_pixmap[0], 0, 512 * 512);
memset(state->ddenlovr_pixmap[1], 0, 512 * 512);
@@ -1330,38 +1330,38 @@ SCREEN_UPDATE(ddenlovr)
state->ddenlovr_blit_pen_mode = 0;
state->ddenlovr_blit_y = 5;
state->ddenlovr_clip_ctrl = 0x0f;
- next = blit_draw(screen->machine, base, 0);
+ next = blit_draw(screen->machine(), base, 0);
popmessage("GFX %06x", base);
- if (input_code_pressed(screen->machine, KEYCODE_S)) base = next;
- if (input_code_pressed_once(screen->machine, KEYCODE_X)) base = next;
- if (input_code_pressed(screen->machine, KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
- if (input_code_pressed(screen->machine, KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
- if (input_code_pressed_once(screen->machine, KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
- if (input_code_pressed_once(screen->machine, KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) base = next;
+ if (input_code_pressed_once(screen->machine(), KEYCODE_X)) base = next;
+ if (input_code_pressed(screen->machine(), KEYCODE_C)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
+ if (input_code_pressed(screen->machine(), KEYCODE_V)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_D)) { base--; while ((gfx[base] & 0xf0) != 0x30) base--; }
+ if (input_code_pressed_once(screen->machine(), KEYCODE_F)) { base++; while ((gfx[base] & 0xf0) != 0x30) base++; }
#endif
bitmap_fill(bitmap, cliprect, state->ddenlovr_bgcolor);
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask, mask2;
mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) mask |= 8;
mask2 = 0;
if (state->extra_layers)
{
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask2 |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_S)) mask2 |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_D)) mask2 |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_F)) mask2 |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask2 |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) mask2 |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) mask2 |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) mask2 |= 8;
}
if (mask || mask2)
@@ -1380,10 +1380,10 @@ SCREEN_UPDATE(ddenlovr)
pri = 0;
}
- copylayer(screen->machine, bitmap, cliprect, order[pri][0]);
- copylayer(screen->machine, bitmap, cliprect, order[pri][1]);
- copylayer(screen->machine, bitmap, cliprect, order[pri][2]);
- copylayer(screen->machine, bitmap, cliprect, order[pri][3]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][0]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][1]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][2]);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][3]);
if (state->extra_layers)
{
@@ -1395,10 +1395,10 @@ SCREEN_UPDATE(ddenlovr)
pri = 0;
}
- copylayer(screen->machine, bitmap, cliprect, order[pri][0] + 4);
- copylayer(screen->machine, bitmap, cliprect, order[pri][1] + 4);
- copylayer(screen->machine, bitmap, cliprect, order[pri][2] + 4);
- copylayer(screen->machine, bitmap, cliprect, order[pri][3] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][0] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][1] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][2] + 4);
+ copylayer(screen->machine(), bitmap, cliprect, order[pri][3] + 4);
}
state->ddenlovr_layer_enable = enab;
@@ -1409,25 +1409,25 @@ SCREEN_UPDATE(ddenlovr)
static CUSTOM_INPUT( ddenlovr_special_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag;
}
static WRITE16_HANDLER( ddenlovr_coincounter_0_w )
{
if (ACCESSING_BITS_0_7)
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
static WRITE16_HANDLER( ddenlovr_coincounter_1_w )
{
if (ACCESSING_BITS_0_7)
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 1, data & 1);
}
static WRITE8_HANDLER( rongrong_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int r, g, b, d1, d2, indx;
state->palram[offset] = data;
@@ -1441,7 +1441,7 @@ static WRITE8_HANDLER( rongrong_palette_w )
/* what were they smoking??? */
b = ((d1 & 0xe0) >> 5) | (d2 & 0xc0) >> 3;
- palette_set_color_rgb(space->machine, indx, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), indx, pal5bit(r), pal5bit(g), pal5bit(b));
}
static WRITE16_HANDLER( ddenlovr_palette_w )
@@ -1453,58 +1453,58 @@ static WRITE16_HANDLER( ddenlovr_palette_w )
WRITE8_HANDLER( ddenlovr_palette_base_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_base[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_palette_base2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_base[offset + 4] = data;
}
WRITE8_HANDLER( ddenlovr_palette_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_mask[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_palette_mask2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_palette_mask[offset + 4] = data;
}
WRITE8_HANDLER( ddenlovr_transparency_pen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_pen[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_transparency_pen2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_pen[offset + 4] = data;
}
WRITE8_HANDLER( ddenlovr_transparency_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_mask[offset] = data;
}
static WRITE8_HANDLER( ddenlovr_transparency_mask2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->ddenlovr_transparency_mask[offset + 4] = data;
}
static WRITE16_HANDLER( ddenlovr16_palette_base_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_palette_base[offset] = data & 0xff;
@@ -1512,7 +1512,7 @@ static WRITE16_HANDLER( ddenlovr16_palette_base_w )
static WRITE16_HANDLER( ddenlovr16_palette_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_palette_mask[offset] = data & 0xff;
@@ -1520,7 +1520,7 @@ static WRITE16_HANDLER( ddenlovr16_palette_mask_w )
static WRITE16_HANDLER( ddenlovr16_transparency_pen_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_transparency_pen[offset] = data & 0xff;
@@ -1528,7 +1528,7 @@ static WRITE16_HANDLER( ddenlovr16_transparency_pen_w )
static WRITE16_HANDLER( ddenlovr16_transparency_mask_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->ddenlovr_transparency_mask[offset] = data & 0xff;
@@ -1554,7 +1554,7 @@ static WRITE16_DEVICE_HANDLER( ddenlovr_oki_bank_w )
static WRITE16_DEVICE_HANDLER( quiz365_oki_bank1_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1566,7 +1566,7 @@ static WRITE16_DEVICE_HANDLER( quiz365_oki_bank1_w )
static WRITE16_DEVICE_HANDLER( quiz365_oki_bank2_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@@ -1591,13 +1591,13 @@ static READ16_HANDLER( unk16_r )
static WRITE8_DEVICE_HANDLER( ddenlovr_select_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static WRITE16_HANDLER( ddenlovr_select_16_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->dsw_sel = data;
@@ -1605,13 +1605,13 @@ static WRITE16_HANDLER( ddenlovr_select_16_w )
static WRITE8_HANDLER( ddenlovr_select2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
}
static WRITE16_HANDLER( ddenlovr_select2_16_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
state->input_sel = data;
@@ -1619,15 +1619,15 @@ static WRITE16_HANDLER( ddenlovr_select2_16_w )
static READ8_HANDLER( rongrong_input2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
// logerror("%04x: input2_r offset %d select %x\n", cpu_get_pc(space->cpu), offset, state->input_sel);
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "P1");
- case 0x01: return input_port_read(space->machine, "P2");
- case 0x02: return input_port_read(space->machine, "SYSTEM");
+ case 0x00: return input_port_read(space->machine(), "P1");
+ case 0x01: return input_port_read(space->machine(), "P2");
+ case 0x02: return input_port_read(space->machine(), "SYSTEM");
}
return 0xff;
}
@@ -1635,27 +1635,27 @@ static READ8_HANDLER( rongrong_input2_r )
static READ8_DEVICE_HANDLER( quiz365_input_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 3)) return 0xff;//device->machine->rand();
- if (!BIT(state->dsw_sel, 4)) return 0xff;//device->machine->rand();
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 3)) return 0xff;//device->machine().rand();
+ if (!BIT(state->dsw_sel, 4)) return 0xff;//device->machine().rand();
return 0xff;
}
static READ16_HANDLER( quiz365_input2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
// logerror("%04x: input2_r offset %d select %x\n",cpu_get_pc(space->cpu), offset, state->input_sel);
/* 0 and 1 are read from offset 1, 2 from offset 0... */
switch (state->input_sel)
{
- case 0x10: return input_port_read(space->machine, "P1");
- case 0x11: return input_port_read(space->machine, "P2");
- case 0x12: return input_port_read(space->machine, "SYSTEM");
+ case 0x10: return input_port_read(space->machine(), "P1");
+ case 0x11: return input_port_read(space->machine(), "P2");
+ case 0x12: return input_port_read(space->machine(), "SYSTEM");
}
return 0xff;
}
@@ -1663,7 +1663,7 @@ static READ16_HANDLER( quiz365_input2_r )
static WRITE8_HANDLER( rongrong_blitter_busy_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rongrong_blitter_busy_select = data;
if (data != 0x18)
@@ -1672,7 +1672,7 @@ static WRITE8_HANDLER( rongrong_blitter_busy_w )
static READ8_HANDLER( rongrong_blitter_busy_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->rongrong_blitter_busy_select)
{
@@ -1687,14 +1687,14 @@ static READ8_HANDLER( rongrong_blitter_busy_r )
static WRITE16_HANDLER( quiz365_coincounter_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
if (state->input_sel == 0x1c)
{
- coin_counter_w(space->machine, 0, ~data & 1);
- coin_counter_w(space->machine, 1, ~data & 4);
+ coin_counter_w(space->machine(), 0, ~data & 1);
+ coin_counter_w(space->machine(), 1, ~data & 4);
}
}
}
@@ -1705,7 +1705,7 @@ static WRITE16_HANDLER( quiz365_coincounter_w )
*/
static READ16_HANDLER( quiz365_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->quiz365_protection[0])
{
@@ -1718,7 +1718,7 @@ static READ16_HANDLER( quiz365_protection_r )
static WRITE16_HANDLER( quiz365_protection_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
COMBINE_DATA(state->quiz365_protection + offset);
}
@@ -1761,11 +1761,11 @@ ADDRESS_MAP_END
static READ16_HANDLER( ddenlovj_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT16 dsw = 0;
- if ((~*state->dsw_sel16) & 0x01) dsw |= input_port_read(space->machine, "DSW1");
- if ((~*state->dsw_sel16) & 0x02) dsw |= input_port_read(space->machine, "DSW2");
- if ((~*state->dsw_sel16) & 0x04) dsw |= input_port_read(space->machine, "DSW3");
+ if ((~*state->dsw_sel16) & 0x01) dsw |= input_port_read(space->machine(), "DSW1");
+ if ((~*state->dsw_sel16) & 0x02) dsw |= input_port_read(space->machine(), "DSW2");
+ if ((~*state->dsw_sel16) & 0x04) dsw |= input_port_read(space->machine(), "DSW3");
return dsw;
}
@@ -1773,15 +1773,15 @@ static WRITE16_HANDLER( ddenlovj_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x04);
// data & 0x80 ?
}
}
static CUSTOM_INPUT( ddenlovj_blitter_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag ? 0x03 : 0x00; // bit 4 = 1 -> blitter busy
}
@@ -1819,7 +1819,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( ddenlovrk_protection1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (*state->protection1)
{
case 0x007e: return 0x00aa;
@@ -1829,7 +1829,7 @@ static READ16_HANDLER( ddenlovrk_protection1_r )
static READ16_HANDLER( ddenlovrk_protection2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (*state->protection1)
{
case 0x0000: return *state->protection2;
@@ -1838,7 +1838,7 @@ static READ16_HANDLER( ddenlovrk_protection2_r )
}
static WRITE16_HANDLER( ddenlovrk_protection2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
COMBINE_DATA(state->protection2);
state->oki->set_bank_base(((*state->protection2) & 0x7) * 0x40000);
@@ -1921,17 +1921,17 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( nettoqc_special_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag ? 0x03 : 0x00;
}
static READ16_HANDLER( nettoqc_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW3");
return 0xffff;
}
@@ -1944,7 +1944,7 @@ static READ16_HANDLER( nettoqc_input_r )
static READ16_HANDLER( nettoqc_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->protection1[0] & 0xff)
{
@@ -1957,8 +1957,8 @@ static WRITE16_HANDLER( nettoqc_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x04);
// data & 0x80 ?
}
}
@@ -2012,28 +2012,28 @@ ADDRESS_MAP_END
static READ8_HANDLER( rongrong_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return 0xff;//space->machine->rand();
- if (!BIT(state->dsw_sel, 3)) return 0xff;//space->machine->rand();
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return 0xff;//space->machine().rand();
+ if (!BIT(state->dsw_sel, 3)) return 0xff;//space->machine().rand();
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW3");
return 0xff;
}
static WRITE8_HANDLER( rongrong_select_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
//logerror("%04x: rongrong_select_w %02x\n",cpu_get_pc(space->cpu),data);
/* bits 0-4 = **both** ROM bank **AND** input select */
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
state->dsw_sel = data;
/* bits 5-7 = RAM bank */
- memory_set_bank(space->machine, "bank2", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank2", ((data & 0xe0) >> 5));
}
@@ -2127,13 +2127,13 @@ static READ8_HANDLER( magic_r )
static WRITE8_HANDLER( mmpanic_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x7);
+ memory_set_bank(space->machine(), "bank1", data & 0x7);
/* Bit 4? */
}
static WRITE8_HANDLER( mmpanic_soundlatch_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->soundcpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -2148,37 +2148,37 @@ static WRITE8_HANDLER( mmpanic_blitter2_w )
blitter_w(space, 1, offset, data, 0xdf); // RST 18
}
-static void mmpanic_update_leds(running_machine *machine)
+static void mmpanic_update_leds(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
set_led_status(machine, 0, state->mmpanic_leds);
}
/* leds 1-8 */
static WRITE8_HANDLER( mmpanic_leds_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->mmpanic_leds = (state->mmpanic_leds & 0xff00) | data;
- mmpanic_update_leds(space->machine);
+ mmpanic_update_leds(space->machine());
}
/* led 9 */
static WRITE8_HANDLER( mmpanic_leds2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->mmpanic_leds = (state->mmpanic_leds & 0xfeff) | (data ? 0x0100 : 0);
- mmpanic_update_leds(space->machine);
+ mmpanic_update_leds(space->machine());
}
static WRITE8_HANDLER( mmpanic_lockout_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->dsw_sel == 0x0c)
{
- coin_counter_w(space->machine, 0, (~data) & 0x01);
- coin_lockout_w(space->machine, 0, (~data) & 0x02);
- set_led_status(space->machine, 1, (~data) & 0x04);
+ coin_counter_w(space->machine(), 0, (~data) & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x02);
+ set_led_status(space->machine(), 1, (~data) & 0x04);
}
}
@@ -2284,38 +2284,38 @@ static READ8_HANDLER( funkyfig_busy_r )
static WRITE8_HANDLER( funkyfig_blitter_w )
{
- blitter_w_funkyfig(space->machine, 0, offset, data, 0xe0);
+ blitter_w_funkyfig(space->machine(), 0, offset, data, 0xe0);
}
static WRITE8_HANDLER( funkyfig_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
// bit 4 selects palette ram at 8000?
- memory_set_bank(space->machine, "bank2", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank2", ((data & 0xe0) >> 5));
}
static READ8_HANDLER( funkyfig_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW3");
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(space->cpu), state->dsw_sel);
return 0xff;
}
static READ8_HANDLER( funkyfig_coin_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x22: return input_port_read(space->machine, "IN2");
+ case 0x22: return input_port_read(space->machine(), "IN2");
case 0x23: return state->funkyfig_lockout;
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
@@ -2324,12 +2324,12 @@ static READ8_HANDLER( funkyfig_coin_r )
static READ8_HANDLER( funkyfig_key_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x20: return input_port_read(space->machine, "IN0");
- case 0x21: return input_port_read(space->machine, "IN1");
+ case 0x20: return input_port_read(space->machine(), "IN0");
+ case 0x21: return input_port_read(space->machine(), "IN1");
}
logerror("%06x: warning, unknown bits read, ddenlovr_select2 = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
return 0xff;
@@ -2337,14 +2337,14 @@ static READ8_HANDLER( funkyfig_key_r )
static WRITE8_HANDLER( funkyfig_lockout_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
case 0x2c:
state->funkyfig_lockout = data;
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_lockout_w(space->machine, 0, (~data) & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x02);
if (data & ~0x03)
logerror("%06x: warning, unknown bits written, lockout = %02x\n", cpu_get_pc(space->cpu), data);
break;
@@ -2405,8 +2405,8 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hanakanz_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
- memory_set_bank(space->machine, "bank2", ((data & 0xf0) >> 4));
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank2", ((data & 0xf0) >> 4));
}
static ADDRESS_MAP_START( hanakanz_map, AS_PROGRAM, 8 )
@@ -2419,41 +2419,41 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hanakanz_keyb_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->keyb = data;
}
static WRITE8_HANDLER( hanakanz_dsw_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_HANDLER( hanakanz_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0xff;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
- val |= input_port_read(space->machine, offset ? "HOPPER" : "BET");
+ val |= input_port_read(space->machine(), offset ? "HOPPER" : "BET");
return val;
}
static READ8_HANDLER( hanakanz_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW3");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine, "DSW4");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW5");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine(), "DSW4");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW5");
return 0xff;
}
@@ -2464,9 +2464,9 @@ static READ8_HANDLER( hanakanz_busy_r )
static READ8_HANDLER( hanakanz_gfxrom_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("blitter")->base();
- size_t size = space->machine->region("blitter")->bytes();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("blitter")->base();
+ size_t size = space->machine().region("blitter")->bytes();
int address = (state->ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size)
@@ -2498,7 +2498,7 @@ static WRITE8_HANDLER( hanakanz_coincounter_w )
// bit 2 = 1 if bet on
// bit 3 = 1 if bet off
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (data & 0xf0)
logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -2510,7 +2510,7 @@ static WRITE8_HANDLER( hanakanz_coincounter_w )
static WRITE8_HANDLER( hanakanz_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->ddenlovr_blit_latch & 0x80)
{
@@ -2524,7 +2524,7 @@ static WRITE8_HANDLER( hanakanz_palette_w )
int g = state->ddenlovr_blit_latch & 0x1f;
int r = data & 0x1f;
int b = ((data & 0xe0) >> 5) | ((state->ddenlovr_blit_latch & 0x60) >> 2);
- palette_set_color_rgb(space->machine, (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -2536,7 +2536,7 @@ static WRITE8_DEVICE_HANDLER( hanakanz_oki_bank_w )
static READ8_HANDLER( hanakanz_rand_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( hanakanz_portmap, AS_IO, 8 )
@@ -2583,13 +2583,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjreach1_protection_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->prot_val = data;
}
static READ8_HANDLER( mjreach1_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->prot_val;
}
@@ -2621,16 +2621,16 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjchuuka_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0xff;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
- val |= input_port_read(space->machine, offset ? "HOPPER" : "BET");
+ val |= input_port_read(space->machine(), offset ? "HOPPER" : "BET");
if (offset)
val |= 0x80; // blitter busy
@@ -2644,16 +2644,16 @@ static WRITE8_HANDLER( mjchuuka_blitter_w )
hanakanz_blitter_data_w(space, 0, data);
}
-static void mjchuuka_get_romdata(running_machine *machine)
+static void mjchuuka_get_romdata(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *rom = machine->region("blitter")->base();
- size_t size = machine->region("blitter")->bytes();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *rom = machine.region("blitter")->base();
+ size_t size = machine.region("blitter")->bytes();
int address = (state->ddenlovr_blit_address & 0xffffff) * 2;
if (address >= size)
{
- logerror("%s: Error, Blitter address %06X out of range\n", machine->describe_context(), address);
+ logerror("%s: Error, Blitter address %06X out of range\n", machine.describe_context(), address);
address %= size;
}
@@ -2663,21 +2663,21 @@ static void mjchuuka_get_romdata(running_machine *machine)
static READ8_HANDLER( mjchuuka_gfxrom_0_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- mjchuuka_get_romdata(space->machine);
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ mjchuuka_get_romdata(space->machine());
state->ddenlovr_blit_address++;
return state->romdata[0];
}
static READ8_HANDLER( mjchuuka_gfxrom_1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->romdata[1];
}
static WRITE8_HANDLER( mjchuuka_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT16 rgb = (offset & 0xff00) | data;
if (rgb & 0x8000)
@@ -2692,7 +2692,7 @@ static WRITE8_HANDLER( mjchuuka_palette_w )
int r = (rgb >> 0) & 0x1f;
int g = (rgb >> 8) & 0x1f;
int b = ((rgb >> 5) & 0x07) | ((rgb & 0x6000) >> 10);
- palette_set_color_rgb(space->machine, (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), (state->palette_index++) & 0x1ff, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -2703,8 +2703,8 @@ static WRITE8_HANDLER( mjchuuka_coincounter_w )
// bit 3 = lockout
// bit 8?
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_lockout_w(space->machine, 0, (~data) & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x08);
if (data & 0x74)
logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -2764,13 +2764,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjmyster_rambank_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", data & 0x07);
//logerror("%04x: rambank = %02x\n", cpu_get_pc(space->cpu), data);
}
static WRITE8_HANDLER( mjmyster_select2_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
if (data & 0x80)
@@ -2779,11 +2779,11 @@ static WRITE8_HANDLER( mjmyster_select2_w )
static READ8_HANDLER( mjmyster_coins_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "SYSTEM");
+ case 0x00: return input_port_read(space->machine(), "SYSTEM");
case 0x01: return 0xff;
case 0x02: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x03: return 0xff;
@@ -2796,14 +2796,14 @@ static READ8_HANDLER( mjmyster_coins_r )
static READ8_HANDLER( mjmyster_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 ret = 0xff;
- if (BIT(state->keyb, 0)) ret = input_port_read(space->machine, "KEY0");
- else if (BIT(state->keyb, 1)) ret = input_port_read(space->machine, "KEY1");
- else if (BIT(state->keyb, 2)) ret = input_port_read(space->machine, "KEY2");
- else if (BIT(state->keyb, 3)) ret = input_port_read(space->machine, "KEY3");
- else if (BIT(state->keyb, 4)) ret = input_port_read(space->machine, "KEY4");
+ if (BIT(state->keyb, 0)) ret = input_port_read(space->machine(), "KEY0");
+ else if (BIT(state->keyb, 1)) ret = input_port_read(space->machine(), "KEY1");
+ else if (BIT(state->keyb, 2)) ret = input_port_read(space->machine(), "KEY2");
+ else if (BIT(state->keyb, 3)) ret = input_port_read(space->machine(), "KEY3");
+ else if (BIT(state->keyb, 4)) ret = input_port_read(space->machine(), "KEY4");
else logerror("%06x: warning, unknown bits read, keyb = %02x\n", cpu_get_pc(space->cpu), state->keyb);
state->keyb <<= 1;
@@ -2813,26 +2813,26 @@ static READ8_HANDLER( mjmyster_keyb_r )
static READ8_HANDLER( mjmyster_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW4");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW3");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW5");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW4");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(space->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW5");
logerror("%06x: warning, unknown bits read, ddenlovr_select = %02x\n", cpu_get_pc(space->cpu), state->dsw_sel);
return 0xff;
}
static WRITE8_HANDLER( mjmyster_coincounter_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
case 0x0c:
- coin_counter_w(space->machine, 0, (~data) & 0x01); // coin in
- coin_counter_w(space->machine, 0, (~data) & 0x02); // coin out actually
+ coin_counter_w(space->machine(), 0, (~data) & 0x01); // coin in
+ coin_counter_w(space->machine(), 0, (~data) & 0x02); // coin out actually
#ifdef MAME_DEBUG
// popmessage("cc: %02x",data);
#endif
@@ -2883,16 +2883,16 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hginga_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- memory_set_bank(space->machine, "bank1", data & 0x7);
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ memory_set_bank(space->machine(), "bank1", data & 0x7);
state->hginga_rombank = data;
}
// similar to rongrong
static READ8_HANDLER( hginga_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
if (state->hginga_rombank & 0x10)
return hanakanz_rand_r(space, 0);
@@ -2911,33 +2911,33 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( hginga_dsw_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW4");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW5");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW4");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine(), "DSW5");
- logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine->describe_context(), state->dsw_sel);
+ logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine().describe_context(), state->dsw_sel);
return 0xff;
}
static WRITE8_HANDLER( hginga_input_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
state->keyb = 0;
}
static READ8_HANDLER( hginga_coins_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x20: return input_port_read(space->machine, "SYSTEM");
- case 0x21: return input_port_read(space->machine, "BET");
+ case 0x20: return input_port_read(space->machine(), "SYSTEM");
+ case 0x21: return input_port_read(space->machine(), "BET");
case 0x22: return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
case 0x23: return state->coins;
}
@@ -2952,7 +2952,7 @@ static WRITE8_HANDLER( hginga_80_w )
static WRITE8_HANDLER( hginga_coins_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
@@ -2964,7 +2964,7 @@ static WRITE8_HANDLER( hginga_coins_w )
// bit 2 = 1 if bet on
// bit 3 = 1 if bet on
// bit 7?
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
#ifdef MAME_DEBUG
// popmessage("COINS %02x", data);
#endif
@@ -2977,7 +2977,7 @@ static WRITE8_HANDLER( hginga_coins_w )
static READ8_HANDLER( hginga_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
@@ -2988,11 +2988,11 @@ static READ8_HANDLER( hginga_input_r )
// player 1
case 0xa1:
- return input_port_read(space->machine, keynames0[state->keyb++]);
+ return input_port_read(space->machine(), keynames0[state->keyb++]);
// player 2
case 0xa2:
- return input_port_read(space->machine, keynames1[state->keyb++]);
+ return input_port_read(space->machine(), keynames1[state->keyb++]);
}
logerror("%04x: input_r with select = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
return 0xff;
@@ -3000,7 +3000,7 @@ static READ8_HANDLER( hginga_input_r )
static WRITE8_HANDLER( hginga_blitter_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (offset == 0)
{
state->ddenlovr_blit_latch = data;
@@ -3062,31 +3062,31 @@ ADDRESS_MAP_END
static UINT8 hgokou_player_r( address_space *space, int player )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 hopper_bit = ((state->hopper && !(space->machine->primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 hopper_bit = ((state->hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6));
- if (!BIT(state->input_sel, 0)) return input_port_read(space->machine, player ? "KEY5" : "KEY0") | hopper_bit;
- if (!BIT(state->input_sel, 1)) return input_port_read(space->machine, player ? "KEY6" : "KEY1") | hopper_bit;
- if (!BIT(state->input_sel, 2)) return input_port_read(space->machine, player ? "KEY7" : "KEY2") | hopper_bit;
- if (!BIT(state->input_sel, 3)) return input_port_read(space->machine, player ? "KEY8" : "KEY3") | hopper_bit;
- if (!BIT(state->input_sel, 4)) return input_port_read(space->machine, player ? "KEY9" : "KEY4") | hopper_bit;
+ if (!BIT(state->input_sel, 0)) return input_port_read(space->machine(), player ? "KEY5" : "KEY0") | hopper_bit;
+ if (!BIT(state->input_sel, 1)) return input_port_read(space->machine(), player ? "KEY6" : "KEY1") | hopper_bit;
+ if (!BIT(state->input_sel, 2)) return input_port_read(space->machine(), player ? "KEY7" : "KEY2") | hopper_bit;
+ if (!BIT(state->input_sel, 3)) return input_port_read(space->machine(), player ? "KEY8" : "KEY3") | hopper_bit;
+ if (!BIT(state->input_sel, 4)) return input_port_read(space->machine(), player ? "KEY9" : "KEY4") | hopper_bit;
return 0x7f; // bit 7 = blitter busy, bit 6 = hopper
}
static WRITE8_HANDLER( hgokou_dsw_sel_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_HANDLER( hgokou_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->dsw_sel)
{
- case 0x20: return input_port_read(space->machine, "SYSTEM");
+ case 0x20: return input_port_read(space->machine(), "SYSTEM");
case 0x21: return hgokou_player_r(space, 1);
case 0x22: return hgokou_player_r(space, 0);
case 0x23: return state->coins;
@@ -3097,7 +3097,7 @@ static READ8_HANDLER( hgokou_input_r )
static WRITE8_HANDLER( hgokou_input_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->dsw_sel)
{
@@ -3105,7 +3105,7 @@ static WRITE8_HANDLER( hgokou_input_w )
// bit 0 = coin counter
// bit 1 = out counter
// bit 2 = hopper
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
state->hopper = data & 0x04;
#ifdef MAME_DEBUG
// popmessage("COINS %02x",data);
@@ -3125,8 +3125,8 @@ static WRITE8_HANDLER( hgokou_input_w )
// similar to rongrong
static READ8_HANDLER( hgokou_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- UINT8 *rom = space->machine->region("maincpu")->base();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ UINT8 *rom = space->machine().region("maincpu")->base();
if (state->hginga_rombank == 0)
return hanakanz_rand_r(space, 0);
@@ -3177,30 +3177,30 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hparadis_select_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
state->keyb = 0;
- memory_set_bank(space->machine, "bank1", data & 0x07);
- memory_set_bank(space->machine, "bank2", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank2", ((data & 0xe0) >> 5));
}
static READ8_HANDLER( hparadis_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "P1");
- case 0x01: return input_port_read(space->machine, "P2");
- case 0x02: return input_port_read(space->machine, "SYSTEM");
+ case 0x00: return input_port_read(space->machine(), "P1");
+ case 0x01: return input_port_read(space->machine(), "P2");
+ case 0x02: return input_port_read(space->machine(), "SYSTEM");
case 0x0d: return 0x00;
- case 0x80: return input_port_read(space->machine, keynames0[state->keyb++]); // P1 (Keys)
- case 0x81: return input_port_read(space->machine, keynames1[state->keyb++]); // P2 (Keys)
+ case 0x80: return input_port_read(space->machine(), keynames0[state->keyb++]); // P1 (Keys)
+ case 0x81: return input_port_read(space->machine(), keynames1[state->keyb++]); // P2 (Keys)
}
logerror("%06x: warning, unknown bits read, input_sel = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
return 0xff;
@@ -3208,23 +3208,23 @@ static READ8_HANDLER( hparadis_input_r )
static READ8_HANDLER( hparadis_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine, "DSW1");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine, "DSW2");
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(space->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(space->machine(), "DSW2");
if (!BIT(state->dsw_sel, 2)) return 0xff;
if (!BIT(state->dsw_sel, 3)) return 0xff;
- if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine, "DSW3");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(space->machine(), "DSW3");
return 0xff;
}
static WRITE8_HANDLER( hparadis_coin_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x0c: coin_counter_w(space->machine, 0, data & 1); break;
+ case 0x0c: coin_counter_w(space->machine(), 0, data & 1); break;
case 0x0d: break;
default:
logerror("%04x: coins_w with select = %02x, data = %02x\n",cpu_get_pc(space->cpu), state->input_sel, data);
@@ -3270,11 +3270,11 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjmywrld_coins_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x80: return input_port_read(space->machine, "SYSTEM");
+ case 0x80: return input_port_read(space->machine(), "SYSTEM");
case 0x81: return 0x00;
case 0x82: return 0xff; // bit 7 = 0 -> blitter busy, + hopper switch
case 0x83: return 0x00;
@@ -3320,13 +3320,13 @@ ADDRESS_MAP_END
static READ16_HANDLER( akamaru_protection1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return (state->prot_16 & 0x0008) ? 0x0001 : 0x0000;
}
static WRITE16_HANDLER( akamaru_protection1_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int bank;
COMBINE_DATA(&state->prot_16);
@@ -3344,17 +3344,17 @@ static READ16_HANDLER( akamaru_protection2_r )
static READ16_HANDLER( akamaru_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT16 dsw = 0;
- if (state->dsw_sel16[1] == 0xff) dsw |= input_port_read(space->machine, "DSW1");
- if (state->dsw_sel16[0] == 0xff) dsw |= input_port_read(space->machine, "DSW2");
+ if (state->dsw_sel16[1] == 0xff) dsw |= input_port_read(space->machine(), "DSW1");
+ if (state->dsw_sel16[0] == 0xff) dsw |= input_port_read(space->machine(), "DSW2");
return dsw;
}
static READ16_HANDLER( akamaru_blitter_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->ddenlovr_blitter_irq_flag << 6; // bit 7 = 1 -> blitter busy
}
@@ -3415,7 +3415,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mjflove_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0xf);
+ memory_set_bank(space->machine(), "bank1", data & 0xf);
}
static WRITE8_DEVICE_HANDLER( mjflove_okibank_w )
@@ -3432,21 +3432,21 @@ static READ8_HANDLER( mjflove_protection_r )
static READ8_HANDLER( mjflove_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0xff;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
return val;
}
static CUSTOM_INPUT( mjflove_blitter_r )
{
- dynax_state *state = field->port->machine->driver_data<dynax_state>();
+ dynax_state *state = field->port->machine().driver_data<dynax_state>();
// bit 7 = 1 -> blitter busy
// bit 6 = 0 -> VBLANK?
@@ -3462,7 +3462,7 @@ static WRITE8_HANDLER( mjflove_blitter_w )
static WRITE8_HANDLER( mjflove_coincounter_w )
{
// bit 0 = in counter
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
if (data & 0xfe)
{
@@ -3513,7 +3513,7 @@ static WRITE8_DEVICE_HANDLER( jongtei_okibank_w )
static WRITE8_HANDLER( jongtei_dsw_keyb_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->dsw_sel = data;
state->keyb = data;
}
@@ -3557,16 +3557,16 @@ ADDRESS_MAP_END
static READ8_HANDLER( sryudens_keyb_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0x3f;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, offset ? "KEY5" : "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, offset ? "KEY6" : "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, offset ? "KEY7" : "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, offset ? "KEY8" : "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, offset ? "KEY9" : "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), offset ? "KEY5" : "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), offset ? "KEY6" : "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), offset ? "KEY7" : "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), offset ? "KEY8" : "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), offset ? "KEY9" : "KEY4");
- val |= input_port_read(space->machine, offset ? "HOPPER" : "BET");
+ val |= input_port_read(space->machine(), offset ? "HOPPER" : "BET");
if (offset)
val &= 0x7f; // bit 7 = blitter busy
return val;
@@ -3580,7 +3580,7 @@ static WRITE8_HANDLER( sryudens_coincounter_w )
// bit 4
// bit 7 = ? mostly on
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
if (data & 0x68)
logerror("%04x: warning, coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -3592,7 +3592,7 @@ static WRITE8_HANDLER( sryudens_coincounter_w )
static WRITE8_HANDLER( sryudens_rambank_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x0f);
+ memory_set_bank(space->machine(), "bank2", data & 0x0f);
//logerror("%04x: rambank = %02x\n", cpu_get_pc(space->cpu), data);
}
@@ -3634,31 +3634,31 @@ ADDRESS_MAP_END
static READ8_HANDLER( daimyojn_keyb1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0x3f;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, "KEY0");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, "KEY1");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, "KEY2");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, "KEY3");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, "KEY4");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), "KEY0");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), "KEY1");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), "KEY2");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), "KEY3");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), "KEY4");
- val |= input_port_read(space->machine, "BET");
+ val |= input_port_read(space->machine(), "BET");
return val;
}
static READ8_HANDLER( daimyojn_keyb2_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
UINT8 val = 0x3f;
- if (!BIT(state->keyb, 0)) val = input_port_read(space->machine, "KEY5");
- else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine, "KEY6");
- else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine, "KEY7");
- else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine, "KEY8");
- else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine, "KEY9");
+ if (!BIT(state->keyb, 0)) val = input_port_read(space->machine(), "KEY5");
+ else if (!BIT(state->keyb, 1)) val = input_port_read(space->machine(), "KEY6");
+ else if (!BIT(state->keyb, 2)) val = input_port_read(space->machine(), "KEY7");
+ else if (!BIT(state->keyb, 3)) val = input_port_read(space->machine(), "KEY8");
+ else if (!BIT(state->keyb, 4)) val = input_port_read(space->machine(), "KEY9");
- val |= input_port_read(space->machine, "HOPPER");
+ val |= input_port_read(space->machine(), "HOPPER");
return val;
}
@@ -3667,13 +3667,13 @@ static READ8_HANDLER( daimyojn_keyb2_r )
static WRITE8_HANDLER( daimyojn_protection_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->prot_val = data;
}
static READ8_HANDLER( daimyojn_protection_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->prot_val)
{
case 0xd4: return 0x96;
@@ -3693,13 +3693,13 @@ static WRITE8_DEVICE_HANDLER( daimyojn_okibank_w )
static WRITE8_HANDLER( daimyojn_palette_sel_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->daimyojn_palette_sel = data;
}
static WRITE8_HANDLER( daimyojn_blitter_data_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->daimyojn_palette_sel & 0x01)
hanakanz_palette_w(space, offset, data);
@@ -7574,11 +7574,11 @@ INPUT_PORTS_END
static MACHINE_START( ddenlovr )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->oki = machine->device<okim6295_device>("oki");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->oki = machine.device<okim6295_device>("oki");
state->save_item(NAME(state->input_sel));
state->save_item(NAME(state->dsw_sel));
@@ -7607,7 +7607,7 @@ static MACHINE_START( ddenlovr )
static MACHINE_RESET( ddenlovr )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->input_sel = 0;
state->dsw_sel = 0;
@@ -7637,7 +7637,7 @@ static MACHINE_RESET( ddenlovr )
static MACHINE_START( rongrong )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x20, &ROM[0x010000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x110000], 0x1000);
@@ -7646,7 +7646,7 @@ static MACHINE_START( rongrong )
static MACHINE_START( mmpanic )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
MACHINE_START_CALL(ddenlovr);
@@ -7654,7 +7654,7 @@ static MACHINE_START( mmpanic )
static MACHINE_START( funkyfig )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x90000], 0x1000);
@@ -7663,7 +7663,7 @@ static MACHINE_START( funkyfig )
static MACHINE_START( hanakanz )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 0x10, &ROM[0x90000], 0x1000);
@@ -7672,7 +7672,7 @@ static MACHINE_START( hanakanz )
static MACHINE_START( mjmyster )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x90000], 0x1000);
@@ -7681,7 +7681,7 @@ static MACHINE_START( mjmyster )
static MACHINE_START( hparadis )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x50000], 0x1000);
@@ -7690,7 +7690,7 @@ static MACHINE_START( hparadis )
static MACHINE_START( mjflove )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 8, &ROM[0x90000], 0x1000);
@@ -7699,7 +7699,7 @@ static MACHINE_START( mjflove )
static MACHINE_START( sryudens )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x10000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 0x10, &ROM[0x90000], 0x1000);
@@ -7811,7 +7811,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( quizchq_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -7892,7 +7892,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( mmpanic_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -7966,7 +7966,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( hanakanz_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -8044,7 +8044,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( mjchuuka_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -8160,7 +8160,7 @@ MACHINE_CONFIG_END
*/
static INTERRUPT_GEN( hginga_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
/* I haven't found a irq ack register, so I need this kludge to
make sure I don't lose any interrupt generated by the blitter,
@@ -8254,7 +8254,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( mjflove_irq )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->mjflove_irq_cause = 1 | (1 << 1);
@@ -9107,7 +9107,7 @@ static DRIVER_INIT( rongrong )
version of the game might be a bootleg with the protection
patched. (both sets need this)
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x60d4, 0x60d4);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x60d4, 0x60d4);
}
/***************************************************************************
diff --git a/src/mame/drivers/ddragon.c b/src/mame/drivers/ddragon.c
index 3f6940b9317..b20633a97e2 100644
--- a/src/mame/drivers/ddragon.c
+++ b/src/mame/drivers/ddragon.c
@@ -118,15 +118,15 @@ INLINE int scanline_to_vcount( int scanline )
static TIMER_DEVICE_CALLBACK( ddragon_scanline )
{
- ddragon_state *state = timer.machine->driver_data<ddragon_state>();
+ ddragon_state *state = timer.machine().driver_data<ddragon_state>();
int scanline = param;
- int screen_height = timer.machine->primary_screen->height();
+ int screen_height = timer.machine().primary_screen->height();
int vcount_old = scanline_to_vcount((scanline == 0) ? screen_height - 1 : scanline - 1);
int vcount = scanline_to_vcount(scanline);
/* update to the current point */
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
/* on the rising edge of VBLK (vcount == F8), signal an NMI */
if (vcount == 0xf8)
@@ -147,16 +147,16 @@ static TIMER_DEVICE_CALLBACK( ddragon_scanline )
static MACHINE_START( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
/* configure banks */
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
- state->maincpu = machine->device("maincpu");
- state->sub_cpu = machine->device("sub");
- state->snd_cpu = machine->device("soundcpu");
- state->adpcm_1 = machine->device("adpcm1");
- state->adpcm_2 = machine->device("adpcm2");
+ state->maincpu = machine.device("maincpu");
+ state->sub_cpu = machine.device("sub");
+ state->snd_cpu = machine.device("soundcpu");
+ state->adpcm_1 = machine.device("adpcm1");
+ state->adpcm_2 = machine.device("adpcm2");
/* register for save states */
state->save_item(NAME(state->dd_sub_cpu_busy));
@@ -171,7 +171,7 @@ static MACHINE_START( ddragon )
static MACHINE_RESET( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->dd_sub_cpu_busy = 1;
state->adpcm_pos[0] = state->adpcm_pos[1] = 0;
@@ -192,10 +192,10 @@ static MACHINE_RESET( ddragon )
static WRITE8_HANDLER( ddragon_bankswitch_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->scrollx_hi = (data & 0x01);
state->scrolly_hi = ((data & 0x02) >> 1);
- flip_screen_set(space->machine, ~data & 0x04);
+ flip_screen_set(space->machine(), ~data & 0x04);
/* bit 3 unknown */
@@ -204,35 +204,35 @@ static WRITE8_HANDLER( ddragon_bankswitch_w )
else if (state->dd_sub_cpu_busy == 0)
device_set_input_line(state->sub_cpu, state->sprite_irq, (state->sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
- memory_set_bank(space->machine, "bank1", (data & 0xe0) >> 5);
+ memory_set_bank(space->machine(), "bank1", (data & 0xe0) >> 5);
}
static WRITE8_HANDLER( toffy_bankswitch_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
state->scrollx_hi = (data & 0x01);
state->scrolly_hi = ((data & 0x02) >> 1);
-// flip_screen_set(space->machine, ~data & 0x04);
+// flip_screen_set(space->machine(), ~data & 0x04);
/* bit 3 unknown */
/* I don't know ... */
- memory_set_bank(space->machine, "bank1", (data & 0x20) >> 5);
+ memory_set_bank(space->machine(), "bank1", (data & 0x20) >> 5);
}
static READ8_HANDLER( darktowr_mcu_bank_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
// logerror("BankRead %05x %08x\n",cpu_get_pc(space->cpu),offset);
/* Horrible hack - the alternate TStrike set is mismatched against the MCU,
so just hack around the protection here. (The hacks are 'right' as I have
the original source code & notes to this version of TStrike to examine).
*/
- if (!strcmp(space->machine->system().name, "tstrike"))
+ if (!strcmp(space->machine().system().name, "tstrike"))
{
/* Static protection checks at boot-up */
if (cpu_get_pc(space->cpu) == 0x9ace)
@@ -254,7 +254,7 @@ static READ8_HANDLER( darktowr_mcu_bank_r )
static WRITE8_HANDLER( darktowr_mcu_bank_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
logerror("BankWrite %05x %08x %08x\n", cpu_get_pc(space->cpu), offset, data);
if (offset == 0x1400 || offset == 0)
@@ -267,14 +267,14 @@ static WRITE8_HANDLER( darktowr_mcu_bank_w )
static WRITE8_HANDLER( darktowr_bankswitch_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
- int oldbank = memory_get_bank(space->machine, "bank1");
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
+ int oldbank = memory_get_bank(space->machine(), "bank1");
int newbank = (data & 0xe0) >> 5;
state->scrollx_hi = (data & 0x01);
state->scrolly_hi = ((data & 0x02) >> 1);
-// flip_screen_set(space->machine, ~data & 0x04);
+// flip_screen_set(space->machine(), ~data & 0x04);
/* bit 3 unknown */
@@ -283,7 +283,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
else if (state->dd_sub_cpu_busy == 0)
device_set_input_line(state->sub_cpu, state->sprite_irq, (state->sprite_irq == INPUT_LINE_NMI) ? PULSE_LINE : HOLD_LINE);
- memory_set_bank(space->machine, "bank1", newbank);
+ memory_set_bank(space->machine(), "bank1", newbank);
if (newbank == 4 && oldbank != 4)
space->install_legacy_readwrite_handler(0x4000, 0x7fff, FUNC(darktowr_mcu_bank_r), FUNC(darktowr_mcu_bank_w));
else if (newbank != 4 && oldbank == 4)
@@ -300,7 +300,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
static WRITE8_HANDLER( ddragon_interrupt_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
switch (offset)
{
case 0: /* 380b - NMI ack */
@@ -329,21 +329,21 @@ static WRITE8_HANDLER( ddragon_interrupt_w )
static WRITE8_HANDLER( ddragon2_sub_irq_ack_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_set_input_line(state->sub_cpu, state->sprite_irq, CLEAR_LINE );
}
static WRITE8_HANDLER( ddragon2_sub_irq_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE);
}
static void irq_handler( device_t *device, int irq )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
device_set_input_line(state->snd_cpu, state->ym_irq , irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -357,14 +357,14 @@ static void irq_handler( device_t *device, int irq )
static CUSTOM_INPUT( sub_cpu_busy )
{
- ddragon_state *state = field->port->machine->driver_data<ddragon_state>();
+ ddragon_state *state = field->port->machine().driver_data<ddragon_state>();
return state->dd_sub_cpu_busy;
}
static WRITE8_HANDLER( darktowr_mcu_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
logerror("McuWrite %05x %08x %08x\n",cpu_get_pc(space->cpu), offset, data);
state->darktowr_mcu_ports[offset] = data;
}
@@ -379,7 +379,7 @@ static READ8_HANDLER( ddragon_hd63701_internal_registers_r )
static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
/* I don't know why port 0x17 is used.. Doesn't seem to be a standard MCU port */
if (offset == 0x17)
@@ -405,7 +405,7 @@ static WRITE8_HANDLER( ddragon_hd63701_internal_registers_w )
static READ8_HANDLER( ddragon_spriteram_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
/* Double Dragon crash fix - see notes above */
if (offset == 0x49 && cpu_get_pc(space->cpu) == 0x6261 && state->spriteram[offset] == 0x1f)
@@ -417,7 +417,7 @@ static READ8_HANDLER( ddragon_spriteram_r )
static WRITE8_HANDLER( ddragon_spriteram_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
if (space->cpu == state->sub_cpu && offset == 0)
state->dd_sub_cpu_busy = 1;
@@ -435,7 +435,7 @@ static WRITE8_HANDLER( ddragon_spriteram_w )
static WRITE8_HANDLER( dd_adpcm_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_t *adpcm = (offset & 1) ? state->adpcm_2 : state->adpcm_1;
int chip = (adpcm == state->adpcm_1) ? 0 : 1;
@@ -464,7 +464,7 @@ static WRITE8_HANDLER( dd_adpcm_w )
static void dd_adpcm_int( device_t *device )
{
- ddragon_state *state = device->machine->driver_data<ddragon_state>();
+ ddragon_state *state = device->machine().driver_data<ddragon_state>();
int chip = (device == state->adpcm_1) ? 0 : 1;
if (state->adpcm_pos[chip] >= state->adpcm_end[chip] || state->adpcm_pos[chip] >= 0x10000)
@@ -479,7 +479,7 @@ static void dd_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base() + 0x10000 * chip;
+ UINT8 *ROM = device->machine().region("adpcm")->base() + 0x10000 * chip;
state->adpcm_data[chip] = ROM[state->adpcm_pos[chip]++];
msm5205_data_w(device, state->adpcm_data[chip] >> 4);
@@ -489,7 +489,7 @@ static void dd_adpcm_int( device_t *device )
static READ8_HANDLER( dd_adpcm_status_r )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
return state->adpcm_idle[0] + (state->adpcm_idle[1] << 1);
}
@@ -576,7 +576,7 @@ ADDRESS_MAP_END
/* might not be 100% accurate, check bits written */
static WRITE8_HANDLER( ddragonba_port_w )
{
- ddragon_state *state = space->machine->driver_data<ddragon_state>();
+ ddragon_state *state = space->machine().driver_data<ddragon_state>();
device_set_input_line(state->maincpu, M6809_IRQ_LINE, ASSERT_LINE);
device_set_input_line(state->sub_cpu, state->sprite_irq, CLEAR_LINE );
}
@@ -1996,7 +1996,7 @@ ROM_END
static DRIVER_INIT( ddragon )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->sprite_irq = INPUT_LINE_NMI;
state->sound_irq = M6809_IRQ_LINE;
state->ym_irq = M6809_FIRQ_LINE;
@@ -2006,7 +2006,7 @@ static DRIVER_INIT( ddragon )
static DRIVER_INIT( ddragon2 )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->sprite_irq = INPUT_LINE_NMI;
state->sound_irq = INPUT_LINE_NMI;
state->ym_irq = 0;
@@ -2016,47 +2016,47 @@ static DRIVER_INIT( ddragon2 )
static DRIVER_INIT( darktowr )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
state->sprite_irq = INPUT_LINE_NMI;
state->sound_irq = M6809_IRQ_LINE;
state->ym_irq = M6809_FIRQ_LINE;
state->technos_video_hw = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(darktowr_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(darktowr_bankswitch_w));
}
static DRIVER_INIT( toffy )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
int i, length;
UINT8 *rom;
state->sound_irq = M6809_IRQ_LINE;
state->ym_irq = M6809_FIRQ_LINE;
state->technos_video_hw = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(toffy_bankswitch_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x3808, 0x3808, FUNC(toffy_bankswitch_w));
/* the program rom has a simple bitswap encryption */
- rom = machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 6,7,5,4,3,2,1,0);
/* and the fg gfx ... */
- rom = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,3,4,2,1,0);
/* and the sprites gfx */
- rom = machine->region("gfx2")->base();
- length = machine->region("gfx2")->bytes();
+ rom = machine.region("gfx2")->base();
+ length = machine.region("gfx2")->bytes();
for (i = 0; i < length; i++)
rom[i] = BITSWAP8(rom[i], 7,6,5,4,3,2,0,1);
/* and the bg gfx */
- rom = machine->region("gfx3")->base();
- length = machine->region("gfx3")->bytes();
+ rom = machine.region("gfx3")->base();
+ length = machine.region("gfx3")->bytes();
for (i = 0; i < length / 2; i++)
{
rom[i + 0*length/2] = BITSWAP8(rom[i + 0*length/2], 7,6,1,4,3,2,5,0);
@@ -2068,12 +2068,12 @@ static DRIVER_INIT( toffy )
static DRIVER_INIT( ddragon6809 )
{
- ddragon_state *state = machine->driver_data<ddragon_state>();
+ ddragon_state *state = machine.driver_data<ddragon_state>();
int i;
UINT8 *dst,*src;
- src = machine->region("chars")->base();
- dst = machine->region("gfx1")->base();
+ src = machine.region("chars")->base();
+ dst = machine.region("gfx1")->base();
for (i = 0; i < 0x8000; i++)
{
diff --git a/src/mame/drivers/ddragon3.c b/src/mame/drivers/ddragon3.c
index 30603e503c4..74e9172d792 100644
--- a/src/mame/drivers/ddragon3.c
+++ b/src/mame/drivers/ddragon3.c
@@ -162,7 +162,7 @@ static WRITE8_DEVICE_HANDLER( oki_bankswitch_w )
static WRITE16_HANDLER( ddragon3_io_w )
{
- ddragon3_state *state = space->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = space->machine().driver_data<ddragon3_state>();
COMBINE_DATA(&state->io_reg[offset]);
@@ -516,7 +516,7 @@ GFXDECODE_END
static void dd3_ymirq_handler(device_t *device, int irq)
{
- ddragon3_state *state = device->machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = device->machine().driver_data<ddragon3_state>();
device_set_input_line(state->audiocpu, 0 , irq ? ASSERT_LINE : CLEAR_LINE );
}
@@ -533,21 +533,21 @@ static const ym2151_interface ym2151_config =
static TIMER_DEVICE_CALLBACK( ddragon3_scanline )
{
- ddragon3_state *state = timer.machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = timer.machine().driver_data<ddragon3_state>();
int scanline = param;
/* An interrupt is generated every 16 scanlines */
if (scanline % 16 == 0)
{
if (scanline > 0)
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
device_set_input_line(state->maincpu, 5, ASSERT_LINE);
}
/* Vblank is raised on scanline 248 */
if (scanline == 248)
{
- timer.machine->primary_screen->update_partial(scanline - 1);
+ timer.machine().primary_screen->update_partial(scanline - 1);
device_set_input_line(state->maincpu, 6, ASSERT_LINE);
}
}
@@ -560,10 +560,10 @@ static TIMER_DEVICE_CALLBACK( ddragon3_scanline )
static MACHINE_START( ddragon3 )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->vreg));
state->save_item(NAME(state->bg_scrollx));
@@ -576,7 +576,7 @@ static MACHINE_START( ddragon3 )
static MACHINE_RESET( ddragon3 )
{
- ddragon3_state *state = machine->driver_data<ddragon3_state>();
+ ddragon3_state *state = machine.driver_data<ddragon3_state>();
int i;
state->vreg = 0;
diff --git a/src/mame/drivers/ddribble.c b/src/mame/drivers/ddribble.c
index 9fa210e3f9f..7c711289cc5 100644
--- a/src/mame/drivers/ddribble.c
+++ b/src/mame/drivers/ddribble.c
@@ -20,14 +20,14 @@
static INTERRUPT_GEN( ddribble_interrupt_0 )
{
- ddribble_state *state = device->machine->driver_data<ddribble_state>();
+ ddribble_state *state = device->machine().driver_data<ddribble_state>();
if (state->int_enable_0)
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
static INTERRUPT_GEN( ddribble_interrupt_1 )
{
- ddribble_state *state = device->machine->driver_data<ddribble_state>();
+ ddribble_state *state = device->machine().driver_data<ddribble_state>();
if (state->int_enable_1)
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
@@ -35,31 +35,31 @@ static INTERRUPT_GEN( ddribble_interrupt_1 )
static WRITE8_HANDLER( ddribble_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static READ8_HANDLER( ddribble_sharedram_r )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER( ddribble_sharedram_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
state->sharedram[offset] = data;
}
static READ8_HANDLER( ddribble_snd_sharedram_r )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
return state->snd_sharedram[offset];
}
static WRITE8_HANDLER( ddribble_snd_sharedram_w )
{
- ddribble_state *state = space->machine->driver_data<ddribble_state>();
+ ddribble_state *state = space->machine().driver_data<ddribble_state>();
state->snd_sharedram[offset] = data;
}
@@ -69,13 +69,13 @@ static WRITE8_HANDLER( ddribble_coin_counter_w )
/* b2-b3: unknown */
/* b1: coin counter 2 */
/* b0: coin counter 1 */
- coin_counter_w(space->machine, 0,(data) & 0x01);
- coin_counter_w(space->machine, 1,(data >> 1) & 0x01);
+ coin_counter_w(space->machine(), 0,(data) & 0x01);
+ coin_counter_w(space->machine(), 1,(data >> 1) & 0x01);
}
static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
{
- return device->machine->rand(); /* patch */
+ return device->machine().rand(); /* patch */
/* FIXME: remove ? */
#if 0
if (vlm5030_bsy(device)) return 1;
@@ -85,8 +85,8 @@ static READ8_DEVICE_HANDLER( ddribble_vlm5030_busy_r )
static WRITE8_DEVICE_HANDLER( ddribble_vlm5030_ctrl_w )
{
- ddribble_state *state = device->machine->driver_data<ddribble_state>();
- UINT8 *SPEECH_ROM = device->machine->region("vlm")->base();
+ ddribble_state *state = device->machine().driver_data<ddribble_state>();
+ UINT8 *SPEECH_ROM = device->machine().region("vlm")->base();
/* b7 : vlm data bus OE */
@@ -250,13 +250,13 @@ static const vlm5030_interface vlm5030_config =
static MACHINE_START( ddribble )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 5, &ROM[0x10000], 0x2000);
- state->filter1 = machine->device("filter1");
- state->filter2 = machine->device("filter2");
- state->filter3 = machine->device("filter3");
+ state->filter1 = machine.device("filter1");
+ state->filter2 = machine.device("filter2");
+ state->filter3 = machine.device("filter3");
state->save_item(NAME(state->int_enable_0));
state->save_item(NAME(state->int_enable_1));
@@ -267,7 +267,7 @@ static MACHINE_START( ddribble )
static MACHINE_RESET( ddribble )
{
- ddribble_state *state = machine->driver_data<ddribble_state>();
+ ddribble_state *state = machine.driver_data<ddribble_state>();
int i;
for (i = 0; i < 5; i++)
diff --git a/src/mame/drivers/deadang.c b/src/mame/drivers/deadang.c
index de4b987e72c..ecb6055ca41 100644
--- a/src/mame/drivers/deadang.c
+++ b/src/mame/drivers/deadang.c
@@ -48,11 +48,11 @@ Dip locations and factory settings verified with US manual
static READ16_HANDLER( ghunter_trackball_low_r )
{
- return (input_port_read(space->machine, "TRACKX") & 0xff) | ((input_port_read(space->machine, "TRACKY") & 0xff) << 8);
+ return (input_port_read(space->machine(), "TRACKX") & 0xff) | ((input_port_read(space->machine(), "TRACKY") & 0xff) << 8);
}
static READ16_HANDLER( ghunter_trackball_high_r )
{
- return ((input_port_read(space->machine, "TRACKX") & 0x0f00) >> 4) | (input_port_read(space->machine, "TRACKY") & 0x0f00);
+ return ((input_port_read(space->machine(), "TRACKX") & 0x0f00) >> 4) | (input_port_read(space->machine(), "TRACKY") & 0x0f00);
}
/* Memory Maps */
@@ -403,8 +403,8 @@ static DRIVER_INIT( ghunter )
seibu_sound_decrypt(machine, "audiocpu", 0x2000);
seibu_adpcm_decrypt(machine, "adpcm");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x80001, FUNC(ghunter_trackball_low_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0000, 0xb0001, FUNC(ghunter_trackball_high_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80000, 0x80001, FUNC(ghunter_trackball_low_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0000, 0xb0001, FUNC(ghunter_trackball_high_r));
}
/* Game Drivers */
diff --git a/src/mame/drivers/dec0.c b/src/mame/drivers/dec0.c
index 5d4db30c709..9af5f646fc6 100644
--- a/src/mame/drivers/dec0.c
+++ b/src/mame/drivers/dec0.c
@@ -183,12 +183,12 @@ static WRITE16_HANDLER( dec0_control_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
break;
case 6: /* Intel 8751 microcontroller - Bad Dudes, Heavy Barrel, Birdy Try only */
- dec0_i8751_write(space->machine, data);
+ dec0_i8751_write(space->machine(), data);
break;
case 8: /* Interrupt ack (VBL - IRQ 6) */
@@ -202,7 +202,7 @@ static WRITE16_HANDLER( dec0_control_w )
break;
case 0xe: /* Reset Intel 8751? - not sure, all the games write here at startup */
- dec0_i8751_reset(space->machine);
+ dec0_i8751_reset(space->machine());
logerror("CPU #0 PC %06x: warning - write %02x to unmapped memory address %06x\n",cpu_get_pc(space->cpu),data,0x30c010+(offset<<1));
break;
@@ -221,7 +221,7 @@ static WRITE16_HANDLER( automat_control_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
break;
@@ -254,7 +254,7 @@ static WRITE16_HANDLER( slyspy_control_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
break;
case 2:
@@ -268,7 +268,7 @@ static WRITE16_HANDLER( midres_sound_w )
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -330,13 +330,13 @@ READ16_HANDLER( slyspy_controls_r )
switch (offset<<1)
{
case 0: /* Dip Switches */
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 2: /* Player 1 & Player 2 joysticks & fire buttons */
- return input_port_read(space->machine, "INPUTS");
+ return input_port_read(space->machine(), "INPUTS");
case 4: /* Credits */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
}
logerror("Unknown control read at 30c000 %d\n", offset);
@@ -394,35 +394,35 @@ READ16_HANDLER( slyspy_protection_r )
static WRITE16_HANDLER( unmapped_w )
{
// fall through for unmapped protection areas
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
logerror("unmapped memory write to %04x = %04x in mode %d\n", 0x240000+offset*2, data, state->slyspy_state);
}
-void slyspy_set_protection_map(running_machine* machine, int type);
+void slyspy_set_protection_map(running_machine& machine, int type);
WRITE16_HANDLER( slyspy_state_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->slyspy_state=0;
- slyspy_set_protection_map(space->machine, state->slyspy_state);
+ slyspy_set_protection_map(space->machine(), state->slyspy_state);
}
READ16_HANDLER( slyspy_state_r )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->slyspy_state++;
state->slyspy_state=state->slyspy_state%4;
- slyspy_set_protection_map(space->machine, state->slyspy_state);
+ slyspy_set_protection_map(space->machine(), state->slyspy_state);
return 0; /* Value doesn't mater */
}
-void slyspy_set_protection_map(running_machine* machine, int type)
+void slyspy_set_protection_map(running_machine& machine, int type)
{
- address_space* space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- deco_bac06_device *tilegen1 = (deco_bac06_device*)space->machine->device<deco_bac06_device>("tilegen1");
- deco_bac06_device *tilegen2 = (deco_bac06_device*)space->machine->device<deco_bac06_device>("tilegen2");
+ deco_bac06_device *tilegen1 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen1");
+ deco_bac06_device *tilegen2 = (deco_bac06_device*)space->machine().device<deco_bac06_device>("tilegen2");
space->install_legacy_write_handler( 0x240000, 0x24ffff, FUNC(unmapped_w));
@@ -640,7 +640,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( automat_adpcm_w )
{
- dec0_state *state = space->machine->driver_data<dec0_state>();
+ dec0_state *state = space->machine().driver_data<dec0_state>();
state->automat_adpcm_byte = data;
}
@@ -1254,12 +1254,12 @@ GFXDECODE_END
static void sound_irq(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, linestate); /* IRQ */
+ cputag_set_input_line(device->machine(), "audiocpu", 0, linestate); /* IRQ */
}
static void sound_irq2(device_t *device, int linestate)
{
- cputag_set_input_line(device->machine, "audiocpu", 1, linestate); /* IRQ2 */
+ cputag_set_input_line(device->machine(), "audiocpu", 1, linestate); /* IRQ2 */
}
static const ym3812_interface ym3812_config =
@@ -1277,7 +1277,7 @@ static const ym3812_interface ym3812b_interface =
static void automat_vclk_cb(device_t *device)
{
- dec0_state *state = device->machine->driver_data<dec0_state>();
+ dec0_state *state = device->machine().driver_data<dec0_state>();
if (state->automat_msm5205_vclk_toggle == 0)
{
msm5205_data_w(device, state->automat_adpcm_byte & 0xf);
@@ -1285,7 +1285,7 @@ static void automat_vclk_cb(device_t *device)
else
{
msm5205_data_w(device, state->automat_adpcm_byte >> 4);
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
state->automat_msm5205_vclk_toggle ^= 1;
@@ -2906,12 +2906,12 @@ ROM_END
// helper function
#if 0
-static void dump_to_file(running_machine* machine, UINT8* ROM, int offset, int size)
+static void dump_to_file(running_machine& machine, UINT8* ROM, int offset, int size)
{
{
FILE *fp;
char filename[256];
- sprintf(filename,"%s_%08x_%08x", machine->system().name, offset, size);
+ sprintf(filename,"%s_%08x_%08x", machine.system().name, offset, size);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -2924,7 +2924,7 @@ static void dump_to_file(running_machine* machine, UINT8* ROM, int offset, int s
static DRIVER_INIT( convert_robocop_gfx4_to_automat )
{
- UINT8* R = machine->region("gfx4")->base();
+ UINT8* R = machine.region("gfx4")->base();
int i;
for (i=0;i<0x80000;i++)
@@ -2945,10 +2945,10 @@ static DRIVER_INIT( convert_robocop_gfx4_to_automat )
static DRIVER_INIT( midresb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00180000, 0x0018000f, FUNC(dec0_controls_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001a0000, 0x001a000f, FUNC(dec0_rotary_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00180000, 0x0018000f, FUNC(dec0_controls_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x001a0000, 0x001a000f, FUNC(dec0_rotary_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00180014, 0x00180015, FUNC(midres_sound_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00180014, 0x00180015, FUNC(midres_sound_w) );
}
/******************************************************************************/
diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c
index 3241a370b3d..988fd4b5c44 100644
--- a/src/mame/drivers/dec8.c
+++ b/src/mame/drivers/dec8.c
@@ -55,25 +55,25 @@ To do:
/* Only used by ghostb, gondo, garyoret, other games can control buffering */
static SCREEN_EOF( dec8 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
buffer_spriteram_w(space, 0, 0);
}
static READ8_HANDLER( i8751_h_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
return state->i8751_return >> 8; /* MSB */
}
static READ8_HANDLER( i8751_l_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
return state->i8751_return & 0xff; /* LSB */
}
static WRITE8_HANDLER( i8751_reset_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
}
@@ -81,28 +81,28 @@ static WRITE8_HANDLER( i8751_reset_w )
static READ8_HANDLER( gondo_player_1_r )
{
- int val = 1 << input_port_read(space->machine, "AN0");
+ int val = 1 << input_port_read(space->machine(), "AN0");
switch (offset)
{
case 0: /* Rotary low byte */
return ~(val & 0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~val >> 4) & 0xf0) | (input_port_read(space->machine, "IN0") & 0xf);
+ return ((~val >> 4) & 0xf0) | (input_port_read(space->machine(), "IN0") & 0xf);
}
return 0xff;
}
static READ8_HANDLER( gondo_player_2_r )
{
- int val = 1 << input_port_read(space->machine, "AN1");
+ int val = 1 << input_port_read(space->machine(), "AN1");
switch (offset)
{
case 0: /* Rotary low byte */
return ~(val & 0xff);
case 1: /* Joystick = bottom 4 bits, rotary = top 4 */
- return ((~val >> 4) & 0xf0) | (input_port_read(space->machine, "IN1") & 0xf);
+ return ((~val >> 4) & 0xf0) | (input_port_read(space->machine(), "IN1") & 0xf);
}
return 0xff;
}
@@ -119,20 +119,20 @@ static TIMER_CALLBACK( dec8_i8751_timer_callback )
{
// The schematics show a clocked LS194 shift register (3A) is used to automatically
// clear the IRQ request. The MCU does not clear it itself.
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
device_set_input_line(state->mcu, MCS51_INT1_LINE, CLEAR_LINE);
}
static WRITE8_HANDLER( dec8_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
switch (offset)
{
case 0: /* High byte - SECIRQ is trigged on activating this latch */
state->i8751_value = (state->i8751_value & 0xff) | (data << 8);
device_set_input_line(state->mcu, MCS51_INT1_LINE, ASSERT_LINE);
- space->machine->scheduler().timer_set(state->mcu->clocks_to_attotime(64), FUNC(dec8_i8751_timer_callback)); // 64 clocks not confirmed
+ space->machine().scheduler().timer_set(state->mcu->clocks_to_attotime(64), FUNC(dec8_i8751_timer_callback)); // 64 clocks not confirmed
break;
case 1: /* Low byte */
state->i8751_value = (state->i8751_value & 0xff00) | data;
@@ -148,7 +148,7 @@ static WRITE8_HANDLER( dec8_i8751_w )
static WRITE8_HANDLER( srdarwin_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -168,8 +168,8 @@ static WRITE8_HANDLER( srdarwin_i8751_w )
if (state->i8751_value == 0x5000) state->i8751_return = ((state->coin1 / 10) << 4) | (state->coin1 % 10); /* Coin request */
if (state->i8751_value == 0x6000) {state->i8751_value = -1; state->coin1--; } /* Coin clear */
/* Nb: Command 0x4000 for setting coinage options is not sup3ed */
- if ((input_port_read(space->machine, "FAKE") & 1) == 1) state->latch = 1;
- if ((input_port_read(space->machine, "FAKE") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
+ if ((input_port_read(space->machine(), "FAKE") & 1) == 1) state->latch = 1;
+ if ((input_port_read(space->machine(), "FAKE") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
/* This next value is the index to a series of tables,
each table controls the end of level bad guy, wrong values crash the
@@ -223,7 +223,7 @@ bb63 = Square things again
static WRITE8_HANDLER( shackled_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -238,9 +238,9 @@ static WRITE8_HANDLER( shackled_i8751_w )
}
/* Coins are controlled by the i8751 */
- if (/*(input_port_read(space->machine, "IN2") & 3) == 3*/!state->latch) {state->latch = 1; state->coin1 = state->coin2 = 0;}
- if ((input_port_read(space->machine, "IN2") & 1) != 1 && state->latch) {state->coin1 = 1; state->latch = 0;}
- if ((input_port_read(space->machine, "IN2") & 2) != 2 && state->latch) {state->coin2 = 1; state->latch = 0;}
+ if (/*(input_port_read(space->machine(), "IN2") & 3) == 3*/!state->latch) {state->latch = 1; state->coin1 = state->coin2 = 0;}
+ if ((input_port_read(space->machine(), "IN2") & 1) != 1 && state->latch) {state->coin1 = 1; state->latch = 0;}
+ if ((input_port_read(space->machine(), "IN2") & 2) != 2 && state->latch) {state->coin2 = 1; state->latch = 0;}
if (state->i8751_value == 0x0050) state->i8751_return = 0; /* Breywood ID */
if (state->i8751_value == 0x0051) state->i8751_return = 0; /* Shackled ID */
@@ -252,7 +252,7 @@ static WRITE8_HANDLER( shackled_i8751_w )
static WRITE8_HANDLER( lastmisn_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -269,8 +269,8 @@ static WRITE8_HANDLER( lastmisn_i8751_w )
if (offset == 0)
{
/* Coins are controlled by the i8751 */
- if ((input_port_read(space->machine, "IN2") & 3) == 3 && !state->latch) state->latch = 1;
- if ((input_port_read(space->machine, "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x400; state->i8751_return = 0x400; return;}
+ if ((input_port_read(space->machine(), "IN2") & 3) == 3 && !state->latch) state->latch = 1;
+ if ((input_port_read(space->machine(), "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x400; state->i8751_return = 0x400; return;}
if (state->i8751_value == 0x007a) state->i8751_return = 0x0185; /* Japan ID code */
if (state->i8751_value == 0x007b) state->i8751_return = 0x0184; /* USA ID code */
if (state->i8751_value == 0x0001) {state->coin1 = state->snd = 0;}//???
@@ -284,7 +284,7 @@ static WRITE8_HANDLER( lastmisn_i8751_w )
static WRITE8_HANDLER( csilver_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -301,8 +301,8 @@ static WRITE8_HANDLER( csilver_i8751_w )
if (offset == 0)
{
/* Coins are controlled by the i8751 */
- if ((input_port_read(space->machine, "IN2") & 3) == 3 && !state->latch) state->latch = 1;
- if ((input_port_read(space->machine, "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x1200; state->i8751_return = 0x1200; return;}
+ if ((input_port_read(space->machine(), "IN2") & 3) == 3 && !state->latch) state->latch = 1;
+ if ((input_port_read(space->machine(), "IN2") & 3) != 3 && state->latch) {state->coin1++; state->latch = 0; state->snd = 0x1200; state->i8751_return = 0x1200; return;}
if (state->i8751_value == 0x054a) {state->i8751_return = ~(0x4a); state->coin1 = 0; state->snd = 0;} /* Captain Silver (Japan) ID */
if (state->i8751_value == 0x054c) {state->i8751_return = ~(0x4c); state->coin1 = 0; state->snd = 0;} /* Captain Silver (World) ID */
@@ -314,7 +314,7 @@ static WRITE8_HANDLER( csilver_i8751_w )
static WRITE8_HANDLER( garyoret_i8751_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->i8751_return = 0;
switch (offset)
@@ -328,9 +328,9 @@ static WRITE8_HANDLER( garyoret_i8751_w )
}
/* Coins are controlled by the i8751 */
- if ((input_port_read(space->machine, "I8751") & 3) == 3) state->latch = 1;
- if ((input_port_read(space->machine, "I8751") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
- if ((input_port_read(space->machine, "I8751") & 2) != 2 && state->latch) {state->coin2++; state->latch = 0;}
+ if ((input_port_read(space->machine(), "I8751") & 3) == 3) state->latch = 1;
+ if ((input_port_read(space->machine(), "I8751") & 1) != 1 && state->latch) {state->coin1++; state->latch = 0;}
+ if ((input_port_read(space->machine(), "I8751") & 2) != 2 && state->latch) {state->coin2++; state->latch = 0;}
/* Work out return values */
if ((state->i8751_value >> 8) == 0x00) {state->i8751_return = 0; state->coin1 = state->coin2 = 0;}
@@ -344,13 +344,13 @@ static WRITE8_HANDLER( garyoret_i8751_w )
static WRITE8_HANDLER( dec8_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
/* Used by Ghostbusters, Meikyuu Hunter G & Gondomania */
static WRITE8_HANDLER( ghostb_bank_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
/* Bit 0: SECCLR - acknowledge interrupt from I8751
Bit 1: NMI enable/disable
@@ -359,11 +359,11 @@ static WRITE8_HANDLER( ghostb_bank_w )
Bits 4-7: Bank switch
*/
- memory_set_bank(space->machine, "bank1", data >> 4);
+ memory_set_bank(space->machine(), "bank1", data >> 4);
if ((data&1)==0) device_set_input_line(state->maincpu, M6809_IRQ_LINE, CLEAR_LINE);
if (data & 2) state->nmi_enable =1; else state->nmi_enable = 0;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static WRITE8_HANDLER( csilver_control_w )
@@ -375,19 +375,19 @@ static WRITE8_HANDLER( csilver_control_w )
Bit 0x40 - Unused.
Bit 0x80 - Hold subcpu reset line high if clear, else low? (Not needed anyway)
*/
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( dec8_sound_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static void csilver_adpcm_int( device_t *device )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
+ dec8_state *state = device->machine().driver_data<dec8_state>();
state->toggle ^= 1;
if (state->toggle)
device_set_input_line(state->audiocpu, M6502_IRQ_LINE, HOLD_LINE);
@@ -404,20 +404,20 @@ static READ8_DEVICE_HANDLER( csilver_adpcm_reset_r )
static WRITE8_HANDLER( csilver_adpcm_data_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
state->msm5205next = data;
}
static WRITE8_HANDLER( csilver_sound_bank_w )
{
- memory_set_bank(space->machine, "bank3", (data & 0x08) >> 3);
+ memory_set_bank(space->machine(), "bank3", (data & 0x08) >> 3);
}
/******************************************************************************/
static WRITE8_HANDLER( oscar_int_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
/* Deal with interrupts, coins also generate NMI to CPU 0 */
switch (offset)
{
@@ -439,7 +439,7 @@ static WRITE8_HANDLER( oscar_int_w )
/* Used by Shackled, Last Mission, Captain Silver */
static WRITE8_HANDLER( shackled_int_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
#if 0
/* This is correct, but the cpus in Shackled need an interleave of about 5000!
With lower interleave CPU 0 misses an interrupt at the start of the game
@@ -482,16 +482,16 @@ static WRITE8_HANDLER( shackled_int_w )
/******************************************************************************/
-static READ8_HANDLER( shackled_sprite_r ) { return space->machine->generic.spriteram.u8[offset]; }
-static WRITE8_HANDLER( shackled_sprite_w ) { space->machine->generic.spriteram.u8[offset] = data; }
-static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine, data); }
+static READ8_HANDLER( shackled_sprite_r ) { return space->machine().generic.spriteram.u8[offset]; }
+static WRITE8_HANDLER( shackled_sprite_w ) { space->machine().generic.spriteram.u8[offset] = data; }
+static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine(), data); }
/******************************************************************************/
static WRITE8_HANDLER( dec8_mxc06_buffer_spriteram_w)
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
- UINT8* spriteram = space->machine->generic.spriteram.u8;
+ dec8_state *state = space->machine().driver_data<dec8_state>();
+ UINT8* spriteram = space->machine().generic.spriteram.u8;
// copy to a 16-bit region for the sprite chip
for (int i=0;i<0x800/2;i++)
{
@@ -842,7 +842,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( dec8_mcu_from_main_r )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
switch (offset)
{
@@ -853,7 +853,7 @@ static READ8_HANDLER( dec8_mcu_from_main_r )
case 2:
return 0xff;
case 3:
- return input_port_read(space->machine, "I8751");
+ return input_port_read(space->machine(), "I8751");
}
return 0xff; //compile safe.
@@ -861,7 +861,7 @@ static READ8_HANDLER( dec8_mcu_from_main_r )
static WRITE8_HANDLER( dec8_mcu_to_main_w )
{
- dec8_state *state = space->machine->driver_data<dec8_state>();
+ dec8_state *state = space->machine().driver_data<dec8_state>();
// Outputs P0 and P1 are latched
if (offset==0) state->i8751_port0=data;
@@ -1898,7 +1898,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int linestate )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
+ dec8_state *state = device->machine().driver_data<dec8_state>();
device_set_input_line(state->audiocpu, 0, linestate); /* M6502_IRQ_LINE */
}
@@ -1922,7 +1922,7 @@ static const msm5205_interface msm5205_config =
static INTERRUPT_GEN( gondo_interrupt )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
+ dec8_state *state = device->machine().driver_data<dec8_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE); /* VBL */
}
@@ -1930,9 +1930,9 @@ static INTERRUPT_GEN( gondo_interrupt )
/* Coins generate NMI's */
static INTERRUPT_GEN( oscar_interrupt )
{
- dec8_state *state = device->machine->driver_data<dec8_state>();
- if ((input_port_read(device->machine, "IN2") & 0x7) == 0x7) state->latch = 1;
- if (state->latch && (input_port_read(device->machine, "IN2") & 0x7) != 0x7)
+ dec8_state *state = device->machine().driver_data<dec8_state>();
+ if ((input_port_read(device->machine(), "IN2") & 0x7) == 0x7) state->latch = 1;
+ if (state->latch && (input_port_read(device->machine(), "IN2") & 0x7) != 0x7)
{
state->latch = 0;
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -1944,12 +1944,12 @@ static INTERRUPT_GEN( oscar_interrupt )
static MACHINE_START( dec8 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->latch));
state->save_item(NAME(state->nmi_enable));
@@ -1970,7 +1970,7 @@ static MACHINE_START( dec8 )
static MACHINE_RESET( dec8 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
int i;
state->nmi_enable = state->i8751_port0 = state->i8751_port1 = 0;
@@ -3443,21 +3443,21 @@ ROM_END
static DRIVER_INIT( dec8 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
+ dec8_state *state = machine.driver_data<dec8_state>();
state->latch = 0;
}
/* Ghostbusters, Darwin, Oscar use a "Deco 222" custom 6502 for sound. */
static DRIVER_INIT( deco222 )
{
- dec8_state *state = machine->driver_data<dec8_state>();
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ dec8_state *state = machine.driver_data<dec8_state>();
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
int A;
UINT8 *decrypt;
UINT8 *rom;
/* bits 5 and 6 of the opcodes are swapped */
- rom = machine->region("audiocpu")->base();
+ rom = machine.region("audiocpu")->base();
decrypt = auto_alloc_array(machine, UINT8, 0x8000);
space->set_decrypted_region(0x8000, 0xffff, decrypt);
@@ -3471,8 +3471,8 @@ static DRIVER_INIT( deco222 )
/* Below, I set up the correct number of banks depending on the "maincpu" region size */
static DRIVER_INIT( ghostb )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *RAM = machine->region("proms")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.region("proms")->base();
/* Blank out unused garbage in colour prom to avoid colour overflow */
memset(RAM + 0x20, 0, 0xe0);
@@ -3483,8 +3483,8 @@ static DRIVER_INIT( ghostb )
static DRIVER_INIT( meikyuh )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *RAM = machine->region("proms")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.region("proms")->base();
/* Blank out unused garbage in colour prom to avoid colour overflow */
memset(RAM + 0x20, 0, 0xe0);
@@ -3495,36 +3495,36 @@ static DRIVER_INIT( meikyuh )
static DRIVER_INIT( cobracom )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( oscar )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( deco222 );
}
static DRIVER_INIT( gondo )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 12, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( garyoret )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( csilver )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- UINT8 *RAM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ UINT8 *RAM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 14, &ROM[0x10000], 0x4000);
memory_configure_bank(machine, "bank3", 0, 2, &RAM[0x10000], 0x4000);
@@ -3533,21 +3533,21 @@ static DRIVER_INIT( csilver )
static DRIVER_INIT( shackled )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 14, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( lastmisn )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( dec8 );
}
static DRIVER_INIT( srdarwin )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
DRIVER_INIT_CALL( deco222 );
}
diff --git a/src/mame/drivers/deco156.c b/src/mame/drivers/deco156.c
index ff74beb6e2e..9eb284e766c 100644
--- a/src/mame/drivers/deco156.c
+++ b/src/mame/drivers/deco156.c
@@ -46,7 +46,7 @@ public:
static VIDEO_START( wcvol95 )
{
- deco156_state *state = machine->driver_data<deco156_state>();
+ deco156_state *state = machine.driver_data<deco156_state>();
state->spriteram = auto_alloc_array(machine, UINT16, 0x2000/2);
/* and register the allocated ram so that save states still work */
@@ -59,17 +59,17 @@ static VIDEO_START( wcvol95 )
static SCREEN_UPDATE( wcvol95 )
{
//FIXME: flip_screen_x should not be written!
- flip_screen_set_no_update(screen->machine, 1);
+ flip_screen_set_no_update(screen->machine(), 1);
- deco156_state *state = screen->machine->driver_data<deco156_state>();
+ deco156_state *state = screen->machine().driver_data<deco156_state>();
- bitmap_fill(screen->machine->priority_bitmap, NULL, 0);
+ bitmap_fill(screen->machine().priority_bitmap, NULL, 0);
bitmap_fill(bitmap, NULL, 0);
deco16ic_pf_update(state->deco_tilegen1, state->pf1_rowscroll, state->pf2_rowscroll);
deco16ic_tilemap_2_draw(state->deco_tilegen1, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
- screen->machine->device<decospr_device>("spritegen")->draw_sprites(screen->machine, bitmap, cliprect, state->spriteram, 0x800);
+ screen->machine().device<decospr_device>("spritegen")->draw_sprites(screen->machine(), bitmap, cliprect, state->spriteram, 0x800);
deco16ic_tilemap_1_draw(state->deco_tilegen1, bitmap, cliprect, 0, 0);
return 0;
}
@@ -78,11 +78,11 @@ static SCREEN_UPDATE( wcvol95 )
static WRITE32_HANDLER(hvysmsh_eeprom_w)
{
- deco156_state *state = space->machine->driver_data<deco156_state>();
+ deco156_state *state = space->machine().driver_data<deco156_state>();
if (ACCESSING_BITS_0_7)
{
state->oki2->set_bank_base(0x40000 * (data & 0x7));
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
@@ -94,8 +94,8 @@ static WRITE32_DEVICE_HANDLER( hvysmsh_oki_0_bank_w )
static WRITE32_HANDLER(wcvol95_nonbuffered_palette_w)
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> 0),pal5bit(space->machine().generic.paletteram.u32[offset] >> 5),pal5bit(space->machine().generic.paletteram.u32[offset] >> 10));
}
/* This is the same as deco32_nonbuffered_palette_w in video/deco32.c */
@@ -103,21 +103,21 @@ static WRITE32_HANDLER( deco156_nonbuffered_palette_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- b = (space->machine->generic.paletteram.u32[offset] >>16) & 0xff;
- g = (space->machine->generic.paletteram.u32[offset] >> 8) & 0xff;
- r = (space->machine->generic.paletteram.u32[offset] >> 0) & 0xff;
+ b = (space->machine().generic.paletteram.u32[offset] >>16) & 0xff;
+ g = (space->machine().generic.paletteram.u32[offset] >> 8) & 0xff;
+ r = (space->machine().generic.paletteram.u32[offset] >> 0) & 0xff;
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
-static READ32_HANDLER( wcvol95_pf1_rowscroll_r ) { deco156_state *state = space->machine->driver_data<deco156_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( wcvol95_pf2_rowscroll_r ) { deco156_state *state = space->machine->driver_data<deco156_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
-static READ32_HANDLER( wcvol95_spriteram_r ) { deco156_state *state = space->machine->driver_data<deco156_state>(); return state->spriteram[offset] ^ 0xffff0000; }
-static WRITE32_HANDLER( wcvol95_pf1_rowscroll_w ) { deco156_state *state = space->machine->driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
-static WRITE32_HANDLER( wcvol95_pf2_rowscroll_w ) { deco156_state *state = space->machine->driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
-static WRITE32_HANDLER( wcvol95_spriteram_w ) { deco156_state *state = space->machine->driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->spriteram[offset]); }
+static READ32_HANDLER( wcvol95_pf1_rowscroll_r ) { deco156_state *state = space->machine().driver_data<deco156_state>(); return state->pf1_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( wcvol95_pf2_rowscroll_r ) { deco156_state *state = space->machine().driver_data<deco156_state>(); return state->pf2_rowscroll[offset] ^ 0xffff0000; }
+static READ32_HANDLER( wcvol95_spriteram_r ) { deco156_state *state = space->machine().driver_data<deco156_state>(); return state->spriteram[offset] ^ 0xffff0000; }
+static WRITE32_HANDLER( wcvol95_pf1_rowscroll_w ) { deco156_state *state = space->machine().driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
+static WRITE32_HANDLER( wcvol95_pf2_rowscroll_w ) { deco156_state *state = space->machine().driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
+static WRITE32_HANDLER( wcvol95_spriteram_w ) { deco156_state *state = space->machine().driver_data<deco156_state>(); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->spriteram[offset]); }
static ADDRESS_MAP_START( hvysmsh_map, AS_PROGRAM, 32 )
@@ -606,10 +606,10 @@ ROM_END
/**********************************************************************************/
-static void descramble_sound( running_machine *machine, const char *tag )
+static void descramble_sound( running_machine &machine, const char *tag )
{
- UINT8 *rom = machine->region(tag)->base();
- int length = machine->region(tag)->bytes();
+ UINT8 *rom = machine.region(tag)->base();
+ int length = machine.region(tag)->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
diff --git a/src/mame/drivers/deco32.c b/src/mame/drivers/deco32.c
index b747f06c0be..7f67d33a31a 100644
--- a/src/mame/drivers/deco32.c
+++ b/src/mame/drivers/deco32.c
@@ -279,24 +279,24 @@ static const deco16ic_interface fghthist_deco16ic_tilegen2_intf =
#if 0
static WRITE32_HANDLER( deco32_pf12_control_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
COMBINE_DATA(&state->pf12_control[offset]);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
static WRITE32_HANDLER( deco32_pf34_control_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
COMBINE_DATA(&state->pf34_control[offset]);
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
#endif
static TIMER_DEVICE_CALLBACK( interrupt_gen )
{
- cputag_set_input_line(timer.machine, "maincpu", ARM_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "maincpu", ARM_IRQ_LINE, HOLD_LINE);
}
static READ32_HANDLER( deco32_irq_controller_r )
@@ -306,7 +306,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
switch (offset)
{
case 2: /* Raster IRQ ACK - value read is not used */
- cputag_set_input_line(space->machine, "maincpu", ARM_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", ARM_IRQ_LINE, CLEAR_LINE);
return 0;
case 3: /* Irq controller
@@ -323,7 +323,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
/* ZV03082007 - video_screen_get_vblank() doesn't work for Captain America, as it expects
that this bit is NOT set in rows 0-7. */
- vblank = space->machine->primary_screen->vpos() > space->machine->primary_screen->visible_area().max_y;
+ vblank = space->machine().primary_screen->vpos() > space->machine().primary_screen->visible_area().max_y;
if (vblank)
return 0xffffff80 | 0x1 | 0x10; /* Assume VBL takes priority over possible raster/lightgun irq */
@@ -337,7 +337,7 @@ static READ32_HANDLER( deco32_irq_controller_r )
static WRITE32_HANDLER( deco32_irq_controller_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
int scanline;
switch (offset) {
@@ -351,7 +351,7 @@ static WRITE32_HANDLER( deco32_irq_controller_w )
if (state->raster_enable && scanline>0 && scanline<240)
{
// needs +16 for the raster to align on captaven intro? (might just be our screen size / visible area / layer offsets need adjusting instead)
- state->raster_irq_timer->adjust(space->machine->primary_screen->time_until_pos(scanline+16, 320));
+ state->raster_irq_timer->adjust(space->machine().primary_screen->time_until_pos(scanline+16, 320));
}
else
state->raster_irq_timer->reset();
@@ -364,7 +364,7 @@ static WRITE32_HANDLER( deco32_irq_controller_w )
static WRITE32_HANDLER( deco32_sound_w )
{
soundlatch_w(space,0,data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
static READ32_HANDLER( deco32_71_r )
@@ -378,9 +378,9 @@ static READ32_HANDLER( captaven_prot_r )
{
/* Protection/IO chip 75, same as Lemmings & Robocop 2 */
switch (offset<<2) {
- case 0x0a0: return input_port_read(space->machine, "IN0"); /* Player 1 & 2 controls */
- case 0x158: return input_port_read(space->machine, "IN1"); /* Player 3 & 4 controls */
- case 0xed4: return input_port_read(space->machine, "IN2"); /* Misc */
+ case 0x0a0: return input_port_read(space->machine(), "IN0"); /* Player 1 & 2 controls */
+ case 0x158: return input_port_read(space->machine(), "IN1"); /* Player 3 & 4 controls */
+ case 0xed4: return input_port_read(space->machine(), "IN2"); /* Misc */
}
logerror("%08x: Unmapped protection read %04x\n",cpu_get_pc(space->cpu),offset<<2);
@@ -390,15 +390,15 @@ static READ32_HANDLER( captaven_prot_r )
static READ32_HANDLER( captaven_soundcpu_r )
{
/* Top byte - top bit low == sound cpu busy, bottom word is dips */
- return 0xffff0000 | input_port_read(space->machine, "DSW");
+ return 0xffff0000 | input_port_read(space->machine(), "DSW");
}
static READ32_HANDLER( fghthist_control_r )
{
switch (offset) {
- case 0: return 0xffff0000 | input_port_read(space->machine, "IN0");
- case 1: return 0xffff0000 | input_port_read(space->machine, "IN1"); //check top bits??
- case 2: return 0xfffffffe | eeprom_read_bit(space->machine->device("eeprom"));
+ case 0: return 0xffff0000 | input_port_read(space->machine(), "IN0");
+ case 1: return 0xffff0000 | input_port_read(space->machine(), "IN1"); //check top bits??
+ case 2: return 0xfffffffe | eeprom_read_bit(space->machine().device("eeprom"));
}
return 0xffffffff;
@@ -407,7 +407,7 @@ static READ32_HANDLER( fghthist_control_r )
static WRITE32_HANDLER( fghthist_eeprom_w )
{
if (ACCESSING_BITS_0_7) {
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x10);
eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
@@ -425,21 +425,21 @@ static WRITE32_HANDLER( fghthist_eeprom_w )
static READ32_HANDLER( dragngun_service_r )
{
// logerror("%08x:Read service\n",cpu_get_pc(space->cpu));
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
static READ32_HANDLER( lockload_gun_mirror_r )
{
//logerror("%08x:Read gun %d\n",cpu_get_pc(space->cpu),offset);
-//return ((space->machine->rand()%0xffff)<<16) | space->machine->rand()%0xffff;
+//return ((space->machine().rand()%0xffff)<<16) | space->machine().rand()%0xffff;
if (offset) /* Mirror of player 1 and player 2 fire buttons */
- return input_port_read(space->machine, "IN4") | ((space->machine->rand()%0xff)<<16);
- return input_port_read(space->machine, "IN3") | input_port_read(space->machine, "LIGHT0_X") | (input_port_read(space->machine, "LIGHT0_X")<<16) | (input_port_read(space->machine, "LIGHT0_X")<<24); //((space->machine->rand()%0xff)<<16);
+ return input_port_read(space->machine(), "IN4") | ((space->machine().rand()%0xff)<<16);
+ return input_port_read(space->machine(), "IN3") | input_port_read(space->machine(), "LIGHT0_X") | (input_port_read(space->machine(), "LIGHT0_X")<<16) | (input_port_read(space->machine(), "LIGHT0_X")<<24); //((space->machine().rand()%0xff)<<16);
}
static READ32_HANDLER( dragngun_prot_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
// logerror("%08x:Read prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
if (!state->strobe) state->strobe=8;
@@ -448,9 +448,9 @@ static READ32_HANDLER( dragngun_prot_r )
//definitely vblank in locked load
switch (offset<<1) {
- case 0x140/2: return 0xffff0000 | input_port_read(space->machine, "IN0"); /* IN0 */
- case 0xadc/2: return 0xffff0000 | input_port_read(space->machine, "IN1") | state->strobe; /* IN1 */
- case 0x6a0/2: return 0xffff0000 | input_port_read(space->machine, "DSW"); /* IN2 (Dip switch) */
+ case 0x140/2: return 0xffff0000 | input_port_read(space->machine(), "IN0"); /* IN0 */
+ case 0xadc/2: return 0xffff0000 | input_port_read(space->machine(), "IN1") | state->strobe; /* IN1 */
+ case 0x6a0/2: return 0xffff0000 | input_port_read(space->machine(), "DSW"); /* IN2 (Dip switch) */
}
return 0xffffffff;
}
@@ -458,13 +458,13 @@ static READ32_HANDLER( dragngun_prot_r )
static READ32_HANDLER( dragngun_lightgun_r )
{
- dragngun_state *state = space->machine->driver_data<dragngun_state>();
+ dragngun_state *state = space->machine().driver_data<dragngun_state>();
/* Ports 0-3 are read, but seem unused */
switch (state->dragngun_lightgun_port) {
- case 4: return input_port_read(space->machine, "LIGHT0_X");
- case 5: return input_port_read(space->machine, "LIGHT1_X");
- case 6: return input_port_read(space->machine, "LIGHT0_Y");
- case 7: return input_port_read(space->machine, "LIGHT1_Y");
+ case 4: return input_port_read(space->machine(), "LIGHT0_X");
+ case 5: return input_port_read(space->machine(), "LIGHT1_X");
+ case 6: return input_port_read(space->machine(), "LIGHT0_Y");
+ case 7: return input_port_read(space->machine(), "LIGHT1_Y");
}
// logerror("Illegal lightgun port %d read \n",state->dragngun_lightgun_port);
@@ -473,7 +473,7 @@ static READ32_HANDLER( dragngun_lightgun_r )
static WRITE32_HANDLER( dragngun_lightgun_w )
{
- dragngun_state *state = space->machine->driver_data<dragngun_state>();
+ dragngun_state *state = space->machine().driver_data<dragngun_state>();
// logerror("Lightgun port %d\n",state->dragngun_lightgun_port);
state->dragngun_lightgun_port=offset;
}
@@ -491,7 +491,7 @@ static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w )
eeprom_set_cs_line(device, (data & 0x4) ? CLEAR_LINE : ASSERT_LINE);
return;
}
- logerror("%s:Write control 1 %08x %08x\n",device->machine->describe_context(),offset,data);
+ logerror("%s:Write control 1 %08x %08x\n",device->machine().describe_context(),offset,data);
}
/**********************************************************************************/
@@ -499,10 +499,10 @@ static WRITE32_DEVICE_HANDLER( dragngun_eeprom_w )
static READ32_HANDLER( tattass_prot_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
switch (offset<<1) {
- case 0x280: return input_port_read(space->machine, "IN0") << 16;
- case 0x4c4: return input_port_read(space->machine, "IN1") << 16;
+ case 0x280: return input_port_read(space->machine(), "IN0") << 16;
+ case 0x4c4: return input_port_read(space->machine(), "IN1") << 16;
case 0x35a: return state->tattass_eprom_bit << 16;
}
@@ -524,8 +524,8 @@ static WRITE32_HANDLER( tattass_prot_w )
static WRITE32_HANDLER( tattass_control_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
- eeprom_device *eeprom = space->machine->device<eeprom_device>("eeprom");
+ deco32_state *state = space->machine().driver_data<deco32_state>();
+ eeprom_device *eeprom = space->machine().device<eeprom_device>("eeprom");
address_space *eeprom_space = eeprom->space();
/* Eprom in low byte */
@@ -644,9 +644,9 @@ static WRITE32_HANDLER( tattass_control_w )
/* Sound board reset control */
if (data&0x80)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, ASSERT_LINE);
/* bit 0x4 fade cancel? */
/* bit 0x8 ?? */
@@ -660,9 +660,9 @@ static READ32_HANDLER( nslasher_prot_r )
{
switch (offset<<1) {
- case 0x280: return input_port_read(space->machine, "IN0") << 16| 0xffff; /* IN0 */
- case 0x4c4: return input_port_read(space->machine, "IN1") << 16| 0xffff; /* IN1 */
- case 0x35a: return (eeprom_read_bit(space->machine->device("eeprom"))<< 16) | 0xffff; // Debug switch in low word??
+ case 0x280: return input_port_read(space->machine(), "IN0") << 16| 0xffff; /* IN0 */
+ case 0x4c4: return input_port_read(space->machine(), "IN1") << 16| 0xffff; /* IN1 */
+ case 0x35a: return (eeprom_read_bit(space->machine().device("eeprom"))<< 16) | 0xffff; // Debug switch in low word??
}
//logerror("%08x: Read unmapped prot %08x (%08x)\n",cpu_get_pc(space->cpu),offset<<1,mem_mask);
@@ -674,7 +674,7 @@ static WRITE32_HANDLER( nslasher_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- eeprom_device *device = space->machine->device<eeprom_device>("eeprom");
+ eeprom_device *device = space->machine().device<eeprom_device>("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x10);
eeprom_set_cs_line(device, (data & 0x40) ? CLEAR_LINE : ASSERT_LINE);
@@ -686,7 +686,7 @@ static WRITE32_HANDLER( nslasher_eeprom_w )
static WRITE32_HANDLER( nslasher_prot_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
//logerror("%08x:write prot %08x (%08x) %08x\n",cpu_get_pc(space->cpu),offset<<1,mem_mask,data);
/* Only sound port of chip is used - no protection */
@@ -695,7 +695,7 @@ static WRITE32_HANDLER( nslasher_prot_w )
/* bit 1 of nslasher_sound_irq specifies IRQ command writes */
soundlatch_w(space,0,(data>>16)&0xff);
state->nslasher_sound_irq |= 0x02;
- cputag_set_input_line(space->machine, "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -703,13 +703,13 @@ static WRITE32_HANDLER( nslasher_prot_w )
static READ32_HANDLER( deco32_spriteram_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
return state->spriteram16[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( deco32_spriteram_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
COMBINE_DATA(&state->spriteram16[offset]);
@@ -717,19 +717,19 @@ static WRITE32_HANDLER( deco32_spriteram_w )
static WRITE32_HANDLER( deco32_buffer_spriteram_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
memcpy(state->spriteram16_buffered, state->spriteram16, 0x1000);
}
static READ32_HANDLER( deco32_spriteram2_r )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
return state->spriteram16_2[offset] ^ 0xffff0000;
}
static WRITE32_HANDLER( deco32_spriteram2_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
data &= 0x0000ffff;
mem_mask &= 0x0000ffff;
COMBINE_DATA(&state->spriteram16_2[offset]);
@@ -737,16 +737,16 @@ static WRITE32_HANDLER( deco32_spriteram2_w )
static WRITE32_HANDLER( deco32_buffer_spriteram2_w )
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
memcpy(state->spriteram16_2_buffered, state->spriteram16_2, 0x1000);
}
// tattass tests these as 32-bit ram, even if only 16-bits are hooked up to the tilemap chip - does it mirror parts of the dword?
-static WRITE32_HANDLER( deco32_pf1_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
-static WRITE32_HANDLER( deco32_pf2_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
-static WRITE32_HANDLER( deco32_pf3_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
-static WRITE32_HANDLER( deco32_pf4_rowscroll_w ) { deco32_state *state = space->machine->driver_data<deco32_state>(); COMBINE_DATA(&state->pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf1_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf1_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf1_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf2_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf2_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf2_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf3_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf3_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf3_rowscroll[offset]); }
+static WRITE32_HANDLER( deco32_pf4_rowscroll_w ) { deco32_state *state = space->machine().driver_data<deco32_state>(); COMBINE_DATA(&state->pf4_rowscroll32[offset]); data &= 0x0000ffff; mem_mask &= 0x0000ffff; COMBINE_DATA(&state->pf4_rowscroll[offset]); }
static ADDRESS_MAP_START( captaven_map, AS_PROGRAM, 32 )
@@ -1032,36 +1032,36 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(deco32_bsmt_reset_w)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
UINT8 diff = data ^ state->bsmt_reset;
state->bsmt_reset = data;
if ((diff & 0x80) && !(data & 0x80))
- devtag_reset(space->machine, "bsmt");
+ devtag_reset(space->machine(), "bsmt");
}
static WRITE8_HANDLER(deco32_bsmt0_w)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
state->bsmt_latch = data;
}
static void bsmt_ready_callback(bsmt2000_device &device)
{
- cputag_set_input_line(device.machine, "audiocpu", M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
+ cputag_set_input_line(device.machine(), "audiocpu", M6809_IRQ_LINE, ASSERT_LINE); /* BSMT is ready */
}
static WRITE8_HANDLER(deco32_bsmt1_w)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ deco32_state *state = space->machine().driver_data<deco32_state>();
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
bsmt->write_reg(offset ^ 0xff);
bsmt->write_data((state->bsmt_latch << 8) | data);
- cputag_set_input_line(space->machine, "audiocpu", M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
+ cputag_set_input_line(space->machine(), "audiocpu", M6809_IRQ_LINE, CLEAR_LINE); /* BSMT is not ready */
}
static READ8_HANDLER(deco32_bsmt_status_r)
{
- bsmt2000_device *bsmt = space->machine->device<bsmt2000_device>("bsmt");
+ bsmt2000_device *bsmt = space->machine().device<bsmt2000_device>("bsmt");
return bsmt->read_status() << 7;
}
@@ -1088,10 +1088,10 @@ ADDRESS_MAP_END
static READ8_HANDLER(latch_r)
{
- deco32_state *state = space->machine->driver_data<deco32_state>();
+ deco32_state *state = space->machine().driver_data<deco32_state>();
/* bit 1 of nslasher_sound_irq specifies IRQ command writes */
state->nslasher_sound_irq &= ~0x02;
- cputag_set_input_line(space->machine, "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (state->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
return soundlatch_r(space,0);
}
@@ -1689,24 +1689,24 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "audiocpu", 1, state); /* IRQ 2 */
+ cputag_set_input_line(device->machine(), "audiocpu", 1, state); /* IRQ 2 */
}
static void sound_irq_nslasher(device_t *device, int state)
{
- deco32_state *drvstate = device->machine->driver_data<deco32_state>();
+ deco32_state *drvstate = device->machine().driver_data<deco32_state>();
/* bit 0 of nslasher_sound_irq specifies IRQ from sound chip */
if (state)
drvstate->nslasher_sound_irq |= 0x01;
else
drvstate->nslasher_sound_irq &= ~0x01;
- cputag_set_input_line(device->machine, "audiocpu", 0, (drvstate->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (drvstate->nslasher_sound_irq != 0) ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( sound_bankswitch_w )
{
- okim6295_device *oki1 = device->machine->device<okim6295_device>("oki1");
- okim6295_device *oki2 = device->machine->device<okim6295_device>("oki2");
+ okim6295_device *oki1 = device->machine().device<okim6295_device>("oki1");
+ okim6295_device *oki2 = device->machine().device<okim6295_device>("oki2");
oki1->set_bank_base(((data >> 0)& 1) * 0x40000);
oki2->set_bank_base(((data >> 1)& 1) * 0x40000);
}
@@ -1733,8 +1733,8 @@ static const eeprom_interface eeprom_interface_tattass =
static MACHINE_RESET( deco32 )
{
- deco32_state *state = machine->driver_data<deco32_state>();
- state->raster_irq_timer = machine->device<timer_device>("int_timer");
+ deco32_state *state = machine.driver_data<deco32_state>();
+ state->raster_irq_timer = machine.device<timer_device>("int_timer");
}
static INTERRUPT_GEN( deco32_vbl_interrupt )
@@ -3251,9 +3251,9 @@ static DRIVER_INIT( captaven )
static DRIVER_INIT( dragngun )
{
- UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
- const UINT8 *SRC_RAM = machine->region("gfx1")->base();
- UINT8 *DST_RAM = machine->region("gfx2")->base();
+ UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
+ const UINT8 *SRC_RAM = machine.region("gfx1")->base();
+ UINT8 *DST_RAM = machine.region("gfx2")->base();
deco74_decrypt_gfx(machine, "gfx1");
deco74_decrypt_gfx(machine, "gfx2");
@@ -3275,8 +3275,8 @@ static DRIVER_INIT( fghthist )
static DRIVER_INIT( lockload )
{
- UINT8 *RAM = machine->region("maincpu")->base();
-// UINT32 *ROM = (UINT32 *)machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
+// UINT32 *ROM = (UINT32 *)machine.region("maincpu")->base();
deco74_decrypt_gfx(machine, "gfx1");
deco74_decrypt_gfx(machine, "gfx2");
@@ -3292,7 +3292,7 @@ static DRIVER_INIT( lockload )
static DRIVER_INIT( tattass )
{
- UINT8 *RAM = machine->region("gfx1")->base();
+ UINT8 *RAM = machine.region("gfx1")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Reorder bitplanes to make decoding easier */
@@ -3300,7 +3300,7 @@ static DRIVER_INIT( tattass )
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
- RAM = machine->region("gfx2")->base();
+ RAM = machine.region("gfx2")->base();
memcpy(tmp,RAM+0x80000,0x80000);
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
@@ -3313,7 +3313,7 @@ static DRIVER_INIT( tattass )
static DRIVER_INIT( nslasher )
{
- UINT8 *RAM = machine->region("gfx1")->base();
+ UINT8 *RAM = machine.region("gfx1")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, 0x80000);
/* Reorder bitplanes to make decoding easier */
@@ -3321,7 +3321,7 @@ static DRIVER_INIT( nslasher )
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
- RAM = machine->region("gfx2")->base();
+ RAM = machine.region("gfx2")->base();
memcpy(tmp,RAM+0x80000,0x80000);
memcpy(RAM+0x80000,RAM+0x100000,0x80000);
memcpy(RAM+0x100000,tmp,0x80000);
diff --git a/src/mame/drivers/deco_ld.c b/src/mame/drivers/deco_ld.c
index 53d49172dc7..d928babbd14 100644
--- a/src/mame/drivers/deco_ld.c
+++ b/src/mame/drivers/deco_ld.c
@@ -124,9 +124,9 @@ public:
static SCREEN_UPDATE( rblaster )
{
- deco_ld_state *state = screen->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = screen->machine().driver_data<deco_ld_state>();
UINT8 *videoram = state->videoram;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
int count = 0x0000;
int y,x;
@@ -150,19 +150,19 @@ static SCREEN_UPDATE( rblaster )
static WRITE8_HANDLER( rblaster_sound_w )
{
soundlatch_w(space,0,data);
- device_set_input_line(space->machine->cpu[1], 0, HOLD_LINE);
+ device_set_input_line(space->machine().cpu[1], 0, HOLD_LINE);
}
#endif
static WRITE8_HANDLER( rblaster_vram_bank_w )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
state->vram_bank = data;
}
static READ8_HANDLER( laserdisc_r )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
UINT8 result = laserdisc_data_r(state->laserdisc);
mame_printf_debug("laserdisc_r = %02X\n", result);
return result;
@@ -171,13 +171,13 @@ static READ8_HANDLER( laserdisc_r )
static WRITE8_HANDLER( laserdisc_w )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
state->laserdisc_data = data;
}
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( begas_map, AS_PROGRAM, 8 )
@@ -237,14 +237,14 @@ ADDRESS_MAP_END
#ifdef UNUSED_FUNCTION
static WRITE8_HANDLER( nmimask_w )
{
- deco_ld_state *state = space->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = space->machine().driver_data<deco_ld_state>();
state->nmimask = data & 0x80;
}
#endif
static INTERRUPT_GEN ( sound_interrupt )
{
- deco_ld_state *state = device->machine->driver_data<deco_ld_state>();
+ deco_ld_state *state = device->machine().driver_data<deco_ld_state>();
if (!state->nmimask) device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -510,8 +510,8 @@ GFXDECODE_END
static MACHINE_START( rblaster )
{
- deco_ld_state *state = machine->driver_data<deco_ld_state>();
- state->laserdisc = machine->device("laserdisc");
+ deco_ld_state *state = machine.driver_data<deco_ld_state>();
+ state->laserdisc = machine.device("laserdisc");
}
static MACHINE_CONFIG_START( rblaster, deco_ld_state )
diff --git a/src/mame/drivers/deco_mlc.c b/src/mame/drivers/deco_mlc.c
index ec68d51e8ef..e0c516ab582 100644
--- a/src/mame/drivers/deco_mlc.c
+++ b/src/mame/drivers/deco_mlc.c
@@ -110,9 +110,9 @@
static READ32_HANDLER(test2_r)
{
// if (offset==0)
-// return input_port_read(space->machine, "IN0"); //0xffffffff;
+// return input_port_read(space->machine(), "IN0"); //0xffffffff;
// logerror("%08x: Test2_r %d\n",cpu_get_pc(space->cpu),offset);
- return space->machine->rand(); //0xffffffff;
+ return space->machine().rand(); //0xffffffff;
}
static READ32_HANDLER(test3_r)
@@ -122,7 +122,7 @@ static READ32_HANDLER(test3_r)
*/
//if (offset==0)
-// return space->machine->rand()|(space->machine->rand()<<16);
+// return space->machine().rand()|(space->machine().rand()<<16);
// logerror("%08x: Test3_r %d\n",cpu_get_pc(space->cpu),offset);
return 0xffffffff;
}
@@ -141,19 +141,19 @@ static WRITE32_DEVICE_HANDLER( avengrs_eprom_w )
//volume control todo
}
else
- logerror("%s: eprom_w %08x mask %08x\n",device->machine->describe_context(),data,mem_mask);
+ logerror("%s: eprom_w %08x mask %08x\n",device->machine().describe_context(),data,mem_mask);
}
static WRITE32_HANDLER( avengrs_palette_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
/* x bbbbb ggggg rrrrr */
- palette_set_color_rgb(space->machine,offset,pal5bit(space->machine->generic.paletteram.u32[offset] >> 0),pal5bit(space->machine->generic.paletteram.u32[offset] >> 5),pal5bit(space->machine->generic.paletteram.u32[offset] >> 10));
+ palette_set_color_rgb(space->machine(),offset,pal5bit(space->machine().generic.paletteram.u32[offset] >> 0),pal5bit(space->machine().generic.paletteram.u32[offset] >> 5),pal5bit(space->machine().generic.paletteram.u32[offset] >> 10));
}
static READ32_HANDLER( decomlc_vbl_r )
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
state->vbl_i ^=0xffffffff;
//logerror("vbl r %08x\n", cpu_get_pc(space->cpu));
// Todo: Vblank probably in $10
@@ -162,31 +162,31 @@ static READ32_HANDLER( decomlc_vbl_r )
static READ32_HANDLER( mlc_scanline_r )
{
-// logerror("read scanline counter (%d)\n", space->machine->primary_screen->vpos());
- return space->machine->primary_screen->vpos();
+// logerror("read scanline counter (%d)\n", space->machine().primary_screen->vpos());
+ return space->machine().primary_screen->vpos();
}
static TIMER_DEVICE_CALLBACK( interrupt_gen )
{
- deco_mlc_state *state = timer.machine->driver_data<deco_mlc_state>();
-// logerror("hit scanline IRQ %d (%08x)\n", machine->primary_screen->vpos(), info.i);
- cputag_set_input_line(timer.machine, "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
+ deco_mlc_state *state = timer.machine().driver_data<deco_mlc_state>();
+// logerror("hit scanline IRQ %d (%08x)\n", machine.primary_screen->vpos(), info.i);
+ cputag_set_input_line(timer.machine(), "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, HOLD_LINE);
}
static WRITE32_HANDLER( mlc_irq_w )
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
- int scanline=space->machine->primary_screen->vpos();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
+ int scanline=space->machine().primary_screen->vpos();
state->irq_ram[offset]=data&0xffff;
switch (offset*4)
{
case 0x10: /* IRQ ack. Value written doesn't matter */
- cputag_set_input_line(space->machine, "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", state->mainCpuIsArm ? ARM_IRQ_LINE : 1, CLEAR_LINE);
return;
case 0x14: /* Prepare scanline interrupt */
- state->raster_irq_timer->adjust(space->machine->primary_screen->time_until_pos(state->irq_ram[0x14/4]));
- //logerror("prepare scanline to fire at %d (currently on %d)\n", state->irq_ram[0x14/4], space->machine->primary_screen->vpos());
+ state->raster_irq_timer->adjust(space->machine().primary_screen->time_until_pos(state->irq_ram[0x14/4]));
+ //logerror("prepare scanline to fire at %d (currently on %d)\n", state->irq_ram[0x14/4], space->machine().primary_screen->vpos());
return;
case 0x18:
case 0x1c:
@@ -222,13 +222,13 @@ static WRITE32_HANDLER( mlc_irq_w )
static READ32_HANDLER(mlc_spriteram_r)
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
return state->spriteram[offset]&0xffff;
}
static READ32_HANDLER(mlc_vram_r)
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
return state->mlc_vram[offset]&0xffff;
}
@@ -373,9 +373,9 @@ GFXDECODE_END
static MACHINE_RESET( mlc )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
state->vbl_i = 0xffffffff;
- state->raster_irq_timer = machine->device<timer_device>("int_timer");
+ state->raster_irq_timer = machine.device<timer_device>("int_timer");
}
static MACHINE_CONFIG_START( avengrgs, deco_mlc_state )
@@ -695,11 +695,11 @@ ROM_END
/***************************************************************************/
-static void descramble_sound( running_machine *machine )
+static void descramble_sound( running_machine &machine )
{
/* the same as simpl156 / heavy smash? */
- UINT8 *rom = machine->region("ymz")->base();
- int length = machine->region("ymz")->bytes();
+ UINT8 *rom = machine.region("ymz")->base();
+ int length = machine.region("ymz")->bytes();
UINT8 *buf1 = auto_alloc_array(machine, UINT8, length);
UINT32 x;
@@ -725,7 +725,7 @@ static void descramble_sound( running_machine *machine )
static READ32_HANDLER( avengrgs_speedup_r )
{
- deco_mlc_state *state = space->machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = space->machine().driver_data<deco_mlc_state>();
UINT32 a=state->mlc_ram[0x89a0/4];
UINT32 p=cpu_get_pc(space->cpu);
@@ -736,26 +736,26 @@ static READ32_HANDLER( avengrgs_speedup_r )
static DRIVER_INIT( avengrgs )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
// init options
- sh2drc_set_options(machine->device("maincpu"), SH2DRC_FASTEST_OPTIONS);
+ sh2drc_set_options(machine.device("maincpu"), SH2DRC_FASTEST_OPTIONS);
// set up speed cheat
- sh2drc_add_pcflush(machine->device("maincpu"), 0x3234);
- sh2drc_add_pcflush(machine->device("maincpu"), 0x32dc);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x3234);
+ sh2drc_add_pcflush(machine.device("maincpu"), 0x32dc);
state->mainCpuIsArm = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01089a0, 0x01089a3, FUNC(avengrgs_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x01089a0, 0x01089a3, FUNC(avengrgs_speedup_r) );
descramble_sound(machine);
}
static DRIVER_INIT( mlc )
{
- deco_mlc_state *state = machine->driver_data<deco_mlc_state>();
+ deco_mlc_state *state = machine.driver_data<deco_mlc_state>();
/* The timing in the ARM core isn't as accurate as it should be, so bump up the
effective clock rate here to compensate otherwise we have slowdowns in
Skull Fung where there probably shouldn't be. */
- machine->device("maincpu")->set_clock_scale(2.0f);
+ machine.device("maincpu")->set_clock_scale(2.0f);
state->mainCpuIsArm = 1;
deco156_decrypt(machine);
descramble_sound(machine);
diff --git a/src/mame/drivers/decocass.c b/src/mame/drivers/decocass.c
index 1a304888461..f0376d298d6 100644
--- a/src/mame/drivers/decocass.c
+++ b/src/mame/drivers/decocass.c
@@ -57,42 +57,42 @@ INLINE int swap_bits_5_6(int data)
static WRITE8_HANDLER( ram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0x0000 + offset] = swap_bits_5_6(data);
state->rambase[0x0000 + offset] = data;
}
static WRITE8_HANDLER( charram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0x6000 + offset] = swap_bits_5_6(data);
decocass_charram_w(space, offset, data);
}
static WRITE8_HANDLER( fgvideoram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xc000 + offset] = swap_bits_5_6(data);
decocass_fgvideoram_w(space, offset, data);
}
static WRITE8_HANDLER( fgcolorram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xc400 + offset] = swap_bits_5_6(data);
decocass_colorram_w(space, offset, data);
}
static WRITE8_HANDLER( tileram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xd000 + offset] = swap_bits_5_6(data);
decocass_tileram_w(space, offset, data);
}
static WRITE8_HANDLER( objectram_w )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
state->decrypted[0xd800 + offset] = swap_bits_5_6(data);
decocass_objectram_w(space, offset, data);
}
@@ -102,14 +102,14 @@ static WRITE8_HANDLER( mirrorcolorram_w ) { offset = ((offset >> 5) & 0x1f) | ((
static READ8_HANDLER( mirrorvideoram_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
return state->fgvideoram[offset];
}
static READ8_HANDLER( mirrorcolorram_r )
{
- decocass_state *state = space->machine->driver_data<decocass_state>();
+ decocass_state *state = space->machine().driver_data<decocass_state>();
offset = ((offset >> 5) & 0x1f) | ((offset & 0x1f) << 5);
return state->colorram[offset];
}
@@ -601,28 +601,28 @@ static PALETTE_INIT( decocass )
{
int i;
- machine->colortable = colortable_alloc(machine, 32);
+ machine.colortable = colortable_alloc(machine, 32);
/* set up 32 colors 1:1 pens */
for (i = 0; i < 32; i++)
- colortable_entry_set_value(machine->colortable, i, i);
+ colortable_entry_set_value(machine.colortable, i, i);
/* setup straight/flipped colors for background tiles (D7 of color_center_bot ?) */
for (i = 0; i < 8; i++)
{
- colortable_entry_set_value(machine->colortable, 32+i, 3*8+i);
- colortable_entry_set_value(machine->colortable, 40+i, 3*8+((i << 1) & 0x04) + ((i >> 1) & 0x02) + (i & 0x01));
+ colortable_entry_set_value(machine.colortable, 32+i, 3*8+i);
+ colortable_entry_set_value(machine.colortable, 40+i, 3*8+((i << 1) & 0x04) + ((i >> 1) & 0x02) + (i & 0x01));
}
/* setup 4 colors for 1bpp object */
- colortable_entry_set_value(machine->colortable, 48+0*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+0*2+1, 25); /* testtape red from 4th palette section? */
- colortable_entry_set_value(machine->colortable, 48+1*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+1*2+1, 28); /* testtape blue from 4th palette section? */
- colortable_entry_set_value(machine->colortable, 48+2*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+2*2+1, 26); /* testtape green from 4th palette section? */
- colortable_entry_set_value(machine->colortable, 48+3*2+0, 0);
- colortable_entry_set_value(machine->colortable, 48+3*2+1, 23); /* ???? */
+ colortable_entry_set_value(machine.colortable, 48+0*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+0*2+1, 25); /* testtape red from 4th palette section? */
+ colortable_entry_set_value(machine.colortable, 48+1*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+1*2+1, 28); /* testtape blue from 4th palette section? */
+ colortable_entry_set_value(machine.colortable, 48+2*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+2*2+1, 26); /* testtape green from 4th palette section? */
+ colortable_entry_set_value(machine.colortable, 48+3*2+0, 0);
+ colortable_entry_set_value(machine.colortable, 48+3*2+1, 23); /* ???? */
}
@@ -1323,9 +1323,9 @@ ROM_END
static DRIVER_INIT( decocass )
{
- decocass_state *state = machine->driver_data<decocass_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ decocass_state *state = machine.driver_data<decocass_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
/* allocate memory and mark all RAM regions with their decrypted pointers */
@@ -1348,9 +1348,9 @@ static DRIVER_INIT( decocass )
static DRIVER_INIT( decocrom )
{
- decocass_state *state = machine->driver_data<decocass_state>();
- int romlength = machine->region("user3")->bytes();
- UINT8 *rom = machine->region("user3")->base();
+ decocass_state *state = machine.driver_data<decocass_state>();
+ int romlength = machine.region("user3")->bytes();
+ UINT8 *rom = machine.region("user3")->base();
int i;
state->decrypted2 = auto_alloc_array(machine, UINT8, romlength);
@@ -1363,16 +1363,16 @@ static DRIVER_INIT( decocrom )
state->decrypted2[i] = swap_bits_5_6(rom[i]);
/* convert charram to a banked ROM */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0xafff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x6000, 0xafff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x6000, 0xafff, FUNC(decocass_de0091_w));
memory_configure_bank(machine, "bank1", 0, 1, state->charram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user3")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user3")->base(), 0);
memory_configure_bank_decrypted(machine, "bank1", 0, 1, &state->decrypted[0x6000], 0);
memory_configure_bank_decrypted(machine, "bank1", 1, 1, state->decrypted2, 0);
memory_set_bank(machine, "bank1", 0);
/* install the bank selector */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe900, 0xe900, FUNC(decocass_e900_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe900, 0xe900, FUNC(decocass_e900_w));
state->save_pointer(NAME(state->decrypted2), romlength);
}
diff --git a/src/mame/drivers/deniam.c b/src/mame/drivers/deniam.c
index 4e4989068da..75219f76258 100644
--- a/src/mame/drivers/deniam.c
+++ b/src/mame/drivers/deniam.c
@@ -50,7 +50,7 @@ Notes:
static WRITE16_HANDLER( sound_command_w )
{
- deniam_state *state = space->machine->driver_data<deniam_state>();
+ deniam_state *state = space->machine().driver_data<deniam_state>();
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space,offset, (data >> 8) & 0xff);
@@ -75,7 +75,7 @@ static WRITE16_DEVICE_HANDLER( deniam16c_oki_rom_bank_w )
static WRITE16_HANDLER( deniam_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 4, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, CLEAR_LINE);
}
static ADDRESS_MAP_START( deniam16b_map, AS_PROGRAM, 16 )
@@ -223,7 +223,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- deniam_state *state = device->machine->driver_data<deniam_state>();
+ deniam_state *state = device->machine().driver_data<deniam_state>();
/* system 16c doesn't have the sound CPU */
if (state->audio_cpu != NULL)
@@ -239,9 +239,9 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( deniam )
{
- deniam_state *state = machine->driver_data<deniam_state>();
+ deniam_state *state = machine.driver_data<deniam_state>();
- state->audio_cpu = machine->device("audiocpu");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->display_enable));
state->save_item(NAME(state->coinctrl));
@@ -264,7 +264,7 @@ static MACHINE_START( deniam )
static MACHINE_RESET( deniam )
{
/* logicpr2 does not reset the bank base on startup */
- machine->device<okim6295_device>("oki")->set_bank_base(0x00000);
+ machine.device<okim6295_device>("oki")->set_bank_base(0x00000);
}
static MACHINE_CONFIG_START( deniam16b, deniam_state )
diff --git a/src/mame/drivers/deshoros.c b/src/mame/drivers/deshoros.c
index bf573700918..3ec4e4b8f62 100644
--- a/src/mame/drivers/deshoros.c
+++ b/src/mame/drivers/deshoros.c
@@ -32,7 +32,7 @@ public:
static VIDEO_START( deshoros )
{
- deshoros_state *state = machine->driver_data<deshoros_state>();
+ deshoros_state *state = machine.driver_data<deshoros_state>();
UINT8 i;
for(i=0;i<20;i++)
state->led_array[i] = 0x20;
@@ -41,7 +41,7 @@ static VIDEO_START( deshoros )
static SCREEN_UPDATE( deshoros )
{
- deshoros_state *state = screen->machine->driver_data<deshoros_state>();
+ deshoros_state *state = screen->machine().driver_data<deshoros_state>();
popmessage("%s",state->led_array);
return 0;
}
@@ -58,12 +58,12 @@ static void update_led_array(deshoros_state *state, UINT8 new_data)
}
-static void answer_bankswitch(running_machine *machine,UINT8 new_bank)
+static void answer_bankswitch(running_machine &machine,UINT8 new_bank)
{
- deshoros_state *state = machine->driver_data<deshoros_state>();
+ deshoros_state *state = machine.driver_data<deshoros_state>();
if(state->bank!=new_bank)
{
- UINT8 *ROM = machine->region("data")->base();
+ UINT8 *ROM = machine.region("data")->base();
UINT32 bankaddress;
state->bank = new_bank;
@@ -74,13 +74,13 @@ static void answer_bankswitch(running_machine *machine,UINT8 new_bank)
static READ8_HANDLER( io_r )
{
- deshoros_state *state = space->machine->driver_data<deshoros_state>();
+ deshoros_state *state = space->machine().driver_data<deshoros_state>();
switch(offset)
{
case 0x00: return 0xff; //printer read
- case 0x03: return input_port_read(space->machine, "KEY0" );
- case 0x04: return input_port_read(space->machine, "KEY1" );
- case 0x05: return input_port_read(space->machine, "SYSTEM" );
+ case 0x03: return input_port_read(space->machine(), "KEY0" );
+ case 0x04: return input_port_read(space->machine(), "KEY1" );
+ case 0x05: return input_port_read(space->machine(), "SYSTEM" );
case 0x0a: return state->io_ram[offset]; //"buzzer" 0 read
case 0x0b: return state->io_ram[offset]; //"buzzer" 1 read
}
@@ -91,16 +91,16 @@ static READ8_HANDLER( io_r )
static WRITE8_HANDLER( io_w )
{
- deshoros_state *state = space->machine->driver_data<deshoros_state>();
+ deshoros_state *state = space->machine().driver_data<deshoros_state>();
switch(offset)
{
case 0x00: /*Printer data*/ return;
case 0x02: update_led_array(state, data); return;
- case 0x05: coin_lockout_w(space->machine, 0,state->io_ram[offset] & 1);return;
+ case 0x05: coin_lockout_w(space->machine(), 0,state->io_ram[offset] & 1);return;
case 0x06: /*Printer IRQ enable*/ return;
// case 0x0a: "buzzer" 0 write
// case 0x0b: "buzzer" 1 write
- case 0x0c: answer_bankswitch(space->machine,data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data...
+ case 0x0c: answer_bankswitch(space->machine(),data&0x03); return; //data & 0x10 enabled too,dunno if it is worth to shift the data...
}
state->io_ram[offset] = data;
// printf("%02x -> [%02x]\n",data,offset);
@@ -161,12 +161,12 @@ INPUT_PORTS_END
/*Is it there an IRQ mask?*/
static INTERRUPT_GEN( deshoros_irq )
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
}
static MACHINE_RESET( deshoros )
{
- deshoros_state *state = machine->driver_data<deshoros_state>();
+ deshoros_state *state = machine.driver_data<deshoros_state>();
state->bank = -1;
}
diff --git a/src/mame/drivers/destroyr.c b/src/mame/drivers/destroyr.c
index 992a1a718ae..9306b4edb4b 100644
--- a/src/mame/drivers/destroyr.c
+++ b/src/mame/drivers/destroyr.c
@@ -38,7 +38,7 @@ public:
static SCREEN_UPDATE( destroyr )
{
- destroyr_state *state = screen->machine->driver_data<destroyr_state>();
+ destroyr_state *state = screen->machine().driver_data<destroyr_state>();
int i, j;
bitmap_fill(bitmap, cliprect, 0);
@@ -64,7 +64,7 @@ static SCREEN_UPDATE( destroyr )
continue;
}
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[2], num, 0, flipx, 0, horz, 16 * i, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[2], num, 0, flipx, 0, horz, 16 * i, 0);
}
/* draw alpha numerics */
@@ -74,7 +74,7 @@ static SCREEN_UPDATE( destroyr )
{
int num = state->alpha_num_ram[32 * i + j];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], num, 0, 0, 0, 8 * j, 8 * i, 0);
}
}
@@ -85,13 +85,13 @@ static SCREEN_UPDATE( destroyr )
int horz = 256 - state->minor_obj_ram[i + 2];
int vert = 256 - state->minor_obj_ram[i + 4];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], num, 0, 0, 0, horz, vert, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], num, 0, 0, 0, horz, vert, 0);
}
/* draw waves */
for (i = 0; i < 4; i++)
{
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[3], state->wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[3], state->wavemod ? 1 : 0, 0, 0, 0, 64 * i, 0x4e, 0);
}
/* draw cursor */
@@ -105,7 +105,7 @@ static SCREEN_UPDATE( destroyr )
static TIMER_CALLBACK( destroyr_dial_callback )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
int dial = param;
/* Analog inputs come from the player's depth control potentiometer.
@@ -126,21 +126,21 @@ static TIMER_CALLBACK( destroyr_dial_callback )
static TIMER_CALLBACK( destroyr_frame_callback )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
state->potsense[0] = 0;
state->potsense[1] = 0;
/* PCB supports two dials, but cab has only got one */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(input_port_read(machine, "PADDLE")), FUNC(destroyr_dial_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
}
static MACHINE_RESET( destroyr )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(destroyr_frame_callback));
state->cursor = 0;
state->wavemod = 0;
@@ -156,7 +156,7 @@ static MACHINE_RESET( destroyr )
static WRITE8_HANDLER( destroyr_misc_w )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
/* bits 0 to 2 connect to the sound circuits */
state->attract = data & 0x01;
@@ -166,14 +166,14 @@ static WRITE8_HANDLER( destroyr_misc_w )
state->wavemod = data & 0x10;
state->potmask[1] = data & 0x20;
- coin_lockout_w(space->machine, 0, !state->attract);
- coin_lockout_w(space->machine, 1, !state->attract);
+ coin_lockout_w(space->machine(), 0, !state->attract);
+ coin_lockout_w(space->machine(), 1, !state->attract);
}
static WRITE8_HANDLER( destroyr_cursor_load_w )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
state->cursor = data;
watchdog_reset_w(space, offset, data);
}
@@ -181,7 +181,7 @@ static WRITE8_HANDLER( destroyr_cursor_load_w )
static WRITE8_HANDLER( destroyr_interrupt_ack_w )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
@@ -193,10 +193,10 @@ static WRITE8_HANDLER( destroyr_output_w )
else switch (offset & 7)
{
case 0:
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
break;
case 1:
- set_led_status(space->machine, 1, data & 1); /* no second LED present on cab */
+ set_led_status(space->machine(), 1, data & 1); /* no second LED present on cab */
break;
case 2:
/* bit 0 => songate */
@@ -222,16 +222,16 @@ static WRITE8_HANDLER( destroyr_output_w )
static READ8_HANDLER( destroyr_input_r )
{
- destroyr_state *state = space->machine->driver_data<destroyr_state>();
+ destroyr_state *state = space->machine().driver_data<destroyr_state>();
if (offset & 1)
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
else
{
- UINT8 ret = input_port_read(space->machine, "IN0");
+ UINT8 ret = input_port_read(space->machine(), "IN0");
if (state->potsense[0] && state->potmask[0])
ret |= 4;
@@ -245,7 +245,7 @@ static READ8_HANDLER( destroyr_input_r )
static READ8_HANDLER( destroyr_scanline_r )
{
- return space->machine->primary_screen->vpos();
+ return space->machine().primary_screen->vpos();
}
@@ -422,9 +422,9 @@ static PALETTE_INIT( destroyr )
static MACHINE_START( destroyr )
{
- destroyr_state *state = machine->driver_data<destroyr_state>();
+ destroyr_state *state = machine.driver_data<destroyr_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->cursor));
state->save_item(NAME(state->wavemod));
diff --git a/src/mame/drivers/dgpix.c b/src/mame/drivers/dgpix.c
index dca7df67e7f..54cfe1ce78b 100644
--- a/src/mame/drivers/dgpix.c
+++ b/src/mame/drivers/dgpix.c
@@ -70,8 +70,8 @@ public:
static READ32_HANDLER( flash_r )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
- UINT32 *ROM = (UINT32 *)space->machine->region("user1")->base();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
+ UINT32 *ROM = (UINT32 *)space->machine().region("user1")->base();
if(offset >= (0x2000000 - state->flash_roms * 0x400000) / 4)
{
@@ -102,14 +102,14 @@ static READ32_HANDLER( flash_r )
static WRITE32_HANDLER( flash_w )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
if(state->flash_cmd == 0x20200000)
{
// erase game settings
if(data == 0xd0d00000)
{
// point to game settings
- UINT8 *rom = (UINT8 *)space->machine->region("user1")->base() + offset*4;
+ UINT8 *rom = (UINT8 *)space->machine().region("user1")->base() + offset*4;
// erase one block
memset(rom, 0xff, 0x10000);
@@ -127,7 +127,7 @@ static WRITE32_HANDLER( flash_w )
}
else
{
- UINT16 *rom = (UINT16 *)space->machine->region("user1")->base();
+ UINT16 *rom = (UINT16 *)space->machine().region("user1")->base();
// write game settings
@@ -150,7 +150,7 @@ static WRITE32_HANDLER( flash_w )
static WRITE32_HANDLER( vram_w )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
UINT32 *dest = &state->vram[offset+(0x40000/4)*state->vbuffer];
if (mem_mask == 0xffffffff)
@@ -168,13 +168,13 @@ static WRITE32_HANDLER( vram_w )
static READ32_HANDLER( vram_r )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
return state->vram[offset+(0x40000/4)*state->vbuffer];
}
static WRITE32_HANDLER( vbuffer_w )
{
- dgpix_state *state = space->machine->driver_data<dgpix_state>();
+ dgpix_state *state = space->machine().driver_data<dgpix_state>();
if(state->old_vbuf == 3 && (data & 3) == 2)
{
state->vbuffer ^= 1;
@@ -185,15 +185,15 @@ static WRITE32_HANDLER( vbuffer_w )
static WRITE32_HANDLER( coin_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
static READ32_HANDLER( vblank_r )
{
/* burn a bunch of cycles because this is polled frequently during busy loops */
device_eat_cycles(space->cpu, 100);
- return input_port_read(space->machine, "VBLANK");
+ return input_port_read(space->machine(), "VBLANK");
}
static ADDRESS_MAP_START( cpu_map, AS_PROGRAM, 32 )
@@ -221,7 +221,7 @@ static NVRAM_HANDLER( flashroms )
if (read_or_write)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000 + 0x360000;
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000 + 0x360000;
UINT8 tmp[0x40000];
int i;
@@ -234,7 +234,7 @@ static NVRAM_HANDLER( flashroms )
else if (file)
{
// point to game settings
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000 + 0x360000;
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000 + 0x360000;
UINT8 tmp[0x40000];
int i;
@@ -281,13 +281,13 @@ INPUT_PORTS_END
static VIDEO_START( dgpix )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
+ dgpix_state *state = machine.driver_data<dgpix_state>();
state->vram = auto_alloc_array(machine, UINT32, 0x40000*2/4);
}
static SCREEN_UPDATE( dgpix )
{
- dgpix_state *state = screen->machine->driver_data<dgpix_state>();
+ dgpix_state *state = screen->machine().driver_data<dgpix_state>();
int y;
for (y = 0; y < 240; y++)
@@ -311,7 +311,7 @@ static SCREEN_UPDATE( dgpix )
static MACHINE_RESET( dgpix )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
+ dgpix_state *state = machine.driver_data<dgpix_state>();
state->vbuffer = 0;
state->flash_cmd = 0;
state->first_offset = -1;
@@ -572,8 +572,8 @@ ROM_END
static DRIVER_INIT( xfiles )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000;
+ dgpix_state *state = machine.driver_data<dgpix_state>();
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000;
rom[BYTE4_XOR_BE(0x3aa92e)] = 3;
rom[BYTE4_XOR_BE(0x3aa92f)] = 0;
@@ -583,15 +583,15 @@ static DRIVER_INIT( xfiles )
rom[BYTE4_XOR_BE(0x3aa933)] = 0;
// protection related ?
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0xf0c8b440, 0xf0c8b447);
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0xf0c8b440, 0xf0c8b447);
state->flash_roms = 2;
}
static DRIVER_INIT( kdynastg )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
- UINT8 *rom = (UINT8 *)machine->region("user1")->base() + 0x1c00000;
+ dgpix_state *state = machine.driver_data<dgpix_state>();
+ UINT8 *rom = (UINT8 *)machine.region("user1")->base() + 0x1c00000;
rom[BYTE4_XOR_BE(0x3aaa10)] = 3; // 129f0 - nopped call
rom[BYTE4_XOR_BE(0x3aaa11)] = 0;
@@ -604,14 +604,14 @@ static DRIVER_INIT( kdynastg )
rom[BYTE4_XOR_BE(0x3a45c9)] = 0;
// protection related ?
-// machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x12341234, 0x12341243);
+// machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x12341234, 0x12341243);
state->flash_roms = 4;
}
static DRIVER_INIT( fmaniac3 )
{
- dgpix_state *state = machine->driver_data<dgpix_state>();
+ dgpix_state *state = machine.driver_data<dgpix_state>();
state->flash_roms = 2;
}
diff --git a/src/mame/drivers/dietgo.c b/src/mame/drivers/dietgo.c
index e413de624a4..c713bb33136 100644
--- a/src/mame/drivers/dietgo.c
+++ b/src/mame/drivers/dietgo.c
@@ -162,7 +162,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- dietgo_state *driver_state = device->machine->driver_data<dietgo_state>();
+ dietgo_state *driver_state = device->machine().driver_data<dietgo_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -197,11 +197,11 @@ static const deco16ic_interface dietgo_deco16ic_tilegen1_intf =
static MACHINE_START( dietgo )
{
- dietgo_state *state = machine->driver_data<dietgo_state>();
+ dietgo_state *state = machine.driver_data<dietgo_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( dietgo, dietgo_state )
diff --git a/src/mame/drivers/discoboy.c b/src/mame/drivers/discoboy.c
index c9cdb07ac90..810172b50f7 100644
--- a/src/mame/drivers/discoboy.c
+++ b/src/mame/drivers/discoboy.c
@@ -72,9 +72,9 @@ static VIDEO_START( discoboy )
{
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
int flipscreen = 0;
int offs, sx, sy;
@@ -107,11 +107,11 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
else
{
- code = machine->rand();
+ code = machine.rand();
}
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
code,
color,
flipscreen,0,
@@ -122,7 +122,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( discoboy )
{
- discoboy_state *state = screen->machine->driver_data<discoboy_state>();
+ discoboy_state *state = screen->machine().driver_data<discoboy_state>();
UINT16 x, y;
int i;
int count = 0;
@@ -137,7 +137,7 @@ static SCREEN_UPDATE( discoboy )
g = ((pal >> 4) & 0xf) << 4;
r = ((pal >> 8) & 0xf) << 4;
- palette_set_color(screen->machine, i / 2, MAKE_RGB(r, g, b));
+ palette_set_color(screen->machine(), i / 2, MAKE_RGB(r, g, b));
}
for (i = 0; i < 0x800; i += 2)
@@ -150,7 +150,7 @@ static SCREEN_UPDATE( discoboy )
g = ((pal >> 4) & 0xf) << 4;
r = ((pal >> 8) & 0xf) << 4;
- palette_set_color(screen->machine, (i / 2) + 0x400, MAKE_RGB(r, g, b));
+ palette_set_color(screen->machine(), (i / 2) + 0x400, MAKE_RGB(r, g, b));
}
bitmap_fill(bitmap, cliprect, 0x3ff);
@@ -169,54 +169,54 @@ static SCREEN_UPDATE( discoboy )
tileno = 0x2000 + (tileno & 0x1fff) + 0x0000;
}
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[1], tileno, state->ram_att[count / 2], 0, 0, x*8, y*8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[1], tileno, state->ram_att[count / 2], 0, 0, x*8, y*8);
count += 2;
}
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
#ifdef UNUSED_FUNCTION
-void discoboy_setrombank( running_machine *machine, UINT8 data )
+void discoboy_setrombank( running_machine &machine, UINT8 data )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
data &= 0x2f;
- memory_set_bankptr(space->machine, "bank1", &ROM[0x6000 + (data * 0x1000)] );
+ memory_set_bankptr(space->machine(), "bank1", &ROM[0x6000 + (data * 0x1000)] );
}
#endif
static WRITE8_HANDLER( rambank_select_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
state->ram_bank = data;
if (data &= 0x83) logerror("rambank_select_w !!!!!");
}
static WRITE8_HANDLER( discoboy_port_00_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (data & 0xfe) logerror("unk discoboy_port_00_w %02x\n",data);
state->port_00 = data;
}
static WRITE8_HANDLER( discoboy_port_01_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
// 00 10 20 30 during gameplay 1,2,3 other times?? title screen bit 0x40 toggle
//printf("unk discoboy_port_01_w %02x\n",data);
// discoboy gfxbank
state->gfxbank = data & 0xf0;
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static WRITE8_HANDLER( discoboy_port_03_w ) // sfx? (to sound cpu)
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
// printf("unk discoboy_port_03_w %02x\n", data);
// device_set_input_line(state->audiocpu, INPUT_LINE_NMI, HOLD_LINE);
soundlatch_w(space, 0, data);
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( discoboy_port_06_w )
static WRITE8_HANDLER( rambank_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->ram_bank & 0x20)
state->ram_2[offset] = data;
@@ -242,7 +242,7 @@ static WRITE8_HANDLER( rambank_w )
static READ8_HANDLER( rambank_r )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->ram_bank & 0x20)
return state->ram_2[offset];
@@ -252,7 +252,7 @@ static READ8_HANDLER( rambank_r )
static READ8_HANDLER( rambank2_r )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->port_00 == 0x00)
return state->ram_3[offset];
@@ -261,12 +261,12 @@ static READ8_HANDLER( rambank2_r )
else
printf("unk rb2_r\n");
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( rambank2_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
if (state->port_00 == 0x00)
state->ram_3[offset] = data;
@@ -278,13 +278,13 @@ static WRITE8_HANDLER( rambank2_w )
static READ8_HANDLER( discoboy_ram_att_r )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
return state->ram_att[offset];
}
static WRITE8_HANDLER( discoboy_ram_att_w )
{
- discoboy_state *state = space->machine->driver_data<discoboy_state>();
+ discoboy_state *state = space->machine().driver_data<discoboy_state>();
state->ram_att[offset] = data;
}
@@ -323,7 +323,7 @@ ADDRESS_MAP_END
static void splash_msm5205_int( device_t *device )
{
- discoboy_state *state = device->machine->driver_data<discoboy_state>();
+ discoboy_state *state = device->machine().driver_data<discoboy_state>();
msm5205_data_w(device, state->adpcm_data >> 4);
// state->adpcm_data = (state->adpcm_data << 4) & 0xf0;
}
@@ -442,9 +442,9 @@ static const msm5205_interface discoboy_msm5205_interface =
static MACHINE_START( discoboy )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->ram_bank));
state->save_item(NAME(state->port_00));
@@ -454,7 +454,7 @@ static MACHINE_START( discoboy )
static MACHINE_RESET( discoboy )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
state->ram_bank = 0;
state->port_00 = 0;
@@ -535,8 +535,8 @@ ROM_END
static DRIVER_INIT( discoboy )
{
- discoboy_state *state = machine->driver_data<discoboy_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ discoboy_state *state = machine.driver_data<discoboy_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memset(state->ram_1, 0, sizeof(state->ram_1));
memset(state->ram_2, 0, sizeof(state->ram_2));
diff --git a/src/mame/drivers/diverboy.c b/src/mame/drivers/diverboy.c
index 75ff5045b2a..3b7876ec579 100644
--- a/src/mame/drivers/diverboy.c
+++ b/src/mame/drivers/diverboy.c
@@ -73,9 +73,9 @@ static VIDEO_START(diverboy)
{
}
-static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine& machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- diverboy_state *state = machine->driver_data<diverboy_state>();
+ diverboy_state *state = machine.driver_data<diverboy_state>();
UINT16 *source = state->spriteram;
UINT16 *finish = source + (state->spriteram_size / 2);
@@ -95,9 +95,9 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
bank = (source[1] & 0x0002) >> 1;
- if (!flash || (machine->primary_screen->frame_number() & 1))
+ if (!flash || (machine.primary_screen->frame_number() & 1))
{
- drawgfx_transpen(bitmap,cliprect,machine->gfx[bank],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[bank],
number,
colr,
0,0,
@@ -111,15 +111,15 @@ static void draw_sprites( running_machine* machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE(diverboy)
{
-// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
- draw_sprites(screen->machine, bitmap, cliprect);
+// bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE16_HANDLER( soundcmd_w )
{
- diverboy_state *state = space->machine->driver_data<diverboy_state>();
+ diverboy_state *state = space->machine().driver_data<diverboy_state>();
if (ACCESSING_BITS_0_7)
{
@@ -244,9 +244,9 @@ GFXDECODE_END
static MACHINE_START( diverboy )
{
- diverboy_state *state = machine->driver_data<diverboy_state>();
+ diverboy_state *state = machine.driver_data<diverboy_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( diverboy, diverboy_state )
diff --git a/src/mame/drivers/djboy.c b/src/mame/drivers/djboy.c
index 0ea7be6b8fb..b67491fc678 100644
--- a/src/mame/drivers/djboy.c
+++ b/src/mame/drivers/djboy.c
@@ -149,7 +149,7 @@ Notes:
static WRITE8_HANDLER( beast_data_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->data_to_beast = data;
state->z80_to_beast_full = 1;
@@ -159,7 +159,7 @@ static WRITE8_HANDLER( beast_data_w )
static READ8_HANDLER( beast_data_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->beast_to_z80_full = 0;
return state->data_to_z80;
@@ -167,7 +167,7 @@ static READ8_HANDLER( beast_data_r )
static READ8_HANDLER( beast_status_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
return (!state->beast_to_z80_full << 2) | (state->z80_to_beast_full << 3);
}
@@ -175,17 +175,17 @@ static READ8_HANDLER( beast_status_r )
static WRITE8_HANDLER( trigger_nmi_on_cpu0 )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( cpu0_bankswitch_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
data ^= state->bankxor;
- memory_set_bank(space->machine, "bank1", data);
- memory_set_bank(space->machine, "bank4", 0); /* unsure if/how this area is banked */
+ memory_set_bank(space->machine(), "bank1", data);
+ memory_set_bank(space->machine(), "bank4", 0); /* unsure if/how this area is banked */
}
/******************************************************************************/
@@ -198,7 +198,7 @@ static WRITE8_HANDLER( cpu0_bankswitch_w )
*/
static WRITE8_HANDLER( cpu1_bankswitch_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->videoreg = data;
switch (data & 0xf)
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
case 0x01:
case 0x02:
case 0x03:
- memory_set_bank(space->machine, "bank2", (data & 0xf));
+ memory_set_bank(space->machine(), "bank2", (data & 0xf));
break;
/* bs101.6w */
@@ -220,7 +220,7 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
case 0x0d:
case 0x0e:
case 0x0f:
- memory_set_bank(space->machine, "bank2", (data & 0xf) - 4);
+ memory_set_bank(space->machine(), "bank2", (data & 0xf) - 4);
break;
default:
@@ -230,22 +230,22 @@ static WRITE8_HANDLER( cpu1_bankswitch_w )
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
/******************************************************************************/
static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->cpu2, INPUT_LINE_NMI, PULSE_LINE);
} /* trigger_nmi_on_sound_cpu2 */
static WRITE8_HANDLER( cpu2_bankswitch_w )
{
- memory_set_bank(space->machine, "bank3", data); // shall we check data<0x07?
+ memory_set_bank(space->machine(), "bank3", data); // shall we check data<0x07?
}
/******************************************************************************/
@@ -315,7 +315,7 @@ static READ8_HANDLER( beast_p0_r )
static WRITE8_HANDLER( beast_p0_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
if (!BIT(state->beast_p0, 1) && BIT(data, 1))
{
@@ -331,7 +331,7 @@ static WRITE8_HANDLER( beast_p0_w )
static READ8_HANDLER( beast_p1_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
if (BIT(state->beast_p0, 0) == 0)
return state->data_to_beast;
@@ -341,7 +341,7 @@ static READ8_HANDLER( beast_p1_r )
static WRITE8_HANDLER( beast_p1_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
if (data == 0xff)
{
@@ -354,30 +354,30 @@ static WRITE8_HANDLER( beast_p1_w )
static READ8_HANDLER( beast_p2_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
switch ((state->beast_p0 >> 2) & 3)
{
- case 0: return input_port_read(space->machine, "IN1");
- case 1: return input_port_read(space->machine, "IN2");
- case 2: return input_port_read(space->machine, "IN0");
+ case 0: return input_port_read(space->machine(), "IN1");
+ case 1: return input_port_read(space->machine(), "IN2");
+ case 2: return input_port_read(space->machine(), "IN0");
default: return 0xff;
}
}
static WRITE8_HANDLER( beast_p2_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->beast_p2 = data;
}
static READ8_HANDLER( beast_p3_r )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
UINT8 dsw = 0;
- UINT8 dsw1 = ~input_port_read(space->machine, "DSW1");
- UINT8 dsw2 = ~input_port_read(space->machine, "DSW2");
+ UINT8 dsw1 = ~input_port_read(space->machine(), "DSW1");
+ UINT8 dsw2 = ~input_port_read(space->machine(), "DSW2");
switch ((state->beast_p0 >> 5) & 3)
{
@@ -391,7 +391,7 @@ static READ8_HANDLER( beast_p3_r )
static WRITE8_HANDLER( beast_p3_w )
{
- djboy_state *state = space->machine->driver_data<djboy_state>();
+ djboy_state *state = space->machine().driver_data<djboy_state>();
state->beast_p3 = data;
device_set_input_line(state->cpu1, INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
@@ -518,11 +518,11 @@ static TIMER_DEVICE_CALLBACK( djboy_scanline )
int scanline = param;
if(scanline == 240) // vblank-out irq
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xfd);
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xfd);
/* Pandora "sprite end dma" irq? TODO: timing is clearly off, attract mode relies on this */
if(scanline == 64)
- cputag_set_input_line_and_vector(timer.machine, "maincpu", 0, HOLD_LINE, 0xff);
+ cputag_set_input_line_and_vector(timer.machine(), "maincpu", 0, HOLD_LINE, 0xff);
}
static const kaneko_pandora_interface djboy_pandora_config =
@@ -535,10 +535,10 @@ static const kaneko_pandora_interface djboy_pandora_config =
static MACHINE_START( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *CPU1 = machine->region("cpu1")->base();
- UINT8 *CPU2 = machine->region("cpu2")->base();
+ djboy_state *state = machine.driver_data<djboy_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *CPU1 = machine.region("cpu1")->base();
+ UINT8 *CPU2 = machine.region("cpu2")->base();
memory_configure_bank(machine, "bank1", 0, 4, &MAIN[0x00000], 0x2000);
memory_configure_bank(machine, "bank1", 4, 28, &MAIN[0x10000], 0x2000);
@@ -548,11 +548,11 @@ static MACHINE_START( djboy )
memory_configure_bank(machine, "bank3", 3, 5, &CPU2[0x10000], 0x4000);
memory_configure_bank(machine, "bank4", 0, 1, &MAIN[0x10000], 0x3000); /* unsure if/how this area is banked */
- state->maincpu = machine->device("maincpu");
- state->cpu1 = machine->device("cpu1");
- state->cpu2 = machine->device("cpu2");
- state->beast = machine->device("beast");
- state->pandora = machine->device("pandora");
+ state->maincpu = machine.device("maincpu");
+ state->cpu1 = machine.device("cpu1");
+ state->cpu2 = machine.device("cpu2");
+ state->beast = machine.device("beast");
+ state->pandora = machine.device("pandora");
state->save_item(NAME(state->videoreg));
state->save_item(NAME(state->scrollx));
@@ -572,7 +572,7 @@ static MACHINE_START( djboy )
static MACHINE_RESET( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->videoreg = 0;
state->scrollx = 0;
@@ -748,13 +748,13 @@ ROM_END
static DRIVER_INIT( djboy )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->bankxor = 0x00;
}
static DRIVER_INIT( djboyj )
{
- djboy_state *state = machine->driver_data<djboy_state>();
+ djboy_state *state = machine.driver_data<djboy_state>();
state->bankxor = 0x1f;
}
diff --git a/src/mame/drivers/djmain.c b/src/mame/drivers/djmain.c
index c023e0a1428..305f9c9d33f 100644
--- a/src/mame/drivers/djmain.c
+++ b/src/mame/drivers/djmain.c
@@ -89,38 +89,38 @@ static WRITE32_HANDLER( paletteram32_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
r = (data >> 0) & 0xff;
g = (data >> 8) & 0xff;
b = (data >> 16) & 0xff;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
}
//---------
-static void sndram_set_bank(running_machine *machine)
+static void sndram_set_bank(running_machine &machine)
{
- djmain_state *state = machine->driver_data<djmain_state>();
- state->sndram = machine->region("shared")->base() + 0x80000 * state->sndram_bank;
+ djmain_state *state = machine.driver_data<djmain_state>();
+ state->sndram = machine.region("shared")->base() + 0x80000 * state->sndram_bank;
}
static WRITE32_HANDLER( sndram_bank_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_16_31)
{
state->sndram_bank = (data >> 16) & 0x1f;
- sndram_set_bank(space->machine);
+ sndram_set_bank(space->machine());
}
}
static READ32_HANDLER( sndram_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
UINT32 data = 0;
if (ACCESSING_BITS_24_31)
@@ -140,7 +140,7 @@ static READ32_HANDLER( sndram_r )
static WRITE32_HANDLER( sndram_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_24_31)
state->sndram[offset * 4] = data >> 24;
@@ -162,9 +162,9 @@ static READ16_HANDLER( dual539_r )
UINT16 ret = 0;
if (ACCESSING_BITS_0_7)
- ret |= k054539_r(space->machine->device("konami2"), offset);
+ ret |= k054539_r(space->machine().device("konami2"), offset);
if (ACCESSING_BITS_8_15)
- ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
+ ret |= k054539_r(space->machine().device("konami1"), offset)<<8;
return ret;
}
@@ -172,9 +172,9 @@ static READ16_HANDLER( dual539_r )
static WRITE16_HANDLER( dual539_w )
{
if (ACCESSING_BITS_0_7)
- k054539_w(space->machine->device("konami2"), offset, data);
+ k054539_w(space->machine().device("konami2"), offset, data);
if (ACCESSING_BITS_8_15)
- k054539_w(space->machine->device("konami1"), offset, data>>8);
+ k054539_w(space->machine().device("konami1"), offset, data>>8);
}
@@ -182,7 +182,7 @@ static WRITE16_HANDLER( dual539_w )
static READ32_HANDLER( obj_ctrl_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
// read state->obj_regs[0x0c/4]: unknown
// read state->obj_regs[0x24/4]: unknown
@@ -191,7 +191,7 @@ static READ32_HANDLER( obj_ctrl_r )
static WRITE32_HANDLER( obj_ctrl_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
// write state->obj_regs[0x28/4]: bank for rom readthrough
COMBINE_DATA(&state->obj_regs[offset]);
@@ -199,8 +199,8 @@ static WRITE32_HANDLER( obj_ctrl_w )
static READ32_HANDLER( obj_rom_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
- UINT8 *mem8 = space->machine->region("gfx1")->base();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
+ UINT8 *mem8 = space->machine().region("gfx1")->base();
int bank = state->obj_regs[0x28/4] >> 16;
offset += bank * 0x200;
@@ -220,7 +220,7 @@ static READ32_HANDLER( obj_rom_r )
static WRITE32_HANDLER( v_ctrl_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_16_31)
{
data >>= 16;
@@ -230,16 +230,16 @@ static WRITE32_HANDLER( v_ctrl_w )
if (state->pending_vb_int && !DISABLE_VB_INT)
{
state->pending_vb_int = 0;
- cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M68K_IRQ_4, HOLD_LINE);
}
}
}
static READ32_HANDLER( v_rom_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
- device_t *k056832 = space->machine->device("k056832");
- UINT8 *mem8 = space->machine->region("gfx2")->base();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
+ device_t *k056832 = space->machine().device("k056832");
+ UINT8 *mem8 = space->machine().region("gfx2")->base();
int bank = k056832_word_r(k056832, 0x34/2, 0xffff);
offset *= 2;
@@ -261,18 +261,18 @@ static READ32_HANDLER( v_rom_r )
static READ8_HANDLER( inp1_r )
{
static const char *const portnames[] = { "DSW3", "BTN3", "BTN2", "BTN1" };
- return input_port_read(space->machine, portnames[ offset & 0x03 ]);
+ return input_port_read(space->machine(), portnames[ offset & 0x03 ]);
}
static READ8_HANDLER( inp2_r )
{
static const char *const portnames[] = { "DSW1", "DSW2", "UNK2", "UNK1" };
- return input_port_read(space->machine, portnames[ offset & 0x03 ]);
+ return input_port_read(space->machine(), portnames[ offset & 0x03 ]);
}
static READ32_HANDLER( turntable_r )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
UINT32 result = 0;
static const char *const ttnames[] = { "TT1", "TT2" };
@@ -281,7 +281,7 @@ static READ32_HANDLER( turntable_r )
UINT8 pos;
int delta;
- pos = input_port_read_safe(space->machine, ttnames[state->turntable_select], 0);
+ pos = input_port_read_safe(space->machine(), ttnames[state->turntable_select], 0);
delta = pos - state->turntable_last_pos[state->turntable_select];
if (delta < -128)
delta += 256;
@@ -299,7 +299,7 @@ static READ32_HANDLER( turntable_r )
static WRITE32_HANDLER( turntable_select_w )
{
- djmain_state *state = space->machine->driver_data<djmain_state>();
+ djmain_state *state = space->machine().driver_data<djmain_state>();
if (ACCESSING_BITS_16_23)
state->turntable_select = (data >> 19) & 1;
}
@@ -392,9 +392,9 @@ static WRITE32_HANDLER( light_ctrl_2_w )
{
output_set_value("left-ssr", !!(data & 0x08000000)); // SSR
output_set_value("right-ssr", !!(data & 0x08000000)); // SSR
- set_led_status(space->machine, 0, data & 0x00010000); // 1P START
- set_led_status(space->machine, 1, data & 0x00020000); // 2P START
- set_led_status(space->machine, 2, data & 0x00040000); // EFFECT
+ set_led_status(space->machine(), 0, data & 0x00010000); // 1P START
+ set_led_status(space->machine(), 1, data & 0x00020000); // 2P START
+ set_led_status(space->machine(), 2, data & 0x00040000); // EFFECT
}
}
@@ -428,7 +428,7 @@ static WRITE32_HANDLER( unknownc02000_w )
static INTERRUPT_GEN( vb_interrupt )
{
- djmain_state *state = device->machine->driver_data<djmain_state>();
+ djmain_state *state = device->machine().driver_data<djmain_state>();
state->pending_vb_int = 0;
if (DISABLE_VB_INT)
@@ -447,12 +447,12 @@ static void ide_interrupt(device_t *device, int state)
if (state != CLEAR_LINE)
{
//logerror("IDE interrupt asserted\n");
- cputag_set_input_line(device->machine, "maincpu", M68K_IRQ_1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_1, HOLD_LINE);
}
else
{
//logerror("IDE interrupt cleared\n");
- cputag_set_input_line(device->machine, "maincpu", M68K_IRQ_1, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M68K_IRQ_1, CLEAR_LINE);
}
}
@@ -1432,8 +1432,8 @@ static STATE_POSTLOAD( djmain_postload )
static MACHINE_START( djmain )
{
- djmain_state *state = machine->driver_data<djmain_state>();
- device_t *ide = machine->device("ide");
+ djmain_state *state = machine.driver_data<djmain_state>();
+ device_t *ide = machine.device("ide");
if (ide != NULL && state->ide_master_password != NULL)
ide_set_master_password(ide, state->ide_master_password);
@@ -1445,13 +1445,13 @@ static MACHINE_START( djmain )
state_save_register_global(machine, state->v_ctrl);
state_save_register_global_array(machine, state->obj_regs);
- machine->state().register_postload(djmain_postload, NULL);
+ machine.state().register_postload(djmain_postload, NULL);
}
static MACHINE_RESET( djmain )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
/* reset sound ram bank */
state->sndram_bank = 0;
sndram_set_bank(machine);
@@ -2036,7 +2036,7 @@ ROM_END
static DRIVER_INIT( beatmania )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
state->ide_master_password = NULL;
state->ide_user_password = NULL;
}
@@ -2052,7 +2052,7 @@ static const UINT8 beatmania_master_password[2 + 32] =
static DRIVER_INIT( hmcompmx )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 hmcompmx_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2070,7 +2070,7 @@ static DRIVER_INIT( hmcompmx )
static DRIVER_INIT( bm4thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm4thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2087,7 +2087,7 @@ static DRIVER_INIT( bm4thmix )
static DRIVER_INIT( bm5thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm5thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2105,7 +2105,7 @@ static DRIVER_INIT( bm5thmix )
static DRIVER_INIT( bmclubmx )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmclubmx_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2124,7 +2124,7 @@ static DRIVER_INIT( bmclubmx )
static DRIVER_INIT( bmcompm2 )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmcompm2_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2142,7 +2142,7 @@ static DRIVER_INIT( bmcompm2 )
static DRIVER_INIT( hmcompm2 )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 hmcompm2_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2160,7 +2160,7 @@ static DRIVER_INIT( hmcompm2 )
static DRIVER_INIT( bmdct )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmdct_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2178,7 +2178,7 @@ static DRIVER_INIT( bmdct )
static DRIVER_INIT( bmcorerm )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmcorerm_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2196,7 +2196,7 @@ static DRIVER_INIT( bmcorerm )
static DRIVER_INIT( bm6thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm6thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2214,7 +2214,7 @@ static DRIVER_INIT( bm6thmix )
static DRIVER_INIT( bm7thmix )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bm7thmix_user_password[2 + 32] =
{
0x00, 0x00,
@@ -2232,7 +2232,7 @@ static DRIVER_INIT( bm7thmix )
static DRIVER_INIT( bmfinal )
{
- djmain_state *state = machine->driver_data<djmain_state>();
+ djmain_state *state = machine.driver_data<djmain_state>();
static const UINT8 bmfinal_user_password[2 + 32] =
{
0x00, 0x00,
diff --git a/src/mame/drivers/dkong.c b/src/mame/drivers/dkong.c
index 8d7b9ef7449..f92b20b7051 100644
--- a/src/mame/drivers/dkong.c
+++ b/src/mame/drivers/dkong.c
@@ -400,19 +400,19 @@ static INTERRUPT_GEN( s2650_interrupt )
*
*************************************/
-static void dkong_init_device_driver_data( running_machine *machine )
+static void dkong_init_device_driver_data( running_machine &machine )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
- state->dev_n2a03a = machine->device("n2a03a");
- state->dev_n2a03b = machine->device("n2a03b");
- state->dev_6h = machine->device("ls259.6h");
- state->dev_vp2 = machine->device("virtual_p2");
+ state->dev_n2a03a = machine.device("n2a03a");
+ state->dev_n2a03b = machine.device("n2a03b");
+ state->dev_6h = machine.device("ls259.6h");
+ state->dev_vp2 = machine.device("virtual_p2");
}
static MACHINE_START( dkong2b )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
dkong_init_device_driver_data(machine);
state->hardware_type = HARDWARE_TKG04;
@@ -423,9 +423,9 @@ static MACHINE_START( dkong2b )
static MACHINE_START( s2650 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
- UINT8 *p = machine->region("user1")->base();
- const char *game_name = machine->system().name;
+ dkong_state *state = machine.driver_data<dkong_state>();
+ UINT8 *p = machine.region("user1")->base();
+ const char *game_name = machine.system().name;
int i;
MACHINE_START_CALL(dkong2b);
@@ -457,7 +457,7 @@ static MACHINE_START( s2650 )
static MACHINE_START( radarscp )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
MACHINE_START_CALL(dkong2b);
state->hardware_type = HARDWARE_TRS02;
@@ -465,7 +465,7 @@ static MACHINE_START( radarscp )
static MACHINE_START( radarscp1 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
MACHINE_START_CALL(dkong2b);
state->hardware_type = HARDWARE_TRS01;
@@ -473,7 +473,7 @@ static MACHINE_START( radarscp1 )
static MACHINE_START( dkong3 )
{
- dkong_state *state = machine->driver_data<dkong_state>();
+ dkong_state *state = machine.driver_data<dkong_state>();
dkong_init_device_driver_data(machine);
state->hardware_type = HARDWARE_TKG04;
@@ -486,8 +486,8 @@ static MACHINE_RESET( dkong )
static MACHINE_RESET( strtheat )
{
- dkong_state *state = machine->driver_data<dkong_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ dkong_state *state = machine.driver_data<dkong_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
MACHINE_RESET_CALL(dkong);
@@ -499,8 +499,8 @@ static MACHINE_RESET( strtheat )
static MACHINE_RESET( drakton )
{
- dkong_state *state = machine->driver_data<dkong_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ dkong_state *state = machine.driver_data<dkong_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
MACHINE_RESET_CALL(dkong);
@@ -519,7 +519,7 @@ static MACHINE_RESET( drakton )
static READ8_HANDLER( hb_dma_read_byte )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
int bucket = state->rev_map[(offset>>10) & 0x1ff];
int addr;
@@ -533,7 +533,7 @@ static READ8_HANDLER( hb_dma_read_byte )
static WRITE8_HANDLER( hb_dma_write_byte )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
int bucket = state->rev_map[(offset>>10) & 0x1ff];
int addr;
@@ -547,13 +547,13 @@ static WRITE8_HANDLER( hb_dma_write_byte )
static READ8_DEVICE_HANDLER( p8257_ctl_r )
{
- dkong_state *state = device->machine->driver_data<dkong_state>();
+ dkong_state *state = device->machine().driver_data<dkong_state>();
return state->dma_latch;
}
static WRITE8_DEVICE_HANDLER( p8257_ctl_w )
{
- dkong_state *state = device->machine->driver_data<dkong_state>();
+ dkong_state *state = device->machine().driver_data<dkong_state>();
state->dma_latch = data;
}
@@ -566,7 +566,7 @@ static WRITE8_DEVICE_HANDLER( p8257_ctl_w )
static WRITE8_HANDLER( dkong3_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
static WRITE8_DEVICE_HANDLER( p8257_drq_w )
@@ -577,13 +577,13 @@ static WRITE8_DEVICE_HANDLER( p8257_drq_w )
static READ8_HANDLER( dkong_in2_r )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
/* mcu status (sound feedback) is inverted bit4 from port B (8039) */
UINT8 mcustatus = latch8_bit4_q_r(state->dev_vp2, 0);
UINT8 r;
- r = (input_port_read(space->machine, "IN2") & 0xBF) | (mcustatus << 6);
- coin_counter_w(space->machine, offset, r >> 7);
+ r = (input_port_read(space->machine(), "IN2") & 0xBF) | (mcustatus << 6);
+ coin_counter_w(space->machine(), offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coin */
return r;
@@ -595,8 +595,8 @@ static READ8_HANDLER( dkongjr_in2_r )
UINT8 r;
- r = (input_port_read(space->machine, "IN2") & 0xBF) | 0x40;
- coin_counter_w(space->machine, offset, r >> 7);
+ r = (input_port_read(space->machine(), "IN2") & 0xBF) | 0x40;
+ coin_counter_w(space->machine(), offset, r >> 7);
if (r & 0x10)
r = (r & ~0x10) | 0x80; /* service ==> coin */
return r;
@@ -616,7 +616,7 @@ static WRITE8_HANDLER( s2650_mirror_w )
static READ8_HANDLER( epos_decrypt_rom )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (offset & 0x01)
{
@@ -631,10 +631,10 @@ static READ8_HANDLER( epos_decrypt_rom )
switch(state->decrypt_counter)
{
- case 0x08: memory_set_bank(space->machine, "bank1", 0); break;
- case 0x09: memory_set_bank(space->machine, "bank1", 1); break;
- case 0x0A: memory_set_bank(space->machine, "bank1", 2); break;
- case 0x0B: memory_set_bank(space->machine, "bank1", 3); break;
+ case 0x08: memory_set_bank(space->machine(), "bank1", 0); break;
+ case 0x09: memory_set_bank(space->machine(), "bank1", 1); break;
+ case 0x0A: memory_set_bank(space->machine(), "bank1", 2); break;
+ case 0x0B: memory_set_bank(space->machine(), "bank1", 3); break;
default:
logerror("Invalid counter = %02X\n",state->decrypt_counter);
break;
@@ -646,7 +646,7 @@ static READ8_HANDLER( epos_decrypt_rom )
static WRITE8_HANDLER( s2650_data_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("write : pc = %04x, loopback = %02x\n",cpu_get_pc(space->cpu), data);
#endif
@@ -656,7 +656,7 @@ static WRITE8_HANDLER( s2650_data_w )
static WRITE8_HANDLER( s2650_fo_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("write : pc = %04x, FO = %02x\n",cpu_get_pc(space->cpu), data);
#endif
@@ -669,7 +669,7 @@ static WRITE8_HANDLER( s2650_fo_w )
static READ8_HANDLER( s2650_port0_r )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("port 0 : pc = %04x, loopback = %02x fo=%d\n",cpu_get_pc(space->cpu), state->hunchloopback, state->main_fo);
#endif
@@ -694,7 +694,7 @@ static READ8_HANDLER( s2650_port0_r )
static READ8_HANDLER( s2650_port1_r )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
#if DEBUG_PROTECTION
logerror("port 1 : pc = %04x, loopback = %02x fo=%d\n",cpu_get_pc(space->cpu), state->hunchloopback, state->main_fo);
@@ -717,7 +717,7 @@ static READ8_HANDLER( s2650_port1_r )
static WRITE8_HANDLER( dkong3_2a03_reset_w )
{
- dkong_state *state = space->machine->driver_data<dkong_state>();
+ dkong_state *state = space->machine().driver_data<dkong_state>();
if (data & 1)
{
@@ -733,30 +733,30 @@ static WRITE8_HANDLER( dkong3_2a03_reset_w )
static READ8_HANDLER( strtheat_inputport_0_r )
{
- if(input_port_read(space->machine, "DSW0") & 0x40)
+ if(input_port_read(space->machine(), "DSW0") & 0x40)
{
/* Joystick inputs */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
else
{
/* Steering Wheel inputs */
- return (input_port_read(space->machine, "IN0") & ~3) | (input_port_read(space->machine, "IN4") & 3);
+ return (input_port_read(space->machine(), "IN0") & ~3) | (input_port_read(space->machine(), "IN4") & 3);
}
}
static READ8_HANDLER( strtheat_inputport_1_r )
{
- if(input_port_read(space->machine, "DSW0") & 0x40)
+ if(input_port_read(space->machine(), "DSW0") & 0x40)
{
/* Joystick inputs */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
else
{
/* Steering Wheel inputs */
- return (input_port_read(space->machine, "IN1") & ~3) | (input_port_read(space->machine, "IN5") & 3);
+ return (input_port_read(space->machine(), "IN1") & ~3) | (input_port_read(space->machine(), "IN5") & 3);
}
}
@@ -1621,8 +1621,8 @@ static READ8_DEVICE_HANDLER( braze_eeprom_r )
static WRITE8_HANDLER( braze_a15_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
- memory_set_bank(space->machine, "bank2", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank2", data & 0x01);
}
static WRITE8_DEVICE_HANDLER( braze_eeprom_w )
@@ -1632,14 +1632,14 @@ static WRITE8_DEVICE_HANDLER( braze_eeprom_w )
eeprom_set_clock_line(device, data & 0x02 ? ASSERT_LINE : CLEAR_LINE);
}
-static void braze_decrypt_rom(running_machine *machine, UINT8 *dest)
+static void braze_decrypt_rom(running_machine &machine, UINT8 *dest)
{
UINT8 oldbyte,newbyte;
UINT8 *ROM;
UINT32 mem;
UINT32 newmem;
- ROM = machine->region("braze")->base();
+ ROM = machine.region("braze")->base();
for (mem=0;mem<0x10000;mem++)
{
@@ -2983,13 +2983,13 @@ ROM_END
*
*************************************/
-static void drakton_decrypt_rom(running_machine *machine, UINT8 mod, int offs, int *bs)
+static void drakton_decrypt_rom(running_machine &machine, UINT8 mod, int offs, int *bs)
{
UINT8 oldbyte,newbyte;
UINT8 *ROM;
int mem;
- ROM = machine->region("maincpu")->base();
+ ROM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
@@ -3015,7 +3015,7 @@ static void drakton_decrypt_rom(running_machine *machine, UINT8 mod, int offs, i
static DRIVER_INIT( herodk )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* swap data lines D3 and D4 */
for (A = 0;A < 0x8000;A++)
@@ -3040,7 +3040,7 @@ static DRIVER_INIT( drakton )
{7,1,4,0,3,6,2,5},
};
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -3062,7 +3062,7 @@ static DRIVER_INIT( strtheat )
{6,3,4,1,0,7,2,5},
};
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1" );
/* While the PAL supports up to 16 decryption methods, only four
are actually used in the PAL. Therefore, we'll take a little
@@ -3073,21 +3073,21 @@ static DRIVER_INIT( strtheat )
drakton_decrypt_rom(machine, 0x88, 0x1c000, bs[3]);
/* custom handlers supporting Joystick or Steering Wheel */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c00, 0x7c00, FUNC(strtheat_inputport_0_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c80, 0x7c80, FUNC(strtheat_inputport_1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c00, 0x7c00, FUNC(strtheat_inputport_0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7c80, 0x7c80, FUNC(strtheat_inputport_1_r));
}
static DRIVER_INIT( dkongx )
{
UINT8 *decrypted;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- device_t *eeprom = machine->device("eeprom");
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ device_t *eeprom = machine.device("eeprom");
decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x5fff, "bank1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xffff, "bank2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x5fff, "bank1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xffff, "bank2" );
space->install_legacy_write_handler(0xe000, 0xe000, FUNC(braze_a15_w));
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 5dfd115e6f0..3f3aa5a769f 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -95,20 +95,20 @@ static const UINT8 led_map[16] =
static void dleuro_interrupt(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "maincpu", 0, state);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state);
}
static WRITE8_DEVICE_HANDLER( serial_transmit )
{
- dlair_state *state = device->machine->driver_data<dlair_state>();
+ dlair_state *state = device->machine().driver_data<dlair_state>();
laserdisc_data_w(state->laserdisc, data);
}
static int serial_receive(device_t *device, int channel)
{
- dlair_state *state = device->machine->driver_data<dlair_state>();
+ dlair_state *state = device->machine().driver_data<dlair_state>();
/* if we still have data to send, do it now */
if (channel == 0 && laserdisc_line_r(state->laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
return laserdisc_data_r(state->laserdisc);
@@ -174,7 +174,7 @@ static PALETTE_INIT( dleuro )
static SCREEN_UPDATE( dleuro )
{
- dlair_state *state = screen->machine->driver_data<dlair_state>();
+ dlair_state *state = screen->machine().driver_data<dlair_state>();
UINT8 *videoram = state->videoram;
int x, y;
@@ -183,7 +183,7 @@ static SCREEN_UPDATE( dleuro )
for (x = 0; x < 32; x++)
{
UINT8 *base = &videoram[y * 64 + x * 2 + 1];
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], base[0], base[1], 0, 0, 10 * x, 16 * y);
}
return 0;
@@ -199,14 +199,14 @@ static SCREEN_UPDATE( dleuro )
static MACHINE_START( dlair )
{
- dlair_state *state = machine->driver_data<dlair_state>();
- state->laserdisc = machine->device<laserdisc_device>("laserdisc");
+ dlair_state *state = machine.driver_data<dlair_state>();
+ state->laserdisc = machine.device<laserdisc_device>("laserdisc");
}
static MACHINE_RESET( dlair )
{
- dlair_state *state = machine->driver_data<dlair_state>();
+ dlair_state *state = machine.driver_data<dlair_state>();
/* determine the laserdisc player from the DIP switches */
if (state->laserdisc_type == LASERDISC_TYPE_VARIABLE)
{
@@ -226,10 +226,10 @@ static MACHINE_RESET( dlair )
static INTERRUPT_GEN( vblank_callback )
{
/* also update the speaker on the European version */
- beep_device *beep = device->machine->device<beep_device>("beep");
+ beep_device *beep = device->machine().device<beep_device>("beep");
if (beep != NULL)
{
- z80ctc_device *ctc = device->machine->device<z80ctc_device>("ctc");
+ z80ctc_device *ctc = device->machine().device<z80ctc_device>("ctc");
beep_set_state(beep, 1);
beep_set_frequency(beep, ATTOSECONDS_TO_HZ(ctc->period(0).attoseconds));
}
@@ -245,7 +245,7 @@ static INTERRUPT_GEN( vblank_callback )
static WRITE8_HANDLER( misc_w )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
/*
D0-D3 = B0-B3
D4 = coin counter
@@ -256,7 +256,7 @@ static WRITE8_HANDLER( misc_w )
UINT8 diff = data ^ state->last_misc;
state->last_misc = data;
- coin_counter_w(space->machine, 0, (~data >> 4) & 1);
+ coin_counter_w(space->machine(), 0, (~data >> 4) & 1);
/* on bit 5 going low, push the data out to the laserdisc player */
if ((diff & 0x20) && !(data & 0x20))
@@ -269,7 +269,7 @@ static WRITE8_HANDLER( misc_w )
static WRITE8_HANDLER( dleuro_misc_w )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
/*
D0 = CHAR GEN ON+
D1 = KILL VIDEO+
@@ -283,8 +283,8 @@ static WRITE8_HANDLER( dleuro_misc_w )
UINT8 diff = data ^ state->last_misc;
state->last_misc = data;
- coin_counter_w(space->machine, 1, (~data >> 3) & 1);
- coin_counter_w(space->machine, 0, (~data >> 4) & 1);
+ coin_counter_w(space->machine(), 1, (~data >> 3) & 1);
+ coin_counter_w(space->machine(), 0, (~data >> 4) & 1);
/* on bit 5 going low, push the data out to the laserdisc player */
if ((diff & 0x20) && !(data & 0x20))
@@ -316,7 +316,7 @@ static WRITE8_HANDLER( led_den2_w )
static CUSTOM_INPUT( laserdisc_status_r )
{
- dlair_state *state = field->port->machine->driver_data<dlair_state>();
+ dlair_state *state = field->port->machine().driver_data<dlair_state>();
switch (laserdisc_get_type(state->laserdisc))
{
case LASERDISC_TYPE_PIONEER_PR7820:
@@ -334,7 +334,7 @@ static CUSTOM_INPUT( laserdisc_status_r )
static CUSTOM_INPUT( laserdisc_command_r )
{
- dlair_state *state = field->port->machine->driver_data<dlair_state>();
+ dlair_state *state = field->port->machine().driver_data<dlair_state>();
switch (laserdisc_get_type(state->laserdisc))
{
case LASERDISC_TYPE_PIONEER_PR7820:
@@ -352,7 +352,7 @@ static CUSTOM_INPUT( laserdisc_command_r )
static READ8_HANDLER( laserdisc_r )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
UINT8 result = laserdisc_data_r(state->laserdisc);
mame_printf_debug("laserdisc_r = %02X\n", result);
return result;
@@ -361,7 +361,7 @@ static READ8_HANDLER( laserdisc_r )
static WRITE8_HANDLER( laserdisc_w )
{
- dlair_state *state = space->machine->driver_data<dlair_state>();
+ dlair_state *state = space->machine().driver_data<dlair_state>();
state->laserdisc_data = data;
}
@@ -949,14 +949,14 @@ ROM_END
static DRIVER_INIT( fixed )
{
- dlair_state *state = machine->driver_data<dlair_state>();
+ dlair_state *state = machine.driver_data<dlair_state>();
state->laserdisc_type = LASERDISC_TYPE_FIXED;
}
static DRIVER_INIT( variable )
{
- dlair_state *state = machine->driver_data<dlair_state>();
+ dlair_state *state = machine.driver_data<dlair_state>();
state->laserdisc_type = LASERDISC_TYPE_VARIABLE;
}
diff --git a/src/mame/drivers/dmndrby.c b/src/mame/drivers/dmndrby.c
index fd47edf0576..2da4575f955 100644
--- a/src/mame/drivers/dmndrby.c
+++ b/src/mame/drivers/dmndrby.c
@@ -76,7 +76,7 @@ public:
static WRITE8_HANDLER( dderby_sound_w )
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, HOLD_LINE);
}
@@ -84,14 +84,14 @@ static READ8_HANDLER( input_r )
{
switch(offset & 7)
{
- case 0: return input_port_read(space->machine, "IN0");
- case 1: return input_port_read(space->machine, "IN1");
- case 2: return input_port_read(space->machine, "IN2");
- case 3: return input_port_read(space->machine, "IN3");
- case 4: return input_port_read(space->machine, "IN4");
- case 5: return input_port_read(space->machine, "IN5");
- case 6: return input_port_read(space->machine, "IN6");
- case 7: return input_port_read(space->machine, "IN7");
+ case 0: return input_port_read(space->machine(), "IN0");
+ case 1: return input_port_read(space->machine(), "IN1");
+ case 2: return input_port_read(space->machine(), "IN2");
+ case 3: return input_port_read(space->machine(), "IN3");
+ case 4: return input_port_read(space->machine(), "IN4");
+ case 5: return input_port_read(space->machine(), "IN5");
+ case 6: return input_port_read(space->machine(), "IN6");
+ case 7: return input_port_read(space->machine(), "IN7");
}
return 0xff;
@@ -99,7 +99,7 @@ static READ8_HANDLER( input_r )
static WRITE8_HANDLER( output_w )
{
- dmndrby_state *state = space->machine->driver_data<dmndrby_state>();
+ dmndrby_state *state = space->machine().driver_data<dmndrby_state>();
/*
---- x--- refill meter [4]
---- x--- token out meter [5]
@@ -313,7 +313,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_dmndrby_tile_info )
{
- dmndrby_state *state = machine->driver_data<dmndrby_state>();
+ dmndrby_state *state = machine.driver_data<dmndrby_state>();
int code = state->racetrack_tilemap_rom[tile_index];
int attr = state->racetrack_tilemap_rom[tile_index+0x2000];
@@ -331,8 +331,8 @@ static TILE_GET_INFO( get_dmndrby_tile_info )
static VIDEO_START(dderby)
{
- dmndrby_state *state = machine->driver_data<dmndrby_state>();
- state->racetrack_tilemap_rom = machine->region("user1")->base();
+ dmndrby_state *state = machine.driver_data<dmndrby_state>();
+ state->racetrack_tilemap_rom = machine.region("user1")->base();
state->racetrack_tilemap = tilemap_create(machine,get_dmndrby_tile_info,tilemap_scan_rows,16,16, 16, 512);
tilemap_mark_all_tiles_dirty(state->racetrack_tilemap);
@@ -340,14 +340,14 @@ static VIDEO_START(dderby)
static SCREEN_UPDATE(dderby)
{
- dmndrby_state *state = screen->machine->driver_data<dmndrby_state>();
+ dmndrby_state *state = screen->machine().driver_data<dmndrby_state>();
int x,y,count;
int off,scrolly;
- const gfx_element *gfx = screen->machine->gfx[0];
- const gfx_element *sprites = screen->machine->gfx[1];
- const gfx_element *track = screen->machine->gfx[2];
+ const gfx_element *gfx = screen->machine().gfx[0];
+ const gfx_element *sprites = screen->machine().gfx[1];
+ const gfx_element *track = screen->machine().gfx[2];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
/* Draw racetrack
@@ -450,7 +450,7 @@ static PALETTE_INIT( dmnderby )
2, &resistances_b[0], bweights, 470, 0);
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x20);
+ machine.colortable = colortable_alloc(machine, 0x20);
/* create a lookup table for the palette */
for (i = 0; i < 0x20; i++)
@@ -475,29 +475,29 @@ static PALETTE_INIT( dmnderby )
bit1 = (color_prom[i] >> 7) & 0x01;
b = combine_2_weights(bweights, bit0, bit1);
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
- color_prom = machine->region("proms2")->base();
+ color_prom = machine.region("proms2")->base();
/* normal tiles use colors 0-15 */
for (i = 0x000; i < 0x300; i++)
{
UINT8 ctabentry = color_prom[i];
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
/*Main Z80 is IM 0,HW-latched irqs. */
static INTERRUPT_GEN( dderby_irq )
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h */
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 0, HOLD_LINE, 0xd7); /* RST 10h */
}
static INTERRUPT_GEN( dderby_timer_irq )
{
- cputag_set_input_line_and_vector(device->machine, "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
+ cputag_set_input_line_and_vector(device->machine(), "maincpu", 0, HOLD_LINE, 0xcf); /* RST 08h */
}
static MACHINE_CONFIG_START( dderby, dmndrby_state )
diff --git a/src/mame/drivers/docastle.c b/src/mame/drivers/docastle.c
index a7700ff1020..8b67369ad3e 100644
--- a/src/mame/drivers/docastle.c
+++ b/src/mame/drivers/docastle.c
@@ -163,9 +163,9 @@ Dip locations verified with manual for docastle, dorunrun and dowild.
/* Read/Write Handlers */
static void idsoccer_adpcm_int( device_t *device )
{
- docastle_state *state = device->machine->driver_data<docastle_state>();
+ docastle_state *state = device->machine().driver_data<docastle_state>();
- if (state->adpcm_pos >= device->machine->region("adpcm")->bytes())
+ if (state->adpcm_pos >= device->machine().region("adpcm")->bytes())
{
state->adpcm_idle = 1;
msm5205_reset_w(device, 1);
@@ -177,14 +177,14 @@ static void idsoccer_adpcm_int( device_t *device )
}
else
{
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos++];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos++];
msm5205_data_w(device, state->adpcm_data >> 4);
}
}
static READ8_DEVICE_HANDLER( idsoccer_adpcm_status_r )
{
- docastle_state *state = device->machine->driver_data<docastle_state>();
+ docastle_state *state = device->machine().driver_data<docastle_state>();
// this is wrong, but the samples work anyway!!
state->adpcm_status ^= 0x80;
@@ -193,7 +193,7 @@ static READ8_DEVICE_HANDLER( idsoccer_adpcm_status_r )
static WRITE8_DEVICE_HANDLER( idsoccer_adpcm_w )
{
- docastle_state *state = device->machine->driver_data<docastle_state>();
+ docastle_state *state = device->machine().driver_data<docastle_state>();
if (data & 0x80)
{
@@ -563,7 +563,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_RESET( docastle )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
int i;
for (i = 0; i < 9; i++)
@@ -579,10 +579,10 @@ static MACHINE_RESET( docastle )
static MACHINE_START( docastle )
{
- docastle_state *state = machine->driver_data<docastle_state>();
+ docastle_state *state = machine.driver_data<docastle_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->slave = machine->device<cpu_device>("slave");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->slave = machine.device<cpu_device>("slave");
state->save_item(NAME(state->adpcm_pos));
state->save_item(NAME(state->adpcm_data));
diff --git a/src/mame/drivers/dogfgt.c b/src/mame/drivers/dogfgt.c
index 41af2494f2f..ebf2b41f2fd 100644
--- a/src/mame/drivers/dogfgt.c
+++ b/src/mame/drivers/dogfgt.c
@@ -16,20 +16,20 @@ driver by Nicola Salmoria
static READ8_HANDLER( sharedram_r )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
return state->sharedram[offset];
}
static WRITE8_HANDLER( sharedram_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->sharedram[offset] = data;
}
static WRITE8_HANDLER( subirqtrigger_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
/* bit 0 used but unknown */
if (data & 0x04)
device_set_input_line(state->subcpu, 0, ASSERT_LINE);
@@ -37,27 +37,27 @@ static WRITE8_HANDLER( subirqtrigger_w )
static WRITE8_HANDLER( sub_irqack_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
device_set_input_line(state->subcpu, 0, CLEAR_LINE);
}
static WRITE8_HANDLER( dogfgt_soundlatch_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
state->soundlatch = data;
}
static WRITE8_HANDLER( dogfgt_soundcontrol_w )
{
- dogfgt_state *state = space->machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = space->machine().driver_data<dogfgt_state>();
/* bit 5 goes to 8910 #0 BDIR pin */
if ((state->last_snd_ctrl & 0x20) == 0x20 && (data & 0x20) == 0x00)
- ay8910_data_address_w(space->machine->device("ay1"), state->last_snd_ctrl >> 4, state->soundlatch);
+ ay8910_data_address_w(space->machine().device("ay1"), state->last_snd_ctrl >> 4, state->soundlatch);
/* bit 7 goes to 8910 #1 BDIR pin */
if ((state->last_snd_ctrl & 0x80) == 0x80 && (data & 0x80) == 0x00)
- ay8910_data_address_w(space->machine->device("ay2"), state->last_snd_ctrl >> 6, state->soundlatch);
+ ay8910_data_address_w(space->machine().device("ay2"), state->last_snd_ctrl >> 6, state->soundlatch);
state->last_snd_ctrl = data;
}
@@ -215,9 +215,9 @@ GFXDECODE_END
static MACHINE_START( dogfgt )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->bm_plane));
state->save_item(NAME(state->lastflip));
@@ -231,7 +231,7 @@ static MACHINE_START( dogfgt )
static MACHINE_RESET( dogfgt )
{
- dogfgt_state *state = machine->driver_data<dogfgt_state>();
+ dogfgt_state *state = machine.driver_data<dogfgt_state>();
int i;
state->bm_plane = 0;
diff --git a/src/mame/drivers/dominob.c b/src/mame/drivers/dominob.c
index 26c1a36e6fe..a0ccc97e2b4 100644
--- a/src/mame/drivers/dominob.c
+++ b/src/mame/drivers/dominob.c
@@ -84,12 +84,12 @@ public:
static VIDEO_START( dominob )
{
- machine->gfx[0]->color_granularity = 8;
+ machine.gfx[0]->color_granularity = 8;
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- dominob_state *state = machine->driver_data<dominob_state>();
+ dominob_state *state = machine.driver_data<dominob_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -103,12 +103,12 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
code = state->spriteram[offs + 3] + ((state->spriteram[offs + 2] & 0x03) << 8) ;
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
2 * code,
((state->spriteram[offs + 2] & 0xf8) >> 3) ,
flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy + (flip_screen_y_get(machine) ? 8 : -8),0);
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],
2 * code + 1,
((state->spriteram[offs + 2] & 0xf8) >> 3) ,
flip_screen_x_get(machine),flip_screen_y_get(machine),
@@ -119,7 +119,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( dominob )
{
- dominob_state *state = screen->machine->driver_data<dominob_state>();
+ dominob_state *state = screen->machine().driver_data<dominob_state>();
int x,y;
int index = 0;
@@ -130,7 +130,7 @@ static SCREEN_UPDATE( dominob )
{
drawgfx_opaque(bitmap,
cliprect,
- screen->machine->gfx[1],
+ screen->machine().gfx[1],
state->bgram[index] + 256 * (state->bgram[index + 1] & 0xf),
state->bgram[index + 1] >> 4,
0, 0,
@@ -145,7 +145,7 @@ static SCREEN_UPDATE( dominob )
{
drawgfx_transpen( bitmap,
cliprect,
- screen->machine->gfx[0],
+ screen->machine().gfx[0],
state->videoram[(y * 32 + x) * 2 + 1] + (state->videoram[(y * 32 + x) * 2] & 7) * 256,
(state->videoram[(y * 32 + x) * 2] >> 3),
0, 0,
@@ -153,7 +153,7 @@ static SCREEN_UPDATE( dominob )
}
}
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
diff --git a/src/mame/drivers/dooyong.c b/src/mame/drivers/dooyong.c
index 266ae492c6c..b21ffb18e6b 100644
--- a/src/mame/drivers/dooyong.c
+++ b/src/mame/drivers/dooyong.c
@@ -87,24 +87,24 @@ be verified on real PCB.
static WRITE8_HANDLER( lastday_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
if (data & 0xf8) popmessage("bankswitch %02x",data);
}
static MACHINE_START( lastday )
{
- memory_configure_bank(machine, "bank1", 0, 8, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 8, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
static MACHINE_RESET( sound_ym2203 )
{
- dooyong_state *state = machine->driver_data<dooyong_state>();
+ dooyong_state *state = machine.driver_data<dooyong_state>();
state->interrupt_line_1=0;
state->interrupt_line_2=0;
@@ -777,21 +777,21 @@ static READ8_DEVICE_HANDLER( unk_r )
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static void irqhandler_2203_1(device_t *device, int irq)
{
- dooyong_state *state = device->machine->driver_data<dooyong_state>();
+ dooyong_state *state = device->machine().driver_data<dooyong_state>();
state->interrupt_line_1=irq;
- cputag_set_input_line(device->machine, "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
}
static void irqhandler_2203_2(device_t *device, int irq)
{
- dooyong_state *state = device->machine->driver_data<dooyong_state>();
+ dooyong_state *state = device->machine().driver_data<dooyong_state>();
state->interrupt_line_2=irq;
- cputag_set_input_line(device->machine, "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, (state->interrupt_line_1 | state->interrupt_line_2) ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2203_interface ym2203_interface_1 =
diff --git a/src/mame/drivers/dorachan.c b/src/mame/drivers/dorachan.c
index 24ff38b1772..10ab1820404 100644
--- a/src/mame/drivers/dorachan.c
+++ b/src/mame/drivers/dorachan.c
@@ -42,7 +42,7 @@ public:
static CUSTOM_INPUT( dorachan_protection_r )
{
- dorachan_state *state = field->port->machine->driver_data<dorachan_state>();
+ dorachan_state *state = field->port->machine().driver_data<dorachan_state>();
UINT8 ret = 0;
switch (cpu_get_previouspc(state->main_cpu))
@@ -80,14 +80,14 @@ static void get_pens(pen_t *pens)
static SCREEN_UPDATE( dorachan )
{
- dorachan_state *state = screen->machine->driver_data<dorachan_state>();
+ dorachan_state *state = screen->machine().driver_data<dorachan_state>();
pen_t pens[NUM_PENS];
offs_t offs;
const UINT8 *color_map_base;
get_pens(pens);
- color_map_base = screen->machine->region("proms")->base();
+ color_map_base = screen->machine().region("proms")->base();
for (offs = 0; offs < state->videoram_size; offs++)
{
@@ -123,17 +123,17 @@ static SCREEN_UPDATE( dorachan )
static WRITE8_HANDLER(dorachan_ctrl_w)
{
- dorachan_state *state = space->machine->driver_data<dorachan_state>();
+ dorachan_state *state = space->machine().driver_data<dorachan_state>();
state->flip_screen = (data >> 6) & 0x01;
}
static CUSTOM_INPUT( dorachan_v128_r )
{
- dorachan_state *state = field->port->machine->driver_data<dorachan_state>();
+ dorachan_state *state = field->port->machine().driver_data<dorachan_state>();
/* to avoid resetting (when player 2 starts) bit 0 need to be inverted when screen is flipped */
- return ((field->port->machine->primary_screen->vpos() >> 7) & 0x01) ^ state->flip_screen;
+ return ((field->port->machine().primary_screen->vpos() >> 7) & 0x01) ^ state->flip_screen;
}
@@ -224,16 +224,16 @@ INPUT_PORTS_END
static MACHINE_START( dorachan )
{
- dorachan_state *state = machine->driver_data<dorachan_state>();
+ dorachan_state *state = machine.driver_data<dorachan_state>();
- state->main_cpu = machine->device("maincpu");
+ state->main_cpu = machine.device("maincpu");
state->save_item(NAME(state->flip_screen));
}
static MACHINE_RESET( dorachan )
{
- dorachan_state *state = machine->driver_data<dorachan_state>();
+ dorachan_state *state = machine.driver_data<dorachan_state>();
state->flip_screen = 0;
}
diff --git a/src/mame/drivers/dotrikun.c b/src/mame/drivers/dotrikun.c
index af82bf93a44..762a5c1bbd4 100644
--- a/src/mame/drivers/dotrikun.c
+++ b/src/mame/drivers/dotrikun.c
@@ -46,7 +46,7 @@ public:
static WRITE8_HANDLER( dotrikun_color_w )
{
- dotrikun_state *state = space->machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = space->machine().driver_data<dotrikun_state>();
/*
x--- ---- screen color swap?
---- -x-- B
@@ -55,13 +55,13 @@ static WRITE8_HANDLER( dotrikun_color_w )
*/
state->color = data;
- space->machine->primary_screen->update_partial(space->machine->primary_screen->vpos());
+ space->machine().primary_screen->update_partial(space->machine().primary_screen->vpos());
}
static SCREEN_UPDATE( dotrikun )
{
- dotrikun_state *state = screen->machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = screen->machine().driver_data<dotrikun_state>();
int x,y,i;
pen_t back_pen = MAKE_RGB(pal1bit(state->color >> 3), pal1bit(state->color >> 4), pal1bit(state->color >> 5));
@@ -135,13 +135,13 @@ INPUT_PORTS_END
static MACHINE_START( dotrikun )
{
- dotrikun_state *state = machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = machine.driver_data<dotrikun_state>();
state->save_item(NAME(state->color));
}
static MACHINE_RESET( dotrikun )
{
- dotrikun_state *state = machine->driver_data<dotrikun_state>();
+ dotrikun_state *state = machine.driver_data<dotrikun_state>();
state->color = 0;
}
diff --git a/src/mame/drivers/dragrace.c b/src/mame/drivers/dragrace.c
index a715609013c..ae273ffda6b 100644
--- a/src/mame/drivers/dragrace.c
+++ b/src/mame/drivers/dragrace.c
@@ -13,13 +13,13 @@ Atari Drag Race Driver
static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
{
- dragrace_state *state = timer.machine->driver_data<dragrace_state>();
+ dragrace_state *state = timer.machine().driver_data<dragrace_state>();
int i;
static const char *const portnames[] = { "P1", "P2" };
for (i = 0; i < 2; i++)
{
- switch (input_port_read(timer.machine, portnames[i]))
+ switch (input_port_read(timer.machine(), portnames[i]))
{
case 0x01: state->gear[i] = 1; break;
case 0x02: state->gear[i] = 2; break;
@@ -30,13 +30,13 @@ static TIMER_DEVICE_CALLBACK( dragrace_frame_callback )
}
/* watchdog is disabled during service mode */
- watchdog_enable(timer.machine, input_port_read(timer.machine, "IN0") & 0x20);
+ watchdog_enable(timer.machine(), input_port_read(timer.machine(), "IN0") & 0x20);
}
-static void dragrace_update_misc_flags( running_machine *machine )
+static void dragrace_update_misc_flags( running_machine &machine )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
/* 0x0900 = set 3SPEED1 0x00000001
* 0x0901 = set 4SPEED1 0x00000002
* 0x0902 = set 5SPEED1 0x00000004
@@ -90,7 +90,7 @@ static void dragrace_update_misc_flags( running_machine *machine )
static WRITE8_HANDLER( dragrace_misc_w )
{
- dragrace_state *state = space->machine->driver_data<dragrace_state>();
+ dragrace_state *state = space->machine().driver_data<dragrace_state>();
/* Set/clear individual bit */
UINT32 mask = 1 << offset;
@@ -99,24 +99,24 @@ static WRITE8_HANDLER( dragrace_misc_w )
else
state->misc_flags &= (~mask);
logerror("Set %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0900 + offset, mask, state->misc_flags, data & 0x01);
- dragrace_update_misc_flags(space->machine);
+ dragrace_update_misc_flags(space->machine());
}
static WRITE8_HANDLER( dragrace_misc_clear_w )
{
- dragrace_state *state = space->machine->driver_data<dragrace_state>();
+ dragrace_state *state = space->machine().driver_data<dragrace_state>();
/* Clear 8 bits */
UINT32 mask = 0xff << (((offset >> 3) & 0x03) * 8);
state->misc_flags &= (~mask);
logerror("Clear %#6x, Mask=%#10x, Flag=%#10x, Data=%x\n", 0x0920 + offset, mask, state->misc_flags, data & 0x01);
- dragrace_update_misc_flags(space->machine);
+ dragrace_update_misc_flags(space->machine());
}
static READ8_HANDLER( dragrace_input_r )
{
- dragrace_state *state = space->machine->driver_data<dragrace_state>();
- int val = input_port_read(space->machine, "IN2");
+ dragrace_state *state = space->machine().driver_data<dragrace_state>();
+ int val = input_port_read(space->machine(), "IN2");
static const char *const portnames[] = { "IN0", "IN1" };
UINT8 maskA = 1 << (offset % 8);
@@ -126,7 +126,7 @@ static READ8_HANDLER( dragrace_input_r )
for (i = 0; i < 2; i++)
{
- int in = input_port_read(space->machine, portnames[i]);
+ int in = input_port_read(space->machine(), portnames[i]);
if (state->gear[i] != 0)
in &= ~(1 << state->gear[i]);
@@ -149,7 +149,7 @@ static READ8_HANDLER( dragrace_steering_r )
for (i = 0; i < 2; i++)
{
- int dial = input_port_read(space->machine, dialnames[i]);
+ int dial = input_port_read(space->machine(), dialnames[i]);
bitA[i] = ((dial + 1) / 2) & 1;
bitB[i] = ((dial + 0) / 2) & 1;
@@ -163,7 +163,7 @@ static READ8_HANDLER( dragrace_steering_r )
static READ8_HANDLER( dragrace_scanline_r )
{
- return (space->machine->primary_screen->vpos() ^ 0xf0) | 0x0f;
+ return (space->machine().primary_screen->vpos() ^ 0xf0) | 0x0f;
}
@@ -316,9 +316,9 @@ static PALETTE_INIT( dragrace )
static MACHINE_START( dragrace )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
- state->discrete = machine->device("discrete");
+ state->discrete = machine.device("discrete");
state->save_item(NAME(state->misc_flags));
state->save_item(NAME(state->gear));
@@ -326,7 +326,7 @@ static MACHINE_START( dragrace )
static MACHINE_RESET( dragrace )
{
- dragrace_state *state = machine->driver_data<dragrace_state>();
+ dragrace_state *state = machine.driver_data<dragrace_state>();
state->misc_flags = 0;
state->gear[0] = 0;
diff --git a/src/mame/drivers/dreamwld.c b/src/mame/drivers/dreamwld.c
index d9af87cda51..f0a62228904 100644
--- a/src/mame/drivers/dreamwld.c
+++ b/src/mame/drivers/dreamwld.c
@@ -113,13 +113,13 @@ public:
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
- const gfx_element *gfx = machine->gfx[0];
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
+ const gfx_element *gfx = machine.gfx[0];
UINT32 *source = state->spriteram;
UINT32 *finish = state->spriteram + 0x1000 / 4;
- UINT16 *redirect = (UINT16 *)machine->region("gfx3")->base();
+ UINT16 *redirect = (UINT16 *)machine.region("gfx3")->base();
while (source < finish)
{
@@ -171,7 +171,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static WRITE32_HANDLER( dreamwld_bg_videoram_w )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset * 2);
tilemap_mark_tile_dirty(state->bg_tilemap, offset * 2 + 1);
@@ -179,7 +179,7 @@ static WRITE32_HANDLER( dreamwld_bg_videoram_w )
static TILE_GET_INFO( get_dreamwld_bg_tile_info )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
int tileno, colour;
tileno = (tile_index & 1) ? (state->bg_videoram[tile_index >> 1] & 0xffff) : ((state->bg_videoram[tile_index >> 1] >> 16) & 0xffff);
colour = tileno >> 13;
@@ -190,7 +190,7 @@ static TILE_GET_INFO( get_dreamwld_bg_tile_info )
static WRITE32_HANDLER( dreamwld_bg2_videoram_w )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
COMBINE_DATA(&state->bg2_videoram[offset]);
tilemap_mark_tile_dirty(state->bg2_tilemap, offset * 2);
tilemap_mark_tile_dirty(state->bg2_tilemap, offset * 2 + 1);
@@ -198,7 +198,7 @@ static WRITE32_HANDLER( dreamwld_bg2_videoram_w )
static TILE_GET_INFO( get_dreamwld_bg2_tile_info )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
UINT16 tileno, colour;
tileno = (tile_index & 1) ? (state->bg2_videoram[tile_index >> 1] & 0xffff) : ((state->bg2_videoram[tile_index >> 1] >> 16) & 0xffff);
colour = tileno >> 13;
@@ -208,7 +208,7 @@ static TILE_GET_INFO( get_dreamwld_bg2_tile_info )
static VIDEO_START( dreamwld )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
state->bg_tilemap = tilemap_create(machine, get_dreamwld_bg_tile_info,tilemap_scan_rows, 16, 16, 64,32);
state->bg2_tilemap = tilemap_create(machine, get_dreamwld_bg2_tile_info,tilemap_scan_rows, 16, 16, 64,32);
@@ -217,7 +217,7 @@ static VIDEO_START( dreamwld )
static SCREEN_UPDATE( dreamwld )
{
- dreamwld_state *state = screen->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = screen->machine().driver_data<dreamwld_state>();
tilemap_set_scrolly(state->bg_tilemap, 0, state->bg_scroll[(0x400 / 4)] + 32);
tilemap_set_scrolly(state->bg2_tilemap, 0, state->bg_scroll[(0x400 / 4) + 2] + 32);
@@ -242,7 +242,7 @@ static SCREEN_UPDATE( dreamwld )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->bg2_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -250,10 +250,10 @@ static SCREEN_UPDATE( dreamwld )
static READ32_HANDLER( dreamwld_protdata_r )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
- UINT8 *protdata = space->machine->region("user1")->base();
- size_t protsize = space->machine->region("user1")->bytes();
+ UINT8 *protdata = space->machine().region("user1")->base();
+ size_t protsize = space->machine().region("user1")->bytes();
UINT8 dat = protdata[(state->protindex++) % protsize];
return dat << 24;
}
@@ -261,7 +261,7 @@ static READ32_HANDLER( dreamwld_protdata_r )
static WRITE32_HANDLER( dreamwld_palette_w )
{
- dreamwld_state *state = space->machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = space->machine().driver_data<dreamwld_state>();
UINT16 dat;
int color;
@@ -269,17 +269,17 @@ static WRITE32_HANDLER( dreamwld_palette_w )
color = offset * 2;
dat = state->paletteram[offset] & 0x7fff;
- palette_set_color_rgb(space->machine, color + 1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
+ palette_set_color_rgb(space->machine(), color + 1, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
dat = (state->paletteram[offset] >> 16) & 0x7fff;
- palette_set_color_rgb(space->machine, color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
+ palette_set_color_rgb(space->machine(), color, pal5bit(dat >> 10), pal5bit(dat >> 5), pal5bit(dat >> 0));
}
-static void dreamwld_oki_setbank( running_machine *machine, UINT8 chip, UINT8 bank )
+static void dreamwld_oki_setbank( running_machine &machine, UINT8 chip, UINT8 bank )
{
/* 0x30000-0x3ffff is banked.
banks are at 0x30000,0x40000,0x50000 and 0x60000 in rom */
- UINT8 *sound = machine->region(chip ? "oki1" : "oki2")->base();
+ UINT8 *sound = machine.region(chip ? "oki1" : "oki2")->base();
logerror("OKI%d: set bank %02x\n", chip, bank);
memcpy(sound + 0x30000, sound + 0xb0000 + 0x10000 * bank, 0x10000);
}
@@ -288,7 +288,7 @@ static void dreamwld_oki_setbank( running_machine *machine, UINT8 chip, UINT8 ba
static WRITE32_HANDLER( dreamwld_6295_0_bank_w )
{
if (ACCESSING_BITS_0_7)
- dreamwld_oki_setbank(space->machine, 0, data & 0x3);
+ dreamwld_oki_setbank(space->machine(), 0, data & 0x3);
else
logerror("OKI0: unk bank write %x mem_mask %8x\n", data, mem_mask);
}
@@ -296,7 +296,7 @@ static WRITE32_HANDLER( dreamwld_6295_0_bank_w )
static WRITE32_HANDLER( dreamwld_6295_1_bank_w )
{
if (ACCESSING_BITS_0_7)
- dreamwld_oki_setbank(space->machine, 1, data & 0x3);
+ dreamwld_oki_setbank(space->machine(), 1, data & 0x3);
else
logerror("OKI1: unk bank write %x mem_mask %8x\n", data, mem_mask);
}
@@ -402,7 +402,7 @@ GFXDECODE_END
static MACHINE_START( dreamwld )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
state->save_item(NAME(state->protindex));
state->save_item(NAME(state->tilebank));
@@ -411,7 +411,7 @@ static MACHINE_START( dreamwld )
static MACHINE_RESET( dreamwld )
{
- dreamwld_state *state = machine->driver_data<dreamwld_state>();
+ dreamwld_state *state = machine.driver_data<dreamwld_state>();
state->tilebankold[0] = state->tilebankold[1] = -1;
state->tilebank[0] = state->tilebank[1] = 0;
diff --git a/src/mame/drivers/drgnmst.c b/src/mame/drivers/drgnmst.c
index bfcb8e0fe0e..9305354bf48 100644
--- a/src/mame/drivers/drgnmst.c
+++ b/src/mame/drivers/drgnmst.c
@@ -43,14 +43,14 @@ Notes:
static WRITE16_HANDLER( drgnmst_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x100);
- coin_lockout_w(space->machine, 0, ~data & 0x400);
- coin_lockout_w(space->machine, 1, ~data & 0x800);
+ coin_counter_w(space->machine(), 0, data & 0x100);
+ coin_lockout_w(space->machine(), 0, ~data & 0x400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x800);
}
static WRITE16_HANDLER( drgnmst_snd_command_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
if (ACCESSING_BITS_0_7)
{
@@ -61,7 +61,7 @@ static WRITE16_HANDLER( drgnmst_snd_command_w )
static WRITE16_HANDLER( drgnmst_snd_flag_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
/* Enables the following 68K write operation to latch through to the PIC */
if (ACCESSING_BITS_0_7)
@@ -71,13 +71,13 @@ static WRITE16_HANDLER( drgnmst_snd_flag_w )
static READ8_HANDLER( pic16c5x_port0_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
return state->pic16c5x_port0;
}
static READ8_HANDLER( drgnmst_snd_command_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
int data = 0;
switch (state->oki_control & 0x1f)
@@ -94,7 +94,7 @@ static READ8_HANDLER( drgnmst_snd_command_r )
static READ8_HANDLER( drgnmst_snd_flag_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
if (state->snd_flag)
{
state->snd_flag = 0;
@@ -106,7 +106,7 @@ static READ8_HANDLER( drgnmst_snd_flag_r )
static WRITE8_HANDLER( drgnmst_pcm_banksel_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
/* This is a 4 bit port.
Each pair of bits is used in part of the OKI PCM ROM bank selectors.
See the Port 2 write handler below (drgnmst_snd_control_w) for details.
@@ -117,7 +117,7 @@ static WRITE8_HANDLER( drgnmst_pcm_banksel_w )
static WRITE8_HANDLER( drgnmst_oki_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
state->oki_command = data;
}
@@ -146,7 +146,7 @@ static WRITE8_HANDLER( drgnmst_snd_control_w )
The OKI0 banks are pre-configured below in the driver init.
*/
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
int oki_new_bank;
state->oki_control = data;
@@ -379,7 +379,7 @@ GFXDECODE_END
static MACHINE_START( drgnmst )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->save_item(NAME(state->snd_flag));
state->save_item(NAME(state->snd_command));
@@ -392,7 +392,7 @@ static MACHINE_START( drgnmst )
static MACHINE_RESET( drgnmst )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->snd_flag = 0;
state->snd_command = 0;
@@ -495,9 +495,9 @@ static UINT8 drgnmst_asciitohex( UINT8 data )
static DRIVER_INIT( drgnmst )
{
- UINT8 *drgnmst_PICROM_HEX = machine->region("user1")->base();
- UINT16 *drgnmst_PICROM = (UINT16 *)machine->region("audiocpu")->base();
- UINT8 *drgnmst_PCM = machine->region("oki1")->base();
+ UINT8 *drgnmst_PICROM_HEX = machine.region("user1")->base();
+ UINT16 *drgnmst_PICROM = (UINT16 *)machine.region("audiocpu")->base();
+ UINT8 *drgnmst_PCM = machine.region("oki1")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
@@ -563,7 +563,7 @@ static DRIVER_INIT( drgnmst )
data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
- pic16c5x_set_config(machine->device("audiocpu"), data);
+ pic16c5x_set_config(machine.device("audiocpu"), data);
src_pos = 0x7fff; /* Force Exit */
}
diff --git a/src/mame/drivers/dribling.c b/src/mame/drivers/dribling.c
index 38ccbea0cef..7287592971e 100644
--- a/src/mame/drivers/dribling.c
+++ b/src/mame/drivers/dribling.c
@@ -40,7 +40,7 @@
static INTERRUPT_GEN( dribling_irq_gen )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
if (state->di)
device_set_input_line(device, 0, ASSERT_LINE);
}
@@ -55,7 +55,7 @@ static INTERRUPT_GEN( dribling_irq_gen )
static READ8_DEVICE_HANDLER( dsr_r )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* return DSR0-7 */
return (state->ds << state->sh) | (state->dr >> (8 - state->sh));
@@ -64,15 +64,15 @@ static READ8_DEVICE_HANDLER( dsr_r )
static READ8_DEVICE_HANDLER( input_mux0_r )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* low value in the given bit selects */
if (!(state->input_mux & 0x01))
- return input_port_read(device->machine, "MUX0");
+ return input_port_read(device->machine(), "MUX0");
else if (!(state->input_mux & 0x02))
- return input_port_read(device->machine, "MUX1");
+ return input_port_read(device->machine(), "MUX1");
else if (!(state->input_mux & 0x04))
- return input_port_read(device->machine, "MUX2");
+ return input_port_read(device->machine(), "MUX2");
return 0xff;
}
@@ -86,7 +86,7 @@ static READ8_DEVICE_HANDLER( input_mux0_r )
static WRITE8_DEVICE_HANDLER( misc_w )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* bit 7 = di */
state->di = (data >> 7) & 1;
@@ -105,7 +105,7 @@ static WRITE8_DEVICE_HANDLER( misc_w )
/* bit 1 = (10) = PC1 */
/* bit 0 = (32) = PC0 */
state->input_mux = data & 7;
- logerror("%s:misc_w(%02X)\n", device->machine->describe_context(), data);
+ logerror("%s:misc_w(%02X)\n", device->machine().describe_context(), data);
}
@@ -119,24 +119,24 @@ static WRITE8_DEVICE_HANDLER( sound_w )
/* bit 2 = folla a */
/* bit 1 = folla m */
/* bit 0 = folla b */
- logerror("%s:sound_w(%02X)\n", device->machine->describe_context(), data);
+ logerror("%s:sound_w(%02X)\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER( pb_w )
{
/* write PB0-7 */
- logerror("%s:pb_w(%02X)\n", device->machine->describe_context(), data);
+ logerror("%s:pb_w(%02X)\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER( shr_w )
{
- dribling_state *state = device->machine->driver_data<dribling_state>();
+ dribling_state *state = device->machine().driver_data<dribling_state>();
/* bit 3 = watchdog */
if (data & 0x08)
- watchdog_reset(device->machine);
+ watchdog_reset(device->machine());
/* bit 2-0 = SH0-2 */
state->sh = data & 0x07;
@@ -152,7 +152,7 @@ static WRITE8_DEVICE_HANDLER( shr_w )
static READ8_HANDLER( ioread )
{
- dribling_state *state = space->machine->driver_data<dribling_state>();
+ dribling_state *state = space->machine().driver_data<dribling_state>();
if (offset & 0x08)
return ppi8255_r(state->ppi_0, offset & 3);
@@ -164,7 +164,7 @@ static READ8_HANDLER( ioread )
static WRITE8_HANDLER( iowrite )
{
- dribling_state *state = space->machine->driver_data<dribling_state>();
+ dribling_state *state = space->machine().driver_data<dribling_state>();
if (offset & 0x08)
ppi8255_w(state->ppi_0, offset & 3, data);
@@ -285,11 +285,11 @@ INPUT_PORTS_END
static MACHINE_START( dribling )
{
- dribling_state *state = machine->driver_data<dribling_state>();
+ dribling_state *state = machine.driver_data<dribling_state>();
- state->maincpu = machine->device("maincpu");
- state->ppi_0 = machine->device("ppi8255_0");
- state->ppi_1 = machine->device("ppi8255_1");
+ state->maincpu = machine.device("maincpu");
+ state->ppi_0 = machine.device("ppi8255_0");
+ state->ppi_1 = machine.device("ppi8255_1");
state->save_item(NAME(state->abca));
state->save_item(NAME(state->di));
@@ -301,7 +301,7 @@ static MACHINE_START( dribling )
static MACHINE_RESET( dribling )
{
- dribling_state *state = machine->driver_data<dribling_state>();
+ dribling_state *state = machine.driver_data<dribling_state>();
state->abca = 0;
state->di = 0;
diff --git a/src/mame/drivers/drmicro.c b/src/mame/drivers/drmicro.c
index 924a52d45ff..c319d483be3 100644
--- a/src/mame/drivers/drmicro.c
+++ b/src/mame/drivers/drmicro.c
@@ -25,7 +25,7 @@ Quite similar to Appoooh
static INTERRUPT_GEN( drmicro_interrupt )
{
- drmicro_state *state = device->machine->driver_data<drmicro_state>();
+ drmicro_state *state = device->machine().driver_data<drmicro_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -33,11 +33,11 @@ static INTERRUPT_GEN( drmicro_interrupt )
static WRITE8_HANDLER( nmi_enable_w )
{
- drmicro_state *state = space->machine->driver_data<drmicro_state>();
+ drmicro_state *state = space->machine().driver_data<drmicro_state>();
state->nmi_enable = data & 1;
state->flipscreen = (data & 2) ? 1 : 0;
- flip_screen_set(space->machine, data & 2);
+ flip_screen_set(space->machine(), data & 2);
// bit2,3 unknown
}
@@ -45,8 +45,8 @@ static WRITE8_HANDLER( nmi_enable_w )
static void pcm_w(device_t *device)
{
- drmicro_state *state = device->machine->driver_data<drmicro_state>();
- UINT8 *PCM = device->machine->region("adpcm")->base();
+ drmicro_state *state = device->machine().driver_data<drmicro_state>();
+ UINT8 *PCM = device->machine().region("adpcm")->base();
int data = PCM[state->pcm_adr / 2];
@@ -66,7 +66,7 @@ static void pcm_w(device_t *device)
static WRITE8_HANDLER( pcm_set_w )
{
- drmicro_state *state = space->machine->driver_data<drmicro_state>();
+ drmicro_state *state = space->machine().driver_data<drmicro_state>();
state->pcm_adr = ((data & 0x3f) << 9);
pcm_w(state->msm);
}
@@ -228,9 +228,9 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( drmicro )
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
- state->msm = machine->device("msm");
+ state->msm = machine.device("msm");
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->pcm_adr));
@@ -239,7 +239,7 @@ static MACHINE_START( drmicro )
static MACHINE_RESET( drmicro )
{
- drmicro_state *state = machine->driver_data<drmicro_state>();
+ drmicro_state *state = machine.driver_data<drmicro_state>();
state->nmi_enable = 0;
state->pcm_adr = 0;
diff --git a/src/mame/drivers/drtomy.c b/src/mame/drivers/drtomy.c
index 9d46c18f237..bf7c45413ff 100644
--- a/src/mame/drivers/drtomy.c
+++ b/src/mame/drivers/drtomy.c
@@ -34,7 +34,7 @@ public:
static TILE_GET_INFO( get_tile_info_fg )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
int code = state->videoram_fg[tile_index] & 0xfff;
int color = (state->videoram_fg[tile_index] & 0xf000) >> 12;
SET_TILE_INFO(2, code, color, 0);
@@ -43,7 +43,7 @@ static TILE_GET_INFO( get_tile_info_fg )
static TILE_GET_INFO( get_tile_info_bg )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
int code = state->videoram_bg[tile_index] & 0xfff;
int color = (state->videoram_bg[tile_index] & 0xf000) >> 12;
SET_TILE_INFO(1, code, color, 0);
@@ -67,11 +67,11 @@ static TILE_GET_INFO( get_tile_info_bg )
3 | xxxxxxxx xxxxxx-- | sprite code
*/
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
int i, x, y, ex, ey;
- const gfx_element *gfx = machine->gfx[0];
+ const gfx_element *gfx = machine.gfx[0];
static const int x_offset[2] = {0x0, 0x2};
static const int y_offset[2] = {0x0, 0x1};
@@ -114,7 +114,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static VIDEO_START( drtomy )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
state->tilemap_bg = tilemap_create(machine, get_tile_info_bg, tilemap_scan_rows, 16, 16, 32, 32);
state->tilemap_fg = tilemap_create(machine, get_tile_info_fg, tilemap_scan_rows, 16, 16, 32, 32);
@@ -124,31 +124,31 @@ static VIDEO_START( drtomy )
static SCREEN_UPDATE( drtomy )
{
- drtomy_state *state = screen->machine->driver_data<drtomy_state>();
+ drtomy_state *state = screen->machine().driver_data<drtomy_state>();
tilemap_draw(bitmap, cliprect, state->tilemap_bg, 0, 0);
tilemap_draw(bitmap, cliprect, state->tilemap_fg, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE16_HANDLER( drtomy_vram_fg_w )
{
- drtomy_state *state = space->machine->driver_data<drtomy_state>();
+ drtomy_state *state = space->machine().driver_data<drtomy_state>();
COMBINE_DATA(&state->videoram_fg[offset]);
tilemap_mark_tile_dirty(state->tilemap_fg, offset);
}
static WRITE16_HANDLER( drtomy_vram_bg_w )
{
- drtomy_state *state = space->machine->driver_data<drtomy_state>();
+ drtomy_state *state = space->machine().driver_data<drtomy_state>();
COMBINE_DATA(&state->videoram_bg[offset]);
tilemap_mark_tile_dirty(state->tilemap_bg, offset);
}
static WRITE16_DEVICE_HANDLER( drtomy_okibank_w )
{
- drtomy_state *state = device->machine->driver_data<drtomy_state>();
+ drtomy_state *state = device->machine().driver_data<drtomy_state>();
if (state->oki_bank != (data & 3))
{
state->oki_bank = data & 3;
@@ -278,14 +278,14 @@ INPUT_PORTS_END
static MACHINE_START( drtomy )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
state->save_item(NAME(state->oki_bank));
}
static MACHINE_RESET( drtomy )
{
- drtomy_state *state = machine->driver_data<drtomy_state>();
+ drtomy_state *state = machine.driver_data<drtomy_state>();
state->oki_bank = 0;
}
diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c
index eaf5ffcb3ef..e66392dbeae 100644
--- a/src/mame/drivers/drw80pkr.c
+++ b/src/mame/drivers/drw80pkr.c
@@ -59,8 +59,8 @@ public:
static MACHINE_START( drw80pkr )
{
- drw80pkr_state *state = machine->driver_data<drw80pkr_state>();
- machine->device<nvram_device>("nvram")->set_base(state->pkr_io_ram, sizeof(state->pkr_io_ram));
+ drw80pkr_state *state = machine.driver_data<drw80pkr_state>();
+ machine.device<nvram_device>("nvram")->set_base(state->pkr_io_ram, sizeof(state->pkr_io_ram));
}
/*****************
@@ -69,37 +69,37 @@ static MACHINE_START( drw80pkr )
static WRITE8_HANDLER( t0_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->t0 = data;
}
static WRITE8_HANDLER( t1_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->t1 = data;
}
static WRITE8_HANDLER( p0_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->p0 = data;
}
static WRITE8_HANDLER( p1_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->p1 = data;
}
static WRITE8_HANDLER( p2_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->p2 = data;
}
static WRITE8_HANDLER( prog_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->prog = data;
// Bankswitch Program Memory
@@ -107,19 +107,19 @@ static WRITE8_HANDLER( prog_w )
{
state->active_bank = state->active_bank ^ 0x01;
- memory_set_bank(space->machine, "bank1", state->active_bank);
+ memory_set_bank(space->machine(), "bank1", state->active_bank);
}
}
static WRITE8_HANDLER( bus_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
state->bus = data;
}
static WRITE8_HANDLER( drw80pkr_io_w )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
UINT16 n_offs;
if (state->p2 == 0x3f || state->p2 == 0x7f)
@@ -184,11 +184,11 @@ static WRITE8_HANDLER( drw80pkr_io_w )
// ay8910 control port
if (state->p1 == 0xfc)
- ay8910_address_w(space->machine->device("aysnd"), 0, data);
+ ay8910_address_w(space->machine().device("aysnd"), 0, data);
// ay8910_write_port_0_w
if (state->p1 == 0xfe)
- ay8910_data_w(space->machine->device("aysnd"), 0, data);
+ ay8910_data_w(space->machine().device("aysnd"), 0, data);
}
}
@@ -198,43 +198,43 @@ static WRITE8_HANDLER( drw80pkr_io_w )
static READ8_HANDLER( t0_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->t0;
}
static READ8_HANDLER( t1_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->t1;
}
static READ8_HANDLER( p0_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->p0;
}
static READ8_HANDLER( p1_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->p1;
}
static READ8_HANDLER( p2_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->p2;
}
static READ8_HANDLER( bus_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
return state->bus;
}
static READ8_HANDLER( drw80pkr_io_r )
{
- drw80pkr_state *state = space->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = space->machine().driver_data<drw80pkr_state>();
UINT8 ret;
UINT16 kbdin;
@@ -284,7 +284,7 @@ static READ8_HANDLER( drw80pkr_io_r )
{
// TODO: Get Input Port Values
- kbdin = ((input_port_read(space->machine, "IN1") & 0xaf ) << 8) + input_port_read(space->machine, "IN0");
+ kbdin = ((input_port_read(space->machine(), "IN1") & 0xaf ) << 8) + input_port_read(space->machine(), "IN0");
switch (kbdin)
{
@@ -324,7 +324,7 @@ static READ8_HANDLER( drw80pkr_io_r )
static TILE_GET_INFO( get_bg_tile_info )
{
- drw80pkr_state *state = machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = machine.driver_data<drw80pkr_state>();
int color = state->color_ram[tile_index];
int code = state->video_ram[tile_index];
@@ -333,13 +333,13 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( drw80pkr )
{
- drw80pkr_state *state = machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = machine.driver_data<drw80pkr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 24, 27);
}
static SCREEN_UPDATE( drw80pkr )
{
- drw80pkr_state *state = screen->machine->driver_data<drw80pkr_state>();
+ drw80pkr_state *state = screen->machine().driver_data<drw80pkr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
@@ -349,7 +349,7 @@ static PALETTE_INIT( drw80pkr )
{
int j;
- for (j = 0; j < machine->total_colors(); j++)
+ for (j = 0; j < machine.total_colors(); j++)
{
int r, g, b, tr, tg, tb, i;
@@ -404,7 +404,7 @@ GFXDECODE_END
static DRIVER_INIT( drw80pkr )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base(), 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base(), 0x1000);
}
diff --git a/src/mame/drivers/dunhuang.c b/src/mame/drivers/dunhuang.c
index e5e22c1a37a..f6245ac1347 100644
--- a/src/mame/drivers/dunhuang.c
+++ b/src/mame/drivers/dunhuang.c
@@ -95,14 +95,14 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
UINT16 code = state->videoram[tile_index];
UINT8 color = state->colorram[tile_index] & 0x0f;
SET_TILE_INFO(0, code, color, 0);
}
static TILE_GET_INFO( get_tile_info2 )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
UINT16 code = state->videoram2[tile_index];
UINT8 color = state->colorram2[tile_index] & 0x0f;
SET_TILE_INFO(1, code, color, 0);
@@ -110,7 +110,7 @@ static TILE_GET_INFO( get_tile_info2 )
static VIDEO_START(dunhuang)
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
state->tmap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 0x40,0x20);
state->tmap2 = tilemap_create(machine, get_tile_info2, tilemap_scan_rows, 8,32, 0x40,0x8);
@@ -126,20 +126,20 @@ static VIDEO_START(dunhuang)
static SCREEN_UPDATE( dunhuang )
{
- dunhuang_state *state = screen->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = screen->machine().driver_data<dunhuang_state>();
int layers_ctrl = -1;
#if DUNHUANG_DEBUG
-if (input_code_pressed(screen->machine, KEYCODE_Z))
+if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
switch (state->layers)
{
@@ -164,7 +164,7 @@ if (input_code_pressed(screen->machine, KEYCODE_Z))
static WRITE8_HANDLER( dunhuang_pos_x_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->pos_x = data & 0x3f;
state->written = 0;
state->written2 = 0;
@@ -172,7 +172,7 @@ static WRITE8_HANDLER( dunhuang_pos_x_w )
static WRITE8_HANDLER( dunhuang_pos_y_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->pos_y = data;
state->written = 0;
state->written2 = 0;
@@ -180,7 +180,7 @@ static WRITE8_HANDLER( dunhuang_pos_y_w )
static WRITE8_HANDLER( dunhuang_tile_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int addr;
if (state->written & (1 << offset))
@@ -207,7 +207,7 @@ static WRITE8_HANDLER( dunhuang_tile_w )
static WRITE8_HANDLER( dunhuang_tile2_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int addr;
if (state->written2 & (1 << offset))
@@ -236,12 +236,12 @@ static WRITE8_HANDLER( dunhuang_tile2_w )
static WRITE8_HANDLER( dunhuang_clear_y_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->clear_y = data;
}
static WRITE8_HANDLER( dunhuang_horiz_clear_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int i;
// logerror("%06x: horiz clear, y = %02x, data = %02d\n", cpu_get_pc(space->cpu), state->clear_y,data);
for (i = 0; i < 0x40; i++)
@@ -258,7 +258,7 @@ static WRITE8_HANDLER( dunhuang_horiz_clear_w )
static WRITE8_HANDLER( dunhuang_vert_clear_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int i;
// logerror("%06x: vert clear, x = %02x, y = %02x, data = %02x\n", cpu_get_pc(space->cpu), state->pos_x,state->pos_y,data);
for (i = 0; i < 0x08; i++)
@@ -279,50 +279,50 @@ static WRITE8_HANDLER( dunhuang_vert_clear_w )
static WRITE8_HANDLER( dunhuang_block_dest_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_dest = data;
}
static WRITE8_HANDLER( dunhuang_block_x_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_x = data;
}
static WRITE8_HANDLER( dunhuang_block_y_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_y = data;
}
static WRITE8_HANDLER( dunhuang_block_w_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_w = data;
}
static WRITE8_HANDLER( dunhuang_block_c_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_c = data;
}
static WRITE8_HANDLER( dunhuang_block_addr_lo_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_addr_lo = data;
}
static WRITE8_HANDLER( dunhuang_block_addr_hi_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->block_addr_hi = data;
}
static WRITE8_HANDLER( dunhuang_block_h_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
int i,j, addr;
UINT8 *tile_addr;
@@ -330,7 +330,7 @@ static WRITE8_HANDLER( dunhuang_block_h_w )
state->block_h = data;
- tile_addr = space->machine->region("gfx2")->base() + ((state->block_addr_hi << 8) + state->block_addr_lo) * 4;
+ tile_addr = space->machine().region("gfx2")->base() + ((state->block_addr_hi << 8) + state->block_addr_lo) * 4;
switch (state->block_dest)
{
@@ -373,16 +373,16 @@ static WRITE8_HANDLER( dunhuang_block_h_w )
static WRITE8_HANDLER( dunhuang_paloffs_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->paloffs = data * 3;
}
static WRITE8_HANDLER( dunhuang_paldata_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->paldata[state->paloffs] = data;
- palette_set_color_rgb( space->machine, state->paloffs/3,
+ palette_set_color_rgb( space->machine(), state->paloffs/3,
pal6bit(state->paldata[(state->paloffs/3)*3+0]),
pal6bit(state->paldata[(state->paloffs/3)*3+1]),
pal6bit(state->paldata[(state->paloffs/3)*3+2])
@@ -395,7 +395,7 @@ static WRITE8_HANDLER( dunhuang_paldata_w )
static WRITE8_HANDLER( dunhuang_layers_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
// popmessage("layers %02x",data);
state->layers = data;
}
@@ -414,53 +414,53 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( dunhuang_input_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
state->input = data;
}
static READ8_HANDLER( dunhuang_service_r )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
- return input_port_read(space->machine, "SERVICE")
- | ((state->hopper && !(space->machine->primary_screen->frame_number() % 10)) ? 0x00 : 0x08) // bit 3: hopper sensor
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
+ return input_port_read(space->machine(), "SERVICE")
+ | ((state->hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0x00 : 0x08) // bit 3: hopper sensor
| 0x80 // bit 7 low -> tiles block transferrer busy
;
}
static READ8_DEVICE_HANDLER( dunhuang_dsw_r )
{
- dunhuang_state *state = device->machine->driver_data<dunhuang_state>();
- if (!(state->input & 0x01)) return input_port_read(device->machine, "DSW1");
- if (!(state->input & 0x02)) return input_port_read(device->machine, "DSW2");
- if (!(state->input & 0x04)) return input_port_read(device->machine, "DSW3");
- if (!(state->input & 0x08)) return input_port_read(device->machine, "DSW4");
- if (!(state->input & 0x10)) return input_port_read(device->machine, "DSW5");
- logerror("%s: warning, unknown dsw bits read, input = %02x\n", device->machine->describe_context(), state->input);
+ dunhuang_state *state = device->machine().driver_data<dunhuang_state>();
+ if (!(state->input & 0x01)) return input_port_read(device->machine(), "DSW1");
+ if (!(state->input & 0x02)) return input_port_read(device->machine(), "DSW2");
+ if (!(state->input & 0x04)) return input_port_read(device->machine(), "DSW3");
+ if (!(state->input & 0x08)) return input_port_read(device->machine(), "DSW4");
+ if (!(state->input & 0x10)) return input_port_read(device->machine(), "DSW5");
+ logerror("%s: warning, unknown dsw bits read, input = %02x\n", device->machine().describe_context(), state->input);
return 0xff;
}
static READ8_HANDLER( dunhuang_input_r )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
- if (!(state->input & 0x01)) return input_port_read(space->machine, "IN0");
- if (!(state->input & 0x02)) return input_port_read(space->machine, "IN1");
- if (!(state->input & 0x04)) return input_port_read(space->machine, "IN2");
- if (!(state->input & 0x08)) return input_port_read(space->machine, "IN3");
- if (!(state->input & 0x10)) return input_port_read(space->machine, "IN4");
- logerror("%s: warning, unknown input bits read, input = %02x\n", space->machine->describe_context(), state->input);
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
+ if (!(state->input & 0x01)) return input_port_read(space->machine(), "IN0");
+ if (!(state->input & 0x02)) return input_port_read(space->machine(), "IN1");
+ if (!(state->input & 0x04)) return input_port_read(space->machine(), "IN2");
+ if (!(state->input & 0x08)) return input_port_read(space->machine(), "IN3");
+ if (!(state->input & 0x10)) return input_port_read(space->machine(), "IN4");
+ logerror("%s: warning, unknown input bits read, input = %02x\n", space->machine().describe_context(), state->input);
return 0xff;
}
static WRITE8_HANDLER( dunhuang_rombank_w )
{
- dunhuang_state *state = space->machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = space->machine().driver_data<dunhuang_state>();
// ? data & 0x01
// ? data & 0x02
- memory_set_bank(space->machine, "bank1", ((data >> 2) & 0x7));
+ memory_set_bank(space->machine(), "bank1", ((data >> 2) & 0x7));
// COIN OUT: data & 0x20
- coin_counter_w(space->machine, 0, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x40);
state->hopper = data & 0x80;
}
@@ -756,8 +756,8 @@ static const ay8910_interface dunhuang_ay8910_interface =
static MACHINE_START( dunhuang )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
@@ -782,7 +782,7 @@ static MACHINE_START( dunhuang )
static MACHINE_RESET( dunhuang )
{
- dunhuang_state *state = machine->driver_data<dunhuang_state>();
+ dunhuang_state *state = machine.driver_data<dunhuang_state>();
state->written = 0;
state->written2 = 0;
diff --git a/src/mame/drivers/dwarfd.c b/src/mame/drivers/dwarfd.c
index c7cb63f24a7..96b65bac35e 100644
--- a/src/mame/drivers/dwarfd.c
+++ b/src/mame/drivers/dwarfd.c
@@ -349,7 +349,7 @@ enum
static WRITE8_HANDLER (i8275_preg_w) //param reg
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
switch (state->i8275Command)
{
@@ -470,7 +470,7 @@ static READ8_HANDLER (i8275_preg_r) //param reg
static WRITE8_HANDLER (i8275_creg_w) //comand reg
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
switch (data>>5)
{
@@ -515,7 +515,7 @@ static READ8_HANDLER (i8275_sreg_r) //status
static READ8_HANDLER(dwarfd_ram_r)
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
if (state->crt_access == 0)
{
@@ -531,7 +531,7 @@ static READ8_HANDLER(dwarfd_ram_r)
static WRITE8_HANDLER(dwarfd_ram_w)
{
- dwarfd_state *state = space->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = space->machine().driver_data<dwarfd_state>();
state->dw_ram[offset] = data;
}
@@ -568,7 +568,7 @@ static WRITE8_HANDLER(output2_w)
static READ8_HANDLER(qc_b8_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( mem_map, AS_PROGRAM, 8 )
@@ -680,9 +680,9 @@ static VIDEO_START(dwarfd)
{
}
-static void drawCrt( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void drawCrt( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
int x, y;
for (y = 0; y < maxy; y++)
{
@@ -725,13 +725,13 @@ static void drawCrt( running_machine *machine, bitmap_t *bitmap,const rectangle
if ((tile & 0xc0) == 0xc0)
{
b = 1;
- tile = machine->rand() & 0x7f;//(tile >> 2) & 0xf;
+ tile = machine.rand() & 0x7f;//(tile >> 2) & 0xf;
}
}
else
b = 1;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0],
tile + (state->bank + bank2) * 128,
0,
0, 0,
@@ -743,14 +743,14 @@ static void drawCrt( running_machine *machine, bitmap_t *bitmap,const rectangle
static SCREEN_UPDATE( dwarfd )
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
- drawCrt(screen->machine, bitmap, cliprect);
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
+ drawCrt(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE_LINE_DEVICE_HANDLER( dwarfd_sod_callback )
{
- dwarfd_state *driver_state = device->machine->driver_data<dwarfd_state>();
+ dwarfd_state *driver_state = device->machine().driver_data<dwarfd_state>();
driver_state->crt_access = state;
}
@@ -767,7 +767,7 @@ static I8085_CONFIG( dwarfd_i8085_config )
#define NUM_LINES 25
static INTERRUPT_GEN( dwarfd_interrupt )
{
- dwarfd_state *state = device->machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = device->machine().driver_data<dwarfd_state>();
if (cpu_getiloops(device) < NUM_LINES)
{
@@ -887,9 +887,9 @@ static PALETTE_INIT(dwarfd)
for (i = 0; i < 256; i++)
{
- int r = machine->rand()|0x80;
- int g = machine->rand()|0x80;
- int b = machine->rand()|0x80;
+ int r = machine.rand()|0x80;
+ int g = machine.rand()|0x80;
+ int b = machine.rand()|0x80;
if (i == 0) r = g = b = 0;
palette_set_color(machine,i,MAKE_RGB(r,g,b));
@@ -913,7 +913,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( dwarfd )
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
state->save_item(NAME(state->bank));
state->save_item(NAME(state->line));
@@ -937,7 +937,7 @@ static MACHINE_START( dwarfd )
static MACHINE_RESET( dwarfd )
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
state->bank = 0;
state->line = 0;
@@ -1136,13 +1136,13 @@ ROM_END
static DRIVER_INIT(dwarfd)
{
- dwarfd_state *state = machine->driver_data<dwarfd_state>();
+ dwarfd_state *state = machine.driver_data<dwarfd_state>();
int i;
UINT8 *src, *dst;
/* expand gfx roms */
- src = machine->region("gfx1")->base();
- dst = machine->region("gfx2")->base();
+ src = machine.region("gfx1")->base();
+ dst = machine.region("gfx2")->base();
for (i = 0; i < 0x4000; i++)
{
@@ -1155,7 +1155,7 @@ static DRIVER_INIT(dwarfd)
}
/* use low bit as 'interpolation' bit */
- src = machine->region("gfx2")->base();
+ src = machine.region("gfx2")->base();
for (i = 0; i < 0x8000; i++)
{
if (src[i] & 0x10)
@@ -1186,12 +1186,12 @@ static DRIVER_INIT(qc)
DRIVER_INIT_CALL(dwarfd);
// hacks for program to proceed
- machine->region("maincpu")->base()[0x6564] = 0x00;
- machine->region("maincpu")->base()[0x6565] = 0x00;
+ machine.region("maincpu")->base()[0x6564] = 0x00;
+ machine.region("maincpu")->base()[0x6565] = 0x00;
- machine->region("maincpu")->base()[0x59b2] = 0x00;
- machine->region("maincpu")->base()[0x59b3] = 0x00;
- machine->region("maincpu")->base()[0x59b4] = 0x00;
+ machine.region("maincpu")->base()[0x59b2] = 0x00;
+ machine.region("maincpu")->base()[0x59b3] = 0x00;
+ machine.region("maincpu")->base()[0x59b4] = 0x00;
}
diff --git a/src/mame/drivers/dynadice.c b/src/mame/drivers/dynadice.c
index 8980614b045..c0b61ff6db2 100644
--- a/src/mame/drivers/dynadice.c
+++ b/src/mame/drivers/dynadice.c
@@ -59,7 +59,7 @@ public:
static WRITE8_HANDLER( dynadice_videoram_w )
{
- dynadice_state *state = space->machine->driver_data<dynadice_state>();
+ dynadice_state *state = space->machine().driver_data<dynadice_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
tilemap_mark_all_tiles_dirty(state->top_tilemap);
@@ -67,13 +67,13 @@ static WRITE8_HANDLER( dynadice_videoram_w )
static WRITE8_HANDLER( sound_data_w )
{
- dynadice_state *state = space->machine->driver_data<dynadice_state>();
+ dynadice_state *state = space->machine().driver_data<dynadice_state>();
state->ay_data = data;
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- dynadice_state *state = device->machine->driver_data<dynadice_state>();
+ dynadice_state *state = device->machine().driver_data<dynadice_state>();
/*
AY 3-8910 :
@@ -190,14 +190,14 @@ GFXDECODE_END
static TILE_GET_INFO( get_tile_info )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
static VIDEO_START( dynadice )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
/* pacman - style videoram layout */
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -207,7 +207,7 @@ static VIDEO_START( dynadice )
static SCREEN_UPDATE( dynadice )
{
- dynadice_state *state = screen->machine->driver_data<dynadice_state>();
+ dynadice_state *state = screen->machine().driver_data<dynadice_state>();
rectangle myclip = *cliprect;
myclip.max_x = 15;
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -224,13 +224,13 @@ static PALETTE_INIT( dynadice )
static MACHINE_START( dynadice )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
state->save_item(NAME(state->ay_data));
}
static MACHINE_RESET( dynadice )
{
- dynadice_state *state = machine->driver_data<dynadice_state>();
+ dynadice_state *state = machine.driver_data<dynadice_state>();
state->ay_data = 0;
}
@@ -293,10 +293,10 @@ ROM_END
static DRIVER_INIT( dynadice )
{
int i, j;
- UINT8 *usr1 = machine->region("user1")->base();
- UINT8 *cpu2 = machine->region("audiocpu")->base();
- UINT8 *gfx1 = machine->region("gfx1")->base();
- UINT8 *gfx2 = machine->region("gfx2")->base();
+ UINT8 *usr1 = machine.region("user1")->base();
+ UINT8 *cpu2 = machine.region("audiocpu")->base();
+ UINT8 *gfx1 = machine.region("gfx1")->base();
+ UINT8 *gfx2 = machine.region("gfx2")->base();
cpu2[0x0b] = 0x23; /* bug in game code Dec HL -> Inc HL*/
diff --git a/src/mame/drivers/dynax.c b/src/mame/drivers/dynax.c
index cd0d50ed07e..54b0ed7f4b2 100644
--- a/src/mame/drivers/dynax.c
+++ b/src/mame/drivers/dynax.c
@@ -99,39 +99,39 @@ TODO:
/* It runs in IM 0, thus needs an opcode on the data bus */
-void sprtmtch_update_irq( running_machine *machine )
+void sprtmtch_update_irq( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int irq = (state->sound_irq ? 0x08 : 0) | ((state->vblank_irq) ? 0x10 : 0) | ((state->blitter_irq) ? 0x20 : 0) ;
device_set_input_line_and_vector(state->maincpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */
}
static WRITE8_HANDLER( dynax_vblank_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->vblank_irq = 0;
- sprtmtch_update_irq(space->machine);
+ sprtmtch_update_irq(space->machine());
}
static WRITE8_HANDLER( dynax_blitter_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter_irq = 0;
- sprtmtch_update_irq(space->machine);
+ sprtmtch_update_irq(space->machine());
}
static INTERRUPT_GEN( sprtmtch_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->vblank_irq = 1;
- sprtmtch_update_irq(device->machine);
+ sprtmtch_update_irq(device->machine());
}
static void sprtmtch_sound_callback( device_t *device, int state )
{
- dynax_state *driver_state = device->machine->driver_data<dynax_state>();
+ dynax_state *driver_state = device->machine().driver_data<dynax_state>();
driver_state->sound_irq = state;
- sprtmtch_update_irq(device->machine);
+ sprtmtch_update_irq(device->machine());
}
@@ -140,39 +140,39 @@ static void sprtmtch_sound_callback( device_t *device, int state )
***************************************************************************/
/* It runs in IM 0, thus needs an opcode on the data bus */
-void jantouki_update_irq(running_machine *machine)
+void jantouki_update_irq(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int irq = ((state->blitter_irq) ? 0x08 : 0) | ((state->blitter2_irq) ? 0x10 : 0) | ((state->vblank_irq) ? 0x20 : 0) ;
device_set_input_line_and_vector(state->maincpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */
}
static WRITE8_HANDLER( jantouki_vblank_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->vblank_irq = 0;
- jantouki_update_irq(space->machine);
+ jantouki_update_irq(space->machine());
}
static WRITE8_HANDLER( jantouki_blitter_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter_irq = data;
- jantouki_update_irq(space->machine);
+ jantouki_update_irq(space->machine());
}
static WRITE8_HANDLER( jantouki_blitter2_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter2_irq = data;
- jantouki_update_irq(space->machine);
+ jantouki_update_irq(space->machine());
}
static INTERRUPT_GEN( jantouki_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->vblank_irq = 1;
- jantouki_update_irq(device->machine);
+ jantouki_update_irq(device->machine());
}
@@ -180,32 +180,32 @@ static INTERRUPT_GEN( jantouki_vblank_interrupt )
Jantouki - Sound CPU
***************************************************************************/
-static void jantouki_sound_update_irq(running_machine *machine)
+static void jantouki_sound_update_irq(running_machine &machine)
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
int irq = ((state->sound_irq) ? 0x08 : 0) | ((state->soundlatch_irq) ? 0x10 : 0) | ((state->sound_vblank_irq) ? 0x20 : 0) ;
device_set_input_line_and_vector(state->soundcpu, 0, irq ? ASSERT_LINE : CLEAR_LINE, 0xc7 | irq); /* rst $xx */
}
static INTERRUPT_GEN( jantouki_sound_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->sound_vblank_irq = 1;
- jantouki_sound_update_irq(device->machine);
+ jantouki_sound_update_irq(device->machine());
}
static WRITE8_HANDLER( jantouki_sound_vblank_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->sound_vblank_irq = 0;
- jantouki_sound_update_irq(space->machine);
+ jantouki_sound_update_irq(space->machine());
}
static void jantouki_sound_callback(device_t *device, int state)
{
- dynax_state *driver_state = device->machine->driver_data<dynax_state>();
+ dynax_state *driver_state = device->machine().driver_data<dynax_state>();
driver_state->sound_irq = state;
- jantouki_sound_update_irq(device->machine);
+ jantouki_sound_update_irq(device->machine());
}
@@ -223,12 +223,12 @@ static void jantouki_sound_callback(device_t *device, int state)
static WRITE8_HANDLER( dynax_coincounter_0_w )
{
- coin_counter_w(space->machine, 0, data);
+ coin_counter_w(space->machine(), 0, data);
}
static WRITE8_HANDLER( dynax_coincounter_1_w )
{
- coin_counter_w(space->machine, 1, data);
+ coin_counter_w(space->machine(), 1, data);
}
static READ8_HANDLER( ret_ff )
@@ -239,60 +239,60 @@ static READ8_HANDLER( ret_ff )
static READ8_HANDLER( hanamai_keyboard_0_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY0");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY1");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY2");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY3");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY4");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY0");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY1");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY2");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY3");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY4");
return res;
}
static READ8_HANDLER( hanamai_keyboard_1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
/* the game reads all rows at once (keyb = 0) to check if a key is pressed */
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY5");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY6");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY7");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY8");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY9");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY5");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY6");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY7");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY8");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY9");
return res;
}
static WRITE8_HANDLER( hanamai_keyboard_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->keyb = data;
}
static WRITE8_HANDLER( dynax_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static WRITE8_HANDLER( jantouki_sound_rombank_w )
{
- memory_set_bank(space->machine, "bank2", data);
+ memory_set_bank(space->machine(), "bank2", data);
}
static WRITE8_HANDLER( hnoridur_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- int bank_n = (space->machine->region("maincpu")->bytes() - 0x10000) / 0x8000;
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ int bank_n = (space->machine().region("maincpu")->bytes() - 0x10000) / 0x8000;
//logerror("%04x: rom bank = %02x\n", cpu_get_pc(space->cpu), data);
if (data < bank_n)
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
else
logerror("rom_bank = %02x (larger than the maximum bank %02x)\n", data, bank_n);
state->hnoridur_bank = data;
@@ -301,14 +301,14 @@ static WRITE8_HANDLER( hnoridur_rombank_w )
static WRITE8_HANDLER( hnoridur_palbank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->palbank = data & 0x0f;
dynax_blit_palbank_w(space, 0, data);
}
static WRITE8_HANDLER( hnoridur_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->hnoridur_bank)
{
@@ -327,7 +327,7 @@ static WRITE8_HANDLER( hnoridur_palette_w )
// hnoridur: R/W RAM
case 0x18:
{
- UINT8 *RAM = space->machine->region("maincpu")->base() + 0x10000 + state->hnoridur_bank * 0x8000;
+ UINT8 *RAM = space->machine().region("maincpu")->base() + 0x10000 + state->hnoridur_bank * 0x8000;
RAM[offset] = data;
return;
}
@@ -343,13 +343,13 @@ static WRITE8_HANDLER( hnoridur_palette_w )
int r = BITSWAP8((x >> 0) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
int g = BITSWAP8((x >> 5) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
int b = BITSWAP8((x >> 10) & 0x1f, 7, 6, 5, 0, 1, 2, 3, 4);
- palette_set_color_rgb(space->machine, 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
static WRITE8_HANDLER( yarunara_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int addr = 512 * state->palbank + offset;
switch (state->hnoridur_bank)
@@ -375,13 +375,13 @@ static WRITE8_HANDLER( yarunara_palette_w )
int r = br & 0x1f;
int g = bg & 0x1f;
int b = ((bg & 0xc0) >> 3) | ((br & 0xe0) >> 5);
- palette_set_color_rgb(space->machine, 256 * state->palbank + ((offset & 0x0f) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + ((offset & 0x0f) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
}
}
static WRITE8_HANDLER( nanajign_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->hnoridur_bank)
{
@@ -404,14 +404,14 @@ static WRITE8_HANDLER( nanajign_palette_w )
int r = br & 0x1f;
int g = bg & 0x1f;
int b = ((bg & 0xc0) >> 3) | ((br & 0xe0) >> 5);
- palette_set_color_rgb(space->machine, 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + offset, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
static void adpcm_int( device_t *device )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
msm5205_data_w(device, state->msm5205next >> 4);
state->msm5205next <<= 4;
@@ -426,7 +426,7 @@ static void adpcm_int( device_t *device )
static void adpcm_int_cpu1( device_t *device )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
msm5205_data_w(device, state->msm5205next >> 4);
state->msm5205next <<= 4;
@@ -441,23 +441,23 @@ static void adpcm_int_cpu1( device_t *device )
static WRITE8_HANDLER( adpcm_data_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->msm5205next = data;
}
static WRITE8_DEVICE_HANDLER( adpcm_reset_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->resetkludge = data & 1;
msm5205_reset_w(device, ~data & 1);
}
static MACHINE_RESET( adpcm )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
/* start with the MSM5205 reset */
state->resetkludge = 0;
- msm5205_reset_w(machine->device("msm"), 1);
+ msm5205_reset_w(machine.device("msm"), 1);
}
static WRITE8_HANDLER( yarunara_layer_half_w )
@@ -609,35 +609,35 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( hjingi_bank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hnoridur_bank = data;
}
static WRITE8_HANDLER( hjingi_lockout_w )
{
- coin_lockout_w(space->machine, 0, (~data) & 0x01);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x01);
}
static WRITE8_HANDLER( hjingi_hopper_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->hopper = data & 0x01;
}
-static UINT8 hjingi_hopper_bit( running_machine *machine )
+static UINT8 hjingi_hopper_bit( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- return (state->hopper && !(machine->primary_screen->frame_number() % 10)) ? 0 : (1 << 6);
+ dynax_state *state = machine.driver_data<dynax_state>();
+ return (state->hopper && !(machine.primary_screen->frame_number() % 10)) ? 0 : (1 << 6);
}
static READ8_HANDLER( hjingi_keyboard_0_r )
{
- return hanamai_keyboard_0_r(space, 0) | hjingi_hopper_bit(space->machine);
+ return hanamai_keyboard_0_r(space, 0) | hjingi_hopper_bit(space->machine());
}
static READ8_HANDLER( hjingi_keyboard_1_r )
{
- return hanamai_keyboard_1_r(space, 0) | input_port_read(space->machine, "BET");
+ return hanamai_keyboard_1_r(space, 0) | input_port_read(space->machine(), "BET");
}
static ADDRESS_MAP_START( hjingi_mem_map, AS_PROGRAM, 8 )
@@ -706,7 +706,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( yarunara_input_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
@@ -721,7 +721,7 @@ static WRITE8_HANDLER( yarunara_input_w )
static READ8_HANDLER( yarunara_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
@@ -732,7 +732,7 @@ static READ8_HANDLER( yarunara_input_r )
switch (state->input_sel)
{
case 0x00:
- return input_port_read(space->machine, "COINS"); // coins
+ return input_port_read(space->machine(), "COINS"); // coins
case 0x02:
return 0xff; // bit 7 must be 1. Bit 2?
@@ -749,12 +749,12 @@ static READ8_HANDLER( yarunara_input_r )
// player 2
case 0x01: //quiztvqq
case 0x81:
- return input_port_read(space->machine, keynames1[state->keyb++]);
+ return input_port_read(space->machine(), keynames1[state->keyb++]);
// player 1
case 0x02: //quiztvqq
case 0x82:
- return input_port_read(space->machine, keynames0[state->keyb++]);
+ return input_port_read(space->machine(), keynames0[state->keyb++]);
default:
return 0xff;
@@ -766,8 +766,8 @@ static READ8_HANDLER( yarunara_input_r )
static WRITE8_HANDLER( yarunara_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
- memory_set_bank(space->machine, "bank1", data);
+ dynax_state *state = space->machine().driver_data<dynax_state>();
+ memory_set_bank(space->machine(), "bank1", data);
state->hnoridur_bank = data;
}
@@ -962,19 +962,19 @@ ADDRESS_MAP_END
static READ8_HANDLER( jantouki_soundlatch_ack_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return (state->soundlatch_ack) ? 0x80 : 0;
}
static WRITE8_HANDLER( jantouki_soundlatch_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->soundlatch_ack = 1;
state->soundlatch_full = 1;
state->soundlatch_irq = 1;
state->latch = data;
- jantouki_sound_update_irq(space->machine);
+ jantouki_sound_update_irq(space->machine());
}
static READ8_HANDLER( jantouki_blitter_busy_r )
@@ -984,8 +984,8 @@ static READ8_HANDLER( jantouki_blitter_busy_r )
static WRITE8_HANDLER( jantouki_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
- set_led_status(space->machine, 0, data & 0x10); // maybe
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
+ set_led_status(space->machine(), 0, data & 0x10); // maybe
}
static ADDRESS_MAP_START( jantouki_io_map, AS_IO, 8 )
@@ -1027,22 +1027,22 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( jantouki_soundlatch_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->soundlatch_ack = data;
state->soundlatch_irq = 0;
- jantouki_sound_update_irq(space->machine);
+ jantouki_sound_update_irq(space->machine());
}
static READ8_HANDLER( jantouki_soundlatch_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->soundlatch_full = 0;
return state->latch;
}
static READ8_HANDLER( jantouki_soundlatch_status_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return (state->soundlatch_full) ? 0 : 0x80;
}
@@ -1068,21 +1068,21 @@ ADDRESS_MAP_END
static READ8_HANDLER( mjelctrn_keyboard_1_r )
{
- return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (input_port_read(space->machine, "FAKE") ? 0x40 : 0);
+ return (hanamai_keyboard_1_r(space, 0) & 0x3f) | (input_port_read(space->machine(), "FAKE") ? 0x40 : 0);
}
static READ8_HANDLER( mjelctrn_dsw_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int dsw = (state->keyb & 0xc0) >> 6;
static const char *const dswnames[] = { "DSW0", "DSW1", "DSW3", "DSW4" };
- return input_port_read(space->machine, dswnames[dsw]);
+ return input_port_read(space->machine(), dswnames[dsw]);
}
static WRITE8_HANDLER( mjelctrn_blitter_ack_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->blitter_irq = 0;
}
@@ -1131,33 +1131,33 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( htengoku_select_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->input_sel = data;
state->keyb = 0;
}
static WRITE8_DEVICE_HANDLER( htengoku_dsw_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_DEVICE_HANDLER( htengoku_dsw_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW0");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW4");
- logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine->describe_context(), state->dsw_sel);
+ dynax_state *state = device->machine().driver_data<dynax_state>();
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
+ logerror("%s: warning, unknown bits read, dsw_sel = %02x\n", device->machine().describe_context(), state->dsw_sel);
return 0xff;
}
static WRITE8_HANDLER( htengoku_coin_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
@@ -1165,7 +1165,7 @@ static WRITE8_HANDLER( htengoku_coin_w )
// bit 0 = coin counter
// bit 1 = out counter
// bit 2 = hopper
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
state->hopper = data & 0x04;
#ifdef MAME_DEBUG
// popmessage("COINS %02x",data);
@@ -1182,14 +1182,14 @@ static WRITE8_HANDLER( htengoku_coin_w )
static READ8_HANDLER( htengoku_input_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
switch (state->input_sel)
{
- case 0x81: return input_port_read(space->machine, keynames1[state->keyb++]);
- case 0x82: return input_port_read(space->machine, keynames0[state->keyb++]);
+ case 0x81: return input_port_read(space->machine(), keynames1[state->keyb++]);
+ case 0x82: return input_port_read(space->machine(), keynames0[state->keyb++]);
case 0x0d: return 0xff; // unused
}
logerror("%04x: input_r with select = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
@@ -1198,13 +1198,13 @@ static READ8_HANDLER( htengoku_input_r )
static READ8_HANDLER( htengoku_coin_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
- case 0x00: return input_port_read(space->machine, "COINS");
+ case 0x00: return input_port_read(space->machine(), "COINS");
case 0x01: return 0xff; //?
- case 0x02: return 0xbf | ((state->hopper && !(space->machine->primary_screen->frame_number() % 10)) ? 0 : (1 << 6)); // bit 7 = blitter busy, bit 6 = hopper
+ case 0x02: return 0xbf | ((state->hopper && !(space->machine().primary_screen->frame_number() % 10)) ? 0 : (1 << 6)); // bit 7 = blitter busy, bit 6 = hopper
case 0x03: return state->coins;
}
logerror("%04x: coin_r with select = %02x\n", cpu_get_pc(space->cpu), state->input_sel);
@@ -1213,9 +1213,9 @@ static READ8_HANDLER( htengoku_coin_r )
static WRITE8_HANDLER( htengoku_rombank_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
state->hnoridur_bank = data;
}
@@ -1276,7 +1276,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( tenkai_ipsel_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (offset)
{
case 0: state->input_sel = data;
@@ -1290,13 +1290,13 @@ static WRITE8_HANDLER( tenkai_ipsel_w )
static WRITE8_HANDLER( tenkai_ip_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
switch (state->input_sel)
{
case 0x0c:
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
// bit 2?
// bit 3?
// popmessage("%02x", data);
@@ -1312,7 +1312,7 @@ static WRITE8_HANDLER( tenkai_ip_w )
static READ8_HANDLER( tenkai_ip_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
static const char *const keynames0[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
//static const char *const keynames1[] = { "KEY5", "KEY6", "KEY7", "KEY8", "KEY9" };
@@ -1323,7 +1323,7 @@ static READ8_HANDLER( tenkai_ip_r )
switch (state->input_sel)
{
case 0x00:
- return input_port_read(space->machine, "COINS"); // coins
+ return input_port_read(space->machine(), "COINS"); // coins
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(space->cpu), state->input_sel, offset);
@@ -1342,13 +1342,13 @@ static READ8_HANDLER( tenkai_ip_r )
case 0x81:
if (state->keyb >= 5)
logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(space->cpu), state->keyb);
- return 0xff;//input_port_read(space->machine, keynames1[state->keyb++]);
+ return 0xff;//input_port_read(space->machine(), keynames1[state->keyb++]);
// player 1
case 0x82:
if (state->keyb >= 5)
logerror("%04x: unmapped keyb=%02x read\n", cpu_get_pc(space->cpu), state->keyb);
- return input_port_read(space->machine, keynames0[state->keyb++]);
+ return input_port_read(space->machine(), keynames0[state->keyb++]);
default:
logerror("%04x: unmapped ip_sel=%02x read from offs %x\n", cpu_get_pc(space->cpu), state->input_sel, offset);
@@ -1362,33 +1362,33 @@ static READ8_HANDLER( tenkai_ip_r )
static WRITE8_DEVICE_HANDLER( tenkai_dswsel_w )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->dsw_sel = data;
}
static READ8_DEVICE_HANDLER( tenkai_dsw_r )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
- if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine, "DSW0");
- if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine, "DSW1");
- if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine, "DSW2");
- if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine, "DSW3");
- if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine, "DSW4");
- logerror("%s: unmapped dsw %02x read\n", device->machine->describe_context(), state->dsw_sel);
+ if (!BIT(state->dsw_sel, 0)) return input_port_read(device->machine(), "DSW0");
+ if (!BIT(state->dsw_sel, 1)) return input_port_read(device->machine(), "DSW1");
+ if (!BIT(state->dsw_sel, 2)) return input_port_read(device->machine(), "DSW2");
+ if (!BIT(state->dsw_sel, 3)) return input_port_read(device->machine(), "DSW3");
+ if (!BIT(state->dsw_sel, 4)) return input_port_read(device->machine(), "DSW4");
+ logerror("%s: unmapped dsw %02x read\n", device->machine().describe_context(), state->dsw_sel);
return 0xff;
}
static READ8_HANDLER( tenkai_palette_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->palette_ram[512 * state->palbank + offset];
}
static WRITE8_HANDLER( tenkai_palette_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int addr = 512 * state->palbank + offset;
state->palette_ram[addr] = data;
@@ -1398,14 +1398,14 @@ static WRITE8_HANDLER( tenkai_palette_w )
int r = br & 0x1f;
int g = bg & 0x1f;
int b = ((bg & 0xc0) >> 3) | ((br & 0xe0) >> 5);
- palette_set_color_rgb(space->machine, 256 * state->palbank + ((offset & 0xf) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), 256 * state->palbank + ((offset & 0xf) | ((offset & 0x1e0) >> 1)), pal5bit(r), pal5bit(g), pal5bit(b));
}
}
-static void tenkai_update_rombank( running_machine *machine )
+static void tenkai_update_rombank( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- state->romptr = machine->region("maincpu")->base() + 0x10000 + 0x8000 * state->rombank;
+ dynax_state *state = machine.driver_data<dynax_state>();
+ state->romptr = machine.region("maincpu")->base() + 0x10000 + 0x8000 * state->rombank;
// logerror("rombank = %02x\n", state->rombank);
}
@@ -1416,26 +1416,26 @@ static READ8_HANDLER( tenkai_p3_r )
static WRITE8_HANDLER( tenkai_p3_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rombank = ((data & 0x04) << 1) | (state->rombank & 0x07);
- tenkai_update_rombank(space->machine);
+ tenkai_update_rombank(space->machine());
}
static WRITE8_HANDLER( tenkai_p4_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rombank = (state->rombank & 0x08) | ((data & 0x0e) >> 1);
- tenkai_update_rombank(space->machine);
+ tenkai_update_rombank(space->machine());
}
static READ8_HANDLER( tenkai_p5_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
return state->tenkai_p5_val;
}
static WRITE8_HANDLER( tenkai_p6_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_p5_val &= 0x0f;
if (data & 0x0f)
@@ -1444,7 +1444,7 @@ static WRITE8_HANDLER( tenkai_p6_w )
static WRITE8_HANDLER( tenkai_p7_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_p5_val &= 0xf0;
if (data & 0x03)
@@ -1453,9 +1453,9 @@ static WRITE8_HANDLER( tenkai_p7_w )
static WRITE8_HANDLER( tenkai_p8_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->rombank = ((data & 0x08) << 1) | (state->rombank & 0x0f);
- tenkai_update_rombank(space->machine);
+ tenkai_update_rombank(space->machine());
}
static READ8_HANDLER( tenkai_p8_r )
@@ -1465,7 +1465,7 @@ static READ8_HANDLER( tenkai_p8_r )
static READ8_HANDLER( tenkai_8000_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->rombank < 0x10)
return state->romptr[offset];
@@ -1480,7 +1480,7 @@ static READ8_HANDLER( tenkai_8000_r )
static WRITE8_HANDLER( tenkai_8000_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if ((state->rombank == 0x10) && (offset < 0x10))
{
@@ -1496,24 +1496,24 @@ static WRITE8_HANDLER( tenkai_8000_w )
logerror("%04x: unmapped offset %04X=%02X written with rombank=%02X\n", cpu_get_pc(space->cpu), offset, data, state->rombank);
}
-static void tenkai_show_6c( running_machine *machine )
+static void tenkai_show_6c( running_machine &machine )
{
-// dynax_state *state = machine->driver_data<dynax_state>();
+// dynax_state *state = machine.driver_data<dynax_state>();
// popmessage("%02x %02x", state->tenkai_6c, state->tenkai_70);
}
static WRITE8_HANDLER( tenkai_6c_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_6c = data;
- tenkai_show_6c(space->machine);
+ tenkai_show_6c(space->machine());
}
static WRITE8_HANDLER( tenkai_70_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->tenkai_70 = data;
- tenkai_show_6c(space->machine);
+ tenkai_show_6c(space->machine());
}
static WRITE8_HANDLER( tenkai_blit_romregion_w )
@@ -1570,30 +1570,30 @@ ADDRESS_MAP_END
static READ8_HANDLER( gekisha_keyboard_0_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY0");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY1");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY2");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY3");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY4");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY0");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY1");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY2");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY3");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY4");
return res;
}
static READ8_HANDLER( gekisha_keyboard_1_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
int res = 0x3f;
- if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine, "KEY5");
- if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine, "KEY6");
- if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine, "KEY7");
- if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine, "KEY8");
- if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine, "KEY9");
+ if (!BIT(state->keyb, 0)) res &= input_port_read(space->machine(), "KEY5");
+ if (!BIT(state->keyb, 1)) res &= input_port_read(space->machine(), "KEY6");
+ if (!BIT(state->keyb, 2)) res &= input_port_read(space->machine(), "KEY7");
+ if (!BIT(state->keyb, 3)) res &= input_port_read(space->machine(), "KEY8");
+ if (!BIT(state->keyb, 4)) res &= input_port_read(space->machine(), "KEY9");
// bit 6
- res |= input_port_read(space->machine, "BET");
+ res |= input_port_read(space->machine(), "BET");
// bit 7 = blitter busy
@@ -1602,41 +1602,41 @@ static READ8_HANDLER( gekisha_keyboard_1_r )
static WRITE8_HANDLER( gekisha_hopper_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->gekisha_val[offset] = data;
// popmessage("%02x %02x", gekisha_val[0], gekisha_val[1]);
}
-static void gekisha_set_rombank( running_machine *machine, UINT8 data )
+static void gekisha_set_rombank( running_machine &machine, UINT8 data )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->rombank = data;
- state->romptr = machine->region("maincpu")->base() + 0x8000 + state->rombank * 0x8000;
+ state->romptr = machine.region("maincpu")->base() + 0x8000 + state->rombank * 0x8000;
}
static WRITE8_HANDLER( gekisha_p4_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
state->gekisha_rom_enable = !BIT(data, 3);
- gekisha_set_rombank(space->machine, BIT(data, 2));
+ gekisha_set_rombank(space->machine(), BIT(data, 2));
}
static READ8_HANDLER( gekisha_8000_r )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (state->gekisha_rom_enable)
return state->romptr[offset];
switch (offset + 0x8000)
{
- case 0x8061: return input_port_read(space->machine, "COINS");
+ case 0x8061: return input_port_read(space->machine(), "COINS");
case 0x8062: return gekisha_keyboard_1_r(space, 0);
case 0x8063: return gekisha_keyboard_0_r(space, 0);
- case 0x8064: return input_port_read(space->machine, "DSW1");
- case 0x8065: return input_port_read(space->machine, "DSW3");
- case 0x8066: return input_port_read(space->machine, "DSW4");
- case 0x8067: return input_port_read(space->machine, "DSW2");
+ case 0x8064: return input_port_read(space->machine(), "DSW1");
+ case 0x8065: return input_port_read(space->machine(), "DSW3");
+ case 0x8066: return input_port_read(space->machine(), "DSW4");
+ case 0x8067: return input_port_read(space->machine(), "DSW2");
}
logerror("%04x: unmapped offset %04X read with rombank=%02X\n",cpu_get_pc(space->cpu), offset, state->rombank);
@@ -1645,7 +1645,7 @@ static READ8_HANDLER( gekisha_8000_r )
static WRITE8_HANDLER( gekisha_8000_w )
{
- dynax_state *state = space->machine->driver_data<dynax_state>();
+ dynax_state *state = space->machine().driver_data<dynax_state>();
if (!state->gekisha_rom_enable)
{
@@ -4203,12 +4203,12 @@ INPUT_PORTS_END
static MACHINE_START( dynax )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
- state->maincpu = machine->device("maincpu");
- state->soundcpu = machine->device("soundcpu");
- state->rtc = machine->device("rtc");
- state->ymsnd = machine->device("ymsnd");
+ state->maincpu = machine.device("maincpu");
+ state->soundcpu = machine.device("soundcpu");
+ state->rtc = machine.device("rtc");
+ state->ymsnd = machine.device("ymsnd");
state->save_item(NAME(state->sound_irq));
state->save_item(NAME(state->vblank_irq));
@@ -4243,9 +4243,9 @@ static MACHINE_START( dynax )
static MACHINE_RESET( dynax )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
- if (machine->device("msm") != NULL)
+ if (machine.device("msm") != NULL)
MACHINE_RESET_CALL(adpcm);
state->sound_irq = 0;
@@ -4283,7 +4283,7 @@ static MACHINE_RESET( dynax )
static MACHINE_START( hanamai )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &ROM[0x8000], 0x8000);
MACHINE_START_CALL(dynax);
@@ -4291,8 +4291,8 @@ static MACHINE_START( hanamai )
static MACHINE_START( hnoridur )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int bank_n = (machine->region("maincpu")->bytes() - 0x10000) / 0x8000;
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int bank_n = (machine.region("maincpu")->bytes() - 0x10000) / 0x8000;
memory_configure_bank(machine, "bank1", 0, bank_n, &ROM[0x10000], 0x8000);
@@ -4301,7 +4301,7 @@ static MACHINE_START( hnoridur )
static MACHINE_START( htengoku )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x8000);
@@ -4596,7 +4596,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( yarunara_clock_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
state->yarunara_clk_toggle ^= 1;
if (state->yarunara_clk_toggle == 1)
@@ -4604,7 +4604,7 @@ static INTERRUPT_GEN( yarunara_clock_interrupt )
else
state->sound_irq = 1;
- sprtmtch_update_irq(device->machine);
+ sprtmtch_update_irq(device->machine());
}
static MACHINE_CONFIG_DERIVED( yarunara, hnoridur )
@@ -4674,15 +4674,15 @@ static const msm5205_interface jantouki_msm5205_interface =
static MACHINE_START( jantouki )
{
- dynax_state *state = machine->driver_data<dynax_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SOUND = machine->region("soundcpu")->base();
+ dynax_state *state = machine.driver_data<dynax_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SOUND = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x10, &MAIN[0x8000], 0x8000);
memory_configure_bank(machine, "bank2", 0, 12, &SOUND[0x8000], 0x8000);
- state->top_scr = machine->device("top");
- state->bot_scr = machine->device("bottom");
+ state->top_scr = machine.device("top");
+ state->bot_scr = machine.device("bottom");
MACHINE_START_CALL(dynax);
}
@@ -4757,16 +4757,16 @@ MACHINE_CONFIG_END
/* It runs in IM 2, thus needs a vector on the data bus:
0xfa and 0xfc are very similar, they should be triggered by the blitter
0xf8 is vblank */
-void mjelctrn_update_irq( running_machine *machine )
+void mjelctrn_update_irq( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->blitter_irq = 1;
device_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0xfa);
}
static INTERRUPT_GEN( mjelctrn_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
@@ -4792,16 +4792,16 @@ MACHINE_CONFIG_END
0x42 and 0x44 are very similar, they should be triggered by the blitter
0x40 is vblank
0x46 is a periodic irq? */
-void neruton_update_irq( running_machine *machine )
+void neruton_update_irq( running_machine &machine )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
state->blitter_irq = 1;
device_set_input_line_and_vector(state->maincpu, 0, HOLD_LINE, 0x42);
}
static INTERRUPT_GEN( neruton_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
@@ -4830,7 +4830,7 @@ MACHINE_CONFIG_END
0x40 is vblank */
static INTERRUPT_GEN( majxtal7_vblank_interrupt )
{
- dynax_state *state = device->machine->driver_data<dynax_state>();
+ dynax_state *state = device->machine().driver_data<dynax_state>();
// This is a kludge to avoid losing blitter interrupts
// there should be a vblank ack mechanism
@@ -4934,7 +4934,7 @@ static MACHINE_START( tenkai )
{
MACHINE_START_CALL(dynax);
- machine->state().register_postload(tenkai_bank_postload, NULL);
+ machine.state().register_postload(tenkai_bank_postload, NULL);
}
static MACHINE_CONFIG_START( tenkai, dynax_state )
@@ -4988,7 +4988,7 @@ MACHINE_CONFIG_END
static STATE_POSTLOAD( gekisha_bank_postload )
{
- dynax_state *state = machine->driver_data<dynax_state>();
+ dynax_state *state = machine.driver_data<dynax_state>();
gekisha_set_rombank(machine, state->rombank);
}
@@ -4997,7 +4997,7 @@ static MACHINE_START( gekisha )
{
MACHINE_START_CALL(dynax);
- machine->state().register_postload(gekisha_bank_postload, NULL);
+ machine.state().register_postload(gekisha_bank_postload, NULL);
}
static MACHINE_RESET( gekisha )
@@ -5386,7 +5386,7 @@ ROM_END
static DRIVER_INIT( blktouch )
{
// fearsome encryption ;-)
- UINT8 *src = (UINT8 *)machine->region("maincpu")->base();
+ UINT8 *src = (UINT8 *)machine.region("maincpu")->base();
int i;
for (i = 0; i < 0x90000; i++)
@@ -5395,7 +5395,7 @@ static DRIVER_INIT( blktouch )
}
- src = (UINT8 *)machine->region("gfx1")->base();
+ src = (UINT8 *)machine.region("gfx1")->base();
for (i = 0; i < 0xc0000; i++)
{
@@ -5408,8 +5408,8 @@ static DRIVER_INIT( maya )
{
/* Address lines scrambling on 1 z80 rom */
int i;
- UINT8 *gfx = (UINT8 *)machine->region("gfx1")->base();
- UINT8 *rom = machine->region("maincpu")->base() + 0x28000, *end = rom + 0x10000;
+ UINT8 *gfx = (UINT8 *)machine.region("gfx1")->base();
+ UINT8 *rom = machine.region("maincpu")->base() + 0x28000, *end = rom + 0x10000;
for ( ; rom < end; rom += 8)
{
UINT8 temp[8];
@@ -6126,8 +6126,8 @@ ROM_END
static DRIVER_INIT( mjelct3 )
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *rom1 = auto_alloc_array(machine, UINT8, size);
memcpy(rom1, rom, size);
@@ -6139,8 +6139,8 @@ static DRIVER_INIT( mjelct3 )
static DRIVER_INIT( mjelct3a )
{
int i, j;
- UINT8 *rom = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *rom1 = auto_alloc_array(machine, UINT8, size);
memcpy(rom1, rom, size);
@@ -6517,7 +6517,7 @@ ROM_END
static DRIVER_INIT( mjreach )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x10060, 0x10060, FUNC(yarunara_flipscreen_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x10060, 0x10060, FUNC(yarunara_flipscreen_w));
}
/***************************************************************************
diff --git a/src/mame/drivers/egghunt.c b/src/mame/drivers/egghunt.c
index 4fa71048c98..a7c84cc0886 100644
--- a/src/mame/drivers/egghunt.c
+++ b/src/mame/drivers/egghunt.c
@@ -69,9 +69,9 @@ public:
};
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
int flipscreen = 0;
int offs, sx, sy;
@@ -100,7 +100,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
sx = 496 - sx;
sy = 240 - sy;
}
- drawgfx_transpen(bitmap,cliprect,machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[1],
code,
color,
flipscreen,flipscreen,
@@ -110,7 +110,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap,const recta
static TILE_GET_INFO( get_bg_tile_info )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
int code = ((state->bgram[tile_index * 2 + 1] << 8) | state->bgram[tile_index * 2]) & 0x3fff;
int colour = state->atram[tile_index] & 0x3f;
@@ -129,7 +129,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static READ8_HANDLER( egghunt_bgram_r )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
if (state->vidram_bank)
{
return state->spram[offset];
@@ -142,7 +142,7 @@ static READ8_HANDLER( egghunt_bgram_r )
static WRITE8_HANDLER( egghunt_bgram_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
if (state->vidram_bank)
{
state->spram[offset] = data;
@@ -156,7 +156,7 @@ static WRITE8_HANDLER( egghunt_bgram_w )
static WRITE8_HANDLER( egghunt_atram_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
state->atram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -164,7 +164,7 @@ static WRITE8_HANDLER( egghunt_atram_w )
static VIDEO_START(egghunt)
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
@@ -174,15 +174,15 @@ static VIDEO_START(egghunt)
static SCREEN_UPDATE(egghunt)
{
- egghunt_state *state = screen->machine->driver_data<egghunt_state>();
+ egghunt_state *state = screen->machine().driver_data<egghunt_state>();
tilemap_draw(bitmap,cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
static WRITE8_HANDLER( egghunt_gfx_banking_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
// data & 0x03 is used for tile banking
// data & 0x30 is used for sprites banking
state->gfx_banking = data & 0x33;
@@ -192,26 +192,26 @@ static WRITE8_HANDLER( egghunt_gfx_banking_w )
static WRITE8_HANDLER( egghunt_vidram_bank_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
state->vidram_bank = data & 1;
}
static WRITE8_HANDLER( egghunt_soundlatch_w )
{
- egghunt_state *state = space->machine->driver_data<egghunt_state>();
+ egghunt_state *state = space->machine().driver_data<egghunt_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static READ8_DEVICE_HANDLER( egghunt_okibanking_r )
{
- egghunt_state *state = device->machine->driver_data<egghunt_state>();
+ egghunt_state *state = device->machine().driver_data<egghunt_state>();
return state->okibanking;
}
static WRITE8_DEVICE_HANDLER( egghunt_okibanking_w )
{
- egghunt_state *state = device->machine->driver_data<egghunt_state>();
+ egghunt_state *state = device->machine().driver_data<egghunt_state>();
state->okibanking = data;
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
@@ -388,9 +388,9 @@ GFXDECODE_END
static MACHINE_START( egghunt )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->gfx_banking));
state->save_item(NAME(state->okibanking));
@@ -399,7 +399,7 @@ static MACHINE_START( egghunt )
static MACHINE_RESET( egghunt )
{
- egghunt_state *state = machine->driver_data<egghunt_state>();
+ egghunt_state *state = machine.driver_data<egghunt_state>();
state->gfx_banking = 0;
state->okibanking = 0;
state->vidram_bank = 0;
diff --git a/src/mame/drivers/embargo.c b/src/mame/drivers/embargo.c
index 150a3028b08..dbf643c1443 100644
--- a/src/mame/drivers/embargo.c
+++ b/src/mame/drivers/embargo.c
@@ -33,7 +33,7 @@ public:
static SCREEN_UPDATE( embargo )
{
- embargo_state *state = screen->machine->driver_data<embargo_state>();
+ embargo_state *state = screen->machine().driver_data<embargo_state>();
offs_t offs;
for (offs = 0; offs < state->videoram_size; offs++)
@@ -67,14 +67,14 @@ static SCREEN_UPDATE( embargo )
static READ8_HANDLER( input_port_bit_r )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
- return (input_port_read(space->machine, "IN1") << (7 - state->input_select)) & 0x80;
+ embargo_state *state = space->machine().driver_data<embargo_state>();
+ return (input_port_read(space->machine(), "IN1") << (7 - state->input_select)) & 0x80;
}
static READ8_HANDLER( dial_r )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
UINT8 lo = 0;
UINT8 hi = 0;
@@ -94,14 +94,14 @@ static READ8_HANDLER( dial_r )
if (state->dial_enable_1 && !state->dial_enable_2)
{
- lo = input_port_read(space->machine, "DIAL0");
- hi = input_port_read(space->machine, "DIAL1");
+ lo = input_port_read(space->machine(), "DIAL0");
+ hi = input_port_read(space->machine(), "DIAL1");
}
if (state->dial_enable_2 && !state->dial_enable_1)
{
- lo = input_port_read(space->machine, "DIAL2");
- hi = input_port_read(space->machine, "DIAL3");
+ lo = input_port_read(space->machine(), "DIAL2");
+ hi = input_port_read(space->machine(), "DIAL3");
}
lo = 12 * lo / 256;
@@ -126,21 +126,21 @@ static READ8_HANDLER( dial_r )
static WRITE8_HANDLER( port_1_w )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
state->dial_enable_1 = data & 0x01; /* other bits unknown */
}
static WRITE8_HANDLER( port_2_w )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
state->dial_enable_2 = data & 0x01; /* other bits unknown */
}
static WRITE8_HANDLER( input_select_w )
{
- embargo_state *state = space->machine->driver_data<embargo_state>();
+ embargo_state *state = space->machine().driver_data<embargo_state>();
state->input_select = data & 0x07;
}
@@ -228,7 +228,7 @@ INPUT_PORTS_END
static MACHINE_START( embargo )
{
- embargo_state *state = machine->driver_data<embargo_state>();
+ embargo_state *state = machine.driver_data<embargo_state>();
/* register for state saving */
state->save_item(NAME(state->dial_enable_1));
@@ -239,7 +239,7 @@ static MACHINE_START( embargo )
static MACHINE_RESET( embargo )
{
- embargo_state *state = machine->driver_data<embargo_state>();
+ embargo_state *state = machine.driver_data<embargo_state>();
state->dial_enable_1 = 0;
state->dial_enable_2 = 0;
diff --git a/src/mame/drivers/enigma2.c b/src/mame/drivers/enigma2.c
index 4fdccf151f6..52d4e40f777 100644
--- a/src/mame/drivers/enigma2.c
+++ b/src/mame/drivers/enigma2.c
@@ -103,19 +103,19 @@ INLINE int vysnc_chain_counter_to_vpos( UINT16 counter )
static TIMER_CALLBACK( interrupt_clear_callback )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
}
static TIMER_CALLBACK( interrupt_assert_callback )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
UINT16 next_counter;
int next_vpos;
/* compute vector and set the interrupt line */
- int vpos = machine->primary_screen->vpos();
+ int vpos = machine.primary_screen->vpos();
UINT16 counter = vpos_to_vysnc_chain_counter(vpos);
UINT8 vector = 0xc7 | ((counter & 0x80) >> 3) | ((~counter & 0x80) >> 4);
device_set_input_line_and_vector(state->maincpu, 0, ASSERT_LINE, vector);
@@ -127,35 +127,35 @@ static TIMER_CALLBACK( interrupt_assert_callback )
next_counter = INT_TRIGGER_COUNT_1;
next_vpos = vysnc_chain_counter_to_vpos(next_counter);
- state->interrupt_assert_timer->adjust(machine->primary_screen->time_until_pos(next_vpos));
- state->interrupt_clear_timer->adjust(machine->primary_screen->time_until_pos(vpos + 1));
+ state->interrupt_assert_timer->adjust(machine.primary_screen->time_until_pos(next_vpos));
+ state->interrupt_clear_timer->adjust(machine.primary_screen->time_until_pos(vpos + 1));
}
-static void create_interrupt_timers( running_machine *machine )
+static void create_interrupt_timers( running_machine &machine )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
- state->interrupt_clear_timer = machine->scheduler().timer_alloc(FUNC(interrupt_clear_callback));
- state->interrupt_assert_timer = machine->scheduler().timer_alloc(FUNC(interrupt_assert_callback));
+ enigma2_state *state = machine.driver_data<enigma2_state>();
+ state->interrupt_clear_timer = machine.scheduler().timer_alloc(FUNC(interrupt_clear_callback));
+ state->interrupt_assert_timer = machine.scheduler().timer_alloc(FUNC(interrupt_assert_callback));
}
-static void start_interrupt_timers( running_machine *machine )
+static void start_interrupt_timers( running_machine &machine )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
int vpos = vysnc_chain_counter_to_vpos(INT_TRIGGER_COUNT_1);
- state->interrupt_assert_timer->adjust(machine->primary_screen->time_until_pos(vpos));
+ state->interrupt_assert_timer->adjust(machine.primary_screen->time_until_pos(vpos));
}
static MACHINE_START( enigma2 )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
create_interrupt_timers(machine);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->blink_count));
state->save_item(NAME(state->sound_latch));
@@ -167,7 +167,7 @@ static MACHINE_START( enigma2 )
static MACHINE_RESET( enigma2 )
{
- enigma2_state *state = machine->driver_data<enigma2_state>();
+ enigma2_state *state = machine.driver_data<enigma2_state>();
cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
state->last_sound_data = 0;
@@ -199,11 +199,11 @@ static void get_pens(pen_t *pens)
static SCREEN_UPDATE( enigma2 )
{
- enigma2_state *state = screen->machine->driver_data<enigma2_state>();
+ enigma2_state *state = screen->machine().driver_data<enigma2_state>();
pen_t pens[NUM_PENS];
const rectangle &visarea = screen->visible_area();
- UINT8 *prom = screen->machine->region("proms")->base();
+ UINT8 *prom = screen->machine().region("proms")->base();
UINT8 *color_map_base = state->flip_screen ? &prom[0x0400] : &prom[0x0000];
UINT8 *star_map_base = (state->blink_count & 0x08) ? &prom[0x0c00] : &prom[0x0800];
@@ -227,7 +227,7 @@ static SCREEN_UPDATE( enigma2 )
offs_t color_map_address = (y >> 3 << 5) | (x >> 3);
/* the schematics shows it like this, but it doesn't work as this would
produce no stars, due to the contents of the PROM -- maybe there is
- a star disabled bit somewhere that's connected here instead of flip_screen_get(screen->machine) */
+ a star disabled bit somewhere that's connected here instead of flip_screen_get(screen->machine()) */
/* star_map_address = (y >> 4 << 6) | (engima2_flip_screen_get() << 5) | (x >> 3); */
offs_t star_map_address = (y >> 4 << 6) | 0x20 | (x >> 3);
@@ -287,7 +287,7 @@ static SCREEN_UPDATE( enigma2 )
static SCREEN_UPDATE( enigma2a )
{
- enigma2_state *state = screen->machine->driver_data<enigma2_state>();
+ enigma2_state *state = screen->machine().driver_data<enigma2_state>();
UINT8 x = 0;
const rectangle &visarea = screen->visible_area();
UINT16 bitmap_y = visarea.min_y;
@@ -349,7 +349,7 @@ static SCREEN_UPDATE( enigma2a )
static READ8_HANDLER( dip_switch_r )
{
- enigma2_state *state = space->machine->driver_data<enigma2_state>();
+ enigma2_state *state = space->machine().driver_data<enigma2_state>();
UINT8 ret = 0x00;
if (LOG_PROT) logerror("DIP SW Read: %x at %x (prot data %x)\n", offset, cpu_get_pc(space->cpu), state->protection_data);
@@ -361,7 +361,7 @@ static READ8_HANDLER( dip_switch_r )
if (state->protection_data != 0xff)
ret = state->protection_data ^ 0x88;
else
- ret = input_port_read(space->machine, "DSW");
+ ret = input_port_read(space->machine(), "DSW");
break;
case 0x02:
@@ -382,7 +382,7 @@ static READ8_HANDLER( dip_switch_r )
static WRITE8_HANDLER( sound_data_w )
{
- enigma2_state *state = space->machine->driver_data<enigma2_state>();
+ enigma2_state *state = space->machine().driver_data<enigma2_state>();
/* clock sound latch shift register on rising edge of D2 */
if (!(data & 0x04) && (state->last_sound_data & 0x04))
state->sound_latch = (state->sound_latch << 1) | (~data & 0x01);
@@ -395,39 +395,39 @@ static WRITE8_HANDLER( sound_data_w )
static READ8_DEVICE_HANDLER( sound_latch_r )
{
- enigma2_state *state = device->machine->driver_data<enigma2_state>();
+ enigma2_state *state = device->machine().driver_data<enigma2_state>();
return BITSWAP8(state->sound_latch,0,1,2,3,4,5,6,7);
}
static WRITE8_DEVICE_HANDLER( protection_data_w )
{
- enigma2_state *state = device->machine->driver_data<enigma2_state>();
- if (LOG_PROT) logerror("%s: Protection Data Write: %x\n", device->machine->describe_context(), data);
+ enigma2_state *state = device->machine().driver_data<enigma2_state>();
+ if (LOG_PROT) logerror("%s: Protection Data Write: %x\n", device->machine().describe_context(), data);
state->protection_data = data;
}
static WRITE8_HANDLER( enigma2_flip_screen_w )
{
- enigma2_state *state = space->machine->driver_data<enigma2_state>();
- state->flip_screen = ((data >> 5) & 0x01) && ((input_port_read(space->machine, "DSW") & 0x20) == 0x20);
+ enigma2_state *state = space->machine().driver_data<enigma2_state>();
+ state->flip_screen = ((data >> 5) & 0x01) && ((input_port_read(space->machine(), "DSW") & 0x20) == 0x20);
}
static CUSTOM_INPUT( p1_controls_r )
{
- return input_port_read(field->port->machine, "P1CONTROLS");
+ return input_port_read(field->port->machine(), "P1CONTROLS");
}
static CUSTOM_INPUT( p2_controls_r )
{
- enigma2_state *state = field->port->machine->driver_data<enigma2_state>();
+ enigma2_state *state = field->port->machine().driver_data<enigma2_state>();
if (state->flip_screen)
- return input_port_read(field->port->machine, "P2CONTROLS");
+ return input_port_read(field->port->machine(), "P2CONTROLS");
else
- return input_port_read(field->port->machine, "P1CONTROLS");
+ return input_port_read(field->port->machine(), "P1CONTROLS");
}
@@ -708,7 +708,7 @@ ROM_END
static DRIVER_INIT(enigma2)
{
offs_t i;
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
for(i = 0; i < 0x2000; i++)
{
diff --git a/src/mame/drivers/eolith.c b/src/mame/drivers/eolith.c
index 0fc2c970b48..37797088550 100644
--- a/src/mame/drivers/eolith.c
+++ b/src/mame/drivers/eolith.c
@@ -86,17 +86,17 @@ static READ32_HANDLER( eolith_custom_r )
*/
eolith_speedup_read(space);
- return (input_port_read(space->machine, "IN0") & ~0x300) | (space->machine->rand() & 0x300);
+ return (input_port_read(space->machine(), "IN0") & ~0x300) | (space->machine().rand() & 0x300);
}
static WRITE32_HANDLER( systemcontrol_w )
{
- eolith_state *state = space->machine->driver_data<eolith_state>();
+ eolith_state *state = space->machine().driver_data<eolith_state>();
state->buffer = (data & 0x80) >> 7;
- coin_counter_w(space->machine, 0, data & state->coin_counter_bit);
- set_led_status(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & state->coin_counter_bit);
+ set_led_status(space->machine(), 0, data & 1);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
// bit 0x100 and 0x040 ?
}
@@ -104,8 +104,8 @@ static WRITE32_HANDLER( systemcontrol_w )
static READ32_HANDLER( hidctch3_pen1_r )
{
//320 x 240
- int xpos = input_port_read(space->machine, "PEN_X_P1");
- int ypos = input_port_read(space->machine, "PEN_Y_P1");
+ int xpos = input_port_read(space->machine(), "PEN_X_P1");
+ int ypos = input_port_read(space->machine(), "PEN_Y_P1");
return xpos + (ypos*168*2);
}
@@ -113,8 +113,8 @@ static READ32_HANDLER( hidctch3_pen1_r )
static READ32_HANDLER( hidctch3_pen2_r )
{
//320 x 240
- int xpos = input_port_read(space->machine, "PEN_X_P2");
- int ypos = input_port_read(space->machine, "PEN_Y_P2");
+ int xpos = input_port_read(space->machine(), "PEN_X_P2");
+ int ypos = input_port_read(space->machine(), "PEN_Y_P2");
return xpos + (ypos*168*2);
}
@@ -1110,18 +1110,18 @@ static DRIVER_INIT( eolith )
static DRIVER_INIT( landbrk )
{
- eolith_state *state = machine->driver_data<eolith_state>();
+ eolith_state *state = machine.driver_data<eolith_state>();
state->coin_counter_bit = 0x1000;
init_eolith_speedup(machine);
}
static DRIVER_INIT( landbrka )
{
- eolith_state *state = machine->driver_data<eolith_state>();
+ eolith_state *state = machine.driver_data<eolith_state>();
//it fails compares with memories:
//$4002d338 -> $4002d348 .... $4002d33f -> $4002d34f
//related with bits 0x100 - 0x200 read at startup from input(0) ?
- UINT32 *rombase = (UINT32*)machine->region("maincpu")->base();
+ UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
rombase[0x14f00/4] = (rombase[0x14f00/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
state->coin_counter_bit = 0x2000;
@@ -1131,22 +1131,22 @@ static DRIVER_INIT( landbrka )
static DRIVER_INIT( hidctch2 )
{
//it fails compares in memory like in landbrka
- UINT32 *rombase = (UINT32*)machine->region("maincpu")->base();
+ UINT32 *rombase = (UINT32*)machine.region("maincpu")->base();
rombase[0xbcc8/4] = (rombase[0xbcc8/4] & 0xffff) | 0x03000000; /* Change BR to NOP */
init_eolith_speedup(machine);
}
static DRIVER_INIT( hidctch3 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xfc200000, 0xfc200003); // this generates pens vibration
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xfc200000, 0xfc200003); // this generates pens vibration
// It is not clear why the first reads are needed too
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce00000, 0xfce00003, FUNC(hidctch3_pen1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce80000, 0xfce80003, FUNC(hidctch3_pen1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce00000, 0xfce00003, FUNC(hidctch3_pen1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfce80000, 0xfce80003, FUNC(hidctch3_pen1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf00000, 0xfcf00003, FUNC(hidctch3_pen2_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf80000, 0xfcf80003, FUNC(hidctch3_pen2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf00000, 0xfcf00003, FUNC(hidctch3_pen2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfcf80000, 0xfcf80003, FUNC(hidctch3_pen2_r));
init_eolith_speedup(machine);
}
diff --git a/src/mame/drivers/eolith16.c b/src/mame/drivers/eolith16.c
index 53d93e2b3c1..d41faca74c0 100644
--- a/src/mame/drivers/eolith16.c
+++ b/src/mame/drivers/eolith16.c
@@ -43,11 +43,11 @@ static const eeprom_interface eeprom_interface_93C66 =
static WRITE16_HANDLER( eeprom_w )
{
- eolith16_state *state = space->machine->driver_data<eolith16_state>();
+ eolith16_state *state = space->machine().driver_data<eolith16_state>();
state->vbuffer = (data & 0x80) >> 7;
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
//data & 0x100 and data & 0x004 always set
}
@@ -55,20 +55,20 @@ static WRITE16_HANDLER( eeprom_w )
static READ16_HANDLER( eolith16_custom_r )
{
eolith_speedup_read(space);
- return input_port_read(space->machine, "SPECIAL");
+ return input_port_read(space->machine(), "SPECIAL");
}
static WRITE16_HANDLER( vram_w )
{
- eolith16_state *state = space->machine->driver_data<eolith16_state>();
+ eolith16_state *state = space->machine().driver_data<eolith16_state>();
COMBINE_DATA(&state->vram[offset + (0x10000/2) * state->vbuffer]);
}
static READ16_HANDLER( vram_r )
{
- eolith16_state *state = space->machine->driver_data<eolith16_state>();
+ eolith16_state *state = space->machine().driver_data<eolith16_state>();
return state->vram[offset + (0x10000/2) * state->vbuffer];
}
@@ -118,13 +118,13 @@ INPUT_PORTS_END
static VIDEO_START( eolith16 )
{
- eolith16_state *state = machine->driver_data<eolith16_state>();
+ eolith16_state *state = machine.driver_data<eolith16_state>();
state->vram = auto_alloc_array(machine, UINT16, 0x10000);
}
static SCREEN_UPDATE( eolith16 )
{
- eolith16_state *state = screen->machine->driver_data<eolith16_state>();
+ eolith16_state *state = screen->machine().driver_data<eolith16_state>();
int x,y,count;
int color;
diff --git a/src/mame/drivers/eolithsp.c b/src/mame/drivers/eolithsp.c
index 0c2ddc3a5d0..73dcd3d46e1 100644
--- a/src/mame/drivers/eolithsp.c
+++ b/src/mame/drivers/eolithsp.c
@@ -21,7 +21,7 @@ void eolith_speedup_read(address_space *space)
{
/* for debug */
//if ((cpu_get_pc(space->cpu)!=eolith_speedup_address) && (eolith_vblank!=1) )
- // printf("%s:eolith speedup_read data %02x\n",space->machine->describe_context(), eolith_vblank);
+ // printf("%s:eolith speedup_read data %02x\n",space->machine().describe_context(), eolith_vblank);
if (cpu_get_pc(space->cpu)==eolith_speedup_address && eolith_vblank==0 && eolith_scanline < eolith_speedup_resume_scanline)
{
@@ -60,7 +60,7 @@ static const struct
};
-void init_eolith_speedup(running_machine *machine)
+void init_eolith_speedup(running_machine &machine)
{
int n_game = 0;
eolith_speedup_address = 0;
@@ -68,7 +68,7 @@ void init_eolith_speedup(running_machine *machine)
while( eolith_speedup_table[ n_game ].s_name != NULL )
{
- if( strcmp( machine->system().name, eolith_speedup_table[ n_game ].s_name ) == 0 )
+ if( strcmp( machine.system().name, eolith_speedup_table[ n_game ].s_name ) == 0 )
{
eolith_speedup_address = eolith_speedup_table[ n_game ].speedup_address;
eolith_speedup_resume_scanline = eolith_speedup_table[ n_game ].speedup_resume_scanline;
@@ -90,7 +90,7 @@ INTERRUPT_GEN( eolith_speedup )
if (eolith_scanline==eolith_speedup_resume_scanline)
{
- device->machine->scheduler().trigger(1000);
+ device->machine().scheduler().trigger(1000);
}
if (eolith_scanline==240)
diff --git a/src/mame/drivers/epos.c b/src/mame/drivers/epos.c
index e9f4780391b..19bc3558d4e 100644
--- a/src/mame/drivers/epos.c
+++ b/src/mame/drivers/epos.c
@@ -36,7 +36,7 @@
static WRITE8_HANDLER( dealer_decrypt_rom )
{
- epos_state *state = space->machine->driver_data<epos_state>();
+ epos_state *state = space->machine().driver_data<epos_state>();
if (offset & 0x04)
state->counter = (state->counter + 1) & 0x03;
@@ -45,7 +45,7 @@ static WRITE8_HANDLER( dealer_decrypt_rom )
// logerror("PC %08x: ctr=%04x\n",cpu_get_pc(space->cpu), state->counter);
- memory_set_bank(space->machine, "bank1", state->counter);
+ memory_set_bank(space->machine(), "bank1", state->counter);
// is the 2nd bank changed by the counter or it always uses the 1st key?
}
@@ -102,7 +102,7 @@ ADDRESS_MAP_END
*/
static WRITE8_DEVICE_HANDLER( write_prtc )
{
- memory_set_bank(device->machine, "bank2", data & 0x01);
+ memory_set_bank(device->machine(), "bank2", data & 0x01);
}
static const ppi8255_interface ppi8255_intf =
@@ -365,7 +365,7 @@ INPUT_PORTS_END
static MACHINE_START( epos )
{
- epos_state *state = machine->driver_data<epos_state>();
+ epos_state *state = machine.driver_data<epos_state>();
state->save_item(NAME(state->palette));
state->save_item(NAME(state->counter));
@@ -373,7 +373,7 @@ static MACHINE_START( epos )
static MACHINE_RESET( epos )
{
- epos_state *state = machine->driver_data<epos_state>();
+ epos_state *state = machine.driver_data<epos_state>();
state->palette = 0;
state->counter = 0;
@@ -382,7 +382,7 @@ static MACHINE_RESET( epos )
static MACHINE_START( dealer )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x0000], 0x10000);
memory_configure_bank(machine, "bank2", 0, 2, &ROM[0x6000], 0x1000);
@@ -610,7 +610,7 @@ ROM_END
static DRIVER_INIT( dealer )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
/* Key 0 */
diff --git a/src/mame/drivers/eprom.c b/src/mame/drivers/eprom.c
index 0724d9c628e..3641f8400ee 100644
--- a/src/mame/drivers/eprom.c
+++ b/src/mame/drivers/eprom.c
@@ -36,13 +36,13 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
- if (machine->device("extra") != NULL)
+ if (machine.device("extra") != NULL)
cputag_set_input_line(machine, "extra", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -57,11 +57,11 @@ static MACHINE_START( eprom )
static MACHINE_RESET( eprom )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, eprom_scanline_update, 8);
+ atarigen_scanline_timer_reset(*machine.primary_screen, eprom_scanline_update, 8);
atarijsa_reset();
}
@@ -75,8 +75,8 @@ static MACHINE_RESET( eprom )
static READ16_HANDLER( special_port1_r )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
- int result = input_port_read(space->machine, "260010");
+ eprom_state *state = space->machine().driver_data<eprom_state>();
+ int result = input_port_read(space->machine(), "260010");
if (state->sound_to_cpu_ready) result ^= 0x0004;
if (state->cpu_to_sound_ready) result ^= 0x0008;
@@ -88,9 +88,9 @@ static READ16_HANDLER( special_port1_r )
static READ16_HANDLER( adc_r )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
static const char *const adcnames[] = { "ADC0", "ADC1", "ADC2", "ADC3" };
- int result = input_port_read(space->machine, adcnames[state->last_offset & 3]);
+ int result = input_port_read(space->machine(), adcnames[state->last_offset & 3]);
state->last_offset = offset;
return result;
@@ -106,15 +106,15 @@ static READ16_HANDLER( adc_r )
static WRITE16_HANDLER( eprom_latch_w )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
- if (ACCESSING_BITS_0_7 && (space->machine->device("extra") != NULL))
+ if (ACCESSING_BITS_0_7 && (space->machine().device("extra") != NULL))
{
/* bit 0: reset extra CPU */
if (data & 1)
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, CLEAR_LINE);
else
- cputag_set_input_line(space->machine, "extra", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "extra", INPUT_LINE_RESET, ASSERT_LINE);
/* bits 1-4: screen intensity */
state->screen_intensity = (data & 0x1e) >> 1;
@@ -134,14 +134,14 @@ static WRITE16_HANDLER( eprom_latch_w )
static READ16_HANDLER( sync_r )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
return state->sync_data[offset];
}
static WRITE16_HANDLER( sync_w )
{
- eprom_state *state = space->machine->driver_data<eprom_state>();
+ eprom_state *state = space->machine().driver_data<eprom_state>();
int oldword = state->sync_data[offset];
int newword = oldword;
COMBINE_DATA(&newword);
@@ -725,13 +725,13 @@ ROM_END
static DRIVER_INIT( eprom )
{
- eprom_state *state = machine->driver_data<eprom_state>();
+ eprom_state *state = machine.driver_data<eprom_state>();
atarijsa_init(machine, "260010", 0x0002);
/* install CPU synchronization handlers */
- state->sync_data = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
- state->sync_data = machine->device("extra")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
+ state->sync_data = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
+ state->sync_data = machine.device("extra")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x16cc00, 0x16cc01, FUNC(sync_r), FUNC(sync_w));
}
diff --git a/src/mame/drivers/equites.c b/src/mame/drivers/equites.c
index 4c35836572d..67a7b82e469 100644
--- a/src/mame/drivers/equites.c
+++ b/src/mame/drivers/equites.c
@@ -398,13 +398,13 @@ D
static TIMER_CALLBACK( equites_nmi_callback )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
device_set_input_line(state->audio_cpu, INPUT_LINE_NMI, ASSERT_LINE);
}
static TIMER_CALLBACK( equites_frq_adjuster_callback )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
UINT8 frq = input_port_read(machine, FRQ_ADJUSTER_TAG);
msm5232_set_clock(state->msm, MSM5232_MIN_CLOCK + frq * (MSM5232_MAX_CLOCK - MSM5232_MIN_CLOCK) / 100);
@@ -418,16 +418,16 @@ static TIMER_CALLBACK( equites_frq_adjuster_callback )
static SOUND_START(equites)
{
- equites_state *state = machine->driver_data<equites_state>();
- state->nmi_timer = machine->scheduler().timer_alloc(FUNC(equites_nmi_callback));
+ equites_state *state = machine.driver_data<equites_state>();
+ state->nmi_timer = machine.scheduler().timer_alloc(FUNC(equites_nmi_callback));
- state->adjuster_timer = machine->scheduler().timer_alloc(FUNC(equites_frq_adjuster_callback));
+ state->adjuster_timer = machine.scheduler().timer_alloc(FUNC(equites_frq_adjuster_callback));
state->adjuster_timer->adjust(attotime::from_hz(60), 0, attotime::from_hz(60));
}
static WRITE8_HANDLER(equites_c0f8_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
switch (offset)
{
@@ -476,7 +476,7 @@ static WRITE8_HANDLER(equites_c0f8_w)
static WRITE8_DEVICE_HANDLER( equites_8910porta_w )
{
- equites_state *state = device->machine->driver_data<equites_state>();
+ equites_state *state = device->machine().driver_data<equites_state>();
// bongo 1
sample_set_volume(device, 0, ((data & 0x30) >> 4) * 0.33);
@@ -497,7 +497,7 @@ popmessage("HH %d(%d) CYM %d(%d)", state->hihat, BIT(state->ay_port_b, 6), state
static WRITE8_DEVICE_HANDLER( equites_8910portb_w )
{
- equites_state *state = device->machine->driver_data<equites_state>();
+ equites_state *state = device->machine().driver_data<equites_state>();
#if POPDRUMKIT
if (data & ~state->ay_port_b & 0x08) state->cymbal++;
if (data & ~state->ay_port_b & 0x04) state->hihat++;
@@ -533,14 +533,14 @@ popmessage("HH %d(%d) CYM %d(%d)",state->hihat,BIT(state->ay_port_b,6),state->cy
static WRITE8_HANDLER(equites_cymbal_ctrl_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->eq_cymbal_ctrl++;
}
-static void equites_update_dac( running_machine *machine )
+static void equites_update_dac( running_machine &machine )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
// there is only one latch, which is used to drive two DAC channels.
// When the channel is enabled in the 4066, it goes to a series of
@@ -557,16 +557,16 @@ static void equites_update_dac( running_machine *machine )
static WRITE8_HANDLER( equites_dac_latch_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->dac_latch = data << 2;
- equites_update_dac(space->machine);
+ equites_update_dac(space->machine());
}
static WRITE8_HANDLER( equites_8155_portb_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->eq8155_port_b = data;
- equites_update_dac(space->machine);
+ equites_update_dac(space->machine());
}
static void equites_msm5232_gate( device_t *device, int state )
@@ -590,7 +590,7 @@ static INTERRUPT_GEN( equites_interrupt )
static WRITE8_HANDLER(equites_8155_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
// FIXME proper 8155 emulation must be implemented
switch( offset )
@@ -637,26 +637,26 @@ static WRITE8_HANDLER(equites_8155_w)
#if HVOLTAGE_DEBUG
static READ16_HANDLER(hvoltage_debug_r)
{
- return(input_port_read(space->machine, "FAKE"));
+ return(input_port_read(space->machine(), "FAKE"));
}
#endif
static CUSTOM_INPUT( gekisou_unknown_status )
{
- equites_state *state = field->port->machine->driver_data<equites_state>();
+ equites_state *state = field->port->machine().driver_data<equites_state>();
return state->unknown_bit;
}
static WRITE16_HANDLER( gekisou_unknown_0_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->unknown_bit = 0;
}
static WRITE16_HANDLER( gekisou_unknown_1_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
state->unknown_bit = 1;
}
@@ -666,7 +666,7 @@ static WRITE16_HANDLER( gekisou_unknown_1_w )
static READ16_HANDLER(equites_spriteram_kludge_r)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (state->spriteram[0] == 0x5555)
return 0;
else
@@ -675,26 +675,26 @@ static READ16_HANDLER(equites_spriteram_kludge_r)
static READ16_HANDLER(mcu_r)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
return 0xff00 | state->mcu_ram[offset];
}
static WRITE16_HANDLER(mcu_w)
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
if (ACCESSING_BITS_0_7)
state->mcu_ram[offset] = data & 0xff;
}
static WRITE16_HANDLER( mcu_halt_assert_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
device_set_input_line(state->mcu, INPUT_LINE_HALT, ASSERT_LINE);
}
static WRITE16_HANDLER( mcu_halt_clear_w )
{
- equites_state *state = space->machine->driver_data<equites_state>();
+ equites_state *state = space->machine().driver_data<equites_state>();
device_set_input_line(state->mcu, INPUT_LINE_HALT, CLEAR_LINE);
}
@@ -1189,13 +1189,13 @@ MACHINE_CONFIG_END
static MACHINE_START( equites )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
- state->mcu = machine->device("mcu");
- state->audio_cpu = machine->device("audiocpu");
- state->msm = machine->device<msm5232_device>("msm");
- state->dac_1 = machine->device("dac1");
- state->dac_2 = machine->device("dac2");
+ state->mcu = machine.device("mcu");
+ state->audio_cpu = machine.device("audiocpu");
+ state->msm = machine.device<msm5232_device>("msm");
+ state->dac_1 = machine.device("dac1");
+ state->dac_2 = machine.device("dac2");
state->save_item(NAME(state->fg_char_bank));
state->save_item(NAME(state->bgcolor));
@@ -1221,7 +1221,7 @@ static MACHINE_START( equites )
static MACHINE_RESET( equites )
{
- equites_state *state = machine->driver_data<equites_state>();
+ equites_state *state = machine.driver_data<equites_state>();
flip_screen_set(machine, 0);
@@ -1856,9 +1856,9 @@ ROM_END
/******************************************************************************/
// Initializations
-static void unpack_block( running_machine *machine, const char *region, int offset, int size )
+static void unpack_block( running_machine &machine, const char *region, int offset, int size )
{
- UINT8 *rom = machine->region(region)->base();
+ UINT8 *rom = machine.region(region)->base();
int i;
for (i = 0; i < size; ++i)
@@ -1868,7 +1868,7 @@ static void unpack_block( running_machine *machine, const char *region, int offs
}
}
-static void unpack_region( running_machine *machine, const char *region )
+static void unpack_region( running_machine &machine, const char *region )
{
unpack_block(machine, region, 0x0000, 0x2000);
unpack_block(machine, region, 0x4000, 0x2000);
@@ -1899,8 +1899,8 @@ static DRIVER_INIT( gekisou )
unpack_region(machine, "gfx3");
// install special handlers for unknown device (protection?)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x580000, 0x580001, FUNC(gekisou_unknown_0_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5a0000, 0x5a0001, FUNC(gekisou_unknown_1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x580000, 0x580001, FUNC(gekisou_unknown_0_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x5a0000, 0x5a0001, FUNC(gekisou_unknown_1_w));
}
static DRIVER_INIT( splndrbt )
@@ -1913,7 +1913,7 @@ static DRIVER_INIT( hvoltage )
unpack_region(machine, "gfx3");
#if HVOLTAGE_DEBUG
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x000038, 0x000039, FUNC(hvoltage_debug_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x000038, 0x000039, FUNC(hvoltage_debug_r));
#endif
}
diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c
index f8e1302be5b..21c7c93e5a5 100644
--- a/src/mame/drivers/ertictac.c
+++ b/src/mame/drivers/ertictac.c
@@ -41,11 +41,11 @@ static READ32_HANDLER( ertictac_podule_r )
switch(offset)
{
- case 0x04/4: return input_port_read(space->machine, "DSW1") & 0xff;
- case 0x08/4: return input_port_read(space->machine, "DSW2") & 0xff;
- case 0x10/4: return input_port_read(space->machine, "SYSTEM") & 0xff;
- case 0x14/4: return input_port_read(space->machine, "P2") & 0xff;
- case 0x18/4: return input_port_read(space->machine, "P1") & 0xff;
+ case 0x04/4: return input_port_read(space->machine(), "DSW1") & 0xff;
+ case 0x08/4: return input_port_read(space->machine(), "DSW2") & 0xff;
+ case 0x10/4: return input_port_read(space->machine(), "SYSTEM") & 0xff;
+ case 0x14/4: return input_port_read(space->machine(), "P2") & 0xff;
+ case 0x18/4: return input_port_read(space->machine(), "P1") & 0xff;
}
return 0;
@@ -194,7 +194,7 @@ static MACHINE_START( ertictac )
archimedes_init(machine);
// reset the DAC to centerline
- //dac_signed_data_w(machine->device("dac"), 0x80);
+ //dac_signed_data_w(machine.device("dac"), 0x80);
}
static MACHINE_RESET( ertictac )
@@ -204,7 +204,7 @@ static MACHINE_RESET( ertictac )
static INTERRUPT_GEN( ertictac_podule_irq )
{
- archimedes_request_irq_b(device->machine, ARCHIMEDES_IRQB_PODULE_IRQ);
+ archimedes_request_irq_b(device->machine(), ARCHIMEDES_IRQB_PODULE_IRQ);
}
/* TODO: Are we sure that this HW have I2C device? */
diff --git a/src/mame/drivers/esd16.c b/src/mame/drivers/esd16.c
index b580ac0638c..be03aac60b6 100644
--- a/src/mame/drivers/esd16.c
+++ b/src/mame/drivers/esd16.c
@@ -61,13 +61,13 @@ Head Panic
static WRITE16_HANDLER( esd16_spriteram_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
COMBINE_DATA(&state->spriteram[offset]);
}
static WRITE16_HANDLER( esd16_sound_command_w )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space, 0, data & 0xff);
@@ -106,7 +106,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER(hedpanic_platform_w)
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
int offsets = state->headpanic_platform_x[0] + 0x40 * state->headpanic_platform_y[0];
state->vram_1[offsets] = data;
@@ -116,7 +116,7 @@ static WRITE16_HANDLER(hedpanic_platform_w)
static READ16_HANDLER( esd_eeprom_r )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
if (ACCESSING_BITS_8_15)
{
return ((eeprom_read_bit(state->eeprom) & 0x01) << 15);
@@ -129,7 +129,7 @@ static READ16_HANDLER( esd_eeprom_r )
static WRITE16_HANDLER( esd_eeprom_w )
{
if (ACCESSING_BITS_8_15)
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
// logerror("(0x%06x) Unk EEPROM write: %04x %04x\n", cpu_get_pc(space->cpu), data, mem_mask);
}
@@ -230,7 +230,7 @@ static WRITE8_HANDLER( esd16_sound_rombank_w )
int bank = data & 0xf;
if (data != bank) logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", cpu_get_pc(space->cpu), data);
if (bank >= 3) bank += 1;
- memory_set_bank(space->machine, "bank1", bank);
+ memory_set_bank(space->machine(), "bank1", bank);
}
static ADDRESS_MAP_START( multchmp_sound_map, AS_PROGRAM, 8 )
@@ -241,7 +241,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( esd16_sound_command_r )
{
- esd16_state *state = space->machine->driver_data<esd16_state>();
+ esd16_state *state = space->machine().driver_data<esd16_state>();
/* Clear IRQ only after reading the command, or some get lost */
device_set_input_line(state->audio_cpu, 0, CLEAR_LINE);
@@ -519,20 +519,20 @@ GFXDECODE_END
static MACHINE_START( esd16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
- UINT8 *AUDIO = machine->region("audiocpu")->base();
+ esd16_state *state = machine.driver_data<esd16_state>();
+ UINT8 *AUDIO = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 17, &AUDIO[0x0000], 0x4000);
- state->audio_cpu = machine->device("audiocpu");
- state->eeprom = machine->device("eeprom");
+ state->audio_cpu = machine.device("audiocpu");
+ state->eeprom = machine.device("eeprom");
state->save_item(NAME(state->tilemap0_color));
}
static MACHINE_RESET( esd16 )
{
- esd16_state *state = machine->driver_data<esd16_state>();
+ esd16_state *state = machine.driver_data<esd16_state>();
state->tilemap0_color = 0;
}
diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c
index 8b9570a3818..b634f5d9289 100644
--- a/src/mame/drivers/esh.c
+++ b/src/mame/drivers/esh.c
@@ -48,7 +48,7 @@ public:
/* VIDEO GOODS */
static SCREEN_UPDATE( esh )
{
- esh_state *state = screen->machine->driver_data<esh_state>();
+ esh_state *state = screen->machine().driver_data<esh_state>();
int charx, chary;
/* clear */
@@ -66,7 +66,7 @@ static SCREEN_UPDATE( esh )
//int blinkLine = (state->tile_control_ram[current_screen_character] & 0x40) >> 6;
//int blinkChar = (state->tile_control_ram[current_screen_character] & 0x80) >> 7;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->tile_ram[current_screen_character] + (0x100 * tileOffs),
palIndex,
0, 0, charx*8, chary*8, 0);
@@ -82,19 +82,19 @@ static SCREEN_UPDATE( esh )
/* MEMORY HANDLERS */
static READ8_HANDLER(ldp_read)
{
- esh_state *state = space->machine->driver_data<esh_state>();
+ esh_state *state = space->machine().driver_data<esh_state>();
return laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER(ldp_write)
{
- esh_state *state = space->machine->driver_data<esh_state>();
+ esh_state *state = space->machine().driver_data<esh_state>();
laserdisc_data_w(state->laserdisc,data);
}
static WRITE8_HANDLER(misc_write)
{
- esh_state *state = space->machine->driver_data<esh_state>();
+ esh_state *state = space->machine().driver_data<esh_state>();
/* Bit 0 unknown */
if (data & 0x02)
@@ -141,9 +141,9 @@ static WRITE8_HANDLER(led_writes)
static WRITE8_HANDLER(nmi_line_w)
{
if (data == 0x00)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, ASSERT_LINE);
if (data == 0x01)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);
if (data != 0x00 && data != 0x01)
logerror("NMI line got a weird value!\n");
@@ -222,7 +222,7 @@ static PALETTE_INIT( esh )
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int r,g,b;
int bit0,bit1,bit2;
@@ -278,13 +278,13 @@ static INTERRUPT_GEN( vblank_callback_esh )
{
// IRQ
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
}
static MACHINE_START( esh )
{
- esh_state *state = machine->driver_data<esh_state>();
- state->laserdisc = machine->device("laserdisc");
+ esh_state *state = machine.driver_data<esh_state>();
+ state->laserdisc = machine.device("laserdisc");
}
diff --git a/src/mame/drivers/espial.c b/src/mame/drivers/espial.c
index b955618bb35..adff0bce129 100644
--- a/src/mame/drivers/espial.c
+++ b/src/mame/drivers/espial.c
@@ -43,28 +43,28 @@ Stephh's notes (based on the games Z80 code and some tests) :
static TIMER_CALLBACK( interrupt_disable )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
//interrupt_enable = 0;
cpu_interrupt_enable(state->maincpu, 0);
}
static MACHINE_RESET( espial )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
state->flipscreen = 0;
/* we must start with NMI interrupts disabled */
- machine->scheduler().synchronize(FUNC(interrupt_disable));
+ machine.scheduler().synchronize(FUNC(interrupt_disable));
state->sound_nmi_enabled = FALSE;
}
static MACHINE_START( espial )
{
- espial_state *state = machine->driver_data<espial_state>();
+ espial_state *state = machine.driver_data<espial_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
//state_save_register_global_array(machine, mcu_out[1]);
state->save_item(NAME(state->sound_nmi_enabled));
@@ -79,14 +79,14 @@ static WRITE8_HANDLER( espial_master_interrupt_enable_w )
WRITE8_HANDLER( espial_sound_nmi_enable_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
state->sound_nmi_enabled = data & 1;
}
INTERRUPT_GEN( espial_sound_nmi_gen )
{
- espial_state *state = device->machine->driver_data<espial_state>();
+ espial_state *state = device->machine().driver_data<espial_state>();
if (state->sound_nmi_enabled)
nmi_line_pulse(device);
@@ -104,7 +104,7 @@ static INTERRUPT_GEN( espial_master_interrupt )
static WRITE8_HANDLER( espial_master_soundlatch_w )
{
- espial_state *state = space->machine->driver_data<espial_state>();
+ espial_state *state = space->machine().driver_data<espial_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index 79c64f03c9f..6286761eec7 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -43,7 +43,7 @@
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "sound_cpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "sound_cpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface ptm_intf =
@@ -95,32 +95,32 @@ static READ8_HANDLER( uart_r )
static READ8_HANDLER( g_status_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- int bank4 = BIT(get_rip_status(space->machine->device("video_cpu")), 2);
- int vblank = space->machine->primary_screen->vblank();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ int bank4 = BIT(get_rip_status(space->machine().device("video_cpu")), 2);
+ int vblank = space->machine().primary_screen->vblank();
return (!vblank << 7) | (bank4 << 6) | (state->f_status & 0x2f);
}
static WRITE8_HANDLER( g_status_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
int bankaddress;
- UINT8 *rom = space->machine->region("game_cpu")->base();
+ UINT8 *rom = space->machine().region("game_cpu")->base();
state->g_status = data;
bankaddress = 0x10000 + (data & 0x03) * 0x10000;
- memory_set_bankptr(space->machine, "bank1", &rom[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[bankaddress]);
- cputag_set_input_line(space->machine, "frame_cpu", M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "frame_cpu", INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "frame_cpu", M6809_FIRQ_LINE, data & 0x10 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "frame_cpu", INPUT_LINE_NMI, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "video_cpu", INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "video_cpu", INPUT_LINE_RESET, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);
/* /VBLANK IRQ acknowledge */
if (!(data & 0x20))
- cputag_set_input_line(space->machine, "game_cpu", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "game_cpu", M6809_IRQ_LINE, CLEAR_LINE);
}
@@ -145,9 +145,9 @@ static WRITE8_HANDLER( g_status_w )
static READ8_HANDLER( f_status_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- int vblank = space->machine->primary_screen->vblank();
- UINT8 rip_status = get_rip_status(space->machine->device("video_cpu"));
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ int vblank = space->machine().primary_screen->vblank();
+ UINT8 rip_status = get_rip_status(space->machine().device("video_cpu"));
rip_status = (rip_status & 0x18) | (BIT(rip_status, 6) << 1) | BIT(rip_status, 7);
@@ -156,7 +156,7 @@ static READ8_HANDLER( f_status_r )
static WRITE8_HANDLER( f_status_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->f_status = data;
}
@@ -169,21 +169,21 @@ static WRITE8_HANDLER( f_status_w )
static TIMER_CALLBACK( delayed_bank_swap )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
state->_fasel ^= 1;
state->_fbsel ^= 1;
}
static WRITE8_HANDLER( frame_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- space->machine->scheduler().synchronize(FUNC(delayed_bank_swap));
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ space->machine().scheduler().synchronize(FUNC(delayed_bank_swap));
state->frame_vbl = 1;
}
static READ8_HANDLER( fdt_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
if (!state->_fasel)
return state->fdt_b[offset];
else
@@ -192,7 +192,7 @@ static READ8_HANDLER( fdt_r )
static WRITE8_HANDLER( fdt_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
if (!state->_fasel)
state->fdt_b[offset] = data;
else
@@ -208,7 +208,7 @@ static WRITE8_HANDLER( fdt_w )
static READ16_DEVICE_HANDLER( fdt_rip_r )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
offset = (offset & 0x7ff) << 1;
if (!state->_fasel)
@@ -219,7 +219,7 @@ static READ16_DEVICE_HANDLER( fdt_rip_r )
static WRITE16_DEVICE_HANDLER( fdt_rip_w )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
offset = (offset & 0x7ff) << 1;
if (!state->_fasel)
@@ -245,12 +245,12 @@ static WRITE16_DEVICE_HANDLER( fdt_rip_w )
D7 = /FDONE
*/
-static UINT8 rip_status_in(running_machine *machine)
+static UINT8 rip_status_in(running_machine &machine)
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
- int vpos = machine->primary_screen->vpos();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
+ int vpos = machine.primary_screen->vpos();
UINT8 _vblank = !(vpos >= ESRIPSYS_VBLANK_START);
-// UINT8 _hblank = !machine->primary_screen->hblank();
+// UINT8 _hblank = !machine.primary_screen->hblank();
return _vblank
| (state->hblank << 1)
@@ -268,13 +268,13 @@ static UINT8 rip_status_in(running_machine *machine)
static WRITE8_HANDLER( g_iobus_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->g_iodata = data;
}
static READ8_HANDLER( g_iobus_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
switch (state->g_ioaddr & 0x7f)
{
case 0:
@@ -285,32 +285,32 @@ static READ8_HANDLER( g_iobus_r )
return state->cmos_ram[(state->cmos_ram_a10_3 << 3) | (state->cmos_ram_a2_0 & 3)];
case 8:
{
- int keypad = input_port_read(space->machine, "KEYPAD_B") | state->keypad_status;
+ int keypad = input_port_read(space->machine(), "KEYPAD_B") | state->keypad_status;
state->keypad_status = 0;
state->io_firq_status = 0;
return keypad;
}
case 9:
{
- return input_port_read(space->machine, "KEYPAD_A");
+ return input_port_read(space->machine(), "KEYPAD_A");
}
case 0xa:
{
- int coins = state->coin_latch | (input_port_read(space->machine, "COINS") & 0x30);
+ int coins = state->coin_latch | (input_port_read(space->machine(), "COINS") & 0x30);
state->coin_latch = 0;
state->io_firq_status = 0;
return coins;
}
case 0x10:
- return input_port_read(space->machine, "IO_1");
+ return input_port_read(space->machine(), "IO_1");
case 0x11:
- return input_port_read(space->machine, "JOYSTICK_X");
+ return input_port_read(space->machine(), "JOYSTICK_X");
case 0x12:
- return input_port_read(space->machine, "JOYSTICK_Y");
+ return input_port_read(space->machine(), "JOYSTICK_Y");
case 0x16:
return state->io_firq_status;
case 0x18:
- return input_port_read(space->machine, "IO_2");
+ return input_port_read(space->machine(), "IO_2");
/* Unused I/O */
case 0x19:
case 0x1a:
@@ -342,7 +342,7 @@ static READ8_HANDLER( g_iobus_r )
static WRITE8_HANDLER( g_ioadd_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->g_ioaddr = data;
/* Bit 7 is connected to /OE of LS374 containing I/O data */
@@ -357,7 +357,7 @@ static WRITE8_HANDLER( g_ioadd_w )
}
case 0x02:
{
- cputag_set_input_line(space->machine, "sound_cpu", INPUT_LINE_NMI, state->g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", INPUT_LINE_NMI, state->g_iodata & 4 ? CLEAR_LINE : ASSERT_LINE);
if (!(state->g_to_s_latch2 & 1) && (state->g_iodata & 1))
{
@@ -365,7 +365,7 @@ static WRITE8_HANDLER( g_ioadd_w )
state->u56a = 1;
/*...causing a sound CPU /IRQ */
- cputag_set_input_line(space->machine, "sound_cpu", M6809_IRQ_LINE, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", M6809_IRQ_LINE, ASSERT_LINE);
}
if (state->g_iodata & 2)
@@ -414,23 +414,23 @@ static WRITE8_HANDLER( g_ioadd_w )
static INPUT_CHANGED( keypad_interrupt )
{
- esripsys_state *state = field->port->machine->driver_data<esripsys_state>();
+ esripsys_state *state = field->port->machine().driver_data<esripsys_state>();
if (newval == 0)
{
state->io_firq_status |= 2;
state->keypad_status |= 0x20;
- cputag_set_input_line(field->port->machine, "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(field->port->machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
}
}
static INPUT_CHANGED( coin_interrupt )
{
- esripsys_state *state = field->port->machine->driver_data<esripsys_state>();
+ esripsys_state *state = field->port->machine().driver_data<esripsys_state>();
if (newval == 1)
{
state->io_firq_status |= 2;
- state->coin_latch = input_port_read(field->port->machine, "COINS") << 2;
- cputag_set_input_line(field->port->machine, "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
+ state->coin_latch = input_port_read(field->port->machine(), "COINS") << 2;
+ cputag_set_input_line(field->port->machine(), "game_cpu", M6809_FIRQ_LINE, HOLD_LINE);
}
}
@@ -493,20 +493,20 @@ INPUT_PORTS_END
/* Game/Sound CPU communications */
static READ8_HANDLER( s_200e_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
return state->g_to_s_latch1;
}
static WRITE8_HANDLER( s_200e_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->s_to_g_latch1 = data;
}
static WRITE8_HANDLER( s_200f_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- UINT8 *rom = space->machine->region("sound_data")->base();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ UINT8 *rom = space->machine().region("sound_data")->base();
int rombank = data & 0x20 ? 0x2000 : 0;
/* Bit 6 -> Reset latch U56A */
@@ -514,23 +514,23 @@ static WRITE8_HANDLER( s_200f_w )
if (state->s_to_g_latch2 & 0x40)
{
state->u56a = 0;
- cputag_set_input_line(space->machine, "sound_cpu", M6809_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sound_cpu", M6809_IRQ_LINE, CLEAR_LINE);
}
if (!(state->s_to_g_latch2 & 0x80) && (data & 0x80))
state->u56b = 1;
/* Speech data resides in the upper 8kB of the ROMs */
- memory_set_bankptr(space->machine, "bank2", &rom[0x0000 + rombank]);
- memory_set_bankptr(space->machine, "bank3", &rom[0x4000 + rombank]);
- memory_set_bankptr(space->machine, "bank4", &rom[0x8000 + rombank]);
+ memory_set_bankptr(space->machine(), "bank2", &rom[0x0000 + rombank]);
+ memory_set_bankptr(space->machine(), "bank3", &rom[0x4000 + rombank]);
+ memory_set_bankptr(space->machine(), "bank4", &rom[0x8000 + rombank]);
state->s_to_g_latch2 = data;
}
static READ8_HANDLER( s_200f_r )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
return (state->g_to_s_latch2 & 0xfc) | (state->u56b << 1) | state->u56a;
}
@@ -539,7 +539,7 @@ static READ8_HANDLER( tms5220_r )
if (offset == 0)
{
/* TMS5220 core returns status bits in D7-D6 */
- device_t *tms = space->machine->device("tms5220nl");
+ device_t *tms = space->machine().device("tms5220nl");
UINT8 status = tms5220_status_r(tms, 0);
status = ((status & 0x80) >> 5) | ((status & 0x40) >> 5) | ((status & 0x20) >> 5);
@@ -552,8 +552,8 @@ static READ8_HANDLER( tms5220_r )
/* TODO: Implement correctly using the state PROM */
static WRITE8_HANDLER( tms5220_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
- device_t *tms = space->machine->device("tms5220nl");
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
+ device_t *tms = space->machine().device("tms5220nl");
if (offset == 0)
{
state->tms_data = data;
@@ -577,7 +577,7 @@ static WRITE8_HANDLER( control_w )
/* 10-bit MC3410CL DAC */
static WRITE8_DEVICE_HANDLER( esripsys_dac_w )
{
- esripsys_state *state = device->machine->driver_data<esripsys_state>();
+ esripsys_state *state = device->machine().driver_data<esripsys_state>();
if (offset == 0)
{
state->dac_msb = data & 3;
@@ -597,7 +597,7 @@ static WRITE8_DEVICE_HANDLER( esripsys_dac_w )
/* 8-bit MC3408 DAC */
static WRITE8_HANDLER( volume_dac_w )
{
- esripsys_state *state = space->machine->driver_data<esripsys_state>();
+ esripsys_state *state = space->machine().driver_data<esripsys_state>();
state->dac_vol = data;
}
@@ -662,14 +662,14 @@ ADDRESS_MAP_END
static DRIVER_INIT( esripsys )
{
- esripsys_state *state = machine->driver_data<esripsys_state>();
- UINT8 *rom = machine->region("sound_data")->base();
+ esripsys_state *state = machine.driver_data<esripsys_state>();
+ UINT8 *rom = machine.region("sound_data")->base();
state->fdt_a = auto_alloc_array(machine, UINT8, FDT_RAM_SIZE);
state->fdt_b = auto_alloc_array(machine, UINT8, FDT_RAM_SIZE);
state->cmos_ram = auto_alloc_array(machine, UINT8, CMOS_RAM_SIZE);
- machine->device<nvram_device>("nvram")->set_base(state->cmos_ram, CMOS_RAM_SIZE);
+ machine.device<nvram_device>("nvram")->set_base(state->cmos_ram, CMOS_RAM_SIZE);
memory_set_bankptr(machine, "bank2", &rom[0x0000]);
memory_set_bankptr(machine, "bank3", &rom[0x4000]);
diff --git a/src/mame/drivers/ettrivia.c b/src/mame/drivers/ettrivia.c
index 4dd01df3995..8066803f167 100644
--- a/src/mame/drivers/ettrivia.c
+++ b/src/mame/drivers/ettrivia.c
@@ -52,49 +52,49 @@ public:
static WRITE8_HANDLER( ettrivia_fg_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( ettrivia_bg_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE8_HANDLER( ettrivia_control_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
+ tilemap_mark_all_tiles_dirty_all(space->machine());
state->palreg = (data >> 1) & 3;
state->gfx_bank = (data >> 2) & 1;
state->question_bank = (data >> 3) & 3;
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static READ8_HANDLER( ettrivia_question_r )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
- UINT8 *QUESTIONS = space->machine->region("user1")->base();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
+ UINT8 *QUESTIONS = space->machine().region("user1")->base();
return QUESTIONS[offset + 0x10000 * state->question_bank];
}
static WRITE8_HANDLER( b000_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
state->b000_val = data;
}
static READ8_HANDLER( b000_r )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
if(state->b800_prev)
return state->b000_ret;
else
@@ -103,26 +103,26 @@ static READ8_HANDLER( b000_r )
static WRITE8_HANDLER( b800_w )
{
- ettrivia_state *state = space->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = space->machine().driver_data<ettrivia_state>();
switch(data)
{
/* special case to return the value written to 0xb000 */
/* does it reset the chips too ? */
case 0: break;
- case 0xc4: state->b000_ret = ay8910_r(space->machine->device("ay1"), 0); break;
- case 0x94: state->b000_ret = ay8910_r(space->machine->device("ay2"), 0); break;
- case 0x86: state->b000_ret = ay8910_r(space->machine->device("ay3"), 0); break;
+ case 0xc4: state->b000_ret = ay8910_r(space->machine().device("ay1"), 0); break;
+ case 0x94: state->b000_ret = ay8910_r(space->machine().device("ay2"), 0); break;
+ case 0x86: state->b000_ret = ay8910_r(space->machine().device("ay3"), 0); break;
case 0x80:
switch(state->b800_prev)
{
- case 0xe0: ay8910_address_w(space->machine->device("ay1"),0,state->b000_val); break;
- case 0x98: ay8910_address_w(space->machine->device("ay2"),0,state->b000_val); break;
- case 0x83: ay8910_address_w(space->machine->device("ay3"),0,state->b000_val); break;
+ case 0xe0: ay8910_address_w(space->machine().device("ay1"),0,state->b000_val); break;
+ case 0x98: ay8910_address_w(space->machine().device("ay2"),0,state->b000_val); break;
+ case 0x83: ay8910_address_w(space->machine().device("ay3"),0,state->b000_val); break;
- case 0xa0: ay8910_data_w(space->machine->device("ay1"),0,state->b000_val); break;
- case 0x88: ay8910_data_w(space->machine->device("ay2"),0,state->b000_val); break;
- case 0x81: ay8910_data_w(space->machine->device("ay3"),0,state->b000_val); break;
+ case 0xa0: ay8910_data_w(space->machine().device("ay1"),0,state->b000_val); break;
+ case 0x88: ay8910_data_w(space->machine().device("ay2"),0,state->b000_val); break;
+ case 0x81: ay8910_data_w(space->machine().device("ay3"),0,state->b000_val); break;
}
break;
@@ -188,9 +188,9 @@ static GFXDECODE_START( ettrivia )
GFXDECODE_ENTRY( "gfx2", 0, charlayout, 32*4, 32 )
GFXDECODE_END
-INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
+INLINE void get_tile_info(running_machine &machine, tile_data *tileinfo, int tile_index, UINT8 *vidram, int gfx_code)
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
int code = vidram[tile_index];
int color = (code >> 5) + 8 * state->palreg;
@@ -201,13 +201,13 @@ INLINE void get_tile_info(running_machine *machine, tile_data *tileinfo, int til
static TILE_GET_INFO( get_tile_info_bg )
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
get_tile_info(machine, tileinfo, tile_index, state->bg_videoram, 0);
}
static TILE_GET_INFO( get_tile_info_fg )
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
get_tile_info(machine, tileinfo, tile_index, state->fg_videoram, 1);
}
@@ -223,7 +223,7 @@ static PALETTE_INIT( ettrivia )
2, resistances, weights, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1;
int r, g, b;
@@ -249,7 +249,7 @@ static PALETTE_INIT( ettrivia )
static VIDEO_START( ettrivia )
{
- ettrivia_state *state = machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = machine.driver_data<ettrivia_state>();
state->bg_tilemap = tilemap_create( machine, get_tile_info_bg,tilemap_scan_rows,8,8,64,32 );
state->fg_tilemap = tilemap_create( machine, get_tile_info_fg,tilemap_scan_rows,8,8,64,32 );
@@ -258,7 +258,7 @@ static VIDEO_START( ettrivia )
static SCREEN_UPDATE( ettrivia )
{
- ettrivia_state *state = screen->machine->driver_data<ettrivia_state>();
+ ettrivia_state *state = screen->machine().driver_data<ettrivia_state>();
tilemap_draw(bitmap,cliprect,state->bg_tilemap,0,0);
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,0);
return 0;
@@ -287,7 +287,7 @@ static const ay8910_interface ay8912_interface_3 =
static INTERRUPT_GEN( ettrivia_interrupt )
{
- if( input_port_read(device->machine, "COIN") & 0x01 )
+ if( input_port_read(device->machine(), "COIN") & 0x01 )
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
else
device_set_input_line(device, 0, HOLD_LINE);
diff --git a/src/mame/drivers/exedexes.c b/src/mame/drivers/exedexes.c
index 3eb585936a8..776e4b6dbbb 100644
--- a/src/mame/drivers/exedexes.c
+++ b/src/mame/drivers/exedexes.c
@@ -194,7 +194,7 @@ GFXDECODE_END
static MACHINE_START( exedexes )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
+ exedexes_state *state = machine.driver_data<exedexes_state>();
state->save_item(NAME(state->chon));
state->save_item(NAME(state->objon));
@@ -204,7 +204,7 @@ static MACHINE_START( exedexes )
static MACHINE_RESET( exedexes )
{
- exedexes_state *state = machine->driver_data<exedexes_state>();
+ exedexes_state *state = machine.driver_data<exedexes_state>();
state->chon = 0;
state->objon = 0;
diff --git a/src/mame/drivers/exerion.c b/src/mame/drivers/exerion.c
index 4c003bbc84c..21eb56ab8a2 100644
--- a/src/mame/drivers/exerion.c
+++ b/src/mame/drivers/exerion.c
@@ -133,14 +133,14 @@ Stephh's notes (based on the games Z80 code and some tests) :
static CUSTOM_INPUT( exerion_controls_r )
{
static const char *const inname[2] = { "P1", "P2" };
- exerion_state *state = field->port->machine->driver_data<exerion_state>();
- return input_port_read(field->port->machine, inname[state->cocktail_flip]) & 0x3f;
+ exerion_state *state = field->port->machine().driver_data<exerion_state>();
+ return input_port_read(field->port->machine(), inname[state->cocktail_flip]) & 0x3f;
}
static INPUT_CHANGED( coin_inserted )
{
- exerion_state *state = field->port->machine->driver_data<exerion_state>();
+ exerion_state *state = field->port->machine().driver_data<exerion_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -157,7 +157,7 @@ static INPUT_CHANGED( coin_inserted )
/* protection or some sort of timer. */
static READ8_DEVICE_HANDLER( exerion_porta_r )
{
- exerion_state *state = device->machine->driver_data<exerion_state>();
+ exerion_state *state = device->machine().driver_data<exerion_state>();
state->porta ^= 0x40;
return state->porta;
}
@@ -165,9 +165,9 @@ static READ8_DEVICE_HANDLER( exerion_porta_r )
static WRITE8_DEVICE_HANDLER( exerion_portb_w )
{
- exerion_state *state = device->machine->driver_data<exerion_state>();
+ exerion_state *state = device->machine().driver_data<exerion_state>();
/* pull the expected value from the ROM */
- state->porta = device->machine->region("maincpu")->base()[0x5f76];
+ state->porta = device->machine().region("maincpu")->base()[0x5f76];
state->portb = data;
logerror("Port B = %02X\n", data);
@@ -176,9 +176,9 @@ static WRITE8_DEVICE_HANDLER( exerion_portb_w )
static READ8_HANDLER( exerion_protection_r )
{
- exerion_state *state = space->machine->driver_data<exerion_state>();
+ exerion_state *state = space->machine().driver_data<exerion_state>();
if (cpu_get_pc(space->cpu) == 0x4143)
- return space->machine->region("maincpu")->base()[0x33c0 + (state->main_ram[0xd] << 2) + offset];
+ return space->machine().region("maincpu")->base()[0x33c0 + (state->main_ram[0xd] << 2) + offset];
else
return state->main_ram[0x8 + offset];
}
@@ -384,9 +384,9 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( exerion )
{
- exerion_state *state = machine->driver_data<exerion_state>();
+ exerion_state *state = machine.driver_data<exerion_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->porta));
state->save_item(NAME(state->portb));
@@ -399,7 +399,7 @@ static MACHINE_START( exerion )
static MACHINE_RESET( exerion )
{
- exerion_state *state = machine->driver_data<exerion_state>();
+ exerion_state *state = machine.driver_data<exerion_state>();
int i;
state->porta = 0;
@@ -562,8 +562,8 @@ static DRIVER_INIT( exerion )
/* make a temporary copy of the character data */
src = temp;
- dst = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ dst = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -580,8 +580,8 @@ static DRIVER_INIT( exerion )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine->region("gfx2")->base();
- length = machine->region("gfx2")->bytes();
+ dst = machine.region("gfx2")->base();
+ length = machine.region("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -603,7 +603,7 @@ static DRIVER_INIT( exerion )
static DRIVER_INIT( exerionb )
{
- UINT8 *ram = machine->region("maincpu")->base();
+ UINT8 *ram = machine.region("maincpu")->base();
int addr;
/* the program ROMs have data lines D1 and D2 swapped. Decode them. */
diff --git a/src/mame/drivers/exidy.c b/src/mame/drivers/exidy.c
index ac8668fb0b8..57ace786fee 100644
--- a/src/mame/drivers/exidy.c
+++ b/src/mame/drivers/exidy.c
@@ -158,8 +158,8 @@ Fax 1982 6502 FXL, FLA
static CUSTOM_INPUT( teetert_input_r )
{
- exidy_state *state = field->port->machine->driver_data<exidy_state>();
- UINT8 dial = input_port_read(field->port->machine, "DIAL");
+ exidy_state *state = field->port->machine().driver_data<exidy_state>();
+ UINT8 dial = input_port_read(field->port->machine(), "DIAL");
int result = 0;
result = (dial != state->last_dial) << 4;
@@ -187,9 +187,9 @@ static CUSTOM_INPUT( teetert_input_r )
static WRITE8_HANDLER( fax_bank_select_w )
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1", &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
+ memory_set_bankptr(space->machine(), "bank1", &RAM[0x10000 + (0x2000 * (data & 0x1f))]);
if ((data & 0x1f) > 0x17)
logerror("Banking to unpopulated ROM bank %02X!\n",data & 0x1f);
}
@@ -795,7 +795,7 @@ GFXDECODE_END
static MACHINE_START( teetert )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
state_save_register_global(machine, state->last_dial);
}
@@ -1384,7 +1384,7 @@ ROM_END
static DRIVER_INIT( sidetrac )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1396,7 +1396,7 @@ static DRIVER_INIT( sidetrac )
static DRIVER_INIT( targ )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1408,7 +1408,7 @@ static DRIVER_INIT( targ )
static DRIVER_INIT( spectar )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1419,7 +1419,7 @@ static DRIVER_INIT( spectar )
static DRIVER_INIT( rallys )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1430,7 +1430,7 @@ static DRIVER_INIT( rallys )
static DRIVER_INIT( phantoma )
{
- exidy_state *state = machine->driver_data<exidy_state>();
+ exidy_state *state = machine.driver_data<exidy_state>();
exidy_video_config(machine, 0x00, 0x00, FALSE);
/* hard-coded palette controlled via 8x3 DIP switches on the board */
@@ -1439,8 +1439,8 @@ static DRIVER_INIT( phantoma )
state->color_latch[0] = 0x09;
/* the ROM is actually mapped high */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xf800, 0xffff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0xf800);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xf800, 0xffff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0xf800);
}
@@ -1470,7 +1470,7 @@ static DRIVER_INIT( pepper2 )
static DRIVER_INIT( fax )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
exidy_video_config(machine, 0x04, 0x04, TRUE);
diff --git a/src/mame/drivers/exidy440.c b/src/mame/drivers/exidy440.c
index 52eb4ee0163..a44c0bb107b 100644
--- a/src/mame/drivers/exidy440.c
+++ b/src/mame/drivers/exidy440.c
@@ -256,7 +256,7 @@ static INPUT_CHANGED( coin_inserted )
{
/* if we got a coin, set the IRQ on the main CPU */
if (newval == 0)
- cputag_set_input_line(field->port->machine, "maincpu", 0, ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", 0, ASSERT_LINE);
}
@@ -269,14 +269,14 @@ static INPUT_CHANGED( coin_inserted )
static CUSTOM_INPUT( firq_beam_r )
{
- exidy440_state *state = field->port->machine->driver_data<exidy440_state>();
+ exidy440_state *state = field->port->machine().driver_data<exidy440_state>();
return state->firq_beam;
}
static CUSTOM_INPUT( firq_vblank_r )
{
- exidy440_state *state = field->port->machine->driver_data<exidy440_state>();
+ exidy440_state *state = field->port->machine().driver_data<exidy440_state>();
return state->firq_vblank;
}
@@ -284,7 +284,7 @@ static CUSTOM_INPUT( firq_vblank_r )
static CUSTOM_INPUT( hitnmiss_button1_r )
{
/* button 1 shows up in two bits */
- UINT32 button1 = input_port_read(field->port->machine, "HITNMISS_BUTTON1");
+ UINT32 button1 = input_port_read(field->port->machine(), "HITNMISS_BUTTON1");
return (button1 << 1) | button1;
}
@@ -296,31 +296,31 @@ static CUSTOM_INPUT( hitnmiss_button1_r )
*
*************************************/
-void exidy440_bank_select(running_machine *machine, UINT8 bank)
+void exidy440_bank_select(running_machine &machine, UINT8 bank)
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
/* for the showdown case, bank 0 is a PLD */
if (state->showdown_bank_data[0] != NULL)
{
if (bank == 0 && state->bank != 0)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x7fff, FUNC(showdown_bank0_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4000, 0x7fff, FUNC(showdown_bank0_r));
else if (bank != 0 && state->bank == 0)
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x4000, 0x7fff, "bank1");
}
/* select the bank and update the bank pointer */
state->bank = bank;
- memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x10000 + state->bank * 0x4000]);
+ memory_set_bankptr(machine, "bank1", &machine.region("maincpu")->base()[0x10000 + state->bank * 0x4000]);
}
static WRITE8_HANDLER( bankram_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* EEROM lives in the upper 8k of bank 15 */
if (state->bank == 15 && offset >= 0x2000)
{
- space->machine->region("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data;
+ space->machine().region("maincpu")->base()[0x10000 + 15 * 0x4000 + offset] = data;
logerror("W EEROM[%04X] = %02X\n", offset - 0x2000, data);
}
@@ -338,8 +338,8 @@ static WRITE8_HANDLER( bankram_w )
static READ8_HANDLER( exidy440_input_port_3_r )
{
/* I/O1 accesses clear the CIRQ flip/flop */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
- return input_port_read(space->machine, "IN3");
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
+ return input_port_read(space->machine(), "IN3");
}
@@ -365,20 +365,20 @@ static TIMER_CALLBACK( delayed_sound_command_w )
static WRITE8_HANDLER( sound_command_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_command_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_command_w), data);
}
static WRITE8_HANDLER( exidy440_input_port_3_w )
{
/* I/O1 accesses clear the CIRQ flip/flop */
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( exidy440_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
@@ -391,7 +391,7 @@ static WRITE8_HANDLER( exidy440_coin_counter_w )
static READ8_HANDLER( showdown_bank0_r )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
/* showdown relies on different values from different memory locations */
/* yukon relies on multiple reads from the same location returning different values */
UINT8 result = 0xff;
@@ -427,13 +427,13 @@ static READ8_HANDLER( claypign_protection_r )
static READ8_HANDLER( topsecex_input_port_5_r )
{
- return (input_port_read(space->machine, "AN1") & 1) ? 0x01 : 0x02;
+ return (input_port_read(space->machine(), "AN1") & 1) ? 0x01 : 0x02;
}
static WRITE8_HANDLER( topsecex_yscroll_w )
{
- exidy440_state *state = space->machine->driver_data<exidy440_state>();
+ exidy440_state *state = space->machine().driver_data<exidy440_state>();
*state->topsecex_yscroll = data;
}
@@ -448,13 +448,13 @@ static WRITE8_HANDLER( topsecex_yscroll_w )
static MACHINE_START( exidy440 )
{
/* the EEROM lives in the uppermost 8k of the top bank */
- UINT8 *rom = machine->region("maincpu")->base();
- machine->device<nvram_device>("nvram")->set_base(&rom[0x10000 + 15 * 0x4000 + 0x2000], 0x2000);
+ UINT8 *rom = machine.region("maincpu")->base();
+ machine.device<nvram_device>("nvram")->set_base(&rom[0x10000 + 15 * 0x4000 + 0x2000], 0x2000);
}
static MACHINE_RESET( exidy440 )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
state->bank = 0xff;
exidy440_bank_select(machine, 0);
}
@@ -1929,7 +1929,7 @@ ROM_END
static DRIVER_INIT( exidy440 )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
state->showdown_bank_data[0] = state->showdown_bank_data[1] = NULL;
}
@@ -1938,27 +1938,27 @@ static DRIVER_INIT( claypign )
{
DRIVER_INIT_CALL(exidy440);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec0, 0x2ec3, FUNC(claypign_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec0, 0x2ec3, FUNC(claypign_protection_r));
}
static DRIVER_INIT( topsecex )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
DRIVER_INIT_CALL(exidy440);
/* extra input ports and scrolling */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec5, 0x2ec5, FUNC(topsecex_input_port_5_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec6, 0x2ec6, "AN0");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec7, 0x2ec7, "IN4");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x2ec5, 0x2ec5, FUNC(topsecex_input_port_5_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec6, 0x2ec6, "AN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0x2ec7, 0x2ec7, "IN4");
- state->topsecex_yscroll = machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ec1, 0x2ec1, FUNC(topsecex_yscroll_w));
+ state->topsecex_yscroll = machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x2ec1, 0x2ec1, FUNC(topsecex_yscroll_w));
}
static DRIVER_INIT( showdown )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
static const UINT8 bankdata0[0x18] =
{
0x15,0x40,0xc1,0x8d,0x4c,0x84,0x0e,0xce,
@@ -1982,7 +1982,7 @@ static DRIVER_INIT( showdown )
static DRIVER_INIT( yukon )
{
- exidy440_state *state = machine->driver_data<exidy440_state>();
+ exidy440_state *state = machine.driver_data<exidy440_state>();
static const UINT8 bankdata0[0x18] =
{
0x31,0x40,0xc1,0x95,0x54,0x90,0x16,0xd6,
diff --git a/src/mame/drivers/expro02.c b/src/mame/drivers/expro02.c
index 0c77383bc83..5abccfcf87b 100644
--- a/src/mame/drivers/expro02.c
+++ b/src/mame/drivers/expro02.c
@@ -310,7 +310,7 @@ static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
}
@@ -323,14 +323,14 @@ static WRITE16_HANDLER( galsnew_6295_bankswitch_w )
static WRITE16_HANDLER( galsnew_paletteram_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- palette_set_color_rgb(space->machine,offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
+ data = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ palette_set_color_rgb(space->machine(),offset,pal5bit(data >> 6),pal5bit(data >> 11),pal5bit(data >> 1));
}
static WRITE16_HANDLER(galsnew_vram_0_bank_w)
{
- expro02_state *state = space->machine->driver_data<expro02_state>();
+ expro02_state *state = space->machine().driver_data<expro02_state>();
int i;
if(state->vram_0_bank_num != data)
{
@@ -347,7 +347,7 @@ static WRITE16_HANDLER(galsnew_vram_0_bank_w)
static WRITE16_HANDLER(galsnew_vram_1_bank_w)
{
- expro02_state *state = space->machine->driver_data<expro02_state>();
+ expro02_state *state = space->machine().driver_data<expro02_state>();
int i;
if(state->vram_1_bank_num != data)
{
@@ -739,8 +739,8 @@ ROM_END
static DRIVER_INIT(galsnew)
{
- UINT32 *src = (UINT32 *)machine->region("gfx3" )->base();
- UINT32 *dst = (UINT32 *)machine->region("gfx2" )->base();
+ UINT32 *src = (UINT32 *)machine.region("gfx3" )->base();
+ UINT32 *dst = (UINT32 *)machine.region("gfx2" )->base();
int x, offset;
diff --git a/src/mame/drivers/exprraid.c b/src/mame/drivers/exprraid.c
index ed3bff31dab..6a7765b429e 100644
--- a/src/mame/drivers/exprraid.c
+++ b/src/mame/drivers/exprraid.c
@@ -219,7 +219,7 @@ Stephh's notes (based on the games M6502 code and some tests) :
static READ8_HANDLER( exprraid_protection_r )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
switch (offset)
{
case 0:
@@ -233,14 +233,14 @@ static READ8_HANDLER( exprraid_protection_r )
static WRITE8_HANDLER( sound_cpu_command_w )
{
- exprraid_state *state = space->machine->driver_data<exprraid_state>();
+ exprraid_state *state = space->machine().driver_data<exprraid_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( vblank_r )
{
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static ADDRESS_MAP_START( master_map, AS_PROGRAM, 8 )
@@ -280,13 +280,13 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin_inserted_deco16 )
{
- exprraid_state *state = field->port->machine->driver_data<exprraid_state>();
+ exprraid_state *state = field->port->machine().driver_data<exprraid_state>();
device_set_input_line(state->maincpu, DECO16_IRQ_LINE, newval ? CLEAR_LINE : ASSERT_LINE);
}
static INPUT_CHANGED( coin_inserted_nmi )
{
- exprraid_state *state = field->port->machine->driver_data<exprraid_state>();
+ exprraid_state *state = field->port->machine().driver_data<exprraid_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
@@ -441,7 +441,7 @@ GFXDECODE_END
/* handler called by the 3812 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int linestate )
{
- exprraid_state *state = device->machine->driver_data<exprraid_state>();
+ exprraid_state *state = device->machine().driver_data<exprraid_state>();
device_set_input_line_and_vector(state->slave, 0, linestate, 0xff);
}
@@ -453,9 +453,9 @@ static const ym3526_interface ym3526_config =
#if 0
static INTERRUPT_GEN( exprraid_interrupt )
{
- exprraid_state *state = device->machine->driver_data<exprraid_state>();
+ exprraid_state *state = device->machine().driver_data<exprraid_state>();
- if ((~input_port_read(device->machine, "IN2")) & 0xc0)
+ if ((~input_port_read(device->machine(), "IN2")) & 0xc0)
{
if (state->coin == 0)
{
@@ -475,17 +475,17 @@ static INTERRUPT_GEN( exprraid_interrupt )
static MACHINE_START( exprraid )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
- state->maincpu = machine->device("maincpu");
- state->slave = machine->device("slave");
+ state->maincpu = machine.device("maincpu");
+ state->slave = machine.device("slave");
state->save_item(NAME(state->bg_index));
}
static MACHINE_RESET( exprraid )
{
- exprraid_state *state = machine->driver_data<exprraid_state>();
+ exprraid_state *state = machine.driver_data<exprraid_state>();
state->bg_index[0] = 0;
state->bg_index[1] = 0;
@@ -733,11 +733,11 @@ ROM_START( wexpressb2 )
ROM_END
-static void exprraid_gfx_expand(running_machine *machine)
+static void exprraid_gfx_expand(running_machine &machine)
{
/* Expand the background rom so we can use regular decode routines */
- UINT8 *gfx = machine->region("gfx3")->base();
+ UINT8 *gfx = machine.region("gfx3")->base();
int offs = 0x10000 - 0x1000;
int i;
@@ -756,7 +756,7 @@ static void exprraid_gfx_expand(running_machine *machine)
static DRIVER_INIT( wexpress )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* HACK: this set uses M6502 irq vectors but DECO CPU-16 opcodes??? */
rom[0xfff7] = rom[0xfffa];
@@ -778,13 +778,13 @@ static DRIVER_INIT( exprraid )
static DRIVER_INIT( wexpressb )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3800, 0x3800, FUNC(vblank_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3800, 0x3800, FUNC(vblank_r));
exprraid_gfx_expand(machine);
}
static DRIVER_INIT( wexpressb2 )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xFFC0, 0xFFC0, FUNC(vblank_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xFFC0, 0xFFC0, FUNC(vblank_r));
exprraid_gfx_expand(machine);
}
diff --git a/src/mame/drivers/exterm.c b/src/mame/drivers/exterm.c
index e9600879413..aca7a2fb6fd 100644
--- a/src/mame/drivers/exterm.c
+++ b/src/mame/drivers/exterm.c
@@ -78,13 +78,13 @@
static WRITE16_HANDLER( exterm_host_data_w )
{
- tms34010_host_w(space->machine->device("slave"), offset / TOWORD(0x00100000), data);
+ tms34010_host_w(space->machine().device("slave"), offset / TOWORD(0x00100000), data);
}
static READ16_HANDLER( exterm_host_data_r )
{
- return tms34010_host_r(space->machine->device("slave"), offset / TOWORD(0x00100000));
+ return tms34010_host_r(space->machine().device("slave"), offset / TOWORD(0x00100000));
}
@@ -97,11 +97,11 @@ static READ16_HANDLER( exterm_host_data_r )
static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 mem_mask)
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
UINT16 port;
/* Read the fake input port */
- UINT8 trackball_pos = input_port_read(space->machine, which ? "DIAL1" : "DIAL0");
+ UINT8 trackball_pos = input_port_read(space->machine(), which ? "DIAL1" : "DIAL0");
/* Calculate the change from the last position. */
UINT8 trackball_diff = state->trackball_old[which] - trackball_pos;
@@ -117,7 +117,7 @@ static UINT16 exterm_trackball_port_r(address_space *space, int which, UINT16 me
state->aimpos[which] = (state->aimpos[which] + trackball_diff) & 0x3f;
/* Combine it with the standard input bits */
- port = which ? input_port_read(space->machine, "P2") : input_port_read(space->machine, "P1");
+ port = which ? input_port_read(space->machine(), "P2") : input_port_read(space->machine(), "P1");
return (port & 0xc0ff) | (state->aimpos[which] << 8);
}
@@ -144,7 +144,7 @@ static READ16_HANDLER( exterm_input_port_1_r )
static WRITE16_HANDLER( exterm_output_port_0_w )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/* All the outputs are activated on the rising edge */
if (ACCESSING_BITS_0_7)
@@ -160,11 +160,11 @@ static WRITE16_HANDLER( exterm_output_port_0_w )
{
/* Bit 13 = Resets the slave CPU */
if ((data & 0x2000) && !(state->last & 0x2000))
- cputag_set_input_line(space->machine, "slave", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "slave", INPUT_LINE_RESET, PULSE_LINE);
/* Bits 14-15 = Coin counters */
- coin_counter_w(space->machine, 0, data & 0x8000);
- coin_counter_w(space->machine, 1, data & 0x4000);
+ coin_counter_w(space->machine(), 0, data & 0x8000);
+ coin_counter_w(space->machine(), 1, data & 0x4000);
}
COMBINE_DATA(&state->last);
@@ -173,7 +173,7 @@ static WRITE16_HANDLER( exterm_output_port_0_w )
static TIMER_CALLBACK( sound_delayed_w )
{
- exterm_state *state = machine->driver_data<exterm_state>();
+ exterm_state *state = machine.driver_data<exterm_state>();
/* data is latched independently for both sound CPUs */
state->master_sound_latch = state->slave_sound_latch = param;
cputag_set_input_line(machine, "audiocpu", M6502_IRQ_LINE, ASSERT_LINE);
@@ -184,7 +184,7 @@ static TIMER_CALLBACK( sound_delayed_w )
static WRITE16_HANDLER( sound_latch_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(sound_delayed_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(sound_delayed_w), data & 0xff);
}
@@ -197,16 +197,16 @@ static WRITE16_HANDLER( sound_latch_w )
static TIMER_DEVICE_CALLBACK( master_sound_nmi_callback )
{
- exterm_state *state = timer.machine->driver_data<exterm_state>();
+ exterm_state *state = timer.machine().driver_data<exterm_state>();
/* bit 0 of the sound control determines if the NMI is actually delivered */
if (state->sound_control & 0x01)
- cputag_set_input_line(timer.machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(timer.machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( ym2151_data_latch_w )
{
- exterm_state *state = device->machine->driver_data<exterm_state>();
+ exterm_state *state = device->machine().driver_data<exterm_state>();
/* bit 7 of the sound control selects which port */
ym2151_w(device, state->sound_control >> 7, data);
}
@@ -218,32 +218,32 @@ static WRITE8_HANDLER( sound_nmi_rate_w )
/* this value is latched into up-counters, which are clocked at the */
/* input clock / 256 */
attotime nmi_rate = attotime::from_hz(4000000) * (4096 * (256 - data));
- timer_device *nmi_timer = space->machine->device<timer_device>("snd_nmi_timer");
+ timer_device *nmi_timer = space->machine().device<timer_device>("snd_nmi_timer");
nmi_timer->adjust(nmi_rate, 0, nmi_rate);
}
static READ8_HANDLER( sound_master_latch_r )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/* read latch and clear interrupt */
- cputag_set_input_line(space->machine, "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", M6502_IRQ_LINE, CLEAR_LINE);
return state->master_sound_latch;
}
static READ8_HANDLER( sound_slave_latch_r )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/* read latch and clear interrupt */
- cputag_set_input_line(space->machine, "audioslave", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audioslave", M6502_IRQ_LINE, CLEAR_LINE);
return state->slave_sound_latch;
}
static WRITE8_DEVICE_HANDLER( sound_slave_dac_w )
{
- exterm_state *state = device->machine->driver_data<exterm_state>();
+ exterm_state *state = device->machine().driver_data<exterm_state>();
/* DAC A is used to modulate DAC B */
state->dac_value[offset & 1] = data;
dac_data_16_w(device, (state->dac_value[0] ^ 0xff) * state->dac_value[1]);
@@ -253,14 +253,14 @@ static WRITE8_DEVICE_HANDLER( sound_slave_dac_w )
static READ8_HANDLER( sound_nmi_to_slave_r )
{
/* a read from here triggers an NMI pulse to the slave */
- cputag_set_input_line(space->machine, "audioslave", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audioslave", INPUT_LINE_NMI, PULSE_LINE);
return 0xff;
}
static WRITE8_HANDLER( sound_control_w )
{
- exterm_state *state = space->machine->driver_data<exterm_state>();
+ exterm_state *state = space->machine().driver_data<exterm_state>();
/*
D7 = to S4-15
D6 = to S4-12
diff --git a/src/mame/drivers/exzisus.c b/src/mame/drivers/exzisus.c
index aab0523f597..c1b1b8188e5 100644
--- a/src/mame/drivers/exzisus.c
+++ b/src/mame/drivers/exzisus.c
@@ -48,74 +48,74 @@ TODO:
static WRITE8_HANDLER( exzisus_cpua_bankswitch_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
- UINT8 *RAM = space->machine->region("cpua")->base();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
+ UINT8 *RAM = space->machine().region("cpua")->base();
if ( (data & 0x0f) != state->cpua_bank )
{
state->cpua_bank = data & 0x0f;
if (state->cpua_bank >= 2)
{
- memory_set_bankptr(space->machine, "bank2", &RAM[ 0x10000 + ( (state->cpua_bank - 2) * 0x4000 ) ] );
+ memory_set_bankptr(space->machine(), "bank2", &RAM[ 0x10000 + ( (state->cpua_bank - 2) * 0x4000 ) ] );
}
}
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
}
static WRITE8_HANDLER( exzisus_cpub_bankswitch_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
- UINT8 *RAM = space->machine->region("cpub")->base();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
+ UINT8 *RAM = space->machine().region("cpub")->base();
if ( (data & 0x0f) != state->cpub_bank )
{
state->cpub_bank = data & 0x0f;
if (state->cpub_bank >= 2)
{
- memory_set_bankptr(space->machine, "bank1", &RAM[ 0x10000 + ( (state->cpub_bank - 2) * 0x4000 ) ] );
+ memory_set_bankptr(space->machine(), "bank1", &RAM[ 0x10000 + ( (state->cpub_bank - 2) * 0x4000 ) ] );
}
}
- flip_screen_set(space->machine, data & 0x40);
+ flip_screen_set(space->machine(), data & 0x40);
}
static WRITE8_HANDLER( exzisus_coincounter_w )
{
- coin_lockout_w(space->machine, 0,~data & 0x01);
- coin_lockout_w(space->machine, 1,~data & 0x02);
- coin_counter_w(space->machine, 0,data & 0x04);
- coin_counter_w(space->machine, 1,data & 0x08);
+ coin_lockout_w(space->machine(), 0,~data & 0x01);
+ coin_lockout_w(space->machine(), 1,~data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x04);
+ coin_counter_w(space->machine(), 1,data & 0x08);
}
static READ8_HANDLER( exzisus_sharedram_ab_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->sharedram_ab[offset];
}
static READ8_HANDLER( exzisus_sharedram_ac_r )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
return state->sharedram_ac[offset];
}
static WRITE8_HANDLER( exzisus_sharedram_ab_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->sharedram_ab[offset] = data;
}
static WRITE8_HANDLER( exzisus_sharedram_ac_w )
{
- exzisus_state *state = space->machine->driver_data<exzisus_state>();
+ exzisus_state *state = space->machine().driver_data<exzisus_state>();
state->sharedram_ac[offset] = data;
}
// is it ok that cpub_reset refers to cpuc?
static WRITE8_HANDLER( exzisus_cpub_reset_w )
{
- cputag_set_input_line(space->machine, "cpuc", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "cpuc", INPUT_LINE_RESET, PULSE_LINE);
}
#if 0
@@ -123,7 +123,7 @@ static WRITE8_HANDLER( exzisus_cpub_reset_w )
// the RAM check to work
static DRIVER_INIT( exzisus )
{
- UINT8 *RAM = machine->region("cpua")->base();
+ UINT8 *RAM = machine.region("cpua")->base();
/* Fix WORK RAM error */
RAM[0x67fd] = 0x18;
@@ -260,7 +260,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- cputag_set_input_line(device->machine, "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
static const ym2151_interface ym2151_config =
diff --git a/src/mame/drivers/f-32.c b/src/mame/drivers/f-32.c
index 9517f3993ed..be1adcc0337 100644
--- a/src/mame/drivers/f-32.c
+++ b/src/mame/drivers/f-32.c
@@ -32,7 +32,7 @@ public:
static SCREEN_UPDATE( mosaicf2 )
{
- mosaicf2_state *state = screen->machine->driver_data<mosaicf2_state>();
+ mosaicf2_state *state = screen->machine().driver_data<mosaicf2_state>();
offs_t offs;
for (offs = 0; offs < 0x10000; offs++)
@@ -62,12 +62,12 @@ ADDRESS_MAP_END
static READ32_HANDLER( f32_input_port_1_r )
{
/* burn a bunch of cycles because this is polled frequently during busy loops */
- mosaicf2_state *state = space->machine->driver_data<mosaicf2_state>();
+ mosaicf2_state *state = space->machine().driver_data<mosaicf2_state>();
offs_t pc = state->maincpu->pc();
if ((pc == 0x000379de) || (pc == 0x000379cc) )
state->maincpu->eat_cycles(100);
//else printf("PC %08x\n", pc );
- return input_port_read(space->machine, "SYSTEM_P2");
+ return input_port_read(space->machine(), "SYSTEM_P2");
}
diff --git a/src/mame/drivers/f1gp.c b/src/mame/drivers/f1gp.c
index ba75831eb63..2dbad86b178 100644
--- a/src/mame/drivers/f1gp.c
+++ b/src/mame/drivers/f1gp.c
@@ -30,19 +30,19 @@
static READ16_HANDLER( sharedram_r )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
return state->sharedram[offset];
}
static WRITE16_HANDLER( sharedram_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
COMBINE_DATA(&state->sharedram[offset]);
}
static READ16_HANDLER( extrarom_r )
{
- UINT8 *rom = space->machine->region("user1")->base();
+ UINT8 *rom = space->machine().region("user1")->base();
offset *= 2;
@@ -51,7 +51,7 @@ static READ16_HANDLER( extrarom_r )
static READ16_HANDLER( extrarom2_r )
{
- UINT8 *rom = space->machine->region("user2")->base();
+ UINT8 *rom = space->machine().region("user2")->base();
offset *= 2;
@@ -60,13 +60,13 @@ static READ16_HANDLER( extrarom2_r )
static WRITE8_HANDLER( f1gp_sh_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE16_HANDLER( sound_command_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
if (ACCESSING_BITS_0_7)
{
@@ -78,13 +78,13 @@ static WRITE16_HANDLER( sound_command_w )
static READ16_HANDLER( command_pending_r )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
return (state->pending_command ? 0xff : 0);
}
static WRITE8_HANDLER( pending_command_clear_w )
{
- f1gp_state *state = space->machine->driver_data<f1gp_state>();
+ f1gp_state *state = space->machine().driver_data<f1gp_state>();
state->pending_command = 0;
}
@@ -168,8 +168,8 @@ static WRITE16_HANDLER( f1gpb_misc_w )
if(old_bank != new_bank && new_bank < 5)
{
// oki banking
- UINT8 *src = space->machine->region("oki")->base() + 0x40000 + 0x10000 * new_bank;
- UINT8 *dst = space->machine->region("oki")->base() + 0x30000;
+ UINT8 *src = space->machine().region("oki")->base() + 0x40000 + 0x10000 * new_bank;
+ UINT8 *dst = space->machine().region("oki")->base() + 0x30000;
memcpy(dst, src, 0x10000);
old_bank = new_bank;
@@ -411,7 +411,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- f1gp_state *state = device->machine->driver_data<f1gp_state>();
+ f1gp_state *state = device->machine().driver_data<f1gp_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -433,7 +433,7 @@ static const k053936_interface f1gp2_k053936_intf =
static MACHINE_START( f1gpb )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->save_item(NAME(state->pending_command));
state->save_item(NAME(state->roz_bank));
@@ -444,20 +444,20 @@ static MACHINE_START( f1gpb )
static MACHINE_START( f1gp )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x8000);
- state->audiocpu = machine->device("audiocpu");
- state->k053936 = machine->device("k053936");
+ state->audiocpu = machine.device("audiocpu");
+ state->k053936 = machine.device("k053936");
MACHINE_START_CALL(f1gpb);
}
static MACHINE_RESET( f1gp )
{
- f1gp_state *state = machine->driver_data<f1gp_state>();
+ f1gp_state *state = machine.driver_data<f1gp_state>();
state->pending_command = 0;
state->roz_bank = 0;
diff --git a/src/mame/drivers/fantland.c b/src/mame/drivers/fantland.c
index 4590ce4ff2d..85147e055d8 100644
--- a/src/mame/drivers/fantland.c
+++ b/src/mame/drivers/fantland.c
@@ -61,7 +61,7 @@ Year + Game Main CPU Sound CPU Sound Video
static WRITE8_HANDLER( fantland_nmi_enable_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
state->nmi_enable = data;
if ((state->nmi_enable != 0) && (state->nmi_enable != 8))
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( fantland_nmi_enable_16_w )
static WRITE8_HANDLER( fantland_soundlatch_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audio_cpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -93,21 +93,21 @@ static WRITE16_HANDLER( fantland_soundlatch_16_w )
static READ16_HANDLER( spriteram_16_r )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram = state->spriteram;
return spriteram[2 * offset + 0] | (spriteram[2 * offset + 1] << 8);
}
static READ16_HANDLER( spriteram2_16_r )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram_2 = state->spriteram2;
return spriteram_2[2 * offset + 0] | (spriteram_2[2 * offset + 1] << 8);
}
static WRITE16_HANDLER( spriteram_16_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram = state->spriteram;
if (ACCESSING_BITS_0_7)
spriteram[2 * offset + 0] = data;
@@ -117,7 +117,7 @@ static WRITE16_HANDLER( spriteram_16_w )
static WRITE16_HANDLER( spriteram2_16_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
UINT8 *spriteram_2 = state->spriteram2;
if (ACCESSING_BITS_0_7)
spriteram_2[2 * offset + 0] = data;
@@ -170,7 +170,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( borntofi_nmi_enable_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
state->nmi_enable = data;
// data & 0x31 changes when lightgun fires
@@ -184,23 +184,23 @@ static WRITE8_HANDLER( borntofi_nmi_enable_w )
// Trackball doesn't work correctly
static READ8_HANDLER( borntofi_inputs_r )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
int x, y, f;
- switch (input_port_read(space->machine, "Controls") & 0x03)
+ switch (input_port_read(space->machine(), "Controls") & 0x03)
{
case 3:
- case 1: return input_port_read(space->machine, offset ? "P2_GUN" : "P1_GUN"); // Lightgun buttons
- case 2: return input_port_read(space->machine, offset ? "P2_JOY" : "P1_JOY"); // Joystick
+ case 1: return input_port_read(space->machine(), offset ? "P2_GUN" : "P1_GUN"); // Lightgun buttons
+ case 2: return input_port_read(space->machine(), offset ? "P2_JOY" : "P1_JOY"); // Joystick
}
// Trackball
- x = input_port_read(space->machine, offset ? "P2 Trackball X" : "P1 Trackball X");
- y = input_port_read(space->machine, offset ? "P2 Trackball Y" : "P1 Trackball Y");
- f = space->machine->primary_screen->frame_number();
+ x = input_port_read(space->machine(), offset ? "P2 Trackball X" : "P1 Trackball X");
+ y = input_port_read(space->machine(), offset ? "P2 Trackball Y" : "P1 Trackball Y");
+ f = space->machine().primary_screen->frame_number();
- state->input_ret[offset] = (state->input_ret[offset] & 0x14) | (input_port_read(space->machine, offset ? "P2_TRACK" : "P1_TRACK") & 0xc3);
+ state->input_ret[offset] = (state->input_ret[offset] & 0x14) | (input_port_read(space->machine(), offset ? "P2_TRACK" : "P1_TRACK") & 0xc3);
x = (x & 0x7f) - (x & 0x80);
y = (y & 0x7f) - (y & 0x80);
@@ -317,23 +317,23 @@ ADDRESS_MAP_END
static void borntofi_adpcm_start( device_t *device, int voice )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
msm5205_reset_w(device, 0);
state->adpcm_playing[voice] = 1;
state->adpcm_nibble[voice] = 0;
-// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine->describe_context(), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]);
+// logerror("%s: adpcm start = %06x, stop = %06x\n", device->machine().describe_context(), state->adpcm_addr[0][voice], state->adpcm_addr[1][voice]);
}
static void borntofi_adpcm_stop( device_t *device, int voice )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
msm5205_reset_w(device, 1);
state->adpcm_playing[voice] = 0;
}
static WRITE8_HANDLER( borntofi_msm5205_w )
{
- fantland_state *state = space->machine->driver_data<fantland_state>();
+ fantland_state *state = space->machine().driver_data<fantland_state>();
int voice = offset / 8;
int reg = offset % 8;
device_t *msm;
@@ -369,7 +369,7 @@ static WRITE8_HANDLER( borntofi_msm5205_w )
static void borntofi_adpcm_int( device_t *device, int voice )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
UINT8 *rom;
size_t len;
int start, stop;
@@ -377,8 +377,8 @@ static void borntofi_adpcm_int( device_t *device, int voice )
if (!state->adpcm_playing[voice])
return;
- rom = device->machine->region("adpcm")->base();
- len = device->machine->region("adpcm")->bytes() * 2;
+ rom = device->machine().region("adpcm")->base();
+ len = device->machine().region("adpcm")->bytes() * 2;
start = state->adpcm_addr[0][voice] + state->adpcm_nibble[voice];
stop = state->adpcm_addr[1][voice];
@@ -730,7 +730,7 @@ INPUT_PORTS_END
static CUSTOM_INPUT( wheelrun_wheel_r )
{
int player = (FPTR)param;
- int delta = input_port_read(field->port->machine, player ? "WHEEL1" : "WHEEL0");
+ int delta = input_port_read(field->port->machine(), player ? "WHEEL1" : "WHEEL0");
delta = (delta & 0x7f) - (delta & 0x80) + 4;
if (delta > 7) delta = 7;
@@ -827,22 +827,22 @@ GFXDECODE_END
static MACHINE_START( fantland )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
- state->audio_cpu = machine->device("audiocpu");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->nmi_enable));
}
static MACHINE_RESET( fantland )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
state->nmi_enable = 0;
}
static INTERRUPT_GEN( fantland_irq )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
if (state->nmi_enable & 8)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -897,7 +897,7 @@ MACHINE_CONFIG_END
static void galaxygn_sound_irq( device_t *device, int line )
{
- fantland_state *state = device->machine->driver_data<fantland_state>();
+ fantland_state *state = device->machine().driver_data<fantland_state>();
device_set_input_line_and_vector(state->audio_cpu, 0, line ? ASSERT_LINE : CLEAR_LINE, 0x80/4);
}
@@ -967,14 +967,14 @@ static const msm5205_interface msm5205_config_3 =
static MACHINE_START( borntofi )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
MACHINE_START_CALL(fantland);
- state->msm1 = machine->device("msm1");
- state->msm2 = machine->device("msm2");
- state->msm3 = machine->device("msm3");
- state->msm4 = machine->device("msm4");
+ state->msm1 = machine.device("msm1");
+ state->msm2 = machine.device("msm2");
+ state->msm3 = machine.device("msm3");
+ state->msm4 = machine.device("msm4");
state->save_item(NAME(state->old_x));
state->save_item(NAME(state->old_y));
@@ -988,7 +988,7 @@ static MACHINE_START( borntofi )
static MACHINE_RESET( borntofi )
{
- fantland_state *state = machine->driver_data<fantland_state>();
+ fantland_state *state = machine.driver_data<fantland_state>();
int i;
MACHINE_RESET_CALL(fantland);
@@ -1009,10 +1009,10 @@ static MACHINE_RESET( borntofi )
state->adpcm_nibble[i] = 0;
}
- borntofi_adpcm_stop(machine->device("msm1"), 0);
- borntofi_adpcm_stop(machine->device("msm2"), 1);
- borntofi_adpcm_stop(machine->device("msm3"), 2);
- borntofi_adpcm_stop(machine->device("msm4"), 3);
+ borntofi_adpcm_stop(machine.device("msm1"), 0);
+ borntofi_adpcm_stop(machine.device("msm2"), 1);
+ borntofi_adpcm_stop(machine.device("msm3"), 2);
+ borntofi_adpcm_stop(machine.device("msm4"), 3);
}
static MACHINE_CONFIG_START( borntofi, fantland_state )
@@ -1053,7 +1053,7 @@ MACHINE_CONFIG_END
static void wheelrun_ym3526_irqhandler( device_t *device, int state )
{
- fantland_state *driver = device->machine->driver_data<fantland_state>();
+ fantland_state *driver = device->machine().driver_data<fantland_state>();
device_set_input_line(driver->audio_cpu, INPUT_LINE_IRQ0, state);
}
diff --git a/src/mame/drivers/fastfred.c b/src/mame/drivers/fastfred.c
index e004ba687d5..088f93c4fa1 100644
--- a/src/mame/drivers/fastfred.c
+++ b/src/mame/drivers/fastfred.c
@@ -124,25 +124,25 @@ static READ8_HANDLER( boggy84_custom_io_r )
static MACHINE_START( imago )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- gfx_element_set_source(machine->gfx[1], state->imago_sprites);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ gfx_element_set_source(machine.gfx[1], state->imago_sprites);
}
static WRITE8_HANDLER( imago_dma_irq_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, data & 1 ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, data & 1 ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE8_HANDLER( imago_sprites_bank_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
state->imago_sprites_bank = (data & 2) >> 1;
}
static WRITE8_HANDLER( imago_sprites_dma_w )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
- UINT8 *rom = (UINT8 *)space->machine->region("gfx2")->base();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
+ UINT8 *rom = (UINT8 *)space->machine().region("gfx2")->base();
UINT8 sprites_data;
sprites_data = rom[state->imago_sprites_address + 0x2000*0 + state->imago_sprites_bank * 0x1000];
@@ -154,12 +154,12 @@ static WRITE8_HANDLER( imago_sprites_dma_w )
sprites_data = rom[state->imago_sprites_address + 0x2000*2 + state->imago_sprites_bank * 0x1000];
state->imago_sprites[offset + 0x800*2] = sprites_data;
- gfx_element_mark_dirty(space->machine->gfx[1], offset/32);
+ gfx_element_mark_dirty(space->machine().gfx[1], offset/32);
}
static READ8_HANDLER( imago_sprites_offset_r )
{
- fastfred_state *state = space->machine->driver_data<fastfred_state>();
+ fastfred_state *state = space->machine().driver_data<fastfred_state>();
state->imago_sprites_address = offset;
return 0xff; //not really used
}
@@ -978,54 +978,54 @@ ROM_END
static DRIVER_INIT( flyboy )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc085, 0xc099, FUNC(flyboy_custom1_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc8fb, 0xc900, FUNC(flyboy_custom2_io_r));
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc085, 0xc099, FUNC(flyboy_custom1_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc8fb, 0xc900, FUNC(flyboy_custom2_io_r));
state->hardware_type = 1;
}
static DRIVER_INIT( flyboyb )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
state->hardware_type = 1;
}
static DRIVER_INIT( fastfred )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(fastfred_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(fastfred_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 1;
}
static DRIVER_INIT( jumpcoas )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 0;
}
static DRIVER_INIT( boggy84b )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(jumpcoas_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 2;
}
static DRIVER_INIT( boggy84 )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(boggy84_custom_io_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
+ fastfred_state *state = machine.driver_data<fastfred_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc800, 0xcfff, FUNC(boggy84_custom_io_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xc800, 0xcfff);
state->hardware_type = 2;
}
static DRIVER_INIT( imago )
{
- fastfred_state *state = machine->driver_data<fastfred_state>();
+ fastfred_state *state = machine.driver_data<fastfred_state>();
state->hardware_type = 3;
}
diff --git a/src/mame/drivers/fastlane.c b/src/mame/drivers/fastlane.c
index a62bc7010d8..c7428edbecb 100644
--- a/src/mame/drivers/fastlane.c
+++ b/src/mame/drivers/fastlane.c
@@ -20,7 +20,7 @@
static INTERRUPT_GEN( fastlane_interrupt )
{
- fastlane_state *state = device->machine->driver_data<fastlane_state>();
+ fastlane_state *state = device->machine().driver_data<fastlane_state>();
if (cpu_getiloops(device) == 0)
{
@@ -36,7 +36,7 @@ static INTERRUPT_GEN( fastlane_interrupt )
static WRITE8_HANDLER( k007121_registers_w )
{
- fastlane_state *state = space->machine->driver_data<fastlane_state>();
+ fastlane_state *state = space->machine().driver_data<fastlane_state>();
if (offset < 8)
k007121_ctrl_w(state->k007121, offset, data);
@@ -46,14 +46,14 @@ static WRITE8_HANDLER( k007121_registers_w )
static WRITE8_HANDLER( fastlane_bankswitch_w )
{
- fastlane_state *state = space->machine->driver_data<fastlane_state>();
+ fastlane_state *state = space->machine().driver_data<fastlane_state>();
/* bits 0 & 1 coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bits 2 & 3 = bank number */
- memory_set_bank(space->machine, "bank1", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank1", (data & 0x0c) >> 2);
/* bit 4: bank # for the 007232 (chip 2) */
k007232_set_bank(state->konami2, 0 + ((data & 0x10) >> 4), 2 + ((data & 0x10) >> 4));
@@ -201,13 +201,13 @@ static const k007232_interface k007232_interface_2 =
static MACHINE_START( fastlane )
{
- fastlane_state *state = machine->driver_data<fastlane_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ fastlane_state *state = machine.driver_data<fastlane_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
- state->konami2 = machine->device("konami2");
- state->k007121 = machine->device("k007121");
+ state->konami2 = machine.device("konami2");
+ state->k007121 = machine.device("k007121");
}
static MACHINE_CONFIG_START( fastlane, fastlane_state )
diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c
index 0510f8167a6..8c707fb5160 100644
--- a/src/mame/drivers/fcombat.c
+++ b/src/mame/drivers/fcombat.c
@@ -36,7 +36,7 @@ inputs + notes by stephh
static INPUT_CHANGED( coin_inserted )
{
- fcombat_state *state = field->port->machine->driver_data<fcombat_state>();
+ fcombat_state *state = field->port->machine().driver_data<fcombat_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
@@ -61,9 +61,9 @@ static READ8_HANDLER( fcombat_protection_r )
static READ8_HANDLER( fcombat_port01_r )
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
/* the cocktail flip bit muxes between ports 0 and 1 */
- return state->cocktail_flip ? input_port_read(space->machine, "IN1") : input_port_read(space->machine, "IN0");
+ return state->cocktail_flip ? input_port_read(space->machine(), "IN1") : input_port_read(space->machine(), "IN0");
}
@@ -71,19 +71,19 @@ static READ8_HANDLER( fcombat_port01_r )
static WRITE8_HANDLER(e900_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->fcombat_sh = data;
}
static WRITE8_HANDLER(ea00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->fcombat_sv = (state->fcombat_sv & 0xff00) | data;
}
static WRITE8_HANDLER(eb00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->fcombat_sv = (state->fcombat_sv & 0xff) | (data << 8);
}
@@ -92,23 +92,23 @@ static WRITE8_HANDLER(eb00_w)
static WRITE8_HANDLER(ec00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->tx = data;
}
static WRITE8_HANDLER(ed00_w)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
state->ty = data;
}
static READ8_HANDLER(e300_r)
{
- fcombat_state *state = space->machine->driver_data<fcombat_state>();
+ fcombat_state *state = space->machine().driver_data<fcombat_state>();
int wx = (state->tx + state->fcombat_sh) / 16;
int wy = (state->ty * 2 + state->fcombat_sv) / 16;
- return space->machine->region("user2")->base()[wx * 32 * 16 + wy];
+ return space->machine().region("user2")->base()[wx * 32 * 16 + wy];
}
static WRITE8_HANDLER(ee00_w)
@@ -267,9 +267,9 @@ GFXDECODE_END
static MACHINE_START( fcombat )
{
- fcombat_state *state = machine->driver_data<fcombat_state>();
+ fcombat_state *state = machine.driver_data<fcombat_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->cocktail_flip));
state->save_item(NAME(state->char_palette));
@@ -283,7 +283,7 @@ static MACHINE_START( fcombat )
static MACHINE_RESET( fcombat )
{
- fcombat_state *state = machine->driver_data<fcombat_state>();
+ fcombat_state *state = machine.driver_data<fcombat_state>();
state->cocktail_flip = 0;
state->char_palette = 0;
@@ -348,8 +348,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ dst = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -366,8 +366,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine->region("gfx2")->base();
- length = machine->region("gfx2")->bytes();
+ dst = machine.region("gfx2")->base();
+ length = machine.region("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -387,8 +387,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine->region("gfx3")->base();
- length = machine->region("gfx3")->bytes();
+ dst = machine.region("gfx3")->base();
+ length = machine.region("gfx3")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -406,8 +406,8 @@ static DRIVER_INIT( fcombat )
}
src = temp;
- dst = machine->region("user1")->base();
- length = machine->region("user1")->bytes();
+ dst = machine.region("user1")->base();
+ length = machine.region("user1")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
@@ -418,8 +418,8 @@ static DRIVER_INIT( fcombat )
src = temp;
- dst = machine->region("user2")->base();
- length = machine->region("user2")->bytes();
+ dst = machine.region("user2")->base();
+ length = machine.region("user2")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index 567c6d1482a..17c8d5b3818 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -42,7 +42,7 @@ from 2.bin to 9.bin program eproms
static WRITE16_HANDLER( fcrash_soundlatch_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
if (ACCESSING_BITS_0_7)
{
@@ -53,17 +53,17 @@ static WRITE16_HANDLER( fcrash_soundlatch_w )
static WRITE8_HANDLER( fcrash_snd_bankswitch_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->msm_1->set_output_gain(0, (data & 0x08) ? 0.0 : 1.0);
state->msm_2->set_output_gain(0, (data & 0x10) ? 0.0 : 1.0);
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static void m5205_int1( device_t *device )
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
msm5205_data_w(device, state->sample_buffer1 & 0x0f);
state->sample_buffer1 >>= 4;
@@ -74,7 +74,7 @@ static void m5205_int1( device_t *device )
static void m5205_int2( device_t *device )
{
- cps_state *state = device->machine->driver_data<cps_state>();
+ cps_state *state = device->machine().driver_data<cps_state>();
msm5205_data_w(device, state->sample_buffer2 & 0x0f);
state->sample_buffer2 >>= 4;
@@ -84,13 +84,13 @@ static void m5205_int2( device_t *device )
static WRITE8_HANDLER( fcrash_msm5205_0_data_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->sample_buffer1 = data;
}
static WRITE8_HANDLER( fcrash_msm5205_1_data_w )
{
- cps_state *state = space->machine->driver_data<cps_state>();
+ cps_state *state = space->machine().driver_data<cps_state>();
state->sample_buffer2 = data;
}
@@ -99,9 +99,9 @@ static WRITE8_HANDLER( fcrash_msm5205_1_data_w )
/* not verified */
#define CPS1_ROWSCROLL_OFFS (0x20/2) /* base of row scroll offsets in other RAM */
-static void fcrash_update_transmasks( running_machine *machine )
+static void fcrash_update_transmasks( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int i;
int priority[4];
@@ -126,9 +126,9 @@ static void fcrash_update_transmasks( running_machine *machine )
}
}
-static void fcrash_render_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void fcrash_render_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int pos;
int base = 0x50c8 / 2;
@@ -153,15 +153,15 @@ static void fcrash_render_sprites( running_machine *machine, bitmap_t *bitmap, c
colour = state->gfxram[base +pos + 1] & 0x1f;
ypos = 256 - ypos;
- pdrawgfx_transpen(bitmap, cliprect, machine->gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine->priority_bitmap, 0x02, 15);
+ pdrawgfx_transpen(bitmap, cliprect, machine.gfx[2], tileno, colour, flipx, flipy, xpos + 49, ypos - 16, machine.priority_bitmap, 0x02, 15);
}
}
-static void fcrash_render_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
+static void fcrash_render_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer, int primask )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
switch (layer)
{
@@ -176,9 +176,9 @@ static void fcrash_render_layer( running_machine *machine, bitmap_t *bitmap, con
}
}
-static void fcrash_render_high_layer( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
+static void fcrash_render_high_layer( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int layer )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
switch (layer)
{
@@ -193,9 +193,9 @@ static void fcrash_render_high_layer( running_machine *machine, bitmap_t *bitmap
}
}
-static void fcrash_build_palette( running_machine *machine )
+static void fcrash_build_palette( running_machine &machine )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
int offset;
for (offset = 0; offset < 32 * 6 * 16; offset++)
@@ -218,22 +218,22 @@ static void fcrash_build_palette( running_machine *machine )
static SCREEN_UPDATE( fcrash )
{
- cps_state *state = screen->machine->driver_data<cps_state>();
+ cps_state *state = screen->machine().driver_data<cps_state>();
int layercontrol, l0, l1, l2, l3;
int videocontrol = state->cps_a_regs[0x22 / 2];
- flip_screen_set(screen->machine, videocontrol & 0x8000);
+ flip_screen_set(screen->machine(), videocontrol & 0x8000);
layercontrol = state->cps_b_regs[0x20 / 2];
/* Get video memory base registers */
- cps1_get_video_base(screen->machine);
+ cps1_get_video_base(screen->machine());
/* Build palette */
- fcrash_build_palette(screen->machine);
+ fcrash_build_palette(screen->machine());
- fcrash_update_transmasks(screen->machine);
+ fcrash_update_transmasks(screen->machine());
tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x - 62);
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y);
@@ -270,28 +270,28 @@ static SCREEN_UPDATE( fcrash )
/* Blank screen */
bitmap_fill(bitmap, cliprect, 0xbff);
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
l0 = (layercontrol >> 0x06) & 03;
l1 = (layercontrol >> 0x08) & 03;
l2 = (layercontrol >> 0x0a) & 03;
l3 = (layercontrol >> 0x0c) & 03;
- fcrash_render_layer(screen->machine, bitmap, cliprect, l0, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l0, 0);
if (l1 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l0);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l0);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l1, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l1, 0);
if (l2 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l1);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l1);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l2, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l2, 0);
if (l3 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l2);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l2);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l3, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l3, 0);
return 0;
}
@@ -299,21 +299,21 @@ static SCREEN_UPDATE( fcrash )
// doesn't have the scroll offsets like fcrash
static SCREEN_UPDATE( kodb )
{
- cps_state *state = screen->machine->driver_data<cps_state>();
+ cps_state *state = screen->machine().driver_data<cps_state>();
int layercontrol, l0, l1, l2, l3;
int videocontrol = state->cps_a_regs[0x22 / 2];
- flip_screen_set(screen->machine, videocontrol & 0x8000);
+ flip_screen_set(screen->machine(), videocontrol & 0x8000);
layercontrol = state->cps_b_regs[0x20 / 2];
/* Get video memory base registers */
- cps1_get_video_base(screen->machine);
+ cps1_get_video_base(screen->machine());
/* Build palette */
- fcrash_build_palette(screen->machine);
+ fcrash_build_palette(screen->machine());
- fcrash_update_transmasks(screen->machine);
+ fcrash_update_transmasks(screen->machine());
tilemap_set_scrollx(state->bg_tilemap[0], 0, state->scroll1x);
tilemap_set_scrolly(state->bg_tilemap[0], 0, state->scroll1y);
@@ -351,28 +351,28 @@ static SCREEN_UPDATE( kodb )
/* Blank screen */
bitmap_fill(bitmap, cliprect, 0xbff);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
l0 = (layercontrol >> 0x06) & 03;
l1 = (layercontrol >> 0x08) & 03;
l2 = (layercontrol >> 0x0a) & 03;
l3 = (layercontrol >> 0x0c) & 03;
- fcrash_render_layer(screen->machine, bitmap, cliprect, l0, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l0, 0);
if (l1 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l0);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l0);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l1, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l1, 0);
if (l2 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l1);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l1);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l2, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l2, 0);
if (l3 == 0)
- fcrash_render_high_layer(screen->machine, bitmap, cliprect, l2);
+ fcrash_render_high_layer(screen->machine(), bitmap, cliprect, l2);
- fcrash_render_layer(screen->machine, bitmap, cliprect, l3, 0);
+ fcrash_render_layer(screen->machine(), bitmap, cliprect, l3, 0);
return 0;
}
@@ -691,15 +691,15 @@ static const msm5205_interface msm5205_interface2 =
static MACHINE_START( fcrash )
{
- cps_state *state = machine->driver_data<cps_state>();
- UINT8 *ROM = machine->region("soundcpu")->base();
+ cps_state *state = machine.driver_data<cps_state>();
+ UINT8 *ROM = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
- state->msm_1 = machine->device<msm5205_device>("msm1");
- state->msm_2 = machine->device<msm5205_device>("msm2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
+ state->msm_1 = machine.device<msm5205_device>("msm1");
+ state->msm_2 = machine.device<msm5205_device>("msm2");
state->save_item(NAME(state->sample_buffer1));
state->save_item(NAME(state->sample_buffer2));
@@ -709,15 +709,15 @@ static MACHINE_START( fcrash )
static MACHINE_START( kodb )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
}
static MACHINE_RESET( fcrash )
{
- cps_state *state = machine->driver_data<cps_state>();
+ cps_state *state = machine.driver_data<cps_state>();
state->sample_buffer1 = 0;
state->sample_buffer2 = 0;
diff --git a/src/mame/drivers/feversoc.c b/src/mame/drivers/feversoc.c
index 022d233b90a..90307718bb0 100644
--- a/src/mame/drivers/feversoc.c
+++ b/src/mame/drivers/feversoc.c
@@ -84,11 +84,11 @@ static VIDEO_START( feversoc )
static SCREEN_UPDATE( feversoc )
{
- feversoc_state *state = screen->machine->driver_data<feversoc_state>();
+ feversoc_state *state = screen->machine().driver_data<feversoc_state>();
UINT32 *spriteram32 = state->spriteram;
int offs,spr_offs,colour,sx,sy,h,w,dx,dy;
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0]); //black pen
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0]); //black pen
for(offs=(0x2000/4)-2;offs>-1;offs-=2)
{
@@ -106,7 +106,7 @@ static SCREEN_UPDATE( feversoc )
for(dx=0;dx<w;dx++)
for(dy=0;dy<h;dy++)
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],spr_offs++,colour,0,0,(sx+dx*16),(sy+dy*16),0x3f);
}
return 0;
@@ -115,27 +115,27 @@ static SCREEN_UPDATE( feversoc )
static WRITE32_HANDLER( fs_paletteram_w )
{
int r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- r = ((space->machine->generic.paletteram.u32[offset] & 0x001f0000)>>16) << 3;
- g = ((space->machine->generic.paletteram.u32[offset] & 0x03e00000)>>16) >> 2;
- b = ((space->machine->generic.paletteram.u32[offset] & 0x7c000000)>>16) >> 7;
+ r = ((space->machine().generic.paletteram.u32[offset] & 0x001f0000)>>16) << 3;
+ g = ((space->machine().generic.paletteram.u32[offset] & 0x03e00000)>>16) >> 2;
+ b = ((space->machine().generic.paletteram.u32[offset] & 0x7c000000)>>16) >> 7;
- palette_set_color(space->machine,offset*2+0,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset*2+0,MAKE_RGB(r,g,b));
- r = (space->machine->generic.paletteram.u32[offset] & 0x001f) << 3;
- g = (space->machine->generic.paletteram.u32[offset] & 0x03e0) >> 2;
- b = (space->machine->generic.paletteram.u32[offset] & 0x7c00) >> 7;
+ r = (space->machine().generic.paletteram.u32[offset] & 0x001f) << 3;
+ g = (space->machine().generic.paletteram.u32[offset] & 0x03e0) >> 2;
+ b = (space->machine().generic.paletteram.u32[offset] & 0x7c00) >> 7;
- palette_set_color(space->machine,offset*2+1,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset*2+1,MAKE_RGB(r,g,b));
}
static READ32_HANDLER( in0_r )
{
- feversoc_state *state = space->machine->driver_data<feversoc_state>();
+ feversoc_state *state = space->machine().driver_data<feversoc_state>();
state->x^=0x40; //vblank? eeprom read bit?
- return (input_port_read(space->machine, "IN0") | state->x) | (input_port_read(space->machine, "IN1")<<16);
+ return (input_port_read(space->machine(), "IN0") | state->x) | (input_port_read(space->machine(), "IN1")<<16);
}
static WRITE32_HANDLER( output_w )
@@ -143,19 +143,19 @@ static WRITE32_HANDLER( output_w )
if(ACCESSING_BITS_16_31)
{
/* probably eeprom stuff too */
- coin_lockout_w(space->machine, 0,~data>>16 & 0x40);
- coin_lockout_w(space->machine, 1,~data>>16 & 0x40);
- coin_counter_w(space->machine, 0,data>>16 & 1);
+ coin_lockout_w(space->machine(), 0,~data>>16 & 0x40);
+ coin_lockout_w(space->machine(), 1,~data>>16 & 0x40);
+ coin_counter_w(space->machine(), 0,data>>16 & 1);
//data>>16 & 2 coin out
- coin_counter_w(space->machine, 1,data>>16 & 4);
+ coin_counter_w(space->machine(), 1,data>>16 & 4);
//data>>16 & 8 coin hopper
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base(0x40000 * (((data>>16) & 0x20)>>5));
}
if(ACCESSING_BITS_0_15)
{
/* -xxx xxxx lamps*/
- coin_counter_w(space->machine, 2,data & 0x2000); //key in
+ coin_counter_w(space->machine(), 2,data & 0x2000); //key in
//data & 0x4000 key out
}
}
@@ -244,7 +244,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( feversoc_irq )
{
- cputag_set_input_line(device->machine, "maincpu", 8, HOLD_LINE );
+ cputag_set_input_line(device->machine(), "maincpu", 8, HOLD_LINE );
}
static MACHINE_CONFIG_START( feversoc, feversoc_state )
@@ -296,7 +296,7 @@ ROM_END
static DRIVER_INIT( feversoc )
{
- seibuspi_rise11_sprite_decrypt_feversoc(machine->region("gfx1")->base(), 0x200000);
+ seibuspi_rise11_sprite_decrypt_feversoc(machine.region("gfx1")->base(), 0x200000);
}
GAME( 2004, feversoc, 0, feversoc, feversoc, feversoc, ROT0, "Seibu Kaihatsu", "Fever Soccer", 0 )
diff --git a/src/mame/drivers/fgoal.c b/src/mame/drivers/fgoal.c
index 78ea5492974..142a8a4bd44 100644
--- a/src/mame/drivers/fgoal.c
+++ b/src/mame/drivers/fgoal.c
@@ -70,7 +70,7 @@ static PALETTE_INIT( fgoal )
static TIMER_CALLBACK( interrupt_callback )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
int scanline;
int coin = (input_port_read(machine, "IN1") & 2);
@@ -81,39 +81,39 @@ static TIMER_CALLBACK( interrupt_callback )
state->prev_coin = coin;
- scanline = machine->primary_screen->vpos() + 128;
+ scanline = machine.primary_screen->vpos() + 128;
if (scanline > 256)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(interrupt_callback));
}
-static unsigned video_ram_address( running_machine *machine )
+static unsigned video_ram_address( running_machine &machine )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
return 0x4000 | (state->row << 5) | (state->col >> 3);
}
static READ8_HANDLER( fgoal_analog_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
- return input_port_read(space->machine, state->fgoal_player ? "PADDLE1" : "PADDLE0"); /* PCB can be jumpered to use a single dial */
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
+ return input_port_read(space->machine(), state->fgoal_player ? "PADDLE1" : "PADDLE0"); /* PCB can be jumpered to use a single dial */
}
static CUSTOM_INPUT( fgoal_80_r )
{
- UINT8 ret = (field->port->machine->primary_screen->vpos() & 0x80) ? 1 : 0;
+ UINT8 ret = (field->port->machine().primary_screen->vpos() & 0x80) ? 1 : 0;
return ret;
}
static READ8_HANDLER( fgoal_nmi_reset_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
device_set_input_line(state->maincpu, INPUT_LINE_NMI, CLEAR_LINE);
return 0;
@@ -122,7 +122,7 @@ static READ8_HANDLER( fgoal_nmi_reset_r )
static READ8_HANDLER( fgoal_irq_reset_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
return 0;
@@ -131,14 +131,14 @@ static READ8_HANDLER( fgoal_irq_reset_r )
static READ8_HANDLER( fgoal_row_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
return state->row;
}
static WRITE8_HANDLER( fgoal_row_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->row = data;
mb14241_shift_data_w(state->mb14241, 0, 0);
@@ -146,7 +146,7 @@ static WRITE8_HANDLER( fgoal_row_w )
static WRITE8_HANDLER( fgoal_col_w )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->col = data;
mb14241_shift_count_w(state->mb14241, 0, data);
@@ -154,17 +154,17 @@ static WRITE8_HANDLER( fgoal_col_w )
static READ8_HANDLER( fgoal_address_hi_r )
{
- return video_ram_address(space->machine) >> 8;
+ return video_ram_address(space->machine()) >> 8;
}
static READ8_HANDLER( fgoal_address_lo_r )
{
- return video_ram_address(space->machine) & 0xff;
+ return video_ram_address(space->machine()) & 0xff;
}
static READ8_HANDLER( fgoal_shifter_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
UINT8 v = mb14241_shift_result_r(state->mb14241, 0);
return BITSWAP8(v, 7, 6, 5, 4, 3, 2, 1, 0);
@@ -172,7 +172,7 @@ static READ8_HANDLER( fgoal_shifter_r )
static READ8_HANDLER( fgoal_shifter_reverse_r )
{
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
UINT8 v = mb14241_shift_result_r(state->mb14241, 0);
return BITSWAP8(v, 0, 1, 2, 3, 4, 5, 6, 7);
@@ -200,7 +200,7 @@ static WRITE8_HANDLER( fgoal_sound2_w )
/* BIT3 => SX5 */
/* BIT4 => SX4 */
/* BIT5 => SX3 */
- fgoal_state *state = space->machine->driver_data<fgoal_state>();
+ fgoal_state *state = space->machine().driver_data<fgoal_state>();
state->fgoal_player = data & 1;
}
@@ -338,10 +338,10 @@ GFXDECODE_END
static MACHINE_START( fgoal )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
- state->maincpu = machine->device("maincpu");
- state->mb14241 = machine->device("mb14241");
+ state->maincpu = machine.device("maincpu");
+ state->mb14241 = machine.device("mb14241");
state->save_item(NAME(state->xpos));
state->save_item(NAME(state->ypos));
@@ -354,9 +354,9 @@ static MACHINE_START( fgoal )
static MACHINE_RESET( fgoal )
{
- fgoal_state *state = machine->driver_data<fgoal_state>();
+ fgoal_state *state = machine.driver_data<fgoal_state>();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(interrupt_callback));
state->xpos = 0;
state->ypos = 0;
diff --git a/src/mame/drivers/finalizr.c b/src/mame/drivers/finalizr.c
index 7722efb2452..a493fd7a45e 100644
--- a/src/mame/drivers/finalizr.c
+++ b/src/mame/drivers/finalizr.c
@@ -23,7 +23,7 @@
static INTERRUPT_GEN( finalizr_interrupt )
{
- finalizr_state *state = device->machine->driver_data<finalizr_state>();
+ finalizr_state *state = device->machine().driver_data<finalizr_state>();
if (cpu_getiloops(device) == 0)
{
@@ -39,28 +39,28 @@ static INTERRUPT_GEN( finalizr_interrupt )
static WRITE8_HANDLER( finalizr_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE8_HANDLER( finalizr_flipscreen_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, ~data & 0x08);
+ flip_screen_set(space->machine(), ~data & 0x08);
}
static WRITE8_HANDLER( finalizr_i8039_irq_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
device_set_input_line(state->audio_cpu, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( i8039_irqen_w )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
/* bit 0x80 goes active low, indicating that the
external IRQ being serviced is complete
@@ -73,7 +73,7 @@ static WRITE8_HANDLER( i8039_irqen_w )
static READ8_HANDLER( i8039_T1_r )
{
- finalizr_state *state = space->machine->driver_data<finalizr_state>();
+ finalizr_state *state = space->machine().driver_data<finalizr_state>();
/* I suspect the clock-out from the I8039 T0 line should be connected
here (See the i8039_T0_w handler below).
@@ -245,9 +245,9 @@ GFXDECODE_END
static MACHINE_START( finalizr )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
- state->audio_cpu = machine->device("audiocpu");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->spriterambank));
state->save_item(NAME(state->charbank));
@@ -258,7 +258,7 @@ static MACHINE_START( finalizr )
static MACHINE_RESET( finalizr )
{
- finalizr_state *state = machine->driver_data<finalizr_state>();
+ finalizr_state *state = machine.driver_data<finalizr_state>();
state->spriterambank = 0;
state->charbank = 0;
diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c
index ecf73582a15..3a0a522d33a 100644
--- a/src/mame/drivers/firebeat.c
+++ b/src/mame/drivers/firebeat.c
@@ -184,7 +184,7 @@ public:
static VIDEO_START(firebeat)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
state->gcu[0].vram = auto_alloc_array(machine, UINT32, 0x2000000/4);
state->gcu[1].vram = auto_alloc_array(machine, UINT32, 0x2000000/4);
memset(state->gcu[0].vram, 0, 0x2000000);
@@ -192,9 +192,9 @@ static VIDEO_START(firebeat)
}
-static void gcu_draw_object(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
+static void gcu_draw_object(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
// 0x00: xxx----- -------- -------- -------- command type
// 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx object data address in vram
@@ -393,9 +393,9 @@ static void gcu_fill_rect(bitmap_t *bitmap, const rectangle *cliprect, UINT32 *c
}
}
-static void gcu_draw_character(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
+static void gcu_draw_character(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 *cmd)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
// 0x00: xxx----- -------- -------- -------- command type
// 0x00: -------- xxxxxxxx xxxxxxxx xxxxxxxx character data address in vram
@@ -442,9 +442,9 @@ static void gcu_draw_character(running_machine *machine, bitmap_t *bitmap, const
}
}
-static void gcu_exec_display_list(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 address)
+static void gcu_exec_display_list(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int chip, UINT32 address)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int counter = 0;
int end = 0;
@@ -515,39 +515,39 @@ static void gcu_exec_display_list(running_machine *machine, bitmap_t *bitmap, co
static SCREEN_UPDATE(firebeat)
{
- firebeat_state *state = screen->machine->driver_data<firebeat_state>();
+ firebeat_state *state = screen->machine().driver_data<firebeat_state>();
int chip;
- if (screen == screen->machine->m_devicelist.find(SCREEN, 0))
+ if (screen == screen->machine().m_devicelist.find(SCREEN, 0))
chip = 0;
else
chip = 1;
bitmap_fill(bitmap, cliprect, 0);
- if (mame_stricmp(screen->machine->system().name, "popn7") == 0)
+ if (mame_stricmp(screen->machine().system().name, "popn7") == 0)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1f80000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1f80000);
}
else
{
if (state->layer >= 2)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x8000);
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x0000);
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x10000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x8000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x0000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x10000);
}
else if (state->layer == 0)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x200000);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x200000);
- //gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x186040);
+ //gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x186040);
}
else if (state->layer == 1)
{
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1d0800);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1d0800);
- gcu_exec_display_list(screen->machine, bitmap, cliprect, chip, 0x1a9440);
+ gcu_exec_display_list(screen->machine(), bitmap, cliprect, chip, 0x1a9440);
}
}
@@ -555,7 +555,7 @@ static SCREEN_UPDATE(firebeat)
if (state->tick >= 5)
{
state->tick = 0;
- if (input_code_pressed(screen->machine, KEYCODE_0))
+ if (input_code_pressed(screen->machine(), KEYCODE_0))
{
state->layer++;
if (state->layer > 2)
@@ -565,7 +565,7 @@ static SCREEN_UPDATE(firebeat)
}
/*
- if (input_code_pressed_once(screen->machine, KEYCODE_9))
+ if (input_code_pressed_once(screen->machine(), KEYCODE_9))
{
FILE *file = fopen("vram0.bin", "wb");
int i;
@@ -597,9 +597,9 @@ static SCREEN_UPDATE(firebeat)
return 0;
}
-static UINT32 GCU_r(running_machine *machine, int chip, UINT32 offset, UINT32 mem_mask)
+static UINT32 GCU_r(running_machine &machine, int chip, UINT32 offset, UINT32 mem_mask)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int reg = offset * 4;
/* VRAM Read */
@@ -621,14 +621,14 @@ static UINT32 GCU_r(running_machine *machine, int chip, UINT32 offset, UINT32 me
return 0xffffffff;
}
-static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data, UINT32 mem_mask)
+static void GCU_w(running_machine &machine, int chip, UINT32 offset, UINT32 data, UINT32 mem_mask)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int reg = offset * 4;
if (reg != 0x70 && chip == 0)
{
- //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", machine->describe_context(), chip, data, offset, mem_mask);
+ //printf("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", machine.describe_context(), chip, data, offset, mem_mask);
//logerror("%s:gcu%d_w: %08X, %08X, %08X at %08X\n", cmachine->describe_context(), hip, data, offset, mem_mask);
}
@@ -649,7 +649,7 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data
COMBINE_DATA( &state->gcu[chip].visible_area );
if (ACCESSING_BITS_0_15)
{
- screen_device *screen = downcast<screen_device *>(machine->m_devicelist.find(SCREEN, chip));
+ screen_device *screen = downcast<screen_device *>(machine.m_devicelist.find(SCREEN, chip));
if (screen != NULL)
{
@@ -702,22 +702,22 @@ static void GCU_w(running_machine *machine, int chip, UINT32 offset, UINT32 data
static READ32_HANDLER(gcu0_r)
{
- return GCU_r(space->machine, 0, offset, mem_mask);
+ return GCU_r(space->machine(), 0, offset, mem_mask);
}
static WRITE32_HANDLER(gcu0_w)
{
- GCU_w(space->machine, 0, offset, data, mem_mask);
+ GCU_w(space->machine(), 0, offset, data, mem_mask);
}
static READ32_HANDLER(gcu1_r)
{
- return GCU_r(space->machine, 1, offset, mem_mask);
+ return GCU_r(space->machine(), 1, offset, mem_mask);
}
static WRITE32_HANDLER(gcu1_w)
{
- GCU_w(space->machine, 1, offset, data, mem_mask);
+ GCU_w(space->machine(), 1, offset, data, mem_mask);
}
/*****************************************************************************/
@@ -728,15 +728,15 @@ static READ32_HANDLER(input_r)
if (ACCESSING_BITS_24_31)
{
- r |= (input_port_read(space->machine, "IN0") & 0xff) << 24;
+ r |= (input_port_read(space->machine(), "IN0") & 0xff) << 24;
}
if (ACCESSING_BITS_8_15)
{
- r |= (input_port_read(space->machine, "IN1") & 0xff) << 8;
+ r |= (input_port_read(space->machine(), "IN1") & 0xff) << 8;
}
if (ACCESSING_BITS_0_7)
{
- r |= (input_port_read(space->machine, "IN2") & 0xff);
+ r |= (input_port_read(space->machine(), "IN2") & 0xff);
}
return r;
@@ -746,17 +746,17 @@ static READ32_HANDLER( sensor_r )
{
if (offset == 0)
{
- return input_port_read(space->machine, "SENSOR1") | 0x01000100;
+ return input_port_read(space->machine(), "SENSOR1") | 0x01000100;
}
else
{
- return input_port_read(space->machine, "SENSOR2") | 0x01000100;
+ return input_port_read(space->machine(), "SENSOR2") | 0x01000100;
}
}
static READ32_HANDLER(flashram_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
{
@@ -779,7 +779,7 @@ static READ32_HANDLER(flashram_r)
static WRITE32_HANDLER(flashram_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
if (ACCESSING_BITS_24_31)
{
state->flash[0]->write((offset*4)+0, (data >> 24) & 0xff);
@@ -800,7 +800,7 @@ static WRITE32_HANDLER(flashram_w)
static READ32_HANDLER(soundflash_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
fujitsu_29f016a_device *chip;
if (offset >= 0 && offset < 0x200000/4)
@@ -835,7 +835,7 @@ static READ32_HANDLER(soundflash_r)
static WRITE32_HANDLER(soundflash_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
fujitsu_29f016a_device *chip;
if (offset >= 0 && offset < 0x200000/4)
{
@@ -902,12 +902,12 @@ static WRITE32_HANDLER(soundflash_w)
#define ATAPI_REG_CMDSTATUS 7
-static void atapi_cause_irq(running_machine *machine)
+static void atapi_cause_irq(running_machine &machine)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ4, ASSERT_LINE);
}
-static void atapi_clear_irq(running_machine *machine)
+static void atapi_clear_irq(running_machine &machine)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ4, CLEAR_LINE);
}
@@ -919,9 +919,9 @@ static void atapi_exit(running_machine& machine)
SCSIDeleteInstance(state->atapi_device_data[0]);
}
-static void atapi_init(running_machine *machine)
+static void atapi_init(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
memset(state->atapi_regs, 0, sizeof(state->atapi_regs));
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -936,12 +936,12 @@ static void atapi_init(running_machine *machine)
SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &state->atapi_device_data[0], "scsi0" );
// TODO: the slave drive can be either CD-ROM, DVD-ROM or HDD
SCSIAllocInstance( machine, SCSI_DEVICE_CDROM, &state->atapi_device_data[1], "scsi1" );
- machine->add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
}
-static void atapi_reset(running_machine *machine)
+static void atapi_reset(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
logerror("ATAPI reset\n");
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -955,9 +955,9 @@ static void atapi_reset(running_machine *machine)
-static UINT16 atapi_command_reg_r(running_machine *machine, int reg)
+static UINT16 atapi_command_reg_r(running_machine &machine, int reg)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int i, data;
// printf("ATAPI: Command reg read %d\n", reg);
@@ -1018,14 +1018,14 @@ static UINT16 atapi_command_reg_r(running_machine *machine, int reg)
}
}
-static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data)
+static void atapi_command_reg_w(running_machine &machine, int reg, UINT16 data)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int i;
if (reg == ATAPI_REG_DATA)
{
-// printf("%s:ATAPI: packet write %04x\n", device->machine->describe_context(), data);
+// printf("%s:ATAPI: packet write %04x\n", device->machine().describe_context(), data);
state->atapi_data[state->atapi_data_ptr] = data;
state->atapi_data_ptr++;
@@ -1175,9 +1175,9 @@ static void atapi_command_reg_w(running_machine *machine, int reg, UINT16 data)
}
}
-static UINT16 atapi_control_reg_r(running_machine *machine, int reg)
+static UINT16 atapi_control_reg_r(running_machine &machine, int reg)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
UINT16 value;
switch(reg)
{
@@ -1199,7 +1199,7 @@ static UINT16 atapi_control_reg_r(running_machine *machine, int reg)
return 0;
}
-static void atapi_control_reg_w(running_machine *machine, int reg, UINT16 data)
+static void atapi_control_reg_w(running_machine &machine, int reg, UINT16 data)
{
switch(reg)
{
@@ -1225,12 +1225,12 @@ static READ32_HANDLER( atapi_command_r )
// printf("atapi_command_r: %08X, %08X\n", offset, mem_mask);
if (ACCESSING_BITS_16_31)
{
- r = atapi_command_reg_r(space->machine, offset*2);
+ r = atapi_command_reg_r(space->machine(), offset*2);
return ATAPI_ENDIAN(r) << 16;
}
else
{
- r = atapi_command_reg_r(space->machine, (offset*2) + 1);
+ r = atapi_command_reg_r(space->machine(), (offset*2) + 1);
return ATAPI_ENDIAN(r) << 0;
}
}
@@ -1241,11 +1241,11 @@ static WRITE32_HANDLER( atapi_command_w )
if (ACCESSING_BITS_16_31)
{
- atapi_command_reg_w(space->machine, offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
+ atapi_command_reg_w(space->machine(), offset*2, ATAPI_ENDIAN((data >> 16) & 0xffff));
}
else
{
- atapi_command_reg_w(space->machine, (offset*2) + 1, ATAPI_ENDIAN((data >> 0) & 0xffff));
+ atapi_command_reg_w(space->machine(), (offset*2) + 1, ATAPI_ENDIAN((data >> 0) & 0xffff));
}
}
@@ -1257,12 +1257,12 @@ static READ32_HANDLER( atapi_control_r )
if (ACCESSING_BITS_16_31)
{
- r = atapi_control_reg_r(space->machine, offset*2);
+ r = atapi_control_reg_r(space->machine(), offset*2);
return ATAPI_ENDIAN(r) << 16;
}
else
{
- r = atapi_control_reg_r(space->machine, (offset*2) + 1);
+ r = atapi_control_reg_r(space->machine(), (offset*2) + 1);
return ATAPI_ENDIAN(r) << 0;
}
}
@@ -1271,11 +1271,11 @@ static WRITE32_HANDLER( atapi_control_w )
{
if (ACCESSING_BITS_16_31)
{
- atapi_control_reg_w(space->machine, offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
+ atapi_control_reg_w(space->machine(), offset*2, ATAPI_ENDIAN(data >> 16) & 0xff);
}
else
{
- atapi_control_reg_w(space->machine, (offset*2) + 1, ATAPI_ENDIAN(data >> 0) & 0xff);
+ atapi_control_reg_w(space->machine(), (offset*2) + 1, ATAPI_ENDIAN(data >> 0) & 0xff);
}
}
@@ -1326,7 +1326,7 @@ static WRITE32_HANDLER( comm_uart_w )
}
}
-static void comm_uart_irq_callback(running_machine *machine, int channel, int value)
+static void comm_uart_irq_callback(running_machine &machine, int channel, int value)
{
// TODO
//cputag_set_input_line(machine, "maincpu", INPUT_LINE_IRQ2, ASSERT_LINE);
@@ -1340,7 +1340,7 @@ static const int ppd_cab_data[2] = { 0x1, 0x9 };
static READ32_HANDLER( cabinet_r )
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
// printf("cabinet_r: %08X, %08X\n", offset, mem_mask);
@@ -1366,11 +1366,11 @@ static READ32_HANDLER( keyboard_wheel_r )
{
if (offset == 0) // Keyboard Wheel (P1)
{
- return input_port_read(space->machine, "WHEEL_P1") << 24;
+ return input_port_read(space->machine(), "WHEEL_P1") << 24;
}
else if (offset == 2) // Keyboard Wheel (P2)
{
- return input_port_read(space->machine, "WHEEL_P2") << 24;
+ return input_port_read(space->machine(), "WHEEL_P2") << 24;
}
return 0;
@@ -1396,9 +1396,9 @@ static WRITE32_HANDLER( midi_uart_w )
}
}
-static void midi_uart_irq_callback(running_machine *machine, int channel, int value)
+static void midi_uart_irq_callback(running_machine &machine, int channel, int value)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
if (channel == 0)
{
if ((state->extend_board_irq_enable & 0x02) == 0 && value != CLEAR_LINE)
@@ -1452,7 +1452,7 @@ static const int keyboard_notes[24] =
static TIMER_CALLBACK( keyboard_timer_callback )
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
static const int kb_uart_channel[2] = { 1, 0 };
static const char *const keynames[] = { "KEYBOARD_P1", "KEYBOARD_P2" };
int keyboard;
@@ -1505,7 +1505,7 @@ static TIMER_CALLBACK( keyboard_timer_callback )
static READ32_HANDLER( extend_board_irq_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
@@ -1518,7 +1518,7 @@ static READ32_HANDLER( extend_board_irq_r)
static WRITE32_HANDLER( extend_board_irq_w )
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
// printf("extend_board_irq_w: %08X, %08X, %08X\n", data, offset, mem_mask);
if (ACCESSING_BITS_24_31)
@@ -1672,7 +1672,7 @@ static WRITE32_HANDLER( lamp_output3_ppp_w )
static READ32_HANDLER(ppc_spu_share_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
UINT32 r = 0;
if (ACCESSING_BITS_24_31)
@@ -1697,7 +1697,7 @@ static READ32_HANDLER(ppc_spu_share_r)
static WRITE32_HANDLER(ppc_spu_share_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
if (ACCESSING_BITS_24_31)
{
state->spu_shared_ram[(offset * 4) + 0] = (data >> 24) & 0xff;
@@ -1719,13 +1719,13 @@ static WRITE32_HANDLER(ppc_spu_share_w)
#ifdef UNUSED_FUNCTION
static READ16_HANDLER(m68k_spu_share_r)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
return state->spu_shared_ram[offset] << 8;
}
static WRITE16_HANDLER(m68k_spu_share_w)
{
- firebeat_state *state = space->machine->driver_data<firebeat_state>();
+ firebeat_state *state = space->machine().driver_data<firebeat_state>();
state->spu_shared_ram[offset] = (data >> 8) & 0xff;
}
#endif
@@ -1739,16 +1739,16 @@ static READ16_HANDLER(spu_unk_r)
static MACHINE_START( firebeat )
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->work_ram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x01ffffff, FALSE, state->work_ram);
- state->flash[0] = machine->device<fujitsu_29f016a_device>("flash0");
- state->flash[1] = machine->device<fujitsu_29f016a_device>("flash1");
- state->flash[2] = machine->device<fujitsu_29f016a_device>("flash2");
+ state->flash[0] = machine.device<fujitsu_29f016a_device>("flash0");
+ state->flash[1] = machine.device<fujitsu_29f016a_device>("flash1");
+ state->flash[2] = machine.device<fujitsu_29f016a_device>("flash2");
}
static ADDRESS_MAP_START( firebeat_map, AS_PROGRAM, 32 )
@@ -1784,7 +1784,7 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( soundram_r )
{
- firebeat_state *state = device->machine->driver_data<firebeat_state>();
+ firebeat_state *state = device->machine().driver_data<firebeat_state>();
if (offset >= 0 && offset < 0x200000)
{
return state->flash[1]->read(offset & 0x1fffff);
@@ -1954,10 +1954,10 @@ static INTERRUPT_GEN(firebeat_interrupt)
static MACHINE_RESET( firebeat )
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
void *cd;
int i;
- UINT8 *sound = machine->region("ymz")->base();
+ UINT8 *sound = machine.region("ymz")->base();
for (i=0; i < 0x200000; i++)
{
@@ -1966,7 +1966,7 @@ static MACHINE_RESET( firebeat )
}
SCSIGetDevice( state->atapi_device_data[1], &cd );
- cdda_set_cdrom(machine->device("cdda"), cd);
+ cdda_set_cdrom(machine.device("cdda"), cd);
}
static MACHINE_CONFIG_START( firebeat, firebeat_state )
@@ -2109,9 +2109,9 @@ static void set_ibutton(firebeat_state *state, UINT8 *data)
}
}
-static int ibutton_w(running_machine *machine, UINT8 data)
+static int ibutton_w(running_machine &machine, UINT8 data)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
int r = -1;
switch (state->ibutton_state)
@@ -2203,28 +2203,28 @@ static int ibutton_w(running_machine *machine, UINT8 data)
static void security_w(device_t *device, UINT8 data)
{
- int r = ibutton_w(device->machine, data);
+ int r = ibutton_w(device->machine(), data);
if (r >= 0)
- ppc4xx_spu_receive_byte(device->machine->device("maincpu"), r);
+ ppc4xx_spu_receive_byte(device->machine().device("maincpu"), r);
}
/*****************************************************************************/
-static void init_lights(running_machine *machine, write32_space_func out1, write32_space_func out2, write32_space_func out3)
+static void init_lights(running_machine &machine, write32_space_func out1, write32_space_func out2, write32_space_func out3)
{
if(!out1) out1 = lamp_output_w;
if(!out2) out1 = lamp_output2_w;
if(!out3) out1 = lamp_output3_w;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000804, 0x7d000807, FUNC(out1));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000320, 0x7d000323, FUNC(out2));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000324, 0x7d000327, FUNC(out3));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000804, 0x7d000807, FUNC(out1));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000320, 0x7d000323, FUNC(out2));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x7d000324, 0x7d000327, FUNC(out3));
}
-static void init_firebeat(running_machine *machine)
+static void init_firebeat(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
- UINT8 *rom = machine->region("user2")->base();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
+ UINT8 *rom = machine.region("user2")->base();
atapi_init(machine);
@@ -2236,7 +2236,7 @@ static void init_firebeat(running_machine *machine)
state->cur_cab_data = cab_data;
- ppc4xx_spu_set_tx_handler(machine->device("maincpu"), security_w);
+ ppc4xx_spu_set_tx_handler(machine.device("maincpu"), security_w);
set_ibutton(state, rom);
@@ -2251,24 +2251,24 @@ static DRIVER_INIT(ppp)
static DRIVER_INIT(ppd)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
init_firebeat(machine);
init_lights(machine, lamp_output_ppp_w, lamp_output2_ppp_w, lamp_output3_ppp_w);
state->cur_cab_data = ppd_cab_data;
}
-static void init_keyboard(running_machine *machine)
+static void init_keyboard(running_machine &machine)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
// set keyboard timer
- state->keyboard_timer = machine->scheduler().timer_alloc(FUNC(keyboard_timer_callback));
+ state->keyboard_timer = machine.scheduler().timer_alloc(FUNC(keyboard_timer_callback));
state->keyboard_timer->adjust(attotime::from_msec(10), 0, attotime::from_msec(10));
}
static DRIVER_INIT(kbm)
{
- firebeat_state *state = machine->driver_data<firebeat_state>();
+ firebeat_state *state = machine.driver_data<firebeat_state>();
init_firebeat(machine);
init_lights(machine, lamp_output_kbm_w, NULL, NULL);
diff --git a/src/mame/drivers/firefox.c b/src/mame/drivers/firefox.c
index 7734a87f9d7..92af885ed31 100644
--- a/src/mame/drivers/firefox.c
+++ b/src/mame/drivers/firefox.c
@@ -89,7 +89,7 @@ fffe=reset e7cc
*/
static READ8_HANDLER( firefox_disc_status_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
UINT8 result = 0xff;
result ^= 0x20;
@@ -105,7 +105,7 @@ static READ8_HANDLER( firefox_disc_status_r )
/* this reset RDDSK (&DSKRD) */
static READ8_HANDLER( firefox_disc_data_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
return state->m_n_disc_read_data;
}
@@ -113,31 +113,31 @@ static READ8_HANDLER( firefox_disc_data_r )
/* 4218 - DSKREAD, set RDDSK */
static WRITE8_HANDLER( firefox_disc_read_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->m_n_disc_read_data = laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER( firefox_disc_lock_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->m_n_disc_lock = data & 0x80;
}
static WRITE8_HANDLER( audio_enable_w )
{
- space->machine->device<laserdisc_sound_device>("ldsound")->set_output_gain(~offset & 1, (data & 0x80) ? 1.0 : 0.0);
+ space->machine().device<laserdisc_sound_device>("ldsound")->set_output_gain(~offset & 1, (data & 0x80) ? 1.0 : 0.0);
}
static WRITE8_HANDLER( firefox_disc_reset_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
laserdisc_line_w(state->laserdisc, LASERDISC_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
/* active low on dbb7 */
static WRITE8_HANDLER( firefox_disc_write_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
if ( ( data & 0x80 ) == 0 )
laserdisc_data_w(state->laserdisc, state->m_n_disc_data);
}
@@ -145,7 +145,7 @@ static WRITE8_HANDLER( firefox_disc_write_w )
/* latch the data */
static WRITE8_HANDLER( firefox_disc_data_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->m_n_disc_data = data;
}
@@ -160,14 +160,14 @@ static WRITE8_HANDLER( firefox_disc_data_w )
static TILE_GET_INFO( bgtile_get_info )
{
- firefox_state *state = machine->driver_data<firefox_state>();
+ firefox_state *state = machine.driver_data<firefox_state>();
SET_TILE_INFO(0, state->tileram[tile_index], 0, 0);
}
static WRITE8_HANDLER( tileram_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->tileram[offset] = data;
tilemap_mark_tile_dirty(state->bgtiles, offset);
}
@@ -175,20 +175,20 @@ static WRITE8_HANDLER( tileram_w )
static VIDEO_START( firefox )
{
- firefox_state *state = machine->driver_data<firefox_state>();
+ firefox_state *state = machine.driver_data<firefox_state>();
state->bgtiles = tilemap_create(machine, bgtile_get_info, tilemap_scan_rows, 8,8, 64,64);
tilemap_set_transparent_pen(state->bgtiles, 0);
- tilemap_set_scrolldy(state->bgtiles, machine->primary_screen->visible_area().min_y, 0);
+ tilemap_set_scrolldy(state->bgtiles, machine.primary_screen->visible_area().min_y, 0);
}
static SCREEN_UPDATE( firefox )
{
- firefox_state *state = screen->machine->driver_data<firefox_state>();
+ firefox_state *state = screen->machine().driver_data<firefox_state>();
int sprite;
int gfxtop = screen->visible_area().min_y;
- bitmap_fill( bitmap, cliprect, palette_get_color(screen->machine, 256) );
+ bitmap_fill( bitmap, cliprect, palette_get_color(screen->machine(), 256) );
for( sprite = 0; sprite < 32; sprite++ )
{
@@ -208,7 +208,7 @@ static SCREEN_UPDATE( firefox )
int flipx = flags & 0x20;
int code = sprite_data[ 15 - row ] + ( 256 * ( ( flags >> 6 ) & 3 ) );
- drawgfx_transpen( bitmap, cliprect, screen->machine->gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
+ drawgfx_transpen( bitmap, cliprect, screen->machine().gfx[ 1 ], code, color, flipx, flipy, x + 8, gfxtop + 500 - y - ( row * 16 ), 0 );
}
}
}
@@ -220,12 +220,12 @@ static SCREEN_UPDATE( firefox )
static TIMER_DEVICE_CALLBACK( video_timer_callback )
{
- timer.machine->primary_screen->update_now();
+ timer.machine().primary_screen->update_now();
- cputag_set_input_line( timer.machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE );
+ cputag_set_input_line( timer.machine(), "maincpu", M6809_IRQ_LINE, ASSERT_LINE );
}
-static void set_rgba( running_machine *machine, int start, int index, unsigned char *palette_ram )
+static void set_rgba( running_machine &machine, int start, int index, unsigned char *palette_ram )
{
int r = palette_ram[ index ];
int g = palette_ram[ index + 256 ];
@@ -237,21 +237,21 @@ static void set_rgba( running_machine *machine, int start, int index, unsigned c
static WRITE8_HANDLER( tile_palette_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->tile_palette[ offset ] = data;
- set_rgba( space->machine, 0, offset & 0xff, state->tile_palette );
+ set_rgba( space->machine(), 0, offset & 0xff, state->tile_palette );
}
static WRITE8_HANDLER( sprite_palette_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sprite_palette[ offset ] = data;
- set_rgba( space->machine, 256, offset & 0xff, state->sprite_palette );
+ set_rgba( space->machine(), 256, offset & 0xff, state->sprite_palette );
}
static WRITE8_HANDLER( firefox_objram_bank_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sprite_bank = data & 0x03;
}
@@ -265,49 +265,49 @@ static WRITE8_HANDLER( firefox_objram_bank_w )
static CUSTOM_INPUT( mainflag_r )
{
- firefox_state *state = field->port->machine->driver_data<firefox_state>();
+ firefox_state *state = field->port->machine().driver_data<firefox_state>();
return state->main_to_sound_flag;
}
static CUSTOM_INPUT( soundflag_r )
{
- firefox_state *state = field->port->machine->driver_data<firefox_state>();
+ firefox_state *state = field->port->machine().driver_data<firefox_state>();
return state->sound_to_main_flag;
}
static READ8_HANDLER( sound_to_main_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sound_to_main_flag = 0;
return soundlatch2_r(space, 0);
}
static WRITE8_HANDLER( main_to_sound_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->main_to_sound_flag = 1;
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( sound_reset_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
+ firefox_state *state = space->machine().driver_data<firefox_state>();
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? ASSERT_LINE : CLEAR_LINE);
if ((data & 0x80) != 0)
state->sound_to_main_flag = state->main_to_sound_flag = 0;
}
static READ8_HANDLER( main_to_sound_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->main_to_sound_flag = 0;
return soundlatch_r(space, 0);
}
static WRITE8_HANDLER( sound_to_main_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->sound_to_main_flag = 1;
soundlatch2_w(space, 0, data);
}
@@ -322,7 +322,7 @@ static WRITE8_HANDLER( sound_to_main_w )
static READ8_DEVICE_HANDLER( riot_porta_r )
{
- firefox_state *state = device->machine->driver_data<firefox_state>();
+ firefox_state *state = device->machine().driver_data<firefox_state>();
/* bit 7 = MAINFLAG */
/* bit 6 = SOUNDFLAG */
/* bit 5 = PA5 */
@@ -337,7 +337,7 @@ static READ8_DEVICE_HANDLER( riot_porta_r )
static WRITE8_DEVICE_HANDLER( riot_porta_w )
{
- device_t *tms = device->machine->device("tms");
+ device_t *tms = device->machine().device("tms");
/* handle 5220 read */
tms5220_rsq_w(tms, (data>>1) & 1);
@@ -348,7 +348,7 @@ static WRITE8_DEVICE_HANDLER( riot_porta_w )
static WRITE_LINE_DEVICE_HANDLER( riot_irq )
{
- cputag_set_input_line(device->machine, "audiocpu", M6502_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", M6502_IRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -361,18 +361,18 @@ static WRITE_LINE_DEVICE_HANDLER( riot_irq )
static READ8_HANDLER( adc_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
if( state->control_num == 0 )
{
- return input_port_read( space->machine, "PITCH" );
+ return input_port_read( space->machine(), "PITCH" );
}
- return input_port_read( space->machine, "YAW" );
+ return input_port_read( space->machine(), "YAW" );
}
static WRITE8_HANDLER( adc_select_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->control_num = offset;
}
@@ -386,27 +386,27 @@ static WRITE8_HANDLER( adc_select_w )
static WRITE8_HANDLER( nvram_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->nvram_1c->write(*space, offset, data >> 4);
state->nvram_1d->write(*space, offset, data & 0xf);
}
static READ8_HANDLER( nvram_r )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
return (state->nvram_1c->read(*space, offset) << 4) | (state->nvram_1d->read(*space, offset) & 0x0f);
}
static WRITE8_HANDLER( novram_recall_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->nvram_1c->recall(data & 0x80);
state->nvram_1d->recall(data & 0x80);
}
static WRITE8_HANDLER( novram_store_w )
{
- firefox_state *state = space->machine->driver_data<firefox_state>();
+ firefox_state *state = space->machine().driver_data<firefox_state>();
state->nvram_1c->store(data & 0x80);
state->nvram_1d->store(data & 0x80);
}
@@ -421,22 +421,22 @@ static WRITE8_HANDLER( novram_store_w )
static WRITE8_HANDLER( rom_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
static WRITE8_HANDLER( main_irq_clear_w )
{
- cputag_set_input_line( space->machine, "maincpu", M6809_IRQ_LINE, CLEAR_LINE );
+ cputag_set_input_line( space->machine(), "maincpu", M6809_IRQ_LINE, CLEAR_LINE );
}
static WRITE8_HANDLER( main_firq_clear_w )
{
- cputag_set_input_line( space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE );
+ cputag_set_input_line( space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE );
}
static WRITE8_HANDLER( self_reset_w )
{
- cputag_set_input_line( space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE );
+ cputag_set_input_line( space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE );
}
@@ -449,12 +449,12 @@ static WRITE8_HANDLER( self_reset_w )
static WRITE8_HANDLER( led_w )
{
- set_led_status( space->machine, offset, ( data & 0x80 ) == 0 );
+ set_led_status( space->machine(), offset, ( data & 0x80 ) == 0 );
}
static WRITE8_HANDLER( firefox_coin_counter_w )
{
- coin_counter_w( space->machine, offset, data & 0x80 );
+ coin_counter_w( space->machine(), offset, data & 0x80 );
}
@@ -462,18 +462,18 @@ static WRITE8_HANDLER( firefox_coin_counter_w )
static void firq_gen(device_t *device, int state)
{
if (state)
- cputag_set_input_line( device->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
+ cputag_set_input_line( device->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE );
}
static MACHINE_START( firefox )
{
- firefox_state *state = machine->driver_data<firefox_state>();
- memory_configure_bank(machine, "bank1", 0, 32, machine->region("maincpu")->base() + 0x10000, 0x1000);
- state->nvram_1c = machine->device<x2212_device>("nvram_1c");
- state->nvram_1d = machine->device<x2212_device>("nvram_1d");
+ firefox_state *state = machine.driver_data<firefox_state>();
+ memory_configure_bank(machine, "bank1", 0, 32, machine.region("maincpu")->base() + 0x10000, 0x1000);
+ state->nvram_1c = machine.device<x2212_device>("nvram_1c");
+ state->nvram_1d = machine.device<x2212_device>("nvram_1d");
- state->laserdisc = machine->device("laserdisc");
+ state->laserdisc = machine.device("laserdisc");
vp931_set_data_ready_callback(state->laserdisc, firq_gen);
state->control_num = 0;
diff --git a/src/mame/drivers/firetrap.c b/src/mame/drivers/firetrap.c
index 38d2776f3d5..a3908fc775e 100644
--- a/src/mame/drivers/firetrap.c
+++ b/src/mame/drivers/firetrap.c
@@ -179,13 +179,13 @@ Stephh's notes (based on the games Z80 code and some tests) :
static WRITE8_HANDLER( firetrap_nmi_disable_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->nmi_enable = ~data & 1;
}
static WRITE8_HANDLER( firetrap_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static READ8_HANDLER( firetrap_8751_bootleg_r )
@@ -193,9 +193,9 @@ static READ8_HANDLER( firetrap_8751_bootleg_r )
/* Check for coin insertion */
/* the following only works in the bootleg version, which doesn't have an */
/* 8751 - the real thing is much more complicated than that. */
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
UINT8 coin = 0;
- UINT8 port = input_port_read(space->machine, "IN2") & 0x70;
+ UINT8 port = input_port_read(space->machine(), "IN2") & 0x70;
if (cpu_get_pc(space->cpu) == 0x1188)
return ~state->coin_command_pending;
@@ -217,7 +217,7 @@ static READ8_HANDLER( firetrap_8751_bootleg_r )
static READ8_HANDLER( firetrap_8751_r )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
//logerror("PC:%04x read from 8751\n",cpu_get_pc(space->cpu));
return state->i8751_return;
}
@@ -244,7 +244,7 @@ static WRITE8_HANDLER( firetrap_8751_w )
};
static const int i8751_coin_data[]={ 0x00, 0xb7 };
static const int i8751_36_data[]={ 0x00, 0xbc };
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
/* End of command - important to note, as coin input is supressed while commands are pending */
if (data == 0x26)
@@ -308,26 +308,26 @@ static WRITE8_HANDLER( firetrap_8751_w )
static WRITE8_HANDLER( firetrap_sound_command_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( firetrap_sound_2400_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
msm5205_reset_w(state->msm, ~data & 0x01);
state->irq_enable = data & 0x02;
}
static WRITE8_HANDLER( firetrap_sound_bankselect_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x01);
+ memory_set_bank(space->machine(), "bank2", data & 0x01);
}
static void firetrap_adpcm_int( device_t *device )
{
- firetrap_state *state = device->machine->driver_data<firetrap_state>();
+ firetrap_state *state = device->machine().driver_data<firetrap_state>();
msm5205_data_w(device, state->msm5205next >> 4);
state->msm5205next <<= 4;
@@ -339,13 +339,13 @@ static void firetrap_adpcm_int( device_t *device )
static WRITE8_HANDLER( firetrap_adpcm_data_w )
{
- firetrap_state *state = space->machine->driver_data<firetrap_state>();
+ firetrap_state *state = space->machine().driver_data<firetrap_state>();
state->msm5205next = data;
}
static WRITE8_HANDLER( flip_screen_w )
{
- flip_screen_set(space->machine, data);
+ flip_screen_set(space->machine(), data);
}
@@ -576,9 +576,9 @@ static const msm5205_interface msm5205_config =
static INTERRUPT_GEN( firetrap )
{
- firetrap_state *state = device->machine->driver_data<firetrap_state>();
+ firetrap_state *state = device->machine().driver_data<firetrap_state>();
UINT8 coin = 0;
- UINT8 port = input_port_read(device->machine, "COIN") & 0x07;
+ UINT8 port = input_port_read(device->machine(), "COIN") & 0x07;
/* Check for coin IRQ */
if (cpu_getiloops(device))
@@ -613,7 +613,7 @@ static INTERRUPT_GEN( firetrap )
static INTERRUPT_GEN( bootleg )
{
- firetrap_state *state = device->machine->driver_data<firetrap_state>();
+ firetrap_state *state = device->machine().driver_data<firetrap_state>();
if (state->nmi_enable)
device_set_input_line (device, INPUT_LINE_NMI, PULSE_LINE);
@@ -622,13 +622,13 @@ static INTERRUPT_GEN( bootleg )
static MACHINE_START( firetrap )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
- UINT8 *MAIN = machine->region("maincpu")->base();
- UINT8 *SOUND = machine->region("audiocpu")->base();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
+ UINT8 *MAIN = machine.region("maincpu")->base();
+ UINT8 *SOUND = machine.region("audiocpu")->base();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->msm = machine->device("msm");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->msm = machine.device("msm");
memory_configure_bank(machine, "bank1", 0, 4, &MAIN[0x10000], 0x4000);
memory_configure_bank(machine, "bank2", 0, 2, &SOUND[0x10000], 0x4000);
@@ -650,7 +650,7 @@ static MACHINE_START( firetrap )
static MACHINE_RESET( firetrap )
{
- firetrap_state *state = machine->driver_data<firetrap_state>();
+ firetrap_state *state = machine.driver_data<firetrap_state>();
int i;
for (i = 0; i < 2; i++)
diff --git a/src/mame/drivers/firetrk.c b/src/mame/drivers/firetrk.c
index e65b51d0ddd..dc554be0623 100644
--- a/src/mame/drivers/firetrk.c
+++ b/src/mame/drivers/firetrk.c
@@ -14,35 +14,35 @@ Atari Fire Truck + Super Bug + Monte Carlo driver
-static void set_service_mode(running_machine *machine, int enable)
+static void set_service_mode(running_machine &machine, int enable)
{
- firetrk_state *state = machine->driver_data<firetrk_state>();
+ firetrk_state *state = machine.driver_data<firetrk_state>();
state->in_service_mode = enable;
/* watchdog is disabled during service mode */
watchdog_enable(machine, !enable);
/* change CPU clock speed according to service switch change */
- machine->device("maincpu")->set_unscaled_clock(enable ? (MASTER_CLOCK/12) : (MASTER_CLOCK/16));
+ machine.device("maincpu")->set_unscaled_clock(enable ? (MASTER_CLOCK/12) : (MASTER_CLOCK/16));
}
static INPUT_CHANGED( service_mode_switch_changed )
{
- set_service_mode(field->port->machine, newval);
+ set_service_mode(field->port->machine(), newval);
}
static INPUT_CHANGED( firetrk_horn_changed )
{
- device_t *discrete = field->port->machine->device("discrete");
+ device_t *discrete = field->port->machine().device("discrete");
discrete_sound_w(discrete, FIRETRUCK_HORN_EN, newval);
}
static INPUT_CHANGED( gear_changed )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
if (newval)
state->gear = (FPTR)param;
}
@@ -50,7 +50,7 @@ static INPUT_CHANGED( gear_changed )
static INTERRUPT_GEN( firetrk_interrupt )
{
- firetrk_state *state = device->machine->driver_data<firetrk_state>();
+ firetrk_state *state = device->machine().driver_data<firetrk_state>();
/* NMI interrupts are disabled during service mode in firetrk and montecar */
if (!state->in_service_mode)
@@ -62,7 +62,7 @@ static TIMER_CALLBACK( periodic_callback )
{
int scanline = param;
- generic_pulse_irq_line(machine->device("maincpu"), 0);
+ generic_pulse_irq_line(machine.device("maincpu"), 0);
/* IRQs are generated by inverse 16V signal */
scanline += 32;
@@ -70,34 +70,34 @@ static TIMER_CALLBACK( periodic_callback )
if (scanline > 262)
scanline = 0;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(periodic_callback), scanline);
}
static WRITE8_HANDLER( firetrk_output_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
- device_t *discrete = space->machine->device("discrete");
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
+ device_t *discrete = space->machine().device("discrete");
/* BIT0 => START1 LAMP */
- set_led_status(space->machine, 0, !(data & 0x01));
+ set_led_status(space->machine(), 0, !(data & 0x01));
/* BIT1 => START2 LAMP */
- set_led_status(space->machine, 1, !(data & 0x02));
+ set_led_status(space->machine(), 1, !(data & 0x02));
/* BIT2 => FLASH */
state->flash = data & 0x04;
/* BIT3 => TRACK LAMP */
- set_led_status(space->machine, 3, !(data & 0x08));
+ set_led_status(space->machine(), 3, !(data & 0x08));
/* BIT4 => ATTRACT */
discrete_sound_w(discrete, FIRETRUCK_ATTRACT_EN, data & 0x10);
- coin_lockout_w(space->machine, 0, !(data & 0x10));
- coin_lockout_w(space->machine, 1, !(data & 0x10));
+ coin_lockout_w(space->machine(), 0, !(data & 0x10));
+ coin_lockout_w(space->machine(), 1, !(data & 0x10));
/* BIT5 => START3 LAMP */
- set_led_status(space->machine, 2, !(data & 0x20));
+ set_led_status(space->machine(), 2, !(data & 0x20));
/* BIT6 => UNUSED */
@@ -108,34 +108,34 @@ static WRITE8_HANDLER( firetrk_output_w )
static WRITE8_HANDLER( superbug_output_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
- device_t *discrete = space->machine->device("discrete");
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
+ device_t *discrete = space->machine().device("discrete");
/* BIT0 => START LAMP */
- set_led_status(space->machine, 0, offset & 0x01);
+ set_led_status(space->machine(), 0, offset & 0x01);
/* BIT1 => ATTRACT */
discrete_sound_w(discrete, SUPERBUG_ATTRACT_EN, offset & 0x02);
- coin_lockout_w(space->machine, 0, !(offset & 0x02));
- coin_lockout_w(space->machine, 1, !(offset & 0x02));
+ coin_lockout_w(space->machine(), 0, !(offset & 0x02));
+ coin_lockout_w(space->machine(), 1, !(offset & 0x02));
/* BIT2 => FLASH */
state->flash = offset & 0x04;
/* BIT3 => TRACK LAMP */
- set_led_status(space->machine, 1, offset & 0x08);
+ set_led_status(space->machine(), 1, offset & 0x08);
}
static WRITE8_HANDLER( montecar_output_1_w )
{
- device_t *discrete = space->machine->device("discrete");
+ device_t *discrete = space->machine().device("discrete");
/* BIT0 => START LAMP */
- set_led_status(space->machine, 0, !(data & 0x01));
+ set_led_status(space->machine(), 0, !(data & 0x01));
/* BIT1 => TRACK LAMP */
- set_led_status(space->machine, 1, !(data & 0x02));
+ set_led_status(space->machine(), 1, !(data & 0x02));
/* BIT2 => ATTRACT */
discrete_sound_w(discrete, MONTECAR_ATTRACT_INV, data & 0x04);
@@ -144,20 +144,20 @@ static WRITE8_HANDLER( montecar_output_1_w )
/* BIT4 => UNUSED */
/* BIT5 => COIN3 COUNTER */
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
/* BIT6 => COIN2 COUNTER */
- coin_counter_w(space->machine, 1, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x40);
/* BIT7 => COIN1 COUNTER */
- coin_counter_w(space->machine, 2, data & 0x20);
+ coin_counter_w(space->machine(), 2, data & 0x20);
}
static WRITE8_HANDLER( montecar_output_2_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
- device_t *discrete = space->machine->device("discrete");
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
+ device_t *discrete = space->machine().device("discrete");
state->flash = data & 0x80;
@@ -170,14 +170,14 @@ static MACHINE_RESET( firetrk )
{
set_service_mode(machine, 0);
- machine->scheduler().synchronize(FUNC(periodic_callback));
+ machine.scheduler().synchronize(FUNC(periodic_callback));
}
static READ8_HANDLER( firetrk_dip_r )
{
- UINT8 val0 = input_port_read(space->machine, "DIP_0");
- UINT8 val1 = input_port_read(space->machine, "DIP_1");
+ UINT8 val0 = input_port_read(space->machine(), "DIP_0");
+ UINT8 val1 = input_port_read(space->machine(), "DIP_1");
if (val1 & (1 << (2 * offset + 0))) val0 |= 1;
if (val1 & (1 << (2 * offset + 1))) val0 |= 2;
@@ -188,8 +188,8 @@ static READ8_HANDLER( firetrk_dip_r )
static READ8_HANDLER( montecar_dip_r )
{
- UINT8 val0 = input_port_read(space->machine, "DIP_0");
- UINT8 val1 = input_port_read(space->machine, "DIP_1");
+ UINT8 val0 = input_port_read(space->machine(), "DIP_0");
+ UINT8 val1 = input_port_read(space->machine(), "DIP_1");
if (val1 & (1 << (3 - offset))) val0 |= 1;
if (val1 & (1 << (7 - offset))) val0 |= 2;
@@ -200,21 +200,21 @@ static READ8_HANDLER( montecar_dip_r )
static CUSTOM_INPUT( steer_dir_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
return state->steer_dir[(FPTR)param];
}
static CUSTOM_INPUT( steer_flag_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
return state->steer_flag[(FPTR)param];
}
static CUSTOM_INPUT( skid_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
UINT32 ret;
int which = (FPTR)param;
@@ -229,7 +229,7 @@ static CUSTOM_INPUT( skid_r )
static CUSTOM_INPUT( crash_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
UINT32 ret;
int which = (FPTR)param;
@@ -244,20 +244,20 @@ static CUSTOM_INPUT( crash_r )
static CUSTOM_INPUT( gear_r )
{
- firetrk_state *state = field->port->machine->driver_data<firetrk_state>();
+ firetrk_state *state = field->port->machine().driver_data<firetrk_state>();
return (state->gear == (FPTR)param) ? 1 : 0;
}
static READ8_HANDLER( firetrk_input_r )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
int i;
/* update steering wheels */
for (i = 0; i < 2; i++)
{
- UINT32 new_dial = input_port_read_safe(space->machine, (i ? "STEER_2" : "STEER_1"), 0);
+ UINT32 new_dial = input_port_read_safe(space->machine(), (i ? "STEER_2" : "STEER_1"), 0);
INT32 delta = new_dial - state->dial[i];
if (delta != 0)
@@ -269,15 +269,15 @@ static READ8_HANDLER( firetrk_input_r )
}
}
- return ((input_port_read_safe(space->machine, "BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
- ((input_port_read_safe(space->machine, "BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
- ((input_port_read_safe(space->machine, "BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
+ return ((input_port_read_safe(space->machine(), "BIT_0", 0) & (1 << offset)) ? 0x01 : 0) |
+ ((input_port_read_safe(space->machine(), "BIT_6", 0) & (1 << offset)) ? 0x40 : 0) |
+ ((input_port_read_safe(space->machine(), "BIT_7", 0) & (1 << offset)) ? 0x80 : 0);
}
static READ8_HANDLER( montecar_input_r )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
UINT8 ret = firetrk_input_r(space, offset);
if (state->crash[0])
@@ -293,14 +293,14 @@ static READ8_HANDLER( montecar_input_r )
static WRITE8_HANDLER( blink_on_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
*state->blink = TRUE;
}
static WRITE8_HANDLER( montecar_car_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->crash[0] = 0;
state->skid[0] = 0;
}
@@ -308,7 +308,7 @@ static WRITE8_HANDLER( montecar_car_reset_w )
static WRITE8_HANDLER( montecar_drone_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->crash[1] = 0;
state->skid[1] = 0;
}
@@ -316,7 +316,7 @@ static WRITE8_HANDLER( montecar_drone_reset_w )
static WRITE8_HANDLER( steer_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->steer_flag[0] = 1;
state->steer_flag[1] = 1;
}
@@ -324,7 +324,7 @@ static WRITE8_HANDLER( steer_reset_w )
static WRITE8_HANDLER( crash_reset_w )
{
- firetrk_state *state = space->machine->driver_data<firetrk_state>();
+ firetrk_state *state = space->machine().driver_data<firetrk_state>();
state->crash[0] = 0;
state->crash[1] = 0;
}
diff --git a/src/mame/drivers/fitfight.c b/src/mame/drivers/fitfight.c
index 4dae28e6fea..2944498a225 100644
--- a/src/mame/drivers/fitfight.c
+++ b/src/mame/drivers/fitfight.c
@@ -90,14 +90,14 @@ Stephh's notes :
static READ16_HANDLER(fitfight_700000_r)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
UINT16 data = state->fof_700000_data;
return (data << 2);
}
static READ16_HANDLER(histryma_700000_r)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
UINT16 data = (state->fof_700000_data & 0x00AA);
data |= ((state->fof_700000_data & 0x0055) >> 2);
return (data);
@@ -105,7 +105,7 @@ static READ16_HANDLER(histryma_700000_r)
static READ16_HANDLER(bbprot_700000_r)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
UINT16 data = 0;
data = (state->fof_700000_data & 0x000b);
data |= ((state->fof_700000_data & 0x01d0) >> 2);
@@ -116,7 +116,7 @@ static READ16_HANDLER(bbprot_700000_r)
static WRITE16_HANDLER(fitfight_700000_w)
{
- fitfight_state *state = space->machine->driver_data<fitfight_state>();
+ fitfight_state *state = space->machine().driver_data<fitfight_state>();
COMBINE_DATA(&state->fof_700000[offset]); // needed for scrolling
if (data < 0x0200) // to avoid considering writes of 0x0200
@@ -219,19 +219,19 @@ ADDRESS_MAP_END
static READ8_HANDLER(snd_porta_r)
{
//mame_printf_debug("PA R @%x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER(snd_portb_r)
{
//mame_printf_debug("PB R @%x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static READ8_HANDLER(snd_portc_r)
{
//mame_printf_debug("PC R @%x\n",cpu_get_pc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER(snd_porta_w)
@@ -719,14 +719,14 @@ GFXDECODE_END
static MACHINE_START( fitfight )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->save_item(NAME(state->fof_700000_data));
}
static MACHINE_RESET( fitfight )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->fof_700000_data = 0;
}
@@ -975,25 +975,25 @@ ROM_END
static DRIVER_INIT( fitfight )
{
-// UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+// UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
// mem16[0x0165B2/2] = 0x4e71; // for now so it boots
- fitfight_state *state = machine->driver_data<fitfight_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(fitfight_700000_r));
+ fitfight_state *state = machine.driver_data<fitfight_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(fitfight_700000_r));
state->bbprot_kludge = 0;
}
static DRIVER_INIT( histryma )
{
-// UINT16 *mem16 = (UINT16 *)machine->region("maincpu")->base();
+// UINT16 *mem16 = (UINT16 *)machine.region("maincpu")->base();
// mem16[0x017FDC/2] = 0x4e71; // for now so it boots
- fitfight_state *state = machine->driver_data<fitfight_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(histryma_700000_r));
+ fitfight_state *state = machine.driver_data<fitfight_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x700000, 0x700001, FUNC(histryma_700000_r));
state->bbprot_kludge = 0;
}
static DRIVER_INIT( bbprot )
{
- fitfight_state *state = machine->driver_data<fitfight_state>();
+ fitfight_state *state = machine.driver_data<fitfight_state>();
state->bbprot_kludge = 1;
}
diff --git a/src/mame/drivers/flkatck.c b/src/mame/drivers/flkatck.c
index e60e615e33a..2e0620d77dc 100644
--- a/src/mame/drivers/flkatck.c
+++ b/src/mame/drivers/flkatck.c
@@ -22,7 +22,7 @@
static INTERRUPT_GEN( flkatck_interrupt )
{
- flkatck_state *state = device->machine->driver_data<flkatck_state>();
+ flkatck_state *state = device->machine().driver_data<flkatck_state>();
if (state->irq_enabled)
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
@@ -31,12 +31,12 @@ static INTERRUPT_GEN( flkatck_interrupt )
static WRITE8_HANDLER( flkatck_bankswitch_w )
{
/* bits 3-4: coin counters */
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x10);
/* bits 0-1: bank # */
if ((data & 0x03) != 0x03) /* for safety */
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static READ8_HANDLER( flkatck_ls138_r )
@@ -47,13 +47,13 @@ static READ8_HANDLER( flkatck_ls138_r )
{
case 0x00:
if (offset & 0x02)
- data = input_port_read(space->machine, (offset & 0x01) ? "COIN" : "DSW3");
+ data = input_port_read(space->machine(), (offset & 0x01) ? "COIN" : "DSW3");
else
- data = input_port_read(space->machine, (offset & 0x01) ? "P2" : "P1");
+ data = input_port_read(space->machine(), (offset & 0x01) ? "P2" : "P1");
break;
case 0x01:
if (offset & 0x02)
- data = input_port_read(space->machine, (offset & 0x01) ? "DSW1" : "DSW2");
+ data = input_port_read(space->machine(), (offset & 0x01) ? "DSW1" : "DSW2");
break;
}
@@ -62,7 +62,7 @@ static READ8_HANDLER( flkatck_ls138_r )
static WRITE8_HANDLER( flkatck_ls138_w )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
switch ((offset & 0x1c) >> 2)
{
@@ -84,13 +84,13 @@ static WRITE8_HANDLER( flkatck_ls138_w )
/* Protection - an external multiplyer connected to the sound CPU */
static READ8_HANDLER( multiply_r )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
return (state->multiply_reg[0] * state->multiply_reg[1]) & 0xff;
}
static WRITE8_HANDLER( multiply_w )
{
- flkatck_state *state = space->machine->driver_data<flkatck_state>();
+ flkatck_state *state = space->machine().driver_data<flkatck_state>();
state->multiply_reg[offset] = data;
}
@@ -197,13 +197,13 @@ static const k007232_interface k007232_config =
static MACHINE_START( flkatck )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007121 = machine->device("k007121");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007121 = machine.device("k007121");
state->save_item(NAME(state->irq_enabled));
state->save_item(NAME(state->multiply_reg));
@@ -212,9 +212,9 @@ static MACHINE_START( flkatck )
static MACHINE_RESET( flkatck )
{
- flkatck_state *state = machine->driver_data<flkatck_state>();
+ flkatck_state *state = machine.driver_data<flkatck_state>();
- k007232_set_bank(machine->device("konami"), 0, 1);
+ k007232_set_bank(machine.device("konami"), 0, 1);
state->irq_enabled = 0;
state->multiply_reg[0] = 0;
diff --git a/src/mame/drivers/flower.c b/src/mame/drivers/flower.c
index 303045ae6e1..aa9a95f1781 100644
--- a/src/mame/drivers/flower.c
+++ b/src/mame/drivers/flower.c
@@ -78,30 +78,30 @@ CHIP # POSITION TYPE
static WRITE8_HANDLER( flower_irq_ack )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( sn_irq_enable_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
*state->sn_irq_enable = data;
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
static INTERRUPT_GEN( sn_irq )
{
- flower_state *state = device->machine->driver_data<flower_state>();
+ flower_state *state = device->machine().driver_data<flower_state>();
if ((*state->sn_irq_enable & 1) == 1)
device_set_input_line(device, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( sound_command_w )
{
- flower_state *state = space->machine->driver_data<flower_state>();
+ flower_state *state = space->machine().driver_data<flower_state>();
soundlatch_w(space, 0, data);
if ((*state->sn_nmi_enable & 1) == 1)
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( flower_cpu1_2, AS_PROGRAM, 8 )
diff --git a/src/mame/drivers/flstory.c b/src/mame/drivers/flstory.c
index fc045ff49b4..b2d1e3e9574 100644
--- a/src/mame/drivers/flstory.c
+++ b/src/mame/drivers/flstory.c
@@ -20,27 +20,27 @@
static READ8_HANDLER( from_snd_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->snd_flag = 0;
return state->snd_data;
}
static READ8_HANDLER( snd_flag_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
return state->snd_flag | 0xfd;
}
static WRITE8_HANDLER( to_main_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->snd_data = data;
state->snd_flag = 2;
}
static TIMER_CALLBACK( nmi_callback )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -50,19 +50,19 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
{
@@ -125,7 +125,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( victnine_mcu_status_bit01_r )
{
- flstory_state *state = field->port->machine->driver_data<flstory_state>();
+ flstory_state *state = field->port->machine().driver_data<flstory_state>();
address_space *space = state->maincpu->memory().space(AS_PROGRAM);
return (victnine_mcu_status_r(space, 0) & 3);
@@ -161,7 +161,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( rumba_mcu_r )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//printf("PC=%04x R %02x\n",cpu_get_pc(space->cpu),state->mcu_cmd);
if((state->mcu_cmd & 0xf0) == 0x00) // end packet cmd, value returned is meaningless (probably used for main <-> mcu comms syncronization)
@@ -213,7 +213,7 @@ static READ8_HANDLER( rumba_mcu_r )
static WRITE8_HANDLER( rumba_mcu_w )
{
- flstory_state *state = space->machine->driver_data<flstory_state>();
+ flstory_state *state = space->machine().driver_data<flstory_state>();
//if((state->mcu_cmd & 0xf0) == 0xc0)
// printf("%02x ",data);
@@ -370,7 +370,7 @@ ADDRESS_MAP_END
static MACHINE_RESET( ta7630 )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
int i;
double db = 0.0;
@@ -395,7 +395,7 @@ static MACHINE_RESET( ta7630 )
static WRITE8_DEVICE_HANDLER( sound_control_0_w )
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
state->snd_ctrl0 = data & 0xff;
// popmessage("SND0 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -411,7 +411,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_0_w )
}
static WRITE8_DEVICE_HANDLER( sound_control_1_w )
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
state->snd_ctrl1 = data & 0xff;
// popmessage("SND1 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -425,7 +425,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_1_w )
static WRITE8_DEVICE_HANDLER( sound_control_2_w )
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
int i;
state->snd_ctrl2 = data & 0xff;
@@ -439,7 +439,7 @@ static WRITE8_DEVICE_HANDLER( sound_control_2_w )
static WRITE8_DEVICE_HANDLER( sound_control_3_w ) /* unknown */
{
- flstory_state *state = device->machine->driver_data<flstory_state>();
+ flstory_state *state = device->machine().driver_data<flstory_state>();
state->snd_ctrl3 = data & 0xff;
// popmessage("SND3 0=%02x 1=%02x 2=%02x 3=%02x", state->snd_ctrl0, state->snd_ctrl1, state->snd_ctrl2, state->snd_ctrl3);
@@ -1014,11 +1014,11 @@ static const msm5232_interface msm5232_config =
static MACHINE_START( flstory )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
/* video */
state->save_item(NAME(state->char_bank));
@@ -1054,7 +1054,7 @@ static MACHINE_START( flstory )
static MACHINE_RESET( flstory )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
MACHINE_RESET_CALL(ta7630);
@@ -1266,7 +1266,7 @@ MACHINE_CONFIG_END
static MACHINE_RESET( rumba )
{
- flstory_state *state = machine->driver_data<flstory_state>();
+ flstory_state *state = machine.driver_data<flstory_state>();
MACHINE_RESET_CALL(flstory);
state->mcu_cmd = 0;
}
diff --git a/src/mame/drivers/flyball.c b/src/mame/drivers/flyball.c
index f2482a59fc3..756a8e80709 100644
--- a/src/mame/drivers/flyball.c
+++ b/src/mame/drivers/flyball.c
@@ -55,7 +55,7 @@ static TILEMAP_MAPPER( flyball_get_memory_offset )
static TILE_GET_INFO( flyball_get_tile_info )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
UINT8 data = state->playfield_ram[tile_index];
int flags = ((data & 0x40) ? TILE_FLIPX : 0) | ((data & 0x80) ? TILE_FLIPY : 0);
int code = data & 63;
@@ -71,14 +71,14 @@ static TILE_GET_INFO( flyball_get_tile_info )
static VIDEO_START( flyball )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
state->tmap = tilemap_create(machine, flyball_get_tile_info, flyball_get_memory_offset, 8, 16, 32, 16);
}
static SCREEN_UPDATE( flyball )
{
- flyball_state *state = screen->machine->driver_data<flyball_state>();
+ flyball_state *state = screen->machine().driver_data<flyball_state>();
int pitcherx = state->pitcher_horz;
int pitchery = state->pitcher_vert - 31;
@@ -94,7 +94,7 @@ static SCREEN_UPDATE( flyball )
tilemap_draw(bitmap, cliprect, state->tmap, 0, 0);
/* draw pitcher */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[1], state->pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[1], state->pitcher_pic ^ 0xf, 0, 1, 0, pitcherx, pitchery, 1);
/* draw ball */
@@ -111,7 +111,7 @@ static SCREEN_UPDATE( flyball )
static TIMER_CALLBACK( flyball_joystick_callback )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
int potsense = param;
if (potsense & ~state->potmask)
@@ -123,7 +123,7 @@ static TIMER_CALLBACK( flyball_joystick_callback )
static TIMER_CALLBACK( flyball_quarter_callback )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
int scanline = param;
int potsense[64], i;
@@ -136,12 +136,12 @@ static TIMER_CALLBACK( flyball_quarter_callback )
for (i = 0; i < 64; i++)
if (potsense[i] != 0)
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline + i), FUNC(flyball_joystick_callback), potsense[i]);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline + i), FUNC(flyball_joystick_callback), potsense[i]);
scanline += 0x40;
scanline &= 0xff;
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(flyball_quarter_callback), scanline);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(flyball_quarter_callback), scanline);
state->potsense = 0;
state->potmask = 0;
@@ -157,53 +157,53 @@ static TIMER_CALLBACK( flyball_quarter_callback )
/* two physical buttons (start game and stop runner) share the same port bit */
static READ8_HANDLER( flyball_input_r )
{
- return input_port_read(space->machine, "IN0") & input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN0") & input_port_read(space->machine(), "IN1");
}
static READ8_HANDLER( flyball_scanline_r )
{
- return space->machine->primary_screen->vpos() & 0x3f;
+ return space->machine().primary_screen->vpos() & 0x3f;
}
static READ8_HANDLER( flyball_potsense_r )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
return state->potsense & ~state->potmask;
}
static WRITE8_HANDLER( flyball_potmask_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->potmask |= data & 0xf;
}
static WRITE8_HANDLER( flyball_pitcher_pic_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->pitcher_pic = data & 0xf;
}
static WRITE8_HANDLER( flyball_ball_vert_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->ball_vert = data;
}
static WRITE8_HANDLER( flyball_ball_horz_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->ball_horz = data;
}
static WRITE8_HANDLER( flyball_pitcher_vert_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->pitcher_vert = data;
}
static WRITE8_HANDLER( flyball_pitcher_horz_w )
{
- flyball_state *state = space->machine->driver_data<flyball_state>();
+ flyball_state *state = space->machine().driver_data<flyball_state>();
state->pitcher_horz = data;
}
@@ -214,7 +214,7 @@ static WRITE8_HANDLER( flyball_misc_w )
switch (offset)
{
case 0:
- set_led_status(space->machine, 0, bit);
+ set_led_status(space->machine(), 0, bit);
break;
case 1:
/* crowd very loud */
@@ -361,9 +361,9 @@ static PALETTE_INIT( flyball )
static MACHINE_START( flyball )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->pitcher_vert));
state->save_item(NAME(state->pitcher_horz));
@@ -376,18 +376,18 @@ static MACHINE_START( flyball )
static MACHINE_RESET( flyball )
{
- flyball_state *state = machine->driver_data<flyball_state>();
+ flyball_state *state = machine.driver_data<flyball_state>();
int i;
/* address bits 0 through 8 are inverted */
- UINT8* ROM = machine->region("maincpu")->base() + 0x2000;
+ UINT8* ROM = machine.region("maincpu")->base() + 0x2000;
for (i = 0; i < 0x1000; i++)
state->rombase[i] = ROM[i ^ 0x1ff];
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(flyball_quarter_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(flyball_quarter_callback));
state->pitcher_vert = 0;
state->pitcher_horz = 0;
diff --git a/src/mame/drivers/foodf.c b/src/mame/drivers/foodf.c
index c1e15d08f61..0caeb5a03a4 100644
--- a/src/mame/drivers/foodf.c
+++ b/src/mame/drivers/foodf.c
@@ -91,7 +91,7 @@
static WRITE16_HANDLER( nvram_recall_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
state->m_nvram->recall(0);
state->m_nvram->recall(1);
state->m_nvram->recall(0);
@@ -105,9 +105,9 @@ static WRITE16_HANDLER( nvram_recall_w )
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
cputag_set_input_line(machine, "maincpu", 1, state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 2, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 3, state->scanline_int_state && state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
@@ -124,7 +124,7 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
mystery yet */
/* INT 1 is on 32V */
- atarigen_scanline_int_gen(timer.machine->device("maincpu"));
+ atarigen_scanline_int_gen(timer.machine().device("maincpu"));
/* advance to the next interrupt */
scanline += 64;
@@ -132,13 +132,13 @@ static TIMER_DEVICE_CALLBACK( scanline_update )
scanline = 0;
/* set a timer for it */
- timer.adjust(timer.machine->primary_screen->time_until_pos(scanline), scanline);
+ timer.adjust(timer.machine().primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( foodf )
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
atarigen_init(machine);
state->save_item(NAME(state->whichport));
}
@@ -146,10 +146,10 @@ static MACHINE_START( foodf )
static MACHINE_RESET( foodf )
{
- foodf_state *state = machine->driver_data<foodf_state>();
+ foodf_state *state = machine.driver_data<foodf_state>();
atarigen_interrupt_reset(state, update_interrupts);
- timer_device *scan_timer = machine->device<timer_device>("scan_timer");
- scan_timer->adjust(machine->primary_screen->time_until_pos(0));
+ timer_device *scan_timer = machine.device<timer_device>("scan_timer");
+ scan_timer->adjust(machine.primary_screen->time_until_pos(0));
}
@@ -162,7 +162,7 @@ static MACHINE_RESET( foodf )
static WRITE8_HANDLER( digital_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
foodf_set_flip(state, data & 0x01);
state->m_nvram->store(data & 0x02);
@@ -175,8 +175,8 @@ static WRITE8_HANDLER( digital_w )
output_set_led_value(0, (data >> 4) & 1);
output_set_led_value(1, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 6) & 1);
- coin_counter_w(space->machine, 1, (data >> 7) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 6) & 1);
+ coin_counter_w(space->machine(), 1, (data >> 7) & 1);
}
@@ -190,15 +190,15 @@ static WRITE8_HANDLER( digital_w )
static READ16_HANDLER( analog_r )
{
static const char *const portnames[] = { "STICK0_X", "STICK1_X", "STICK0_Y", "STICK1_Y" };
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
- return input_port_read(space->machine, portnames[state->whichport]);
+ return input_port_read(space->machine(), portnames[state->whichport]);
}
static WRITE16_HANDLER( analog_w )
{
- foodf_state *state = space->machine->driver_data<foodf_state>();
+ foodf_state *state = space->machine().driver_data<foodf_state>();
state->whichport = offset ^ 3;
}
@@ -330,7 +330,7 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER( pot_r )
{
- return (input_port_read(device->machine, "DSW") >> offset) << 7;
+ return (input_port_read(device->machine(), "DSW") >> offset) << 7;
}
static const pokey_interface pokey_config =
diff --git a/src/mame/drivers/forte2.c b/src/mame/drivers/forte2.c
index 09e5af5f779..c13f24d0ab5 100644
--- a/src/mame/drivers/forte2.c
+++ b/src/mame/drivers/forte2.c
@@ -71,13 +71,13 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER(forte2_ay8910_read_input)
{
- forte2_state *state = device->machine->driver_data<forte2_state>();
- return input_port_read(device->machine, "IN0") | (state->input_mask&0x3f);
+ forte2_state *state = device->machine().driver_data<forte2_state>();
+ return input_port_read(device->machine(), "IN0") | (state->input_mask&0x3f);
}
static WRITE8_DEVICE_HANDLER( forte2_ay8910_set_input_mask )
{
- forte2_state *state = device->machine->driver_data<forte2_state>();
+ forte2_state *state = device->machine().driver_data<forte2_state>();
/* PSG reg 15, writes 0 at coin insert, 0xff at boot and game over */
state->input_mask = data;
}
@@ -93,7 +93,7 @@ static const ay8910_interface forte2_ay8910_interface =
};
-static void vdp_interrupt(running_machine *machine, int i)
+static void vdp_interrupt(running_machine &machine, int i)
{
cputag_set_input_line(machine, "maincpu", 0, (i ? HOLD_LINE : CLEAR_LINE));
}
@@ -113,14 +113,14 @@ static STATE_POSTLOAD ( forte2 )
static MACHINE_START( forte2 )
{
- forte2_state *state = machine->driver_data<forte2_state>();
+ forte2_state *state = machine.driver_data<forte2_state>();
TMS9928A_configure(&tms9928a_interface);
state->input_mask = 0xff;
/* register for save states */
state_save_register_global(machine, state->input_mask);
- machine->state().register_postload(forte2, NULL);
+ machine.state().register_postload(forte2, NULL);
}
static MACHINE_RESET( forte2 )
@@ -130,7 +130,7 @@ static MACHINE_RESET( forte2 )
static INTERRUPT_GEN( pesadelo_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
@@ -161,8 +161,8 @@ MACHINE_CONFIG_END
static DRIVER_INIT(pesadelo)
{
int i;
- UINT8 *mem = machine->region("maincpu")->base();
- int memsize = machine->region("maincpu")->bytes();
+ UINT8 *mem = machine.region("maincpu")->base();
+ int memsize = machine.region("maincpu")->bytes();
UINT8 *buf;
// data swap
diff --git a/src/mame/drivers/fortecar.c b/src/mame/drivers/fortecar.c
index b19f67a67d3..5419ec31a2f 100644
--- a/src/mame/drivers/fortecar.c
+++ b/src/mame/drivers/fortecar.c
@@ -49,7 +49,7 @@ static VIDEO_START(fortecar)
static SCREEN_UPDATE(fortecar)
{
- fortecar_state *state = screen->machine->driver_data<fortecar_state>();
+ fortecar_state *state = screen->machine().driver_data<fortecar_state>();
int x,y,count;
count = 0;
@@ -62,7 +62,7 @@ static SCREEN_UPDATE(fortecar)
tile = (state->ram[(count*4)+1] | (state->ram[(count*4)+2]<<8)) & 0xfff;
color = state->ram[(count*4)+3] & 3;
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,color,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,color,0,0,x*8,y*8);
count++;
}
@@ -80,7 +80,7 @@ static WRITE8_DEVICE_HANDLER( ppi0_portc_w )
static READ8_DEVICE_HANDLER( ppi0_portc_r )
{
-// popmessage("%s",device->machine->describe_context());
+// popmessage("%s",device->machine().describe_context());
return (~(eeprom_read_bit(device)<<1) & 2);
}
@@ -254,7 +254,7 @@ GFXDECODE_END
static MACHINE_RESET(fortecar)
{
- fortecar_state *state = machine->driver_data<fortecar_state>();
+ fortecar_state *state = machine.driver_data<fortecar_state>();
state->bank = -1;
}
diff --git a/src/mame/drivers/freekick.c b/src/mame/drivers/freekick.c
index 17b0548708b..a0a7727971d 100644
--- a/src/mame/drivers/freekick.c
+++ b/src/mame/drivers/freekick.c
@@ -46,49 +46,49 @@ static WRITE8_HANDLER( flipscreen_w )
{
/* flip Y/X could be the other way round... */
if (offset)
- flip_screen_y_set(space->machine, ~data & 1);
+ flip_screen_y_set(space->machine(), ~data & 1);
else
- flip_screen_x_set(space->machine, ~data & 1);
+ flip_screen_x_set(space->machine(), ~data & 1);
}
static WRITE8_HANDLER( coin_w )
{
- coin_counter_w(space->machine, offset, ~data & 1);
+ coin_counter_w(space->machine(), offset, ~data & 1);
}
static WRITE8_HANDLER( spinner_select_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->spinner = data & 1;
}
static READ8_HANDLER( spinner_r )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
- return input_port_read(space->machine, state->spinner ? "IN3" : "IN2");
+ freekick_state *state = space->machine().driver_data<freekick_state>();
+ return input_port_read(space->machine(), state->spinner ? "IN3" : "IN2");
}
static WRITE8_HANDLER( pbillrd_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER( nmi_enable_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->nmi_en = data & 1;
}
static INTERRUPT_GEN( freekick_irqgen )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
+ freekick_state *state = device->machine().driver_data<freekick_state>();
if (state->nmi_en)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( oigas_5_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
if (data > 0xc0 && data < 0xe0)
state->cnt = 1;
@@ -101,7 +101,7 @@ static WRITE8_HANDLER( oigas_5_w )
static READ8_HANDLER( oigas_3_r )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
switch (++state->cnt)
{
case 2: return ~(state->inval >> 8);
@@ -144,13 +144,13 @@ static READ8_HANDLER( oigas_2_r )
static READ8_HANDLER( freekick_ff_r )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
return state->ff_data;
}
static WRITE8_HANDLER( freekick_ff_w )
{
- freekick_state *state = space->machine->driver_data<freekick_state>();
+ freekick_state *state = space->machine().driver_data<freekick_state>();
state->ff_data = data;
}
@@ -513,20 +513,20 @@ INPUT_PORTS_END
static WRITE8_DEVICE_HANDLER( snd_rom_addr_l_w )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
+ freekick_state *state = device->machine().driver_data<freekick_state>();
state->romaddr = (state->romaddr & 0xff00) | data;
}
static WRITE8_DEVICE_HANDLER( snd_rom_addr_h_w )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
+ freekick_state *state = device->machine().driver_data<freekick_state>();
state->romaddr = (state->romaddr & 0x00ff) | (data << 8);
}
static READ8_DEVICE_HANDLER( snd_rom_r )
{
- freekick_state *state = device->machine->driver_data<freekick_state>();
- return device->machine->region("user1")->base()[state->romaddr & 0x7fff];
+ freekick_state *state = device->machine().driver_data<freekick_state>();
+ return device->machine().region("user1")->base()[state->romaddr & 0x7fff];
}
static const ppi8255_interface ppi8255_intf[2] =
@@ -596,7 +596,7 @@ GFXDECODE_END
static MACHINE_START( freekick )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->save_item(NAME(state->romaddr));
state->save_item(NAME(state->spinner));
@@ -606,7 +606,7 @@ static MACHINE_START( freekick )
static MACHINE_RESET( freekick )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->romaddr = 0;
state->spinner = 0;
@@ -616,14 +616,14 @@ static MACHINE_RESET( freekick )
static MACHINE_START( pbillrd )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
MACHINE_START_CALL(freekick);
}
static MACHINE_START( oigas )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
state->save_item(NAME(state->inval));
state->save_item(NAME(state->outval));
@@ -634,7 +634,7 @@ static MACHINE_START( oigas )
static MACHINE_RESET( oigas )
{
- freekick_state *state = machine->driver_data<freekick_state>();
+ freekick_state *state = machine.driver_data<freekick_state>();
MACHINE_RESET_CALL(freekick);
@@ -1108,8 +1108,8 @@ ROM_END
static DRIVER_INIT(gigasb)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- space->set_decrypted_region(0x0000, 0xbfff, machine->region("maincpu")->base() + 0x10000);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space->set_decrypted_region(0x0000, 0xbfff, machine.region("maincpu")->base() + 0x10000);
}
diff --git a/src/mame/drivers/fromanc2.c b/src/mame/drivers/fromanc2.c
index de34b2bc2aa..6c70996c412 100644
--- a/src/mame/drivers/fromanc2.c
+++ b/src/mame/drivers/fromanc2.c
@@ -39,7 +39,7 @@ static INTERRUPT_GEN( fromanc2_interrupt )
static WRITE16_HANDLER( fromanc2_sndcmd_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
soundlatch_w(space, offset, (data >> 8) & 0xff); // 1P (LEFT)
soundlatch2_w(space, offset, data & 0xff); // 2P (RIGHT)
@@ -50,21 +50,21 @@ static WRITE16_HANDLER( fromanc2_sndcmd_w )
static WRITE16_HANDLER( fromanc2_portselect_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->portselect = data;
}
static READ16_HANDLER( fromanc2_keymatrix_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
UINT16 ret;
switch (state->portselect)
{
- case 0x01: ret = input_port_read(space->machine, "KEY0"); break;
- case 0x02: ret = input_port_read(space->machine, "KEY1"); break;
- case 0x04: ret = input_port_read(space->machine, "KEY2"); break;
- case 0x08: ret = input_port_read(space->machine, "KEY3"); break;
+ case 0x01: ret = input_port_read(space->machine(), "KEY0"); break;
+ case 0x02: ret = input_port_read(space->machine(), "KEY1"); break;
+ case 0x04: ret = input_port_read(space->machine(), "KEY2"); break;
+ case 0x08: ret = input_port_read(space->machine(), "KEY3"); break;
default: ret = 0xffff;
logerror("PC:%08X unknown %02X\n", cpu_get_pc(space->cpu), state->portselect);
break;
@@ -75,46 +75,46 @@ static READ16_HANDLER( fromanc2_keymatrix_r )
static CUSTOM_INPUT( subcpu_int_r )
{
- fromanc2_state *state = field->port->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = field->port->machine().driver_data<fromanc2_state>();
return state->subcpu_int_flag & 0x01;
}
static CUSTOM_INPUT( sndcpu_nmi_r )
{
- fromanc2_state *state = field->port->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = field->port->machine().driver_data<fromanc2_state>();
return state->sndcpu_nmi_flag & 0x01;
}
static CUSTOM_INPUT( subcpu_nmi_r )
{
- fromanc2_state *state = field->port->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = field->port->machine().driver_data<fromanc2_state>();
return state->subcpu_nmi_flag & 0x01;
}
static WRITE16_HANDLER( fromanc2_eeprom_w )
{
if (ACCESSING_BITS_8_15)
- input_port_write(space->machine, "EEPROMOUT", data, 0xffff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xffff);
}
static WRITE16_HANDLER( fromancr_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- fromancr_gfxbank_w(space->machine, data & 0xfff8);
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ fromancr_gfxbank_w(space->machine(), data & 0xfff8);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
}
static WRITE16_HANDLER( fromanc4_eeprom_w )
{
if (ACCESSING_BITS_0_7)
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
static WRITE16_HANDLER( fromanc2_subcpu_w )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->datalatch1 = data;
device_set_input_line(state->subcpu, 0, HOLD_LINE);
@@ -123,7 +123,7 @@ static WRITE16_HANDLER( fromanc2_subcpu_w )
static READ16_HANDLER( fromanc2_subcpu_r )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
device_set_input_line(state->subcpu, INPUT_LINE_NMI, PULSE_LINE);
state->subcpu_nmi_flag = 0;
@@ -132,13 +132,13 @@ static READ16_HANDLER( fromanc2_subcpu_r )
static READ8_HANDLER( fromanc2_maincpu_r_l )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
return state->datalatch1 & 0x00ff;
}
static READ8_HANDLER( fromanc2_maincpu_r_h )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->subcpu_int_flag = 1;
return (state->datalatch1 & 0xff00) >> 8;
@@ -146,25 +146,25 @@ static READ8_HANDLER( fromanc2_maincpu_r_h )
static WRITE8_HANDLER( fromanc2_maincpu_w_l )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->datalatch_2l = data;
}
static WRITE8_HANDLER( fromanc2_maincpu_w_h )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->datalatch_2h = data;
}
static WRITE8_HANDLER( fromanc2_subcpu_nmi_clr )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->subcpu_nmi_flag = 1;
}
static READ8_HANDLER( fromanc2_sndcpu_nmi_clr )
{
- fromanc2_state *state = space->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = space->machine().driver_data<fromanc2_state>();
state->sndcpu_nmi_flag = 1;
return 0xff;
@@ -173,10 +173,10 @@ static READ8_HANDLER( fromanc2_sndcpu_nmi_clr )
static WRITE8_HANDLER( fromanc2_subcpu_rombank_w )
{
// Change ROM BANK
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
// Change RAM BANK
- memory_set_bank(space->machine, "bank2", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank2", (data & 0x0c) >> 2);
}
@@ -497,7 +497,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- fromanc2_state *state = device->machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = device->machine().driver_data<fromanc2_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -515,13 +515,13 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( fromanc4 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->eeprom = machine->device("eeprom");
- state->left_screen = machine->device("lscreen");
- state->right_screen = machine->device("rscreen");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->eeprom = machine.device("eeprom");
+ state->left_screen = machine.device("lscreen");
+ state->right_screen = machine.device("rscreen");
state->save_item(NAME(state->portselect));
state->save_item(NAME(state->sndcpu_nmi_flag));
@@ -534,11 +534,11 @@ static MACHINE_START( fromanc4 )
static MACHINE_START( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("sub")->base(), 0x4000);
- memory_configure_bank(machine, "bank2", 0, 1, machine->region("sub")->base() + 0x08000, 0x4000);
- memory_configure_bank(machine, "bank2", 1, 3, machine->region("sub")->base() + 0x14000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("sub")->base(), 0x4000);
+ memory_configure_bank(machine, "bank2", 0, 1, machine.region("sub")->base() + 0x08000, 0x4000);
+ memory_configure_bank(machine, "bank2", 1, 3, machine.region("sub")->base() + 0x14000, 0x4000);
MACHINE_START_CALL(fromanc4);
@@ -548,7 +548,7 @@ static MACHINE_START( fromanc2 )
static MACHINE_RESET( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->portselect = 0;
state->datalatch1 = 0;
@@ -828,7 +828,7 @@ ROM_END
static DRIVER_INIT( fromanc2 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->subcpu_nmi_flag = 1;
state->subcpu_int_flag = 1;
state->sndcpu_nmi_flag = 1;
@@ -836,7 +836,7 @@ static DRIVER_INIT( fromanc2 )
static DRIVER_INIT( fromanc4 )
{
- fromanc2_state *state = machine->driver_data<fromanc2_state>();
+ fromanc2_state *state = machine.driver_data<fromanc2_state>();
state->sndcpu_nmi_flag = 1;
}
diff --git a/src/mame/drivers/fromance.c b/src/mame/drivers/fromance.c
index 8bbb27fd74b..fdf171c8876 100644
--- a/src/mame/drivers/fromance.c
+++ b/src/mame/drivers/fromance.c
@@ -55,14 +55,14 @@ Memo:
static READ8_HANDLER( fromance_commanddata_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
return state->commanddata;
}
static TIMER_CALLBACK( deferred_commanddata_w )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
state->commanddata = param;
state->directionflag = 1;
}
@@ -71,16 +71,16 @@ static TIMER_CALLBACK( deferred_commanddata_w )
static WRITE8_HANDLER( fromance_commanddata_w )
{
/* do this on a timer to let the slave CPU synchronize */
- space->machine->scheduler().synchronize(FUNC(deferred_commanddata_w), data);
+ space->machine().scheduler().synchronize(FUNC(deferred_commanddata_w), data);
}
static READ8_HANDLER( fromance_busycheck_main_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
/* set a timer to force synchronization after the read */
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
if (!state->directionflag)
return 0x00; // standby
@@ -91,7 +91,7 @@ static READ8_HANDLER( fromance_busycheck_main_r )
static READ8_HANDLER( fromance_busycheck_sub_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
if (state->directionflag)
return 0xff; // standby
@@ -102,7 +102,7 @@ static READ8_HANDLER( fromance_busycheck_sub_r )
static WRITE8_HANDLER( fromance_busycheck_sub_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->directionflag = 0;
}
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( fromance_busycheck_sub_w )
static WRITE8_HANDLER( fromance_rombank_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
@@ -129,7 +129,7 @@ static WRITE8_HANDLER( fromance_rombank_w )
static WRITE8_DEVICE_HANDLER( fromance_adpcm_reset_w )
{
- fromance_state *state = device->machine->driver_data<fromance_state>();
+ fromance_state *state = device->machine().driver_data<fromance_state>();
state->adpcm_reset = (data & 0x01);
state->vclk_left = 0;
@@ -139,7 +139,7 @@ static WRITE8_DEVICE_HANDLER( fromance_adpcm_reset_w )
static WRITE8_HANDLER( fromance_adpcm_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->adpcm_data = data;
state->vclk_left = 2;
}
@@ -147,7 +147,7 @@ static WRITE8_HANDLER( fromance_adpcm_w )
static void fromance_adpcm_int( device_t *device )
{
- fromance_state *state = device->machine->driver_data<fromance_state>();
+ fromance_state *state = device->machine().driver_data<fromance_state>();
/* skip if we're reset */
if (!state->adpcm_reset)
@@ -176,26 +176,26 @@ static void fromance_adpcm_int( device_t *device )
static WRITE8_HANDLER( fromance_portselect_w )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
state->portselect = data;
}
static READ8_HANDLER( fromance_keymatrix_r )
{
- fromance_state *state = space->machine->driver_data<fromance_state>();
+ fromance_state *state = space->machine().driver_data<fromance_state>();
int ret = 0xff;
if (state->portselect & 0x01)
- ret &= input_port_read(space->machine, "KEY1");
+ ret &= input_port_read(space->machine(), "KEY1");
if (state->portselect & 0x02)
- ret &= input_port_read(space->machine, "KEY2");
+ ret &= input_port_read(space->machine(), "KEY2");
if (state->portselect & 0x04)
- ret &= input_port_read(space->machine, "KEY3");
+ ret &= input_port_read(space->machine(), "KEY3");
if (state->portselect & 0x08)
- ret &= input_port_read(space->machine, "KEY4");
+ ret &= input_port_read(space->machine(), "KEY4");
if (state->portselect & 0x10)
- ret &= input_port_read(space->machine, "KEY5");
+ ret &= input_port_read(space->machine(), "KEY5");
return ret;
}
@@ -960,12 +960,12 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( fromance )
{
- fromance_state *state = machine->driver_data<fromance_state>();
- UINT8 *ROM = machine->region("sub")->base();
+ fromance_state *state = machine.driver_data<fromance_state>();
+ UINT8 *ROM = machine.region("sub")->base();
memory_configure_bank(machine, "bank1", 0, 0x100, &ROM[0x10000], 0x4000);
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->directionflag));
state->save_item(NAME(state->commanddata));
@@ -980,7 +980,7 @@ static MACHINE_START( fromance )
static MACHINE_RESET( fromance )
{
- fromance_state *state = machine->driver_data<fromance_state>();
+ fromance_state *state = machine.driver_data<fromance_state>();
int i;
state->directionflag = 0;
diff --git a/src/mame/drivers/funkybee.c b/src/mame/drivers/funkybee.c
index 30e59f2f779..8514644e95b 100644
--- a/src/mame/drivers/funkybee.c
+++ b/src/mame/drivers/funkybee.c
@@ -80,12 +80,12 @@ Stephh's notes (based on the games Z80 code and some tests) :
static READ8_HANDLER( funkybee_input_port_0_r )
{
watchdog_reset_r(space, 0);
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static WRITE8_HANDLER( funkybee_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static ADDRESS_MAP_START( funkybee_map, AS_PROGRAM, 8 )
@@ -280,14 +280,14 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( funkybee )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
state->save_item(NAME(state->gfx_bank));
}
static MACHINE_RESET( funkybee )
{
- funkybee_state *state = machine->driver_data<funkybee_state>();
+ funkybee_state *state = machine.driver_data<funkybee_state>();
state->gfx_bank = 0;
}
diff --git a/src/mame/drivers/funkyjet.c b/src/mame/drivers/funkyjet.c
index cff39ae0e12..249cefa3029 100644
--- a/src/mame/drivers/funkyjet.c
+++ b/src/mame/drivers/funkyjet.c
@@ -277,7 +277,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- funkyjet_state *driver_state = device->machine->driver_data<funkyjet_state>();
+ funkyjet_state *driver_state = device->machine().driver_data<funkyjet_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -299,11 +299,11 @@ static const deco16ic_interface funkyjet_deco16ic_tilegen1_intf =
static MACHINE_START( funkyjet )
{
- funkyjet_state *state = machine->driver_data<funkyjet_state>();
+ funkyjet_state *state = machine.driver_data<funkyjet_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->deco_tilegen1 = machine->device("tilegen1");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->deco_tilegen1 = machine.device("tilegen1");
}
static MACHINE_CONFIG_START( funkyjet, funkyjet_state )
diff --git a/src/mame/drivers/funworld.c b/src/mame/drivers/funworld.c
index 946e207c968..fb8de6a9f52 100644
--- a/src/mame/drivers/funworld.c
+++ b/src/mame/drivers/funworld.c
@@ -764,8 +764,8 @@ static WRITE8_DEVICE_HANDLER(funworld_lamp_a_w)
output_set_lamp_value(3, (data >> 7) & 1); /* button hold4/high */
output_set_lamp_value(5, 1-((data >> 5) & 1)); /* button 6 (collect/cancel) */
- coin_counter_w(device->machine, 0, data & 0x01); /* credit in counter */
- coin_counter_w(device->machine, 7, data & 0x04); /* credit out counter, mapped as coin 8 */
+ coin_counter_w(device->machine(), 0, data & 0x01); /* credit in counter */
+ coin_counter_w(device->machine(), 7, data & 0x04); /* credit out counter, mapped as coin 8 */
// popmessage("Lamps A: %02X", data);
}
@@ -810,7 +810,7 @@ static UINT8 funquiz_question_bank = 0x80;
static READ8_HANDLER( questions_r )
{
- UINT8* quiz = space->machine->region("questions")->base();
+ UINT8* quiz = space->machine().region("questions")->base();
int extraoffset = ((funquiz_question_bank & 0x1f) * 0x8000);
// if 0x80 is set, read the 2nd half of the question rom (contains header info)
@@ -4049,7 +4049,7 @@ static DRIVER_INIT( tabblue )
*****************************************************************************************************/
int x, na, nb, nad, nbd;
- UINT8 *src = machine->region( "gfx1" )->base();
+ UINT8 *src = machine.region( "gfx1" )->base();
for (x=0x0000; x < 0x10000; x++)
@@ -4079,7 +4079,7 @@ static DRIVER_INIT( magicd2a )
******************************************************************/
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0xc1c6] = 0x92;
}
@@ -4088,8 +4088,8 @@ static DRIVER_INIT( magicd2b )
/*** same as blue TAB PCB, with the magicd2a patch ***/
{
int x, na, nb, nad, nbd;
- UINT8 *src = machine->region( "gfx1" )->base();
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *src = machine.region( "gfx1" )->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (x=0x0000; x < 0x10000; x++)
{
@@ -4108,7 +4108,7 @@ static DRIVER_INIT( magicd2b )
static DRIVER_INIT( soccernw )
{
/* temporary patch to avoid hardware errors for debug purposes */
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x80b2] = 0xa9;
ROM[0x80b3] = 0x00;
@@ -4143,16 +4143,16 @@ static DRIVER_INIT( saloon )
*************************************************/
{
- UINT8 *rom = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0x8000;
- UINT8 *gfxrom = machine->region("gfx1")->base();
- int sizeg = machine->region("gfx1")->bytes();
+ UINT8 *gfxrom = machine.region("gfx1")->base();
+ int sizeg = machine.region("gfx1")->bytes();
int startg = 0;
- UINT8 *prom = machine->region("proms")->base();
- int sizep = machine->region("proms")->bytes();
+ UINT8 *prom = machine.region("proms")->base();
+ int sizep = machine.region("proms")->bytes();
int startp = 0;
UINT8 *buffer;
@@ -4237,8 +4237,8 @@ static DRIVER_INIT( multiwin )
******************************************************/
{
- UINT8 *ROM = machine->region("maincpu")->base();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine.region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4256,7 +4256,7 @@ static DRIVER_INIT( multiwin )
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x8000, 0xffff, machine->region("maincpu")->base() + 0x18000);
+ space->set_decrypted_region(0x8000, 0xffff, machine.region("maincpu")->base() + 0x18000);
}
static DRIVER_INIT( royalcdc )
@@ -4270,8 +4270,8 @@ static DRIVER_INIT( royalcdc )
******************************************************/
- UINT8 *ROM = machine->region("maincpu")->base();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *ROM = machine.region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int x;
@@ -4309,7 +4309,7 @@ static DRIVER_INIT( royalcdc )
ROM[x+0x10000] = code;
}
- space->set_decrypted_region(0x6000, 0xffff, machine->region("maincpu")->base() + 0x16000);
+ space->set_decrypted_region(0x6000, 0xffff, machine.region("maincpu")->base() + 0x16000);
}
diff --git a/src/mame/drivers/funybubl.c b/src/mame/drivers/funybubl.c
index 61574426ea1..69f6becc097 100644
--- a/src/mame/drivers/funybubl.c
+++ b/src/mame/drivers/funybubl.c
@@ -56,18 +56,18 @@ Note: SW2, SW3 & SW4 not populated
static WRITE8_HANDLER ( funybubl_vidram_bank_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
}
static WRITE8_HANDLER ( funybubl_cpurombank_w )
{
- memory_set_bank(space->machine, "bank2", data & 0x3f); // should we add a check that (data&0x3f) < #banks?
+ memory_set_bank(space->machine(), "bank2", data & 0x3f); // should we add a check that (data&0x3f) < #banks?
}
static WRITE8_HANDLER( funybubl_soundcommand_w )
{
- funybubl_state *state = space->machine->driver_data<funybubl_state>();
+ funybubl_state *state = space->machine().driver_data<funybubl_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -202,10 +202,10 @@ GFXDECODE_END
static MACHINE_START( funybubl )
{
- funybubl_state *state = machine->driver_data<funybubl_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ funybubl_state *state = machine.driver_data<funybubl_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->banked_vram));
diff --git a/src/mame/drivers/fuukifg2.c b/src/mame/drivers/fuukifg2.c
index 445dd28643a..f83165ae04e 100644
--- a/src/mame/drivers/fuukifg2.c
+++ b/src/mame/drivers/fuukifg2.c
@@ -53,26 +53,26 @@ To Do:
static WRITE16_HANDLER( fuuki16_vregs_w )
{
- fuuki16_state *state = space->machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = space->machine().driver_data<fuuki16_state>();
UINT16 old_data = state->vregs[offset];
UINT16 new_data = COMBINE_DATA(&state->vregs[offset]);
if ((offset == 0x1c/2) && old_data != new_data)
{
- const rectangle &visarea = space->machine->primary_screen->visible_area();
- attotime period = space->machine->primary_screen->frame_period();
- state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(new_data, visarea.max_x + 1), 0, period);
+ const rectangle &visarea = space->machine().primary_screen->visible_area();
+ attotime period = space->machine().primary_screen->frame_period();
+ state->raster_interrupt_timer->adjust(space->machine().primary_screen->time_until_pos(new_data, visarea.max_x + 1), 0, period);
}
}
static WRITE16_HANDLER( fuuki16_sound_command_w )
{
- fuuki16_state *state = space->machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = space->machine().driver_data<fuuki16_state>();
if (ACCESSING_BITS_0_7)
{
soundlatch_w(space,0,data & 0xff);
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
// device_spin_until_time(space->cpu, attotime::from_usec(50)); // Allow the other CPU to reply
- space->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters
+ space->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); // Fixes glitching in rasters
}
}
@@ -106,7 +106,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( fuuki16_sound_rombank_w )
{
if (data <= 2)
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
else
logerror("CPU #1 - PC %04X: unknown bank bits: %02X\n", cpu_get_pc(space->cpu), data);
}
@@ -376,7 +376,7 @@ GFXDECODE_END
static void soundirq( device_t *device, int state )
{
- fuuki16_state *fuuki16 = device->machine->driver_data<fuuki16_state>();
+ fuuki16_state *fuuki16 = device->machine().driver_data<fuuki16_state>();
device_set_input_line(fuuki16->audiocpu, 0, state);
}
@@ -399,51 +399,51 @@ static const ym3812_interface fuuki16_ym3812_intf =
static TIMER_CALLBACK( level_1_interrupt_callback )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
}
static TIMER_CALLBACK( vblank_interrupt_callback )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
device_set_input_line(state->maincpu, 3, HOLD_LINE); // VBlank IRQ
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
}
static TIMER_CALLBACK( raster_interrupt_callback )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE); // Raster Line IRQ
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
- state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ state->raster_interrupt_timer->adjust(machine.primary_screen->frame_period());
}
static MACHINE_START( fuuki16 )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 3, &ROM[0x10000], 0x8000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
- state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC(raster_interrupt_callback));
+ state->raster_interrupt_timer = machine.scheduler().timer_alloc(FUNC(raster_interrupt_callback));
}
static MACHINE_RESET( fuuki16 )
{
- fuuki16_state *state = machine->driver_data<fuuki16_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ fuuki16_state *state = machine.driver_data<fuuki16_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
- state->raster_interrupt_timer->adjust(machine->primary_screen->time_until_pos(0, visarea.max_x + 1));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ state->raster_interrupt_timer->adjust(machine.primary_screen->time_until_pos(0, visarea.max_x + 1));
}
diff --git a/src/mame/drivers/fuukifg3.c b/src/mame/drivers/fuukifg3.c
index cf00569c337..6bb6cf40dad 100644
--- a/src/mame/drivers/fuukifg3.c
+++ b/src/mame/drivers/fuukifg3.c
@@ -157,7 +157,7 @@ FG-3J ROM-J 507KA0301P04 Rev:1.3
static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
if(ACCESSING_BITS_16_31)
{
int r,g,b;
@@ -167,7 +167,7 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
g = (state->paletteram[offset] & 0x03e00000) >> (5 + 16);
b = (state->paletteram[offset] & 0x001f0000) >> (0 + 16);
- palette_set_color_rgb(space->machine, offset * 2, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset * 2, pal5bit(r), pal5bit(g), pal5bit(b));
}
if(ACCESSING_BITS_0_15)
@@ -179,7 +179,7 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
g = (state->paletteram[offset] & 0x000003e0) >> (5);
b = (state->paletteram[offset] & 0x0000001f) >> (0);
- palette_set_color_rgb(space->machine, offset * 2 + 1, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset * 2 + 1, pal5bit(r), pal5bit(g), pal5bit(b));
}
}
@@ -194,14 +194,14 @@ static WRITE32_HANDLER( paletteram32_xRRRRRGGGGGBBBBB_dword_w )
/* Sound comms */
static READ32_HANDLER( snd_020_r )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
UINT32 retdata = state->shared_ram[offset * 2] << 16 | state->shared_ram[(offset * 2) + 1];
return retdata;
}
static WRITE32_HANDLER( snd_020_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
if (ACCESSING_BITS_16_23)
state->shared_ram[offset * 2] = data >> 16;
@@ -212,16 +212,16 @@ static WRITE32_HANDLER( snd_020_w )
static WRITE32_HANDLER( fuuki32_vregs_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
if (state->vregs[offset] != data)
{
COMBINE_DATA(&state->vregs[offset]);
if (offset == 0x1c / 4)
{
- const rectangle &visarea = space->machine->primary_screen->visible_area();
- attotime period = space->machine->primary_screen->frame_period();
- state->raster_interrupt_timer->adjust(space->machine->primary_screen->time_until_pos(state->vregs[0x1c / 4] >> 16, visarea.max_x + 1), 0, period);
+ const rectangle &visarea = space->machine().primary_screen->visible_area();
+ attotime period = space->machine().primary_screen->frame_period();
+ state->raster_interrupt_timer->adjust(space->machine().primary_screen->time_until_pos(state->vregs[0x1c / 4] >> 16, visarea.max_x + 1), 0, period);
}
}
}
@@ -269,19 +269,19 @@ ADDRESS_MAP_END
static WRITE8_HANDLER ( fuuki32_sound_bw_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
static READ8_HANDLER( snd_z80_r )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
UINT8 retdata = state->shared_ram[offset];
return retdata;
}
static WRITE8_HANDLER( snd_z80_w )
{
- fuuki32_state *state = space->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = space->machine().driver_data<fuuki32_state>();
state->shared_ram[offset] = data;
}
@@ -485,40 +485,40 @@ GFXDECODE_END
static TIMER_CALLBACK( level_1_interrupt_callback )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
}
static TIMER_CALLBACK( vblank_interrupt_callback )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
device_set_input_line(state->maincpu, 3, HOLD_LINE); // VBlank IRQ
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
}
static TIMER_CALLBACK( raster_interrupt_callback )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
device_set_input_line(state->maincpu, 5, HOLD_LINE); // Raster Line IRQ
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
- state->raster_interrupt_timer->adjust(machine->primary_screen->frame_period());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
+ state->raster_interrupt_timer->adjust(machine.primary_screen->frame_period());
}
static MACHINE_START( fuuki32 )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
- UINT8 *ROM = machine->region("soundcpu")->base();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
+ UINT8 *ROM = machine.region("soundcpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x3e, &ROM[0x10000], 0x8000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
- state->raster_interrupt_timer = machine->scheduler().timer_alloc(FUNC(raster_interrupt_callback));
+ state->raster_interrupt_timer = machine.scheduler().timer_alloc(FUNC(raster_interrupt_callback));
state->save_item(NAME(state->spr_buffered_tilebank));
state->save_item(NAME(state->shared_ram));
@@ -527,18 +527,18 @@ static MACHINE_START( fuuki32 )
static MACHINE_RESET( fuuki32 )
{
- fuuki32_state *state = machine->driver_data<fuuki32_state>();
- const rectangle &visarea = machine->primary_screen->visible_area();
+ fuuki32_state *state = machine.driver_data<fuuki32_state>();
+ const rectangle &visarea = machine.primary_screen->visible_area();
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
- machine->scheduler().timer_set(machine->primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
- state->raster_interrupt_timer->adjust(machine->primary_screen->time_until_pos(0, visarea.max_x + 1));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(248), FUNC(level_1_interrupt_callback));
+ machine.scheduler().timer_set(machine.primary_screen->time_until_vblank_start(), FUNC(vblank_interrupt_callback));
+ state->raster_interrupt_timer->adjust(machine.primary_screen->time_until_pos(0, visarea.max_x + 1));
}
static void irqhandler( device_t *device, int irq )
{
- fuuki32_state *state = device->machine->driver_data<fuuki32_state>();
+ fuuki32_state *state = device->machine().driver_data<fuuki32_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
diff --git a/src/mame/drivers/gaelco.c b/src/mame/drivers/gaelco.c
index 2a68fcabeb5..bfc7ca426c2 100644
--- a/src/mame/drivers/gaelco.c
+++ b/src/mame/drivers/gaelco.c
@@ -23,7 +23,7 @@
static WRITE16_HANDLER( bigkarnk_sound_command_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
if (ACCESSING_BITS_0_7)
{
@@ -40,11 +40,11 @@ static WRITE16_HANDLER( bigkarnk_coin_w )
{
case 0x00: /* Coin Lockouts */
case 0x01:
- coin_lockout_w(space->machine, (offset >> 3) & 0x01, ~data & 0x01);
+ coin_lockout_w(space->machine(), (offset >> 3) & 0x01, ~data & 0x01);
break;
case 0x02: /* Coin Counters */
case 0x03:
- coin_counter_w(space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), (offset >> 3) & 0x01, data & 0x01);
break;
}
}
@@ -52,7 +52,7 @@ static WRITE16_HANDLER( bigkarnk_coin_w )
static WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7)
{
@@ -64,7 +64,7 @@ static WRITE16_HANDLER( OKIM6295_bankswitch_w )
static WRITE16_HANDLER( gaelco_vram_encrypted_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( gaelco_vram_encrypted_w )
static WRITE16_HANDLER(gaelco_encrypted_w)
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0f, 0x4228);
@@ -87,7 +87,7 @@ static WRITE16_HANDLER(gaelco_encrypted_w)
static WRITE16_HANDLER( thoop_vram_encrypted_w )
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_vram_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
@@ -98,7 +98,7 @@ static WRITE16_HANDLER( thoop_vram_encrypted_w )
static WRITE16_HANDLER(thoop_encrypted_w)
{
- gaelco_state *state = space->machine->driver_data<gaelco_state>();
+ gaelco_state *state = space->machine().driver_data<gaelco_state>();
// mame_printf_debug("gaelco_encrypted_w!!\n");
data = gaelco_decrypt(space, offset, data, 0x0e, 0x4228);
@@ -492,9 +492,9 @@ GFXDECODEINFO(0x100000,64)
static MACHINE_START( gaelco )
{
- gaelco_state *state = machine->driver_data<gaelco_state>();
+ gaelco_state *state = machine.driver_data<gaelco_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( bigkarnk, gaelco_state )
diff --git a/src/mame/drivers/gaelco2.c b/src/mame/drivers/gaelco2.c
index fdb2bd74f72..0faa7f4bc6d 100644
--- a/src/mame/drivers/gaelco2.c
+++ b/src/mame/drivers/gaelco2.c
@@ -209,10 +209,10 @@ ROM_END
BANG
============================================================================*/
-static READ16_HANDLER(p1_gun_x) {return (input_port_read(space->machine, "LIGHT0_X") * 320 / 0x100) + 1;}
-static READ16_HANDLER(p1_gun_y) {return (input_port_read(space->machine, "LIGHT0_Y") * 240 / 0x100) - 4;}
-static READ16_HANDLER(p2_gun_x) {return (input_port_read(space->machine, "LIGHT1_X") * 320 / 0x100) + 1;}
-static READ16_HANDLER(p2_gun_y) {return (input_port_read(space->machine, "LIGHT1_Y") * 240 / 0x100) - 4;}
+static READ16_HANDLER(p1_gun_x) {return (input_port_read(space->machine(), "LIGHT0_X") * 320 / 0x100) + 1;}
+static READ16_HANDLER(p1_gun_y) {return (input_port_read(space->machine(), "LIGHT0_Y") * 240 / 0x100) - 4;}
+static READ16_HANDLER(p2_gun_x) {return (input_port_read(space->machine(), "LIGHT1_X") * 320 / 0x100) + 1;}
+static READ16_HANDLER(p2_gun_y) {return (input_port_read(space->machine(), "LIGHT1_Y") * 240 / 0x100) - 4;}
static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16 )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */
diff --git a/src/mame/drivers/gaelco3d.c b/src/mame/drivers/gaelco3d.c
index c3f8592174a..200020eac95 100644
--- a/src/mame/drivers/gaelco3d.c
+++ b/src/mame/drivers/gaelco3d.c
@@ -162,9 +162,9 @@ static void adsp_tx_callback(adsp21xx_device &device, int port, INT32 data);
static WRITE_LINE_DEVICE_HANDLER( ser_irq )
{
if (state)
- cputag_set_input_line(device->machine, "maincpu", 6, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 6, ASSERT_LINE);
else
- cputag_set_input_line(device->machine, "maincpu", 6, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 6, CLEAR_LINE);
}
@@ -184,7 +184,7 @@ static const gaelco_serial_interface serial_interface =
static MACHINE_START( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
/* Save state support */
state_save_register_global(machine, state->sound_data);
state_save_register_global(machine, state->sound_status);
@@ -199,14 +199,14 @@ static MACHINE_START( gaelco3d )
static MACHINE_RESET( common )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
UINT16 *src;
int i;
state->framenum = 0;
/* boot the ADSP chip */
- src = (UINT16 *)machine->region("user1")->base();
+ src = (UINT16 *)machine.region("user1")->base();
for (i = 0; i < (src[3] & 0xff) * 8; i++)
{
UINT32 opcode = ((src[i*4+0] & 0xff) << 16) | ((src[i*4+1] & 0xff) << 8) | (src[i*4+2] & 0xff);
@@ -214,9 +214,9 @@ static MACHINE_RESET( common )
}
/* allocate a timer for feeding the autobuffer */
- state->adsp_autobuffer_timer = machine->device<timer_device>("adsp_timer");
+ state->adsp_autobuffer_timer = machine.device<timer_device>("adsp_timer");
- memory_configure_bank(machine, "bank1", 0, 256, machine->region("user1")->base(), 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 256, machine.region("user1")->base(), 0x4000);
memory_set_bank(machine, "bank1", 0);
/* keep the TMS32031 halted until the code is ready to go */
@@ -226,14 +226,14 @@ static MACHINE_RESET( common )
{
char buffer[10];
sprintf(buffer, "dac%d", i + 1);
- state->dmadac[i] = machine->device<dmadac_sound_device>(buffer);
+ state->dmadac[i] = machine.device<dmadac_sound_device>(buffer);
}
}
static MACHINE_RESET( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
MACHINE_RESET_CALL( common );
state->tms_offset_xor = 0;
}
@@ -241,7 +241,7 @@ static MACHINE_RESET( gaelco3d )
static MACHINE_RESET( gaelco3d2 )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
MACHINE_RESET_CALL( common );
state->tms_offset_xor = BYTE_XOR_BE(0);
}
@@ -256,14 +256,14 @@ static MACHINE_RESET( gaelco3d2 )
static INTERRUPT_GEN( vblank_gen )
{
- gaelco3d_render(*device->machine->primary_screen);
+ gaelco3d_render(*device->machine().primary_screen);
device_set_input_line(device, 2, ASSERT_LINE);
}
static WRITE16_HANDLER( irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
}
static WRITE32_HANDLER( irq_ack32_w )
@@ -271,7 +271,7 @@ static WRITE32_HANDLER( irq_ack32_w )
if (mem_mask == 0xffff0000)
irq_ack_w(space, offset, data, mem_mask >> 16);
else if (ACCESSING_BITS_0_7)
- gaelco_serial_tr_w(space->machine->device("serial"), 0, data & 0x01);
+ gaelco_serial_tr_w(space->machine().device("serial"), 0, data & 0x01);
else
logerror("%06X:irq_ack_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
}
@@ -293,7 +293,7 @@ static READ16_DEVICE_HANDLER( eeprom_data_r )
/* bit 0 is clock */
/* bit 1 active */
result &= ~GAELCOSER_EXT_STATUS_MASK;
- result |= gaelco_serial_status_r(device->machine->device("serial"), 0);
+ result |= gaelco_serial_status_r(device->machine().device("serial"), 0);
}
if (eeprom_read_bit(device))
@@ -309,13 +309,13 @@ static READ32_DEVICE_HANDLER( eeprom_data32_r )
return (eeprom_data_r(device, 0, mem_mask >> 16) << 16) | 0xffff;
else if (ACCESSING_BITS_0_7)
{
- UINT8 data = gaelco_serial_data_r(device->machine->device("serial"),0);
+ UINT8 data = gaelco_serial_data_r(device->machine().device("serial"),0);
if (LOG)
- logerror("%06X:read(%02X) = %08X & %08X\n", cpu_get_pc(device->machine->device("maincpu")), offset, data, mem_mask);
+ logerror("%06X:read(%02X) = %08X & %08X\n", cpu_get_pc(device->machine().device("maincpu")), offset, data, mem_mask);
return data | 0xffffff00;
}
else
- logerror("%06X:read(%02X) = mask %08X\n", cpu_get_pc(device->machine->device("maincpu")), offset, mem_mask);
+ logerror("%06X:read(%02X) = mask %08X\n", cpu_get_pc(device->machine().device("maincpu")), offset, mem_mask);
return 0xffffffff;
}
@@ -353,7 +353,7 @@ static WRITE16_DEVICE_HANDLER( eeprom_cs_w )
static TIMER_CALLBACK( delayed_sound_w )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
if (LOG)
logerror("delayed_sound_w(%02X)\n", param);
state->sound_data = param;
@@ -366,23 +366,23 @@ static WRITE16_HANDLER( sound_data_w )
if (LOG)
logerror("%06X:sound_data_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_w), data & 0xff);
}
static READ16_HANDLER( sound_data_r )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("sound_data_r(%02X)\n", state->sound_data);
- cputag_set_input_line(space->machine, "adsp", ADSP2115_IRQ2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "adsp", ADSP2115_IRQ2, CLEAR_LINE);
return state->sound_data;
}
static READ16_HANDLER( sound_status_r )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("%06X:sound_status_r(%02X) = %02X\n", cpu_get_pc(space->cpu), offset, state->sound_status);
if (ACCESSING_BITS_0_7)
@@ -393,7 +393,7 @@ static READ16_HANDLER( sound_status_r )
static WRITE16_HANDLER( sound_status_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("sound_status_w(%02X)\n", state->sound_data);
state->sound_status = data;
@@ -409,7 +409,7 @@ static WRITE16_HANDLER( sound_status_w )
static CUSTOM_INPUT( analog_bit_r )
{
- gaelco3d_state *state = field->port->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = field->port->machine().driver_data<gaelco3d_state>();
int which = (FPTR)param;
return (state->analog_ports[which] >> 7) & 0x01;
}
@@ -417,7 +417,7 @@ static CUSTOM_INPUT( analog_bit_r )
static WRITE16_HANDLER( analog_port_clock_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
/* a zero/one combo is written here to clock the next analog port bit */
if (ACCESSING_BITS_0_7)
{
@@ -439,16 +439,16 @@ static WRITE16_HANDLER( analog_port_clock_w )
static WRITE16_HANDLER( analog_port_latch_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
/* a zero is written here to read the analog ports, and a one is written when finished */
if (ACCESSING_BITS_0_7)
{
if (!(data & 0xff))
{
- state->analog_ports[0] = input_port_read_safe(space->machine, "ANALOG0", 0);
- state->analog_ports[1] = input_port_read_safe(space->machine, "ANALOG1", 0);
- state->analog_ports[2] = input_port_read_safe(space->machine, "ANALOG2", 0);
- state->analog_ports[3] = input_port_read_safe(space->machine, "ANALOG3", 0);
+ state->analog_ports[0] = input_port_read_safe(space->machine(), "ANALOG0", 0);
+ state->analog_ports[1] = input_port_read_safe(space->machine(), "ANALOG1", 0);
+ state->analog_ports[2] = input_port_read_safe(space->machine(), "ANALOG2", 0);
+ state->analog_ports[3] = input_port_read_safe(space->machine(), "ANALOG3", 0);
}
}
else
@@ -469,7 +469,7 @@ static WRITE16_HANDLER( analog_port_latch_w )
static READ32_HANDLER( tms_m68k_ram_r )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
// logerror("%06X:tms_m68k_ram_r(%04X) = %08X\n", cpu_get_pc(space->cpu), offset, !(offset & 1) ? ((INT32)state->m68k_ram_base[offset/2] >> 16) : (int)(INT16)state->m68k_ram_base[offset/2]);
return (INT32)(INT16)state->m68k_ram_base[offset ^ state->tms_offset_xor];
}
@@ -477,7 +477,7 @@ static READ32_HANDLER( tms_m68k_ram_r )
static WRITE32_HANDLER( tms_m68k_ram_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
state->m68k_ram_base[offset ^ state->tms_offset_xor] = data;
}
@@ -503,7 +503,7 @@ static WRITE16_HANDLER( tms_reset_w )
/* it does not ever appear to be touched after that */
if (LOG)
logerror("%06X:tms_reset_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
- cputag_set_input_line(space->machine, "tms", INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "tms", INPUT_LINE_RESET, (data == 0xffff) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -514,7 +514,7 @@ static WRITE16_HANDLER( tms_irq_w )
if (LOG)
logerror("%06X:tms_irq_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset, data, mem_mask);
if (ACCESSING_BITS_0_7)
- cputag_set_input_line(space->machine, "tms", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "tms", 0, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -527,7 +527,7 @@ static WRITE16_HANDLER( tms_control3_w )
static WRITE16_HANDLER( tms_comm_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
COMBINE_DATA(&state->tms_comm_base[offset ^ state->tms_offset_xor]);
if (LOG)
logerror("%06X:tms_comm_w(%02X) = %08X & %08X\n", cpu_get_pc(space->cpu), offset*2, data, mem_mask);
@@ -574,7 +574,7 @@ ADSP control 3FFF W = 0C08 (SYSCONTROL_REG)
static WRITE16_HANDLER( adsp_control_w )
{
- gaelco3d_state *state = space->machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = space->machine().driver_data<gaelco3d_state>();
if (LOG)
logerror("ADSP control %04X W = %04X\n", 0x3fe0 + offset, data);
@@ -613,7 +613,7 @@ static WRITE16_HANDLER( adsp_rombank_w )
{
if (LOG)
logerror("adsp_rombank_w(%d) = %04X\n", offset, data);
- memory_set_bank(space->machine, "bank1", (offset & 1) * 0x80 + (data & 0x7f));
+ memory_set_bank(space->machine(), "bank1", (offset & 1) * 0x80 + (data & 0x7f));
}
@@ -626,8 +626,8 @@ static WRITE16_HANDLER( adsp_rombank_w )
static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
{
- gaelco3d_state *state = timer.machine->driver_data<gaelco3d_state>();
- cpu_device *adsp = timer.machine->device<cpu_device>("adsp");
+ gaelco3d_state *state = timer.machine().driver_data<gaelco3d_state>();
+ cpu_device *adsp = timer.machine().device<cpu_device>("adsp");
/* get the index register */
int reg = adsp->state(ADSP2100_I0 + state->adsp_ireg);
@@ -657,7 +657,7 @@ static TIMER_DEVICE_CALLBACK( adsp_autobuffer_irq )
static void adsp_tx_callback(adsp21xx_device &device, int port, INT32 data)
{
- gaelco3d_state *state = device.machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = device.machine().driver_data<gaelco3d_state>();
/* check if it's for SPORT1 */
if (port != 1)
return;
@@ -1207,18 +1207,18 @@ ROM_END
static DRIVER_INIT( gaelco3d )
{
- gaelco3d_state *state = machine->driver_data<gaelco3d_state>();
+ gaelco3d_state *state = machine.driver_data<gaelco3d_state>();
UINT8 *src, *dst;
int x, y;
/* allocate memory */
- state->texture_size = machine->region("gfx1")->bytes();
- state->texmask_size = machine->region("gfx2")->bytes() * 8;
+ state->texture_size = machine.region("gfx1")->bytes();
+ state->texmask_size = machine.region("gfx2")->bytes() * 8;
state->texture = auto_alloc_array(machine, UINT8, state->texture_size);
state->texmask = auto_alloc_array(machine, UINT8, state->texmask_size);
/* first expand the pixel data */
- src = machine->region("gfx1")->base();
+ src = machine.region("gfx1")->base();
dst = state->texture;
for (y = 0; y < state->texture_size/4096; y += 2)
for (x = 0; x < 4096; x += 2)
@@ -1230,7 +1230,7 @@ static DRIVER_INIT( gaelco3d )
}
/* then expand the mask data */
- src = machine->region("gfx2")->base();
+ src = machine.region("gfx2")->base();
dst = state->texmask;
for (y = 0; y < state->texmask_size/4096; y++)
for (x = 0; x < 4096; x++)
diff --git a/src/mame/drivers/gaiden.c b/src/mame/drivers/gaiden.c
index 8eebf0111ac..5220268b23a 100644
--- a/src/mame/drivers/gaiden.c
+++ b/src/mame/drivers/gaiden.c
@@ -138,7 +138,7 @@ Notes:
static WRITE16_HANDLER( gaiden_sound_command_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_0_7)
soundlatch_w(space, 0, data & 0xff); /* Ninja Gaiden */
@@ -149,7 +149,7 @@ static WRITE16_HANDLER( gaiden_sound_command_w )
static WRITE16_HANDLER( drgnbowl_sound_command_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_8_15)
{
@@ -166,7 +166,7 @@ static WRITE16_HANDLER( drgnbowl_sound_command_w )
static WRITE16_HANDLER( wildfang_protection_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_8_15)
{
@@ -217,7 +217,7 @@ static WRITE16_HANDLER( wildfang_protection_w )
static READ16_HANDLER( wildfang_protection_r )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
// logerror("PC %06x: read prot %02x\n", cpu_get_pc(space->cpu), state->prot);
return state->prot;
}
@@ -295,7 +295,7 @@ static const int jumppoints_other[0x100] =
static MACHINE_RESET( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
state->prot = 0;
state->jumpcode = 0;
@@ -315,8 +315,8 @@ static MACHINE_RESET( raiga )
static MACHINE_START( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
- state->audiocpu = machine->device("audiocpu");
+ gaiden_state *state = machine.driver_data<gaiden_state>();
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->prot));
state->save_item(NAME(state->jumpcode));
@@ -336,7 +336,7 @@ static MACHINE_START( raiga )
static WRITE16_HANDLER( raiga_protection_w )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
if (ACCESSING_BITS_8_15)
{
@@ -388,7 +388,7 @@ static WRITE16_HANDLER( raiga_protection_w )
static READ16_HANDLER( raiga_protection_r )
{
- gaiden_state *state = space->machine->driver_data<gaiden_state>();
+ gaiden_state *state = space->machine().driver_data<gaiden_state>();
// logerror("PC %06x: read prot %02x\n", cpu_get_pc(space->cpu), state->prot);
return state->prot;
}
@@ -750,7 +750,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- gaiden_state *state = device->machine->driver_data<gaiden_state>();
+ gaiden_state *state = device->machine().driver_data<gaiden_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -1491,7 +1491,7 @@ ROM_END
static DRIVER_INIT( shadoww )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* sprite size Y = sprite size X */
state->sprite_sizey = 0;
state->raiga_jumppoints = jumppoints_00;
@@ -1499,35 +1499,35 @@ static DRIVER_INIT( shadoww )
static DRIVER_INIT( wildfang )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* sprite size Y = sprite size X */
state->sprite_sizey = 0;
state->raiga_jumppoints = jumppoints_00;
state->prot = 0;
state->jumpcode = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(wildfang_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(wildfang_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(wildfang_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(wildfang_protection_w));
}
static DRIVER_INIT( raiga )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
/* sprite size Y independent from sprite size X */
state->sprite_sizey = 2;
state->raiga_jumppoints = jumppoints_00;
state->prot = 0;
state->jumpcode = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(raiga_protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(raiga_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x07a006, 0x07a007, FUNC(raiga_protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x07a804, 0x07a805, FUNC(raiga_protection_w));
}
-static void descramble_drgnbowl_gfx(running_machine *machine)
+static void descramble_drgnbowl_gfx(running_machine &machine)
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
UINT8 *buffer = auto_alloc_array(machine, UINT8, size);
memcpy(buffer, ROM, size);
@@ -1543,8 +1543,8 @@ static void descramble_drgnbowl_gfx(running_machine *machine)
auto_free(machine, buffer);
- ROM = machine->region("gfx2")->base();
- size = machine->region("gfx2")->bytes();
+ ROM = machine.region("gfx2")->base();
+ size = machine.region("gfx2")->bytes();
buffer = auto_alloc_array(machine, UINT8, size);
memcpy(buffer,ROM,size);
@@ -1564,13 +1564,13 @@ static void descramble_drgnbowl_gfx(running_machine *machine)
static DRIVER_INIT( drgnbowl )
{
- gaiden_state *state = machine->driver_data<gaiden_state>();
+ gaiden_state *state = machine.driver_data<gaiden_state>();
state->raiga_jumppoints = jumppoints_00;
descramble_drgnbowl_gfx(machine);
}
-static void descramble_mastninj_gfx(running_machine *machine, UINT8* src)
+static void descramble_mastninj_gfx(running_machine &machine, UINT8* src)
{
UINT8 *buffer;
int len = 0x80000;
@@ -1614,8 +1614,8 @@ static void descramble_mastninj_gfx(running_machine *machine, UINT8* src)
static DRIVER_INIT(mastninj)
{
// rearrange the graphic roms into a format that MAME can decode
- descramble_mastninj_gfx(machine, machine->region("gfx2")->base());
- descramble_mastninj_gfx(machine, machine->region("gfx3")->base());
+ descramble_mastninj_gfx(machine, machine.region("gfx2")->base());
+ descramble_mastninj_gfx(machine, machine.region("gfx3")->base());
DRIVER_INIT_CALL(shadoww);
}
diff --git a/src/mame/drivers/gal3.c b/src/mame/drivers/gal3.c
index cf42c2c1038..c737a835a5c 100644
--- a/src/mame/drivers/gal3.c
+++ b/src/mame/drivers/gal3.c
@@ -159,7 +159,7 @@ static VIDEO_START(gal3)
}
-static void update_palette( running_machine *machine )
+static void update_palette( running_machine &machine )
{
int i;
INT16 data1,data2;
@@ -167,8 +167,8 @@ static void update_palette( running_machine *machine )
for( i=0; i<NAMCOS21_NUM_COLORS; i++ )
{
- data1 = machine->generic.paletteram.u16[0x00000/2+i];
- data2 = machine->generic.paletteram.u16[0x10000/2+i];
+ data1 = machine.generic.paletteram.u16[0x00000/2+i];
+ data2 = machine.generic.paletteram.u16[0x10000/2+i];
r = data1>>8;
g = data1&0xff;
@@ -180,27 +180,27 @@ static void update_palette( running_machine *machine )
static SCREEN_UPDATE(gal3)
{
- gal3_state *state = screen->machine->driver_data<gal3_state>();
+ gal3_state *state = screen->machine().driver_data<gal3_state>();
int i;
char mst[18], slv[18];
static int pivot = 15;
int pri;
- update_palette(screen->machine);
+ update_palette(screen->machine());
- if( input_code_pressed_once(screen->machine, KEYCODE_H)&&(pivot<15) ) pivot+=1;
- if( input_code_pressed_once(screen->machine, KEYCODE_J)&&(pivot>0) ) pivot-=1;
+ if( input_code_pressed_once(screen->machine(), KEYCODE_H)&&(pivot<15) ) pivot+=1;
+ if( input_code_pressed_once(screen->machine(), KEYCODE_J)&&(pivot>0) ) pivot-=1;
for( pri=0; pri<pivot; pri++ )
{
- namco_obj_draw(screen->machine, bitmap, cliprect, pri );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, pri );
}
/* CopyVisiblePolyFrameBuffer( bitmap, cliprect,0,0x7fbf );
for( pri=pivot; pri<15; pri++ )
{
- namco_obj_draw(screen->machine, bitmap, cliprect, pri );
+ namco_obj_draw(screen->machine(), bitmap, cliprect, pri );
}*/
// CPU Diag LEDs
@@ -234,7 +234,7 @@ static SCREEN_UPDATE(gal3)
static NVRAM_HANDLER( gal3 )
{
- gal3_state *state = machine->driver_data<gal3_state>();
+ gal3_state *state = machine.driver_data<gal3_state>();
int i;
UINT8 data[4];
if( read_or_write )
@@ -271,26 +271,26 @@ static NVRAM_HANDLER( gal3 )
static READ32_HANDLER( shareram0_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->mpSharedRAM0[offset];
}
static WRITE32_HANDLER( shareram0_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA( &state->mpSharedRAM0[offset] );
}
#if 0
static READ32_HANDLER( shareram1_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->mpSharedRAM1[offset];
}
static WRITE32_HANDLER( shareram1_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA( &state->mpSharedRAM1[offset] );
}
#endif
@@ -299,25 +299,25 @@ static WRITE32_HANDLER( shareram1_w )
static READ32_HANDLER( led_mst_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->led_mst;
}
static WRITE32_HANDLER( led_mst_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA(&state->led_mst);
}
static READ32_HANDLER( led_slv_r )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->led_slv;
}
static WRITE32_HANDLER( led_slv_w )
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
COMBINE_DATA(&state->led_slv);
}
@@ -326,28 +326,28 @@ static WRITE32_HANDLER( led_slv_w )
static READ32_HANDLER( paletteram32_r )
{
offset *= 2;
- return (space->machine->generic.paletteram.u16[offset]<<16)|space->machine->generic.paletteram.u16[offset+1];
+ return (space->machine().generic.paletteram.u16[offset]<<16)|space->machine().generic.paletteram.u16[offset+1];
}
static WRITE32_HANDLER( paletteram32_w )
{
UINT32 v;
offset *= 2;
- v = (space->machine->generic.paletteram.u16[offset]<<16)|space->machine->generic.paletteram.u16[offset+1];
+ v = (space->machine().generic.paletteram.u16[offset]<<16)|space->machine().generic.paletteram.u16[offset+1];
COMBINE_DATA( &v );
- space->machine->generic.paletteram.u16[offset+0] = v>>16;
- space->machine->generic.paletteram.u16[offset+1] = v&0xffff;
+ space->machine().generic.paletteram.u16[offset+0] = v>>16;
+ space->machine().generic.paletteram.u16[offset+1] = v&0xffff;
}
static READ32_HANDLER(namcos21_video_enable_r)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
return state->namcos21_video_enable<<16;
}
static WRITE32_HANDLER(namcos21_video_enable_w)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
UINT32 v;
v = state->namcos21_video_enable<<16;
COMBINE_DATA( &v ); // 0xff53, instead of 0x40 in namcos21
@@ -356,7 +356,7 @@ static WRITE32_HANDLER(namcos21_video_enable_w)
static READ32_HANDLER(rso_r)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
/*store $5555 @$0046, and readback @$0000
read @$0144 and store at A6_21e & A4_5c
Check @$009a==1 to start DEMO
@@ -367,7 +367,7 @@ static READ32_HANDLER(rso_r)
static WRITE32_HANDLER(rso_w)
{
- gal3_state *state = space->machine->driver_data<gal3_state>();
+ gal3_state *state = space->machine().driver_data<gal3_state>();
UINT32 v;
offset *= 2;
v = (state->rsoSharedRAM[offset]<<16)|state->rsoSharedRAM[offset+1];
diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c
index 4b233d03398..e0e31443a5e 100644
--- a/src/mame/drivers/galaga.c
+++ b/src/mame/drivers/galaga.c
@@ -717,49 +717,49 @@ static READ8_HANDLER( bosco_dsw_r )
{
int bit0,bit1;
- bit0 = (input_port_read(space->machine, "DSWB") >> offset) & 1;
- bit1 = (input_port_read(space->machine, "DSWA") >> offset) & 1;
+ bit0 = (input_port_read(space->machine(), "DSWB") >> offset) & 1;
+ bit1 = (input_port_read(space->machine(), "DSWA") >> offset) & 1;
return bit0 | (bit1 << 1);
}
static WRITE8_HANDLER( galaga_flip_screen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
static WRITE8_HANDLER( bosco_flip_screen_w )
{
- flip_screen_set(space->machine, ~data & 1);
+ flip_screen_set(space->machine(), ~data & 1);
}
static WRITE8_HANDLER( bosco_latch_w )
{
- galaga_state *state = space->machine->driver_data<galaga_state>();
+ galaga_state *state = space->machine().driver_data<galaga_state>();
int bit = data & 1;
switch (offset)
{
case 0x00: /* IRQ1 */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x01: /* IRQ2 */
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02: /* NMION */
- cpu_interrupt_enable(space->machine->device("sub2"), !bit);
+ cpu_interrupt_enable(space->machine().device("sub2"), !bit);
break;
case 0x03: /* RESET */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x04: /* n.c. */
@@ -779,19 +779,19 @@ static WRITE8_HANDLER( bosco_latch_w )
}
}
-static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine, (const char *)param) >> 4; }
+static CUSTOM_INPUT( shifted_port_r ) { return input_port_read(field->port->machine(), (const char *)param) >> 4; }
static WRITE8_DEVICE_HANDLER( out_0 )
{
- set_led_status(device->machine, 1,data & 1);
- set_led_status(device->machine, 0,data & 2);
- coin_counter_w(device->machine, 1,~data & 4);
- coin_counter_w(device->machine, 0,~data & 8);
+ set_led_status(device->machine(), 1,data & 1);
+ set_led_status(device->machine(), 0,data & 2);
+ coin_counter_w(device->machine(), 1,~data & 4);
+ coin_counter_w(device->machine(), 0,~data & 8);
}
static WRITE8_DEVICE_HANDLER( out_1 )
{
- coin_lockout_global_w(device->machine, data & 1);
+ coin_lockout_global_w(device->machine(), data & 1);
}
static const namco_51xx_interface namco_51xx_intf =
@@ -811,7 +811,7 @@ static const namco_51xx_interface namco_51xx_intf =
static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
{
- UINT32 length = device->machine->region("52xx")->bytes();
+ UINT32 length = device->machine().region("52xx")->bytes();
//printf("ROM read %04X\n", offset);
if (!(offset & 0x1000))
offset = (offset & 0xfff) | 0x0000;
@@ -821,7 +821,7 @@ static READ8_DEVICE_HANDLER( namco_52xx_rom_r )
offset = (offset & 0xfff) | 0x2000;
else if (!(offset & 0x8000))
offset = (offset & 0xfff) | 0x3000;
- return (offset < length) ? device->machine->region("52xx")->base()[offset] : 0xff;
+ return (offset < length) ? device->machine().region("52xx")->base()[offset] : 0xff;
}
static READ8_DEVICE_HANDLER( namco_52xx_si_r )
@@ -842,7 +842,7 @@ static const namco_52xx_interface namco_52xx_intf =
static READ8_DEVICE_HANDLER( custom_mod_r )
{
- galaga_state *state = device->machine->driver_data<galaga_state>();
+ galaga_state *state = device->machine().driver_data<galaga_state>();
/* MOD0-2 is connected to K1-3; K0 is left unconnected */
return state->custom_mod << 1;
}
@@ -862,33 +862,33 @@ static const namco_53xx_interface namco_53xx_intf =
static TIMER_CALLBACK( cpu3_interrupt_callback )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
int scanline = param;
- nmi_line_pulse(machine->device("sub2"));
+ nmi_line_pulse(machine.device("sub2"));
scanline = scanline + 128;
if (scanline >= 272)
scanline = 64;
/* the vertical synch chain is clocked by H256 -- this is probably not important, but oh well */
- state->cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->cpu3_interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( galaga )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
/* create the interrupt timer */
- state->cpu3_interrupt_timer = machine->scheduler().timer_alloc(FUNC(cpu3_interrupt_callback));
+ state->cpu3_interrupt_timer = machine.scheduler().timer_alloc(FUNC(cpu3_interrupt_callback));
state->custom_mod = 0;
state_save_register_global(machine, state->custom_mod);
}
-static void bosco_latch_reset(running_machine *machine)
+static void bosco_latch_reset(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -898,12 +898,12 @@ static void bosco_latch_reset(running_machine *machine)
static MACHINE_RESET( galaga )
{
- galaga_state *state = machine->driver_data<galaga_state>();
+ galaga_state *state = machine.driver_data<galaga_state>();
/* Reset all latches */
bosco_latch_reset(machine);
- state->cpu3_interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ state->cpu3_interrupt_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
}
static MACHINE_RESET( battles )
@@ -3193,8 +3193,8 @@ ROM_END
static DRIVER_INIT (galaga)
{
/* swap bytes for flipped character so we can decode them together with normal characters */
- UINT8 *rom = machine->region("gfx1")->base();
- int i, len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int i, len = machine.region("gfx1")->bytes();
for (i = 0;i < len;i++)
{
@@ -3212,7 +3212,7 @@ static DRIVER_INIT (gatsbee)
DRIVER_INIT_CALL(galaga);
/* Gatsbee has a larger character ROM, we need a handler for banking */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1000, 0x1000, FUNC(gatsbee_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1000, 0x1000, FUNC(gatsbee_bank_w));
}
@@ -3221,7 +3221,7 @@ static DRIVER_INIT( xevious )
UINT8 *rom;
int i;
- rom = machine->region("gfx3")->base() + 0x5000;
+ rom = machine.region("gfx3")->base() + 0x5000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
}
@@ -3233,14 +3233,14 @@ static DRIVER_INIT( xevios )
/* convert one of the sprite ROMs to the format used by Xevious */
- rom = machine->region("gfx3")->base();
+ rom = machine.region("gfx3")->base();
for (A = 0x5000;A < 0x7000;A++)
{
rom[A] = BITSWAP8(rom[A],1,3,5,7,0,2,4,6);
}
/* convert one of tile map ROMs to the format used by Xevious */
- rom = machine->region("gfx4")->base();
+ rom = machine.region("gfx4")->base();
for (A = 0x0000;A < 0x1000;A++)
{
rom[A] = BITSWAP8(rom[A],3,7,5,1,2,6,4,0);
@@ -3253,8 +3253,8 @@ static DRIVER_INIT( xevios )
static DRIVER_INIT( battles )
{
/* replace the Namco I/O handlers with interface to the 4th CPU */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7000, 0x700f, FUNC(battles_customio_data0_r), FUNC(battles_customio_data0_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x7100, 0x7100, FUNC(battles_customio0_r), FUNC(battles_customio0_w) );
DRIVER_INIT_CALL(xevious);
}
diff --git a/src/mame/drivers/galastrm.c b/src/mame/drivers/galastrm.c
index 2b6da92ef25..61cf10a4600 100644
--- a/src/mame/drivers/galastrm.c
+++ b/src/mame/drivers/galastrm.c
@@ -50,7 +50,7 @@ $305.b invincibility
static INTERRUPT_GEN( galastrm_interrupt )
{
- galastrm_state *state = device->machine->driver_data<galastrm_state>();
+ galastrm_state *state = device->machine().driver_data<galastrm_state>();
state->frame_counter ^= 1;
device_set_input_line(device, 5, HOLD_LINE);
}
@@ -64,16 +64,16 @@ static TIMER_CALLBACK( galastrm_interrupt6 )
static WRITE32_HANDLER( galastrm_palette_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
if (ACCESSING_BITS_16_31)
state->tc0110pcr_addr = data >> 16;
if ((ACCESSING_BITS_0_15) && (state->tc0110pcr_addr < 4096))
- palette_set_color_rgb(space->machine, state->tc0110pcr_addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ palette_set_color_rgb(space->machine(), state->tc0110pcr_addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static WRITE32_HANDLER( galastrm_tc0610_0_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
if (ACCESSING_BITS_16_31)
state->tc0610_0_addr = data >> 16;
if ((ACCESSING_BITS_0_15) && (state->tc0610_0_addr < 8))
@@ -82,7 +82,7 @@ static WRITE32_HANDLER( galastrm_tc0610_0_w )
static WRITE32_HANDLER( galastrm_tc0610_1_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
if (ACCESSING_BITS_16_31)
state->tc0610_1_addr = data >> 16;
if ((ACCESSING_BITS_0_15) && (state->tc0610_1_addr < 8))
@@ -92,19 +92,19 @@ static WRITE32_HANDLER( galastrm_tc0610_1_w )
static CUSTOM_INPUT( frame_counter_r )
{
- galastrm_state *state = field->port->machine->driver_data<galastrm_state>();
+ galastrm_state *state = field->port->machine().driver_data<galastrm_state>();
return state->frame_counter;
}
static CUSTOM_INPUT( coin_word_r )
{
- galastrm_state *state = field->port->machine->driver_data<galastrm_state>();
+ galastrm_state *state = field->port->machine().driver_data<galastrm_state>();
return state->coin_word;
}
static WRITE32_HANDLER( galastrm_input_w )
{
- galastrm_state *state = space->machine->driver_data<galastrm_state>();
+ galastrm_state *state = space->machine().driver_data<galastrm_state>();
#if 0
{
@@ -122,12 +122,12 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31) /* $400000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x40);
eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -140,10 +140,10 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0, ~data & 0x01000000);
- coin_lockout_w(space->machine, 1, ~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x04000000);
+ coin_lockout_w(space->machine(), 0, ~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1, ~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x04000000);
state->coin_word = (data >> 16) &0xffff;
}
//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(space->cpu),offset);
@@ -156,16 +156,16 @@ static READ32_HANDLER( galastrm_adstick_ctrl_r )
if (offset == 0x00)
{
if (ACCESSING_BITS_24_31)
- return input_port_read(space->machine, "STICKX") << 24;
+ return input_port_read(space->machine(), "STICKX") << 24;
if (ACCESSING_BITS_16_23)
- return input_port_read(space->machine, "STICKY") << 16;
+ return input_port_read(space->machine(), "STICKY") << 16;
}
return 0;
}
static WRITE32_HANDLER( galastrm_adstick_ctrl_w )
{
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(galastrm_interrupt6));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(galastrm_interrupt6));
}
/***********************************************************
diff --git a/src/mame/drivers/galaxi.c b/src/mame/drivers/galaxi.c
index 525094ccf31..8ff823a8c7b 100644
--- a/src/mame/drivers/galaxi.c
+++ b/src/mame/drivers/galaxi.c
@@ -75,77 +75,77 @@ public:
static TILE_GET_INFO( get_bg1_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg1_ram[tile_index];
SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0);
}
static TILE_GET_INFO( get_bg2_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg2_ram[tile_index];
SET_TILE_INFO(0, code, 0x10 + (code >> 12), 0);
}
static TILE_GET_INFO( get_bg3_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg3_ram[tile_index];
SET_TILE_INFO(0, code, (code >> 12), 0);
}
static TILE_GET_INFO( get_bg4_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->bg4_ram[tile_index];
SET_TILE_INFO(0, code, (code >> 12), 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
UINT16 code = state->fg_ram[tile_index];
SET_TILE_INFO(1, code, 0x20 + (code >> 12), 0);
}
static WRITE16_HANDLER( galaxi_bg1_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg1_ram[offset]);
tilemap_mark_tile_dirty(state->bg1_tmap, offset);
}
static WRITE16_HANDLER( galaxi_bg2_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg2_ram[offset]);
tilemap_mark_tile_dirty(state->bg2_tmap, offset);
}
static WRITE16_HANDLER( galaxi_bg3_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg3_ram[offset]);
tilemap_mark_tile_dirty(state->bg3_tmap, offset);
}
static WRITE16_HANDLER( galaxi_bg4_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->bg4_ram[offset]);
tilemap_mark_tile_dirty(state->bg4_tmap, offset);
}
static WRITE16_HANDLER( galaxi_fg_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->fg_ram[offset]);
tilemap_mark_tile_dirty(state->fg_tmap, offset);
}
static VIDEO_START(galaxi)
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
state->bg1_tmap = tilemap_create(machine, get_bg1_tile_info, tilemap_scan_rows, 16, 16, 0x20, 0x10);
state->bg2_tmap = tilemap_create(machine, get_bg2_tile_info, tilemap_scan_rows, 16, 16, 0x20, 0x10);
@@ -166,24 +166,24 @@ static VIDEO_START(galaxi)
static SCREEN_UPDATE(galaxi)
{
- galaxi_state *state = screen->machine->driver_data<galaxi_state>();
+ galaxi_state *state = screen->machine().driver_data<galaxi_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_R)) // remapped due to inputs changes.
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) // remapped due to inputs changes.
{
int msk = 0;
- if (input_code_pressed(screen->machine, KEYCODE_T)) msk |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_Y)) msk |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_U)) msk |= 4;
- if (input_code_pressed(screen->machine, KEYCODE_I)) msk |= 8;
- if (input_code_pressed(screen->machine, KEYCODE_O)) msk |= 16;
+ if (input_code_pressed(screen->machine(), KEYCODE_T)) msk |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_Y)) msk |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_U)) msk |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_I)) msk |= 8;
+ if (input_code_pressed(screen->machine(), KEYCODE_O)) msk |= 16;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->bg1_tmap, TILEMAP_DRAW_OPAQUE, 0);
- else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->bg2_tmap, 0, 0);
if (layers_ctrl & 4) tilemap_draw(bitmap, cliprect, state->bg3_tmap, 0, 0);
if (layers_ctrl & 8) tilemap_draw(bitmap, cliprect, state->bg4_tmap, 0, 0);
@@ -197,29 +197,29 @@ static SCREEN_UPDATE(galaxi)
Memory Maps
***************************************************************************/
-static void show_out( running_machine *machine )
+static void show_out( running_machine &machine )
{
-// galaxi_state *state = machine->driver_data<galaxi_state>();
+// galaxi_state *state = machine.driver_data<galaxi_state>();
// popmessage("%04x %04x %04x", state->out[0], state->out[1], state->out[2]);
}
static WRITE16_HANDLER( galaxi_500000_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->out[0]);
- show_out(space->machine);
+ show_out(space->machine());
}
static WRITE16_HANDLER( galaxi_500002_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
COMBINE_DATA(&state->out[1]);
- show_out(space->machine);
+ show_out(space->machine());
}
static WRITE16_HANDLER( galaxi_500004_w )
{
- galaxi_state *state = space->machine->driver_data<galaxi_state>();
+ galaxi_state *state = space->machine().driver_data<galaxi_state>();
if (ACCESSING_BITS_0_7)
{
@@ -247,23 +247,23 @@ static WRITE16_HANDLER( galaxi_500004_w )
{
state->ticket = data & 0x0100;
state->hopper = data & 0x1000;
- coin_counter_w(space->machine, 0, data & 0x2000); // coins
+ coin_counter_w(space->machine(), 0, data & 0x2000); // coins
}
COMBINE_DATA(&state->out[2]);
- show_out(space->machine);
+ show_out(space->machine());
}
static CUSTOM_INPUT( ticket_r )
{
- galaxi_state *state = field->port->machine->driver_data<galaxi_state>();
- return state->ticket && !(field->port->machine->primary_screen->frame_number() % 10);
+ galaxi_state *state = field->port->machine().driver_data<galaxi_state>();
+ return state->ticket && !(field->port->machine().primary_screen->frame_number() % 10);
}
static CUSTOM_INPUT( hopper_r )
{
- galaxi_state *state = field->port->machine->driver_data<galaxi_state>();
- return state->hopper && !(field->port->machine->primary_screen->frame_number() % 10);
+ galaxi_state *state = field->port->machine().driver_data<galaxi_state>();
+ return state->hopper && !(field->port->machine().primary_screen->frame_number() % 10);
}
@@ -373,7 +373,7 @@ GFXDECODE_END
static MACHINE_START( galaxi )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
state->save_item(NAME(state->hopper));
state->save_item(NAME(state->ticket));
@@ -382,7 +382,7 @@ static MACHINE_START( galaxi )
static MACHINE_RESET( galaxi )
{
- galaxi_state *state = machine->driver_data<galaxi_state>();
+ galaxi_state *state = machine.driver_data<galaxi_state>();
state->hopper = 0;
state->ticket = 0;
diff --git a/src/mame/drivers/galaxia.c b/src/mame/drivers/galaxia.c
index e5f74ab4553..1abfcff18eb 100644
--- a/src/mame/drivers/galaxia.c
+++ b/src/mame/drivers/galaxia.c
@@ -43,16 +43,16 @@ public:
static SCREEN_UPDATE( galaxia )
{
- galaxia_state *state = screen->machine->driver_data<galaxia_state>();
+ galaxia_state *state = screen->machine().driver_data<galaxia_state>();
int x,y, count;
bitmap_t *s2636_0_bitmap;
bitmap_t *s2636_1_bitmap;
bitmap_t *s2636_2_bitmap;
- device_t *s2636_0 = screen->machine->device("s2636_0");
- device_t *s2636_1 = screen->machine->device("s2636_1");
- device_t *s2636_2 = screen->machine->device("s2636_2");
+ device_t *s2636_0 = screen->machine().device("s2636_0");
+ device_t *s2636_1 = screen->machine().device("s2636_1");
+ device_t *s2636_2 = screen->machine().device("s2636_2");
count = 0;
@@ -61,7 +61,7 @@ static SCREEN_UPDATE( galaxia )
for (x=0;x<256/8;x++)
{
int tile = state->video[count];
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[0],tile,0,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[0],tile,0,0,0,x*8,y*8);
count++;
}
}
@@ -100,7 +100,7 @@ static SCREEN_UPDATE( galaxia )
static WRITE8_HANDLER(galaxia_video_w)
{
- galaxia_state *state = space->machine->driver_data<galaxia_state>();
+ galaxia_state *state = space->machine().driver_data<galaxia_state>();
if (cpu_get_reg(space->cpu, S2650_FO))
{
state->video[offset]=data;
@@ -113,7 +113,7 @@ static WRITE8_HANDLER(galaxia_video_w)
static READ8_HANDLER(galaxia_video_r)
{
- galaxia_state *state = space->machine->driver_data<galaxia_state>();
+ galaxia_state *state = space->machine().driver_data<galaxia_state>();
return state->video[offset];
}
@@ -357,7 +357,7 @@ ROM_END
static DRIVER_INIT(galaxia)
{
- galaxia_state *state = machine->driver_data<galaxia_state>();
+ galaxia_state *state = machine.driver_data<galaxia_state>();
state->color=auto_alloc_array(machine, UINT8, 0x400);
}
diff --git a/src/mame/drivers/galaxian.c b/src/mame/drivers/galaxian.c
index f414d021584..190e37b56b4 100644
--- a/src/mame/drivers/galaxian.c
+++ b/src/mame/drivers/galaxian.c
@@ -475,12 +475,12 @@ static INTERRUPT_GEN( fakechange_interrupt_gen )
{
interrupt_gen(device);
- if (input_port_read_safe(device->machine, "FAKE_SELECT", 0x00))
+ if (input_port_read_safe(device->machine(), "FAKE_SELECT", 0x00))
{
tenspot_current_game++;
tenspot_current_game%=10;
- tenspot_set_game_bank(device->machine, tenspot_current_game, 1);
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ tenspot_set_game_bank(device->machine(), tenspot_current_game, 1);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
}
}
@@ -504,26 +504,26 @@ static WRITE8_HANDLER( start_lamp_w )
{
/* offset 0 = 1P START LAMP */
/* offset 1 = 2P START LAMP */
- set_led_status(space->machine, offset, data & 1);
+ set_led_status(space->machine(), offset, data & 1);
}
static WRITE8_HANDLER( coin_lock_w )
{
/* many variants and bootlegs don't have this */
- coin_lockout_global_w(space->machine, ~data & 1);
+ coin_lockout_global_w(space->machine(), ~data & 1);
}
static WRITE8_HANDLER( coin_count_0_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
}
static WRITE8_HANDLER( coin_count_1_w )
{
- coin_counter_w(space->machine, 1, data & 1);
+ coin_counter_w(space->machine(), 1, data & 1);
}
@@ -538,8 +538,8 @@ static READ8_HANDLER( konami_ay8910_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0);
- if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0);
+ if (offset & 0x20) result &= ay8910_r(space->machine().device("8910.1"), 0);
+ if (offset & 0x80) result &= ay8910_r(space->machine().device("8910.0"), 0);
return result;
}
@@ -549,14 +549,14 @@ static WRITE8_HANDLER( konami_ay8910_w )
/* AV 4,5 ==> AY8910 #2 */
/* the decoding here is very simplistic, and you can address two simultaneously */
if (offset & 0x10)
- ay8910_address_w(space->machine->device("8910.1"), 0, data);
+ ay8910_address_w(space->machine().device("8910.1"), 0, data);
else if (offset & 0x20)
- ay8910_data_w(space->machine->device("8910.1"), 0, data);
+ ay8910_data_w(space->machine().device("8910.1"), 0, data);
/* AV6,7 ==> AY8910 #1 */
if (offset & 0x40)
- ay8910_address_w(space->machine->device("8910.0"), 0, data);
+ ay8910_address_w(space->machine().device("8910.0"), 0, data);
else if (offset & 0x80)
- ay8910_data_w(space->machine->device("8910.0"), 0, data);
+ ay8910_data_w(space->machine().device("8910.0"), 0, data);
}
@@ -568,10 +568,10 @@ static WRITE8_DEVICE_HANDLER( konami_sound_control_w )
/* the inverse of bit 3 clocks the flip flop to signal an INT */
/* it is automatically cleared on the acknowledge */
if ((old & 0x08) && !(data & 0x08))
- cputag_set_input_line(device->machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, HOLD_LINE);
/* bit 4 is sound disable */
- device->machine->sound().system_mute(data & 0x10);
+ device->machine().sound().system_mute(data & 0x10);
}
@@ -591,7 +591,7 @@ static READ8_DEVICE_HANDLER( konami_sound_timer_r )
current counter index, we use the sound cpu clock times 8 mod
16*16*2*8*5*2.
*/
- UINT32 cycles = (device->machine->device<cpu_device>("audiocpu")->total_cycles() * 8) % (UINT64)(16*16*2*8*5*2);
+ UINT32 cycles = (device->machine().device<cpu_device>("audiocpu")->total_cycles() * 8) % (UINT64)(16*16*2*8*5*2);
UINT8 hibit = 0;
/* separate the high bit from the others */
@@ -612,7 +612,7 @@ static READ8_DEVICE_HANDLER( konami_sound_timer_r )
static WRITE8_HANDLER( konami_sound_filter_w )
{
- device_t *discrete = space->machine->device("konami");
+ device_t *discrete = space->machine().device("konami");
static const char *const ayname[2] = { "8910.0", "8910.1" };
int which, chan;
@@ -620,7 +620,7 @@ static WRITE8_HANDLER( konami_sound_filter_w )
/* AV0 .. AV5 ==> AY8910 #2 */
/* AV6 .. AV11 ==> AY8910 #1 */
for (which = 0; which < 2; which++)
- if (space->machine->device(ayname[which]) != NULL)
+ if (space->machine().device(ayname[which]) != NULL)
for (chan = 0; chan < 3; chan++)
{
UINT8 bits = (offset >> (2 * chan + 6 * (1 - which))) & 3;
@@ -634,13 +634,13 @@ static WRITE8_HANDLER( konami_sound_filter_w )
static WRITE8_DEVICE_HANDLER( konami_portc_0_w )
{
- logerror("%s:ppi0_portc_w = %02X\n", device->machine->describe_context(), data);
+ logerror("%s:ppi0_portc_w = %02X\n", device->machine().describe_context(), data);
}
static WRITE8_DEVICE_HANDLER( konami_portc_1_w )
{
- logerror("%s:ppi1_portc_w = %02X\n", device->machine->describe_context(), data);
+ logerror("%s:ppi1_portc_w = %02X\n", device->machine().describe_context(), data);
}
@@ -677,8 +677,8 @@ static READ8_HANDLER( theend_ppi8255_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x0100) result &= ppi8255_r(space->machine->device("ppi8255_0"), offset & 3);
- if (offset & 0x0200) result &= ppi8255_r(space->machine->device("ppi8255_1"), offset & 3);
+ if (offset & 0x0100) result &= ppi8255_r(space->machine().device("ppi8255_0"), offset & 3);
+ if (offset & 0x0200) result &= ppi8255_r(space->machine().device("ppi8255_1"), offset & 3);
return result;
}
@@ -686,14 +686,14 @@ static READ8_HANDLER( theend_ppi8255_r )
static WRITE8_HANDLER( theend_ppi8255_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x0100) ppi8255_w(space->machine->device("ppi8255_0"), offset & 3, data);
- if (offset & 0x0200) ppi8255_w(space->machine->device("ppi8255_1"), offset & 3, data);
+ if (offset & 0x0100) ppi8255_w(space->machine().device("ppi8255_0"), offset & 3, data);
+ if (offset & 0x0200) ppi8255_w(space->machine().device("ppi8255_1"), offset & 3, data);
}
static WRITE8_DEVICE_HANDLER( theend_coin_counter_w )
{
- coin_counter_w(device->machine, 0, data & 0x80);
+ coin_counter_w(device->machine(), 0, data & 0x80);
}
@@ -776,14 +776,14 @@ static const ppi8255_interface scramble_ppi8255_1_intf =
static WRITE8_HANDLER( explorer_sound_control_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
static READ8_DEVICE_HANDLER( explorer_sound_latch_r )
{
- cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
- return soundlatch_r(device->machine->device("audiocpu")->memory().space(AS_PROGRAM), 0);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE);
+ return soundlatch_r(device->machine().device("audiocpu")->memory().space(AS_PROGRAM), 0);
}
@@ -798,7 +798,7 @@ static READ8_HANDLER( sfx_sample_io_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x04) result &= ppi8255_r(space->machine->device("ppi8255_2"), offset & 3);
+ if (offset & 0x04) result &= ppi8255_r(space->machine().device("ppi8255_2"), offset & 3);
return result;
}
@@ -806,8 +806,8 @@ static READ8_HANDLER( sfx_sample_io_r )
static WRITE8_HANDLER( sfx_sample_io_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x04) ppi8255_w(space->machine->device("ppi8255_2"), offset & 3, data);
- if (offset & 0x10) dac_signed_data_w(space->machine->device("dac"), data);
+ if (offset & 0x04) ppi8255_w(space->machine().device("ppi8255_2"), offset & 3, data);
+ if (offset & 0x10) dac_signed_data_w(space->machine().device("dac"), data);
}
@@ -819,7 +819,7 @@ static WRITE8_DEVICE_HANDLER( sfx_sample_control_w )
/* the inverse of bit 0 clocks the flip flop to signal an INT */
/* it is automatically cleared on the acknowledge */
if ((old & 0x01) && !(data & 0x01))
- cputag_set_input_line(device->machine, "audio2", 0, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "audio2", 0, HOLD_LINE);
}
@@ -845,8 +845,8 @@ static READ8_HANDLER( frogger_ppi8255_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 1) & 3);
- if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 1) & 3);
+ if (offset & 0x1000) result &= ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 1) & 3);
+ if (offset & 0x2000) result &= ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 1) & 3);
return result;
}
@@ -854,8 +854,8 @@ static READ8_HANDLER( frogger_ppi8255_r )
static WRITE8_HANDLER( frogger_ppi8255_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 1) & 3, data);
- if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 1) & 3, data);
+ if (offset & 0x1000) ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 1) & 3, data);
+ if (offset & 0x2000) ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 1) & 3, data);
}
@@ -863,7 +863,7 @@ static READ8_HANDLER( frogger_ay8910_r )
{
/* the decoding here is very simplistic */
UINT8 result = 0xff;
- if (offset & 0x40) result &= ay8910_r(space->machine->device("8910.0"), 0);
+ if (offset & 0x40) result &= ay8910_r(space->machine().device("8910.0"), 0);
return result;
}
@@ -873,9 +873,9 @@ static WRITE8_HANDLER( frogger_ay8910_w )
/* the decoding here is very simplistic */
/* AV6,7 ==> AY8910 #1 */
if (offset & 0x40)
- ay8910_data_w(space->machine->device("8910.0"), 0, data);
+ ay8910_data_w(space->machine().device("8910.0"), 0, data);
else if (offset & 0x80)
- ay8910_address_w(space->machine->device("8910.0"), 0, data);
+ ay8910_address_w(space->machine().device("8910.0"), 0, data);
}
@@ -889,7 +889,7 @@ static READ8_DEVICE_HANDLER( frogger_sound_timer_r )
static WRITE8_HANDLER( froggrmc_sound_control_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, (data & 1) ? CLEAR_LINE : ASSERT_LINE);
}
@@ -904,8 +904,8 @@ static READ8_HANDLER( frogf_ppi8255_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x1000) result &= ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 3) & 3);
- if (offset & 0x2000) result &= ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 3) & 3);
+ if (offset & 0x1000) result &= ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 3) & 3);
+ if (offset & 0x2000) result &= ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 3) & 3);
return result;
}
@@ -913,8 +913,8 @@ static READ8_HANDLER( frogf_ppi8255_r )
static WRITE8_HANDLER( frogf_ppi8255_w )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
- if (offset & 0x1000) ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 3) & 3, data);
- if (offset & 0x2000) ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 3) & 3, data);
+ if (offset & 0x1000) ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 3) & 3, data);
+ if (offset & 0x2000) ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 3) & 3, data);
}
@@ -925,10 +925,10 @@ static WRITE8_HANDLER( frogf_ppi8255_w )
*
*************************************/
-static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine->device("ppi8255_0"), (offset >> 4) & 3); }
-static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine->device("ppi8255_1"), (offset >> 4) & 3); }
-static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine->device("ppi8255_0"), (offset >> 4) & 3, data); }
-static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine->device("ppi8255_1"), (offset >> 4) & 3, data); }
+static READ8_HANDLER( turtles_ppi8255_0_r ) { return ppi8255_r(space->machine().device("ppi8255_0"), (offset >> 4) & 3); }
+static READ8_HANDLER( turtles_ppi8255_1_r ) { return ppi8255_r(space->machine().device("ppi8255_1"), (offset >> 4) & 3); }
+static WRITE8_HANDLER( turtles_ppi8255_0_w ) { ppi8255_w(space->machine().device("ppi8255_0"), (offset >> 4) & 3, data); }
+static WRITE8_HANDLER( turtles_ppi8255_1_w ) { ppi8255_w(space->machine().device("ppi8255_1"), (offset >> 4) & 3, data); }
@@ -942,9 +942,9 @@ static READ8_HANDLER( scorpion_ay8910_r )
{
/* the decoding here is very simplistic, and you can address both simultaneously */
UINT8 result = 0xff;
- if (offset & 0x08) result &= ay8910_r(space->machine->device("8910.2"), 0);
- if (offset & 0x20) result &= ay8910_r(space->machine->device("8910.1"), 0);
- if (offset & 0x80) result &= ay8910_r(space->machine->device("8910.0"), 0);
+ if (offset & 0x08) result &= ay8910_r(space->machine().device("8910.2"), 0);
+ if (offset & 0x20) result &= ay8910_r(space->machine().device("8910.1"), 0);
+ if (offset & 0x80) result &= ay8910_r(space->machine().device("8910.0"), 0);
return result;
}
@@ -952,12 +952,12 @@ static READ8_HANDLER( scorpion_ay8910_r )
static WRITE8_HANDLER( scorpion_ay8910_w )
{
/* the decoding here is very simplistic, and you can address all six simultaneously */
- if (offset & 0x04) ay8910_address_w(space->machine->device("8910.2"), 0, data);
- if (offset & 0x08) ay8910_data_w(space->machine->device("8910.2"), 0, data);
- if (offset & 0x10) ay8910_address_w(space->machine->device("8910.1"), 0, data);
- if (offset & 0x20) ay8910_data_w(space->machine->device("8910.1"), 0, data);
- if (offset & 0x40) ay8910_address_w(space->machine->device("8910.0"), 0, data);
- if (offset & 0x80) ay8910_data_w(space->machine->device("8910.0"), 0, data);
+ if (offset & 0x04) ay8910_address_w(space->machine().device("8910.2"), 0, data);
+ if (offset & 0x08) ay8910_data_w(space->machine().device("8910.2"), 0, data);
+ if (offset & 0x10) ay8910_address_w(space->machine().device("8910.1"), 0, data);
+ if (offset & 0x20) ay8910_data_w(space->machine().device("8910.1"), 0, data);
+ if (offset & 0x40) ay8910_address_w(space->machine().device("8910.0"), 0, data);
+ if (offset & 0x80) ay8910_data_w(space->machine().device("8910.0"), 0, data);
}
@@ -992,7 +992,7 @@ static WRITE8_DEVICE_HANDLER( scorpion_protection_w )
static READ8_HANDLER( scorpion_digitalker_intr_r )
{
- device_t *digitalker = space->machine->device("digitalker");
+ device_t *digitalker = space->machine().device("digitalker");
return digitalker_0_intr_r(digitalker);
}
@@ -1023,20 +1023,20 @@ static const ppi8255_interface scorpion_ppi8255_1_intf =
static INPUT_CHANGED( gmgalax_game_changed )
{
- address_space *space = field->port->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = field->port->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* new value is the selected game */
gmgalax_selected_game = newval;
/* select the bank and graphics bank based on it */
- memory_set_bank(field->port->machine, "bank1", gmgalax_selected_game);
+ memory_set_bank(field->port->machine(), "bank1", gmgalax_selected_game);
galaxian_gfxbank_w(space, 0, gmgalax_selected_game);
/* reset the stars */
galaxian_stars_enable_w(space, 0, 0);
/* reset the CPU */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
}
@@ -1045,7 +1045,7 @@ static CUSTOM_INPUT( gmgalax_port_r )
const char *portname = (const char *)param;
if (gmgalax_selected_game != 0)
portname += strlen(portname) + 1;
- return input_port_read(field->port->machine, portname);
+ return input_port_read(field->port->machine(), portname);
}
@@ -1058,8 +1058,8 @@ static CUSTOM_INPUT( gmgalax_port_r )
static WRITE8_HANDLER( zigzag_bankswap_w )
{
- memory_set_bank(space->machine, "bank1", data & 1);
- memory_set_bank(space->machine, "bank2", ~data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank2", ~data & 1);
}
@@ -1072,7 +1072,7 @@ static WRITE8_HANDLER( zigzag_ay8910_w )
/* bit 0 = WRITE */
/* bit 1 = C/D */
if ((offset & 1) != 0)
- ay8910_data_address_w(space->machine->device("aysnd"), offset >> 1, zigzag_ay8910_latch);
+ ay8910_data_address_w(space->machine().device("aysnd"), offset >> 1, zigzag_ay8910_latch);
break;
case 0x100:
@@ -1096,7 +1096,7 @@ static WRITE8_HANDLER( zigzag_ay8910_w )
static CUSTOM_INPUT( azurian_port_r )
{
- return (input_port_read(field->port->machine, "FAKE") >> (FPTR)param) & 1;
+ return (input_port_read(field->port->machine(), "FAKE") >> (FPTR)param) & 1;
}
@@ -1110,7 +1110,7 @@ static CUSTOM_INPUT( azurian_port_r )
static CUSTOM_INPUT( kingball_muxbit_r )
{
/* multiplex the service mode switch with a speech DIP switch */
- return (input_port_read(field->port->machine, "FAKE") >> kingball_speech_dip) & 1;
+ return (input_port_read(field->port->machine(), "FAKE") >> kingball_speech_dip) & 1;
}
@@ -1119,7 +1119,7 @@ static CUSTOM_INPUT( kingball_noise_r )
/* bit 5 is the NOISE line from the sound circuit. The code just verifies
that it's working, doesn't actually use return value, so we can just use
rand() */
- return field->port->machine->rand() & 1;
+ return field->port->machine().rand() & 1;
}
@@ -1164,21 +1164,21 @@ static WRITE8_HANDLER( mshuttle_ay8910_cs_w )
static WRITE8_HANDLER( mshuttle_ay8910_control_w )
{
if (!mshuttle_ay8910_cs)
- ay8910_address_w(space->machine->device("aysnd"), offset, data);
+ ay8910_address_w(space->machine().device("aysnd"), offset, data);
}
static WRITE8_HANDLER( mshuttle_ay8910_data_w )
{
if (!mshuttle_ay8910_cs)
- ay8910_data_w(space->machine->device("aysnd"), offset, data);
+ ay8910_data_w(space->machine().device("aysnd"), offset, data);
}
static READ8_HANDLER( mshuttle_ay8910_data_r )
{
if (!mshuttle_ay8910_cs)
- return ay8910_r(space->machine->device("aysnd"), offset);
+ return ay8910_r(space->machine().device("aysnd"), offset);
return 0xff;
}
@@ -1215,13 +1215,13 @@ static READ8_HANDLER( jumpbug_protection_r )
static WRITE8_HANDLER( checkman_sound_command_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static TIMER_DEVICE_CALLBACK( checkmaj_irq0_gen )
{
- cputag_set_input_line(timer.machine, "audiocpu", 0, HOLD_LINE);
+ cputag_set_input_line(timer.machine(), "audiocpu", 0, HOLD_LINE);
}
@@ -2412,9 +2412,9 @@ MACHINE_CONFIG_END
*
*************************************/
-static void decode_mooncrst(running_machine *machine, int length, UINT8 *dest)
+static void decode_mooncrst(running_machine &machine, int length, UINT8 *dest)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int offs;
for (offs = 0; offs < length; offs++)
@@ -2429,7 +2429,7 @@ static void decode_mooncrst(running_machine *machine, int length, UINT8 *dest)
}
-static void decode_checkman(running_machine *machine)
+static void decode_checkman(running_machine &machine)
{
/*
Encryption Table
@@ -2476,8 +2476,8 @@ static void decode_checkman(running_machine *machine)
{ 0,2,0,2 },
{ 1,4,1,4 }
};
- UINT8 *rombase = machine->region("maincpu")->base();
- UINT32 romlength = machine->region("maincpu")->bytes();
+ UINT8 *rombase = machine.region("maincpu")->base();
+ UINT32 romlength = machine.region("maincpu")->bytes();
UINT32 offs;
for (offs = 0; offs < romlength; offs++)
@@ -2491,10 +2491,10 @@ static void decode_checkman(running_machine *machine)
}
-static void decode_dingoe(running_machine *machine)
+static void decode_dingoe(running_machine &machine)
{
- UINT8 *rombase = machine->region("maincpu")->base();
- UINT32 romlength = machine->region("maincpu")->bytes();
+ UINT8 *rombase = machine.region("maincpu")->base();
+ UINT32 romlength = machine.region("maincpu")->bytes();
UINT32 offs;
for (offs = 0; offs < romlength; offs++)
@@ -2514,9 +2514,9 @@ static void decode_dingoe(running_machine *machine)
}
-static void decode_frogger_sound(running_machine *machine)
+static void decode_frogger_sound(running_machine &machine)
{
- UINT8 *rombase = machine->region("audiocpu")->base();
+ UINT8 *rombase = machine.region("audiocpu")->base();
UINT32 offs;
/* the first ROM of the sound CPU has data lines D0 and D1 swapped */
@@ -2525,9 +2525,9 @@ static void decode_frogger_sound(running_machine *machine)
}
-static void decode_frogger_gfx(running_machine *machine)
+static void decode_frogger_gfx(running_machine &machine)
{
- UINT8 *rombase = machine->region("gfx1")->base();
+ UINT8 *rombase = machine.region("gfx1")->base();
UINT32 offs;
/* the 2nd gfx ROM has data lines D0 and D1 swapped */
@@ -2536,10 +2536,10 @@ static void decode_frogger_gfx(running_machine *machine)
}
-static void decode_anteater_gfx(running_machine *machine)
+static void decode_anteater_gfx(running_machine &machine)
{
- UINT32 romlength = machine->region("gfx1")->bytes();
- UINT8 *rombase = machine->region("gfx1")->base();
+ UINT32 romlength = machine.region("gfx1")->bytes();
+ UINT8 *rombase = machine.region("gfx1")->base();
UINT8 *scratch = auto_alloc_array(machine, UINT8, romlength);
UINT32 offs;
@@ -2556,10 +2556,10 @@ static void decode_anteater_gfx(running_machine *machine)
}
-static void decode_losttomb_gfx(running_machine *machine)
+static void decode_losttomb_gfx(running_machine &machine)
{
- UINT32 romlength = machine->region("gfx1")->bytes();
- UINT8 *rombase = machine->region("gfx1")->base();
+ UINT32 romlength = machine.region("gfx1")->bytes();
+ UINT8 *rombase = machine.region("gfx1")->base();
UINT8 *scratch = auto_alloc_array(machine, UINT8, romlength);
UINT32 offs;
@@ -2576,14 +2576,14 @@ static void decode_losttomb_gfx(running_machine *machine)
}
-static void decode_superbon(running_machine *machine)
+static void decode_superbon(running_machine &machine)
{
offs_t i;
UINT8 *RAM;
/* Deryption worked out by hand by Chris Hardy. */
- RAM = machine->region("maincpu")->base();
+ RAM = machine.region("maincpu")->base();
for (i = 0;i < 0x1000;i++)
{
@@ -2614,7 +2614,7 @@ static void decode_superbon(running_machine *machine)
*************************************/
static void common_init(
- running_machine *machine,
+ running_machine &machine,
galaxian_draw_bullet_func draw_bullet,
galaxian_draw_background_func draw_background,
galaxian_extend_tile_info_func extend_tile_info,
@@ -2631,9 +2631,9 @@ static void common_init(
}
-static void unmap_galaxian_sound(running_machine *machine, offs_t base)
+static void unmap_galaxian_sound(running_machine &machine, offs_t base)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->unmap_write(base + 0x0004, base + 0x0007, 0, 0x07f8);
space->unmap_write(base + 0x0800, base + 0x0807, 0, 0x07f8);
@@ -2656,7 +2656,7 @@ static DRIVER_INIT( galaxian )
static DRIVER_INIT( nolock )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
@@ -2668,7 +2668,7 @@ static DRIVER_INIT( nolock )
static DRIVER_INIT( azurian )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* yellow bullets instead of white ones */
common_init(machine, scramble_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -2680,24 +2680,24 @@ static DRIVER_INIT( azurian )
static DRIVER_INIT( gmgalax )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, gmgalax_extend_tile_info, gmgalax_extend_sprite_info);
/* ROM is banked */
space->install_read_bank(0x0000, 0x3fff, "bank1");
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* callback when the game select is toggled */
- gmgalax_game_changed(machine->m_portlist.first()->fieldlist, NULL, 0, 0);
+ gmgalax_game_changed(machine.m_portlist.first()->fieldlist, NULL, 0, 0);
state_save_register_global(machine, gmgalax_selected_game);
}
static DRIVER_INIT( pisces )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
@@ -2709,7 +2709,7 @@ static DRIVER_INIT( pisces )
static DRIVER_INIT( batman2 )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
@@ -2721,7 +2721,7 @@ static DRIVER_INIT( batman2 )
static DRIVER_INIT( frogg )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
common_init(machine, galaxian_draw_bullet, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
@@ -2744,7 +2744,7 @@ static DRIVER_INIT( mooncrst )
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
/* decrypt program code */
- decode_mooncrst(machine, 0x8000, machine->region("maincpu")->base());
+ decode_mooncrst(machine, 0x8000, machine.region("maincpu")->base());
}
@@ -2757,7 +2757,7 @@ static DRIVER_INIT( mooncrsu )
static DRIVER_INIT( mooncrgx )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -2769,7 +2769,7 @@ static DRIVER_INIT( mooncrgx )
static DRIVER_INIT( moonqsr )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x8000);
/* video extensions */
@@ -2787,7 +2787,7 @@ static WRITE8_HANDLER( artic_gfxbank_w )
static DRIVER_INIT( pacmanbl )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* same as galaxian... */
DRIVER_INIT_CALL(galaxian);
@@ -2800,11 +2800,11 @@ static READ8_HANDLER( tenspot_dsw_read )
{
char tmp[64];
sprintf(tmp,"IN2_GAME%d", tenspot_current_game);
- return input_port_read_safe(space->machine, tmp, 0x00);
+ return input_port_read_safe(space->machine(), tmp, 0x00);
}
-void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
+void tenspot_set_game_bank(running_machine& machine, int bank, int from_game)
{
char tmp[64];
UINT8* srcregion;
@@ -2813,15 +2813,15 @@ void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
int x;
sprintf(tmp,"game_%d_cpu", bank);
- srcregion = machine->region(tmp)->base();
- dstregion = machine->region("maincpu")->base();
+ srcregion = machine.region(tmp)->base();
+ dstregion = machine.region("maincpu")->base();
memcpy(dstregion, srcregion, 0x4000);
sprintf(tmp,"game_%d_temp", bank);
- srcregion = machine->region(tmp)->base();
- dstregion = machine->region("gfx1")->base();
+ srcregion = machine.region(tmp)->base();
+ dstregion = machine.region("gfx1")->base();
memcpy(dstregion, srcregion, 0x2000);
- dstregion = machine->region("gfx2")->base();
+ dstregion = machine.region("gfx2")->base();
memcpy(dstregion, srcregion, 0x2000);
if (from_game)
@@ -2829,18 +2829,18 @@ void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
for (x=0;x<0x200;x++)
{
- gfx_element_mark_dirty(machine->gfx[0], x);
+ gfx_element_mark_dirty(machine.gfx[0], x);
}
for (x=0;x<0x80;x++)
{
- gfx_element_mark_dirty(machine->gfx[1], x);
+ gfx_element_mark_dirty(machine.gfx[1], x);
}
}
sprintf(tmp,"game_%d_prom", bank);
- srcregion = machine->region(tmp)->base();
- dstregion = machine->region("proms")->base();
+ srcregion = machine.region(tmp)->base();
+ dstregion = machine.region("proms")->base();
memcpy(dstregion, srcregion, 0x20);
color_prom = dstregion;
@@ -2849,7 +2849,7 @@ void tenspot_set_game_bank(running_machine* machine, int bank, int from_game)
static DRIVER_INIT( tenspot )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* these are needed for batman part 2 to work properly, this banking is probably a property of the artic board,
which tenspot appears to have copied */
@@ -2886,7 +2886,7 @@ static DRIVER_INIT( devilfsg )
static DRIVER_INIT( zigzag )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, NULL, galaxian_draw_background, NULL, NULL);
@@ -2895,13 +2895,13 @@ static DRIVER_INIT( zigzag )
/* make ROMs 2 & 3 swappable */
space->install_read_bank(0x2000, 0x2fff, "bank1");
space->install_read_bank(0x3000, 0x3fff, "bank2");
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x2000, 0x1000);
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("maincpu")->base() + 0x2000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x2000, 0x1000);
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("maincpu")->base() + 0x2000, 0x1000);
/* also re-install the fixed ROM area as a bank in order to inform the memory system that
the fixed area only extends to 0x1fff */
space->install_read_bank(0x0000, 0x1fff, "bank3");
- memory_set_bankptr(machine, "bank3", machine->region("maincpu")->base() + 0x0000);
+ memory_set_bankptr(machine, "bank3", machine.region("maincpu")->base() + 0x0000);
/* handler for doing the swaps */
space->install_legacy_write_handler(0x7002, 0x7002, 0, 0x07f8, FUNC(zigzag_bankswap_w));
@@ -2927,8 +2927,8 @@ static DRIVER_INIT( jumpbug )
static DRIVER_INIT( checkman )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -2947,7 +2947,7 @@ static DRIVER_INIT( checkman )
static DRIVER_INIT( checkmaj )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -2962,7 +2962,7 @@ static DRIVER_INIT( checkmaj )
static DRIVER_INIT( dingo )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -2977,8 +2977,8 @@ static DRIVER_INIT( dingo )
static DRIVER_INIT( dingoe )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *iospace = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *iospace = machine.device("maincpu")->memory().space(AS_IO);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -2999,7 +2999,7 @@ static DRIVER_INIT( dingoe )
static DRIVER_INIT( skybase )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, pisces_extend_tile_info, pisces_extend_sprite_info);
@@ -3011,14 +3011,14 @@ static DRIVER_INIT( skybase )
space->install_ram(0x8000, 0x87ff);
/* extend ROM */
- space->install_rom(0x0000, 0x5fff, machine->region("maincpu")->base());
+ space->install_rom(0x0000, 0x5fff, machine.region("maincpu")->base());
}
-static void mshuttle_decode(running_machine *machine, const UINT8 convtable[8][16])
+static void mshuttle_decode(running_machine &machine, const UINT8 convtable[8][16])
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x10000);
int A;
@@ -3095,7 +3095,7 @@ static DRIVER_INIT( mshuttlj )
static DRIVER_INIT( kingball )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -3112,7 +3112,7 @@ static DRIVER_INIT( kingball )
static DRIVER_INIT( scorpnmc )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
@@ -3122,7 +3122,7 @@ static DRIVER_INIT( scorpnmc )
space->install_legacy_write_handler(0xb001, 0xb001, 0, 0x7f8, FUNC(irq_enable_w));
/* extra ROM */
- space->install_rom(0x5000, 0x67ff, machine->region("maincpu")->base() + 0x5000);
+ space->install_rom(0x5000, 0x67ff, machine.region("maincpu")->base() + 0x5000);
/* install RAM at $4000-$4800 */
space->install_ram(0x4000, 0x47ff);
@@ -3133,7 +3133,7 @@ static DRIVER_INIT( scorpnmc )
static DRIVER_INIT( thepitm )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, galaxian_draw_bullet, galaxian_draw_background, mooncrst_extend_tile_info, mooncrst_extend_sprite_info);
@@ -3146,7 +3146,7 @@ static DRIVER_INIT( thepitm )
space->unmap_write(0xb004, 0xb004, 0, 0x07f8);
/* extend ROM */
- space->install_rom(0x0000, 0x47ff, machine->region("maincpu")->base());
+ space->install_rom(0x0000, 0x47ff, machine.region("maincpu")->base());
}
/*************************************
@@ -3157,7 +3157,7 @@ static DRIVER_INIT( thepitm )
static DRIVER_INIT( theend )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, theend_draw_bullet, galaxian_draw_background, NULL, NULL);
@@ -3176,7 +3176,7 @@ static DRIVER_INIT( scramble )
static DRIVER_INIT( explorer )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
@@ -3202,14 +3202,14 @@ static DRIVER_INIT( sfx )
galaxian_sfx_tilemap = TRUE;
/* sound board has space for extra ROM */
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("audiocpu")->base());
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x3fff, "bank1");
+ memory_set_bankptr(machine, "bank1", machine.region("audiocpu")->base());
}
static DRIVER_INIT( atlantis )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, scramble_draw_bullet, scramble_draw_background, NULL, NULL);
@@ -3251,7 +3251,7 @@ static DRIVER_INIT( frogger )
static DRIVER_INIT( froggrmc )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* video extensions */
common_init(machine, NULL, frogger_draw_background, frogger_extend_tile_info, frogger_extend_sprite_info);
@@ -3296,24 +3296,24 @@ static DRIVER_INIT( amidar )
static DRIVER_INIT( scorpion )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
common_init(machine, scramble_draw_bullet, scramble_draw_background, batman2_extend_tile_info, upper_extend_sprite_info);
/* hook up AY8910 */
- machine->device("audiocpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x00, 0xff, FUNC(scorpion_ay8910_r), FUNC(scorpion_ay8910_w));
+ machine.device("audiocpu")->memory().space(AS_IO)->install_legacy_readwrite_handler(0x00, 0xff, FUNC(scorpion_ay8910_r), FUNC(scorpion_ay8910_w));
/* extra ROM */
space->install_read_bank(0x5800, 0x67ff, "bank1");
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x5800);
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x5800);
/* no background related */
// space->nop_write(0x6803, 0x6803);
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(scorpion_digitalker_intr_r));
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x3000, 0x3000, FUNC(scorpion_digitalker_intr_r));
/*
{
- const UINT8 *rom = machine->region("speech")->base();
+ const UINT8 *rom = machine.region("speech")->base();
int i;
for (i = 0; i < 0x2c; i++)
diff --git a/src/mame/drivers/galaxold.c b/src/mame/drivers/galaxold.c
index 891cec9d977..fb02f255b49 100644
--- a/src/mame/drivers/galaxold.c
+++ b/src/mame/drivers/galaxold.c
@@ -580,9 +580,9 @@ static ADDRESS_MAP_START( scramblb_map, AS_PROGRAM, 8 )
ADDRESS_MAP_END
static READ8_HANDLER( scramb2_protection_r ) { return 0x25; }
-static READ8_HANDLER( scramb2_port0_r ) { return (input_port_read(space->machine, "IN0") >> offset) & 0x1; }
-static READ8_HANDLER( scramb2_port1_r ) { return (input_port_read(space->machine, "IN1") >> offset) & 0x1; }
-static READ8_HANDLER( scramb2_port2_r ) { return (input_port_read(space->machine, "IN2") >> offset) & 0x1; }
+static READ8_HANDLER( scramb2_port0_r ) { return (input_port_read(space->machine(), "IN0") >> offset) & 0x1; }
+static READ8_HANDLER( scramb2_port1_r ) { return (input_port_read(space->machine(), "IN1") >> offset) & 0x1; }
+static READ8_HANDLER( scramb2_port2_r ) { return (input_port_read(space->machine(), "IN2") >> offset) & 0x1; }
static ADDRESS_MAP_START( scramb2_map, AS_PROGRAM, 8 )
AM_RANGE(0x0000, 0x3fff) AM_ROM
@@ -917,9 +917,9 @@ static CUSTOM_INPUT( vpool_lives_r )
switch (bit_mask)
{
case 0x40: /* vpool : IN1 (0xa800) bit 6 */
- return ((input_port_read(field->port->machine, "LIVES") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "LIVES") & bit_mask) >> 6);
case 0x01: /* vpool : DSW (0xb000) bit 0 */
- return ((input_port_read(field->port->machine, "LIVES") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "LIVES") & bit_mask) >> 0);
default:
logerror("vpool_lives_r : invalid %02X bit_mask\n",bit_mask);
@@ -1064,14 +1064,14 @@ static CUSTOM_INPUT( ckongg_coinage_r )
switch (bit_mask)
{
case 0x0c: /* ckongg : DSW (0xc800) bits 2 and 3 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 2);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 2);
case 0x40: /* ckongg : IN1 (0xc400) bit 6 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 6);
case 0xc0: /* ckongmc : IN1 (0xa800) bits 6 and 7 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 6);
case 0x01: /* ckongmc : DSW (0xb000) bit 0 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 0);
default:
logerror("ckongg_coinage_r : invalid %02X bit_mask\n",bit_mask);
@@ -1432,9 +1432,9 @@ static CUSTOM_INPUT( dkongjrm_coinage_r )
switch (bit_mask)
{
case 0xc0: /* dkongjrm : IN1 (0xa8??) bits 6 and 7 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 6);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 6);
case 0x01: /* dkongjrm : DSW (0xb0??) bit 0 */
- return ((input_port_read(field->port->machine, "COINAGE") & bit_mask) >> 0);
+ return ((input_port_read(field->port->machine(), "COINAGE") & bit_mask) >> 0);
default:
logerror("dkongjrm_coinage_r : invalid %02X bit_mask\n",bit_mask);
diff --git a/src/mame/drivers/galdrvr.c b/src/mame/drivers/galdrvr.c
index db97830d1b6..583e2ff7e6a 100644
--- a/src/mame/drivers/galdrvr.c
+++ b/src/mame/drivers/galdrvr.c
@@ -2362,7 +2362,7 @@ static CUSTOM_INPUT( moonwar_dial_r )
static int counter_74ls161[2] = {0, 0};
static int direction[2] = {0, 0};
- signed char dialread = input_port_read(field->port->machine, dialname[p]);
+ signed char dialread = input_port_read(field->port->machine(), dialname[p]);
UINT8 ret;
diff --git a/src/mame/drivers/galivan.c b/src/mame/drivers/galivan.c
index cb1658fbc04..ae241bc447a 100644
--- a/src/mame/drivers/galivan.c
+++ b/src/mame/drivers/galivan.c
@@ -398,10 +398,10 @@ GFXDECODE_END
static MACHINE_START( galivan )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
/* configure ROM banking */
- UINT8 *rombase = machine->region("maincpu")->base();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &rombase[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
@@ -415,10 +415,10 @@ static MACHINE_START( galivan )
static MACHINE_START( ninjemak )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
/* configure ROM banking */
- UINT8 *rombase = machine->region("maincpu")->base();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rombase[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
@@ -431,9 +431,9 @@ static MACHINE_START( ninjemak )
static MACHINE_RESET( galivan )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
// state->layers = 0x60;
state->layers = 0;
@@ -445,9 +445,9 @@ static MACHINE_RESET( galivan )
static MACHINE_RESET( ninjemak )
{
- galivan_state *state = machine->driver_data<galivan_state>();
+ galivan_state *state = machine.driver_data<galivan_state>();
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
state->scrollx[0] = state->scrollx[1] = 0;
state->scrolly[0] = state->scrolly[1] = 0;
@@ -1019,16 +1019,16 @@ ROM_END
static WRITE8_HANDLER( youmab_extra_bank_w )
{
if (data == 0xff)
- memory_set_bank(space->machine, "bank2", 1);
+ memory_set_bank(space->machine(), "bank2", 1);
else if (data == 0x00)
- memory_set_bank(space->machine, "bank2", 0);
+ memory_set_bank(space->machine(), "bank2", 0);
else
printf("data %03x\n", data);
}
static READ8_HANDLER( youmab_8a_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE8_HANDLER( youmab_81_w )
@@ -1043,20 +1043,20 @@ static WRITE8_HANDLER( youmab_84_w )
static DRIVER_INIT( youmab )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x82, 0x82, FUNC(youmab_extra_bank_w)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
- memory_set_bankptr(machine, "bank3", machine->region("maincpu")->base());
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x82, 0x82, FUNC(youmab_extra_bank_w)); // banks rom at 0x8000? writes 0xff and 0x00 before executing code there
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x7fff, "bank3");
+ memory_set_bankptr(machine, "bank3", machine.region("maincpu")->base());
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
- memory_configure_bank(machine, "bank2", 0, 2, machine->region("user2")->base(), 0x4000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0x8000, 0xbfff, "bank2");
+ memory_configure_bank(machine, "bank2", 0, 2, machine.region("user2")->base(), 0x4000);
memory_set_bank(machine, "bank2", 0);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x81, 0x81, FUNC(youmab_81_w)); // ?? often, alternating values
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x84, 0x84, FUNC(youmab_84_w)); // ?? often, sequence..
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x81, 0x81, FUNC(youmab_81_w)); // ?? often, alternating values
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x84, 0x84, FUNC(youmab_84_w)); // ?? often, sequence..
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xd800, 0xd81f); // scrolling isn't here..
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xd800, 0xd81f); // scrolling isn't here..
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x8a, 0x8a, FUNC(youmab_8a_r)); // ???
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x8a, 0x8a, FUNC(youmab_8a_r)); // ???
}
diff --git a/src/mame/drivers/galpani2.c b/src/mame/drivers/galpani2.c
index 4eec266e2a6..5364c1705dc 100644
--- a/src/mame/drivers/galpani2.c
+++ b/src/mame/drivers/galpani2.c
@@ -37,13 +37,13 @@ To Do:
static READ16_DEVICE_HANDLER(galpani2_eeprom_r)
{
- galpani2_state *state = device->machine->driver_data<galpani2_state>();
+ galpani2_state *state = device->machine().driver_data<galpani2_state>();
return (state->eeprom_word & ~1) | (eeprom_read_bit(device) & 1);
}
static WRITE16_DEVICE_HANDLER(galpani2_eeprom_w)
{
- galpani2_state *state = device->machine->driver_data<galpani2_state>();
+ galpani2_state *state = device->machine().driver_data<galpani2_state>();
COMBINE_DATA( &state->eeprom_word );
if ( ACCESSING_BITS_0_7 )
{
@@ -78,7 +78,7 @@ static MACHINE_RESET( galpani2 )
kaneko16_sprite_xoffs = 0x10000 - 0x16c0 + 0xc00;
kaneko16_sprite_yoffs = 0x000;
- machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //initial mcu xchk
+ machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(50)); //initial mcu xchk
}
static void galpani2_write_kaneko(device_t *device)
@@ -112,9 +112,9 @@ static void galpani2_write_kaneko(device_t *device)
static WRITE8_HANDLER( galpani2_mcu_init_w )
{
- running_machine *machine = space->machine;
- address_space *srcspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *dstspace = machine->device("sub")->memory().space(AS_PROGRAM);
+ running_machine &machine = space->machine();
+ address_space *srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *dstspace = machine.device("sub")->memory().space(AS_PROGRAM);
UINT32 mcu_address, mcu_data;
for ( mcu_address = 0x100010; mcu_address < (0x100010 + 6); mcu_address += 1 )
@@ -125,10 +125,10 @@ static WRITE8_HANDLER( galpani2_mcu_init_w )
cputag_set_input_line(machine, "sub", INPUT_LINE_IRQ7, HOLD_LINE); //MCU Initialised
}
-static void galpani2_mcu_nmi1(running_machine *machine)
+static void galpani2_mcu_nmi1(running_machine &machine)
{
- address_space *srcspace = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *dstspace = machine->device("sub")->memory().space(AS_PROGRAM);
+ address_space *srcspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *dstspace = machine.device("sub")->memory().space(AS_PROGRAM);
UINT32 mcu_list, mcu_command, mcu_address, mcu_extra, mcu_src, mcu_dst, mcu_size;
for ( mcu_list = 0x100021; mcu_list < (0x100021 + 0x40); mcu_list += 4 )
@@ -144,7 +144,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
if (mcu_command != 0)
{
logerror("%s : MCU [$%06X] endidx = $%02X / command = $%02X addr = $%04X ? = $%02X.\n",
- machine->describe_context(),
+ machine.describe_context(),
mcu_list,
srcspace->read_byte(0x100020),
mcu_command,
@@ -167,7 +167,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) +
(srcspace->read_byte(mcu_address + 9)<<0) ;
- logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine->describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
+ logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine.describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
for( ; mcu_size > 0 ; mcu_size-- )
{
@@ -192,7 +192,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
mcu_size = (srcspace->read_byte(mcu_address + 8)<<8) +
(srcspace->read_byte(mcu_address + 9)<<0) ;
- logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine->describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
+ logerror("%s : MCU executes command $%02X, %04X %02X-> %04x\n",machine.describe_context(),mcu_command,mcu_src,mcu_size,mcu_dst);
for( ; mcu_size > 0 ; mcu_size-- )
{
@@ -220,7 +220,7 @@ static void galpani2_mcu_nmi1(running_machine *machine)
srcspace->write_byte(mcu_address+0,0xff);
srcspace->write_byte(mcu_address+1,0xff);
- logerror("%s : MCU ERROR, unknown command $%02X\n",machine->describe_context(),mcu_command);
+ logerror("%s : MCU ERROR, unknown command $%02X\n",machine.describe_context(),mcu_command);
}
/* Erase command (so that it won't be processed again)? */
@@ -228,29 +228,29 @@ static void galpani2_mcu_nmi1(running_machine *machine)
}
}
-static void galpani2_mcu_nmi2(running_machine *machine)
+static void galpani2_mcu_nmi2(running_machine &machine)
{
- galpani2_write_kaneko(machine->device("maincpu"));
- //logerror("%s : MCU executes CHECKs synchro\n", machine->describe_context());
+ galpani2_write_kaneko(machine.device("maincpu"));
+ //logerror("%s : MCU executes CHECKs synchro\n", machine.describe_context());
}
static WRITE8_HANDLER( galpani2_mcu_nmi1_w ) //driven by CPU1's int5 ISR
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
//for galpan2t:
//Triggered from 'maincpu' (00007D60),once, with no command, using alternate line, during init
//Triggered from 'maincpu' (000080BE),once, for unknown command, during init
//Triggered from 'maincpu' (0000741E),from here on...driven by int5, even if there's no command
- if ( (data & 1) && !(state->old_mcu_nmi1 & 1) ) galpani2_mcu_nmi1(space->machine);
- //if ( (data & 0x10) && !(state->old_mcu_nmi1 & 0x10) ) galpani2_mcu_nmi1(space->machine);
+ if ( (data & 1) && !(state->old_mcu_nmi1 & 1) ) galpani2_mcu_nmi1(space->machine());
+ //if ( (data & 0x10) && !(state->old_mcu_nmi1 & 0x10) ) galpani2_mcu_nmi1(space->machine());
//alternate line, same function?
state->old_mcu_nmi1 = data;
}
static WRITE8_HANDLER( galpani2_mcu_nmi2_w ) //driven by CPU2's int5 ISR
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
- if ( (data & 1) && !(state->old_mcu_nmi2 & 1) ) galpani2_mcu_nmi2(space->machine);
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ if ( (data & 1) && !(state->old_mcu_nmi2 & 1) ) galpani2_mcu_nmi2(space->machine());
state->old_mcu_nmi2 = data;
}
@@ -265,10 +265,10 @@ static WRITE8_HANDLER( galpani2_mcu_nmi2_w ) //driven by CPU2's int5 ISR
static WRITE8_HANDLER( galpani2_coin_lockout_w )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
- coin_lockout_w(space->machine, 0,~data & 0x04);
- coin_lockout_w(space->machine, 1,~data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
+ coin_lockout_w(space->machine(), 0,~data & 0x04);
+ coin_lockout_w(space->machine(), 1,~data & 0x08);
// & 0x10 CARD in lockout?
// & 0x20 CARD in lockout?
// & 0x40 CARD out
@@ -276,8 +276,8 @@ static WRITE8_HANDLER( galpani2_coin_lockout_w )
static WRITE8_DEVICE_HANDLER( galpani2_oki1_bank_w )
{
- UINT8 *ROM = device->machine->region("oki1")->base();
- logerror("%s : %s bank %08X\n",device->machine->describe_context(),device->tag(),data);
+ UINT8 *ROM = device->machine().region("oki1")->base();
+ logerror("%s : %s bank %08X\n",device->machine().describe_context(),device->tag(),data);
memcpy(ROM + 0x30000, ROM + 0x40000 + 0x10000 * (~data & 0xf), 0x10000);
}
@@ -285,7 +285,7 @@ static WRITE8_DEVICE_HANDLER( galpani2_oki2_bank_w )
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0xf) );
- logerror("%s : %s bank %08X\n",device->machine->describe_context(),device->tag(),data);
+ logerror("%s : %s bank %08X\n",device->machine().describe_context(),device->tag(),data);
}
@@ -350,9 +350,9 @@ ADDRESS_MAP_END
static READ16_HANDLER( galpani2_bankedrom_r )
{
- galpani2_state *state = space->machine->driver_data<galpani2_state>();
- UINT16 *ROM = (UINT16 *) space->machine->region( "user1" )->base();
- size_t len = space->machine->region( "user1" )->bytes() / 2;
+ galpani2_state *state = space->machine().driver_data<galpani2_state>();
+ UINT16 *ROM = (UINT16 *) space->machine().region( "user1" )->base();
+ size_t len = space->machine().region( "user1" )->bytes() / 2;
offset += (0x800000/2) * (*state->rombank & 0x0003);
diff --git a/src/mame/drivers/galpani3.c b/src/mame/drivers/galpani3.c
index 6033598847d..419ad940464 100644
--- a/src/mame/drivers/galpani3.c
+++ b/src/mame/drivers/galpani3.c
@@ -142,27 +142,27 @@ static INTERRUPT_GEN( galpani3_vblank ) // 2, 3, 5 ?
static VIDEO_START(galpani3)
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
/* so we can use suprnova.c */
state->spriteram32 = auto_alloc_array(machine, UINT32, 0x4000/4);
- machine->generic.spriteram_size = 0x4000;
+ machine.generic.spriteram_size = 0x4000;
state->spc_regs = auto_alloc_array(machine, UINT32, 0x40/4);
state->sprite_bitmap_1 = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_INDEXED16);
- state->spritegen = machine->device<sknsspr_device>("spritegen");
+ state->spritegen = machine.device<sknsspr_device>("spritegen");
state->spritegen->skns_sprite_kludge(0,0);
}
-static int gp3_is_alpha_pen(running_machine *machine, int pen)
+static int gp3_is_alpha_pen(running_machine &machine, int pen)
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
UINT16 dat = 0;
if (pen<0x4000)
{
- dat = machine->generic.paletteram.u16[pen];
+ dat = machine.generic.paletteram.u16[pen];
}
else if (pen<0x4100)
{
@@ -196,12 +196,12 @@ static int gp3_is_alpha_pen(running_machine *machine, int pen)
static SCREEN_UPDATE(galpani3)
{
- galpani3_state *state = screen->machine->driver_data<galpani3_state>();
+ galpani3_state *state = screen->machine().driver_data<galpani3_state>();
int x,y;
UINT16* src1;
UINT32* dst;
UINT16 pixdata1;
- const pen_t *paldata = screen->machine->pens;
+ const pen_t *paldata = screen->machine().pens;
bitmap_fill(bitmap, cliprect, 0x0000);
@@ -261,7 +261,7 @@ static SCREEN_UPDATE(galpani3)
UINT16 pen = dat1+0x4000;
UINT32 pal = paldata[pen];
- if (gp3_is_alpha_pen(screen->machine, pen))
+ if (gp3_is_alpha_pen(screen->machine(), pen))
{
int r,g,b;
r = (pal & 0x00ff0000)>>16;
@@ -289,7 +289,7 @@ static SCREEN_UPDATE(galpani3)
UINT16 pen = dat2+0x4100;
UINT32 pal = paldata[pen];
- if (gp3_is_alpha_pen(screen->machine, pen))
+ if (gp3_is_alpha_pen(screen->machine(), pen))
{
int r,g,b;
r = (pal & 0x00ff0000)>>16;
@@ -321,20 +321,20 @@ static SCREEN_UPDATE(galpani3)
/*
else if (pridat==0x2f) // area outside of the girl
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else if (pridat==0x00) // the initial line / box that gets drawn
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else if (pridat==0x30) // during the 'gals boxes' on the intro
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else if (pridat==0x0c) // 'nice' at end of level
{
- //dst[0] = screen->machine->rand()&0x3fff;
+ //dst[0] = screen->machine().rand()&0x3fff;
}
else
{
@@ -347,7 +347,7 @@ static SCREEN_UPDATE(galpani3)
bitmap_fill(state->sprite_bitmap_1, cliprect, 0x0000);
- state->spritegen->skns_draw_sprites(screen->machine, state->sprite_bitmap_1, cliprect, state->spriteram32, screen->machine->generic.spriteram_size, screen->machine->region("gfx1")->base(), screen->machine->region ("gfx1")->bytes(), state->spc_regs );
+ state->spritegen->skns_draw_sprites(screen->machine(), state->sprite_bitmap_1, cliprect, state->spriteram32, screen->machine().generic.spriteram_size, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->spc_regs );
// ignoring priority bits for now..
for (y=0;y<240;y++)
@@ -434,7 +434,7 @@ INPUT_PORTS_END
static WRITE16_HANDLER( galpani3_suprnova_sprite32_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->spriteram[offset]);
offset>>=1;
state->spriteram32[offset]=(state->spriteram[offset*2+1]<<16) | (state->spriteram[offset*2]);
@@ -442,7 +442,7 @@ static WRITE16_HANDLER( galpani3_suprnova_sprite32_w )
static WRITE16_HANDLER( galpani3_suprnova_sprite32regs_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->sprregs[offset]);
offset>>=1;
state->spc_regs[offset]=(state->sprregs[offset*2+1]<<16) | (state->sprregs[offset*2]);
@@ -457,14 +457,14 @@ static WRITE16_HANDLER( galpani3_suprnova_sprite32regs_w )
***************************************************************************/
-static void galpani3_mcu_run(running_machine *machine)
+static void galpani3_mcu_run(running_machine &machine)
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
UINT16 mcu_command = state->mcu_ram[0x0010/2]; /* command nb */
UINT16 mcu_offset = state->mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
UINT16 mcu_subcmd = state->mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */
- logerror("%s: MCU executed command : %04X %04X\n",machine->describe_context(),mcu_command,mcu_offset*2);
+ logerror("%s: MCU executed command : %04X %04X\n",machine.describe_context(),mcu_command,mcu_offset*2);
/* the only MCU commands found in program code are:
0x04: protection: provide code/data,
@@ -477,7 +477,7 @@ static void galpani3_mcu_run(running_machine *machine)
case 0x03: // DSW
{
state->mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
- logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine->describe_context(), mcu_command, mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (read DSW)\n", machine.describe_context(), mcu_command, mcu_offset*2);
}
break;
@@ -534,7 +534,7 @@ static void galpani3_mcu_run(running_machine *machine)
#define GALPANI3_MCU_COM_W(_n_) \
static WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \
{ \
- galpani3_state *state = space->machine->driver_data<galpani3_state>(); \
+ galpani3_state *state = space->machine().driver_data<galpani3_state>(); \
COMBINE_DATA(&state->mcu_com[_n_]); \
if (state->mcu_com[0] != 0xFFFF) return; \
if (state->mcu_com[1] != 0xFFFF) return; \
@@ -542,7 +542,7 @@ static WRITE16_HANDLER( galpani3_mcu_com##_n_##_w ) \
if (state->mcu_com[3] != 0xFFFF) return; \
\
memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- galpani3_mcu_run(space->machine); \
+ galpani3_mcu_run(space->machine()); \
}
GALPANI3_MCU_COM_W(0)
@@ -560,7 +560,7 @@ static READ16_HANDLER( galpani3_mcu_status_r )
static READ16_HANDLER( galpani3_regs1_r )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
switch (offset)
{
case 0x2:
@@ -585,7 +585,7 @@ static READ16_HANDLER( galpani3_regs1_r )
static READ16_HANDLER( galpani3_regs2_r )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
switch (offset)
{
case 0x2:
@@ -610,7 +610,7 @@ static READ16_HANDLER( galpani3_regs2_r )
static READ16_HANDLER( galpani3_regs3_r )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
switch (offset)
{
case 0x2:
@@ -686,16 +686,16 @@ static void gp3_do_rle(UINT32 address, UINT16*framebuffer, UINT8* rledata)
static WRITE16_HANDLER( galpani3_regs1_address_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
logerror("galpani3_regs1_address_w %04x\n",data);
COMBINE_DATA(&state->regs1_address_regs[offset]);
}
static WRITE16_HANDLER( galpani3_regs1_go_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
UINT32 address = state->regs1_address_regs[1]| (state->regs1_address_regs[0]<<16);
- UINT8* rledata = space->machine->region("gfx2")->base();
+ UINT8* rledata = space->machine().region("gfx2")->base();
printf("galpani3_regs1_go_w? %08x\n",address );
if ((data==0x2000) || (data==0x3000)) gp3_do_rle(address, state->framebuffer1, rledata);
@@ -704,16 +704,16 @@ static WRITE16_HANDLER( galpani3_regs1_go_w )
static WRITE16_HANDLER( galpani3_regs2_address_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
logerror("galpani3_regs2_address_w %04x\n",data);
COMBINE_DATA(&state->regs2_address_regs[offset]);
}
static WRITE16_HANDLER( galpani3_regs2_go_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
UINT32 address = state->regs2_address_regs[1]| (state->regs2_address_regs[0]<<16);
- UINT8* rledata = space->machine->region("gfx2")->base();
+ UINT8* rledata = space->machine().region("gfx2")->base();
printf("galpani3_regs2_go_w? %08x\n", address );
@@ -726,137 +726,137 @@ static WRITE16_HANDLER( galpani3_regs2_go_w )
static WRITE16_HANDLER( galpani3_regs3_address_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
logerror("galpani3_regs3_address_w %04x\n",data);
COMBINE_DATA(&state->regs3_address_regs[offset]);
}
static WRITE16_HANDLER( galpani3_regs3_go_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
UINT32 address = state->regs3_address_regs[1]| (state->regs3_address_regs[0]<<16);
- UINT8* rledata = space->machine->region("gfx2")->base();
+ UINT8* rledata = space->machine().region("gfx2")->base();
printf("galpani3_regs3_go_w? %08x\n",address );
if ((data==0x2000) || (data==0x3000)) gp3_do_rle(address, state->framebuffer3, rledata);
}
-static void set_color_555_gp3(running_machine *machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
+static void set_color_555_gp3(running_machine &machine, pen_t color, int rshift, int gshift, int bshift, UINT16 data)
{
palette_set_color_rgb(machine, color, pal5bit(data >> rshift), pal5bit(data >> gshift), pal5bit(data >> bshift));
}
static WRITE16_HANDLER( galpani3_framebuffer1_palette_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer1_palette[offset]);
- set_color_555_gp3(space->machine, offset+0x4000, 5, 10, 0, state->framebuffer1_palette[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4000, 5, 10, 0, state->framebuffer1_palette[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer2_palette_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer2_palette[offset]);
- set_color_555_gp3(space->machine, offset+0x4100, 5, 10, 0, state->framebuffer2_palette[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4100, 5, 10, 0, state->framebuffer2_palette[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer3_palette_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer3_palette[offset]);
- set_color_555_gp3(space->machine, offset+0x4200, 5, 10, 0, state->framebuffer3_palette[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4200, 5, 10, 0, state->framebuffer3_palette[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer3_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer3_scrolly = data;
}
static WRITE16_HANDLER( galpani3_framebuffer3_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer3_scrollx = data;
}
static WRITE16_HANDLER( galpani3_framebuffer2_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer2_scrolly = data;
}
static WRITE16_HANDLER( galpani3_framebuffer2_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer2_scrollx = data;
}
static WRITE16_HANDLER( galpani3_framebuffer1_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer1_scrolly = data;
}
static WRITE16_HANDLER( galpani3_framebuffer1_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer1_scrollx = data;
}
static WRITE16_HANDLER( galpani3_priority_buffer_scrollx_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->priority_buffer_scrollx = data;
}
static WRITE16_HANDLER( galpani3_priority_buffer_scrolly_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->priority_buffer_scrolly = data;
}
/* I'm not convinced these are enables */
static WRITE16_HANDLER( galpani3_framebuffer1_enable_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer1_enable = data;
}
static WRITE16_HANDLER( galpani3_framebuffer2_enable_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer2_enable = data;
}
static WRITE16_HANDLER( galpani3_framebuffer3_enable_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
state->framebuffer3_enable = data;
}
/* definitely looks like a cycling bg colour used for the girls */
static WRITE16_HANDLER( galpani3_framebuffer1_bgcol_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer1_bgcol[offset]);
- set_color_555_gp3(space->machine, offset+0x4300, 5, 10, 0, state->framebuffer1_bgcol[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4300, 5, 10, 0, state->framebuffer1_bgcol[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer2_bgcol_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer2_bgcol[offset]);
- set_color_555_gp3(space->machine, offset+0x4301, 5, 10, 0, state->framebuffer2_bgcol[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4301, 5, 10, 0, state->framebuffer2_bgcol[offset]);
}
static WRITE16_HANDLER( galpani3_framebuffer3_bgcol_w )
{
- galpani3_state *state = space->machine->driver_data<galpani3_state>();
+ galpani3_state *state = space->machine().driver_data<galpani3_state>();
COMBINE_DATA(&state->framebuffer3_bgcol[offset]);
- set_color_555_gp3(space->machine, offset+0x4302, 5, 10, 0, state->framebuffer3_bgcol[offset]);
+ set_color_555_gp3(space->machine(), offset+0x4302, 5, 10, 0, state->framebuffer3_bgcol[offset]);
}
@@ -1003,7 +1003,7 @@ ROM_END
static DRIVER_INIT( galpani3 )
{
- galpani3_state *state = machine->driver_data<galpani3_state>();
+ galpani3_state *state = machine.driver_data<galpani3_state>();
DRIVER_INIT_CALL( decrypt_toybox_rom );
memset(state->mcu_com, 0, 4 * sizeof( UINT16) );
diff --git a/src/mame/drivers/galpanic.c b/src/mame/drivers/galpanic.c
index 868488b5ede..dbbc21dfda9 100644
--- a/src/mame/drivers/galpanic.c
+++ b/src/mame/drivers/galpanic.c
@@ -127,7 +127,7 @@ The current set of Super Model is an example of type C
static SCREEN_EOF( galpanic )
{
- device_t *pandora = machine->device("pandora");
+ device_t *pandora = machine.device("pandora");
pandora_eof(pandora);
}
@@ -153,11 +153,11 @@ static INTERRUPT_GEN( galhustl_interrupt )
static WRITE16_HANDLER( galpanic_6295_bankswitch_w )
{
- device_t *pandora = space->machine->device("pandora");
+ device_t *pandora = space->machine().device("pandora");
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
@@ -170,7 +170,7 @@ static WRITE16_HANDLER( galpanica_6295_bankswitch_w )
{
if (ACCESSING_BITS_8_15)
{
- UINT8 *rom = space->machine->region("oki")->base();
+ UINT8 *rom = space->machine().region("oki")->base();
memcpy(&rom[0x30000],&rom[0x40000 + ((data >> 8) & 0x0f) * 0x10000],0x10000);
}
@@ -179,7 +179,7 @@ static WRITE16_HANDLER( galpanica_6295_bankswitch_w )
#ifdef UNUSED_FUNCTION
static WRITE16_HANDLER( galpanica_misc_w )
{
- device_t *pandora = machine->device("pandora");
+ device_t *pandora = machine.device("pandora");
if (ACCESSING_BITS_0_7)
{
@@ -194,11 +194,11 @@ static WRITE16_HANDLER( galpanic_coin_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x100);
- coin_counter_w(space->machine, 1, data & 0x200);
+ coin_counter_w(space->machine(), 0, data & 0x100);
+ coin_counter_w(space->machine(), 1, data & 0x200);
- coin_lockout_w(space->machine, 0, ~data & 0x400);
- coin_lockout_w(space->machine, 1, ~data & 0x800);
+ coin_lockout_w(space->machine(), 0, ~data & 0x400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x800);
}
}
@@ -233,7 +233,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( kludge )
{
- return space->machine->rand() & 0x0700;
+ return space->machine().rand() & 0x0700;
}
/* a kludge! */
@@ -242,7 +242,7 @@ static READ8_DEVICE_HANDLER( comad_okim6295_r )
UINT16 retvalue;
// retvalue = okim6295_r(offset,mem_mask) << 8; // doesn't work, causes lockups when girls change..
- retvalue = device->machine->rand();
+ retvalue = device->machine().rand();
return retvalue;
}
@@ -306,7 +306,7 @@ ADDRESS_MAP_END
#ifdef UNUSED_FUNCTION
READ16_HANDLER( zipzap_random_read )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
diff --git a/src/mame/drivers/galspnbl.c b/src/mame/drivers/galspnbl.c
index 5c0fedcef03..492c47fb83b 100644
--- a/src/mame/drivers/galspnbl.c
+++ b/src/mame/drivers/galspnbl.c
@@ -28,7 +28,7 @@ TODO:
static WRITE16_HANDLER( soundcommand_w )
{
- galspnbl_state *state = space->machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = space->machine().driver_data<galspnbl_state>();
if (ACCESSING_BITS_0_7)
{
@@ -190,7 +190,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- galspnbl_state *state = device->machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = device->machine().driver_data<galspnbl_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -202,9 +202,9 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( galspnbl )
{
- galspnbl_state *state = machine->driver_data<galspnbl_state>();
+ galspnbl_state *state = machine.driver_data<galspnbl_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( galspnbl, galspnbl_state )
diff --git a/src/mame/drivers/gamecstl.c b/src/mame/drivers/gamecstl.c
index c506431231f..c05f219b2fb 100644
--- a/src/mame/drivers/gamecstl.c
+++ b/src/mame/drivers/gamecstl.c
@@ -138,9 +138,9 @@ static void draw_char(bitmap_t *bitmap, const rectangle *cliprect, const gfx_ele
static SCREEN_UPDATE(gamecstl)
{
- gamecstl_state *state = screen->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = screen->machine().driver_data<gamecstl_state>();
int i, j;
- const gfx_element *gfx = screen->machine->gfx[0];
+ const gfx_element *gfx = screen->machine().gfx[0];
UINT32 *cga = state->cga_ram;
int index = 0;
@@ -189,7 +189,7 @@ static WRITE32_DEVICE_HANDLER(at32_dma8237_2_w)
static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
// mame_printf_debug("MXTC: read %d, %02X\n", function, reg);
return state->mxtc_config_reg[reg];
@@ -197,8 +197,8 @@ static UINT8 mxtc_config_r(device_t *busdevice, device_t *device, int function,
static void mxtc_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
-// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", busdevice->machine->describe_context(), function, reg, data);
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
+// mame_printf_debug("%s:MXTC: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data);
switch(reg)
{
@@ -206,11 +206,11 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
{
if (data & 0x10) // enable RAM access to region 0xf0000 - 0xfffff
{
- memory_set_bankptr(busdevice->machine, "bank1", state->bios_ram);
+ memory_set_bankptr(busdevice->machine(), "bank1", state->bios_ram);
}
else // disable RAM access (reads go to BIOS ROM)
{
- memory_set_bankptr(busdevice->machine, "bank1", busdevice->machine->region("user1")->base() + 0x30000);
+ memory_set_bankptr(busdevice->machine(), "bank1", busdevice->machine().region("user1")->base() + 0x30000);
}
break;
}
@@ -219,9 +219,9 @@ static void mxtc_config_w(device_t *busdevice, device_t *device, int function, i
state->mxtc_config_reg[reg] = data;
}
-static void intel82439tx_init(running_machine *machine)
+static void intel82439tx_init(running_machine &machine)
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
state->mxtc_config_reg[0x60] = 0x02;
state->mxtc_config_reg[0x61] = 0x02;
state->mxtc_config_reg[0x62] = 0x02;
@@ -276,15 +276,15 @@ static void intel82439tx_pci_w(device_t *busdevice, device_t *device, int functi
static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
// mame_printf_debug("PIIX4: read %d, %02X\n", function, reg);
return state->piix4_config_reg[function][reg];
}
static void piix4_config_w(device_t *busdevice, device_t *device, int function, int reg, UINT8 data)
{
- gamecstl_state *state = busdevice->machine->driver_data<gamecstl_state>();
-// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine->describe_context(), function, reg, data);
+ gamecstl_state *state = busdevice->machine().driver_data<gamecstl_state>();
+// mame_printf_debug("%s:PIIX4: write %d, %02X, %02X\n", busdevice->machine().describe_context(), function, reg, data);
state->piix4_config_reg[function][reg] = data;
}
@@ -374,7 +374,7 @@ static WRITE32_DEVICE_HANDLER( fdc_w )
static WRITE32_HANDLER(bios_ram_w)
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
if (state->mxtc_config_reg[0x59] & 0x20) // write to RAM if this region is write-enabled
{
COMBINE_DATA(state->bios_ram + offset);
@@ -392,7 +392,7 @@ static WRITE32_HANDLER(bios_ram_w)
static READ8_HANDLER(at_page8_r)
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
UINT8 data = state->at_pages[offset % 0x10];
switch(offset % 8)
@@ -416,7 +416,7 @@ static READ8_HANDLER(at_page8_r)
static WRITE8_HANDLER(at_page8_w)
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
state->at_pages[offset % 0x10] = data;
switch(offset % 8)
@@ -439,7 +439,7 @@ static WRITE8_HANDLER(at_page8_w)
static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_HALT, state ? ASSERT_LINE : CLEAR_LINE);
/* Assert HLDA */
i8237_hlda_w( device, state );
@@ -448,7 +448,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc_dma_hrq_changed )
static READ8_HANDLER( pc_dma_read_byte )
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -458,7 +458,7 @@ static READ8_HANDLER( pc_dma_read_byte )
static WRITE8_HANDLER( pc_dma_write_byte )
{
- gamecstl_state *state = space->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = space->machine().driver_data<gamecstl_state>();
offs_t page_offset = (((offs_t) state->dma_offset[0][state->dma_channel]) << 16)
& 0xFF0000;
@@ -467,7 +467,7 @@ static WRITE8_HANDLER( pc_dma_write_byte )
static void set_dma_channel(device_t *device, int channel, int state)
{
- gamecstl_state *drvstate = device->machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = device->machine().driver_data<gamecstl_state>();
if (!state) drvstate->dma_channel = channel;
}
@@ -602,7 +602,7 @@ INPUT_PORTS_END
static IRQ_CALLBACK(irq_callback)
{
- gamecstl_state *state = device->machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = device->machine().driver_data<gamecstl_state>();
int r = 0;
r = pic8259_acknowledge(state->pic8259_2);
if (r==0)
@@ -614,19 +614,19 @@ static IRQ_CALLBACK(irq_callback)
static MACHINE_START(gamecstl)
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
- state->pit8254 = machine->device( "pit8254" );
- state->pic8259_1 = machine->device( "pic8259_1" );
- state->pic8259_2 = machine->device( "pic8259_2" );
- state->dma8237_1 = machine->device( "dma8237_1" );
- state->dma8237_2 = machine->device( "dma8237_2" );
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
+ state->pit8254 = machine.device( "pit8254" );
+ state->pic8259_1 = machine.device( "pic8259_1" );
+ state->pic8259_2 = machine.device( "pic8259_2" );
+ state->dma8237_1 = machine.device( "dma8237_1" );
+ state->dma8237_2 = machine.device( "dma8237_2" );
}
static MACHINE_RESET(gamecstl)
{
- memory_set_bankptr(machine, "bank1", machine->region("user1")->base() + 0x30000);
+ memory_set_bankptr(machine, "bank1", machine.region("user1")->base() + 0x30000);
- device_set_irq_callback(machine->device("maincpu"), irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), irq_callback);
}
@@ -638,7 +638,7 @@ static MACHINE_RESET(gamecstl)
static WRITE_LINE_DEVICE_HANDLER( gamecstl_pic8259_1_set_int_line )
{
- cputag_set_input_line(device->machine, "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", 0, state ? HOLD_LINE : CLEAR_LINE);
}
static const struct pic8259_interface gamecstl_pic8259_1_config =
@@ -721,26 +721,26 @@ static MACHINE_CONFIG_START( gamecstl, gamecstl_state )
MACHINE_CONFIG_END
-static void set_gate_a20(running_machine *machine, int a20)
+static void set_gate_a20(running_machine &machine, int a20)
{
cputag_set_input_line(machine, "maincpu", INPUT_LINE_A20, a20);
}
-static void keyboard_interrupt(running_machine *machine, int state)
+static void keyboard_interrupt(running_machine &machine, int state)
{
- gamecstl_state *drvstate = machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = machine.driver_data<gamecstl_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static void ide_interrupt(device_t *device, int state)
{
- gamecstl_state *drvstate = device->machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = device->machine().driver_data<gamecstl_state>();
pic8259_ir6_w(drvstate->pic8259_2, state);
}
-static int gamecstl_get_out2(running_machine *machine)
+static int gamecstl_get_out2(running_machine &machine)
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
return pit8253_get_output( state->pit8254, 2 );
}
@@ -749,15 +749,15 @@ static const struct kbdc8042_interface at8042 =
KBDC8042_AT386, set_gate_a20, keyboard_interrupt, gamecstl_get_out2
};
-static void gamecstl_set_keyb_int(running_machine *machine, int state)
+static void gamecstl_set_keyb_int(running_machine &machine, int state)
{
- gamecstl_state *drvstate = machine->driver_data<gamecstl_state>();
+ gamecstl_state *drvstate = machine.driver_data<gamecstl_state>();
pic8259_ir1_w(drvstate->pic8259_1, state);
}
static DRIVER_INIT( gamecstl )
{
- gamecstl_state *state = machine->driver_data<gamecstl_state>();
+ gamecstl_state *state = machine.driver_data<gamecstl_state>();
state->bios_ram = auto_alloc_array(machine, UINT32, 0x10000/4);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, gamecstl_set_keyb_int);
diff --git a/src/mame/drivers/gameplan.c b/src/mame/drivers/gameplan.c
index 8318240f346..3e9391a336d 100644
--- a/src/mame/drivers/gameplan.c
+++ b/src/mame/drivers/gameplan.c
@@ -91,7 +91,7 @@ TODO:
static WRITE8_DEVICE_HANDLER( io_select_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
switch (data)
{
@@ -108,15 +108,15 @@ static WRITE8_DEVICE_HANDLER( io_select_w )
static READ8_DEVICE_HANDLER( io_port_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3", "DSW0", "DSW1" };
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
- return input_port_read(device->machine, portnames[state->current_port]);
+ return input_port_read(device->machine(), portnames[state->current_port]);
}
static WRITE8_DEVICE_HANDLER( coin_w )
{
- coin_counter_w(device->machine, 0, ~data & 1);
+ coin_counter_w(device->machine(), 0, ~data & 1);
}
@@ -139,28 +139,28 @@ static const via6522_interface via_1_interface =
static WRITE8_DEVICE_HANDLER( audio_reset_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, data ? CLEAR_LINE : ASSERT_LINE);
if (data == 0)
{
state->riot->reset();
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
}
static WRITE8_DEVICE_HANDLER( audio_cmd_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
riot6532_porta_in_set(state->riot, data, 0x7f);
}
static WRITE8_DEVICE_HANDLER( audio_trigger_w )
{
- gameplan_state *state = device->machine->driver_data<gameplan_state>();
+ gameplan_state *state = device->machine().driver_data<gameplan_state>();
riot6532_porta_in_set(state->riot, data << 7, 0x80);
}
@@ -184,17 +184,17 @@ static const via6522_interface via_2_interface =
static WRITE_LINE_DEVICE_HANDLER( r6532_irq )
{
- gameplan_state *gameplan = device->machine->driver_data<gameplan_state>();
+ gameplan_state *gameplan = device->machine().driver_data<gameplan_state>();
device_set_input_line(gameplan->audiocpu, 0, state);
if (state == ASSERT_LINE)
- device->machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
+ device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(10));
}
static WRITE8_DEVICE_HANDLER( r6532_soundlatch_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
soundlatch_w(space, 0, data);
}
@@ -982,11 +982,11 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( gameplan )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->riot = machine->device("riot");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->riot = machine.device("riot");
/* register for save states */
state->save_item(NAME(state->current_port));
@@ -999,7 +999,7 @@ static MACHINE_START( gameplan )
static MACHINE_RESET( gameplan )
{
- gameplan_state *state = machine->driver_data<gameplan_state>();
+ gameplan_state *state = machine.driver_data<gameplan_state>();
state->current_port = 0;
state->video_x = 0;
state->video_y = 0;
diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c
index 727237439ff..0da97ad5d5b 100644
--- a/src/mame/drivers/gaplus.c
+++ b/src/mame/drivers/gaplus.c
@@ -160,52 +160,52 @@ TODO:
static READ8_HANDLER( gaplus_spriteram_r )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
return state->spriteram[offset];
}
static WRITE8_HANDLER( gaplus_spriteram_w )
{
- gaplus_state *state = space->machine->driver_data<gaplus_state>();
+ gaplus_state *state = space->machine().driver_data<gaplus_state>();
state->spriteram[offset] = data;
}
static WRITE8_HANDLER( gaplus_irq_1_ctrl_w )
{
int bit = !BIT(offset, 11);
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( gaplus_irq_3_ctrl_w )
{
int bit = !BIT(offset, 13);
- cpu_interrupt_enable(space->machine->device("sub2"), bit);
+ cpu_interrupt_enable(space->machine().device("sub2"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( gaplus_irq_2_ctrl_w )
{
int bit = offset & 1;
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( gaplus_sreset_w )
{
int bit = !BIT(offset, 11);
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
- mappy_sound_enable(space->machine->device("namco"), bit);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ mappy_sound_enable(space->machine().device("namco"), bit);
}
static WRITE8_HANDLER( gaplus_freset_w )
{
- device_t *io58xx = space->machine->device("58xx");
- device_t *io56xx = space->machine->device("56xx");
+ device_t *io58xx = space->machine().device("58xx");
+ device_t *io56xx = space->machine().device("56xx");
int bit = !BIT(offset, 11);
logerror("%04x: freset %d\n",cpu_get_pc(space->cpu), bit);
@@ -232,14 +232,14 @@ static const namco_62xx_interface namco_62xx_intf =
static MACHINE_RESET( gaplus )
{
/* on reset, VINTON is reset, while the other flags don't seem to be affected */
- cpu_interrupt_enable(machine->device("sub"), 0);
+ cpu_interrupt_enable(machine.device("sub"), 0);
cputag_set_input_line(machine, "sub", 0, CLEAR_LINE);
}
static TIMER_CALLBACK( namcoio_run )
{
- device_t *io58xx = machine->device("58xx");
- device_t *io56xx = machine->device("56xx");
+ device_t *io58xx = machine.device("58xx");
+ device_t *io56xx = machine.device("56xx");
switch (param)
{
@@ -254,17 +254,17 @@ static TIMER_CALLBACK( namcoio_run )
static INTERRUPT_GEN( gaplus_interrupt_1 )
{
- device_t *io58xx = device->machine->device("58xx");
- device_t *io56xx = device->machine->device("56xx");
+ device_t *io58xx = device->machine().device("58xx");
+ device_t *io56xx = device->machine().device("56xx");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(io58xx)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run));
if (!namcoio_read_reset_line(io56xx)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(namcoio_run), 1);
}
@@ -503,15 +503,15 @@ static const samples_interface gaplus_samples_interface =
static WRITE8_DEVICE_HANDLER( out_lamps0 )
{
- set_led_status(device->machine, 0, data & 1);
- set_led_status(device->machine, 1, data & 2);
- coin_lockout_global_w(device->machine, data & 4);
- coin_counter_w(device->machine, 0, ~data & 8);
+ set_led_status(device->machine(), 0, data & 1);
+ set_led_status(device->machine(), 1, data & 2);
+ coin_lockout_global_w(device->machine(), data & 4);
+ coin_counter_w(device->machine(), 0, ~data & 8);
}
static WRITE8_DEVICE_HANDLER( out_lamps1 )
{
- coin_counter_w(device->machine, 1, ~data & 1);
+ coin_counter_w(device->machine(), 1, ~data & 1);
}
/* chip #0: player inputs, buttons, coins */
@@ -858,11 +858,11 @@ static DRIVER_INIT( gaplus )
UINT8 *rom;
int i;
- rom = machine->region("gfx1")->base();
+ rom = machine.region("gfx1")->base();
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] >> 4;
- rom = machine->region("gfx2")->base() + 0x6000;
+ rom = machine.region("gfx2")->base() + 0x6000;
for (i = 0;i < 0x2000;i++)
rom[i + 0x2000] = rom[i] << 4;
}
diff --git a/src/mame/drivers/gauntlet.c b/src/mame/drivers/gauntlet.c
index a25ef8e6d33..287045710e8 100644
--- a/src/mame/drivers/gauntlet.c
+++ b/src/mame/drivers/gauntlet.c
@@ -134,9 +134,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 6, state->sound_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -144,11 +144,11 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
- address_space *space = screen.machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = screen.machine().device("audiocpu")->memory().space(AS_PROGRAM);
/* sound IRQ is on 32V */
if (scanline & 32)
- atarigen_6502_irq_gen(screen.machine->device("audiocpu"));
+ atarigen_6502_irq_gen(screen.machine().device("audiocpu"));
else
atarigen_6502_irq_ack_r(space, 0);
}
@@ -156,7 +156,7 @@ static void scanline_update(screen_device &screen, int scanline)
static MACHINE_START( gauntlet )
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
atarigen_init(machine);
state->save_item(NAME(state->sound_reset_val));
@@ -165,15 +165,15 @@ static MACHINE_START( gauntlet )
static MACHINE_RESET( gauntlet )
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
state->sound_reset_val = 1;
atarigen_eeprom_reset(state);
atarigen_slapstic_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
- atarigen_sound_io_reset(machine->device("audiocpu"));
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
+ atarigen_sound_io_reset(machine.device("audiocpu"));
}
@@ -186,8 +186,8 @@ static MACHINE_RESET( gauntlet )
static READ16_HANDLER( port4_r )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
- int temp = input_port_read(space->machine, "803008");
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
+ int temp = input_port_read(space->machine(), "803008");
if (state->cpu_to_sound_ready) temp ^= 0x0020;
if (state->sound_to_cpu_ready) temp ^= 0x0010;
return temp;
@@ -203,7 +203,7 @@ static READ16_HANDLER( port4_r )
static WRITE16_HANDLER( sound_reset_w )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
if (ACCESSING_BITS_0_7)
{
int oldword = state->sound_reset_val;
@@ -211,16 +211,16 @@ static WRITE16_HANDLER( sound_reset_w )
if ((oldword ^ state->sound_reset_val) & 1)
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (state->sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
- atarigen_sound_reset(space->machine);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (state->sound_reset_val & 1) ? CLEAR_LINE : ASSERT_LINE);
+ atarigen_sound_reset(space->machine());
if (state->sound_reset_val & 1)
{
- devtag_reset(space->machine, "ymsnd");
- devtag_reset(space->machine, "tms");
- tms5220_set_frequency(space->machine->device("tms"), ATARI_CLOCK_14MHz/2 / 11);
- atarigen_set_ym2151_vol(space->machine, 0);
- atarigen_set_pokey_vol(space->machine, 0);
- atarigen_set_tms5220_vol(space->machine, 0);
+ devtag_reset(space->machine(), "ymsnd");
+ devtag_reset(space->machine(), "tms");
+ tms5220_set_frequency(space->machine().device("tms"), ATARI_CLOCK_14MHz/2 / 11);
+ atarigen_set_ym2151_vol(space->machine(), 0);
+ atarigen_set_pokey_vol(space->machine(), 0);
+ atarigen_set_tms5220_vol(space->machine(), 0);
}
}
}
@@ -236,13 +236,13 @@ static WRITE16_HANDLER( sound_reset_w )
static READ8_HANDLER( switch_6502_r )
{
- gauntlet_state *state = space->machine->driver_data<gauntlet_state>();
+ gauntlet_state *state = space->machine().driver_data<gauntlet_state>();
int temp = 0x30;
if (state->cpu_to_sound_ready) temp ^= 0x80;
if (state->sound_to_cpu_ready) temp ^= 0x40;
- if (!tms5220_readyq_r(space->machine->device("tms"))) temp ^= 0x20;
- if (!(input_port_read(space->machine, "803008") & 0x0008)) temp ^= 0x10;
+ if (!tms5220_readyq_r(space->machine().device("tms"))) temp ^= 0x20;
+ if (!(input_port_read(space->machine(), "803008") & 0x0008)) temp ^= 0x10;
return temp;
}
@@ -256,11 +256,11 @@ static READ8_HANDLER( switch_6502_r )
static WRITE8_HANDLER( sound_ctl_w )
{
- device_t *tms = space->machine->device("tms");
+ device_t *tms = space->machine().device("tms");
switch (offset & 7)
{
case 0: /* music reset, bit D7, low reset */
- if (((data>>7)&1) == 0) devtag_reset(space->machine, "ymsnd");
+ if (((data>>7)&1) == 0) devtag_reset(space->machine(), "ymsnd");
break;
case 1: /* speech write, bit D7, active low */
@@ -288,9 +288,9 @@ static WRITE8_HANDLER( sound_ctl_w )
static WRITE8_HANDLER( mixer_w )
{
- atarigen_set_ym2151_vol(space->machine, (data & 7) * 100 / 7);
- atarigen_set_pokey_vol(space->machine, ((data >> 3) & 3) * 100 / 3);
- atarigen_set_tms5220_vol(space->machine, ((data >> 5) & 7) * 100 / 7);
+ atarigen_set_ym2151_vol(space->machine(), (data & 7) * 100 / 7);
+ atarigen_set_pokey_vol(space->machine(), ((data >> 3) & 3) * 100 / 3);
+ atarigen_set_tms5220_vol(space->machine(), ((data >> 5) & 7) * 100 / 7);
}
@@ -1621,12 +1621,12 @@ ROM_END
*
*************************************/
-static void gauntlet_common_init(running_machine *machine, int slapstic, int vindctr2)
+static void gauntlet_common_init(running_machine &machine, int slapstic, int vindctr2)
{
- gauntlet_state *state = machine->driver_data<gauntlet_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ gauntlet_state *state = machine.driver_data<gauntlet_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
state->eeprom_default = NULL;
- atarigen_slapstic_init(machine->device("maincpu"), 0x038000, 0, slapstic);
+ atarigen_slapstic_init(machine.device("maincpu"), 0x038000, 0, slapstic);
/* swap the top and bottom halves of the main CPU ROM images */
atarigen_swap_mem(rom + 0x000000, rom + 0x008000, 0x8000);
@@ -1660,7 +1660,7 @@ static DRIVER_INIT( gauntlet2 )
static DRIVER_INIT( vindctr2 )
{
- UINT8 *gfx2_base = machine->region("gfx2")->base();
+ UINT8 *gfx2_base = machine.region("gfx2")->base();
UINT8 *data = auto_alloc_array(machine, UINT8, 0x8000);
int i;
diff --git a/src/mame/drivers/gberet.c b/src/mame/drivers/gberet.c
index f8cf93e15a0..fe3d7161bd1 100644
--- a/src/mame/drivers/gberet.c
+++ b/src/mame/drivers/gberet.c
@@ -88,7 +88,7 @@
static INTERRUPT_GEN( gberet_interrupt )
{
- gberet_state *state = device->machine->driver_data<gberet_state>();
+ gberet_state *state = device->machine().driver_data<gberet_state>();
if (cpu_getiloops(device) == 0)
{
if (state->irq_enable)
@@ -112,36 +112,36 @@ static INTERRUPT_GEN( gberet_interrupt )
static WRITE8_HANDLER( gberet_coin_counter_w )
{
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
static WRITE8_HANDLER( gberet_flipscreen_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x04;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static WRITE8_HANDLER( mrgoemon_coin_counter_w )
{
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bits 5-7 = ROM bank select */
- memory_set_bank(space->machine, "bank1", ((data & 0xe0) >> 5));
+ memory_set_bank(space->machine(), "bank1", ((data & 0xe0) >> 5));
}
static WRITE8_HANDLER( mrgoemon_flipscreen_w )
{
- gberet_state *state = space->machine->driver_data<gberet_state>();
+ gberet_state *state = space->machine().driver_data<gberet_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
/*************************************
@@ -371,7 +371,7 @@ GFXDECODE_END
static MACHINE_START( gberet )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
state->save_item(NAME(state->irq_enable));
state->save_item(NAME(state->nmi_enable));
@@ -380,7 +380,7 @@ static MACHINE_START( gberet )
static MACHINE_RESET( gberet )
{
- gberet_state *state = machine->driver_data<gberet_state>();
+ gberet_state *state = machine.driver_data<gberet_state>();
state->irq_enable = 0;
state->nmi_enable = 0;
@@ -547,7 +547,7 @@ ROM_END
static DRIVER_INIT( mrgoemon )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x800);
}
diff --git a/src/mame/drivers/gbusters.c b/src/mame/drivers/gbusters.c
index 8874e3fc55d..9e64e0879c7 100644
--- a/src/mame/drivers/gbusters.c
+++ b/src/mame/drivers/gbusters.c
@@ -21,7 +21,7 @@ static KONAMI_SETLINES_CALLBACK( gbusters_banking );
static INTERRUPT_GEN( gbusters_interrupt )
{
- gbusters_state *state = device->machine->driver_data<gbusters_state>();
+ gbusters_state *state = device->machine().driver_data<gbusters_state>();
if (k052109_is_irq_enabled(state->k052109))
device_set_input_line(device, KONAMI_IRQ_LINE, HOLD_LINE);
@@ -29,17 +29,17 @@ static INTERRUPT_GEN( gbusters_interrupt )
static READ8_HANDLER( bankedram_r )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (state->palette_selected)
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
else
return state->ram[offset];
}
static WRITE8_HANDLER( bankedram_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (state->palette_selected)
paletteram_xBBBBBGGGGGRRRRR_be_w(space, offset, data);
@@ -49,7 +49,7 @@ static WRITE8_HANDLER( bankedram_w )
static WRITE8_HANDLER( gbusters_1f98_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
/* bit 0 = enable char ROM reading through the video RAM */
k052109_set_rmrd_line(state->k052109, (data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
@@ -66,14 +66,14 @@ static WRITE8_HANDLER( gbusters_1f98_w )
static WRITE8_HANDLER( gbusters_coin_counter_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
/* bit 0 select palette RAM or work RAM at 5800-5fff */
state->palette_selected = ~data & 0x01;
/* bits 1 & 2 = coin counters */
- coin_counter_w(space->machine, 0, data & 0x02);
- coin_counter_w(space->machine, 1, data & 0x04);
+ coin_counter_w(space->machine(), 0, data & 0x02);
+ coin_counter_w(space->machine(), 1, data & 0x04);
/* bits 3 selects tilemap priority */
state->priority = data & 0x08;
@@ -105,7 +105,7 @@ char baf[40];
static WRITE8_HANDLER( gbusters_sh_irqtrigger_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -127,7 +127,7 @@ static WRITE8_DEVICE_HANDLER( gbusters_snd_bankswitch_w )
/* special handlers to combine 052109 & 051960 */
static READ8_HANDLER( k052109_051960_r )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -144,7 +144,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- gbusters_state *state = space->machine->driver_data<gbusters_state>();
+ gbusters_state *state = space->machine().driver_data<gbusters_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -274,31 +274,31 @@ static const k051960_interface gbusters_k051960_intf =
static MACHINE_START( gbusters )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
+ machine.generic.paletteram.u8 = auto_alloc_array_clear(machine, UINT8, 0x800);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
- state->k007232 = machine->device("k007232");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
+ state->k007232 = machine.device("k007232");
state->save_item(NAME(state->palette_selected));
state->save_item(NAME(state->priority));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x800);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x800);
}
static MACHINE_RESET( gbusters )
{
- gbusters_state *state = machine->driver_data<gbusters_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ gbusters_state *state = machine.driver_data<gbusters_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
- konami_configure_set_lines(machine->device("maincpu"), gbusters_banking);
+ konami_configure_set_lines(machine.device("maincpu"), gbusters_banking);
/* mirror address for banked ROM */
memcpy(&RAM[0x18000], &RAM[0x10000], 0x08000);
@@ -434,7 +434,7 @@ ROM_END
static KONAMI_SETLINES_CALLBACK( gbusters_banking )
{
/* bits 0-3 ROM bank */
- memory_set_bank(device->machine, "bank1", lines & 0x0f);
+ memory_set_bank(device->machine(), "bank1", lines & 0x0f);
if (lines & 0xf0)
{
diff --git a/src/mame/drivers/gcpinbal.c b/src/mame/drivers/gcpinbal.c
index eafa0c56a7e..3aa75ad64eb 100644
--- a/src/mame/drivers/gcpinbal.c
+++ b/src/mame/drivers/gcpinbal.c
@@ -44,14 +44,14 @@ Stephh's notes (based on the game M68000 code and some tests) :
static TIMER_CALLBACK( gcpinbal_interrupt1 )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
device_set_input_line(state->maincpu, 1, HOLD_LINE);
}
#ifdef UNUSED_FUNCTION
static TIMER_CALLBACK( gcpinbal_interrupt3 )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
// IRQ3 is from the M6585
// if (!ADPCM_playing(0))
{
@@ -64,8 +64,8 @@ static INTERRUPT_GEN( gcpinbal_interrupt )
{
/* Unsure of actual sequence */
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(gcpinbal_interrupt1));
-// device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(1000), FUNC(gcpinbal_interrupt3));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(500), FUNC(gcpinbal_interrupt1));
+// device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(1000), FUNC(gcpinbal_interrupt3));
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -76,20 +76,20 @@ static INTERRUPT_GEN( gcpinbal_interrupt )
static READ16_HANDLER( ioc_r )
{
- gcpinbal_state *state = space->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = space->machine().driver_data<gcpinbal_state>();
/* 20 (only once), 76, a0 are read in log */
switch (offset)
{
case 0x80/2:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 0x84/2:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x86/2:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x50:
case 0x51:
@@ -105,7 +105,7 @@ static READ16_HANDLER( ioc_r )
static WRITE16_HANDLER( ioc_w )
{
- gcpinbal_state *state = space->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = space->machine().driver_data<gcpinbal_state>();
COMBINE_DATA(&state->ioc_ram[offset]);
// switch (offset)
@@ -114,8 +114,8 @@ static WRITE16_HANDLER( ioc_w )
// return;
//
// case 0x88/2: /* coin control (+ others) ??? */
-// coin_lockout_w(space->machine, 0, ~data & 0x01);
-// coin_lockout_w(space->machine, 1, ~data & 0x02);
+// coin_lockout_w(space->machine(), 0, ~data & 0x01);
+// coin_lockout_w(space->machine(), 1, ~data & 0x02);
//popmessage(" address %04x value %04x", offset, data);
// }
@@ -204,7 +204,7 @@ static WRITE16_HANDLER( ioc_w )
/* Controlled through ioc? */
static void gcp_adpcm_int( device_t *device )
{
- gcpinbal_state *state = device->machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = device->machine().driver_data<gcpinbal_state>();
if (state->adpcm_idle)
msm5205_reset_w(device, 1);
@@ -216,7 +216,7 @@ static void gcp_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("msm")->base();
+ UINT8 *ROM = device->machine().region("msm")->base();
state->adpcm_data = ((state->adpcm_trigger ? (ROM[state->adpcm_start] & 0x0f) : (ROM[state->adpcm_start] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
@@ -394,7 +394,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( gcpinbal )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
state->save_item(NAME(state->scrollx));
state->save_item(NAME(state->scrolly));
@@ -412,7 +412,7 @@ static MACHINE_START( gcpinbal )
static MACHINE_RESET( gcpinbal )
{
- gcpinbal_state *state = machine->driver_data<gcpinbal_state>();
+ gcpinbal_state *state = machine.driver_data<gcpinbal_state>();
int i;
for (i = 0; i < 3; i++)
diff --git a/src/mame/drivers/gei.c b/src/mame/drivers/gei.c
index 40a1703f28b..4c8dcf8e7b5 100644
--- a/src/mame/drivers/gei.c
+++ b/src/mame/drivers/gei.c
@@ -90,7 +90,7 @@ public:
static WRITE8_HANDLER( gei_drawctrl_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
state->drawctrl[offset] = data;
if (offset == 2)
{
@@ -102,7 +102,7 @@ static WRITE8_HANDLER( gei_drawctrl_w )
static WRITE8_HANDLER( gei_bitmap_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
int sx,sy;
int i;
@@ -115,7 +115,7 @@ static WRITE8_HANDLER( gei_bitmap_w )
for (i = 0; i < 8; i++)
- *BITMAP_ADDR16(space->machine->generic.tmpbitmap, sy, sx+i) = state->color[8-i-1];
+ *BITMAP_ADDR16(space->machine().generic.tmpbitmap, sy, sx+i) = state->color[8-i-1];
}
static PALETTE_INIT(gei)
@@ -141,66 +141,66 @@ static PALETTE_INIT(quizvid)
static WRITE8_DEVICE_HANDLER( lamps_w )
{
/* 5 button lamps */
- set_led_status(device->machine, 0,data & 0x01);
- set_led_status(device->machine, 1,data & 0x02);
- set_led_status(device->machine, 2,data & 0x04);
- set_led_status(device->machine, 3,data & 0x08);
- set_led_status(device->machine, 4,data & 0x10);
+ set_led_status(device->machine(), 0,data & 0x01);
+ set_led_status(device->machine(), 1,data & 0x02);
+ set_led_status(device->machine(), 2,data & 0x04);
+ set_led_status(device->machine(), 3,data & 0x08);
+ set_led_status(device->machine(), 4,data & 0x10);
/* 3 button lamps for deal, cancel, stand in poker games;
lamp order verified in poker and selection self tests */
- set_led_status(device->machine, 7,data & 0x20);
- set_led_status(device->machine, 5,data & 0x40);
- set_led_status(device->machine, 6,data & 0x80);
+ set_led_status(device->machine(), 7,data & 0x20);
+ set_led_status(device->machine(), 5,data & 0x40);
+ set_led_status(device->machine(), 6,data & 0x80);
}
static WRITE8_DEVICE_HANDLER( sound_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* bit 3 - coin lockout, lamp10 in poker / lamp6 in trivia test modes */
- coin_lockout_global_w(device->machine, ~data & 0x08);
- set_led_status(device->machine, 9,data & 0x08);
+ coin_lockout_global_w(device->machine(), ~data & 0x08);
+ set_led_status(device->machine(), 9,data & 0x08);
/* bit 5 - ticket out in trivia games */
- ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x20)<< 2);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, (data & 0x20)<< 2);
/* bit 6 enables NMI */
interrupt_enable_w(space, 0, data & 0x40);
/* bit 7 goes directly to the sound amplifier */
- dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255);
+ dac_data_w(device->machine().device("dac"), ((data & 0x80) >> 7) * 255);
}
static WRITE8_DEVICE_HANDLER( sound2_w )
{
/* bit 3,6 - coin lockout, lamp10+11 in selection test mode */
- coin_lockout_w(device->machine, 0, ~data & 0x08);
- coin_lockout_w(device->machine, 1, ~data & 0x40);
- set_led_status(device->machine, 9,data & 0x08);
- set_led_status(device->machine, 10,data & 0x40);
+ coin_lockout_w(device->machine(), 0, ~data & 0x08);
+ coin_lockout_w(device->machine(), 1, ~data & 0x40);
+ set_led_status(device->machine(), 9,data & 0x08);
+ set_led_status(device->machine(), 10,data & 0x40);
/* bit 4,5 - lamps 12, 13 in selection test mode;
12 lights up if dsw maximum bet = 30 an bet > 15 or if dsw maximum bet = 10 an bet = 10 */
- set_led_status(device->machine, 11,data & 0x10);
- set_led_status(device->machine, 12,data & 0x20);
+ set_led_status(device->machine(), 11,data & 0x10);
+ set_led_status(device->machine(), 12,data & 0x20);
/* bit 7 goes directly to the sound amplifier */
- dac_data_w(device->machine->device("dac"), ((data & 0x80) >> 7) * 255);
+ dac_data_w(device->machine().device("dac"), ((data & 0x80) >> 7) * 255);
}
static WRITE8_DEVICE_HANDLER( lamps2_w )
{
/* bit 4 - play/raise button lamp, lamp 9 in poker test mode */
- set_led_status(device->machine, 8,data & 0x10);
+ set_led_status(device->machine(), 8,data & 0x10);
}
static WRITE8_DEVICE_HANDLER( nmi_w )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* bit 4 - play/raise button lamp, lamp 9 in selection test mode */
- set_led_status(device->machine, 8,data & 0x10);
+ set_led_status(device->machine(), 8,data & 0x10);
/* bit 6 enables NMI */
interrupt_enable_w(space, 0, data & 0x40);
@@ -223,68 +223,68 @@ static READ8_DEVICE_HANDLER( portC_r )
static WRITE8_HANDLER( banksel_main_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x8000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x8000);
}
static WRITE8_HANDLER( banksel_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x10000);
}
static WRITE8_HANDLER( banksel_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x18000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x18000);
}
static WRITE8_HANDLER( banksel_3_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x20000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x20000);
}
static WRITE8_HANDLER( banksel_4_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x28000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x28000);
}
static WRITE8_HANDLER( banksel_5_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x30000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x30000);
}
static WRITE8_HANDLER( banksel_1_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x10000);
}
static WRITE8_HANDLER( banksel_2_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x14000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x14000);
}
static WRITE8_HANDLER( banksel_3_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x18000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x18000);
}
static WRITE8_HANDLER( banksel_4_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x1c000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x1c000);
}
static WRITE8_HANDLER( banksel_5_1_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x20000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x20000);
}
static WRITE8_HANDLER( banksel_1_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x12000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x12000);
}
static WRITE8_HANDLER( banksel_2_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x16000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x16000);
}
static WRITE8_HANDLER( banksel_3_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x1a000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x1a000);
}
static WRITE8_HANDLER( banksel_4_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x1e000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x1e000);
}
static WRITE8_HANDLER( banksel_5_2_w )
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x22000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x22000);
}
static WRITE8_HANDLER(geimulti_bank_w)
@@ -312,36 +312,36 @@ static WRITE8_HANDLER(geimulti_bank_w)
}
if (bank != -1)
- memory_set_bankptr(space->machine, "bank1", space->machine->region("bank")->base() + bank*0x8000);
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("bank")->base() + bank*0x8000);
}
static READ8_HANDLER(banksel_1_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x10000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x10000);
return 0x03;
};
static READ8_HANDLER(banksel_2_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x18000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x18000);
return 0x03;
}
static READ8_HANDLER(banksel_3_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x20000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x20000);
return 0x03;
}
static READ8_HANDLER(banksel_4_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x28000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x28000);
return 0x03;
}
static READ8_HANDLER(banksel_5_r)
{
- memory_set_bankptr(space->machine, "bank1",space->machine->region("maincpu")->base() + 0x30000);
+ memory_set_bankptr(space->machine(), "bank1",space->machine().region("maincpu")->base() + 0x30000);
return 0x03;
}
@@ -349,13 +349,13 @@ static READ8_HANDLER(banksel_5_r)
static READ8_HANDLER( signature_r )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
return state->signature_answer;
}
static WRITE8_HANDLER( signature_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
if (data == 0) state->signature_pos = 0;
else
{
@@ -369,7 +369,7 @@ static WRITE8_HANDLER( signature_w )
static WRITE8_HANDLER( signature2_w )
{
- gei_state *state = space->machine->driver_data<gei_state>();
+ gei_state *state = space->machine().driver_data<gei_state>();
if (data == 0) state->signature_pos = 0;
else
{
@@ -1824,12 +1824,12 @@ ROM_END
static DRIVER_INIT( setbank )
{
- memory_set_bankptr(machine, "bank1",machine->region("maincpu")->base() + 0x2000);
+ memory_set_bankptr(machine, "bank1",machine.region("maincpu")->base() + 0x2000);
}
static DRIVER_INIT( geimulti )
{
- memory_set_bankptr(machine, "bank1",machine->region("bank")->base() + 0x0000);
+ memory_set_bankptr(machine, "bank1",machine.region("bank")->base() + 0x0000);
}
GAME( 1982, jokpoker, 0, gselect, gselect, setbank, ROT0, "Greyhound Electronics", "Joker Poker (Version 16.03B)", GAME_IMPERFECT_GRAPHICS | GAME_IMPERFECT_SOUND )
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index b30dd84ed86..22de6d592f5 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -116,7 +116,7 @@ static const UINT8 security_data[] = { 0x01, 0xC4, 0xFF, 0x22 };
static UINT32 s3c2410_gpio_port_r( device_t *device, int port)
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
UINT32 data = state->bballoon_port[port];
switch (port)
{
@@ -137,7 +137,7 @@ static UINT32 s3c2410_gpio_port_r( device_t *device, int port)
static void s3c2410_gpio_port_w( device_t *device, int port, UINT32 data)
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
UINT32 old_value = state->bballoon_port[port];
state->bballoon_port[port] = data;
switch (port)
@@ -167,9 +167,9 @@ static void s3c2410_gpio_port_w( device_t *device, int port, UINT32 data)
static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->nand;
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
logerror( "s3c2410_nand_command_w %02X\n", data);
switch (data)
{
@@ -191,9 +191,9 @@ static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->nand;
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
logerror( "s3c2410_nand_address_w %02X\n", data);
switch (nand.mode)
{
@@ -225,9 +225,9 @@ static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
{
- ghosteo_state *state = device->machine->driver_data<ghosteo_state>();
+ ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->nand;
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
UINT8 data = 0;
switch (nand.mode)
{
@@ -238,7 +238,7 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
break;
case NAND_M_READ :
{
- UINT8 *flash = (UINT8 *)device->machine->region( "user1")->base();
+ UINT8 *flash = (UINT8 *)device->machine().region( "user1")->base();
if (nand.byte_addr < 0x200)
{
data = *(flash + nand.page_addr * 0x200 + nand.byte_addr);
@@ -272,20 +272,20 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
static WRITE8_DEVICE_HANDLER( s3c2410_nand_data_w )
{
-// device_t *nand = device->machine->device( "nand");
+// device_t *nand = device->machine().device( "nand");
logerror( "s3c2410_nand_data_w %02X\n", data);
}
static WRITE_LINE_DEVICE_HANDLER( s3c2410_i2c_scl_w )
{
- device_t *i2cmem = device->machine->device( "i2cmem");
+ device_t *i2cmem = device->machine().device( "i2cmem");
// logerror( "s3c2410_i2c_scl_w %d\n", state ? 1 : 0);
i2cmem_scl_write( i2cmem, state);
}
static READ_LINE_DEVICE_HANDLER( s3c2410_i2c_sda_r )
{
- device_t *i2cmem = device->machine->device( "i2cmem");
+ device_t *i2cmem = device->machine().device( "i2cmem");
int state;
state = i2cmem_sda_read( i2cmem);
// logerror( "s3c2410_i2c_sda_r %d\n", state ? 1 : 0);
@@ -294,7 +294,7 @@ static READ_LINE_DEVICE_HANDLER( s3c2410_i2c_sda_r )
static WRITE_LINE_DEVICE_HANDLER( s3c2410_i2c_sda_w )
{
- device_t *i2cmem = device->machine->device( "i2cmem");
+ device_t *i2cmem = device->machine().device( "i2cmem");
// logerror( "s3c2410_i2c_sda_w %d\n", state ? 1 : 0);
i2cmem_sda_write( i2cmem, state);
}
@@ -437,8 +437,8 @@ static READ32_HANDLER( bballoon_speedup_r )
static MACHINE_RESET( bballoon )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4d000010, 0x4d000013, FUNC(bballoon_speedup_r));
- s3c2410 = machine->device("s3c2410");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4d000010, 0x4d000013, FUNC(bballoon_speedup_r));
+ s3c2410 = machine.device("s3c2410");
}
static MACHINE_CONFIG_START( bballoon, ghosteo_state )
@@ -549,8 +549,8 @@ ROM_END
static DRIVER_INIT( bballoon )
{
- ghosteo_state *state = machine->driver_data<ghosteo_state>();
- memcpy( state->steppingstone, machine->region( "user1")->base(), 4 * 1024);
+ ghosteo_state *state = machine.driver_data<ghosteo_state>();
+ memcpy( state->steppingstone, machine.region( "user1")->base(), 4 * 1024);
}
GAME( 2003, bballoon, 0, bballoon, bballoon, bballoon, ROT0, "Eolith", "BnB Arcade", GAME_NO_SOUND )
diff --git a/src/mame/drivers/gijoe.c b/src/mame/drivers/gijoe.c
index e3a86a154b4..d221481a9ca 100644
--- a/src/mame/drivers/gijoe.c
+++ b/src/mame/drivers/gijoe.c
@@ -60,13 +60,13 @@ static const eeprom_interface eeprom_intf =
static READ16_HANDLER( control2_r )
{
- gijoe_state *state = space->machine->driver_data<gijoe_state>();
+ gijoe_state *state = space->machine().driver_data<gijoe_state>();
return state->cur_control2;
}
static WRITE16_HANDLER( control2_w )
{
- gijoe_state *state = space->machine->driver_data<gijoe_state>();
+ gijoe_state *state = space->machine().driver_data<gijoe_state>();
if (ACCESSING_BITS_0_7)
{
@@ -76,7 +76,7 @@ static WRITE16_HANDLER( control2_w )
/* bit 3 (unknown: coin) */
/* bit 5 is enable irq 6 */
/* bit 7 (unknown: enable irq 5?) */
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
state->cur_control2 = data;
@@ -85,9 +85,9 @@ static WRITE16_HANDLER( control2_w )
}
}
-static void gijoe_objdma( running_machine *machine )
+static void gijoe_objdma( running_machine &machine )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
UINT16 *src_head, *src_tail, *dst_head, *dst_tail;
src_head = state->spriteram;
@@ -112,7 +112,7 @@ static void gijoe_objdma( running_machine *machine )
static TIMER_CALLBACK( dmaend_callback )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
if (state->cur_control2 & 0x0020)
device_set_input_line(state->maincpu, 6, HOLD_LINE);
@@ -120,7 +120,7 @@ static TIMER_CALLBACK( dmaend_callback )
static INTERRUPT_GEN( gijoe_interrupt )
{
- gijoe_state *state = device->machine->driver_data<gijoe_state>();
+ gijoe_state *state = device->machine().driver_data<gijoe_state>();
// global interrupt masking (*this game only)
if (!k056832_is_irq_enabled(state->k056832, 0))
@@ -128,7 +128,7 @@ static INTERRUPT_GEN( gijoe_interrupt )
if (k053246_is_irq_enabled(state->k053246))
{
- gijoe_objdma(device->machine);
+ gijoe_objdma(device->machine());
// 42.7us(clr) + 341.3us(xfer) delay at 6Mhz dotclock
state->dmadelay_timer->adjust(JOE_DMADELAY);
@@ -150,7 +150,7 @@ static WRITE16_HANDLER( sound_cmd_w )
static WRITE16_HANDLER( sound_irq_w )
{
- gijoe_state *state = space->machine->driver_data<gijoe_state>();
+ gijoe_state *state = space->machine().driver_data<gijoe_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -161,7 +161,7 @@ static READ16_HANDLER( sound_status_r )
static void sound_nmi( device_t *device )
{
- gijoe_state *state = device->machine->driver_data<gijoe_state>();
+ gijoe_state *state = device->machine().driver_data<gijoe_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -276,23 +276,23 @@ static const k053247_interface gijoe_k053247_intf =
static MACHINE_START( gijoe )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->k054539 = machine->device("k054539");
- state->k056832 = machine->device("k056832");
- state->k053246 = machine->device("k053246");
- state->k053251 = machine->device("k053251");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->k054539 = machine.device("k054539");
+ state->k056832 = machine.device("k056832");
+ state->k053246 = machine.device("k053246");
+ state->k053251 = machine.device("k053251");
- state->dmadelay_timer = machine->scheduler().timer_alloc(FUNC(dmaend_callback));
+ state->dmadelay_timer = machine.scheduler().timer_alloc(FUNC(dmaend_callback));
state->save_item(NAME(state->cur_control2));
}
static MACHINE_RESET( gijoe )
{
- gijoe_state *state = machine->driver_data<gijoe_state>();
+ gijoe_state *state = machine.driver_data<gijoe_state>();
state->cur_control2 = 0;
}
diff --git a/src/mame/drivers/ginganin.c b/src/mame/drivers/ginganin.c
index 3698c125a75..b4e60934cf5 100644
--- a/src/mame/drivers/ginganin.c
+++ b/src/mame/drivers/ginganin.c
@@ -89,7 +89,7 @@ static WRITE8_HANDLER( MC6840_control_port_0_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_index0 = data;
if (state->MC6840_index0 & 0x80) /* enable timer output */
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( MC6840_control_port_1_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_index1 = data;
}
@@ -125,7 +125,7 @@ static WRITE8_HANDLER( MC6840_write_port_0_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_register0 = data;
}
@@ -134,7 +134,7 @@ static WRITE8_HANDLER( MC6840_write_port_1_w )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = space->machine->driver_data<ginganin_state>();
+ ginganin_state *state = space->machine().driver_data<ginganin_state>();
state->MC6840_register1 = data;
}
@@ -278,7 +278,7 @@ static INTERRUPT_GEN( ginganin_sound_interrupt )
/* MC6840 Emulation by Takahiro Nogi. 1999/09/27
(This routine hasn't been completed yet.) */
- ginganin_state *state = device->machine->driver_data<ginganin_state>();
+ ginganin_state *state = device->machine().driver_data<ginganin_state>();
if (state->S_TEMPO_OLD != state->S_TEMPO)
{
@@ -304,9 +304,9 @@ static INTERRUPT_GEN( ginganin_sound_interrupt )
static MACHINE_START( ginganin )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->layers_ctrl));
state->save_item(NAME(state->flipscreen));
@@ -322,7 +322,7 @@ static MACHINE_START( ginganin )
static MACHINE_RESET( ginganin )
{
- ginganin_state *state = machine->driver_data<ginganin_state>();
+ ginganin_state *state = machine.driver_data<ginganin_state>();
state->layers_ctrl = 0;
state->flipscreen = 0;
@@ -459,7 +459,7 @@ static DRIVER_INIT( ginganin )
UINT16 *rom;
/* main cpu patches */
- rom = (UINT16 *)machine->region("maincpu")->base();
+ rom = (UINT16 *)machine.region("maincpu")->base();
/* avoid writes to rom getting to the log */
rom[0x408 / 2] = 0x6000;
rom[0x40a / 2] = 0x001c;
@@ -467,7 +467,7 @@ static DRIVER_INIT( ginganin )
/* sound cpu patches */
/* let's clear the RAM: ROM starts at 0x4000 */
- memset(machine->region("audiocpu")->base(), 0, 0x800);
+ memset(machine.region("audiocpu")->base(), 0, 0x800);
}
diff --git a/src/mame/drivers/gladiatr.c b/src/mame/drivers/gladiatr.c
index 5e242417349..d161ad066e0 100644
--- a/src/mame/drivers/gladiatr.c
+++ b/src/mame/drivers/gladiatr.c
@@ -194,22 +194,22 @@ TODO:
/*Rom bankswitching*/
static WRITE8_HANDLER( gladiatr_bankswitch_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base() + 0x10000;
+ UINT8 *rom = space->machine().region("maincpu")->base() + 0x10000;
- memory_set_bankptr(space->machine, "bank1", rom + 0x6000 * (data & 0x01));
+ memory_set_bankptr(space->machine(), "bank1", rom + 0x6000 * (data & 0x01));
}
static READ8_HANDLER( gladiator_dsw1_r )
{
- int orig = input_port_read(space->machine, "DSW1")^0xff;
+ int orig = input_port_read(space->machine(), "DSW1")^0xff;
return BITSWAP8(orig, 0,1,2,3,4,5,6,7);
}
static READ8_HANDLER( gladiator_dsw2_r )
{
- int orig = input_port_read(space->machine, "DSW2")^0xff;
+ int orig = input_port_read(space->machine(), "DSW2")^0xff;
return BITSWAP8(orig, 2,3,4,5,6,7,1,0);
}
@@ -218,15 +218,15 @@ static READ8_HANDLER( gladiator_controls_r )
{
int coins = 0;
- if( input_port_read(space->machine, "COINS") & 0xc0 ) coins = 0x80;
+ if( input_port_read(space->machine(), "COINS") & 0xc0 ) coins = 0x80;
switch(offset)
{
case 0x01: /* start button , coins */
- return input_port_read(space->machine, "IN0") | coins;
+ return input_port_read(space->machine(), "IN0") | coins;
case 0x02: /* Player 1 Controller , coins */
- return input_port_read(space->machine, "IN1") | coins;
+ return input_port_read(space->machine(), "IN1") | coins;
case 0x04: /* Player 2 Controller , coins */
- return input_port_read(space->machine, "IN2") | coins;
+ return input_port_read(space->machine(), "IN2") | coins;
}
/* unknown */
return 0;
@@ -237,7 +237,7 @@ static READ8_HANDLER( gladiator_button3_r )
switch(offset)
{
case 0x01: /* button 3 */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
/* unknown */
return 0;
@@ -256,9 +256,9 @@ static MACHINE_RESET( gladiator )
TAITO8741_start(&gladiator_8741interface);
/* 6809 bank memory set */
{
- UINT8 *rom = machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = machine.region("audiocpu")->base() + 0x10000;
memory_set_bankptr(machine, "bank2",rom);
- machine->device("audiocpu")->reset();
+ machine.device("audiocpu")->reset();
}
}
@@ -273,16 +273,16 @@ static WRITE8_DEVICE_HANDLER( gladiator_int_control_w )
static void gladiator_ym_irq(device_t *device, int irq)
{
/* NMI IRQ is not used by gladiator sound program */
- cputag_set_input_line(device->machine, "sub", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "sub", INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
/*Sound Functions*/
static WRITE8_DEVICE_HANDLER( glad_adpcm_w )
{
- UINT8 *rom = device->machine->region("audiocpu")->base() + 0x10000;
+ UINT8 *rom = device->machine().region("audiocpu")->base() + 0x10000;
/* bit6 = bank offset */
- memory_set_bankptr(device->machine, "bank2",rom + ((data & 0x40) ? 0xc000 : 0));
+ memory_set_bankptr(device->machine(), "bank2",rom + ((data & 0x40) ? 0xc000 : 0));
msm5205_data_w(device,data); /* bit0..3 */
msm5205_reset_w(device,(data>>5)&1); /* bit 5 */
@@ -292,18 +292,18 @@ static WRITE8_DEVICE_HANDLER( glad_adpcm_w )
static WRITE8_HANDLER( glad_cpu_sound_command_w )
{
soundlatch_w(space,0,data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, ASSERT_LINE);
}
static READ8_HANDLER( glad_cpu_sound_command_r )
{
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space,0);
}
static WRITE8_HANDLER( gladiatr_flipscreen_w )
{
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
}
@@ -311,7 +311,7 @@ static WRITE8_HANDLER( gladiatr_flipscreen_w )
/* !!!!! patch to IRQ timming for 2nd CPU !!!!! */
static WRITE8_HANDLER( gladiatr_irq_patch_w )
{
- cputag_set_input_line(space->machine, "sub", 0, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, HOLD_LINE);
}
#endif
@@ -323,7 +323,7 @@ static WRITE8_HANDLER( gladiatr_irq_patch_w )
static WRITE8_HANDLER(qx0_w)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
{
state->data2=data;
@@ -333,7 +333,7 @@ static WRITE8_HANDLER(qx0_w)
static WRITE8_HANDLER(qx1_w)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
{
state->data1=data;
@@ -345,13 +345,13 @@ static WRITE8_HANDLER(qx2_w){ }
static WRITE8_HANDLER(qx3_w){ }
-static READ8_HANDLER(qx2_r){ return space->machine->rand(); }
+static READ8_HANDLER(qx2_r){ return space->machine().rand(); }
-static READ8_HANDLER(qx3_r){ return space->machine->rand()&0xf; }
+static READ8_HANDLER(qx3_r){ return space->machine().rand()&0xf; }
static READ8_HANDLER(qx0_r)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
return state->data1;
else
@@ -360,7 +360,7 @@ static READ8_HANDLER(qx0_r)
static READ8_HANDLER(qx1_r)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(!offset)
return state->data2;
else
@@ -369,7 +369,7 @@ static READ8_HANDLER(qx1_r)
static MACHINE_RESET( ppking )
{
- gladiatr_state *state = machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = machine.driver_data<gladiatr_state>();
state->data1 = state->data2 = 0;
state->flag1 = state->flag2 = 1;
}
@@ -627,7 +627,7 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER(f1_r)
{
- return device->machine->rand();
+ return device->machine().rand();
}
static const ym2203_interface ppking_ym2203_interface =
@@ -962,7 +962,7 @@ static DRIVER_INIT( gladiatr )
UINT8 *rom;
int i,j;
- rom = machine->region("gfx2")->base();
+ rom = machine.region("gfx2")->base();
// unpack 3bpp graphics
for (j = 3; j >= 0; j--)
{
@@ -976,7 +976,7 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x14000, rom + 0x18000, 0x4000);
- rom = machine->region("gfx3")->base();
+ rom = machine.region("gfx3")->base();
// unpack 3bpp graphics
for (j = 5; j >= 0; j--)
{
@@ -993,14 +993,14 @@ static DRIVER_INIT( gladiatr )
swap_block(rom + 0x24000, rom + 0x28000, 0x4000);
/* make sure bank is valid in cpu-reset */
- rom = machine->region("audiocpu")->base() + 0x10000;
+ rom = machine.region("audiocpu")->base() + 0x10000;
memory_set_bankptr(machine, "bank2",rom);
}
static READ8_HANDLER(f6a3_r)
{
- gladiatr_state *state = space->machine->driver_data<gladiatr_state>();
+ gladiatr_state *state = space->machine().driver_data<gladiatr_state>();
if(cpu_get_previouspc(space->cpu)==0x8e)
state->m_nvram[0x6a3]=1;
@@ -1012,14 +1012,14 @@ static DRIVER_INIT(ppking)
UINT8 *rom;
int i,j;
- rom = machine->region("gfx2")->base();
+ rom = machine.region("gfx2")->base();
// unpack 3bpp graphics
for (i = 0; i < 0x2000; i++)
{
rom[i+0x2000] = rom[i] >> 4;
}
- rom = machine->region("gfx3")->base();
+ rom = machine.region("gfx3")->base();
// unpack 3bpp graphics
for (j = 1; j >= 0; j--)
{
@@ -1030,7 +1030,7 @@ static DRIVER_INIT(ppking)
}
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf6a3,0xf6a3,FUNC(f6a3_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf6a3,0xf6a3,FUNC(f6a3_r) );
}
diff --git a/src/mame/drivers/glass.c b/src/mame/drivers/glass.c
index 92693578d6c..858d8ce17e9 100644
--- a/src/mame/drivers/glass.c
+++ b/src/mame/drivers/glass.c
@@ -15,13 +15,13 @@ The DS5002FP has up to 128KB undumped gameplay code making the game unplayable :
static WRITE16_HANDLER( clr_int_w )
{
- glass_state *state = space->machine->driver_data<glass_state>();
+ glass_state *state = space->machine().driver_data<glass_state>();
state->cause_interrupt = 1;
}
static INTERRUPT_GEN( glass_interrupt )
{
- glass_state *state = device->machine->driver_data<glass_state>();
+ glass_state *state = device->machine().driver_data<glass_state>();
if (state->cause_interrupt)
{
@@ -55,7 +55,7 @@ GFXDECODE_END
static WRITE16_HANDLER( OKIM6295_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("oki")->base();
+ UINT8 *RAM = space->machine().region("oki")->base();
if (ACCESSING_BITS_0_7)
memcpy(&RAM[0x30000], &RAM[0x40000 + (data & 0x0f) * 0x10000], 0x10000);
@@ -67,11 +67,11 @@ static WRITE16_HANDLER( glass_coin_w )
{
case 0x00: /* Coin Lockouts */
case 0x01:
- coin_lockout_w(space->machine, (offset >> 3) & 0x01, ~data & 0x01);
+ coin_lockout_w(space->machine(), (offset >> 3) & 0x01, ~data & 0x01);
break;
case 0x02: /* Coin Counters */
case 0x03:
- coin_counter_w(space->machine, (offset >> 3) & 0x01, data & 0x01);
+ coin_counter_w(space->machine(), (offset >> 3) & 0x01, data & 0x01);
break;
case 0x04: /* Sound Muting (if bit 0 == 1, sound output stream = 0) */
break;
@@ -173,7 +173,7 @@ INPUT_PORTS_END
static MACHINE_START( glass )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
state->save_item(NAME(state->cause_interrupt));
state->save_item(NAME(state->current_bit));
@@ -183,7 +183,7 @@ static MACHINE_START( glass )
static MACHINE_RESET( glass )
{
- glass_state *state = machine->driver_data<glass_state>();
+ glass_state *state = machine.driver_data<glass_state>();
int i;
state->cause_interrupt = 1;
@@ -294,15 +294,15 @@ ROM_END
***************************************************************************/
-static void glass_ROM16_split_gfx( running_machine *machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
+static void glass_ROM16_split_gfx( running_machine &machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
{
int i;
/* get a pointer to the source data */
- UINT8 *src = (UINT8 *)machine->region(src_reg)->base();
+ UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
/* get a pointer to the destination data */
- UINT8 *dst = (UINT8 *)machine->region(dst_reg)->base();
+ UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length / 2; i++)
diff --git a/src/mame/drivers/gng.c b/src/mame/drivers/gng.c
index d60c1e82141..831edb1df53 100644
--- a/src/mame/drivers/gng.c
+++ b/src/mame/drivers/gng.c
@@ -31,14 +31,14 @@ Notes:
static WRITE8_HANDLER( gng_bankswitch_w )
{
if (data == 4)
- memory_set_bank(space->machine, "bank1", 4);
+ memory_set_bank(space->machine(), "bank1", 4);
else
- memory_set_bank(space->machine, "bank1", (data & 0x03));
+ memory_set_bank(space->machine(), "bank1", (data & 0x03));
}
static WRITE8_HANDLER( gng_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
static ADDRESS_MAP_START( gng_map, AS_PROGRAM, 8 )
@@ -303,9 +303,9 @@ GFXDECODE_END
static MACHINE_START( gng )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
- UINT8 *rombase = machine->region("maincpu")->base();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rombase[0x10000], 0x2000);
memory_configure_bank(machine, "bank1", 4, 1, &rombase[0x4000], 0x2000);
@@ -315,7 +315,7 @@ static MACHINE_START( gng )
static MACHINE_RESET( gng )
{
- gng_state *state = machine->driver_data<gng_state>();
+ gng_state *state = machine.driver_data<gng_state>();
state->scrollx[0] = 0;
state->scrollx[1] = 0;
@@ -721,7 +721,7 @@ static READ8_HANDLER( diamond_hack_r )
static DRIVER_INIT( diamond )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000, 0x6000, FUNC(diamond_hack_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6000, 0x6000, FUNC(diamond_hack_r));
}
diff --git a/src/mame/drivers/go2000.c b/src/mame/drivers/go2000.c
index aab5f121caa..61cffffbad4 100644
--- a/src/mame/drivers/go2000.c
+++ b/src/mame/drivers/go2000.c
@@ -52,7 +52,7 @@ public:
static WRITE16_HANDLER( sound_cmd_w )
{
- go2000_state *state = space->machine->driver_data<go2000_state>();
+ go2000_state *state = space->machine().driver_data<go2000_state>();
soundlatch_w(space, offset, data & 0xff);
device_set_input_line(state->soundcpu, 0, HOLD_LINE);
}
@@ -73,7 +73,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( go2000_pcm_1_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static ADDRESS_MAP_START( go2000_sound_map, AS_PROGRAM, 8 )
@@ -171,7 +171,7 @@ static VIDEO_START(go2000)
static SCREEN_UPDATE(go2000)
{
- go2000_state *state = screen->machine->driver_data<go2000_state>();
+ go2000_state *state = screen->machine().driver_data<go2000_state>();
int x,y;
int count = 0;
@@ -182,7 +182,7 @@ static SCREEN_UPDATE(go2000)
{
int tile = state->videoram[count];
int attr = state->videoram2[count];
- drawgfx_opaque(bitmap, cliprect, screen->machine->gfx[0], tile, attr, 0, 0, x * 8, y * 8);
+ drawgfx_opaque(bitmap, cliprect, screen->machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8);
count++;
}
}
@@ -194,7 +194,7 @@ static SCREEN_UPDATE(go2000)
{
int tile = state->videoram[count];
int attr = state->videoram2[count];
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0], tile, attr, 0, 0, x * 8, y * 8, 0xf);
count++;
}
}
@@ -203,8 +203,8 @@ static SCREEN_UPDATE(go2000)
{
int offs;
- int max_x = screen->machine->primary_screen->width() - 8;
- int max_y = screen->machine->primary_screen->height() - 8;
+ int max_x = screen->machine().primary_screen->width() - 8;
+ int max_y = screen->machine().primary_screen->height() - 8;
for (offs = 0xf800 / 2; offs < 0x10000 / 2 ; offs += 4/2)
{
@@ -277,7 +277,7 @@ static SCREEN_UPDATE(go2000)
if (flipx)
tile_flipx = !tile_flipx;
- if (flip_screen_get(screen->machine))
+ if (flip_screen_get(screen->machine()))
{
sx = max_x - sx;
sy = max_y - sy;
@@ -285,7 +285,7 @@ static SCREEN_UPDATE(go2000)
tile_flipy = !tile_flipy;
}
- drawgfx_transpen( bitmap, cliprect,screen->machine->gfx[0],
+ drawgfx_transpen( bitmap, cliprect,screen->machine().gfx[0],
(tile & 0x1fff) + bank*0x4000,
attr,
tile_flipx, tile_flipy,
@@ -306,8 +306,8 @@ static SCREEN_UPDATE(go2000)
static MACHINE_START( go2000 )
{
- go2000_state *state = machine->driver_data<go2000_state>();
- UINT8 *SOUND = machine->region("soundcpu")->base();
+ go2000_state *state = machine.driver_data<go2000_state>();
+ UINT8 *SOUND = machine.region("soundcpu")->base();
int i;
for (i = 0; i < 8; i++)
@@ -315,7 +315,7 @@ static MACHINE_START( go2000 )
memory_set_bank(machine, "bank1", 0);
- state->soundcpu = machine->device("soundcpu");
+ state->soundcpu = machine.device("soundcpu");
}
static MACHINE_CONFIG_START( go2000, go2000_state )
diff --git a/src/mame/drivers/goal92.c b/src/mame/drivers/goal92.c
index 8d03bb38f05..e5db61b3a23 100644
--- a/src/mame/drivers/goal92.c
+++ b/src/mame/drivers/goal92.c
@@ -17,7 +17,7 @@
static WRITE16_HANDLER( goal92_sound_command_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data >> 8) & 0xff);
@@ -30,15 +30,15 @@ static READ16_HANDLER( goal92_inputs_r )
switch(offset)
{
case 0:
- return input_port_read(space->machine, "DSW1");
+ return input_port_read(space->machine(), "DSW1");
case 1:
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 2:
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 3:
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
case 7:
- return input_port_read(space->machine, "DSW2");
+ return input_port_read(space->machine(), "DSW2");
default:
logerror("reading unhandled goal92 inputs %04X %04X @ PC = %04X\n", offset, mem_mask,cpu_get_pc(space->cpu));
@@ -70,14 +70,14 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( adpcm_control_w )
{
- memory_set_bank(device->machine, "bank1", data & 0x01);
+ memory_set_bank(device->machine(), "bank1", data & 0x01);
msm5205_reset_w(device, data & 0x08);
}
static WRITE8_HANDLER( adpcm_data_w )
{
- goal92_state *state = space->machine->driver_data<goal92_state>();
+ goal92_state *state = space->machine().driver_data<goal92_state>();
state->msm5205next = data;
}
@@ -213,7 +213,7 @@ INPUT_PORTS_END
static void irqhandler( device_t *device, int irq )
{
/* NMI writes to MSM ports *only*! -AS */
- //goal92_state *state = device->machine->driver_data<goal92_state>();
+ //goal92_state *state = device->machine().driver_data<goal92_state>();
//device_set_input_line(state->audiocpu, INPUT_LINE_NMI, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -229,7 +229,7 @@ static const ym2203_interface ym2203_config =
static void goal92_adpcm_int( device_t *device )
{
- goal92_state *state = device->machine->driver_data<goal92_state>();
+ goal92_state *state = device->machine().driver_data<goal92_state>();
msm5205_data_w(device, state->msm5205next);
state->msm5205next >>= 4;
state->adpcm_toggle^= 1;
@@ -292,12 +292,12 @@ GFXDECODE_END
static MACHINE_START( goal92 )
{
- goal92_state *state = machine->driver_data<goal92_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ goal92_state *state = machine.driver_data<goal92_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->fg_bank));
state->save_item(NAME(state->msm5205next));
@@ -306,7 +306,7 @@ static MACHINE_START( goal92 )
static MACHINE_RESET( goal92 )
{
- goal92_state *state = machine->driver_data<goal92_state>();
+ goal92_state *state = machine.driver_data<goal92_state>();
state->fg_bank = 0;
state->msm5205next = 0;
diff --git a/src/mame/drivers/goindol.c b/src/mame/drivers/goindol.c
index ffe4db68365..ce99969e92f 100644
--- a/src/mame/drivers/goindol.c
+++ b/src/mame/drivers/goindol.c
@@ -26,24 +26,24 @@ Notes:
static WRITE8_HANDLER( goindol_bankswitch_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
if (state->char_bank != ((data & 0x10) >> 4))
{
state->char_bank = (data & 0x10) >> 4;
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
}
static READ8_HANDLER( prot_f422_r )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
/* bit 7 = vblank? */
state->prot_toggle ^= 0x80;
@@ -54,7 +54,7 @@ static READ8_HANDLER( prot_f422_r )
static WRITE8_HANDLER( prot_fc44_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fc44_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0419] = 0x5b;
@@ -64,7 +64,7 @@ static WRITE8_HANDLER( prot_fc44_w )
static WRITE8_HANDLER( prot_fd99_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fd99_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0421] = 0x3f;
@@ -72,7 +72,7 @@ static WRITE8_HANDLER( prot_fd99_w )
static WRITE8_HANDLER( prot_fc66_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fc66_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0423] = 0x06;
@@ -80,7 +80,7 @@ static WRITE8_HANDLER( prot_fc66_w )
static WRITE8_HANDLER( prot_fcb0_w )
{
- goindol_state *state = space->machine->driver_data<goindol_state>();
+ goindol_state *state = space->machine().driver_data<goindol_state>();
logerror("%04x: prot_fcb0_w(%02x)\n", cpu_get_pc(space->cpu), data);
state->ram[0x0425] = 0x06;
@@ -226,8 +226,8 @@ GFXDECODE_END
static MACHINE_START( goindol )
{
- goindol_state *state = machine->driver_data<goindol_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ goindol_state *state = machine.driver_data<goindol_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
@@ -237,7 +237,7 @@ static MACHINE_START( goindol )
static MACHINE_RESET( goindol )
{
- goindol_state *state = machine->driver_data<goindol_state>();
+ goindol_state *state = machine.driver_data<goindol_state>();
state->char_bank = 0;
state->prot_toggle = 0;
@@ -391,7 +391,7 @@ ROM_END
static DRIVER_INIT( goindol )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* I hope that's all patches to avoid protection */
diff --git a/src/mame/drivers/goldngam.c b/src/mame/drivers/goldngam.c
index 8c9b4731e30..1db26c64608 100644
--- a/src/mame/drivers/goldngam.c
+++ b/src/mame/drivers/goldngam.c
@@ -258,7 +258,7 @@ static VIDEO_START( goldngam )
static SCREEN_UPDATE( goldngam )
{
- goldngam_state *state = screen->machine->driver_data<goldngam_state>();
+ goldngam_state *state = screen->machine().driver_data<goldngam_state>();
int x, y;
@@ -291,7 +291,7 @@ static PALETTE_INIT( goldngam )
static READ16_HANDLER(unk_r)
{
- int test1 = (space->machine->rand() & 0xae00);
+ int test1 = (space->machine().rand() & 0xae00);
// popmessage("VAL = %02x", test1);
return test1;
diff --git a/src/mame/drivers/goldnpkr.c b/src/mame/drivers/goldnpkr.c
index 6ca691f5b06..e7c5984d2a3 100644
--- a/src/mame/drivers/goldnpkr.c
+++ b/src/mame/drivers/goldnpkr.c
@@ -720,21 +720,21 @@ public:
static WRITE8_HANDLER( goldnpkr_videoram_w )
{
- goldnpkr_state *state = space->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = space->machine().driver_data<goldnpkr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( goldnpkr_colorram_w )
{
- goldnpkr_state *state = space->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = space->machine().driver_data<goldnpkr_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
/* - bits -
7654 3210
--xx xx-- tiles color.
@@ -753,7 +753,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( xtnd_get_bg_tile_info )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
/* 3 graphics banks system for VK extended cards
- bits -
@@ -773,19 +773,19 @@ static TILE_GET_INFO( xtnd_get_bg_tile_info )
static VIDEO_START( goldnpkr )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static VIDEO_START( wcrdxtnd )
{
- goldnpkr_state *state = machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = machine.driver_data<goldnpkr_state>();
state->bg_tilemap = tilemap_create(machine, xtnd_get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( goldnpkr )
{
- goldnpkr_state *state = screen->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = screen->machine().driver_data<goldnpkr_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -805,7 +805,7 @@ static PALETTE_INIT( goldnpkr )
/* 0000IBGR */
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, r, g, b, inten, intenmin, intenmax;
@@ -856,7 +856,7 @@ static PALETTE_INIT( witchcrd )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -899,7 +899,7 @@ static PALETTE_INIT( wcrdxtnd )
if (color_prom == 0) return;
- for (i = 0;i < machine->total_colors();i++)
+ for (i = 0;i < machine.total_colors();i++)
{
int bit0, bit1, bit2, bit3, r, g, b, bk;
@@ -936,28 +936,28 @@ static PALETTE_INIT( wcrdxtnd )
*/
static READ8_DEVICE_HANDLER( goldnpkr_mux_port_r )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
return 0xff;
}
static READ8_DEVICE_HANDLER( pottnpkr_mux_port_r )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
UINT8 pa_0_4 = 0xff, pa_7; /* Temporary place holder for bits 0 to 4 & 7 */
switch( state->mux_data & 0xf0 ) /* bits 4-7 */
{
- case 0x10: return input_port_read(device->machine, "IN0-0");
- case 0x20: return input_port_read(device->machine, "IN0-1");
- case 0x40: return input_port_read(device->machine, "IN0-2");
- case 0x80: return input_port_read(device->machine, "IN0-3");
+ case 0x10: return input_port_read(device->machine(), "IN0-0");
+ case 0x20: return input_port_read(device->machine(), "IN0-1");
+ case 0x40: return input_port_read(device->machine(), "IN0-2");
+ case 0x80: return input_port_read(device->machine(), "IN0-3");
}
pa_7 = (state->pia0_PA_data >> 7) & 1; /* To do: bit PA5 to pin CB1 */
@@ -968,13 +968,13 @@ static READ8_DEVICE_HANDLER( pottnpkr_mux_port_r )
static WRITE8_DEVICE_HANDLER( mux_w )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
state->mux_data = data ^ 0xff; /* inverted */
}
static WRITE8_DEVICE_HANDLER( mux_port_w )
{
- goldnpkr_state *state = device->machine->driver_data<goldnpkr_state>();
+ goldnpkr_state *state = device->machine().driver_data<goldnpkr_state>();
state->pia0_PA_data = data;
}
@@ -987,12 +987,12 @@ static WRITE8_DEVICE_HANDLER( wcfalcon_snd_w )
{
if (wcfalcon_flag == 0)
{
- ay8910_data_address_w(device->machine->device("ay8910"), 0, data);
+ ay8910_data_address_w(device->machine().device("ay8910"), 0, data);
// logerror("sound address: %02x %02x\n", data, wcfalcon_flag);
}
else
{
- ay8910_data_address_w(device->machine->device("ay8910"), 1, data);
+ ay8910_data_address_w(device->machine().device("ay8910"), 1, data);
// logerror("sound data: %02x %02x\n", data, wcfalcon_flag);
}
@@ -1043,9 +1043,9 @@ static WRITE8_DEVICE_HANDLER( lamps_a_w )
output_set_lamp_value(4, 1 - ((data >> 4) & 1)); /* Lamp 4 */
// popmessage("written : %02X", data);
- coin_counter_w(device->machine, 0, data & 0x40); /* counter1 */
- coin_counter_w(device->machine, 1, data & 0x80); /* counter2 */
- coin_counter_w(device->machine, 2, data & 0x20); /* counter3 */
+ coin_counter_w(device->machine(), 0, data & 0x40); /* counter1 */
+ coin_counter_w(device->machine(), 1, data & 0x80); /* counter2 */
+ coin_counter_w(device->machine(), 2, data & 0x20); /* counter3 */
/* Counters:
@@ -4617,7 +4617,7 @@ static DRIVER_INIT( royale )
{
/* $60bb, NOPing the ORA #$F0 (after read the PIA1 port B */
-// UINT8 *ROM = machine->region("maincpu")->base();
+// UINT8 *ROM = machine.region("maincpu")->base();
// ROM[0x60bb] = 0xea;
// ROM[0x60bc] = 0xea;
@@ -4647,8 +4647,8 @@ static DRIVER_INIT( flcnw )
/* Attempt to decrypt the MCU program (we're sooo close!) */
- UINT8 *ROM = machine->region("mcu")->base();
- int size = machine->region("mcu")->bytes();
+ UINT8 *ROM = machine.region("mcu")->base();
+ int size = machine.region("mcu")->bytes();
int start = 0x0000;
int i;
@@ -4666,7 +4666,7 @@ static DRIVER_INIT( vkdlsa )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0xe097] = 0xea;
ROM[0xe098] = 0xea;
@@ -4678,7 +4678,7 @@ static DRIVER_INIT( vkdlsb )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0xe87b] = 0xea;
ROM[0xe87c] = 0xea;
@@ -4690,7 +4690,7 @@ static DRIVER_INIT( vkdlsc )
after compare with Dallas TK data
*/
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x453a] = 0xea;
ROM[0x453b] = 0xea;
diff --git a/src/mame/drivers/goldstar.c b/src/mame/drivers/goldstar.c
index bd496a06f04..1c20efa6f04 100644
--- a/src/mame/drivers/goldstar.c
+++ b/src/mame/drivers/goldstar.c
@@ -122,7 +122,7 @@
static WRITE8_HANDLER( protection_w )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
if (data == 0x2a)
state->dataoffset = 0;
@@ -130,7 +130,7 @@ static WRITE8_HANDLER( protection_w )
static READ8_HANDLER( protection_r )
{
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
static const int data[4] = { 0x47, 0x4f, 0x4c, 0x44 };
state->dataoffset %= 4;
@@ -386,7 +386,7 @@ static WRITE8_HANDLER( magodds_outb850_w )
{
// guess, could be wrong, this might just be lights
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
if (data&0x20)
state->tile_bank = 1;
@@ -555,7 +555,7 @@ static WRITE8_HANDLER( unkcm_0x02_w )
static WRITE8_HANDLER( unkcm_0x03_w )
{
//popmessage("unkcm_0x03_w %02x", data);
- goldstar_state *state = space->machine->driver_data<goldstar_state>();
+ goldstar_state *state = space->machine().driver_data<goldstar_state>();
state->unkch_vidreg = data;
@@ -5502,21 +5502,21 @@ static const ppi8255_interface cm_ppi8255_intf[2] =
static WRITE8_DEVICE_HANDLER( system_outputa_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("system_outputa_w %02x",data);
}
static WRITE8_DEVICE_HANDLER( system_outputb_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("system_outputb_w %02x",data);
}
static WRITE8_DEVICE_HANDLER( system_outputc_w )
{
- goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ goldstar_state *state = device->machine().driver_data<goldstar_state>();
state->lucky8_nmi_enable = data & 8;
state->unkch_vidreg = data & 2;
@@ -5622,13 +5622,13 @@ static const ay8910_interface cm_ay8910_config =
static WRITE8_DEVICE_HANDLER( ay8910_outputa_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("ay8910_outputa_w %02x",data);
}
static WRITE8_DEVICE_HANDLER( ay8910_outputb_w )
{
- //goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ //goldstar_state *state = device->machine().driver_data<goldstar_state>();
//popmessage("ay8910_outputb_w %02x",data);
}
@@ -5764,7 +5764,7 @@ static PALETTE_INIT(cm)
for (i = 0; i < 0x100; i++)
{
UINT8 data;
- UINT8*proms = machine->region("proms")->base();
+ UINT8*proms = machine.region("proms")->base();
data = proms[0x000 + i] | (proms[0x100 + i] << 4);
@@ -5779,7 +5779,7 @@ static PALETTE_INIT(cmast91)
{
int r,g,b;
- UINT8*proms = machine->region("proms")->base();
+ UINT8*proms = machine.region("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -5797,7 +5797,7 @@ static PALETTE_INIT(lucky8)
UINT8 data;
UINT8 *proms;
- proms = machine->region("proms")->base();
+ proms = machine.region("proms")->base();
for (i = 0; i < 0x100; i++)
{
@@ -5806,7 +5806,7 @@ static PALETTE_INIT(lucky8)
palette_set_color_rgb(machine, i, pal3bit(data >> 0), pal3bit(data >> 3), pal2bit(data >> 6));
}
- proms = machine->region("proms2")->base();
+ proms = machine.region("proms2")->base();
for (i=0; i < 0x20; i++)
{
data = proms[i];
@@ -6055,7 +6055,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( lucky8_irq )
{
- goldstar_state *state = device->machine->driver_data<goldstar_state>();
+ goldstar_state *state = device->machine().driver_data<goldstar_state>();
if(state->lucky8_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -6109,7 +6109,7 @@ static PALETTE_INIT(magodds)
{
int r,g,b;
- UINT8*proms = machine->region("proms")->base();
+ UINT8*proms = machine.region("proms")->base();
b = proms[0x000 + i] << 4;
g = proms[0x100 + i] << 4;
@@ -8082,7 +8082,7 @@ YM2203
static DRIVER_INIT(magoddsc)
{
int A;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (A = 0;A < 0x8000;A++)
{
@@ -9620,7 +9620,7 @@ ROM_END
static DRIVER_INIT(goldstar)
{
int A;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
{
@@ -9633,7 +9633,7 @@ static DRIVER_INIT(goldstar)
// this block swapping is the same for chry10, chrygld and cb3
// the underlying bitswaps / xors are different however
-static void do_blockswaps(running_machine *machine, UINT8* ROM)
+static void do_blockswaps(running_machine &machine, UINT8* ROM)
{
int A;
UINT8 *buffer;
@@ -9664,13 +9664,13 @@ static void do_blockswaps(running_machine *machine, UINT8* ROM)
auto_free(machine, buffer);
}
-static void dump_to_file(running_machine* machine, UINT8* ROM)
+static void dump_to_file(running_machine& machine, UINT8* ROM)
{
#if 0
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
@@ -9705,8 +9705,8 @@ static UINT8 chry10_decrypt(UINT8 cipherText)
static DRIVER_INIT( chry10 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0;
int i;
@@ -9729,8 +9729,8 @@ static DRIVER_INIT( chry10 )
static DRIVER_INIT( cb3 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
- int size = machine->region("maincpu")->bytes();
+ UINT8 *ROM = machine.region("maincpu")->base();
+ int size = machine.region("maincpu")->bytes();
int start = 0;
int i;
@@ -9748,7 +9748,7 @@ static DRIVER_INIT( cb3 )
static DRIVER_INIT( chrygld )
{
int A;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
do_blockswaps(machine, ROM);
// a data bitswap
@@ -9764,7 +9764,7 @@ static DRIVER_INIT( chrygld )
static DRIVER_INIT(cm)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -9775,7 +9775,7 @@ static DRIVER_INIT(cm)
static DRIVER_INIT(cmv4)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -9786,7 +9786,7 @@ static DRIVER_INIT(cmv4)
static DRIVER_INIT(cmast91)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* forcing PPI mode 0 for all, and A, B & C as input.
the mixed modes 2-0 are not working properly.
@@ -9797,7 +9797,7 @@ static DRIVER_INIT(cmast91)
static DRIVER_INIT(lucky8a)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x0010] = 0x21;
}
@@ -9805,7 +9805,7 @@ static DRIVER_INIT(lucky8a)
static DRIVER_INIT( nfb96sea )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
@@ -9838,7 +9838,7 @@ static READ8_HANDLER( fixedvala8_r )
static DRIVER_INIT( schery97 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9853,8 +9853,8 @@ static DRIVER_INIT( schery97 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1d, 0x1d, FUNC(fixedvala8_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2a, 0x2a, FUNC(fixedvalb4_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1d, 0x1d, FUNC(fixedvala8_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2a, 0x2a, FUNC(fixedvalb4_r));
/* Oki 6295 at 0x20 */
}
@@ -9866,7 +9866,7 @@ static READ8_HANDLER( fixedval38_r )
static DRIVER_INIT( schery97a )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9883,7 +9883,7 @@ static DRIVER_INIT( schery97a )
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedval38_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedval38_r));
/* Oki 6295 at 0x20 */
}
@@ -9895,7 +9895,7 @@ static READ8_HANDLER( fixedvalea_r )
static DRIVER_INIT( skill98 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9910,7 +9910,7 @@ static DRIVER_INIT( skill98 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1e, 0x1e, FUNC(fixedvalea_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1e, 0x1e, FUNC(fixedvalea_r));
/* Oki 6295 at 0x20 */
}
@@ -9922,7 +9922,7 @@ static READ8_HANDLER( fixedval68_r )
static DRIVER_INIT( fb36xc1 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9937,7 +9937,7 @@ static DRIVER_INIT( fb36xc1 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x31, 0x31, FUNC(fixedval68_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x31, 0x31, FUNC(fixedval68_r));
}
@@ -9959,7 +9959,7 @@ static READ8_HANDLER( fixedvalaa_r )
static DRIVER_INIT( fbse354 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -9974,11 +9974,11 @@ static DRIVER_INIT( fbse354 )
ROM[i] = x;
}
// nfb96b needs both of these
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x23, 0x23, FUNC(fixedval80_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5a, 0x5a, FUNC(fixedvalaa_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x23, 0x23, FUNC(fixedval80_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5a, 0x5a, FUNC(fixedvalaa_r));
// csel96b
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x6e, 0x6e, FUNC(fixedval96_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x6e, 0x6e, FUNC(fixedval96_r));
}
@@ -9991,7 +9991,7 @@ static READ8_HANDLER( fixedvalbe_r )
static DRIVER_INIT( fbse362 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10006,7 +10006,7 @@ static DRIVER_INIT( fbse362 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2e, 0x2e, FUNC(fixedvalbe_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x2e, 0x2e, FUNC(fixedvalbe_r));
}
@@ -10023,7 +10023,7 @@ static READ8_HANDLER( fixedval84_r )
static DRIVER_INIT( rp35 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10038,8 +10038,8 @@ static DRIVER_INIT( rp35 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5e, 0x5e, FUNC(fixedval84_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x36, 0x36, FUNC(fixedval90_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x5e, 0x5e, FUNC(fixedval84_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x36, 0x36, FUNC(fixedval90_r));
}
static READ8_HANDLER( fixedvalb2_r )
@@ -10050,7 +10050,7 @@ static READ8_HANDLER( fixedvalb2_r )
static DRIVER_INIT( rp36 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10066,7 +10066,7 @@ static DRIVER_INIT( rp36 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x34, 0x34, FUNC(fixedvalb2_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x34, 0x34, FUNC(fixedvalb2_r));
}
static READ8_HANDLER( fixedval48_r )
@@ -10077,7 +10077,7 @@ static READ8_HANDLER( fixedval48_r )
static DRIVER_INIT( rp36c3 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10093,7 +10093,7 @@ static DRIVER_INIT( rp36c3 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, FUNC(fixedval48_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x17, 0x17, FUNC(fixedval48_r));
}
static READ8_HANDLER( fixedval09_r )
@@ -10110,7 +10110,7 @@ static READ8_HANDLER( fixedval74_r )
static DRIVER_INIT( po33 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10125,8 +10125,8 @@ static DRIVER_INIT( po33 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x32, 0x32, FUNC(fixedval74_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x12, 0x12, FUNC(fixedval09_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x32, 0x32, FUNC(fixedval74_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x12, 0x12, FUNC(fixedval09_r));
/* oki6295 at 0x20 */
}
@@ -10138,7 +10138,7 @@ static READ8_HANDLER( fixedval58_r )
static DRIVER_INIT( tc132axt )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10154,7 +10154,7 @@ static DRIVER_INIT( tc132axt )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x21, 0x21, FUNC(fixedval58_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x21, 0x21, FUNC(fixedval58_r));
}
static READ8_HANDLER( fixedvale4_r )
@@ -10170,7 +10170,7 @@ static READ8_HANDLER( fixedvalc7_r )
static DRIVER_INIT( match133 )
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
for (i = 0;i < 0x10000;i++)
{
UINT8 x = ROM[i];
@@ -10186,14 +10186,14 @@ static DRIVER_INIT( match133 )
ROM[i] = x;
}
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedvalc7_r));
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1a, 0x1a, FUNC(fixedvale4_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x16, 0x16, FUNC(fixedvalc7_r));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x1a, 0x1a, FUNC(fixedvale4_r));
}
static DRIVER_INIT(cherrys)
{
int i;
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
unsigned char rawData[256] = {
0xCC, 0xCD, 0xCE, 0xCF, 0xC8, 0xC9, 0xCA, 0xCB, 0xC4, 0xC5, 0xC6, 0xC7,
@@ -10230,21 +10230,21 @@ static DRIVER_INIT(cherrys)
/* todo: remove these patches! */
static DRIVER_INIT( unkch1 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x9d52] = 0x00;
ROM[0x9d53] = 0x00;
}
static DRIVER_INIT( unkch3 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x9b86] = 0x00;
ROM[0x9b87] = 0x00;
}
static DRIVER_INIT( unkch4 )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x9a6e] = 0x00;
ROM[0x9a6f] = 0x00;
}
@@ -10252,7 +10252,7 @@ static DRIVER_INIT( unkch4 )
static DRIVER_INIT( tonypok )
{
// the ppi doesn't seem to work properly, so just install the inputs directly
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
io->install_read_port(0x04, 0x04, "IN0" );
io->install_read_port(0x05, 0x05, "IN1" );
io->install_read_port(0x06, 0x06, "IN2" );
diff --git a/src/mame/drivers/gomoku.c b/src/mame/drivers/gomoku.c
index b47e09d5d40..ae1f182ebda 100644
--- a/src/mame/drivers/gomoku.c
+++ b/src/mame/drivers/gomoku.c
@@ -32,7 +32,7 @@ static READ8_HANDLER( input_port_r )
res = 0;
for (i = 0; i < 8; i++)
- res |= ((input_port_read_safe(space->machine, portnames[i], 0xff) >> offset) & 1) << i;
+ res |= ((input_port_read_safe(space->machine(), portnames[i], 0xff) >> offset) & 1) << i;
return res;
}
diff --git a/src/mame/drivers/good.c b/src/mame/drivers/good.c
index 6e2dd1e1d4b..b0bba711f52 100644
--- a/src/mame/drivers/good.c
+++ b/src/mame/drivers/good.c
@@ -54,14 +54,14 @@ public:
static WRITE16_HANDLER( fg_tilemapram_w )
{
- good_state *state = space->machine->driver_data<good_state>();
+ good_state *state = space->machine().driver_data<good_state>();
COMBINE_DATA(&state->fg_tilemapram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- good_state *state = machine->driver_data<good_state>();
+ good_state *state = machine.driver_data<good_state>();
int tileno = state->fg_tilemapram[tile_index * 2];
int attr = state->fg_tilemapram[tile_index * 2 + 1] & 0xf;
SET_TILE_INFO(0, tileno, attr, 0);
@@ -69,14 +69,14 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE16_HANDLER( bg_tilemapram_w )
{
- good_state *state = space->machine->driver_data<good_state>();
+ good_state *state = space->machine().driver_data<good_state>();
COMBINE_DATA(&state->bg_tilemapram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap, offset / 2);
}
static TILE_GET_INFO( get_bg_tile_info )
{
- good_state *state = machine->driver_data<good_state>();
+ good_state *state = machine.driver_data<good_state>();
int tileno = state->bg_tilemapram[tile_index * 2];
int attr = state->bg_tilemapram[tile_index * 2 + 1] & 0xf;
SET_TILE_INFO(1, tileno, attr, 0);
@@ -86,7 +86,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( good )
{
- good_state *state = machine->driver_data<good_state>();
+ good_state *state = machine.driver_data<good_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
tilemap_set_transparent_pen(state->fg_tilemap, 0xf);
@@ -94,7 +94,7 @@ static VIDEO_START( good )
static SCREEN_UPDATE( good )
{
- good_state *state = screen->machine->driver_data<good_state>();
+ good_state *state = screen->machine().driver_data<good_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
diff --git a/src/mame/drivers/goodejan.c b/src/mame/drivers/goodejan.c
index bc5edc8d644..978fbb02db2 100644
--- a/src/mame/drivers/goodejan.c
+++ b/src/mame/drivers/goodejan.c
@@ -81,17 +81,17 @@ static WRITE16_HANDLER( goodejan_gfxbank_w )
/* Multiplexer device for the mahjong panel */
static READ16_HANDLER( mahjong_panel_r )
{
- goodejan_state *state = space->machine->driver_data<goodejan_state>();
+ goodejan_state *state = space->machine().driver_data<goodejan_state>();
UINT16 ret;
ret = 0xffff;
switch(state->mux_data)
{
- case 1: ret = input_port_read(space->machine, "KEY0"); break;
- case 2: ret = input_port_read(space->machine, "KEY1"); break;
- case 4: ret = input_port_read(space->machine, "KEY2"); break;
- case 8: ret = input_port_read(space->machine, "KEY3"); break;
- case 0x10: ret = input_port_read(space->machine, "KEY4"); break;
+ case 1: ret = input_port_read(space->machine(), "KEY0"); break;
+ case 2: ret = input_port_read(space->machine(), "KEY1"); break;
+ case 4: ret = input_port_read(space->machine(), "KEY2"); break;
+ case 8: ret = input_port_read(space->machine(), "KEY3"); break;
+ case 0x10: ret = input_port_read(space->machine(), "KEY4"); break;
}
return ret;
@@ -99,7 +99,7 @@ static READ16_HANDLER( mahjong_panel_r )
static WRITE16_HANDLER( mahjong_panel_w )
{
- goodejan_state *state = space->machine->driver_data<goodejan_state>();
+ goodejan_state *state = space->machine().driver_data<goodejan_state>();
state->mux_data = data;
}
diff --git a/src/mame/drivers/gotcha.c b/src/mame/drivers/gotcha.c
index dc529082afd..0365a346cae 100644
--- a/src/mame/drivers/gotcha.c
+++ b/src/mame/drivers/gotcha.c
@@ -238,7 +238,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int linestate )
{
- gotcha_state *state = device->machine->driver_data<gotcha_state>();
+ gotcha_state *state = device->machine().driver_data<gotcha_state>();
device_set_input_line(state->audiocpu, 0, linestate);
}
@@ -250,9 +250,9 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( gotcha )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->banksel));
state->save_item(NAME(state->gfxbank));
@@ -261,7 +261,7 @@ static MACHINE_START( gotcha )
static MACHINE_RESET( gotcha )
{
- gotcha_state *state = machine->driver_data<gotcha_state>();
+ gotcha_state *state = machine.driver_data<gotcha_state>();
int i;
for (i = 0; i < 4; i++)
diff --git a/src/mame/drivers/gottlieb.c b/src/mame/drivers/gottlieb.c
index cf03862b747..451390670f2 100644
--- a/src/mame/drivers/gottlieb.c
+++ b/src/mame/drivers/gottlieb.c
@@ -238,23 +238,23 @@ static WRITE8_HANDLER( laserdisc_command_w );
static MACHINE_START( gottlieb )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* register for save states */
state_save_register_global(machine, state->joystick_select);
state_save_register_global_array(machine, state->track);
/* see if we have a laserdisc */
- state->laserdisc = machine->m_devicelist.first(LASERDISC);
+ state->laserdisc = machine.m_devicelist.first(LASERDISC);
if (state->laserdisc != NULL)
{
/* attach to the I/O ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x05805, 0x05807, 0, 0x07f8, FUNC(laserdisc_status_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05805, 0x05805, 0, 0x07f8, FUNC(laserdisc_command_w)); /* command for the player */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05806, 0x05806, 0, 0x07f8, FUNC(laserdisc_select_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x05805, 0x05807, 0, 0x07f8, FUNC(laserdisc_status_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05805, 0x05805, 0, 0x07f8, FUNC(laserdisc_command_w)); /* command for the player */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05806, 0x05806, 0, 0x07f8, FUNC(laserdisc_select_w));
/* allocate a timer for serial transmission, and one for philips code processing */
- state->laserdisc_bit_timer = machine->scheduler().timer_alloc(FUNC(laserdisc_bit_callback));
- state->laserdisc_philips_timer = machine->scheduler().timer_alloc(FUNC(laserdisc_philips_callback));
+ state->laserdisc_bit_timer = machine.scheduler().timer_alloc(FUNC(laserdisc_bit_callback));
+ state->laserdisc_philips_timer = machine.scheduler().timer_alloc(FUNC(laserdisc_philips_callback));
/* create some audio RAM */
state->laserdisc_audio_buffer = auto_alloc_array(machine, UINT8, AUDIORAM_SIZE);
@@ -279,10 +279,10 @@ static MACHINE_START( gottlieb )
static MACHINE_RESET( gottlieb )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* if we have a laserdisc, reset our philips code callback for the next line 17 */
if (state->laserdisc != NULL)
- state->laserdisc_philips_timer->adjust(machine->primary_screen->time_until_pos(17), 17);
+ state->laserdisc_philips_timer->adjust(machine.primary_screen->time_until_pos(17), 17);
}
@@ -295,28 +295,28 @@ static MACHINE_RESET( gottlieb )
static CUSTOM_INPUT( analog_delta_r )
{
- gottlieb_state *state = field->port->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = field->port->machine().driver_data<gottlieb_state>();
const char *string = (const char *)param;
int which = string[0] - '0';
- return input_port_read(field->port->machine, &string[1]) - state->track[which];
+ return input_port_read(field->port->machine(), &string[1]) - state->track[which];
}
static WRITE8_HANDLER( gottlieb_analog_reset_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* reset the trackball counters */
- state->track[0] = input_port_read_safe(space->machine, "TRACKX", 0);
- state->track[1] = input_port_read_safe(space->machine, "TRACKY", 0);
+ state->track[0] = input_port_read_safe(space->machine(), "TRACKX", 0);
+ state->track[1] = input_port_read_safe(space->machine(), "TRACKY", 0);
}
static CUSTOM_INPUT( stooges_joystick_r )
{
- gottlieb_state *state = field->port->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = field->port->machine().driver_data<gottlieb_state>();
static const char *const joyport[] = { "P2JOY", "P3JOY", "P1JOY", NULL };
- return (joyport[state->joystick_select & 3] != NULL) ? input_port_read(field->port->machine, joyport[state->joystick_select & 3]) : 0xff;
+ return (joyport[state->joystick_select & 3] != NULL) ? input_port_read(field->port->machine(), joyport[state->joystick_select & 3]) : 0xff;
}
@@ -329,7 +329,7 @@ static CUSTOM_INPUT( stooges_joystick_r )
static WRITE8_HANDLER( general_output_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* bits 0-3 control video features, and are different for laserdisc games */
if (state->laserdisc == NULL)
gottlieb_video_control_w(space, offset, data);
@@ -337,7 +337,7 @@ static WRITE8_HANDLER( general_output_w )
gottlieb_laserdisc_video_control_w(space, offset, data);
/* bit 4 controls the coin meter */
- coin_counter_w(space->machine, 0, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x10);
/* bit 5 controls the knocker */
output_set_value("knocker0", (data >> 5) & 1);
@@ -351,15 +351,15 @@ static WRITE8_HANDLER( general_output_w )
static WRITE8_HANDLER( reactor_output_w )
{
general_output_w(space, offset, data & ~0xe0);
- set_led_status(space->machine, 0, data & 0x20);
- set_led_status(space->machine, 1, data & 0x40);
- set_led_status(space->machine, 2, data & 0x80);
+ set_led_status(space->machine(), 0, data & 0x20);
+ set_led_status(space->machine(), 1, data & 0x40);
+ set_led_status(space->machine(), 2, data & 0x80);
}
static WRITE8_HANDLER( stooges_output_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
general_output_w(space, offset, data & ~0x60);
state->joystick_select = (data >> 5) & 0x03;
}
@@ -374,7 +374,7 @@ static WRITE8_HANDLER( stooges_output_w )
static READ8_HANDLER( laserdisc_status_r )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* IP5 reads low 8 bits of philips code */
if (offset == 0)
return state->laserdisc_philips_code;
@@ -406,7 +406,7 @@ static READ8_HANDLER( laserdisc_status_r )
static WRITE8_HANDLER( laserdisc_select_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* selects between reading audio data and reading status */
state->laserdisc_select = data & 1;
}
@@ -414,7 +414,7 @@ static WRITE8_HANDLER( laserdisc_select_w )
static WRITE8_HANDLER( laserdisc_command_w )
{
- gottlieb_state *state = space->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = space->machine().driver_data<gottlieb_state>();
/* a write here latches data into a 8-bit register and starts
a sequence of events that sends serial data to the player */
@@ -435,7 +435,7 @@ static WRITE8_HANDLER( laserdisc_command_w )
static TIMER_CALLBACK( laserdisc_philips_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
int newcode = laserdisc_get_field_code(state->laserdisc, (param == 17) ? LASERDISC_CODE_LINE17 : LASERDISC_CODE_LINE18, TRUE);
/* the PR8210 sends line 17/18 data on each frame; the laserdisc interface
@@ -450,13 +450,13 @@ static TIMER_CALLBACK( laserdisc_philips_callback )
/* toggle to the next one */
param = (param == 17) ? 18 : 17;
- state->laserdisc_philips_timer->adjust(machine->primary_screen->time_until_pos(param * 2), param);
+ state->laserdisc_philips_timer->adjust(machine.primary_screen->time_until_pos(param * 2), param);
}
static TIMER_CALLBACK( laserdisc_bit_off_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
/* deassert the control line */
laserdisc_line_w(state->laserdisc, LASERDISC_LINE_CONTROL, CLEAR_LINE);
}
@@ -464,14 +464,14 @@ static TIMER_CALLBACK( laserdisc_bit_off_callback )
static TIMER_CALLBACK( laserdisc_bit_callback )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
UINT8 bitsleft = param >> 16;
UINT8 data = param;
attotime duration;
/* assert the line and set a timer for deassertion */
laserdisc_line_w(state->laserdisc, LASERDISC_LINE_CONTROL, ASSERT_LINE);
- machine->scheduler().timer_set(LASERDISC_CLOCK * 10, FUNC(laserdisc_bit_off_callback));
+ machine.scheduler().timer_set(LASERDISC_CLOCK * 10, FUNC(laserdisc_bit_off_callback));
/* determine how long for the next command; there is a 555 timer with a
variable resistor controlling the timing of the pulses. Nominally, the
@@ -598,8 +598,8 @@ static void audio_handle_zero_crossing(gottlieb_state *state, attotime zerotime,
static void laserdisc_audio_process(device_t *device, int samplerate, int samples, const INT16 *ch0, const INT16 *ch1)
{
- gottlieb_state *state = device->machine->driver_data<gottlieb_state>();
- int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine, KEYCODE_L);
+ gottlieb_state *state = device->machine().driver_data<gottlieb_state>();
+ int logit = LOG_AUDIO_DECODE && input_code_pressed(device->machine(), KEYCODE_L);
attotime time_per_sample = attotime::from_hz(samplerate);
attotime curtime = state->laserdisc_last_time;
int cursamp;
@@ -672,10 +672,10 @@ static TIMER_CALLBACK( nmi_clear )
static INTERRUPT_GEN( gottlieb_interrupt )
{
- gottlieb_state *state = device->machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = device->machine().driver_data<gottlieb_state>();
/* assert the NMI and set a timer to clear it at the first visible line */
device_set_input_line(device, INPUT_LINE_NMI, ASSERT_LINE);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(0), FUNC(nmi_clear));
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(0), FUNC(nmi_clear));
/* if we have a laserdisc, update it */
if (state->laserdisc != NULL)
@@ -2598,14 +2598,14 @@ ROM_END
static DRIVER_INIT( ramtiles )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = state->gfxcharhi = 0;
}
static DRIVER_INIT( romtiles )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = state->gfxcharhi = 1;
}
@@ -2613,13 +2613,13 @@ static DRIVER_INIT( romtiles )
static DRIVER_INIT( stooges )
{
DRIVER_INIT_CALL(ramtiles);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05803, 0x05803, 0, 0x07f8, FUNC(stooges_output_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x05803, 0x05803, 0, 0x07f8, FUNC(stooges_output_w));
}
static DRIVER_INIT( screwloo )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = 0;
state->gfxcharhi = 1;
}
@@ -2627,7 +2627,7 @@ static DRIVER_INIT( screwloo )
static DRIVER_INIT( vidvince )
{
- gottlieb_state *state = machine->driver_data<gottlieb_state>();
+ gottlieb_state *state = machine.driver_data<gottlieb_state>();
state->gfxcharlo = 1;
state->gfxcharhi = 0;
}
diff --git a/src/mame/drivers/gotya.c b/src/mame/drivers/gotya.c
index 228ac47177a..48f86121b59 100644
--- a/src/mame/drivers/gotya.c
+++ b/src/mame/drivers/gotya.c
@@ -176,9 +176,9 @@ static const samples_interface gotya_samples_interface =
static MACHINE_START( gotya )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
- state->samples = machine->device("samples");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->scroll_bit_8));
state->save_item(NAME(state->theme_playing));
@@ -186,7 +186,7 @@ static MACHINE_START( gotya )
static MACHINE_RESET( gotya )
{
- gotya_state *state = machine->driver_data<gotya_state>();
+ gotya_state *state = machine.driver_data<gotya_state>();
state->scroll_bit_8 = 0;
state->theme_playing = 0;
diff --git a/src/mame/drivers/gpworld.c b/src/mame/drivers/gpworld.c
index f9e2185db45..907a13d35bc 100644
--- a/src/mame/drivers/gpworld.c
+++ b/src/mame/drivers/gpworld.c
@@ -70,9 +70,9 @@ public:
/* VIDEO GOODS */
-static void gpworld_draw_tiles(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void gpworld_draw_tiles(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
+ gpworld_state *state = machine.driver_data<gpworld_state>();
UINT8 characterX, characterY;
/* Temporarily set to 64 wide to accommodate two screens */
@@ -82,7 +82,7 @@ static void gpworld_draw_tiles(running_machine *machine, bitmap_t *bitmap,const
{
int current_screen_character = (characterY*64) + characterX;
- drawgfx_transpen(bitmap, cliprect, machine->gfx[0], state->tile_RAM[current_screen_character],
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[0], state->tile_RAM[current_screen_character],
characterY, 0, 0, characterX*8, characterY*8, 0);
}
}
@@ -105,9 +105,9 @@ INLINE void draw_pixel(bitmap_t *bitmap,const rectangle *cliprect,int x,int y,in
*BITMAP_ADDR32(bitmap, y, x) = color;
}
-static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void gpworld_draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
+ gpworld_state *state = machine.driver_data<gpworld_state>();
const int SPR_Y_TOP = 0;
const int SPR_Y_BOTTOM = 1;
const int SPR_X_LO = 2;
@@ -120,7 +120,7 @@ static void gpworld_draw_sprites(running_machine *machine, bitmap_t *bitmap, con
int i;
- UINT8 *GFX = machine->region("gfx2")->base();
+ UINT8 *GFX = machine.region("gfx2")->base();
/* Heisted from Daphne which heisted it from MAME */
for (i = 0; i < 0x800; i += 8)
@@ -220,8 +220,8 @@ static SCREEN_UPDATE( gpworld )
{
bitmap_fill(bitmap, cliprect, 0);
- gpworld_draw_tiles(screen->machine, bitmap, cliprect);
- gpworld_draw_sprites(screen->machine, bitmap, cliprect);
+ gpworld_draw_tiles(screen->machine(), bitmap, cliprect);
+ gpworld_draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -229,8 +229,8 @@ static SCREEN_UPDATE( gpworld )
static MACHINE_START( gpworld )
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
- state->laserdisc = machine->device("laserdisc");
+ gpworld_state *state = machine.driver_data<gpworld_state>();
+ state->laserdisc = machine.device("laserdisc");
}
@@ -238,30 +238,30 @@ static MACHINE_START( gpworld )
/* READS */
static READ8_HANDLER( ldp_read )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
return state->ldp_read_latch;
}
static READ8_HANDLER( pedal_in )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
if (state->brake_gas)
- return input_port_read(space->machine, "INACCEL");
+ return input_port_read(space->machine(), "INACCEL");
- return input_port_read(space->machine, "INBRAKE");
+ return input_port_read(space->machine(), "INBRAKE");
}
/* WRITES */
static WRITE8_HANDLER( ldp_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
state->ldp_write_latch = data;
}
static WRITE8_HANDLER( misc_io_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
state->start_lamp = (data & 0x04) >> 1;
state->nmi_enable = (data & 0x40) >> 6;
/* dunno = (data & 0x80) >> 7; */ //coin counter???
@@ -271,13 +271,13 @@ static WRITE8_HANDLER( misc_io_write )
static WRITE8_HANDLER( brake_gas_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
state->brake_gas = data & 0x01;
}
static WRITE8_HANDLER( palette_write )
{
- gpworld_state *state = space->machine->driver_data<gpworld_state>();
+ gpworld_state *state = space->machine().driver_data<gpworld_state>();
/* This is all just a (bad) guess */
int pal_index, r, g, b, a;
@@ -293,7 +293,7 @@ static WRITE8_HANDLER( palette_write )
/* logerror("PAL WRITE index : %x rgb : %d %d %d (real %x) at %x\n", pal_index, r,g,b, data, offset); */
- palette_set_color(space->machine, (pal_index & 0xffe) >> 1, MAKE_ARGB(a, r, g, b));
+ palette_set_color(space->machine(), (pal_index & 0xffe) >> 1, MAKE_ARGB(a, r, g, b));
}
/* PROGRAM MAP */
@@ -431,7 +431,7 @@ static TIMER_CALLBACK( irq_stop )
static INTERRUPT_GEN( vblank_callback_gpworld )
{
- gpworld_state *state = device->machine->driver_data<gpworld_state>();
+ gpworld_state *state = device->machine().driver_data<gpworld_state>();
/* Do an NMI if the enabled bit is set */
if (state->nmi_enable)
{
@@ -442,7 +442,7 @@ static INTERRUPT_GEN( vblank_callback_gpworld )
/* The time the IRQ line stays high is set just long enough to happen after the NMI - hacky? */
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(100), FUNC(irq_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(irq_stop));
}
static const gfx_layout gpworld_tile_layout =
@@ -527,7 +527,7 @@ ROM_END
static DRIVER_INIT( gpworld )
{
- gpworld_state *state = machine->driver_data<gpworld_state>();
+ gpworld_state *state = machine.driver_data<gpworld_state>();
state->nmi_enable = 0;
state->start_lamp = 0;
state->brake_gas = 0;
diff --git a/src/mame/drivers/gradius3.c b/src/mame/drivers/gradius3.c
index 2415cf14920..9bf23ad0009 100644
--- a/src/mame/drivers/gradius3.c
+++ b/src/mame/drivers/gradius3.c
@@ -30,13 +30,13 @@
static READ16_HANDLER( k052109_halfword_r )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
return k052109_r(state->k052109, offset);
}
static WRITE16_HANDLER( k052109_halfword_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_0_7)
k052109_w(state->k052109, offset, data & 0xff);
@@ -49,13 +49,13 @@ static WRITE16_HANDLER( k052109_halfword_w )
static READ16_HANDLER( k051937_halfword_r )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
return k051937_r(state->k051960, offset);
}
static WRITE16_HANDLER( k051937_halfword_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_0_7)
k051937_w(state->k051960, offset, data & 0xff);
@@ -63,28 +63,28 @@ static WRITE16_HANDLER( k051937_halfword_w )
static READ16_HANDLER( k051960_halfword_r )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
return k051960_r(state->k051960, offset);
}
static WRITE16_HANDLER( k051960_halfword_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_0_7)
k051960_w(state->k051960, offset, data & 0xff);
}
static WRITE16_HANDLER( cpuA_ctrl_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_8_15)
{
data >>= 8;
/* bits 0-1 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* bit 2 selects layer priority */
state->priority = data & 0x04;
@@ -102,7 +102,7 @@ static WRITE16_HANDLER( cpuA_ctrl_w )
static WRITE16_HANDLER( cpuB_irqenable_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (ACCESSING_BITS_8_15)
state->irqBmask = (data >> 8) & 0x07;
@@ -110,14 +110,14 @@ static WRITE16_HANDLER( cpuB_irqenable_w )
static INTERRUPT_GEN( cpuA_interrupt )
{
- gradius3_state *state = device->machine->driver_data<gradius3_state>();
+ gradius3_state *state = device->machine().driver_data<gradius3_state>();
if (state->irqAen)
device_set_input_line(device, 2, HOLD_LINE);
}
static INTERRUPT_GEN( cpuB_interrupt )
{
- gradius3_state *state = device->machine->driver_data<gradius3_state>();
+ gradius3_state *state = device->machine().driver_data<gradius3_state>();
if (cpu_getiloops(device) & 1) /* ??? */
{
@@ -133,7 +133,7 @@ static INTERRUPT_GEN( cpuB_interrupt )
static WRITE16_HANDLER( cpuB_irqtrigger_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
if (state->irqBmask & 4)
{
@@ -152,7 +152,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( sound_irq_w )
{
- gradius3_state *state = space->machine->driver_data<gradius3_state>();
+ gradius3_state *state = space->machine().driver_data<gradius3_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -301,14 +301,14 @@ static const k051960_interface gradius3_k051960_intf =
static MACHINE_START( gradius3 )
{
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->subcpu = machine->device("sub");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->subcpu = machine.device("sub");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->irqAen));
state->save_item(NAME(state->irqBmask));
@@ -317,7 +317,7 @@ static MACHINE_START( gradius3 )
static MACHINE_RESET( gradius3 )
{
- gradius3_state *state = machine->driver_data<gradius3_state>();
+ gradius3_state *state = machine.driver_data<gradius3_state>();
/* start with cpu B halted */
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
diff --git a/src/mame/drivers/grchamp.c b/src/mame/drivers/grchamp.c
index f42522d3f47..e05d410b5df 100644
--- a/src/mame/drivers/grchamp.c
+++ b/src/mame/drivers/grchamp.c
@@ -92,7 +92,7 @@ static MACHINE_RESET( grchamp )
static INTERRUPT_GEN( grchamp_cpu0_interrupt )
{
- grchamp_state *state = device->machine->driver_data<grchamp_state>();
+ grchamp_state *state = device->machine().driver_data<grchamp_state>();
if (state->cpu0_out[0] & 0x01)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -101,7 +101,7 @@ static INTERRUPT_GEN( grchamp_cpu0_interrupt )
static INTERRUPT_GEN( grchamp_cpu1_interrupt )
{
- grchamp_state *state = device->machine->driver_data<grchamp_state>();
+ grchamp_state *state = device->machine().driver_data<grchamp_state>();
if (state->cpu1_out[4] & 0x01)
device_set_input_line(device, 0, ASSERT_LINE);
@@ -117,7 +117,7 @@ static INTERRUPT_GEN( grchamp_cpu1_interrupt )
static WRITE8_HANDLER( cpu0_outputs_w )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
UINT8 diff = data ^ state->cpu0_out[offset];
state->cpu0_out[offset] = data;
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( cpu0_outputs_w )
/* bit 6: FOG OUT */
/* bit 7: RADARON */
if ((diff & 0x01) && !(data & 0x01))
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
if ((diff & 0x02) && !(data & 0x02))
state->collide = state->collmode = 0;
break;
@@ -168,7 +168,7 @@ static WRITE8_HANDLER( cpu0_outputs_w )
/* bit 4: coin lockout */
/* bit 5: Game Over lamp */
/* bit 6-7: n/c */
- coin_lockout_global_w(space->machine, (data >> 4) & 1);
+ coin_lockout_global_w(space->machine(), (data >> 4) & 1);
output_set_value("led0", (~data >> 5) & 1);
break;
@@ -185,13 +185,13 @@ static WRITE8_HANDLER( cpu0_outputs_w )
break;
case 0x0d: /* OUT13 */
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
break;
case 0x0e: /* OUT14 */
/* O-21 connector */
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
break;
}
}
@@ -201,7 +201,7 @@ static WRITE8_HANDLER( led_board_w )
{
static const UINT8 ls247_map[16] =
{ 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x58,0x4c,0x62,0x69,0x78,0x00 };
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
switch (offset)
{
@@ -244,8 +244,8 @@ static WRITE8_HANDLER( led_board_w )
static WRITE8_HANDLER( cpu1_outputs_w )
{
- device_t *discrete = space->machine->device("discrete");
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ device_t *discrete = space->machine().device("discrete");
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
UINT8 diff = data ^ state->cpu1_out[offset];
state->cpu1_out[offset] = data;
@@ -272,7 +272,7 @@ static WRITE8_HANDLER( cpu1_outputs_w )
case 0x04: /* OUT4 */
/* bit 0: interrupt enable for CPU 1 */
if ((diff & 0x01) && !(data & 0x01))
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x05: /* OUT5 - unused */
@@ -337,12 +337,12 @@ static WRITE8_HANDLER( cpu1_outputs_w )
*
*************************************/
-INLINE UINT8 get_pc3259_bits(running_machine *machine, grchamp_state *state, int offs)
+INLINE UINT8 get_pc3259_bits(running_machine &machine, grchamp_state *state, int offs)
{
int bits;
/* force a partial update to the current position */
- machine->primary_screen->update_partial(machine->primary_screen->vpos());
+ machine.primary_screen->update_partial(machine.primary_screen->vpos());
/* get the relevant 4 bits */
bits = (state->collide >> (offs*4)) & 0x0f;
@@ -354,29 +354,29 @@ INLINE UINT8 get_pc3259_bits(running_machine *machine, grchamp_state *state, int
static READ8_HANDLER( pc3259_0_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 0);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 0);
}
static READ8_HANDLER( pc3259_1_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 1);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 1);
}
static READ8_HANDLER( pc3259_2_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 2);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 2);
}
static READ8_HANDLER( pc3259_3_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
- return get_pc3259_bits(space->machine, state, 3);
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
+ return get_pc3259_bits(space->machine(), state, 3);
}
@@ -389,14 +389,14 @@ static READ8_HANDLER( pc3259_3_r )
static READ8_HANDLER( sub_to_main_comm_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
return state->comm_latch;
}
static TIMER_CALLBACK( main_to_sub_comm_sync_w )
{
- grchamp_state *state = machine->driver_data<grchamp_state>();
+ grchamp_state *state = machine.driver_data<grchamp_state>();
int offset = param >> 8;
state->comm_latch2[offset & 3] = param;
}
@@ -404,13 +404,13 @@ static TIMER_CALLBACK( main_to_sub_comm_sync_w )
static WRITE8_HANDLER( main_to_sub_comm_w )
{
- space->machine->scheduler().synchronize(FUNC(main_to_sub_comm_sync_w), data | (offset << 8));
+ space->machine().scheduler().synchronize(FUNC(main_to_sub_comm_sync_w), data | (offset << 8));
}
static READ8_HANDLER( main_to_sub_comm_r )
{
- grchamp_state *state = space->machine->driver_data<grchamp_state>();
+ grchamp_state *state = space->machine().driver_data<grchamp_state>();
return state->comm_latch2[offset];
}
diff --git a/src/mame/drivers/gridlee.c b/src/mame/drivers/gridlee.c
index ac561c3171d..eafd070a7b0 100644
--- a/src/mame/drivers/gridlee.c
+++ b/src/mame/drivers/gridlee.c
@@ -89,7 +89,7 @@
/* local prototypes */
-static void poly17_init(running_machine *machine);
+static void poly17_init(running_machine &machine);
/*************************************
*
@@ -105,18 +105,18 @@ static TIMER_CALLBACK( irq_off_tick )
static TIMER_CALLBACK( irq_timer_tick )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* next interrupt after scanline 256 is scanline 64 */
if (param == 256)
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
else
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(param + 64), param + 64);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(param + 64), param + 64);
/* IRQ starts on scanline 0, 64, 128, etc. */
cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- state->irq_off->adjust(machine->primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
+ state->irq_off->adjust(machine.primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
}
@@ -128,21 +128,21 @@ static TIMER_CALLBACK( firq_off_tick )
static TIMER_CALLBACK( firq_timer_tick )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* same time next frame */
- state->firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE));
+ state->firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
/* IRQ starts on scanline FIRQ_SCANLINE? */
cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- state->firq_off->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
+ state->firq_off->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
}
static MACHINE_START( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
+ gridlee_state *state = machine.driver_data<gridlee_state>();
+ state->maincpu = machine.device<cpu_device>("maincpu");
/* create the polynomial tables */
poly17_init(machine);
@@ -150,19 +150,19 @@ static MACHINE_START( gridlee )
state_save_register_global_array(machine, state->last_analog_input);
state_save_register_global_array(machine, state->last_analog_output);
- state->irq_off = machine->scheduler().timer_alloc(FUNC(irq_off_tick));
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_timer_tick));
- state->firq_off = machine->scheduler().timer_alloc(FUNC(firq_off_tick));
- state->firq_timer = machine->scheduler().timer_alloc(FUNC(firq_timer_tick));
+ state->irq_off = machine.scheduler().timer_alloc(FUNC(irq_off_tick));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_timer_tick));
+ state->firq_off = machine.scheduler().timer_alloc(FUNC(firq_off_tick));
+ state->firq_timer = machine.scheduler().timer_alloc(FUNC(firq_timer_tick));
}
static MACHINE_RESET( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* start timers to generate interrupts */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(0));
- state->firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE));
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(0));
+ state->firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
}
@@ -175,13 +175,13 @@ static MACHINE_RESET( gridlee )
static READ8_HANDLER( analog_port_r )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
int delta, sign, magnitude;
UINT8 newval;
static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
/* first read the new trackball value and compute the signed delta */
- newval = input_port_read(space->machine, portnames[offset + 2 * state->cocktail_flip]);
+ newval = input_port_read(space->machine(), portnames[offset + 2 * state->cocktail_flip]);
delta = (int)newval - (int)state->last_analog_input[offset];
/* handle the case where we wrap around from 0x00 to 0xff, or vice versa */
@@ -226,9 +226,9 @@ static READ8_HANDLER( analog_port_r )
#define POLY17_SHR 10
#define POLY17_ADD 0x18000
-static void poly17_init(running_machine *machine)
+static void poly17_init(running_machine &machine)
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
UINT32 i, x = 0;
UINT8 *p, *r;
@@ -258,7 +258,7 @@ static void poly17_init(running_machine *machine)
static READ8_HANDLER( random_num_r )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
UINT32 cc;
/* CPU runs at 1.25MHz, noise source at 100kHz --> multiply by 12.5 */
@@ -279,21 +279,21 @@ static READ8_HANDLER( random_num_r )
static WRITE8_HANDLER( led_0_w )
{
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
logerror("LED 0 %s\n", (data & 1) ? "on" : "off");
}
static WRITE8_HANDLER( led_1_w )
{
- set_led_status(space->machine, 1, data & 1);
+ set_led_status(space->machine(), 1, data & 1);
logerror("LED 1 %s\n", (data & 1) ? "on" : "off");
}
static WRITE8_HANDLER( gridlee_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
logerror("coin counter %s\n", (data & 1) ? "on" : "off");
}
diff --git a/src/mame/drivers/groundfx.c b/src/mame/drivers/groundfx.c
index f6e071a5256..d6cee9e366b 100644
--- a/src/mame/drivers/groundfx.c
+++ b/src/mame/drivers/groundfx.c
@@ -81,15 +81,15 @@ Extract a standard version of this
static WRITE32_HANDLER( color_ram_w )
{
int a,r,g,b;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
{
- a = space->machine->generic.paletteram.u32[offset];
+ a = space->machine().generic.paletteram.u32[offset];
r = (a &0xff0000) >> 16;
g = (a &0xff00) >> 8;
b = (a &0xff);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
}
@@ -126,30 +126,30 @@ static const eeprom_interface groundfx_eeprom_interface =
static CUSTOM_INPUT( frame_counter_r )
{
- groundfx_state *state = field->port->machine->driver_data<groundfx_state>();
+ groundfx_state *state = field->port->machine().driver_data<groundfx_state>();
return state->frame_counter;
}
static CUSTOM_INPUT( coin_word_r )
{
- groundfx_state *state = field->port->machine->driver_data<groundfx_state>();
+ groundfx_state *state = field->port->machine().driver_data<groundfx_state>();
return state->coin_word;
}
static WRITE32_HANDLER( groundfx_input_w )
{
- groundfx_state *state = space->machine->driver_data<groundfx_state>();
+ groundfx_state *state = space->machine().driver_data<groundfx_state>();
switch (offset)
{
case 0x00:
if (ACCESSING_BITS_24_31) /* $500000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
break;
@@ -157,10 +157,10 @@ static WRITE32_HANDLER( groundfx_input_w )
case 0x01:
if (ACCESSING_BITS_24_31)
{
- coin_lockout_w(space->machine, 0,~data & 0x01000000);
- coin_lockout_w(space->machine, 1,~data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x08000000);
+ coin_lockout_w(space->machine(), 0,~data & 0x01000000);
+ coin_lockout_w(space->machine(), 1,~data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x08000000);
state->coin_word = (data >> 16) &0xffff;
}
break;
@@ -169,19 +169,19 @@ static WRITE32_HANDLER( groundfx_input_w )
static READ32_HANDLER( groundfx_adc_r )
{
- return (input_port_read(space->machine, "AN0") << 8) | input_port_read(space->machine, "AN1");
+ return (input_port_read(space->machine(), "AN0") << 8) | input_port_read(space->machine(), "AN1");
}
static WRITE32_HANDLER( groundfx_adc_w )
{
/* One interrupt per input port (4 per frame, though only 2 used).
1000 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(groundfx_interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(1000), FUNC(groundfx_interrupt5));
}
static WRITE32_HANDLER( rotate_control_w ) /* only a guess that it's rotation */
{
- groundfx_state *state = space->machine->driver_data<groundfx_state>();
+ groundfx_state *state = space->machine().driver_data<groundfx_state>();
if (ACCESSING_BITS_0_15)
{
state->rotate_ctrl[state->port_sel] = data;
@@ -360,7 +360,7 @@ static const tc0480scp_interface groundfx_tc0480scp_intf =
static INTERRUPT_GEN( groundfx_interrupt )
{
- groundfx_state *state = device->machine->driver_data<groundfx_state>();
+ groundfx_state *state = device->machine().driver_data<groundfx_state>();
state->frame_counter^=1;
device_set_input_line(device, 4, HOLD_LINE);
}
@@ -441,7 +441,7 @@ ROM_END
static READ32_HANDLER( irq_speedup_r_groundfx )
{
- groundfx_state *state = space->machine->driver_data<groundfx_state>();
+ groundfx_state *state = space->machine().driver_data<groundfx_state>();
cpu_device *cpu = downcast<cpu_device *>(space->cpu);
int ptr;
offs_t sp = cpu->sp();
@@ -459,12 +459,12 @@ static READ32_HANDLER( irq_speedup_r_groundfx )
static DRIVER_INIT( groundfx )
{
UINT32 offset,i;
- UINT8 *gfx = machine->region("gfx3")->base();
- int size=machine->region("gfx3")->bytes();
+ UINT8 *gfx = machine.region("gfx3")->base();
+ int size=machine.region("gfx3")->bytes();
int data;
/* Speedup handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20b574, 0x20b577, FUNC(irq_speedup_r_groundfx));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20b574, 0x20b577, FUNC(irq_speedup_r_groundfx));
/* make piv tile GFX format suitable for gfxdecode */
offset = size/2;
diff --git a/src/mame/drivers/gstream.c b/src/mame/drivers/gstream.c
index c85da761706..7d3e47b4352 100644
--- a/src/mame/drivers/gstream.c
+++ b/src/mame/drivers/gstream.c
@@ -161,7 +161,7 @@ static CUSTOM_INPUT( gstream_mirror_service_r )
int result;
/* PORT_SERVICE_NO_TOGGLE */
- result = (input_port_read(field->port->machine, "IN0") & 0x8000) >> 15;
+ result = (input_port_read(field->port->machine(), "IN0") & 0x8000) >> 15;
return ~result;
}
@@ -171,15 +171,15 @@ static CUSTOM_INPUT( gstream_mirror_r )
int result;
/* IPT_COIN1 */
- result = ((input_port_read(field->port->machine, "IN0") & 0x200) >> 9) << 0;
+ result = ((input_port_read(field->port->machine(), "IN0") & 0x200) >> 9) << 0;
/* IPT_COIN2 */
- result |= ((input_port_read(field->port->machine, "IN1") & 0x200) >> 9) << 1;
+ result |= ((input_port_read(field->port->machine(), "IN1") & 0x200) >> 9) << 1;
/* IPT_START1 */
- result |= ((input_port_read(field->port->machine, "IN0") & 0x400) >> 10) << 2;
+ result |= ((input_port_read(field->port->machine(), "IN0") & 0x400) >> 10) << 2;
/* IPT_START2 */
- result |= ((input_port_read(field->port->machine, "IN1") & 0x400) >> 10) << 3;
+ result |= ((input_port_read(field->port->machine(), "IN1") & 0x400) >> 10) << 3;
/* PORT_SERVICE_NO_TOGGLE */
- result |= ((input_port_read(field->port->machine, "IN0") & 0x8000) >> 15) << 6;
+ result |= ((input_port_read(field->port->machine(), "IN0") & 0x8000) >> 15) << 6;
return ~result;
}
@@ -187,22 +187,22 @@ static CUSTOM_INPUT( gstream_mirror_r )
static WRITE32_HANDLER( gstream_palette_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
COMBINE_DATA(&state->paletteram[offset]);
- palette_set_color_rgb(space->machine, offset * 2, pal5bit(state->paletteram[offset] >> (0 + 16)),
+ palette_set_color_rgb(space->machine(), offset * 2, pal5bit(state->paletteram[offset] >> (0 + 16)),
pal5bit(state->paletteram[offset] >> (6 + 16)),
pal5bit(state->paletteram[offset] >> (11 + 16)));
- palette_set_color_rgb(space->machine,offset * 2 + 1,pal5bit(state->paletteram[offset] >> (0)),
+ palette_set_color_rgb(space->machine(),offset * 2 + 1,pal5bit(state->paletteram[offset] >> (0)),
pal5bit(state->paletteram[offset] >> (6)),
pal5bit(state->paletteram[offset] >> (11)));
}
static WRITE32_HANDLER( gstream_vram_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
COMBINE_DATA(&state->vram[offset]);
if (ACCESSING_BITS_24_31)
@@ -224,37 +224,37 @@ static WRITE32_HANDLER( gstream_vram_w )
static WRITE32_HANDLER( gstream_tilemap1_scrollx_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap1_scrollx = data;
}
static WRITE32_HANDLER( gstream_tilemap1_scrolly_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap1_scrolly = data;
}
static WRITE32_HANDLER( gstream_tilemap2_scrollx_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap2_scrollx = data;
}
static WRITE32_HANDLER( gstream_tilemap2_scrolly_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap2_scrolly = data;
}
static WRITE32_HANDLER( gstream_tilemap3_scrollx_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap3_scrollx = data;
}
static WRITE32_HANDLER( gstream_tilemap3_scrolly_w )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
state->tmap3_scrolly = data;
}
@@ -307,7 +307,7 @@ static WRITE32_HANDLER( gstream_oki_banking_w )
Musics order is completely guessed but close to what the original PCB game should be */
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
static const int bank_table_0[16] = { -1, -1, -1, -1, -1, -1, 0, 0, -1, 6, 0, 5, -1, 0, 0, 0 };
static const int bank_table_1[16] = { -1, -1, -1, -1, -1, -1, 2, 2, -1, 0, 0, 4, -1, 1, 1, 1 };
@@ -431,7 +431,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_gs1_tile_info )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
int tileno = (state->vram[tile_index + 0x000 / 4] & 0x0fff0000) >> 16;
int palette = (state->vram[tile_index + 0x000 / 4] & 0xc0000000) >> 30;
SET_TILE_INFO(0, tileno, palette + 0x10, 0);
@@ -439,7 +439,7 @@ static TILE_GET_INFO( get_gs1_tile_info )
static TILE_GET_INFO( get_gs2_tile_info )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
int tileno = (state->vram[tile_index + 0x400 / 4] & 0x0fff0000) >> 16;
int palette = (state->vram[tile_index + 0x400 / 4] & 0xc0000000) >> 30;
SET_TILE_INFO(0, tileno + 0x1000, palette + 0x14, 0);
@@ -448,7 +448,7 @@ static TILE_GET_INFO( get_gs2_tile_info )
static TILE_GET_INFO( get_gs3_tile_info )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
int tileno = (state->vram[tile_index + 0x800 / 4] & 0x0fff0000) >> 16;
int palette = (state->vram[tile_index + 0x800 / 4] & 0xc0000000) >> 30;
SET_TILE_INFO(0, tileno + 0x2000, palette + 0x18, 0);
@@ -457,7 +457,7 @@ static TILE_GET_INFO( get_gs3_tile_info )
static VIDEO_START(gstream)
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
state->tilemap1 = tilemap_create(machine, get_gs1_tile_info, tilemap_scan_rows, 32, 32, 16, 16);
state->tilemap2 = tilemap_create(machine, get_gs2_tile_info, tilemap_scan_rows, 32, 32, 16, 16);
state->tilemap3 = tilemap_create(machine, get_gs3_tile_info, tilemap_scan_rows, 32, 32, 16, 16);
@@ -482,7 +482,7 @@ static SCREEN_UPDATE(gstream)
are being set ?!
*/
- gstream_state *state = screen->machine->driver_data<gstream_state>();
+ gstream_state *state = screen->machine().driver_data<gstream_state>();
int i;
//popmessage("(1) %08x %08x (2) %08x %08x (3) %08x %08x", state->tmap1_scrollx, state->tmap1_scrolly, state->tmap2_scrollx, state->tmap2_scrolly, state->tmap3_scrollx, state->tmap3_scrolly );
@@ -512,7 +512,7 @@ static SCREEN_UPDATE(gstream)
if (x & 0x8000) x -= 0x10000;
if (y & 0x8000) y -= 0x10000;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],code,col,0,0,x-2,y,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],code,col,0,0,x-2,y,0);
}
return 0;
@@ -521,7 +521,7 @@ static SCREEN_UPDATE(gstream)
static MACHINE_START( gstream )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
state->save_item(NAME(state->tmap1_scrollx));
state->save_item(NAME(state->tmap2_scrollx));
@@ -535,7 +535,7 @@ static MACHINE_START( gstream )
static MACHINE_RESET( gstream )
{
- gstream_state *state = machine->driver_data<gstream_state>();
+ gstream_state *state = machine.driver_data<gstream_state>();
state->tmap1_scrollx = 0;
state->tmap2_scrollx = 0;
@@ -623,7 +623,7 @@ ROM_END
static READ32_HANDLER( gstream_speedup_r )
{
- gstream_state *state = space->machine->driver_data<gstream_state>();
+ gstream_state *state = space->machine().driver_data<gstream_state>();
if (state->maincpu->state(STATE_GENPC) == 0xc0001592)
{
state->maincpu->eat_cycles(50);
@@ -634,7 +634,7 @@ static READ32_HANDLER( gstream_speedup_r )
static DRIVER_INIT( gstream )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd1ee0, 0xd1ee3, FUNC(gstream_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd1ee0, 0xd1ee3, FUNC(gstream_speedup_r) );
}
diff --git a/src/mame/drivers/gstriker.c b/src/mame/drivers/gstriker.c
index 1a86cb5a694..628c957b033 100644
--- a/src/mame/drivers/gstriker.c
+++ b/src/mame/drivers/gstriker.c
@@ -182,7 +182,7 @@ Frequencies: 68k is XTAL_32MHZ/2
static READ16_HANDLER(dmmy_8f)
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->dmmy_8f_ret = ~state->dmmy_8f_ret;
return state->dmmy_8f_ret;
}
@@ -192,36 +192,36 @@ static READ16_HANDLER(dmmy_8f)
static WRITE16_HANDLER( sound_command_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
if (ACCESSING_BITS_0_7)
{
state->pending_command = 1;
soundlatch_w(space, offset, data & 0xff);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
#if 0
static READ16_HANDLER( pending_command_r )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
return state->pending_command;
}
#endif
static WRITE8_HANDLER( gs_sh_pending_command_clear_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( gs_sh_bankswitch_w )
{
- UINT8 *RAM = space->machine->region("audiocpu")->base();
+ UINT8 *RAM = space->machine().region("audiocpu")->base();
int bankaddress;
bankaddress = 0x10000 + (data & 0x03) * 0x8000;
- memory_set_bankptr(space->machine, "bank1",&RAM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1",&RAM[bankaddress]);
}
/*** GFX DECODE **************************************************************/
@@ -266,9 +266,9 @@ GFXDECODE_END
static void gs_ym2610_irq(device_t *device, int irq)
{
if (irq)
- cputag_set_input_line(device->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, ASSERT_LINE);
else
- cputag_set_input_line(device->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", 0, CLEAR_LINE);
}
static const ym2610_interface ym2610_config =
@@ -833,19 +833,19 @@ state->work_ram[0x002/2] = (_num_ & 0x0000ffff) >> 0;
static WRITE16_HANDLER( twrldc94_mcu_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->mcu_data = data;
}
static READ16_HANDLER( twrldc94_mcu_r )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
return state->mcu_data;
}
static WRITE16_HANDLER( twrldc94_prot_reg_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
state->prot_reg[1] = state->prot_reg[0];
state->prot_reg[0] = data;
@@ -958,7 +958,7 @@ static WRITE16_HANDLER( twrldc94_prot_reg_w )
static READ16_HANDLER( twrldc94_prot_reg_r )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
// bit 0 is for debugging vgoalsoc?
// Setting it results in a hang with a digit displayed on screen
// For twrldc94, it just disables sound.
@@ -993,7 +993,7 @@ static READ16_HANDLER( vbl_toggle_r )
static WRITE16_HANDLER( vbl_toggle_w )
{
- gstriker_state *state = space->machine->driver_data<gstriker_state>();
+ gstriker_state *state = space->machine().driver_data<gstriker_state>();
if( COUNTER1_ENABLE == 1 )
{
TICK_1 = (TICK_1 - 1) & 0xff; // 8bit
@@ -1015,42 +1015,42 @@ static WRITE16_HANDLER( vbl_toggle_w )
}
}
-static void mcu_init( running_machine *machine )
+static void mcu_init( running_machine &machine )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->dmmy_8f_ret = 0xFFFF;
state->pending_command = 0;
state->mcu_data = 0;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008a, 0x20008b, FUNC(twrldc94_mcu_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x20008e, 0x20008f, FUNC(twrldc94_prot_reg_r));
}
static DRIVER_INIT( twrldc94 )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->gametype = 1;
mcu_init( machine );
}
static DRIVER_INIT( twrldc94a )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->gametype = 2;
mcu_init( machine );
}
static DRIVER_INIT( vgoalsoc )
{
- gstriker_state *state = machine->driver_data<gstriker_state>();
+ gstriker_state *state = machine.driver_data<gstriker_state>();
state->gametype = 3;
mcu_init( machine );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200090, 0x200091, FUNC(vbl_toggle_w)); // vblank toggle
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200090, 0x200091, FUNC(vbl_toggle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x200090, 0x200091, FUNC(vbl_toggle_w)); // vblank toggle
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200090, 0x200091, FUNC(vbl_toggle_r));
}
/*** GAME DRIVERS ************************************************************/
diff --git a/src/mame/drivers/gsword.c b/src/mame/drivers/gsword.c
index 3b23986f43c..bd09932cf0f 100644
--- a/src/mame/drivers/gsword.c
+++ b/src/mame/drivers/gsword.c
@@ -171,7 +171,7 @@ static int gsword_coins_in(void)
/* (4004,4005) clear down counter , if (4004,4005)==0 then (402E)=0 */
static READ8_HANDLER( gsword_hack_r )
{
- gsword_state *state = space->machine->driver_data<gsword_state>();
+ gsword_state *state = space->machine().driver_data<gsword_state>();
UINT8 data = state->cpu2_ram[offset + 4];
/*if(offset==1)mame_printf_debug("CNT %02X%02X\n",state->cpu2_ram[5],state->cpu2_ram[4]); */
@@ -193,11 +193,11 @@ static READ8_HANDLER( gsword_8741_2_r )
switch (offset)
{
case 0x01: /* start button , coins */
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
case 0x02: /* Player 1 Controller */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x04: /* Player 2 Controller */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
// default:
// logerror("8741-2 unknown read %d PC=%04x\n",offset,cpu_get_pc(space->cpu));
}
@@ -210,11 +210,11 @@ static READ8_HANDLER( gsword_8741_3_r )
switch (offset)
{
case 0x01: /* start button */
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
case 0x02: /* Player 1 Controller? */
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
case 0x04: /* Player 2 Controller? */
- return input_port_read(space->machine, "IN3");
+ return input_port_read(space->machine(), "IN3");
}
/* unknown */
// logerror("8741-3 unknown read %d PC=%04x\n",offset,cpu_get_pc(space->cpu));
@@ -232,7 +232,7 @@ static const struct TAITO8741interface gsword_8741interface=
static MACHINE_RESET( gsword )
{
- gsword_state *state = machine->driver_data<gsword_state>();
+ gsword_state *state = machine.driver_data<gsword_state>();
int i;
for(i=0;i<4;i++) TAITO8741_reset(i);
@@ -252,7 +252,7 @@ static MACHINE_RESET( josvolly )
static INTERRUPT_GEN( gsword_snd_interrupt )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
if(state->nmi_enable)
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -261,7 +261,7 @@ static INTERRUPT_GEN( gsword_snd_interrupt )
static WRITE8_DEVICE_HANDLER( gsword_nmi_set_w )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
/* mame_printf_debug("AY write %02X\n",data);*/
state->protect_hack = (data&0x80) ? 0 : 1;
@@ -297,25 +297,25 @@ static WRITE8_DEVICE_HANDLER( gsword_nmi_set_w )
static WRITE8_DEVICE_HANDLER( gsword_AY8910_control_port_0_w )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
ay8910_address_w(device,offset,data);
state->fake8910_0 = data;
}
static WRITE8_DEVICE_HANDLER( gsword_AY8910_control_port_1_w )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
ay8910_address_w(device,offset,data);
state->fake8910_1 = data;
}
static READ8_DEVICE_HANDLER( gsword_fake_0_r )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
return state->fake8910_0+1;
}
static READ8_DEVICE_HANDLER( gsword_fake_1_r )
{
- gsword_state *state = device->machine->driver_data<gsword_state>();
+ gsword_state *state = device->machine().driver_data<gsword_state>();
return state->fake8910_1+1;
}
@@ -329,7 +329,7 @@ static WRITE8_DEVICE_HANDLER( gsword_adpcm_data_w )
static WRITE8_HANDLER( adpcm_soundcommand_w )
{
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM , 8 )
@@ -909,7 +909,7 @@ ROM_END
static DRIVER_INIT( gsword )
{
#if 0
- UINT8 *ROM2 = machine->region("sub")->base();
+ UINT8 *ROM2 = machine.region("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x71e] = 0; /* patch for sound protection or time out function */
@@ -917,14 +917,14 @@ static DRIVER_INIT( gsword )
#endif
#if 1
/* hack for sound protection or time out function */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
#endif
}
static DRIVER_INIT( gsword2 )
{
#if 0
- UINT8 *ROM2 = machine->region("sub")->base();
+ UINT8 *ROM2 = machine.region("sub")->base();
ROM2[0x1da] = 0xc3; /* patch for rom self check */
ROM2[0x726] = 0; /* patch for sound protection or time out function */
@@ -932,7 +932,7 @@ static DRIVER_INIT( gsword2 )
#endif
#if 1
/* hack for sound protection or time out function */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4004, 0x4005, FUNC(gsword_hack_r));
#endif
}
diff --git a/src/mame/drivers/gticlub.c b/src/mame/drivers/gticlub.c
index 79f2d780b2b..e2cbb401e5c 100644
--- a/src/mame/drivers/gticlub.c
+++ b/src/mame/drivers/gticlub.c
@@ -249,55 +249,55 @@ public:
static WRITE32_HANDLER( paletteram32_w )
{
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
- data = space->machine->generic.paletteram.u32[offset];
- palette_set_color_rgb(space->machine, offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
+ data = space->machine().generic.paletteram.u32[offset];
+ palette_set_color_rgb(space->machine(), offset, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
}
static void voodoo_vblank_0(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, param ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ0, param ? ASSERT_LINE : CLEAR_LINE);
}
static void voodoo_vblank_1(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, param ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ1, param ? ASSERT_LINE : CLEAR_LINE);
}
static READ32_HANDLER( gticlub_k001604_tile_r )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
return k001604_tile_r(k001604, offset, mem_mask);
}
static WRITE32_HANDLER( gticlub_k001604_tile_w )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
k001604_tile_w(k001604, offset, data, mem_mask);
}
static READ32_HANDLER( gticlub_k001604_char_r )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
return k001604_char_r(k001604, offset, mem_mask);
}
static WRITE32_HANDLER( gticlub_k001604_char_w )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
k001604_char_w(k001604, offset, data, mem_mask);
}
static READ32_HANDLER( gticlub_k001604_reg_r )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
return k001604_reg_r(k001604, offset, mem_mask);
}
static WRITE32_HANDLER( gticlub_k001604_reg_w )
{
- device_t *k001604 = space->machine->device(get_cgboard_id() ? "k001604_2" : "k001604_1");
+ device_t *k001604 = space->machine().device(get_cgboard_id() ? "k001604_2" : "k001604_1");
k001604_reg_w(k001604, offset, data, mem_mask);
}
@@ -321,15 +321,15 @@ static const eeprom_interface eeprom_intf =
static READ8_HANDLER( sysreg_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- device_t *adc1038 = space->machine->device("adc1038");
- device_t *eeprom = space->machine->device("eeprom");
+ device_t *adc1038 = space->machine().device("adc1038");
+ device_t *eeprom = space->machine().device("eeprom");
switch (offset)
{
case 0:
case 1:
case 3:
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
case 2:
return adc1038_sars_read(adc1038) << 7;
@@ -356,8 +356,8 @@ static READ8_HANDLER( sysreg_r )
static WRITE8_HANDLER( sysreg_w )
{
- device_t *adc1038 = space->machine->device("adc1038");
- device_t *eeprom = space->machine->device("eeprom");
+ device_t *adc1038 = space->machine().device("adc1038");
+ device_t *eeprom = space->machine().device("eeprom");
switch (offset)
{
@@ -374,10 +374,10 @@ static WRITE8_HANDLER( sysreg_w )
case 4:
if (data & 0x80) /* CG Board 1 IRQ Ack */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
if (data & 0x40) /* CG Board 0 IRQ Ack */
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
adc1038_di_write(adc1038, (data >> 0) & 1);
adc1038_clk_write(adc1038, (data >> 1) & 1);
@@ -391,13 +391,13 @@ static WRITE8_HANDLER( sysreg_w )
static MACHINE_START( gticlub )
{
- gticlub_state *state = machine->driver_data<gticlub_state>();
+ gticlub_state *state = machine.driver_data<gticlub_state>();
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->work_ram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x000fffff, FALSE, state->work_ram);
}
static ADDRESS_MAP_START( gticlub_map, AS_PROGRAM, 32 )
@@ -436,25 +436,25 @@ ADDRESS_MAP_END
static READ32_HANDLER( dsp_dataram0_r )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
return state->sharc_dataram_0[offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram0_w )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
state->sharc_dataram_0[offset] = data;
}
static READ32_HANDLER( dsp_dataram1_r )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
return state->sharc_dataram_1[offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram1_w )
{
- gticlub_state *state = space->machine->driver_data<gticlub_state>();
+ gticlub_state *state = space->machine().driver_data<gticlub_state>();
state->sharc_dataram_1[offset] = data;
}
@@ -698,12 +698,12 @@ static TIMER_CALLBACK( irq_off )
cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
}
-static void sound_irq_callback( running_machine *machine, int irq )
+static void sound_irq_callback( running_machine &machine, int irq )
{
int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
- machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line);
+ machine.scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off), line);
}
static const k056800_interface gticlub_k056800_interface =
@@ -717,10 +717,10 @@ static int adc1038_input_callback( device_t *device, int input )
int value = 0;
switch (input)
{
- case 0: value = input_port_read(device->machine, "AN0"); break;
- case 1: value = input_port_read(device->machine, "AN1"); break;
- case 2: value = input_port_read(device->machine, "AN2"); break;
- case 3: value = input_port_read(device->machine, "AN3"); break;
+ case 0: value = input_port_read(device->machine(), "AN0"); break;
+ case 1: value = input_port_read(device->machine(), "AN1"); break;
+ case 2: value = input_port_read(device->machine(), "AN2"); break;
+ case 3: value = input_port_read(device->machine(), "AN3"); break;
case 4: value = 0x000; break;
case 5: value = 0x000; break;
case 6: value = 0x000; break;
@@ -1152,22 +1152,22 @@ ROM_END
static DRIVER_INIT(gticlub)
{
- gticlub_state *state = machine->driver_data<gticlub_state>();
+ gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_GTICLUB);
state->sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
- K001005_preprocess_texture_data(machine->region("gfx1")->base(), machine->region("gfx1")->bytes(), 1);
+ K001005_preprocess_texture_data(machine.region("gfx1")->base(), machine.region("gfx1")->bytes(), 1);
}
static DRIVER_INIT(hangplt)
{
- gticlub_state *state = machine->driver_data<gticlub_state>();
+ gticlub_state *state = machine.driver_data<gticlub_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HANGPLT);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
state->sharc_dataram_0 = auto_alloc_array(machine, UINT32, 0x100000/4);
state->sharc_dataram_1 = auto_alloc_array(machine, UINT32, 0x100000/4);
diff --git a/src/mame/drivers/guab.c b/src/mame/drivers/guab.c
index f4af7c309bd..9b6cd9fff21 100644
--- a/src/mame/drivers/guab.c
+++ b/src/mame/drivers/guab.c
@@ -92,7 +92,7 @@ public:
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "maincpu", INT_6840PTM, state);
+ cputag_set_input_line(device->machine(), "maincpu", INT_6840PTM, state);
}
static const ptm6840_interface ptm_intf =
@@ -114,7 +114,7 @@ static const ptm6840_interface ptm_intf =
* TMS34061 CRTC
*****************/
-static void tms_interrupt(running_machine *machine, int state)
+static void tms_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INT_TMS34061, state);
}
@@ -177,7 +177,7 @@ static READ16_HANDLER( guab_tms34061_r )
/* Non-multiplexed mode */
static WRITE16_HANDLER( ef9369_w )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct ef9369 &pal = state->pal;
data &= 0x00ff;
@@ -207,7 +207,7 @@ static WRITE16_HANDLER( ef9369_w )
col = pal.clut[entry] & 0xfff;
/* Update the MAME palette */
- palette_set_color_rgb(space->machine, entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
+ palette_set_color_rgb(space->machine(), entry, pal4bit(col >> 0), pal4bit(col >> 4), pal4bit(col >> 8));
}
/* Address register auto-increment */
@@ -218,7 +218,7 @@ static WRITE16_HANDLER( ef9369_w )
static READ16_HANDLER( ef9369_r )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct ef9369 &pal = state->pal;
if ((offset & 1) == 0)
{
@@ -253,7 +253,7 @@ static SCREEN_UPDATE( guab )
/* If blanked, fill with black */
if (state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -267,8 +267,8 @@ static SCREEN_UPDATE( guab )
UINT8 pen = src[x >> 1];
/* Draw two 4-bit pixels */
- *dest++ = screen->machine->pens[pen >> 4];
- *dest++ = screen->machine->pens[pen & 0x0f];
+ *dest++ = screen->machine().pens[pen >> 4];
+ *dest++ = screen->machine().pens[pen & 0x0f];
}
}
@@ -310,9 +310,9 @@ enum wd1770_status
static TIMER_CALLBACK( fdc_data_callback )
{
- guab_state *state = machine->driver_data<guab_state>();
+ guab_state *state = machine.driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
- UINT8* disk = (UINT8*)machine->region("user1")->base();
+ UINT8* disk = (UINT8*)machine.region("user1")->base();
int more_data = 0;
/*
@@ -374,7 +374,7 @@ static TIMER_CALLBACK( fdc_data_callback )
static WRITE16_HANDLER( wd1770_w )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
data &= 0xff;
@@ -464,7 +464,7 @@ static WRITE16_HANDLER( wd1770_w )
fdc.sector));
/* Trigger a DRQ interrupt on the CPU */
- cputag_set_input_line(space->machine, "maincpu", INT_FLOPPYCTRL, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INT_FLOPPYCTRL, ASSERT_LINE);
fdc.status |= DATA_REQUEST;
break;
}
@@ -509,7 +509,7 @@ static WRITE16_HANDLER( wd1770_w )
fdc.data = data;
/* Clear the DRQ */
- cputag_set_input_line(space->machine, "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
/* Queue an event to write the data if write command was specified */
if (fdc.cmd & 0x20)
@@ -522,7 +522,7 @@ static WRITE16_HANDLER( wd1770_w )
static READ16_HANDLER( wd1770_r )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
UINT16 retval = 0;
@@ -548,7 +548,7 @@ static READ16_HANDLER( wd1770_r )
retval = fdc.data;
/* Clear the DRQ */
- cputag_set_input_line(space->machine, "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INT_FLOPPYCTRL, CLEAR_LINE);
fdc.status &= ~DATA_REQUEST;
break;
}
@@ -574,7 +574,7 @@ static READ16_HANDLER( io_r )
case 0x01:
case 0x02:
{
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
case 0x30:
{
@@ -594,7 +594,7 @@ static INPUT_CHANGED( coin_inserted )
if (newval == 0)
{
UINT32 credit;
- address_space *space = field->port->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = field->port->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Get the current credit value and add the new coin value */
credit = space->read_dword(0x8002c) + (UINT32)(FPTR)param;
@@ -610,7 +610,7 @@ static INPUT_CHANGED( coin_inserted )
static WRITE16_HANDLER( io_w )
{
- guab_state *state = space->machine->driver_data<guab_state>();
+ guab_state *state = space->machine().driver_data<guab_state>();
struct wd1770 &fdc = state->fdc;
switch (offset)
{
@@ -646,7 +646,7 @@ static WRITE16_HANDLER( io_w )
}
case 0x30:
{
- sn76496_w(space->machine->device("snsnd"), 0, data & 0xff);
+ sn76496_w(space->machine().device("snsnd"), 0, data & 0xff);
break;
}
case 0x31:
@@ -775,13 +775,13 @@ INPUT_PORTS_END
static MACHINE_START( guab )
{
- guab_state *state = machine->driver_data<guab_state>();
- state->fdc_timer = machine->scheduler().timer_alloc(FUNC(fdc_data_callback));
+ guab_state *state = machine.driver_data<guab_state>();
+ state->fdc_timer = machine.scheduler().timer_alloc(FUNC(fdc_data_callback));
}
static MACHINE_RESET( guab )
{
- guab_state *state = machine->driver_data<guab_state>();
+ guab_state *state = machine.driver_data<guab_state>();
memset(&state->fdc, 0, sizeof(state->fdc));
}
diff --git a/src/mame/drivers/gunbustr.c b/src/mame/drivers/gunbustr.c
index 5d669189548..28f6b74fc30 100644
--- a/src/mame/drivers/gunbustr.c
+++ b/src/mame/drivers/gunbustr.c
@@ -62,31 +62,31 @@ static TIMER_CALLBACK( gunbustr_interrupt5 )
static INTERRUPT_GEN( gunbustr_interrupt )
{
- device->machine->scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000-500), FUNC(gunbustr_interrupt5));
+ device->machine().scheduler().timer_set(downcast<cpu_device *>(device)->cycles_to_attotime(200000-500), FUNC(gunbustr_interrupt5));
device_set_input_line(device, 4, HOLD_LINE);
}
static WRITE32_HANDLER( gunbustr_palette_w )
{
int a;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
- a = space->machine->generic.paletteram.u32[offset] >> 16;
- palette_set_color_rgb(space->machine,offset*2,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
+ a = space->machine().generic.paletteram.u32[offset] >> 16;
+ palette_set_color_rgb(space->machine(),offset*2,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
- a = space->machine->generic.paletteram.u32[offset] &0xffff;
- palette_set_color_rgb(space->machine,offset*2+1,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
+ a = space->machine().generic.paletteram.u32[offset] &0xffff;
+ palette_set_color_rgb(space->machine(),offset*2+1,pal5bit(a >> 10),pal5bit(a >> 5),pal5bit(a >> 0));
}
static CUSTOM_INPUT( coin_word_r )
{
- gunbustr_state *state = field->port->machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = field->port->machine().driver_data<gunbustr_state>();
return state->coin_word;
}
static WRITE32_HANDLER( gunbustr_input_w )
{
- gunbustr_state *state = space->machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = space->machine().driver_data<gunbustr_state>();
#if 0
{
@@ -104,12 +104,12 @@ popmessage(t);
{
if (ACCESSING_BITS_24_31) /* $400000 is watchdog */
{
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
}
if (ACCESSING_BITS_0_7)
{
- device_t *device = space->machine->device("eeprom");
+ device_t *device = space->machine().device("eeprom");
eeprom_set_clock_line(device, (data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom_write_bit(device, data & 0x40);
eeprom_set_cs_line(device, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE);
@@ -125,10 +125,10 @@ popmessage(t);
/* game does not write a separate counter for coin 2!
It should disable both coins when 9 credits reached
see code $1d8a-f6... but for some reason it's not */
- coin_lockout_w(space->machine, 0, data & 0x01000000);
- coin_lockout_w(space->machine, 1, data & 0x02000000);
- coin_counter_w(space->machine, 0, data & 0x04000000);
- coin_counter_w(space->machine, 1, data & 0x04000000);
+ coin_lockout_w(space->machine(), 0, data & 0x01000000);
+ coin_lockout_w(space->machine(), 1, data & 0x02000000);
+ coin_counter_w(space->machine(), 0, data & 0x04000000);
+ coin_counter_w(space->machine(), 1, data & 0x04000000);
state->coin_word = (data >> 16) &0xffff;
}
//logerror("CPU #0 PC %06x: write input %06x\n",cpu_get_pc(space->cpu),offset);
@@ -176,14 +176,14 @@ static WRITE32_HANDLER( motor_control_w )
static READ32_HANDLER( gunbustr_gun_r )
{
- return ( input_port_read(space->machine, "LIGHT0_X") << 24) | (input_port_read(space->machine, "LIGHT0_Y") << 16) |
- ( input_port_read(space->machine, "LIGHT1_X") << 8) | input_port_read(space->machine, "LIGHT1_Y");
+ return ( input_port_read(space->machine(), "LIGHT0_X") << 24) | (input_port_read(space->machine(), "LIGHT0_Y") << 16) |
+ ( input_port_read(space->machine(), "LIGHT1_X") << 8) | input_port_read(space->machine(), "LIGHT1_Y");
}
static WRITE32_HANDLER( gunbustr_gun_w )
{
/* 10000 cycle delay is arbitrary */
- space->machine->scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(gunbustr_interrupt5));
+ space->machine().scheduler().timer_set(downcast<cpu_device *>(space->cpu)->cycles_to_attotime(10000), FUNC(gunbustr_interrupt5));
}
@@ -407,7 +407,7 @@ ROM_END
static READ32_HANDLER( main_cycle_r )
{
- gunbustr_state *state = space->machine->driver_data<gunbustr_state>();
+ gunbustr_state *state = space->machine().driver_data<gunbustr_state>();
if (cpu_get_pc(space->cpu)==0x55a && (state->ram[0x3acc/4]&0xff000000)==0)
device_spin_until_interrupt(space->cpu);
@@ -417,7 +417,7 @@ static READ32_HANDLER( main_cycle_r )
static DRIVER_INIT( gunbustr )
{
/* Speedup handler */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x203acc, 0x203acf, FUNC(main_cycle_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x203acc, 0x203acf, FUNC(main_cycle_r));
}
GAME( 1992, gunbustr, 0, gunbustr, gunbustr, gunbustr, ORIENTATION_FLIP_X, "Taito Corporation", "Gunbuster (Japan)", 0 )
diff --git a/src/mame/drivers/gundealr.c b/src/mame/drivers/gundealr.c
index 69a2ce45466..03d61d218a3 100644
--- a/src/mame/drivers/gundealr.c
+++ b/src/mame/drivers/gundealr.c
@@ -55,15 +55,15 @@ Runs in interrupt mode 0, the interrupt vectors are 0xcf (RST 08h) and
static INTERRUPT_GEN( yamyam_interrupt )
{
- gundealr_state *state = device->machine->driver_data<gundealr_state>();
+ gundealr_state *state = device->machine().driver_data<gundealr_state>();
if (cpu_getiloops(device) == 0)
{
if (state->input_ports_hack)
{
- state->rambase[0x004] = input_port_read(device->machine, "IN2");
- state->rambase[0x005] = input_port_read(device->machine, "IN1");
- state->rambase[0x006] = input_port_read(device->machine, "IN0");
+ state->rambase[0x004] = input_port_read(device->machine(), "IN2");
+ state->rambase[0x005] = input_port_read(device->machine(), "IN1");
+ state->rambase[0x006] = input_port_read(device->machine(), "IN0");
}
device_set_input_line_and_vector(device, 0, HOLD_LINE, 0xd7); /* RST 10h vblank */
}
@@ -73,12 +73,12 @@ static INTERRUPT_GEN( yamyam_interrupt )
static WRITE8_HANDLER( yamyam_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
}
static WRITE8_HANDLER( yamyam_protection_w )
{
- gundealr_state *state = space->machine->driver_data<gundealr_state>();
+ gundealr_state *state = space->machine().driver_data<gundealr_state>();
logerror("e000 = %02x\n", state->rambase[0x000]);
state->rambase[0x000] = data;
if (data == 0x03) state->rambase[0x001] = 0x03;
@@ -446,8 +446,8 @@ GFXDECODE_END
static MACHINE_START( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x4000);
@@ -457,7 +457,7 @@ static MACHINE_START( gundealr )
static MACHINE_RESET( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->flipscreen = 0;
state->scroll[0] = 0;
@@ -571,15 +571,15 @@ ROM_END
static DRIVER_INIT( gundealr )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->input_ports_hack = 0;
}
static DRIVER_INIT( yamyam )
{
- gundealr_state *state = machine->driver_data<gundealr_state>();
+ gundealr_state *state = machine.driver_data<gundealr_state>();
state->input_ports_hack = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(yamyam_protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(yamyam_protection_w));
}
diff --git a/src/mame/drivers/gunpey.c b/src/mame/drivers/gunpey.c
index 33206bbaf7e..06dd6558b72 100644
--- a/src/mame/drivers/gunpey.c
+++ b/src/mame/drivers/gunpey.c
@@ -64,13 +64,13 @@ public:
static VIDEO_START( gunpey )
{
- gunpey_state *state = machine->driver_data<gunpey_state>();
+ gunpey_state *state = machine.driver_data<gunpey_state>();
state->blit_buffer = auto_alloc_array(machine, UINT16, 512*512);
}
static SCREEN_UPDATE( gunpey )
{
- gunpey_state *state = screen->machine->driver_data<gunpey_state>();
+ gunpey_state *state = screen->machine().driver_data<gunpey_state>();
UINT16 *blit_buffer = state->blit_buffer;
int x,y;
int count;
@@ -116,11 +116,11 @@ static READ8_HANDLER( gunpey_inputs_r )
{
switch(offset+0x7f40)
{
- case 0x7f40: return input_port_read(space->machine, "DSW1");
- case 0x7f41: return input_port_read(space->machine, "DSW2");
- case 0x7f42: return input_port_read(space->machine, "P1");
- case 0x7f43: return input_port_read(space->machine, "P2");
- case 0x7f44: return input_port_read(space->machine, "SYSTEM");
+ case 0x7f40: return input_port_read(space->machine(), "DSW1");
+ case 0x7f41: return input_port_read(space->machine(), "DSW2");
+ case 0x7f42: return input_port_read(space->machine(), "P1");
+ case 0x7f43: return input_port_read(space->machine(), "P2");
+ case 0x7f44: return input_port_read(space->machine(), "SYSTEM");
}
return 0xff;
@@ -128,10 +128,10 @@ static READ8_HANDLER( gunpey_inputs_r )
static WRITE8_HANDLER( gunpey_blitter_w )
{
- gunpey_state *state = space->machine->driver_data<gunpey_state>();
+ gunpey_state *state = space->machine().driver_data<gunpey_state>();
UINT16 *blit_buffer = state->blit_buffer;
UINT16 *blit_ram = state->blit_ram;
- UINT8 *blit_rom = space->machine->region("blit_data")->base();
+ UINT8 *blit_rom = space->machine().region("blit_data")->base();
int x,y;
blit_ram[offset] = data;
@@ -304,7 +304,7 @@ INPUT_PORTS_END
static PALETTE_INIT( gunpey )
{
int i,r,g,b,val;
- UINT8 *blit_rom = machine->region("blit_data")->base();
+ UINT8 *blit_rom = machine.region("blit_data")->base();
for (i = 0; i < 512; i+=2)
{
@@ -382,7 +382,7 @@ ROM_END
static DRIVER_INIT( gunpey )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* patch SLOOOOW cycle checks ... */
rom[0x848b5] = 0x7e;
diff --git a/src/mame/drivers/gunsmoke.c b/src/mame/drivers/gunsmoke.c
index 7dadeda6cb7..d0078f246ee 100644
--- a/src/mame/drivers/gunsmoke.c
+++ b/src/mame/drivers/gunsmoke.c
@@ -274,8 +274,8 @@ GFXDECODE_END
static MACHINE_START( gunsmoke )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
- UINT8 *rombase = machine->region("maincpu")->base();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
+ UINT8 *rombase = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &rombase[0x10000], 0x4000);
@@ -287,7 +287,7 @@ static MACHINE_START( gunsmoke )
static MACHINE_RESET( gunsmoke )
{
- gunsmoke_state *state = machine->driver_data<gunsmoke_state>();
+ gunsmoke_state *state = machine.driver_data<gunsmoke_state>();
state->chon = 0;
state->objon = 0;
diff --git a/src/mame/drivers/gyruss.c b/src/mame/drivers/gyruss.c
index d69a3c8bdc1..51079a0286a 100644
--- a/src/mame/drivers/gyruss.c
+++ b/src/mame/drivers/gyruss.c
@@ -89,7 +89,7 @@ static const int gyruss_timer[10] =
static READ8_DEVICE_HANDLER( gyruss_portA_r )
{
- gyruss_state *state = device->machine->driver_data<gyruss_state>();
+ gyruss_state *state = device->machine().driver_data<gyruss_state>();
return gyruss_timer[(state->audiocpu->total_cycles() / 1024) % 10];
}
@@ -101,7 +101,7 @@ static WRITE8_DEVICE_HANDLER( gyruss_dac_w )
static WRITE8_HANDLER( gyruss_irq_clear_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
device_set_input_line(state->audiocpu_2, 0, CLEAR_LINE);
}
@@ -132,14 +132,14 @@ static WRITE8_DEVICE_HANDLER( gyruss_filter1_w )
static WRITE8_HANDLER( gyruss_sh_irqtrigger_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
/* writing to this register triggers IRQ on the sound CPU */
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( gyruss_i8039_irq_w )
{
- gyruss_state *state = space->machine->driver_data<gyruss_state>();
+ gyruss_state *state = space->machine().driver_data<gyruss_state>();
device_set_input_line(state->audiocpu_2, 0, ASSERT_LINE);
}
@@ -499,10 +499,10 @@ DISCRETE_SOUND_END
static MACHINE_START( gyruss )
{
- gyruss_state *state = machine->driver_data<gyruss_state>();
+ gyruss_state *state = machine.driver_data<gyruss_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
- state->audiocpu_2 = machine->device<cpu_device>("audio2");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
+ state->audiocpu_2 = machine.device<cpu_device>("audio2");
}
static MACHINE_CONFIG_START( gyruss, gyruss_state )
diff --git a/src/mame/drivers/halleys.c b/src/mame/drivers/halleys.c
index 6c73a54232c..105c0e133db 100644
--- a/src/mame/drivers/halleys.c
+++ b/src/mame/drivers/halleys.c
@@ -338,7 +338,7 @@ static void blit(halleys_state *state, int offset)
#if HALLEYS_DEBUG
if (0) {
- logerror("%s:[%04x]", machine->describe_context(), offset);
+ logerror("%s:[%04x]", machine.describe_context(), offset);
for (ecx=0; ecx<16; ecx++) logerror(" %02x", param[ecx]);
logerror("\n");
}
@@ -975,7 +975,7 @@ COMMAND_MODE:
// draws Ben Bero Beh's color backdrop(verification required)
static WRITE8_HANDLER( bgtile_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
int yskip, xskip, ecx;
UINT16 *edi;
UINT16 ax;
@@ -1001,7 +1001,7 @@ static WRITE8_HANDLER( bgtile_w )
static READ8_HANDLER( blitter_status_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
if (state->game_id==GAME_HALLEYS && cpu_get_pc(space->cpu)==0x8017) return(0x55); // HACK: trick SRAM test on startup
return(0);
@@ -1010,7 +1010,7 @@ static READ8_HANDLER( blitter_status_r )
static READ8_HANDLER( blitter_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
int i = offset & 0xf;
if (i==0 || i==4) return(1);
@@ -1021,14 +1021,14 @@ static READ8_HANDLER( blitter_r )
static TIMER_CALLBACK( blitter_reset )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->blitter_busy = 0;
}
static WRITE8_HANDLER( blitter_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
int i = offset & 0xf;
state->blitter_ram[offset] = data;
@@ -1040,7 +1040,7 @@ static WRITE8_HANDLER( blitter_w )
if (i==0 || (i==4 && !data))
{
state->blitter_busy = 0;
- if (state->firq_level) cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's
+ if (state->firq_level) cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, ASSERT_LINE); // make up delayed FIRQ's
}
else
{
@@ -1053,7 +1053,7 @@ static WRITE8_HANDLER( blitter_w )
static READ8_HANDLER( collision_id_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
/*
Collision detection abstract:
@@ -1092,7 +1092,7 @@ static READ8_HANDLER( collision_id_r )
static PALETTE_INIT( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
UINT32 d, r, g, b, i, j, count;
UINT32 *pal_ptr = state->internal_palette;
@@ -1139,7 +1139,7 @@ static PALETTE_INIT( halleys )
}
}
-static void halleys_decode_rgb(running_machine *machine, UINT32 *r, UINT32 *g, UINT32 *b, int addr, int data)
+static void halleys_decode_rgb(running_machine &machine, UINT32 *r, UINT32 *g, UINT32 *b, int addr, int data)
{
/*
proms contain:
@@ -1153,10 +1153,10 @@ static void halleys_decode_rgb(running_machine *machine, UINT32 *r, UINT32 *g, U
int bit0, bit1, bit2, bit3, bit4;
// the four 16x4-bit SN74S189 SRAM chips are assumed be the game's 32-byte palette RAM
- sram_189 = machine->generic.paletteram.u8;
+ sram_189 = machine.generic.paletteram.u8;
// each of the three 32-byte 6330 PROM is wired to an RGB component output
- prom_6330 = machine->region("proms")->base();
+ prom_6330 = machine.region("proms")->base();
// latch1 holds 8 bits from the selected palette RAM address
latch1_273 = sram_189[addr];
@@ -1186,11 +1186,11 @@ static void halleys_decode_rgb(running_machine *machine, UINT32 *r, UINT32 *g, U
static WRITE8_HANDLER( halleys_paletteram_IIRRGGBB_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
UINT32 d, r, g, b, i, j;
UINT32 *pal_ptr = state->internal_palette;
- space->machine->generic.paletteram.u8[offset] = data;
+ space->machine().generic.paletteram.u8[offset] = data;
d = (UINT32)data;
j = d | BG_RGB;
pal_ptr[offset] = j;
@@ -1204,19 +1204,19 @@ static WRITE8_HANDLER( halleys_paletteram_IIRRGGBB_w )
g = d & 0x0c; g |= i; g = g<<4 | g;
b = d<<2 & 0x0c; b |= i; b = b<<4 | b;
- palette_set_color(space->machine, offset, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset+SP_2BACK, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset+SP_ALPHA, MAKE_RGB(r, g, b));
- palette_set_color(space->machine, offset+SP_COLLD, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset+SP_2BACK, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset+SP_ALPHA, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset+SP_COLLD, MAKE_RGB(r, g, b));
- halleys_decode_rgb(space->machine, &r, &g, &b, offset, 0);
- palette_set_color(space->machine, offset+0x20, MAKE_RGB(r, g, b));
+ halleys_decode_rgb(space->machine(), &r, &g, &b, offset, 0);
+ palette_set_color(space->machine(), offset+0x20, MAKE_RGB(r, g, b));
}
static VIDEO_START( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
#define HALLEYS_Y0 0x8e
#define HALLEYS_X0 0x9a
#define HALLEYS_Y1 0xa2
@@ -1423,9 +1423,9 @@ static void copy_fixed_2b(bitmap_t *bitmap, UINT16 *source)
}
-static void filter_bitmap(running_machine *machine, bitmap_t *bitmap, int mask)
+static void filter_bitmap(running_machine &machine, bitmap_t *bitmap, int mask)
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
int dst_pitch;
UINT32 *pal_ptr, *edi;
@@ -1466,7 +1466,7 @@ static void filter_bitmap(running_machine *machine, bitmap_t *bitmap, int mask)
static SCREEN_UPDATE( halleys )
{
- halleys_state *state = screen->machine->driver_data<halleys_state>();
+ halleys_state *state = screen->machine().driver_data<halleys_state>();
int i, j;
if (state->stars_enabled)
@@ -1478,7 +1478,7 @@ static SCREEN_UPDATE( halleys )
bitmap_fill(bitmap, cliprect, state->bgcolor);
#ifdef MAME_DEBUG
- if (input_port_read(screen->machine, "DEBUG")) copy_scroll_xp(bitmap, state->render_layer[3], *state->scrollx0, *state->scrolly0); // not used???
+ if (input_port_read(screen->machine(), "DEBUG")) copy_scroll_xp(bitmap, state->render_layer[3], *state->scrollx0, *state->scrolly0); // not used???
#endif
copy_scroll_xp(bitmap, state->render_layer[2], *state->scrollx1, *state->scrolly1);
@@ -1488,14 +1488,14 @@ static SCREEN_UPDATE( halleys )
// HALF-HACK: apply RGB filter when the following conditions are met
i = state->io_ram[0xa0];
j = state->io_ram[0xa1];
- if (state->io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen->machine, bitmap, i);
+ if (state->io_ram[0x2b] && (i>0xc6 && i<0xfe) && (j==0xc0 || j==0xed)) filter_bitmap(screen->machine(), bitmap, i);
return 0;
}
static SCREEN_UPDATE( benberob )
{
- halleys_state *state = screen->machine->driver_data<halleys_state>();
+ halleys_state *state = screen->machine().driver_data<halleys_state>();
if (state->io_ram[0xa0] & 0x80)
copy_scroll_op(bitmap, state->render_layer[2], *state->scrollx1, *state->scrolly1);
else
@@ -1516,7 +1516,7 @@ static READ8_HANDLER( zero_r ) { return(0); }
static READ8_HANDLER( debug_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
return(state->io_ram[offset]);
}
@@ -1528,7 +1528,7 @@ static READ8_HANDLER( debug_r )
static INTERRUPT_GEN( halleys_interrupt )
{
- halleys_state *state = device->machine->driver_data<halleys_state>();
+ halleys_state *state = device->machine().driver_data<halleys_state>();
UINT8 latch_data;
switch (cpu_getiloops(device))
@@ -1555,7 +1555,7 @@ static INTERRUPT_GEN( halleys_interrupt )
state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1);
state->latch_delay = (latch_data) ? 0 : 4;
soundlatch_w( device->memory().space(AS_PROGRAM), 0, latch_data);
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
// clear collision list of this frame unconditionally
@@ -1581,7 +1581,7 @@ static INTERRUPT_GEN( halleys_interrupt )
static INTERRUPT_GEN( benberob_interrupt )
{
- halleys_state *state = device->machine->driver_data<halleys_state>();
+ halleys_state *state = device->machine().driver_data<halleys_state>();
UINT8 latch_data;
switch (cpu_getiloops(device))
@@ -1595,7 +1595,7 @@ static INTERRUPT_GEN( benberob_interrupt )
state->fftail = (state->fftail + 1) & (MAX_SOUNDS - 1);
state->latch_delay = (latch_data) ? 0 : 4;
soundlatch_w(device->memory().space(AS_PROGRAM), 0, latch_data);
- cputag_set_input_line(device->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
break;
@@ -1614,31 +1614,31 @@ static INTERRUPT_GEN( benberob_interrupt )
static READ8_HANDLER( vector_r )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
return(state->cpu1_base[0xffe0 + (offset^(state->mVectorType<<4))]);
}
static WRITE8_HANDLER( firq_ack_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
state->io_ram[0x9c] = data;
if (state->firq_level) state->firq_level--;
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE, CLEAR_LINE);
}
static WRITE8_DEVICE_HANDLER( sndnmi_msk_w )
{
- halleys_state *state = device->machine->driver_data<halleys_state>();
+ halleys_state *state = device->machine().driver_data<halleys_state>();
state->sndnmi_mask = data & 1;
}
static WRITE8_HANDLER( soundcommand_w )
{
- halleys_state *state = space->machine->driver_data<halleys_state>();
+ halleys_state *state = space->machine().driver_data<halleys_state>();
if (state->ffcount < MAX_SOUNDS)
{
state->ffcount++;
@@ -1655,8 +1655,8 @@ static READ8_HANDLER( coin_lockout_r )
// 0x8599 : 'benberob'
// 0x83e2 : 'halleys', 'halleysc', 'halleycj'
// 0x83df : 'halley87'
- int inp = input_port_read(space->machine, "IN0");
- int result = ((input_port_read(space->machine, "DSW4")) & 0x20) >> 5;
+ int inp = input_port_read(space->machine(), "IN0");
+ int result = ((input_port_read(space->machine(), "DSW4")) & 0x20) >> 5;
if (inp & 0x80) result |= 0x02;
if (inp & 0x40) result |= 0x04;
@@ -1669,7 +1669,7 @@ static READ8_HANDLER( io_mirror_r )
{
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- return input_port_read(space->machine, portnames[offset]);
+ return input_port_read(space->machine(), portnames[offset]);
}
@@ -1955,7 +1955,7 @@ INPUT_PORTS_END
static MACHINE_RESET( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->mVectorType = 0;
state->firq_level = 0;
state->blitter_busy = 0;
@@ -2178,9 +2178,9 @@ ROM_END
//**************************************************************************
// Driver Initializations
-static void init_common(running_machine *machine)
+static void init_common(running_machine &machine)
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
UINT8 *buf, *rom;
int addr, i;
UINT8 al, ah, dl, dh;
@@ -2214,7 +2214,7 @@ static void init_common(running_machine *machine)
// decrypt main program ROM
- rom = state->cpu1_base = machine->region("maincpu")->base();
+ rom = state->cpu1_base = machine.region("maincpu")->base();
buf = state->gfx1_base;
for (i=0; i<0x10000; i++)
@@ -2227,7 +2227,7 @@ static void init_common(running_machine *machine)
// swap graphics ROM addresses and unpack each pixel
- rom = machine->region("gfx1")->base();
+ rom = machine.region("gfx1")->base();
buf = state->gfx_plane02;
for (i=0xffff; i>=0; i--)
@@ -2261,18 +2261,18 @@ static void init_common(running_machine *machine)
static DRIVER_INIT( benberob )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->game_id = GAME_BENBEROB;
init_common(machine);
- state->blitter_reset_timer = machine->scheduler().timer_alloc(FUNC(blitter_reset));
+ state->blitter_reset_timer = machine.scheduler().timer_alloc(FUNC(blitter_reset));
}
static DRIVER_INIT( halleys )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->game_id = GAME_HALLEYS;
state->collision_detection = 0xb114;
@@ -2281,7 +2281,7 @@ static DRIVER_INIT( halleys )
static DRIVER_INIT( halley87 )
{
- halleys_state *state = machine->driver_data<halleys_state>();
+ halleys_state *state = machine.driver_data<halleys_state>();
state->game_id = GAME_HALLEYS;
state->collision_detection = 0xb10d;
diff --git a/src/mame/drivers/hanaawas.c b/src/mame/drivers/hanaawas.c
index 69466d2097b..9d4a4a759d2 100644
--- a/src/mame/drivers/hanaawas.c
+++ b/src/mame/drivers/hanaawas.c
@@ -32,20 +32,20 @@
static READ8_HANDLER( hanaawas_input_port_0_r )
{
- hanaawas_state *state = space->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = space->machine().driver_data<hanaawas_state>();
int i, ordinal = 0;
UINT16 buttons = 0;
switch (state->mux)
{
case 1: /* start buttons */
- buttons = input_port_read(space->machine, "START");
+ buttons = input_port_read(space->machine(), "START");
break;
case 2: /* player 1 buttons */
- buttons = input_port_read(space->machine, "P1");
+ buttons = input_port_read(space->machine(), "P1");
break;
case 4: /* player 2 buttons */
- buttons = input_port_read(space->machine, "P2");
+ buttons = input_port_read(space->machine(), "P2");
break;
}
@@ -61,12 +61,12 @@ static READ8_HANDLER( hanaawas_input_port_0_r )
}
}
- return (input_port_read(space->machine, "IN0") & 0xf0) | ordinal;
+ return (input_port_read(space->machine(), "IN0") & 0xf0) | ordinal;
}
static WRITE8_HANDLER( hanaawas_inputs_mux_w )
{
- hanaawas_state *state = space->machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = space->machine().driver_data<hanaawas_state>();
state->mux = data;
}
@@ -186,14 +186,14 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( hanaawas )
{
- hanaawas_state *state = machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = machine.driver_data<hanaawas_state>();
state->save_item(NAME(state->mux));
}
static MACHINE_RESET( hanaawas )
{
- hanaawas_state *state = machine->driver_data<hanaawas_state>();
+ hanaawas_state *state = machine.driver_data<hanaawas_state>();
state->mux = 0;
}
diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c
index cd1481b5412..65668f00ae5 100644
--- a/src/mame/drivers/harddriv.c
+++ b/src/mame/drivers/harddriv.c
@@ -3771,9 +3771,9 @@ ROM_END
*************************************/
/* COMMON INIT: initialize the original "driver" main board */
-static void init_driver(running_machine *machine)
+static void init_driver(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* note that we're not multisync */
state->gsp_multisync = FALSE;
@@ -3781,9 +3781,9 @@ static void init_driver(running_machine *machine)
/* COMMON INIT: initialize the later "multisync" main board */
-static void init_multisync(running_machine *machine, int compact_inputs)
+static void init_multisync(running_machine &machine, int compact_inputs)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* note that we're multisync */
state->gsp_multisync = TRUE;
@@ -3799,9 +3799,9 @@ static void init_multisync(running_machine *machine, int compact_inputs)
/* COMMON INIT: initialize the ADSP/ADSP2 board */
-static void init_adsp(running_machine *machine)
+static void init_adsp(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* install ADSP program RAM */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_adsp_program_r), FUNC(hd68k_adsp_program_w));
@@ -3820,9 +3820,9 @@ static void init_adsp(running_machine *machine)
/* COMMON INIT: initialize the DS3 board */
-static void init_ds3(running_machine *machine)
+static void init_ds3(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* install ADSP program RAM */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_ds3_program_r), FUNC(hd68k_ds3_program_w));
@@ -3918,10 +3918,10 @@ static void init_ds3(running_machine *machine)
/* COMMON INIT: initialize the DSK add-on board */
-static void init_dsk(running_machine *machine)
+static void init_dsk(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- UINT8 *usr3 = machine->region("user3")->base();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ UINT8 *usr3 = machine.region("user3")->base();
/* install ASIC61 */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
@@ -3952,10 +3952,10 @@ static void init_dsk(running_machine *machine)
/* COMMON INIT: initialize the DSK II add-on board */
-static void init_dsk2(running_machine *machine)
+static void init_dsk2(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
- UINT8 *usr3 = machine->region("user3")->base();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
+ UINT8 *usr3 = machine.region("user3")->base();
/* install ASIC65 */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w));
@@ -3982,9 +3982,9 @@ static void init_dsk2(running_machine *machine)
/* COMMON INIT: initialize the DSPCOM add-on board */
-static void init_dspcom(running_machine *machine)
+static void init_dspcom(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* install ASIC65 */
state->maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w));
@@ -4000,9 +4000,9 @@ static void init_dspcom(running_machine *machine)
/* COMMON INIT: initialize the original "driver" sound board */
-static void init_driver_sound(running_machine *machine)
+static void init_driver_sound(running_machine &machine)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
hdsnd_init(machine);
@@ -4023,7 +4023,7 @@ static void init_driver_sound(running_machine *machine)
static DRIVER_INIT( harddriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_driver(machine);
@@ -4048,7 +4048,7 @@ static DRIVER_INIT( harddriv )
static DRIVER_INIT( harddrivc )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4073,7 +4073,7 @@ static DRIVER_INIT( harddrivc )
static DRIVER_INIT( stunrun )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 0);
@@ -4093,7 +4093,7 @@ static DRIVER_INIT( stunrun )
static DRIVER_INIT( racedriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_driver(machine);
@@ -4114,9 +4114,9 @@ static DRIVER_INIT( racedriv )
}
-static void racedrivc_init_common(running_machine *machine, offs_t gsp_protection)
+static void racedrivc_init_common(running_machine &machine, offs_t gsp_protection)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4156,9 +4156,9 @@ static READ16_HANDLER( steeltal_dummy_r )
}
-static void steeltal_init_common(running_machine *machine, offs_t ds3_transfer_pc, int proto_sloop)
+static void steeltal_init_common(running_machine &machine, offs_t ds3_transfer_pc, int proto_sloop)
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 0);
@@ -4207,7 +4207,7 @@ static DRIVER_INIT( steeltalp ) { steeltal_init_common(machine, 0x52290, 1); }
static DRIVER_INIT( strtdriv )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4238,7 +4238,7 @@ static DRIVER_INIT( strtdriv )
static DRIVER_INIT( hdrivair )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
@@ -4265,7 +4265,7 @@ static DRIVER_INIT( hdrivair )
static DRIVER_INIT( hdrivairp )
{
- harddriv_state *state = machine->driver_data<harddriv_state>();
+ harddriv_state *state = machine.driver_data<harddriv_state>();
/* initialize the boards */
init_multisync(machine, 1);
diff --git a/src/mame/drivers/hcastle.c b/src/mame/drivers/hcastle.c
index 4231cd20f34..beb3e7ee9ac 100644
--- a/src/mame/drivers/hcastle.c
+++ b/src/mame/drivers/hcastle.c
@@ -19,19 +19,19 @@
static WRITE8_HANDLER( hcastle_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x1f);
+ memory_set_bank(space->machine(), "bank1", data & 0x1f);
}
static WRITE8_HANDLER( hcastle_soundirq_w )
{
- hcastle_state *state = space->machine->driver_data<hcastle_state>();
+ hcastle_state *state = space->machine().driver_data<hcastle_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
static WRITE8_HANDLER( hcastle_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x40);
- coin_counter_w(space->machine, 1, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x40);
+ coin_counter_w(space->machine(), 1, data & 0x80);
}
@@ -156,7 +156,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int linestate)
{
-// hcastle_state *state = device->machine->driver_data<hcastle_state>();
+// hcastle_state *state = device->machine().driver_data<hcastle_state>();
// cputag_set_input_line(state->audiocpu, 0, linestate);
}
@@ -178,14 +178,14 @@ static const ym3812_interface ym3812_config =
static MACHINE_START( hcastle )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 16, &ROM[0x10000], 0x2000);
- state->audiocpu = machine->device("audiocpu");
- state->k007121_1 = machine->device("k007121_1");
- state->k007121_2 = machine->device("k007121_2");
+ state->audiocpu = machine.device("audiocpu");
+ state->k007121_1 = machine.device("k007121_1");
+ state->k007121_2 = machine.device("k007121_2");
state->save_item(NAME(state->pf2_bankbase));
state->save_item(NAME(state->pf1_bankbase));
@@ -196,7 +196,7 @@ static MACHINE_START( hcastle )
static MACHINE_RESET( hcastle )
{
- hcastle_state *state = machine->driver_data<hcastle_state>();
+ hcastle_state *state = machine.driver_data<hcastle_state>();
state->pf2_bankbase = 0;
state->pf1_bankbase = 0;
diff --git a/src/mame/drivers/hexion.c b/src/mame/drivers/hexion.c
index bd5f0df1b3e..b73b1680d2c 100644
--- a/src/mame/drivers/hexion.c
+++ b/src/mame/drivers/hexion.c
@@ -92,11 +92,11 @@ static WRITE8_HANDLER( coincntr_w )
//logerror("%04x: coincntr_w %02x\n",cpu_get_pc(space->cpu),data);
/* bits 0/1 = coin counters */
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
/* bit 5 = flip screen */
- flip_screen_set(space->machine, data & 0x20);
+ flip_screen_set(space->machine(), data & 0x20);
/* other bit unknown */
if ((data & 0xdc) != 0x10) popmessage("coincntr %02x",data);
diff --git a/src/mame/drivers/highvdeo.c b/src/mame/drivers/highvdeo.c
index 6821027f8f3..557f7178bb1 100644
--- a/src/mame/drivers/highvdeo.c
+++ b/src/mame/drivers/highvdeo.c
@@ -112,7 +112,7 @@ static VIDEO_START(tourvisn)
static SCREEN_UPDATE(tourvisn)
{
- highvdeo_state *state = screen->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = screen->machine().driver_data<highvdeo_state>();
int x,y,count;
count = (0/2);
@@ -126,12 +126,12 @@ static SCREEN_UPDATE(tourvisn)
color = ((state->blit_ram[count]) & 0x00ff)>>0;
if((x*2)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine().pens[color];
color = ((state->blit_ram[count]) & 0xff00)>>8;
if(((x*2)+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine().pens[color];
count++;
}
@@ -143,7 +143,7 @@ static SCREEN_UPDATE(tourvisn)
/*Later HW, RGB565 instead of RAM-based pens (+ ramdac).*/
static SCREEN_UPDATE(brasil)
{
- highvdeo_state *state = screen->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = screen->machine().driver_data<highvdeo_state>();
int x,y,count;
count = (0/2);
@@ -176,22 +176,22 @@ static SCREEN_UPDATE(brasil)
static READ16_HANDLER( read1_r )
{
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
static READ16_HANDLER( read2_r )
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
static READ16_HANDLER( read3_r )
{
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
static WRITE16_HANDLER( tv_vcf_paletteram_w )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
switch(offset*2)
{
case 0:
@@ -213,7 +213,7 @@ static WRITE16_HANDLER( tv_vcf_paletteram_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -226,12 +226,12 @@ static WRITE16_HANDLER( tv_vcf_paletteram_w )
static WRITE16_HANDLER( tv_vcf_bankselect_w )
{
UINT32 bankaddress;
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
/* bits 0, 1 select the ROM bank */
bankaddress = (data & 0x03) * 0x40000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
@@ -295,7 +295,7 @@ static READ16_HANDLER( tv_ncf_read2_r )
// machine resets itself.
resetpulse ^= 0x40;
- return (input_port_read(space->machine, "IN1") & 0xbf) | resetpulse;
+ return (input_port_read(space->machine(), "IN1") & 0xbf) | resetpulse;
}
static WRITE16_DEVICE_HANDLER( tv_ncf_oki6395_w )
@@ -329,25 +329,25 @@ static WRITE16_HANDLER( tv_tcf_paletteram_w )
{
int r, g, b, color;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- color = space->machine->generic.paletteram.u16[offset];
+ color = space->machine().generic.paletteram.u16[offset];
r = (color >> 8) & 0xf8;
g = (color >> 3) & 0xf8;
b = (color << 3) & 0xf8;
- palette_set_color_rgb(space->machine, offset, r, g, b);
+ palette_set_color_rgb(space->machine(), offset, r, g, b);
}
static WRITE16_HANDLER( tv_tcf_bankselect_w )
{
UINT32 bankaddress;
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
/* bits 0, 1, 2 select the ROM bank */
bankaddress = (data & 0x07) * 0x40000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
}
static ADDRESS_MAP_START( tv_tcf_map, AS_PROGRAM, 16 )
@@ -386,13 +386,13 @@ static READ16_HANDLER( newmcard_status_r )
static READ16_HANDLER( newmcard_vblank_r )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
return state->vblank_bit; //0x80
}
static WRITE16_HANDLER( newmcard_vblank_w )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
state->vblank_bit = data;
}
@@ -404,8 +404,8 @@ static WRITE16_HANDLER( write2_w )
for(i=0;i<4;i++)
{
- coin_counter_w(space->machine, i,data & 0x20);
- coin_lockout_w(space->machine, i,~data & 0x08);
+ coin_counter_w(space->machine(), i,data & 0x20);
+ coin_lockout_w(space->machine(), i,~data & 0x08);
}
}
@@ -440,7 +440,7 @@ ADDRESS_MAP_END
static READ16_HANDLER( brasil_status_r )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
static UINT16 resetpulse;
switch(offset*2)
@@ -460,9 +460,9 @@ static READ16_HANDLER( brasil_status_r )
/*bankaddress might be incorrect.*/
static WRITE16_HANDLER( brasil_status_w )
{
- highvdeo_state *state = space->machine->driver_data<highvdeo_state>();
+ highvdeo_state *state = space->machine().driver_data<highvdeo_state>();
UINT32 bankaddress;
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
switch(data & 3) //data & 7?
{
@@ -473,7 +473,7 @@ static WRITE16_HANDLER( brasil_status_w )
bankaddress = (data & 0x07) * 0x40000;
- memory_set_bankptr(space->machine, "bank1", &ROM[bankaddress]);
+ memory_set_bankptr(space->machine(), "bank1", &ROM[bankaddress]);
// popmessage("%04x",data);
}
@@ -1159,7 +1159,7 @@ static READ16_HANDLER( ciclone_status_r )
static DRIVER_INIT( ciclone )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0030, 0x0033, FUNC(ciclone_status_r) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_read_handler(0x0030, 0x0033, FUNC(ciclone_status_r) );
}
/*
@@ -1222,14 +1222,14 @@ static WRITE16_HANDLER( fashion_output_w )
for(i=0;i<4;i++)
{
- coin_counter_w(space->machine, i,data & 0x20);
- coin_lockout_w(space->machine, i,~data & 0x01);
+ coin_counter_w(space->machine(), i,data & 0x20);
+ coin_lockout_w(space->machine(), i,~data & 0x01);
}
}
static DRIVER_INIT( fashion )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x0002, 0x0003, FUNC(fashion_output_w) );
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0x0002, 0x0003, FUNC(fashion_output_w) );
}
GAMEL( 2000, tour4000, 0, tv_vcf, tv_vcf, 0, ROT0, "High Video", "Tour 4000", 0, layout_fashion )
diff --git a/src/mame/drivers/himesiki.c b/src/mame/drivers/himesiki.c
index 3a4ae0432f2..f164227b867 100644
--- a/src/mame/drivers/himesiki.c
+++ b/src/mame/drivers/himesiki.c
@@ -91,7 +91,7 @@ A 12.000MHz
static WRITE8_HANDLER( himesiki_rombank_w )
{
- memory_set_bank(space->machine, "bank1", ((data & 0x08) >> 3));
+ memory_set_bank(space->machine(), "bank1", ((data & 0x08) >> 3));
if (data & 0xf7)
logerror("p06_w %02x\n", data);
@@ -99,7 +99,7 @@ static WRITE8_HANDLER( himesiki_rombank_w )
static WRITE8_HANDLER( himesiki_sound_w )
{
- himesiki_state *state = space->machine->driver_data<himesiki_state>();
+ himesiki_state *state = space->machine().driver_data<himesiki_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->subcpu, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -269,12 +269,12 @@ GFXDECODE_END
static MACHINE_START( himesiki )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
- state->subcpu = machine->device("sub");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->scrollx));
state->save_item(NAME(state->flipscreen));
@@ -282,7 +282,7 @@ static MACHINE_START( himesiki )
static MACHINE_RESET( himesiki )
{
- himesiki_state *state = machine->driver_data<himesiki_state>();
+ himesiki_state *state = machine.driver_data<himesiki_state>();
state->scrollx[0] = 0;
state->scrollx[1] = 0;
diff --git a/src/mame/drivers/hitme.c b/src/mame/drivers/hitme.c
index 823f71847c6..72422aabaaf 100644
--- a/src/mame/drivers/hitme.c
+++ b/src/mame/drivers/hitme.c
@@ -30,7 +30,7 @@
static TILE_GET_INFO( get_hitme_tile_info )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
/* the code is the low 6 bits */
UINT8 code = state->videoram[tile_index] & 0x3f;
@@ -40,7 +40,7 @@ static TILE_GET_INFO( get_hitme_tile_info )
static WRITE8_HANDLER( hitme_vidram_w )
{
- hitme_state *state = space->machine->driver_data<hitme_state>();
+ hitme_state *state = space->machine().driver_data<hitme_state>();
/* mark this tile dirty */
state->videoram[offset] = data;
@@ -57,23 +57,23 @@ static WRITE8_HANDLER( hitme_vidram_w )
static VIDEO_START( hitme )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
state->tilemap = tilemap_create(machine, get_hitme_tile_info, tilemap_scan_rows, 8, 10, 40, 19);
}
static VIDEO_START( barricad )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
state->tilemap = tilemap_create(machine, get_hitme_tile_info, tilemap_scan_rows, 8, 8, 32, 24);
}
static SCREEN_UPDATE( hitme )
{
- hitme_state *state = screen->machine->driver_data<hitme_state>();
+ hitme_state *state = screen->machine().driver_data<hitme_state>();
/* the card width resistor comes from an input port, scaled to the range 0-25 kOhms */
- double width_resist = input_port_read(screen->machine, "WIDTH") * 25000 / 100;
+ double width_resist = input_port_read(screen->machine(), "WIDTH") * 25000 / 100;
/* this triggers a oneshot for the following length of time */
double width_duration = 0.45 * 1000e-12 * width_resist;
/* the dot clock runs at the standard horizontal frequency * 320+16 clocks per scanline */
@@ -119,7 +119,7 @@ static SCREEN_UPDATE( hitme )
static SCREEN_UPDATE( barricad )
{
- hitme_state *state = screen->machine->driver_data<hitme_state>();
+ hitme_state *state = screen->machine().driver_data<hitme_state>();
tilemap_draw(bitmap, cliprect, state->tilemap, 0, 0);
return 0;
}
@@ -132,22 +132,22 @@ static SCREEN_UPDATE( barricad )
*
*************************************/
-static UINT8 read_port_and_t0( running_machine *machine, int port )
+static UINT8 read_port_and_t0( running_machine &machine, int port )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
UINT8 val = input_port_read(machine, portnames[port]);
- if (machine->time() > state->timeout_time)
+ if (machine.time() > state->timeout_time)
val ^= 0x80;
return val;
}
-static UINT8 read_port_and_t0_and_hblank( running_machine *machine, int port )
+static UINT8 read_port_and_t0_and_hblank( running_machine &machine, int port )
{
UINT8 val = read_port_and_t0(machine, port);
- if (machine->primary_screen->hpos() < (machine->primary_screen->width() * 9 / 10))
+ if (machine.primary_screen->hpos() < (machine.primary_screen->width() * 9 / 10))
val ^= 0x04;
return val;
}
@@ -155,25 +155,25 @@ static UINT8 read_port_and_t0_and_hblank( running_machine *machine, int port )
static READ8_HANDLER( hitme_port_0_r )
{
- return read_port_and_t0_and_hblank(space->machine, 0);
+ return read_port_and_t0_and_hblank(space->machine(), 0);
}
static READ8_HANDLER( hitme_port_1_r )
{
- return read_port_and_t0(space->machine, 1);
+ return read_port_and_t0(space->machine(), 1);
}
static READ8_HANDLER( hitme_port_2_r )
{
- return read_port_and_t0_and_hblank(space->machine, 2);
+ return read_port_and_t0_and_hblank(space->machine(), 2);
}
static READ8_HANDLER( hitme_port_3_r )
{
- return read_port_and_t0(space->machine, 3);
+ return read_port_and_t0(space->machine(), 3);
}
@@ -192,11 +192,11 @@ static WRITE8_DEVICE_HANDLER( output_port_0_w )
In fact, it is very important that our timing calculation timeout AFTER the sound
system's equivalent computation, or else we will hang notes.
*/
- hitme_state *state = device->machine->driver_data<hitme_state>();
- UINT8 raw_game_speed = input_port_read(device->machine, "R3");
+ hitme_state *state = device->machine().driver_data<hitme_state>();
+ UINT8 raw_game_speed = input_port_read(device->machine(), "R3");
double resistance = raw_game_speed * 25000 / 100;
attotime duration = attotime(0, ATTOSECONDS_PER_SECOND * 0.45 * 6.8e-6 * resistance * (data + 1));
- state->timeout_time = device->machine->time() + duration;
+ state->timeout_time = device->machine().time() + duration;
discrete_sound_w(device, HITME_DOWNCOUNT_VAL, data);
discrete_sound_w(device, HITME_OUT0, 1);
@@ -311,7 +311,7 @@ static MACHINE_START( hitme )
static MACHINE_RESET( hitme )
{
- hitme_state *state = machine->driver_data<hitme_state>();
+ hitme_state *state = machine.driver_data<hitme_state>();
state->timeout_time = attotime::zero;
}
diff --git a/src/mame/drivers/hitpoker.c b/src/mame/drivers/hitpoker.c
index 7e13a3ccae6..e9494c52b69 100644
--- a/src/mame/drivers/hitpoker.c
+++ b/src/mame/drivers/hitpoker.c
@@ -69,7 +69,7 @@ public:
static VIDEO_START(hitpoker)
{
- hitpoker_state *state = machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = machine.driver_data<hitpoker_state>();
state->videoram = auto_alloc_array(machine, UINT8, 0x35ff);
state->paletteram = auto_alloc_array(machine, UINT8, 0x1000);
state->colorram = auto_alloc_array(machine, UINT8, 0x2000);
@@ -77,7 +77,7 @@ static VIDEO_START(hitpoker)
static SCREEN_UPDATE(hitpoker)
{
- hitpoker_state *state = screen->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = screen->machine().driver_data<hitpoker_state>();
int count = 0;
int y,x;
@@ -93,7 +93,7 @@ static SCREEN_UPDATE(hitpoker)
gfx_bpp = (state->colorram[count] & 0x80)>>7; //flag between 4 and 8 bpp
color = gfx_bpp ? ((state->colorram[count] & 0x70)>>4) : (state->colorram[count] & 0xf);
- drawgfx_opaque(bitmap,cliprect,screen->machine->gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
+ drawgfx_opaque(bitmap,cliprect,screen->machine().gfx[gfx_bpp],tile,color,0,0,x*8,y*8);
count+=2;
}
@@ -104,8 +104,8 @@ static SCREEN_UPDATE(hitpoker)
static READ8_HANDLER( hitpoker_vram_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if(state->pic_data & 0x10)
return state->videoram[offset];
@@ -115,8 +115,8 @@ static READ8_HANDLER( hitpoker_vram_r )
static WRITE8_HANDLER( hitpoker_vram_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
-// UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+// UINT8 *ROM = space->machine().region("maincpu")->base();
// if(state->sys_regs[0x00] & 0x10)
state->videoram[offset] = data;
@@ -124,8 +124,8 @@ static WRITE8_HANDLER( hitpoker_vram_w )
static READ8_HANDLER( hitpoker_cram_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if(state->pic_data & 0x10)
return state->colorram[offset];
@@ -135,14 +135,14 @@ static READ8_HANDLER( hitpoker_cram_r )
static WRITE8_HANDLER( hitpoker_cram_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
state->colorram[offset] = data;
}
static READ8_HANDLER( hitpoker_paletteram_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
if(state->pic_data & 0x10)
return state->paletteram[offset];
@@ -152,7 +152,7 @@ static READ8_HANDLER( hitpoker_paletteram_r )
static WRITE8_HANDLER( hitpoker_paletteram_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
int r,g,b,datax;
state->paletteram[offset] = data;
offset>>=1;
@@ -163,7 +163,7 @@ static WRITE8_HANDLER( hitpoker_paletteram_w )
g = ((datax)&0x07e0)>>5;
r = ((datax)&0x001f)>>0;
- palette_set_color_rgb(space->machine, offset, pal5bit(r), pal6bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offset, pal5bit(r), pal6bit(g), pal5bit(b));
}
static READ8_HANDLER( rtc_r )
@@ -175,7 +175,7 @@ static READ8_HANDLER( rtc_r )
/* tests 0x180, what EEPROM is this one??? */
static WRITE8_HANDLER( eeprom_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
if(offset == 0)
{
state->eeprom_index = (state->eeprom_index & 0x100)|(data & 0xff);
@@ -191,7 +191,7 @@ static WRITE8_HANDLER( eeprom_w )
static READ8_HANDLER( eeprom_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
state->tmp = state->eeprom_data[state->eeprom_index];
if((state->eeprom_index & 0x1f) == 0x1f)
state->tmp = 0xaa;
@@ -203,7 +203,7 @@ static READ8_HANDLER( eeprom_r )
static READ8_HANDLER( hitpoker_pic_r )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
// logerror("R\n");
if(offset == 0)
@@ -222,7 +222,7 @@ static READ8_HANDLER( hitpoker_pic_r )
static WRITE8_HANDLER( hitpoker_pic_w )
{
- hitpoker_state *state = space->machine->driver_data<hitpoker_state>();
+ hitpoker_state *state = space->machine().driver_data<hitpoker_state>();
if(offset == 0)
state->pic_data = (data & 0xff);// | (data & 0x40) ? 0x80 : 0x00;
// logerror("%02x W\n",data);
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( hitpoker_pic_w )
#if 0
static READ8_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
#endif
@@ -514,7 +514,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT(hitpoker)
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x1220] = 0x01; //patch eeprom write?
ROM[0x1221] = 0x01;
diff --git a/src/mame/drivers/hnayayoi.c b/src/mame/drivers/hnayayoi.c
index fff94e6a0cf..ad5f4b024f7 100644
--- a/src/mame/drivers/hnayayoi.c
+++ b/src/mame/drivers/hnayayoi.c
@@ -42,7 +42,7 @@ TODO:
static READ8_HANDLER( keyboard_0_r )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
int res = 0x3f;
int i;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
@@ -50,7 +50,7 @@ static READ8_HANDLER( keyboard_0_r )
for (i = 0; i < 5; i++)
{
if (~state->keyb & (1 << i))
- res &= input_port_read(space->machine, keynames[i]);
+ res &= input_port_read(space->machine(), keynames[i]);
}
return res;
@@ -64,7 +64,7 @@ static READ8_HANDLER( keyboard_1_r )
static WRITE8_HANDLER( keyboard_w )
{
- hnayayoi_state *state = space->machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = space->machine().driver_data<hnayayoi_state>();
state->keyb = data;
}
@@ -503,7 +503,7 @@ INPUT_PORTS_END
static void irqhandler(device_t *device, int irq)
{
popmessage("irq");
-// cputag_set_input_line(device->machine, "maincpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
+// cputag_set_input_line(device->machine(), "maincpu", 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -530,7 +530,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( hnayayoi )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
state->save_item(NAME(state->palbank));
state->save_item(NAME(state->blit_layer));
@@ -541,10 +541,10 @@ static MACHINE_START( hnayayoi )
static MACHINE_RESET( hnayayoi )
{
- hnayayoi_state *state = machine->driver_data<hnayayoi_state>();
+ hnayayoi_state *state = machine.driver_data<hnayayoi_state>();
/* start with the MSM5205 reset */
- msm5205_reset_w(machine->device("msm"), 1);
+ msm5205_reset_w(machine.device("msm"), 1);
state->palbank = 0;
state->blit_layer = 0;
@@ -677,8 +677,8 @@ ROM_END
static DRIVER_INIT( hnfubuki )
{
- UINT8 *rom = machine->region("gfx1")->base();
- int len = machine->region("gfx1")->bytes();
+ UINT8 *rom = machine.region("gfx1")->base();
+ int len = machine.region("gfx1")->bytes();
int i, j;
/* interestingly, the blitter data has a slight encryption */
diff --git a/src/mame/drivers/hng64.c b/src/mame/drivers/hng64.c
index 7ef5640035a..c06ad119e40 100644
--- a/src/mame/drivers/hng64.c
+++ b/src/mame/drivers/hng64.c
@@ -459,13 +459,13 @@ WRITE32_HANDLER( trap_write )
static READ32_HANDLER( hng64_random_read )
{
- return space->machine->rand()&0xffffffff;
+ return space->machine().rand()&0xffffffff;
}
#endif
static READ32_HANDLER( hng64_com_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
logerror("com read (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(space->cpu), (offset*4)+0xc0000000, mem_mask, state->com_ram[offset]);
return state->com_ram[offset];
@@ -473,7 +473,7 @@ static READ32_HANDLER( hng64_com_r )
static WRITE32_HANDLER( hng64_com_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
logerror("com write (PC=%08x): %08x %08x = %08x\n", cpu_get_pc(space->cpu), (offset*4)+0xc0000000, mem_mask, data);
COMBINE_DATA(&state->com_ram[offset]);
@@ -481,7 +481,7 @@ static WRITE32_HANDLER( hng64_com_w )
static WRITE32_HANDLER( hng64_com_share_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
logerror("commw (PC=%08x): %08x %08x %08x\n", cpu_get_pc(space->cpu), data, (offset*4)+0xc0001000, mem_mask);
@@ -504,7 +504,7 @@ static READ32_HANDLER( hng64_com_share_r )
static WRITE32_HANDLER( hng64_pal_w )
{
- UINT32 *paletteram = space->machine->generic.paletteram.u32;
+ UINT32 *paletteram = space->machine().generic.paletteram.u32;
int r, g, b/*, a*/;
COMBINE_DATA(&paletteram[offset]);
@@ -513,15 +513,15 @@ static WRITE32_HANDLER( hng64_pal_w )
g = ((paletteram[offset] & 0x0000ff00) >>8);
r = ((paletteram[offset] & 0x00ff0000) >>16);
//a = ((paletteram[offset] & 0xff000000) >>24);
- palette_set_color(space->machine,offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),offset,MAKE_RGB(r,g,b));
}
static READ32_HANDLER( hng64_sysregs_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
system_time systime;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
#if 0
if((offset*4) != 0x1084)
@@ -530,7 +530,7 @@ static READ32_HANDLER( hng64_sysregs_r )
switch(offset*4)
{
- case 0x001c: return space->machine->rand(); // hng64 hangs on start-up if zero.
+ case 0x001c: return space->machine().rand(); // hng64 hangs on start-up if zero.
//case 0x106c:
//case 0x107c:
case 0x1084: return 0x00000002; //MCU->MIPS latch port
@@ -559,14 +559,14 @@ static READ32_HANDLER( hng64_sysregs_r )
// printf("%08x\n",offset*4);
-// return space->machine->rand()&0xffffffff;
+// return space->machine().rand()&0xffffffff;
return state->sysregs[offset];
}
/* preliminary dma code, dma is used to copy program code -> ram */
static void hng64_do_dma(address_space *space)
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("Performing DMA Start %08x Len %08x Dst %08x\n", state->dma_start, state->dma_len, state->dma_dst);
@@ -596,7 +596,7 @@ static void hng64_do_dma(address_space *space)
static WRITE32_HANDLER( hng64_sysregs_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
COMBINE_DATA (&state->sysregs[offset]);
@@ -632,13 +632,13 @@ static WRITE32_HANDLER( hng64_sysregs_w )
/* Fatal Fury Wild Ambition / Buriki One */
static READ32_HANDLER( fight_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
case 0x000: return 0x00000400;
- case 0x004: return input_port_read(space->machine, "SYSTEM");
- case 0x008: return input_port_read(space->machine, "P1_P2");
+ case 0x004: return input_port_read(space->machine(), "SYSTEM");
+ case 0x008: return input_port_read(space->machine(), "P1_P2");
case 0x600: return state->no_machine_error_code;
}
@@ -648,7 +648,7 @@ static READ32_HANDLER( fight_io_r )
/* Samurai Shodown 64 / Samurai Shodown 64 2 */
static READ32_HANDLER( samsho_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
@@ -667,8 +667,8 @@ static READ32_HANDLER( samsho_io_r )
else
return 0x000;
}
- case 0x004: return input_port_read(space->machine, "SYSTEM");
- case 0x008: return input_port_read(space->machine, "P1_P2");
+ case 0x004: return input_port_read(space->machine(), "SYSTEM");
+ case 0x008: return input_port_read(space->machine(), "P1_P2");
case 0x600: return state->no_machine_error_code;
}
@@ -679,7 +679,7 @@ static READ32_HANDLER( samsho_io_r )
/* FIXME: trigger input doesn't work? */
static READ32_HANDLER( shoot_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
@@ -696,26 +696,26 @@ static READ32_HANDLER( shoot_io_r )
case 0x010:
{
/* Quick kludge for use the input test items */
- if(input_port_read(space->machine, "D_IN") & 0x01000000)
- state->p1_trig = space->machine->rand() & 0x01000000;
+ if(input_port_read(space->machine(), "D_IN") & 0x01000000)
+ state->p1_trig = space->machine().rand() & 0x01000000;
- return (input_port_read(space->machine, "D_IN") & ~0x01000000) | (state->p1_trig);
+ return (input_port_read(space->machine(), "D_IN") & ~0x01000000) | (state->p1_trig);
}
case 0x018:
{
UINT8 p1_x, p1_y, p2_x, p2_y;
- p1_x = input_port_read(space->machine, "LIGHT_P1_X") & 0xff;
- p1_y = input_port_read(space->machine, "LIGHT_P1_Y") & 0xff;
- p2_x = input_port_read(space->machine, "LIGHT_P2_X") & 0xff;
- p2_y = input_port_read(space->machine, "LIGHT_P2_Y") & 0xff;
+ p1_x = input_port_read(space->machine(), "LIGHT_P1_X") & 0xff;
+ p1_y = input_port_read(space->machine(), "LIGHT_P1_Y") & 0xff;
+ p2_x = input_port_read(space->machine(), "LIGHT_P2_X") & 0xff;
+ p2_y = input_port_read(space->machine(), "LIGHT_P2_Y") & 0xff;
return p1_x<<24 | p1_y<<16 | p2_x<<8 | p2_y;
}
case 0x01c:
{
UINT8 p3_x, p3_y;
- p3_x = input_port_read(space->machine, "LIGHT_P3_X") & 0xff;
- p3_y = input_port_read(space->machine, "LIGHT_P3_Y") & 0xff;
+ p3_x = input_port_read(space->machine(), "LIGHT_P3_X") & 0xff;
+ p3_y = input_port_read(space->machine(), "LIGHT_P3_Y") & 0xff;
return p3_x<<24 | p3_y<<16 | p3_x<<8 | p3_y; //FIXME: see what's the right bank here when the trigger works
}
@@ -728,7 +728,7 @@ static READ32_HANDLER( shoot_io_r )
/* Roads Edge / Xtreme Rally */
static READ32_HANDLER( racing_io_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
switch (offset*4)
{
@@ -742,8 +742,8 @@ static READ32_HANDLER( racing_io_r )
else
return 0x000;
}
- case 0x004: return input_port_read(space->machine, "SYSTEM");
- case 0x008: return input_port_read(space->machine, "P1_P2");
+ case 0x004: return input_port_read(space->machine(), "SYSTEM");
+ case 0x008: return input_port_read(space->machine(), "P1_P2");
case 0x600: return state->no_machine_error_code;
}
@@ -752,7 +752,7 @@ static READ32_HANDLER( racing_io_r )
static READ32_HANDLER( hng64_dualport_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("dualport R %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu));
@@ -791,7 +791,7 @@ Beast Busters 2 outputs (all at offset == 0x1c):
static WRITE32_HANDLER( hng64_dualport_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("dualport WRITE %08x %08x (PC=%08x)\n", offset*4, hng64_dualport[offset], cpu_get_pc(space->cpu));
COMBINE_DATA (&state->dualport[offset]);
@@ -806,7 +806,7 @@ static WRITE32_HANDLER( hng64_dualport_w )
// <ElSemi> 30140000-3015ffff is ZBuffer A
static READ32_HANDLER( hng64_3d_1_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
return state->_3d_1[offset];
}
@@ -820,14 +820,14 @@ WRITE32_HANDLER( hng64_3d_1_w )
static READ32_HANDLER( hng64_3d_2_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
return state->_3d_2[offset];
}
static WRITE32_HANDLER( hng64_3d_2_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
COMBINE_DATA (&state->_3d_1[offset]);
COMBINE_DATA (&state->_3d_2[offset]);
@@ -836,7 +836,7 @@ static WRITE32_HANDLER( hng64_3d_2_w )
// The 3d 'display list'
static WRITE32_HANDLER( dl_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 *hng64_dl = state->dl;
int i;
UINT16 packet3d[16];
@@ -863,7 +863,7 @@ static WRITE32_HANDLER( dl_w )
}
// Send it off to the 3d subsystem.
- hng64_command3d(space->machine, packet3d);
+ hng64_command3d(space->machine(), packet3d);
}
}
@@ -904,7 +904,7 @@ WRITE32_HANDLER( activate_3d_buffer )
// Transition Control memory.
static WRITE32_HANDLER( tcram_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 *hng64_tcram = state->tcram;
COMBINE_DATA (&hng64_tcram[offset]);
@@ -912,7 +912,7 @@ static WRITE32_HANDLER( tcram_w )
if(offset == 0x02)
{
UINT16 min_x, min_y, max_x, max_y;
- rectangle visarea = space->machine->primary_screen->visible_area();
+ rectangle visarea = space->machine().primary_screen->visible_area();
min_x = (hng64_tcram[1] & 0xffff0000) >> 16;
min_y = (hng64_tcram[1] & 0x0000ffff) >> 0;
@@ -931,17 +931,17 @@ static WRITE32_HANDLER( tcram_w )
visarea.max_x = min_x + max_x - 1;
visarea.min_y = min_y;
visarea.max_y = min_y + max_y - 1;
- space->machine->primary_screen->configure(0x200, 0x1c0, visarea, space->machine->primary_screen->frame_period().attoseconds );
+ space->machine().primary_screen->configure(0x200, 0x1c0, visarea, space->machine().primary_screen->frame_period().attoseconds );
}
}
static READ32_HANDLER( tcram_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
//printf("Q1 R : %.8x %.8x\n", offset, hng64_tcram[offset]);
if(offset == 0x12)
- return input_port_read(space->machine, "VBLANK");
+ return input_port_read(space->machine(), "VBLANK");
return state->tcram[offset];
}
@@ -950,7 +950,7 @@ static READ32_HANDLER( tcram_r )
unknown purpose (vblank? related to the display list?). */
static READ32_HANDLER( unk_vreg_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
return ++state->unk_vreg_toggle;
}
@@ -958,7 +958,7 @@ static READ32_HANDLER( unk_vreg_r )
static WRITE32_HANDLER( hng64_soundram_w )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 mem_mask32 = mem_mask;
UINT32 data32 = data;
@@ -978,7 +978,7 @@ static WRITE32_HANDLER( hng64_soundram_w )
static READ32_HANDLER( hng64_soundram_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT16 datalo = state->soundram[offset * 2 + 0];
UINT16 datahi = state->soundram[offset * 2 + 1];
@@ -1186,7 +1186,7 @@ static void KL5C80_init(hng64_state *state)
static READ8_HANDLER( hng64_comm_memory_r )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
UINT32 physical_address = KL5C80_translate_address(state, offset);
logerror("READING 0x%02x from 0x%04x (0x%05x)\n", state->com_virtual_mem[physical_address], offset, physical_address);
@@ -1210,7 +1210,7 @@ static WRITE8_HANDLER( hng64_comm_memory_w )
/* KL5C80 I/O handlers */
static WRITE8_HANDLER( hng64_comm_io_mmu )
{
- hng64_state *state = space->machine->driver_data<hng64_state>();
+ hng64_state *state = space->machine().driver_data<hng64_state>();
state->com_mmu_mem[offset] = data;
@@ -1517,7 +1517,7 @@ static GFXDECODE_START( hng64 )
GFXDECODE_ENTRY( "textures", 0, hng64_texlayout, 0x0, 0x10 ) /* textures */
GFXDECODE_END
-static void hng64_reorder(running_machine *machine, UINT8* gfxregion, size_t gfxregionsize)
+static void hng64_reorder(running_machine &machine, UINT8* gfxregion, size_t gfxregionsize)
{
// by default 2 4bpp tiles are stored in each 8bpp tile, this makes decoding in MAME harder than it needs to be
// reorder them
@@ -1540,14 +1540,14 @@ static void hng64_reorder(running_machine *machine, UINT8* gfxregion, size_t gfx
static DRIVER_INIT( hng64_reorder_gfx )
{
- hng64_reorder(machine, machine->region("scrtile")->base(), machine->region("scrtile")->bytes());
+ hng64_reorder(machine, machine.region("scrtile")->base(), machine.region("scrtile")->bytes());
}
#define HACK_REGION
#ifdef HACK_REGION
-static void hng64_patch_bios_region(running_machine* machine, int region)
+static void hng64_patch_bios_region(running_machine& machine, int region)
{
- UINT8 *rom = machine->region("user1")->base();
+ UINT8 *rom = machine.region("user1")->base();
if ((rom[0x4000]==0xff) && (rom[0x4001] == 0xff))
{
@@ -1561,7 +1561,7 @@ static void hng64_patch_bios_region(running_machine* machine, int region)
static DRIVER_INIT( hng64 )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
// region hacking, english error messages are more useful to us, but no english bios is dumped...
#ifdef HACK_REGION
@@ -1583,7 +1583,7 @@ static DRIVER_INIT( hng64 )
static DRIVER_INIT(hng64_fght)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
state->no_machine_error_code = 0x01000000;
DRIVER_INIT_CALL(hng64);
@@ -1591,16 +1591,16 @@ static DRIVER_INIT(hng64_fght)
static DRIVER_INIT( fatfurwa )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
- /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(machine->region("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
+ /* FILE* fp = fopen("/tmp/test.bin", "wb"); fwrite(machine.region("verts")->base(), 1, 0x0c00000*2, fp); fclose(fp); */
DRIVER_INIT_CALL(hng64_fght);
state->mcu_type = FIGHT_MCU;
}
static DRIVER_INIT( ss64 )
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
DRIVER_INIT_CALL(hng64_fght);
state->mcu_type = SAMSHO_MCU;
@@ -1608,7 +1608,7 @@ static DRIVER_INIT( ss64 )
static DRIVER_INIT(hng64_race)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
state->no_machine_error_code = 0x02000000;
state->mcu_type = RACING_MCU;
@@ -1617,7 +1617,7 @@ static DRIVER_INIT(hng64_race)
static DRIVER_INIT(hng64_shoot)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
state->mcu_type = SHOOT_MCU;
state->no_machine_error_code = 0x03000000;
@@ -1639,7 +1639,7 @@ static TIMER_CALLBACK( irq_stop )
static INTERRUPT_GEN( irq_start )
{
- hng64_state *state = device->machine->driver_data<hng64_state>();
+ hng64_state *state = device->machine().driver_data<hng64_state>();
logerror("HNG64 interrupt level %x\n", cpu_getiloops(device));
@@ -1661,29 +1661,29 @@ static INTERRUPT_GEN( irq_start )
}
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq_stop));
}
static MACHINE_START(hyperneo)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
/* set the fastest DRC options */
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS + MIPS3DRC_STRICT_VERIFY);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x00ffffff, FALSE, state->mainram);
- mips3drc_add_fastram(machine->device("maincpu"), 0x04000000, 0x05ffffff, TRUE, state->cart);
- mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x00ffffff, FALSE, state->mainram);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x04000000, 0x05ffffff, TRUE, state->cart);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
}
static MACHINE_RESET(hyperneo)
{
- hng64_state *state = machine->driver_data<hng64_state>();
+ hng64_state *state = machine.driver_data<hng64_state>();
int i;
- const UINT8 *rom = machine->region("user2")->base();
+ const UINT8 *rom = machine.region("user2")->base();
/* Sound CPU */
UINT8 *RAM = (UINT8*)state->soundram;
@@ -1701,8 +1701,8 @@ static MACHINE_RESET(hyperneo)
KL5C80_virtual_mem_sync(state);
- address_space *space = machine->device<z80_device>("comm")->space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate_create_static(KL5C80_direct_handler, *machine));
+ address_space *space = machine.device<z80_device>("comm")->space(AS_PROGRAM);
+ space->set_direct_update_handler(direct_update_delegate_create_static(KL5C80_direct_handler, machine));
cputag_set_input_line(machine, "comm", INPUT_LINE_RESET, PULSE_LINE); // reset the CPU and let 'er rip
// cputag_set_input_line(machine, "comm", INPUT_LINE_HALT, ASSERT_LINE); // hold on there pardner...
diff --git a/src/mame/drivers/homedata.c b/src/mame/drivers/homedata.c
index 7e3ebcd877e..1e1a6a56f88 100644
--- a/src/mame/drivers/homedata.c
+++ b/src/mame/drivers/homedata.c
@@ -226,7 +226,7 @@ Custom: GX61A01
static INTERRUPT_GEN( homedata_irq )
{
- homedata_state *state = device->machine->driver_data<homedata_state>();
+ homedata_state *state = device->machine().driver_data<homedata_state>();
state->vblank = 1;
device_set_input_line(device, M6809_FIRQ_LINE, HOLD_LINE);
}
@@ -247,7 +247,7 @@ static INTERRUPT_GEN( upd7807_irq )
static READ8_HANDLER( mrokumei_keyboard_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
int res = 0x3f,i;
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4" };
@@ -258,7 +258,7 @@ static READ8_HANDLER( mrokumei_keyboard_r )
{
if (state->keyb & (1 << i))
{
- res = input_port_read(space->machine, keynames[i]) & 0x3f;
+ res = input_port_read(space->machine(), keynames[i]) & 0x3f;
break;
}
}
@@ -283,23 +283,23 @@ static READ8_HANDLER( mrokumei_keyboard_r )
static WRITE8_HANDLER( mrokumei_keyboard_select_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->keyb = data;
}
static READ8_HANDLER( mrokumei_sound_io_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
if (state->sndbank & 4)
return(soundlatch_r(space, 0));
else
- return space->machine->region("audiocpu")->base()[0x10000 + offset + (state->sndbank & 1) * 0x10000];
+ return space->machine().region("audiocpu")->base()[0x10000 + offset + (state->sndbank & 1) * 0x10000];
}
static WRITE8_HANDLER( mrokumei_sound_bank_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* bit 0 = ROM bank
bit 2 = ROM or soundlatch
*/
@@ -308,7 +308,7 @@ static WRITE8_HANDLER( mrokumei_sound_bank_w )
static WRITE8_HANDLER( mrokumei_sound_io_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
switch (offset & 0xff)
{
case 0x40:
@@ -322,7 +322,7 @@ static WRITE8_HANDLER( mrokumei_sound_io_w )
static WRITE8_HANDLER( mrokumei_sound_cmd_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -338,19 +338,19 @@ static WRITE8_HANDLER( mrokumei_sound_cmd_w )
static READ8_HANDLER( reikaids_upd7807_porta_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
return state->upd7807_porta;
}
static WRITE8_HANDLER( reikaids_upd7807_porta_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->upd7807_porta = data;
}
static WRITE8_HANDLER( reikaids_upd7807_portc_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* port C layout:
7 coin counter
@@ -364,9 +364,9 @@ static WRITE8_HANDLER( reikaids_upd7807_portc_w )
*/
// logerror("%04x: port C wr %02x (STATUS %d DATA %d)\n", cpu_get_pc(space->cpu), data, BIT(data, 2), BIT(data, 6));
- memory_set_bank(space->machine, "bank2", data & 0x03);
+ memory_set_bank(space->machine(), "bank2", data & 0x03);
- coin_counter_w(space->machine, 0, ~data & 0x80);
+ coin_counter_w(space->machine(), 0, ~data & 0x80);
if (BIT(state->upd7807_portc, 5) && !BIT(data, 5)) /* write clock 1->0 */
ym2203_w(state->ym, BIT(data, 3), state->upd7807_porta);
@@ -379,8 +379,8 @@ static WRITE8_HANDLER( reikaids_upd7807_portc_w )
static READ8_HANDLER( reikaids_io_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
- int res = input_port_read(space->machine, "IN2"); // bit 4 = coin, bit 5 = service
+ homedata_state *state = space->machine().driver_data<homedata_state>();
+ int res = input_port_read(space->machine(), "IN2"); // bit 4 = coin, bit 5 = service
res |= BIT(state->upd7807_portc, 2) * 0x01; // bit 0 = upd7807 status
res |= BIT(state->upd7807_portc, 6) * 0x02; // bit 1 = upd7807 data
@@ -397,14 +397,14 @@ static READ8_HANDLER( reikaids_io_r )
static READ8_HANDLER( reikaids_snd_command_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: sndmcd_r (%02x)\n", cpu_get_pc(space->cpu), state->snd_command);
return state->snd_command;
}
static WRITE8_HANDLER( reikaids_snd_command_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->snd_command = data;
//logerror("%04x: coprocessor_command_w %02x\n", cpu_get_pc(space->cpu), data);
}
@@ -420,21 +420,21 @@ static WRITE8_HANDLER( reikaids_snd_command_w )
static WRITE8_HANDLER( pteacher_snd_command_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: snd_command_w %02x\n", cpu_get_pc(space->cpu), data);
state->from_cpu = data;
}
static READ8_HANDLER( pteacher_snd_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
//logerror("%04x: pteacher_snd_r %02x\n",cpu_get_pc(space->cpu),to_cpu);
return state->to_cpu;
}
static READ8_HANDLER( pteacher_io_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* bit 6: !vblank
* bit 7: visible page
* other bits seem unused
@@ -452,9 +452,9 @@ static READ8_HANDLER( pteacher_io_r )
static READ8_HANDLER( pteacher_keyboard_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", "KEY5" };
- int dips = input_port_read(space->machine, "DSW");
+ int dips = input_port_read(space->machine(), "DSW");
// logerror("%04x: keyboard_r with port A = %02x\n",cpu_get_pc(space->cpu),upd7807_porta);
@@ -462,7 +462,7 @@ static READ8_HANDLER( pteacher_keyboard_r )
{
/* player 1 + dip switches */
int row = (state->upd7807_porta & 0x07);
- return input_port_read(space->machine, keynames[row]) | (((dips >> row) & 1) << 5); // 0-5
+ return input_port_read(space->machine(), keynames[row]) | (((dips >> row) & 1) << 5); // 0-5
}
if (state->upd7807_porta & 0x08)
{
@@ -476,7 +476,7 @@ static READ8_HANDLER( pteacher_keyboard_r )
static READ8_HANDLER( pteacher_upd7807_porta_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
if (!BIT(state->upd7807_portc, 6))
state->upd7807_porta = state->from_cpu;
else
@@ -487,20 +487,20 @@ static READ8_HANDLER( pteacher_upd7807_porta_r )
static WRITE8_HANDLER( pteacher_snd_answer_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->to_cpu = data;
//logerror("%04x: to_cpu = %02x\n", cpu_get_pc(space->cpu), state->to_cpu);
}
static WRITE8_HANDLER( pteacher_upd7807_porta_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->upd7807_porta = data;
}
static WRITE8_HANDLER( pteacher_upd7807_portc_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
/* port C layout:
7 coin counter
6 enable message from main CPU on port A
@@ -514,9 +514,9 @@ static WRITE8_HANDLER( pteacher_upd7807_portc_w )
// logerror("%04x: port C wr %02x\n", cpu_get_pc(space->cpu), data);
- memory_set_bank(space->machine, "bank2", (data & 0x0c) >> 2);
+ memory_set_bank(space->machine(), "bank2", (data & 0x0c) >> 2);
- coin_counter_w(space->machine, 0, ~data & 0x80);
+ coin_counter_w(space->machine(), 0, ~data & 0x80);
if (BIT(state->upd7807_portc, 5) && !BIT(data, 5)) /* clock 1->0 */
sn76496_w(state->sn, 0, state->upd7807_porta);
@@ -529,13 +529,13 @@ static WRITE8_HANDLER( pteacher_upd7807_portc_w )
static WRITE8_HANDLER( bankswitch_w )
{
- int last_bank = (space->machine->region("maincpu")->bytes() - 0x10000) / 0x4000;
+ int last_bank = (space->machine().region("maincpu")->bytes() - 0x10000) / 0x4000;
/* last bank is fixed and is #0 for us, other banks start from #1 (hence data+1 below)*/
if (data < last_bank)
- memory_set_bank(space->machine, "bank1", data + 1);
+ memory_set_bank(space->machine(), "bank1", data + 1);
else
- memory_set_bank(space->machine, "bank1", 0);
+ memory_set_bank(space->machine(), "bank1", 0);
}
@@ -1147,13 +1147,13 @@ GFXDECODE_END
static MACHINE_START( homedata )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->ym = machine->device("ymsnd");
- state->sn = machine->device("snsnd");
- state->dac = machine->device("dac");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->ym = machine.device("ymsnd");
+ state->sn = machine.device("snsnd");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->visible_page));
state->save_item(NAME(state->flipscreen));
@@ -1168,11 +1168,11 @@ static MACHINE_START( homedata )
static MACHINE_START( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ homedata_state *state = machine.driver_data<homedata_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0xc000], 0x4000);
- memory_configure_bank(machine, "bank2", 0, 4, machine->region("audiocpu")->base(), 0x10000);
+ memory_configure_bank(machine, "bank2", 0, 4, machine.region("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
@@ -1185,11 +1185,11 @@ static MACHINE_START( reikaids )
static MACHINE_START( pteacher )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ homedata_state *state = machine.driver_data<homedata_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0xc000], 0x4000);
- memory_configure_bank(machine, "bank2", 0, 4, machine->region("audiocpu")->base(), 0x10000);
+ memory_configure_bank(machine, "bank2", 0, 4, machine.region("audiocpu")->base(), 0x10000);
MACHINE_START_CALL(homedata);
@@ -1203,7 +1203,7 @@ static MACHINE_START( pteacher )
static MACHINE_RESET( homedata )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->visible_page = 0;
state->flipscreen = 0;
@@ -1221,8 +1221,8 @@ static MACHINE_RESET( homedata )
static MACHINE_RESET( pteacher )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ homedata_state *state = machine.driver_data<homedata_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* on reset, ports are set as input (high impedance), therefore 0xff output */
pteacher_upd7807_portc_w(space, 0, 0xff);
@@ -1238,8 +1238,8 @@ static MACHINE_RESET( pteacher )
static MACHINE_RESET( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ homedata_state *state = machine.driver_data<homedata_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
/* on reset, ports are set as input (high impedance), therefore 0xff output */
reikaids_upd7807_portc_w(space, 0, 0xff);
@@ -1449,14 +1449,14 @@ ADDRESS_MAP_END
static READ8_HANDLER( mirderby_prot_r )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->prot_data&=0x7f;
return state->prot_data++;
}
static WRITE8_HANDLER( mirderby_prot_w )
{
- homedata_state *state = space->machine->driver_data<homedata_state>();
+ homedata_state *state = space->machine().driver_data<homedata_state>();
state->prot_data = data;
}
@@ -2032,26 +2032,26 @@ static DRIVER_INIT( jogakuen )
/* it seems that Mahjong Jogakuen runs on the same board as the others,
but with just these two addresses swapped. Instead of creating a new
MachineDriver, I just fix them here. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8007, 0x8007, FUNC(pteacher_blitter_bank_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8005, 0x8005, FUNC(pteacher_gfx_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8007, 0x8007, FUNC(pteacher_blitter_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x8005, 0x8005, FUNC(pteacher_gfx_bank_w));
}
static DRIVER_INIT( mjikaga )
{
/* Mahjong Ikagadesuka is different as well. */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7802, 0x7802, FUNC(pteacher_snd_r));
- machine->device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0123, 0x0123, FUNC(pteacher_snd_answer_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7802, 0x7802, FUNC(pteacher_snd_r));
+ machine.device("audiocpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0123, 0x0123, FUNC(pteacher_snd_answer_w));
}
static DRIVER_INIT( reikaids )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->priority = 0;
}
static DRIVER_INIT( battlcry )
{
- homedata_state *state = machine->driver_data<homedata_state>();
+ homedata_state *state = machine.driver_data<homedata_state>();
state->priority = 1; /* priority and initial value for bank write */
}
diff --git a/src/mame/drivers/homerun.c b/src/mame/drivers/homerun.c
index 665d849ef2d..7a60f856de9 100644
--- a/src/mame/drivers/homerun.c
+++ b/src/mame/drivers/homerun.c
@@ -24,19 +24,19 @@ Todo :
static WRITE8_DEVICE_HANDLER(pa_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
+ homerun_state *state = device->machine().driver_data<homerun_state>();
state->xpa = data;
}
static WRITE8_DEVICE_HANDLER(pb_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
+ homerun_state *state = device->machine().driver_data<homerun_state>();
state->xpb = data;
}
static WRITE8_DEVICE_HANDLER(pc_w)
{
- homerun_state *state = device->machine->driver_data<homerun_state>();
+ homerun_state *state = device->machine().driver_data<homerun_state>();
state->xpc = data;
}
@@ -64,7 +64,7 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( homerun_40_r )
{
- UINT8 ret = (field->port->machine->primary_screen->vpos() > 116) ? 1 : 0;
+ UINT8 ret = (field->port->machine().primary_screen->vpos() > 116) ? 1 : 0;
return ret;
}
@@ -192,8 +192,8 @@ GFXDECODE_END
static MACHINE_START( homerun )
{
- homerun_state *state = machine->driver_data<homerun_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ homerun_state *state = machine.driver_data<homerun_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x00000], 0x4000);
memory_configure_bank(machine, "bank1", 1, 7, &ROM[0x10000], 0x4000);
@@ -208,7 +208,7 @@ static MACHINE_START( homerun )
static MACHINE_RESET( homerun )
{
- homerun_state *state = machine->driver_data<homerun_state>();
+ homerun_state *state = machine.driver_data<homerun_state>();
state->gfx_ctrl = 0;
state->gc_up = 0;
diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c
index 523fbf1372d..7c53b534026 100644
--- a/src/mame/drivers/hornet.c
+++ b/src/mame/drivers/hornet.c
@@ -346,56 +346,56 @@ public:
static READ32_HANDLER( hornet_k037122_sram_r )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
return k037122_sram_r(k037122, offset, mem_mask);
}
static WRITE32_HANDLER( hornet_k037122_sram_w )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
k037122_sram_w(k037122, offset, data, mem_mask);
}
static READ32_HANDLER( hornet_k037122_char_r )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
return k037122_char_r(k037122, offset, mem_mask);
}
static WRITE32_HANDLER( hornet_k037122_char_w )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
k037122_char_w(k037122, offset, data, mem_mask);
}
static READ32_HANDLER( hornet_k037122_reg_r )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
return k037122_reg_r(k037122, offset, mem_mask);
}
static WRITE32_HANDLER( hornet_k037122_reg_w )
{
- device_t *k037122 = space->machine->device(get_cgboard_id() ? "k037122_2" : "k037122_1");
+ device_t *k037122 = space->machine().device(get_cgboard_id() ? "k037122_2" : "k037122_1");
k037122_reg_w(k037122, offset, data, mem_mask);
}
static void voodoo_vblank_0(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ0, ASSERT_LINE);
}
static void voodoo_vblank_1(device_t *device, int param)
{
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_IRQ1, ASSERT_LINE);
}
static SCREEN_UPDATE( hornet )
{
- hornet_state *state = screen->machine->driver_data<hornet_state>();
- device_t *voodoo = screen->machine->device("voodoo0");
- device_t *k037122 = screen->machine->device("k037122_1");
+ hornet_state *state = screen->machine().driver_data<hornet_state>();
+ device_t *voodoo = screen->machine().device("voodoo0");
+ device_t *k037122 = screen->machine().device("k037122_1");
voodoo_update(voodoo, bitmap, cliprect);
@@ -408,11 +408,11 @@ static SCREEN_UPDATE( hornet )
static SCREEN_UPDATE( hornet_2board )
{
- hornet_state *state = screen->machine->driver_data<hornet_state>();
+ hornet_state *state = screen->machine().driver_data<hornet_state>();
if (strcmp(screen->tag(), "lscreen") == 0)
{
- device_t *k037122 = screen->machine->device("k037122_1");
- device_t *voodoo = screen->machine->device("voodoo0");
+ device_t *k037122 = screen->machine().device("k037122_1");
+ device_t *voodoo = screen->machine().device("voodoo0");
voodoo_update(voodoo, bitmap, cliprect);
/* TODO: tilemaps per screen */
@@ -420,8 +420,8 @@ static SCREEN_UPDATE( hornet_2board )
}
else if (strcmp(screen->tag(), "rscreen") == 0)
{
- device_t *k037122 = screen->machine->device("k037122_2");
- device_t *voodoo = screen->machine->device("voodoo1");
+ device_t *k037122 = screen->machine().device("k037122_2");
+ device_t *voodoo = screen->machine().device("voodoo1");
voodoo_update(voodoo, bitmap, cliprect);
/* TODO: tilemaps per screen */
@@ -439,15 +439,15 @@ static READ8_HANDLER( sysreg_r )
{
UINT8 r = 0;
static const char *const portnames[] = { "IN0", "IN1", "IN2" };
- device_t *adc12138 = space->machine->device("adc12138");
- device_t *eeprom = space->machine->device("eeprom");
+ device_t *adc12138 = space->machine().device("adc12138");
+ device_t *eeprom = space->machine().device("eeprom");
switch (offset)
{
case 0: /* I/O port 0 */
case 1: /* I/O port 1 */
case 2: /* I/O port 2 */
- r = input_port_read(space->machine, portnames[offset]);
+ r = input_port_read(space->machine(), portnames[offset]);
break;
case 3: /* I/O port 3 */
@@ -465,7 +465,7 @@ static READ8_HANDLER( sysreg_r )
break;
case 4: /* I/O port 4 - DIP switches */
- r = input_port_read(space->machine, "DSW");
+ r = input_port_read(space->machine(), "DSW");
break;
}
return r;
@@ -473,8 +473,8 @@ static READ8_HANDLER( sysreg_r )
static WRITE8_HANDLER( sysreg_w )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
- device_t *adc12138 = space->machine->device("adc12138");
+ hornet_state *state = space->machine().driver_data<hornet_state>();
+ device_t *adc12138 = space->machine().device("adc12138");
switch (offset)
{
@@ -501,7 +501,7 @@ static WRITE8_HANDLER( sysreg_w )
0x02 = LAMP1
0x01 = LAMP0
*/
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
mame_printf_debug("System register 0 = %02X\n", data);
break;
@@ -521,7 +521,7 @@ static WRITE8_HANDLER( sysreg_w )
adc1213x_di_w(adc12138, 0, (data >> 1) & 0x1);
adc1213x_sclk_w(adc12138, 0, data & 0x1);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_RESET, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
mame_printf_debug("System register 1 = %02X\n", data);
break;
@@ -544,7 +544,7 @@ static WRITE8_HANDLER( sysreg_w )
0x80 = WDTCLK
*/
if (data & 0x80)
- watchdog_reset(space->machine);
+ watchdog_reset(space->machine());
break;
case 7: /* CG Control Register */
@@ -556,9 +556,9 @@ static WRITE8_HANDLER( sysreg_w )
0x01 = EXRGB
*/
if (data & 0x80)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ1, CLEAR_LINE);
if (data & 0x40)
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_IRQ0, CLEAR_LINE);
set_cgboard_id((data >> 4) & 3);
break;
}
@@ -574,9 +574,9 @@ static WRITE32_HANDLER( comm1_w )
static WRITE32_HANDLER( comm_rombank_w )
{
int bank = data >> 24;
- UINT8 *usr3 = space->machine->region("user3")->base();
+ UINT8 *usr3 = space->machine().region("user3")->base();
if (usr3 != NULL)
- memory_set_bank(space->machine, "bank1", bank & 0x7f);
+ memory_set_bank(space->machine(), "bank1", bank & 0x7f);
}
static READ32_HANDLER( comm0_unk_r )
@@ -588,17 +588,17 @@ static READ32_HANDLER( comm0_unk_r )
static READ32_HANDLER(gun_r)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
return state->gn680_ret0<<16 | state->gn680_ret1;
}
static WRITE32_HANDLER(gun_w)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
if (mem_mask == 0xffff0000)
{
state->gn680_latch = data>>16;
- cputag_set_input_line(space->machine, "gn680", M68K_IRQ_6, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "gn680", M68K_IRQ_6, HOLD_LINE);
}
}
@@ -649,15 +649,15 @@ static WRITE16_HANDLER(gn680_sysctrl)
static READ16_HANDLER(gn680_latch_r)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
- cputag_set_input_line(space->machine, "gn680", M68K_IRQ_6, CLEAR_LINE);
+ hornet_state *state = space->machine().driver_data<hornet_state>();
+ cputag_set_input_line(space->machine(), "gn680", M68K_IRQ_6, CLEAR_LINE);
return state->gn680_latch;
}
static WRITE16_HANDLER(gn680_latch_w)
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
if (offset)
{
state->gn680_ret1 = data;
@@ -684,25 +684,25 @@ ADDRESS_MAP_END
static READ32_HANDLER( dsp_dataram0_r )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
return state->sharc_dataram[0][offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram0_w )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
state->sharc_dataram[0][offset] = data;
}
static READ32_HANDLER( dsp_dataram1_r )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
return state->sharc_dataram[1][offset] & 0xffff;
}
static WRITE32_HANDLER( dsp_dataram1_w )
{
- hornet_state *state = space->machine->driver_data<hornet_state>();
+ hornet_state *state = space->machine().driver_data<hornet_state>();
state->sharc_dataram[1][offset] = data;
}
@@ -858,31 +858,31 @@ static TIMER_CALLBACK( irq_off );
static MACHINE_START( hornet )
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
state->jvs_sdata_ptr = 0;
state->jvs_sdata = auto_alloc_array_clear(machine, UINT8, 1024);
/* set conservative DRC options */
- ppcdrc_set_options(machine->device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
+ ppcdrc_set_options(machine.device("maincpu"), PPCDRC_COMPATIBLE_OPTIONS);
/* configure fast RAM regions for DRC */
- ppcdrc_add_fastram(machine->device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->workram);
+ ppcdrc_add_fastram(machine.device("maincpu"), 0x00000000, 0x003fffff, FALSE, state->workram);
state_save_register_global(machine, state->led_reg0);
state_save_register_global(machine, state->led_reg1);
state_save_register_global_pointer(machine, state->jvs_sdata, 1024);
state_save_register_global(machine, state->jvs_sdata_ptr);
- state->sound_irq_timer = machine->scheduler().timer_alloc(FUNC(irq_off));
+ state->sound_irq_timer = machine.scheduler().timer_alloc(FUNC(irq_off));
}
static MACHINE_RESET( hornet )
{
- UINT8 *usr3 = machine->region("user3")->base();
- UINT8 *usr5 = machine->region("user5")->base();
+ UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr5 = machine.region("user5")->base();
if (usr3 != NULL)
{
- memory_configure_bank(machine, "bank1", 0, machine->region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ memory_configure_bank(machine, "bank1", 0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
memory_set_bank(machine, "bank1", 0);
}
@@ -906,9 +906,9 @@ static TIMER_CALLBACK( irq_off )
cputag_set_input_line(machine, "audiocpu", param, CLEAR_LINE);
}
-static void sound_irq_callback( running_machine *machine, int irq )
+static void sound_irq_callback( running_machine &machine, int irq )
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
int line = (irq == 0) ? INPUT_LINE_IRQ1 : INPUT_LINE_IRQ2;
cputag_set_input_line(machine, "audiocpu", line, ASSERT_LINE);
@@ -1000,12 +1000,12 @@ MACHINE_CONFIG_END
static MACHINE_RESET( hornet_2board )
{
- UINT8 *usr3 = machine->region("user3")->base();
- UINT8 *usr5 = machine->region("user5")->base();
+ UINT8 *usr3 = machine.region("user3")->base();
+ UINT8 *usr5 = machine.region("user5")->base();
if (usr3 != NULL)
{
- memory_configure_bank(machine, "bank1", 0, machine->region("user3")->bytes() / 0x40000, usr3, 0x40000);
+ memory_configure_bank(machine, "bank1", 0, machine.region("user3")->bytes() / 0x40000, usr3, 0x40000);
memory_set_bank(machine, "bank1", 0);
}
cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE);
@@ -1085,21 +1085,21 @@ MACHINE_CONFIG_END
/*****************************************************************************/
-static void jamma_jvs_cmd_exec(running_machine *machine);
+static void jamma_jvs_cmd_exec(running_machine &machine);
static void jamma_jvs_w(device_t *device, UINT8 data)
{
- hornet_state *state = device->machine->driver_data<hornet_state>();
+ hornet_state *state = device->machine().driver_data<hornet_state>();
if (state->jvs_sdata_ptr == 0 && data != 0xe0)
return;
state->jvs_sdata[state->jvs_sdata_ptr] = data;
state->jvs_sdata_ptr++;
if (state->jvs_sdata_ptr >= 3 && state->jvs_sdata_ptr >= 3 + state->jvs_sdata[2])
- jamma_jvs_cmd_exec(device->machine);
+ jamma_jvs_cmd_exec(device->machine());
}
-static int jvs_encode_data(running_machine *machine, UINT8 *in, int length)
+static int jvs_encode_data(running_machine &machine, UINT8 *in, int length)
{
int inptr = 0;
int sum = 0;
@@ -1110,19 +1110,19 @@ static int jvs_encode_data(running_machine *machine, UINT8 *in, int length)
if (b == 0xe0)
{
sum += 0xd0 + 0xdf;
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xdf);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xd0);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xdf);
}
else if (b == 0xd0)
{
sum += 0xd0 + 0xcf;
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xd0);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xcf);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xd0);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xcf);
}
else
{
sum += b;
- ppc4xx_spu_receive_byte(machine->device("maincpu"), b);
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), b);
}
}
return sum;
@@ -1150,9 +1150,9 @@ static int jvs_decode_data(UINT8 *in, UINT8 *out, int length)
return outptr;
}
-static void jamma_jvs_cmd_exec(running_machine *machine)
+static void jamma_jvs_cmd_exec(running_machine &machine)
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
UINT8 sync, node, byte_num;
UINT8 data[1024], rdata[1024];
#if 0
@@ -1216,11 +1216,11 @@ static void jamma_jvs_cmd_exec(running_machine *machine)
// write jvs return data
sum = 0x00 + (rdata_ptr+1);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0xe0); // sync
- ppc4xx_spu_receive_byte(machine->device("maincpu"), 0x00); // node
- ppc4xx_spu_receive_byte(machine->device("maincpu"), rdata_ptr + 1); // num of bytes
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0xe0); // sync
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), 0x00); // node
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), rdata_ptr + 1); // num of bytes
sum += jvs_encode_data(machine, rdata, rdata_ptr);
- ppc4xx_spu_receive_byte(machine->device("maincpu"), sum - 1); // checksum
+ ppc4xx_spu_receive_byte(machine.device("maincpu"), sum - 1); // checksum
state->jvs_sdata_ptr = 0;
}
@@ -1230,25 +1230,25 @@ static void jamma_jvs_cmd_exec(running_machine *machine)
static DRIVER_INIT(hornet)
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 1, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
state->led_reg0 = state->led_reg1 = 0x7f;
- ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w);
+ ppc4xx_spu_set_tx_handler(machine.device("maincpu"), jamma_jvs_w);
}
static DRIVER_INIT(hornet_2board)
{
- hornet_state *state = machine->driver_data<hornet_state>();
+ hornet_state *state = machine.driver_data<hornet_state>();
init_konami_cgboard(machine, 2, CGBOARD_TYPE_HORNET);
- set_cgboard_texture_bank(machine, 0, "bank5", machine->region("user5")->base());
- set_cgboard_texture_bank(machine, 1, "bank6", machine->region("user5")->base());
+ set_cgboard_texture_bank(machine, 0, "bank5", machine.region("user5")->base());
+ set_cgboard_texture_bank(machine, 1, "bank6", machine.region("user5")->base());
state->led_reg0 = state->led_reg1 = 0x7f;
- ppc4xx_spu_set_tx_handler(machine->device("maincpu"), jamma_jvs_w);
+ ppc4xx_spu_set_tx_handler(machine.device("maincpu"), jamma_jvs_w);
}
/*****************************************************************************/
diff --git a/src/mame/drivers/hotblock.c b/src/mame/drivers/hotblock.c
index 08cdcc3e60b..117631ccaf3 100644
--- a/src/mame/drivers/hotblock.c
+++ b/src/mame/drivers/hotblock.c
@@ -66,7 +66,7 @@ public:
static READ8_HANDLER( hotblock_video_read )
{
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
/* right?, anything else?? */
if (state->port0 & 0x20) // port 0 = a8 e8 -- palette
{
@@ -90,7 +90,7 @@ static WRITE8_HANDLER( hotblock_port4_w )
{
// mame_printf_debug("port4_w: pc = %06x : data %04x\n", cpu_get_pc(space->cpu), data);
// popmessage("port4_w: pc = %06x : data %04x", cpu_get_pc(space->cpu), data);
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
state->port4 = data;
}
@@ -99,13 +99,13 @@ static WRITE8_HANDLER( hotblock_port4_w )
static WRITE8_HANDLER( hotblock_port0_w )
{
// popmessage("port4_w: pc = %06x : data %04x", cpu_get_pc(space->cpu), data);
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
state->port0 = data;
}
static WRITE8_HANDLER( hotblock_video_write )
{
- hotblock_state *state = space->machine->driver_data<hotblock_state>();
+ hotblock_state *state = space->machine().driver_data<hotblock_state>();
/* right?, anything else?? */
if (state->port0 & 0x20) // port 0 = a8 e8 -- palette
{
@@ -134,23 +134,23 @@ ADDRESS_MAP_END
static VIDEO_START(hotblock)
{
- hotblock_state *state = machine->driver_data<hotblock_state>();
+ hotblock_state *state = machine.driver_data<hotblock_state>();
state->save_item(NAME(state->pal));
}
static SCREEN_UPDATE(hotblock)
{
- hotblock_state *state = screen->machine->driver_data<hotblock_state>();
+ hotblock_state *state = screen->machine().driver_data<hotblock_state>();
int y, x, count;
int i;
static const int xxx = 320, yyy = 204;
- bitmap_fill(bitmap, 0, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, 0, get_black_pen(screen->machine()));
for (i = 0; i < 256; i++)
{
int dat = (state->pal[i * 2 + 1] << 8) | state->pal[i * 2];
- palette_set_color_rgb(screen->machine, i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
+ palette_set_color_rgb(screen->machine(), i, pal5bit(dat >> 0), pal5bit(dat >> 5), pal5bit(dat >> 10));
}
count = 0;
diff --git a/src/mame/drivers/hotstuff.c b/src/mame/drivers/hotstuff.c
index f5e65a7e657..7818d3c88ba 100644
--- a/src/mame/drivers/hotstuff.c
+++ b/src/mame/drivers/hotstuff.c
@@ -22,7 +22,7 @@ VIDEO_START( hotstuff )
SCREEN_UPDATE( hotstuff )
{
- hotstuff_state *state = screen->machine->driver_data<hotstuff_state>();
+ hotstuff_state *state = screen->machine().driver_data<hotstuff_state>();
int count, y,yyy,x,xxx;
UINT16 row_palette_data[0x10];
rgb_t row_palette_data_as_rgb32_pen_data[0x10];
diff --git a/src/mame/drivers/hshavoc.c b/src/mame/drivers/hshavoc.c
index 9eebffadd5a..264c7804dec 100644
--- a/src/mame/drivers/hshavoc.c
+++ b/src/mame/drivers/hshavoc.c
@@ -119,7 +119,7 @@ static DRIVER_INIT(hshavoc)
{
int x;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
static const UINT16 typedat[16] = {
1,1,1,1, 1,1,1,1,
@@ -218,7 +218,7 @@ static DRIVER_INIT(hshavoc)
*/
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
space->nop_write(0x200000, 0x201fff);
}
diff --git a/src/mame/drivers/hvyunit.c b/src/mame/drivers/hvyunit.c
index 7baa1940a73..d229772cb19 100644
--- a/src/mame/drivers/hvyunit.c
+++ b/src/mame/drivers/hvyunit.c
@@ -114,20 +114,20 @@ public:
static MACHINE_START( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
- state->master_cpu = machine->device("master");
- state->slave_cpu = machine->device("slave");
- state->sound_cpu = machine->device("soundcpu");
- state->mermaid = machine->device("mermaid");
- state->pandora = machine->device("pandora");
+ state->master_cpu = machine.device("master");
+ state->slave_cpu = machine.device("slave");
+ state->sound_cpu = machine.device("soundcpu");
+ state->mermaid = machine.device("mermaid");
+ state->pandora = machine.device("pandora");
// TODO: Save state
}
static MACHINE_RESET( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
state->int_vector = 0xff;
state->mermaid_int0_l = 1;
@@ -144,7 +144,7 @@ static MACHINE_RESET( hvyunit )
static TILE_GET_INFO( get_bg_tile_info )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] + ((attr & 0x0f) << 8);
@@ -155,7 +155,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
}
@@ -163,11 +163,11 @@ static SCREEN_UPDATE( hvyunit )
{
#define SX_POS 96
#define SY_POS 0
- hvyunit_state *state = screen->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = screen->machine().driver_data<hvyunit_state>();
tilemap_set_scrollx(state->bg_tilemap, 0, ((state->port0_data & 0x40) << 2) + state->scrollx + SX_POS); // TODO
tilemap_set_scrolly(state->bg_tilemap, 0, ((state->port0_data & 0x80) << 1) + state->scrolly + SY_POS); // TODO
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
pandora_update(state->pandora, bitmap, cliprect);
@@ -176,7 +176,7 @@ static SCREEN_UPDATE( hvyunit )
static SCREEN_EOF( hvyunit )
{
- hvyunit_state *state = machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = machine.driver_data<hvyunit_state>();
pandora_eof(state->pandora);
}
@@ -189,21 +189,21 @@ static SCREEN_EOF( hvyunit )
static WRITE8_HANDLER( trigger_nmi_on_slave_cpu )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
device_set_input_line(state->slave_cpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( master_bankswitch_w )
{
- unsigned char *ROM = space->machine->region("master")->base();
+ unsigned char *ROM = space->machine().region("master")->base();
int bank = data & 7;
ROM = &ROM[0x4000 * bank];
- memory_set_bankptr(space->machine, "bank1", ROM);
+ memory_set_bankptr(space->machine(), "bank1", ROM);
}
static WRITE8_HANDLER( mermaid_data_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->data_to_mermaid = data;
state->z80_to_mermaid_full = 1;
@@ -213,7 +213,7 @@ static WRITE8_HANDLER( mermaid_data_w )
static READ8_HANDLER( mermaid_data_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->mermaid_to_z80_full = 0;
return state->data_to_z80;
@@ -221,7 +221,7 @@ static READ8_HANDLER( mermaid_data_r )
static READ8_HANDLER( mermaid_status_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
return (!state->mermaid_to_z80_full << 2) | (state->z80_to_mermaid_full << 3);
}
@@ -235,7 +235,7 @@ static READ8_HANDLER( mermaid_status_r )
static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->sound_cpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -243,7 +243,7 @@ static WRITE8_HANDLER( trigger_nmi_on_sound_cpu2 )
static WRITE8_HANDLER( hu_videoram_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -251,7 +251,7 @@ static WRITE8_HANDLER( hu_videoram_w )
static WRITE8_HANDLER( hu_colorram_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -259,32 +259,32 @@ static WRITE8_HANDLER( hu_colorram_w )
static WRITE8_HANDLER( slave_bankswitch_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
- unsigned char *ROM = space->machine->region("slave")->base();
+ unsigned char *ROM = space->machine().region("slave")->base();
int bank = (data & 0x03);
state->port0_data = data;
ROM = &ROM[0x4000 * bank];
- memory_set_bankptr(space->machine, "bank2", ROM);
+ memory_set_bankptr(space->machine(), "bank2", ROM);
}
static WRITE8_HANDLER( hu_scrollx_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->scrollx = data;
}
static WRITE8_HANDLER( hu_scrolly_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->scrolly = data;
}
static WRITE8_HANDLER( coin_count_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
@@ -296,11 +296,11 @@ static WRITE8_HANDLER( coin_count_w )
static WRITE8_HANDLER( sound_bankswitch_w )
{
- unsigned char *ROM = space->machine->region("soundcpu")->base();
+ unsigned char *ROM = space->machine().region("soundcpu")->base();
int bank = data & 0x3;
ROM = &ROM[0x4000 * bank];
- memory_set_bankptr(space->machine, "bank3", ROM);
+ memory_set_bankptr(space->machine(), "bank3", ROM);
}
@@ -318,7 +318,7 @@ static READ8_HANDLER( mermaid_p0_r )
static WRITE8_HANDLER( mermaid_p0_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
if (!BIT(state->mermaid_p[0], 1) && BIT(data, 1))
{
@@ -334,7 +334,7 @@ static WRITE8_HANDLER( mermaid_p0_w )
static READ8_HANDLER( mermaid_p1_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
if (BIT(state->mermaid_p[0], 0) == 0)
return state->data_to_mermaid;
@@ -344,7 +344,7 @@ static READ8_HANDLER( mermaid_p1_r )
static WRITE8_HANDLER( mermaid_p1_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
if (data == 0xff)
{
@@ -357,31 +357,31 @@ static WRITE8_HANDLER( mermaid_p1_w )
static READ8_HANDLER( mermaid_p2_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
switch ((state->mermaid_p[0] >> 2) & 3)
{
- case 0: return input_port_read(space->machine, "IN1");
- case 1: return input_port_read(space->machine, "IN2");
- case 2: return input_port_read(space->machine, "IN0");
+ case 0: return input_port_read(space->machine(), "IN1");
+ case 1: return input_port_read(space->machine(), "IN2");
+ case 2: return input_port_read(space->machine(), "IN0");
default: return 0xff;
}
}
static WRITE8_HANDLER( mermaid_p2_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->mermaid_p[2] = data;
}
static READ8_HANDLER( mermaid_p3_r )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
UINT8 dsw = 0;
- UINT8 dsw1 = input_port_read(space->machine, "DSW1");
- UINT8 dsw2 = input_port_read(space->machine, "DSW2");
+ UINT8 dsw1 = input_port_read(space->machine(), "DSW1");
+ UINT8 dsw2 = input_port_read(space->machine(), "DSW2");
switch ((state->mermaid_p[0] >> 5) & 3)
{
@@ -396,7 +396,7 @@ static READ8_HANDLER( mermaid_p3_r )
static WRITE8_HANDLER( mermaid_p3_w )
{
- hvyunit_state *state = space->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = space->machine().driver_data<hvyunit_state>();
state->mermaid_p[3] = data;
device_set_input_line(state->slave_cpu, INPUT_LINE_RESET, data & 2 ? CLEAR_LINE : ASSERT_LINE);
@@ -620,7 +620,7 @@ GFXDECODE_END
static INTERRUPT_GEN( hvyunit_interrupt )
{
- hvyunit_state *state = device->machine->driver_data<hvyunit_state>();
+ hvyunit_state *state = device->machine().driver_data<hvyunit_state>();
state->int_vector ^= 0x02;
device_set_input_line_and_vector(device, 0, HOLD_LINE, state->int_vector);
diff --git a/src/mame/drivers/hyperspt.c b/src/mame/drivers/hyperspt.c
index 2f549b3da1a..182f1323f10 100644
--- a/src/mame/drivers/hyperspt.c
+++ b/src/mame/drivers/hyperspt.c
@@ -23,7 +23,7 @@ Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
static WRITE8_HANDLER( hyperspt_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
diff --git a/src/mame/drivers/hyprduel.c b/src/mame/drivers/hyprduel.c
index e393034b3ae..13f012a0b9d 100644
--- a/src/mame/drivers/hyprduel.c
+++ b/src/mame/drivers/hyprduel.c
@@ -46,9 +46,9 @@ fix comms so it boots, it's a bit of a hack for hyperduel at the moment ;-)
Interrupts
***************************************************************************/
-static void update_irq_state( running_machine *machine )
+static void update_irq_state( running_machine &machine )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
int irq = state->requested_int & ~*state->irq_enable;
device_set_input_line(state->maincpu, 3, (irq & state->int_num) ? ASSERT_LINE : CLEAR_LINE);
@@ -56,13 +56,13 @@ static void update_irq_state( running_machine *machine )
static TIMER_CALLBACK( vblank_end_callback )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->requested_int &= ~param;
}
static INTERRUPT_GEN( hyprduel_interrupt )
{
- hyprduel_state *state = device->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = device->machine().driver_data<hyprduel_state>();
int line = RASTER_LINES - cpu_getiloops(device);
if (line == RASTER_LINES)
@@ -71,23 +71,23 @@ static INTERRUPT_GEN( hyprduel_interrupt )
state->requested_int |= 0x20;
device_set_input_line(device, 2, HOLD_LINE);
/* the duration is a guess */
- device->machine->scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20);
+ device->machine().scheduler().timer_set(attotime::from_usec(2500), FUNC(vblank_end_callback), 0x20);
}
else
state->requested_int |= 0x12; /* hsync */
- update_irq_state(device->machine);
+ update_irq_state(device->machine());
}
static READ16_HANDLER( hyprduel_irq_cause_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
return state->requested_int;
}
static WRITE16_HANDLER( hyprduel_irq_cause_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
if (ACCESSING_BITS_0_7)
{
if (data == state->int_num)
@@ -95,14 +95,14 @@ static WRITE16_HANDLER( hyprduel_irq_cause_w )
else
state->requested_int &= ~(data & *state->irq_enable);
- update_irq_state(space->machine);
+ update_irq_state(space->machine());
}
}
static WRITE16_HANDLER( hyprduel_subcpu_control_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
switch (data)
{
@@ -135,10 +135,10 @@ static WRITE16_HANDLER( hyprduel_subcpu_control_w )
static READ16_HANDLER( hyprduel_cpusync_trigger1_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
if (state->cpu_trigger == 1001)
{
- space->machine->scheduler().trigger(1001);
+ space->machine().scheduler().trigger(1001);
state->cpu_trigger = 0;
}
@@ -147,7 +147,7 @@ static READ16_HANDLER( hyprduel_cpusync_trigger1_r )
static WRITE16_HANDLER( hyprduel_cpusync_trigger1_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
COMBINE_DATA(&state->sharedram1[0x00040e / 2 + offset]);
if (((state->sharedram1[0x00040e / 2] << 16) + state->sharedram1[0x000410 / 2]) != 0x00)
@@ -163,10 +163,10 @@ static WRITE16_HANDLER( hyprduel_cpusync_trigger1_w )
static READ16_HANDLER( hyprduel_cpusync_trigger2_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
if (state->cpu_trigger == 1002)
{
- space->machine->scheduler().trigger(1002);
+ space->machine().scheduler().trigger(1002);
state->cpu_trigger = 0;
}
@@ -175,7 +175,7 @@ static READ16_HANDLER( hyprduel_cpusync_trigger2_r )
static WRITE16_HANDLER( hyprduel_cpusync_trigger2_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
COMBINE_DATA(&state->sharedram1[0x000408 / 2 + offset]);
if (ACCESSING_BITS_8_15)
@@ -191,7 +191,7 @@ static WRITE16_HANDLER( hyprduel_cpusync_trigger2_w )
static TIMER_CALLBACK( magerror_irq_callback )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
device_set_input_line(state->subcpu, 1, HOLD_LINE);
}
@@ -209,9 +209,9 @@ static TIMER_CALLBACK( magerror_irq_callback )
static READ16_HANDLER( hyprduel_bankedrom_r )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
- UINT8 *ROM = space->machine->region("gfx1")->base();
- size_t len = space->machine->region("gfx1")->bytes();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
+ UINT8 *ROM = space->machine().region("gfx1")->base();
+ size_t len = space->machine().region("gfx1")->bytes();
offset = offset * 2 + 0x10000 * (*state->rombank);
@@ -267,7 +267,7 @@ static READ16_HANDLER( hyprduel_bankedrom_r )
static TIMER_CALLBACK( hyprduel_blit_done )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->requested_int |= 1 << state->blitter_bit;
update_irq_state(machine);
}
@@ -285,19 +285,19 @@ INLINE void blt_write( address_space *space, const int tmap, const offs_t offs,
case 2: hyprduel_vram_1_w(space, offs, data, mask); break;
case 3: hyprduel_vram_2_w(space, offs, data, mask); break;
}
-// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine->describe_context(), tmap, offs, data, mask);
+// logerror("%s : Blitter %X] %04X <- %04X & %04X\n", space->machine().describe_context(), tmap, offs, data, mask);
}
static WRITE16_HANDLER( hyprduel_blitter_w )
{
- hyprduel_state *state = space->machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = space->machine().driver_data<hyprduel_state>();
COMBINE_DATA(&state->blitter_regs[offset]);
if (offset == 0xc / 2)
{
- UINT8 *src = space->machine->region("gfx1")->base();
- size_t src_len = space->machine->region("gfx1")->bytes();
+ UINT8 *src = space->machine().region("gfx1")->base();
+ size_t src_len = space->machine().region("gfx1")->bytes();
UINT32 tmap = (state->blitter_regs[0x00 / 2] << 16) + state->blitter_regs[0x02 / 2];
UINT32 src_offs = (state->blitter_regs[0x04 / 2] << 16) + state->blitter_regs[0x06 / 2];
@@ -342,7 +342,7 @@ static WRITE16_HANDLER( hyprduel_blitter_w )
another blit. */
if (b1 == 0)
{
- space->machine->scheduler().timer_set(attotime::from_usec(500), FUNC(hyprduel_blit_done));
+ space->machine().scheduler().timer_set(attotime::from_usec(500), FUNC(hyprduel_blit_done));
return;
}
@@ -623,7 +623,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- hyprduel_state *hyprduel = device->machine->driver_data<hyprduel_state>();
+ hyprduel_state *hyprduel = device->machine().driver_data<hyprduel_state>();
device_set_input_line(hyprduel->subcpu, 1, HOLD_LINE);
}
@@ -638,7 +638,7 @@ static const ym2151_interface ym2151_config =
static MACHINE_RESET( hyprduel )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
/* start with cpu2 halted */
cputag_set_input_line(machine, "sub", INPUT_LINE_RESET, ASSERT_LINE);
@@ -652,10 +652,10 @@ static MACHINE_RESET( hyprduel )
static MACHINE_START( hyprduel )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->blitter_bit));
state->save_item(NAME(state->requested_int));
@@ -665,7 +665,7 @@ static MACHINE_START( hyprduel )
static MACHINE_START( magerror )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
MACHINE_START_CALL(hyprduel);
state->magerror_irq_timer->adjust(attotime::zero, 0, attotime::from_hz(968)); /* tempo? */
@@ -807,23 +807,23 @@ ROM_END
static DRIVER_INIT( hyprduel )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->int_num = 0x02;
/* cpu synchronization (severe timings) */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc0040e, 0xc00411, FUNC(hyprduel_cpusync_trigger1_w));
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger2_w));
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff34c, 0xfff34d, FUNC(hyprduel_cpusync_trigger2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc0040e, 0xc00411, FUNC(hyprduel_cpusync_trigger1_w));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xc00408, 0xc00409, FUNC(hyprduel_cpusync_trigger2_w));
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff34c, 0xfff34d, FUNC(hyprduel_cpusync_trigger2_r));
}
static DRIVER_INIT( magerror )
{
- hyprduel_state *state = machine->driver_data<hyprduel_state>();
+ hyprduel_state *state = machine.driver_data<hyprduel_state>();
state->int_num = 0x01;
- state->magerror_irq_timer = machine->scheduler().timer_alloc(FUNC(magerror_irq_callback));
+ state->magerror_irq_timer = machine.scheduler().timer_alloc(FUNC(magerror_irq_callback));
}
diff --git a/src/mame/drivers/igs009.c b/src/mame/drivers/igs009.c
index 6ce1cddd195..6bb60c6ccf9 100644
--- a/src/mame/drivers/igs009.c
+++ b/src/mame/drivers/igs009.c
@@ -58,14 +58,14 @@ public:
static WRITE8_HANDLER( gp98_reel1_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel1_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel1_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel1_ram[tile_index];
SET_TILE_INFO(
@@ -78,7 +78,7 @@ static TILE_GET_INFO( get_jingbell_reel1_tile_info )
static TILE_GET_INFO( get_gp98_reel1_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel1_ram[tile_index];
SET_TILE_INFO(
@@ -91,14 +91,14 @@ static TILE_GET_INFO( get_gp98_reel1_tile_info )
static WRITE8_HANDLER( gp98_reel2_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel2_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel2_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel2_ram[tile_index];
SET_TILE_INFO(
@@ -110,7 +110,7 @@ static TILE_GET_INFO( get_jingbell_reel2_tile_info )
static TILE_GET_INFO( get_gp98_reel2_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel2_ram[tile_index];
SET_TILE_INFO(
@@ -124,14 +124,14 @@ static TILE_GET_INFO( get_gp98_reel2_tile_info )
static WRITE8_HANDLER( gp98_reel3_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel3_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel3_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel3_ram[tile_index];
SET_TILE_INFO(
@@ -143,7 +143,7 @@ static TILE_GET_INFO( get_jingbell_reel3_tile_info )
static TILE_GET_INFO( get_gp98_reel3_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel3_ram[tile_index];
SET_TILE_INFO(
@@ -157,14 +157,14 @@ static TILE_GET_INFO( get_gp98_reel3_tile_info )
static WRITE8_HANDLER( gp98_reel4_ram_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->gp98_reel4_ram[offset] = data;
tilemap_mark_tile_dirty(state->gp98_reel4_tilemap,offset);
}
static TILE_GET_INFO( get_jingbell_reel4_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel4_ram[tile_index];
SET_TILE_INFO(
@@ -176,7 +176,7 @@ static TILE_GET_INFO( get_jingbell_reel4_tile_info )
static TILE_GET_INFO( get_gp98_reel4_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->gp98_reel4_ram[tile_index];
SET_TILE_INFO(
@@ -194,7 +194,7 @@ static TILE_GET_INFO( get_gp98_reel4_tile_info )
static WRITE8_HANDLER( bg_scroll_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->bg_scroll[offset] = data;
// tilemap_set_scrolly(bg_tilemap,offset,data);
}
@@ -202,28 +202,28 @@ static WRITE8_HANDLER( bg_scroll_w )
static TILE_GET_INFO( get_fg_tile_info )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
SET_TILE_INFO(1, code, (4*(code >> 14)+3), 0);
}
static WRITE8_HANDLER( fg_tile_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static VIDEO_START(jingbell)
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 0x80,0x20);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -241,7 +241,7 @@ static VIDEO_START(jingbell)
static VIDEO_START(gp98)
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 0x80,0x20);
tilemap_set_transparent_pen(state->fg_tilemap, 0);
@@ -260,16 +260,16 @@ static VIDEO_START(gp98)
static SCREEN_UPDATE(jingbell)
{
- igs009_state *state = screen->machine->driver_data<igs009_state>();
+ igs009_state *state = screen->machine().driver_data<igs009_state>();
int layers_ctrl = state->video_enable ? -1 : 0;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
@@ -303,7 +303,7 @@ static SCREEN_UPDATE(jingbell)
clip.min_y = startclipmin;
clip.max_y = startclipmin+2;
- bitmap_fill(bitmap,&clip,screen->machine->pens[rowenable]);
+ bitmap_fill(bitmap,&clip,screen->machine().pens[rowenable]);
if (rowenable==0)
{ // 0 and 1 are the same? or is there a global switchoff?
@@ -327,7 +327,7 @@ static SCREEN_UPDATE(jingbell)
}
}
- else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ else bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -342,8 +342,8 @@ static SCREEN_UPDATE(jingbell)
static CUSTOM_INPUT( hopper_r )
{
- igs009_state *state = field->port->machine->driver_data<igs009_state>();
- return state->hopper && !(field->port->machine->primary_screen->frame_number()%10);
+ igs009_state *state = field->port->machine().driver_data<igs009_state>();
+ return state->hopper && !(field->port->machine().primary_screen->frame_number()%10);
}
@@ -356,19 +356,19 @@ static void show_out(igs009_state *state)
static WRITE8_HANDLER( jingbell_nmi_and_coins_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
if ((state->nmi_enable ^ data) & (~0xdd))
{
logerror("PC %06X: nmi_and_coins = %02x\n",cpu_get_pc(space->cpu),data);
// popmessage("%02x",data);
}
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x40); // led for coin state->out / state->hopper active
+ set_led_status(space->machine(), 6, data & 0x40); // led for coin state->out / state->hopper active
state->nmi_enable = data; // data & 0x80 // nmi enable?
@@ -378,9 +378,9 @@ static WRITE8_HANDLER( jingbell_nmi_and_coins_w )
static WRITE8_HANDLER( jingbell_video_and_leds_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
- set_led_status(space->machine, 4, data & 0x01); // start?
- set_led_status(space->machine, 5, data & 0x04); // l_bet?
+ igs009_state *state = space->machine().driver_data<igs009_state>();
+ set_led_status(space->machine(), 4, data & 0x01); // start?
+ set_led_status(space->machine(), 5, data & 0x04); // l_bet?
state->video_enable = data & 0x40;
state->hopper = (~data)& 0x80;
@@ -391,11 +391,11 @@ static WRITE8_HANDLER( jingbell_video_and_leds_w )
static WRITE8_HANDLER( jingbell_leds_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
- set_led_status(space->machine, 0, data & 0x01); // stop_1
- set_led_status(space->machine, 1, data & 0x02); // stop_2
- set_led_status(space->machine, 2, data & 0x04); // stop_3
- set_led_status(space->machine, 3, data & 0x08); // stop
+ igs009_state *state = space->machine().driver_data<igs009_state>();
+ set_led_status(space->machine(), 0, data & 0x01); // stop_1
+ set_led_status(space->machine(), 1, data & 0x02); // stop_2
+ set_led_status(space->machine(), 2, data & 0x04); // stop_3
+ set_led_status(space->machine(), 3, data & 0x08); // stop
// data & 0x10?
state->out[2] = data;
@@ -405,7 +405,7 @@ static WRITE8_HANDLER( jingbell_leds_w )
static WRITE8_HANDLER( jingbell_magic_w )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
state->igs_magic[offset] = data;
if (offset == 0)
@@ -424,15 +424,15 @@ static WRITE8_HANDLER( jingbell_magic_w )
static READ8_HANDLER( jingbell_magic_r )
{
- igs009_state *state = space->machine->driver_data<igs009_state>();
+ igs009_state *state = space->machine().driver_data<igs009_state>();
switch(state->igs_magic[0])
{
case 0x00:
- if ( !(state->igs_magic[1] & 0x01) ) return input_port_read(space->machine, "DSW1");
- if ( !(state->igs_magic[1] & 0x02) ) return input_port_read(space->machine, "DSW2");
- if ( !(state->igs_magic[1] & 0x04) ) return input_port_read(space->machine, "DSW3");
- if ( !(state->igs_magic[1] & 0x08) ) return input_port_read(space->machine, "DSW4");
- if ( !(state->igs_magic[1] & 0x10) ) return input_port_read(space->machine, "DSW5");
+ if ( !(state->igs_magic[1] & 0x01) ) return input_port_read(space->machine(), "DSW1");
+ if ( !(state->igs_magic[1] & 0x02) ) return input_port_read(space->machine(), "DSW2");
+ if ( !(state->igs_magic[1] & 0x04) ) return input_port_read(space->machine(), "DSW3");
+ if ( !(state->igs_magic[1] & 0x08) ) return input_port_read(space->machine(), "DSW4");
+ if ( !(state->igs_magic[1] & 0x10) ) return input_port_read(space->machine(), "DSW5");
logerror("%06x: warning, reading dsw with igs_magic[1] = %02x\n", cpu_get_pc(space->cpu), state->igs_magic[1]);
break;
@@ -658,7 +658,7 @@ GFXDECODE_END
static MACHINE_RESET( jingbell )
{
- igs009_state *state = machine->driver_data<igs009_state>();
+ igs009_state *state = machine.driver_data<igs009_state>();
state->nmi_enable = 0;
state->hopper = 0;
state->video_enable = 1;
@@ -666,7 +666,7 @@ static MACHINE_RESET( jingbell )
static INTERRUPT_GEN( jingbell_interrupt )
{
- igs009_state *state = device->machine->driver_data<igs009_state>();
+ igs009_state *state = device->machine().driver_data<igs009_state>();
if (state->nmi_enable & 0x80)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -778,8 +778,8 @@ ROM_END
static DRIVER_INIT( jingbell )
{
int i;
- UINT8 *rom = (UINT8 *)machine->region("maincpu")->base();
- size_t size = machine->region("maincpu")->bytes();
+ UINT8 *rom = (UINT8 *)machine.region("maincpu")->base();
+ size_t size = machine.region("maincpu")->bytes();
for (i=0; i<size; i++)
{
diff --git a/src/mame/drivers/igs011.c b/src/mame/drivers/igs011.c
index ab95327c726..1d88ad16d6a 100644
--- a/src/mame/drivers/igs011.c
+++ b/src/mame/drivers/igs011.c
@@ -131,7 +131,7 @@ public:
static WRITE16_HANDLER( igs011_priority_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->priority);
// logerror("%06x: priority = %02x\n", cpu_get_pc(space->cpu), state->priority);
@@ -143,7 +143,7 @@ static WRITE16_HANDLER( igs011_priority_w )
static VIDEO_START( igs011 )
{
- igs011_state *state = machine->driver_data<igs011_state>();
+ igs011_state *state = machine.driver_data<igs011_state>();
int i;
for (i = 0; i < 8; i++)
@@ -156,7 +156,7 @@ static VIDEO_START( igs011 )
static SCREEN_UPDATE( igs011 )
{
- igs011_state *state = screen->machine->driver_data<igs011_state>();
+ igs011_state *state = screen->machine().driver_data<igs011_state>();
#ifdef MAME_DEBUG
int layer_enable = -1;
#endif
@@ -165,17 +165,17 @@ static SCREEN_UPDATE( igs011 )
UINT16 *pri_ram;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 0x01;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 0x02;
- if (input_code_pressed(screen->machine, KEYCODE_E)) mask |= 0x04;
- if (input_code_pressed(screen->machine, KEYCODE_R)) mask |= 0x08;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 0x10;
- if (input_code_pressed(screen->machine, KEYCODE_S)) mask |= 0x20;
- if (input_code_pressed(screen->machine, KEYCODE_D)) mask |= 0x40;
- if (input_code_pressed(screen->machine, KEYCODE_F)) mask |= 0x80;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 0x01;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 0x02;
+ if (input_code_pressed(screen->machine(), KEYCODE_E)) mask |= 0x04;
+ if (input_code_pressed(screen->machine(), KEYCODE_R)) mask |= 0x08;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 0x10;
+ if (input_code_pressed(screen->machine(), KEYCODE_S)) mask |= 0x20;
+ if (input_code_pressed(screen->machine(), KEYCODE_D)) mask |= 0x40;
+ if (input_code_pressed(screen->machine(), KEYCODE_F)) mask |= 0x80;
if (mask) layer_enable &= mask;
}
#endif
@@ -204,7 +204,7 @@ static SCREEN_UPDATE( igs011 )
#ifdef MAME_DEBUG
if ((layer_enable != -1) && (pri_addr == 0xff))
- *BITMAP_ADDR16(bitmap, y, x) = get_black_pen(screen->machine);
+ *BITMAP_ADDR16(bitmap, y, x) = get_black_pen(screen->machine());
else
#endif
*BITMAP_ADDR16(bitmap, y, x) = state->layer[l][scr_addr] | (l << 8);
@@ -233,7 +233,7 @@ static SCREEN_UPDATE( igs011 )
static READ16_HANDLER( igs011_layers_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2);
UINT8 *l0 = state->layer[layer0];
@@ -247,7 +247,7 @@ static READ16_HANDLER( igs011_layers_r )
static WRITE16_HANDLER( igs011_layers_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
UINT16 word;
int layer0 = ((offset & (0x80000/2)) ? 4 : 0) + ((offset & 1) ? 0 : 2);
@@ -277,10 +277,10 @@ static WRITE16_HANDLER( igs011_palette )
{
int rgb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- rgb = (space->machine->generic.paletteram.u16[offset & 0x7ff] & 0xff) | ((space->machine->generic.paletteram.u16[offset | 0x800] & 0xff) << 8);
- palette_set_color_rgb(space->machine,offset & 0x7ff,pal5bit(rgb >> 0),pal5bit(rgb >> 5),pal5bit(rgb >> 10));
+ rgb = (space->machine().generic.paletteram.u16[offset & 0x7ff] & 0xff) | ((space->machine().generic.paletteram.u16[offset | 0x800] & 0xff) << 8);
+ palette_set_color_rgb(space->machine(),offset & 0x7ff,pal5bit(rgb >> 0),pal5bit(rgb >> 5),pal5bit(rgb >> 10));
}
/***************************************************************************
@@ -292,56 +292,56 @@ static WRITE16_HANDLER( igs011_palette )
static WRITE16_HANDLER( igs011_blit_x_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.x);
}
static WRITE16_HANDLER( igs011_blit_y_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.y);
}
static WRITE16_HANDLER( igs011_blit_gfx_lo_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.gfx_lo);
}
static WRITE16_HANDLER( igs011_blit_gfx_hi_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.gfx_hi);
}
static WRITE16_HANDLER( igs011_blit_w_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.w);
}
static WRITE16_HANDLER( igs011_blit_h_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.h);
}
static WRITE16_HANDLER( igs011_blit_depth_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.depth);
}
static WRITE16_HANDLER( igs011_blit_pen_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
COMBINE_DATA(&blitter.pen);
}
@@ -349,7 +349,7 @@ static WRITE16_HANDLER( igs011_blit_pen_w )
static WRITE16_HANDLER( igs011_blit_flags_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
struct blitter_t &blitter = state->blitter;
int x, xstart, xend, xinc, flipx;
int y, ystart, yend, yinc, flipy;
@@ -357,12 +357,12 @@ static WRITE16_HANDLER( igs011_blit_flags_w )
UINT8 trans_pen, clear_pen, pen_hi, *dest;
UINT8 pen = 0;
- UINT8 *gfx = space->machine->region("blitter")->base();
- UINT8 *gfx2 = space->machine->region("blitter_hi")->base();
- int gfx_size = space->machine->region("blitter")->bytes();
- int gfx2_size = space->machine->region("blitter_hi")->bytes();
+ UINT8 *gfx = space->machine().region("blitter")->base();
+ UINT8 *gfx2 = space->machine().region("blitter_hi")->base();
+ int gfx_size = space->machine().region("blitter")->bytes();
+ int gfx2_size = space->machine().region("blitter_hi")->bytes();
- const rectangle &clip = space->machine->primary_screen->visible_area();
+ const rectangle &clip = space->machine().primary_screen->visible_area();
COMBINE_DATA(&blitter.flags);
@@ -446,7 +446,7 @@ static WRITE16_HANDLER( igs011_blit_flags_w )
#ifdef MAME_DEBUG
#if 1
- if (input_code_pressed(space->machine, KEYCODE_Z))
+ if (input_code_pressed(space->machine(), KEYCODE_Z))
{ char buf[20];
sprintf(buf, "%02X%02X",blitter.depth,blitter.flags&0xff);
// ui_draw_text(buf, blitter.x, blitter.y); // crashes mame!
@@ -466,27 +466,27 @@ static WRITE16_HANDLER( igs011_blit_flags_w )
static CUSTOM_INPUT( igs_hopper_r )
{
- igs011_state *state = field->port->machine->driver_data<igs011_state>();
- return (state->igs_hopper && ((field->port->machine->primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
+ igs011_state *state = field->port->machine().driver_data<igs011_state>();
+ return (state->igs_hopper && ((field->port->machine().primary_screen->frame_number()/5)&1)) ? 0x0000 : 0x0001;
}
static WRITE16_HANDLER( igs_dips_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs_dips_sel);
}
#define IGS_DIPS_R( NUM ) \
static READ16_HANDLER( igs_##NUM##_dips_r ) \
{ \
- igs011_state *state = space->machine->driver_data<igs011_state>(); \
+ igs011_state *state = space->machine().driver_data<igs011_state>(); \
int i; \
UINT16 ret=0; \
static const char *const dipnames[] = { "DSW1", "DSW2", "DSW3", "DSW4", "DSW5" }; \
\
for (i = 0; i < NUM; i++) \
if ((~state->igs_dips_sel) & (1 << i) ) \
- ret = input_port_read(space->machine, dipnames[i]); \
+ ret = input_port_read(space->machine(), dipnames[i]); \
\
/* 0x0100 is blitter busy */ \
return (ret & 0xff) | 0x0000; \
@@ -503,10 +503,10 @@ IGS_DIPS_R( 5 )
***************************************************************************/
-static void wlcc_decrypt(running_machine *machine)
+static void wlcc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -527,10 +527,10 @@ static void wlcc_decrypt(running_machine *machine)
}
-static void lhb_decrypt(running_machine *machine)
+static void lhb_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -552,10 +552,10 @@ static void lhb_decrypt(running_machine *machine)
}
-static void drgnwrld_type3_decrypt(running_machine *machine)
+static void drgnwrld_type3_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -580,10 +580,10 @@ static void drgnwrld_type3_decrypt(running_machine *machine)
}
}
-static void drgnwrld_type2_decrypt(running_machine *machine)
+static void drgnwrld_type2_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -613,10 +613,10 @@ static void drgnwrld_type2_decrypt(running_machine *machine)
}
}
-static void drgnwrld_type1_decrypt(running_machine *machine)
+static void drgnwrld_type1_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -642,11 +642,11 @@ static void drgnwrld_type1_decrypt(running_machine *machine)
}
-static void lhb2_decrypt(running_machine *machine)
+static void lhb2_decrypt(running_machine &machine)
{
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -674,7 +674,7 @@ static void lhb2_decrypt(running_machine *machine)
// To be done (similar to lhb2?)
-static void nkishusp_decrypt(running_machine *machine)
+static void nkishusp_decrypt(running_machine &machine)
{
// lhb_decrypt(machine);
// dbc_decrypt(machine);
@@ -687,7 +687,7 @@ static void nkishusp_decrypt(running_machine *machine)
int i,j;
int rom_size = 0x80000;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
UINT16 *result_data = auto_alloc_array(machine, UINT16, rom_size/2);
for (i=0; i<rom_size/2; i++)
@@ -714,10 +714,10 @@ static void nkishusp_decrypt(running_machine *machine)
}
-static void vbowlj_decrypt(running_machine *machine)
+static void vbowlj_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -748,10 +748,10 @@ static void vbowlj_decrypt(running_machine *machine)
}
-static void dbc_decrypt(running_machine *machine)
+static void dbc_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -798,10 +798,10 @@ static void dbc_decrypt(running_machine *machine)
}
-static void ryukobou_decrypt(running_machine *machine)
+static void ryukobou_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *) machine.region("maincpu")->base();
int rom_size = 0x80000;
for (i=0; i<rom_size/2; i++)
@@ -829,11 +829,11 @@ static void ryukobou_decrypt(running_machine *machine)
***************************************************************************/
-static void lhb2_decrypt_gfx(running_machine *machine)
+static void lhb2_decrypt_gfx(running_machine &machine)
{
int i;
unsigned rom_size = 0x200000;
- UINT8 *src = (UINT8 *) (machine->region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -844,11 +844,11 @@ static void lhb2_decrypt_gfx(running_machine *machine)
auto_free(machine, result_data);
}
-static void drgnwrld_gfx_decrypt(running_machine *machine)
+static void drgnwrld_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x400000;
- UINT8 *src = (UINT8 *) (machine->region("blitter")->base());
+ UINT8 *src = (UINT8 *) (machine.region("blitter")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
@@ -904,7 +904,7 @@ static void drgnwrld_gfx_decrypt(running_machine *machine)
static WRITE16_HANDLER( igs011_prot1_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
switch (offset)
@@ -944,11 +944,11 @@ static WRITE16_HANDLER( igs011_prot1_w )
break;
}
- logerror("%s: warning, unknown igs011_prot1_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+ logerror("%s: warning, unknown igs011_prot1_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
static READ16_HANDLER( igs011_prot1_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// !(b1&b2) . 0 . 0 . (b0^b3) . 0 . 0
UINT8 x = state->prot1;
return (((BIT(x,1)&BIT(x,2))^1)<<5) | ((BIT(x,0)^BIT(x,3))<<2);
@@ -957,14 +957,14 @@ static READ16_HANDLER( igs011_prot1_r )
static WRITE16_HANDLER( igs011_prot_addr_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->prot1 = 0x00;
state->prot1_swap = 0x00;
// state->prot2 = 0x00;
- address_space *sp = space->machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = space->machine->region("maincpu")->base();
+ address_space *sp = space->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = space->machine().region("maincpu")->base();
// Plug previous address range with ROM access
sp->install_rom(state->prot1_addr + 0, state->prot1_addr + 9, rom + state->prot1_addr);
@@ -978,7 +978,7 @@ static WRITE16_HANDLER( igs011_prot_addr_w )
/*
static READ16_HANDLER( igs011_prot_fake_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch (offset)
{
case 0: return state->prot1;
@@ -999,14 +999,14 @@ static READ16_HANDLER( igs011_prot_fake_r )
// drgnwrld (33)
static WRITE16_HANDLER( igs011_prot2_reset_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->prot2 = 0x00;
}
// wlcc
static READ16_HANDLER( igs011_prot2_reset_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->prot2 = 0x00;
return 0;
}
@@ -1016,32 +1016,32 @@ static READ16_HANDLER( igs011_prot2_reset_r )
// lhb2 (55), lhb/dbc/ryukobou (33)
static WRITE16_HANDLER( igs011_prot2_inc_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x5500) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0055)) )
{
state->prot2++;
}
// else
-// logerror("%s: warning, unknown igs011_prot2_inc_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_inc_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// vbowl (33)
static WRITE16_HANDLER( igs011_prot2_dec_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
{
state->prot2--;
}
// else
-// logerror("%s: warning, unknown igs011_prot2_dec_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_dec_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
static WRITE16_HANDLER( drgnwrld_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1051,13 +1051,13 @@ static WRITE16_HANDLER( drgnwrld_igs011_prot2_swap_w )
state->prot2 = ((BIT(x,3)&BIT(x,0))<<4) | (BIT(x,2)<<3) | ((BIT(x,0)|BIT(x,1))<<2) | ((BIT(x,2)^BIT(x,4)^1)<<1) | (BIT(x,1)^1^BIT(x,3));
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// lhb, xymg, lhb2
static WRITE16_HANDLER( lhb_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1067,13 +1067,13 @@ static WRITE16_HANDLER( lhb_igs011_prot2_swap_w )
state->prot2 = (((BIT(x,0)^1)|BIT(x,1))<<2) | (BIT(x,2)<<1) | (BIT(x,0)&BIT(x,1));
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// wlcc
static WRITE16_HANDLER( wlcc_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1083,13 +1083,13 @@ static WRITE16_HANDLER( wlcc_igs011_prot2_swap_w )
state->prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0)^1)<<1) | (BIT(x,4)^BIT(x,3)^1);
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
// vbowl
static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
offset *= 2;
// if ( (ACCESSING_BITS_8_15 && (data & 0xff00) == 0x3300) || ((ACCESSING_BITS_0_7 && (data & 0x00ff) == 0x0033)) )
@@ -1099,7 +1099,7 @@ static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w )
state->prot2 = ((BIT(x,3)^BIT(x,2))<<4) | ((BIT(x,2)^BIT(x,1))<<3) | ((BIT(x,1)^BIT(x,0))<<2) | ((BIT(x,4)^BIT(x,0))<<1) | (BIT(x,4)^BIT(x,3));
}
// else
-// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine->describe_context(), offset, data);
+// logerror("%s: warning, unknown igs011_prot2_swap_w( %04x, %04x )\n", space->machine().describe_context(), offset, data);
}
@@ -1107,7 +1107,7 @@ static WRITE16_HANDLER( vbowl_igs011_prot2_swap_w )
// drgnwrld
static READ16_HANDLER( drgnwrldv21_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = (!b4) | (!b0 & b2) | (!(b3 ^ b1) & !(!(b4 & b0) | b2))
UINT8 x = state->prot2;
UINT8 b9 = (BIT(x,4)^1) | ((BIT(x,0)^1) & BIT(x,2)) | ( (BIT(x,3)^BIT(x,1)^1) & ((((BIT(x,4)^1) & BIT(x,0)) | BIT(x,2))^1) );
@@ -1115,7 +1115,7 @@ static READ16_HANDLER( drgnwrldv21_igs011_prot2_r )
}
static READ16_HANDLER( drgnwrldv20j_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = (!b4 | !b0) | !(b3 | b1) | !(b2 & b0)
UINT8 x = state->prot2;
UINT8 b9 = ((BIT(x,4)^1) | (BIT(x,0)^1)) | ((BIT(x,3) | BIT(x,1))^1) | ((BIT(x,2) & BIT(x,0))^1);
@@ -1125,7 +1125,7 @@ static READ16_HANDLER( drgnwrldv20j_igs011_prot2_r )
// lhb, xymg
static READ16_HANDLER( lhb_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = !b2 | (b1 & b0)
UINT8 x = state->prot2;
UINT8 b9 = (BIT(x,2)^1) | (BIT(x,1) & BIT(x,0));
@@ -1135,7 +1135,7 @@ static READ16_HANDLER( lhb_igs011_prot2_r )
// dbc
static READ16_HANDLER( dbc_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = !b1 | (!b0 & b2)
UINT8 x = state->prot2;
UINT8 b9 = (BIT(x,1)^1) | ((BIT(x,0)^1) & BIT(x,2));
@@ -1145,7 +1145,7 @@ static READ16_HANDLER( dbc_igs011_prot2_r )
// ryukobou
static READ16_HANDLER( ryukobou_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b9 = (!b1 | b2) & b0
UINT8 x = state->prot2;
UINT8 b9 = ((BIT(x,1)^1) | BIT(x,2)) & BIT(x,0);
@@ -1155,7 +1155,7 @@ static READ16_HANDLER( ryukobou_igs011_prot2_r )
// lhb2
static READ16_HANDLER( lhb2_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// b3 = !b2 | !b1 | b0
UINT8 x = state->prot2;
UINT8 b3 = (BIT(x,2)^1) | (BIT(x,1)^1) | BIT(x,0);
@@ -1165,7 +1165,7 @@ static READ16_HANDLER( lhb2_igs011_prot2_r )
// vbowl
static READ16_HANDLER( vbowl_igs011_prot2_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
UINT8 x = state->prot2;
UINT8 b9 = ((BIT(x,4)^1) & (BIT(x,3)^1)) | ((BIT(x,2) & BIT(x,1))^1) | ((BIT(x,4) | BIT(x,0))^1);
return (b9 << 9);
@@ -1195,7 +1195,7 @@ static READ16_HANDLER( vbowl_igs011_prot2_r )
static WRITE16_HANDLER( igs012_prot_reset_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
state->igs012_prot = 0x00;
state->igs012_prot_swap = 0x00;
@@ -1204,7 +1204,7 @@ static WRITE16_HANDLER( igs012_prot_reset_w )
/*
static READ16_HANDLER( igs012_prot_fake_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch (offset)
{
case 0: return state->igs012_prot;
@@ -1220,29 +1220,29 @@ static READ16_HANDLER( igs012_prot_fake_r )
static WRITE16_HANDLER( igs012_prot_mode_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0xcc) || MODE_AND_DATA(1, 0xdd) )
{
state->igs012_prot_mode = state->igs012_prot_mode ^ 1;
}
else
- logerror("%s: warning, unknown igs012_prot_mode_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_mode_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_inc_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0xff) )
{
state->igs012_prot = (state->igs012_prot + 1) & 0x1f;
}
else
- logerror("%s: warning, unknown igs012_prot_inc_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_inc_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_dec_inc_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0xaa) )
{
state->igs012_prot = (state->igs012_prot - 1) & 0x1f;
@@ -1252,12 +1252,12 @@ static WRITE16_HANDLER( igs012_prot_dec_inc_w )
state->igs012_prot = (state->igs012_prot + 1) & 0x1f;
}
else
- logerror("%s: warning, unknown igs012_prot_dec_inc_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_dec_inc_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_dec_copy_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0x33) )
{
state->igs012_prot = state->igs012_prot_swap;
@@ -1267,23 +1267,23 @@ static WRITE16_HANDLER( igs012_prot_dec_copy_w )
state->igs012_prot = (state->igs012_prot - 1) & 0x1f;
}
else
- logerror("%s: warning, unknown igs012_prot_dec_copy_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_dec_copy_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_copy_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(1, 0x22) )
{
state->igs012_prot = state->igs012_prot_swap;
}
else
- logerror("%s: warning, unknown igs012_prot_copy_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_copy_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static WRITE16_HANDLER( igs012_prot_swap_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if ( MODE_AND_DATA(0, 0x55) || MODE_AND_DATA(1, 0xa5) )
{
// !(3 | 1)..(2 & 1)..(3 ^ 0)..(!2)
@@ -1291,12 +1291,12 @@ static WRITE16_HANDLER( igs012_prot_swap_w )
state->igs012_prot_swap = (((BIT(x,3)|BIT(x,1))^1)<<3) | ((BIT(x,2)&BIT(x,1))<<2) | ((BIT(x,3)^BIT(x,0))<<1) | (BIT(x,2)^1);
}
else
- logerror("%s: warning, unknown igs012_prot_swap_w( %04x, %04x ), mode %x\n", space->machine->describe_context(), offset, data, state->igs012_prot_mode);
+ logerror("%s: warning, unknown igs012_prot_swap_w( %04x, %04x ), mode %x\n", space->machine().describe_context(), offset, data, state->igs012_prot_mode);
}
static READ16_HANDLER( igs012_prot_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
// FIXME: mode 0 and mode 1 are mapped to different memory ranges
UINT8 x = state->igs012_prot;
@@ -1315,7 +1315,7 @@ static READ16_HANDLER( igs012_prot_r )
static WRITE16_HANDLER( drgnwrld_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1326,7 +1326,7 @@ static WRITE16_HANDLER( drgnwrld_igs003_w )
case 0x00:
if (ACCESSING_BITS_0_7)
- coin_counter_w(space->machine, 0,data & 2);
+ coin_counter_w(space->machine(), 0,data & 2);
if (data & ~0x2)
logerror("%06x: warning, unknown bits written in coin counter = %02x\n", cpu_get_pc(space->cpu), data);
@@ -1347,12 +1347,12 @@ static WRITE16_HANDLER( drgnwrld_igs003_w )
}
static READ16_HANDLER( drgnwrld_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "IN0");
- case 0x01: return input_port_read(space->machine, "IN1");
- case 0x02: return input_port_read(space->machine, "IN2");
+ case 0x00: return input_port_read(space->machine(), "IN0");
+ case 0x01: return input_port_read(space->machine(), "IN1");
+ case 0x02: return input_port_read(space->machine(), "IN2");
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -1387,12 +1387,12 @@ static READ16_HANDLER( drgnwrld_igs003_r )
static WRITE16_HANDLER( lhb_inputs_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs_input_sel);
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x20 );
+ coin_counter_w(space->machine(), 0, data & 0x20 );
// coin out data & 0x40
state->igs_hopper = data & 0x80;
}
@@ -1404,17 +1404,17 @@ static WRITE16_HANDLER( lhb_inputs_w )
}
static READ16_HANDLER( lhb_inputs_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(offset)
{
case 0: return state->igs_input_sel;
case 1:
- if (~state->igs_input_sel & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->igs_input_sel & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->igs_input_sel & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->igs_input_sel & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->igs_input_sel & 0x10) return input_port_read(space->machine, "KEY4");
+ if (~state->igs_input_sel & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->igs_input_sel & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->igs_input_sel & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->igs_input_sel & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->igs_input_sel & 0x10) return input_port_read(space->machine(), "KEY4");
logerror("%06x: warning, reading with igs_input_sel = %02x\n", cpu_get_pc(space->cpu), state->igs_input_sel);
break;
@@ -1426,7 +1426,7 @@ static READ16_HANDLER( lhb_inputs_r )
static WRITE16_HANDLER( lhb2_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1439,7 +1439,7 @@ static WRITE16_HANDLER( lhb2_igs003_w )
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x20);
// coin out data & 0x40
state->igs_hopper = data & 0x80;
}
@@ -1455,7 +1455,7 @@ static WRITE16_HANDLER( lhb2_igs003_w )
{
state->lhb2_pen_hi = data & 0x07;
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x08) ? 0x40000 : 0);
}
@@ -1471,15 +1471,15 @@ static WRITE16_HANDLER( lhb2_igs003_w )
}
static READ16_HANDLER( lhb2_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
case 0x01:
- if (~state->igs_input_sel & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->igs_input_sel & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->igs_input_sel & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->igs_input_sel & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->igs_input_sel & 0x10) return input_port_read(space->machine, "KEY4");
+ if (~state->igs_input_sel & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->igs_input_sel & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->igs_input_sel & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->igs_input_sel & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->igs_input_sel & 0x10) return input_port_read(space->machine(), "KEY4");
/* fall through */
default:
logerror("%06x: warning, reading with igs003_reg = %02x\n", cpu_get_pc(space->cpu), state->igs003_reg[0]);
@@ -1522,7 +1522,7 @@ static READ16_HANDLER( lhb2_igs003_r )
static WRITE16_HANDLER( wlcc_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1533,10 +1533,10 @@ static WRITE16_HANDLER( wlcc_igs003_w )
case 0x02:
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
// coin out data & 0x02
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x10) ? 0x40000 : 0);
state->igs_hopper = data & 0x20;
}
@@ -1553,10 +1553,10 @@ static WRITE16_HANDLER( wlcc_igs003_w )
}
static READ16_HANDLER( wlcc_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "IN0");
+ case 0x00: return input_port_read(space->machine(), "IN0");
case 0x20: return 0x49;
case 0x21: return 0x47;
@@ -1591,7 +1591,7 @@ static READ16_HANDLER( wlcc_igs003_r )
static WRITE16_HANDLER( xymg_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1604,7 +1604,7 @@ static WRITE16_HANDLER( xymg_igs003_w )
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x20);
// coin out data & 0x40
state->igs_hopper = data & 0x80;
}
@@ -1621,17 +1621,17 @@ static WRITE16_HANDLER( xymg_igs003_w )
}
static READ16_HANDLER( xymg_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "COIN");
+ case 0x00: return input_port_read(space->machine(), "COIN");
case 0x02:
- if (~state->igs_input_sel & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->igs_input_sel & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->igs_input_sel & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->igs_input_sel & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->igs_input_sel & 0x10) return input_port_read(space->machine, "KEY4");
+ if (~state->igs_input_sel & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->igs_input_sel & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->igs_input_sel & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->igs_input_sel & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->igs_input_sel & 0x10) return input_port_read(space->machine(), "KEY4");
/* fall through */
case 0x20: return 0x49;
@@ -1668,7 +1668,7 @@ static READ16_HANDLER( xymg_igs003_r )
static WRITE16_HANDLER( vbowl_igs003_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA(&state->igs003_reg[offset]);
if (offset == 0)
@@ -1679,8 +1679,8 @@ static WRITE16_HANDLER( vbowl_igs003_w )
case 0x02:
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
if (data & ~0x3)
@@ -1695,11 +1695,11 @@ static WRITE16_HANDLER( vbowl_igs003_w )
}
static READ16_HANDLER( vbowl_igs003_r )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
switch(state->igs003_reg[0])
{
- case 0x00: return input_port_read(space->machine, "IN0");
- case 0x01: return input_port_read(space->machine, "IN1");
+ case 0x00: return input_port_read(space->machine(), "IN0");
+ case 0x01: return input_port_read(space->machine(), "IN1");
// case 0x03:
// return 0xff; // parametric bitswaps?
@@ -1744,7 +1744,7 @@ static READ16_HANDLER( vbowl_igs003_r )
// V0400O
static DRIVER_INIT( drgnwrld )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1770,7 +1770,7 @@ static DRIVER_INIT( drgnwrld )
static DRIVER_INIT( drgnwrldv30 )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1795,12 +1795,12 @@ static DRIVER_INIT( drgnwrldv30 )
static DRIVER_INIT( drgnwrldv21 )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type2_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4c0, 0xd4ff, FUNC(drgnwrldv21_igs011_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4c0, 0xd4ff, FUNC(drgnwrldv21_igs011_prot2_r));
/*
// PROTECTION CHECKS
// bp 32ee; bp 11ca8; bp 23d5e; bp 23fd0; bp 24170; bp 24348; bp 2454e; bp 246cc; bp 24922; bp 24b66; bp 24de2; bp 2502a; bp 25556; bp 269de; bp 2766a; bp 2a830
@@ -1825,7 +1825,7 @@ static DRIVER_INIT( drgnwrldv21 )
static DRIVER_INIT( drgnwrldv21j )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1852,7 +1852,7 @@ static DRIVER_INIT( drgnwrldv21j )
static DRIVER_INIT( drgnwrldv20j )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type3_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1890,7 +1890,7 @@ static DRIVER_INIT( drgnwrldv11h )
static DRIVER_INIT( drgnwrldv10c )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
drgnwrld_type1_decrypt(machine);
drgnwrld_gfx_decrypt(machine);
@@ -1916,7 +1916,7 @@ static DRIVER_INIT( drgnwrldv10c )
static DRIVER_INIT( lhb )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb_decrypt(machine);
@@ -1926,7 +1926,7 @@ static DRIVER_INIT( lhb )
static DRIVER_INIT( lhbv33c )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb_decrypt(machine);
@@ -1936,11 +1936,11 @@ static DRIVER_INIT( lhbv33c )
static DRIVER_INIT( dbc )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
dbc_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(dbc_igs011_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(dbc_igs011_prot2_r));
/*
// PROTECTION CHECKS
rom[0x04c42/2] = 0x602e; // 004C42: 6604 bne 4c48 (rom test error otherwise)
@@ -1965,11 +1965,11 @@ static DRIVER_INIT( dbc )
static DRIVER_INIT( ryukobou )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
ryukobou_decrypt(machine);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(ryukobou_igs011_prot2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x10600, 0x107ff, FUNC(ryukobou_igs011_prot2_r));
// PROTECTION CHECKS
// rom[0x2df68/2] = 0x4e75; // 02DF68: 4E56 FE00 link A6, #-$200 (fills palette with pink otherwise)
@@ -1978,7 +1978,7 @@ static DRIVER_INIT( ryukobou )
static DRIVER_INIT( xymg )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb_decrypt(machine);
/*
@@ -2012,7 +2012,7 @@ static DRIVER_INIT( xymg )
static DRIVER_INIT( wlcc )
{
-// UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+// UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
wlcc_decrypt(machine);
/*
@@ -2036,7 +2036,7 @@ static DRIVER_INIT( wlcc )
static DRIVER_INIT( lhb2 )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
lhb2_decrypt(machine);
lhb2_decrypt_gfx(machine);
@@ -2058,8 +2058,8 @@ static DRIVER_INIT( lhb2 )
static DRIVER_INIT( vbowl )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine->region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
int i;
vbowlj_decrypt(machine);
@@ -2083,8 +2083,8 @@ static DRIVER_INIT( vbowl )
static DRIVER_INIT( vbowlj )
{
- UINT16 *rom = (UINT16 *) machine->region("maincpu")->base();
- UINT8 *gfx = (UINT8 *) machine->region("blitter")->base();
+ UINT16 *rom = (UINT16 *) machine.region("maincpu")->base();
+ UINT8 *gfx = (UINT8 *) machine.region("blitter")->base();
int i;
vbowlj_decrypt(machine);
@@ -2178,7 +2178,7 @@ ADDRESS_MAP_END
// Only values 0 and 7 are written (1 bit per irq source?)
static WRITE16_HANDLER( lhb_irq_enable_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
COMBINE_DATA( &state->lhb_irq_enable );
}
@@ -2191,7 +2191,7 @@ static WRITE16_DEVICE_HANDLER( lhb_okibank_w )
}
if ( data & (~0x200) )
- logerror("%s: warning, unknown bits written in oki bank = %02x\n", device->machine->describe_context(), data);
+ logerror("%s: warning, unknown bits written in oki bank = %02x\n", device->machine().describe_context(), data);
// popmessage("oki %04x",data);
}
@@ -2357,7 +2357,7 @@ ADDRESS_MAP_END
*/
static READ16_DEVICE_HANDLER( ics2115_word_r )
{
- ics2115_device* ics2115 = device->machine->device<ics2115_device>("ics");
+ ics2115_device* ics2115 = device->machine().device<ics2115_device>("ics");
switch(offset)
{
case 0: return ics2115_device::read(ics2115, (offs_t)0);
@@ -2369,7 +2369,7 @@ static READ16_DEVICE_HANDLER( ics2115_word_r )
static WRITE16_DEVICE_HANDLER( ics2115_word_w )
{
- ics2115_device* ics2115 = device->machine->device<ics2115_device>("ics");
+ ics2115_device* ics2115 = device->machine().device<ics2115_device>("ics");
switch(offset)
{
case 1:
@@ -2389,14 +2389,14 @@ static READ16_HANDLER( vbowl_unk_r )
static SCREEN_EOF( vbowl )
{
- igs011_state *state = machine->driver_data<igs011_state>();
+ igs011_state *state = machine.driver_data<igs011_state>();
state->vbowl_trackball[0] = state->vbowl_trackball[1];
state->vbowl_trackball[1] = (input_port_read(machine, "AN1") << 8) | input_port_read(machine, "AN0");
}
static WRITE16_HANDLER( vbowl_pen_hi_w )
{
- igs011_state *state = space->machine->driver_data<igs011_state>();
+ igs011_state *state = space->machine().driver_data<igs011_state>();
if (ACCESSING_BITS_0_7)
{
state->lhb2_pen_hi = data & 0x07;
@@ -3617,7 +3617,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( lhb_interrupt )
{
- igs011_state *state = device->machine->driver_data<igs011_state>();
+ igs011_state *state = device->machine().driver_data<igs011_state>();
if (!state->lhb_irq_enable)
return;
diff --git a/src/mame/drivers/igs017.c b/src/mame/drivers/igs017.c
index f639ba586c9..7a3d3fb11bb 100644
--- a/src/mame/drivers/igs017.c
+++ b/src/mame/drivers/igs017.c
@@ -86,7 +86,7 @@ public:
static WRITE8_HANDLER( video_disable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->video_disable = data & 1;
if (data & (~1))
logerror("PC %06X: unknown bits of video_disable written = %02x\n",cpu_get_pc(space->cpu),data);
@@ -100,7 +100,7 @@ static WRITE16_HANDLER( video_disable_lsb_w )
static VIDEO_RESET( igs017 )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
state->video_disable = 0;
}
@@ -109,14 +109,14 @@ static VIDEO_RESET( igs017 )
static TILE_GET_INFO( get_fg_tile_info )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
int code = state->fg_videoram[tile_index*4+0] + (state->fg_videoram[tile_index*4+1] << 8);
int attr = state->fg_videoram[tile_index*4+2] + (state->fg_videoram[tile_index*4+3] << 8);
SET_TILE_INFO(0, code, COLOR(attr), TILE_FLIPXY( attr >> 5 ));
}
static TILE_GET_INFO( get_bg_tile_info )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
int code = state->bg_videoram[tile_index*4+0] + (state->bg_videoram[tile_index*4+1] << 8);
int attr = state->bg_videoram[tile_index*4+2] + (state->bg_videoram[tile_index*4+3] << 8);
SET_TILE_INFO(0, code, COLOR(attr)+8, TILE_FLIPXY( attr >> 5 ));
@@ -124,14 +124,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static WRITE8_HANDLER( fg_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->fg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset/4);
}
static WRITE8_HANDLER( bg_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->bg_videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset/4);
}
@@ -140,7 +140,7 @@ static WRITE8_HANDLER( bg_w )
static READ16_HANDLER( fg_lsb_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
return state->fg_videoram[offset];
}
static WRITE16_HANDLER( fg_lsb_w )
@@ -151,7 +151,7 @@ static WRITE16_HANDLER( fg_lsb_w )
static READ16_HANDLER( bg_lsb_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
return state->bg_videoram[offset];
}
static WRITE16_HANDLER( bg_lsb_w )
@@ -162,12 +162,12 @@ static WRITE16_HANDLER( bg_lsb_w )
static READ16_HANDLER( spriteram_lsb_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
return state->spriteram[offset];
}
static WRITE16_HANDLER( spriteram_lsb_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
if (ACCESSING_BITS_0_7)
state->spriteram[offset] = data;
}
@@ -176,11 +176,11 @@ static WRITE16_HANDLER( spriteram_lsb_w )
// Eeach 16 bit word in the sprites gfx roms contains three 5 bit pens: x-22222-11111-00000.
// This routine expands each word into three bytes.
-static void expand_sprites(running_machine *machine)
+static void expand_sprites(running_machine &machine)
{
- igs017_state *state = machine->driver_data<igs017_state>();
- UINT8 *rom = machine->region("sprites")->base();
- int size = machine->region("sprites")->bytes();
+ igs017_state *state = machine.driver_data<igs017_state>();
+ UINT8 *rom = machine.region("sprites")->base();
+ int size = machine.region("sprites")->bytes();
int i;
state->sprites_gfx_size = size / 2 * 3;
@@ -198,7 +198,7 @@ static void expand_sprites(running_machine *machine)
static VIDEO_START( igs017 )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,64,32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -245,9 +245,9 @@ static VIDEO_START( igs017 )
***************************************************************************/
-static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
+static void draw_sprite(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect, int sx, int sy, int dimx, int dimy, int flipx, int flipy, int color, int addr)
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
// prepare GfxElement on the fly
gfx_element gfx;
@@ -263,9 +263,9 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap,const rectang
sx, sy, 0x1f );
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
UINT8 *s = state->spriteram;
UINT8 *end = state->spriteram + 0x800;
@@ -299,10 +299,10 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
}
// A simple gfx viewer (toggle with T)
-static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
+static int debug_viewer(running_machine &machine, bitmap_t *bitmap,const rectangle *cliprect)
{
#ifdef MAME_DEBUG
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
if (input_code_pressed_once(machine, KEYCODE_T)) state->toggle = 1-state->toggle;
if (state->toggle) {
int h = 256, w = state->debug_width, a = state->debug_addr;
@@ -344,31 +344,31 @@ static int debug_viewer(running_machine *machine, bitmap_t *bitmap,const rectang
static SCREEN_UPDATE( igs017 )
{
- igs017_state *state = screen->machine->driver_data<igs017_state>();
+ igs017_state *state = screen->machine().driver_data<igs017_state>();
int layers_ctrl = -1;
#ifdef MAME_DEBUG
- if (input_code_pressed(screen->machine, KEYCODE_Z))
+ if (input_code_pressed(screen->machine(), KEYCODE_Z))
{
int mask = 0;
- if (input_code_pressed(screen->machine, KEYCODE_Q)) mask |= 1;
- if (input_code_pressed(screen->machine, KEYCODE_W)) mask |= 2;
- if (input_code_pressed(screen->machine, KEYCODE_A)) mask |= 4;
+ if (input_code_pressed(screen->machine(), KEYCODE_Q)) mask |= 1;
+ if (input_code_pressed(screen->machine(), KEYCODE_W)) mask |= 2;
+ if (input_code_pressed(screen->machine(), KEYCODE_A)) mask |= 4;
if (mask != 0) layers_ctrl &= mask;
}
#endif
- if (debug_viewer(screen->machine, bitmap,cliprect))
+ if (debug_viewer(screen->machine(), bitmap,cliprect))
return 0;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
if (state->video_disable)
return 0;
if (layers_ctrl & 1) tilemap_draw(bitmap, cliprect, state->bg_tilemap, TILEMAP_DRAW_OPAQUE, 0);
- if (layers_ctrl & 4) draw_sprites(screen->machine, bitmap, cliprect);
+ if (layers_ctrl & 4) draw_sprites(screen->machine(), bitmap, cliprect);
if (layers_ctrl & 2) tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
@@ -379,10 +379,10 @@ static SCREEN_UPDATE( igs017 )
Decryption
***************************************************************************/
-static void decrypt_program_rom(running_machine *machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
+static void decrypt_program_rom(running_machine &machine, int mask, int a7, int a6, int a5, int a4, int a3, int a2, int a1, int a0)
{
- int length = machine->region("maincpu")->bytes();
- UINT8 *rom = machine->region("maincpu")->base();
+ int length = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -432,9 +432,9 @@ static void decrypt_program_rom(running_machine *machine, int mask, int a7, int
// iqblocka
-static void iqblocka_patch_rom(running_machine *machine)
+static void iqblocka_patch_rom(running_machine &machine)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
// rom[0x7b64] = 0xc9;
@@ -473,10 +473,10 @@ static DRIVER_INIT( iqblockf )
// tjsb
-static void tjsb_decrypt_sprites(running_machine *machine)
+static void tjsb_decrypt_sprites(running_machine &machine)
{
- int length = machine->region("sprites")->bytes();
- UINT8 *rom = machine->region("sprites")->base();
+ int length = machine.region("sprites")->bytes();
+ UINT8 *rom = machine.region("sprites")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -503,9 +503,9 @@ static void tjsb_decrypt_sprites(running_machine *machine)
}
}
-static void tjsb_patch_rom(running_machine *machine)
+static void tjsb_patch_rom(running_machine &machine)
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
rom[0x011df] = 0x18;
}
@@ -520,10 +520,10 @@ static DRIVER_INIT( tjsb )
// mgcs
-static void mgcs_decrypt_program_rom(running_machine *machine)
+static void mgcs_decrypt_program_rom(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
int rom_size = 0x80000;
@@ -570,10 +570,10 @@ static void mgcs_decrypt_program_rom(running_machine *machine)
}
}
-static void mgcs_decrypt_tiles(running_machine *machine)
+static void mgcs_decrypt_tiles(running_machine &machine)
{
- int length = machine->region("tilemaps")->bytes();
- UINT8 *rom = machine->region("tilemaps")->base();
+ int length = machine.region("tilemaps")->bytes();
+ UINT8 *rom = machine.region("tilemaps")->base();
UINT8 *tmp = auto_alloc_array(machine, UINT8, length);
int i;
@@ -587,10 +587,10 @@ static void mgcs_decrypt_tiles(running_machine *machine)
auto_free(machine, tmp);
}
-static void mgcs_flip_sprites(running_machine *machine)
+static void mgcs_flip_sprites(running_machine &machine)
{
- int length = machine->region("sprites")->bytes();
- UINT8 *rom = machine->region("sprites")->base();
+ int length = machine.region("sprites")->bytes();
+ UINT8 *rom = machine.region("sprites")->base();
int i;
for (i = 0;i < length;i+=2)
@@ -608,9 +608,9 @@ static void mgcs_flip_sprites(running_machine *machine)
}
}
-static void mgcs_patch_rom(running_machine *machine)
+static void mgcs_patch_rom(running_machine &machine)
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
rom[0x4e036/2] = 0x6006;
@@ -636,7 +636,7 @@ static DRIVER_INIT( mgcs )
// decryption is incomplete, the first part of code doesn't seem right.
static DRIVER_INIT( tarzan )
{
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
int i;
int size = 0x40000;
@@ -662,7 +662,7 @@ static DRIVER_INIT( tarzan )
// by iq_132
static DRIVER_INIT( tarzana )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
int size = 0x80000;
@@ -684,7 +684,7 @@ static DRIVER_INIT( tarzana )
// decryption is incomplete, the first part of code doesn't seem right.
static DRIVER_INIT( starzan )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
int i;
int size = 0x040000;
@@ -739,7 +739,7 @@ static DRIVER_INIT( starzan )
static DRIVER_INIT( sdmg2 )
{
int i;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
int rom_size = 0x80000;
@@ -796,7 +796,7 @@ static DRIVER_INIT( sdmg2 )
static DRIVER_INIT( mgdha )
{
int i;
- UINT16 *src = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *src = (UINT16 *)machine.region("maincpu")->base();
int rom_size = 0x80000;
@@ -831,7 +831,7 @@ static DRIVER_INIT( mgdh )
{
DRIVER_INIT_CALL( mgdha );
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// additional protection
rom[0x4ad50/2] = 0x4e71;
@@ -843,7 +843,7 @@ static DRIVER_INIT( mgdh )
static DRIVER_INIT( lhzb2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -933,7 +933,7 @@ static DRIVER_INIT( lhzb2 )
static DRIVER_INIT( lhzb2a )
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -995,7 +995,7 @@ static DRIVER_INIT( lhzb2a )
static DRIVER_INIT( slqz2 )
{
int i;
- UINT16 *src = (UINT16 *) (machine->region("maincpu")->base());
+ UINT16 *src = (UINT16 *) (machine.region("maincpu")->base());
int rom_size = 0x80000;
@@ -1082,7 +1082,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( nmi_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->nmi_enable = data & 1;
if (data & (~1))
logerror("PC %06X: nmi_enable = %02x\n",cpu_get_pc(space->cpu),data);
@@ -1090,7 +1090,7 @@ static WRITE8_HANDLER( nmi_enable_w )
static WRITE8_HANDLER( irq_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->irq_enable = data & 1;
if (data & (~1))
logerror("PC %06X: irq_enable = %02x\n",cpu_get_pc(space->cpu),data);
@@ -1098,18 +1098,18 @@ static WRITE8_HANDLER( irq_enable_w )
static WRITE8_HANDLER( input_select_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
state->input_select = data;
}
static READ8_HANDLER( input_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch (state->input_select)
{
- case 0x00: return input_port_read(space->machine, "PLAYER1");
- case 0x01: return input_port_read(space->machine, "PLAYER2");
- case 0x02: return input_port_read(space->machine, "COINS");
+ case 0x00: return input_port_read(space->machine(), "PLAYER1");
+ case 0x01: return input_port_read(space->machine(), "PLAYER2");
+ case 0x02: return input_port_read(space->machine(), "COINS");
case 0x03: return 01;
@@ -1175,7 +1175,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( mgcs_magic_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
COMBINE_DATA(&state->igs_magic[offset]);
if (offset == 0)
@@ -1210,7 +1210,7 @@ static WRITE16_HANDLER( mgcs_magic_w )
static READ16_HANDLER( mgcs_magic_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch(state->igs_magic[0])
{
case 0x01:
@@ -1226,20 +1226,20 @@ static READ16_HANDLER( mgcs_magic_r )
static READ8_DEVICE_HANDLER( mgcs_keys_r )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
- if (~state->input_select & 0x08) return input_port_read(device->machine, "KEY0");
- if (~state->input_select & 0x10) return input_port_read(device->machine, "KEY1");
- if (~state->input_select & 0x20) return input_port_read(device->machine, "KEY2");
- if (~state->input_select & 0x40) return input_port_read(device->machine, "KEY3");
- if (~state->input_select & 0x80) return input_port_read(device->machine, "KEY4");
+ igs017_state *state = device->machine().driver_data<igs017_state>();
+ if (~state->input_select & 0x08) return input_port_read(device->machine(), "KEY0");
+ if (~state->input_select & 0x10) return input_port_read(device->machine(), "KEY1");
+ if (~state->input_select & 0x20) return input_port_read(device->machine(), "KEY2");
+ if (~state->input_select & 0x40) return input_port_read(device->machine(), "KEY3");
+ if (~state->input_select & 0x80) return input_port_read(device->machine(), "KEY4");
- logerror("%s: warning, reading key with input_select = %02x\n", device->machine->describe_context(), state->input_select);
+ logerror("%s: warning, reading key with input_select = %02x\n", device->machine().describe_context(), state->input_select);
return 0xff;
}
static WRITE16_HANDLER( irq1_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
if (ACCESSING_BITS_0_7)
state->irq1_enable = data & 1;
@@ -1249,7 +1249,7 @@ static WRITE16_HANDLER( irq1_enable_w )
static WRITE16_HANDLER( irq2_enable_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
if (ACCESSING_BITS_0_7)
state->irq2_enable = data & 1;
@@ -1261,14 +1261,14 @@ static WRITE16_HANDLER( mgcs_paletteram_xRRRRRGGGGGBBBBB_w )
{
int rgb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- rgb = ((space->machine->generic.paletteram.u16[offset/2*2+0] & 0xff) << 8) | (space->machine->generic.paletteram.u16[offset/2*2+1] & 0xff);
+ rgb = ((space->machine().generic.paletteram.u16[offset/2*2+0] & 0xff) << 8) | (space->machine().generic.paletteram.u16[offset/2*2+1] & 0xff);
// bitswap
rgb = BITSWAP16(rgb,7,8,9,2,14,3,13,15,12,11,10,0,1,4,5,6);
- palette_set_color_rgb(space->machine, offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
+ palette_set_color_rgb(space->machine(), offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
}
static ADDRESS_MAP_START( mgcs, AS_PROGRAM, 16 )
@@ -1295,31 +1295,31 @@ static WRITE16_HANDLER( sdmg2_paletteram_xRRRRRGGGGGBBBBB_w )
{
int rgb;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
- rgb = ((space->machine->generic.paletteram.u16[offset/2*2+1] & 0xff) << 8) | (space->machine->generic.paletteram.u16[offset/2*2+0] & 0xff);
+ rgb = ((space->machine().generic.paletteram.u16[offset/2*2+1] & 0xff) << 8) | (space->machine().generic.paletteram.u16[offset/2*2+0] & 0xff);
- palette_set_color_rgb(space->machine, offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
+ palette_set_color_rgb(space->machine(), offset/2, pal5bit(rgb >> 0), pal5bit(rgb >> 5), pal5bit(rgb >> 10));
}
static READ8_HANDLER( sdmg2_keys_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
- if (~state->input_select & 0x01) return input_port_read(space->machine, "KEY0");
- if (~state->input_select & 0x02) return input_port_read(space->machine, "KEY1");
- if (~state->input_select & 0x04) return input_port_read(space->machine, "KEY2");
- if (~state->input_select & 0x08) return input_port_read(space->machine, "KEY3");
- if (~state->input_select & 0x10) return input_port_read(space->machine, "KEY4");
+ igs017_state *state = space->machine().driver_data<igs017_state>();
+ if (~state->input_select & 0x01) return input_port_read(space->machine(), "KEY0");
+ if (~state->input_select & 0x02) return input_port_read(space->machine(), "KEY1");
+ if (~state->input_select & 0x04) return input_port_read(space->machine(), "KEY2");
+ if (~state->input_select & 0x08) return input_port_read(space->machine(), "KEY3");
+ if (~state->input_select & 0x10) return input_port_read(space->machine(), "KEY4");
- if (state->input_select == 0x1f) return input_port_read(space->machine, "KEY0"); // in joystick mode
+ if (state->input_select == 0x1f) return input_port_read(space->machine(), "KEY0"); // in joystick mode
- logerror("%s: warning, reading key with input_select = %02x\n", space->machine->describe_context(), state->input_select);
+ logerror("%s: warning, reading key with input_select = %02x\n", space->machine().describe_context(), state->input_select);
return 0xff;
}
static WRITE16_HANDLER( sdmg2_magic_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
COMBINE_DATA(&state->igs_magic[offset]);
if (offset == 0)
@@ -1333,7 +1333,7 @@ static WRITE16_HANDLER( sdmg2_magic_w )
if (ACCESSING_BITS_0_7)
{
state->input_select = data & 0x1f;
- coin_counter_w(space->machine, 0, data & 0x20);
+ coin_counter_w(space->machine(), 0, data & 0x20);
// coin out data & 0x40
state->hopper = data & 0x80;
}
@@ -1342,7 +1342,7 @@ static WRITE16_HANDLER( sdmg2_magic_w )
case 0x02:
if (ACCESSING_BITS_0_7)
{
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x80) ? 0x40000 : 0);
}
break;
@@ -1354,13 +1354,13 @@ static WRITE16_HANDLER( sdmg2_magic_w )
static READ16_HANDLER( sdmg2_magic_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch(state->igs_magic[0])
{
case 0x00:
{
- UINT16 hopper_bit = (state->hopper && ((space->machine->primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
- return input_port_read(space->machine, "COINS") | hopper_bit;
+ UINT16 hopper_bit = (state->hopper && ((space->machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
+ return input_port_read(space->machine(), "COINS") | hopper_bit;
}
case 0x02:
@@ -1395,22 +1395,22 @@ ADDRESS_MAP_END
static READ8_HANDLER( mgdh_keys_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
- if (~state->input_select & 0x04) return input_port_read(space->machine, "KEY0");
- if (~state->input_select & 0x08) return input_port_read(space->machine, "KEY1");
- if (~state->input_select & 0x10) return input_port_read(space->machine, "KEY2");
- if (~state->input_select & 0x20) return input_port_read(space->machine, "KEY3");
- if (~state->input_select & 0x40) return input_port_read(space->machine, "KEY4");
+ igs017_state *state = space->machine().driver_data<igs017_state>();
+ if (~state->input_select & 0x04) return input_port_read(space->machine(), "KEY0");
+ if (~state->input_select & 0x08) return input_port_read(space->machine(), "KEY1");
+ if (~state->input_select & 0x10) return input_port_read(space->machine(), "KEY2");
+ if (~state->input_select & 0x20) return input_port_read(space->machine(), "KEY3");
+ if (~state->input_select & 0x40) return input_port_read(space->machine(), "KEY4");
- if ((state->input_select & 0xfc) == 0xfc) return input_port_read(space->machine, "DSW1");
+ if ((state->input_select & 0xfc) == 0xfc) return input_port_read(space->machine(), "DSW1");
- logerror("%s: warning, reading key with input_select = %02x\n", space->machine->describe_context(), state->input_select);
+ logerror("%s: warning, reading key with input_select = %02x\n", space->machine().describe_context(), state->input_select);
return 0xff;
}
static WRITE16_HANDLER( mgdha_magic_w )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
COMBINE_DATA(&state->igs_magic[offset]);
if (offset == 0)
@@ -1422,7 +1422,7 @@ static WRITE16_HANDLER( mgdha_magic_w )
if (ACCESSING_BITS_0_7)
{
// coin out data & 0x40
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 0, data & 0x80);
}
if ( data & ~0xc0 )
@@ -1446,7 +1446,7 @@ static WRITE16_HANDLER( mgdha_magic_w )
if (ACCESSING_BITS_0_7)
{
// bit 7?
- okim6295_device *oki = space->machine->device<okim6295_device>("oki");
+ okim6295_device *oki = space->machine().device<okim6295_device>("oki");
oki->set_bank_base((data & 0x40) ? 0x40000 : 0);
}
break;
@@ -1469,22 +1469,22 @@ static WRITE16_HANDLER( mgdha_magic_w )
static READ16_HANDLER( mgdha_magic_r )
{
- igs017_state *state = space->machine->driver_data<igs017_state>();
+ igs017_state *state = space->machine().driver_data<igs017_state>();
switch(state->igs_magic[0])
{
case 0x00:
return mgdh_keys_r(space, 0);
case 0x01:
- return input_port_read(space->machine, "BUTTONS");
+ return input_port_read(space->machine(), "BUTTONS");
case 0x02:
- return BITSWAP8(input_port_read(space->machine, "DSW2"), 0,1,2,3,4,5,6,7);
+ return BITSWAP8(input_port_read(space->machine(), "DSW2"), 0,1,2,3,4,5,6,7);
case 0x03:
{
- UINT16 hopper_bit = (state->hopper && ((space->machine->primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
- return input_port_read(space->machine, "COINS") | hopper_bit;
+ UINT16 hopper_bit = (state->hopper && ((space->machine().primary_screen->frame_number()/10)&1)) ? 0x0000 : 0x0001;
+ return input_port_read(space->machine(), "COINS") | hopper_bit;
}
default:
@@ -2066,7 +2066,7 @@ GFXDECODE_END
static INTERRUPT_GEN( iqblocka_interrupt )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
+ igs017_state *state = device->machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1)
{
if (state->nmi_enable)
@@ -2093,7 +2093,7 @@ static const ppi8255_interface iqblocka_ppi8255_intf =
static MACHINE_RESET( iqblocka )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
state->nmi_enable = 0;
state->irq_enable = 0;
state->input_select = 0;
@@ -2139,7 +2139,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( mgcs_interrupt )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
+ igs017_state *state = device->machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1)
{
if (state->irq2_enable)
@@ -2154,7 +2154,7 @@ static INTERRUPT_GEN( mgcs_interrupt )
static MACHINE_RESET( mgcs )
{
- igs017_state *state = machine->driver_data<igs017_state>();
+ igs017_state *state = machine.driver_data<igs017_state>();
MACHINE_RESET_CALL( iqblocka );
state->irq1_enable = 0;
state->irq2_enable = 0;
@@ -2253,7 +2253,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( mgdh_interrupt )
{
- igs017_state *state = device->machine->driver_data<igs017_state>();
+ igs017_state *state = device->machine().driver_data<igs017_state>();
if (cpu_getiloops(device) & 1)
{
if (state->irq2_enable)
diff --git a/src/mame/drivers/igs_m027.c b/src/mame/drivers/igs_m027.c
index 2c041ebb7ec..fb15c02817b 100644
--- a/src/mame/drivers/igs_m027.c
+++ b/src/mame/drivers/igs_m027.c
@@ -54,7 +54,7 @@ public:
/* CGLayer */
static WRITE32_HANDLER( igs_cg_videoram_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
COMBINE_DATA(&state->igs_cg_videoram[offset]);
//if(data!=0)
logerror("PC(%08X) CG @%x = %x!\n",cpu_get_pc(space->cpu),offset ,state->igs_cg_videoram[offset]);
@@ -98,7 +98,7 @@ static WRITE32_HANDLER( igs_cg_videoram_w )
/* TX Layer */
static WRITE32_HANDLER( igs_tx_videoram_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
COMBINE_DATA(&state->igs_tx_videoram[offset]);
tilemap_mark_tile_dirty(state->igs_tx_tilemap,offset);
//if(data!=0)
@@ -107,7 +107,7 @@ static WRITE32_HANDLER( igs_tx_videoram_w )
static TILE_GET_INFO( get_tx_tilemap_tile_info )
{
- igs_m027_state *state = machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = machine.driver_data<igs_m027_state>();
//ppppppppNNNNNNNN
int tileno,colour;
tileno = state->igs_tx_videoram[tile_index] & 0xffff;
@@ -119,7 +119,7 @@ static TILE_GET_INFO( get_tx_tilemap_tile_info )
/* BG Layer */
static WRITE32_HANDLER( igs_bg_videoram_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
COMBINE_DATA(&state->igs_bg_videoram[offset]);
tilemap_mark_tile_dirty(state->igs_bg_tilemap,offset);
//if(data!=0)
@@ -128,7 +128,7 @@ static WRITE32_HANDLER( igs_bg_videoram_w )
static TILE_GET_INFO( get_bg_tilemap_tile_info )
{
- igs_m027_state *state = machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = machine.driver_data<igs_m027_state>();
//ppppppppNNNNNNNN
int tileno,colour;
tileno = state->igs_bg_videoram[tile_index] & 0xffff;
@@ -141,11 +141,11 @@ static TILE_GET_INFO( get_bg_tilemap_tile_info )
/* Pallete Layer */
static WRITE32_HANDLER( igs_pallete32_w )
{
- igs_m027_state *state = space->machine->driver_data<igs_m027_state>();
- space->machine->generic.paletteram.u16=(UINT16 *)state->igs_pallete32;
+ igs_m027_state *state = space->machine().driver_data<igs_m027_state>();
+ space->machine().generic.paletteram.u16=(UINT16 *)state->igs_pallete32;
COMBINE_DATA(&state->igs_pallete32[offset]);
- //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2,space->machine->generic.paletteram.u16[offset*2],0);
- //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2+1,space->machine->generic.paletteram.u16[offset*2+1],0);
+ //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2,space->machine().generic.paletteram.u16[offset*2],0);
+ //paletteram16_xGGGGGRRRRRBBBBB_word_w(offset*2+1,space->machine().generic.paletteram.u16[offset*2+1],0);
//if(data!=0)
//fprintf(stdout,"PALLETE RAM OFFSET %x ,data %x!\n",offset ,state->igs_pallete32[offset]);
}
@@ -154,7 +154,7 @@ static WRITE32_HANDLER( igs_pallete32_w )
static VIDEO_START(igs_majhong)
{
- igs_m027_state *state = machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = machine.driver_data<igs_m027_state>();
state->igs_tx_tilemap= tilemap_create(machine, get_tx_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
tilemap_set_transparent_pen(state->igs_tx_tilemap,15);
state->igs_bg_tilemap= tilemap_create(machine, get_bg_tilemap_tile_info,tilemap_scan_rows, 8, 8,64,32);
@@ -165,9 +165,9 @@ static VIDEO_START(igs_majhong)
static SCREEN_UPDATE(igs_majhong)
{
- igs_m027_state *state = screen->machine->driver_data<igs_m027_state>();
+ igs_m027_state *state = screen->machine().driver_data<igs_m027_state>();
//??????????
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
//??????
tilemap_draw(bitmap,cliprect,state->igs_bg_tilemap,0,0);
@@ -242,11 +242,11 @@ static const UINT8 sdwx_tab[] =
0x12,0x56,0x97,0x26,0x1D,0x5F,0xA7,0xF8,0x89,0x3F,0x14,0x36,0x72,0x3B,0x48,0x7B,
0xF1,0xED,0x72,0xB7,0x7A,0x56,0x05,0xDE,0x7B,0x27,0x6D,0xCF,0x33,0x4C,0x14,0x86,
};
-static void sdwx_decrypt(running_machine *machine)
+static void sdwx_decrypt(running_machine &machine)
{
int i;
- UINT16 *src = (UINT16 *) machine->region("user1")->base();
+ UINT16 *src = (UINT16 *) machine.region("user1")->base();
int rom_size = 0x80000;
@@ -287,11 +287,11 @@ static void sdwx_decrypt(running_machine *machine)
-static void sdwx_gfx_decrypt(running_machine *machine)
+static void sdwx_gfx_decrypt(running_machine &machine)
{
int i;
unsigned rom_size = 0x80000;
- UINT8 *src = (UINT8 *) (machine->region("gfx1")->base());
+ UINT8 *src = (UINT8 *) (machine.region("gfx1")->base());
UINT8 *result_data = auto_alloc_array(machine, UINT8, rom_size);
for (i=0; i<rom_size; i++)
diff --git a/src/mame/drivers/igspoker.c b/src/mame/drivers/igspoker.c
index 17b88f72fbb..bbc6e8676d2 100644
--- a/src/mame/drivers/igspoker.c
+++ b/src/mame/drivers/igspoker.c
@@ -98,7 +98,7 @@ public:
static MACHINE_RESET( igs )
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
state->nmi_enable = 0;
state->hopper = 0;
state->bg_enable = 1;
@@ -106,7 +106,7 @@ static MACHINE_RESET( igs )
static INTERRUPT_GEN( igs_interrupt )
{
- igspoker_state *state = device->machine->driver_data<igspoker_state>();
+ igspoker_state *state = device->machine().driver_data<igspoker_state>();
if (cpu_getiloops(device) % 2) {
device_set_input_line(device, 0, HOLD_LINE);
} else {
@@ -122,7 +122,7 @@ static READ8_HANDLER( igs_irqack_r )
static WRITE8_HANDLER( igs_irqack_w )
{
-// cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+// cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -130,14 +130,14 @@ static WRITE8_HANDLER( igs_irqack_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
int code = state->bg_tile_ram[tile_index];
SET_TILE_INFO(1 + (tile_index & 3), code, 0, 0);
}
static TILE_GET_INFO( get_fg_tile_info )
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
int tile = code & 0x1fff;
SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
@@ -145,28 +145,28 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( bg_tile_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
state->bg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE8_HANDLER( fg_tile_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static VIDEO_START(igs_video)
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 32, 64, 8);
@@ -175,8 +175,8 @@ static VIDEO_START(igs_video)
static SCREEN_UPDATE(igs_video)
{
- igspoker_state *state = screen->machine->driver_data<igspoker_state>();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ igspoker_state *state = screen->machine().driver_data<igspoker_state>();
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
// FIX: CSK227IT must have some way to disable background, or wrong gfx?
if (state->bg_enable) tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
@@ -188,13 +188,13 @@ static SCREEN_UPDATE(igs_video)
static VIDEO_START(cpokerpk)
{
- igspoker_state *state = machine->driver_data<igspoker_state>();
+ igspoker_state *state = machine.driver_data<igspoker_state>();
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 64, 32);
}
static SCREEN_UPDATE(cpokerpk)
{
- igspoker_state *state = screen->machine->driver_data<igspoker_state>();
+ igspoker_state *state = screen->machine().driver_data<igspoker_state>();
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
@@ -210,13 +210,13 @@ static void show_out(igspoker_state *state)
static WRITE8_HANDLER( igs_nmi_and_coins_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x20); // led for coin state->out / state->hopper active
+ set_led_status(space->machine(), 6, data & 0x20); // led for coin state->out / state->hopper active
state->nmi_enable = data & 0x80; // nmi enable?
#ifdef VERBOSE
@@ -229,7 +229,7 @@ static WRITE8_HANDLER( igs_nmi_and_coins_w )
static WRITE8_HANDLER( igs_lamps_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
/*
- Lbits -
7654 3210
@@ -258,7 +258,7 @@ static WRITE8_HANDLER( igs_lamps_w )
static READ8_HANDLER( custom_io_r )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
#ifdef VERBOSE
logerror("PC %06X: Protection read %02x\n",cpu_get_pc(space->cpu), (int) state->protection_res);
#endif
@@ -267,14 +267,14 @@ static READ8_HANDLER( custom_io_r )
static WRITE8_HANDLER( custom_io_w )
{
- igspoker_state *state = space->machine->driver_data<igspoker_state>();
+ igspoker_state *state = space->machine().driver_data<igspoker_state>();
#ifdef VERBOSE
logerror("PC %06X: Protection write %02x\n",cpu_get_pc(space->cpu),data);
#endif
switch (data)
{
- case 0x00: state->protection_res = input_port_read(space->machine, "BUTTONS1"); break;
+ case 0x00: state->protection_res = input_port_read(space->machine(), "BUTTONS1"); break;
// CSK227
case 0x20: state->protection_res = 0x49; break;
case 0x21: state->protection_res = 0x47; break;
@@ -313,14 +313,14 @@ static WRITE8_HANDLER( custom_io_w )
static CUSTOM_INPUT( hopper_r )
{
- igspoker_state *state = field->port->machine->driver_data<igspoker_state>();
- if (state->hopper) return !(field->port->machine->primary_screen->frame_number()%10);
- return input_code_pressed(field->port->machine, KEYCODE_H);
+ igspoker_state *state = field->port->machine().driver_data<igspoker_state>();
+ if (state->hopper) return !(field->port->machine().primary_screen->frame_number()%10);
+ return input_code_pressed(field->port->machine(), KEYCODE_H);
}
static READ8_HANDLER( exp_rom_r )
{
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
return rom[offset+0x10000];
}
@@ -1751,7 +1751,7 @@ ROM_END
static DRIVER_INIT( cpoker )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1765,7 +1765,7 @@ static DRIVER_INIT( cpoker )
static DRIVER_INIT( cpokert )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -1795,7 +1795,7 @@ static DRIVER_INIT( cpokert )
static DRIVER_INIT( cska )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1812,7 +1812,7 @@ static DRIVER_INIT( cska )
static DRIVER_INIT( igs_ncs )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
@@ -1929,7 +1929,7 @@ Clocks
static DRIVER_INIT( igs_ncs2 )
{
- UINT8 *src = (UINT8 *) (machine->region("maincpu")->base());
+ UINT8 *src = (UINT8 *) (machine.region("maincpu")->base());
int i;
for(i = 0; i < 0x10000; i++)
@@ -2006,8 +2006,8 @@ static DRIVER_INIT( chleague )
int length;
UINT8 *rom;
- rom = machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2070,8 +2070,8 @@ static DRIVER_INIT( number10 )
UINT8 *tmp;
UINT8 *rom;
- rom = machine->region("maincpu")->base();
- length = machine->region("maincpu")->bytes();
+ rom = machine.region("maincpu")->base();
+ length = machine.region("maincpu")->bytes();
for (A = 0;A < length;A++)
{
if ((A & 0x09C0) == 0x0880) rom[A] ^= 0x20;
@@ -2100,8 +2100,8 @@ static DRIVER_INIT( number10 )
rom[0xeed] = 0xc3;
/* Descramble graphic */
- rom = machine->region("gfx1")->base();
- length = machine->region("gfx1")->bytes();
+ rom = machine.region("gfx1")->base();
+ length = machine.region("gfx1")->bytes();
tmp = auto_alloc_array(machine, UINT8, length);
memcpy(tmp,rom,length);
for (A = 0;A < length;A++)
@@ -2149,7 +2149,7 @@ ROM_END
static DRIVER_INIT( cpokerpk )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A=0x0714; A < 0xF000; A+=0x1000)
rom[A] ^= 0x20;
@@ -2203,7 +2203,7 @@ ROM_END
static DRIVER_INIT( pktet346 )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0x10000;A++)
diff --git a/src/mame/drivers/ikki.c b/src/mame/drivers/ikki.c
index 7ef6861b1ae..d54a5eab41b 100644
--- a/src/mame/drivers/ikki.c
+++ b/src/mame/drivers/ikki.c
@@ -32,8 +32,8 @@ static READ8_HANDLER( ikki_e000_r )
static WRITE8_HANDLER( ikki_coin_counters )
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
}
/*************************************
@@ -208,7 +208,7 @@ GFXDECODE_END
static MACHINE_START( ikki )
{
- ikki_state *state = machine->driver_data<ikki_state>();
+ ikki_state *state = machine.driver_data<ikki_state>();
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->punch_through_pen));
@@ -216,7 +216,7 @@ static MACHINE_START( ikki )
static MACHINE_RESET( ikki )
{
- ikki_state *state = machine->driver_data<ikki_state>();
+ ikki_state *state = machine.driver_data<ikki_state>();
state->flipscreen = 0;
}
diff --git a/src/mame/drivers/imolagp.c b/src/mame/drivers/imolagp.c
index 7477c0f2c2e..f63de189502 100644
--- a/src/mame/drivers/imolagp.c
+++ b/src/mame/drivers/imolagp.c
@@ -117,7 +117,7 @@ public:
static WRITE8_HANDLER( transmit_data_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->mComData[state->mComCount++] = data;
}
@@ -137,24 +137,24 @@ static READ8_HANDLER( receive_data_r )
*/
static WRITE8_HANDLER( transmit_data_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->mLatchedData[offset] = data;
}
static READ8_HANDLER( trigger_slave_nmi_r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
device_set_input_line(state->slave, INPUT_LINE_NMI, PULSE_LINE);
return 0;
}
static READ8_HANDLER( receive_data_r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
return state->mLatchedData[offset];
}
#endif
-static void initialize_colors( running_machine *machine )
+static void initialize_colors( running_machine &machine )
{
/* optional runtime remapping of colors */
static const UINT8 color[0x10][3] =
@@ -186,7 +186,7 @@ static void initialize_colors( running_machine *machine )
static VIDEO_START( imolagp )
{
- imolagp_state *state = machine->driver_data<imolagp_state>();
+ imolagp_state *state = machine.driver_data<imolagp_state>();
memset(state->videoram, 0, sizeof(state->videoram));
state->save_item(NAME(state->videoram));
@@ -197,7 +197,7 @@ static VIDEO_START( imolagp )
static SCREEN_UPDATE( imolagp )
{
- imolagp_state *state = screen->machine->driver_data<imolagp_state>();
+ imolagp_state *state = screen->machine().driver_data<imolagp_state>();
int scroll2 = state->scroll ^ 0x03;
int pass;
for (pass = 0; pass < 2; pass++)
@@ -275,13 +275,13 @@ static WRITE8_HANDLER( imola_ledram_w )
static READ8_HANDLER( steerlatch_r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
return state->steerlatch;
}
static WRITE8_HANDLER( screenram_w )
{ /* ?! */
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
switch (state->draw_mode)
{
case 0x82:
@@ -299,7 +299,7 @@ static WRITE8_HANDLER( screenram_w )
static READ8_HANDLER( imola_slave_port05r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
memcpy(state->videoram[2], state->videoram[1], 0x4000); /* hack! capture before sprite plane is erased */
state->draw_mode = 0x05;
return 0;
@@ -307,14 +307,14 @@ static READ8_HANDLER( imola_slave_port05r )
static READ8_HANDLER( imola_slave_port06r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->draw_mode = 0x06;
return 0;
}
static READ8_HANDLER( imola_slave_port81r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->draw_mode = 0x81;
memcpy(state->videoram[2], state->videoram[1], 0x4000); /* hack! capture before sprite plane is erased */
return 0;
@@ -322,20 +322,20 @@ static READ8_HANDLER( imola_slave_port81r )
static READ8_HANDLER( imola_slave_port82r )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->draw_mode = 0x82;
return 0;
}
static WRITE8_HANDLER( vreg_control_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
state->control = data;
}
static WRITE8_HANDLER( vreg_data_w )
{
- imolagp_state *state = space->machine->driver_data<imolagp_state>();
+ imolagp_state *state = space->machine().driver_data<imolagp_state>();
switch (state->control)
{
case 0x0e:
@@ -465,7 +465,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( master_interrupt )
{
- imolagp_state *state = device->machine->driver_data<imolagp_state>();
+ imolagp_state *state = device->machine().driver_data<imolagp_state>();
int which = cpu_getiloops(device);
if (which == 0)
{
@@ -477,7 +477,7 @@ static INTERRUPT_GEN( master_interrupt )
}
else
{
- int newsteer = input_port_read(device->machine, "2802") & 0xf;
+ int newsteer = input_port_read(device->machine(), "2802") & 0xf;
if (newsteer != state->oldsteer)
{
if (state->steerlatch == 0)
@@ -510,9 +510,9 @@ static const ppi8255_interface ppi8255_intf =
static MACHINE_START( imolagp )
{
- imolagp_state *state = machine->driver_data<imolagp_state>();
+ imolagp_state *state = machine.driver_data<imolagp_state>();
- state->slavecpu = machine->device("slave");
+ state->slavecpu = machine.device("slave");
state->save_item(NAME(state->control));
state->save_item(NAME(state->scroll));
@@ -529,7 +529,7 @@ static MACHINE_START( imolagp )
static MACHINE_RESET( imolagp )
{
- imolagp_state *state = machine->driver_data<imolagp_state>();
+ imolagp_state *state = machine.driver_data<imolagp_state>();
state->control = 0;
state->scroll = 0;
diff --git a/src/mame/drivers/intrscti.c b/src/mame/drivers/intrscti.c
index 141dd6d62fa..6415b38e2a8 100644
--- a/src/mame/drivers/intrscti.c
+++ b/src/mame/drivers/intrscti.c
@@ -27,7 +27,7 @@ public:
static READ8_HANDLER( unk_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static ADDRESS_MAP_START( intrscti_map, AS_PROGRAM, 8 )
@@ -68,11 +68,11 @@ static VIDEO_START(intrscti)
static SCREEN_UPDATE(intrscti)
{
- intrscti_state *state = screen->machine->driver_data<intrscti_state>();
+ intrscti_state *state = screen->machine().driver_data<intrscti_state>();
int y,x;
int count;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
count = 0;
for (y=0;y<64;y++)
@@ -81,7 +81,7 @@ static SCREEN_UPDATE(intrscti)
{
int dat;
dat = state->ram[count];
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[0],dat/*+0x100*/,0,0,0,x*8,y*8,0);
count++;
}
}
@@ -130,7 +130,7 @@ ROM_END
static DRIVER_INIT( intrscti )
{
- UINT8 *cpu = machine->region( "maincpu" )->base();
+ UINT8 *cpu = machine.region( "maincpu" )->base();
int i;
for (i=0x8000;i<0x8fff;i++)
{
diff --git a/src/mame/drivers/inufuku.c b/src/mame/drivers/inufuku.c
index ea03f14bd08..1fea80a2974 100644
--- a/src/mame/drivers/inufuku.c
+++ b/src/mame/drivers/inufuku.c
@@ -83,7 +83,7 @@ TODO:
static WRITE16_HANDLER( inufuku_soundcommand_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
if (ACCESSING_BITS_0_7)
{
/* hack... sound doesn't work otherwise */
@@ -98,13 +98,13 @@ static WRITE16_HANDLER( inufuku_soundcommand_w )
static WRITE8_HANDLER( pending_command_clear_w )
{
- inufuku_state *state = space->machine->driver_data<inufuku_state>();
+ inufuku_state *state = space->machine().driver_data<inufuku_state>();
state->pending_command = 0;
}
static WRITE8_HANDLER( inufuku_soundrombank_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
/******************************************************************************
@@ -115,7 +115,7 @@ static WRITE8_HANDLER( inufuku_soundrombank_w )
static CUSTOM_INPUT( soundflag_r )
{
- inufuku_state *state = field->port->machine->driver_data<inufuku_state>();
+ inufuku_state *state = field->port->machine().driver_data<inufuku_state>();
UINT16 soundflag = state->pending_command ? 0 : 1;
return soundflag;
@@ -298,7 +298,7 @@ GFXDECODE_END
static void irqhandler( device_t *device, int irq )
{
- inufuku_state *state = device->machine->driver_data<inufuku_state>();
+ inufuku_state *state = device->machine().driver_data<inufuku_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -316,13 +316,13 @@ static const ym2610_interface ym2610_config =
static MACHINE_START( inufuku )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
- UINT8 *ROM = machine->region("audiocpu")->base();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x8000);
memory_set_bank(machine, "bank1", 0);
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->pending_command));
state->save_item(NAME(state->bg_scrollx));
@@ -336,7 +336,7 @@ static MACHINE_START( inufuku )
static MACHINE_RESET( inufuku )
{
- inufuku_state *state = machine->driver_data<inufuku_state>();
+ inufuku_state *state = machine.driver_data<inufuku_state>();
state->pending_command = 1;
state->bg_scrollx = 0;
diff --git a/src/mame/drivers/iqblock.c b/src/mame/drivers/iqblock.c
index 0cb09e96683..a232c67c29a 100644
--- a/src/mame/drivers/iqblock.c
+++ b/src/mame/drivers/iqblock.c
@@ -60,7 +60,7 @@ Grndtour:
static WRITE8_HANDLER( iqblock_prot_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
state->rambase[0xe26] = data;
state->rambase[0xe27] = data;
state->rambase[0xe1c] = data;
@@ -68,7 +68,7 @@ static WRITE8_HANDLER( iqblock_prot_w )
static WRITE8_HANDLER( grndtour_prot_w )
{
- iqblock_state *state = space->machine->driver_data<iqblock_state>();
+ iqblock_state *state = space->machine().driver_data<iqblock_state>();
state->rambase[0xe39] = data;
state->rambase[0xe3a] = data;
state->rambase[0xe2f] = data;
@@ -86,25 +86,25 @@ static INTERRUPT_GEN( iqblock_interrupt )
static WRITE8_HANDLER( iqblock_irqack_w )
{
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static READ8_HANDLER( extrarom_r )
{
- return space->machine->region("user1")->base()[offset];
+ return space->machine().region("user1")->base()[offset];
}
static WRITE8_DEVICE_HANDLER( port_C_w )
{
- iqblock_state *state = device->machine->driver_data<iqblock_state>();
+ iqblock_state *state = device->machine().driver_data<iqblock_state>();
/* bit 4 unknown; it is pulsed at the end of every NMI */
/* bit 5 seems to be 0 during screen redraw */
state->videoenable = data & 0x20;
/* bit 6 is coin counter */
- coin_counter_w(device->machine, 0,data & 0x40);
+ coin_counter_w(device->machine(), 0,data & 0x40);
/* bit 7 could be a second coin counter, but coin 2 doesn't seem to work... */
}
@@ -427,8 +427,8 @@ ROM_END
static DRIVER_INIT( iqblock )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -440,18 +440,18 @@ static DRIVER_INIT( iqblock )
}
/* initialize pointers for I/O mapped RAM */
- machine->generic.paletteram.u8 = rom + 0x12000;
- machine->generic.paletteram2.u8 = rom + 0x12800;
+ machine.generic.paletteram.u8 = rom + 0x12000;
+ machine.generic.paletteram2.u8 = rom + 0x12800;
state->fgvideoram = rom + 0x16800;
state->bgvideoram = rom + 0x17000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe26, 0xfe26, FUNC(iqblock_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe26, 0xfe26, FUNC(iqblock_prot_w));
state->video_type=1;
}
static DRIVER_INIT( grndtour )
{
- iqblock_state *state = machine->driver_data<iqblock_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ iqblock_state *state = machine.driver_data<iqblock_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
/* decrypt the program ROM */
@@ -463,11 +463,11 @@ static DRIVER_INIT( grndtour )
}
/* initialize pointers for I/O mapped RAM */
- machine->generic.paletteram.u8 = rom + 0x12000;
- machine->generic.paletteram2.u8 = rom + 0x12800;
+ machine.generic.paletteram.u8 = rom + 0x12000;
+ machine.generic.paletteram2.u8 = rom + 0x12800;
state->fgvideoram = rom + 0x16800;
state->bgvideoram = rom + 0x17000;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe39, 0xfe39, FUNC(grndtour_prot_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfe39, 0xfe39, FUNC(grndtour_prot_w));
state->video_type=0;
}
diff --git a/src/mame/drivers/irobot.c b/src/mame/drivers/irobot.c
index e8bd0a2446d..9eae20cd732 100644
--- a/src/mame/drivers/irobot.c
+++ b/src/mame/drivers/irobot.c
@@ -94,7 +94,7 @@
static WRITE8_HANDLER( irobot_nvram_w )
{
- irobot_state *state = space->machine->driver_data<irobot_state>();
+ irobot_state *state = space->machine().driver_data<irobot_state>();
state->m_nvram[offset] = data & 0x0f;
}
@@ -108,13 +108,13 @@ static WRITE8_HANDLER( irobot_nvram_w )
static WRITE8_HANDLER( irobot_clearirq_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_IRQ_LINE ,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_IRQ_LINE ,CLEAR_LINE);
}
static WRITE8_HANDLER( irobot_clearfirq_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6809_FIRQ_LINE ,CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6809_FIRQ_LINE ,CLEAR_LINE);
}
diff --git a/src/mame/drivers/ironhors.c b/src/mame/drivers/ironhors.c
index 6aabbe42510..90ac2e79e63 100644
--- a/src/mame/drivers/ironhors.c
+++ b/src/mame/drivers/ironhors.c
@@ -23,7 +23,7 @@
static INTERRUPT_GEN( ironhors_interrupt )
{
- ironhors_state *state = device->machine->driver_data<ironhors_state>();
+ ironhors_state *state = device->machine().driver_data<ironhors_state>();
if (cpu_getiloops(device) == 0)
{
@@ -39,7 +39,7 @@ static INTERRUPT_GEN( ironhors_interrupt )
static WRITE8_HANDLER( ironhors_sh_irqtrigger_w )
{
- ironhors_state *state = space->machine->driver_data<ironhors_state>();
+ ironhors_state *state = space->machine().driver_data<ironhors_state>();
device_set_input_line_and_vector(state->soundcpu, 0, HOLD_LINE, 0xff);
}
@@ -358,9 +358,9 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( ironhors )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
- state->soundcpu = machine->device("soundcpu");
+ state->soundcpu = machine.device("soundcpu");
state->save_item(NAME(state->palettebank));
state->save_item(NAME(state->charbank));
@@ -369,7 +369,7 @@ static MACHINE_START( ironhors )
static MACHINE_RESET( ironhors )
{
- ironhors_state *state = machine->driver_data<ironhors_state>();
+ ironhors_state *state = machine.driver_data<ironhors_state>();
state->palettebank = 0;
state->charbank = 0;
@@ -424,7 +424,7 @@ MACHINE_CONFIG_END
static INTERRUPT_GEN( farwest_interrupt )
{
- ironhors_state *state = device->machine->driver_data<ironhors_state>();
+ ironhors_state *state = device->machine().driver_data<ironhors_state>();
if (cpu_getiloops(device) &1)
{
@@ -440,7 +440,7 @@ static INTERRUPT_GEN( farwest_interrupt )
static READ8_DEVICE_HANDLER( farwest_soundlatch_r )
{
- ironhors_state *state = device->machine->driver_data<ironhors_state>();
+ ironhors_state *state = device->machine().driver_data<ironhors_state>();
return soundlatch_r(state->soundcpu->memory().space(AS_PROGRAM), 0);
}
diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c
index 838f931d214..ae89e076831 100644
--- a/src/mame/drivers/istellar.c
+++ b/src/mame/drivers/istellar.c
@@ -48,7 +48,7 @@ public:
/* VIDEO GOODS */
static SCREEN_UPDATE( istellar )
{
- istellar_state *state = screen->machine->driver_data<istellar_state>();
+ istellar_state *state = screen->machine().driver_data<istellar_state>();
int charx, chary;
/* clear */
@@ -70,7 +70,7 @@ static SCREEN_UPDATE( istellar )
{
int current_screen_character = (chary*32) + charx;
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->tile_ram[current_screen_character],
(state->tile_control_ram[current_screen_character] & 0x0f),
0, 0, charx*8, chary*8, 0);
@@ -86,8 +86,8 @@ static SCREEN_UPDATE( istellar )
static MACHINE_START( istellar )
{
- istellar_state *state = machine->driver_data<istellar_state>();
- state->laserdisc = machine->device("laserdisc");
+ istellar_state *state = machine.driver_data<istellar_state>();
+ state->laserdisc = machine.device("laserdisc");
}
@@ -96,14 +96,14 @@ static MACHINE_START( istellar )
/* Z80 0 R/W */
static READ8_HANDLER(z80_0_latch1_read)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
/*logerror("CPU0 : reading LDP status latch (%x)\n", state->ldp_latch1);*/
return state->ldp_latch1;
}
static WRITE8_HANDLER(z80_0_latch2_write)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
/*logerror("CPU0 : writing cpu_latch2 (%x). Potentially followed by an IRQ.\n", data);*/
state->ldp_latch2 = data;
@@ -111,7 +111,7 @@ static WRITE8_HANDLER(z80_0_latch2_write)
if (state->z80_2_nmi_enable)
{
logerror("Executing an NMI on CPU2\n");
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_NMI, PULSE_LINE); /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_NMI, PULSE_LINE); /* Maybe this is a ASSERT_LINE, CLEAR_LINE combo? */
state->z80_2_nmi_enable = 0;
}
}
@@ -123,7 +123,7 @@ static WRITE8_HANDLER(z80_0_latch2_write)
/* Z80 2 R/W */
static READ8_HANDLER(z80_2_ldp_read)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
UINT8 readResult = laserdisc_data_r(state->laserdisc);
logerror("CPU2 : reading LDP : %x\n", readResult);
return readResult;
@@ -131,14 +131,14 @@ static READ8_HANDLER(z80_2_ldp_read)
static READ8_HANDLER(z80_2_latch2_read)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : reading latch2 (%x)\n", state->ldp_latch2);
return state->ldp_latch2;
}
static READ8_HANDLER(z80_2_nmienable)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : ENABLING NMI\n");
state->z80_2_nmi_enable = 1;
return 0x00;
@@ -152,14 +152,14 @@ static READ8_HANDLER(z80_2_unknown_read)
static WRITE8_HANDLER(z80_2_latch1_write)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : writing latch1 (%x)\n", data);
state->ldp_latch1 = data;
}
static WRITE8_HANDLER(z80_2_ldp_write)
{
- istellar_state *state = space->machine->driver_data<istellar_state>();
+ istellar_state *state = space->machine().driver_data<istellar_state>();
logerror("CPU2 : writing LDP : 0x%x\n", data);
laserdisc_data_w(state->laserdisc,data);
}
@@ -274,7 +274,7 @@ static PALETTE_INIT( istellar )
int i;
/* Oddly enough, the top 4 bits of each byte is 0 */
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int r,g,b;
int bit0,bit1,bit2,bit3;
@@ -330,7 +330,7 @@ static INTERRUPT_GEN( vblank_callback_istellar )
device_set_input_line(device, 0, ASSERT_LINE);
/* Interrupt presumably comes from the LDP's status strobe */
- cputag_set_input_line(device->machine, "sub", 0, ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "sub", 0, ASSERT_LINE);
}
@@ -411,7 +411,7 @@ ROM_END
static DRIVER_INIT( istellar )
{
- istellar_state *state = machine->driver_data<istellar_state>();
+ istellar_state *state = machine.driver_data<istellar_state>();
state->z80_2_nmi_enable = 0;
}
diff --git a/src/mame/drivers/itech32.c b/src/mame/drivers/itech32.c
index ecd0510d964..f09db6c8213 100644
--- a/src/mame/drivers/itech32.c
+++ b/src/mame/drivers/itech32.c
@@ -364,8 +364,8 @@ Notes:
-#define START_TMS_SPINNING(n) do { device_spin_until_trigger(space->cpu, 7351 + n); space->machine->driver_data<itech32_state>()->tms_spinning[n] = 1; } while (0)
-#define STOP_TMS_SPINNING(machine, n) do { machine->scheduler().trigger(7351 + n); machine->driver_data<itech32_state>()->tms_spinning[n] = 0; } while (0)
+#define START_TMS_SPINNING(n) do { device_spin_until_trigger(space->cpu, 7351 + n); space->machine().driver_data<itech32_state>()->tms_spinning[n] = 1; } while (0)
+#define STOP_TMS_SPINNING(machine, n) do { (machine).scheduler().trigger(7351 + n); (machine).driver_data<itech32_state>()->tms_spinning[n] = 0; } while (0)
@@ -392,9 +392,9 @@ INLINE int determine_irq_state(itech32_state *state, int vint, int xint, int qin
}
-void itech32_update_interrupts(running_machine *machine, int vint, int xint, int qint)
+void itech32_update_interrupts(running_machine &machine, int vint, int xint, int qint)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/* update the states */
if (vint != -1) state->vint_state = vint;
if (xint != -1) state->xint_state = xint;
@@ -418,14 +418,14 @@ void itech32_update_interrupts(running_machine *machine, int vint, int xint, int
static INTERRUPT_GEN( generate_int1 )
{
/* signal the NMI */
- itech32_update_interrupts(device->machine, 1, -1, -1);
- if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine->primary_screen->vpos());
+ itech32_update_interrupts(device->machine(), 1, -1, -1);
+ if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine().primary_screen->vpos());
}
static WRITE16_HANDLER( int1_ack_w )
{
- itech32_update_interrupts(space->machine, 0, -1, -1);
+ itech32_update_interrupts(space->machine(), 0, -1, -1);
}
@@ -438,7 +438,7 @@ static WRITE16_HANDLER( int1_ack_w )
static MACHINE_RESET( itech32 )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
state->vint_state = state->xint_state = state->qint_state = 0;
state->sound_data = 0;
state->sound_return = 0;
@@ -467,7 +467,7 @@ static MACHINE_RESET( drivedge )
static CUSTOM_INPUT( special_port_r )
{
- itech32_state *state = field->port->machine->driver_data<itech32_state>();
+ itech32_state *state = field->port->machine().driver_data<itech32_state>();
if (state->sound_int_state)
state->special_result ^= 1;
@@ -476,8 +476,8 @@ static CUSTOM_INPUT( special_port_r )
static READ16_HANDLER( trackball_r )
{
- int lower = input_port_read(space->machine, "TRACKX1");
- int upper = input_port_read(space->machine, "TRACKY1");
+ int lower = input_port_read(space->machine(), "TRACKX1");
+ int upper = input_port_read(space->machine(), "TRACKY1");
return (lower & 15) | ((upper & 15) << 4);
}
@@ -485,8 +485,8 @@ static READ16_HANDLER( trackball_r )
static READ32_HANDLER( trackball32_8bit_r )
{
- int lower = input_port_read(space->machine, "TRACKX1");
- int upper = input_port_read(space->machine, "TRACKY1");
+ int lower = input_port_read(space->machine(), "TRACKX1");
+ int upper = input_port_read(space->machine(), "TRACKY1");
return (lower & 255) | ((upper & 255) << 8);
}
@@ -494,16 +494,16 @@ static READ32_HANDLER( trackball32_8bit_r )
static READ32_HANDLER( trackball32_4bit_p1_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
- attotime curtime = space->machine->time();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
+ attotime curtime = space->machine().time();
- if ((curtime - state->p1_lasttime) > space->machine->primary_screen->scan_period())
+ if ((curtime - state->p1_lasttime) > space->machine().primary_screen->scan_period())
{
int upper, lower;
int dx, dy;
- int curx = input_port_read(space->machine, "TRACKX1");
- int cury = input_port_read(space->machine, "TRACKY1");
+ int curx = input_port_read(space->machine(), "TRACKX1");
+ int cury = input_port_read(space->machine(), "TRACKY1");
dx = curx - state->p1_effx;
if (dx < -0x80) dx += 0x100;
@@ -531,16 +531,16 @@ static READ32_HANDLER( trackball32_4bit_p1_r )
static READ32_HANDLER( trackball32_4bit_p2_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
- attotime curtime = space->machine->time();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
+ attotime curtime = space->machine().time();
- if ((curtime - state->p2_lasttime) > space->machine->primary_screen->scan_period())
+ if ((curtime - state->p2_lasttime) > space->machine().primary_screen->scan_period())
{
int upper, lower;
int dx, dy;
- int curx = input_port_read(space->machine, "TRACKX2");
- int cury = input_port_read(space->machine, "TRACKY2");
+ int curx = input_port_read(space->machine(), "TRACKX2");
+ int cury = input_port_read(space->machine(), "TRACKY2");
dx = curx - state->p2_effx;
if (dx < -0x80) dx += 0x100;
@@ -575,7 +575,7 @@ static READ32_HANDLER( trackball32_4bit_combined_r )
static READ32_HANDLER( drivedge_steering_r )
{
- int val = input_port_read(space->machine, "STEER") * 2 - 0x100;
+ int val = input_port_read(space->machine(), "STEER") * 2 - 0x100;
if (val < 0) val = 0x100 | (-val);
return val << 16;
}
@@ -583,7 +583,7 @@ static READ32_HANDLER( drivedge_steering_r )
static READ32_HANDLER( drivedge_gas_r )
{
- int val = input_port_read(space->machine, "GAS");
+ int val = input_port_read(space->machine(), "GAS");
return val << 16;
}
@@ -596,14 +596,14 @@ static READ32_HANDLER( drivedge_gas_r )
static READ16_HANDLER( wcbowl_prot_result_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
return state->main_ram[0x111d/2];
}
static READ32_HANDLER( itech020_prot_result_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
UINT32 result = ((UINT32 *)state->main_ram)[state->itech020_prot_address >> 2];
result >>= (~state->itech020_prot_address & 3) * 8;
return (result & 0xff) << 8;
@@ -631,7 +631,7 @@ static READ32_HANDLER( gtclass_prot_result_r )
static WRITE8_HANDLER( sound_bank_w )
{
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("soundcpu")->base()[0x10000 + data * 0x4000]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("soundcpu")->base()[0x10000 + data * 0x4000]);
}
@@ -644,7 +644,7 @@ static WRITE8_HANDLER( sound_bank_w )
static TIMER_CALLBACK( delayed_sound_data_w )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
state->sound_data = param;
state->sound_int_state = 1;
cputag_set_input_line(machine, "soundcpu", M6809_IRQ_LINE, ASSERT_LINE);
@@ -654,13 +654,13 @@ static TIMER_CALLBACK( delayed_sound_data_w )
static WRITE16_HANDLER( sound_data_w )
{
if (ACCESSING_BITS_0_7)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data & 0xff);
}
static READ32_HANDLER( sound_data32_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
return state->sound_return << 16;
}
@@ -668,14 +668,14 @@ static READ32_HANDLER( sound_data32_r )
static WRITE32_HANDLER( sound_data32_w )
{
if (ACCESSING_BITS_16_23)
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), (data >> 16) & 0xff);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), (data >> 16) & 0xff);
}
static READ8_HANDLER( sound_data_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
- cputag_set_input_line(space->machine, "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
+ itech32_state *state = space->machine().driver_data<itech32_state>();
+ cputag_set_input_line(space->machine(), "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
state->sound_int_state = 0;
return state->sound_data;
}
@@ -683,7 +683,7 @@ static READ8_HANDLER( sound_data_r )
static WRITE8_HANDLER( sound_return_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
state->sound_return = data;
}
@@ -703,7 +703,7 @@ static READ8_HANDLER( sound_data_buffer_r )
static WRITE8_DEVICE_HANDLER( drivedge_portb_out )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
// logerror("PIA port B write = %02x\n", data);
/* bit 0 controls the fan light */
@@ -712,30 +712,30 @@ static WRITE8_DEVICE_HANDLER( drivedge_portb_out )
/* bit 4 controls the ticket dispenser */
/* bit 5 controls the coin counter */
/* bit 6 controls the diagnostic sound LED */
- set_led_status(space->machine, 1, data & 0x01);
- set_led_status(space->machine, 2, data & 0x02);
- set_led_status(space->machine, 3, data & 0x04);
- ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3);
- coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
+ set_led_status(space->machine(), 1, data & 0x01);
+ set_led_status(space->machine(), 2, data & 0x02);
+ set_led_status(space->machine(), 3, data & 0x04);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, (data & 0x10) << 3);
+ coin_counter_w(space->machine(), 0, (data & 0x20) >> 5);
}
static WRITE8_DEVICE_HANDLER( drivedge_turbo_light )
{
- set_led_status(device->machine, 0, data);
+ set_led_status(device->machine(), 0, data);
}
static WRITE8_DEVICE_HANDLER( pia_portb_out )
{
- address_space *space = device->machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
// logerror("PIA port B write = %02x\n", data);
/* bit 4 controls the ticket dispenser */
/* bit 5 controls the coin counter */
/* bit 6 controls the diagnostic sound LED */
- ticket_dispenser_w(device->machine->device("ticket"), 0, (data & 0x10) << 3);
- coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, (data & 0x10) << 3);
+ coin_counter_w(space->machine(), 0, (data & 0x20) >> 5);
}
@@ -775,7 +775,7 @@ static const via6522_interface drivedge_via_interface =
static WRITE8_HANDLER( firq_clear_w )
{
- cputag_set_input_line(space->machine, "soundcpu", M6809_FIRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", M6809_FIRQ_LINE, CLEAR_LINE);
}
@@ -788,68 +788,68 @@ static WRITE8_HANDLER( firq_clear_w )
static WRITE32_HANDLER( tms_reset_assert_w )
{
- cputag_set_input_line(space->machine, "dsp1", INPUT_LINE_RESET, ASSERT_LINE);
- cputag_set_input_line(space->machine, "dsp2", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp1", INPUT_LINE_RESET, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "dsp2", INPUT_LINE_RESET, ASSERT_LINE);
}
static WRITE32_HANDLER( tms_reset_clear_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
/* kludge to prevent crash on first boot */
if ((state->tms1_ram[0] & 0xff000000) == 0)
{
- cputag_set_input_line(space->machine, "dsp1", INPUT_LINE_RESET, CLEAR_LINE);
- STOP_TMS_SPINNING(space->machine, 0);
+ cputag_set_input_line(space->machine(), "dsp1", INPUT_LINE_RESET, CLEAR_LINE);
+ STOP_TMS_SPINNING(space->machine(), 0);
}
if ((state->tms2_ram[0] & 0xff000000) == 0)
{
- cputag_set_input_line(space->machine, "dsp2", INPUT_LINE_RESET, CLEAR_LINE);
- STOP_TMS_SPINNING(space->machine, 1);
+ cputag_set_input_line(space->machine(), "dsp2", INPUT_LINE_RESET, CLEAR_LINE);
+ STOP_TMS_SPINNING(space->machine(), 1);
}
}
static WRITE32_HANDLER( tms1_68k_ram_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms1_ram[offset]);
if (offset == 0) COMBINE_DATA(state->tms1_boot);
- if (offset == 0x382 && state->tms_spinning[0]) STOP_TMS_SPINNING(space->machine, 0);
+ if (offset == 0x382 && state->tms_spinning[0]) STOP_TMS_SPINNING(space->machine(), 0);
if (!state->tms_spinning[0])
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static WRITE32_HANDLER( tms2_68k_ram_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms2_ram[offset]);
- if (offset == 0x382 && state->tms_spinning[1]) STOP_TMS_SPINNING(space->machine, 1);
+ if (offset == 0x382 && state->tms_spinning[1]) STOP_TMS_SPINNING(space->machine(), 1);
if (!state->tms_spinning[1])
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static WRITE32_HANDLER( tms1_trigger_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms1_ram[offset]);
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static WRITE32_HANDLER( tms2_trigger_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
COMBINE_DATA(&state->tms2_ram[offset]);
- space->machine->scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
+ space->machine().scheduler().boost_interleave(attotime::from_hz(CPU020_CLOCK/256), attotime::from_usec(20));
}
static READ32_HANDLER( drivedge_tms1_speedup_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (state->tms1_ram[0x382] == 0 && cpu_get_pc(space->cpu) == 0xee) START_TMS_SPINNING(0);
return state->tms1_ram[0x382];
}
@@ -857,7 +857,7 @@ static READ32_HANDLER( drivedge_tms1_speedup_r )
static READ32_HANDLER( drivedge_tms2_speedup_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (state->tms2_ram[0x382] == 0 && cpu_get_pc(space->cpu) == 0x809808) START_TMS_SPINNING(1);
return state->tms2_ram[0x382];
}
@@ -895,11 +895,11 @@ static READ32_DEVICE_HANDLER( timekeeper_32be_r )
void itech32_state::nvram_init(nvram_device &nvram, void *base, size_t length)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = m_machine.driver_data<itech32_state>();
// if nvram is the main RAM, don't overwrite exception vectors
int start = (base == state->main_ram) ? 0x80 : 0x00;
for (int i = start; i < length; i++)
- ((UINT8 *)base)[i] = machine->rand();
+ ((UINT8 *)base)[i] = m_machine.rand();
// due to accessing uninitialized RAM, we need this hack
if (state->is_drivedge)
@@ -957,7 +957,7 @@ ADDRESS_MAP_END
static READ32_HANDLER( test1_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31 && !state->written[0x100 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0x100 + offset*4+0);
if (ACCESSING_BITS_16_23 && !state->written[0x100 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0x100 + offset*4+1);
if (ACCESSING_BITS_8_15 && !state->written[0x100 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0x100 + offset*4+2);
@@ -967,7 +967,7 @@ static READ32_HANDLER( test1_r )
static WRITE32_HANDLER( test1_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31) state->written[0x100 + offset*4+0] = 1;
if (ACCESSING_BITS_16_23) state->written[0x100 + offset*4+1] = 1;
if (ACCESSING_BITS_8_15) state->written[0x100 + offset*4+2] = 1;
@@ -977,7 +977,7 @@ static WRITE32_HANDLER( test1_w )
static READ32_HANDLER( test2_r )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31 && !state->written[0xc00 + offset*4+0]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0xc00 + offset*4+0);
if (ACCESSING_BITS_16_23 && !state->written[0xc00 + offset*4+1]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0xc00 + offset*4+1);
if (ACCESSING_BITS_8_15 && !state->written[0xc00 + offset*4+2]) logerror("%06X:read from uninitialized memory %04X\n", cpu_get_pc(space->cpu), 0xc00 + offset*4+2);
@@ -987,7 +987,7 @@ static READ32_HANDLER( test2_r )
static WRITE32_HANDLER( test2_w )
{
- itech32_state *state = space->machine->driver_data<itech32_state>();
+ itech32_state *state = space->machine().driver_data<itech32_state>();
if (ACCESSING_BITS_24_31) state->written[0xc00 + offset*4+0] = 1;
if (ACCESSING_BITS_16_23) state->written[0xc00 + offset*4+1] = 1;
if (ACCESSING_BITS_8_15) state->written[0xc00 + offset*4+2] = 1;
@@ -3963,16 +3963,16 @@ ROM_END
*
*************************************/
-static void init_program_rom(running_machine *machine)
+static void init_program_rom(running_machine &machine)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
memcpy(state->main_ram, state->main_rom, 0x80);
}
static DRIVER_INIT( timekill )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 512;
state->planes = 2;
@@ -3982,7 +3982,7 @@ static DRIVER_INIT( timekill )
static DRIVER_INIT( hardyard )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
@@ -3992,7 +3992,7 @@ static DRIVER_INIT( hardyard )
static DRIVER_INIT( bloodstm )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
@@ -4002,20 +4002,20 @@ static DRIVER_INIT( bloodstm )
static DRIVER_INIT( drivedge )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
state->is_drivedge = 1;
- machine->device("dsp1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms1_speedup_r));
- machine->device("dsp2")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms2_speedup_r));
+ machine.device("dsp1")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms1_speedup_r));
+ machine.device("dsp2")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x8382, 0x8382, FUNC(drivedge_tms2_speedup_r));
}
static DRIVER_INIT( wcbowl )
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/*
This is the 3 tier PCB set:
Main P/N 1059 Rev 3 (see Hot Memory PCB layout above)
@@ -4026,17 +4026,17 @@ static DRIVER_INIT( wcbowl )
state->vram_height = 1024;
state->planes = 1;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680001, FUNC(trackball_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680001, FUNC(trackball_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x578000, 0x57ffff);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680080, 0x680081, FUNC(wcbowl_prot_result_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x680080, 0x680081);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_read(0x578000, 0x57ffff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680080, 0x680081, FUNC(wcbowl_prot_result_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x680080, 0x680081);
}
-static void init_sftm_common(running_machine *machine, int prot_addr)
+static void init_sftm_common(running_machine &machine, int prot_addr)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 1;
@@ -4044,8 +4044,8 @@ static void init_sftm_common(running_machine *machine, int prot_addr)
state->itech020_prot_address = prot_addr;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
}
@@ -4061,9 +4061,9 @@ static DRIVER_INIT( sftm110 )
}
-static void init_shuffle_bowl_common(running_machine *machine, int prot_addr)
+static void init_shuffle_bowl_common(running_machine &machine, int prot_addr)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
/*
The newest versions of World Class Bowling are on the same exact
platform as Shuffle Shot. So We'll use the same general INIT
@@ -4076,10 +4076,10 @@ static void init_shuffle_bowl_common(running_machine *machine, int prot_addr)
state->itech020_prot_address = prot_addr;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x300000, 0x300003, FUNC(itech020_color2_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x380000, 0x380003, FUNC(itech020_color1_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
}
@@ -4095,10 +4095,10 @@ static DRIVER_INIT( wcbowln ) /* PIC 16C54 labeled as ITBWL-3 */
init_shuffle_bowl_common(machine, 0x1116);
}
-static void install_timekeeper(running_machine *machine)
+static void install_timekeeper(running_machine &machine)
{
- device_t *device = machine->device("m48t02");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_32be_r), FUNC(timekeeper_32be_w));
+ device_t *device = machine.device("m48t02");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(*device, 0x681000, 0x6817ff, FUNC(timekeeper_32be_r), FUNC(timekeeper_32be_w));
}
static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL-3 */
@@ -4109,9 +4109,9 @@ static DRIVER_INIT( wcbowlt ) /* PIC 16C54 labeled as ITBWL-3 */
install_timekeeper(machine);
}
-static void init_gt_common(running_machine *machine)
+static void init_gt_common(running_machine &machine)
{
- itech32_state *state = machine->driver_data<itech32_state>();
+ itech32_state *state = machine.driver_data<itech32_state>();
init_program_rom(machine);
state->vram_height = 1024;
state->planes = 2;
@@ -4130,7 +4130,7 @@ static DRIVER_INIT( gt3d )
Hacked versions of this PCB have been found with GT97
through GTClassic. This is _NOT_ a factory modification
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_8bit_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_8bit_r));
init_gt_common(machine);
}
@@ -4143,8 +4143,8 @@ static DRIVER_INIT( aama )
board share the same sound CPU code and sample ROMs.
This board has all versions of GT for it, GT3D through GTClassic
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x180800, 0x180803, FUNC(trackball32_4bit_p1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x181000, 0x181003, FUNC(trackball32_4bit_p2_r));
init_gt_common(machine);
}
@@ -4168,7 +4168,7 @@ static DRIVER_INIT( s_ver )
board: GT97 v1.21S, GT98, GT99, GT2K & GT Classic Versions 1.00S
Trackball info is read through 200202 (actually 200203).
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200200, 0x200203, FUNC(trackball32_4bit_p1_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200200, 0x200203, FUNC(trackball32_4bit_p1_r));
init_gt_common(machine);
}
@@ -4182,7 +4182,7 @@ static DRIVER_INIT( gt3dl )
Player 1 trackball read through 200003
Player 2 trackball read through 200002
*/
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_4bit_combined_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x200000, 0x200003, FUNC(trackball32_4bit_combined_r));
init_gt_common(machine);
}
@@ -4190,7 +4190,7 @@ static DRIVER_INIT( gt3dl )
static DRIVER_INIT( gt2kp )
{
/* a little extra protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gt2kp_prot_result_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gt2kp_prot_result_r));
DRIVER_INIT_CALL(aama);
/* The protection code is:
@@ -4211,7 +4211,7 @@ Label1 bne.s Label1 ; Infinite loop if result isn't 0x01
static DRIVER_INIT( gtclasscp )
{
/* a little extra protection */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gtclass_prot_result_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x680000, 0x680003, FUNC(gtclass_prot_result_r));
DRIVER_INIT_CALL(aama);
/* The protection code is:
diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c
index f6c6a9805d4..b2d9b632133 100644
--- a/src/mame/drivers/itech8.c
+++ b/src/mame/drivers/itech8.c
@@ -569,10 +569,10 @@ static const via6522_interface via_interface =
*
*************************************/
-void itech8_update_interrupts(running_machine *machine, int periodic, int tms34061, int blitter)
+void itech8_update_interrupts(running_machine &machine, int periodic, int tms34061, int blitter)
{
- itech8_state *state = machine->driver_data<itech8_state>();
- device_type main_cpu_type = machine->device("maincpu")->type();
+ itech8_state *state = machine.driver_data<itech8_state>();
+ device_type main_cpu_type = machine.device("maincpu")->type();
/* update the states */
if (periodic != -1) state->periodic_int = periodic;
@@ -613,23 +613,23 @@ static TIMER_CALLBACK( irq_off )
static INTERRUPT_GEN( generate_nmi )
{
/* signal the NMI */
- itech8_update_interrupts(device->machine, 1, -1, -1);
- device->machine->scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
+ itech8_update_interrupts(device->machine(), 1, -1, -1);
+ device->machine().scheduler().timer_set(attotime::from_usec(1), FUNC(irq_off));
- if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine->primary_screen->vpos());
+ if (FULL_LOGGING) logerror("------------ VBLANK (%d) --------------\n", device->machine().primary_screen->vpos());
}
static WRITE8_HANDLER( itech8_nmi_ack_w )
{
/* doesn't seem to hold for every game (e.g., hstennis) */
-/* cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_NMI, CLEAR_LINE);*/
+/* cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_NMI, CLEAR_LINE);*/
}
static void generate_sound_irq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "soundcpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "soundcpu", M6809_FIRQ_LINE, state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -646,25 +646,25 @@ static TIMER_CALLBACK( behind_the_beam_update );
static MACHINE_START( sstrike )
{
/* we need to update behind the beam as well */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(0), FUNC(behind_the_beam_update), 32);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(0), FUNC(behind_the_beam_update), 32);
}
static MACHINE_RESET( itech8 )
{
- itech8_state *state = machine->driver_data<itech8_state>();
- device_type main_cpu_type = machine->device("maincpu")->type();
+ itech8_state *state = machine.driver_data<itech8_state>();
+ device_type main_cpu_type = machine.device("maincpu")->type();
/* make sure bank 0 is selected */
if (main_cpu_type == M6809 || main_cpu_type == HD6309)
{
- memory_set_bankptr(machine, "bank1", &machine->region("maincpu")->base()[0x4000]);
- machine->device("maincpu")->reset();
+ memory_set_bankptr(machine, "bank1", &machine.region("maincpu")->base()[0x4000]);
+ machine.device("maincpu")->reset();
}
/* set the visible area */
if (state->visarea)
{
- machine->primary_screen->set_visible_area(state->visarea->min_x, state->visarea->max_x, state->visarea->min_y, state->visarea->max_y);
+ machine.primary_screen->set_visible_area(state->visarea->min_x, state->visarea->max_x, state->visarea->min_y, state->visarea->max_y);
state->visarea = NULL;
}
}
@@ -683,14 +683,14 @@ static TIMER_CALLBACK( behind_the_beam_update )
int interval = param & 0xff;
/* force a partial update to the current scanline */
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
/* advance by the interval, and wrap to 0 */
scanline += interval;
if (scanline >= 256) scanline = 0;
/* set a new timer */
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(scanline), FUNC(behind_the_beam_update), (scanline << 8) + interval);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(scanline), FUNC(behind_the_beam_update), (scanline << 8) + interval);
}
@@ -705,7 +705,7 @@ static WRITE8_HANDLER( blitter_w )
{
/* bit 0x20 on address 7 controls CPU banking */
if (offset / 2 == 7)
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("maincpu")->base()[0x4000 + 0xc000 * ((data >> 5) & 1)]);
/* the rest is handled by the video hardware */
itech8_blitter_w(space, offset, data);
@@ -715,7 +715,7 @@ static WRITE8_HANDLER( blitter_w )
static WRITE8_HANDLER( rimrockn_bank_w )
{
/* banking is controlled here instead of by the blitter output */
- memory_set_bankptr(space->machine, "bank1", &space->machine->region("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
+ memory_set_bankptr(space->machine(), "bank1", &space->machine().region("maincpu")->base()[0x4000 + 0xc000 * (data & 3)]);
}
@@ -728,7 +728,7 @@ static WRITE8_HANDLER( rimrockn_bank_w )
static CUSTOM_INPUT( special_r )
{
- itech8_state *state = field->port->machine->driver_data<itech8_state>();
+ itech8_state *state = field->port->machine().driver_data<itech8_state>();
return state->pia_portb_data & 0x01;
}
@@ -741,7 +741,7 @@ static CUSTOM_INPUT( special_r )
static WRITE8_DEVICE_HANDLER( pia_porta_out )
{
- itech8_state *state = device->machine->driver_data<itech8_state>();
+ itech8_state *state = device->machine().driver_data<itech8_state>();
logerror("PIA port A write = %02x\n", data);
state->pia_porta_data = data;
}
@@ -749,7 +749,7 @@ static WRITE8_DEVICE_HANDLER( pia_porta_out )
static WRITE8_HANDLER( pia_portb_out )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
logerror("PIA port B write = %02x\n", data);
/* bit 0 provides feedback to the main CPU */
@@ -757,14 +757,14 @@ static WRITE8_HANDLER( pia_portb_out )
/* bit 5 controls the coin counter */
/* bit 6 controls the diagnostic sound LED */
state->pia_portb_data = data;
- ticket_dispenser_w(space->machine->device("ticket"), 0, (data & 0x10) << 3);
- coin_counter_w(space->machine, 0, (data & 0x20) >> 5);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, (data & 0x10) << 3);
+ coin_counter_w(space->machine(), 0, (data & 0x20) >> 5);
}
static WRITE8_DEVICE_HANDLER( ym2203_portb_out )
{
- itech8_state *state = device->machine->driver_data<itech8_state>();
+ itech8_state *state = device->machine().driver_data<itech8_state>();
logerror("YM2203 port B write = %02x\n", data);
/* bit 0 provides feedback to the main CPU */
@@ -772,8 +772,8 @@ static WRITE8_DEVICE_HANDLER( ym2203_portb_out )
/* bit 6 controls the diagnostic sound LED */
/* bit 7 controls the ticket dispenser */
state->pia_portb_data = data;
- ticket_dispenser_w(device->machine->device("ticket"), 0, data & 0x80);
- coin_counter_w(device->machine, 0, (data & 0x20) >> 5);
+ ticket_dispenser_w(device->machine().device("ticket"), 0, data & 0x80);
+ coin_counter_w(device->machine(), 0, (data & 0x20) >> 5);
}
@@ -786,7 +786,7 @@ static WRITE8_DEVICE_HANDLER( ym2203_portb_out )
static TIMER_CALLBACK( delayed_sound_data_w )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
state->sound_data = param;
cputag_set_input_line(machine, "soundcpu", M6809_IRQ_LINE, ASSERT_LINE);
}
@@ -794,7 +794,7 @@ static TIMER_CALLBACK( delayed_sound_data_w )
static WRITE8_HANDLER( sound_data_w )
{
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data);
}
@@ -805,14 +805,14 @@ static WRITE8_HANDLER( gtg2_sound_data_w )
((data & 0x5d) << 1) |
((data & 0x20) >> 3) |
((data & 0x02) << 5);
- space->machine->scheduler().synchronize(FUNC(delayed_sound_data_w), data);
+ space->machine().scheduler().synchronize(FUNC(delayed_sound_data_w), data);
}
static READ8_HANDLER( sound_data_r )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
- cputag_set_input_line(space->machine, "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
+ itech8_state *state = space->machine().driver_data<itech8_state>();
+ cputag_set_input_line(space->machine(), "soundcpu", M6809_IRQ_LINE, CLEAR_LINE);
return state->sound_data;
}
@@ -826,7 +826,7 @@ static READ8_HANDLER( sound_data_r )
static WRITE16_HANDLER( grom_bank16_w )
{
- itech8_state *state = space->machine->driver_data<itech8_state>();
+ itech8_state *state = space->machine().driver_data<itech8_state>();
if (ACCESSING_BITS_8_15)
*state->grom_bank = data >> 8;
}
@@ -1102,7 +1102,7 @@ static CUSTOM_INPUT( gtg_mux )
{
const char *tag1 = (const char *)param;
const char *tag2 = tag1 + strlen(tag1) + 1;
- return input_port_read(field->port->machine, tag1) & input_port_read(field->port->machine, tag2);
+ return input_port_read(field->port->machine(), tag1) & input_port_read(field->port->machine(), tag2);
}
static INPUT_PORTS_START( gtg )
@@ -2634,31 +2634,31 @@ ROM_END
static DRIVER_INIT( grmatch )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0160, 0x0160, FUNC(grmatch_palette_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0180, 0x0180, FUNC(grmatch_xscroll_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x01e0, 0x01ff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0160, 0x0160, FUNC(grmatch_palette_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x0180, 0x0180, FUNC(grmatch_xscroll_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->unmap_write(0x01e0, 0x01ff);
}
static DRIVER_INIT( slikshot )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x0180, 0x0180, FUNC(slikshot_z80_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x01cf, 0x01cf, FUNC(slikshot_z80_control_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01cf, 0x01cf, FUNC(slikshot_z80_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x0180, 0x0180, FUNC(slikshot_z80_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x01cf, 0x01cf, FUNC(slikshot_z80_control_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01cf, 0x01cf, FUNC(slikshot_z80_control_w));
}
static DRIVER_INIT( sstrike )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1180, 0x1180, FUNC(slikshot_z80_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x11cf, 0x11cf, FUNC(slikshot_z80_control_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x11cf, 0x11cf, FUNC(slikshot_z80_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x1180, 0x1180, FUNC(slikshot_z80_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler (0x11cf, 0x11cf, FUNC(slikshot_z80_control_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x11cf, 0x11cf, FUNC(slikshot_z80_control_w));
}
static DRIVER_INIT( hstennis )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 0, 375, 0, 239 };
state->visarea = &visible;
}
@@ -2666,7 +2666,7 @@ static DRIVER_INIT( hstennis )
static DRIVER_INIT( arligntn )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 16, 389, 0, 239 };
state->visarea = &visible;
}
@@ -2674,7 +2674,7 @@ static DRIVER_INIT( arligntn )
static DRIVER_INIT( peggle )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 18, 367, 0, 239 };
state->visarea = &visible;
}
@@ -2682,7 +2682,7 @@ static DRIVER_INIT( peggle )
static DRIVER_INIT( neckneck )
{
- itech8_state *state = machine->driver_data<itech8_state>();
+ itech8_state *state = machine.driver_data<itech8_state>();
static const rectangle visible = { 8, 375, 0, 239 };
state->visarea = &visible;
}
@@ -2691,15 +2691,15 @@ static DRIVER_INIT( neckneck )
static DRIVER_INIT( rimrockn )
{
/* additional input ports */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0161, 0x0161, "161");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0162, 0x0162, "162");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0163, 0x0163, "163");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0164, 0x0164, "164");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0165, 0x0165, "165");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0161, 0x0161, "161");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0162, 0x0162, "162");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0163, 0x0163, "163");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0164, 0x0164, "164");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port (0x0165, 0x0165, "165");
/* different banking mechanism (disable the old one) */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01a0, 0x01a0, FUNC(rimrockn_bank_w));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c0, 0x01df, FUNC(itech8_blitter_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01a0, 0x01a0, FUNC(rimrockn_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x01c0, 0x01df, FUNC(itech8_blitter_w));
}
diff --git a/src/mame/drivers/itgambl2.c b/src/mame/drivers/itgambl2.c
index b01343cd78d..b97ce2be3b6 100644
--- a/src/mame/drivers/itgambl2.c
+++ b/src/mame/drivers/itgambl2.c
@@ -75,7 +75,7 @@ public:
static VIDEO_START( itgambl2 )
{
- itgambl2_state *state = machine->driver_data<itgambl2_state>();
+ itgambl2_state *state = machine.driver_data<itgambl2_state>();
state->test_x = 256;
state->test_y = 256;
state->start_offs = 0;
@@ -84,37 +84,37 @@ static VIDEO_START( itgambl2 )
/* (dirty) debug code for looking 8bpps blitter-based gfxs */
static SCREEN_UPDATE( itgambl2 )
{
- itgambl2_state *state = screen->machine->driver_data<itgambl2_state>();
+ itgambl2_state *state = screen->machine().driver_data<itgambl2_state>();
int x,y,count;
- const UINT8 *blit_ram = screen->machine->region("gfx1")->base();
+ const UINT8 *blit_ram = screen->machine().region("gfx1")->base();
- if(input_code_pressed(screen->machine, KEYCODE_Z))
+ if(input_code_pressed(screen->machine(), KEYCODE_Z))
state->test_x++;
- if(input_code_pressed(screen->machine, KEYCODE_X))
+ if(input_code_pressed(screen->machine(), KEYCODE_X))
state->test_x--;
- if(input_code_pressed(screen->machine, KEYCODE_A))
+ if(input_code_pressed(screen->machine(), KEYCODE_A))
state->test_y++;
- if(input_code_pressed(screen->machine, KEYCODE_S))
+ if(input_code_pressed(screen->machine(), KEYCODE_S))
state->test_y--;
- if(input_code_pressed(screen->machine, KEYCODE_Q))
+ if(input_code_pressed(screen->machine(), KEYCODE_Q))
state->start_offs+=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_W))
+ if(input_code_pressed(screen->machine(), KEYCODE_W))
state->start_offs-=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_E))
+ if(input_code_pressed(screen->machine(), KEYCODE_E))
state->start_offs++;
- if(input_code_pressed(screen->machine, KEYCODE_R))
+ if(input_code_pressed(screen->machine(), KEYCODE_R))
state->start_offs--;
popmessage("%d %d %04x",state->test_x,state->test_y,state->start_offs);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (state->start_offs);
@@ -127,7 +127,7 @@ static SCREEN_UPDATE( itgambl2 )
color = (blit_ram[count] & 0xff)>>0;
if((x)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color];
count++;
}
diff --git a/src/mame/drivers/itgambl3.c b/src/mame/drivers/itgambl3.c
index e2e11ad8af5..0575c43fe54 100644
--- a/src/mame/drivers/itgambl3.c
+++ b/src/mame/drivers/itgambl3.c
@@ -63,7 +63,7 @@ public:
static VIDEO_START( itgambl3 )
{
- itgambl3_state *state = machine->driver_data<itgambl3_state>();
+ itgambl3_state *state = machine.driver_data<itgambl3_state>();
state->test_x = 256;
state->test_y = 256;
state->start_offs = 0;
@@ -72,37 +72,37 @@ static VIDEO_START( itgambl3 )
/* (dirty) debug code for looking 8bpps blitter-based gfxs */
static SCREEN_UPDATE( itgambl3 )
{
- itgambl3_state *state = screen->machine->driver_data<itgambl3_state>();
+ itgambl3_state *state = screen->machine().driver_data<itgambl3_state>();
int x,y,count;
- const UINT8 *blit_ram = screen->machine->region("gfx1")->base();
+ const UINT8 *blit_ram = screen->machine().region("gfx1")->base();
- if(input_code_pressed(screen->machine, KEYCODE_Z))
+ if(input_code_pressed(screen->machine(), KEYCODE_Z))
state->test_x++;
- if(input_code_pressed(screen->machine, KEYCODE_X))
+ if(input_code_pressed(screen->machine(), KEYCODE_X))
state->test_x--;
- if(input_code_pressed(screen->machine, KEYCODE_A))
+ if(input_code_pressed(screen->machine(), KEYCODE_A))
state->test_y++;
- if(input_code_pressed(screen->machine, KEYCODE_S))
+ if(input_code_pressed(screen->machine(), KEYCODE_S))
state->test_y--;
- if(input_code_pressed(screen->machine, KEYCODE_Q))
+ if(input_code_pressed(screen->machine(), KEYCODE_Q))
state->start_offs+=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_W))
+ if(input_code_pressed(screen->machine(), KEYCODE_W))
state->start_offs-=0x200;
- if(input_code_pressed(screen->machine, KEYCODE_E))
+ if(input_code_pressed(screen->machine(), KEYCODE_E))
state->start_offs++;
- if(input_code_pressed(screen->machine, KEYCODE_R))
+ if(input_code_pressed(screen->machine(), KEYCODE_R))
state->start_offs--;
popmessage("%d %d %04x",state->test_x,state->test_y,state->start_offs);
- bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine));
+ bitmap_fill(bitmap,cliprect,get_black_pen(screen->machine()));
count = (state->start_offs);
@@ -115,7 +115,7 @@ static SCREEN_UPDATE( itgambl3 )
color = (blit_ram[count] & 0xff)>>0;
if((x)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x) = screen->machine().pens[color];
count++;
}
diff --git a/src/mame/drivers/jack.c b/src/mame/drivers/jack.c
index 89241e355e5..cffed9f2945 100644
--- a/src/mame/drivers/jack.c
+++ b/src/mame/drivers/jack.c
@@ -56,7 +56,7 @@ The 2 ay-8910 read ports are responsible for reading the sound commands.
static READ8_DEVICE_HANDLER( timer_r )
{
- jack_state *state = device->machine->driver_data<jack_state>();
+ jack_state *state = device->machine().driver_data<jack_state>();
/* wrong! there should be no need for timer_rate, the same function */
/* should work for both games */
@@ -66,7 +66,7 @@ static READ8_DEVICE_HANDLER( timer_r )
static WRITE8_HANDLER( jack_sh_command_w )
{
- jack_state *state = space->machine->driver_data<jack_state>();
+ jack_state *state = space->machine().driver_data<jack_state>();
soundlatch_w(space, 0, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -76,17 +76,17 @@ static WRITE8_HANDLER( jack_sh_command_w )
static WRITE8_HANDLER( joinem_misc_w )
{
- jack_state *state = space->machine->driver_data<jack_state>();
- flip_screen_set(space->machine, data & 0x80);
+ jack_state *state = space->machine().driver_data<jack_state>();
+ flip_screen_set(space->machine(), data & 0x80);
state->joinem_snd_bit = data & 1;
}
static CUSTOM_INPUT( sound_check_r )
{
- jack_state *state = field->port->machine->driver_data<jack_state>();
+ jack_state *state = field->port->machine().driver_data<jack_state>();
UINT8 ret = 0;
- if ((input_port_read(field->port->machine, "IN2") & 0x80) && !state->joinem_snd_bit)
+ if ((input_port_read(field->port->machine(), "IN2") & 0x80) && !state->joinem_snd_bit)
ret = 1;
return ret;
@@ -98,7 +98,7 @@ static CUSTOM_INPUT( sound_check_r )
static READ8_HANDLER( striv_question_r )
{
- jack_state *state = space->machine->driver_data<jack_state>();
+ jack_state *state = space->machine().driver_data<jack_state>();
// Set-up the remap table for every 16 bytes
if ((offset & 0xc00) == 0x800)
@@ -114,7 +114,7 @@ static READ8_HANDLER( striv_question_r )
// Read the actual byte from question roms
else
{
- UINT8 *ROM = space->machine->region("user1")->base();
+ UINT8 *ROM = space->machine().region("user1")->base();
int real_address;
real_address = state->question_address | (offset & 0x3f0) | state->remap_address[offset & 0x0f];
@@ -794,9 +794,9 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
- state->audiocpu = machine->device<cpu_device>("audiocpu");
+ state->audiocpu = machine.device<cpu_device>("audiocpu");
state->save_item(NAME(state->joinem_snd_bit));
state->save_item(NAME(state->question_address));
@@ -806,7 +806,7 @@ static MACHINE_START( jack )
static MACHINE_RESET( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
int i;
state->joinem_snd_bit = 0;
@@ -866,7 +866,7 @@ static INTERRUPT_GEN( joinem_interrupts )
device_set_input_line(device, 0, HOLD_LINE);
else
{
- if (!(input_port_read(device->machine, "IN2") & 0x80))
+ if (!(input_port_read(device->machine(), "IN2") & 0x80))
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -1303,11 +1303,11 @@ ROM_END
*
*************************************/
-static void treahunt_decode( running_machine *machine )
+static void treahunt_decode( running_machine &machine )
{
int A;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine->region("maincpu")->base();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypt = auto_alloc_array(machine, UINT8, 0x4000);
int data;
@@ -1350,33 +1350,33 @@ static void treahunt_decode( running_machine *machine )
static DRIVER_INIT( jack )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->timer_rate = 128;
}
static DRIVER_INIT( treahunt )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->timer_rate = 128;
treahunt_decode(machine);
}
static DRIVER_INIT( zzyzzyxx )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
state->timer_rate = 16;
}
static DRIVER_INIT( loverboy )
{
- jack_state *state = machine->driver_data<jack_state>();
+ jack_state *state = machine.driver_data<jack_state>();
/* this doesn't make sense.. the startup code, and irq0 have jumps to 0..
I replace the startup jump with another jump to what appears to be
the start of the game code.
ToDo: Figure out what's really going on */
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
ROM[0x13] = 0x01;
ROM[0x12] = 0x9d;
@@ -1386,8 +1386,8 @@ static DRIVER_INIT( loverboy )
static DRIVER_INIT( striv )
{
- jack_state *state = machine->driver_data<jack_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ jack_state *state = machine.driver_data<jack_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
UINT8 data;
int A;
@@ -1414,10 +1414,10 @@ static DRIVER_INIT( striv )
}
// Set-up the weirdest questions read ever done
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xcfff, FUNC(striv_question_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xc000, 0xcfff, FUNC(striv_question_r));
// Nop out unused sprites writes
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xb000, 0xb0ff);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xb000, 0xb0ff);
state->timer_rate = 128;
}
diff --git a/src/mame/drivers/jackal.c b/src/mame/drivers/jackal.c
index 7f119da3e31..a1068c8d732 100644
--- a/src/mame/drivers/jackal.c
+++ b/src/mame/drivers/jackal.c
@@ -85,67 +85,67 @@ Address Dir Data Description
static READ8_HANDLER( topgunbl_rotary_r )
{
- return (1 << input_port_read_safe(space->machine, offset ? "DIAL1" : "DIAL0", 0x00)) ^ 0xff;
+ return (1 << input_port_read_safe(space->machine(), offset ? "DIAL1" : "DIAL0", 0x00)) ^ 0xff;
}
static WRITE8_HANDLER( jackal_flipscreen_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static READ8_HANDLER( jackal_zram_r )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
return state->rambank[0x0020 + offset];
}
static READ8_HANDLER( jackal_voram_r )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
return state->rambank[0x2000 + offset];
}
static READ8_HANDLER( jackal_spriteram_r )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
return state->spritebank[0x3000 + offset];
}
static WRITE8_HANDLER( jackal_rambank_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
- UINT8 *rgn = space->machine->region("master")->base();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
+ UINT8 *rgn = space->machine().region("master")->base();
if (data & 0x04)
popmessage("jackal_rambank_w %02x", data);
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
state->spritebank = &rgn[((data & 0x08) << 13)];
state->rambank = &rgn[((data & 0x10) << 12)];
- memory_set_bank(space->machine, "bank1", (data & 0x20) ? 1 : 0);
+ memory_set_bank(space->machine(), "bank1", (data & 0x20) ? 1 : 0);
}
static WRITE8_HANDLER( jackal_zram_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
state->rambank[0x0020 + offset] = data;
}
static WRITE8_HANDLER( jackal_voram_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
if ((offset & 0xf800) == 0)
- jackal_mark_tile_dirty(space->machine, offset & 0x3ff);
+ jackal_mark_tile_dirty(space->machine(), offset & 0x3ff);
state->rambank[0x2000 + offset] = data;
}
@@ -153,7 +153,7 @@ static WRITE8_HANDLER( jackal_voram_w )
static WRITE8_HANDLER( jackal_spriteram_w )
{
- jackal_state *state = space->machine->driver_data<jackal_state>();
+ jackal_state *state = space->machine().driver_data<jackal_state>();
state->spritebank[0x3000 + offset] = data;
}
@@ -317,7 +317,7 @@ GFXDECODE_END
static INTERRUPT_GEN( jackal_interrupt )
{
- jackal_state *state = device->machine->driver_data<jackal_state>();
+ jackal_state *state = device->machine().driver_data<jackal_state>();
if (state->irq_enable)
{
@@ -335,27 +335,27 @@ static INTERRUPT_GEN( jackal_interrupt )
static MACHINE_START( jackal )
{
- jackal_state *state = machine->driver_data<jackal_state>();
- UINT8 *ROM = machine->region("master")->base();
+ jackal_state *state = machine.driver_data<jackal_state>();
+ UINT8 *ROM = machine.region("master")->base();
memory_configure_bank(machine, "bank1", 0, 1, &ROM[0x04000], 0x8000);
memory_configure_bank(machine, "bank1", 1, 1, &ROM[0x14000], 0x8000);
memory_set_bank(machine, "bank1", 0);
- state->mastercpu = machine->device("master");
- state->slavecpu = machine->device("slave");
+ state->mastercpu = machine.device("master");
+ state->slavecpu = machine.device("slave");
state->save_item(NAME(state->irq_enable));
}
static MACHINE_RESET( jackal )
{
- jackal_state *state = machine->driver_data<jackal_state>();
- UINT8 *rgn = machine->region("master")->base();
+ jackal_state *state = machine.driver_data<jackal_state>();
+ UINT8 *rgn = machine.region("master")->base();
// HACK: running at the nominal clock rate, music stops working
// at the beginning of the game. This fixes it.
- machine->device("slave")->set_clock_scale(1.2f);
+ machine.device("slave")->set_clock_scale(1.2f);
state->rambank = rgn;
state->spritebank = rgn;
diff --git a/src/mame/drivers/jackie.c b/src/mame/drivers/jackie.c
index 15e7ee40338..45ef2827e17 100644
--- a/src/mame/drivers/jackie.c
+++ b/src/mame/drivers/jackie.c
@@ -80,7 +80,7 @@ public:
static TILE_GET_INFO( get_fg_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->fg_tile_ram[tile_index] | (state->fg_color_ram[tile_index] << 8);
int tile = code & 0x1fff;
SET_TILE_INFO(0, code, tile != 0x1fff ? ((code >> 12) & 0xe) + 1 : 0, 0);
@@ -88,14 +88,14 @@ static TILE_GET_INFO( get_fg_tile_info )
static WRITE8_HANDLER( fg_tile_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->fg_tile_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
static WRITE8_HANDLER( fg_color_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->fg_color_ram[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
@@ -105,21 +105,21 @@ static WRITE8_HANDLER( fg_color_w )
static WRITE8_HANDLER( bg_scroll_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->bg_scroll[offset] = data;
}
static WRITE8_HANDLER( jackie_reel1_ram_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
static TILE_GET_INFO( get_jackie_reel1_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->reel1_ram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
@@ -128,14 +128,14 @@ static TILE_GET_INFO( get_jackie_reel1_tile_info )
static WRITE8_HANDLER( jackie_reel2_ram_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
static TILE_GET_INFO( get_jackie_reel2_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->reel2_ram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
@@ -143,21 +143,21 @@ static TILE_GET_INFO( get_jackie_reel2_tile_info )
static WRITE8_HANDLER( jackie_reel3_ram_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
static TILE_GET_INFO( get_jackie_reel3_tile_info )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
int code = state->reel3_ram[tile_index];
SET_TILE_INFO(1, code, 0, 0);
}
static VIDEO_START(jackie)
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
state->reel1_tilemap = tilemap_create(machine,get_jackie_reel1_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_jackie_reel2_tile_info,tilemap_scan_rows,8,32, 64, 8);
state->reel3_tilemap = tilemap_create(machine,get_jackie_reel3_tile_info,tilemap_scan_rows,8,32, 64, 8);
@@ -173,12 +173,12 @@ static VIDEO_START(jackie)
static SCREEN_UPDATE(jackie)
{
- jackie_state *state = screen->machine->driver_data<jackie_state>();
+ jackie_state *state = screen->machine().driver_data<jackie_state>();
int i,j;
int startclipmin = 0;
const rectangle &visarea = screen->visible_area();
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
for (i=0;i < 0x40;i++)
{
@@ -226,7 +226,7 @@ static SCREEN_UPDATE(jackie)
static MACHINE_RESET( jackie )
{
- jackie_state *state = machine->driver_data<jackie_state>();
+ jackie_state *state = machine.driver_data<jackie_state>();
state->irq_enable = 1;
state->nmi_enable = 0;
state->hopper = 0;
@@ -235,7 +235,7 @@ static MACHINE_RESET( jackie )
static INTERRUPT_GEN( jackie_interrupt )
{
- jackie_state *state = device->machine->driver_data<jackie_state>();
+ jackie_state *state = device->machine().driver_data<jackie_state>();
if (cpu_getiloops(device) % 2) {
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
@@ -260,7 +260,7 @@ static void show_out(jackie_state *state)
static void jackie_unk_reg_lo_w( address_space *space, int offset, UINT8 data, int reg )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->unk_reg[reg][offset] &= 0xff00;
state->unk_reg[reg][offset] |= data;
show_out(state);
@@ -272,7 +272,7 @@ static WRITE8_HANDLER( jackie_unk_reg3_lo_w ) { jackie_unk_reg_lo_w( space, offs
static void jackie_unk_reg_hi_w( address_space *space, int offset, UINT8 data, int reg )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->unk_reg[reg][offset] &= 0xff;
state->unk_reg[reg][offset] |= data << 8;
show_out(state);
@@ -284,13 +284,13 @@ static WRITE8_HANDLER( jackie_unk_reg3_hi_w ) { jackie_unk_reg_hi_w( space, offs
static WRITE8_HANDLER( jackie_nmi_and_coins_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
- coin_counter_w(space->machine, 0, data & 0x01); // coin_a
- coin_counter_w(space->machine, 1, data & 0x04); // coin_c
- coin_counter_w(space->machine, 2, data & 0x08); // key in
- coin_counter_w(space->machine, 3, data & 0x10); // coin state->out mech
+ jackie_state *state = space->machine().driver_data<jackie_state>();
+ coin_counter_w(space->machine(), 0, data & 0x01); // coin_a
+ coin_counter_w(space->machine(), 1, data & 0x04); // coin_c
+ coin_counter_w(space->machine(), 2, data & 0x08); // key in
+ coin_counter_w(space->machine(), 3, data & 0x10); // coin state->out mech
- set_led_status(space->machine, 6, data & 0x20); // led for coin state->out / state->hopper active
+ set_led_status(space->machine(), 6, data & 0x20); // led for coin state->out / state->hopper active
state->exp_bank = (data & 0x02) ? 1 : 0; // expram bank number
state->nmi_enable = data & 0x80; // nmi enable?
@@ -301,7 +301,7 @@ static WRITE8_HANDLER( jackie_nmi_and_coins_w )
static WRITE8_HANDLER( jackie_lamps_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
/*
- Lbits -
7654 3210
@@ -328,23 +328,23 @@ static WRITE8_HANDLER( jackie_lamps_w )
static READ8_HANDLER( igs_irqack_r )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
state->irq_enable = 1;
return 0;
}
static WRITE8_HANDLER( igs_irqack_w )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
-// cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ jackie_state *state = space->machine().driver_data<jackie_state>();
+// cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
state->out[2] = data;
show_out(state);
}
static READ8_HANDLER( expram_r )
{
- jackie_state *state = space->machine->driver_data<jackie_state>();
- UINT8 *rom = space->machine->region("gfx3")->base();
+ jackie_state *state = space->machine().driver_data<jackie_state>();
+ UINT8 *rom = space->machine().region("gfx3")->base();
offset += state->exp_bank * 0x8000;
// logerror("PC %06X: %04x = %02x\n",cpu_get_pc(space->cpu),offset,rom[offset]);
@@ -391,9 +391,9 @@ ADDRESS_MAP_END
static CUSTOM_INPUT( hopper_r )
{
- jackie_state *state = field->port->machine->driver_data<jackie_state>();
- if (state->hopper) return !(field->port->machine->primary_screen->frame_number()%10);
- return input_code_pressed(field->port->machine, KEYCODE_H);
+ jackie_state *state = field->port->machine().driver_data<jackie_state>();
+ if (state->hopper) return !(field->port->machine().primary_screen->frame_number()%10);
+ return input_code_pressed(field->port->machine(), KEYCODE_H);
}
static INPUT_PORTS_START( jackie )
@@ -539,7 +539,7 @@ static DRIVER_INIT( jackie )
{
int A;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for (A = 0;A < 0xf000;A++)
{
diff --git a/src/mame/drivers/jackpool.c b/src/mame/drivers/jackpool.c
index b96f427ebc0..a79dbebce72 100644
--- a/src/mame/drivers/jackpool.c
+++ b/src/mame/drivers/jackpool.c
@@ -39,8 +39,8 @@ static VIDEO_START(jackpool)
static SCREEN_UPDATE(jackpool)
{
- jackpool_state *state = screen->machine->driver_data<jackpool_state>();
- const gfx_element *gfx = screen->machine->gfx[0];
+ jackpool_state *state = screen->machine().driver_data<jackpool_state>();
+ const gfx_element *gfx = screen->machine().gfx[0];
int count;// = 0x00000/2;
int y,x;
@@ -90,27 +90,27 @@ static READ16_HANDLER( jackpool_ff_r )
static READ16_HANDLER( jackpool_io_r )
{
- jackpool_state *state = space->machine->driver_data<jackpool_state>();
+ jackpool_state *state = space->machine().driver_data<jackpool_state>();
switch(offset*2)
{
- case 0x00: return input_port_read(space->machine,"COIN1");
- case 0x04: return input_port_read(space->machine,"UNK1");
- case 0x06: return input_port_read(space->machine,"UNK2");
- case 0x08: return input_port_read(space->machine,"SERVICE1");
- case 0x0a: return input_port_read(space->machine,"SERVICE2");//probably not a button, remote?
- case 0x0c: return input_port_read(space->machine,"PAYOUT");
- case 0x0e: return input_port_read(space->machine,"START2");
- case 0x10: return input_port_read(space->machine,"HOLD3");
- case 0x12: return input_port_read(space->machine,"HOLD4");
- case 0x14: return input_port_read(space->machine,"HOLD2");
- case 0x16: return input_port_read(space->machine,"HOLD1");
- case 0x18: return input_port_read(space->machine,"HOLD5");
- case 0x1a: return input_port_read(space->machine,"START1");
- case 0x1c: return input_port_read(space->machine,"BET");
+ case 0x00: return input_port_read(space->machine(),"COIN1");
+ case 0x04: return input_port_read(space->machine(),"UNK1");
+ case 0x06: return input_port_read(space->machine(),"UNK2");
+ case 0x08: return input_port_read(space->machine(),"SERVICE1");
+ case 0x0a: return input_port_read(space->machine(),"SERVICE2");//probably not a button, remote?
+ case 0x0c: return input_port_read(space->machine(),"PAYOUT");
+ case 0x0e: return input_port_read(space->machine(),"START2");
+ case 0x10: return input_port_read(space->machine(),"HOLD3");
+ case 0x12: return input_port_read(space->machine(),"HOLD4");
+ case 0x14: return input_port_read(space->machine(),"HOLD2");
+ case 0x16: return input_port_read(space->machine(),"HOLD1");
+ case 0x18: return input_port_read(space->machine(),"HOLD5");
+ case 0x1a: return input_port_read(space->machine(),"START1");
+ case 0x1c: return input_port_read(space->machine(),"BET");
case 0x1e: return 0xff; //ticket motor
case 0x20: return 0xff; //hopper motor
- case 0x2c: return eeprom_read_bit(space->machine->device("eeprom"));
- case 0x2e: return eeprom_read_bit(space->machine->device("eeprom"));
+ case 0x2c: return eeprom_read_bit(space->machine().device("eeprom"));
+ case 0x2e: return eeprom_read_bit(space->machine().device("eeprom"));
// default: printf("R %02x\n",offset*2); break;
}
@@ -120,7 +120,7 @@ static READ16_HANDLER( jackpool_io_r )
static WRITE16_HANDLER( jackpool_io_w )
{
- jackpool_state *state = space->machine->driver_data<jackpool_state>();
+ jackpool_state *state = space->machine().driver_data<jackpool_state>();
COMBINE_DATA(&state->io[offset]);
switch(offset*2)
@@ -138,11 +138,11 @@ static WRITE16_HANDLER( jackpool_io_w )
case 0x4a: /* ---- ---x Ticket motor */break;
case 0x4c: /* ---- ---x Hopper motor */break;
case 0x4e: state->map_vreg = data & 1; break;
- case 0x50: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
- case 0x52: eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
- case 0x54: eeprom_write_bit(space->machine->device("eeprom"), data & 1); break;
-// case 0x5a: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
-// case 0x5c: eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
+ case 0x50: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
+ case 0x52: eeprom_set_clock_line(space->machine().device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE ); break;
+ case 0x54: eeprom_write_bit(space->machine().device("eeprom"), data & 1); break;
+// case 0x5a: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
+// case 0x5c: eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE ); break;
case 0x60: break;
// default: printf("[%02x] <- %02x W\n",offset*2,data); break;
}
@@ -151,17 +151,17 @@ static WRITE16_HANDLER( jackpool_io_w )
if(offset*2 == 0x54)
{
printf("Write bit %02x\n",data);
- eeprom_write_bit(space->machine->device("eeprom"), data & 1);
+ eeprom_write_bit(space->machine().device("eeprom"), data & 1);
}
if(offset*2 == 0x52)
{
printf("Clock bit %02x\n",data);
- eeprom_set_clock_line(space->machine->device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE );
+ eeprom_set_clock_line(space->machine().device("eeprom"), (data & 1) ? ASSERT_LINE : CLEAR_LINE );
}
if(offset*2 == 0x50)
{
printf("chip select bit %02x\n",data);
- eeprom_set_cs_line(space->machine->device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE );
+ eeprom_set_cs_line(space->machine().device("eeprom"), (data & 1) ? CLEAR_LINE : ASSERT_LINE );
}
#endif
}
@@ -294,7 +294,7 @@ ROM_END
static DRIVER_INIT( jackpool )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
/* patch NVRAM routine */
rom[0x9040/2] = 0x6602;
diff --git a/src/mame/drivers/jailbrek.c b/src/mame/drivers/jailbrek.c
index 139eb4bf45a..b7290b8a060 100644
--- a/src/mame/drivers/jailbrek.c
+++ b/src/mame/drivers/jailbrek.c
@@ -94,16 +94,16 @@ Notes:
static WRITE8_HANDLER( ctrl_w )
{
- jailbrek_state *state = space->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = space->machine().driver_data<jailbrek_state>();
state->nmi_enable = data & 0x01;
state->irq_enable = data & 0x02;
- flip_screen_set(space->machine, data & 0x08);
+ flip_screen_set(space->machine(), data & 0x08);
}
static INTERRUPT_GEN( jb_interrupt )
{
- jailbrek_state *state = device->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = device->machine().driver_data<jailbrek_state>();
if (state->irq_enable)
device_set_input_line(device, 0, HOLD_LINE);
@@ -111,7 +111,7 @@ static INTERRUPT_GEN( jb_interrupt )
static INTERRUPT_GEN( jb_interrupt_nmi )
{
- jailbrek_state *state = device->machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = device->machine().driver_data<jailbrek_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -239,14 +239,14 @@ GFXDECODE_END
static MACHINE_START( jailbrek )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
state->save_item(NAME(state->irq_enable));
state->save_item(NAME(state->nmi_enable));
}
static MACHINE_RESET( jailbrek )
{
- jailbrek_state *state = machine->driver_data<jailbrek_state>();
+ jailbrek_state *state = machine.driver_data<jailbrek_state>();
state->irq_enable = 0;
state->nmi_enable = 0;
}
@@ -406,7 +406,7 @@ ROM_END
static DRIVER_INIT( jailbrek )
{
- UINT8 *SPEECH_ROM = machine->region("vlm")->base();
+ UINT8 *SPEECH_ROM = machine.region("vlm")->base();
int ind;
/*
@@ -418,7 +418,7 @@ static DRIVER_INIT( jailbrek )
represents address line A13.)
*/
- if (machine->region("vlm")->bytes() == 0x4000)
+ if (machine.region("vlm")->bytes() == 0x4000)
{
for (ind = 0; ind < 0x2000; ++ind)
{
diff --git a/src/mame/drivers/jalmah.c b/src/mame/drivers/jalmah.c
index f7632748df3..1804de51875 100644
--- a/src/mame/drivers/jalmah.c
+++ b/src/mame/drivers/jalmah.c
@@ -199,7 +199,7 @@ static TILEMAP_MAPPER( range3_8x8 )
static TILE_GET_INFO( get_sc0_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc0_vram[tile_index];
SET_TILE_INFO(
3,
@@ -210,7 +210,7 @@ static TILE_GET_INFO( get_sc0_tile_info )
static TILE_GET_INFO( get_sc1_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc1_vram[tile_index];
SET_TILE_INFO(
2,
@@ -221,7 +221,7 @@ static TILE_GET_INFO( get_sc1_tile_info )
static TILE_GET_INFO( get_sc2_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc2_vram[tile_index];
SET_TILE_INFO(
1,
@@ -232,7 +232,7 @@ static TILE_GET_INFO( get_sc2_tile_info )
static TILE_GET_INFO( get_sc3_tile_info )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
int code = state->sc3_vram[tile_index];
SET_TILE_INFO(
0,
@@ -243,7 +243,7 @@ static TILE_GET_INFO( get_sc3_tile_info )
static VIDEO_START( jalmah )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
state->sc0_tilemap_0 = tilemap_create(machine, get_sc0_tile_info,range0_16x16,16,16,256,32);
state->sc0_tilemap_1 = tilemap_create(machine, get_sc0_tile_info,range1_16x16,16,16,128,64);
state->sc0_tilemap_2 = tilemap_create(machine, get_sc0_tile_info,range2_16x16,16,16,64,128);
@@ -290,7 +290,7 @@ static VIDEO_START( jalmah )
static VIDEO_START( urashima )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
state->sc0_tilemap_0 = tilemap_create(machine, get_sc0_tile_info,range0_16x16,16,16,256,32);
state->sc3_tilemap_0 = tilemap_create(machine, get_sc3_tile_info,range2_8x8,8,8,128,64);
@@ -311,10 +311,10 @@ etc.)
In the end the final results always are one bit assigned to each priority (i.e. most
priority = 8, then 4, 2 and finally 1).
***************************************************************************************/
-static void jalmah_priority_system(running_machine *machine)
+static void jalmah_priority_system(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- UINT8 *pri_rom = machine->region("user1")->base();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ UINT8 *pri_rom = machine.region("user1")->base();
UINT8 i;
UINT8 prinum[0x10];
@@ -336,9 +336,9 @@ static void jalmah_priority_system(running_machine *machine)
//popmessage("%02x %02x %02x %02x",state->sc0_prin,state->sc1_prin,state->sc2_prin,state->sc3_prin);
}
-static void draw_sc0_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc0_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[0] & 3)
{
case 0: tilemap_draw(bitmap,cliprect,state->sc0_tilemap_0,0,0); break;
@@ -348,9 +348,9 @@ static void draw_sc0_layer(running_machine *machine, bitmap_t *bitmap, const rec
}
}
-static void draw_sc1_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc1_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[1] & 3)
{
case 0: tilemap_draw(bitmap,cliprect,state->sc1_tilemap_0,0,0); break;
@@ -360,9 +360,9 @@ static void draw_sc1_layer(running_machine *machine, bitmap_t *bitmap, const rec
}
}
-static void draw_sc2_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc2_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[2] & 3)
{
case 0: tilemap_draw(bitmap,cliprect,state->sc2_tilemap_0,0,0); break;
@@ -372,9 +372,9 @@ static void draw_sc2_layer(running_machine *machine, bitmap_t *bitmap, const rec
}
}
-static void draw_sc3_layer(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sc3_layer(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
switch(state->jm_vregs[3] & 3)
{
case 0:
@@ -386,10 +386,10 @@ static void draw_sc3_layer(running_machine *machine, bitmap_t *bitmap, const rec
static SCREEN_UPDATE( jalmah )
{
- jalmah_state *state = screen->machine->driver_data<jalmah_state>();
+ jalmah_state *state = screen->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
UINT8 cur_prin;
- jalmah_priority_system(screen->machine);
+ jalmah_priority_system(screen->machine());
tilemap_set_scrollx(state->sc0_tilemap_0, 0, jm_scrollram[0] & 0xfff);
tilemap_set_scrollx(state->sc0_tilemap_1, 0, jm_scrollram[0] & 0x7ff);
@@ -432,14 +432,14 @@ static SCREEN_UPDATE( jalmah )
tilemap_set_scrolly(state->sc3_tilemap_2, 0, jm_scrollram[7] & 0x1ff);
tilemap_set_scrolly(state->sc3_tilemap_3, 0, jm_scrollram[7] & 0x3ff);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0xff]); //selectable by a ram address?
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0xff]); //selectable by a ram address?
for(cur_prin=1;cur_prin<=0x8;cur_prin<<=1)
{
- if(cur_prin==state->sc0_prin) { draw_sc0_layer(screen->machine,bitmap,cliprect); }
- if(cur_prin==state->sc1_prin) { draw_sc1_layer(screen->machine,bitmap,cliprect); }
- if(cur_prin==state->sc2_prin) { draw_sc2_layer(screen->machine,bitmap,cliprect); }
- if(cur_prin==state->sc3_prin) { draw_sc3_layer(screen->machine,bitmap,cliprect); }
+ if(cur_prin==state->sc0_prin) { draw_sc0_layer(screen->machine(),bitmap,cliprect); }
+ if(cur_prin==state->sc1_prin) { draw_sc1_layer(screen->machine(),bitmap,cliprect); }
+ if(cur_prin==state->sc2_prin) { draw_sc2_layer(screen->machine(),bitmap,cliprect); }
+ if(cur_prin==state->sc3_prin) { draw_sc3_layer(screen->machine(),bitmap,cliprect); }
}
return 0;
@@ -447,7 +447,7 @@ static SCREEN_UPDATE( jalmah )
static SCREEN_UPDATE( urashima )
{
- jalmah_state *state = screen->machine->driver_data<jalmah_state>();
+ jalmah_state *state = screen->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
/*this game doesn't use the RANGE register at all.*/
tilemap_set_scrollx(state->sc0_tilemap_0, 0, jm_scrollram[0]);
@@ -455,7 +455,7 @@ static SCREEN_UPDATE( urashima )
tilemap_set_scrolly(state->sc0_tilemap_0, 0, jm_scrollram[4]);
tilemap_set_scrolly(state->sc3_tilemap_0, 0, jm_scrollram[7]);
- bitmap_fill(bitmap, cliprect, screen->machine->pens[0x1ff]);//selectable by a ram address?
+ bitmap_fill(bitmap, cliprect, screen->machine().pens[0x1ff]);//selectable by a ram address?
if(state->jm_vregs[0] & 1) { tilemap_draw(bitmap,cliprect,state->sc0_tilemap_0,0,0); }
if(state->jm_vregs[3] & 1) { tilemap_draw(bitmap,cliprect,state->sc3_tilemap_0,0,0); }
return 0;
@@ -463,7 +463,7 @@ static SCREEN_UPDATE( urashima )
static WRITE16_HANDLER( sc0_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc0_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc0_tilemap_0,offset);
@@ -477,7 +477,7 @@ static WRITE16_HANDLER( sc0_vram_w )
static WRITE16_HANDLER( sc3_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc3_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc3_tilemap_0,offset);
@@ -489,7 +489,7 @@ static WRITE16_HANDLER( sc3_vram_w )
static WRITE16_HANDLER( sc1_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc1_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc1_tilemap_0,offset);
@@ -503,7 +503,7 @@ static WRITE16_HANDLER( sc1_vram_w )
static WRITE16_HANDLER( sc2_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc2_vram[offset]);
/*2048x256 tilemap*/
tilemap_mark_tile_dirty(state->sc2_tilemap_0,offset);
@@ -517,7 +517,7 @@ static WRITE16_HANDLER( sc2_vram_w )
static WRITE16_HANDLER( jalmah_tilebank_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
/*
xxxx ---- fg bank (used by suchipi)
---- xxxx Priority number (trusted,see mjzoomin)
@@ -540,7 +540,7 @@ static WRITE16_HANDLER( jalmah_tilebank_w )
static WRITE16_HANDLER( jalmah_scroll_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
UINT16 *jm_vregs = state->jm_vregs;
//logerror("[%04x]<-%04x\n",(offset+0x10)*2,data);
@@ -570,7 +570,7 @@ static WRITE16_HANDLER( jalmah_scroll_w )
static WRITE16_HANDLER( urashima_bank_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
if (ACCESSING_BITS_0_7)
{
if (state->sc0bank != (data & 0x0f))
@@ -585,14 +585,14 @@ static WRITE16_HANDLER( urashima_bank_w )
static WRITE16_HANDLER( urashima_sc0_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc0_vram[offset]);
tilemap_mark_tile_dirty(state->sc0_tilemap_0,offset);
}
static WRITE16_HANDLER( urashima_sc3_vram_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
COMBINE_DATA(&state->sc3_vram[offset]);
tilemap_mark_tile_dirty(state->sc3_tilemap_0,offset);
}
@@ -600,7 +600,7 @@ static WRITE16_HANDLER( urashima_sc3_vram_w )
/*Urashima Mahjong uses a bigger (and mostly unused/wasted) video register ram.*/
static WRITE16_HANDLER( urashima_vregs_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_scrollram = state->jm_scrollram;
UINT16 *jm_vregs = state->jm_vregs;
//logerror("[%04x]<-%04x\n",(offset)*2,data);
@@ -685,10 +685,10 @@ static WRITE16_HANDLER( urashima_dma_w )
}
/*same as $f00c0 sub-routine,but with additional work-around,to remove from here...*/
-static void daireika_palette_dma(running_machine *machine, UINT16 val)
+static void daireika_palette_dma(running_machine &machine, UINT16 val)
{
- //jalmah_state *state = machine->driver_data<jalmah_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ //jalmah_state *state = machine.driver_data<jalmah_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 index_1, index_2, src_addr, tmp_addr;
/*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */
/*a1=88000*/
@@ -707,9 +707,9 @@ static void daireika_palette_dma(running_machine *machine, UINT16 val)
}
/*RAM-based protection handlings*/
-static void daireika_mcu_run(running_machine *machine)
+static void daireika_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(((jm_shared_ram[0x550/2] & 0xf00) == 0x700) && ((jm_shared_ram[0x540/2] & 0xf00) != state->dma_old))
@@ -757,9 +757,9 @@ static void daireika_mcu_run(running_machine *machine)
jm_shared_ram[0x00e/2] = state->prg_prot;
}
-static void mjzoomin_mcu_run(running_machine *machine)
+static void mjzoomin_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(state->test_mode) //service_mode
@@ -796,15 +796,15 @@ static void mjzoomin_mcu_run(running_machine *machine)
MCU_READ("KEY1", 0x0002, 0x000/2, 0x13); /*CHI (trusted)*/
MCU_READ("KEY0", 0x0004, 0x000/2, 0x14); /*START1*/
}
- jm_shared_ram[0x00c/2] = machine->rand() & 0xffff;
+ jm_shared_ram[0x00c/2] = machine.rand() & 0xffff;
state->prg_prot++;
if(state->prg_prot > 0x10) { state->prg_prot = 0; }
jm_shared_ram[0x00e/2] = state->prg_prot;
}
-static void urashima_mcu_run(running_machine *machine)
+static void urashima_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(state->test_mode) //service_mode
@@ -841,15 +841,15 @@ static void urashima_mcu_run(running_machine *machine)
MCU_READ("KEY1", 0x0002, 0x300/2, 0x13); /*CHI (trusted)*/
MCU_READ("KEY0", 0x0004, 0x300/2, 0x14); /*START1*/
}
- jm_shared_ram[0x30c/2] = machine->rand() & 0xffff;
+ jm_shared_ram[0x30c/2] = machine.rand() & 0xffff;
state->prg_prot++;
if(state->prg_prot > 0x10) { state->prg_prot = 0; }
jm_shared_ram[0x30e/2] = state->prg_prot;
}
-static void second_mcu_run(running_machine *machine)
+static void second_mcu_run(running_machine &machine)
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
if(state->test_mode) //service_mode
{
@@ -884,13 +884,13 @@ static void second_mcu_run(running_machine *machine)
// MCU_READ("KEY0", 0x0004, 0x7b8/2, 0x03); /*START1(correct?) */
}
- jm_shared_ram[0x20c/2] = machine->rand() & 0xffff; //kakumei2
+ jm_shared_ram[0x20c/2] = machine.rand() & 0xffff; //kakumei2
}
static TIMER_DEVICE_CALLBACK( jalmah_mcu_sim )
{
- jalmah_state *state = timer.machine->driver_data<jalmah_state>();
+ jalmah_state *state = timer.machine().driver_data<jalmah_state>();
switch(state->mcu_prg)
{
/*
@@ -901,12 +901,12 @@ static TIMER_DEVICE_CALLBACK( jalmah_mcu_sim )
#define KAKUMEI2_MCU (0x22)
#define SUCHIPI_MCU (0x23)
*/
- case MJZOOMIN_MCU: mjzoomin_mcu_run(timer.machine); break;
- case DAIREIKA_MCU: daireika_mcu_run(timer.machine); break;
- case URASHIMA_MCU: urashima_mcu_run(timer.machine); break;
+ case MJZOOMIN_MCU: mjzoomin_mcu_run(timer.machine()); break;
+ case DAIREIKA_MCU: daireika_mcu_run(timer.machine()); break;
+ case URASHIMA_MCU: urashima_mcu_run(timer.machine()); break;
case KAKUMEI_MCU:
case KAKUMEI2_MCU:
- case SUCHIPI_MCU: second_mcu_run(timer.machine); break;
+ case SUCHIPI_MCU: second_mcu_run(timer.machine()); break;
}
}
@@ -919,10 +919,10 @@ Basic driver start
static WRITE16_HANDLER( jalmah_okirom_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
state->oki_rom = data & 1;
@@ -937,10 +937,10 @@ static WRITE16_HANDLER( jalmah_okirom_w )
static WRITE16_HANDLER( jalmah_okibank_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
if(ACCESSING_BITS_0_7)
{
- UINT8 *oki = space->machine->region("oki")->base();
+ UINT8 *oki = space->machine().region("oki")->base();
state->oki_bank = data & 3;
@@ -953,7 +953,7 @@ static WRITE16_HANDLER( jalmah_okibank_w )
static WRITE16_HANDLER( jalmah_flip_screen_w )
{
/*---- ----x flip screen*/
- flip_screen_set(space->machine, data & 1);
+ flip_screen_set(space->machine(), data & 1);
// popmessage("%04x",data);
}
@@ -1344,7 +1344,7 @@ GFXDECODE_END
static MACHINE_RESET ( jalmah )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
+ jalmah_state *state = machine.driver_data<jalmah_state>();
state->respcount = 0;
/*check if we are into service or normal mode*/
switch(state->mcu_prg)
@@ -1708,7 +1708,7 @@ MCU code snippets
static READ16_HANDLER( urashima_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x99, 0xd8, 0x00,
0x2a, 0x6a, 0x00,
0x9c, 0xd8, 0x00,
@@ -1734,7 +1734,7 @@ data value is REQ under mjzoomin video test menu.It is related to the MCU?
*/
static WRITE16_HANDLER( urashima_mcu_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
UINT16 *jm_mcu_code = state->jm_mcu_code;
if(ACCESSING_BITS_0_7 && data)
@@ -1928,7 +1928,7 @@ static WRITE16_HANDLER( urashima_mcu_w )
static READ16_HANDLER( daireika_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x99, 0xd8, 0x00,
0x2a, 0x6a, 0x00,
0x9c, 0xd8, 0x00,
@@ -1957,7 +1957,7 @@ static const UINT16 dai_mcu_code[0x11] = { 0x33c5, 0x0010, 0x07fe, 0x3a39,0x000f
static WRITE16_HANDLER( daireika_mcu_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
UINT16 *jm_mcu_code = state->jm_mcu_code;
UINT16 i;
@@ -2210,7 +2210,7 @@ static WRITE16_HANDLER( daireika_mcu_w )
static READ16_HANDLER( mjzoomin_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x9c, 0xd8, 0x00,
0x2a, 0x6a, 0x00,
0x99, 0xd8, 0x00,
@@ -2235,7 +2235,7 @@ data value is REQ under mjzoomin video test menu.It is related to the MCU?
*/
static WRITE16_HANDLER( mjzoomin_mcu_w )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
UINT16 *jm_shared_ram = state->jm_shared_ram;
UINT16 *jm_mcu_code = state->jm_mcu_code;
if(ACCESSING_BITS_0_7 && data)
@@ -2349,7 +2349,7 @@ static WRITE16_HANDLER( mjzoomin_mcu_w )
static READ16_HANDLER( kakumei_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x8a, 0xd8, 0x00,
0x3c, 0x7c, 0x00,
0x99, 0xd8, 0x00,
@@ -2371,7 +2371,7 @@ static READ16_HANDLER( kakumei_mcu_r )
static READ16_HANDLER( suchipi_mcu_r )
{
- jalmah_state *state = space->machine->driver_data<jalmah_state>();
+ jalmah_state *state = space->machine().driver_data<jalmah_state>();
static const int resp[] = { 0x8a, 0xd8, 0x00,
0x3c, 0x7c, 0x00,
0x99, 0xd8, 0x00,
@@ -2393,51 +2393,51 @@ static READ16_HANDLER( suchipi_mcu_r )
static DRIVER_INIT( urashima )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(urashima_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(urashima_mcu_w) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(urashima_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(urashima_mcu_w) );
state->mcu_prg = 0x12;
}
static DRIVER_INIT( daireika )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(daireika_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(daireika_mcu_w) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(daireika_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(daireika_mcu_w) );
state->mcu_prg = 0x11;
}
static DRIVER_INIT( mjzoomin )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(mjzoomin_mcu_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(mjzoomin_mcu_w) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(mjzoomin_mcu_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x80012, 0x80013, FUNC(mjzoomin_mcu_w) );
state->mcu_prg = 0x13;
}
static DRIVER_INIT( kakumei )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
state->mcu_prg = 0x21;
}
static DRIVER_INIT( kakumei2 )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(kakumei_mcu_r) );
state->mcu_prg = 0x22;
}
static DRIVER_INIT( suchipi )
{
- jalmah_state *state = machine->driver_data<jalmah_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(suchipi_mcu_r) );
+ jalmah_state *state = machine.driver_data<jalmah_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x80004, 0x80005, FUNC(suchipi_mcu_r) );
state->mcu_prg = 0x23;
}
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index a09ddc18875..e65f814cce3 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -86,7 +86,7 @@ static PALETTE_INIT( jangou )
2, resistances_b, weights_b, 0, 0,
0, 0, 0, 0, 0);
- for (i = 0;i < machine->total_colors(); i++)
+ for (i = 0;i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
int r, g, b;
@@ -114,14 +114,14 @@ static PALETTE_INIT( jangou )
static VIDEO_START( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
state->save_item(NAME(state->blit_buffer));
}
static SCREEN_UPDATE( jangou )
{
- jangou_state *state = screen->machine->driver_data<jangou_state>();
+ jangou_state *state = screen->machine().driver_data<jangou_state>();
int x, y;
for (y = cliprect->min_y; y <= cliprect->max_y; ++y)
@@ -132,8 +132,8 @@ static SCREEN_UPDATE( jangou )
for (x = cliprect->min_x; x <= cliprect->max_x; x += 2)
{
UINT32 srcpix = *src++;
- *dst++ = screen->machine->pens[srcpix & 0xf];
- *dst++ = screen->machine->pens[(srcpix >> 4) & 0xf];
+ *dst++ = screen->machine().pens[srcpix & 0xf];
+ *dst++ = screen->machine().pens[(srcpix >> 4) & 0xf];
}
}
@@ -151,9 +151,9 @@ h [$16]
w [$17]
*/
-static UINT8 jangou_gfx_nibble( running_machine *machine, UINT16 niboffset )
+static UINT8 jangou_gfx_nibble( running_machine &machine, UINT16 niboffset )
{
- const UINT8 *const blit_rom = machine->region("gfx")->base();
+ const UINT8 *const blit_rom = machine.region("gfx")->base();
if (niboffset & 1)
return (blit_rom[(niboffset >> 1) & 0xffff] & 0xf0) >> 4;
@@ -161,9 +161,9 @@ static UINT8 jangou_gfx_nibble( running_machine *machine, UINT16 niboffset )
return (blit_rom[(niboffset >> 1) & 0xffff] & 0x0f);
}
-static void plot_jangou_gfx_pixel( running_machine *machine, UINT8 pix, int x, int y )
+static void plot_jangou_gfx_pixel( running_machine &machine, UINT8 pix, int x, int y )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
if (y < 0 || y >= 512)
return;
if (x < 0 || x >= 512)
@@ -177,7 +177,7 @@ static void plot_jangou_gfx_pixel( running_machine *machine, UINT8 pix, int x, i
static WRITE8_HANDLER( blitter_process_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
int src, x, y, h, w, flipx;
state->blit_data[offset] = data;
@@ -208,14 +208,14 @@ static WRITE8_HANDLER( blitter_process_w )
{
int drawx = (x + xcount) & 0xff;
int drawy = (y + ycount) & 0xff;
- UINT8 dat = jangou_gfx_nibble(space->machine, src + count);
+ UINT8 dat = jangou_gfx_nibble(space->machine(), src + count);
UINT8 cur_pen_hi = state->pen_data[(dat & 0xf0) >> 4];
UINT8 cur_pen_lo = state->pen_data[(dat & 0x0f) >> 0];
dat = cur_pen_lo | (cur_pen_hi << 4);
if ((dat & 0xff) != 0)
- plot_jangou_gfx_pixel(space->machine, dat, drawx, drawy);
+ plot_jangou_gfx_pixel(space->machine(), dat, drawx, drawy);
if (!flipx)
count--;
@@ -229,7 +229,7 @@ static WRITE8_HANDLER( blitter_process_w )
/* What is the bit 5 (0x20) for?*/
static WRITE8_HANDLER( blit_vregs_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
// printf("%02x %02x\n", offset, data);
state->pen_data[offset] = data & 0xf;
@@ -243,7 +243,7 @@ static WRITE8_HANDLER( blit_vregs_w )
static WRITE8_HANDLER( mux_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->mux_data = ~data;
}
@@ -255,30 +255,30 @@ static WRITE8_HANDLER( output_w )
---- ---x coin counter
*/
// printf("%02x\n", data);
- coin_counter_w(space->machine, 0, data & 0x01);
+ coin_counter_w(space->machine(), 0, data & 0x01);
// flip_screen_set(data & 0x04);
-// coin_lockout_w(space->machine, 0, ~data & 0x20);
+// coin_lockout_w(space->machine(), 0, ~data & 0x20);
}
static READ8_DEVICE_HANDLER( input_mux_r )
{
- jangou_state *state = device->machine->driver_data<jangou_state>();
+ jangou_state *state = device->machine().driver_data<jangou_state>();
switch(state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL1_1");
- case 0x02: return input_port_read(device->machine, "PL1_2");
- case 0x04: return input_port_read(device->machine, "PL2_1");
- case 0x08: return input_port_read(device->machine, "PL2_2");
- case 0x10: return input_port_read(device->machine, "PL1_3");
- case 0x20: return input_port_read(device->machine, "PL2_3");
+ case 0x01: return input_port_read(device->machine(), "PL1_1");
+ case 0x02: return input_port_read(device->machine(), "PL1_2");
+ case 0x04: return input_port_read(device->machine(), "PL2_1");
+ case 0x08: return input_port_read(device->machine(), "PL2_2");
+ case 0x10: return input_port_read(device->machine(), "PL1_3");
+ case 0x20: return input_port_read(device->machine(), "PL2_3");
}
- return input_port_read(device->machine, "IN_NOMUX");
+ return input_port_read(device->machine(), "IN_NOMUX");
}
static READ8_DEVICE_HANDLER( input_system_r )
{
- return input_port_read(device->machine, "SYSTEM");
+ return input_port_read(device->machine(), "SYSTEM");
}
@@ -290,14 +290,14 @@ static READ8_DEVICE_HANDLER( input_system_r )
static WRITE8_HANDLER( sound_latch_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->cpu_1, INPUT_LINE_NMI, ASSERT_LINE);
}
static READ8_HANDLER( sound_latch_r )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
device_set_input_line(state->cpu_1, INPUT_LINE_NMI, CLEAR_LINE);
return soundlatch_r(space, 0);
}
@@ -305,13 +305,13 @@ static READ8_HANDLER( sound_latch_r )
/* Jangou HC-55516 CVSD */
static WRITE8_HANDLER( cvsd_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->cvsd_shiftreg = data;
}
static TIMER_CALLBACK( cvsd_bit_timer_callback )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
/* Data is shifted out at the MSB */
hc55516_digit_w(state->cvsd, (state->cvsd_shiftreg >> 7) & 1);
@@ -326,13 +326,13 @@ static TIMER_CALLBACK( cvsd_bit_timer_callback )
/* Jangou Lady MSM5218 (MSM5205-compatible) ADPCM */
static WRITE8_HANDLER( adpcm_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->adpcm_byte = data;
}
static void jngolady_vclk_cb( device_t *device )
{
- jangou_state *state = device->machine->driver_data<jangou_state>();
+ jangou_state *state = device->machine().driver_data<jangou_state>();
if (state->msm5205_vclk_toggle == 0)
msm5205_data_w(device, state->adpcm_byte >> 4);
@@ -354,13 +354,13 @@ static void jngolady_vclk_cb( device_t *device )
static READ8_HANDLER( master_com_r )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
return state->z80_latch;
}
static WRITE8_HANDLER( master_com_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
device_set_input_line(state->nsc, 0, HOLD_LINE);
state->nsc_latch = data;
@@ -368,13 +368,13 @@ static WRITE8_HANDLER( master_com_w )
static READ8_HANDLER( slave_com_r )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
return state->nsc_latch;
}
static WRITE8_HANDLER( slave_com_w )
{
- jangou_state *state = space->machine->driver_data<jangou_state>();
+ jangou_state *state = space->machine().driver_data<jangou_state>();
state->z80_latch = data;
}
@@ -890,10 +890,10 @@ static const msm5205_interface msm5205_config =
static SOUND_START( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
/* Create a timer to feed the CVSD DAC with sample bits */
- state->cvsd_bit_timer = machine->scheduler().timer_alloc(FUNC(cvsd_bit_timer_callback));
+ state->cvsd_bit_timer = machine.scheduler().timer_alloc(FUNC(cvsd_bit_timer_callback));
state->cvsd_bit_timer->adjust(attotime::from_hz(MASTER_CLOCK / 1024), 0, attotime::from_hz(MASTER_CLOCK / 1024));
}
@@ -906,12 +906,12 @@ static SOUND_START( jangou )
static MACHINE_START( common )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
- state->cpu_0 = machine->device("cpu0");
- state->cpu_1 = machine->device("cpu1");
- state->cvsd = machine->device("cvsd");
- state->nsc = machine->device("nsc");
+ state->cpu_0 = machine.device("cpu0");
+ state->cpu_1 = machine.device("cpu1");
+ state->cvsd = machine.device("cvsd");
+ state->nsc = machine.device("nsc");
state->save_item(NAME(state->pen_data));
state->save_item(NAME(state->blit_data));
@@ -920,7 +920,7 @@ static MACHINE_START( common )
static MACHINE_START( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_START_CALL(common);
@@ -930,7 +930,7 @@ static MACHINE_START( jangou )
static MACHINE_START( jngolady )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_START_CALL(common);
@@ -942,7 +942,7 @@ static MACHINE_START( jngolady )
static MACHINE_RESET( common )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
int i;
state->mux_data = 0;
@@ -956,7 +956,7 @@ static MACHINE_RESET( common )
static MACHINE_RESET( jangou )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_RESET_CALL(common);
@@ -966,7 +966,7 @@ static MACHINE_RESET( jangou )
static MACHINE_RESET( jngolady )
{
- jangou_state *state = machine->driver_data<jangou_state>();
+ jangou_state *state = machine.driver_data<jangou_state>();
MACHINE_RESET_CALL(common);
@@ -1355,19 +1355,19 @@ ROM_END
/*Temporary kludge for make the RNG work*/
static READ8_HANDLER( jngolady_rng_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static DRIVER_INIT( jngolady )
{
- machine->device("nsc")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x08, 0x08, FUNC(jngolady_rng_r) );
+ machine.device("nsc")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x08, 0x08, FUNC(jngolady_rng_r) );
}
static DRIVER_INIT (luckygrl)
{
// this is WRONG
int A;
- UINT8 *ROM = machine->region("cpu0")->base();
+ UINT8 *ROM = machine.region("cpu0")->base();
unsigned char patn1[32] = {
0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0, 0x00, 0xA0,
@@ -1393,7 +1393,7 @@ static DRIVER_INIT (luckygrl)
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
diff --git a/src/mame/drivers/jantotsu.c b/src/mame/drivers/jantotsu.c
index 622d8c94959..ea21dd2af9e 100644
--- a/src/mame/drivers/jantotsu.c
+++ b/src/mame/drivers/jantotsu.c
@@ -127,14 +127,14 @@ public:
static VIDEO_START(jantotsu)
{
- jantotsu_state *state = machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = machine.driver_data<jantotsu_state>();
state->save_item(NAME(state->bitmap));
}
static SCREEN_UPDATE(jantotsu)
{
- jantotsu_state *state = screen->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = screen->machine().driver_data<jantotsu_state>();
int x, y, i;
int count = 0;
@@ -161,7 +161,7 @@ static SCREEN_UPDATE(jantotsu)
color |= state->col_bank;
if ((x + i) <= screen->visible_area().max_x && (y + 0) < screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, x + i) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, x + i) = screen->machine().pens[color];
}
count++;
@@ -174,19 +174,19 @@ static SCREEN_UPDATE(jantotsu)
/* banked vram */
static READ8_HANDLER( jantotsu_bitmap_r )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
return state->bitmap[offset + ((state->vram_bank & 3) * 0x2000)];
}
static WRITE8_HANDLER( jantotsu_bitmap_w )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
state->bitmap[offset + ((state->vram_bank & 3) * 0x2000)] = data;
}
static WRITE8_HANDLER( bankaddr_w )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
state->vram_bank = ((data & 0xc0) >> 6);
@@ -231,21 +231,21 @@ static PALETTE_INIT( jantotsu )
/*Multiplexer is mapped as 6-bits reads,bits 6 & 7 are always connected to the coin mechs.*/
static READ8_HANDLER( jantotsu_mux_r )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
- UINT8 coin_port = input_port_read(space->machine, "COINS");
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
+ UINT8 coin_port = input_port_read(space->machine(), "COINS");
// printf("%02x\n", state->mux_data);
switch (state->mux_data)
{
- case 0x01: return input_port_read(space->machine, "PL1_1") | coin_port;
- case 0x02: return input_port_read(space->machine, "PL1_2") | coin_port;
- case 0x04: return input_port_read(space->machine, "PL1_3") | coin_port;
- case 0x08: return input_port_read(space->machine, "PL1_4") | coin_port;
- case 0x10: return input_port_read(space->machine, "PL2_1") | coin_port;
- case 0x20: return input_port_read(space->machine, "PL2_2") | coin_port;
- case 0x40: return input_port_read(space->machine, "PL2_3") | coin_port;
- case 0x80: return input_port_read(space->machine, "PL2_4") | coin_port;
+ case 0x01: return input_port_read(space->machine(), "PL1_1") | coin_port;
+ case 0x02: return input_port_read(space->machine(), "PL1_2") | coin_port;
+ case 0x04: return input_port_read(space->machine(), "PL1_3") | coin_port;
+ case 0x08: return input_port_read(space->machine(), "PL1_4") | coin_port;
+ case 0x10: return input_port_read(space->machine(), "PL2_1") | coin_port;
+ case 0x20: return input_port_read(space->machine(), "PL2_2") | coin_port;
+ case 0x40: return input_port_read(space->machine(), "PL2_3") | coin_port;
+ case 0x80: return input_port_read(space->machine(), "PL2_4") | coin_port;
}
return coin_port;
@@ -253,7 +253,7 @@ static READ8_HANDLER( jantotsu_mux_r )
static WRITE8_HANDLER( jantotsu_mux_w )
{
- jantotsu_state *state = space->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = space->machine().driver_data<jantotsu_state>();
state->mux_data = ~data;
}
@@ -263,12 +263,12 @@ static WRITE8_HANDLER( jantotsu_mux_w )
a side-by-side test (to know if the background colors really works) to be sure. */
static READ8_HANDLER( jantotsu_dsw2_r )
{
- return (input_port_read(space->machine, "DSW2") & 0x3f) | 0x80;
+ return (input_port_read(space->machine(), "DSW2") & 0x3f) | 0x80;
}
static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
{
- jantotsu_state *state = device->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = device->machine().driver_data<jantotsu_state>();
switch (offset)
{
@@ -293,7 +293,7 @@ static WRITE8_DEVICE_HANDLER( jan_adpcm_w )
static void jan_adpcm_int( device_t *device )
{
- jantotsu_state *state = device->machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = device->machine().driver_data<jantotsu_state>();
if (state->adpcm_pos >= 0x10000 || state->adpcm_idle)
{
@@ -303,7 +303,7 @@ static void jan_adpcm_int( device_t *device )
}
else
{
- UINT8 *ROM = device->machine->region("adpcm")->base();
+ UINT8 *ROM = device->machine().region("adpcm")->base();
state->adpcm_data = ((state->adpcm_trigger ? (ROM[state->adpcm_pos] & 0x0f) : (ROM[state->adpcm_pos] & 0xf0) >> 4));
msm5205_data_w(device, state->adpcm_data & 0xf);
@@ -478,7 +478,7 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( jantotsu )
{
- jantotsu_state *state = machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = machine.driver_data<jantotsu_state>();
state->save_item(NAME(state->vram_bank));
state->save_item(NAME(state->mux_data));
@@ -490,7 +490,7 @@ static MACHINE_START( jantotsu )
static MACHINE_RESET( jantotsu )
{
- jantotsu_state *state = machine->driver_data<jantotsu_state>();
+ jantotsu_state *state = machine.driver_data<jantotsu_state>();
/*Load hard-wired background color.*/
state->col_bank = (input_port_read(machine, "DSW2") & 0xc0) >> 3;
diff --git a/src/mame/drivers/jchan.c b/src/mame/drivers/jchan.c
index 07a40415c5b..b26a5d6344e 100644
--- a/src/mame/drivers/jchan.c
+++ b/src/mame/drivers/jchan.c
@@ -209,14 +209,14 @@ public:
***************************************************************************/
-static void jchan_mcu_run(running_machine *machine)
+static void jchan_mcu_run(running_machine &machine)
{
- jchan_state *state = machine->driver_data<jchan_state>();
+ jchan_state *state = machine.driver_data<jchan_state>();
UINT16 mcu_command = state->mcu_ram[0x0010/2]; /* command nb */
UINT16 mcu_offset = state->mcu_ram[0x0012/2] / 2; /* offset in shared RAM where MCU will write */
UINT16 mcu_subcmd = state->mcu_ram[0x0014/2]; /* sub-command parameter, happens only for command #4 */
- logerror("%s : MCU executed command: %04X %04X %04X ",machine->describe_context(),mcu_command,mcu_offset*2,mcu_subcmd);
+ logerror("%s : MCU executed command: %04X %04X %04X ",machine.describe_context(),mcu_command,mcu_offset*2,mcu_subcmd);
/*
the only MCU commands found in program code are:
@@ -237,7 +237,7 @@ static void jchan_mcu_run(running_machine *machine)
case 0x03: // DSW
{
state->mcu_ram[mcu_offset] = input_port_read(machine, "DSW");
- logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine->describe_context(),mcu_command,mcu_offset*2);
+ logerror("%s : MCU executed command: %04X %04X (read DSW)\n",machine.describe_context(),mcu_command,mcu_offset*2);
}
break;
@@ -263,7 +263,7 @@ static void jchan_mcu_run(running_machine *machine)
#define JCHAN_MCU_COM_W(_n_) \
static WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \
{ \
- jchan_state *state = space->machine->driver_data<jchan_state>(); \
+ jchan_state *state = space->machine().driver_data<jchan_state>(); \
COMBINE_DATA(&state->mcu_com[_n_]); \
if (state->mcu_com[0] != 0xFFFF) return; \
if (state->mcu_com[1] != 0xFFFF) return; \
@@ -271,7 +271,7 @@ static WRITE16_HANDLER( jchan_mcu_com##_n_##_w ) \
if (state->mcu_com[3] != 0xFFFF) return; \
\
memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) ); \
- jchan_mcu_run(space->machine); \
+ jchan_mcu_run(space->machine()); \
}
JCHAN_MCU_COM_W(0)
@@ -300,7 +300,7 @@ static READ16_HANDLER( jchan_mcu_status_r )
// move was performed
static INTERRUPT_GEN( jchan_vblank )
{
- jchan_state *state = device->machine->driver_data<jchan_state>();
+ jchan_state *state = device->machine().driver_data<jchan_state>();
int i = cpu_getiloops(device);
switch (i)
{
@@ -321,15 +321,15 @@ static INTERRUPT_GEN( jchan_vblank )
{
case 0:
- cputag_set_input_line(device->machine, "sub", 1, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "sub", 1, HOLD_LINE);
break;
case 220:
- cputag_set_input_line(device->machine, "sub", 2, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "sub", 2, HOLD_LINE);
break;
case 100:
- cputag_set_input_line(device->machine, "sub", 3, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "sub", 3, HOLD_LINE);
break;
}
@@ -341,20 +341,20 @@ static INTERRUPT_GEN( jchan_vblank )
static VIDEO_START(jchan)
{
- jchan_state *state = machine->driver_data<jchan_state>();
+ jchan_state *state = machine.driver_data<jchan_state>();
/* so we can use suprnova.c */
state->sprite_ram32_1 = auto_alloc_array(machine, UINT32, 0x4000/4);
state->sprite_ram32_2 = auto_alloc_array(machine, UINT32, 0x4000/4);
- machine->generic.spriteram_size = 0x4000;
+ machine.generic.spriteram_size = 0x4000;
state->sprite_regs32_1 = auto_alloc_array(machine, UINT32, 0x40/4);
state->sprite_regs32_2 = auto_alloc_array(machine, UINT32, 0x40/4);
state->sprite_bitmap_1 = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_INDEXED16);
state->sprite_bitmap_2 = auto_bitmap_alloc(machine,1024,1024,BITMAP_FORMAT_INDEXED16);
- state->spritegen1 = machine->device<sknsspr_device>("spritegen1");
- state->spritegen2 = machine->device<sknsspr_device>("spritegen2");
+ state->spritegen1 = machine.device<sknsspr_device>("spritegen1");
+ state->spritegen2 = machine.device<sknsspr_device>("spritegen2");
state->spritegen1->skns_sprite_kludge(0,0);
@@ -371,7 +371,7 @@ static VIDEO_START(jchan)
static SCREEN_UPDATE(jchan)
{
- jchan_state *state = screen->machine->driver_data<jchan_state>();
+ jchan_state *state = screen->machine().driver_data<jchan_state>();
int x,y;
UINT16* src1;
UINT16* src2;
@@ -379,15 +379,15 @@ static SCREEN_UPDATE(jchan)
UINT16 pixdata1;
UINT16 pixdata2;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
SCREEN_UPDATE_CALL(jchan_view2);
bitmap_fill(state->sprite_bitmap_1, cliprect, 0x0000);
bitmap_fill(state->sprite_bitmap_2, cliprect, 0x0000);
- state->spritegen1->skns_draw_sprites(screen->machine, state->sprite_bitmap_1, cliprect, state->sprite_ram32_1, 0x4000, screen->machine->region("gfx1")->base(), screen->machine->region ("gfx1")->bytes(), state->sprite_regs32_1 );
- state->spritegen2->skns_draw_sprites(screen->machine, state->sprite_bitmap_2, cliprect, state->sprite_ram32_2, 0x4000, screen->machine->region("gfx2")->base(), screen->machine->region ("gfx2")->bytes(), state->sprite_regs32_2 );
+ state->spritegen1->skns_draw_sprites(screen->machine(), state->sprite_bitmap_1, cliprect, state->sprite_ram32_1, 0x4000, screen->machine().region("gfx1")->base(), screen->machine().region ("gfx1")->bytes(), state->sprite_regs32_1 );
+ state->spritegen2->skns_draw_sprites(screen->machine(), state->sprite_bitmap_2, cliprect, state->sprite_ram32_2, 0x4000, screen->machine().region("gfx2")->base(), screen->machine().region ("gfx2")->bytes(), state->sprite_regs32_2 );
// ignoring priority bits for now - might use alpha too, check 0x8000 of palette writes
for (y=0;y<240;y++)
@@ -430,19 +430,19 @@ static SCREEN_UPDATE(jchan)
static WRITE16_HANDLER( jchan_ctrl_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
state->irq_sub_enable = data & 0x8000; // hack / guess!
}
static READ16_HANDLER ( jchan_ctrl_r )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
switch(offset)
{
- case 0/2: return input_port_read(space->machine, "P1");
- case 2/2: return input_port_read(space->machine, "P2");
- case 4/2: return input_port_read(space->machine, "SYSTEM");
- case 6/2: return input_port_read(space->machine, "EXTRA");
+ case 0/2: return input_port_read(space->machine(), "P1");
+ case 2/2: return input_port_read(space->machine(), "P2");
+ case 4/2: return input_port_read(space->machine(), "SYSTEM");
+ case 6/2: return input_port_read(space->machine(), "EXTRA");
default: logerror("jchan_ctrl_r unknown!"); break;
}
return state->ctrl[offset];
@@ -457,23 +457,23 @@ static READ16_HANDLER ( jchan_ctrl_r )
/* communications - hacky! */
static WRITE16_HANDLER( main2sub_cmd_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->mainsub_shared_ram[0x03ffe/2]);
- cputag_set_input_line(space->machine, "sub", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "sub", 4, HOLD_LINE);
}
// is this called?
static WRITE16_HANDLER( sub2main_cmd_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->mainsub_shared_ram[0x0000/2]);
- cputag_set_input_line(space->machine, "maincpu", 3, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 3, HOLD_LINE);
}
/* ram convert for suprnova (requires 32-bit stuff) */
static WRITE16_HANDLER( jchan_suprnova_sprite32_1_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->spriteram_1[offset]);
offset>>=1;
state->sprite_ram32_1[offset]=(state->spriteram_1[offset*2+1]<<16) | (state->spriteram_1[offset*2]);
@@ -481,7 +481,7 @@ static WRITE16_HANDLER( jchan_suprnova_sprite32_1_w )
static WRITE16_HANDLER( jchan_suprnova_sprite32regs_1_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->sprregs_1[offset]);
offset>>=1;
state->sprite_regs32_1[offset]=(state->sprregs_1[offset*2+1]<<16) | (state->sprregs_1[offset*2]);
@@ -489,7 +489,7 @@ static WRITE16_HANDLER( jchan_suprnova_sprite32regs_1_w )
static WRITE16_HANDLER( jchan_suprnova_sprite32_2_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->spriteram_2[offset]);
offset>>=1;
state->sprite_ram32_2[offset]=(state->spriteram_2[offset*2+1]<<16) | (state->spriteram_2[offset*2]);
@@ -497,7 +497,7 @@ static WRITE16_HANDLER( jchan_suprnova_sprite32_2_w )
static WRITE16_HANDLER( jchan_suprnova_sprite32regs_2_w )
{
- jchan_state *state = space->machine->driver_data<jchan_state>();
+ jchan_state *state = space->machine().driver_data<jchan_state>();
COMBINE_DATA(&state->sprregs_2[offset]);
offset>>=1;
state->sprite_regs32_2[offset]=(state->sprregs_2[offset*2+1]<<16) | (state->sprregs_2[offset*2]);
@@ -786,16 +786,16 @@ ROM_END
static DRIVER_INIT( jchan )
{
- jchan_state *state = machine->driver_data<jchan_state>();
+ jchan_state *state = machine.driver_data<jchan_state>();
DRIVER_INIT_CALL( decrypt_toybox_rom );
// install these here, putting them in the memory map causes issues
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x403ffe, 0x403fff, FUNC(main2sub_cmd_w) );
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(sub2main_cmd_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x403ffe, 0x403fff, FUNC(main2sub_cmd_w) );
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x400000, 0x400001, FUNC(sub2main_cmd_w) );
memset(state->mcu_com, 0, 4 * sizeof( UINT16 ) );
- machine->device<nvram_device>("nvram")->set_base(state->nvram_data, sizeof(state->nvram_data));
+ machine.device<nvram_device>("nvram")->set_base(state->nvram_data, sizeof(state->nvram_data));
}
diff --git a/src/mame/drivers/jedi.c b/src/mame/drivers/jedi.c
index 6806a8edaeb..00333c1dbcc 100644
--- a/src/mame/drivers/jedi.c
+++ b/src/mame/drivers/jedi.c
@@ -125,7 +125,7 @@
static TIMER_CALLBACK( generate_interrupt )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
int scanline = param;
/* IRQ is set by /32V */
@@ -136,13 +136,13 @@ static TIMER_CALLBACK( generate_interrupt )
scanline += 32;
if (scanline > 256)
scanline = 32;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static WRITE8_HANDLER( main_irq_ack_w )
{
- cputag_set_input_line(space->machine, "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", M6502_IRQ_LINE, CLEAR_LINE);
}
@@ -155,14 +155,14 @@ static WRITE8_HANDLER( main_irq_ack_w )
static MACHINE_START( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* set a timer to run the interrupts */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(generate_interrupt));
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(32), 32);
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(generate_interrupt));
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(32), 32);
/* configure the banks */
- memory_configure_bank(machine, "bank1", 0, 3, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 3, machine.region("maincpu")->base() + 0x10000, 0x4000);
/* set up save state */
state->save_item(NAME(state->nvram_enabled));
@@ -178,7 +178,7 @@ static MACHINE_START( jedi )
static MACHINE_RESET( jedi )
{
- jedi_state *state = machine->driver_data<jedi_state>();
+ jedi_state *state = machine.driver_data<jedi_state>();
/* init globals */
state->a2d_select = 0;
@@ -195,9 +195,9 @@ static MACHINE_RESET( jedi )
static WRITE8_HANDLER( rom_banksel_w )
{
- if (data & 0x01) memory_set_bank(space->machine, "bank1", 0);
- if (data & 0x02) memory_set_bank(space->machine, "bank1", 1);
- if (data & 0x04) memory_set_bank(space->machine, "bank1", 2);
+ if (data & 0x01) memory_set_bank(space->machine(), "bank1", 0);
+ if (data & 0x02) memory_set_bank(space->machine(), "bank1", 1);
+ if (data & 0x04) memory_set_bank(space->machine(), "bank1", 2);
}
@@ -210,13 +210,13 @@ static WRITE8_HANDLER( rom_banksel_w )
static READ8_HANDLER( a2d_data_r )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
UINT8 ret = 0;
switch (state->a2d_select)
{
- case 0: ret = input_port_read(space->machine, "STICKY"); break;
- case 2: ret = input_port_read(space->machine, "STICKX"); break;
+ case 0: ret = input_port_read(space->machine(), "STICKY"); break;
+ case 2: ret = input_port_read(space->machine(), "STICKX"); break;
}
return ret;
@@ -225,7 +225,7 @@ static READ8_HANDLER( a2d_data_r )
static WRITE8_HANDLER( a2d_select_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->a2d_select = offset;
}
@@ -233,7 +233,7 @@ static WRITE8_HANDLER( a2d_select_w )
static WRITE8_HANDLER( jedi_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
@@ -246,7 +246,7 @@ static WRITE8_HANDLER( jedi_coin_counter_w )
static WRITE8_HANDLER( nvram_data_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
if (state->nvram_enabled)
state->m_nvram[offset] = data;
@@ -255,7 +255,7 @@ static WRITE8_HANDLER( nvram_data_w )
static WRITE8_HANDLER( nvram_enable_w )
{
- jedi_state *state = space->machine->driver_data<jedi_state>();
+ jedi_state *state = space->machine().driver_data<jedi_state>();
state->nvram_enabled = ~offset & 1;
}
diff --git a/src/mame/drivers/jokrwild.c b/src/mame/drivers/jokrwild.c
index a77d049eeb5..e84cb53be37 100644
--- a/src/mame/drivers/jokrwild.c
+++ b/src/mame/drivers/jokrwild.c
@@ -116,7 +116,7 @@ public:
static WRITE8_HANDLER( jokrwild_videoram_w )
{
- jokrwild_state *state = space->machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = space->machine().driver_data<jokrwild_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -124,7 +124,7 @@ static WRITE8_HANDLER( jokrwild_videoram_w )
static WRITE8_HANDLER( jokrwild_colorram_w )
{
- jokrwild_state *state = space->machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = space->machine().driver_data<jokrwild_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( jokrwild_colorram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- jokrwild_state *state = machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = machine.driver_data<jokrwild_state>();
/* - bits -
7654 3210
xx-- ---- bank select.
@@ -148,14 +148,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( jokrwild )
{
- jokrwild_state *state = machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = machine.driver_data<jokrwild_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 24, 26);
}
static SCREEN_UPDATE( jokrwild )
{
- jokrwild_state *state = screen->machine->driver_data<jokrwild_state>();
+ jokrwild_state *state = screen->machine().driver_data<jokrwild_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -184,7 +184,7 @@ static READ8_HANDLER( rng_r )
if(cpu_get_pc(space->cpu) == 0xab3a)
return (offset == 2) ? 0x49 : 0x92;
- return space->machine->rand() & 0xff;
+ return space->machine().rand() & 0xff;
}
/*************************
@@ -551,7 +551,7 @@ static DRIVER_INIT( jokrwild )
*****************************************************************************/
{
int i, offs;
- UINT8 *srcp = machine->region( "maincpu" )->base();
+ UINT8 *srcp = machine.region( "maincpu" )->base();
for (i = 0x8000; i < 0x10000; i++)
{
diff --git a/src/mame/drivers/jollyjgr.c b/src/mame/drivers/jollyjgr.c
index 24337aae2d8..f3494adde7e 100644
--- a/src/mame/drivers/jollyjgr.c
+++ b/src/mame/drivers/jollyjgr.c
@@ -131,14 +131,14 @@ public:
static WRITE8_HANDLER( jollyjgr_videoram_w )
{
- jollyjgr_state *state = space->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = space->machine().driver_data<jollyjgr_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( jollyjgr_attrram_w )
{
- jollyjgr_state *state = space->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = space->machine().driver_data<jollyjgr_state>();
if (offset & 1)
{
@@ -158,7 +158,7 @@ static WRITE8_HANDLER( jollyjgr_attrram_w )
static WRITE8_HANDLER( jollyjgr_misc_w )
{
- jollyjgr_state *state = space->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = space->machine().driver_data<jollyjgr_state>();
// they could be swapped, because it always set "data & 3"
state->flip_x = data & 1;
@@ -177,7 +177,7 @@ static WRITE8_HANDLER( jollyjgr_misc_w )
static WRITE8_HANDLER( jollyjgr_coin_lookout_w )
{
- coin_lockout_global_w(space->machine, data & 1);
+ coin_lockout_global_w(space->machine(), data & 1);
/* bits 4, 5, 6 and 7 are used too */
}
@@ -425,7 +425,7 @@ static PALETTE_INIT( jollyjgr )
/* Tilemap is the same as in Galaxian */
static TILE_GET_INFO( get_bg_tile_info )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
int color = state->colorram[((tile_index & 0x1f) << 1) | 1] & 7;
int region = (state->tilemap_bank & 0x20) ? 2 : 0;
SET_TILE_INFO(region, state->videoram[tile_index], color, 0);
@@ -433,16 +433,16 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( jollyjgr )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->bg_tilemap, 0);
tilemap_set_scroll_cols(state->bg_tilemap, 32);
}
-static void draw_bitmap( running_machine *machine, bitmap_t *bitmap )
+static void draw_bitmap( running_machine &machine, bitmap_t *bitmap )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
int x, y, count;
int i, bit0, bit1, bit2;
int color;
@@ -479,7 +479,7 @@ static void draw_bitmap( running_machine *machine, bitmap_t *bitmap )
static SCREEN_UPDATE( jollyjgr )
{
- jollyjgr_state *state = screen->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = screen->machine().driver_data<jollyjgr_state>();
UINT8 *spriteram = state->spriteram;
int offs;
@@ -488,7 +488,7 @@ static SCREEN_UPDATE( jollyjgr )
if(state->pri) //used in Frog & Spiders level 3
{
if(!(state->bitmap_disable))
- draw_bitmap(screen->machine, bitmap);
+ draw_bitmap(screen->machine(), bitmap);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
}
@@ -497,7 +497,7 @@ static SCREEN_UPDATE( jollyjgr )
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
if(!(state->bitmap_disable))
- draw_bitmap(screen->machine, bitmap);
+ draw_bitmap(screen->machine(), bitmap);
}
/* Sprites are the same as in Galaxian */
@@ -524,7 +524,7 @@ static SCREEN_UPDATE( jollyjgr )
if (offs < 3 * 4)
sy++;
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
code,color,
flipx,flipy,
sx,sy,0);
@@ -535,7 +535,7 @@ static SCREEN_UPDATE( jollyjgr )
static SCREEN_UPDATE( fspider )
{
- jollyjgr_state *state = screen->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = screen->machine().driver_data<jollyjgr_state>();
// Draw bg and sprites
SCREEN_UPDATE_CALL(jollyjgr);
@@ -608,7 +608,7 @@ GFXDECODE_END
static INTERRUPT_GEN( jollyjgr_interrupt )
{
- jollyjgr_state *state = device->machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = device->machine().driver_data<jollyjgr_state>();
if(state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -616,7 +616,7 @@ static INTERRUPT_GEN( jollyjgr_interrupt )
static MACHINE_START( jollyjgr )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->flip_x));
@@ -627,7 +627,7 @@ static MACHINE_START( jollyjgr )
static MACHINE_RESET( jollyjgr )
{
- jollyjgr_state *state = machine->driver_data<jollyjgr_state>();
+ jollyjgr_state *state = machine.driver_data<jollyjgr_state>();
state->nmi_enable = 0;
state->flip_x = 0;
diff --git a/src/mame/drivers/jongkyo.c b/src/mame/drivers/jongkyo.c
index 093c4fbb636..11e8ea82fd3 100644
--- a/src/mame/drivers/jongkyo.c
+++ b/src/mame/drivers/jongkyo.c
@@ -61,7 +61,7 @@ static VIDEO_START( jongkyo )
static SCREEN_UPDATE( jongkyo )
{
- jongkyo_state *state = screen->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = screen->machine().driver_data<jongkyo_state>();
int y;
for (y = 0; y < 256; ++y)
@@ -111,7 +111,7 @@ static SCREEN_UPDATE( jongkyo )
static WRITE8_HANDLER( bank_select_w )
{
- jongkyo_state *state = space->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = space->machine().driver_data<jongkyo_state>();
int mask = 1 << (offset >> 1);
state->rom_bank &= ~mask;
@@ -119,12 +119,12 @@ static WRITE8_HANDLER( bank_select_w )
if (offset & 1)
state->rom_bank |= mask;
- memory_set_bank(space->machine, "bank1", state->rom_bank);
+ memory_set_bank(space->machine(), "bank1", state->rom_bank);
}
static WRITE8_HANDLER( mux_w )
{
- jongkyo_state *state = space->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = space->machine().driver_data<jongkyo_state>();
state->mux_data = ~data;
// printf("%02x\n", state->mux_data);
}
@@ -132,54 +132,54 @@ static WRITE8_HANDLER( mux_w )
static WRITE8_HANDLER( jongkyo_coin_counter_w )
{
/* bit 1 = coin counter */
- coin_counter_w(space->machine, 0, data & 2);
+ coin_counter_w(space->machine(), 0, data & 2);
/* bit 2 always set? */
}
static READ8_DEVICE_HANDLER( input_1p_r )
{
- jongkyo_state *state = device->machine->driver_data<jongkyo_state>();
- UINT8 cr_clear = input_port_read(device->machine, "CR_CLEAR");
+ jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
+ UINT8 cr_clear = input_port_read(device->machine(), "CR_CLEAR");
switch (state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL1_1") | cr_clear;
- case 0x02: return input_port_read(device->machine, "PL1_2") | cr_clear;
- case 0x04: return input_port_read(device->machine, "PL1_3") | cr_clear;
- case 0x08: return input_port_read(device->machine, "PL1_4") | cr_clear;
- case 0x10: return input_port_read(device->machine, "PL1_5") | cr_clear;
- case 0x20: return input_port_read(device->machine, "PL1_6") | cr_clear;
+ case 0x01: return input_port_read(device->machine(), "PL1_1") | cr_clear;
+ case 0x02: return input_port_read(device->machine(), "PL1_2") | cr_clear;
+ case 0x04: return input_port_read(device->machine(), "PL1_3") | cr_clear;
+ case 0x08: return input_port_read(device->machine(), "PL1_4") | cr_clear;
+ case 0x10: return input_port_read(device->machine(), "PL1_5") | cr_clear;
+ case 0x20: return input_port_read(device->machine(), "PL1_6") | cr_clear;
}
// printf("%04x\n", state->mux_data);
- return (input_port_read(device->machine, "PL1_1") & input_port_read(device->machine, "PL1_2") & input_port_read(device->machine, "PL1_3") &
- input_port_read(device->machine, "PL1_4") & input_port_read(device->machine, "PL1_5") & input_port_read(device->machine, "PL1_6")) | cr_clear;
+ return (input_port_read(device->machine(), "PL1_1") & input_port_read(device->machine(), "PL1_2") & input_port_read(device->machine(), "PL1_3") &
+ input_port_read(device->machine(), "PL1_4") & input_port_read(device->machine(), "PL1_5") & input_port_read(device->machine(), "PL1_6")) | cr_clear;
}
static READ8_DEVICE_HANDLER( input_2p_r )
{
- jongkyo_state *state = device->machine->driver_data<jongkyo_state>();
- UINT8 coin_port = input_port_read(device->machine, "COINS");
+ jongkyo_state *state = device->machine().driver_data<jongkyo_state>();
+ UINT8 coin_port = input_port_read(device->machine(), "COINS");
switch (state->mux_data)
{
- case 0x01: return input_port_read(device->machine, "PL2_1") | coin_port;
- case 0x02: return input_port_read(device->machine, "PL2_2") | coin_port;
- case 0x04: return input_port_read(device->machine, "PL2_3") | coin_port;
- case 0x08: return input_port_read(device->machine, "PL2_4") | coin_port;
- case 0x10: return input_port_read(device->machine, "PL2_5") | coin_port;
- case 0x20: return input_port_read(device->machine, "PL2_6") | coin_port;
+ case 0x01: return input_port_read(device->machine(), "PL2_1") | coin_port;
+ case 0x02: return input_port_read(device->machine(), "PL2_2") | coin_port;
+ case 0x04: return input_port_read(device->machine(), "PL2_3") | coin_port;
+ case 0x08: return input_port_read(device->machine(), "PL2_4") | coin_port;
+ case 0x10: return input_port_read(device->machine(), "PL2_5") | coin_port;
+ case 0x20: return input_port_read(device->machine(), "PL2_6") | coin_port;
}
// printf("%04x\n", state->mux_data);
- return (input_port_read(device->machine, "PL2_1") & input_port_read(device->machine, "PL2_2") & input_port_read(device->machine, "PL2_3") &
- input_port_read(device->machine, "PL2_4") & input_port_read(device->machine, "PL2_5") & input_port_read(device->machine, "PL2_6")) | coin_port;
+ return (input_port_read(device->machine(), "PL2_1") & input_port_read(device->machine(), "PL2_2") & input_port_read(device->machine(), "PL2_3") &
+ input_port_read(device->machine(), "PL2_4") & input_port_read(device->machine(), "PL2_5") & input_port_read(device->machine(), "PL2_6")) | coin_port;
}
static WRITE8_HANDLER( videoram2_w )
{
- jongkyo_state *state = space->machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = space->machine().driver_data<jongkyo_state>();
state->videoram2[offset] = data;
}
@@ -427,7 +427,7 @@ INPUT_PORTS_END
static PALETTE_INIT(jongkyo)
{
int i;
- UINT8* proms = machine->region("proms")->base();
+ UINT8* proms = machine.region("proms")->base();
for (i = 0; i < 0x40; i++)
{
int data = proms[i];
@@ -466,7 +466,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( jongkyo )
{
- jongkyo_state *state = machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = machine.driver_data<jongkyo_state>();
state->save_item(NAME(state->videoram2));
state->save_item(NAME(state->rom_bank));
@@ -475,7 +475,7 @@ static MACHINE_START( jongkyo )
static MACHINE_RESET( jongkyo )
{
- jongkyo_state *state = machine->driver_data<jongkyo_state>();
+ jongkyo_state *state = machine.driver_data<jongkyo_state>();
state->rom_bank = 0;
state->mux_data = 0;
@@ -548,7 +548,7 @@ ROM_END
static DRIVER_INIT( jongkyo )
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
/* first of all, do a simple bitswap */
for (i = 0x6000; i < 0x9000; ++i)
diff --git a/src/mame/drivers/jpmimpct.c b/src/mame/drivers/jpmimpct.c
index 7bb5a8d10ce..9b6317133bb 100644
--- a/src/mame/drivers/jpmimpct.c
+++ b/src/mame/drivers/jpmimpct.c
@@ -101,9 +101,9 @@
*
*************************************/
-static void update_irqs(running_machine *machine)
+static void update_irqs(running_machine &machine)
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
cputag_set_input_line(machine, "maincpu", 2, state->tms_irq ? ASSERT_LINE : CLEAR_LINE);
cputag_set_input_line(machine, "maincpu", 5, state->duart_1_irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -117,7 +117,7 @@ static void update_irqs(running_machine *machine)
static MACHINE_START( jpmimpct )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
state_save_register_global(machine, state->tms_irq);
state_save_register_global(machine, state->duart_1_irq);
state_save_register_global(machine, state->touch_cnt);
@@ -132,7 +132,7 @@ static MACHINE_START( jpmimpct )
static MACHINE_RESET( jpmimpct )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
memset(&state->duart_1, 0, sizeof(state->duart_1));
/* Reset states */
@@ -151,12 +151,12 @@ static MACHINE_RESET( jpmimpct )
static WRITE16_HANDLER( m68k_tms_w )
{
- tms34010_host_w(space->machine->device("dsp"), offset, data);
+ tms34010_host_w(space->machine().device("dsp"), offset, data);
}
static READ16_HANDLER( m68k_tms_r )
{
- return tms34010_host_r(space->machine->device("dsp"), offset);
+ return tms34010_host_r(space->machine().device("dsp"), offset);
}
@@ -190,17 +190,17 @@ static READ16_HANDLER( m68k_tms_r )
static TIMER_DEVICE_CALLBACK( duart_1_timer_event )
{
- jpmimpct_state *state = timer.machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = timer.machine().driver_data<jpmimpct_state>();
state->duart_1.tc = 0;
state->duart_1.ISR |= 0x08;
state->duart_1_irq = 1;
- update_irqs(timer.machine);
+ update_irqs(timer.machine());
}
static READ16_HANDLER( duart_1_r )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
struct duart_t &duart_1 = state->duart_1;
UINT16 val = 0xffff;
switch (offset)
@@ -242,20 +242,20 @@ static READ16_HANDLER( duart_1_r )
}
case 0xd:
{
- val = input_port_read(space->machine, "TEST/DEMO");
+ val = input_port_read(space->machine(), "TEST/DEMO");
break;
}
case 0xe:
{
attotime rate = attotime::from_hz(MC68681_1_CLOCK) * (16 * duart_1.CT);
- timer_device *duart_timer = space->machine->device<timer_device>("duart_1_timer");
+ timer_device *duart_timer = space->machine().device<timer_device>("duart_1_timer");
duart_timer->adjust(rate, 0, rate);
break;
}
case 0xf:
{
state->duart_1_irq = 0;
- update_irqs(space->machine);
+ update_irqs(space->machine());
duart_1.ISR |= ~0x8;
break;
}
@@ -266,7 +266,7 @@ static READ16_HANDLER( duart_1_r )
static WRITE16_HANDLER( duart_1_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
struct duart_t &duart_1 = state->duart_1;
//int old_val;
switch (offset)
@@ -353,18 +353,18 @@ static WRITE16_HANDLER( duart_1_w )
*/
static READ16_HANDLER( duart_2_r )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
switch (offset)
{
case 0x9:
{
if (state->touch_cnt == 0)
{
- if ( input_port_read(space->machine, "TOUCH") & 0x1 )
+ if ( input_port_read(space->machine(), "TOUCH") & 0x1 )
{
state->touch_data[0] = 0x2a;
- state->touch_data[1] = 0x7 - (input_port_read(space->machine, "TOUCH_Y") >> 5) + 0x30;
- state->touch_data[2] = (input_port_read(space->machine, "TOUCH_X") >> 5) + 0x30;
+ state->touch_data[1] = 0x7 - (input_port_read(space->machine(), "TOUCH_Y") >> 5) + 0x30;
+ state->touch_data[2] = (input_port_read(space->machine(), "TOUCH_X") >> 5) + 0x30;
/* Return RXRDY */
return 0x1;
@@ -428,22 +428,22 @@ static READ16_HANDLER( inputs1_r )
{
case 0:
{
- val = input_port_read(space->machine, "DSW");
+ val = input_port_read(space->machine(), "DSW");
break;
}
case 2:
{
- val = input_port_read(space->machine, "SW2");
+ val = input_port_read(space->machine(), "SW2");
break;
}
case 4:
{
- val = input_port_read(space->machine, "SW1");
+ val = input_port_read(space->machine(), "SW1");
break;
}
case 9:
{
- val = input_port_read(space->machine, "COINS");
+ val = input_port_read(space->machine(), "COINS");
break;
}
}
@@ -519,7 +519,7 @@ static READ16_HANDLER( jpmio_r )
static WRITE16_HANDLER( jpmio_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
switch (offset)
{
case 0x02:
@@ -781,9 +781,9 @@ INPUT_PORTS_END
static void jpmimpct_tms_irq(device_t *device, int state)
{
- jpmimpct_state *drvstate = device->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *drvstate = device->machine().driver_data<jpmimpct_state>();
drvstate->tms_irq = state;
- update_irqs(device->machine);
+ update_irqs(device->machine());
}
static const tms34010_config tms_config =
@@ -1058,7 +1058,7 @@ static READ8_DEVICE_HANDLER( hopper_c_r )
static WRITE8_DEVICE_HANDLER( payen_a_w )
{
- jpmimpct_state *state = device->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = device->machine().driver_data<jpmimpct_state>();
if ( data )
{
if ( data & 0x10 )
@@ -1087,7 +1087,7 @@ static const ppi8255_interface ppi8255_intf[1] =
static MACHINE_START( impctawp )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
state_save_register_global(machine, state->duart_1_irq);
state_save_register_global(machine, state->touch_cnt);
state_save_register_global_array(machine, state->touch_data);
@@ -1108,7 +1108,7 @@ static MACHINE_START( impctawp )
static MACHINE_RESET( impctawp )
{
- jpmimpct_state *state = machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = machine.driver_data<jpmimpct_state>();
memset(&state->duart_1, 0, sizeof(state->duart_1));
/* Reset states */
@@ -1140,7 +1140,7 @@ static MACHINE_RESET( impctawp )
*/
static READ16_HANDLER( optos_r )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
int i;
for (i=0; i<6; i++)
@@ -1159,7 +1159,7 @@ static READ16_HANDLER( optos_r )
static WRITE16_HANDLER( jpmioawp_w )
{
- jpmimpct_state *state = space->machine->driver_data<jpmimpct_state>();
+ jpmimpct_state *state = space->machine().driver_data<jpmimpct_state>();
int i;
switch (offset)
{
diff --git a/src/mame/drivers/jpmsys5.c b/src/mame/drivers/jpmsys5.c
index 261614590e7..0c214d23402 100644
--- a/src/mame/drivers/jpmsys5.c
+++ b/src/mame/drivers/jpmsys5.c
@@ -80,7 +80,7 @@ enum int_levels
*
*************************************/
-static void tms_interrupt(running_machine *machine, int state)
+static void tms_interrupt(running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", INT_TMS34061, state);
}
@@ -144,7 +144,7 @@ static READ16_HANDLER( sys5_tms34061_r )
static WRITE16_HANDLER( ramdac_w )
{
- jpmsys5_state *state = space->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = space->machine().driver_data<jpmsys5_state>();
if (offset == 0)
{
state->pal_addr = data;
@@ -157,7 +157,7 @@ static WRITE16_HANDLER( ramdac_w )
if (++state->pal_idx == 3)
{
/* Update the MAME palette */
- palette_set_color_rgb(space->machine, state->pal_addr, pal6bit(state->palette[state->pal_addr][0]), pal6bit(state->palette[state->pal_addr][1]), pal6bit(state->palette[state->pal_addr][2]));
+ palette_set_color_rgb(space->machine(), state->pal_addr, pal6bit(state->palette[state->pal_addr][0]), pal6bit(state->palette[state->pal_addr][1]), pal6bit(state->palette[state->pal_addr][2]));
state->pal_addr++;
state->pal_idx = 0;
}
@@ -182,7 +182,7 @@ static SCREEN_UPDATE( jpmsys5v )
if (state.blanked)
{
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
return 0;
}
@@ -196,8 +196,8 @@ static SCREEN_UPDATE( jpmsys5v )
UINT8 pen = src[(x-cliprect->min_x)>>1];
/* Draw two 4-bit pixels */
- *dest++ = screen->machine->pens[(pen >> 4) & 0xf];
- *dest++ = screen->machine->pens[pen & 0xf];
+ *dest++ = screen->machine().pens[(pen >> 4) & 0xf];
+ *dest++ = screen->machine().pens[pen & 0xf];
}
}
@@ -213,15 +213,15 @@ static SCREEN_UPDATE( jpmsys5v )
static WRITE16_HANDLER( rombank_w )
{
- UINT8 *rom = space->machine->region("maincpu")->base();
+ UINT8 *rom = space->machine().region("maincpu")->base();
data &= 0x1f;
- memory_set_bankptr(space->machine, "bank1", &rom[0x20000 + 0x20000 * data]);
+ memory_set_bankptr(space->machine(), "bank1", &rom[0x20000 + 0x20000 * data]);
}
static READ16_HANDLER( coins_r )
{
if (offset == 2)
- return input_port_read(space->machine, "COINS") << 8;
+ return input_port_read(space->machine(), "COINS") << 8;
else
return 0xffff;
}
@@ -244,7 +244,7 @@ static WRITE16_HANDLER( mux_w )
static READ16_HANDLER( mux_r )
{
if (offset == 0x81/2)
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
return 0xffff;
}
@@ -264,7 +264,7 @@ static WRITE16_DEVICE_HANDLER( jpm_upd7759_w )
}
else
{
- logerror("%s: upd7759: Unknown write to %x with %x\n", device->machine->describe_context(), offset, data);
+ logerror("%s: upd7759: Unknown write to %x with %x\n", device->machine().describe_context(), offset, data);
}
}
@@ -318,7 +318,7 @@ ADDRESS_MAP_END
/* Serial bit transmission callback */
static TIMER_CALLBACK( touch_cb )
{
- jpmsys5_state *state = machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
switch (state->touch_state)
{
case IDLE:
@@ -368,15 +368,15 @@ static TIMER_CALLBACK( touch_cb )
static INPUT_CHANGED( touchscreen_press )
{
- jpmsys5_state *state = field->port->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = field->port->machine().driver_data<jpmsys5_state>();
if (newval == 0)
{
attotime rx_period = attotime::from_hz(10000) * 16;
/* Each touch screen packet is 3 bytes */
state->touch_data[0] = 0x2a;
- state->touch_data[1] = 0x7 - (input_port_read(field->port->machine, "TOUCH_Y") >> 5) + 0x30;
- state->touch_data[2] = (input_port_read(field->port->machine, "TOUCH_X") >> 5) + 0x30;
+ state->touch_data[1] = 0x7 - (input_port_read(field->port->machine(), "TOUCH_Y") >> 5) + 0x30;
+ state->touch_data[2] = (input_port_read(field->port->machine(), "TOUCH_X") >> 5) + 0x30;
/* Start sending the data to the 68000 serially */
state->touch_data_count = 0;
@@ -464,7 +464,7 @@ INPUT_PORTS_END
static WRITE_LINE_DEVICE_HANDLER( ptm_irq )
{
- cputag_set_input_line(device->machine, "maincpu", INT_6840PTM, state ? ASSERT_LINE : CLEAR_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INT_6840PTM, state ? ASSERT_LINE : CLEAR_LINE);
}
static const ptm6840_interface ptm_intf =
@@ -484,26 +484,26 @@ static const ptm6840_interface ptm_intf =
static WRITE_LINE_DEVICE_HANDLER( acia_irq )
{
- cputag_set_input_line(device->machine, "maincpu", INT_6850ACIA, state ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INT_6850ACIA, state ? CLEAR_LINE : ASSERT_LINE);
}
/* Clocks are incorrect */
static READ_LINE_DEVICE_HANDLER( a0_rx_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a0_data_in;
}
static WRITE_LINE_DEVICE_HANDLER( a0_tx_w )
{
- jpmsys5_state *drvstate = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *drvstate = device->machine().driver_data<jpmsys5_state>();
drvstate->a0_data_out = state;
}
static READ_LINE_DEVICE_HANDLER( a0_dcd_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a0_acia_dcd;
}
@@ -521,19 +521,19 @@ static ACIA6850_INTERFACE( acia0_if )
static READ_LINE_DEVICE_HANDLER( a1_rx_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a1_data_in;
}
static WRITE_LINE_DEVICE_HANDLER( a1_tx_w )
{
- jpmsys5_state *drvstate = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *drvstate = device->machine().driver_data<jpmsys5_state>();
drvstate->a1_data_out = state;
}
static READ_LINE_DEVICE_HANDLER( a1_dcd_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a1_acia_dcd;
}
@@ -551,19 +551,19 @@ static ACIA6850_INTERFACE( acia1_if )
static READ_LINE_DEVICE_HANDLER( a2_rx_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a2_data_in;
}
static WRITE_LINE_DEVICE_HANDLER( a2_tx_w )
{
- jpmsys5_state *drvstate = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *drvstate = device->machine().driver_data<jpmsys5_state>();
drvstate->a2_data_out = state;
}
static READ_LINE_DEVICE_HANDLER( a2_dcd_r )
{
- jpmsys5_state *state = device->machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = device->machine().driver_data<jpmsys5_state>();
return state->a2_acia_dcd;
}
@@ -588,14 +588,14 @@ static ACIA6850_INTERFACE( acia2_if )
static MACHINE_START( jpmsys5v )
{
- jpmsys5_state *state = machine->driver_data<jpmsys5_state>();
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base());
- state->touch_timer = machine->scheduler().timer_alloc(FUNC(touch_cb));
+ jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base());
+ state->touch_timer = machine.scheduler().timer_alloc(FUNC(touch_cb));
}
static MACHINE_RESET( jpmsys5v )
{
- jpmsys5_state *state = machine->driver_data<jpmsys5_state>();
+ jpmsys5_state *state = machine.driver_data<jpmsys5_state>();
state->touch_timer->reset();
state->touch_state = IDLE;
state->a2_data_in = 1;
diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c
index bf80f8c661a..91d5a49537f 100644
--- a/src/mame/drivers/jrpacman.c
+++ b/src/mame/drivers/jrpacman.c
@@ -115,8 +115,8 @@ public:
static WRITE8_HANDLER( jrpacman_interrupt_vector_w )
{
- device_set_input_line_vector(space->machine->device("maincpu"), 0, data);
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ device_set_input_line_vector(space->machine().device("maincpu"), 0, data);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
@@ -378,7 +378,7 @@ static DRIVER_INIT( jrpacman )
{ 0,0 }
};
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i, j, A;
for (i = A = 0; table[i].count; i++)
diff --git a/src/mame/drivers/jubilee.c b/src/mame/drivers/jubilee.c
index 3f43ccea7ea..edde28ec020 100644
--- a/src/mame/drivers/jubilee.c
+++ b/src/mame/drivers/jubilee.c
@@ -108,7 +108,7 @@ public:
static WRITE8_HANDLER( jubileep_videoram_w )
{
- jubilee_state *state = space->machine->driver_data<jubilee_state>();
+ jubilee_state *state = space->machine().driver_data<jubilee_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( jubileep_videoram_w )
static TILE_GET_INFO( get_bg_tile_info )
{
- jubilee_state *state = machine->driver_data<jubilee_state>();
+ jubilee_state *state = machine.driver_data<jubilee_state>();
int code = state->videoram[tile_index];
SET_TILE_INFO( 0, code, 0, 0);
@@ -126,14 +126,14 @@ static TILE_GET_INFO( get_bg_tile_info )
static VIDEO_START( jubileep )
{
- jubilee_state *state = machine->driver_data<jubilee_state>();
+ jubilee_state *state = machine.driver_data<jubilee_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( jubileep )
{
- jubilee_state *state = screen->machine->driver_data<jubilee_state>();
+ jubilee_state *state = screen->machine().driver_data<jubilee_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -179,7 +179,7 @@ ADDRESS_MAP_END
static READ8_HANDLER(unk_r)
{
- return (space->machine->rand() & 0xff);
+ return (space->machine().rand() & 0xff);
}
static ADDRESS_MAP_START( jubileep_cru_map, AS_IO, 8 )
diff --git a/src/mame/drivers/junofrst.c b/src/mame/drivers/junofrst.c
index fdaa6a6878a..ae07008515f 100644
--- a/src/mame/drivers/junofrst.c
+++ b/src/mame/drivers/junofrst.c
@@ -127,14 +127,14 @@ public:
static WRITE8_HANDLER( junofrst_blitter_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
state->blitterdata[offset] = data;
/* blitter is triggered by $8073 */
if (offset == 3)
{
int i;
- UINT8 *gfx_rom = space->machine->region("gfx1")->base();
+ UINT8 *gfx_rom = space->machine().region("gfx1")->base();
offs_t src = ((state->blitterdata[2] << 8) | state->blitterdata[3]) & 0xfffc;
offs_t dest = (state->blitterdata[0] << 8) | state->blitterdata[1];
@@ -181,13 +181,13 @@ static WRITE8_HANDLER( junofrst_blitter_w )
static WRITE8_HANDLER( junofrst_bankselect_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
static READ8_DEVICE_HANDLER( junofrst_portA_r )
{
- junofrst_state *state = device->machine->driver_data<junofrst_state>();
+ junofrst_state *state = device->machine().driver_data<junofrst_state>();
int timer;
/* main xtal 14.318MHz, divided by 8 to get the CPU clock, further */
@@ -204,7 +204,7 @@ static READ8_DEVICE_HANDLER( junofrst_portA_r )
static WRITE8_DEVICE_HANDLER( junofrst_portB_w )
{
- junofrst_state *state = device->machine->driver_data<junofrst_state>();
+ junofrst_state *state = device->machine().driver_data<junofrst_state>();
device_t *filter[3] = { state->filter_0_0, state->filter_0_1, state->filter_0_2 };
int i;
@@ -225,7 +225,7 @@ static WRITE8_DEVICE_HANDLER( junofrst_portB_w )
static WRITE8_HANDLER( junofrst_sh_irqtrigger_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
if (state->last_irq == 0 && data == 1)
{
@@ -239,14 +239,14 @@ static WRITE8_HANDLER( junofrst_sh_irqtrigger_w )
static WRITE8_HANDLER( junofrst_i8039_irq_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
device_set_input_line(state->i8039, 0, ASSERT_LINE);
}
static WRITE8_HANDLER( i8039_irqen_and_status_w )
{
- junofrst_state *state = space->machine->driver_data<junofrst_state>();
+ junofrst_state *state = space->machine().driver_data<junofrst_state>();
if ((data & 0x80) == 0)
device_set_input_line(state->i8039, 0, CLEAR_LINE);
@@ -263,7 +263,7 @@ static WRITE8_HANDLER( flip_screen_w )
static WRITE8_HANDLER( junofrst_coin_counter_w )
{
- coin_counter_w(space->machine, offset, data);
+ coin_counter_w(space->machine(), offset, data);
}
@@ -370,14 +370,14 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( junofrst )
{
- junofrst_state *state = machine->driver_data<junofrst_state>();
+ junofrst_state *state = machine.driver_data<junofrst_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
- state->i8039 = machine->device("mcu");
- state->soundcpu = machine->device<cpu_device>("audiocpu");
- state->filter_0_0 = machine->device("filter.0.0");
- state->filter_0_1 = machine->device("filter.0.1");
- state->filter_0_2 = machine->device("filter.0.2");
+ state->maincpu = machine.device<cpu_device>("maincpu");
+ state->i8039 = machine.device("mcu");
+ state->soundcpu = machine.device<cpu_device>("audiocpu");
+ state->filter_0_0 = machine.device("filter.0.0");
+ state->filter_0_1 = machine.device("filter.0.1");
+ state->filter_0_2 = machine.device("filter.0.2");
state->save_item(NAME(state->i8039_status));
state->save_item(NAME(state->last_irq));
@@ -388,7 +388,7 @@ static MACHINE_START( junofrst )
static MACHINE_RESET( junofrst )
{
- junofrst_state *state = machine->driver_data<junofrst_state>();
+ junofrst_state *state = machine.driver_data<junofrst_state>();
state->i8039_status = 0;
state->last_irq = 0;
@@ -503,7 +503,7 @@ static DRIVER_INIT( junofrst )
{
UINT8 *decrypted = konami1_decode(machine, "maincpu");
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
memory_configure_bank_decrypted(machine, "bank1", 0, 16, decrypted + 0x10000, 0x1000);
}
diff --git a/src/mame/drivers/kaneko16.c b/src/mame/drivers/kaneko16.c
index e817350feaa..a19c5b50c47 100644
--- a/src/mame/drivers/kaneko16.c
+++ b/src/mame/drivers/kaneko16.c
@@ -270,17 +270,17 @@ static MACHINE_RESET( shogwarr )
static READ16_HANDLER( kaneko16_rnd_r )
{
- return space->machine->rand() & 0xffff;
+ return space->machine().rand() & 0xffff;
}
static WRITE16_HANDLER( kaneko16_coin_lockout_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, (~data) & 0x0400 );
- coin_lockout_w(space->machine, 1, (~data) & 0x0800 );
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, (~data) & 0x0400 );
+ coin_lockout_w(space->machine(), 1, (~data) & 0x0800 );
}
}
@@ -300,7 +300,7 @@ static WRITE16_HANDLER( kaneko16_soundlatch_w )
if (ACCESSING_BITS_8_15)
{
soundlatch_w(space, 0, (data & 0xff00) >> 8 );
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
}
@@ -335,15 +335,15 @@ static WRITE16_HANDLER( kaneko16_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
- input_port_write(space->machine, "EEPROMOUT", data, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", data, 0xff);
}
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, data & 0x8000);
- coin_lockout_w(space->machine, 1, data & 0x8000);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, data & 0x8000);
+ coin_lockout_w(space->machine(), 1, data & 0x8000);
}
}
@@ -400,7 +400,7 @@ static WRITE16_DEVICE_HANDLER( bakubrkr_oki_bank_sw )
if (ACCESSING_BITS_0_7) {
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0x7) );
- logerror("%s:Selecting OKI bank %02X\n",device->machine->describe_context(),data&0xff);
+ logerror("%s:Selecting OKI bank %02X\n",device->machine().describe_context(),data&0xff);
}
}
@@ -490,10 +490,10 @@ static WRITE16_HANDLER( bloodwar_coin_lockout_w )
{
if (ACCESSING_BITS_8_15)
{
- coin_counter_w(space->machine, 0, data & 0x0100);
- coin_counter_w(space->machine, 1, data & 0x0200);
- coin_lockout_w(space->machine, 0, data & 0x8000);
- coin_lockout_w(space->machine, 1, data & 0x8000);
+ coin_counter_w(space->machine(), 0, data & 0x0100);
+ coin_counter_w(space->machine(), 1, data & 0x0200);
+ coin_lockout_w(space->machine(), 0, data & 0x8000);
+ coin_lockout_w(space->machine(), 1, data & 0x8000);
}
}
@@ -544,7 +544,7 @@ static WRITE16_DEVICE_HANDLER( bonkadv_oki_0_bank_w )
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * (data & 0xF));
- logerror("%s: OKI0 bank %08X\n",device->machine->describe_context(),data);
+ logerror("%s: OKI0 bank %08X\n",device->machine().describe_context(),data);
}
}
@@ -554,7 +554,7 @@ static WRITE16_DEVICE_HANDLER( bonkadv_oki_1_bank_w )
{
okim6295_device *oki = downcast<okim6295_device *>(device);
oki->set_bank_base(0x40000 * data );
- logerror("%s: OKI1 bank %08X\n",device->machine->describe_context(),data);
+ logerror("%s: OKI1 bank %08X\n",device->machine().describe_context(),data);
}
}
@@ -604,12 +604,12 @@ ADDRESS_MAP_END
static READ16_HANDLER( gtmr_wheel_r )
{
// check 'Controls' dip switch
- switch (input_port_read(space->machine, "DSW1") & 0x1000)
+ switch (input_port_read(space->machine(), "DSW1") & 0x1000)
{
case 0x0000: // 'Both Sides' = 270deg Wheel
- return (input_port_read(space->machine, "WHEEL0"));
+ return (input_port_read(space->machine(), "WHEEL0"));
case 0x1000: // '1P Side' = 360' Wheel
- return (input_port_read(space->machine, "WHEEL1"));
+ return (input_port_read(space->machine(), "WHEEL1"));
default:
return (0);
}
@@ -692,14 +692,14 @@ ADDRESS_MAP_END
static READ16_HANDLER( gtmr2_wheel_r )
{
- switch (input_port_read(space->machine, "DSW1") & 0x1800)
+ switch (input_port_read(space->machine(), "DSW1") & 0x1800)
{
case 0x0000: // 270' A. Wheel
- return (input_port_read(space->machine, "WHEEL0"));
+ return (input_port_read(space->machine(), "WHEEL0"));
case 0x1000: // 270' D. Wheel
- return (input_port_read(space->machine, "WHEEL1") << 8);
+ return (input_port_read(space->machine(), "WHEEL1") << 8);
case 0x0800: // 360' Wheel
- return (input_port_read(space->machine, "WHEEL2") << 8);
+ return (input_port_read(space->machine(), "WHEEL2") << 8);
default:
logerror("gtmr2_wheel_r : read at %06x with joystick\n", cpu_get_pc(space->cpu));
return (~0);
@@ -708,7 +708,7 @@ static READ16_HANDLER( gtmr2_wheel_r )
static READ16_HANDLER( gtmr2_IN1_r )
{
- return (input_port_read(space->machine, "P2") & (input_port_read(space->machine, "FAKE") | ~0x7100));
+ return (input_port_read(space->machine(), "P2") & (input_port_read(space->machine(), "FAKE") | ~0x7100));
}
static ADDRESS_MAP_START( gtmr2_map, AS_PROGRAM, 16 )
@@ -796,11 +796,11 @@ ADDRESS_MAP_END
Shogun Warriors
***************************************************************************/
-static void kaneko16_common_oki_bank_w( running_machine* machine, const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize )
+static void kaneko16_common_oki_bank_w( running_machine& machine, const char *bankname, const char* tag, int bank, size_t fixedsize, size_t bankedsize )
{
UINT32 bankaddr;
- UINT8* samples = machine->region(tag)->base();
- size_t length = machine->region(tag)->bytes();
+ UINT8* samples = machine.region(tag)->base();
+ size_t length = machine.region(tag)->bytes();
bankaddr = fixedsize + (bankedsize * bank);
@@ -814,8 +814,8 @@ static WRITE16_HANDLER( shogwarr_oki_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- kaneko16_common_oki_bank_w(space->machine, "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
- kaneko16_common_oki_bank_w(space->machine, "bank11", "oki2", (data & 0xf) , 0x00000, 0x40000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank11", "oki2", (data & 0xf) , 0x00000, 0x40000);
}
}
@@ -823,8 +823,8 @@ static WRITE16_HANDLER( brapboys_oki_bank_w )
{
if (ACCESSING_BITS_0_7)
{
- kaneko16_common_oki_bank_w(space->machine, "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
- kaneko16_common_oki_bank_w(space->machine, "bank11", "oki2", (data & 0xf) , 0x20000, 0x20000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank10", "oki1", (data >> 4) & 0xf, 0x30000, 0x10000);
+ kaneko16_common_oki_bank_w(space->machine(), "bank11", "oki2", (data & 0xf) , 0x20000, 0x20000);
}
}
@@ -1770,7 +1770,7 @@ static WRITE8_DEVICE_HANDLER( kaneko16_eeprom_reset_w )
{
// FIXME: the device line cannot be directly put in the interface due to inverse value!
// we might want to define a "reversed" set_cs_line handler
- device_t *eeprom = device->machine->device("eeprom");
+ device_t *eeprom = device->machine().device("eeprom");
// reset line asserted: reset.
eeprom_set_cs_line(eeprom, (data & 0x01) ? CLEAR_LINE : ASSERT_LINE );
}
@@ -2111,7 +2111,7 @@ static INTERRUPT_GEN( shogwarr_interrupt )
// the code for this interupt is provided by the MCU..
case 0: device_set_input_line(device, 4, HOLD_LINE);
- calc3_mcu_run(device->machine);
+ calc3_mcu_run(device->machine());
break;
/*case 0:
{
@@ -2235,10 +2235,10 @@ MACHINE_CONFIG_END
have the even and odd pixels swapped. So we use this function to untangle
them and have one single gfxlayout for both tiles and sprites.
*/
-static void kaneko16_unscramble_tiles(running_machine *machine, const char *region)
+static void kaneko16_unscramble_tiles(running_machine &machine, const char *region)
{
- UINT8 *RAM = machine->region(region)->base();
- int size = machine->region(region)->bytes();
+ UINT8 *RAM = machine.region(region)->base();
+ int size = machine.region(region)->bytes();
int i;
if (RAM == NULL) return;
@@ -2249,7 +2249,7 @@ static void kaneko16_unscramble_tiles(running_machine *machine, const char *regi
}
}
-static void kaneko16_expand_sample_banks(running_machine *machine, const char *region)
+static void kaneko16_expand_sample_banks(running_machine &machine, const char *region)
{
/* The sample data for the first OKI has an address translator/
banking register in it that munges the addresses as follows:
@@ -2263,11 +2263,11 @@ static void kaneko16_expand_sample_banks(running_machine *machine, const char *r
int bank;
UINT8 *src0;
- if (machine->region(region)->bytes() < 0x40000 * 16)
+ if (machine.region(region)->bytes() < 0x40000 * 16)
fatalerror("gtmr SOUND1 region too small");
/* bank 0 maps to itself, so we just leave it alone */
- src0 = machine->region(region)->base();
+ src0 = machine.region(region)->base();
for (bank = 15; bank > 0; bank--)
{
UINT8 *srcn = src0 + 0x10000 * (bank < 3 ? 3 : bank);
@@ -3843,14 +3843,14 @@ ROM_END
static DRIVER_INIT( bloodwar )
{
- machine->device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
+ machine.device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
DRIVER_INIT_CALL(samplebank);
DRIVER_INIT_CALL(decrypt_toybox_rom);
}
static DRIVER_INIT( gtmr2 )
{
- machine->device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
+ machine.device<nvram_device>("nvram")->set_base(kaneko16_nvram_save, sizeof(kaneko16_nvram_save));
DRIVER_INIT_CALL(samplebank);
DRIVER_INIT_CALL(decrypt_toybox_rom_alt);
}
@@ -3877,7 +3877,7 @@ static DRIVER_INIT( shogwarr )
static DRIVER_INIT( brapboys )
{
// sample banking is different on brap boys for the music, why? GALs / PALs ?
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe00000, 0xe00001, FUNC(brapboys_oki_bank_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe00000, 0xe00001, FUNC(brapboys_oki_bank_w));
// default sample banks
kaneko16_common_oki_bank_w(machine, "bank10", "oki1", 0, 0x30000, 0x10000);
diff --git a/src/mame/drivers/kangaroo.c b/src/mame/drivers/kangaroo.c
index a76b5d931d5..1eaf18d3ef0 100644
--- a/src/mame/drivers/kangaroo.c
+++ b/src/mame/drivers/kangaroo.c
@@ -174,23 +174,23 @@ static WRITE8_HANDLER(mcu_sim_w);
static MACHINE_START( kangaroo )
{
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("gfx1")->base(), 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("gfx1")->base(), 0x2000);
}
static MACHINE_START( kangaroo_mcu )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
MACHINE_START_CALL(kangaroo);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xef00, 0xefff, FUNC(mcu_sim_r), FUNC(mcu_sim_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xef00, 0xefff, FUNC(mcu_sim_r), FUNC(mcu_sim_w));
state->save_item(NAME(state->clock));
}
static MACHINE_RESET( kangaroo )
{
- kangaroo_state *state = machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = machine.driver_data<kangaroo_state>();
/* I think there is a bug in the startup checks of the game. At the very */
/* beginning, during the RAM check, it goes one byte too far, and ends up */
@@ -222,7 +222,7 @@ static MACHINE_RESET( kangaroo )
static READ8_HANDLER( mcu_sim_r )
{
- kangaroo_state *state = space->machine->driver_data<kangaroo_state>();
+ kangaroo_state *state = space->machine().driver_data<kangaroo_state>();
return ++state->clock & 0x0f;
}
@@ -240,8 +240,8 @@ static WRITE8_HANDLER( mcu_sim_w )
static WRITE8_HANDLER( kangaroo_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- coin_counter_w(space->machine, 1, data & 2);
+ coin_counter_w(space->machine(), 0, data & 1);
+ coin_counter_w(space->machine(), 1, data & 2);
}
diff --git a/src/mame/drivers/karnov.c b/src/mame/drivers/karnov.c
index 9e5fa1b0130..fe92935b124 100644
--- a/src/mame/drivers/karnov.c
+++ b/src/mame/drivers/karnov.c
@@ -90,9 +90,9 @@ Stephh's notes (based on the games M68000 code and some tests) :
*************************************/
/* Emulation of the protected microcontroller - for coins & general protection */
-static void karnov_i8751_w( running_machine *machine, int data )
+static void karnov_i8751_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* Pending coin operations may cause protection commands to be queued */
if (state->i8751_needs_ack)
@@ -123,15 +123,15 @@ static void karnov_i8751_w( running_machine *machine, int data )
if (data == 0x401) state->i8751_return = 0x4138; /* ^Whistling wind */
if (data == 0x408) state->i8751_return = 0x4276; /* ^Heavy Gates */
-// if (!state->i8751_return && data != 0x300) logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data);
+// if (!state->i8751_return && data != 0x300) logerror("%s - Unknown Write %02x intel\n", machine.describe_context(), data);
device_set_input_line(state->maincpu, 6, HOLD_LINE); /* Signal main cpu task is complete */
state->i8751_needs_ack = 1;
}
-static void wndrplnt_i8751_w( running_machine *machine, int data )
+static void wndrplnt_i8751_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* The last command hasn't been ACK'd (probably a conflict with coin command) */
if (state->i8751_needs_ack)
@@ -159,7 +159,7 @@ static void wndrplnt_i8751_w( running_machine *machine, int data )
case 0x18: state->i8751_return = 0x5341; break;
}
}
-// else logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data);
+// else logerror("%s - Unknown Write %02x intel\n", machine.describe_context(), data);
/* These are 68k function call addresses - different address for each power-up */
if (data == 0x400) state->i8751_return = 0x594;
@@ -189,9 +189,9 @@ static void wndrplnt_i8751_w( running_machine *machine, int data )
state->i8751_needs_ack = 1;
}
-static void chelnov_i8751_w( running_machine *machine, int data )
+static void chelnov_i8751_w( running_machine &machine, int data )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
/* Pending coin operations may cause protection commands to be queued */
if (state->i8751_needs_ack)
@@ -315,7 +315,7 @@ static void chelnov_i8751_w( running_machine *machine, int data )
}
}
- // logerror("%s - Unknown Write %02x intel\n", machine->describe_context(), data);
+ // logerror("%s - Unknown Write %02x intel\n", machine.describe_context(), data);
device_set_input_line(state->maincpu, 6, HOLD_LINE); /* Signal main cpu task is complete */
state->i8751_needs_ack = 1;
@@ -329,7 +329,7 @@ static void chelnov_i8751_w( running_machine *machine, int data )
static WRITE16_HANDLER( karnov_control_w )
{
- karnov_state *state = space->machine->driver_data<karnov_state>();
+ karnov_state *state = space->machine().driver_data<karnov_state>();
/* Mnemonics filled in from the schematics, brackets are my comments */
switch (offset << 1)
@@ -371,16 +371,16 @@ static WRITE16_HANDLER( karnov_control_w )
case 6: /* SECREQ (Interrupt & Data to i8751) */
if (state->microcontroller_id == KARNOV || state->microcontroller_id == KARNOVJ)
- karnov_i8751_w(space->machine, data);
+ karnov_i8751_w(space->machine(), data);
if (state->microcontroller_id == CHELNOV || state->microcontroller_id == CHELNOVU || state->microcontroller_id == CHELNOVJ)
- chelnov_i8751_w(space->machine, data);
+ chelnov_i8751_w(space->machine(), data);
if (state->microcontroller_id == WNDRPLNT)
- wndrplnt_i8751_w(space->machine, data);
+ wndrplnt_i8751_w(space->machine(), data);
break;
case 8: /* HSHIFT (9 bits) - Top bit indicates video flip */
COMBINE_DATA(&state->scroll[0]);
- karnov_flipscreen_w(space->machine, data >> 15);
+ karnov_flipscreen_w(space->machine(), data >> 15);
break;
case 0xa: /* VSHIFT */
@@ -403,16 +403,16 @@ static WRITE16_HANDLER( karnov_control_w )
static READ16_HANDLER( karnov_control_r )
{
- karnov_state *state = space->machine->driver_data<karnov_state>();
+ karnov_state *state = space->machine().driver_data<karnov_state>();
switch (offset << 1)
{
case 0:
- return input_port_read(space->machine, "P1_P2");
+ return input_port_read(space->machine(), "P1_P2");
case 2: /* Start buttons & VBL */
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 4:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
case 6: /* i8751 return values */
return state->i8751_return;
}
@@ -728,8 +728,8 @@ GFXDECODE_END
static INTERRUPT_GEN( karnov_interrupt )
{
- karnov_state *state = device->machine->driver_data<karnov_state>();
- UINT8 port = input_port_read(device->machine, "FAKE");
+ karnov_state *state = device->machine().driver_data<karnov_state>();
+ UINT8 port = input_port_read(device->machine(), "FAKE");
/* Coin input to the i8751 generates an interrupt to the main cpu */
if (port == state->coin_mask)
@@ -757,7 +757,7 @@ static INTERRUPT_GEN( karnov_interrupt )
static void sound_irq( device_t *device, int linestate )
{
- karnov_state *state = device->machine->driver_data<karnov_state>();
+ karnov_state *state = device->machine().driver_data<karnov_state>();
device_set_input_line(state->audiocpu, 0, linestate); /* IRQ */
}
@@ -774,10 +774,10 @@ static const ym3526_interface ym3526_config =
static MACHINE_START( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
state->save_item(NAME(state->scroll));
@@ -793,7 +793,7 @@ static MACHINE_START( karnov )
static MACHINE_RESET( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
memset(state->ram, 0, 0x4000 / 2); /* Chelnov likes ram clear on reset.. */
@@ -1116,29 +1116,29 @@ ROM_END
static DRIVER_INIT( karnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->microcontroller_id = KARNOV;
state->coin_mask = 0x07;
}
static DRIVER_INIT( karnovj )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->microcontroller_id = KARNOVJ;
state->coin_mask = 0x07;
}
static DRIVER_INIT( wndrplnt )
{
- karnov_state *state = machine->driver_data<karnov_state>();
+ karnov_state *state = machine.driver_data<karnov_state>();
state->microcontroller_id = WNDRPLNT;
state->coin_mask = 0x00;
}
static DRIVER_INIT( chelnov )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
state->microcontroller_id = CHELNOV;
state->coin_mask = 0xe0;
@@ -1148,8 +1148,8 @@ static DRIVER_INIT( chelnov )
static DRIVER_INIT( chelnovu )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
state->microcontroller_id = CHELNOVU;
state->coin_mask = 0xe0;
@@ -1159,8 +1159,8 @@ static DRIVER_INIT( chelnovu )
static DRIVER_INIT( chelnovj )
{
- karnov_state *state = machine->driver_data<karnov_state>();
- UINT16 *RAM = (UINT16 *)machine->region("maincpu")->base();
+ karnov_state *state = machine.driver_data<karnov_state>();
+ UINT16 *RAM = (UINT16 *)machine.region("maincpu")->base();
state->microcontroller_id = CHELNOVJ;
state->coin_mask = 0xe0;
diff --git a/src/mame/drivers/kchamp.c b/src/mame/drivers/kchamp.c
index ef7df83634b..50ec92144a7 100644
--- a/src/mame/drivers/kchamp.c
+++ b/src/mame/drivers/kchamp.c
@@ -76,34 +76,34 @@ IO ports and memory map changes. Dip switches differ too.
static WRITE8_HANDLER( control_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
state->nmi_enable = data & 1;
}
static WRITE8_HANDLER( sound_reset_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
if (!(data & 1))
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, PULSE_LINE);
}
static WRITE8_DEVICE_HANDLER( sound_control_w )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
msm5205_reset_w(device, !(data & 1));
state->sound_nmi_enable = ((data >> 1) & 1);
}
static WRITE8_HANDLER( sound_command_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
soundlatch_w(space, 0, data);
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( sound_msm_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
state->msm_data = data;
state->msm_play_lo_nibble = 1;
}
@@ -148,14 +148,14 @@ ADDRESS_MAP_END
********************/
static READ8_HANDLER( sound_reset_r )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, PULSE_LINE);
return 0;
}
static WRITE8_HANDLER( kc_sound_control_w )
{
- kchamp_state *state = space->machine->driver_data<kchamp_state>();
+ kchamp_state *state = space->machine().driver_data<kchamp_state>();
if (offset == 0)
state->sound_nmi_enable = ((data >> 7) & 1);
@@ -348,14 +348,14 @@ GFXDECODE_END
static INTERRUPT_GEN( kc_interrupt )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
static void msmint( device_t *device )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
if (state->msm_play_lo_nibble)
msm5205_data_w(device, state->msm_data & 0x0f);
@@ -383,7 +383,7 @@ static const msm5205_interface msm_interface =
static INTERRUPT_GEN( sound_int )
{
- kchamp_state *state = device->machine->driver_data<kchamp_state>();
+ kchamp_state *state = device->machine().driver_data<kchamp_state>();
if (state->sound_nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
}
@@ -391,9 +391,9 @@ static INTERRUPT_GEN( sound_int )
static MACHINE_START( kchamp )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->sound_nmi_enable));
@@ -401,7 +401,7 @@ static MACHINE_START( kchamp )
static MACHINE_START( kchampvs )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
MACHINE_START_CALL(kchamp);
@@ -412,7 +412,7 @@ static MACHINE_START( kchampvs )
static MACHINE_RESET( kchamp )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
state->nmi_enable = 0;
state->sound_nmi_enable = 0;
@@ -728,11 +728,11 @@ ROM_START( karatevs )
ROM_END
-static UINT8 *decrypt_code(running_machine *machine)
+static UINT8 *decrypt_code(running_machine &machine)
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int A;
space->set_decrypted_region(0x0000, 0xffff, decrypted);
@@ -746,8 +746,8 @@ static UINT8 *decrypt_code(running_machine *machine)
static DRIVER_INIT( kchampvs )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
UINT8 *decrypted = decrypt_code(machine);
int A;
@@ -778,7 +778,7 @@ static DRIVER_INIT( kchampvs )
static DRIVER_INIT( kchampvs2 )
{
- kchamp_state *state = machine->driver_data<kchamp_state>();
+ kchamp_state *state = machine.driver_data<kchamp_state>();
decrypt_code(machine);
state->counter = 0;
diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c
index 043156d1f30..8eefd792be8 100644
--- a/src/mame/drivers/kickgoal.c
+++ b/src/mame/drivers/kickgoal.c
@@ -205,8 +205,8 @@ WRITE16_DEVICE_HANDLER( kickgoal_snd_w )
static WRITE16_DEVICE_HANDLER( actionhw_snd_w )
{
- kickgoal_state *state = device->machine->driver_data<kickgoal_state>();
- logerror("%s: Writing %04x to Sound CPU - mask %04x\n",device->machine->describe_context(),data,mem_mask);
+ kickgoal_state *state = device->machine().driver_data<kickgoal_state>();
+ logerror("%s: Writing %04x to Sound CPU - mask %04x\n",device->machine().describe_context(),data,mem_mask);
if (!ACCESSING_BITS_0_7)
data >>= 8;
@@ -294,7 +294,7 @@ static WRITE16_DEVICE_HANDLER( actionhw_snd_w )
static INTERRUPT_GEN( kickgoal_interrupt )
{
- kickgoal_state *state = device->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = device->machine().driver_data<kickgoal_state>();
if ((state->adpcm->read_status() & 0x08) == 0)
{
@@ -329,7 +329,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
state->adpcm->write_command(0x81);
}
}
- if (input_code_pressed_once(device->machine, KEYCODE_PGUP))
+ if (input_code_pressed_once(device->machine(), KEYCODE_PGUP))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -348,7 +348,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_PGDN))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_PGDN))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -367,7 +367,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_INSERT))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_INSERT))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -388,7 +388,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_DEL))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_DEL))
{
if (state->m6295_key_delay >= (0x60 * oki_time_base))
{
@@ -409,7 +409,7 @@ static INTERRUPT_GEN( kickgoal_interrupt )
else
state->m6295_key_delay += (0x01 * oki_time_base);
}
- else if (input_code_pressed_once(device->machine, KEYCODE_Z))
+ else if (input_code_pressed_once(device->machine(), KEYCODE_Z))
{
if (state->m6295_key_delay >= (0x80 * oki_time_base))
{
@@ -448,7 +448,7 @@ static const UINT16 kickgoal_default_eeprom_type1[64] = {
static READ16_HANDLER( kickgoal_eeprom_r )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
if (ACCESSING_BITS_0_7)
{
return eeprom_read_bit(state->eeprom);
@@ -459,7 +459,7 @@ static READ16_HANDLER( kickgoal_eeprom_r )
static WRITE16_HANDLER( kickgoal_eeprom_w )
{
- kickgoal_state *state = space->machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = space->machine().driver_data<kickgoal_state>();
if (ACCESSING_BITS_0_7)
{
switch (offset)
@@ -647,7 +647,7 @@ GFXDECODE_END
static MACHINE_START( kickgoal )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
state->save_item(NAME(state->snd_sam));
state->save_item(NAME(state->melody_loop));
@@ -659,7 +659,7 @@ static MACHINE_START( kickgoal )
static MACHINE_RESET( kickgoal )
{
- kickgoal_state *state = machine->driver_data<kickgoal_state>();
+ kickgoal_state *state = machine.driver_data<kickgoal_state>();
state->melody_loop = 0;
state->snd_new = 0;
@@ -814,7 +814,7 @@ ROM_END
static DRIVER_INIT( kickgoal )
{
#if 0 /* we should find a real fix instead */
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
/* fix "bug" that prevents game from writing to EEPROM */
rom[0x12b0/2] = 0x0001;
diff --git a/src/mame/drivers/kingdrby.c b/src/mame/drivers/kingdrby.c
index d0eed5c55e1..d489d76669e 100644
--- a/src/mame/drivers/kingdrby.c
+++ b/src/mame/drivers/kingdrby.c
@@ -115,7 +115,7 @@ xxxx ---- basic color?
static TILE_GET_INFO( get_sc0_tile_info )
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
int tile = state->vram[tile_index] | state->attr[tile_index]<<8;
int color = (state->attr[tile_index] & 0x06)>>1;
@@ -130,7 +130,7 @@ static TILE_GET_INFO( get_sc0_tile_info )
static TILE_GET_INFO( get_sc1_tile_info )
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
int tile = state->vram[tile_index] | state->attr[tile_index]<<8;
int color = (state->attr[tile_index] & 0x06)>>1;
@@ -150,7 +150,7 @@ static TILE_GET_INFO( get_sc1_tile_info )
static VIDEO_START(kingdrby)
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
state->sc0_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,24);
state->sc1_tilemap = tilemap_create(machine, get_sc1_tile_info,tilemap_scan_rows,8,8,32,24);
state->sc0w_tilemap = tilemap_create(machine, get_sc0_tile_info,tilemap_scan_rows,8,8,32,32);
@@ -158,9 +158,9 @@ static VIDEO_START(kingdrby)
tilemap_set_transparent_pen(state->sc1_tilemap,0);
}
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
- kingdrby_state *state = machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = machine.driver_data<kingdrby_state>();
UINT8 *spriteram = state->spriteram;
int count = 0;
@@ -192,20 +192,20 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
{
for(dy=0;dy<h;dy++)
for(dx=0;dx<w;dx++)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16),0);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],spr_offs++,colour,1,0,((x+16*w)-(dx+1)*16),(y+dy*16),0);
}
else
{
for(dy=0;dy<h;dy++)
for(dx=0;dx<w;dx++)
- drawgfx_transpen(bitmap,cliprect,machine->gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16),0);
+ drawgfx_transpen(bitmap,cliprect,machine.gfx[0],spr_offs++,colour,0,0,(x+dx*16),(y+dy*16),0);
}
}
}
static SCREEN_UPDATE(kingdrby)
{
- kingdrby_state *state = screen->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = screen->machine().driver_data<kingdrby_state>();
const rectangle &visarea = screen->visible_area();
rectangle clip;
tilemap_set_scrollx( state->sc0_tilemap,0, state->vram[0x342]);
@@ -222,7 +222,7 @@ static SCREEN_UPDATE(kingdrby)
/*TILEMAP_DRAW_CATEGORY + TILEMAP_DRAW_OPAQUE doesn't suit well?*/
tilemap_draw(bitmap,cliprect,state->sc0_tilemap,0,0);
- draw_sprites(screen->machine,bitmap,cliprect);
+ draw_sprites(screen->machine(),bitmap,cliprect);
tilemap_draw(bitmap,cliprect,state->sc1_tilemap,TILEMAP_DRAW_CATEGORY(1),0);
tilemap_draw(bitmap,&clip,state->sc0w_tilemap,0,0);
@@ -231,7 +231,7 @@ static SCREEN_UPDATE(kingdrby)
static WRITE8_HANDLER( sc0_vram_w )
{
- kingdrby_state *state = space->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = space->machine().driver_data<kingdrby_state>();
state->vram[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
tilemap_mark_tile_dirty(state->sc0w_tilemap,offset);
@@ -240,7 +240,7 @@ static WRITE8_HANDLER( sc0_vram_w )
static WRITE8_HANDLER( sc0_attr_w )
{
- kingdrby_state *state = space->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = space->machine().driver_data<kingdrby_state>();
state->attr[offset] = data;
tilemap_mark_tile_dirty(state->sc0_tilemap,offset);
tilemap_mark_tile_dirty(state->sc0w_tilemap,offset);
@@ -257,13 +257,13 @@ static WRITE8_HANDLER( sc0_attr_w )
static READ8_DEVICE_HANDLER( hopper_io_r )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
- return (input_port_read(device->machine,"HPIO") & 0x3f) | state->p1_hopper | state->p2_hopper;
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
+ return (input_port_read(device->machine(),"HPIO") & 0x3f) | state->p1_hopper | state->p2_hopper;
}
static WRITE8_DEVICE_HANDLER( hopper_io_w )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
state->p1_hopper = (data & 0x8)<<3;
state->p2_hopper = (data & 0x4)<<5;
// printf("%02x\n",data);
@@ -271,8 +271,8 @@ static WRITE8_DEVICE_HANDLER( hopper_io_w )
static WRITE8_DEVICE_HANDLER( sound_cmd_w )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
state->sound_cmd = data;
/* soundlatch is unneeded since we are already using perfect interleave. */
// soundlatch_w(space,0, data);
@@ -282,18 +282,18 @@ static WRITE8_DEVICE_HANDLER( sound_cmd_w )
/* No idea about what's this (if it's really a mux etc.)*/
static WRITE8_DEVICE_HANDLER( outport2_w )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
// popmessage("PPI1 port C(upper) out: %02X", data);
state->mux_data = data & 0x80;
}
static READ8_DEVICE_HANDLER( input_mux_r )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
if(state->mux_data & 0x80)
- return input_port_read(device->machine,"MUX0");
+ return input_port_read(device->machine(),"MUX0");
else
- return input_port_read(device->machine,"MUX1");
+ return input_port_read(device->machine(),"MUX1");
}
static READ8_DEVICE_HANDLER( key_matrix_r )
@@ -301,8 +301,8 @@ static READ8_DEVICE_HANDLER( key_matrix_r )
UINT16 p1_val,p2_val;
UINT8 p1_res,p2_res;
- p1_val = input_port_read(device->machine,"KEY_1P");
- p2_val = input_port_read(device->machine,"KEY_2P");
+ p1_val = input_port_read(device->machine(),"KEY_1P");
+ p2_val = input_port_read(device->machine(),"KEY_2P");
p1_res = 0;
p2_res = 0;
@@ -350,7 +350,7 @@ static READ8_DEVICE_HANDLER( key_matrix_r )
static READ8_DEVICE_HANDLER( sound_cmd_r )
{
- kingdrby_state *state = device->machine->driver_data<kingdrby_state>();
+ kingdrby_state *state = device->machine().driver_data<kingdrby_state>();
return state->sound_cmd;
}
@@ -964,8 +964,8 @@ static PALETTE_INIT(kingdrby)
static PALETTE_INIT(kingdrbb)
{
- UINT8 *raw_prom = machine->region("raw_prom")->base();
- UINT8 *prom = machine->region("proms")->base();
+ UINT8 *raw_prom = machine.region("raw_prom")->base();
+ UINT8 *prom = machine.region("proms")->base();
int bit0, bit1, bit2 , r, g, b;
int i;
diff --git a/src/mame/drivers/kingobox.c b/src/mame/drivers/kingobox.c
index e47b7a1301c..d8fdaa1d0f4 100644
--- a/src/mame/drivers/kingobox.c
+++ b/src/mame/drivers/kingobox.c
@@ -23,26 +23,26 @@ Main CPU:
static WRITE8_HANDLER( video_interrupt_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
device_set_input_line_and_vector(state->video_cpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( sprite_interrupt_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
device_set_input_line_and_vector(state->sprite_cpu, 0, HOLD_LINE, 0xff);
}
static WRITE8_HANDLER( scroll_interrupt_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
sprite_interrupt_w(space, offset, data);
*state->scroll_y = data;
}
static WRITE8_HANDLER( sound_command_w )
{
- kingofb_state *state = space->machine->driver_data<kingofb_state>();
+ kingofb_state *state = space->machine().driver_data<kingofb_state>();
soundlatch_w(space, 0, data);
device_set_input_line_and_vector(state->audio_cpu, 0, HOLD_LINE, 0xff);
}
@@ -448,7 +448,7 @@ static const ay8910_interface ay8910_config =
static INTERRUPT_GEN( kingofb_interrupt )
{
- kingofb_state *state = device->machine->driver_data<kingofb_state>();
+ kingofb_state *state = device->machine().driver_data<kingofb_state>();
if (state->nmi_enable)
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -456,11 +456,11 @@ static INTERRUPT_GEN( kingofb_interrupt )
static MACHINE_START( kingofb )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
- state->video_cpu = machine->device("video");
- state->sprite_cpu = machine->device("sprite");
- state->audio_cpu = machine->device("audiocpu");
+ state->video_cpu = machine.device("video");
+ state->sprite_cpu = machine.device("sprite");
+ state->audio_cpu = machine.device("audiocpu");
state->save_item(NAME(state->nmi_enable));
state->save_item(NAME(state->palette_bank));
@@ -468,7 +468,7 @@ static MACHINE_START( kingofb )
static MACHINE_RESET( kingofb )
{
- kingofb_state *state = machine->driver_data<kingofb_state>();
+ kingofb_state *state = machine.driver_data<kingofb_state>();
state->nmi_enable = 0;
state->palette_bank = 0;
@@ -794,7 +794,7 @@ ROM_END
static DRIVER_INIT( ringking3 )
{
int i;
- UINT8 *RAM = machine->region("proms")->base();
+ UINT8 *RAM = machine.region("proms")->base();
/* expand the first color PROM to look like the kingofb ones... */
for (i = 0; i < 0x100; i++)
@@ -804,8 +804,8 @@ static DRIVER_INIT( ringking3 )
static DRIVER_INIT( ringkingw )
{
int i,j,k;
- UINT8 *PROMS = machine->region("proms")->base();
- UINT8 *USER1 = machine->region("user1")->base();
+ UINT8 *PROMS = machine.region("proms")->base();
+ UINT8 *USER1 = machine.region("user1")->base();
/* change the PROMs encode in a simple format to use kingofb decode */
for(i = 0, j = 0; j < 0x40; i++, j++)
diff --git a/src/mame/drivers/kingpin.c b/src/mame/drivers/kingpin.c
index 3bd93c26117..93b5df3fb79 100644
--- a/src/mame/drivers/kingpin.c
+++ b/src/mame/drivers/kingpin.c
@@ -134,10 +134,10 @@ ADDRESS_MAP_END
static INTERRUPT_GEN( kingpin_video_interrupt )
{
- TMS9928A_interrupt(device->machine);
+ TMS9928A_interrupt(device->machine());
}
-static void vdp_interrupt (running_machine *machine, int state)
+static void vdp_interrupt (running_machine &machine, int state)
{
cputag_set_input_line(machine, "maincpu", 0, HOLD_LINE);
}
@@ -184,12 +184,12 @@ MACHINE_CONFIG_END
static DRIVER_INIT( kingpin )
{
- kingpin_state *state = machine->driver_data<kingpin_state>();
+ kingpin_state *state = machine.driver_data<kingpin_state>();
TMS9928A_configure(&tms9928a_interface);
/* Hacks to keep the emu a'runnin */
- state->code_base = machine->region("maincpu")->base();
+ state->code_base = machine.region("maincpu")->base();
state->code_base[0x17d4] = 0xc3; /* Maybe sound related? */
}
diff --git a/src/mame/drivers/kinst.c b/src/mame/drivers/kinst.c
index a08dc25f914..8f0d1837172 100644
--- a/src/mame/drivers/kinst.c
+++ b/src/mame/drivers/kinst.c
@@ -165,11 +165,11 @@ public:
static MACHINE_START( kinst )
{
- kinst_state *state = machine->driver_data<kinst_state>();
- device_t *ide = machine->device("ide");
+ kinst_state *state = machine.driver_data<kinst_state>();
+ device_t *ide = machine.device("ide");
UINT8 *features = ide_get_features(ide);
- if (strncmp(machine->system().name, "kinst2", 6) != 0)
+ if (strncmp(machine.system().name, "kinst2", 6) != 0)
{
/* kinst: tweak the model number so we pass the check */
features[27*2+0] = 0x54;
@@ -199,12 +199,12 @@ static MACHINE_START( kinst )
}
/* set the fastest DRC options */
- mips3drc_set_options(machine->device("maincpu"), MIPS3DRC_FASTEST_OPTIONS);
+ mips3drc_set_options(machine.device("maincpu"), MIPS3DRC_FASTEST_OPTIONS);
/* configure fast RAM regions for DRC */
- mips3drc_add_fastram(machine->device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->rambase2);
- mips3drc_add_fastram(machine->device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->rambase);
- mips3drc_add_fastram(machine->device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x08000000, 0x087fffff, FALSE, state->rambase2);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x00000000, 0x0007ffff, FALSE, state->rambase);
+ mips3drc_add_fastram(machine.device("maincpu"), 0x1fc00000, 0x1fc7ffff, TRUE, state->rombase);
}
@@ -217,7 +217,7 @@ static MACHINE_START( kinst )
static MACHINE_RESET( kinst )
{
- kinst_state *state = machine->driver_data<kinst_state>();
+ kinst_state *state = machine.driver_data<kinst_state>();
/* set a safe base location for video */
state->video_base = &state->rambase[0x30000/4];
}
@@ -232,7 +232,7 @@ static MACHINE_RESET( kinst )
static SCREEN_UPDATE( kinst )
{
- kinst_state *state = screen->machine->driver_data<kinst_state>();
+ kinst_state *state = screen->machine().driver_data<kinst_state>();
int y;
/* loop over rows and copy to the destination */
@@ -272,13 +272,13 @@ static TIMER_CALLBACK( irq0_stop )
static INTERRUPT_GEN( irq0_start )
{
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(irq0_stop));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(irq0_stop));
}
static void ide_interrupt(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "maincpu", 1, state);
+ cputag_set_input_line(device->machine(), "maincpu", 1, state);
}
@@ -322,7 +322,7 @@ static WRITE32_DEVICE_HANDLER( kinst_ide_extra_w )
static READ32_HANDLER( kinst_control_r )
{
- kinst_state *state = space->machine->driver_data<kinst_state>();
+ kinst_state *state = space->machine().driver_data<kinst_state>();
UINT32 result;
static const char *const portnames[] = { "P1", "P2", "VOLUME", "UNUSED", "DSW" };
@@ -333,7 +333,7 @@ static READ32_HANDLER( kinst_control_r )
switch (offset)
{
case 2: /* $90 -- sound return */
- result = input_port_read(space->machine, portnames[offset]);
+ result = input_port_read(space->machine(), portnames[offset]);
result &= ~0x0002;
if (dcs_control_r() & 0x800)
result |= 0x0002;
@@ -342,11 +342,11 @@ static READ32_HANDLER( kinst_control_r )
case 0: /* $80 */
case 1: /* $88 */
case 3: /* $98 */
- result = input_port_read(space->machine, portnames[offset]);
+ result = input_port_read(space->machine(), portnames[offset]);
break;
case 4: /* $a0 */
- result = input_port_read(space->machine, portnames[offset]);
+ result = input_port_read(space->machine(), portnames[offset]);
if (cpu_get_pc(space->cpu) == 0x802d428)
device_spin_until_interrupt(space->cpu);
break;
@@ -358,7 +358,7 @@ static READ32_HANDLER( kinst_control_r )
static WRITE32_HANDLER( kinst_control_w )
{
- kinst_state *state = space->machine->driver_data<kinst_state>();
+ kinst_state *state = space->machine().driver_data<kinst_state>();
UINT32 olddata;
/* apply shuffling */
@@ -887,7 +887,7 @@ ROM_END
static DRIVER_INIT( kinst )
{
- kinst_state *state = machine->driver_data<kinst_state>();
+ kinst_state *state = machine.driver_data<kinst_state>();
static const UINT8 kinst_control_map[8] = { 0,1,2,3,4,5,6,7 };
dcs_init(machine);
@@ -899,7 +899,7 @@ static DRIVER_INIT( kinst )
static DRIVER_INIT( kinst2 )
{
- kinst_state *state = machine->driver_data<kinst_state>();
+ kinst_state *state = machine.driver_data<kinst_state>();
static const UINT8 kinst2_control_map[8] = { 2,4,1,0,3,5,6,7 };
// read: $80 on ki2 = $90 on ki
diff --git a/src/mame/drivers/klax.c b/src/mame/drivers/klax.c
index bc1215b7239..69acdeccbd5 100644
--- a/src/mame/drivers/klax.c
+++ b/src/mame/drivers/klax.c
@@ -30,9 +30,9 @@
*
*************************************/
-static void update_interrupts(running_machine *machine)
+static void update_interrupts(running_machine &machine)
{
- klax_state *state = machine->driver_data<klax_state>();
+ klax_state *state = machine.driver_data<klax_state>();
cputag_set_input_line(machine, "maincpu", 4, state->video_int_state || state->scanline_int_state ? ASSERT_LINE : CLEAR_LINE);
}
@@ -40,8 +40,8 @@ static void update_interrupts(running_machine *machine)
static void scanline_update(screen_device &screen, int scanline)
{
/* generate 32V signals */
- if ((scanline & 32) == 0 && !(input_port_read(screen.machine, "P1") & 0x800))
- atarigen_scanline_int_gen(screen.machine->device("maincpu"));
+ if ((scanline & 32) == 0 && !(input_port_read(screen.machine(), "P1") & 0x800))
+ atarigen_scanline_int_gen(screen.machine().device("maincpu"));
}
@@ -67,11 +67,11 @@ static MACHINE_START( klax )
static MACHINE_RESET( klax )
{
- klax_state *state = machine->driver_data<klax_state>();
+ klax_state *state = machine.driver_data<klax_state>();
atarigen_eeprom_reset(state);
atarigen_interrupt_reset(state, update_interrupts);
- atarigen_scanline_timer_reset(*machine->primary_screen, scanline_update, 32);
+ atarigen_scanline_timer_reset(*machine.primary_screen, scanline_update, 32);
}
diff --git a/src/mame/drivers/kncljoe.c b/src/mame/drivers/kncljoe.c
index d1053d59936..17450dede75 100644
--- a/src/mame/drivers/kncljoe.c
+++ b/src/mame/drivers/kncljoe.c
@@ -35,7 +35,7 @@ Updates:
static WRITE8_HANDLER( sound_cmd_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
if ((data & 0x80) == 0)
soundlatch_w(space, 0, data & 0x7f);
@@ -65,13 +65,13 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( m6803_port1_w )
{
- kncljoe_state *state = device->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = device->machine().driver_data<kncljoe_state>();
state->port1 = data;
}
static WRITE8_DEVICE_HANDLER( m6803_port2_w )
{
- kncljoe_state *state = device->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = device->machine().driver_data<kncljoe_state>();
/* write latch */
if ((state->port2 & 0x01) && !(data & 0x01))
@@ -85,7 +85,7 @@ static WRITE8_DEVICE_HANDLER( m6803_port2_w )
static READ8_DEVICE_HANDLER( m6803_port1_r )
{
- kncljoe_state *state = device->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = device->machine().driver_data<kncljoe_state>();
if (state->port2 & 0x08)
return ay8910_r(device, 0);
@@ -99,7 +99,7 @@ static READ8_DEVICE_HANDLER( m6803_port2_r )
static WRITE8_HANDLER( sound_irq_ack_w )
{
- kncljoe_state *state = space->machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = space->machine().driver_data<kncljoe_state>();
device_set_input_line(state->soundcpu, 0, CLEAR_LINE);
}
@@ -250,9 +250,9 @@ static INTERRUPT_GEN (sound_nmi)
static MACHINE_START( kncljoe )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
- state->soundcpu = machine->device("soundcpu");
+ state->soundcpu = machine.device("soundcpu");
state->save_item(NAME(state->port1));
state->save_item(NAME(state->port2));
@@ -263,7 +263,7 @@ static MACHINE_START( kncljoe )
static MACHINE_RESET( kncljoe )
{
- kncljoe_state *state = machine->driver_data<kncljoe_state>();
+ kncljoe_state *state = machine.driver_data<kncljoe_state>();
state->port1 = 0;
state->port2 = 0;
diff --git a/src/mame/drivers/koftball.c b/src/mame/drivers/koftball.c
index 8e5309a9f64..60fa5a9aefc 100644
--- a/src/mame/drivers/koftball.c
+++ b/src/mame/drivers/koftball.c
@@ -53,7 +53,7 @@ public:
static TILE_GET_INFO( get_t1_tile_info )
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
int data = state->bmc_1_videoram[tile_index];
SET_TILE_INFO(
0,
@@ -64,7 +64,7 @@ static TILE_GET_INFO( get_t1_tile_info )
static TILE_GET_INFO( get_t2_tile_info )
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
int data = state->bmc_2_videoram[tile_index];
SET_TILE_INFO(
0,
@@ -75,7 +75,7 @@ static TILE_GET_INFO( get_t2_tile_info )
static VIDEO_START( koftball )
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
state->tilemap_1 = tilemap_create(machine, get_t1_tile_info,tilemap_scan_rows,8,8,64,32);
state->tilemap_2 = tilemap_create(machine, get_t2_tile_info,tilemap_scan_rows,8,8,64,32);
@@ -84,7 +84,7 @@ static VIDEO_START( koftball )
static SCREEN_UPDATE( koftball )
{
- koftball_state *state = screen->machine->driver_data<koftball_state>();
+ koftball_state *state = screen->machine().driver_data<koftball_state>();
tilemap_draw( bitmap, cliprect, state->tilemap_2, 0, 0);
tilemap_draw( bitmap, cliprect, state->tilemap_1, 0, 0);
return 0;
@@ -92,33 +92,33 @@ static SCREEN_UPDATE( koftball )
static WRITE16_HANDLER( bmc_RAMDAC_offset_w )
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
state->clr_offset=data*3;
}
static WRITE16_HANDLER( bmc_RAMDAC_color_w )
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
state->bmc_colorram[state->clr_offset]=data;
- palette_set_color_rgb(space->machine,state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
+ palette_set_color_rgb(space->machine(),state->clr_offset/3,pal6bit(state->bmc_colorram[(state->clr_offset/3)*3]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+1]),pal6bit(state->bmc_colorram[(state->clr_offset/3)*3+2]));
state->clr_offset=(state->clr_offset+1)%768;
}
static READ16_HANDLER( bmc_RAMDAC_color_r )
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
return state->bmc_colorram[state->clr_offset];
}
static READ16_HANDLER(random_number_r)
{
- return space->machine->rand();
+ return space->machine().rand();
}
static READ16_HANDLER(prot_r)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
switch(state->prot_data)
{
case 0x0000: return 0x0d00;
@@ -128,25 +128,25 @@ static READ16_HANDLER(prot_r)
}
logerror("unk prot r %x %x\n",state->prot_data, cpu_get_previouspc(space->cpu));
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE16_HANDLER(prot_w)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
COMBINE_DATA(&state->prot_data);
}
static WRITE16_HANDLER(bmc_1_videoram_w)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
COMBINE_DATA(&state->bmc_1_videoram[offset]);
tilemap_mark_tile_dirty(state->tilemap_1, offset);
}
static WRITE16_HANDLER(bmc_2_videoram_w)
{
- koftball_state *state = space->machine->driver_data<koftball_state>();
+ koftball_state *state = space->machine().driver_data<koftball_state>();
COMBINE_DATA(&state->bmc_2_videoram[offset]);
tilemap_mark_tile_dirty(state->tilemap_2, offset);
}
@@ -293,7 +293,7 @@ static const UINT16 nvram[]=
#endif
static DRIVER_INIT(koftball)
{
- koftball_state *state = machine->driver_data<koftball_state>();
+ koftball_state *state = machine.driver_data<koftball_state>();
state->bmc_colorram = auto_alloc_array(machine, UINT8, 768);
#if NVRAM_HACK
diff --git a/src/mame/drivers/koikoi.c b/src/mame/drivers/koikoi.c
index 5d477854f9b..cf7c5fe9bae 100644
--- a/src/mame/drivers/koikoi.c
+++ b/src/mame/drivers/koikoi.c
@@ -73,7 +73,7 @@ public:
static TILE_GET_INFO( get_tile_info )
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
int code = state->videoram[tile_index] | ((state->videoram[tile_index + 0x400] & 0x40) << 2);
int color = (state->videoram[tile_index + 0x400] & 0x1f);
int flip = (state->videoram[tile_index + 0x400] & 0x80) ? (TILEMAP_FLIPX | TILEMAP_FLIPY) : 0;
@@ -86,7 +86,7 @@ static PALETTE_INIT( koikoi )
int i;
/* allocate the colortable */
- machine->colortable = colortable_alloc(machine, 0x10);
+ machine.colortable = colortable_alloc(machine, 0x10);
/* create a lookup table for the palette */
for (i = 0; i < 0x10; i++)
@@ -112,7 +112,7 @@ static PALETTE_INIT( koikoi )
bit2 = (color_prom[i] >> 7) & 0x01;
b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2;
- colortable_palette_set_color(machine->colortable, i, MAKE_RGB(r, g, b));
+ colortable_palette_set_color(machine.colortable, i, MAKE_RGB(r, g, b));
}
/* color_prom now points to the beginning of the lookup table */
@@ -122,19 +122,19 @@ static PALETTE_INIT( koikoi )
for (i = 0; i < 0x100; i++)
{
UINT8 ctabentry = color_prom[i] & 0x0f;
- colortable_entry_set_value(machine->colortable, i, ctabentry);
+ colortable_entry_set_value(machine.colortable, i, ctabentry);
}
}
static VIDEO_START(koikoi)
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
state->tmap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE(koikoi)
{
- koikoi_state *state = screen->machine->driver_data<koikoi_state>();
+ koikoi_state *state = screen->machine().driver_data<koikoi_state>();
tilemap_draw(bitmap, cliprect, state->tmap, 0, 0);
return 0;
}
@@ -147,21 +147,21 @@ static SCREEN_UPDATE(koikoi)
static WRITE8_HANDLER( vram_w )
{
- koikoi_state *state = space->machine->driver_data<koikoi_state>();
+ koikoi_state *state = space->machine().driver_data<koikoi_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->tmap, offset & 0x3ff);
}
static READ8_DEVICE_HANDLER( input_r )
{
- koikoi_state *state = device->machine->driver_data<koikoi_state>();
+ koikoi_state *state = device->machine().driver_data<koikoi_state>();
if (state->inputcnt < 0)
return 0;
if (!state->inputcnt)
{
- int key = input_port_read(device->machine, "IN1");
+ int key = input_port_read(device->machine(), "IN1");
int keyval = 0; //we must return 0 (0x2 in 2nd read) to clear 4 bit at $6600 and allow next read
if (key)
@@ -197,16 +197,16 @@ static WRITE8_DEVICE_HANDLER( unknown_w )
static READ8_HANDLER( io_r )
{
- koikoi_state *state = space->machine->driver_data<koikoi_state>();
+ koikoi_state *state = space->machine().driver_data<koikoi_state>();
if (!offset)
- return input_port_read(space->machine, "IN0") ^ state->ioram[4]; //coin
+ return input_port_read(space->machine(), "IN0") ^ state->ioram[4]; //coin
return 0;
}
static WRITE8_HANDLER( io_w )
{
- koikoi_state *state = space->machine->driver_data<koikoi_state>();
+ koikoi_state *state = space->machine().driver_data<koikoi_state>();
if (offset == 7 && data == 0)
state->inputcnt = 0; //reset read cycle counter
@@ -334,7 +334,7 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( koikoi )
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
state->save_item(NAME(state->inputcnt));
state->save_item(NAME(state->inputval));
@@ -344,7 +344,7 @@ static MACHINE_START( koikoi )
static MACHINE_RESET( koikoi )
{
- koikoi_state *state = machine->driver_data<koikoi_state>();
+ koikoi_state *state = machine.driver_data<koikoi_state>();
int i;
state->inputcnt = -1;
diff --git a/src/mame/drivers/konamigq.c b/src/mame/drivers/konamigq.c
index d976976475f..18c6db2cbd9 100644
--- a/src/mame/drivers/konamigq.c
+++ b/src/mame/drivers/konamigq.c
@@ -71,14 +71,14 @@ public:
static WRITE32_HANDLER( soundr3k_w )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
if( ACCESSING_BITS_16_31 )
{
state->sndto000[ ( offset << 1 ) + 1 ] = data >> 16;
if( offset == 3 )
{
- cputag_set_input_line(space->machine, "soundcpu", 1, HOLD_LINE );
+ cputag_set_input_line(space->machine(), "soundcpu", 1, HOLD_LINE );
}
}
if( ACCESSING_BITS_0_15 )
@@ -89,7 +89,7 @@ static WRITE32_HANDLER( soundr3k_w )
static READ32_HANDLER( soundr3k_r )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
UINT32 data;
data = ( state->sndtor3k[ ( offset << 1 ) + 1 ] << 16 ) | state->sndtor3k[ offset << 1 ];
@@ -130,8 +130,8 @@ static const UINT16 konamigq_def_eeprom[64] =
static WRITE32_HANDLER( eeprom_w )
{
- input_port_write(space->machine, "EEPROMOUT", data & 0x07, 0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
+ input_port_write(space->machine(), "EEPROMOUT", data & 0x07, 0xff);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, ( data & 0x40 ) ? CLEAR_LINE : ASSERT_LINE );
}
@@ -139,7 +139,7 @@ static WRITE32_HANDLER( eeprom_w )
static WRITE32_HANDLER( pcmram_w )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
if( ACCESSING_BITS_0_7 )
{
@@ -153,7 +153,7 @@ static WRITE32_HANDLER( pcmram_w )
static READ32_HANDLER( pcmram_r )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
return ( state->p_n_pcmram[ ( offset << 1 ) + 1 ] << 16 ) | state->p_n_pcmram[ offset << 1 ];
}
@@ -213,11 +213,11 @@ static READ16_HANDLER( dual539_r )
data = 0;
if( ACCESSING_BITS_0_7 )
{
- data |= k054539_r( space->machine->device("konami2"), offset );
+ data |= k054539_r( space->machine().device("konami2"), offset );
}
if( ACCESSING_BITS_8_15 )
{
- data |= k054539_r( space->machine->device("konami1"), offset ) << 8;
+ data |= k054539_r( space->machine().device("konami1"), offset ) << 8;
}
return data;
}
@@ -226,24 +226,24 @@ static WRITE16_HANDLER( dual539_w )
{
if( ACCESSING_BITS_0_7 )
{
- k054539_w( space->machine->device("konami2"), offset, data );
+ k054539_w( space->machine().device("konami2"), offset, data );
}
if( ACCESSING_BITS_8_15 )
{
- k054539_w( space->machine->device("konami1"), offset, data >> 8 );
+ k054539_w( space->machine().device("konami1"), offset, data >> 8 );
}
}
static READ16_HANDLER( sndcomm68k_r )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
return state->sndto000[ offset ];
}
static WRITE16_HANDLER( sndcomm68k_w )
{
- konamigq_state *state = space->machine->driver_data<konamigq_state>();
+ konamigq_state *state = space->machine().driver_data<konamigq_state>();
state->sndtor3k[ offset ] = data;
}
@@ -286,9 +286,9 @@ static const k054539_interface k054539_config =
/* SCSI */
-static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- konamigq_state *state = machine->driver_data<konamigq_state>();
+ konamigq_state *state = machine.driver_data<konamigq_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *sector_buffer = state->sector_buffer;
int i;
@@ -322,11 +322,11 @@ static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_s
}
}
-static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
}
-static void scsi_irq(running_machine *machine)
+static void scsi_irq(running_machine &machine)
{
psx_irq_set(machine, 0x400);
}
@@ -347,11 +347,11 @@ static const struct AM53CF96interface scsi_intf =
static DRIVER_INIT( konamigq )
{
- konamigq_state *state = machine->driver_data<konamigq_state>();
+ konamigq_state *state = machine.driver_data<konamigq_state>();
psx_driver_init(machine);
- state->p_n_pcmram = machine->region( "shared" )->base() + 0x80000;
+ state->p_n_pcmram = machine.region( "shared" )->base() + 0x80000;
}
static void konamigq_exit(running_machine &machine)
@@ -361,11 +361,11 @@ static void konamigq_exit(running_machine &machine)
static MACHINE_START( konamigq )
{
- konamigq_state *state = machine->driver_data<konamigq_state>();
+ konamigq_state *state = machine.driver_data<konamigq_state>();
/* init the scsi controller and hook up it's DMA */
am53cf96_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, konamigq_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, konamigq_exit);
psx_dma_install_read_handler(machine, 5, scsi_dma_read);
psx_dma_install_write_handler(machine, 5, scsi_dma_write);
diff --git a/src/mame/drivers/konamigv.c b/src/mame/drivers/konamigv.c
index f679a6dec33..5a8f968a221 100644
--- a/src/mame/drivers/konamigv.c
+++ b/src/mame/drivers/konamigv.c
@@ -194,9 +194,9 @@ ADDRESS_MAP_END
/* SCSI */
-static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *sector_buffer = state->sector_buffer;
int i;
@@ -240,9 +240,9 @@ static void scsi_dma_read( running_machine *machine, UINT32 n_address, INT32 n_s
}
}
-static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void scsi_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *sector_buffer = state->sector_buffer;
int i;
@@ -276,7 +276,7 @@ static void scsi_dma_write( running_machine *machine, UINT32 n_address, INT32 n_
}
}
-static void scsi_irq(running_machine *machine)
+static void scsi_irq(running_machine &machine)
{
psx_irq_set(machine, 0x400);
}
@@ -306,14 +306,14 @@ static DRIVER_INIT( konamigv )
/* init the scsi controller and hook up it's DMA */
am53cf96_init(machine, &scsi_intf);
- machine->add_notifier(MACHINE_NOTIFY_EXIT, konamigv_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, konamigv_exit);
psx_dma_install_read_handler(machine, 5, scsi_dma_read);
psx_dma_install_write_handler(machine, 5, scsi_dma_write);
}
static MACHINE_START( konamigv )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
state->save_item(NAME(state->sector_buffer));
state->save_item(NAME(state->flash_address));
@@ -328,14 +328,14 @@ static MACHINE_RESET( konamigv )
psx_machine_init(machine);
/* also hook up CDDA audio to the CD-ROM drive */
- cdda_set_cdrom(machine->device("cdda"), am53cf96_get_device(SCSI_ID_4));
+ cdda_set_cdrom(machine.device("cdda"), am53cf96_get_device(SCSI_ID_4));
}
static void spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
@@ -440,7 +440,7 @@ INPUT_PORTS_END
static READ32_HANDLER( flash_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
int reg = offset*2;
//int shift = 0;
@@ -471,7 +471,7 @@ static READ32_HANDLER( flash_r )
static WRITE32_HANDLER( flash_w )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
int reg = offset*2;
int chip;
@@ -506,7 +506,7 @@ static WRITE32_HANDLER( flash_w )
static READ32_HANDLER( trackball_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
if( offset == 0 && mem_mask == 0x0000ffff )
{
@@ -517,7 +517,7 @@ static READ32_HANDLER( trackball_r )
for( axis = 0; axis < 2; axis++ )
{
- value = input_port_read(space->machine, axisnames[axis]);
+ value = input_port_read(space->machine(), axisnames[axis]);
diff = value - state->trackball_prev[ axis ];
state->trackball_prev[ axis ] = value;
state->trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
@@ -533,16 +533,16 @@ static READ32_HANDLER( unknown_r )
static DRIVER_INIT( simpbowl )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
- state->flash8[0] = machine->device<fujitsu_29f016a_device>("flash0");
- state->flash8[1] = machine->device<fujitsu_29f016a_device>("flash1");
- state->flash8[2] = machine->device<fujitsu_29f016a_device>("flash2");
- state->flash8[3] = machine->device<fujitsu_29f016a_device>("flash3");
+ state->flash8[0] = machine.device<fujitsu_29f016a_device>("flash0");
+ state->flash8[1] = machine.device<fujitsu_29f016a_device>("flash1");
+ state->flash8[2] = machine.device<fujitsu_29f016a_device>("flash2");
+ state->flash8[3] = machine.device<fujitsu_29f016a_device>("flash3");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(flash_r), FUNC(flash_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c0, 0x1f6800c7, FUNC(trackball_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c8, 0x1f6800cb, FUNC(unknown_r) ); /* ?? */
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(flash_r), FUNC(flash_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c0, 0x1f6800c7, FUNC(trackball_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f6800c8, 0x1f6800cb, FUNC(unknown_r) ); /* ?? */
DRIVER_INIT_CALL(konamigv);
}
@@ -569,7 +569,7 @@ INPUT_PORTS_END
static READ32_HANDLER( btcflash_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
if (mem_mask == 0x0000ffff)
{
@@ -585,7 +585,7 @@ static READ32_HANDLER( btcflash_r )
static WRITE32_HANDLER( btcflash_w )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
if (mem_mask == 0x0000ffff)
{
@@ -599,7 +599,7 @@ static WRITE32_HANDLER( btcflash_w )
static READ32_HANDLER( btc_trackball_r )
{
- konamigv_state *state = space->machine->driver_data<konamigv_state>();
+ konamigv_state *state = space->machine().driver_data<konamigv_state>();
// mame_printf_debug( "r %08x %08x %08x\n", cpu_get_pc(space->cpu), offset, mem_mask );
@@ -612,7 +612,7 @@ static READ32_HANDLER( btc_trackball_r )
for( axis = 0; axis < 4; axis++ )
{
- value = input_port_read(space->machine, axisnames[axis]);
+ value = input_port_read(space->machine(), axisnames[axis]);
diff = value - state->btc_trackball_prev[ axis ];
state->btc_trackball_prev[ axis ] = value;
state->btc_trackball_data[ axis ] = ( ( diff & 0xf00 ) << 16 ) | ( ( diff & 0xff ) << 8 );
@@ -629,13 +629,13 @@ static WRITE32_HANDLER( btc_trackball_w )
static DRIVER_INIT( btchamp )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
- state->flash16[0] = machine->device<sharp_lh28f400_device>("flash");
+ state->flash16[0] = machine.device<sharp_lh28f400_device>("flash");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(btc_trackball_r), FUNC(btc_trackball_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f6800e0, 0x1f6800e3);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f680080, 0x1f68008f, FUNC(btc_trackball_r), FUNC(btc_trackball_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write ( 0x1f6800e0, 0x1f6800e3);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
DRIVER_INIT_CALL(konamigv);
}
@@ -688,8 +688,8 @@ static WRITE32_HANDLER( tokimeki_serial_w )
static DRIVER_INIT( tokimosh )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f680080, 0x1f680083, FUNC(tokimeki_serial_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f680090, 0x1f680093, FUNC(tokimeki_serial_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler ( 0x1f680080, 0x1f680083, FUNC(tokimeki_serial_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f680090, 0x1f680093, FUNC(tokimeki_serial_w) );
DRIVER_INIT_CALL(konamigv);
}
@@ -717,17 +717,17 @@ static WRITE32_HANDLER( kdeadeye_0_w )
static DRIVER_INIT( kdeadeye )
{
- konamigv_state *state = machine->driver_data<konamigv_state>();
+ konamigv_state *state = machine.driver_data<konamigv_state>();
- state->flash16[0] = machine->device<sharp_lh28f400_device>("flash");
+ state->flash16[0] = machine.device<sharp_lh28f400_device>("flash");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680080, 0x1f680083, "GUNX1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680090, 0x1f680093, "GUNY1" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1f6800e0, 0x1f6800e3, FUNC(kdeadeye_0_w) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680080, 0x1f680083, "GUNX1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f680090, 0x1f680093, "GUNY1" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800a0, 0x1f6800a3, "GUNX2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800b0, 0x1f6800b3, "GUNY2" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port ( 0x1f6800c0, 0x1f6800c3, "BUTTONS" );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler ( 0x1f6800e0, 0x1f6800e3, FUNC(kdeadeye_0_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f380000, 0x1f3fffff, FUNC(btcflash_r), FUNC(btcflash_w) );
DRIVER_INIT_CALL(konamigv);
}
diff --git a/src/mame/drivers/konamigx.c b/src/mame/drivers/konamigx.c
index 98f3ccd6abe..69b5e6687f6 100644
--- a/src/mame/drivers/konamigx.c
+++ b/src/mame/drivers/konamigx.c
@@ -422,7 +422,7 @@ static WRITE32_HANDLER( esc_w )
if (konamigx_wrport1_1 & 0x10)
{
gx_rdport1_3 &= ~8;
- cputag_set_input_line(space->machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, HOLD_LINE);
}
}
else
@@ -465,7 +465,7 @@ static WRITE32_HANDLER( eeprom_w )
bit 0: eeprom data
*/
- input_port_write(space->machine, "EEPROMOUT", odata, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", odata, 0xff);
konamigx_wrport1_0 = odata;
}
@@ -512,13 +512,13 @@ static WRITE32_HANDLER( control_w )
{
// enable 68k
// clear the halt condition and reset the 68000
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_HALT, CLEAR_LINE);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_HALT, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, PULSE_LINE);
}
else
{
// disable 68k
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
}
K053246_set_OBJCHA_line((data&0x100000) ? ASSERT_LINE : CLEAR_LINE);
@@ -581,14 +581,14 @@ static WRITE32_HANDLER( ccu_w )
// vblank interrupt ACK
if (ACCESSING_BITS_24_31)
{
- cputag_set_input_line(space->machine, "maincpu", 1, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 1, CLEAR_LINE);
gx_syncen |= 0x20;
}
// hblank interrupt ACK
if (ACCESSING_BITS_8_15)
{
- cputag_set_input_line(space->machine, "maincpu", 2, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 2, CLEAR_LINE);
gx_syncen |= 0x40;
}
}
@@ -606,7 +606,7 @@ static WRITE32_HANDLER( ccu_w )
static TIMER_CALLBACK( dmaend_callback )
{
// foul-proof (CPU0 could be deactivated while we wait)
- if (resume_trigger && suspension_active) { suspension_active = 0; machine->scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; machine.scheduler().trigger(resume_trigger); }
// DMA busy flag must be cleared before triggering IRQ 3
gx_rdport1_3 &= ~2;
@@ -642,7 +642,7 @@ static void dmastart_callback(int data)
static INTERRUPT_GEN(konamigx_vbinterrupt)
{
// lift idle suspension
- if (resume_trigger && suspension_active) { suspension_active = 0; device->machine->scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; device->machine().scheduler().trigger(resume_trigger); }
// IRQ 1 is the main 60hz vblank interrupt
if (gx_syncen & 0x20)
@@ -662,7 +662,7 @@ static INTERRUPT_GEN(konamigx_vbinterrupt)
static INTERRUPT_GEN(konamigx_vbinterrupt_type4)
{
// lift idle suspension
- if (resume_trigger && suspension_active) { suspension_active = 0; device->machine->scheduler().trigger(resume_trigger); }
+ if (resume_trigger && suspension_active) { suspension_active = 0; device->machine().scheduler().trigger(resume_trigger); }
// IRQ 1 is the main 60hz vblank interrupt
// the gx_syncen & 0x20 test doesn't work on type 3 or 4 ROM boards, likely because the ROM board
@@ -670,7 +670,7 @@ static INTERRUPT_GEN(konamigx_vbinterrupt_type4)
// maybe this interupt should only be every 30fps, or maybe there are flags to prevent the game running too fast
// the real hardware should output the display for each screen on alternate frames
-// if(device->machine->primary_screen->frame_number() & 1)
+// if(device->machine().primary_screen->frame_number() & 1)
if (1) // gx_syncen & 0x20)
{
gx_syncen &= ~0x20;
@@ -839,7 +839,7 @@ static READ32_HANDLER( sound020_r )
return(rv);
}
-INLINE void write_snd_020(running_machine *machine, int reg, int val)
+INLINE void write_snd_020(running_machine &machine, int reg, int val)
{
sndto000[reg] = val;
@@ -857,14 +857,14 @@ static WRITE32_HANDLER( sound020_w )
{
reg = offset<<1;
val = data>>24;
- write_snd_020(space->machine, reg, val);
+ write_snd_020(space->machine(), reg, val);
}
if (ACCESSING_BITS_8_15)
{
reg = (offset<<1)+1;
val = (data>>8)&0xff;
- write_snd_020(space->machine, reg, val);
+ write_snd_020(space->machine(), reg, val);
}
}
@@ -879,9 +879,9 @@ static double adc0834_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)(5 * input_port_read(device->machine, "AN0")) / 255.0; // steer
+ return (double)(5 * input_port_read(device->machine(), "AN0")) / 255.0; // steer
case ADC083X_CH1:
- return (double)(5 * input_port_read(device->machine, "AN1")) / 255.0; // gas
+ return (double)(5 * input_port_read(device->machine(), "AN1")) / 255.0; // gas
case ADC083X_VREF:
return 5;
}
@@ -895,16 +895,16 @@ static const adc083x_interface konamigx_adc_interface = {
static READ32_HANDLER( le2_gun_H_r )
{
- int p1x = input_port_read(space->machine, "LIGHT0_X")*290/0xff+20;
- int p2x = input_port_read(space->machine, "LIGHT1_X")*290/0xff+20;
+ int p1x = input_port_read(space->machine(), "LIGHT0_X")*290/0xff+20;
+ int p2x = input_port_read(space->machine(), "LIGHT1_X")*290/0xff+20;
return (p1x<<16)|p2x;
}
static READ32_HANDLER( le2_gun_V_r )
{
- int p1y = input_port_read(space->machine, "LIGHT0_Y")*224/0xff;
- int p2y = input_port_read(space->machine, "LIGHT1_Y")*224/0xff;
+ int p1y = input_port_read(space->machine(), "LIGHT0_Y")*224/0xff;
+ int p2y = input_port_read(space->machine(), "LIGHT1_Y")*224/0xff;
// make "off the bottom" reload too
if (p1y >= 0xdf) p1y = 0;
@@ -928,14 +928,14 @@ static READ32_HANDLER( gx6bppspr_r )
static READ32_HANDLER( type1_roz_r1 )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("gfx3")->base();
return ROM[offset];
}
static READ32_HANDLER( type1_roz_r2 )
{
- UINT32 *ROM = (UINT32 *)space->machine->region("gfx3")->base();
+ UINT32 *ROM = (UINT32 *)space->machine().region("gfx3")->base();
ROM += (0x600000/2);
@@ -1138,7 +1138,7 @@ static WRITE32_HANDLER( type4_prot_w )
if (konamigx_wrport1_1 & 0x10)
{
gx_rdport1_3 &= ~8;
- cputag_set_input_line(space->machine, "maincpu", 4, HOLD_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 4, HOLD_LINE);
}
// don't accidentally do a phony command
@@ -1152,7 +1152,7 @@ static WRITE32_HANDLER( type4_prot_w )
// cabinet lamps for type 1 games
static WRITE32_HANDLER( type1_cablamps_w )
{
- set_led_status(space->machine, 0, (data>>24)&1);
+ set_led_status(space->machine(), 0, (data>>24)&1);
}
/**********************************************************************************/
@@ -1254,9 +1254,9 @@ static READ16_HANDLER( dual539_r )
UINT16 ret = 0;
if (ACCESSING_BITS_0_7)
- ret |= k054539_r(space->machine->device("konami2"), offset);
+ ret |= k054539_r(space->machine().device("konami2"), offset);
if (ACCESSING_BITS_8_15)
- ret |= k054539_r(space->machine->device("konami1"), offset)<<8;
+ ret |= k054539_r(space->machine().device("konami1"), offset)<<8;
return ret;
}
@@ -1264,9 +1264,9 @@ static READ16_HANDLER( dual539_r )
static WRITE16_HANDLER( dual539_w )
{
if (ACCESSING_BITS_0_7)
- k054539_w(space->machine->device("konami2"), offset, data);
+ k054539_w(space->machine().device("konami2"), offset, data);
if (ACCESSING_BITS_8_15)
- k054539_w(space->machine->device("konami1"), offset, data>>8);
+ k054539_w(space->machine().device("konami1"), offset, data>>8);
}
static READ16_HANDLER( sndcomm68k_r )
@@ -1287,28 +1287,28 @@ static INTERRUPT_GEN(tms_sync)
static READ16_HANDLER(tms57002_data_word_r)
{
- return tms57002_data_r(space->machine->device("dasp"), 0);
+ return tms57002_data_r(space->machine().device("dasp"), 0);
}
static WRITE16_HANDLER(tms57002_data_word_w)
{
if (ACCESSING_BITS_0_7)
- tms57002_data_w(space->machine->device("dasp"), 0, data);
+ tms57002_data_w(space->machine().device("dasp"), 0, data);
}
static READ16_HANDLER(tms57002_status_word_r)
{
- return (tms57002_dready_r(space->machine->device("dasp"), 0) ? 4 : 0) |
- (tms57002_empty_r(space->machine->device("dasp"), 0) ? 1 : 0);
+ return (tms57002_dready_r(space->machine().device("dasp"), 0) ? 4 : 0) |
+ (tms57002_empty_r(space->machine().device("dasp"), 0) ? 1 : 0);
}
static WRITE16_HANDLER(tms57002_control_word_w)
{
if (ACCESSING_BITS_0_7)
{
- tms57002_pload_w(space->machine->device("dasp"), 0, data & 4);
- tms57002_cload_w(space->machine->device("dasp"), 0, data & 8);
- cputag_set_input_line(space->machine, "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE);
+ tms57002_pload_w(space->machine().device("dasp"), 0, data & 4);
+ tms57002_cload_w(space->machine().device("dasp"), 0, data & 8);
+ cputag_set_input_line(space->machine(), "dasp", INPUT_LINE_RESET, !(data & 16) ? ASSERT_LINE : CLEAR_LINE);
}
}
@@ -3649,7 +3649,7 @@ static MACHINE_START( konamigx )
static MACHINE_RESET(konamigx)
{
- device_t *k054539_2 = machine->device("konami2");
+ device_t *k054539_2 = machine.device("konami2");
int i;
konamigx_wrport1_0 = konamigx_wrport1_1 = 0;
@@ -3671,12 +3671,12 @@ static MACHINE_RESET(konamigx)
cputag_set_input_line(machine, "soundcpu", INPUT_LINE_HALT, ASSERT_LINE);
cputag_set_input_line(machine, "dasp", INPUT_LINE_RESET, ASSERT_LINE);
- if (!strcmp(machine->system().name, "tkmmpzdm"))
+ if (!strcmp(machine.system().name, "tkmmpzdm"))
{
// boost voice(chip 1 channel 3-7)
for (i=3; i<=7; i++) k054539_set_gain(k054539_2, i, 2.0);
}
- else if ((!strcmp(machine->system().name, "dragoonj")) || (!strcmp(machine->system().name, "dragoona")))
+ else if ((!strcmp(machine.system().name, "dragoonj")) || (!strcmp(machine.system().name, "dragoona")))
{
// soften percussions(chip 1 channel 0-3), boost voice(chip 1 channel 4-7)
for (i=0; i<=3; i++)
@@ -3756,12 +3756,12 @@ static DRIVER_INIT(konamigx)
snd020_hack = 0;
resume_trigger = 0;
- dmadelay_timer = machine->scheduler().timer_alloc(FUNC(dmaend_callback));
+ dmadelay_timer = machine.scheduler().timer_alloc(FUNC(dmaend_callback));
i = match = 0;
while ((gameDefs[i].cfgport != -1) && (!match))
{
- if (!strcmp(machine->system().name, gameDefs[i].romname))
+ if (!strcmp(machine.system().name, gameDefs[i].romname))
{
match = 1;
konamigx_cfgport = gameDefs[i].cfgport;
@@ -3771,13 +3771,13 @@ static DRIVER_INIT(konamigx)
switch (gameDefs[i].special)
{
case 1: // LE2 guns
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44000, 0xd44003, FUNC(le2_gun_H_r) );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44004, 0xd44007, FUNC(le2_gun_V_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44000, 0xd44003, FUNC(le2_gun_H_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd44004, 0xd44007, FUNC(le2_gun_V_r) );
break;
case 2: // tkmmpzdm hack
{
- UINT32 *rom = (UINT32*)machine->region("maincpu")->base();
+ UINT32 *rom = (UINT32*)machine.region("maincpu")->base();
// The display is initialized after POST but the copyright screen disabled
// planes B,C,D and didn't bother restoring them. I've spent a good
@@ -3808,7 +3808,7 @@ static DRIVER_INIT(konamigx)
break;
case 7: // install type 4 Xilinx protection for non-type 3/4 games
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xcc0000, 0xcc0007, FUNC(type4_prot_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xcc0000, 0xcc0007, FUNC(type4_prot_w) );
break;
case 8: // tbyahhoo
@@ -3828,14 +3828,14 @@ static DRIVER_INIT(konamigx)
switch (readback)
{
case BPP5:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx5bppspr_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx5bppspr_r));
break;
case BPP66:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd00000, 0xd01fff, FUNC(K056832_6bpp_rom_long_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd00000, 0xd01fff, FUNC(K056832_6bpp_rom_long_r));
case BPP6:
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx6bppspr_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xd4a000, 0xd4a00f, FUNC(gx6bppspr_r));
break;
}
diff --git a/src/mame/drivers/konamim2.c b/src/mame/drivers/konamim2.c
index 00ca8f9480c..8514d8ead33 100644
--- a/src/mame/drivers/konamim2.c
+++ b/src/mame/drivers/konamim2.c
@@ -235,7 +235,7 @@ static VIDEO_START( m2 )
static SCREEN_UPDATE( m2 )
{
- konamim2_state *state = screen->machine->driver_data<konamim2_state>();
+ konamim2_state *state = screen->machine().driver_data<konamim2_state>();
int i, j;
UINT32 fb_start = 0xffffffff;
@@ -266,7 +266,7 @@ static SCREEN_UPDATE( m2 )
static READ64_HANDLER(irq_enable_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT64 r = 0;
if (ACCESSING_BITS_32_63)
@@ -279,7 +279,7 @@ static READ64_HANDLER(irq_enable_r)
static WRITE64_HANDLER(irq_enable_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
state->irq_enable |= (UINT32)(data >> 32);
@@ -288,7 +288,7 @@ static WRITE64_HANDLER(irq_enable_w)
static READ64_HANDLER(irq_active_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT64 r = 0;
if (ACCESSING_BITS_32_63)
@@ -320,14 +320,14 @@ static READ64_HANDLER(unk2_r)
static READ64_HANDLER(unk3_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
//return U64(0xffffffffffffffff);
return state->unk3;
}
static READ64_HANDLER(unk4_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT64 r = 0;
// logerror("unk4_r: %08X, %08X%08X at %08X\n", offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(space->cpu));
@@ -345,7 +345,7 @@ static READ64_HANDLER(unk4_r)
static WRITE64_HANDLER(unk4_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
// logerror("unk4_w: %08X%08X, %08X, %08X%08X at %08X\n", (UINT32)(data >> 32), (UINT32)(data),
// offset, (UINT32)(mem_mask>>32), (UINT32)(mem_mask), cpu_get_pc(space->cpu));
@@ -354,7 +354,7 @@ static WRITE64_HANDLER(unk4_w)
if (data & 0x800000)
{
mame_printf_debug("CPU '%s': CPU1 IRQ at %08X\n", space->cpu->tag(), cpu_get_pc(space->cpu));
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_IRQ0, ASSERT_LINE);
}
state->unk20004 = (UINT32)(data);
@@ -364,7 +364,7 @@ static WRITE64_HANDLER(unk4_w)
static READ64_HANDLER(unk30000_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
state->counter1++;
return (UINT64)(state->counter1 & 0x7f) << 32;
}
@@ -380,7 +380,7 @@ static READ64_HANDLER(unk30030_r)
static WRITE64_HANDLER(video_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
state->vdl0_address = (UINT32)(data >> 32);
@@ -393,7 +393,7 @@ static WRITE64_HANDLER(video_w)
static WRITE64_HANDLER(video_irq_ack_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
if ((data >> 32) & 0x8000)
@@ -447,12 +447,12 @@ static WRITE64_HANDLER(unk4000418_w)
static WRITE64_HANDLER(reset_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
if (ACCESSING_BITS_32_63)
{
if (data & U64(0x100000000))
{
- cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", INPUT_LINE_RESET, PULSE_LINE);
state->unk3 = 0;
}
}
@@ -473,9 +473,9 @@ static WRITE64_HANDLER(reset_w)
-static void cde_init(running_machine *machine)
+static void cde_init(running_machine &machine)
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
cdrom_file *cd = cdrom_open(get_disk_handle(machine, "cdrom"));
const cdrom_toc *toc = cdrom_get_toc(cd);
@@ -513,9 +513,9 @@ static void cde_init(running_machine *machine)
state->cde_qchannel_offset = 0;
}
-static void cde_handle_command(running_machine *machine)
+static void cde_handle_command(running_machine &machine)
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
switch (state->cde_command_bytes[0])
{
case 0x04: // Set Speed
@@ -688,9 +688,9 @@ static void cde_handle_command(running_machine *machine)
}
}
-static void cde_handle_reports(running_machine *machine)
+static void cde_handle_reports(running_machine &machine)
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
switch (state->cde_command_bytes[0])
{
case 0x09:
@@ -809,7 +809,7 @@ static void cde_handle_reports(running_machine *machine)
static void cde_dma_transfer(address_space *space, int channel, int next)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT32 address;
//int length;
int i;
@@ -834,7 +834,7 @@ static void cde_dma_transfer(address_space *space, int channel, int next)
static READ64_HANDLER(cde_r)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
UINT32 r = 0;
int reg = offset * 2;
@@ -872,7 +872,7 @@ static READ64_HANDLER(cde_r)
if (!state->cde_response)
{
- cde_handle_reports(space->machine);
+ cde_handle_reports(space->machine());
// state->cde_command_byte_ptr = 0;
// state->cde_command_bytes[state->cde_command_byte_ptr++] = 0x1c;
@@ -910,7 +910,7 @@ static READ64_HANDLER(cde_r)
static WRITE64_HANDLER(cde_w)
{
- konamim2_state *state = space->machine->driver_data<konamim2_state>();
+ konamim2_state *state = space->machine().driver_data<konamim2_state>();
int reg = offset * 2;
UINT32 d;
@@ -934,7 +934,7 @@ static WRITE64_HANDLER(cde_w)
{
if (state->cde_response)
{
- cde_handle_command(space->machine);
+ cde_handle_command(space->machine());
state->cde_response = 0;
}
@@ -1099,7 +1099,7 @@ static READ64_HANDLER(cpu_r)
if (ACCESSING_BITS_32_63)
{
- r = (UINT64)((space->cpu != space->machine->device("maincpu")) ? 0x80000000 : 0);
+ r = (UINT64)((space->cpu != space->machine().device("maincpu")) ? 0x80000000 : 0);
//r |= 0x40000000; // sets Video-LowRes !?
return r << 32;
}
@@ -1141,7 +1141,7 @@ static const powerpc_config ppc602_config =
static INTERRUPT_GEN(m2)
{
- konamim2_state *state = device->machine->driver_data<konamim2_state>();
+ konamim2_state *state = device->machine().driver_data<konamim2_state>();
if (state->irq_enable & 0x800000)
{
state->irq_active |= 0x800000;
@@ -1282,7 +1282,7 @@ ROM_END
static DRIVER_INIT( m2 )
{
- konamim2_state *state = machine->driver_data<konamim2_state>();
+ konamim2_state *state = machine.driver_data<konamim2_state>();
state->unk3 = U64(0xffffffffffffffff);
state->unk20004 = 0;
cde_init(machine);
diff --git a/src/mame/drivers/kongambl.c b/src/mame/drivers/kongambl.c
index c4a523a87c2..b1e4b1f0ea4 100644
--- a/src/mame/drivers/kongambl.c
+++ b/src/mame/drivers/kongambl.c
@@ -30,7 +30,7 @@ public:
static VIDEO_START(kongambl)
{
- device_t *k056832 = machine->device("k056832");
+ device_t *k056832 = machine.device("k056832");
k056832_set_layer_association(k056832, 0);
k056832_set_layer_offs(k056832, 0, -2, 0);
@@ -41,10 +41,10 @@ static VIDEO_START(kongambl)
static SCREEN_UPDATE(kongambl)
{
- device_t *k056832 = screen->machine->device("k056832");
+ device_t *k056832 = screen->machine().device("k056832");
bitmap_fill(bitmap, cliprect, 0);
- bitmap_fill(screen->machine->priority_bitmap, cliprect, 0);
+ bitmap_fill(screen->machine().priority_bitmap, cliprect, 0);
// k056832_tilemap_draw(k056832, bitmap, cliprect, 3, 0, 0);
// k056832_tilemap_draw(k056832, bitmap, cliprect, 2, 0, 0);
@@ -57,7 +57,7 @@ static READ32_HANDLER( eeprom_r )
{
if (ACCESSING_BITS_0_7)
{
- UINT32 rv = input_port_read(space->machine, "SYSTEM") & ~0x1;
+ UINT32 rv = input_port_read(space->machine(), "SYSTEM") & ~0x1;
return rv; // bit 0 freezes the game if 1
}
@@ -69,7 +69,7 @@ static WRITE32_HANDLER( eeprom_w )
{
if (ACCESSING_BITS_8_15)
{
- input_port_write(space->machine, "EEPROMOUT", (data>>8)&0xf, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", (data>>8)&0xf, 0xff);
}
}
@@ -109,11 +109,11 @@ static ADDRESS_MAP_START( kongamaud_map, AS_PROGRAM, 16 )
AM_RANGE(0x200000, 0x2000ff) AM_RAM // unknown (YMZ280b? Shared with 68020?)
ADDRESS_MAP_END
-static void kongambl_sprite_callback( running_machine *machine, int *code, int *color, int *priority_mask )
+static void kongambl_sprite_callback( running_machine &machine, int *code, int *color, int *priority_mask )
{
}
-static void kongambl_tile_callback( running_machine *machine, int layer, int *code, int *color, int *flags )
+static void kongambl_tile_callback( running_machine &machine, int layer, int *code, int *color, int *flags )
{
}
diff --git a/src/mame/drivers/kopunch.c b/src/mame/drivers/kopunch.c
index 94ad46e0357..dc0e352f00b 100644
--- a/src/mame/drivers/kopunch.c
+++ b/src/mame/drivers/kopunch.c
@@ -18,14 +18,14 @@ static READ8_HANDLER( kopunch_in_r )
{
/* port 31 + low 3 bits of port 32 contain the punch strength */
if (offset == 0)
- return space->machine->rand();
+ return space->machine().rand();
else
- return (space->machine->rand() & 0x07) | input_port_read(space->machine, "SYSTEM");
+ return (space->machine().rand() & 0x07) | input_port_read(space->machine(), "SYSTEM");
}
static WRITE8_HANDLER( kopunch_lamp_w )
{
- set_led_status(space->machine, 0, ~data & 0x80);
+ set_led_status(space->machine(), 0, ~data & 0x80);
// if ((data & 0x7f) != 0x7f)
// popmessage("port 38 = %02x",data);
@@ -33,8 +33,8 @@ static WRITE8_HANDLER( kopunch_lamp_w )
static WRITE8_HANDLER( kopunch_coin_w )
{
- coin_counter_w(space->machine, 0, ~data & 0x80);
- coin_counter_w(space->machine, 1, ~data & 0x40);
+ coin_counter_w(space->machine(), 0, ~data & 0x80);
+ coin_counter_w(space->machine(), 1, ~data & 0x40);
// if ((data & 0x3f) != 0x3f)
// popmessage("port 34 = %02x",data);
@@ -70,7 +70,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( left_coin_inserted )
{
- kopunch_state *state = field->port->machine->driver_data<kopunch_state>();
+ kopunch_state *state = field->port->machine().driver_data<kopunch_state>();
/* left coin insertion causes a rst6.5 (vector 0x34) */
if (newval)
@@ -79,7 +79,7 @@ static INPUT_CHANGED( left_coin_inserted )
static INPUT_CHANGED( right_coin_inserted )
{
- kopunch_state *state = field->port->machine->driver_data<kopunch_state>();
+ kopunch_state *state = field->port->machine().driver_data<kopunch_state>();
/* right coin insertion causes a rst5.5 (vector 0x2c) */
if (newval)
@@ -173,16 +173,16 @@ GFXDECODE_END
static MACHINE_START( kopunch )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->gfxbank));
}
static MACHINE_RESET( kopunch )
{
- kopunch_state *state = machine->driver_data<kopunch_state>();
+ kopunch_state *state = machine.driver_data<kopunch_state>();
state->gfxbank = 0;
}
diff --git a/src/mame/drivers/ksayakyu.c b/src/mame/drivers/ksayakyu.c
index 5c072e78d52..893ef65332c 100644
--- a/src/mame/drivers/ksayakyu.c
+++ b/src/mame/drivers/ksayakyu.c
@@ -81,25 +81,25 @@ static WRITE8_HANDLER( bank_select_w )
xxxxxxx - unused ?
*/
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE8_HANDLER( latch_w )
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
state->sound_status &= ~0x80;
soundlatch_w(space, 0, data | 0x80);
}
static READ8_HANDLER (sound_status_r)
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
return state->sound_status | 4;
}
static WRITE8_HANDLER(tomaincpu_w)
{
- ksayakyu_state *state = space->machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = space->machine().driver_data<ksayakyu_state>();
state->sound_status |= 0x80;
soundlatch_w(space, 0, data);
}
@@ -252,8 +252,8 @@ GFXDECODE_END
static MACHINE_START( ksayakyu )
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
@@ -264,7 +264,7 @@ static MACHINE_START( ksayakyu )
static MACHINE_RESET( ksayakyu )
{
- ksayakyu_state *state = machine->driver_data<ksayakyu_state>();
+ ksayakyu_state *state = machine.driver_data<ksayakyu_state>();
state->sound_status = 0xff;
state->video_ctrl = 0;
diff --git a/src/mame/drivers/ksys573.c b/src/mame/drivers/ksys573.c
index 97d814b349d..b6918dac2d7 100644
--- a/src/mame/drivers/ksys573.c
+++ b/src/mame/drivers/ksys573.c
@@ -403,12 +403,12 @@ public:
int atapi_xfermod;
UINT32 m_n_security_control;
- void (*security_callback)( running_machine *machine, int data );
+ void (*security_callback)( running_machine &machine, int data );
UINT8 gx700pwbf_output_data[ 4 ];
- void (*gx700pwfbf_output_callback)( running_machine *machine, int offset, int data );
+ void (*gx700pwfbf_output_callback)( running_machine &machine, int offset, int data );
UINT16 gx894pwbba_output_data[ 8 ];
- void (*gx894pwbba_output_callback)( running_machine *machine, int offset, int data );
+ void (*gx894pwbba_output_callback)( running_machine &machine, int offset, int data );
UINT32 stage_mask;
struct
@@ -442,7 +442,7 @@ public:
double pad_position[ 6 ];
};
-INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level, const char *s_fmt, ... )
+INLINE void ATTR_PRINTF(3,4) verboselog( running_machine &machine, int n_level, const char *s_fmt, ... )
{
if( VERBOSE_LEVEL >= n_level )
{
@@ -451,7 +451,7 @@ INLINE void ATTR_PRINTF(3,4) verboselog( running_machine *machine, int n_level,
va_start( v, s_fmt );
vsprintf( buf, s_fmt, v );
va_end( v );
- logerror( "%s: %s", machine->describe_context(), buf );
+ logerror( "%s: %s", machine.describe_context(), buf );
}
}
@@ -459,26 +459,26 @@ static const char *const diskregions[] = { "cdrom0", "cdrom1" };
static WRITE32_HANDLER( mb89371_w )
{
- verboselog( space->machine, 2, "mb89371_w %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "mb89371_w %08x %08x %08x\n", offset, mem_mask, data );
}
static READ32_HANDLER( mb89371_r )
{
UINT32 data = 0xffffffff;
- verboselog( space->machine, 2, "mb89371_r %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "mb89371_r %08x %08x %08x\n", offset, mem_mask, data );
return data;
}
static READ32_HANDLER( jamma_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
- running_machine *machine = space->machine;
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
+ running_machine &machine = space->machine();
int security_cart_number = state->security_cart_number;
UINT32 data = input_port_read(machine, "IN1");
data |= 0x000000c0;
- ds2401_device *ds2401 = space->machine->device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
- device_secure_serial_flash *secflash = space->machine->device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
+ device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
if( ds2401 )
{
@@ -504,61 +504,61 @@ static READ32_HANDLER( jamma_r )
static READ32_HANDLER( control_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
- verboselog( space->machine, 2, "control_r( %08x, %08x ) %08x\n", offset, mem_mask, state->control );
+ verboselog( space->machine(), 2, "control_r( %08x, %08x ) %08x\n", offset, mem_mask, state->control );
return state->control;
}
static WRITE32_HANDLER( control_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 control;
int old_bank = state->flash_bank;
COMBINE_DATA(&state->control);
control = state->control;
- verboselog( space->machine, 2, "control_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "control_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
state->flash_bank = -1;
// zs01 only, others are reached through security_w
- device_secure_serial_flash *secflash = space->machine->device<device_secure_serial_flash>(state->security_cart_number ? "game_eeprom" : "install_eeprom");
+ device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(state->security_cart_number ? "game_eeprom" : "install_eeprom");
if( dynamic_cast<zs01_device *>(secflash) )
secflash->sda_w( !( ( control >> 6 ) & 1 ) ); /* 0x40 */
if( state->flash_device[0][0] != NULL && ( control & ~0x43 ) == 0x00 )
{
state->flash_bank = (0 << 8) + ( ( control & 3 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "onboard %d\n", control & 3 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "onboard %d\n", control & 3 );
}
else if( state->flash_device[1][0] != NULL && ( control & ~0x47 ) == 0x10 )
{
state->flash_bank = (1 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard1 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard1 %d\n", control & 7 );
}
else if( state->flash_device[2][0] != NULL && ( control & ~0x47 ) == 0x20 )
{
state->flash_bank = (2 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard2 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard2 %d\n", control & 7 );
}
else if( state->flash_device[3][0] != NULL && ( control & ~0x47 ) == 0x20 )
{
state->flash_bank = (3 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard3 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard3 %d\n", control & 7 );
}
else if( state->flash_device[4][0] != NULL && ( control & ~0x47 ) == 0x28 )
{
state->flash_bank = (4 << 8) + ( ( control & 7 ) * 2 );
- if( state->flash_bank != old_bank ) verboselog( space->machine, 1, "pccard4 %d\n", control & 7 );
+ if( state->flash_bank != old_bank ) verboselog( space->machine(), 1, "pccard4 %d\n", control & 7 );
}
}
static TIMER_CALLBACK( atapi_xfer_end )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
UINT8 *atapi_regs = state->atapi_regs;
int i, n_this;
@@ -610,7 +610,7 @@ static TIMER_CALLBACK( atapi_xfer_end )
atapi_regs[ATAPI_REG_COUNTLOW] = state->atapi_xferlen & 0xff;
atapi_regs[ATAPI_REG_COUNTHIGH] = (state->atapi_xferlen>>8)&0xff;
- state->atapi_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
+ state->atapi_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
}
else
{
@@ -626,9 +626,9 @@ static TIMER_CALLBACK( atapi_xfer_end )
static READ32_HANDLER( atapi_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT8 *atapi_regs = state->atapi_regs;
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
int reg, data;
if (mem_mask == 0x0000ffff) // word-wide command read
@@ -672,7 +672,7 @@ static READ32_HANDLER( atapi_r )
atapi_regs[ATAPI_REG_COUNTLOW] = state->atapi_xferlen & 0xff;
atapi_regs[ATAPI_REG_COUNTHIGH] = (state->atapi_xferlen>>8)&0xff;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
}
if( state->atapi_data_ptr < state->atapi_data_len )
@@ -689,7 +689,7 @@ static READ32_HANDLER( atapi_r )
{
atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
}
}
}
@@ -750,10 +750,10 @@ static READ32_HANDLER( atapi_r )
static WRITE32_HANDLER( atapi_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT8 *atapi_regs = state->atapi_regs;
UINT8 *atapi_data = state->atapi_data;
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
int reg;
verboselog( machine, 2, "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
@@ -775,7 +775,7 @@ static WRITE32_HANDLER( atapi_w )
SCSIWriteData( state->inserted_cdrom, atapi_data, state->atapi_cdata_wait );
// assert IRQ
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
// not sure here, but clear DRQ at least?
atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -848,7 +848,7 @@ static WRITE32_HANDLER( atapi_w )
}
// assert IRQ
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
}
else
{
@@ -965,7 +965,7 @@ static WRITE32_HANDLER( atapi_w )
atapi_regs[ATAPI_REG_COUNTLOW] = 0;
atapi_regs[ATAPI_REG_COUNTHIGH] = 2;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
break;
case 0xef: // SET FEATURES
@@ -974,7 +974,7 @@ static WRITE32_HANDLER( atapi_w )
state->atapi_data_ptr = 0;
state->atapi_data_len = 0;
- psx_irq_set(space->machine, 0x400);
+ psx_irq_set(space->machine(), 0x400);
break;
default:
@@ -992,16 +992,16 @@ static void atapi_exit(running_machine& machine)
for( i = 0; i < 2; i++ )
{
- if( get_disk_handle( &machine, diskregions[i] ) != NULL )
+ if( get_disk_handle( machine, diskregions[i] ) != NULL )
{
SCSIDeleteInstance( state->available_cdroms[ i ] );
}
}
}
-static void atapi_init(running_machine *machine)
+static void atapi_init(running_machine &machine)
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int i;
state->atapi_regs[ATAPI_REG_CMDSTATUS] = 0;
@@ -1013,7 +1013,7 @@ static void atapi_init(running_machine *machine)
state->atapi_data_len = 0;
state->atapi_cdata_wait = 0;
- state->atapi_timer = machine->scheduler().timer_alloc(FUNC(atapi_xfer_end));
+ state->atapi_timer = machine.scheduler().timer_alloc(FUNC(atapi_xfer_end));
state->atapi_timer->adjust(attotime::never);
for( i = 0; i < 2; i++ )
@@ -1027,7 +1027,7 @@ static void atapi_init(running_machine *machine)
state->available_cdroms[ i ] = NULL;
}
}
- machine->add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
+ machine.add_notifier(MACHINE_NOTIFY_EXIT, atapi_exit);
state->save_item( NAME(state->atapi_regs) );
@@ -1042,14 +1042,14 @@ static void atapi_init(running_machine *machine)
static WRITE32_HANDLER( atapi_reset_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT8 *atapi_regs = state->atapi_regs;
- verboselog( space->machine, 2, "atapi_reset_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "atapi_reset_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
if (data)
{
- verboselog( space->machine, 2, "atapi_reset_w: reset\n" );
+ verboselog( space->machine(), 2, "atapi_reset_w: reset\n" );
// mame_printf_debug("ATAPI reset\n");
@@ -1067,15 +1067,15 @@ static WRITE32_HANDLER( atapi_reset_w )
}
}
-static void cdrom_dma_read( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void cdrom_dma_read( running_machine &machine, UINT32 n_address, INT32 n_size )
{
verboselog( machine, 2, "cdrom_dma_read( %08x, %08x )\n", n_address, n_size );
// mame_printf_debug("DMA read: address %08x size %08x\n", n_address, n_size);
}
-static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n_size )
+static void cdrom_dma_write( running_machine &machine, UINT32 n_address, INT32 n_size )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
verboselog( machine, 2, "cdrom_dma_write( %08x, %08x )\n", n_address, n_size );
// mame_printf_debug("DMA write: address %08x size %08x\n", n_address, n_size);
@@ -1085,22 +1085,22 @@ static void cdrom_dma_write( running_machine *machine, UINT32 n_address, INT32 n
verboselog( machine, 2, "atapi_xfer_end: %d %d\n", state->atapi_xferlen, state->atapi_xfermod );
// set a transfer complete timer (Note: CYCLES_PER_SECTOR can't be lower than 2000 or the BIOS ends up "out of order")
- state->atapi_timer->adjust(machine->device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
+ state->atapi_timer->adjust(machine.device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (state->atapi_xferlen/2048))));
}
static WRITE32_HANDLER( security_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
int security_cart_number = state->security_cart_number;
- running_machine *machine = space->machine;
+ running_machine &machine = space->machine();
COMBINE_DATA( &state->m_n_security_control );
- verboselog( space->machine, 2, "security_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "security_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
if( ACCESSING_BITS_0_15 )
{
- ds2401_device *ds2401 = space->machine->device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
- device_secure_serial_flash *secflash = space->machine->device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>(security_cart_number ? "game_id" : "install_id");
+ device_secure_serial_flash *secflash = space->machine().device<device_secure_serial_flash>(security_cart_number ? "game_eeprom" : "install_eeprom");
if( secflash ) {
if( !dynamic_cast<zs01_device *>(secflash) )
@@ -1126,16 +1126,16 @@ static WRITE32_HANDLER( security_w )
static READ32_HANDLER( security_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 data = state->m_n_security_control;
- verboselog( space->machine, 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "security_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
static READ32_HANDLER( flash_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 data = 0;
if( state->flash_bank < 0 )
@@ -1166,16 +1166,16 @@ static READ32_HANDLER( flash_r )
}
}
- verboselog( space->machine, 2, "flash_r( %08x, %08x, %08x) bank = %08x\n", offset, mem_mask, data, state->flash_bank );
+ verboselog( space->machine(), 2, "flash_r( %08x, %08x, %08x) bank = %08x\n", offset, mem_mask, data, state->flash_bank );
return data;
}
static WRITE32_HANDLER( flash_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
- verboselog( space->machine, 2, "flash_w( %08x, %08x, %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "flash_w( %08x, %08x, %08x\n", offset, mem_mask, data );
if( state->flash_bank < 0 )
{
@@ -1245,26 +1245,26 @@ ADDRESS_MAP_END
-static void flash_init( running_machine *machine )
+static void flash_init( running_machine &machine )
{
// find onboard flash devices
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
astring tempstr;
for (int index = 0; index < 8; index++)
- state->flash_device[0][index] = machine->device<fujitsu_29f016a_device>(tempstr.format("onboard.%d", index));
+ state->flash_device[0][index] = machine.device<fujitsu_29f016a_device>(tempstr.format("onboard.%d", index));
// find pccard flash devices
for (int card = 1; card <= 4; card++)
for (int index = 0; index < 16; index++)
- state->flash_device[card][index] = machine->device<fujitsu_29f016a_device>(tempstr.format("pccard%d.%d", card, index));
+ state->flash_device[card][index] = machine.device<fujitsu_29f016a_device>(tempstr.format("pccard%d.%d", card, index));
state->save_item( NAME(state->flash_bank) );
state->save_item( NAME(state->control) );
}
-static void *atapi_get_device(running_machine *machine)
+static void *atapi_get_device(running_machine &machine)
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
void *ret;
SCSIGetDevice( state->inserted_cdrom, &ret );
return ret;
@@ -1272,7 +1272,7 @@ static void *atapi_get_device(running_machine *machine)
static DRIVER_INIT( konami573 )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
psx_driver_init(machine);
atapi_init(machine);
@@ -1286,11 +1286,11 @@ static DRIVER_INIT( konami573 )
static MACHINE_RESET( konami573 )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
psx_machine_init(machine);
- if( state->machine->device<device_secure_serial_flash>("install_eeprom") )
+ if( state->machine().device<device_secure_serial_flash>("install_eeprom") )
{
/* security cart */
psx_sio_input( machine, 1, PSX_SIO_IN_DSR, PSX_SIO_IN_DSR );
@@ -1303,18 +1303,18 @@ static void spu_irq(device_t *device, UINT32 data)
{
if (data)
{
- psx_irq_set(device->machine, 1<<9);
+ psx_irq_set(device->machine(), 1<<9);
}
}
-static void update_mode( running_machine *machine )
+static void update_mode( running_machine &machine )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int cart = input_port_read(machine, "CART");
int cd = input_port_read( machine, "CD" );
SCSIInstance *new_cdrom;
- if( state->machine->device<device_secure_serial_flash>("game_eeprom") )
+ if( state->machine().device<device_secure_serial_flash>("game_eeprom") )
{
state->security_cart_number = cart;
}
@@ -1335,18 +1335,18 @@ static void update_mode( running_machine *machine )
if( state->inserted_cdrom != new_cdrom )
{
state->inserted_cdrom = new_cdrom;
- cdda_set_cdrom(machine->device("cdda"), atapi_get_device(machine));
+ cdda_set_cdrom(machine.device("cdda"), atapi_get_device(machine));
}
}
static INTERRUPT_GEN( sys573_vblank )
{
- ksys573_state *state = device->machine->driver_data<ksys573_state>();
+ ksys573_state *state = device->machine().driver_data<ksys573_state>();
UINT32 *p_n_psxram = state->p_n_psxram;
- update_mode(device->machine);
+ update_mode(device->machine());
- if( strcmp( device->machine->system().name, "ddr2ml" ) == 0 )
+ if( strcmp( device->machine().system().name, "ddr2ml" ) == 0 )
{
/* patch out security-plate error */
@@ -1368,7 +1368,7 @@ static INTERRUPT_GEN( sys573_vblank )
p_n_psxram[ 0x1f850 / 4 ] = 0x08007e22;
}
}
- else if( strcmp( device->machine->system().name, "ddr2mla" ) == 0 )
+ else if( strcmp( device->machine().system().name, "ddr2mla" ) == 0 )
{
/* patch out security-plate error */
@@ -1395,14 +1395,14 @@ todo:
static READ32_HANDLER( ge765pwbba_r )
{
- device_t *upd4701 = space->machine->device("upd4701");
+ device_t *upd4701 = space->machine().device("upd4701");
UINT32 data = 0;
switch (offset)
{
case 0x26:
- upd4701_y_add(upd4701, 0, input_port_read_safe(space->machine, "uPD4701_y", 0), 0xffff);
- upd4701_switches_set(upd4701, 0, input_port_read_safe(space->machine, "uPD4701_switches", 0));
+ upd4701_y_add(upd4701, 0, input_port_read_safe(space->machine(), "uPD4701_y", 0), 0xffff);
+ upd4701_switches_set(upd4701, 0, input_port_read_safe(space->machine(), "uPD4701_switches", 0));
upd4701_cs_w(upd4701, 0, 0);
upd4701_xy_w(upd4701, 0, 1);
@@ -1423,17 +1423,17 @@ static READ32_HANDLER( ge765pwbba_r )
break;
default:
- verboselog(space->machine, 0, "ge765pwbba_r: unhandled offset %08x %08x\n", offset, mem_mask);
+ verboselog(space->machine(), 0, "ge765pwbba_r: unhandled offset %08x %08x\n", offset, mem_mask);
break;
}
- verboselog(space->machine, 2, "ge765pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data);
+ verboselog(space->machine(), 2, "ge765pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data);
return data;
}
static WRITE32_HANDLER( ge765pwbba_w )
{
- device_t *upd4701 = space->machine->device("upd4701");
+ device_t *upd4701 = space->machine().device("upd4701");
switch (offset)
{
case 0x04:
@@ -1462,17 +1462,17 @@ static WRITE32_HANDLER( ge765pwbba_w )
break;
default:
- verboselog(space->machine, 0, "ge765pwbba_w: unhandled offset %08x %08x %08x\n", offset, mem_mask, data);
+ verboselog(space->machine(), 0, "ge765pwbba_w: unhandled offset %08x %08x %08x\n", offset, mem_mask, data);
break;
}
- verboselog(space->machine, 2, "ge765pwbba_w( %08x, %08x, %08x )\n", offset, mem_mask, data);
+ verboselog(space->machine(), 2, "ge765pwbba_w( %08x, %08x, %08x )\n", offset, mem_mask, data);
}
static DRIVER_INIT( ge765pwbba )
{
DRIVER_INIT_CALL(konami573);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(ge765pwbba_r), FUNC(ge765pwbba_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(ge765pwbba_r), FUNC(ge765pwbba_w) );
}
/*
@@ -1509,14 +1509,14 @@ static READ32_HANDLER( gx700pwbf_io_r )
break;
}
- verboselog( space->machine, 2, "gx700pwbf_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gx700pwbf_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
-static void gx700pwbf_output( running_machine *machine, int offset, UINT8 data )
+static void gx700pwbf_output( running_machine &machine, int offset, UINT8 data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
if( state->gx700pwfbf_output_callback != NULL )
{
@@ -1537,7 +1537,7 @@ static void gx700pwbf_output( running_machine *machine, int offset, UINT8 data )
static WRITE32_HANDLER( gx700pwbf_io_w )
{
- verboselog( space->machine, 2, "gx700pwbf_io_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gx700pwbf_io_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
switch( offset )
{
@@ -1545,28 +1545,28 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 0, data & 0xff );
+ gx700pwbf_output( space->machine(), 0, data & 0xff );
}
break;
case 0x22:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 1, data & 0xff );
+ gx700pwbf_output( space->machine(), 1, data & 0xff );
}
break;
case 0x24:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 2, data & 0xff );
+ gx700pwbf_output( space->machine(), 2, data & 0xff );
}
break;
case 0x26:
if( ACCESSING_BITS_0_15 )
{
- gx700pwbf_output( space->machine, 3, data & 0xff );
+ gx700pwbf_output( space->machine(), 3, data & 0xff );
}
break;
@@ -1576,15 +1576,15 @@ static WRITE32_HANDLER( gx700pwbf_io_w )
}
}
-static void gx700pwfbf_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) )
+static void gx700pwfbf_init( running_machine &machine, void (*output_callback_func)( running_machine &machine, int offset, int data ) )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
memset( state->gx700pwbf_output_data, 0, sizeof( state->gx700pwbf_output_data ) );
state->gx700pwfbf_output_callback = output_callback_func;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx700pwbf_io_r), FUNC(gx700pwbf_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx700pwbf_io_r), FUNC(gx700pwbf_io_w) );
state->save_item( NAME(state->gx700pwbf_output_data) );
}
@@ -1610,16 +1610,16 @@ static const int mask[] =
0, 4, 0, 6
};
-static void gn845pwbb_do_w( running_machine *machine, int offset, int data )
+static void gn845pwbb_do_w( running_machine &machine, int offset, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
state->stage[ offset ].DO = !data;
}
-static void gn845pwbb_clk_w( running_machine *machine, int offset, int data )
+static void gn845pwbb_clk_w( running_machine &machine, int offset, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int clk = !data;
if( clk != state->stage[ offset ].clk )
@@ -1668,12 +1668,12 @@ static void gn845pwbb_clk_w( running_machine *machine, int offset, int data )
static CUSTOM_INPUT( gn845pwbb_read )
{
- ksys573_state *state = field->port->machine->driver_data<ksys573_state>();
+ ksys573_state *state = field->port->machine().driver_data<ksys573_state>();
- return input_port_read(field->port->machine, "STAGE") & state->stage_mask;
+ return input_port_read(field->port->machine(), "STAGE") & state->stage_mask;
}
-static void gn845pwbb_output_callback( running_machine *machine, int offset, int data )
+static void gn845pwbb_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -1762,7 +1762,7 @@ static void gn845pwbb_output_callback( running_machine *machine, int offset, int
static DRIVER_INIT( ddr )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
DRIVER_INIT_CALL(konami573);
@@ -1791,17 +1791,17 @@ static READ32_HANDLER( gtrfrks_io_r )
break;
default:
- verboselog( space->machine, 0, "gtrfrks_io_r: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "gtrfrks_io_r: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
- verboselog( space->machine, 2, "gtrfrks_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gtrfrks_io_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
return data;
}
static WRITE32_HANDLER( gtrfrks_io_w )
{
- verboselog( space->machine, 2, "gtrfrks_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gtrfrks_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
switch( offset )
{
@@ -1816,7 +1816,7 @@ static WRITE32_HANDLER( gtrfrks_io_w )
break;
default:
- verboselog( space->machine, 0, "gtrfrks_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "gtrfrks_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
}
@@ -1825,14 +1825,14 @@ static DRIVER_INIT( gtrfrks )
{
DRIVER_INIT_CALL(konami573);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
}
/* GX894 digital i/o */
static READ32_HANDLER( gx894pwbba_r )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
UINT32 data = 0;
switch( offset )
@@ -1849,7 +1849,7 @@ static READ32_HANDLER( gx894pwbba_r )
case 0x2b:
if( ACCESSING_BITS_0_15 )
{
- mas3507d_device *mas3507d = space->machine->device<mas3507d_device>("mpeg");
+ mas3507d_device *mas3507d = space->machine().device<mas3507d_device>("mpeg");
data |= mas3507d->i2c_scl_r() << 13;
data |= mas3507d->i2c_sda_r() << 12;
}
@@ -1910,7 +1910,7 @@ static READ32_HANDLER( gx894pwbba_r )
case 0x3b:
if( ACCESSING_BITS_16_31 )
{
- data |= space->machine->device<ds2401_device>("digital_id")->read() << 28;
+ data |= space->machine().device<ds2401_device>("digital_id")->read() << 28;
}
break;
case 0x3d:
@@ -1933,7 +1933,7 @@ static READ32_HANDLER( gx894pwbba_r )
break;
}
- verboselog( space->machine, 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gx894pwbba_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
// printf( "%08x: gx894pwbba_r( %08x, %08x ) %08x\n", cpu_get_pc(space->cpu), offset, mem_mask, data );
return data;
}
@@ -1949,9 +1949,9 @@ static char *binary( char *s, UINT32 data )
return s;
}
-static void gx894pwbba_output( running_machine *machine, int offset, UINT8 data )
+static void gx894pwbba_output( running_machine &machine, int offset, UINT8 data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
if( state->gx894pwbba_output_callback != NULL )
{
@@ -1972,7 +1972,7 @@ static void gx894pwbba_output( running_machine *machine, int offset, UINT8 data
static WRITE32_HANDLER( gx894pwbba_w )
{
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
char buff[33];
UINT32 olda=state->a,oldb=state->b,oldc=state->c,oldd=state->d;
@@ -1983,7 +1983,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
return;
}
- verboselog( space->machine, 2, "gx894pwbba_w( %08x, %08x, %08x) %s\n", offset, mem_mask, data, binary( buff, data ) );
+ verboselog( space->machine(), 2, "gx894pwbba_w( %08x, %08x, %08x) %s\n", offset, mem_mask, data, binary( buff, data ) );
switch( offset )
{
@@ -2005,7 +2005,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
break;
case 0x2b:
if(ACCESSING_BITS_0_15) {
- mas3507d_device *mas3507d = space->machine->device<mas3507d_device>("mpeg");
+ mas3507d_device *mas3507d = space->machine().device<mas3507d_device>("mpeg");
mas3507d->i2c_scl_w(data & 0x2000);
mas3507d->i2c_sda_w(data & 0x1000);
}
@@ -2055,22 +2055,22 @@ static WRITE32_HANDLER( gx894pwbba_w )
case 0x38:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 0, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 0, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( space->machine, 1, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine(), 1, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &state->a );
break;
case 0x39:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 7, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 7, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( space->machine, 3, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine(), 3, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &state->b );
break;
@@ -2083,7 +2083,7 @@ static WRITE32_HANDLER( gx894pwbba_w )
logerror("FPGA MPEG key 3/3 %02x\n", data & 0xff);
if( ACCESSING_BITS_16_31 )
{
- space->machine->device<ds2401_device>("digital_id")->write( !( ( data >> 28 ) & 1 ) );
+ space->machine().device<ds2401_device>("digital_id")->write( !( ( data >> 28 ) & 1 ) );
}
break;
case 0x3e:
@@ -2108,18 +2108,18 @@ static WRITE32_HANDLER( gx894pwbba_w )
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 4, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 4, ( data >> 28 ) & 0xf );
}
COMBINE_DATA( &state->c );
break;
case 0x3f:
if( ACCESSING_BITS_16_31 )
{
- gx894pwbba_output( space->machine, 2, ( data >> 28 ) & 0xf );
+ gx894pwbba_output( space->machine(), 2, ( data >> 28 ) & 0xf );
}
if( ACCESSING_BITS_0_15 )
{
- gx894pwbba_output( space->machine, 5, ( data >> 12 ) & 0xf );
+ gx894pwbba_output( space->machine(), 5, ( data >> 12 ) & 0xf );
}
COMBINE_DATA( &state->d );
break;
@@ -2133,14 +2133,14 @@ static WRITE32_HANDLER( gx894pwbba_w )
}
}
-static void gx894pwbba_init( running_machine *machine, void (*output_callback_func)( running_machine *machine, int offset, int data ) )
+static void gx894pwbba_init( running_machine &machine, void (*output_callback_func)( running_machine &machine, int offset, int data ) )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int gx894_ram_size = 24 * 1024 * 1024;
state->gx894pwbba_output_callback = output_callback_func;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx894pwbba_r), FUNC(gx894pwbba_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gx894pwbba_r), FUNC(gx894pwbba_w) );
state->gx894_ram_write_offset = 0;
state->gx894_ram_read_offset = 0;
@@ -2167,12 +2167,12 @@ static DRIVER_INIT( gtrfrkdigital )
gx894pwbba_init( machine, NULL );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f600000, 0x1f6000ff, FUNC(gtrfrks_io_r), FUNC(gtrfrks_io_w) );
}
/* ddr solo */
-static void ddrsolo_output_callback( running_machine *machine, int offset, int data )
+static void ddrsolo_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2234,7 +2234,7 @@ static DRIVER_INIT( ddrsolo )
/* drummania */
-static void drmn_output_callback( running_machine *machine, int offset, int data )
+static void drmn_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2314,7 +2314,7 @@ static DRIVER_INIT( drmndigital )
/* dance maniax */
-static void dmx_output_callback( running_machine *machine, int offset, int data )
+static void dmx_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2434,7 +2434,7 @@ static void dmx_output_callback( running_machine *machine, int offset, int data
static WRITE32_HANDLER( dmx_io_w )
{
- verboselog( space->machine, 2, "dmx_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "dmx_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
switch( offset )
{
@@ -2449,7 +2449,7 @@ static WRITE32_HANDLER( dmx_io_w )
break;
default:
- verboselog( space->machine, 0, "dmx_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "dmx_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
}
@@ -2460,14 +2460,14 @@ static DRIVER_INIT( dmx )
gx894pwbba_init( machine, dmx_output_callback );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(dmx_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(dmx_io_w) );
}
/* salary man champ */
-static void salarymc_lamp_callback( running_machine *machine, int data )
+static void salarymc_lamp_callback( running_machine &machine, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int d = ( data >> 7 ) & 1;
int rst = ( data >> 6 ) & 1;
int clk = ( data >> 5 ) & 1;
@@ -2513,7 +2513,7 @@ static void salarymc_lamp_callback( running_machine *machine, int data )
static DRIVER_INIT( salarymc )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
DRIVER_INIT_CALL(konami573);
@@ -2526,9 +2526,9 @@ static DRIVER_INIT( salarymc )
/* Hyper Bishi Bashi Champ */
-static void hyperbbc_lamp_callback( running_machine *machine, int data )
+static void hyperbbc_lamp_callback( running_machine &machine, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
int red = ( data >> 6 ) & 1;
int blue = ( data >> 5 ) & 1;
int green = ( data >> 4 ) & 1;
@@ -2556,7 +2556,7 @@ static void hyperbbc_lamp_callback( running_machine *machine, int data )
static DRIVER_INIT( hyperbbc )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
DRIVER_INIT_CALL(konami573);
@@ -2568,7 +2568,7 @@ static DRIVER_INIT( hyperbbc )
/* Mambo A Go Go */
-static void mamboagg_output_callback( running_machine *machine, int offset, int data )
+static void mamboagg_output_callback( running_machine &machine, int offset, int data )
{
switch( offset )
{
@@ -2598,7 +2598,7 @@ static void mamboagg_output_callback( running_machine *machine, int offset, int
static WRITE32_HANDLER( mamboagg_io_w )
{
- verboselog( space->machine, 2, "mamboagg_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "mamboagg_io_w( %08x, %08x ) %08x\n", offset, mem_mask, data );
switch( offset )
{
@@ -2609,7 +2609,7 @@ static WRITE32_HANDLER( mamboagg_io_w )
break;
default:
- verboselog( space->machine, 0, "mamboagg_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
+ verboselog( space->machine(), 0, "mamboagg_io_w: unhandled offset %08x, %08x\n", offset, mem_mask );
break;
}
}
@@ -2620,7 +2620,7 @@ static DRIVER_INIT( mamboagg )
gx894pwbba_init( machine, mamboagg_output_callback );
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(mamboagg_io_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x1f600000, 0x1f6000ff, FUNC(mamboagg_io_w) );
}
@@ -2629,9 +2629,9 @@ static DRIVER_INIT( mamboagg )
static double punchmania_inputs_callback( device_t *device, UINT8 input )
{
- ksys573_state *state = device->machine->driver_data<ksys573_state>();
+ ksys573_state *state = device->machine().driver_data<ksys573_state>();
double *pad_position = state->pad_position;
- int pads = input_port_read(device->machine, "PADS");
+ int pads = input_port_read(device->machine(), "PADS");
for( int i = 0; i < 6; i++ )
{
if( ( pads & ( 1 << i ) ) != 0 )
@@ -2664,9 +2664,9 @@ static double punchmania_inputs_callback( device_t *device, UINT8 input )
int pad_light[ 6 ];
-static void punchmania_output_callback( running_machine *machine, int offset, int data )
+static void punchmania_output_callback( running_machine &machine, int offset, int data )
{
- ksys573_state *state = machine->driver_data<ksys573_state>();
+ ksys573_state *state = machine.driver_data<ksys573_state>();
double *pad_position = state->pad_position;
char pad[ 7 ];
@@ -2805,8 +2805,8 @@ static DRIVER_INIT( punchmania )
static WRITE32_HANDLER( gunmania_w )
{
char s[ 1024 ] = "";
- ksys573_state *state = space->machine->driver_data<ksys573_state>();
- ds2401_device *ds2401 = space->machine->device<ds2401_device>("gunmania_id");
+ ksys573_state *state = space->machine().driver_data<ksys573_state>();
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>("gunmania_id");
switch( offset )
{
@@ -2891,12 +2891,12 @@ static WRITE32_HANDLER( gunmania_w )
break;
}
- verboselog( space->machine, 2, "gunmania_w %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gunmania_w %08x %08x %08x\n", offset, mem_mask, data );
}
static CUSTOM_INPUT( gunmania_tank_shutter_sensor )
{
- ksys573_state *state = field->port->machine->driver_data<ksys573_state>();
+ ksys573_state *state = field->port->machine().driver_data<ksys573_state>();
if( state->tank_shutter_position == 0 )
{
@@ -2908,7 +2908,7 @@ static CUSTOM_INPUT( gunmania_tank_shutter_sensor )
static CUSTOM_INPUT( gunmania_cable_holder_sensor )
{
- ksys573_state *state = field->port->machine->driver_data<ksys573_state>();
+ ksys573_state *state = field->port->machine().driver_data<ksys573_state>();
return state->cable_holder_release;
}
@@ -2916,32 +2916,32 @@ static CUSTOM_INPUT( gunmania_cable_holder_sensor )
static READ32_HANDLER( gunmania_r )
{
UINT32 data = 0;
- ds2401_device *ds2401 = space->machine->device<ds2401_device>("gunmania_id");
+ ds2401_device *ds2401 = space->machine().device<ds2401_device>("gunmania_id");
switch( offset )
{
case 0x20:
- data = input_port_read( space->machine, "GUNX" ) | ds2401->read() << 7;
+ data = input_port_read( space->machine(), "GUNX" ) | ds2401->read() << 7;
break;
case 0x22:
- data = input_port_read( space->machine, "GUNY" ) | input_port_read( space->machine, "SENSOR" );
+ data = input_port_read( space->machine(), "GUNY" ) | input_port_read( space->machine(), "SENSOR" );
break;
case 0x34:
- data = input_port_read( space->machine, "ENCODER" );
+ data = input_port_read( space->machine(), "ENCODER" );
popmessage( "encoder %04x", data );
break;
}
- verboselog( space->machine, 2, "gunmania_r %08x %08x %08x\n", offset, mem_mask, data );
+ verboselog( space->machine(), 2, "gunmania_r %08x %08x %08x\n", offset, mem_mask, data );
return data;
}
static DRIVER_INIT( gunmania )
{
DRIVER_INIT_CALL(konami573);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gunmania_r), FUNC(gunmania_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler( 0x1f640000, 0x1f6400ff, FUNC(gunmania_r), FUNC(gunmania_w) );
}
/* ADC0834 Interface */
@@ -2951,13 +2951,13 @@ static double analogue_inputs_callback( device_t *device, UINT8 input )
switch (input)
{
case ADC083X_CH0:
- return (double)( 5 * input_port_read_safe( device->machine, "analog0", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog0", 0 ) ) / 255.0;
case ADC083X_CH1:
- return (double)( 5 * input_port_read_safe( device->machine, "analog1", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog1", 0 ) ) / 255.0;
case ADC083X_CH2:
- return (double)( 5 * input_port_read_safe( device->machine, "analog2", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog2", 0 ) ) / 255.0;
case ADC083X_CH3:
- return (double)( 5 * input_port_read_safe( device->machine, "analog3", 0 ) ) / 255.0;
+ return (double)( 5 * input_port_read_safe( device->machine(), "analog3", 0 ) ) / 255.0;
case ADC083X_AGND:
return 0;
case ADC083X_VREF:
diff --git a/src/mame/drivers/kungfur.c b/src/mame/drivers/kungfur.c
index 66209107937..2434b550563 100644
--- a/src/mame/drivers/kungfur.c
+++ b/src/mame/drivers/kungfur.c
@@ -120,7 +120,7 @@ static void draw_led(bitmap_t *bitmap, int x, int y,UINT8 value)
/* actually debugging purpose, it will be converted to the artwork system at some point. */
static SCREEN_UPDATE( kungfur )
{
- kungfur_state *state = screen->machine->driver_data<kungfur_state>();
+ kungfur_state *state = screen->machine().driver_data<kungfur_state>();
// popmessage("%02x %02x %02x %02x %02x %02x",io_data[0],io_data[1],io_data[2],io_data[3],io_data[4],io_data[5]);
int i;
@@ -132,7 +132,7 @@ static SCREEN_UPDATE( kungfur )
static WRITE8_DEVICE_HANDLER( test0_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
state->mux_data = data & 7; /* multiplexer selector? (00-06) */
state->mux_data|= (data & 0x10)>>1;
@@ -147,7 +147,7 @@ static WRITE8_DEVICE_HANDLER( test1_w )
static WRITE8_DEVICE_HANDLER( test2_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
// io_data[2] = data; /* lower nibble should be NULL */
state->led[state->mux_data] = data;
// printf("%02x Unk 2 W\n",data);
@@ -162,7 +162,7 @@ static WRITE8_DEVICE_HANDLER( test3_w )
/*mux is always 0*/
static WRITE8_DEVICE_HANDLER( test4_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
// io_data[4] = data;
state->led[state->mux_data] = data;
}
@@ -177,18 +177,18 @@ static WRITE8_DEVICE_HANDLER( test5_w )
static WRITE8_DEVICE_HANDLER( kungfur_adpcm1_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
state->adpcm_pos[0] = 0x40000+(data & 0xff) * 0x100;
state->adpcm_idle[0] = 0;
- msm5205_reset_w(device->machine->device("adpcm1"),0);
+ msm5205_reset_w(device->machine().device("adpcm1"),0);
}
static WRITE8_DEVICE_HANDLER( kungfur_adpcm2_w )
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
state->adpcm_pos[1] = (data & 0xff) * 0x400;
state->adpcm_idle[1] = 0;
- msm5205_reset_w(device->machine->device("adpcm2"),0);
+ msm5205_reset_w(device->machine().device("adpcm2"),0);
}
/*
@@ -279,19 +279,19 @@ static const ppi8255_interface ppi8255_intf[2] =
static void kfr_adpcm1_int(device_t *device)
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
if (state->adpcm_pos[0] >= 0x40000 || state->adpcm_idle[0])
{
- msm5205_reset_w(device->machine->device("adpcm1"),1);
+ msm5205_reset_w(device->machine().device("adpcm1"),1);
state->trigger1 = 0;
}
else
{
- UINT8 *ROM = device->machine->region("adpcm1")->base();
+ UINT8 *ROM = device->machine().region("adpcm1")->base();
state->adpcm_data1 = ((state->trigger1 ? (ROM[state->adpcm_pos[0]] & 0x0f) : (ROM[state->adpcm_pos[0]] & 0xf0)>>4) );
- msm5205_data_w(device->machine->device("adpcm1"), state->adpcm_data1 & 0xf);
+ msm5205_data_w(device->machine().device("adpcm1"), state->adpcm_data1 & 0xf);
state->trigger1 ^= 1;
if(state->trigger1 == 0)
{
@@ -305,19 +305,19 @@ static void kfr_adpcm1_int(device_t *device)
static void kfr_adpcm2_int(device_t *device)
{
- kungfur_state *state = device->machine->driver_data<kungfur_state>();
+ kungfur_state *state = device->machine().driver_data<kungfur_state>();
if (state->adpcm_pos[1] >= 0x10000 || state->adpcm_idle[1])
{
- msm5205_reset_w(device->machine->device("adpcm2"),1);
+ msm5205_reset_w(device->machine().device("adpcm2"),1);
state->trigger2 = 0;
}
else
{
- UINT8 *ROM = device->machine->region("adpcm2")->base();
+ UINT8 *ROM = device->machine().region("adpcm2")->base();
state->adpcm_data2 = ((state->trigger2 ? (ROM[state->adpcm_pos[1]] & 0x0f) : (ROM[state->adpcm_pos[1]] & 0xf0)>>4) );
- msm5205_data_w(device->machine->device("adpcm2"), state->adpcm_data2 & 0xf);
+ msm5205_data_w(device->machine().device("adpcm2"), state->adpcm_data2 & 0xf);
state->trigger2 ^= 1;
if(state->trigger2 == 0)
{
@@ -342,14 +342,14 @@ static const msm5205_interface msm5205_config_2 =
static MACHINE_RESET( kungfur )
{
- kungfur_state *state = machine->driver_data<kungfur_state>();
+ kungfur_state *state = machine.driver_data<kungfur_state>();
state->adpcm_pos[0] = state->adpcm_pos[1] = 0;
state->adpcm_idle[0] = state->adpcm_idle[1] = 1;
}
static INTERRUPT_GEN( kungfur_irq )
{
- cputag_set_input_line(device->machine, "maincpu", M6809_IRQ_LINE, HOLD_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", M6809_IRQ_LINE, HOLD_LINE);
}
static MACHINE_CONFIG_START( kungfur, kungfur_state )
diff --git a/src/mame/drivers/kyugo.c b/src/mame/drivers/kyugo.c
index cd3852e91e8..732764a1d54 100644
--- a/src/mame/drivers/kyugo.c
+++ b/src/mame/drivers/kyugo.c
@@ -36,7 +36,7 @@
static WRITE8_HANDLER( kyugo_sub_cpu_control_w )
{
- kyugo_state *state = space->machine->driver_data<kyugo_state>();
+ kyugo_state *state = space->machine().driver_data<kyugo_state>();
device_set_input_line(state->subcpu, INPUT_LINE_HALT, data ? CLEAR_LINE : ASSERT_LINE);
}
@@ -449,10 +449,10 @@ static const ay8910_interface ay8910_config =
static MACHINE_START( kyugo )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
- state->maincpu = machine->device("maincpu");
- state->subcpu = machine->device("sub");
+ state->maincpu = machine.device("maincpu");
+ state->subcpu = machine.device("sub");
state->save_item(NAME(state->scroll_x_lo));
state->save_item(NAME(state->scroll_x_hi));
@@ -464,10 +464,10 @@ static MACHINE_START( kyugo )
static MACHINE_RESET( kyugo )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ kyugo_state *state = machine.driver_data<kyugo_state>();
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
// must start with interrupts and sub CPU disabled
- cpu_interrupt_enable(machine->device("maincpu"), 0);
+ cpu_interrupt_enable(machine.device("maincpu"), 0);
kyugo_sub_cpu_control_w(space, 0, 0);
state->scroll_x_lo = 0;
@@ -1333,19 +1333,19 @@ ROM_END
static DRIVER_INIT( gyrodine )
{
/* add watchdog */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(watchdog_reset_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe000, 0xe000, FUNC(watchdog_reset_w));
}
static DRIVER_INIT( srdmissn )
{
- kyugo_state *state = machine->driver_data<kyugo_state>();
+ kyugo_state *state = machine.driver_data<kyugo_state>();
/* shared RAM is mapped at 0xe000 as well */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xe000, 0xe7ff, state->shared_ram);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_ram(0xe000, 0xe7ff, state->shared_ram);
/* extra RAM on sub CPU */
- machine->device("sub")->memory().space(AS_PROGRAM)->install_ram(0x8800, 0x8fff);
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_ram(0x8800, 0x8fff);
}
diff --git a/src/mame/drivers/labyrunr.c b/src/mame/drivers/labyrunr.c
index 6811a0e6ab0..2df7cd79e3a 100644
--- a/src/mame/drivers/labyrunr.c
+++ b/src/mame/drivers/labyrunr.c
@@ -19,7 +19,7 @@
static INTERRUPT_GEN( labyrunr_interrupt )
{
- labyrunr_state *state = device->machine->driver_data<labyrunr_state>();
+ labyrunr_state *state = device->machine().driver_data<labyrunr_state>();
if (cpu_getiloops(device) == 0)
{
@@ -38,11 +38,11 @@ static WRITE8_HANDLER( labyrunr_bankswitch_w )
if (data & 0xe0) popmessage("bankswitch %02x", data);
/* bits 0-2 = bank number */
- memory_set_bank(space->machine, "bank1", data & 0x07); // shall we check if data&7 > #banks?
+ memory_set_bank(space->machine(), "bank1", data & 0x07); // shall we check if data&7 > #banks?
/* bits 3 and 4 are coin counters */
- coin_counter_w(space->machine, 0, data & 0x08);
- coin_counter_w(space->machine, 1, data & 0x10);
+ coin_counter_w(space->machine(), 0, data & 0x08);
+ coin_counter_w(space->machine(), 1, data & 0x10);
}
static ADDRESS_MAP_START( labyrunr_map, AS_PROGRAM, 8 )
@@ -185,12 +185,12 @@ static const ym2203_interface ym2203_interface_2 =
static MACHINE_START( labyrunr )
{
- labyrunr_state *state = machine->driver_data<labyrunr_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ labyrunr_state *state = machine.driver_data<labyrunr_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 6, &ROM[0x10000], 0x4000);
- state->k007121 = machine->device("k007121");
+ state->k007121 = machine.device("k007121");
}
static MACHINE_CONFIG_START( labyrunr, labyrunr_state )
diff --git a/src/mame/drivers/ladybug.c b/src/mame/drivers/ladybug.c
index 616a4e1b4ed..6afb4e8c8c3 100644
--- a/src/mame/drivers/ladybug.c
+++ b/src/mame/drivers/ladybug.c
@@ -67,25 +67,25 @@ TODO:
/* Sound comm between CPU's */
static READ8_HANDLER( sraider_sound_low_r )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
return state->sound_low;
}
static READ8_HANDLER( sraider_sound_high_r )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
return state->sound_high;
}
static WRITE8_HANDLER( sraider_sound_low_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->sound_low = data;
}
static WRITE8_HANDLER( sraider_sound_high_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
state->sound_high = data;
}
@@ -100,7 +100,7 @@ static READ8_HANDLER( sraider_8005_r )
/* Unknown IO */
static WRITE8_HANDLER( sraider_misc_w )
{
- ladybug_state *state = space->machine->driver_data<ladybug_state>();
+ ladybug_state *state = space->machine().driver_data<ladybug_state>();
switch(offset)
{
@@ -189,7 +189,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( coin1_inserted )
{
- ladybug_state *state = field->port->machine->driver_data<ladybug_state>();
+ ladybug_state *state = field->port->machine().driver_data<ladybug_state>();
/* left coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
@@ -197,7 +197,7 @@ static INPUT_CHANGED( coin1_inserted )
static INPUT_CHANGED( coin2_inserted )
{
- ladybug_state *state = field->port->machine->driver_data<ladybug_state>();
+ ladybug_state *state = field->port->machine().driver_data<ladybug_state>();
/* right coin insertion causes an IRQ */
if (newval)
@@ -210,7 +210,7 @@ static INPUT_CHANGED( coin2_inserted )
static CUSTOM_INPUT( ladybug_p1_control_r )
{
- return input_port_read(field->port->machine, LADYBUG_P1_CONTROL_PORT_TAG);
+ return input_port_read(field->port->machine(), LADYBUG_P1_CONTROL_PORT_TAG);
}
static CUSTOM_INPUT( ladybug_p2_control_r )
@@ -218,10 +218,10 @@ static CUSTOM_INPUT( ladybug_p2_control_r )
UINT32 ret;
/* upright cabinet only uses a single set of controls */
- if (input_port_read(field->port->machine, "DSW0") & 0x20)
- ret = input_port_read(field->port->machine, LADYBUG_P2_CONTROL_PORT_TAG);
+ if (input_port_read(field->port->machine(), "DSW0") & 0x20)
+ ret = input_port_read(field->port->machine(), LADYBUG_P2_CONTROL_PORT_TAG);
else
- ret = input_port_read(field->port->machine, LADYBUG_P1_CONTROL_PORT_TAG);
+ ret = input_port_read(field->port->machine(), LADYBUG_P1_CONTROL_PORT_TAG);
return ret;
}
@@ -724,15 +724,15 @@ GFXDECODE_END
static MACHINE_START( ladybug )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
- state->maincpu = machine->device("maincpu");
+ ladybug_state *state = machine.driver_data<ladybug_state>();
+ state->maincpu = machine.device("maincpu");
}
static MACHINE_START( sraider )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->grid_color));
state->save_item(NAME(state->sound_low));
@@ -752,7 +752,7 @@ static MACHINE_START( sraider )
static MACHINE_RESET( sraider )
{
- ladybug_state *state = machine->driver_data<ladybug_state>();
+ ladybug_state *state = machine.driver_data<ladybug_state>();
int i;
state->grid_color = 0;
@@ -1062,10 +1062,10 @@ static DRIVER_INIT( dorodon )
/* decode the opcodes */
offs_t i;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x6000);
- UINT8 *rom = machine->region("maincpu")->base();
- UINT8 *table = machine->region("user1")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *table = machine.region("user1")->base();
space->set_decrypted_region(0x0000, 0x5fff, decrypted);
diff --git a/src/mame/drivers/ladyfrog.c b/src/mame/drivers/ladyfrog.c
index 0d6e3d941a2..8e5b68967fd 100644
--- a/src/mame/drivers/ladyfrog.c
+++ b/src/mame/drivers/ladyfrog.c
@@ -56,27 +56,27 @@ Notes:
static READ8_HANDLER( from_snd_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->snd_flag = 0;
return state->snd_data;
}
static WRITE8_HANDLER( to_main_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->snd_data = data;
state->snd_flag = 2;
}
static WRITE8_HANDLER( sound_cpu_reset_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_RESET, (data & 1 ) ? ASSERT_LINE : CLEAR_LINE);
}
static TIMER_CALLBACK( nmi_callback )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
@@ -87,18 +87,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( sound_command_w )
{
soundlatch_w(space, 0, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( nmi_disable_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( nmi_enable_w )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -130,7 +130,7 @@ static const msm5232_interface msm5232_config =
static READ8_HANDLER( snd_flag_r )
{
- ladyfrog_state *state = space->machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = space->machine().driver_data<ladyfrog_state>();
return state->snd_flag | 0xfd;
}
@@ -285,9 +285,9 @@ GFXDECODE_END
static MACHINE_START( ladyfrog )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->tilebank));
state->save_item(NAME(state->palette_bank));
@@ -299,7 +299,7 @@ static MACHINE_START( ladyfrog )
static MACHINE_RESET( ladyfrog )
{
- ladyfrog_state *state = machine->driver_data<ladyfrog_state>();
+ ladyfrog_state *state = machine.driver_data<ladyfrog_state>();
state->tilebank = 0;
state->palette_bank = 0;
diff --git a/src/mame/drivers/laserbas.c b/src/mame/drivers/laserbas.c
index abe1a506380..fc3afaf72ba 100644
--- a/src/mame/drivers/laserbas.c
+++ b/src/mame/drivers/laserbas.c
@@ -38,7 +38,7 @@ public:
static VIDEO_START(laserbas)
{
- laserbas_state *state = machine->driver_data<laserbas_state>();
+ laserbas_state *state = machine.driver_data<laserbas_state>();
state->save_item(NAME(state->vram1));
state->save_item(NAME(state->vram2));
@@ -46,7 +46,7 @@ static VIDEO_START(laserbas)
static SCREEN_UPDATE(laserbas)
{
- laserbas_state *state = screen->machine->driver_data<laserbas_state>();
+ laserbas_state *state = screen->machine().driver_data<laserbas_state>();
int x, y;
for (y = 0; y < 256; y++)
@@ -67,7 +67,7 @@ static SCREEN_UPDATE(laserbas)
static READ8_HANDLER(vram_r)
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
if(!state->vrambank)
return state->vram1[offset];
@@ -77,7 +77,7 @@ static READ8_HANDLER(vram_r)
static WRITE8_HANDLER(vram_w)
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
if(!state->vrambank)
state->vram1[offset] = data;
@@ -87,7 +87,7 @@ static WRITE8_HANDLER(vram_w)
static READ8_HANDLER( read_unk )
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
state->count ^= 0x80;
return state->count | 0x7f;
@@ -95,12 +95,12 @@ static READ8_HANDLER( read_unk )
static WRITE8_HANDLER(palette_w)
{
- palette_set_color_rgb(space->machine, offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data));
+ palette_set_color_rgb(space->machine(), offset, pal3bit(data >> 5), pal3bit(data >> 2), pal2bit(data));
}
static WRITE8_HANDLER(vrambank_w)
{
- laserbas_state *state = space->machine->driver_data<laserbas_state>();
+ laserbas_state *state = space->machine().driver_data<laserbas_state>();
if ((offset & 0xf1) == 0x10)
state->vrambank = data & 0x40;
@@ -146,7 +146,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( laserbas_interrupt )
{
- if(device->machine->primary_screen->vblank())
+ if(device->machine().primary_screen->vblank())
device_set_input_line(device, 0, HOLD_LINE);
else
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -154,7 +154,7 @@ static INTERRUPT_GEN( laserbas_interrupt )
static MACHINE_START( laserbas )
{
- laserbas_state *state = machine->driver_data<laserbas_state>();
+ laserbas_state *state = machine.driver_data<laserbas_state>();
state->save_item(NAME(state->vrambank));
state->save_item(NAME(state->count));
@@ -162,7 +162,7 @@ static MACHINE_START( laserbas )
static MACHINE_RESET( laserbas )
{
- laserbas_state *state = machine->driver_data<laserbas_state>();
+ laserbas_state *state = machine.driver_data<laserbas_state>();
state->vrambank = 0;
state->count = 0;
diff --git a/src/mame/drivers/laserbat.c b/src/mame/drivers/laserbat.c
index 0e184377a72..d802e2c7e7a 100644
--- a/src/mame/drivers/laserbat.c
+++ b/src/mame/drivers/laserbat.c
@@ -29,7 +29,7 @@ TODO:
static WRITE8_HANDLER( laserbat_videoram_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
if (state->video_page == 0)
{
@@ -45,7 +45,7 @@ static WRITE8_HANDLER( laserbat_videoram_w )
static WRITE8_HANDLER( video_extra_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
state->video_page = (data & 0x10) >> 4;
state->sprite_enable = (data & 1) ^ 1;
@@ -55,7 +55,7 @@ static WRITE8_HANDLER( video_extra_w )
static WRITE8_HANDLER( sprite_x_y_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
if (offset == 0)
state->sprite_x = 256 - data;
@@ -65,13 +65,13 @@ static WRITE8_HANDLER( sprite_x_y_w )
static WRITE8_HANDLER( laserbat_input_mux_w )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
state->input_mux = (data & 0x30) >> 4;
- flip_screen_set_no_update(space->machine, data & 0x08);
+ flip_screen_set_no_update(space->machine(), data & 0x08);
- coin_counter_w(space->machine, 0,data & 1);
+ coin_counter_w(space->machine(), 0,data & 1);
//data & 0x02 ?
//data & 0x04 ?
@@ -79,10 +79,10 @@ static WRITE8_HANDLER( laserbat_input_mux_w )
static READ8_HANDLER( laserbat_input_r )
{
- laserbat_state *state = space->machine->driver_data<laserbat_state>();
+ laserbat_state *state = space->machine().driver_data<laserbat_state>();
static const char *const portnames[] = { "IN0", "IN1", "IN2", "IN3" };
- return input_port_read(space->machine, portnames[state->input_mux]);
+ return input_port_read(space->machine(), portnames[state->input_mux]);
}
static WRITE8_HANDLER( laserbat_cnteff_w )
@@ -487,7 +487,7 @@ GFXDECODE_END
static TILE_GET_INFO( get_tile_info )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
+ laserbat_state *state = machine.driver_data<laserbat_state>();
// wrong color index!
SET_TILE_INFO(0, state->videoram[tile_index], state->colorram[tile_index] & 0x7f, 0);
@@ -495,7 +495,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( laserbat )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
+ laserbat_state *state = machine.driver_data<laserbat_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -505,7 +505,7 @@ static VIDEO_START( laserbat )
static SCREEN_UPDATE( laserbat )
{
- laserbat_state *state = screen->machine->driver_data<laserbat_state>();
+ laserbat_state *state = screen->machine().driver_data<laserbat_state>();
int y;
bitmap_t *s2636_1_bitmap;
bitmap_t *s2636_2_bitmap;
@@ -541,7 +541,7 @@ static SCREEN_UPDATE( laserbat )
}
if (state->sprite_enable)
- drawgfx_transpen(bitmap,cliprect,screen->machine->gfx[1],
+ drawgfx_transpen(bitmap,cliprect,screen->machine().gfx[1],
state->sprite_code,
state->sprite_color,
0,0,
@@ -583,32 +583,32 @@ static const sn76477_interface laserbat_sn76477_interface =
static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0a )
{
- laserbat_state *laserbat = device->machine->driver_data<laserbat_state>();
+ laserbat_state *laserbat = device->machine().driver_data<laserbat_state>();
device_set_input_line(laserbat->audiocpu, INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( zaccaria_irq0b )
{
- laserbat_state *laserbat = device->machine->driver_data<laserbat_state>();
+ laserbat_state *laserbat = device->machine().driver_data<laserbat_state>();
device_set_input_line(laserbat->audiocpu, 0, state ? ASSERT_LINE : CLEAR_LINE);
}
static READ8_DEVICE_HANDLER( zaccaria_port0a_r )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
device_t *ay = (state->active_8910 == 0) ? state->ay1 : state->ay2;
return ay8910_r(ay, 0);
}
static WRITE8_DEVICE_HANDLER( zaccaria_port0a_w )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
state->port0a = data;
}
static WRITE8_DEVICE_HANDLER( zaccaria_port0b_w )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
/* bit 1 goes to 8910 #0 BDIR pin */
if ((state->last_port0b & 0x02) == 0x02 && (data & 0x02) == 0x00)
{
@@ -671,7 +671,7 @@ static INTERRUPT_GEN( laserbat_interrupt )
static INTERRUPT_GEN( zaccaria_cb1_toggle )
{
- laserbat_state *state = device->machine->driver_data<laserbat_state>();
+ laserbat_state *state = device->machine().driver_data<laserbat_state>();
pia6821_cb1_w(state->pia, state->cb1_toggle & 1);
state->cb1_toggle ^= 1;
@@ -704,18 +704,18 @@ static const s2636_interface s2636_3_config =
static MACHINE_START( laserbat )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
-
- state->audiocpu = machine->device("audiocpu");
- state->s2636_1 = machine->device("s2636_1");
- state->s2636_2 = machine->device("s2636_2");
- state->s2636_3 = machine->device("s2636_3");
- state->pia = machine->device("pia");
- state->sn = machine->device("snsnd");
- state->tms1 = machine->device("tms1");
- state->tms2 = machine->device("tms2");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
+ laserbat_state *state = machine.driver_data<laserbat_state>();
+
+ state->audiocpu = machine.device("audiocpu");
+ state->s2636_1 = machine.device("s2636_1");
+ state->s2636_2 = machine.device("s2636_2");
+ state->s2636_3 = machine.device("s2636_3");
+ state->pia = machine.device("pia");
+ state->sn = machine.device("snsnd");
+ state->tms1 = machine.device("tms1");
+ state->tms2 = machine.device("tms2");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
state->save_item(NAME(state->video_page));
state->save_item(NAME(state->input_mux));
@@ -741,7 +741,7 @@ static MACHINE_START( laserbat )
static MACHINE_RESET( laserbat )
{
- laserbat_state *state = machine->driver_data<laserbat_state>();
+ laserbat_state *state = machine.driver_data<laserbat_state>();
state->video_page = 0;
state->input_mux = 0;
diff --git a/src/mame/drivers/lasso.c b/src/mame/drivers/lasso.c
index 9ae0b59a119..d73c6b07d18 100644
--- a/src/mame/drivers/lasso.c
+++ b/src/mame/drivers/lasso.c
@@ -38,7 +38,7 @@ DIP locations verified for:
static INPUT_CHANGED( coin_inserted )
{
- lasso_state *state = field->port->machine->driver_data<lasso_state>();
+ lasso_state *state = field->port->machine().driver_data<lasso_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
@@ -48,14 +48,14 @@ static INPUT_CHANGED( coin_inserted )
/* Write to the sound latch and generate an IRQ on the sound CPU */
static WRITE8_HANDLER( sound_command_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
soundlatch_w(space, offset, data);
generic_pulse_irq_line(state->audiocpu, 0);
}
static WRITE8_HANDLER( pinbo_sound_command_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
soundlatch_w(space, offset, data);
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -68,7 +68,7 @@ static READ8_HANDLER( sound_status_r )
static WRITE8_HANDLER( sound_select_w )
{
- lasso_state *state = space->machine->driver_data<lasso_state>();
+ lasso_state *state = space->machine().driver_data<lasso_state>();
UINT8 to_write = BITSWAP8(*state->chip_data, 0, 1, 2, 3, 4, 5, 6, 7);
if (~data & 0x01) /* chip #0 */
@@ -464,19 +464,19 @@ GFXDECODE_END
static MACHINE_START( lasso )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->sn_1 = machine->device("sn76489.1");
- state->sn_2 = machine->device("sn76489.2");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->sn_1 = machine.device("sn76489.1");
+ state->sn_2 = machine.device("sn76489.2");
state->save_item(NAME(state->gfxbank));
}
static MACHINE_START( wwjgtin )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
MACHINE_START_CALL(lasso);
@@ -485,14 +485,14 @@ static MACHINE_START( wwjgtin )
static MACHINE_RESET( lasso )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
state->gfxbank = 0;
}
static MACHINE_RESET( wwjgtin )
{
- lasso_state *state = machine->driver_data<lasso_state>();
+ lasso_state *state = machine.driver_data<lasso_state>();
MACHINE_RESET_CALL(lasso);
diff --git a/src/mame/drivers/lastduel.c b/src/mame/drivers/lastduel.c
index d6ee1d24895..e5a73f6a977 100644
--- a/src/mame/drivers/lastduel.c
+++ b/src/mame/drivers/lastduel.c
@@ -176,7 +176,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( mg_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static ADDRESS_MAP_START( madgear_sound_map, AS_PROGRAM, 8 )
@@ -442,7 +442,7 @@ GFXDECODE_END
/* handler called by the 2203 emulator when the internal timers cause an IRQ */
static void irqhandler( device_t *device, int irq )
{
- lastduel_state *state = device->machine->driver_data<lastduel_state>();
+ lastduel_state *state = device->machine().driver_data<lastduel_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -474,9 +474,9 @@ static INTERRUPT_GEN( madgear_interrupt )
static MACHINE_START( lastduel )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->tilemap_priority));
state->save_item(NAME(state->scroll));
@@ -484,7 +484,7 @@ static MACHINE_START( lastduel )
static MACHINE_START( madgear )
{
- UINT8 *ROM = machine->region("audiocpu")->base();
+ UINT8 *ROM = machine.region("audiocpu")->base();
memory_configure_bank(machine, "bank1", 0, 2, &ROM[0x10000], 0x4000);
@@ -493,7 +493,7 @@ static MACHINE_START( madgear )
static MACHINE_RESET( lastduel )
{
- lastduel_state *state = machine->driver_data<lastduel_state>();
+ lastduel_state *state = machine.driver_data<lastduel_state>();
int i;
state->tilemap_priority = 0;
diff --git a/src/mame/drivers/lastfght.c b/src/mame/drivers/lastfght.c
index 8a55f37578b..032932b2309 100644
--- a/src/mame/drivers/lastfght.c
+++ b/src/mame/drivers/lastfght.c
@@ -99,10 +99,10 @@ public:
static VIDEO_START( lastfght )
{
- lastfght_state *state = machine->driver_data<lastfght_state>();
+ lastfght_state *state = machine.driver_data<lastfght_state>();
int i;
for (i = 0; i < 2; i++)
- state->bitmap[i] = machine->primary_screen->alloc_compatible_bitmap();
+ state->bitmap[i] = machine.primary_screen->alloc_compatible_bitmap();
state->save_item(NAME(*state->bitmap[0]));
state->save_item(NAME(*state->bitmap[1]));
@@ -112,30 +112,30 @@ static VIDEO_START( lastfght )
static SCREEN_UPDATE( lastfght )
{
- lastfght_state *state = screen->machine->driver_data<lastfght_state>();
+ lastfght_state *state = screen->machine().driver_data<lastfght_state>();
#ifdef MAME_DEBUG
#if 1
// gfx roms viewer (toggle with enter, use pgup/down to browse)
int x, y, count = 0;
- UINT8 *gfxdata = screen->machine->region("gfx1")->base();
+ UINT8 *gfxdata = screen->machine().region("gfx1")->base();
UINT8 data;
- if (input_code_pressed_once(screen->machine, KEYCODE_ENTER)) state->view_roms ^= 1;
+ if (input_code_pressed_once(screen->machine(), KEYCODE_ENTER)) state->view_roms ^= 1;
if (state->view_roms)
{
- if (input_code_pressed_once(screen->machine, KEYCODE_PGDN)) state->base += 512 * 256;
- if (input_code_pressed_once(screen->machine, KEYCODE_PGUP)) state->base -= 512 * 256;
- state->base %= screen->machine->region("gfx1")->bytes();
+ if (input_code_pressed_once(screen->machine(), KEYCODE_PGDN)) state->base += 512 * 256;
+ if (input_code_pressed_once(screen->machine(), KEYCODE_PGUP)) state->base -= 512 * 256;
+ state->base %= screen->machine().region("gfx1")->bytes();
count = state->base;
- bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect , get_black_pen(screen->machine()));
for (y = 0 ; y < 256; y++)
{
for (x = 0; x < 512; x++)
{
- data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen->machine) : gfxdata[count]; // white grid or data
+ data = (((count & 0xf) == 0) && ((count & 0x1e00) == 0)) ? get_white_pen(screen->machine()) : gfxdata[count]; // white grid or data
*BITMAP_ADDR16(bitmap, y, x) = data;
count++;
}
@@ -155,12 +155,12 @@ static SCREEN_UPDATE( lastfght )
static WRITE16_HANDLER( colordac_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_0_7)
{
state->colorram[state->clr_offset] = data;
- palette_set_color_rgb(space->machine, state->clr_offset / 3,
+ palette_set_color_rgb(space->machine(), state->clr_offset / 3,
pal6bit(state->colorram[(state->clr_offset / 3) * 3 + 0]),
pal6bit(state->colorram[(state->clr_offset / 3) * 3 + 1]),
pal6bit(state->colorram[(state->clr_offset / 3) * 3 + 2])
@@ -178,7 +178,7 @@ static WRITE16_HANDLER( colordac_w )
// high byte of a 16 bit register
static WRITE16_HANDLER( lastfght_hi_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
logerror("%06x: 600000.b = %02x\n", cpu_get_pc(space->cpu), data >> 8);
@@ -192,7 +192,7 @@ static WRITE16_HANDLER( lastfght_hi_w )
// screen x
static WRITE16_HANDLER( lastfght_x_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
logerror("%06x: 800008.b = %02x\n", cpu_get_pc(space->cpu), data >> 8);
@@ -206,7 +206,7 @@ static WRITE16_HANDLER( lastfght_x_w )
// screen y, screen width - 1
static WRITE16_HANDLER( lastfght_yw_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -223,7 +223,7 @@ static WRITE16_HANDLER( lastfght_yw_w )
// screen height - 1
static WRITE16_HANDLER( lastfght_h_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -237,7 +237,7 @@ static WRITE16_HANDLER( lastfght_h_w )
// source delta x << 6, source x << 6
static WRITE16_HANDLER( lastfght_sx_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -254,7 +254,7 @@ static WRITE16_HANDLER( lastfght_sx_w )
// source y << 6, source y1 << 6
static WRITE16_HANDLER( lastfght_sy_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -271,7 +271,7 @@ static WRITE16_HANDLER( lastfght_sy_w )
// source rom (0x200000 bytes), source page (512x256 bytes)
static WRITE16_HANDLER( lastfght_sr_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -288,7 +288,7 @@ static WRITE16_HANDLER( lastfght_sr_w )
// source x1 << 6, source delta y << 6
static WRITE16_HANDLER( lastfght_sd_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
@@ -305,12 +305,12 @@ static WRITE16_HANDLER( lastfght_sd_w )
// start blit
static WRITE16_HANDLER( lastfght_blit_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_8_15)
{
int x, y, addr;
- UINT8 *gfxdata = space->machine->region( "gfx1" )->base();
+ UINT8 *gfxdata = space->machine().region( "gfx1" )->base();
bitmap_t *dest = state->bitmap[state->dest];
#if 0
@@ -344,7 +344,7 @@ static WRITE16_HANDLER( lastfght_blit_w )
// toggle framebuffer
static WRITE16_HANDLER( lastfght_dest_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
if (ACCESSING_BITS_0_7)
state->dest ^= 1;
@@ -363,12 +363,12 @@ static READ16_HANDLER( lastfght_c00002_r )
{
// high byte:
// mask 0x1c: from sound?
- return (space->machine->rand() & 0x1c00) | input_port_read(space->machine, "IN0");
+ return (space->machine().rand() & 0x1c00) | input_port_read(space->machine(), "IN0");
}
static READ16_HANDLER( lastfght_c00004_r )
{
- return input_port_read(space->machine, "IN1");
+ return input_port_read(space->machine(), "IN1");
}
static READ16_HANDLER( lastfght_c00006_r )
@@ -376,12 +376,12 @@ static READ16_HANDLER( lastfght_c00006_r )
// low byte:
// bit 7 = protection?
// bit 5 = blitter?
- return input_port_read(space->machine, "IN2");
+ return input_port_read(space->machine(), "IN2");
}
static WRITE16_HANDLER( lastfght_c00006_w )
{
- lastfght_state *state = space->machine->driver_data<lastfght_state>();
+ lastfght_state *state = space->machine().driver_data<lastfght_state>();
COMBINE_DATA(&state->c00006);
// popmessage("%04x", state->c00006);
}
@@ -508,7 +508,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( unknown_interrupt )
{
- lastfght_state *state = device->machine->driver_data<lastfght_state>();
+ lastfght_state *state = device->machine().driver_data<lastfght_state>();
switch (cpu_getiloops(device))
{
case 0:
@@ -522,9 +522,9 @@ static INTERRUPT_GEN( unknown_interrupt )
static MACHINE_START( lastfght )
{
- lastfght_state *state = machine->driver_data<lastfght_state>();
+ lastfght_state *state = machine.driver_data<lastfght_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->clr_offset));
state->save_item(NAME(state->dest));
@@ -546,7 +546,7 @@ static MACHINE_START( lastfght )
static MACHINE_RESET( lastfght )
{
- lastfght_state *state = machine->driver_data<lastfght_state>();
+ lastfght_state *state = machine.driver_data<lastfght_state>();
state->clr_offset = 0;
state->dest = 0;
@@ -612,7 +612,7 @@ ROM_END
static DRIVER_INIT(lastfght)
{
- UINT16 *rom = (UINT16*)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16*)machine.region("maincpu")->base();
// pass initial check (protection ? hw?)
rom[0x00354 / 2] = 0x403e;
diff --git a/src/mame/drivers/lazercmd.c b/src/mame/drivers/lazercmd.c
index 8915dceb195..1e7cc238573 100644
--- a/src/mame/drivers/lazercmd.c
+++ b/src/mame/drivers/lazercmd.c
@@ -239,7 +239,7 @@
static INTERRUPT_GEN( lazercmd_timer )
{
- lazercmd_state *state = device->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = device->machine().driver_data<lazercmd_state>();
if (++state->timer_count >= 64 * 128)
{
@@ -251,7 +251,7 @@ static INTERRUPT_GEN( lazercmd_timer )
static INTERRUPT_GEN( bbonk_timer )
{
- lazercmd_state *state = device->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = device->machine().driver_data<lazercmd_state>();
if (++state->timer_count >= 64 * 128)
state->timer_count = 0;
@@ -283,13 +283,13 @@ static WRITE8_HANDLER( lazercmd_data_port_w )
/* triggered by REDD,r opcode */
static READ8_HANDLER( lazercmd_data_port_r )
{
- UINT8 data = input_port_read(space->machine, "DSW") & 0x0f;
+ UINT8 data = input_port_read(space->machine(), "DSW") & 0x0f;
return data;
}
static WRITE8_HANDLER( lazercmd_hardware_w )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
switch (offset)
{
@@ -313,7 +313,7 @@ static WRITE8_HANDLER( lazercmd_hardware_w )
static WRITE8_HANDLER( medlanes_hardware_w )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
switch (offset)
{
@@ -340,7 +340,7 @@ static WRITE8_HANDLER( medlanes_hardware_w )
static WRITE8_HANDLER( bbonk_hardware_w )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
switch (offset)
{
@@ -361,22 +361,22 @@ static WRITE8_HANDLER( bbonk_hardware_w )
static READ8_HANDLER( lazercmd_hardware_r )
{
- lazercmd_state *state = space->machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = space->machine().driver_data<lazercmd_state>();
UINT8 data = 0;
switch (offset)
{
case 0: /* player 1 joysticks */
- data = input_port_read(space->machine, "IN0");
+ data = input_port_read(space->machine(), "IN0");
break;
case 1: /* player 2 joysticks */
- data = input_port_read(space->machine, "IN1");
+ data = input_port_read(space->machine(), "IN1");
break;
case 2: /* player 1 + 2 buttons */
- data = input_port_read(space->machine, "IN3");
+ data = input_port_read(space->machine(), "IN3");
break;
case 3: /* coin slot + start buttons */
- data = input_port_read(space->machine, "IN2");
+ data = input_port_read(space->machine(), "IN2");
break;
case 4: /* vertical scan counter */
data = ((state->timer_count & 0x10) >> 1) | ((state->timer_count & 0x20) >> 3)
@@ -601,9 +601,9 @@ static PALETTE_INIT( lazercmd )
static MACHINE_START( lazercmd )
{
- lazercmd_state *state = machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = machine.driver_data<lazercmd_state>();
- state->dac = machine->device("dac");
+ state->dac = machine.device("dac");
state->save_item(NAME(state->marker_x));
state->save_item(NAME(state->marker_y));
@@ -614,7 +614,7 @@ static MACHINE_START( lazercmd )
static MACHINE_RESET( lazercmd )
{
- lazercmd_state *state = machine->driver_data<lazercmd_state>();
+ lazercmd_state *state = machine.driver_data<lazercmd_state>();
state->marker_x = 0;
state->marker_y = 0;
@@ -789,7 +789,7 @@ ROM_END
static DRIVER_INIT( lazercmd )
{
int i, y;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -818,7 +818,7 @@ static DRIVER_INIT( lazercmd )
static DRIVER_INIT( medlanes )
{
int i, y;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
@@ -847,7 +847,7 @@ static DRIVER_INIT( medlanes )
static DRIVER_INIT( bbonk )
{
int i, y;
- UINT8 *gfx = machine->region("gfx1")->base();
+ UINT8 *gfx = machine.region("gfx1")->base();
/******************************************************************
* To show the maze bit #6 and #7 of the video ram are used.
diff --git a/src/mame/drivers/legionna.c b/src/mame/drivers/legionna.c
index a301b0483a0..52579a3014c 100644
--- a/src/mame/drivers/legionna.c
+++ b/src/mame/drivers/legionna.c
@@ -128,7 +128,7 @@ ADDRESS_MAP_END
static WRITE16_HANDLER( denjin_paletteram16_xBBBBBGGGGGRRRRR_word_w )
{
offset^=1;
- COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
paletteram16_xBBBBBGGGGGRRRRR_word_w(space,offset,data,mem_mask);
}
@@ -897,7 +897,7 @@ static const gfx_layout legionna_new_charlayout =
};
-static void descramble_legionnaire_gfx(running_machine *machine, UINT8* src)
+static void descramble_legionnaire_gfx(running_machine &machine, UINT8* src)
{
UINT8 *buffer;
int len = 0x10000;
@@ -2169,7 +2169,7 @@ ROM_END
static DRIVER_INIT( cupsoc )
{
#if CUPSOC_DEBUG_MODE
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
/*Press p1 button 3 to enter into debug mode during gameplay*/
ROM[0xffffb/2] = 0x0000;
@@ -2181,13 +2181,13 @@ static DRIVER_INIT( cupsoc )
static DRIVER_INIT( denjinmk )
{
/* problem with audio comms? */
- UINT16 *ROM = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *ROM = (UINT16 *)machine.region("maincpu")->base();
ROM[0x5fe4/2] = 0x4e71;
}
static DRIVER_INIT( legiongfx )
{
- descramble_legionnaire_gfx( machine, machine->region("gfx5")->base() );
+ descramble_legionnaire_gfx( machine, machine.region("gfx5")->base() );
}
diff --git a/src/mame/drivers/leland.c b/src/mame/drivers/leland.c
index 1cd94ed35e2..9ab62e9e20a 100644
--- a/src/mame/drivers/leland.c
+++ b/src/mame/drivers/leland.c
@@ -1978,38 +1978,38 @@ ROM_END
*
*************************************/
-static void init_master_ports(running_machine *machine, UINT8 mvram_base, UINT8 io_base)
+static void init_master_ports(running_machine &machine, UINT8 mvram_base, UINT8 io_base)
{
/* set up the master CPU VRAM I/O */
- machine->device("master")->memory().space(AS_IO)->install_legacy_readwrite_handler(mvram_base, mvram_base + 0x1f, FUNC(leland_mvram_port_r), FUNC(leland_mvram_port_w));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_readwrite_handler(mvram_base, mvram_base + 0x1f, FUNC(leland_mvram_port_r), FUNC(leland_mvram_port_w));
/* set up the master CPU I/O ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(io_base, io_base + 0x1f, FUNC(leland_master_input_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_write_handler(io_base, io_base + 0x0f, FUNC(leland_master_output_w));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(io_base, io_base + 0x1f, FUNC(leland_master_input_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_write_handler(io_base, io_base + 0x0f, FUNC(leland_master_output_w));
}
static DRIVER_INIT( cerberus )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = cerberus_bankswitch;
- memory_set_bankptr(machine, "bank1", machine->region("master")->base() + 0x2000);
- memory_set_bankptr(machine, "bank2", machine->region("master")->base() + 0xa000);
- memory_set_bankptr(machine, "bank3", machine->region("slave")->base() + 0x2000);
+ memory_set_bankptr(machine, "bank1", machine.region("master")->base() + 0x2000);
+ memory_set_bankptr(machine, "bank2", machine.region("master")->base() + 0xa000);
+ memory_set_bankptr(machine, "bank3", machine.region("slave")->base() + 0x2000);
/* set up the master CPU I/O ports */
init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x80, 0x80, FUNC(cerberus_dial_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x90, 0x90, FUNC(cerberus_dial_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x80, 0x80, FUNC(cerberus_dial_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0x90, 0x90, FUNC(cerberus_dial_2_r));
}
static DRIVER_INIT( mayhem )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2020,7 +2020,7 @@ static DRIVER_INIT( mayhem )
static DRIVER_INIT( powrplay )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2031,7 +2031,7 @@ static DRIVER_INIT( powrplay )
static DRIVER_INIT( wseries )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2042,7 +2042,7 @@ static DRIVER_INIT( wseries )
static DRIVER_INIT( alleymas )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2052,13 +2052,13 @@ static DRIVER_INIT( alleymas )
/* kludge warning: the game uses location E0CA to determine if the joysticks are available */
/* it gets cleared by the code, but there is no obvious way for the value to be set to a */
/* non-zero value. If the value is zero, the joystick is never read. */
- state->alleymas_kludge_mem = machine->device("master")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0ca, 0xe0ca, FUNC(alleymas_joystick_kludge));
+ state->alleymas_kludge_mem = machine.device("master")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xe0ca, 0xe0ca, FUNC(alleymas_joystick_kludge));
}
static DRIVER_INIT( upyoural )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = mayhem_bankswitch;
@@ -2069,7 +2069,7 @@ static DRIVER_INIT( upyoural )
static DRIVER_INIT( dangerz )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = dangerz_bankswitch;
@@ -2077,15 +2077,15 @@ static DRIVER_INIT( dangerz )
init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf4, 0xf4, FUNC(dangerz_input_upper_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(dangerz_input_y_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfc, 0xfc, FUNC(dangerz_input_x_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf4, 0xf4, FUNC(dangerz_input_upper_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(dangerz_input_y_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfc, 0xfc, FUNC(dangerz_input_x_r));
}
static DRIVER_INIT( basebal2 )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = basebal2_bankswitch;
@@ -2096,7 +2096,7 @@ static DRIVER_INIT( basebal2 )
static DRIVER_INIT( dblplay )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = basebal2_bankswitch;
@@ -2107,7 +2107,7 @@ static DRIVER_INIT( dblplay )
static DRIVER_INIT( strkzone )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = basebal2_bankswitch;
@@ -2118,7 +2118,7 @@ static DRIVER_INIT( strkzone )
static DRIVER_INIT( redlin2p )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = redline_bankswitch;
@@ -2128,16 +2128,16 @@ static DRIVER_INIT( redlin2p )
init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xc0, 0xc0, FUNC(redline_pedal_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xd0, 0xd0, FUNC(redline_pedal_2_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(redline_wheel_2_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(redline_wheel_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xc0, 0xc0, FUNC(redline_pedal_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xd0, 0xd0, FUNC(redline_pedal_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(redline_wheel_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(redline_wheel_1_r));
}
static DRIVER_INIT( quarterb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2150,7 +2150,7 @@ static DRIVER_INIT( quarterb )
static DRIVER_INIT( viper )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2162,15 +2162,15 @@ static DRIVER_INIT( viper )
init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xa4, 0xa4, FUNC(dangerz_input_upper_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xb8, 0xb8, FUNC(dangerz_input_y_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xbc, 0xbc, FUNC(dangerz_input_x_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xa4, 0xa4, FUNC(dangerz_input_upper_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xb8, 0xb8, FUNC(dangerz_input_y_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xbc, 0xbc, FUNC(dangerz_input_x_r));
}
static DRIVER_INIT( teamqb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2182,14 +2182,14 @@ static DRIVER_INIT( teamqb )
init_master_ports(machine, 0x40, 0x80);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( aafb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2201,14 +2201,14 @@ static DRIVER_INIT( aafb )
init_master_ports(machine, 0x00, 0xc0);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( aafbb )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2220,14 +2220,14 @@ static DRIVER_INIT( aafbb )
init_master_ports(machine, 0x80, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( aafbd2p )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = viper_bankswitch;
@@ -2239,14 +2239,14 @@ static DRIVER_INIT( aafbd2p )
init_master_ports(machine, 0x00, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7c, 0x7c, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN5");
}
static DRIVER_INIT( offroad )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = offroad_bankswitch;
@@ -2259,15 +2259,15 @@ static DRIVER_INIT( offroad )
init_master_ports(machine, 0x40, 0x80); /* yes, this is intentional */
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
}
static DRIVER_INIT( offroadt )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = offroad_bankswitch;
@@ -2279,15 +2279,15 @@ static DRIVER_INIT( offroadt )
init_master_ports(machine, 0x80, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
- machine->device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf8, 0xf8, FUNC(offroad_wheel_3_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xf9, 0xf9, FUNC(offroad_wheel_1_r));
+ machine.device("master")->memory().space(AS_IO)->install_legacy_read_handler(0xfb, 0xfb, FUNC(offroad_wheel_2_r));
}
static DRIVER_INIT( pigout )
{
- leland_state *state = machine->driver_data<leland_state>();
+ leland_state *state = machine.driver_data<leland_state>();
/* master CPU bankswitching */
state->update_master_bank = offroad_bankswitch;
@@ -2299,7 +2299,7 @@ static DRIVER_INIT( pigout )
init_master_ports(machine, 0x00, 0x40);
/* set up additional input ports */
- machine->device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN4");
+ machine.device("master")->memory().space(AS_IO)->install_read_port(0x7f, 0x7f, "IN4");
}
diff --git a/src/mame/drivers/lemmings.c b/src/mame/drivers/lemmings.c
index eacaf7b4c08..9856992f472 100644
--- a/src/mame/drivers/lemmings.c
+++ b/src/mame/drivers/lemmings.c
@@ -24,7 +24,7 @@
static WRITE16_HANDLER( lemmings_control_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
/* Offset==0 Pixel layer X scroll */
if (offset == 4)
@@ -36,10 +36,10 @@ static READ16_HANDLER( lemmings_trackball_r )
{
switch (offset)
{
- case 0: return input_port_read(space->machine, "AN0");
- case 1: return input_port_read(space->machine, "AN1");
- case 4: return input_port_read(space->machine, "AN2");
- case 5: return input_port_read(space->machine, "AN3");
+ case 0: return input_port_read(space->machine(), "AN0");
+ case 1: return input_port_read(space->machine(), "AN1");
+ case 4: return input_port_read(space->machine(), "AN2");
+ case 5: return input_port_read(space->machine(), "AN3");
}
return 0;
}
@@ -50,13 +50,13 @@ static READ16_HANDLER( lemmings_prot_r )
switch (offset << 1)
{
case 0x41a:
- return input_port_read(space->machine, "BUTTONS");
+ return input_port_read(space->machine(), "BUTTONS");
case 0x320:
- return input_port_read(space->machine, "SYSTEM");
+ return input_port_read(space->machine(), "SYSTEM");
case 0x4e6:
- return input_port_read(space->machine, "DSW");
+ return input_port_read(space->machine(), "DSW");
}
return 0;
@@ -64,7 +64,7 @@ static READ16_HANDLER( lemmings_prot_r )
static WRITE16_HANDLER( lemmings_palette_24bit_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
int r, g, b;
COMBINE_DATA(&state->paletteram[offset]);
@@ -75,19 +75,19 @@ static WRITE16_HANDLER( lemmings_palette_24bit_w )
g = (state->paletteram[offset + 1] >> 8) & 0xff;
r = (state->paletteram[offset + 1] >> 0) & 0xff;
- palette_set_color(space->machine, offset / 2, MAKE_RGB(r, g, b));
+ palette_set_color(space->machine(), offset / 2, MAKE_RGB(r, g, b));
}
static WRITE16_HANDLER( lemmings_sound_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
soundlatch_w(space, 0, data & 0xff);
device_set_input_line(state->audiocpu, 1, HOLD_LINE);
}
static WRITE8_HANDLER( lemmings_sound_ack_w )
{
- lemmings_state *state = space->machine->driver_data<lemmings_state>();
+ lemmings_state *state = space->machine().driver_data<lemmings_state>();
device_set_input_line(state->audiocpu, 1, CLEAR_LINE);
}
@@ -246,7 +246,7 @@ GFXDECODE_END
static void sound_irq( device_t *device, int state )
{
- lemmings_state *lemmings = device->machine->driver_data<lemmings_state>();
+ lemmings_state *lemmings = device->machine().driver_data<lemmings_state>();
device_set_input_line(lemmings->audiocpu, 0, state);
}
@@ -257,9 +257,9 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( lemmings )
{
- lemmings_state *state = machine->driver_data<lemmings_state>();
+ lemmings_state *state = machine.driver_data<lemmings_state>();
- state->audiocpu = machine->device("audiocpu");
+ state->audiocpu = machine.device("audiocpu");
}
static MACHINE_CONFIG_START( lemmings, lemmings_state )
diff --git a/src/mame/drivers/lethal.c b/src/mame/drivers/lethal.c
index dd7a15b2b3d..ed922b7cbaa 100644
--- a/src/mame/drivers/lethal.c
+++ b/src/mame/drivers/lethal.c
@@ -178,8 +178,8 @@ maybe some priority issues / sprite placement issues..
static const char *const gunnames[] = { "LIGHT0_X", "LIGHT0_Y", "LIGHT1_X", "LIGHT1_Y" };
/* a = 1, 2 = player # */
-#define GUNX( a ) (( ( input_port_read(space->machine, gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
-#define GUNY( a ) (( ( input_port_read(space->machine, gunnames[2 * (a - 1) + 1]) * 223 ) / 0xff ) + 10)
+#define GUNX( a ) (( ( input_port_read(space->machine(), gunnames[2 * (a - 1)]) * 287 ) / 0xff ) + 16)
+#define GUNY( a ) (( ( input_port_read(space->machine(), gunnames[2 * (a - 1) + 1]) * 223 ) / 0xff ) + 10)
/* Default Eeprom for the parent.. otherwise it will always complain first boot */
@@ -210,16 +210,16 @@ static WRITE8_HANDLER( control2_w )
/* bit 4 bankswitches the 4800-4fff region: 0 = registers, 1 = RAM ("CBNK" on schematics) */
/* bit 6 is "SHD0" (some kind of shadow control) */
/* bit 7 is "SHD1" (ditto) */
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
state->cur_control2 = data;
- input_port_write(space->machine, "EEPROMOUT", state->cur_control2, 0xff);
+ input_port_write(space->machine(), "EEPROMOUT", state->cur_control2, 0xff);
}
static INTERRUPT_GEN(lethalen_interrupt)
{
- lethal_state *state = device->machine->driver_data<lethal_state>();
+ lethal_state *state = device->machine().driver_data<lethal_state>();
if (k056832_is_irq_enabled(state->k056832, 0))
device_set_input_line(device, HD6309_IRQ_LINE, HOLD_LINE);
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( sound_cmd_w )
static WRITE8_HANDLER( sound_irq_w )
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
device_set_input_line(state->audiocpu, 0, HOLD_LINE);
}
@@ -243,22 +243,22 @@ static READ8_HANDLER( sound_status_r )
static void sound_nmi( device_t *device )
{
- lethal_state *state = device->machine->driver_data<lethal_state>();
+ lethal_state *state = device->machine().driver_data<lethal_state>();
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
}
static WRITE8_HANDLER( le_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data);
+ memory_set_bank(space->machine(), "bank1", data);
}
static READ8_HANDLER( le_4800_r )
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
if (state->cur_control2 & 0x10) // RAM enable
{
- return space->machine->generic.paletteram.u8[offset];
+ return space->machine().generic.paletteram.u8[offset];
}
else
{
@@ -339,7 +339,7 @@ static READ8_HANDLER( le_4800_r )
static WRITE8_HANDLER( le_4800_w )
{
- lethal_state *state = space->machine->driver_data<lethal_state>();
+ lethal_state *state = space->machine().driver_data<lethal_state>();
if (state->cur_control2 & 0x10) // RAM enable
{
@@ -595,37 +595,37 @@ static const k054539_interface k054539_config =
static MACHINE_START( lethalen )
{
- lethal_state *state = machine->driver_data<lethal_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ lethal_state *state = machine.driver_data<lethal_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 0x20, &ROM[0x10000], 0x2000);
memory_set_bank(machine, "bank1", 0);
- machine->generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3800 + 0x02);
+ machine.generic.paletteram.u8 = auto_alloc_array(machine, UINT8, 0x3800 + 0x02);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("soundcpu");
- state->k054539 = machine->device("k054539");
- state->k053244 = machine->device("k053244");
- state->k056832 = machine->device("k056832");
- state->k054000 = machine->device("k054000");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("soundcpu");
+ state->k054539 = machine.device("k054539");
+ state->k053244 = machine.device("k053244");
+ state->k056832 = machine.device("k056832");
+ state->k054000 = machine.device("k054000");
state->save_item(NAME(state->cur_control2));
state->save_item(NAME(state->sprite_colorbase));
state->save_item(NAME(state->layer_colorbase));
- state_save_register_global_pointer(machine, machine->generic.paletteram.u8, 0x3800 + 0x02);
+ state_save_register_global_pointer(machine, machine.generic.paletteram.u8, 0x3800 + 0x02);
}
static MACHINE_RESET( lethalen )
{
- lethal_state *state = machine->driver_data<lethal_state>();
- UINT8 *prgrom = (UINT8 *)machine->region("maincpu")->base();
+ lethal_state *state = machine.driver_data<lethal_state>();
+ UINT8 *prgrom = (UINT8 *)machine.region("maincpu")->base();
int i;
memory_set_bankptr(machine, "bank2", &prgrom[0x48000]);
/* force reset again to read proper reset vector */
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
for (i = 0; i < 4; i++)
state->layer_colorbase[i] = 0;
diff --git a/src/mame/drivers/lethalj.c b/src/mame/drivers/lethalj.c
index c61c5497448..8d1a4ccc506 100644
--- a/src/mame/drivers/lethalj.c
+++ b/src/mame/drivers/lethalj.c
@@ -161,7 +161,7 @@ Pin #11(+) | | R |
static CUSTOM_INPUT( cclownz_paddle )
{
- int value = input_port_read(field->port->machine, "PADDLE");
+ int value = input_port_read(field->port->machine(), "PADDLE");
return ((value << 4) & 0xf00) | (value & 0x00f);
}
@@ -175,29 +175,29 @@ static CUSTOM_INPUT( cclownz_paddle )
static WRITE16_HANDLER( ripribit_control_w )
{
- coin_counter_w(space->machine, 0, data & 1);
- ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 1) & 1) << 7);
+ coin_counter_w(space->machine(), 0, data & 1);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, ((data >> 1) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
}
static WRITE16_HANDLER( cfarm_control_w )
{
- ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, ((data >> 0) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
output_set_lamp_value(1, (data >> 3) & 1);
output_set_lamp_value(2, (data >> 4) & 1);
- coin_counter_w(space->machine, 0, (data >> 7) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 7) & 1);
}
static WRITE16_HANDLER( cclownz_control_w )
{
- ticket_dispenser_w(space->machine->device("ticket"), 0, ((data >> 0) & 1) << 7);
+ ticket_dispenser_w(space->machine().device("ticket"), 0, ((data >> 0) & 1) << 7);
output_set_lamp_value(0, (data >> 2) & 1);
output_set_lamp_value(1, (data >> 4) & 1);
output_set_lamp_value(2, (data >> 5) & 1);
- coin_counter_w(space->machine, 0, (data >> 6) & 1);
+ coin_counter_w(space->machine(), 0, (data >> 6) & 1);
}
@@ -897,19 +897,19 @@ ROM_END
static DRIVER_INIT( ripribit )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(ripribit_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(ripribit_control_w));
}
static DRIVER_INIT( cfarm )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cfarm_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cfarm_control_w));
}
static DRIVER_INIT( cclownz )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cclownz_control_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x04100010, 0x0410001f, FUNC(cclownz_control_w));
}
diff --git a/src/mame/drivers/lgp.c b/src/mame/drivers/lgp.c
index 8273d6c8319..28ae1050871 100644
--- a/src/mame/drivers/lgp.c
+++ b/src/mame/drivers/lgp.c
@@ -90,11 +90,11 @@ public:
/* VIDEO GOODS */
static SCREEN_UPDATE( lgp )
{
- lgp_state *state = screen->machine->driver_data<lgp_state>();
+ lgp_state *state = screen->machine().driver_data<lgp_state>();
int charx, chary;
/* make color 0 transparent */
- palette_set_color(screen->machine, 0, MAKE_ARGB(0,0,0,0));
+ palette_set_color(screen->machine(), 0, MAKE_ARGB(0,0,0,0));
/* clear */
bitmap_fill(bitmap, cliprect, 0);
@@ -108,7 +108,7 @@ static SCREEN_UPDATE( lgp )
/* Somewhere there's a flag that offsets the tilemap by 0x100*x */
/* Palette is likely set somewhere as well (tile_control_ram?) */
- drawgfx_transpen(bitmap, cliprect, screen->machine->gfx[0],
+ drawgfx_transpen(bitmap, cliprect, screen->machine().gfx[0],
state->tile_ram[current_screen_character],
0,
0, 0, charx*8, chary*8, 0);
@@ -123,13 +123,13 @@ static SCREEN_UPDATE( lgp )
/* Main Z80 R/W */
static READ8_HANDLER(ldp_read)
{
- lgp_state *state = space->machine->driver_data<lgp_state>();
+ lgp_state *state = space->machine().driver_data<lgp_state>();
return laserdisc_data_r(state->laserdisc);
}
static WRITE8_HANDLER(ldp_write)
{
- lgp_state *state = space->machine->driver_data<lgp_state>();
+ lgp_state *state = space->machine().driver_data<lgp_state>();
laserdisc_data_w(state->laserdisc,data);
}
@@ -333,7 +333,7 @@ static TIMER_CALLBACK( irq_stop )
static INTERRUPT_GEN( vblank_callback_lgp )
{
- lgp_state *state = device->machine->driver_data<lgp_state>();
+ lgp_state *state = device->machine().driver_data<lgp_state>();
// NMI
//device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -345,9 +345,9 @@ static INTERRUPT_GEN( vblank_callback_lgp )
static MACHINE_START( lgp )
{
- lgp_state *state = machine->driver_data<lgp_state>();
- state->laserdisc = machine->device("laserdisc");
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_stop));
+ lgp_state *state = machine.driver_data<lgp_state>();
+ state->laserdisc = machine.device("laserdisc");
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_stop));
}
diff --git a/src/mame/drivers/liberate.c b/src/mame/drivers/liberate.c
index bea04dbd15a..6711156165c 100644
--- a/src/mame/drivers/liberate.c
+++ b/src/mame/drivers/liberate.c
@@ -27,8 +27,8 @@
static READ8_HANDLER( deco16_bank_r )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- const UINT8 *ROM = space->machine->region("user1")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ const UINT8 *ROM = space->machine().region("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (state->bank)
@@ -55,11 +55,11 @@ static READ8_HANDLER( deco16_bank_r )
static READ8_HANDLER( deco16_io_r )
{
- if (offset == 0) return input_port_read(space->machine, "IN1"); /* Player 1 controls */
- if (offset == 1) return input_port_read(space->machine, "IN2"); /* Player 2 controls */
- if (offset == 2) return input_port_read(space->machine, "IN3"); /* Vblank, coins */
- if (offset == 3) return input_port_read(space->machine, "DSW1"); /* Dip 1 */
- if (offset == 4) return input_port_read(space->machine, "DSW2"); /* Dip 2 */
+ if (offset == 0) return input_port_read(space->machine(), "IN1"); /* Player 1 controls */
+ if (offset == 1) return input_port_read(space->machine(), "IN2"); /* Player 2 controls */
+ if (offset == 2) return input_port_read(space->machine(), "IN3"); /* Vblank, coins */
+ if (offset == 3) return input_port_read(space->machine(), "DSW1"); /* Dip 1 */
+ if (offset == 4) return input_port_read(space->machine(), "DSW2"); /* Dip 2 */
logerror("%04x: Read input %d\n", cpu_get_pc(space->cpu), offset);
return 0xff;
@@ -67,7 +67,7 @@ static READ8_HANDLER( deco16_io_r )
static WRITE8_HANDLER( deco16_bank_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->bank = data;
if (state->bank)
@@ -78,8 +78,8 @@ static WRITE8_HANDLER( deco16_bank_w )
static READ8_HANDLER( prosoccr_bank_r )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- const UINT8 *ROM = space->machine->region("user1")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ const UINT8 *ROM = space->machine().region("user1")->base();
/* The tilemap bank can be swapped into main memory */
if (state->bank)
@@ -108,8 +108,8 @@ static READ8_HANDLER( prosoccr_bank_r )
static READ8_HANDLER( prosoccr_charram_r )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- UINT8 *SRC_GFX = space->machine->region("shared_gfx")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ UINT8 *SRC_GFX = space->machine().region("shared_gfx")->base();
if (state->gfx_rom_readback)
{
@@ -130,8 +130,8 @@ static READ8_HANDLER( prosoccr_charram_r )
static WRITE8_HANDLER( prosoccr_charram_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
- UINT8 *FG_GFX = space->machine->region("fg_gfx")->base();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
+ UINT8 *FG_GFX = space->machine().region("fg_gfx")->base();
if (state->bank)
{
@@ -162,13 +162,13 @@ static WRITE8_HANDLER( prosoccr_charram_w )
offset &= 0x7ff;
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[0], offset >> 3);
-// gfx_element_mark_dirty(space->machine->gfx[0], (offset | 0x1800) >> 3);
+ gfx_element_mark_dirty(space->machine().gfx[0], offset >> 3);
+// gfx_element_mark_dirty(space->machine().gfx[0], (offset | 0x1800) >> 3);
}
static WRITE8_HANDLER( prosoccr_char_bank_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->gfx_rom_readback = data & 1; //enable GFX rom read-back
if (data & 0xfe)
@@ -177,7 +177,7 @@ static WRITE8_HANDLER( prosoccr_char_bank_w )
static WRITE8_HANDLER( prosoccr_io_bank_w )
{
- liberate_state *state = space->machine->driver_data<liberate_state>();
+ liberate_state *state = space->machine().driver_data<liberate_state>();
state->bank = data & 1;
if (state->bank)
@@ -189,7 +189,7 @@ static WRITE8_HANDLER( prosoccr_io_bank_w )
static READ8_HANDLER( prosport_charram_r )
{
- UINT8 *FG_GFX = space->machine->region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = space->machine().region("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -209,7 +209,7 @@ static READ8_HANDLER( prosport_charram_r )
static WRITE8_HANDLER( prosport_charram_w )
{
- UINT8 *FG_GFX = space->machine->region("progolf_fg_gfx")->base();
+ UINT8 *FG_GFX = space->machine().region("progolf_fg_gfx")->base();
switch (offset & 0x1800)
{
@@ -230,8 +230,8 @@ static WRITE8_HANDLER( prosport_charram_w )
offset &= 0x7ff;
/* dirty char */
- gfx_element_mark_dirty(space->machine->gfx[3], (offset + 0x800) >> 3);
- gfx_element_mark_dirty(space->machine->gfx[3 + 4], (offset + 0x800) >> 5);
+ gfx_element_mark_dirty(space->machine().gfx[3], (offset + 0x800) >> 3);
+ gfx_element_mark_dirty(space->machine().gfx[3 + 4], (offset + 0x800) >> 5);
}
@@ -769,8 +769,8 @@ GFXDECODE_END
static INTERRUPT_GEN( deco16_interrupt )
{
- liberate_state *state = device->machine->driver_data<liberate_state>();
- int p = ~input_port_read(device->machine, "IN3");
+ liberate_state *state = device->machine().driver_data<liberate_state>();
+ int p = ~input_port_read(device->machine(), "IN3");
if ((p & 0x43) && !state->latch)
{
device_set_input_line(device, DECO16_IRQ_LINE, ASSERT_LINE);
@@ -799,10 +799,10 @@ static INTERRUPT_GEN( prosport_interrupt )
static MACHINE_START( liberate )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->background_disable));
state->save_item(NAME(state->background_color));
@@ -815,7 +815,7 @@ static MACHINE_START( liberate )
static MACHINE_RESET( liberate )
{
- liberate_state *state = machine->driver_data<liberate_state>();
+ liberate_state *state = machine.driver_data<liberate_state>();
memset(state->io_ram, 0, ARRAY_LENGTH(state->io_ram));
@@ -1355,11 +1355,11 @@ ROM_END
*
*************************************/
-static void sound_cpu_decrypt(running_machine *machine)
+static void sound_cpu_decrypt(running_machine &machine)
{
- address_space *space = machine->device("audiocpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("audiocpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
- UINT8 *rom = machine->region("audiocpu")->base();
+ UINT8 *rom = machine.region("audiocpu")->base();
int i;
/* Bit swapping on sound cpu - Opcodes only */
@@ -1371,7 +1371,7 @@ static void sound_cpu_decrypt(running_machine *machine)
static DRIVER_INIT( prosport )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
/* Main cpu has the nibbles swapped */
@@ -1385,15 +1385,15 @@ static DRIVER_INIT( yellowcb )
{
DRIVER_INIT_CALL(prosport);
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xa000, 0xa000, "IN0");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_port(0xa000, 0xa000, "IN0");
}
static DRIVER_INIT( liberate )
{
int A;
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x10000);
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
space->set_decrypted_region(0x0000, 0xffff, decrypted);
diff --git a/src/mame/drivers/liberatr.c b/src/mame/drivers/liberatr.c
index 85ea485a1db..3e926dd6e4e 100644
--- a/src/mame/drivers/liberatr.c
+++ b/src/mame/drivers/liberatr.c
@@ -161,13 +161,13 @@ void liberatr_state::machine_start()
WRITE8_MEMBER( liberatr_state::led_w )
{
- set_led_status(&m_machine, offset, ~data & 0x10);
+ set_led_status(m_machine, offset, ~data & 0x10);
}
WRITE8_MEMBER( liberatr_state::coin_counter_w )
{
- ::coin_counter_w(&m_machine, offset ^ 0x01, data & 0x10);
+ ::coin_counter_w(m_machine, offset ^ 0x01, data & 0x10);
}
@@ -184,8 +184,8 @@ WRITE8_MEMBER( liberatr_state::trackball_reset_w )
/* input becomes the starting point for the trackball counters */
if (((data ^ m_ctrld) & 0x10) && (data & 0x10))
{
- UINT8 trackball = input_port_read(&m_machine, "FAKE");
- UINT8 switches = input_port_read(&m_machine, "IN0");
+ UINT8 trackball = input_port_read(m_machine, "FAKE");
+ UINT8 switches = input_port_read(m_machine, "IN0");
m_trackball_offset = ((trackball & 0xf0) - (switches & 0xf0)) | ((trackball - switches) & 0x0f);
}
m_ctrld = data & 0x10;
@@ -197,13 +197,13 @@ READ8_MEMBER( liberatr_state::port0_r )
/* if ctrld is high, the /ld signal on the LS191 is NOT set, meaning that the trackball is counting */
if (m_ctrld)
{
- UINT8 trackball = input_port_read(&m_machine, "FAKE");
+ UINT8 trackball = input_port_read(m_machine, "FAKE");
return ((trackball & 0xf0) - (m_trackball_offset & 0xf0)) | ((trackball - m_trackball_offset) & 0x0f);
}
/* otherwise, the LS191 is simply passing through the raw switch inputs */
else
- return input_port_read(&m_machine, "IN0");
+ return input_port_read(m_machine, "IN0");
}
diff --git a/src/mame/drivers/limenko.c b/src/mame/drivers/limenko.c
index 153b3e3b945..52247003d1a 100644
--- a/src/mame/drivers/limenko.c
+++ b/src/mame/drivers/limenko.c
@@ -55,7 +55,7 @@ public:
};
-static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count);
+static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle *cliprect, int count);
/*****************************************************************************************************
MISC FUNCTIONS
@@ -63,44 +63,44 @@ static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectan
static WRITE32_HANDLER( limenko_coincounter_w )
{
- coin_counter_w(space->machine,0,data & 0x10000);
+ coin_counter_w(space->machine(),0,data & 0x10000);
}
static WRITE32_HANDLER( limenko_paletteram_w )
{
UINT16 paldata;
- COMBINE_DATA(&space->machine->generic.paletteram.u32[offset]);
+ COMBINE_DATA(&space->machine().generic.paletteram.u32[offset]);
if(ACCESSING_BITS_0_15)
{
- paldata = space->machine->generic.paletteram.u32[offset] & 0x7fff;
- palette_set_color_rgb(space->machine, offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
+ paldata = space->machine().generic.paletteram.u32[offset] & 0x7fff;
+ palette_set_color_rgb(space->machine(), offset * 2 + 1, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
}
if(ACCESSING_BITS_16_31)
{
- paldata = (space->machine->generic.paletteram.u32[offset] >> 16) & 0x7fff;
- palette_set_color_rgb(space->machine, offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
+ paldata = (space->machine().generic.paletteram.u32[offset] >> 16) & 0x7fff;
+ palette_set_color_rgb(space->machine(), offset * 2 + 0, pal5bit(paldata >> 0), pal5bit(paldata >> 5), pal5bit(paldata >> 10));
}
}
static WRITE32_HANDLER( bg_videoram_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
COMBINE_DATA(&state->bg_videoram[offset]);
tilemap_mark_tile_dirty(state->bg_tilemap,offset);
}
static WRITE32_HANDLER( md_videoram_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
COMBINE_DATA(&state->md_videoram[offset]);
tilemap_mark_tile_dirty(state->md_tilemap,offset);
}
static WRITE32_HANDLER( fg_videoram_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
COMBINE_DATA(&state->fg_videoram[offset]);
tilemap_mark_tile_dirty(state->fg_tilemap,offset);
}
@@ -112,13 +112,13 @@ static WRITE32_HANDLER( spotty_soundlatch_w )
static CUSTOM_INPUT( spriteram_bit_r )
{
- limenko_state *state = field->port->machine->driver_data<limenko_state>();
+ limenko_state *state = field->port->machine().driver_data<limenko_state>();
return state->spriteram_bit;
}
static WRITE32_HANDLER( spriteram_buffer_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
rectangle clip;
clip.min_x = 0;
clip.max_x = 383;
@@ -134,12 +134,12 @@ static WRITE32_HANDLER( spriteram_buffer_w )
if(state->spriteram_bit)
{
// draw the sprites to the frame buffer
- draw_sprites(space->machine,state->spriteram2,&clip,state->prev_sprites_count);
+ draw_sprites(space->machine(),state->spriteram2,&clip,state->prev_sprites_count);
}
else
{
// draw the sprites to the frame buffer
- draw_sprites(space->machine,state->spriteram,&clip,state->prev_sprites_count);
+ draw_sprites(space->machine(),state->spriteram,&clip,state->prev_sprites_count);
}
// buffer the next number of sprites to draw
@@ -203,7 +203,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( spotty_sound_cmd_w )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
state->spotty_sound_cmd = data;
}
@@ -214,13 +214,13 @@ static READ8_HANDLER( spotty_sound_cmd_r )
static READ8_HANDLER( spotty_sound_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
+ limenko_state *state = space->machine().driver_data<limenko_state>();
// check state->spotty_sound_cmd bits...
if(state->spotty_sound_cmd == 0xf7)
return soundlatch_r(space,0);
else
- return space->machine->device<okim6295_device>("oki")->read(*space,0);
+ return space->machine().device<okim6295_device>("oki")->read(*space,0);
}
static ADDRESS_MAP_START( spotty_sound_io_map, AS_IO, 8 )
@@ -234,7 +234,7 @@ ADDRESS_MAP_END
static TILE_GET_INFO( get_bg_tile_info )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int tile = state->bg_videoram[tile_index] & 0x7ffff;
int color = (state->bg_videoram[tile_index]>>28) & 0xf;
SET_TILE_INFO(0,tile,color,0);
@@ -242,7 +242,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_md_tile_info )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int tile = state->md_videoram[tile_index] & 0x7ffff;
int color = (state->md_videoram[tile_index]>>28) & 0xf;
SET_TILE_INFO(0,tile,color,0);
@@ -250,7 +250,7 @@ static TILE_GET_INFO( get_md_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int tile = state->fg_videoram[tile_index] & 0x7ffff;
int color = (state->fg_videoram[tile_index]>>28) & 0xf;
SET_TILE_INFO(0,tile,color,0);
@@ -260,7 +260,7 @@ static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gf
UINT32 code,UINT32 color,int flipx,int flipy,int sx,int sy,
int priority)
{
- limenko_state *state = gfx->machine->driver_data<limenko_state>();
+ limenko_state *state = gfx->machine().driver_data<limenko_state>();
int pal_base = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
const UINT8 *source_base = gfx_element_get_data(gfx, code % gfx->total_elements);
@@ -359,13 +359,13 @@ static void draw_single_sprite(bitmap_t *dest_bmp,const rectangle *clip,const gf
}
// sprites aren't tile based (except for 8x8 ones)
-static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectangle *cliprect, int count)
+static void draw_sprites(running_machine &machine, UINT32 *sprites, const rectangle *cliprect, int count)
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int i;
- UINT8 *base_gfx = machine->region("gfx1")->base();
- UINT8 *gfx_max = base_gfx + machine->region("gfx1")->bytes();
+ UINT8 *base_gfx = machine.region("gfx1")->base();
+ UINT8 *gfx_max = base_gfx + machine.region("gfx1")->bytes();
UINT8 *gfxdata;
gfx_element gfx;
@@ -418,9 +418,9 @@ static void draw_sprites(running_machine *machine, UINT32 *sprites, const rectan
}
}
-static void copy_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle *cliprect)
+static void copy_sprites(running_machine &machine, bitmap_t *bitmap, bitmap_t *sprites_bitmap, bitmap_t *priority_bitmap, const rectangle *cliprect)
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
int y;
for( y=cliprect->min_y; y<=cliprect->max_y; y++ )
{
@@ -443,7 +443,7 @@ static void copy_sprites(running_machine *machine, bitmap_t *bitmap, bitmap_t *s
static VIDEO_START( limenko )
{
- limenko_state *state = machine->driver_data<limenko_state>();
+ limenko_state *state = machine.driver_data<limenko_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info,tilemap_scan_rows,8,8,128,64);
state->md_tilemap = tilemap_create(machine, get_md_tile_info,tilemap_scan_rows,8,8,128,64);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info,tilemap_scan_rows,8,8,128,64);
@@ -457,10 +457,10 @@ static VIDEO_START( limenko )
static SCREEN_UPDATE( limenko )
{
- limenko_state *state = screen->machine->driver_data<limenko_state>();
+ limenko_state *state = screen->machine().driver_data<limenko_state>();
// state->videoreg[4] ???? It always has this value: 0xffeffff8 (2 signed bytes? values: -17 and -8 ?)
- bitmap_fill(screen->machine->priority_bitmap,cliprect,0);
+ bitmap_fill(screen->machine().priority_bitmap,cliprect,0);
tilemap_set_enable(state->bg_tilemap, state->videoreg[0] & 4);
tilemap_set_enable(state->md_tilemap, state->videoreg[0] & 2);
@@ -479,7 +479,7 @@ static SCREEN_UPDATE( limenko )
tilemap_draw(bitmap,cliprect,state->fg_tilemap,0,1);
if(state->videoreg[0] & 8)
- copy_sprites(screen->machine, bitmap, state->sprites_bitmap, screen->machine->priority_bitmap, cliprect);
+ copy_sprites(screen->machine(), bitmap, state->sprites_bitmap, screen->machine().priority_bitmap, cliprect);
return 0;
}
@@ -996,10 +996,10 @@ ROM_END
static READ32_HANDLER( dynabomb_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0xc25b8)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0xc25b8)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0xe2784/4];
@@ -1007,10 +1007,10 @@ static READ32_HANDLER( dynabomb_speedup_r )
static READ32_HANDLER( legendoh_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0x23e32)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0x23e32)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0x32ab0/4];
@@ -1018,10 +1018,10 @@ static READ32_HANDLER( legendoh_speedup_r )
static READ32_HANDLER( sb2003_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0x26da4)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0x26da4)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0x135800/4];
@@ -1029,10 +1029,10 @@ static READ32_HANDLER( sb2003_speedup_r )
static READ32_HANDLER( spotty_speedup_r )
{
- limenko_state *state = space->machine->driver_data<limenko_state>();
- if(space->machine->firstcpu->pc() == 0x8560)
+ limenko_state *state = space->machine().driver_data<limenko_state>();
+ if(space->machine().firstcpu->pc() == 0x8560)
{
- space->machine->firstcpu->eat_cycles(50);
+ space->machine().firstcpu->eat_cycles(50);
}
return state->mainram[0x6626c/4];
@@ -1040,33 +1040,33 @@ static READ32_HANDLER( spotty_speedup_r )
static DRIVER_INIT( dynabomb )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe2784, 0xe2787, FUNC(dynabomb_speedup_r) );
+ limenko_state *state = machine.driver_data<limenko_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xe2784, 0xe2787, FUNC(dynabomb_speedup_r) );
state->spriteram_bit = 1;
}
static DRIVER_INIT( legendoh )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x32ab0, 0x32ab3, FUNC(legendoh_speedup_r) );
+ limenko_state *state = machine.driver_data<limenko_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x32ab0, 0x32ab3, FUNC(legendoh_speedup_r) );
state->spriteram_bit = 1;
}
static DRIVER_INIT( sb2003 )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x135800, 0x135803, FUNC(sb2003_speedup_r) );
+ limenko_state *state = machine.driver_data<limenko_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x135800, 0x135803, FUNC(sb2003_speedup_r) );
state->spriteram_bit = 1;
}
static DRIVER_INIT( spotty )
{
- limenko_state *state = machine->driver_data<limenko_state>();
- UINT8 *dst = machine->region("gfx1")->base();
- UINT8 *src = machine->region("user2")->base();
+ limenko_state *state = machine.driver_data<limenko_state>();
+ UINT8 *dst = machine.region("gfx1")->base();
+ UINT8 *src = machine.region("user2")->base();
int x;
/* expand 4bpp roms to 8bpp space */
@@ -1078,7 +1078,7 @@ static DRIVER_INIT( spotty )
dst[x+2] = (src[x+1]&0x0f) >> 0;
}
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6626c, 0x6626f, FUNC(spotty_speedup_r) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x6626c, 0x6626f, FUNC(spotty_speedup_r) );
state->spriteram_bit = 1;
}
diff --git a/src/mame/drivers/littlerb.c b/src/mame/drivers/littlerb.c
index 2dd265960bb..b3685a580c6 100644
--- a/src/mame/drivers/littlerb.c
+++ b/src/mame/drivers/littlerb.c
@@ -83,13 +83,13 @@ public:
WRITE16_HANDLER( region4_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
COMBINE_DATA(&state->region4[offset]);
}
WRITE16_HANDLER(palette_offset_w)
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
//printf("palette offset set to %04x\n",data);
state->paldac_offset = data;
state->paldac_select = 0;
@@ -99,7 +99,7 @@ WRITE16_HANDLER(palette_offset_w)
WRITE16_HANDLER( palette_data_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
//printf("palette write %04x\n",data);
state->paldac[state->paldac_select][state->paldac_offset] = data;
@@ -112,7 +112,7 @@ WRITE16_HANDLER( palette_data_w )
g = state->paldac[1][state->paldac_offset];
b = state->paldac[2][state->paldac_offset];
- palette_set_color(space->machine,state->paldac_offset,MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(),state->paldac_offset,MAKE_RGB(r,g,b));
state->paldac_select = 0;
state->paldac_offset++;
@@ -122,7 +122,7 @@ WRITE16_HANDLER( palette_data_w )
WRITE16_HANDLER( palette_reset_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
// printf("palette reset write %04x\n",data);
state->paldac_select = 0;
@@ -178,7 +178,7 @@ public:
virtual device_t *alloc_device(running_machine &machine) const
{
- return auto_alloc(&machine, littlerb_vdp_device(machine, *this));
+ return auto_alloc(machine, littlerb_vdp_device(machine, *this));
}
protected:
@@ -210,9 +210,9 @@ const device_type LITTLERBVDP = littlerb_vdp_device_config::static_alloc_device_
/* end VDP device to give us our own memory map */
-static void littlerb_recalc_regs(running_machine *machine)
+static void littlerb_recalc_regs(running_machine &machine)
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
state->vdp_address_low = state->write_address&0xffff;
state->vdp_address_high = (state->write_address>>16)&0xffff;
}
@@ -220,11 +220,11 @@ static void littlerb_recalc_regs(running_machine *machine)
-static void littlerb_data_write(running_machine *machine, UINT16 data, UINT16 mem_mask)
+static void littlerb_data_write(running_machine &machine, UINT16 data, UINT16 mem_mask)
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
UINT32 addr = state->write_address>>4; // is this right? should we shift?
- address_space *vdp_space = machine->device<littlerb_vdp_device>("littlerbvdp")->space();
+ address_space *vdp_space = machine.device<littlerb_vdp_device>("littlerbvdp")->space();
vdp_space->write_word(addr*2, data, mem_mask);
@@ -239,15 +239,15 @@ static void littlerb_data_write(running_machine *machine, UINT16 data, UINT16 me
-static void littlerb_recalc_address(running_machine *machine)
+static void littlerb_recalc_address(running_machine &machine)
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
state->write_address = state->vdp_address_low | state->vdp_address_high<<16;
}
static READ16_HANDLER( littlerb_vdp_r )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
logerror("%06x littlerb_vdp_r offs %04x mask %04x\n", cpu_get_pc(space->cpu), offset, mem_mask);
switch (offset)
@@ -271,7 +271,7 @@ static READ16_HANDLER( littlerb_vdp_r )
#define LOG_VDP 0
static WRITE16_HANDLER( littlerb_vdp_w )
{
- littlerb_state *state = space->machine->driver_data<littlerb_state>();
+ littlerb_state *state = space->machine().driver_data<littlerb_state>();
if (offset!=2)
{
@@ -311,17 +311,17 @@ static WRITE16_HANDLER( littlerb_vdp_w )
{
case 0:
state->vdp_address_low = data;
- littlerb_recalc_address(space->machine);
+ littlerb_recalc_address(space->machine());
break;
case 1:
state->vdp_address_high = data;
- littlerb_recalc_address(space->machine);
+ littlerb_recalc_address(space->machine());
break;
case 2:
- littlerb_data_write(space->machine, data, mem_mask);
+ littlerb_data_write(space->machine(), data, mem_mask);
break;
case 3:
@@ -431,9 +431,9 @@ static INPUT_PORTS_START( littlerb )
INPUT_PORTS_END
-static void draw_sprite(running_machine *machine, bitmap_t *bitmap, int xsize,int ysize, int offset, int xpos, int ypos, int pal )
+static void draw_sprite(running_machine &machine, bitmap_t *bitmap, int xsize,int ysize, int offset, int xpos, int ypos, int pal )
{
- littlerb_state *state = machine->driver_data<littlerb_state>();
+ littlerb_state *state = machine.driver_data<littlerb_state>();
UINT16* spritegfx = state->region4;
int x,y;
//int pal = 1;
@@ -472,12 +472,12 @@ static void draw_sprite(running_machine *machine, bitmap_t *bitmap, int xsize,in
/* sprite format / offset could be completely wrong, this is just based on our (currently incorrect) vram access */
static SCREEN_UPDATE(littlerb)
{
- littlerb_state *state = screen->machine->driver_data<littlerb_state>();
+ littlerb_state *state = screen->machine().driver_data<littlerb_state>();
int x,y,offs, code;
int xsize,ysize;
int pal;
UINT16* spriteregion = &state->region4[0x400];
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine));
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine()));
//printf("frame\n");
/* the spriteram format is something like this .. */
for (offs=0x26/2;offs<0xc00;offs+=6) // start at 00x26?
@@ -496,7 +496,7 @@ static SCREEN_UPDATE(littlerb)
//if (code!=0) printf("%04x %04x %04x %04x %04x %04x\n", spriteregion[offs+0], spriteregion[offs+1], spriteregion[offs+2], spriteregion[offs+3], spriteregion[offs+4], spriteregion[offs+5]);
- draw_sprite(screen->machine,bitmap,xsize,ysize,code,x-8,y-16, pal);
+ draw_sprite(screen->machine(),bitmap,xsize,ysize,code,x-8,y-16, pal);
}
return 0;
diff --git a/src/mame/drivers/lkage.c b/src/mame/drivers/lkage.c
index 9a824ac6c9f..1aa1c95396e 100644
--- a/src/mame/drivers/lkage.c
+++ b/src/mame/drivers/lkage.c
@@ -97,7 +97,7 @@ TODO:
static TIMER_CALLBACK( nmi_callback )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
if (state->sound_nmi_enable)
device_set_input_line(state->audiocpu, INPUT_LINE_NMI, PULSE_LINE);
else
@@ -107,18 +107,18 @@ static TIMER_CALLBACK( nmi_callback )
static WRITE8_HANDLER( lkage_sound_command_w )
{
soundlatch_w(space, offset, data);
- space->machine->scheduler().synchronize(FUNC(nmi_callback), data);
+ space->machine().scheduler().synchronize(FUNC(nmi_callback), data);
}
static WRITE8_HANDLER( lkage_sh_nmi_disable_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->sound_nmi_enable = 0;
}
static WRITE8_HANDLER( lkage_sh_nmi_enable_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->sound_nmi_enable = 1;
if (state->pending_nmi)
@@ -161,7 +161,7 @@ ADDRESS_MAP_END
static READ8_HANDLER( port_fetch_r )
{
- return space->machine->region("user1")->base()[offset];
+ return space->machine().region("user1")->base()[offset];
}
static ADDRESS_MAP_START( lkage_io_map, AS_IO, 8 )
@@ -480,7 +480,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- lkage_state *state = device->machine->driver_data<lkage_state>();
+ lkage_state *state = device->machine().driver_data<lkage_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -496,11 +496,11 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->bg_tile_bank));
state->save_item(NAME(state->fg_tile_bank));
@@ -530,7 +530,7 @@ static MACHINE_START( lkage )
static MACHINE_RESET( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->bg_tile_bank = state->fg_tile_bank = state->tx_tile_bank =0;
@@ -922,7 +922,7 @@ ROM_END
static READ8_HANDLER( fake_mcu_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
int result = 0;
switch (state->mcu_val)
@@ -958,34 +958,34 @@ static READ8_HANDLER( fake_mcu_r )
static WRITE8_HANDLER( fake_mcu_w )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
state->mcu_val = data;
}
static READ8_HANDLER( fake_status_r )
{
- lkage_state *state = space->machine->driver_data<lkage_state>();
+ lkage_state *state = space->machine().driver_data<lkage_state>();
return state->mcu_ready;
}
static DRIVER_INIT( lkage )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->sprite_dx=0;
}
static DRIVER_INIT( lkageb )
{
- lkage_state *state = machine->driver_data<lkage_state>();
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf062, 0xf062, FUNC(fake_mcu_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf087, 0xf087, FUNC(fake_status_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf062, 0xf062, FUNC(fake_mcu_w) );
+ lkage_state *state = machine.driver_data<lkage_state>();
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf062, 0xf062, FUNC(fake_mcu_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xf087, 0xf087, FUNC(fake_status_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf062, 0xf062, FUNC(fake_mcu_w) );
state->sprite_dx=0;
}
static DRIVER_INIT( bygone )
{
- lkage_state *state = machine->driver_data<lkage_state>();
+ lkage_state *state = machine.driver_data<lkage_state>();
state->sprite_dx=1;
}
diff --git a/src/mame/drivers/lockon.c b/src/mame/drivers/lockon.c
index d82e9d74c07..4e76dea73c7 100644
--- a/src/mame/drivers/lockon.c
+++ b/src/mame/drivers/lockon.c
@@ -53,7 +53,7 @@ static READ8_HANDLER( adc_r );
static WRITE16_HANDLER( adrst_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->ctrl_reg = data & 0xff;
/* Bus mastering for shared access */
@@ -64,14 +64,14 @@ static WRITE16_HANDLER( adrst_w )
static READ16_HANDLER( main_gnd_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *gndspace = state->ground->memory().space(AS_PROGRAM);
return gndspace->read_word(V30_GND_ADDR | offset * 2);
}
static WRITE16_HANDLER( main_gnd_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *gndspace = state->ground->memory().space(AS_PROGRAM);
if (ACCESSING_BITS_0_7)
@@ -82,14 +82,14 @@ static WRITE16_HANDLER( main_gnd_w )
static READ16_HANDLER( main_obj_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *objspace = state->object->memory().space(AS_PROGRAM);
return objspace->read_word(V30_OBJ_ADDR | offset * 2);
}
static WRITE16_HANDLER( main_obj_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *objspace = state->object->memory().space(AS_PROGRAM);
if (ACCESSING_BITS_0_7)
@@ -100,7 +100,7 @@ static WRITE16_HANDLER( main_obj_w )
static WRITE16_HANDLER( tst_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
if (offset < 0x800)
{
@@ -121,28 +121,28 @@ static WRITE16_HANDLER( tst_w )
static READ16_HANDLER( main_z80_r )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *sndspace = state->audiocpu->memory().space(AS_PROGRAM);
return 0xff00 | sndspace->read_byte(offset);
}
static WRITE16_HANDLER( main_z80_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
address_space *sndspace = state->audiocpu->memory().space(AS_PROGRAM);
sndspace->write_byte(offset, data);
}
static WRITE16_HANDLER( inten_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
state->main_inten = 1;
}
static WRITE16_HANDLER( emres_w )
{
- lockon_state *state = space->machine->driver_data<lockon_state>();
- watchdog_reset(space->machine);
+ lockon_state *state = space->machine().driver_data<lockon_state>();
+ watchdog_reset(space->machine());
state->main_inten = 0;
}
@@ -342,10 +342,10 @@ static READ8_HANDLER( adc_r )
{
switch (offset)
{
- case 0: return input_port_read(space->machine, "ADC_BANK");
- case 1: return input_port_read(space->machine, "ADC_PITCH");
- case 2: return input_port_read(space->machine, "ADC_MISSILE");
- case 3: return input_port_read(space->machine, "ADC_HOVER");
+ case 0: return input_port_read(space->machine(), "ADC_BANK");
+ case 1: return input_port_read(space->machine(), "ADC_PITCH");
+ case 2: return input_port_read(space->machine(), "ADC_MISSILE");
+ case 3: return input_port_read(space->machine(), "ADC_HOVER");
default: return 0;
}
}
@@ -392,7 +392,7 @@ static WRITE8_HANDLER( sound_vol )
#define LO_RI 100000.0
#define LO_RP 100000.0
- lockon_state *state = space->machine->driver_data<lockon_state>();
+ lockon_state *state = space->machine().driver_data<lockon_state>();
static const double gains[16] =
{
@@ -428,18 +428,18 @@ static WRITE8_HANDLER( sound_vol )
static void ym2203_irq(device_t *device, int irq)
{
- lockon_state *state = device->machine->driver_data<lockon_state>();
+ lockon_state *state = device->machine().driver_data<lockon_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE );
}
static WRITE8_DEVICE_HANDLER( ym2203_out_b )
{
- coin_counter_w(device->machine, 0, data & 0x80);
- coin_counter_w(device->machine, 1, data & 0x40);
- coin_counter_w(device->machine, 2, data & 0x20);
+ coin_counter_w(device->machine(), 0, data & 0x80);
+ coin_counter_w(device->machine(), 1, data & 0x40);
+ coin_counter_w(device->machine(), 2, data & 0x20);
/* 'Lock-On' lamp */
- set_led_status(device->machine, 1, !(data & 0x10));
+ set_led_status(device->machine(), 1, !(data & 0x10));
}
static const ym2203_interface ym2203_config =
@@ -464,18 +464,18 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lockon )
{
- lockon_state *state = machine->driver_data<lockon_state>();
-
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->ground = machine->device("ground");
- state->object = machine->device("object");
- state->f2203_1l = machine->device("f2203.1l");
- state->f2203_2l = machine->device("f2203.2l");
- state->f2203_3l = machine->device("f2203.3l");
- state->f2203_1r = machine->device("f2203.1r");
- state->f2203_2r = machine->device("f2203.2r");
- state->f2203_3r = machine->device("f2203.3r");
+ lockon_state *state = machine.driver_data<lockon_state>();
+
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->ground = machine.device("ground");
+ state->object = machine.device("object");
+ state->f2203_1l = machine.device("f2203.1l");
+ state->f2203_2l = machine.device("f2203.2l");
+ state->f2203_3l = machine.device("f2203.3l");
+ state->f2203_1r = machine.device("f2203.1r");
+ state->f2203_2r = machine.device("f2203.2r");
+ state->f2203_3r = machine.device("f2203.3r");
state->save_item(NAME(state->ground_ctrl));
state->save_item(NAME(state->scroll_h));
@@ -497,7 +497,7 @@ static MACHINE_START( lockon )
static MACHINE_RESET( lockon )
{
- lockon_state *state = machine->driver_data<lockon_state>();
+ lockon_state *state = machine.driver_data<lockon_state>();
state->ground_ctrl = 0;
state->scroll_h = 0;
diff --git a/src/mame/drivers/looping.c b/src/mame/drivers/looping.c
index ab7f7c18662..6d1eed1e281 100644
--- a/src/mame/drivers/looping.c
+++ b/src/mame/drivers/looping.c
@@ -171,7 +171,7 @@ static PALETTE_INIT( looping )
static TILE_GET_INFO( get_tile_info )
{
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
int tile_number = state->videoram[tile_index];
int color = state->colorram[(tile_index & 0x1f) * 2 + 1] & 0x07;
SET_TILE_INFO(0, tile_number, color, 0);
@@ -180,7 +180,7 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( looping )
{
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
state->bg_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8,8, 32,32);
@@ -197,23 +197,23 @@ static VIDEO_START( looping )
static WRITE8_HANDLER( flip_screen_x_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
- flip_screen_x_set(space->machine, ~data & 0x01);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
+ looping_state *state = space->machine().driver_data<looping_state>();
+ flip_screen_x_set(space->machine(), ~data & 0x01);
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine()) ? 128 : 0);
}
static WRITE8_HANDLER( flip_screen_y_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
- flip_screen_y_set(space->machine, ~data & 0x01);
- tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine) ? 128 : 0);
+ looping_state *state = space->machine().driver_data<looping_state>();
+ flip_screen_y_set(space->machine(), ~data & 0x01);
+ tilemap_set_scrollx(state->bg_tilemap, 0, flip_screen_get(space->machine()) ? 128 : 0);
}
static WRITE8_HANDLER( looping_videoram_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
@@ -221,7 +221,7 @@ static WRITE8_HANDLER( looping_videoram_w )
static WRITE8_HANDLER( looping_colorram_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
int i;
state->colorram[offset] = data;
@@ -248,10 +248,10 @@ static WRITE8_HANDLER( looping_colorram_w )
*
*************************************/
-static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
+static void draw_sprites(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect)
{
const UINT8 *source;
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
for (source = state->spriteram; source < state->spriteram + 0x40; source += 4)
{
@@ -274,17 +274,17 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
flipy = !flipy;
}
- drawgfx_transpen(bitmap, cliprect, machine->gfx[1], code, color, flipx, flipy, sx, sy, 0);
+ drawgfx_transpen(bitmap, cliprect, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0);
}
}
static SCREEN_UPDATE( looping )
{
- looping_state *state = screen->machine->driver_data<looping_state>();
+ looping_state *state = screen->machine().driver_data<looping_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
return 0;
}
@@ -298,7 +298,7 @@ static SCREEN_UPDATE( looping )
static MACHINE_START( looping )
{
- looping_state *state = machine->driver_data<looping_state>();
+ looping_state *state = machine.driver_data<looping_state>();
state->save_item(NAME(state->sound));
}
@@ -319,34 +319,34 @@ static INTERRUPT_GEN( looping_interrupt )
static WRITE8_HANDLER( level2_irq_set )
{
if (!(data & 1))
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, ASSERT_LINE, 4);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, ASSERT_LINE, 4);
}
static WRITE8_HANDLER( main_irq_ack_w )
{
if (data == 0)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
}
static WRITE8_HANDLER( looping_souint_clr )
{
if (data == 0)
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
}
static WRITE_LINE_DEVICE_HANDLER( looping_spcint )
{
- cputag_set_input_line_and_vector(device->machine, "audiocpu", 0, !state, 6);
+ cputag_set_input_line_and_vector(device->machine(), "audiocpu", 0, !state, 6);
}
static WRITE8_HANDLER( looping_soundlatch_w )
{
soundlatch_w(space, offset, data);
- cputag_set_input_line_and_vector(space->machine, "audiocpu", 0, ASSERT_LINE, 4);
+ cputag_set_input_line_and_vector(space->machine(), "audiocpu", 0, ASSERT_LINE, 4);
}
@@ -370,7 +370,7 @@ static WRITE8_DEVICE_HANDLER( looping_sound_sw )
0007 = AFA
*/
- looping_state *state = device->machine->driver_data<looping_state>();
+ looping_state *state = device->machine().driver_data<looping_state>();
state->sound[offset + 1] = data ^ 1;
dac_data_w(device, ((state->sound[2] << 7) + (state->sound[3] << 6)) * state->sound[7]);
}
@@ -404,7 +404,7 @@ static WRITE8_DEVICE_HANDLER( speech_enable_w )
static WRITE8_HANDLER( ballon_enable_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
if (state->last != data)
mame_printf_debug("ballon_enable_w = %d\n", data);
state->last = data;
@@ -440,21 +440,21 @@ static WRITE8_HANDLER( plr2_w )
static READ8_HANDLER( cop_io_r )
{
- //looping_state *state = space->machine->driver_data<looping_state>();
- // if (offset == 1) return space->machine->rand() & 0x01;
+ //looping_state *state = space->machine().driver_data<looping_state>();
+ // if (offset == 1) return space->machine().rand() & 0x01;
return 1; // state->cop_io[offset];
}
static WRITE8_HANDLER( cop_io_w )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
state->cop_io[offset] = data;
if (offset == 0) logerror("%02x ",data);
}
static READ8_HANDLER( protection_r )
{
- looping_state *state = space->machine->driver_data<looping_state>();
+ looping_state *state = space->machine().driver_data<looping_state>();
// The code reads ($7002) ($7004) alternately
// The result must change at least once every 10 reads
// A read from ($34b0 + result) must == $01
@@ -887,9 +887,9 @@ ROM_END
static DRIVER_INIT( looping )
{
- looping_state *state = machine->driver_data<looping_state>();
- int length = machine->region("maincpu")->bytes();
- UINT8 *rom = machine->region("maincpu")->base();
+ looping_state *state = machine.driver_data<looping_state>();
+ int length = machine.region("maincpu")->bytes();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
state->cop_io = auto_alloc_array(machine, UINT8, 0x08);
@@ -899,7 +899,7 @@ static DRIVER_INIT( looping )
rom[i] = BITSWAP8(rom[i], 0,1,2,3,4,5,6,7);
/* install protection handlers */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7000, 0x7007, FUNC(protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x7000, 0x7007, FUNC(protection_r));
}
diff --git a/src/mame/drivers/lordgun.c b/src/mame/drivers/lordgun.c
index 5be87e6de75..0ae62ff7b45 100644
--- a/src/mame/drivers/lordgun.c
+++ b/src/mame/drivers/lordgun.c
@@ -57,7 +57,7 @@ Notes:
static DRIVER_INIT( lordgun )
{
int i;
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// Decryption
@@ -82,7 +82,7 @@ static DRIVER_INIT( lordgun )
// From XingXing:
static DRIVER_INIT( aliencha )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// Protection
@@ -106,7 +106,7 @@ static DRIVER_INIT( aliencha )
static DRIVER_INIT( alienchac )
{
- UINT16 *rom = (UINT16 *)machine->region("maincpu")->base();
+ UINT16 *rom = (UINT16 *)machine.region("maincpu")->base();
// Protection
@@ -144,22 +144,22 @@ static WRITE8_DEVICE_HANDLER(fake2_w)
static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
- device_t *eeprom = device->machine->device("eeprom");
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
+ device_t *eeprom = device->machine().device("eeprom");
int i;
if (data & ~0xfd)
{
// popmessage("EE: %02x", data);
- logerror("%s: Unknown EEPROM bit written %02X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %02X\n",device->machine().describe_context(),data);
}
- coin_counter_w(device->machine, 0, data & 0x01);
+ coin_counter_w(device->machine(), 0, data & 0x01);
// Update light guns positions
for (i = 0; i < 2; i++)
if ( (data & (0x04 << i)) && !(state->old & (0x04 << i)) )
- lordgun_update_gun(device->machine, i);
+ lordgun_update_gun(device->machine(), i);
// latch the bit
eeprom_write_bit(eeprom, data & 0x40);
@@ -177,20 +177,20 @@ static WRITE8_DEVICE_HANDLER( lordgun_eeprom_w )
static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
- device_t *eeprom = device->machine->device("eeprom");
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
+ device_t *eeprom = device->machine().device("eeprom");
if (~data & ~0xf8)
{
// popmessage("EE: %02x", data);
- logerror("%s: Unknown EEPROM bit written %02X\n",device->machine->describe_context(),data);
+ logerror("%s: Unknown EEPROM bit written %02X\n",device->machine().describe_context(),data);
}
// bit 1? cleared during screen transitions
state->whitescreen = !(data & 0x02);
- coin_counter_w(device->machine, 0, data & 0x08);
- coin_counter_w(device->machine, 1, data & 0x10);
+ coin_counter_w(device->machine(), 0, data & 0x08);
+ coin_counter_w(device->machine(), 1, data & 0x10);
// latch the bit
eeprom_write_bit(eeprom, data & 0x80);
@@ -205,22 +205,22 @@ static WRITE8_DEVICE_HANDLER( aliencha_eeprom_w )
static READ8_DEVICE_HANDLER( aliencha_dip_r )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
switch (state->aliencha_dip_sel & 0x70)
{
- case 0x30: return input_port_read(device->machine, "DIP1");
- case 0x60: return input_port_read(device->machine, "DIP2");
- case 0x50: return input_port_read(device->machine, "DIP3");
+ case 0x30: return input_port_read(device->machine(), "DIP1");
+ case 0x60: return input_port_read(device->machine(), "DIP2");
+ case 0x50: return input_port_read(device->machine(), "DIP3");
default:
- logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine->describe_context(),state->aliencha_dip_sel);
+ logerror("%s: dip_r with unknown dip_sel = %02X\n",device->machine().describe_context(),state->aliencha_dip_sel);
return 0xff;
}
}
static WRITE8_DEVICE_HANDLER( aliencha_dip_w )
{
- lordgun_state *state = device->machine->driver_data<lordgun_state>();
+ lordgun_state *state = device->machine().driver_data<lordgun_state>();
state->aliencha_dip_sel = data;
}
@@ -228,7 +228,7 @@ static WRITE8_DEVICE_HANDLER( aliencha_dip_w )
// Unknown, always equal to 7 in lordgun, aliencha.
static WRITE16_HANDLER( lordgun_priority_w )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
COMBINE_DATA(&state->priority);
// popmessage("PR: %04x", data);
}
@@ -236,25 +236,25 @@ static WRITE16_HANDLER( lordgun_priority_w )
static READ16_HANDLER( lordgun_gun_0_x_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[0].hw_x;
}
static READ16_HANDLER( lordgun_gun_0_y_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[0].hw_y;
}
static READ16_HANDLER( lordgun_gun_1_x_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[1].hw_x;
}
static READ16_HANDLER( lordgun_gun_1_y_r )
{
- lordgun_state *state = space->machine->driver_data<lordgun_state>();
+ lordgun_state *state = space->machine().driver_data<lordgun_state>();
return state->gun[1].hw_y;
}
@@ -264,7 +264,7 @@ static WRITE16_HANDLER( lordgun_soundlatch_w )
if (ACCESSING_BITS_0_7) soundlatch_w (space, 0, (data >> 0) & 0xff);
if (ACCESSING_BITS_8_15) soundlatch2_w(space, 0, (data >> 8) & 0xff);
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
static ADDRESS_MAP_START( lordgun_map, AS_PROGRAM, 16 )
@@ -341,7 +341,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( lordgun_okibank_w )
{
downcast<okim6295_device *>(device)->set_bank_base((data & 2) ? 0x40000 : 0);
- if (data & ~3) logerror("%s: unknown okibank bits %02x\n", device->machine->describe_context(), data);
+ if (data & ~3) logerror("%s: unknown okibank bits %02x\n", device->machine().describe_context(), data);
// popmessage("OKI %x", data);
}
@@ -664,7 +664,7 @@ static const ppi8255_interface aliencha_ppi8255_intf[2] =
static void soundirq(device_t *device, int state)
{
- cputag_set_input_line(device->machine, "soundcpu", INPUT_LINE_IRQ0, state);
+ cputag_set_input_line(device->machine(), "soundcpu", INPUT_LINE_IRQ0, state);
}
static const ym3812_interface lordgun_ym3812_interface =
diff --git a/src/mame/drivers/lsasquad.c b/src/mame/drivers/lsasquad.c
index 1a04bd334fd..c0c8e463c47 100644
--- a/src/mame/drivers/lsasquad.c
+++ b/src/mame/drivers/lsasquad.c
@@ -155,12 +155,12 @@ Notes:
static WRITE8_HANDLER( lsasquad_bankswitch_w )
{
/* bits 0-2 select ROM bank */
- memory_set_bank(space->machine, "bank1", data & 0x07);
+ memory_set_bank(space->machine(), "bank1", data & 0x07);
/* bit 3 is zeroed on startup, maybe reset sound CPU */
/* bit 4 flips screen */
- flip_screen_set(space->machine, data & 0x10);
+ flip_screen_set(space->machine(), data & 0x10);
/* other bits unknown */
}
@@ -540,7 +540,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- lsasquad_state *state = device->machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = device->machine().driver_data<lsasquad_state>();
device_set_input_line(state->audiocpu, 0, irq ? ASSERT_LINE : CLEAR_LINE);
}
@@ -566,14 +566,14 @@ static const ym2203_interface ym2203_config =
static MACHINE_START( lsasquad )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 8, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->mcu = machine->device("mcu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->mcu = machine.device("mcu");
state->save_item(NAME(state->port_a_in));
state->save_item(NAME(state->port_a_out));
@@ -595,7 +595,7 @@ static MACHINE_START( lsasquad )
static MACHINE_RESET( lsasquad )
{
- lsasquad_state *state = machine->driver_data<lsasquad_state>();
+ lsasquad_state *state = machine.driver_data<lsasquad_state>();
state->sound_pending = 0;
state->sound_nmi_enable = 0;
diff --git a/src/mame/drivers/ltcasino.c b/src/mame/drivers/ltcasino.c
index 652f74c6a0b..5249c1676bd 100644
--- a/src/mame/drivers/ltcasino.c
+++ b/src/mame/drivers/ltcasino.c
@@ -34,7 +34,7 @@ public:
static TILE_GET_INFO( get_ltcasino_tile_info )
{
- ltcasino_state *state = machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = machine.driver_data<ltcasino_state>();
int tileno, colour;
tileno = state->tile_num_ram[tile_index];
@@ -47,21 +47,21 @@ static TILE_GET_INFO( get_ltcasino_tile_info )
static VIDEO_START(ltcasino)
{
- ltcasino_state *state = machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = machine.driver_data<ltcasino_state>();
state->tilemap = tilemap_create(machine, get_ltcasino_tile_info,tilemap_scan_rows,8, 8,64,32);
}
static WRITE8_HANDLER( ltcasino_tile_num_w )
{
- ltcasino_state *state = space->machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = space->machine().driver_data<ltcasino_state>();
state->tile_num_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
}
static WRITE8_HANDLER( ltcasino_tile_atr_w )
{
- ltcasino_state *state = space->machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = space->machine().driver_data<ltcasino_state>();
state->tile_atr_ram[offset] = data;
tilemap_mark_tile_dirty(state->tilemap,offset);
}
@@ -634,7 +634,7 @@ GFXDECODE_END
static SCREEN_UPDATE(ltcasino)
{
- ltcasino_state *state = screen->machine->driver_data<ltcasino_state>();
+ ltcasino_state *state = screen->machine().driver_data<ltcasino_state>();
tilemap_draw(bitmap,cliprect,state->tilemap,0,0);
return 0;
}
@@ -711,7 +711,7 @@ ROM_END
static DRIVER_INIT(mv4in1)
{
int i;
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
for(i=0;i<0x10000;i++)
rom[i]=BITSWAP8(rom[i],7,6,5,4,3,1,2,0);
}
diff --git a/src/mame/drivers/luckgrln.c b/src/mame/drivers/luckgrln.c
index 853348efaa5..baef1deb01b 100644
--- a/src/mame/drivers/luckgrln.c
+++ b/src/mame/drivers/luckgrln.c
@@ -116,14 +116,14 @@ public:
static WRITE8_HANDLER( luckgrln_reel1_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel1_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel1_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel1_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel1_tilemap,offset);
}
@@ -132,7 +132,7 @@ static WRITE8_HANDLER( luckgrln_reel1_attr_w )
static TILE_GET_INFO( get_luckgrln_reel1_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel1_ram[tile_index];
int attr = state->reel1_attr[tile_index];
int col = (attr & 0x1f);
@@ -150,14 +150,14 @@ static TILE_GET_INFO( get_luckgrln_reel1_tile_info )
static WRITE8_HANDLER( luckgrln_reel2_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel2_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel2_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel2_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel2_tilemap,offset);
}
@@ -165,7 +165,7 @@ static WRITE8_HANDLER( luckgrln_reel2_attr_w )
static TILE_GET_INFO( get_luckgrln_reel2_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel2_ram[tile_index];
int attr = state->reel2_attr[tile_index];
int col = (attr & 0x1f);
@@ -182,14 +182,14 @@ static TILE_GET_INFO( get_luckgrln_reel2_tile_info )
static WRITE8_HANDLER( luckgrln_reel3_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel3_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel3_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel3_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel3_tilemap,offset);
}
@@ -197,7 +197,7 @@ static WRITE8_HANDLER( luckgrln_reel3_attr_w )
static TILE_GET_INFO( get_luckgrln_reel3_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel3_ram[tile_index];
int attr = state->reel3_attr[tile_index];
int col = (attr & 0x1f);
@@ -213,14 +213,14 @@ static TILE_GET_INFO( get_luckgrln_reel3_tile_info )
static WRITE8_HANDLER( luckgrln_reel4_ram_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel4_ram[offset] = data;
tilemap_mark_tile_dirty(state->reel4_tilemap,offset);
}
static WRITE8_HANDLER( luckgrln_reel4_attr_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->reel4_attr[offset] = data;
tilemap_mark_tile_dirty(state->reel4_tilemap,offset);
}
@@ -228,7 +228,7 @@ static WRITE8_HANDLER( luckgrln_reel4_attr_w )
static TILE_GET_INFO( get_luckgrln_reel4_tile_info )
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
int code = state->reel4_ram[tile_index];
int attr = state->reel4_attr[tile_index];
int col = (attr & 0x1f);
@@ -244,7 +244,7 @@ static TILE_GET_INFO( get_luckgrln_reel4_tile_info )
static VIDEO_START(luckgrln)
{
- luckgrln_state *state = machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = machine.driver_data<luckgrln_state>();
state->reel1_tilemap = tilemap_create(machine,get_luckgrln_reel1_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel2_tilemap = tilemap_create(machine,get_luckgrln_reel2_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
state->reel3_tilemap = tilemap_create(machine,get_luckgrln_reel3_tile_info,tilemap_scan_rows, 8, 32, 64, 8);
@@ -263,7 +263,7 @@ static VIDEO_START(luckgrln)
static SCREEN_UPDATE(luckgrln)
{
- luckgrln_state *state = screen->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = screen->machine().driver_data<luckgrln_state>();
int y,x;
int count = 0;
const rectangle &visarea = screen->visible_area();
@@ -341,10 +341,10 @@ static SCREEN_UPDATE(luckgrln)
if (bgenable==3) tilemap_draw(bitmap, &clip, state->reel4_tilemap, 0, 0);
}
- if (tileattr&0x08) drawgfx_transpen(bitmap,&clip,screen->machine->gfx[region],tile,col,0,0,x*8,y*8, 0);
+ if (tileattr&0x08) drawgfx_transpen(bitmap,clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
#else // treat it as priority flag instead (looks better in non-adult title screen - needs verifying)
- if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine->gfx[region],tile,col,0,0,x*8,y*8, 0);
+ if (!(tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
if (tileattr&0x04)
{
@@ -354,7 +354,7 @@ static SCREEN_UPDATE(luckgrln)
if (bgenable==3) tilemap_draw(bitmap, &clip, state->reel4_tilemap, 0, 0);
}
- if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine->gfx[region],tile,col,0,0,x*8,y*8, 0);
+ if ((tileattr&0x08)) drawgfx_transpen(bitmap,&clip,screen->machine().gfx[region],tile,col,0,0,x*8,y*8, 0);
#endif
count++;
@@ -401,7 +401,7 @@ ADDRESS_MAP_END
static WRITE8_HANDLER( output_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
/* correct? */
if (data==0x84)
state->nmi_enable = 0;
@@ -415,19 +415,19 @@ static WRITE8_HANDLER( output_w )
static WRITE8_HANDLER( palette_offset_low_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->palette_count = data<<1;
}
static WRITE8_HANDLER( palette_offset_high_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->palette_count = state->palette_count | data<<9;
}
static WRITE8_HANDLER( palette_w )
{
- luckgrln_state *state = space->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = space->machine().driver_data<luckgrln_state>();
state->palette_ram[state->palette_count] = data;
@@ -442,7 +442,7 @@ static WRITE8_HANDLER( palette_w )
g = (dat >> 5) & 0x1f;
b = (dat >> 10) & 0x1f;
- palette_set_color_rgb(space->machine, offs/2, pal5bit(r), pal5bit(g), pal5bit(b));
+ palette_set_color_rgb(space->machine(), offs/2, pal5bit(r), pal5bit(g), pal5bit(b));
}
@@ -454,7 +454,7 @@ static WRITE8_HANDLER( palette_w )
static READ8_HANDLER( rtc_r )
{
system_time systime;
- space->machine->base_datetime(systime);
+ space->machine().base_datetime(systime);
switch(offset)
{
@@ -534,10 +534,10 @@ static WRITE8_HANDLER(counters_w)
xxxx ---- unused
*/
- coin_counter_w(space->machine, 0, data & 0x01); /* COIN 1 */
- coin_counter_w(space->machine, 1, data & 0x04); /* COIN 2 */
- coin_counter_w(space->machine, 2, data & 0x08); /* COIN 3 */
- coin_counter_w(space->machine, 3, data & 0x02); /* KEY IN */
+ coin_counter_w(space->machine(), 0, data & 0x01); /* COIN 1 */
+ coin_counter_w(space->machine(), 1, data & 0x04); /* COIN 2 */
+ coin_counter_w(space->machine(), 2, data & 0x08); /* COIN 3 */
+ coin_counter_w(space->machine(), 3, data & 0x02); /* KEY IN */
}
@@ -841,9 +841,9 @@ static const mc6845_interface mc6845_intf =
static INTERRUPT_GEN( luckgrln_irq )
{
- luckgrln_state *state = device->machine->driver_data<luckgrln_state>();
+ luckgrln_state *state = device->machine().driver_data<luckgrln_state>();
if(state->nmi_enable)
- cputag_set_input_line(device->machine, "maincpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(device->machine(), "maincpu", INPUT_LINE_NMI, PULSE_LINE);
}
static MACHINE_CONFIG_START( luckgrln, luckgrln_state )
@@ -875,7 +875,7 @@ static DRIVER_INIT( luckgrln )
{
int i;
UINT8 x,v;
- UINT8* rom = machine->region("rom_data")->base();
+ UINT8* rom = machine.region("rom_data")->base();
for (i=0;i<0x20000;i++)
{
@@ -891,7 +891,7 @@ static DRIVER_INIT( luckgrln )
{
FILE *fp;
char filename[256];
- sprintf(filename,"decrypted_%s", machine->system().name);
+ sprintf(filename,"decrypted_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
diff --git a/src/mame/drivers/lucky74.c b/src/mame/drivers/lucky74.c
index 8ef7bc1e3bd..1db4c33f024 100644
--- a/src/mame/drivers/lucky74.c
+++ b/src/mame/drivers/lucky74.c
@@ -683,7 +683,7 @@
static READ8_HANDLER( custom_09R81P_port_r )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
if (offset != 0x00)
{
return state->adpcm_reg[offset];
@@ -696,13 +696,13 @@ static READ8_HANDLER( custom_09R81P_port_r )
static WRITE8_HANDLER( custom_09R81P_port_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
state->adpcm_reg[offset] = data;
}
static WRITE8_DEVICE_HANDLER( ym2149_portb_w )
{
- lucky74_state *state = device->machine->driver_data<lucky74_state>();
+ lucky74_state *state = device->machine().driver_data<lucky74_state>();
/* when is in game mode writes 0x0a.
when is in test mode writes 0x0e.
after reset writes 0x16.
@@ -710,7 +710,7 @@ static WRITE8_DEVICE_HANDLER( ym2149_portb_w )
bit 0 contains the screen orientation.
*/
state->ym2149_portb = data;
- flip_screen_set(device->machine, data & 0x01);
+ flip_screen_set(device->machine(), data & 0x01);
}
static READ8_HANDLER( usart_8251_r )
@@ -722,7 +722,7 @@ static READ8_HANDLER( usart_8251_r )
static WRITE8_HANDLER( usart_8251_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
/* writes to USART 8251 port */
state->usart_8251 = data;
logerror("write to USART port: %02x \n", state->usart_8251);
@@ -737,7 +737,7 @@ static READ8_HANDLER( copro_sm7831_r )
static WRITE8_HANDLER( copro_sm7831_w )
{
- lucky74_state *state = space->machine->driver_data<lucky74_state>();
+ lucky74_state *state = space->machine().driver_data<lucky74_state>();
/* write to SM7831 co-processor */
state->copro_sm7831 = data;
logerror("write to co-processor: %2X\n", state->copro_sm7831);
@@ -794,7 +794,7 @@ static WRITE8_DEVICE_HANDLER(lamps_b_w)
static INTERRUPT_GEN( nmi_interrupt )
{
- lucky74_state *state = device->machine->driver_data<lucky74_state>();
+ lucky74_state *state = device->machine().driver_data<lucky74_state>();
if ((state->ym2149_portb & 0x10) == 0) /* ym2149 portB bit 4 trigger the NMI */
{
device_set_input_line(device, INPUT_LINE_NMI, PULSE_LINE);
@@ -1098,7 +1098,7 @@ GFXDECODE_END
static SOUND_START( lucky74 )
{
- lucky74_state *state = machine->driver_data<lucky74_state>();
+ lucky74_state *state = machine.driver_data<lucky74_state>();
/* cleaning all 09R81P registers */
UINT8 i;
@@ -1113,7 +1113,7 @@ static SOUND_START( lucky74 )
static void lucky74_adpcm_int(device_t *device)
{
- lucky74_state *state = device->machine->driver_data<lucky74_state>();
+ lucky74_state *state = device->machine().driver_data<lucky74_state>();
if (state->adpcm_reg[05] == 0x01) /* register 0x05 (bit 0 activated), trigger the sample */
{
/* conditional zone for samples reproduction */
@@ -1134,7 +1134,7 @@ static void lucky74_adpcm_int(device_t *device)
if (state->adpcm_data == -1)
{
/* transferring 1st nibble */
- state->adpcm_data = device->machine->region("adpcm")->base()[state->adpcm_pos];
+ state->adpcm_data = device->machine().region("adpcm")->base()[state->adpcm_pos];
state->adpcm_pos = (state->adpcm_pos + 1) & 0xffff;
msm5205_data_w(device, state->adpcm_data >> 4);
diff --git a/src/mame/drivers/lvcards.c b/src/mame/drivers/lvcards.c
index bd7f2c6a19d..24c9cf60fb0 100644
--- a/src/mame/drivers/lvcards.c
+++ b/src/mame/drivers/lvcards.c
@@ -82,7 +82,7 @@ TODO:
static MACHINE_START( lvpoker )
{
- lvcards_state *state = machine->driver_data<lvcards_state>();
+ lvcards_state *state = machine.driver_data<lvcards_state>();
state_save_register_global(machine, state->payout);
state_save_register_global(machine, state->pulse);
state_save_register_global(machine, state->result);
@@ -90,7 +90,7 @@ static MACHINE_START( lvpoker )
static MACHINE_RESET( lvpoker )
{
- lvcards_state *state = machine->driver_data<lvcards_state>();
+ lvcards_state *state = machine.driver_data<lvcards_state>();
state->payout = 0;
state->pulse = 0;
state->result = 0;
@@ -98,7 +98,7 @@ static MACHINE_RESET( lvpoker )
static WRITE8_HANDLER(control_port_2_w)
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
switch (data)
{
case 0x60:
@@ -115,7 +115,7 @@ static WRITE8_HANDLER(control_port_2_w)
static WRITE8_HANDLER(control_port_2a_w)
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
switch (data)
{
case 0x60:
@@ -132,8 +132,8 @@ static WRITE8_HANDLER(control_port_2a_w)
static READ8_HANDLER( payout_r )
{
- lvcards_state *state = space->machine->driver_data<lvcards_state>();
- state->result = input_port_read(space->machine, "IN2");
+ lvcards_state *state = space->machine().driver_data<lvcards_state>();
+ state->result = input_port_read(space->machine(), "IN2");
if (state->payout)
{
diff --git a/src/mame/drivers/lwings.c b/src/mame/drivers/lwings.c
index ff8bd2eb293..d6abcb3c931 100644
--- a/src/mame/drivers/lwings.c
+++ b/src/mame/drivers/lwings.c
@@ -62,30 +62,30 @@ Notes:
static WRITE8_HANDLER( avengers_adpcm_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->adpcm = data;
}
static READ8_HANDLER( avengers_adpcm_r )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
return state->adpcm;
}
static WRITE8_HANDLER( lwings_bankswitch_w )
{
/* bit 0 is flip screen */
- flip_screen_set(space->machine, ~data & 0x01);
+ flip_screen_set(space->machine(), ~data & 0x01);
/* bits 1 and 2 select ROM bank */
- memory_set_bank(space->machine, "bank1", (data & 0x06) >> 1);
+ memory_set_bank(space->machine(), "bank1", (data & 0x06) >> 1);
/* bit 3 enables NMI */
interrupt_enable_w(space, 0, data & 0x08);
/* bits 6 and 7 are coin counters */
- coin_counter_w(space->machine, 1, data & 0x40);
- coin_counter_w(space->machine, 0, data & 0x80);
+ coin_counter_w(space->machine(), 1, data & 0x40);
+ coin_counter_w(space->machine(), 0, data & 0x80);
}
static INTERRUPT_GEN( lwings_interrupt )
@@ -97,7 +97,7 @@ static INTERRUPT_GEN( lwings_interrupt )
static WRITE8_HANDLER( avengers_protection_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
int pc = cpu_get_pc(space->cpu);
if (pc == 0x2eeb)
@@ -125,13 +125,13 @@ static WRITE8_HANDLER( avengers_protection_w )
static WRITE8_HANDLER( avengers_prot_bank_w )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
state->palette_pen = data * 64;
}
-static int avengers_fetch_paldata( running_machine *machine )
+static int avengers_fetch_paldata( running_machine &machine )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
static const char pal_data[] =
/* page 1: 0x03,0x02,0x01,0x00 */
@@ -224,7 +224,7 @@ static int avengers_fetch_paldata( running_machine *machine )
static READ8_HANDLER( avengers_protection_r )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
static const int xpos[8] = { 10, 7, 0, -7, -10, -7, 0, 7 };
static const int ypos[8] = { 0, 7, 10, 7, 0, -7, -10, -7 };
int best_dist = 0;
@@ -235,7 +235,7 @@ static READ8_HANDLER( avengers_protection_r )
if (cpu_get_pc(space->cpu) == 0x7c7)
{
/* palette data */
- return avengers_fetch_paldata(space->machine);
+ return avengers_fetch_paldata(space->machine());
}
/* Point to Angle Function
@@ -261,7 +261,7 @@ static READ8_HANDLER( avengers_protection_r )
static READ8_HANDLER( avengers_soundlatch2_r )
{
- lwings_state *state = space->machine->driver_data<lwings_state>();
+ lwings_state *state = space->machine().driver_data<lwings_state>();
UINT8 data = *state->soundlatch2 | state->soundstate;
state->soundstate = 0;
return(data);
@@ -742,8 +742,8 @@ static const msm5205_interface msm5205_config =
static MACHINE_START( lwings )
{
- lwings_state *state = machine->driver_data<lwings_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ lwings_state *state = machine.driver_data<lwings_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x4000);
@@ -758,7 +758,7 @@ static MACHINE_START( lwings )
static MACHINE_RESET( lwings )
{
- lwings_state *state = machine->driver_data<lwings_state>();
+ lwings_state *state = machine.driver_data<lwings_state>();
state->bg2_image = 0;
state->scroll_x[0] = 0;
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index 81ab3585d8f..6a38d9bbac1 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -130,14 +130,14 @@ Notes (couriersud)
static WRITE8_DEVICE_HANDLER( ic8j1_output_changed )
{
- m10_state *state = device->machine->driver_data<m10_state>();
- LOG(("ic8j1: %d %d\n", data, device->machine->primary_screen->vpos()));
+ m10_state *state = device->machine().driver_data<m10_state>();
+ LOG(("ic8j1: %d %d\n", data, device->machine().primary_screen->vpos()));
device_set_input_line(state->maincpu, 0, !data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_DEVICE_HANDLER( ic8j2_output_changed )
{
- m10_state *state = device->machine->driver_data<m10_state>();
+ m10_state *state = device->machine().driver_data<m10_state>();
/* written from /Q to A with slight delight */
LOG(("ic8j2: %d\n", data));
@@ -194,12 +194,12 @@ static PALETTE_INIT( m10 )
static MACHINE_START( m10 )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
- state->maincpu = machine->device("maincpu");
- state->ic8j1 = machine->device("ic8j1");
- state->ic8j2 = machine->device("ic8j2");
- state->samples = machine->device("samples");
+ state->maincpu = machine.device("maincpu");
+ state->ic8j1 = machine.device("ic8j1");
+ state->ic8j2 = machine.device("ic8j2");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->bottomline));
state->save_item(NAME(state->flip));
@@ -208,7 +208,7 @@ static MACHINE_START( m10 )
static MACHINE_RESET( m10 )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
state->bottomline = 0;
state->flip = 0;
@@ -242,7 +242,7 @@ static MACHINE_RESET( m10 )
static WRITE8_HANDLER( m10_ctrl_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
#if DEBUG
if (data & 0x40)
@@ -252,11 +252,11 @@ static WRITE8_HANDLER( m10_ctrl_w )
/* I have NO IDEA if this is correct or not */
state->bottomline = ~data & 0x20;
- if (input_port_read(space->machine, "CAB") & 0x01)
+ if (input_port_read(space->machine(), "CAB") & 0x01)
state->flip = ~data & 0x10;
- if (!(input_port_read(space->machine, "CAB") & 0x02))
- space->machine->sound().system_mute(data & 0x80);
+ if (!(input_port_read(space->machine(), "CAB") & 0x02))
+ space->machine().sound().system_mute(data & 0x80);
/* sound command in lower 4 bytes */
switch (data & 0x07)
@@ -319,7 +319,7 @@ static WRITE8_HANDLER( m10_ctrl_w )
static WRITE8_HANDLER( m11_ctrl_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
#if DEBUG
if (data & 0x4c)
@@ -328,11 +328,11 @@ static WRITE8_HANDLER( m11_ctrl_w )
state->bottomline = ~data & 0x20;
- if (input_port_read(space->machine, "CAB") & 0x01)
+ if (input_port_read(space->machine(), "CAB") & 0x01)
state->flip = ~data & 0x10;
- if (!(input_port_read(space->machine, "CAB") & 0x02))
- space->machine->sound().system_mute(data & 0x80);
+ if (!(input_port_read(space->machine(), "CAB") & 0x02))
+ space->machine().sound().system_mute(data & 0x80);
}
/*
@@ -352,16 +352,16 @@ static WRITE8_HANDLER( m11_ctrl_w )
static WRITE8_HANDLER( m15_ctrl_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
#if DEBUG
if (data & 0xf0)
popmessage("M15 ctrl: %02x",data);
#endif
- if (input_port_read(space->machine, "CAB") & 0x01)
+ if (input_port_read(space->machine(), "CAB") & 0x01)
state->flip = ~data & 0x04;
- if (!(input_port_read(space->machine, "CAB") & 0x02))
- space->machine->sound().system_mute(data & 0x08);
+ if (!(input_port_read(space->machine(), "CAB") & 0x02))
+ space->machine().sound().system_mute(data & 0x08);
}
@@ -388,7 +388,7 @@ static WRITE8_HANDLER( m10_a500_w )
static WRITE8_HANDLER( m11_a100_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
int raising_bits = data & ~state->last;
//int falling_bits = ~data & state->last;
@@ -423,7 +423,7 @@ static WRITE8_HANDLER( m11_a100_w )
static WRITE8_HANDLER( m15_a100_w )
{
- m10_state *state = space->machine->driver_data<m10_state>();
+ m10_state *state = space->machine().driver_data<m10_state>();
//int raising_bits = data & ~state->last;
int falling_bits = ~data & state->last;
@@ -481,8 +481,8 @@ static WRITE8_HANDLER( m15_a100_w )
static READ8_HANDLER( m10_a700_r )
{
- m10_state *state = space->machine->driver_data<m10_state>();
- //LOG(("rd:%d\n",space->machine->primary_screen->vpos()));
+ m10_state *state = space->machine().driver_data<m10_state>();
+ //LOG(("rd:%d\n",space->machine().primary_screen->vpos()));
LOG(("clear\n"));
ttl74123_clear_w(state->ic8j1, 0, 0);
ttl74123_clear_w(state->ic8j1, 0, 1);
@@ -491,8 +491,8 @@ static READ8_HANDLER( m10_a700_r )
static READ8_HANDLER( m11_a700_r )
{
- m10_state *state = space->machine->driver_data<m10_state>();
- //LOG(("rd:%d\n",space->machine->primary_screen->vpos()));
+ m10_state *state = space->machine().driver_data<m10_state>();
+ //LOG(("rd:%d\n",space->machine().primary_screen->vpos()));
//device_set_input_line(state->maincpu, 0, CLEAR_LINE);
LOG(("clear\n"));
ttl74123_clear_w(state->ic8j1, 0, 0);
@@ -508,7 +508,7 @@ static READ8_HANDLER( m11_a700_r )
static INPUT_CHANGED( coin_inserted )
{
- m10_state *state = field->port->machine->driver_data<m10_state>();
+ m10_state *state = field->port->machine().driver_data<m10_state>();
/* coin insertion causes an NMI */
device_set_input_line(state->maincpu, INPUT_LINE_NMI, newval ? ASSERT_LINE : CLEAR_LINE);
}
@@ -516,16 +516,16 @@ static INPUT_CHANGED( coin_inserted )
static TIMER_CALLBACK( interrupt_callback )
{
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
if (param == 0)
{
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(IREMM10_VBSTART + 16), FUNC(interrupt_callback), 1);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBSTART + 16), FUNC(interrupt_callback), 1);
}
if (param == 1)
{
device_set_input_line(state->maincpu, 0, ASSERT_LINE);
- machine->scheduler().timer_set(machine->primary_screen->time_until_pos(IREMM10_VBSTART + 24), FUNC(interrupt_callback), 2);
+ machine.scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBSTART + 24), FUNC(interrupt_callback), 2);
}
if (param == -1)
device_set_input_line(state->maincpu, 0, CLEAR_LINE);
@@ -536,7 +536,7 @@ static TIMER_CALLBACK( interrupt_callback )
static INTERRUPT_GEN( m11_interrupt )
{
device_set_input_line(device, 0, ASSERT_LINE);
- //device->machine->scheduler().timer_set(machine->primary_screen->time_until_pos(IREMM10_VBEND), FUNC(interrupt_callback), -1);
+ //device->machine().scheduler().timer_set(machine.primary_screen->time_until_pos(IREMM10_VBEND), FUNC(interrupt_callback), -1);
}
static INTERRUPT_GEN( m10_interrupt )
@@ -548,7 +548,7 @@ static INTERRUPT_GEN( m10_interrupt )
static INTERRUPT_GEN( m15_interrupt )
{
device_set_input_line(device, 0, ASSERT_LINE);
- device->machine->scheduler().timer_set(device->machine->primary_screen->time_until_pos(IREMM10_VBSTART + 1, 80), FUNC(interrupt_callback), -1);
+ device->machine().scheduler().timer_set(device->machine().primary_screen->time_until_pos(IREMM10_VBSTART + 1, 80), FUNC(interrupt_callback), -1);
}
/*************************************
@@ -930,7 +930,7 @@ MACHINE_CONFIG_END
static DRIVER_INIT( andromed )
{
int i;
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
for (i = 0x1c00; i < 0x2000; i++)
state->rom[i] = 0x60;
@@ -939,7 +939,7 @@ static DRIVER_INIT( andromed )
static DRIVER_INIT( ipminva1 )
{
int i;
- m10_state *state = machine->driver_data<m10_state>();
+ m10_state *state = machine.driver_data<m10_state>();
for (i = 0x1400; i < 0x17ff; i++)
state->rom[i] = 0x60;
diff --git a/src/mame/drivers/m107.c b/src/mame/drivers/m107.c
index a0ac6fb5b1b..793506987ba 100644
--- a/src/mame/drivers/m107.c
+++ b/src/mame/drivers/m107.c
@@ -48,48 +48,48 @@ static WRITE16_HANDLER( bankswitch_w )
{
if (ACCESSING_BITS_0_7)
{
- UINT8 *RAM = space->machine->region("maincpu")->base();
- memory_set_bankptr(space->machine, "bank1",&RAM[0x100000 + ((data&0x7)*0x10000)]);
+ UINT8 *RAM = space->machine().region("maincpu")->base();
+ memory_set_bankptr(space->machine(), "bank1",&RAM[0x100000 + ((data&0x7)*0x10000)]);
}
}
static MACHINE_START( m107 )
{
- m107_state *state = machine->driver_data<m107_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m107_scanline_interrupt));
+ m107_state *state = machine.driver_data<m107_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(m107_scanline_interrupt));
}
static MACHINE_RESET( m107 )
{
- m107_state *state = machine->driver_data<m107_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ m107_state *state = machine.driver_data<m107_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
/*****************************************************************************/
static TIMER_CALLBACK( m107_scanline_interrupt )
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
int scanline = param;
/* raster interrupt */
if (scanline == state->raster_irq_position)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M107_IRQ_2);
}
/* VBLANK interrupt */
- else if (scanline == machine->primary_screen->visible_area().max_y + 1)
+ else if (scanline == machine.primary_screen->visible_area().max_y + 1)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M107_IRQ_0);
}
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
@@ -97,8 +97,8 @@ static WRITE16_HANDLER( m107_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
}
}
@@ -108,7 +108,7 @@ enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR };
static TIMER_CALLBACK( setvector_callback )
{
- m107_state *state = machine->driver_data<m107_state>();
+ m107_state *state = machine.driver_data<m107_state>();
switch(param)
{
@@ -120,9 +120,9 @@ static TIMER_CALLBACK( setvector_callback )
}
if (state->irqvector & 0x2) /* YM2151 has precedence */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x18);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x18);
else if (state->irqvector & 0x1) /* V30 */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x19);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x19);
if (state->irqvector == 0) /* no IRQs pending */
cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);
@@ -132,7 +132,7 @@ static TIMER_CALLBACK( setvector_callback )
static WRITE16_HANDLER( m107_soundlatch_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
soundlatch_w(space, 0, data & 0xff);
// logerror("soundlatch_w %02x\n",data);
}
@@ -140,7 +140,7 @@ static WRITE16_HANDLER( m107_soundlatch_w )
static READ16_HANDLER( m107_sound_status_r )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
return state->sound_status;
}
@@ -151,19 +151,19 @@ static READ16_HANDLER( m107_soundlatch_r )
static WRITE16_HANDLER( m107_sound_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
}
static WRITE16_HANDLER( m107_sound_status_w )
{
- m107_state *state = space->machine->driver_data<m107_state>();
+ m107_state *state = space->machine().driver_data<m107_state>();
COMBINE_DATA(&state->sound_status);
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, HOLD_LINE, M107_IRQ_3);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, HOLD_LINE, M107_IRQ_3);
}
static WRITE16_HANDLER( m107_sound_reset_w )
{
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
}
/*****************************************************************************/
@@ -805,9 +805,9 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
if (state)
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
}
static const ym2151_interface ym2151_config =
@@ -1014,13 +1014,13 @@ ROM_END
static DRIVER_INIT( firebarr )
{
- m107_state *state = machine->driver_data<m107_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m107_state *state = machine.driver_data<m107_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x7fff0, 0x10); /* Start vector */
memory_set_bankptr(machine, "bank1", &RAM[0xa0000]); /* Initial bank */
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
memcpy(RAM + 0xffff0,RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
state->irq_vectorbase = 0x20;
@@ -1029,13 +1029,13 @@ static DRIVER_INIT( firebarr )
static DRIVER_INIT( dsoccr94 )
{
- m107_state *state = machine->driver_data<m107_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m107_state *state = machine.driver_data<m107_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x7fff0, 0x10); /* Start vector */
memory_set_bankptr(machine, "bank1", &RAM[0xa0000]); /* Initial bank */
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
state->irq_vectorbase = 0x80;
@@ -1044,13 +1044,13 @@ static DRIVER_INIT( dsoccr94 )
static DRIVER_INIT( wpksoc )
{
- m107_state *state = machine->driver_data<m107_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m107_state *state = machine.driver_data<m107_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x7fff0, 0x10); /* Start vector */
memory_set_bankptr(machine, "bank1", &RAM[0xa0000]); /* Initial bank */
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
memcpy(RAM + 0xffff0, RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
diff --git a/src/mame/drivers/m14.c b/src/mame/drivers/m14.c
index b6b33d19c58..7b835476ad8 100644
--- a/src/mame/drivers/m14.c
+++ b/src/mame/drivers/m14.c
@@ -99,7 +99,7 @@ static PALETTE_INIT( m14 )
static TILE_GET_INFO( m14_get_tile_info )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
int code = state->video_ram[tile_index];
int color = state->color_ram[tile_index] & 0x0f;
@@ -115,14 +115,14 @@ static TILE_GET_INFO( m14_get_tile_info )
static VIDEO_START( m14 )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
state->m14_tilemap = tilemap_create(machine, m14_get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
}
static SCREEN_UPDATE( m14 )
{
- m14_state *state = screen->machine->driver_data<m14_state>();
+ m14_state *state = screen->machine().driver_data<m14_state>();
tilemap_draw(bitmap, cliprect, state->m14_tilemap, 0, 0);
return 0;
@@ -131,7 +131,7 @@ static SCREEN_UPDATE( m14 )
static WRITE8_HANDLER( m14_vram_w )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
state->video_ram[offset] = data;
tilemap_mark_tile_dirty(state->m14_tilemap, offset);
@@ -139,7 +139,7 @@ static WRITE8_HANDLER( m14_vram_w )
static WRITE8_HANDLER( m14_cram_w )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
state->color_ram[offset] = data;
tilemap_mark_tile_dirty(state->m14_tilemap, offset);
@@ -154,13 +154,13 @@ static WRITE8_HANDLER( m14_cram_w )
static READ8_HANDLER( m14_rng_r )
{
/* graphic artifacts happens if this doesn't return random values. */
- return (space->machine->rand() & 0x0f) | 0xf0; /* | (input_port_read(space->machine, "IN1") & 0x80)*/;
+ return (space->machine().rand() & 0x0f) | 0xf0; /* | (input_port_read(space->machine(), "IN1") & 0x80)*/;
}
/* Here routes the hopper & the inputs */
static READ8_HANDLER( input_buttons_r )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
if (state->hop_mux)
{
@@ -168,7 +168,7 @@ static READ8_HANDLER( input_buttons_r )
return 0; //0x43 status bits
}
else
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
}
#if 0
@@ -184,7 +184,7 @@ static WRITE8_HANDLER( test_w )
static WRITE8_HANDLER( hopper_w )
{
- m14_state *state = space->machine->driver_data<m14_state>();
+ m14_state *state = space->machine().driver_data<m14_state>();
/* ---- x--- coin out */
/* ---- --x- hopper/input mux? */
@@ -222,7 +222,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( left_coin_inserted )
{
- m14_state *state = field->port->machine->driver_data<m14_state>();
+ m14_state *state = field->port->machine().driver_data<m14_state>();
/* left coin insertion causes a rst6.5 (vector 0x34) */
if (newval)
device_set_input_line(state->maincpu, I8085_RST65_LINE, HOLD_LINE);
@@ -230,7 +230,7 @@ static INPUT_CHANGED( left_coin_inserted )
static INPUT_CHANGED( right_coin_inserted )
{
- m14_state *state = field->port->machine->driver_data<m14_state>();
+ m14_state *state = field->port->machine().driver_data<m14_state>();
/* right coin insertion causes a rst5.5 (vector 0x2c) */
if (newval)
device_set_input_line(state->maincpu, I8085_RST55_LINE, HOLD_LINE);
@@ -314,16 +314,16 @@ static INTERRUPT_GEN( m14_irq )
static MACHINE_START( m14 )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->save_item(NAME(state->hop_mux));
}
static MACHINE_RESET( m14 )
{
- m14_state *state = machine->driver_data<m14_state>();
+ m14_state *state = machine.driver_data<m14_state>();
state->hop_mux = 0;
}
diff --git a/src/mame/drivers/m52.c b/src/mame/drivers/m52.c
index 2ef7c62edd8..00acb262403 100644
--- a/src/mame/drivers/m52.c
+++ b/src/mame/drivers/m52.c
@@ -382,7 +382,7 @@ GFXDECODE_END
static MACHINE_RESET( m52 )
{
- m52_state *state = machine->driver_data<m52_state>();
+ m52_state *state = machine.driver_data<m52_state>();
state->bg1xpos = 0;
state->bg1ypos = 0;
diff --git a/src/mame/drivers/m58.c b/src/mame/drivers/m58.c
index b1d22552763..e837aaa17ba 100644
--- a/src/mame/drivers/m58.c
+++ b/src/mame/drivers/m58.c
@@ -435,7 +435,7 @@ static DRIVER_INIT( yard85 )
// on these sets the content of the sprite color PROM needs reversing
// are the proms on the other sets from bootleg boards, or hand modified?
UINT8* buffer = auto_alloc_array(machine, UINT8, 0x10);
- UINT8* region = machine->region("proms")->base();
+ UINT8* region = machine.region("proms")->base();
int i;
for (i=0;i<0x10;i++)
diff --git a/src/mame/drivers/m62.c b/src/mame/drivers/m62.c
index b5f1fe71929..974f02afc87 100644
--- a/src/mame/drivers/m62.c
+++ b/src/mame/drivers/m62.c
@@ -84,21 +84,21 @@ other supported games as well.
static READ8_HANDLER( ldrun2_bankswitch_r )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
if (state->ldrun2_bankswap)
{
state->ldrun2_bankswap--;
/* swap to bank #1 on second read */
if (state->ldrun2_bankswap == 0)
- memory_set_bank(space->machine, "bank1", 1);
+ memory_set_bank(space->machine(), "bank1", 1);
}
return 0;
}
static WRITE8_HANDLER( ldrun2_bankswitch_w )
{
- m62_state *state = space->machine->driver_data<m62_state>();
+ m62_state *state = space->machine().driver_data<m62_state>();
static const int banks[30] =
{
0,0,0,0,0,1,0,1,0,0,
@@ -116,7 +116,7 @@ static WRITE8_HANDLER( ldrun2_bankswitch_w )
logerror("unknown bank select %02x\n",data);
return;
}
- memory_set_bank(space->machine, "bank1", banks[data - 1]);
+ memory_set_bank(space->machine(), "bank1", banks[data - 1]);
}
else
{
@@ -145,30 +145,30 @@ static READ8_HANDLER( ldrun3_prot_7_r )
static WRITE8_HANDLER( ldrun4_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
static WRITE8_HANDLER( kidniki_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x0f);
+ memory_set_bank(space->machine(), "bank1", data & 0x0f);
}
#define battroad_bankswitch_w kidniki_bankswitch_w
static WRITE8_HANDLER( spelunkr_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
}
static WRITE8_HANDLER( spelunk2_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", (data & 0xc0) >> 6);
- memory_set_bank(space->machine, "bank2", (data & 0x3c) >> 2);
+ memory_set_bank(space->machine(), "bank1", (data & 0xc0) >> 6);
+ memory_set_bank(space->machine(), "bank2", (data & 0x3c) >> 2);
}
static WRITE8_HANDLER( youjyudn_bankswitch_w )
{
- memory_set_bank(space->machine, "bank1", data & 0x01);
+ memory_set_bank(space->machine(), "bank1", data & 0x01);
}
@@ -932,7 +932,7 @@ GFXDECODE_END
static MACHINE_START( m62 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->save_item(NAME(state->ldrun2_bankswap));
state->save_item(NAME(state->bankcontrol));
@@ -940,7 +940,7 @@ static MACHINE_START( m62 )
static MACHINE_RESET( m62 )
{
- m62_state *state = machine->driver_data<m62_state>();
+ m62_state *state = machine.driver_data<m62_state>();
state->flipscreen = 0;
state->m62_background_hscroll = 0;
@@ -2161,50 +2161,50 @@ ROM_END
static DRIVER_INIT( battroad )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun2 )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( ldrun4 )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
static DRIVER_INIT( kidniki )
{
- UINT8 *ROM = machine->region("maincpu")->base();
+ UINT8 *ROM = machine.region("maincpu")->base();
/* in Kid Niki, bank 0 has code falling from 7fff to 8000, */
/* so I have to copy it there because bank switching wouldn't catch it */
memcpy(ROM + 0x08000, ROM + 0x10000, 0x2000);
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunkr )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x10000, 0x2000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x10000, 0x2000);
}
static DRIVER_INIT( spelunk2 )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 4, machine->region("maincpu")->base() + 0x20000, 0x1000);
- memory_configure_bank(machine, "bank2", 0, 16, machine->region("maincpu")->base() + 0x10000, 0x1000);
+ memory_configure_bank(machine, "bank1", 0, 4, machine.region("maincpu")->base() + 0x20000, 0x1000);
+ memory_configure_bank(machine, "bank2", 0, 16, machine.region("maincpu")->base() + 0x10000, 0x1000);
}
static DRIVER_INIT( youjyudn )
{
/* configure memory banks */
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("maincpu")->base() + 0x10000, 0x4000);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("maincpu")->base() + 0x10000, 0x4000);
}
GAME( 1984, kungfum, 0, kungfum, kungfum, 0, ROT0, "Irem", "Kung-Fu Master", GAME_SUPPORTS_SAVE )
diff --git a/src/mame/drivers/m63.c b/src/mame/drivers/m63.c
index 598e7c4c58f..e8eba959c88 100644
--- a/src/mame/drivers/m63.c
+++ b/src/mame/drivers/m63.c
@@ -209,7 +209,7 @@ static PALETTE_INIT( m63 )
static WRITE8_HANDLER( m63_videoram_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -217,7 +217,7 @@ static WRITE8_HANDLER( m63_videoram_w )
static WRITE8_HANDLER( m63_colorram_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
@@ -225,7 +225,7 @@ static WRITE8_HANDLER( m63_colorram_w )
static WRITE8_HANDLER( m63_videoram2_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->videoram2[offset] = data;
tilemap_mark_tile_dirty(state->fg_tilemap, offset);
@@ -233,7 +233,7 @@ static WRITE8_HANDLER( m63_videoram2_w )
static WRITE8_HANDLER( m63_palbank_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if (state->pal_bank != (data & 0x01))
{
@@ -244,25 +244,25 @@ static WRITE8_HANDLER( m63_palbank_w )
static WRITE8_HANDLER( m63_flipscreen_w )
{
- if (flip_screen_get(space->machine) != (~data & 0x01))
+ if (flip_screen_get(space->machine()) != (~data & 0x01))
{
- flip_screen_set(space->machine, ~data & 0x01);
- tilemap_mark_all_tiles_dirty_all(space->machine);
+ flip_screen_set(space->machine(), ~data & 0x01);
+ tilemap_mark_all_tiles_dirty_all(space->machine());
}
}
static WRITE8_HANDLER( fghtbskt_flipscreen_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
- flip_screen_set(space->machine, data);
- state->fg_flag = flip_screen_get(space->machine) ? TILE_FLIPX : 0;
+ flip_screen_set(space->machine(), data);
+ state->fg_flag = flip_screen_get(space->machine()) ? TILE_FLIPX : 0;
}
static TILE_GET_INFO( get_bg_tile_info )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
int attr = state->colorram[tile_index];
int code = state->videoram[tile_index] | ((attr & 0x30) << 4);
@@ -273,7 +273,7 @@ static TILE_GET_INFO( get_bg_tile_info )
static TILE_GET_INFO( get_fg_tile_info )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
int code = state->videoram2[tile_index];
@@ -282,7 +282,7 @@ static TILE_GET_INFO( get_fg_tile_info )
static VIDEO_START( m63 )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
@@ -291,9 +291,9 @@ static VIDEO_START( m63 )
tilemap_set_transparent_pen(state->fg_tilemap, 0);
}
-static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect )
+static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
int offs;
for (offs = 0; offs < state->spriteram_size; offs += 4)
@@ -314,7 +314,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
}
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx, sy, 0);
@@ -323,7 +323,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
if (sx > 0xf0)
{
drawgfx_transpen(bitmap, cliprect,
- machine->gfx[2],
+ machine.gfx[2],
code, color,
flipx, flipy,
sx - 0x100, sy, 0);
@@ -334,7 +334,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect
static SCREEN_UPDATE( m63 )
{
- m63_state *state = screen->machine->driver_data<m63_state>();
+ m63_state *state = screen->machine().driver_data<m63_state>();
int col;
@@ -342,7 +342,7 @@ static SCREEN_UPDATE( m63 )
tilemap_set_scrolly(state->bg_tilemap, col, state->scrollram[col * 8]);
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
- draw_sprites(screen->machine, bitmap, cliprect);
+ draw_sprites(screen->machine(), bitmap, cliprect);
tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0);
return 0;
}
@@ -350,19 +350,19 @@ static SCREEN_UPDATE( m63 )
static WRITE8_HANDLER( coin_w )
{
- coin_counter_w(space->machine, offset, data & 0x01);
+ coin_counter_w(space->machine(), offset, data & 0x01);
}
static WRITE8_HANDLER( snd_irq_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
device_set_input_line(state->soundcpu, 0, ASSERT_LINE);
- space->machine->scheduler().synchronize();
+ space->machine().scheduler().synchronize();
}
static WRITE8_HANDLER( snddata_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if ((state->p2 & 0xf0) == 0xe0)
ay8910_address_w(state->ay1, 0, offset);
@@ -378,13 +378,13 @@ static WRITE8_HANDLER( snddata_w )
static WRITE8_HANDLER( p1_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->p1 = data;
}
static WRITE8_HANDLER( p2_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
state->p2 = data;
if((state->p2 & 0xf0) == 0x50)
@@ -395,13 +395,13 @@ static WRITE8_HANDLER( p2_w )
static READ8_HANDLER( snd_status_r )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
return state->sound_status;
}
static READ8_HANDLER( irq_r )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if (state->sound_irq)
{
@@ -413,18 +413,18 @@ static READ8_HANDLER( irq_r )
static READ8_HANDLER( snddata_r )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
switch (state->p2 & 0xf0)
{
case 0x60: return soundlatch_r(space, 0); ;
- case 0x70: return space->machine->region("user1")->base()[((state->p1 & 0x1f) << 8) | offset];
+ case 0x70: return space->machine().region("user1")->base()[((state->p1 & 0x1f) << 8) | offset];
}
return 0xff;
}
static WRITE8_HANDLER( fghtbskt_samples_w )
{
- m63_state *state = space->machine->driver_data<m63_state>();
+ m63_state *state = space->machine().driver_data<m63_state>();
if (data & 1)
sample_start_raw(state->samples, 0, state->samplebuf + ((data & 0xf0) << 8), 0x2000, 8000, 0);
@@ -673,10 +673,10 @@ GFXDECODE_END
static SAMPLES_START( fghtbskt_sh_start )
{
- running_machine *machine = device->machine;
- m63_state *state = machine->driver_data<m63_state>();
- int i, len = machine->region("samples")->bytes();
- UINT8 *ROM = machine->region("samples")->base();
+ running_machine &machine = device->machine();
+ m63_state *state = machine.driver_data<m63_state>();
+ int i, len = machine.region("samples")->bytes();
+ UINT8 *ROM = machine.region("samples")->base();
state->samplebuf = auto_alloc_array(machine, INT16, len);
state->save_pointer(NAME(state->samplebuf), len);
@@ -694,18 +694,18 @@ static const samples_interface fghtbskt_samples_interface =
static INTERRUPT_GEN( snd_irq )
{
- m63_state *state = device->machine->driver_data<m63_state>();
+ m63_state *state = device->machine().driver_data<m63_state>();
state->sound_irq = 1;
}
static MACHINE_START( m63 )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
- state->soundcpu = machine->device("soundcpu");
- state->ay1 = machine->device("ay1");
- state->ay2 = machine->device("ay2");
- state->samples = machine->device("samples");
+ state->soundcpu = machine.device("soundcpu");
+ state->ay1 = machine.device("ay1");
+ state->ay2 = machine.device("ay2");
+ state->samples = machine.device("samples");
state->save_item(NAME(state->pal_bank));
state->save_item(NAME(state->fg_flag));
@@ -720,7 +720,7 @@ static MACHINE_START( m63 )
static MACHINE_RESET( m63 )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->pal_bank = 0;
state->fg_flag = 0;
@@ -992,13 +992,13 @@ ROM_END
static DRIVER_INIT( wilytowr )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->sy_offset = 238;
}
static DRIVER_INIT( fghtbskt )
{
- m63_state *state = machine->driver_data<m63_state>();
+ m63_state *state = machine.driver_data<m63_state>();
state->sy_offset = 240;
}
diff --git a/src/mame/drivers/m72.c b/src/mame/drivers/m72.c
index 2f754c7c28b..f7e7758854a 100644
--- a/src/mame/drivers/m72.c
+++ b/src/mame/drivers/m72.c
@@ -105,8 +105,8 @@ static TIMER_CALLBACK( kengo_scanline_interrupt );
static MACHINE_START( m72 )
{
- m72_state *state = machine->driver_data<m72_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m72_scanline_interrupt));
+ m72_state *state = machine.driver_data<m72_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(m72_scanline_interrupt));
state->save_item(NAME(state->mcu_sample_addr));
state->save_item(NAME(state->mcu_snd_cmd_latch));
@@ -114,8 +114,8 @@ static MACHINE_START( m72 )
static MACHINE_START( kengo )
{
- m72_state *state = machine->driver_data<m72_state>();
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(kengo_scanline_interrupt));
+ m72_state *state = machine.driver_data<m72_state>();
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(kengo_scanline_interrupt));
state->save_item(NAME(state->mcu_sample_addr));
state->save_item(NAME(state->mcu_snd_cmd_latch));
@@ -123,68 +123,68 @@ static MACHINE_START( kengo )
static TIMER_CALLBACK( synch_callback )
{
- //machine->scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000));
- machine->scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25));
+ //machine.scheduler().boost_interleave(attotime::zero, attotime::from_usec(8000000));
+ machine.scheduler().boost_interleave(attotime::from_hz(MASTER_CLOCK/4/12), attotime::from_seconds(25));
}
static MACHINE_RESET( m72 )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->irq_base = 0x20;
state->mcu_sample_addr = 0;
state->mcu_snd_cmd_latch = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
- machine->scheduler().synchronize(FUNC(synch_callback));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
+ machine.scheduler().synchronize(FUNC(synch_callback));
}
static MACHINE_RESET( xmultipl )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->irq_base = 0x08;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
static MACHINE_RESET( kengo )
{
- m72_state *state = machine->driver_data<m72_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ m72_state *state = machine.driver_data<m72_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
static TIMER_CALLBACK( m72_scanline_interrupt )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
int scanline = param;
/* raster interrupt - visible area only? */
if (scanline < 256 && scanline == state->raster_irq_position - 128)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, state->irq_base + 2);
}
/* VBLANK interrupt */
else if (scanline == 256)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, state->irq_base + 0);
}
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static TIMER_CALLBACK( kengo_scanline_interrupt )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
int scanline = param;
/* raster interrupt - visible area only? */
if (scanline < 256 && scanline == state->raster_irq_position - 128)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line(machine, "maincpu", NEC_INPUT_LINE_INTP2, ASSERT_LINE);
}
else
@@ -193,16 +193,16 @@ static TIMER_CALLBACK( kengo_scanline_interrupt )
/* VBLANK interrupt */
if (scanline == 256)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line(machine, "maincpu", NEC_INPUT_LINE_INTP0, ASSERT_LINE);
}
else
cputag_set_input_line(machine, "maincpu", NEC_INPUT_LINE_INTP0, CLEAR_LINE);
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
/***************************************************************************
@@ -232,20 +232,20 @@ static TIMER_CALLBACK( delayed_ram16_w )
static WRITE16_HANDLER( m72_main_mcu_sound_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (data & 0xfff0)
logerror("sound_w: %04x %04x\n", mem_mask, data);
if (ACCESSING_BITS_0_7)
{
state->mcu_snd_cmd_latch = data;
- cputag_set_input_line(space->machine, "mcu", 1, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 1, ASSERT_LINE);
}
}
static WRITE16_HANDLER( m72_main_mcu_w)
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT16 val = state->protection_ram[offset];
COMBINE_DATA(&val);
@@ -257,33 +257,33 @@ static WRITE16_HANDLER( m72_main_mcu_w)
if (offset == 0x0fff/2 && ACCESSING_BITS_8_15)
{
state->protection_ram[offset] = val;
- cputag_set_input_line(space->machine, "mcu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, ASSERT_LINE);
/* Line driven, most likely by write line */
- //space->machine->scheduler().timer_set(space->machine->device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear));
- //space->machine->scheduler().timer_set(space->machine->device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise));
+ //space->machine().scheduler().timer_set(space->machine().device<cpu_device>("mcu")->cycles_to_attotime(2), FUNC(mcu_irq0_clear));
+ //space->machine().scheduler().timer_set(space->machine().device<cpu_device>("mcu")->cycles_to_attotime(0), FUNC(mcu_irq0_raise));
}
else
- space->machine->scheduler().synchronize( FUNC(delayed_ram16_w), (offset<<16) | val, state->protection_ram);
+ space->machine().scheduler().synchronize( FUNC(delayed_ram16_w), (offset<<16) | val, state->protection_ram);
}
static WRITE8_HANDLER( m72_mcu_data_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT16 val;
if (offset&1) val = (state->protection_ram[offset/2] & 0x00ff) | (data << 8);
else val = (state->protection_ram[offset/2] & 0xff00) | (data&0xff);
- space->machine->scheduler().synchronize( FUNC(delayed_ram16_w), ((offset >>1 ) << 16) | val, state->protection_ram);
+ space->machine().scheduler().synchronize( FUNC(delayed_ram16_w), ((offset >>1 ) << 16) | val, state->protection_ram);
}
static READ8_HANDLER(m72_mcu_data_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT8 ret;
if (offset == 0x0fff || offset == 0x0ffe)
{
- cputag_set_input_line(space->machine, "mcu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "mcu", 0, CLEAR_LINE);
}
if (offset&1) ret = (state->protection_ram[offset/2] & 0xff00)>>8;
@@ -294,30 +294,30 @@ static READ8_HANDLER(m72_mcu_data_r )
static INTERRUPT_GEN( m72_mcu_int )
{
- m72_state *state = device->machine->driver_data<m72_state>();
+ m72_state *state = device->machine().driver_data<m72_state>();
//state->mcu_snd_cmd_latch |= 0x11; /* 0x10 is special as well - FIXME */
- state->mcu_snd_cmd_latch = 0x11;// | (machine->rand() & 1); /* 0x10 is special as well - FIXME */
+ state->mcu_snd_cmd_latch = 0x11;// | (machine.rand() & 1); /* 0x10 is special as well - FIXME */
device_set_input_line(device, 1, ASSERT_LINE);
}
static READ8_HANDLER(m72_mcu_sample_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
UINT8 sample;
- sample = space->machine->region("samples")->base()[state->mcu_sample_addr++];
+ sample = space->machine().region("samples")->base()[state->mcu_sample_addr++];
return sample;
}
static WRITE8_HANDLER(m72_mcu_ack_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
- cputag_set_input_line(space->machine, "mcu", 1, CLEAR_LINE);
+ m72_state *state = space->machine().driver_data<m72_state>();
+ cputag_set_input_line(space->machine(), "mcu", 1, CLEAR_LINE);
state->mcu_snd_cmd_latch = 0;
}
static READ8_HANDLER(m72_mcu_snd_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
return state->mcu_snd_cmd_latch;
}
@@ -329,11 +329,11 @@ static READ8_HANDLER(m72_mcu_port_r )
static WRITE8_HANDLER(m72_mcu_port_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (offset == 1)
{
state->mcu_sample_latch = data;
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_NMI, PULSE_LINE);
}
else
logerror("port: %02x %02x\n", offset, data);
@@ -342,14 +342,14 @@ static WRITE8_HANDLER(m72_mcu_port_w )
static WRITE8_HANDLER( m72_mcu_low_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
state->mcu_sample_addr = (state->mcu_sample_addr & 0xffe000) | (data<<5);
logerror("low: %02x %02x %08x\n", offset, data, state->mcu_sample_addr);
}
static WRITE8_HANDLER( m72_mcu_high_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
state->mcu_sample_addr = (state->mcu_sample_addr & 0x1fff) | (data<<(8+5));
logerror("high: %02x %02x %08x\n", offset, data, state->mcu_sample_addr);
}
@@ -362,17 +362,17 @@ static WRITE8_DEVICE_HANDLER( m72_snd_cpu_sample_w )
static READ8_HANDLER( m72_snd_cpu_sample_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
return state->mcu_sample_latch;
}
INLINE DRIVER_INIT( m72_8751 )
{
- m72_state *state = machine->driver_data<m72_state>();
- address_space *program = machine->device("maincpu")->memory().space(AS_PROGRAM);
- address_space *io = machine->device("maincpu")->memory().space(AS_IO);
- address_space *sndio = machine->device("soundcpu")->memory().space(AS_IO);
- device_t *dac = machine->device("dac");
+ m72_state *state = machine.driver_data<m72_state>();
+ address_space *program = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *io = machine.device("maincpu")->memory().space(AS_IO);
+ address_space *sndio = machine.device("soundcpu")->memory().space(AS_IO);
+ device_t *dac = machine.device("dac");
state->protection_ram = auto_alloc_array(machine, UINT16, 0x10000/2);
program->install_read_bank(0xb0000, 0xbffff, "bank1");
@@ -394,7 +394,7 @@ INLINE DRIVER_INIT( m72_8751 )
* prefetching on the V30.
*/
{
- UINT8 *rom=machine->region("mcu")->base();
+ UINT8 *rom=machine.region("mcu")->base();
rom[0x12d+5] += 1; printf(" 5: %d\n", rom[0x12d+5]);
rom[0x12d+8] += 5; printf(" 8: %d\n", rom[0x12d+8]);
@@ -434,8 +434,8 @@ the NMI handler in the other games.
#if 0
static int find_sample(int num)
{
- UINT8 *rom = machine->region("samples")->base();
- int len = machine->region("samples")->bytes();
+ UINT8 *rom = machine.region("samples")->base();
+ int len = machine.region("samples")->bytes();
int addr = 0;
while (num--)
@@ -456,7 +456,7 @@ static INTERRUPT_GEN(fake_nmi)
address_space *space = device->memory().space(AS_PROGRAM);
int sample = m72_sample_r(space,0);
if (sample)
- m72_sample_w(device->machine->device("dac"),0,sample);
+ m72_sample_w(device->machine().device("dac"),0,sample);
}
@@ -727,7 +727,7 @@ static void copy_le(UINT16 *dest, const UINT8 *src, UINT8 bytes)
static READ16_HANDLER( protection_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_8_15)
copy_le(state->protection_ram,state->protection_code,CODE_LEN);
return state->protection_ram[0xffa/2+offset];
@@ -735,7 +735,7 @@ static READ16_HANDLER( protection_r )
static WRITE16_HANDLER( protection_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
data ^= 0xffff;
COMBINE_DATA(&state->protection_ram[offset]);
data ^= 0xffff;
@@ -744,15 +744,15 @@ static WRITE16_HANDLER( protection_w )
copy_le(&state->protection_ram[0x0fe0],state->protection_crc,CRC_LEN);
}
-static void install_protection_handler(running_machine *machine, const UINT8 *code,const UINT8 *crc)
+static void install_protection_handler(running_machine &machine, const UINT8 *code,const UINT8 *crc)
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
state->protection_ram = auto_alloc_array(machine, UINT16, 0x1000/2);
state->protection_code = code;
state->protection_crc = crc;
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb0000, 0xb0fff, "bank1");
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0ffa, 0xb0ffb, FUNC(protection_r));
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb0000, 0xb0fff, FUNC(protection_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank(0xb0000, 0xb0fff, "bank1");
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xb0ffa, 0xb0ffb, FUNC(protection_r));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xb0000, 0xb0fff, FUNC(protection_w));
memory_set_bankptr(machine, "bank1", state->protection_ram);
}
@@ -760,36 +760,36 @@ static DRIVER_INIT( bchopper )
{
install_protection_handler(machine, bchopper_code,bchopper_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
}
static DRIVER_INIT( mrheli )
{
install_protection_handler(machine, bchopper_code,mrheli_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(bchopper_sample_trigger_w));
}
static DRIVER_INIT( nspirit )
{
install_protection_handler(machine, nspirit_code,nspirit_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(nspirit_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(nspirit_sample_trigger_w));
}
static DRIVER_INIT( imgfight )
{
install_protection_handler(machine, imgfight_code,imgfight_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(imgfight_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(imgfight_sample_trigger_w));
}
static DRIVER_INIT( loht )
{
- m72_state *state = machine->driver_data<m72_state>();
+ m72_state *state = machine.driver_data<m72_state>();
install_protection_handler(machine, loht_code,loht_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(loht_sample_trigger_w));
/* since we skip the startup tests, clear video RAM to prevent garbage on title screen */
memset(state->videoram2,0,0x4000);
@@ -799,33 +799,33 @@ static DRIVER_INIT( xmultiplm72 )
{
install_protection_handler(machine, xmultiplm72_code,xmultiplm72_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(xmultiplm72_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(xmultiplm72_sample_trigger_w));
}
static DRIVER_INIT( dbreedm72 )
{
install_protection_handler(machine, dbreedm72_code,dbreedm72_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dbreedm72_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dbreedm72_sample_trigger_w));
}
static DRIVER_INIT( airduel )
{
install_protection_handler(machine, airduel_code,airduel_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(airduel_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(airduel_sample_trigger_w));
}
static DRIVER_INIT( dkgenm72 )
{
install_protection_handler(machine, dkgenm72_code,dkgenm72_crc);
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dkgenm72_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(dkgenm72_sample_trigger_w));
}
static DRIVER_INIT( gallop )
{
- machine->device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(gallop_sample_trigger_w));
+ machine.device("maincpu")->memory().space(AS_IO)->install_legacy_write_handler(0xc0, 0xc1, FUNC(gallop_sample_trigger_w));
}
@@ -835,13 +835,13 @@ static DRIVER_INIT( gallop )
static READ16_HANDLER( soundram_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
return state->soundram[offset * 2 + 0] | (state->soundram[offset * 2 + 1] << 8);
}
static WRITE16_HANDLER( soundram_w )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
if (ACCESSING_BITS_0_7)
state->soundram[offset * 2 + 0] = data;
if (ACCESSING_BITS_8_15)
@@ -851,7 +851,7 @@ static WRITE16_HANDLER( soundram_w )
static READ16_HANDLER( poundfor_trackball_r )
{
- m72_state *state = space->machine->driver_data<m72_state>();
+ m72_state *state = space->machine().driver_data<m72_state>();
static const char *const axisnames[] = { "TRACK0_X", "TRACK0_Y", "TRACK1_X", "TRACK1_Y" };
if (offset == 0)
@@ -860,7 +860,7 @@ static READ16_HANDLER( poundfor_trackball_r )
for (i = 0;i < 4;i++)
{
- curr = input_port_read(space->machine, axisnames[i]);
+ curr = input_port_read(space->machine(), axisnames[i]);
state->diff[i] = (curr - state->prev[i]);
state->prev[i] = curr;
}
@@ -872,7 +872,7 @@ static READ16_HANDLER( poundfor_trackball_r )
case 0:
return (state->diff[0] & 0xff) | ((state->diff[2] & 0xff) << 8);
case 1:
- return ((state->diff[0] >> 8) & 0x1f) | (state->diff[2] & 0x1f00) | (input_port_read(space->machine, "IN0") & 0xe0e0);
+ return ((state->diff[0] >> 8) & 0x1f) | (state->diff[2] & 0x1f00) | (input_port_read(space->machine(), "IN0") & 0xe0e0);
case 2:
return (state->diff[1] & 0xff) | ((state->diff[3] & 0xff) << 8);
case 3:
diff --git a/src/mame/drivers/m79amb.c b/src/mame/drivers/m79amb.c
index 2016c32f598..1ab2d2c79ba 100644
--- a/src/mame/drivers/m79amb.c
+++ b/src/mame/drivers/m79amb.c
@@ -76,13 +76,13 @@ public:
static WRITE8_HANDLER( ramtek_videoram_w )
{
- m79amb_state *state = space->machine->driver_data<m79amb_state>();
+ m79amb_state *state = space->machine().driver_data<m79amb_state>();
state->videoram[offset] = data & ~*state->mask;
}
static SCREEN_UPDATE( ramtek )
{
- m79amb_state *state = screen->machine->driver_data<m79amb_state>();
+ m79amb_state *state = screen->machine().driver_data<m79amb_state>();
offs_t offs;
for (offs = 0; offs < 0x2000; offs++)
@@ -109,18 +109,18 @@ static SCREEN_UPDATE( ramtek )
static READ8_HANDLER( gray5bit_controller0_r )
{
- m79amb_state *state = space->machine->driver_data<m79amb_state>();
- UINT8 port_data = input_port_read(space->machine, "8004");
- UINT8 gun_pos = input_port_read(space->machine, "GUN1");
+ m79amb_state *state = space->machine().driver_data<m79amb_state>();
+ UINT8 port_data = input_port_read(space->machine(), "8004");
+ UINT8 gun_pos = input_port_read(space->machine(), "GUN1");
return (port_data & 0xe0) | state->lut_gun1[gun_pos];
}
static READ8_HANDLER( gray5bit_controller1_r )
{
- m79amb_state *state = space->machine->driver_data<m79amb_state>();
- UINT8 port_data = input_port_read(space->machine, "8005");
- UINT8 gun_pos = input_port_read(space->machine, "GUN2");
+ m79amb_state *state = space->machine().driver_data<m79amb_state>();
+ UINT8 port_data = input_port_read(space->machine(), "8005");
+ UINT8 gun_pos = input_port_read(space->machine(), "GUN2");
return (port_data & 0xe0) | state->lut_gun2[gun_pos];
}
@@ -287,8 +287,8 @@ static const UINT8 lut_pos[0x20] = {
static DRIVER_INIT( m79amb )
{
- m79amb_state *state = machine->driver_data<m79amb_state>();
- UINT8 *rom = machine->region("maincpu")->base();
+ m79amb_state *state = machine.driver_data<m79amb_state>();
+ UINT8 *rom = machine.region("maincpu")->base();
int i, j;
/* PROM data is active low */
diff --git a/src/mame/drivers/m90.c b/src/mame/drivers/m90.c
index 4994adc086d..f243d22b319 100644
--- a/src/mame/drivers/m90.c
+++ b/src/mame/drivers/m90.c
@@ -38,10 +38,10 @@ Notes:
/***************************************************************************/
-static void set_m90_bank(running_machine *machine)
+static void set_m90_bank(running_machine &machine)
{
- m90_state *state = machine->driver_data<m90_state>();
- UINT8 *rom = machine->region("user1")->base();
+ m90_state *state = machine.driver_data<m90_state>();
+ UINT8 *rom = machine.region("user1")->base();
if (!rom)
popmessage("bankswitch with no banked ROM!");
@@ -55,8 +55,8 @@ static WRITE16_HANDLER( m90_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0,data & 0x01);
- coin_counter_w(space->machine, 1,data & 0x02);
+ coin_counter_w(space->machine(), 0,data & 0x01);
+ coin_counter_w(space->machine(), 1,data & 0x02);
if (data&0xfe) logerror("Coin counter %02x\n",data);
}
@@ -64,11 +64,11 @@ static WRITE16_HANDLER( m90_coincounter_w )
static WRITE16_HANDLER( quizf1_bankswitch_w )
{
- m90_state *state = space->machine->driver_data<m90_state>();
+ m90_state *state = space->machine().driver_data<m90_state>();
if (ACCESSING_BITS_0_7)
{
state->bankaddress = 0x10000 * (data & 0x0f);
- set_m90_bank(space->machine);
+ set_m90_bank(space->machine());
}
}
@@ -1145,19 +1145,19 @@ static STATE_POSTLOAD( quizf1_postload )
static DRIVER_INIT( quizf1 )
{
- m90_state *state = machine->driver_data<m90_state>();
+ m90_state *state = machine.driver_data<m90_state>();
state->bankaddress = 0;
set_m90_bank(machine);
state_save_register_global(machine, state->bankaddress);
- machine->state().register_postload(quizf1_postload, NULL);
+ machine.state().register_postload(quizf1_postload, NULL);
}
static DRIVER_INIT( bomblord )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
int i;
for (i=0; i<0x100000; i+=8)
diff --git a/src/mame/drivers/m92.c b/src/mame/drivers/m92.c
index 3e90c90fccc..31621e351eb 100644
--- a/src/mame/drivers/m92.c
+++ b/src/mame/drivers/m92.c
@@ -215,10 +215,10 @@ static TIMER_CALLBACK( m92_scanline_interrupt );
/*****************************************************************************/
-static void set_m92_bank(running_machine *machine)
+static void set_m92_bank(running_machine &machine)
{
- m92_state *state = machine->driver_data<m92_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m92_state *state = machine.driver_data<m92_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
memory_set_bankptr(machine, "bank1",&RAM[state->bankaddress]);
}
@@ -229,60 +229,60 @@ static STATE_POSTLOAD( m92_postload )
static MACHINE_START( m92 )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
state->save_item(NAME(state->irqvector));
state->save_item(NAME(state->sound_status));
state->save_item(NAME(state->bankaddress));
- machine->state().register_postload(m92_postload, NULL);
+ machine.state().register_postload(m92_postload, NULL);
- state->scanline_timer = machine->scheduler().timer_alloc(FUNC(m92_scanline_interrupt));
+ state->scanline_timer = machine.scheduler().timer_alloc(FUNC(m92_scanline_interrupt));
}
static MACHINE_RESET( m92 )
{
- m92_state *state = machine->driver_data<m92_state>();
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(0));
+ m92_state *state = machine.driver_data<m92_state>();
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(0));
}
/*****************************************************************************/
static TIMER_CALLBACK( m92_scanline_interrupt )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
int scanline = param;
/* raster interrupt */
if (scanline == state->raster_irq_position)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M92_IRQ_2);
}
/* VBLANK interrupt */
- else if (scanline == machine->primary_screen->visible_area().max_y + 1)
+ else if (scanline == machine.primary_screen->visible_area().max_y + 1)
{
- machine->primary_screen->update_partial(scanline);
+ machine.primary_screen->update_partial(scanline);
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M92_IRQ_0);
}
/* adjust for next scanline */
- if (++scanline >= machine->primary_screen->height())
+ if (++scanline >= machine.primary_screen->height())
scanline = 0;
- state->scanline_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->scanline_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
/*****************************************************************************/
static READ16_HANDLER( m92_eeprom_r )
{
- UINT8 *RAM = space->machine->region("user1")->base();
+ UINT8 *RAM = space->machine().region("user1")->base();
// logerror("%05x: EEPROM RE %04x\n",cpu_get_pc(space->cpu),offset);
return RAM[offset] | 0xff00;
}
static WRITE16_HANDLER( m92_eeprom_w )
{
- UINT8 *RAM = space->machine->region("user1")->base();
+ UINT8 *RAM = space->machine().region("user1")->base();
// logerror("%05x: EEPROM WR %04x\n",cpu_get_pc(space->cpu),offset);
if (ACCESSING_BITS_0_7)
RAM[offset] = data;
@@ -292,8 +292,8 @@ static WRITE16_HANDLER( m92_coincounter_w )
{
if (ACCESSING_BITS_0_7)
{
- coin_counter_w(space->machine, 0, data & 0x01);
- coin_counter_w(space->machine, 1, data & 0x02);
+ coin_counter_w(space->machine(), 0, data & 0x01);
+ coin_counter_w(space->machine(), 1, data & 0x02);
/* Bit 0x8 is Motor(?!), used in Hook, In The Hunt, UCops */
/* Bit 0x8 is Memcard related in RTypeLeo */
/* Bit 0x40 set in Blade Master test mode input check */
@@ -302,17 +302,17 @@ static WRITE16_HANDLER( m92_coincounter_w )
static WRITE16_HANDLER( m92_bankswitch_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
if (ACCESSING_BITS_0_7)
{
state->bankaddress = 0x100000 + ((data & 0x7) * 0x10000);
- set_m92_bank(space->machine);
+ set_m92_bank(space->machine());
}
}
static CUSTOM_INPUT( m92_sprite_busy_r )
{
- m92_state *state = field->port->machine->driver_data<m92_state>();
+ m92_state *state = field->port->machine().driver_data<m92_state>();
return state->sprite_buffer_busy;
}
@@ -322,8 +322,8 @@ enum { VECTOR_INIT, YM2151_ASSERT, YM2151_CLEAR, V30_ASSERT, V30_CLEAR };
static TIMER_CALLBACK( setvector_callback )
{
- m92_state *state = machine->driver_data<m92_state>();
- if (!machine->device("soundcpu"))
+ m92_state *state = machine.driver_data<m92_state>();
+ if (!machine.device("soundcpu"))
return;
switch(param)
@@ -336,9 +336,9 @@ static TIMER_CALLBACK( setvector_callback )
}
if (state->irqvector & 0x2) /* YM2151 has precedence */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x18);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x18);
else if (state->irqvector & 0x1) /* V30 */
- device_set_input_line_vector(machine->device("soundcpu"), 0, 0x19);
+ device_set_input_line_vector(machine.device("soundcpu"), 0, 0x19);
if (state->irqvector == 0) /* no IRQs pending */
cputag_set_input_line(machine, "soundcpu", 0, CLEAR_LINE);
@@ -348,13 +348,13 @@ static TIMER_CALLBACK( setvector_callback )
static WRITE16_HANDLER( m92_soundlatch_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_ASSERT);
soundlatch_w(space, 0, data & 0xff);
}
static READ16_HANDLER( m92_sound_status_r )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
//logerror("%06x: read sound status\n",cpu_get_pc(space->cpu));
return state->sound_status;
}
@@ -366,20 +366,20 @@ static READ16_HANDLER( m92_soundlatch_r )
static WRITE16_HANDLER( m92_sound_irq_ack_w )
{
- space->machine->scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
+ space->machine().scheduler().synchronize(FUNC(setvector_callback), V30_CLEAR);
}
static WRITE16_HANDLER( m92_sound_status_w )
{
- m92_state *state = space->machine->driver_data<m92_state>();
+ m92_state *state = space->machine().driver_data<m92_state>();
COMBINE_DATA(&state->sound_status);
- cputag_set_input_line_and_vector(space->machine, "maincpu", 0, HOLD_LINE, M92_IRQ_3);
+ cputag_set_input_line_and_vector(space->machine(), "maincpu", 0, HOLD_LINE, M92_IRQ_3);
}
static WRITE16_HANDLER( m92_sound_reset_w )
{
- cputag_set_input_line(space->machine, "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "soundcpu", INPUT_LINE_RESET, (data) ? CLEAR_LINE : ASSERT_LINE);
}
/*****************************************************************************/
@@ -911,9 +911,9 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
if (state)
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_ASSERT);
else
- device->machine->scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
+ device->machine().scheduler().synchronize(FUNC(setvector_callback), YM2151_CLEAR);
}
static const ym2151_interface ym2151_config =
@@ -923,9 +923,9 @@ static const ym2151_interface ym2151_config =
/***************************************************************************/
-void m92_sprite_interrupt(running_machine *machine)
+void m92_sprite_interrupt(running_machine &machine)
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
cputag_set_input_line_and_vector(machine, "maincpu", 0, HOLD_LINE, M92_IRQ_1);
}
@@ -2082,10 +2082,10 @@ ROM_START( geostorm )
ROM_END
-static void init_m92(running_machine *machine, int hasbanks)
+static void init_m92(running_machine &machine, int hasbanks)
{
- m92_state *state = machine->driver_data<m92_state>();
- UINT8 *RAM = machine->region("maincpu")->base();
+ m92_state *state = machine.driver_data<m92_state>();
+ UINT8 *RAM = machine.region("maincpu")->base();
if (hasbanks)
{
@@ -2098,7 +2098,7 @@ static void init_m92(running_machine *machine, int hasbanks)
memory_set_bankptr(machine, "bank2", &RAM[0xc0000]);
}
- RAM = machine->region("soundcpu")->base();
+ RAM = machine.region("soundcpu")->base();
if (RAM)
memcpy(RAM + 0xffff0, RAM + 0x1fff0, 0x10); /* Sound cpu Start vector */
@@ -2137,25 +2137,25 @@ static DRIVER_INIT( uccops )
static DRIVER_INIT( rtypeleo )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
}
static DRIVER_INIT( rtypelej )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
}
static DRIVER_INIT( majtitl2 )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
/* This game has an eprom on the game board */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0000, 0xf3fff, FUNC(m92_eeprom_r), FUNC(m92_eeprom_w));
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xf0000, 0xf3fff, FUNC(m92_eeprom_r), FUNC(m92_eeprom_w));
state->game_kludge = 2;
}
@@ -2173,17 +2173,17 @@ static DRIVER_INIT( inthunt )
static DRIVER_INIT( lethalth )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 0);
state->irq_vectorbase = 0x20;
/* NOP out the bankswitcher */
- machine->device("maincpu")->memory().space(AS_IO)->nop_write(0x20, 0x21);
+ machine.device("maincpu")->memory().space(AS_IO)->nop_write(0x20, 0x21);
}
static DRIVER_INIT( nbbatman )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
init_m92(machine, 1);
@@ -2192,7 +2192,7 @@ static DRIVER_INIT( nbbatman )
static DRIVER_INIT( ssoldier )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
/* main CPU expects an answer even before writing the first command */
@@ -2201,7 +2201,7 @@ static DRIVER_INIT( ssoldier )
static DRIVER_INIT( psoldier )
{
- m92_state *state = machine->driver_data<m92_state>();
+ m92_state *state = machine.driver_data<m92_state>();
init_m92(machine, 1);
state->irq_vectorbase = 0x20;
/* main CPU expects an answer even before writing the first command */
@@ -2215,7 +2215,7 @@ static DRIVER_INIT( dsoccr94j )
static DRIVER_INIT( gunforc2 )
{
- UINT8 *RAM = machine->region("maincpu")->base();
+ UINT8 *RAM = machine.region("maincpu")->base();
init_m92(machine, 1);
memcpy(RAM + 0x80000, RAM + 0x100000, 0x20000);
}
diff --git a/src/mame/drivers/macrossp.c b/src/mame/drivers/macrossp.c
index 6ffbba97687..7d6e31e6765 100644
--- a/src/mame/drivers/macrossp.c
+++ b/src/mame/drivers/macrossp.c
@@ -306,7 +306,7 @@ Notes:
static WRITE32_HANDLER( paletteram32_macrossp_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
int r,g,b;
COMBINE_DATA(&state->paletteram[offset]);
@@ -314,13 +314,13 @@ static WRITE32_HANDLER( paletteram32_macrossp_w )
g = ((state->paletteram[offset] & 0x00ff0000) >>16);
r = ((state->paletteram[offset] & 0xff000000) >>24);
- palette_set_color(space->machine, offset, MAKE_RGB(r,g,b));
+ palette_set_color(space->machine(), offset, MAKE_RGB(r,g,b));
}
static READ32_HANDLER ( macrossp_soundstatus_r )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
// logerror("%08x read soundstatus\n", cpu_get_pc(space->cpu));
@@ -334,7 +334,7 @@ static READ32_HANDLER ( macrossp_soundstatus_r )
static WRITE32_HANDLER( macrossp_soundcmd_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
if (ACCESSING_BITS_16_31)
{
@@ -349,16 +349,16 @@ static WRITE32_HANDLER( macrossp_soundcmd_w )
static READ16_HANDLER( macrossp_soundcmd_r )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
// logerror("%06x read soundcmd\n",cpu_get_pc(space->cpu));
state->sndpending = 0;
return soundlatch_word_r(space, offset, mem_mask);
}
-static void update_colors( running_machine *machine )
+static void update_colors( running_machine &machine )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
int i, r, g, b;
for (i = 0; i < 0x1000; i++)
@@ -388,7 +388,7 @@ static void update_colors( running_machine *machine )
static WRITE32_HANDLER( macrossp_palette_fade_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
state->fade_effect = ((data & 0xff00) >> 8) - 0x28; //it writes two times, first with a -0x28 then with the proper data
// popmessage("%02x",fade_effect);
@@ -396,7 +396,7 @@ static WRITE32_HANDLER( macrossp_palette_fade_w )
if (state->old_fade != state->fade_effect)
{
state->old_fade = state->fade_effect;
- update_colors(space->machine);
+ update_colors(space->machine());
}
}
@@ -584,7 +584,7 @@ GFXDECODE_END
static void irqhandler(device_t *device, int irq)
{
- // macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ // macrossp_state *state = space->machine().driver_data<macrossp_state>();
logerror("ES5506 irq %d\n", irq);
/* IRQ lines 1 & 4 on the sound 68000 are definitely triggered by the ES5506,
@@ -604,10 +604,10 @@ static const es5506_interface es5506_config =
static MACHINE_START( macrossp )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->sndpending));
state->save_item(NAME(state->snd_toggle));
@@ -617,7 +617,7 @@ static MACHINE_START( macrossp )
static MACHINE_RESET( macrossp )
{
- macrossp_state *state = machine->driver_data<macrossp_state>();
+ macrossp_state *state = machine.driver_data<macrossp_state>();
state->sndpending = 0;
state->snd_toggle = 0;
@@ -774,7 +774,7 @@ PC :00018104 018104: addq.w #1, $f1015a.l
PC :0001810A 01810A: cmp.w $f10140.l, D0
PC :00018110 018110: beq 18104
*/
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->mainram[0x10158 / 4]);
if (cpu_get_pc(space->cpu) == 0x001810A) device_spin_until_interrupt(space->cpu);
@@ -783,7 +783,7 @@ PC :00018110 018110: beq 18104
#ifdef UNUSED_FUNCTION
static WRITE32_HANDLER( quizmoon_speedup_w )
{
- macrossp_state *state = space->machine->driver_data<macrossp_state>();
+ macrossp_state *state = space->machine().driver_data<macrossp_state>();
COMBINE_DATA(&state->mainram[0x00020 / 4]);
if (cpu_get_pc(space->cpu) == 0x1cc) device_spin_until_interrupt(space->cpu);
@@ -792,13 +792,13 @@ static WRITE32_HANDLER( quizmoon_speedup_w )
static DRIVER_INIT( macrossp )
{
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf10158, 0xf1015b, FUNC(macrossp_speedup_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf10158, 0xf1015b, FUNC(macrossp_speedup_w) );
}
static DRIVER_INIT( quizmoon )
{
#ifdef UNUSED_FUNCTION
- machine->device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00020, 0xf00023, FUNC(quizmoon_speedup_w) );
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xf00020, 0xf00023, FUNC(quizmoon_speedup_w) );
#endif
}
diff --git a/src/mame/drivers/macs.c b/src/mame/drivers/macs.c
index 57fd99b7762..cb27032bc52 100644
--- a/src/mame/drivers/macs.c
+++ b/src/mame/drivers/macs.c
@@ -93,13 +93,13 @@ ADDRESS_MAP_END
static WRITE8_HANDLER(rambank_w)
{
- macs_state *state = space->machine->driver_data<macs_state>();
- memory_set_bankptr(space->machine, "bank3", &state->ram1[0x10000+(data&1)*0x800] );
+ macs_state *state = space->machine().driver_data<macs_state>();
+ memory_set_bankptr(space->machine(), "bank3", &state->ram1[0x10000+(data&1)*0x800] );
}
static READ8_HANDLER( macs_input_r )
{
- macs_state *state = space->machine->driver_data<macs_state>();
+ macs_state *state = space->machine().driver_data<macs_state>();
switch(offset)
{
case 0:
@@ -107,23 +107,23 @@ static READ8_HANDLER( macs_input_r )
/*It's bit-wise*/
switch(state->mux_data&0x0f)
{
- case 0x00: return input_port_read(space->machine, "IN0");
- case 0x01: return input_port_read(space->machine, "IN1");
- case 0x02: return input_port_read(space->machine, "IN2");
- case 0x04: return input_port_read(space->machine, "IN3");
- case 0x08: return input_port_read(space->machine, "IN4");
+ case 0x00: return input_port_read(space->machine(), "IN0");
+ case 0x01: return input_port_read(space->machine(), "IN1");
+ case 0x02: return input_port_read(space->machine(), "IN2");
+ case 0x04: return input_port_read(space->machine(), "IN3");
+ case 0x08: return input_port_read(space->machine(), "IN4");
default:
logerror("Unmapped mahjong panel mux data %02x\n",state->mux_data);
return 0xff;
}
}
- case 1: return input_port_read(space->machine, "SYS0");
- case 2: return input_port_read(space->machine, "DSW0");
- case 3: return input_port_read(space->machine, "DSW1");
- case 4: return input_port_read(space->machine, "DSW2");
- case 5: return input_port_read(space->machine, "DSW3");
- case 6: return input_port_read(space->machine, "DSW4");
- case 7: return input_port_read(space->machine, "SYS1");
+ case 1: return input_port_read(space->machine(), "SYS0");
+ case 2: return input_port_read(space->machine(), "DSW0");
+ case 3: return input_port_read(space->machine(), "DSW1");
+ case 4: return input_port_read(space->machine(), "DSW2");
+ case 5: return input_port_read(space->machine(), "DSW3");
+ case 6: return input_port_read(space->machine(), "DSW4");
+ case 7: return input_port_read(space->machine(), "SYS1");
default: popmessage("Unmapped I/O read at PC = %06x offset = %02x",cpu_get_pc(space->cpu),offset+0xc0);
}
@@ -133,15 +133,15 @@ static READ8_HANDLER( macs_input_r )
static WRITE8_HANDLER( macs_rom_bank_w )
{
- memory_set_bankptr(space->machine, "bank1", space->machine->region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
+ memory_set_bankptr(space->machine(), "bank1", space->machine().region("maincpu")->base() + (data* 0x4000) + 0x10000 + macs_cart_slot*0x400000 );
st0016_rom_bank=data;
}
static WRITE8_HANDLER( macs_output_w )
{
- macs_state *state = space->machine->driver_data<macs_state>();
- UINT8 *ROM = space->machine->region("maincpu")->base();
+ macs_state *state = space->machine().driver_data<macs_state>();
+ UINT8 *ROM = space->machine().region("maincpu")->base();
switch(offset)
{
@@ -156,14 +156,14 @@ static WRITE8_HANDLER( macs_output_w )
{
/* FIXME: dunno if this RAM bank is right, DASM tracking made on the POST screens indicates that there's just one RAM bank,
but then MACS2 games locks up. */
- memory_set_bankptr(space->machine, "bank3", &state->ram1[((data&0x20)>>5)*0x1000+0x000] );
+ memory_set_bankptr(space->machine(), "bank3", &state->ram1[((data&0x20)>>5)*0x1000+0x000] );
macs_cart_slot = (data & 0xc) >> 2;
- memory_set_bankptr(space->machine, "bank4", &ROM[macs_cart_slot*0x400000+0x10000] );
+ memory_set_bankptr(space->machine(), "bank4", &ROM[macs_cart_slot*0x400000+0x10000] );
}
- memory_set_bankptr(space->machine, "bank2", &state->ram1[((data&0x20)>>5)*0x1000+0x800] );
+ memory_set_bankptr(space->machine(), "bank2", &state->ram1[((data&0x20)>>5)*0x1000+0x800] );
break;
case 2: state->mux_data = data; break;
@@ -643,7 +643,7 @@ static const UINT8 ramdata[160]=
static MACHINE_RESET(macs)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
UINT8 *macs_ram1 = state->ram1;
#if 0
UINT8 *macs_ram2 = state->ram2;
@@ -675,11 +675,11 @@ static MACHINE_RESET(macs)
730E: ED B0 ldir
...
*/
- memcpy(macs_ram1 + 0x0e9f, machine->region("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x1e9f, machine->region("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x0e9f, machine.region("user1")->base()+0x7327, 0xc7);
+ memcpy(macs_ram1 + 0x1e9f, machine.region("user1")->base()+0x7327, 0xc7);
- memcpy(macs_ram1 + 0x0800, machine->region("user1")->base()+0x73fa, 0x507);
- memcpy(macs_ram1 + 0x1800, machine->region("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x0800, machine.region("user1")->base()+0x73fa, 0x507);
+ memcpy(macs_ram1 + 0x1800, machine.region("user1")->base()+0x73fa, 0x507);
#define MAKEJMP(n,m) macs_ram2[(n) - 0xe800 + 0]=0xc3;\
macs_ram2[(n) - 0xe800 + 1]=(m)&0xff;\
@@ -715,15 +715,15 @@ static MACHINE_RESET(macs)
macs_ram1[0x1ff9]=0x07;
#endif
- memory_set_bankptr(machine, "bank1", machine->region("maincpu")->base() + 0x10000 );
+ memory_set_bankptr(machine, "bank1", machine.region("maincpu")->base() + 0x10000 );
memory_set_bankptr(machine, "bank2", macs_ram1+0x800);
memory_set_bankptr(machine, "bank3", macs_ram1+0x10000);
- memory_set_bankptr(machine, "bank4", machine->region("maincpu")->base() );
+ memory_set_bankptr(machine, "bank4", machine.region("maincpu")->base() );
}
static DRIVER_INIT(macs)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=10|0x80;
state->rev = 1;
@@ -731,7 +731,7 @@ static DRIVER_INIT(macs)
static DRIVER_INIT(macs2)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=10|0x80;
state->rev = 2;
@@ -739,7 +739,7 @@ static DRIVER_INIT(macs2)
static DRIVER_INIT(kisekaeh)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=11|0x180;
state->rev = 1;
@@ -747,7 +747,7 @@ static DRIVER_INIT(kisekaeh)
static DRIVER_INIT(kisekaem)
{
- macs_state *state = machine->driver_data<macs_state>();
+ macs_state *state = machine.driver_data<macs_state>();
state->ram1=auto_alloc_array(machine, UINT8, 0x20000);
st0016_game=10|0x180;
state->rev = 1;
diff --git a/src/mame/drivers/madalien.c b/src/mame/drivers/madalien.c
index d457098d6ad..a0835b7a3be 100644
--- a/src/mame/drivers/madalien.c
+++ b/src/mame/drivers/madalien.c
@@ -19,30 +19,30 @@
static INPUT_CHANGED( coin_inserted )
{
/* coin insertion causes an NMI */
- cputag_set_input_line(field->port->machine, "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(field->port->machine(), "maincpu", INPUT_LINE_NMI, newval ? CLEAR_LINE : ASSERT_LINE);
}
-INLINE UINT8 shift_common(running_machine *machine, UINT8 hi, UINT8 lo)
+INLINE UINT8 shift_common(running_machine &machine, UINT8 hi, UINT8 lo)
{
- const UINT8 *table = machine->region("user2")->base();
+ const UINT8 *table = machine.region("user2")->base();
return table[((hi & 0x07) << 8) | lo];
}
static READ8_HANDLER( shift_r )
{
- madalien_state *state = space->machine->driver_data<madalien_state>();
- return shift_common(space->machine, *state->shift_hi, *state->shift_lo);
+ madalien_state *state = space->machine().driver_data<madalien_state>();
+ return shift_common(space->machine(), *state->shift_hi, *state->shift_lo);
}
static READ8_HANDLER( shift_rev_r )
{
- madalien_state *state = space->machine->driver_data<madalien_state>();
+ madalien_state *state = space->machine().driver_data<madalien_state>();
UINT8 hi = *state->shift_hi ^ 0x07;
UINT8 lo = BITSWAP8(*state->shift_lo,0,1,2,3,4,5,6,7);
- UINT8 ret = shift_common(space->machine, hi, lo);
+ UINT8 ret = shift_common(space->machine(), hi, lo);
return BITSWAP8(ret,7,0,1,2,3,4,5,6) & 0x7f;
}
@@ -56,14 +56,14 @@ static WRITE8_HANDLER( madalien_output_w )
static WRITE8_HANDLER( madalien_sound_command_w )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
soundlatch_w(space, offset, data);
}
static READ8_HANDLER(madalien_sound_command_r )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
return soundlatch_r(space, offset);
}
diff --git a/src/mame/drivers/madmotor.c b/src/mame/drivers/madmotor.c
index 8a2266b7c14..91194374072 100644
--- a/src/mame/drivers/madmotor.c
+++ b/src/mame/drivers/madmotor.c
@@ -26,7 +26,7 @@
static WRITE16_HANDLER( madmotor_sound_w )
{
- madmotor_state *state = space->machine->driver_data<madmotor_state>();
+ madmotor_state *state = space->machine().driver_data<madmotor_state>();
if (ACCESSING_BITS_0_7)
{
@@ -222,7 +222,7 @@ GFXDECODE_END
static void sound_irq(device_t *device, int state)
{
- madmotor_state *driver_state = device->machine->driver_data<madmotor_state>();
+ madmotor_state *driver_state = device->machine().driver_data<madmotor_state>();
device_set_input_line(driver_state->audiocpu, 1, state); /* IRQ 2 */
}
@@ -233,17 +233,17 @@ static const ym2151_interface ym2151_config =
static MACHINE_START( madmotor )
{
- madmotor_state *state = machine->driver_data<madmotor_state>();
+ madmotor_state *state = machine.driver_data<madmotor_state>();
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
state->save_item(NAME(state->flipscreen));
}
static MACHINE_RESET( madmotor )
{
- madmotor_state *state = machine->driver_data<madmotor_state>();
+ madmotor_state *state = machine.driver_data<madmotor_state>();
state->flipscreen = 0;
}
@@ -353,7 +353,7 @@ ROM_END
static DRIVER_INIT( madmotor )
{
- UINT8 *rom = machine->region("maincpu")->base();
+ UINT8 *rom = machine.region("maincpu")->base();
int i;
for (i = 0x00000;i < 0x80000;i++)
diff --git a/src/mame/drivers/magic10.c b/src/mame/drivers/magic10.c
index 1e91eed5beb..550b825e2b8 100644
--- a/src/mame/drivers/magic10.c
+++ b/src/mame/drivers/magic10.c
@@ -109,35 +109,35 @@ public:
static WRITE16_HANDLER( layer0_videoram_w )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
COMBINE_DATA(&state->layer0_videoram[offset]);
tilemap_mark_tile_dirty( state->layer0_tilemap, offset >> 1);
}
static WRITE16_HANDLER( layer1_videoram_w )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
COMBINE_DATA(&state->layer1_videoram[offset]);
tilemap_mark_tile_dirty( state->layer1_tilemap, offset >> 1);
}
static WRITE16_HANDLER( layer2_videoram_w )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
COMBINE_DATA(&state->layer2_videoram[offset]);
tilemap_mark_tile_dirty( state->layer2_tilemap, offset >> 1);
}
static WRITE16_HANDLER( paletteram_w )
{
- data = COMBINE_DATA(&space->machine->generic.paletteram.u16[offset]);
- palette_set_color_rgb( space->machine, offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
+ data = COMBINE_DATA(&space->machine().generic.paletteram.u16[offset]);
+ palette_set_color_rgb( space->machine(), offset, pal4bit(data >> 4), pal4bit(data >> 0), pal4bit(data >> 8));
}
static TILE_GET_INFO( get_layer0_tile_info )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
SET_TILE_INFO
(
1,
@@ -149,7 +149,7 @@ static TILE_GET_INFO( get_layer0_tile_info )
static TILE_GET_INFO( get_layer1_tile_info )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
SET_TILE_INFO
(
1,
@@ -161,7 +161,7 @@ static TILE_GET_INFO( get_layer1_tile_info )
static TILE_GET_INFO( get_layer2_tile_info )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
SET_TILE_INFO
(
0,
@@ -174,7 +174,7 @@ static TILE_GET_INFO( get_layer2_tile_info )
static VIDEO_START( magic10 )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer0_tilemap = tilemap_create(machine, get_layer0_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->layer1_tilemap = tilemap_create(machine, get_layer1_tile_info, tilemap_scan_rows, 16, 16, 32, 32);
state->layer2_tilemap = tilemap_create(machine, get_layer2_tile_info, tilemap_scan_rows, 8, 8, 64, 64);
@@ -185,7 +185,7 @@ static VIDEO_START( magic10 )
static SCREEN_UPDATE( magic10 )
{
- magic10_state *state = screen->machine->driver_data<magic10_state>();
+ magic10_state *state = screen->machine().driver_data<magic10_state>();
/*TODO: understand where this comes from. */
tilemap_set_scrollx(state->layer2_tilemap, 0, state->layer2_offset[0]);
tilemap_set_scrolly(state->layer2_tilemap, 0, state->layer2_offset[1]);
@@ -211,7 +211,7 @@ static SCREEN_UPDATE( magic10 )
static READ16_HANDLER( magic102_r )
{
- magic10_state *state = space->machine->driver_data<magic10_state>();
+ magic10_state *state = space->machine().driver_data<magic10_state>();
state->magic102_ret ^= 0x20;
return state->magic102_ret;
}
@@ -275,7 +275,7 @@ static WRITE16_HANDLER( magic10_out_w )
output_set_lamp_value(7, (data >> 6) & 1); /* Lamp 7 - PLAY (BET/TAKE/CANCEL) */
output_set_lamp_value(8, (data >> 8) & 1); /* Lamp 8 - PAYOUT/SUPERGAME */
- coin_counter_w(space->machine, 0, data & 0x400);
+ coin_counter_w(space->machine(), 0, data & 0x400);
}
/***************************
@@ -1204,28 +1204,28 @@ ROM_END
static DRIVER_INIT( magic10 )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 32;
state->layer2_offset[1] = 2;
}
static DRIVER_INIT( magic102 )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 8;
state->layer2_offset[1] = 20;
}
static DRIVER_INIT( suprpool )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 8;
state->layer2_offset[1] = 16;
}
static DRIVER_INIT( hotslot )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
/* a value of -56 center the playfield, but displace the intro and initial screen.
a value of -64 center the intro and initial screen, but displace the playfield.
*/
@@ -1235,7 +1235,7 @@ static DRIVER_INIT( hotslot )
static DRIVER_INIT( sgsafari )
{
- magic10_state *state = machine->driver_data<magic10_state>();
+ magic10_state *state = machine.driver_data<magic10_state>();
state->layer2_offset[0] = 16;
state->layer2_offset[1] = 20;
}
diff --git a/src/mame/drivers/magicard.c b/src/mame/drivers/magicard.c
index 9f5888364c8..908d4c8c83f 100644
--- a/src/mame/drivers/magicard.c
+++ b/src/mame/drivers/magicard.c
@@ -380,11 +380,11 @@ static VIDEO_START(magicard)
static SCREEN_UPDATE(magicard)
{
- magicard_state *state = screen->machine->driver_data<magicard_state>();
+ magicard_state *state = screen->machine().driver_data<magicard_state>();
int x,y;
UINT32 count;
- bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine)); //TODO
+ bitmap_fill(bitmap, cliprect, get_black_pen(screen->machine())); //TODO
if(!(SCC_DE_VREG)) //display enable
return 0;
@@ -402,22 +402,22 @@ static SCREEN_UPDATE(magicard)
color = ((state->magicram[count]) & 0x000f)>>0;
if(((x*4)+3)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+3) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+3) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0x00f0)>>4;
if(((x*4)+2)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+2) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+2) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0x0f00)>>8;
if(((x*4)+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+1) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0xf000)>>12;
if(((x*4)+0)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*4)+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*4)+0) = screen->machine().pens[color];
count++;
}
@@ -434,12 +434,12 @@ static SCREEN_UPDATE(magicard)
color = ((state->magicram[count]) & 0x00ff)>>0;
if(((x*2)+1)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+1) = screen->machine().pens[color];
color = ((state->magicram[count]) & 0xff00)>>8;
if(((x*2)+0)<screen->visible_area().max_x && ((y)+0)<screen->visible_area().max_y)
- *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine->pens[color];
+ *BITMAP_ADDR32(bitmap, y, (x*2)+0) = screen->machine().pens[color];
count++;
}
@@ -456,12 +456,12 @@ static SCREEN_UPDATE(magicard)
static READ16_HANDLER( test_r )
{
- return space->machine->rand();
+ return space->machine().rand();
}
static WRITE16_HANDLER( paletteram_io_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
switch(offset*2)
{
case 0:
@@ -483,7 +483,7 @@ static WRITE16_HANDLER( paletteram_io_w )
break;
case 2:
state->pal.b = ((data & 0x3f) << 2) | ((data & 0x30) >> 4);
- palette_set_color(space->machine, state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
+ palette_set_color(space->machine(), state->pal.offs, MAKE_RGB(state->pal.r, state->pal.g, state->pal.b));
state->pal.offs_internal = 0;
state->pal.offs++;
break;
@@ -495,11 +495,11 @@ static WRITE16_HANDLER( paletteram_io_w )
static READ16_HANDLER( philips_66470_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
switch(offset)
{
// case 0/2:
-// return space->machine->rand(); //TODO
+// return space->machine().rand(); //TODO
}
//printf("[%04x]\n",offset*2);
@@ -510,7 +510,7 @@ static READ16_HANDLER( philips_66470_r )
static WRITE16_HANDLER( philips_66470_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
COMBINE_DATA(&state->pcab_vregs[offset]);
// if(offset == 0x10/2)
@@ -524,19 +524,19 @@ static WRITE16_HANDLER( philips_66470_w )
static READ16_HANDLER( scc68070_ext_irqc_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_ext_irqc_regs[offset];
}
static WRITE16_HANDLER( scc68070_ext_irqc_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_ext_irqc_regs[offset] = data;
}
static READ16_HANDLER( scc68070_iic_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
//printf("%04x\n",offset*2);
switch(offset)
@@ -549,18 +549,18 @@ static READ16_HANDLER( scc68070_iic_r )
static WRITE16_HANDLER( scc68070_iic_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_iic_regs[offset] = data;
}
static READ16_HANDLER( scc68070_uart_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
//printf("%02x\n",offset*2);
switch(offset)
{
- case 0x02/2: return space->machine->rand(); //uart mode register
+ case 0x02/2: return space->machine().rand(); //uart mode register
}
return state->scc68070_uart_regs[offset];
@@ -568,67 +568,67 @@ static READ16_HANDLER( scc68070_uart_r )
static WRITE16_HANDLER( scc68070_uart_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_uart_regs[offset] = data;
}
static READ16_HANDLER( scc68070_timer_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_timer_regs[offset];
}
static WRITE16_HANDLER( scc68070_timer_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_timer_regs[offset] = data;
}
static READ16_HANDLER( scc68070_int_irqc_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_int_irqc_regs[offset];
}
static WRITE16_HANDLER( scc68070_int_irqc_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_int_irqc_regs[offset] = data;
}
static READ16_HANDLER( scc68070_dma_ch1_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_dma_ch1_regs[offset];
}
static WRITE16_HANDLER( scc68070_dma_ch1_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_dma_ch1_regs[offset] = data;
}
static READ16_HANDLER( scc68070_dma_ch2_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_dma_ch2_regs[offset];
}
static WRITE16_HANDLER( scc68070_dma_ch2_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_dma_ch2_regs[offset] = data;
}
static READ16_HANDLER( scc68070_mmu_r )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
return state->scc68070_mmu_regs[offset];
}
static WRITE16_HANDLER( scc68070_mmu_w )
{
- magicard_state *state = space->machine->driver_data<magicard_state>();
+ magicard_state *state = space->machine().driver_data<magicard_state>();
state->scc68070_mmu_regs[offset] = data;
switch(offset)
@@ -680,11 +680,11 @@ INPUT_PORTS_END
static MACHINE_RESET( magicard )
{
- magicard_state *state = machine->driver_data<magicard_state>();
- UINT16 *src = (UINT16*)machine->region("maincpu" )->base();
+ magicard_state *state = machine.driver_data<magicard_state>();
+ UINT16 *src = (UINT16*)machine.region("maincpu" )->base();
UINT16 *dst = state->magicram;
memcpy (dst, src, 0x80000);
- machine->device("maincpu")->reset();
+ machine.device("maincpu")->reset();
}
@@ -695,9 +695,9 @@ static MACHINE_RESET( magicard )
/*Probably there's a mask somewhere if it REALLY uses irqs at all...irq vectors dynamically changes after some time.*/
static INTERRUPT_GEN( magicard_irq )
{
- if(input_code_pressed(device->machine, KEYCODE_Z)) //vblank?
+ if(input_code_pressed(device->machine(), KEYCODE_Z)) //vblank?
device_set_input_line_and_vector(device, 1, HOLD_LINE,0xe4/4);
- if(input_code_pressed(device->machine, KEYCODE_X)) //uart irq
+ if(input_code_pressed(device->machine(), KEYCODE_X)) //uart irq
device_set_input_line_and_vector(device, 1, HOLD_LINE,0xf0/4);
}
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c
index 9752d6f84c8..5184a5fe6ea 100644
--- a/src/mame/drivers/magicfly.c
+++ b/src/mame/drivers/magicfly.c
@@ -422,21 +422,21 @@ public:
static WRITE8_HANDLER( magicfly_videoram_w )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
state->videoram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static WRITE8_HANDLER( magicfly_colorram_w )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
state->colorram[offset] = data;
tilemap_mark_tile_dirty(state->bg_tilemap, offset);
}
static TILE_GET_INFO( get_magicfly_tile_info )
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
/* - bits -
7654 3210
---- -xxx Tiles color.
@@ -462,13 +462,13 @@ static TILE_GET_INFO( get_magicfly_tile_info )
static VIDEO_START(magicfly)
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
state->bg_tilemap = tilemap_create(machine, get_magicfly_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
}
static TILE_GET_INFO( get_7mezzo_tile_info )
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
/* - bits -
7654 3210
---- -xxx Tiles color.
@@ -494,13 +494,13 @@ static TILE_GET_INFO( get_7mezzo_tile_info )
static VIDEO_START( 7mezzo )
{
- magicfly_state *state = machine->driver_data<magicfly_state>();
+ magicfly_state *state = machine.driver_data<magicfly_state>();
state->bg_tilemap = tilemap_create(machine, get_7mezzo_tile_info, tilemap_scan_rows, 8, 8, 32, 29);
}
static SCREEN_UPDATE( magicfly )
{
- magicfly_state *state = screen->machine->driver_data<magicfly_state>();
+ magicfly_state *state = screen->machine().driver_data<magicfly_state>();
tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0);
return 0;
}
@@ -535,21 +535,21 @@ static PALETTE_INIT( magicfly )
static READ8_HANDLER( mux_port_r )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
switch( state->input_selector )
{
- case 0x01: return input_port_read(space->machine, "IN0-0");
- case 0x02: return input_port_read(space->machine, "IN0-1");
- case 0x04: return input_port_read(space->machine, "IN0-2");
- case 0x08: return input_port_read(space->machine, "IN0-3");
- case 0x00: return input_port_read(space->machine, "DSW0");
+ case 0x01: return input_port_read(space->machine(), "IN0-0");
+ case 0x02: return input_port_read(space->machine(), "IN0-1");
+ case 0x04: return input_port_read(space->machine(), "IN0-2");
+ case 0x08: return input_port_read(space->machine(), "IN0-3");
+ case 0x00: return input_port_read(space->machine(), "DSW0");
}
return 0xff;
}
static WRITE8_HANDLER( mux_port_w )
{
- magicfly_state *state = space->machine->driver_data<magicfly_state>();
+ magicfly_state *state = space->machine().driver_data<magicfly_state>();
/* - bits -
7654 3210
---- xxxx Input selector.
@@ -561,11 +561,11 @@ static WRITE8_HANDLER( mux_port_w )
*/
state->input_selector = data & 0x0f; /* Input Selector */
- dac_data_w(space->machine->device("dac"), data & 0x80); /* Sound DAC */
+ dac_data_w(space->machine().device("dac"), data & 0x80); /* Sound DAC */
- coin_counter_w(space->machine, 0, data & 0x40); /* Coin1 */
- coin_counter_w(space->machine, 1, data & 0x10); /* Coin2 */
- coin_counter_w(space->machine, 2, data & 0x20); /* Payout */
+ coin_counter_w(space->machine(), 0, data & 0x40); /* Coin1 */
+ coin_counter_w(space->machine(), 1, data & 0x10); /* Coin2 */
+ coin_counter_w(space->machine(), 2, data & 0x20); /* Payout */
}
diff --git a/src/mame/drivers/magmax.c b/src/mame/drivers/magmax.c
index c842ac10ff2..5e13b2d9309 100644
--- a/src/mame/drivers/magmax.c
+++ b/src/mame/drivers/magmax.c
@@ -32,29 +32,29 @@ Stephh's notes (based on the game M68000 code and some tests) :
static WRITE16_HANDLER( magmax_sound_w )
{
- magmax_state *state = space->machine->driver_data<magmax_state>();
+ magmax_state *state = space->machine().driver_data<magmax_state>();
if (ACCESSING_BITS_0_7)
{
state->sound_latch = (data & 0xff) << 1;
- cputag_set_input_line(space->machine, "audiocpu", 0, ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, ASSERT_LINE);
}
}
static READ8_HANDLER( magmax_sound_irq_ack )
{
- cputag_set_input_line(space->machine, "audiocpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", 0, CLEAR_LINE);
return 0;
}
static READ8_HANDLER( magmax_sound_r )
{
- magmax_state *state = space->machine->driver_data<magmax_state>();
+ magmax_state *state = space->machine().driver_data<magmax_state>();
return (state->sound_latch | state->LS74_q);
}
static WRITE8_DEVICE_HANDLER( ay8910_portB_0_w )
{
- magmax_state *state = device->machine->driver_data<magmax_state>();
+ magmax_state *state = device->machine().driver_data<magmax_state>();
/*bit 0 is input to CLR line of the LS74*/
state->LS74_clr = data & 1;
if (state->LS74_clr == 0)
@@ -63,7 +63,7 @@ static WRITE8_DEVICE_HANDLER( ay8910_portB_0_w )
static TIMER_CALLBACK( scanline_callback )
{
- magmax_state *state = machine->driver_data<magmax_state>();
+ magmax_state *state = machine.driver_data<magmax_state>();
int scanline = param;
/* bit 0 goes hi whenever line V6 from video part goes lo->hi */
@@ -74,14 +74,14 @@ static TIMER_CALLBACK( scanline_callback )
scanline += 128;
scanline &= 255;
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(scanline), scanline);
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(scanline), scanline);
}
static MACHINE_START( magmax )
{
- magmax_state *state = machine->driver_data<magmax_state>();
+ magmax_state *state = machine.driver_data<magmax_state>();
/* Create interrupt timer */
- state->interrupt_timer = machine->scheduler().timer_alloc(FUNC(scanline_callback));
+ state->interrupt_timer = machine.scheduler().timer_alloc(FUNC(scanline_callback));
/* Set up save state */
state_save_register_global(machine, state->sound_latch);
@@ -92,8 +92,8 @@ static MACHINE_START( magmax )
static MACHINE_RESET( magmax )
{
- magmax_state *state = machine->driver_data<magmax_state>();
- state->interrupt_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ magmax_state *state = machine.driver_data<magmax_state>();
+ state->interrupt_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
#if 0
{
@@ -108,10 +108,10 @@ static MACHINE_RESET( magmax )
static WRITE8_DEVICE_HANDLER( ay8910_portA_0_w )
{
- magmax_state *state = device->machine->driver_data<magmax_state>();
-ay8910_device *ay1 = device->machine->device<ay8910_device>("ay1");
-ay8910_device *ay2 = device->machine->device<ay8910_device>("ay2");
-ay8910_device *ay3 = device->machine->device<ay8910_device>("ay3");
+ magmax_state *state = device->machine().driver_data<magmax_state>();
+ay8910_device *ay1 = device->machine().device<ay8910_device>("ay1");
+ay8910_device *ay2 = device->machine().device<ay8910_device>("ay2");
+ay8910_device *ay3 = device->machine().device<ay8910_device>("ay3");
float percent;
/*There are three AY8910 chips and four(!) separate amplifiers on the board
@@ -190,7 +190,7 @@ bit3 - SOUND Chan#8 name=AY-3-8910 #2 Ch C
static WRITE16_HANDLER( magmax_vreg_w )
{
- magmax_state *state = space->machine->driver_data<magmax_state>();
+ magmax_state *state = space->machine().driver_data<magmax_state>();
/* VRAM CONTROL REGISTER */
/* bit0 - coin counter 1 */
/* bit1 - coin counter 2 */
diff --git a/src/mame/drivers/magtouch.c b/src/mame/drivers/magtouch.c
index a73d8cadbc7..2c8139df14b 100644
--- a/src/mame/drivers/magtouch.c
+++ b/src/mame/drivers/magtouch.c
@@ -97,9 +97,9 @@ public:
*
*************************************/
-static void magtouch_microtouch_tx_callback(running_machine *machine, UINT8 data)
+static void magtouch_microtouch_tx_callback(running_machine &machine, UINT8 data)
{
- ins8250_receive(machine->device("ns16450_0"), data);
+ ins8250_receive(machine.device("ns16450_0"), data);
};
static INS8250_TRANSMIT( magtouch_com_transmit )
@@ -110,7 +110,7 @@ static INS8250_TRANSMIT( magtouch_com_transmit )
static INS8250_INTERRUPT( at_com_interrupt_1 )
{
- pic8259_ir4_w(device->machine->device("pic8259_1"), state);
+ pic8259_ir4_w(device->machine().device("pic8259_1"), state);
}
static const ins8250_interface magtouch_com0_interface =
@@ -133,7 +133,7 @@ static READ8_HANDLER(magtouch_io_r)
switch(offset)
{
case 1:
- return input_port_read(space->machine, "IN0");
+ return input_port_read(space->machine(), "IN0");
default:
return 0;
}
@@ -144,7 +144,7 @@ static WRITE8_HANDLER(magtouch_io_w)
switch(offset)
{
case 6:
- memory_set_bank(space->machine, "rombank", data & 0x7f );
+ memory_set_bank(space->machine(), "rombank", data & 0x7f );
break;
}
}
@@ -176,9 +176,9 @@ static INPUT_PORTS_START( magtouch )
PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_COIN3) PORT_IMPULSE(1)
INPUT_PORTS_END
-static void magtouch_set_keyb_int(running_machine *machine, int state)
+static void magtouch_set_keyb_int(running_machine &machine, int state)
{
- pic8259_ir1_w(machine->device("pic8259_1"), state);
+ pic8259_ir1_w(machine.device("pic8259_1"), state);
}
static const struct pc_vga_interface vga_interface =
@@ -192,11 +192,11 @@ static const struct pc_vga_interface vga_interface =
static MACHINE_START( magtouch )
{
- device_set_irq_callback(machine->device("maincpu"), pcat_irq_callback);
+ device_set_irq_callback(machine.device("maincpu"), pcat_irq_callback);
init_pc_common(machine, PCCOMMON_KEYBOARD_AT, magtouch_set_keyb_int);
- memory_configure_bank(machine, "rombank", 0, 0x80, machine->region("game_prg")->base(), 0x8000 );
+ memory_configure_bank(machine, "rombank", 0, 0x80, machine.region("game_prg")->base(), 0x8000 );
memory_set_bank(machine, "rombank", 0);
microtouch_init(machine, magtouch_microtouch_tx_callback, NULL);
diff --git a/src/mame/drivers/mainevt.c b/src/mame/drivers/mainevt.c
index 156c11b6814..e36ec298053 100644
--- a/src/mame/drivers/mainevt.c
+++ b/src/mame/drivers/mainevt.c
@@ -33,7 +33,7 @@ Notes:
static INTERRUPT_GEN( mainevt_interrupt )
{
- mainevt_state *state = device->machine->driver_data<mainevt_state>();
+ mainevt_state *state = device->machine().driver_data<mainevt_state>();
if (k052109_is_irq_enabled(state->k052109))
irq0_line_hold(device);
@@ -41,13 +41,13 @@ static INTERRUPT_GEN( mainevt_interrupt )
static WRITE8_HANDLER( dv_nmienable_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
state->nmi_enable = data;
}
static INTERRUPT_GEN( dv_interrupt )
{
- mainevt_state *state = device->machine->driver_data<mainevt_state>();
+ mainevt_state *state = device->machine().driver_data<mainevt_state>();
if (state->nmi_enable)
nmi_line_pulse(device);
@@ -56,10 +56,10 @@ static INTERRUPT_GEN( dv_interrupt )
static WRITE8_HANDLER( mainevt_bankswitch_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
/* bit 0-1 ROM bank select */
- memory_set_bank(space->machine, "bank1", data & 0x03);
+ memory_set_bank(space->machine(), "bank1", data & 0x03);
/* TODO: bit 5 = select work RAM or palette? */
//palette_selected = data & 0x20;
@@ -74,17 +74,17 @@ static WRITE8_HANDLER( mainevt_bankswitch_w )
static WRITE8_HANDLER( mainevt_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x10);
- coin_counter_w(space->machine, 1, data & 0x20);
- set_led_status(space->machine, 0, data & 0x01);
- set_led_status(space->machine, 1, data & 0x02);
- set_led_status(space->machine, 2, data & 0x04);
- set_led_status(space->machine, 3, data & 0x08);
+ coin_counter_w(space->machine(), 0, data & 0x10);
+ coin_counter_w(space->machine(), 1, data & 0x20);
+ set_led_status(space->machine(), 0, data & 0x01);
+ set_led_status(space->machine(), 1, data & 0x02);
+ set_led_status(space->machine(), 2, data & 0x04);
+ set_led_status(space->machine(), 3, data & 0x08);
}
static WRITE8_HANDLER( mainevt_sh_irqtrigger_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
device_set_input_line_and_vector(state->audiocpu, 0, HOLD_LINE, 0xff);
}
@@ -95,7 +95,7 @@ static READ8_DEVICE_HANDLER( mainevt_sh_busy_r )
static WRITE8_HANDLER( mainevt_sh_irqcontrol_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
upd7759_reset_w(state->upd, data & 2);
upd7759_start_w(state->upd, data & 1);
@@ -110,7 +110,7 @@ static WRITE8_HANDLER( devstor_sh_irqcontrol_w )
static WRITE8_HANDLER( mainevt_sh_bankswitch_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
int bank_A, bank_B;
//logerror("CPU #1 PC: %04x bank switch = %02x\n",cpu_get_pc(space->cpu),data);
@@ -138,7 +138,7 @@ static WRITE8_DEVICE_HANDLER( dv_sh_bankswitch_w )
static READ8_HANDLER( k052109_051960_r )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
if (k052109_get_rmrd_line(state->k052109) == CLEAR_LINE)
{
@@ -155,7 +155,7 @@ static READ8_HANDLER( k052109_051960_r )
static WRITE8_HANDLER( k052109_051960_w )
{
- mainevt_state *state = space->machine->driver_data<mainevt_state>();
+ mainevt_state *state = space->machine().driver_data<mainevt_state>();
if (offset >= 0x3800 && offset < 0x3808)
k051937_w(state->k051960, offset - 0x3800, data);
@@ -417,24 +417,24 @@ static const k051960_interface mainevt_k051960_intf =
static MACHINE_START( mainevt )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
- UINT8 *ROM = machine->region("maincpu")->base();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
+ UINT8 *ROM = machine.region("maincpu")->base();
memory_configure_bank(machine, "bank1", 0, 4, &ROM[0x10000], 0x2000);
- state->maincpu = machine->device("maincpu");
- state->audiocpu = machine->device("audiocpu");
- state->upd = machine->device("upd");
- state->k007232 = machine->device("k007232");
- state->k052109 = machine->device("k052109");
- state->k051960 = machine->device("k051960");
+ state->maincpu = machine.device("maincpu");
+ state->audiocpu = machine.device("audiocpu");
+ state->upd = machine.device("upd");
+ state->k007232 = machine.device("k007232");
+ state->k052109 = machine.device("k052109");
+ state->k051960 = machine.device("k051960");
state->save_item(NAME(state->nmi_enable));
}
static MACHINE_RESET( mainevt )
{
- mainevt_state *state = machine->driver_data<mainevt_state>();
+ mainevt_state *state = machine.driver_data<mainevt_state>();
state->nmi_enable = 0;
}
diff --git a/src/mame/drivers/mainsnk.c b/src/mame/drivers/mainsnk.c
index 61affe0a88a..3a579ada93b 100644
--- a/src/mame/drivers/mainsnk.c
+++ b/src/mame/drivers/mainsnk.c
@@ -114,11 +114,11 @@ cc_p14.j2 8192 0xedc6a1eb M5L2764k
static WRITE8_HANDLER( sound_command_w )
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
state->sound_cpu_busy = 1;
soundlatch_w(space, 0, data);
- cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
+ cputag_set_input_line(space->machine(), "audiocpu", INPUT_LINE_NMI, PULSE_LINE);
}
static READ8_HANDLER( sound_command_r )
@@ -128,7 +128,7 @@ static READ8_HANDLER( sound_command_r )
static READ8_HANDLER( sound_ack_r )
{
- mainsnk_state *state = space->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = space->machine().driver_data<mainsnk_state>();
state->sound_cpu_busy = 0;
return 0xff;
@@ -136,7 +136,7 @@ static READ8_HANDLER( sound_ack_r )
static CUSTOM_INPUT( mainsnk_sound_r )
{
- mainsnk_state *state = field->port->machine->driver_data<mainsnk_state>();
+ mainsnk_state *state = field->port->machine().driver_data<mainsnk_state>();
return (state->sound_cpu_busy) ? 0x01 : 0x00;
}
diff --git a/src/mame/drivers/malzak.c b/src/mame/drivers/malzak.c
index ef2c5b1c3c0..44065ce7ff1 100644
--- a/src/mame/drivers/malzak.c
+++ b/src/mame/drivers/malzak.c
@@ -74,8 +74,8 @@
static READ8_HANDLER( fake_VRLE_r )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
- return (s2636_work_ram_r(state->s2636_0, 0xcb) & 0x3f) + (space->machine->primary_screen->vblank() * 0x40);
+ malzak_state *state = space->machine().driver_data<malzak_state>();
+ return (s2636_work_ram_r(state->s2636_0, 0xcb) & 0x3f) + (space->machine().primary_screen->vblank() * 0x40);
}
static READ8_HANDLER( s2636_portA_r )
@@ -83,7 +83,7 @@ static READ8_HANDLER( s2636_portA_r )
// POT switch position, read from port A of the first S2636
// Not sure of the correct values to return, but these should
// do based on the game code.
- switch (input_port_read(space->machine, "POT"))
+ switch (input_port_read(space->machine(), "POT"))
{
case 0: // Normal play
return 0xf0;
@@ -153,27 +153,27 @@ static WRITE8_HANDLER( port40_w )
// Bits 1-3 are all set high upon death, until the game continues
// Bit 6 is used only in Malzak II, and is set high after checking
// the selected version
-// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(space->machine->device("maincpu")), data);
- memory_set_bank(space->machine, "bank1", (data & 0x40) >> 6);
+// logerror("S2650 [0x%04x]: port 0x40 write: 0x%02x\n", cpu_get_pc(space->machine().device("maincpu")), data);
+ memory_set_bank(space->machine(), "bank1", (data & 0x40) >> 6);
}
static WRITE8_HANDLER( port60_w )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
state->malzak_x = data;
// logerror("I/O: port 0x60 write 0x%02x\n", data);
}
static WRITE8_HANDLER( portc0_w )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
state->malzak_y = data;
// logerror("I/O: port 0xc0 write 0x%02x\n", data);
}
static READ8_HANDLER( collision_r )
{
- malzak_state *state = space->machine->driver_data<malzak_state>();
+ malzak_state *state = space->machine().driver_data<malzak_state>();
// High 4 bits seem to refer to the row affected.
if(++state->collision_counter > 15)
@@ -372,13 +372,13 @@ static const saa5050_interface malzac_saa5050_intf =
static MACHINE_START( malzak )
{
- malzak_state *state = machine->driver_data<malzak_state>();
+ malzak_state *state = machine.driver_data<malzak_state>();
- memory_configure_bank(machine, "bank1", 0, 2, machine->region("user2")->base(), 0x400);
+ memory_configure_bank(machine, "bank1", 0, 2, machine.region("user2")->base(), 0x400);
- state->s2636_0 = machine->device("s2636_0");
- state->s2636_1 = machine->device("s2636_1");
- state->saa5050 = machine->device("saa5050");
+ state->s2636_0 = machine.device("s2636_0");
+ state->s2636_1 = machine.device("s2636_1");
+ state->saa5050 = machine.device("saa5050");
state->save_item(NAME(state->playfield_code));
state->save_item(NAME(state->malzak_x));
@@ -387,7 +387,7 @@ static MACHINE_START( malzak )
static MACHINE_RESET( malzak )
{
- malzak_state *state = machine->driver_data<malzak_state>();
+ malzak_state *state = machine.driver_data<malzak_state>();
memset(state->playfield_code, 0, 256);
diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c
index 1386b6c4835..7c3b0f2864a 100644
--- a/src/mame/drivers/mappy.c
+++ b/src/mame/drivers/mappy.c
@@ -579,29 +579,29 @@ TODO:
static WRITE8_HANDLER( superpac_latch_w )
{
- device_t *namcoio_1 = space->machine->device("namcoio_1");
- device_t *namcoio_2 = space->machine->device("namcoio_2");
+ device_t *namcoio_1 = space->machine().device("namcoio_1");
+ device_t *namcoio_2 = space->machine().device("namcoio_2");
int bit = offset & 1;
switch (offset & 0x0e)
{
case 0x00: /* INT ON 2 */
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02: /* INT ON */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x04: /* n.c. */
break;
case 0x06: /* SOUND ON */
- mappy_sound_enable(space->machine->device("namco"), bit);
+ mappy_sound_enable(space->machine().device("namco"), bit);
break;
case 0x08: /* 4 RESET */
@@ -610,7 +610,7 @@ static WRITE8_HANDLER( superpac_latch_w )
break;
case 0x0a: /* SUB RESET */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0c: /* n.c. */
@@ -623,32 +623,32 @@ static WRITE8_HANDLER( superpac_latch_w )
static WRITE8_HANDLER( phozon_latch_w )
{
- device_t *namcoio_1 = space->machine->device("namcoio_1");
- device_t *namcoio_2 = space->machine->device("namcoio_2");
+ device_t *namcoio_1 = space->machine().device("namcoio_1");
+ device_t *namcoio_2 = space->machine().device("namcoio_2");
int bit = offset & 1;
switch (offset & 0x0e)
{
case 0x00:
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02:
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x04:
- cpu_interrupt_enable(space->machine->device("sub2"), bit);
+ cpu_interrupt_enable(space->machine().device("sub2"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub2", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub2", 0, CLEAR_LINE);
break;
case 0x06:
- mappy_sound_enable(space->machine->device("namco"), bit);
+ mappy_sound_enable(space->machine().device("namco"), bit);
break;
case 0x08:
@@ -657,11 +657,11 @@ static WRITE8_HANDLER( phozon_latch_w )
break;
case 0x0a:
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0c:
- cputag_set_input_line(space->machine, "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub2", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0e:
@@ -671,30 +671,30 @@ static WRITE8_HANDLER( phozon_latch_w )
static WRITE8_HANDLER( mappy_latch_w )
{
- device_t *namcoio_1 = space->machine->device("namcoio_1");
- device_t *namcoio_2 = space->machine->device("namcoio_2");
+ device_t *namcoio_1 = space->machine().device("namcoio_1");
+ device_t *namcoio_2 = space->machine().device("namcoio_2");
int bit = offset & 1;
switch (offset & 0x0e)
{
case 0x00: /* INT ON 2 */
- cpu_interrupt_enable(space->machine->device("sub"), bit);
+ cpu_interrupt_enable(space->machine().device("sub"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "sub", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "sub", 0, CLEAR_LINE);
break;
case 0x02: /* INT ON */
- cpu_interrupt_enable(space->machine->device("maincpu"), bit);
+ cpu_interrupt_enable(space->machine().device("maincpu"), bit);
if (!bit)
- cputag_set_input_line(space->machine, "maincpu", 0, CLEAR_LINE);
+ cputag_set_input_line(space->machine(), "maincpu", 0, CLEAR_LINE);
break;
case 0x04: /* FLIP */
- flip_screen_set(space->machine, bit);
+ flip_screen_set(space->machine(), bit);
break;
case 0x06: /* SOUND ON */
- mappy_sound_enable(space->machine->device("namco"), bit);
+ mappy_sound_enable(space->machine().device("namco"), bit);
break;
case 0x08: /* 4 RESET */
@@ -703,7 +703,7 @@ static WRITE8_HANDLER( mappy_latch_w )
break;
case 0x0a: /* SUB RESET */
- cputag_set_input_line(space->machine, "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
+ cputag_set_input_line(space->machine(), "sub", INPUT_LINE_RESET, bit ? CLEAR_LINE : ASSERT_LINE);
break;
case 0x0c: /* n.c. */
@@ -717,7 +717,7 @@ static WRITE8_HANDLER( mappy_latch_w )
static MACHINE_RESET( superpac )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -727,7 +727,7 @@ static MACHINE_RESET( superpac )
static MACHINE_RESET( phozon )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -737,7 +737,7 @@ static MACHINE_RESET( phozon )
static MACHINE_RESET( mappy )
{
- address_space *space = machine->device("maincpu")->memory().space(AS_PROGRAM);
+ address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
int i;
/* Reset all latches */
@@ -749,8 +749,8 @@ static MACHINE_RESET( mappy )
static TIMER_CALLBACK( superpac_io_run )
{
- device_t *io56xx_1 = machine->device("namcoio_1");
- device_t *io56xx_2 = machine->device("namcoio_2");
+ device_t *io56xx_1 = machine.device("namcoio_1");
+ device_t *io56xx_2 = machine.device("namcoio_2");
switch (param)
{
@@ -765,23 +765,23 @@ static TIMER_CALLBACK( superpac_io_run )
static INTERRUPT_GEN( superpac_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(superpac_io_run), 1);
}
static TIMER_CALLBACK( pacnpal_io_run )
{
- device_t *io56xx = machine->device("namcoio_1");
- device_t *io59xx = machine->device("namcoio_2");
+ device_t *io56xx = machine.device("namcoio_1");
+ device_t *io59xx = machine.device("namcoio_2");
switch (param)
{
@@ -796,23 +796,23 @@ static TIMER_CALLBACK( pacnpal_io_run )
static INTERRUPT_GEN( pacnpal_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(pacnpal_io_run), 1);
}
static TIMER_CALLBACK( phozon_io_run )
{
- device_t *io58xx = machine->device("namcoio_1");
- device_t *io56xx = machine->device("namcoio_2");
+ device_t *io58xx = machine.device("namcoio_1");
+ device_t *io56xx = machine.device("namcoio_2");
switch (param)
{
@@ -827,23 +827,23 @@ static TIMER_CALLBACK( phozon_io_run )
static INTERRUPT_GEN( phozon_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(phozon_io_run), 1);
}
static TIMER_CALLBACK( mappy_io_run )
{
- device_t *io58xx_1 = machine->device("namcoio_1");
- device_t *io58xx_2 = machine->device("namcoio_2");
+ device_t *io58xx_1 = machine.device("namcoio_1");
+ device_t *io58xx_2 = machine.device("namcoio_2");
switch (param)
{
@@ -858,17 +858,17 @@ static TIMER_CALLBACK( mappy_io_run )
static INTERRUPT_GEN( mappy_interrupt_1 )
{
- device_t *namcoio_1 = device->machine->device("namcoio_1");
- device_t *namcoio_2 = device->machine->device("namcoio_2");
+ device_t *namcoio_1 = device->machine().device("namcoio_1");
+ device_t *namcoio_2 = device->machine().device("namcoio_2");
irq0_line_assert(device); // this also checks if irq is enabled - IMPORTANT!
// so don't replace with cputag_set_input_line(machine, "maincpu", 0, ASSERT_LINE);
if (!namcoio_read_reset_line(namcoio_1)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run));
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run));
if (!namcoio_read_reset_line(namcoio_2)) /* give the cpu a tiny bit of time to write the command before processing it */
- device->machine->scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run), 1);
+ device->machine().scheduler().timer_set(attotime::from_usec(50), FUNC(mappy_io_run), 1);
}
@@ -1538,37 +1538,37 @@ static const namco_interface namco_config =
***************************************************************************/
-static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine, "DSW1"); } // dips A
-static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine, "DSW1") >> 4; } // dips A
+static READ8_DEVICE_HANDLER( dipA_l ) { return input_port_read(device->machine(), "DSW1"); } // dips A
+static READ8_DEVICE_HANDLER( dipA_h ) { return input_port_read(device->machine(), "DSW1") >> 4; } // dips A
static READ8_DEVICE_HANDLER( dipB_mux ) // dips B
{
- mappy_state *state = device->machine->driver_data<mappy_state>();
+ mappy_state *state = device->machine().driver_data<mappy_state>();
- return input_port_read(device->machine, "DSW2") >> (4 * state->mux);
+ return input_port_read(device->machine(), "DSW2") >> (4 * state->mux);
}
static READ8_DEVICE_HANDLER( dipB_muxi ) // dips B
{
- mappy_state *state = device->machine->driver_data<mappy_state>();
+ mappy_state *state = device->machine().driver_data<mappy_state>();
// bits are interleaved in Phozon
- return BITSWAP8(input_port_read(device->machine, "DSW2"),6,4,2,0,7,5,3,1) >> (4 * state->mux);
+ return BITSWAP8(input_port_read(device->machine(), "DSW2"),6,4,2,0,7,5,3,1) >> (4 * state->mux);
}
static WRITE8_DEVICE_HANDLER( out_mux )
{
- mappy_state *state = device->machine->driver_data<mappy_state>();
+ mappy_state *state = device->machine().driver_data<mappy_state>();
state->mux = data & 1;
}
static WRITE8_DEVICE_HANDLER( out_lamps )
{
- set_led_status(device->machine, 0, data & 1);
- set_led_status(device->machine, 1, data & 2);
- coin_lockout_global_w(device->machine, data & 4);
- coin_counter_w(device->machine, 0, ~data & 8);
+ set_led_status(device->machine(), 0, data & 1);
+ set_led_status(device->machine(), 1, data & 2);
+ coin_lockout_global_w(device->machine(), data & 4);
+ coin_counter_w(device->machine(), 0, ~data & 8);
}
/* chip #0: player inputs, buttons, coins */
@@ -2239,14 +2239,14 @@ static DRIVER_INIT( grobda )
However, removing the 15XX from the board causes sound to disappear completely, so
the DAC might be built-in after all.
*/
- device_t *dac = machine->device("dac");
- machine->device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x0002, 0x0002, FUNC(grobda_DAC_w) );
+ device_t *dac = machine.device("dac");
+ machine.device("sub")->memory().space(AS_PROGRAM)->install_legacy_write_handler(*dac, 0x0002, 0x0002, FUNC(grobda_DAC_w) );
}
static DRIVER_INIT( digdug2 )
{
/* appears to not use the watchdog */
- machine->device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x8000, 0x8000);
+ machine.device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0x8000, 0x8000);
}
diff --git a/src/mame/drivers/marineb.c b/src/mame/drivers/marineb.c
index a17be0a456d..7de4a0a1531 100644
--- a/src/mame/drivers/marineb.c
+++ b/src/mame/drivers/marineb.c
@@ -43,14 +43,14 @@ write
static TIMER_CALLBACK( interrupt_disable )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
//interrupt_enable = 0;
cpu_interrupt_enable(state->maincpu, 0);
}
static MACHINE_RESET( marineb )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
state->palette_bank = 0;
state->column_scroll = 0;
@@ -59,12 +59,12 @@ static MACHINE_RESET( marineb )
state->marineb_active_low_flipscreen = 0;
/* we must start with NMI interrupts disabled */
- machine->scheduler().synchronize(FUNC(interrupt_disable));
+ machine.scheduler().synchronize(FUNC(interrupt_disable));
}
static MACHINE_RESET( springer )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
MACHINE_RESET_CALL( marineb );
@@ -73,9 +73,9 @@ static MACHINE_RESET( springer )
static MACHINE_START( marineb )
{
- marineb_state *state = machine->driver_data<marineb_state>();
+ marineb_state *state = machine.driver_data<marineb_state>();
- state->maincpu = machine->device("maincpu");
+ state->maincpu = machine.device("maincpu");
state->audiocpu = NULL;
state->save_item(NAME(state->marineb_active_low_flipscreen));
diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c
index 45d78bfa2a7..9269bfbd723 100644
--- a/src/mame/drivers/marinedt.c
+++ b/src/mame/drivers/marinedt.c
@@ -121,7 +121,7 @@ public:
static WRITE8_HANDLER( tx_tileram_w )
{
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
state->tx_tileram[offset] = data;
tilemap_mark_tile_dirty(state->tx_tilemap, offset);
@@ -129,12 +129,12 @@ static WRITE8_HANDLER( tx_tileram_w )
static READ8_HANDLER( marinedt_port1_r )
{
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
//might need to be reversed for cocktail stuff
/* x/y multiplexed */
- return input_port_read(space->machine, ((state->pf & 0x08) >> 3) ? "TRACKY" : "TRACKX");
+ return input_port_read(space->machine(), ((state->pf & 0x08) >> 3) ? "TRACKY" : "TRACKX");
}
static READ8_HANDLER( marinedt_coll_r )
@@ -145,7 +145,7 @@ static READ8_HANDLER( marinedt_coll_r )
//----x--- obj1 to playfield collision
//-----xxx unused
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
return state->coll | state->collh;
}
@@ -159,8 +159,8 @@ static READ8_HANDLER( marinedt_obj1_x_r )
//xxxx---- unknown
//----xxxx x pos in tile ram
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
- UINT8 *RAM = space->machine->region("maincpu")->base();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
+ UINT8 *RAM = space->machine().region("maincpu")->base();
if (RAM[0x430e])
--state->cx;
@@ -177,7 +177,7 @@ static READ8_HANDLER( marinedt_obj1_yr_r )
//xxxx---- unknown
//----xxxx row in current screen quarter
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
//has to be +1 if cx went over?
if (state->cx == 0x10)
@@ -194,18 +194,18 @@ static READ8_HANDLER( marinedt_obj1_yq_r )
//----xx-- unknown
//------xx screen quarter
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
return state->cyq | (state->cyqh << 4);
}
-static WRITE8_HANDLER( marinedt_obj1_a_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj1_a = data; }
-static WRITE8_HANDLER( marinedt_obj1_x_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj1_x = data; }
-static WRITE8_HANDLER( marinedt_obj1_y_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj1_y = data; }
-static WRITE8_HANDLER( marinedt_obj2_a_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj2_a = data; }
-static WRITE8_HANDLER( marinedt_obj2_x_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj2_x = data; }
-static WRITE8_HANDLER( marinedt_obj2_y_w ) { marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->obj2_y = data; }
+static WRITE8_HANDLER( marinedt_obj1_a_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj1_a = data; }
+static WRITE8_HANDLER( marinedt_obj1_x_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj1_x = data; }
+static WRITE8_HANDLER( marinedt_obj1_y_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj1_y = data; }
+static WRITE8_HANDLER( marinedt_obj2_a_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj2_a = data; }
+static WRITE8_HANDLER( marinedt_obj2_x_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj2_x = data; }
+static WRITE8_HANDLER( marinedt_obj2_y_w ) { marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->obj2_y = data; }
-static WRITE8_HANDLER( marinedt_music_w ){ marinedt_state *state = space->machine->driver_data<marinedt_state>(); state->music = data; }
+static WRITE8_HANDLER( marinedt_music_w ){ marinedt_state *state = space->machine().driver_data<marinedt_state>(); state->music = data; }
static WRITE8_HANDLER( marinedt_sound_w )
{
@@ -218,7 +218,7 @@ static WRITE8_HANDLER( marinedt_sound_w )
//------x- dots hit
//-------x ??
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
state->sound = data;
}
@@ -232,7 +232,7 @@ static WRITE8_HANDLER( marinedt_pd_w )
//------x- obj2 enable
//-------x obj1 enable
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
state->pd = data;
}
@@ -260,7 +260,7 @@ static WRITE8_HANDLER( marinedt_pf_w )
//------x- ?? upright/cocktail
//-------x ?? service mode (coin lockout??)
- marinedt_state *state = space->machine->driver_data<marinedt_state>();
+ marinedt_state *state = space->machine().driver_data<marinedt_state>();
//if ((state->pf & 0x07) != (data & 0x07))
// mame_printf_debug("marinedt_pf_w: %02x\n", data & 0x07);
@@ -282,7 +282,7 @@ static WRITE8_HANDLER( marinedt_pf_w )
//if (data & 0xf0)
// logerror("pf:%02x %d\n", state->pf);
- //logerror("pd:%02x %d\n", state->pd, space->machine->primary_screen->frame_number());
+ //logerror("pd:%02x %d\n", state->pd, space->machine().primary_screen->frame_number());
}
@@ -425,7 +425,7 @@ static PALETTE_INIT( marinedt )
{
int i,r,b,g;
- for (i = 0; i < machine->total_colors(); i++)
+ for (i = 0; i < machine.total_colors(); i++)
{
int bit0, bit1, bit2;
@@ -456,7 +456,7 @@ bit0 = 0;
static TILE_GET_INFO( get_tile_info )
{
- marinedt_state *state = machine->driver_data<marinedt_state>();
+ marinedt_state *state = machine.driver_data<marinedt_state>();
int code = state->tx_tileram[tile_index];
int color = 0;
int flags = TILE_FLIPX;
@@ -466,16 +466,16 @@ static TILE_GET_INFO( get_tile_info )
static VIDEO_START( marinedt )
{
- marinedt_state *state = machine->driver_data<marinedt_state>();
+ marinedt_state *state = machine.driver_data<marinedt_state>();
state->tx_tilemap = tilemap_create(machine, get_tile_info, tilemap_scan_rows, 8, 8, 32, 32);
tilemap_set_transparent_pen(state->tx_tilemap, 0);
tilemap_set_scrolldx(state->tx_tilemap, 0, 4*8);
tilemap_set_scrolldy(state->tx_tilemap, 0, -4*8);
- state->tile = auto_bitmap_alloc(machine, 32 * 8, 32 * 8, machine->primary_screen->format());
- state-