summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-09-17 08:22:16 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-09-17 08:22:16 +0000
commit3cce7e019e095296b5ce2bb45d19b1209bed961d (patch)
tree4fa76260ac2dee5878fbba70d759ba6a1d4d76bf /src/mess
parent22b4739aded17790b3f1bf31b9da8ff9e6a0860c (diff)
Memory handler normalization, part 2. Change legacy
read/write handlers to take an address_space & instead of an address_space *. Also update pretty much all other functions to take a reference where appropriate. [Aaron Giles]
Diffstat (limited to 'src/mess')
-rw-r--r--src/mess/drivers/a2600.c94
-rw-r--r--src/mess/drivers/a5105.c4
-rw-r--r--src/mess/drivers/amiga.c8
-rw-r--r--src/mess/drivers/apexc.c6
-rw-r--r--src/mess/drivers/apollo.c4
-rw-r--r--src/mess/drivers/aquarius.c4
-rw-r--r--src/mess/drivers/astrocde.c26
-rw-r--r--src/mess/drivers/atm.c8
-rw-r--r--src/mess/drivers/avigo.c12
-rw-r--r--src/mess/drivers/b16.c4
-rw-r--r--src/mess/drivers/basic52.c4
-rw-r--r--src/mess/drivers/bebox.c10
-rw-r--r--src/mess/drivers/bigbord2.c12
-rw-r--r--src/mess/drivers/bullet.c4
-rw-r--r--src/mess/drivers/c128.c4
-rw-r--r--src/mess/drivers/c64.c4
-rw-r--r--src/mess/drivers/cd2650.c8
-rw-r--r--src/mess/drivers/d6800.c4
-rw-r--r--src/mess/drivers/dc.c24
-rw-r--r--src/mess/drivers/dmv.c4
-rw-r--r--src/mess/drivers/enterp.c36
-rw-r--r--src/mess/drivers/esq5505.c2
-rw-r--r--src/mess/drivers/fk1.c4
-rw-r--r--src/mess/drivers/fm7.c78
-rw-r--r--src/mess/drivers/fmtowns.c2
-rw-r--r--src/mess/drivers/gba.c6
-rw-r--r--src/mess/drivers/gp32.c8
-rw-r--r--src/mess/drivers/homelab.c4
-rw-r--r--src/mess/drivers/indiana.c2
-rw-r--r--src/mess/drivers/instruct.c4
-rw-r--r--src/mess/drivers/ip22.c42
-rw-r--r--src/mess/drivers/itt3030.c4
-rw-r--r--src/mess/drivers/lynx.c8
-rw-r--r--src/mess/drivers/mc10.c4
-rw-r--r--src/mess/drivers/megadriv.c14
-rw-r--r--src/mess/drivers/mikromik.c4
-rw-r--r--src/mess/drivers/mmodular.c26
-rw-r--r--src/mess/drivers/nanos.c10
-rw-r--r--src/mess/drivers/nc.c14
-rw-r--r--src/mess/drivers/nes.c2
-rw-r--r--src/mess/drivers/next.c6
-rw-r--r--src/mess/drivers/ng_aes.c68
-rw-r--r--src/mess/drivers/p8k.c4
-rw-r--r--src/mess/drivers/palm.c6
-rw-r--r--src/mess/drivers/pc6001.c6
-rw-r--r--src/mess/drivers/pc88va.c6
-rw-r--r--src/mess/drivers/pc9801.c4
-rw-r--r--src/mess/drivers/pce220.c4
-rw-r--r--src/mess/drivers/pcw.c6
-rw-r--r--src/mess/drivers/pcw16.c66
-rw-r--r--src/mess/drivers/pentagon.c8
-rw-r--r--src/mess/drivers/pipbug.c4
-rw-r--r--src/mess/drivers/psion.c8
-rw-r--r--src/mess/drivers/psx.c4
-rw-r--r--src/mess/drivers/px4.c28
-rw-r--r--src/mess/drivers/qx10.c4
-rw-r--r--src/mess/drivers/samcoupe.c6
-rw-r--r--src/mess/drivers/sc2.c2
-rw-r--r--src/mess/drivers/scorpion.c8
-rw-r--r--src/mess/drivers/spc1000.c10
-rw-r--r--src/mess/drivers/spec128.c8
-rw-r--r--src/mess/drivers/specpls3.c34
-rw-r--r--src/mess/drivers/spectrum.c10
-rw-r--r--src/mess/drivers/super6.c4
-rw-r--r--src/mess/drivers/timex.c160
-rw-r--r--src/mess/drivers/trs80m2.c4
-rw-r--r--src/mess/drivers/tvc.c16
-rw-r--r--src/mess/drivers/vc4000.c10
-rw-r--r--src/mess/drivers/vidbrain.c2
-rw-r--r--src/mess/drivers/vii.c22
-rw-r--r--src/mess/drivers/vt520.c4
-rw-r--r--src/mess/drivers/vtech1.c22
-rw-r--r--src/mess/drivers/x07.c10
-rw-r--r--src/mess/drivers/x1.c18
-rw-r--r--src/mess/drivers/x1twin.c2
-rw-r--r--src/mess/drivers/x68k.c202
-rw-r--r--src/mess/formats/ace_ace.c4
-rw-r--r--src/mess/formats/cbm_snqk.c64
-rw-r--r--src/mess/formats/m65_snqk.c10
-rw-r--r--src/mess/formats/spec_snqk.c140
-rw-r--r--src/mess/formats/z80bin.c22
-rw-r--r--src/mess/includes/samcoupe.h2
-rw-r--r--src/mess/machine/990_hd.c4
-rw-r--r--src/mess/machine/a7800.c10
-rw-r--r--src/mess/machine/aim65.c4
-rw-r--r--src/mess/machine/amigacd.c88
-rw-r--r--src/mess/machine/amigacrt.c26
-rw-r--r--src/mess/machine/amstr_pc.c44
-rw-r--r--src/mess/machine/amstrad.c18
-rw-r--r--src/mess/machine/apollo.c18
-rw-r--r--src/mess/machine/apple1.c4
-rw-r--r--src/mess/machine/apple2.c16
-rw-r--r--src/mess/machine/apple2gs.c88
-rw-r--r--src/mess/machine/apple3.c54
-rw-r--r--src/mess/machine/at.c6
-rw-r--r--src/mess/machine/ataricrt.c66
-rw-r--r--src/mess/machine/b2m.c52
-rw-r--r--src/mess/machine/bebox.c72
-rw-r--r--src/mess/machine/c64.c126
-rw-r--r--src/mess/machine/c65.c104
-rw-r--r--src/mess/machine/cgenie.c146
-rw-r--r--src/mess/machine/comx_clm.c10
-rw-r--r--src/mess/machine/concept.c34
-rw-r--r--src/mess/machine/corvushd.c8
-rw-r--r--src/mess/machine/cpc_ssa1.c10
-rw-r--r--src/mess/machine/dccons.c30
-rw-r--r--src/mess/machine/dgn_beta.c64
-rw-r--r--src/mess/machine/europc.c14
-rw-r--r--src/mess/machine/galaxy.c20
-rw-r--r--src/mess/machine/gb.c64
-rw-r--r--src/mess/machine/hd63450.c60
-rw-r--r--src/mess/machine/hec2hrp.c16
-rw-r--r--src/mess/machine/hecdisk2.c46
-rw-r--r--src/mess/machine/hp48.c44
-rw-r--r--src/mess/machine/intv.c20
-rw-r--r--src/mess/machine/iq151_staper.c8
-rw-r--r--src/mess/machine/isa.c22
-rw-r--r--src/mess/machine/kaypro.c12
-rw-r--r--src/mess/machine/kc.c98
-rw-r--r--src/mess/machine/lisa.c8
-rw-r--r--src/mess/machine/llc.c10
-rw-r--r--src/mess/machine/lux21046.c4
-rw-r--r--src/mess/machine/lviv.c12
-rw-r--r--src/mess/machine/lynx.c4
-rw-r--r--src/mess/machine/mac.c24
-rw-r--r--src/mess/machine/mbc55x.c14
-rw-r--r--src/mess/machine/mbee.c14
-rw-r--r--src/mess/machine/mboard.c16
-rw-r--r--src/mess/machine/microtan.c10
-rw-r--r--src/mess/machine/mpc105.c6
-rw-r--r--src/mess/machine/msx_slot.c66
-rw-r--r--src/mess/machine/mz700.c2
-rw-r--r--src/mess/machine/nes.c44
-rw-r--r--src/mess/machine/nes_ines.c36
-rw-r--r--src/mess/machine/nes_mmc.c12
-rw-r--r--src/mess/machine/nes_pcb.c2010
-rw-r--r--src/mess/machine/northbridge.c6
-rw-r--r--src/mess/machine/nubus.c4
-rw-r--r--src/mess/machine/oric.c92
-rw-r--r--src/mess/machine/orion.c112
-rw-r--r--src/mess/machine/osborne1.c10
-rw-r--r--src/mess/machine/partner.c64
-rw-r--r--src/mess/machine/pc.c4
-rw-r--r--src/mess/machine/pc1350.c12
-rw-r--r--src/mess/machine/pc1403.c4
-rw-r--r--src/mess/machine/pc_fdc.c64
-rw-r--r--src/mess/machine/pc_joy.c14
-rw-r--r--src/mess/machine/pc_joy.h4
-rw-r--r--src/mess/machine/pecom.c14
-rw-r--r--src/mess/machine/pet.c100
-rw-r--r--src/mess/machine/pk8020.c494
-rw-r--r--src/mess/machine/pmd85.c64
-rw-r--r--src/mess/machine/pokemini.c10
-rw-r--r--src/mess/machine/poly88.c4
-rw-r--r--src/mess/machine/pp01.c24
-rw-r--r--src/mess/machine/primo.c10
-rw-r--r--src/mess/machine/radio86.c4
-rw-r--r--src/mess/machine/rmnimbus.c32
-rw-r--r--src/mess/machine/s3c44b0.c38
-rw-r--r--src/mess/machine/samcoupe.c60
-rw-r--r--src/mess/machine/sgi.c170
-rw-r--r--src/mess/machine/sms.c70
-rw-r--r--src/mess/machine/snescart.c6
-rw-r--r--src/mess/machine/sorcerer.c24
-rw-r--r--src/mess/machine/special.c46
-rw-r--r--src/mess/machine/tandy1t.c20
-rw-r--r--src/mess/machine/tf20.c12
-rw-r--r--src/mess/machine/thomflop.c148
-rw-r--r--src/mess/machine/thomson.c386
-rw-r--r--src/mess/machine/ti85.c34
-rw-r--r--src/mess/machine/trs80.c4
-rw-r--r--src/mess/machine/upd71071.c6
-rw-r--r--src/mess/machine/vector06.c10
-rw-r--r--src/mess/machine/vtech2.c16
-rw-r--r--src/mess/machine/wswan.c10
-rw-r--r--src/mess/machine/x68k_neptunex.c4
-rw-r--r--src/mess/machine/x68k_scsiext.c8
-rw-r--r--src/mess/machine/z80ne.c16
-rw-r--r--src/mess/machine/zx.c12
-rw-r--r--src/mess/video/a7800.c6
-rw-r--r--src/mess/video/ac1.c8
-rw-r--r--src/mess/video/apple3.c10
-rw-r--r--src/mess/video/bbc.c6
-rw-r--r--src/mess/video/cgenie.c10
-rw-r--r--src/mess/video/cirrus.c2
-rw-r--r--src/mess/video/dai.c134
-rw-r--r--src/mess/video/dgn_beta.c2
-rw-r--r--src/mess/video/epnick.c2
-rw-r--r--src/mess/video/galaxy.c8
-rw-r--r--src/mess/video/gb.c14
-rw-r--r--src/mess/video/gf4500.c4
-rw-r--r--src/mess/video/hp48.c4
-rw-r--r--src/mess/video/intv.c4
-rw-r--r--src/mess/video/iq151_grafik.c8
-rw-r--r--src/mess/video/irisha.c6
-rw-r--r--src/mess/video/isa_cga.c4
-rw-r--r--src/mess/video/isa_svga_cirrus.c2
-rw-r--r--src/mess/video/isa_svga_s3.c2
-rw-r--r--src/mess/video/isa_svga_tseng.c2
-rw-r--r--src/mess/video/isa_vga.c2
-rw-r--r--src/mess/video/isa_vga_ati.c2
-rw-r--r--src/mess/video/kramermc.c4
-rw-r--r--src/mess/video/newport.c22
-rw-r--r--src/mess/video/nubus_cb264.c2
-rw-r--r--src/mess/video/oric.c6
-rw-r--r--src/mess/video/pc1251.c4
-rw-r--r--src/mess/video/pc1350.c4
-rw-r--r--src/mess/video/pc1401.c4
-rw-r--r--src/mess/video/pc1403.c4
-rw-r--r--src/mess/video/pc_aga.c44
-rw-r--r--src/mess/video/pc_t1t.c32
-rw-r--r--src/mess/video/stic.c4
-rw-r--r--src/mess/video/ti85.c4
-rw-r--r--src/mess/video/x68k.c34
214 files changed, 4012 insertions, 4012 deletions
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index eb611cfda71..df6e38e3528 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -1142,12 +1142,12 @@ DIRECT_UPDATE_MEMBER(a2600_state::modeFE_opbase_handler)
static void modeFE_switch(running_machine &machine,UINT16 offset, UINT8 data)
{
a2600_state *state = machine.driver_data<a2600_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* Retrieve last byte read by the cpu (for this mapping scheme this
should be the last byte that was on the data bus
*/
state->m_FETimer = 1;
- state->m_FE_old_opbase_handler = space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeFE_opbase_handler), state));
+ state->m_FE_old_opbase_handler = space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeFE_opbase_handler), state));
}
READ8_MEMBER(a2600_state::modeFE_switch_r)
@@ -1732,7 +1732,7 @@ static void set_controller( running_machine &machine, const char *controller, un
void a2600_state::machine_reset()
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
int chip = 0xFF;
static const unsigned char snowwhite[] = { 0x10, 0xd0, 0xff, 0xff }; // Snow White Proto
@@ -1911,7 +1911,7 @@ void a2600_state::machine_reset()
if (m_banking_mode == modeDC)
{
- space->install_read_handler(0x1fec, 0x1fec, read8_delegate(FUNC(a2600_state::current_bank_r),this));
+ space.install_read_handler(0x1fec, 0x1fec, read8_delegate(FUNC(a2600_state::current_bank_r),this));
}
/* set up bank switch registers */
@@ -1919,89 +1919,89 @@ void a2600_state::machine_reset()
switch (m_banking_mode)
{
case modeF8:
- space->install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
- space->install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
+ space.install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
+ space.install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
break;
case modeFA:
- space->install_write_handler(0x1ff8, 0x1ffa, write8_delegate(FUNC(a2600_state::modeFA_switch_w),this));
- space->install_read_handler(0x1ff8, 0x1ffa, read8_delegate(FUNC(a2600_state::modeFA_switch_r),this));
+ space.install_write_handler(0x1ff8, 0x1ffa, write8_delegate(FUNC(a2600_state::modeFA_switch_w),this));
+ space.install_read_handler(0x1ff8, 0x1ffa, read8_delegate(FUNC(a2600_state::modeFA_switch_r),this));
break;
case modeF6:
- space->install_write_handler(0x1ff6, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF6_switch_w),this));
- space->install_read_handler(0x1ff6, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF6_switch_r),this));
- space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeF6_opbase), this));
+ space.install_write_handler(0x1ff6, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF6_switch_w),this));
+ space.install_read_handler(0x1ff6, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF6_switch_r),this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeF6_opbase), this));
break;
case modeF4:
- space->install_write_handler(0x1ff4, 0x1ffb, write8_delegate(FUNC(a2600_state::modeF4_switch_w),this));
- space->install_read_handler(0x1ff4, 0x1ffb, read8_delegate(FUNC(a2600_state::modeF4_switch_r),this));
+ space.install_write_handler(0x1ff4, 0x1ffb, write8_delegate(FUNC(a2600_state::modeF4_switch_w),this));
+ space.install_read_handler(0x1ff4, 0x1ffb, read8_delegate(FUNC(a2600_state::modeF4_switch_r),this));
break;
case modeE0:
- space->install_write_handler(0x1fe0, 0x1ff8, write8_delegate(FUNC(a2600_state::modeE0_switch_w),this));
- space->install_read_handler(0x1fe0, 0x1ff8, read8_delegate(FUNC(a2600_state::modeE0_switch_r),this));
+ space.install_write_handler(0x1fe0, 0x1ff8, write8_delegate(FUNC(a2600_state::modeE0_switch_w),this));
+ space.install_read_handler(0x1fe0, 0x1ff8, read8_delegate(FUNC(a2600_state::modeE0_switch_r),this));
break;
case mode3F:
- space->install_write_handler(0x00, 0x3f, write8_delegate(FUNC(a2600_state::mode3F_switch_w),this));
+ space.install_write_handler(0x00, 0x3f, write8_delegate(FUNC(a2600_state::mode3F_switch_w),this));
break;
case modeUA:
- space->install_write_handler(0x200, 0x27f, write8_delegate(FUNC(a2600_state::modeUA_switch_w),this));
- space->install_read_handler(0x200, 0x27f, read8_delegate(FUNC(a2600_state::modeUA_switch_r),this));
+ space.install_write_handler(0x200, 0x27f, write8_delegate(FUNC(a2600_state::modeUA_switch_w),this));
+ space.install_read_handler(0x200, 0x27f, read8_delegate(FUNC(a2600_state::modeUA_switch_r),this));
break;
case modeE7:
- space->install_write_handler(0x1fe0, 0x1fe7, write8_delegate(FUNC(a2600_state::modeE7_switch_w),this));
- space->install_read_handler(0x1fe0, 0x1fe7, read8_delegate(FUNC(a2600_state::modeE7_switch_r),this));
- space->install_write_handler(0x1fe8, 0x1feb, write8_delegate(FUNC(a2600_state::modeE7_RAM_switch_w),this));
- space->install_read_handler(0x1fe8, 0x1feb, read8_delegate(FUNC(a2600_state::modeE7_RAM_switch_r),this));
- space->install_readwrite_bank(0x1800, 0x18ff, "bank9");
+ space.install_write_handler(0x1fe0, 0x1fe7, write8_delegate(FUNC(a2600_state::modeE7_switch_w),this));
+ space.install_read_handler(0x1fe0, 0x1fe7, read8_delegate(FUNC(a2600_state::modeE7_switch_r),this));
+ space.install_write_handler(0x1fe8, 0x1feb, write8_delegate(FUNC(a2600_state::modeE7_RAM_switch_w),this));
+ space.install_read_handler(0x1fe8, 0x1feb, read8_delegate(FUNC(a2600_state::modeE7_RAM_switch_r),this));
+ space.install_readwrite_bank(0x1800, 0x18ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base() + 4 * 256 );
break;
case modeDC:
- space->install_write_handler(0x1ff0, 0x1ff0, write8_delegate(FUNC(a2600_state::modeDC_switch_w),this));
- space->install_read_handler(0x1ff0, 0x1ff0, read8_delegate(FUNC(a2600_state::modeDC_switch_r),this));
+ space.install_write_handler(0x1ff0, 0x1ff0, write8_delegate(FUNC(a2600_state::modeDC_switch_w),this));
+ space.install_read_handler(0x1ff0, 0x1ff0, read8_delegate(FUNC(a2600_state::modeDC_switch_r),this));
break;
case modeFE:
- space->install_write_handler(0x01fe, 0x01fe, write8_delegate(FUNC(a2600_state::modeFE_switch_w),this));
- space->install_read_handler(0x01fe, 0x01fe, read8_delegate(FUNC(a2600_state::modeFE_switch_r),this));
+ space.install_write_handler(0x01fe, 0x01fe, write8_delegate(FUNC(a2600_state::modeFE_switch_w),this));
+ space.install_read_handler(0x01fe, 0x01fe, read8_delegate(FUNC(a2600_state::modeFE_switch_r),this));
break;
case mode3E:
- space->install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(a2600_state::mode3E_RAM_switch_w),this));
- space->install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(a2600_state::mode3E_switch_w),this));
- space->install_write_handler(0x1400, 0x15ff, write8_delegate(FUNC(a2600_state::mode3E_RAM_w),this));
+ space.install_write_handler(0x3e, 0x3e, write8_delegate(FUNC(a2600_state::mode3E_RAM_switch_w),this));
+ space.install_write_handler(0x3f, 0x3f, write8_delegate(FUNC(a2600_state::mode3E_switch_w),this));
+ space.install_write_handler(0x1400, 0x15ff, write8_delegate(FUNC(a2600_state::mode3E_RAM_w),this));
break;
case modeSS:
- space->install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(a2600_state::modeSS_r),this));
+ space.install_read_handler(0x1000, 0x1fff, read8_delegate(FUNC(a2600_state::modeSS_r),this));
m_bank_base[1] = m_extra_RAM->base() + 2 * 0x800;
m_bank_base[2] = CART_MEMBER;
membank("bank1")->set_base(m_bank_base[1] );
membank("bank2")->set_base(m_bank_base[2] );
m_modeSS_write_enabled = 0;
m_modeSS_byte_started = 0;
- space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeSS_opbase), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeSS_opbase), this));
/* The Supercharger has no motor control so just enable it */
machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MOTOR_DISABLED );
break;
case modeFV:
- space->install_write_handler(0x1fd0, 0x1fd0, write8_delegate(FUNC(a2600_state::modeFV_switch_w),this));
- space->install_read_handler(0x1fd0, 0x1fd0, read8_delegate(FUNC(a2600_state::modeFV_switch_r),this));
+ space.install_write_handler(0x1fd0, 0x1fd0, write8_delegate(FUNC(a2600_state::modeFV_switch_w),this));
+ space.install_read_handler(0x1fd0, 0x1fd0, read8_delegate(FUNC(a2600_state::modeFV_switch_r),this));
break;
case modeDPC:
- space->install_read_handler(0x1000, 0x103f, read8_delegate(FUNC(a2600_state::modeDPC_r),this));
- space->install_write_handler(0x1040, 0x107f, write8_delegate(FUNC(a2600_state::modeDPC_w),this));
- space->install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
- space->install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
- space->set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeDPC_opbase_handler), this));
+ space.install_read_handler(0x1000, 0x103f, read8_delegate(FUNC(a2600_state::modeDPC_r),this));
+ space.install_write_handler(0x1040, 0x107f, write8_delegate(FUNC(a2600_state::modeDPC_w),this));
+ space.install_write_handler(0x1ff8, 0x1ff9, write8_delegate(FUNC(a2600_state::modeF8_switch_w),this));
+ space.install_read_handler(0x1ff8, 0x1ff9, read8_delegate(FUNC(a2600_state::modeF8_switch_r),this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(a2600_state::modeDPC_opbase_handler), this));
{
int data_fetcher;
for( data_fetcher = 0; data_fetcher < 8; data_fetcher++ )
@@ -2020,8 +2020,8 @@ void a2600_state::machine_reset()
break;
case modeJVP:
- space->install_read_handler(0x0FA0, 0x0FC0, read8_delegate(FUNC(a2600_state::modeJVP_switch_r),this));
- space->install_write_handler(0x0FA0, 0x0FC0, write8_delegate(FUNC(a2600_state::modeJVP_switch_w),this));
+ space.install_read_handler(0x0FA0, 0x0FC0, read8_delegate(FUNC(a2600_state::modeJVP_switch_r),this));
+ space.install_write_handler(0x0FA0, 0x0FC0, write8_delegate(FUNC(a2600_state::modeJVP_switch_w),this));
break;
}
@@ -2029,24 +2029,24 @@ void a2600_state::machine_reset()
if (m_banking_mode == modeFA)
{
- space->install_write_bank(0x1000, 0x10ff, "bank9");
- space->install_read_bank(0x1100, 0x11ff, "bank9");
+ space.install_write_bank(0x1000, 0x10ff, "bank9");
+ space.install_read_bank(0x1100, 0x11ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base());
}
if (m_banking_mode == modeCV)
{
- space->install_write_bank(0x1400, 0x17ff, "bank9");
- space->install_read_bank(0x1000, 0x13ff, "bank9");
+ space.install_write_bank(0x1400, 0x17ff, "bank9");
+ space.install_read_bank(0x1000, 0x13ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base());
}
if (chip)
{
- space->install_write_bank(0x1000, 0x107f, "bank9");
- space->install_read_bank(0x1080, 0x10ff, "bank9");
+ space.install_write_bank(0x1000, 0x107f, "bank9");
+ space.install_read_bank(0x1080, 0x10ff, "bank9");
membank("bank9")->set_base(m_extra_RAM->base());
}
diff --git a/src/mess/drivers/a5105.c b/src/mess/drivers/a5105.c
index 2455bd937fe..a3436071fd4 100644
--- a/src/mess/drivers/a5105.c
+++ b/src/mess/drivers/a5105.c
@@ -454,8 +454,8 @@ INPUT_PORTS_END
void a5105_state::machine_reset()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- a5105_ab_w(*space, 0, 9); // turn motor off
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ a5105_ab_w(space, 0, 9); // turn motor off
beep_set_frequency(m_beep, 500);
m_ram_base = (UINT8*)machine().device<ram_device>(RAM_TAG)->pointer();
diff --git a/src/mess/drivers/amiga.c b/src/mess/drivers/amiga.c
index eca358cdbce..3f689dd2867 100644
--- a/src/mess/drivers/amiga.c
+++ b/src/mess/drivers/amiga.c
@@ -58,15 +58,15 @@ static DECLARE_WRITE8_DEVICE_HANDLER( amiga_cia_0_portA_w );
static READ16_HANDLER( amiga_clock_r )
{
- msm6242_device *rtc = space->machine().device<msm6242_device>("rtc");
- return rtc->read(*space,offset / 2);
+ msm6242_device *rtc = space.machine().device<msm6242_device>("rtc");
+ return rtc->read(space,offset / 2);
}
static WRITE16_HANDLER( amiga_clock_w )
{
- msm6242_device *rtc = space->machine().device<msm6242_device>("rtc");
- rtc->write(*space,offset / 2, data);
+ msm6242_device *rtc = space.machine().device<msm6242_device>("rtc");
+ rtc->write(space,offset / 2, data);
}
diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c
index ba8fdfad0d0..acae1e12d0a 100644
--- a/src/mess/drivers/apexc.c
+++ b/src/mess/drivers/apexc.c
@@ -397,7 +397,7 @@ INPUT_PORTS_END
static INTERRUPT_GEN( apexc_interrupt )
{
apexc_state *state = device->machine().driver_data<apexc_state>();
- address_space* space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT32 edit_keys;
int control_keys;
@@ -478,11 +478,11 @@ static INTERRUPT_GEN( apexc_interrupt )
if (control_keys & panel_write) {
/* write memory */
- space->write_dword(device->state().state_int(APEXC_ML_FULL)<<2, state->m_panel_data_reg);
+ space.write_dword(device->state().state_int(APEXC_ML_FULL)<<2, state->m_panel_data_reg);
}
else {
/* read memory */
- state->m_panel_data_reg = space->read_dword(device->state().state_int(APEXC_ML_FULL)<<2);
+ state->m_panel_data_reg = space.read_dword(device->state().state_int(APEXC_ML_FULL)<<2);
}
}
diff --git a/src/mess/drivers/apollo.c b/src/mess/drivers/apollo.c
index 8c34df4d8c6..fcd8887207a 100644
--- a/src/mess/drivers/apollo.c
+++ b/src/mess/drivers/apollo.c
@@ -483,7 +483,7 @@ WRITE32_MEMBER(apollo_state::ram_with_parity_w){
// no more than 192 read/write handlers may be used
// see table_assign_handler in memory.c
if (parity_error_handler_install_counter < 40) {
- //memory_install_read32_handler(&space, ram_base_address+offset*4, ram_base_address+offset*4+3, 0xffffffff, 0, ram_with_parity_r);
+ //memory_install_read32_handler(space, ram_base_address+offset*4, ram_base_address+offset*4+3, 0xffffffff, 0, ram_with_parity_r);
space.install_read_handler(ram_base_address+offset*4, ram_base_address+offset*4+3, 0xffffffff,0,read32_delegate(FUNC(apollo_state::ram_with_parity_r),this));
parity_error_handler_is_installed = 1;
parity_error_handler_install_counter++;
@@ -495,7 +495,7 @@ WRITE32_MEMBER(apollo_state::ram_with_parity_w){
// uninstall not supported, reinstall previous read handler instead
- // memory_install_rom(&space, ram_base_address, ram_end_address, 0xffffffff, 0, messram_ptr.v);
+ // memory_install_rom(space, ram_base_address, ram_end_address, 0xffffffff, 0, messram_ptr.v);
space.install_rom(ram_base_address,ram_end_address,0xffffffff,0,&m_messram_ptr[0]);
parity_error_handler_is_installed = 0;
diff --git a/src/mess/drivers/aquarius.c b/src/mess/drivers/aquarius.c
index e11db47d247..a92000c1088 100644
--- a/src/mess/drivers/aquarius.c
+++ b/src/mess/drivers/aquarius.c
@@ -216,9 +216,9 @@ DRIVER_INIT_MEMBER(aquarius_state,aquarius)
/* install expansion memory if available */
if (machine().device<ram_device>(RAM_TAG)->size() > 0x1000)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_readwrite_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 0x1000 - 1, "bank1");
+ space.install_readwrite_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 0x1000 - 1, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
}
}
diff --git a/src/mess/drivers/astrocde.c b/src/mess/drivers/astrocde.c
index ebd5886f6c2..8ff035f8e75 100644
--- a/src/mess/drivers/astrocde.c
+++ b/src/mess/drivers/astrocde.c
@@ -14,7 +14,7 @@
#include "machine/ram.h"
MACHINE_RESET( astrocde );
-void get_ram_expansion_settings(address_space *space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end);
+void get_ram_expansion_settings(address_space &space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end);
/*************************************
*
@@ -90,7 +90,7 @@ ADDRESS_MAP_END
static INPUT_CHANGED( set_write_protect ) // run when RAM expansion write protect switch is changed
{
int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0;
- address_space *space = field.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *field.machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *expram = field.machine().device<ram_device>("ram_tag")->pointer();
get_ram_expansion_settings(space, ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference
@@ -99,13 +99,13 @@ static INPUT_CHANGED( set_write_protect ) // run when RAM expansion write prote
{
if (write_protect_on == 0) // write protect off, so install memory normally
{
- space->install_ram(expansion_ram_start, expansion_ram_end, expram);
+ space.install_ram(expansion_ram_start, expansion_ram_end, expram);
if (shadow_ram_end > expansion_ram_end)
- space->install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
+ space.install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
}
else // write protect on, so make memory read only
{
- space->nop_write(expansion_ram_start, expansion_ram_end);
+ space.nop_write(expansion_ram_start, expansion_ram_end);
}
}
}
@@ -310,9 +310,9 @@ DRIVER_INIT_MEMBER(astrocde_state,astrocde)
MACHINE_RESET( astrocde )
{
int ram_expansion_installed = 0, write_protect_on = 0, expansion_ram_start = 0, expansion_ram_end = 0, shadow_ram_end = 0;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *expram = machine.device<ram_device>("ram_tag")->pointer();
- space->unmap_readwrite(0x5000, 0xffff); // unmap any previously installed expansion RAM
+ space.unmap_readwrite(0x5000, 0xffff); // unmap any previously installed expansion RAM
get_ram_expansion_settings(space, ram_expansion_installed, write_protect_on, expansion_ram_start, expansion_ram_end, shadow_ram_end); // passing by reference
@@ -320,27 +320,27 @@ MACHINE_RESET( astrocde )
{
if (write_protect_on == 0) // write protect off, so install memory normally
{
- space->install_ram(expansion_ram_start, expansion_ram_end, expram);
+ space.install_ram(expansion_ram_start, expansion_ram_end, expram);
if (shadow_ram_end > expansion_ram_end)
- space->install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
+ space.install_ram(expansion_ram_end + 1, shadow_ram_end, expram);
}
else // write protect on, so make memory read only
{
- space->nop_write(expansion_ram_start, expansion_ram_end);
+ space.nop_write(expansion_ram_start, expansion_ram_end);
}
}
}
-void get_ram_expansion_settings(address_space *space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end)
+void get_ram_expansion_settings(address_space &space, int &ram_expansion_installed, int &write_protect_on, int &expansion_ram_start, int &expansion_ram_end, int &shadow_ram_end)
{
- if (space->machine().root_device().ioport("PROTECT")->read() == 0x01)
+ if (space.machine().root_device().ioport("PROTECT")->read() == 0x01)
write_protect_on = 1;
else
write_protect_on = 0;
ram_expansion_installed = 1;
- switch(space->machine().root_device().ioport("CFG")->read()) // check RAM expansion configuration and set address ranges
+ switch(space.machine().root_device().ioport("CFG")->read()) // check RAM expansion configuration and set address ranges
{
case 0x00: // No RAM Expansion
ram_expansion_installed = 0;
diff --git a/src/mess/drivers/atm.c b/src/mess/drivers/atm.c
index ac02807ad09..86144ec6a1f 100644
--- a/src/mess/drivers/atm.c
+++ b/src/mess/drivers/atm.c
@@ -120,17 +120,17 @@ ADDRESS_MAP_END
MACHINE_RESET_MEMBER(atm_state,atm)
{
UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
device_t *beta = machine().device(BETA_DISK_TAG);
- space->install_read_bank(0x0000, 0x3fff, "bank1");
- space->unmap_write(0x0000, 0x3fff);
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
+ space.unmap_write(0x0000, 0x3fff);
if (beta->started()) {
betadisk_enable(beta);
betadisk_clear_status(beta);
}
- space->set_direct_update_handler(direct_update_delegate(FUNC(atm_state::atm_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(atm_state::atm_direct), this));
memset(messram,0,128*1024);
diff --git a/src/mess/drivers/avigo.c b/src/mess/drivers/avigo.c
index 3af8c4203fd..5919a279c5f 100644
--- a/src/mess/drivers/avigo.c
+++ b/src/mess/drivers/avigo.c
@@ -158,7 +158,7 @@ static RP5C01_INTERFACE( rtc_intf )
void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
{
- address_space* space = m_maincpu->space(AS_PROGRAM);
+ address_space& space = *m_maincpu->space(AS_PROGRAM);
int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000);
char bank_tag[6];
@@ -167,14 +167,14 @@ void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
switch (chip_select)
{
case 0x06: // videoram
- space->install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, read8_delegate(FUNC(avigo_state::vid_memory_r), this), write8_delegate(FUNC(avigo_state::vid_memory_w), this));
+ space.install_readwrite_handler(bank * 0x4000, bank * 0x4000 + 0x3fff, read8_delegate(FUNC(avigo_state::vid_memory_r), this), write8_delegate(FUNC(avigo_state::vid_memory_w), this));
active_flash = -1;
break;
case 0x01: // banked RAM
sprintf(bank_tag,"bank%d", bank);
membank(bank_tag)->set_base(m_ram_base + (((bank == 1 ? m_bank1_l : m_bank2_l) & 0x07)<<14));
- space->install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag);
+ space.install_readwrite_bank (bank * 0x4000, bank * 0x4000 + 0x3fff, bank_tag);
active_flash = -1;
break;
@@ -185,9 +185,9 @@ void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
if (active_flash < 0) // to avoid useless calls to install_readwrite_handler that cause slowdowns
{
if (bank == 1)
- space->install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(avigo_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x4000_write_handler), this));
+ space.install_readwrite_handler(0x4000, 0x7fff, read8_delegate(FUNC(avigo_state::flash_0x4000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x4000_write_handler), this));
else
- space->install_readwrite_handler(0x8000, 0xbfff, read8_delegate(FUNC(avigo_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x8000_write_handler), this));
+ space.install_readwrite_handler(0x8000, 0xbfff, read8_delegate(FUNC(avigo_state::flash_0x8000_read_handler), this), write8_delegate(FUNC(avigo_state::flash_0x8000_write_handler), this));
}
switch (chip_select)
@@ -201,7 +201,7 @@ void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
default:
logerror("Unknown chip %02x mapped at %04x - %04x\n", chip_select, bank * 0x4000, bank * 0x4000 + 0x3fff);
- space->unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
+ space.unmap_readwrite(bank * 0x4000, bank * 0x4000 + 0x3fff);
active_flash = -1;
break;
}
diff --git a/src/mess/drivers/b16.c b/src/mess/drivers/b16.c
index 46393e82179..057d2e0b50e 100644
--- a/src/mess/drivers/b16.c
+++ b/src/mess/drivers/b16.c
@@ -262,8 +262,8 @@ static const mc6845_interface mc6845_intf =
NULL /* update address callback */
};
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( b16_dma8237_interface )
{
diff --git a/src/mess/drivers/basic52.c b/src/mess/drivers/basic52.c
index b1c41d91425..69afbce87fe 100644
--- a/src/mess/drivers/basic52.c
+++ b/src/mess/drivers/basic52.c
@@ -80,8 +80,8 @@ INPUT_PORTS_END
static void to_term(device_t *device, int data )
{
basic52_state *state = device->machine().driver_data<basic52_state>();
- address_space *space = device->memory().space(AS_PROGRAM);
- state->m_terminal->write(*space, 0, data);
+ address_space &space = *device->memory().space(AS_PROGRAM);
+ state->m_terminal->write(space, 0, data);
}
static int from_term(device_t *device)
diff --git a/src/mess/drivers/bebox.c b/src/mess/drivers/bebox.c
index c49b49b843e..b8e80d6e417 100644
--- a/src/mess/drivers/bebox.c
+++ b/src/mess/drivers/bebox.c
@@ -37,8 +37,8 @@
#include "formats/pc_dsk.h"
#include "machine/ram.h"
-static READ8_HANDLER(at_dma8237_1_r) { return i8237_r(space->machine().device("dma8237_2"), *space, offset / 2); }
-static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space->machine().device("dma8237_2"), *space, offset / 2, data); }
+static READ8_HANDLER(at_dma8237_1_r) { return i8237_r(space.machine().device("dma8237_2"), space, offset / 2); }
+static WRITE8_HANDLER(at_dma8237_1_w) { i8237_w(space.machine().device("dma8237_2"), space, offset / 2, data); }
static ADDRESS_MAP_START( bebox_mem, AS_PROGRAM, 64, bebox_state )
AM_RANGE(0x7FFFF0F0, 0x7FFFF0F7) AM_READWRITE_LEGACY(bebox_cpu0_imask_r, bebox_cpu0_imask_w )
@@ -76,15 +76,15 @@ ADDRESS_MAP_END
static READ64_HANDLER(bb_slave_64be_r)
{
- pci_bus_device *device = space->machine().device<pci_bus_device>("pcibus");
+ pci_bus_device *device = space.machine().device<pci_bus_device>("pcibus");
// 2e94 is the real address, 2e84 is where the PC appears to be under full DRC
- if ((space->device().safe_pc() == 0xfff02e94) || (space->device().safe_pc() == 0xfff02e84))
+ if ((space.device().safe_pc() == 0xfff02e94) || (space.device().safe_pc() == 0xfff02e84))
{
return 0x108000ff; // indicate slave CPU
}
- return device->read_64be(*space, offset, mem_mask);
+ return device->read_64be(space, offset, mem_mask);
}
static ADDRESS_MAP_START( bebox_slave_mem, AS_PROGRAM, 64, bebox_state )
diff --git a/src/mess/drivers/bigbord2.c b/src/mess/drivers/bigbord2.c
index 93254c450a0..378d1c0f55b 100644
--- a/src/mess/drivers/bigbord2.c
+++ b/src/mess/drivers/bigbord2.c
@@ -207,8 +207,8 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
/* Z80 DMA */
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
@@ -415,11 +415,11 @@ static TIMER_DEVICE_CALLBACK( ctc_tick )
WRITE_LINE_MEMBER( bigbord2_state::frame )
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
static UINT8 framecnt;
framecnt++;
- if ((space->read_byte(0xf13d) == 0x4d) & (framecnt > 3))
+ if ((space.read_byte(0xf13d) == 0x4d) & (framecnt > 3))
{
framecnt = 0;
// simulate interrupt by saving current pc on
@@ -427,9 +427,9 @@ WRITE_LINE_MEMBER( bigbord2_state::frame )
UINT16 spreg = m_maincpu->state_int(Z80_SP);
UINT16 pcreg = m_maincpu->state_int(Z80_PC);
spreg--;
- space->write_byte(spreg, pcreg >> 8);
+ space.write_byte(spreg, pcreg >> 8);
spreg--;
- space->write_byte(spreg, pcreg);
+ space.write_byte(spreg, pcreg);
m_maincpu->set_state_int(Z80_SP, spreg);
m_maincpu->set_state_int(Z80_PC, 0xF18E);
}
diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c
index 8ebc48d6c6b..951ab4ce1d2 100644
--- a/src/mess/drivers/bullet.c
+++ b/src/mess/drivers/bullet.c
@@ -798,8 +798,8 @@ WRITE8_MEMBER( bullet_state::dma_mreq_w )
}
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/drivers/c128.c b/src/mess/drivers/c128.c
index cdfae00fffb..fed387cc73b 100644
--- a/src/mess/drivers/c128.c
+++ b/src/mess/drivers/c128.c
@@ -969,7 +969,7 @@ static const mc6845_interface vdc_intf =
READ8_MEMBER( c128_state::sid_potx_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
@@ -984,7 +984,7 @@ READ8_MEMBER( c128_state::sid_potx_r )
READ8_MEMBER( c128_state::sid_poty_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
diff --git a/src/mess/drivers/c64.c b/src/mess/drivers/c64.c
index 476dba7c07c..883fe2a3121 100644
--- a/src/mess/drivers/c64.c
+++ b/src/mess/drivers/c64.c
@@ -428,7 +428,7 @@ static MOS6567_INTERFACE( vic_intf )
READ8_MEMBER( c64_state::sid_potx_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
@@ -443,7 +443,7 @@ READ8_MEMBER( c64_state::sid_potx_r )
READ8_MEMBER( c64_state::sid_poty_r )
{
UINT8 cia1_pa = mos6526_pa_r(m_cia1, space, 0);
-
+
int sela = BIT(cia1_pa, 6);
int selb = BIT(cia1_pa, 7);
diff --git a/src/mess/drivers/cd2650.c b/src/mess/drivers/cd2650.c
index 9726e0c9db3..74932bc9922 100644
--- a/src/mess/drivers/cd2650.c
+++ b/src/mess/drivers/cd2650.c
@@ -166,7 +166,7 @@ static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
QUICKLOAD_LOAD( cd2650 )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x440;
int exec_addr;
@@ -226,7 +226,7 @@ QUICKLOAD_LOAD( cd2650 )
read_ = quick_length;
for (i = quick_addr; i < read_; i++)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
read_ = 0x1780;
if (quick_length < 0x1780)
@@ -234,11 +234,11 @@ QUICKLOAD_LOAD( cd2650 )
if (quick_length > 0x157f)
for (i = 0x1580; i < read_; i++)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
if (quick_length > 0x17ff)
for (i = 0x1800; i < quick_length; i++)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr);
diff --git a/src/mess/drivers/d6800.c b/src/mess/drivers/d6800.c
index 80de332730c..46b5434bf3a 100644
--- a/src/mess/drivers/d6800.c
+++ b/src/mess/drivers/d6800.c
@@ -319,7 +319,7 @@ static const cassette_interface d6800_cassette_interface =
static QUICKLOAD_LOAD( d6800 )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x0200;
int exec_addr = 0xc000;
@@ -346,7 +346,7 @@ static QUICKLOAD_LOAD( d6800 )
for (i = 0; i < quick_length; i++)
if ((quick_addr + i) < 0x800)
- space->write_byte(i + quick_addr, quick_data[i]);
+ space.write_byte(i + quick_addr, quick_data[i]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length,quick_addr,quick_addr+quick_length,exec_addr);
diff --git a/src/mess/drivers/dc.c b/src/mess/drivers/dc.c
index df4f12b30f0..f8e4b6a34ad 100644
--- a/src/mess/drivers/dc.c
+++ b/src/mess/drivers/dc.c
@@ -42,20 +42,20 @@ extern WRITE64_HANDLER( dc_mess_g1_ctrl_w );
static READ64_HANDLER( dcus_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0ba52a)
- space->device().execute().spin_until_time(attotime::from_usec(2500));
- // device_spinuntil_int(&space->device());
+ if (space.device().safe_pc()==0xc0ba52a)
+ space.device().execute().spin_until_time(attotime::from_usec(2500));
+ // device_spinuntil_int(&space.device());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2303b0/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2303b0/8];
}
static READ64_HANDLER( dcjp_idle_skip_r )
{
- if (space->device().safe_pc()==0xc0bac62)
- space->device().execute().spin_until_time(attotime::from_usec(2500));
- // device_spinuntil_int(&space->device());
+ if (space.device().safe_pc()==0xc0bac62)
+ space.device().execute().spin_until_time(attotime::from_usec(2500));
+ // device_spinuntil_int(&space.device());
- return space->machine().driver_data<dc_state>()->dc_ram[0x2302f8/8];
+ return space.machine().driver_data<dc_state>()->dc_ram[0x2302f8/8];
}
DRIVER_INIT_MEMBER(dc_state,dc)
@@ -110,14 +110,14 @@ static WRITE64_HANDLER( dc_pdtra_w )
static READ64_HANDLER( dc_arm_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
return *((UINT64 *)state->dc_sound_ram.target()+offset);
}
static WRITE64_HANDLER( dc_arm_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
COMBINE_DATA((UINT64 *)state->dc_sound_ram.target() + offset);
}
@@ -126,7 +126,7 @@ static WRITE64_HANDLER( dc_arm_w )
// SB_LMMODE0
static WRITE64_HANDLER( ta_texture_directpath0_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int mode = state->pvrctrl_regs[SB_LMMODE0]&1;
if (mode&1)
@@ -143,7 +143,7 @@ static WRITE64_HANDLER( dc_arm_w )
// SB_LMMODE1
static WRITE64_HANDLER( ta_texture_directpath1_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int mode = state->pvrctrl_regs[SB_LMMODE1]&1;
if (mode&1)
diff --git a/src/mess/drivers/dmv.c b/src/mess/drivers/dmv.c
index ebce5851c1c..8909acec968 100644
--- a/src/mess/drivers/dmv.c
+++ b/src/mess/drivers/dmv.c
@@ -277,8 +277,8 @@ WRITE_LINE_MEMBER( dmv_state::dma_hrq_changed )
i8237_hlda_w(m_dmac, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( dmv_dma8237_config )
{
diff --git a/src/mess/drivers/enterp.c b/src/mess/drivers/enterp.c
index 0ea84d1f692..1ff333dced3 100644
--- a/src/mess/drivers/enterp.c
+++ b/src/mess/drivers/enterp.c
@@ -31,9 +31,9 @@
MEMORY / I/O
***************************************************************************/
-static void enterprise_update_memory_page(address_space *space, offs_t page, int index)
+static void enterprise_update_memory_page(address_space &space, offs_t page, int index)
{
- ep_state *state = space->machine().driver_data<ep_state>();
+ ep_state *state = space.machine().driver_data<ep_state>();
int start = (page - 1) * 0x4000;
int end = (page - 1) * 0x4000 + 0x3fff;
char page_num[10];
@@ -45,24 +45,24 @@ static void enterprise_update_memory_page(address_space *space, offs_t page, int
case 0x01:
case 0x02:
case 0x03:
- space->install_read_bank(start, end, page_num);
- space->nop_write(start, end);
- state->membank(page_num)->set_base(space->machine().root_device().memregion("exos")->base() + (index * 0x4000));
+ space.install_read_bank(start, end, page_num);
+ space.nop_write(start, end);
+ state->membank(page_num)->set_base(space.machine().root_device().memregion("exos")->base() + (index * 0x4000));
break;
case 0x04:
case 0x05:
case 0x06:
case 0x07:
- space->install_read_bank(start, end, page_num);
- space->nop_write(start, end);
- state->membank(page_num)->set_base(space->machine().root_device().memregion("cartridges")->base() + ((index - 0x04) * 0x4000));
+ space.install_read_bank(start, end, page_num);
+ space.nop_write(start, end);
+ state->membank(page_num)->set_base(space.machine().root_device().memregion("cartridges")->base() + ((index - 0x04) * 0x4000));
break;
case 0x20:
case 0x21:
- space->install_read_bank(start, end, page_num);
- space->nop_write(start, end);
+ space.install_read_bank(start, end, page_num);
+ space.nop_write(start, end);
state->membank(page_num)->set_base(state->memregion("exdos")->base() + ((index - 0x20) * 0x4000));
break;
@@ -71,14 +71,14 @@ static void enterprise_update_memory_page(address_space *space, offs_t page, int
case 0xfa:
case 0xfb:
/* additional 64k ram */
- if (space->machine().device<ram_device>(RAM_TAG)->size() == 128*1024)
+ if (space.machine().device<ram_device>(RAM_TAG)->size() == 128*1024)
{
- space->install_readwrite_bank(start, end, page_num);
- state->membank(page_num)->set_base(space->machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xf4) * 0x4000);
+ space.install_readwrite_bank(start, end, page_num);
+ state->membank(page_num)->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xf4) * 0x4000);
}
else
{
- space->unmap_readwrite(start, end);
+ space.unmap_readwrite(start, end);
}
break;
@@ -87,12 +87,12 @@ static void enterprise_update_memory_page(address_space *space, offs_t page, int
case 0xfe:
case 0xff:
/* basic 64k ram */
- space->install_readwrite_bank(start, end, page_num);
- state->membank(page_num)->set_base(space->machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xfc) * 0x4000);
+ space.install_readwrite_bank(start, end, page_num);
+ state->membank(page_num)->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer() + (index - 0xfc) * 0x4000);
break;
default:
- space->unmap_readwrite(start, end);
+ space.unmap_readwrite(start, end);
}
}
@@ -108,7 +108,7 @@ static WRITE8_DEVICE_HANDLER( enterprise_dave_reg_write )
case 0x11:
case 0x12:
case 0x13:
- enterprise_update_memory_page(device->machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
+ enterprise_update_memory_page(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
break;
case 0x15:
diff --git a/src/mess/drivers/esq5505.c b/src/mess/drivers/esq5505.c
index 85d1be5843d..ab829cd17ff 100644
--- a/src/mess/drivers/esq5505.c
+++ b/src/mess/drivers/esq5505.c
@@ -136,7 +136,7 @@ void esq5505_state::machine_reset()
READ16_MEMBER(esq5505_state::es5510_dsp_r)
{
-// logerror("%06x: DSP read offset %04x (data is %04x)\n",space->device().safe_pc(),offset,es5510_dsp_ram[offset]);
+// logerror("%06x: DSP read offset %04x (data is %04x)\n",space.device().safe_pc(),offset,es5510_dsp_ram[offset]);
switch(offset)
{
diff --git a/src/mess/drivers/fk1.c b/src/mess/drivers/fk1.c
index 4596a9762f3..0a3bea99b50 100644
--- a/src/mess/drivers/fk1.c
+++ b/src/mess/drivers/fk1.c
@@ -423,10 +423,10 @@ static TIMER_DEVICE_CALLBACK( vsync_callback )
void fk1_state::machine_reset()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); // ROM
membank("bank2")->set_base(ram + 0x10000); // VRAM
membank("bank3")->set_base(ram + 0x8000);
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index 97417e01124..792d5d6252c 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -53,7 +53,7 @@
#include "includes/fm7.h"
-static void fm7_mmr_refresh(address_space*);
+static void fm7_mmr_refresh(address_space&);
@@ -352,7 +352,7 @@ READ8_MEMBER(fm7_state::fm7_rom_en_r)
membank("bank1")->set_base(RAM+0x38000);
}
else
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("BASIC ROM enabled\n");
return 0x00;
}
@@ -368,7 +368,7 @@ WRITE8_MEMBER(fm7_state::fm7_rom_en_w)
membank("bank1")->set_base(RAM+0x8000);
}
else
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("BASIC ROM disabled\n");
}
@@ -383,12 +383,12 @@ WRITE8_MEMBER(fm7_state::fm7_init_en_w)
if(data & 0x02)
{
m_init_rom_en = 0;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
}
else
{
m_init_rom_en = 1;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
}
}
@@ -985,9 +985,9 @@ READ8_MEMBER(fm7_state::fm7_mmr_r)
return 0xff;
}
-static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
+static void fm7_update_bank(address_space & space, int bank, UINT8 physical)
{
- fm7_state *state = space->machine().driver_data<fm7_state>();
+ fm7_state *state = space.machine().driver_data<fm7_state>();
UINT8* RAM = state->memregion("maincpu")->base();
UINT16 size = 0xfff;
char bank_name[10];
@@ -1002,40 +1002,40 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
switch(physical)
{
case 0x10:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram0_r),state),write8_delegate(FUNC(fm7_state::fm7_vram0_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram0_r),state),write8_delegate(FUNC(fm7_state::fm7_vram0_w),state));
break;
case 0x11:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram1_r),state),write8_delegate(FUNC(fm7_state::fm7_vram1_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram1_r),state),write8_delegate(FUNC(fm7_state::fm7_vram1_w),state));
break;
case 0x12:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram2_r),state),write8_delegate(FUNC(fm7_state::fm7_vram2_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram2_r),state),write8_delegate(FUNC(fm7_state::fm7_vram2_w),state));
break;
case 0x13:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram3_r),state),write8_delegate(FUNC(fm7_state::fm7_vram3_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram3_r),state),write8_delegate(FUNC(fm7_state::fm7_vram3_w),state));
break;
case 0x14:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram4_r),state),write8_delegate(FUNC(fm7_state::fm7_vram4_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram4_r),state),write8_delegate(FUNC(fm7_state::fm7_vram4_w),state));
break;
case 0x15:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram5_r),state),write8_delegate(FUNC(fm7_state::fm7_vram5_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram5_r),state),write8_delegate(FUNC(fm7_state::fm7_vram5_w),state));
break;
case 0x16:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram6_r),state),write8_delegate(FUNC(fm7_state::fm7_vram6_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram6_r),state),write8_delegate(FUNC(fm7_state::fm7_vram6_w),state));
break;
case 0x17:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram7_r),state),write8_delegate(FUNC(fm7_state::fm7_vram7_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram7_r),state),write8_delegate(FUNC(fm7_state::fm7_vram7_w),state));
break;
case 0x18:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram8_r),state),write8_delegate(FUNC(fm7_state::fm7_vram8_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram8_r),state),write8_delegate(FUNC(fm7_state::fm7_vram8_w),state));
break;
case 0x19:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram9_r),state),write8_delegate(FUNC(fm7_state::fm7_vram9_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vram9_r),state),write8_delegate(FUNC(fm7_state::fm7_vram9_w),state));
break;
case 0x1a:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramA_r),state),write8_delegate(FUNC(fm7_state::fm7_vramA_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramA_r),state),write8_delegate(FUNC(fm7_state::fm7_vramA_w),state));
break;
case 0x1b:
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramB_r),state),write8_delegate(FUNC(fm7_state::fm7_vramB_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_vramB_r),state),write8_delegate(FUNC(fm7_state::fm7_vramB_w),state));
break;
}
// state->membank(bank+1)->set_base(RAM+(physical<<12)-0x10000);
@@ -1043,21 +1043,21 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
}
if(physical == 0x1c)
{
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_console_ram_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_console_ram_banked_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_console_ram_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_console_ram_banked_w),state));
return;
}
if(physical == 0x1d)
{
- space->install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_w),state));
+ space.install_readwrite_handler(bank*0x1000,(bank*0x1000)+size,read8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_r),state),write8_delegate(FUNC(fm7_state::fm7_sub_ram_ports_banked_w),state));
return;
}
if(physical == 0x35)
{
if(state->m_init_rom_en && (state->m_type == SYS_FM11 || state->m_type == SYS_FM16))
{
- RAM = space->machine().root_device().memregion("init")->base();
- space->install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space->nop_write(bank*0x1000,(bank*0x1000)+size);
+ RAM = space.machine().root_device().memregion("init")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
state->membank(bank_name)->set_base(RAM+(physical<<12)-0x35000);
return;
}
@@ -1066,9 +1066,9 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
{
if(state->m_init_rom_en && (state->m_type != SYS_FM11 && state->m_type != SYS_FM16))
{
- RAM = space->machine().root_device().memregion("init")->base();
- space->install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space->nop_write(bank*0x1000,(bank*0x1000)+size);
+ RAM = space.machine().root_device().memregion("init")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
state->membank(bank_name)->set_base(RAM+(physical<<12)-0x36000);
return;
}
@@ -1077,20 +1077,20 @@ static void fm7_update_bank(address_space* space, int bank, UINT8 physical)
{
if(state->m_basic_rom_en && (state->m_type != SYS_FM11 && state->m_type != SYS_FM16))
{
- RAM = space->machine().root_device().memregion("fbasic")->base();
- space->install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
- space->nop_write(bank*0x1000,(bank*0x1000)+size);
+ RAM = space.machine().root_device().memregion("fbasic")->base();
+ space.install_read_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.nop_write(bank*0x1000,(bank*0x1000)+size);
state->membank(bank_name)->set_base(RAM+(physical<<12)-0x38000);
return;
}
}
- space->install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
+ space.install_readwrite_bank(bank*0x1000,(bank*0x1000)+size,bank_name);
state->membank(bank_name)->set_base(RAM+(physical<<12));
}
-static void fm7_mmr_refresh(address_space* space)
+static void fm7_mmr_refresh(address_space& space)
{
- fm7_state *state = space->machine().driver_data<fm7_state>();
+ fm7_state *state = space.machine().driver_data<fm7_state>();
int x;
UINT16 window_addr;
UINT8* RAM = state->memregion("maincpu")->base();
@@ -1115,7 +1115,7 @@ static void fm7_mmr_refresh(address_space* space)
window_addr = ((state->m_mmr.window_offset << 8) + 0x7c00) & 0xffff;
// if(window_addr < 0xfc00)
{
- space->install_readwrite_bank(0x7c00,0x7fff,"bank24");
+ space.install_readwrite_bank(0x7c00,0x7fff,"bank24");
state->membank("bank24")->set_base(RAM+window_addr);
}
}
@@ -1127,7 +1127,7 @@ WRITE8_MEMBER(fm7_state::fm7_mmr_w)
{
m_mmr.bank_addr[m_mmr.segment][offset] = data;
if(m_mmr.enabled)
- fm7_update_bank(&space,offset,data);
+ fm7_update_bank(space,offset,data);
logerror("MMR: Segment %i, bank %i, set to 0x%02x\n",m_mmr.segment,offset,data);
return;
}
@@ -1135,18 +1135,18 @@ WRITE8_MEMBER(fm7_state::fm7_mmr_w)
{
case 0x10:
m_mmr.segment = data & 0x07;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("MMR: Active segment set to %i\n",m_mmr.segment);
break;
case 0x12:
m_mmr.window_offset = data;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("MMR: Window offset set to %02x\n",data);
break;
case 0x13:
m_mmr.mode = data;
m_mmr.enabled = data & 0x80;
- fm7_mmr_refresh(&space);
+ fm7_mmr_refresh(space);
logerror("MMR: Mode register set to %02x\n",data);
break;
}
@@ -1963,7 +1963,7 @@ void fm7_state::machine_reset()
}
if(m_type == SYS_FM77AV || m_type == SYS_FM77AV40EX || m_type == SYS_FM11)
{
- fm7_mmr_refresh(machine().device("maincpu")->memory().space(AS_PROGRAM));
+ fm7_mmr_refresh(*machine().device("maincpu")->memory().space(AS_PROGRAM));
}
if(m_type == SYS_FM11)
{
diff --git a/src/mess/drivers/fmtowns.c b/src/mess/drivers/fmtowns.c
index 5a49987ea5b..50b8ac3a95e 100644
--- a/src/mess/drivers/fmtowns.c
+++ b/src/mess/drivers/fmtowns.c
@@ -270,7 +270,7 @@ WRITE8_MEMBER(towns_state::towns_system_w)
switch(offset)
{
case 0x00: // bit 7 = NMI vector protect, bit 6 = power off, bit 0 = software reset, bit 3 = A20 line?
-// space->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_A20,(data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
+// space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_A20,(data & 0x08) ? CLEAR_LINE : ASSERT_LINE);
logerror("SYS: port 0x20 write %02x\n",data);
break;
case 0x02:
diff --git a/src/mess/drivers/gba.c b/src/mess/drivers/gba.c
index e1eb3d56932..037a3d49e72 100644
--- a/src/mess/drivers/gba.c
+++ b/src/mess/drivers/gba.c
@@ -154,7 +154,7 @@ static void dma_exec(running_machine &machine, FPTR ch)
int ctrl;
int srcadd, dstadd;
UINT32 src, dst;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
gba_state *state = machine.driver_data<gba_state>();
src = state->m_dma_src[ch];
@@ -207,7 +207,7 @@ static void dma_exec(running_machine &machine, FPTR ch)
dst &= 0xfffffffc;
// 32-bit
- space->write_dword(dst, space->read_dword(src));
+ space.write_dword(dst, space.read_dword(src));
switch (dstadd)
{
case 0: // increment
@@ -242,7 +242,7 @@ static void dma_exec(running_machine &machine, FPTR ch)
dst &= 0xfffffffe;
// 16-bit
- space->write_word(dst, space->read_word(src));
+ space.write_word(dst, space.read_word(src));
switch (dstadd)
{
case 0: // increment
diff --git a/src/mess/drivers/gp32.c b/src/mess/drivers/gp32.c
index cf308f86a21..2928f382ecd 100644
--- a/src/mess/drivers/gp32.c
+++ b/src/mess/drivers/gp32.c
@@ -708,7 +708,7 @@ static void s3c240x_dma_trigger( running_machine &machine, int dma)
gp32_state *state = machine.driver_data<gp32_state>();
UINT32 *regs = &state->m_s3c240x_dma_regs[dma<<3];
UINT32 curr_tc, curr_src, curr_dst;
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM);
int dsz, inc_src, inc_dst, servmode;
static const UINT32 ch_int[] = { INT_DMA0, INT_DMA1, INT_DMA2, INT_DMA3 };
verboselog( machine, 5, "DMA %d trigger\n", dma);
@@ -725,9 +725,9 @@ static void s3c240x_dma_trigger( running_machine &machine, int dma)
curr_tc--;
switch (dsz)
{
- case 0 : space->write_byte( curr_dst, space->read_byte( curr_src)); break;
- case 1 : space->write_word( curr_dst, space->read_word( curr_src)); break;
- case 2 : space->write_dword( curr_dst, space->read_dword( curr_src)); break;
+ case 0 : space.write_byte( curr_dst, space.read_byte( curr_src)); break;
+ case 1 : space.write_word( curr_dst, space.read_word( curr_src)); break;
+ case 2 : space.write_dword( curr_dst, space.read_dword( curr_src)); break;
}
if (inc_src == 0) curr_src += (1 << dsz);
if (inc_dst == 0) curr_dst += (1 << dsz);
diff --git a/src/mess/drivers/homelab.c b/src/mess/drivers/homelab.c
index 08a336db52e..5e2824e2f02 100644
--- a/src/mess/drivers/homelab.c
+++ b/src/mess/drivers/homelab.c
@@ -646,7 +646,7 @@ static const mea8000_interface brailab4_speech_intf = { "speech", DEVCB_NULL };
static QUICKLOAD_LOAD(homelab)
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i=0;
UINT8 ch;
UINT16 quick_addr;
@@ -730,7 +730,7 @@ static QUICKLOAD_LOAD(homelab)
image.message("%s: Unexpected EOF while writing byte to %04X", pgmname, (unsigned) j);
return IMAGE_INIT_FAIL;
}
- space->write_byte(j, ch);
+ space.write_byte(j, ch);
}
return IMAGE_INIT_PASS;
diff --git a/src/mess/drivers/indiana.c b/src/mess/drivers/indiana.c
index 155eb4daf18..ce37cee85b1 100644
--- a/src/mess/drivers/indiana.c
+++ b/src/mess/drivers/indiana.c
@@ -84,7 +84,7 @@ READ8_HANDLER( indiana_vga_setting )
DRIVER_INIT_MEMBER(indiana_state,indiana)
{
pc_vga_init(machine(), indiana_vga_setting, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f7a0000, machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f600000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f7a0000, *machine().device("maincpu")->memory().space(AS_PROGRAM), 0x7f600000);
}
/* ROM definition */
diff --git a/src/mess/drivers/instruct.c b/src/mess/drivers/instruct.c
index d717eb1fd50..631695458c0 100644
--- a/src/mess/drivers/instruct.c
+++ b/src/mess/drivers/instruct.c
@@ -218,7 +218,7 @@ void instruct_state::machine_reset()
QUICKLOAD_LOAD( instruct )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x0100;
int exec_addr;
@@ -275,7 +275,7 @@ QUICKLOAD_LOAD( instruct )
for (i = quick_addr; i < quick_length; i++)
{
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
}
/* display a message about the loaded quickload */
diff --git a/src/mess/drivers/ip22.c b/src/mess/drivers/ip22.c
index 317c5952c58..13cd538907b 100644
--- a/src/mess/drivers/ip22.c
+++ b/src/mess/drivers/ip22.c
@@ -270,9 +270,9 @@ READ32_MEMBER(ip22_state::hpc3_pbus6_r)
//verboselog(( machine, 2, "Serial 2 Command Transfer Read, 0x1fbd9838: %02x\n", 0x04 );
return 0x00000004;
case 0x40/4:
- return kbdc8042_8_r(&space, 0);
+ return kbdc8042_8_r(space, 0);
case 0x44/4:
- return kbdc8042_8_r(&space, 4);
+ return kbdc8042_8_r(space, 4);
case 0x58/4:
return 0x20; // chip rev 1, board rev 0, "Guinness" (Indy) => 0x01 for "Full House" (Indigo2)
case 0x80/4:
@@ -355,10 +355,10 @@ WRITE32_MEMBER(ip22_state::hpc3_pbus6_w)
}
break;
case 0x40/4:
- kbdc8042_8_w(&space, 0, data);
+ kbdc8042_8_w(space, 0, data);
break;
case 0x44/4:
- kbdc8042_8_w(&space, 4, data);
+ kbdc8042_8_w(space, 4, data);
break;
case 0x80/4:
case 0x84/4:
@@ -895,14 +895,14 @@ WRITE32_MEMBER(ip22_state::rtc_w)
WRITE32_MEMBER(ip22_state::ip22_write_ram)
{
// if banks 2 or 3 are enabled, do nothing, we don't support that much memory
- if (sgi_mc_r(&space, 0xc8/4, 0xffffffff) & 0x10001000)
+ if (sgi_mc_r(space, 0xc8/4, 0xffffffff) & 0x10001000)
{
// a random perturbation so the memory test fails
data ^= 0xffffffff;
}
// if banks 0 or 1 have 2 membanks, also kill it, we only want 128 MB
- if (sgi_mc_r(&space, 0xc0/4, 0xffffffff) & 0x40004000)
+ if (sgi_mc_r(space, 0xc0/4, 0xffffffff) & 0x40004000)
{
// a random perturbation so the memory test fails
data ^= 0xffffffff;
@@ -1239,14 +1239,14 @@ void ip22_state::machine_reset()
mips3drc_set_options(machine().device("maincpu"), MIPS3DRC_COMPATIBLE_OPTIONS | MIPS3DRC_CHECK_OVERFLOWS);
}
-static void dump_chain(address_space *space, UINT32 ch_base)
+static void dump_chain(address_space &space, UINT32 ch_base)
{
- printf("node: %08x %08x %08x (len = %x)\n", space->read_dword(ch_base), space->read_dword(ch_base+4), space->read_dword(ch_base+8), space->read_dword(ch_base+4) & 0x3fff);
+ printf("node: %08x %08x %08x (len = %x)\n", space.read_dword(ch_base), space.read_dword(ch_base+4), space.read_dword(ch_base+8), space.read_dword(ch_base+4) & 0x3fff);
- if ((space->read_dword(ch_base+8) != 0) && !(space->read_dword(ch_base+4) & 0x80000000))
+ if ((space.read_dword(ch_base+8) != 0) && !(space.read_dword(ch_base+4) & 0x80000000))
{
- dump_chain(space, space->read_dword(ch_base+8));
+ dump_chain(space, space.read_dword(ch_base+8));
}
}
@@ -1260,7 +1260,7 @@ static void dump_chain(address_space *space, UINT32 ch_base)
static void scsi_irq(running_machine &machine, int state)
{
ip22_state *drvstate = machine.driver_data<ip22_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state)
{
@@ -1281,7 +1281,7 @@ static void scsi_irq(running_machine &machine, int state)
words = drvstate->m_wd33c93->get_dma_count();
words /= 4;
- wptr = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
+ wptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
drvstate->m_HPC3.nSCSI0Descriptor += words*4;
dptr = 0;
@@ -1296,7 +1296,7 @@ static void scsi_irq(running_machine &machine, int state)
while (words)
{
- tmpword = space->read_dword(wptr);
+ tmpword = space.read_dword(wptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{
@@ -1332,7 +1332,7 @@ static void scsi_irq(running_machine &machine, int state)
while (twords)
{
- tmpword = space->read_dword(wptr);
+ tmpword = space.read_dword(wptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{
@@ -1364,8 +1364,8 @@ static void scsi_irq(running_machine &machine, int state)
drvstate->m_wd33c93->clear_dma();
#if 0
UINT32 dptr, tmpword;
- UINT32 bc = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor + 4);
- UINT32 rptr = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
+ UINT32 bc = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor + 4);
+ UINT32 rptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
int length = bc & 0x3fff;
int xie = (bc & 0x20000000) ? 1 : 0;
int eox = (bc & 0x80000000) ? 1 : 0;
@@ -1380,7 +1380,7 @@ static void scsi_irq(running_machine &machine, int state)
dptr = 0;
while (length > 0)
{
- tmpword = space->read_dword(rptr);
+ tmpword = space.read_dword(rptr);
if (drvstate->m_HPC3.nSCSI0DMACtrl & HPC3_DMACTRL_ENDIAN)
{
drvstate->m_dma_buffer[dptr+3] = (tmpword>>24)&0xff;
@@ -1401,7 +1401,7 @@ static void scsi_irq(running_machine &machine, int state)
length -= 4;
}
- length = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor+4) & 0x3fff;
+ length = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor+4) & 0x3fff;
drvstate->m_wd33c93->write_data(length, drvstate->m_dma_buffer);
// clear DMA on the controller too
@@ -1423,7 +1423,7 @@ static void scsi_irq(running_machine &machine, int state)
words = drvstate->m_wd33c93->get_dma_count();
words /= 4;
- wptr = space->read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
+ wptr = space.read_dword(drvstate->m_HPC3.nSCSI0Descriptor);
sptr = 0;
// mame_printf_info("DMA from device: %d words @ %x\n", words, wptr);
@@ -1446,7 +1446,7 @@ static void scsi_irq(running_machine &machine, int state)
tmpword = drvstate->m_dma_buffer[sptr]<<24 | drvstate->m_dma_buffer[sptr+1]<<16 | drvstate->m_dma_buffer[sptr+2]<<8 | drvstate->m_dma_buffer[sptr+3];
}
- space->write_dword(wptr, tmpword);
+ space.write_dword(wptr, tmpword);
wptr += 4;
sptr += 4;
words--;
@@ -1470,7 +1470,7 @@ static void scsi_irq(running_machine &machine, int state)
{
tmpword = drvstate->m_dma_buffer[sptr]<<24 | drvstate->m_dma_buffer[sptr+1]<<16 | drvstate->m_dma_buffer[sptr+2]<<8 | drvstate->m_dma_buffer[sptr+3];
}
- space->write_dword(wptr, tmpword);
+ space.write_dword(wptr, tmpword);
wptr += 4;
sptr += 4;
diff --git a/src/mess/drivers/itt3030.c b/src/mess/drivers/itt3030.c
index 5c017fed519..eb15a7a334c 100644
--- a/src/mess/drivers/itt3030.c
+++ b/src/mess/drivers/itt3030.c
@@ -57,13 +57,13 @@ READ8_MEMBER(itt3030_state::unk2_r)
UINT32 itt3030_state::screen_update( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(int y = 0; y < 24; y++ )
{
for(int x = 0; x < 80; x++ )
{
- UINT8 code = space->read_byte(0x3000 + x + y*128);
+ UINT8 code = space.read_byte(0x3000 + x + y*128);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, x*8,y*16);
}
}
diff --git a/src/mess/drivers/lynx.c b/src/mess/drivers/lynx.c
index 7936bc4ef7c..4ab33d7fd58 100644
--- a/src/mess/drivers/lynx.c
+++ b/src/mess/drivers/lynx.c
@@ -138,7 +138,7 @@ ROM_END
static QUICKLOAD_LOAD( lynx )
{
device_t *cpu = image.device().machine().device("maincpu");
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *data = NULL;
UINT8 *rom = image.device().machine().root_device().memregion("maincpu")->base();
UINT8 header[10]; // 80 08 dw Start dw Len B S 9 3
@@ -165,14 +165,14 @@ static QUICKLOAD_LOAD( lynx )
}
for (i = 0; i < length; i++)
- space->write_byte(start + i, data[i]);
+ space.write_byte(start + i, data[i]);
free(data);
rom[0x1fc] = start & 0xff;
rom[0x1fd] = start >> 8;
- space->write_byte(0x1fc, start & 0xff);
- space->write_byte(0x1fd, start >> 8);
+ space.write_byte(0x1fc, start & 0xff);
+ space.write_byte(0x1fd, start >> 8);
cpu->state().set_pc(start);
diff --git a/src/mess/drivers/mc10.c b/src/mess/drivers/mc10.c
index 105e016b829..a4a449f8968 100644
--- a/src/mess/drivers/mc10.c
+++ b/src/mess/drivers/mc10.c
@@ -236,7 +236,7 @@ static TIMER_DEVICE_CALLBACK( alice32_scanline )
DRIVER_INIT_MEMBER(mc10_state,mc10)
{
- address_space *prg = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &prg = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* initialize keyboard strobe */
m_keyboard_strobe = 0x00;
@@ -254,7 +254,7 @@ DRIVER_INIT_MEMBER(mc10_state,mc10)
else if (m_ram_size == 24*1024)
membank("bank2")->set_base(m_ram_base + 0x2000);
else if (m_ram_size != 32*1024) //ensure that is not alice90
- prg->nop_readwrite(0x5000, 0x8fff);
+ prg.nop_readwrite(0x5000, 0x8fff);
/* register for state saving */
state_save_register_global(machine(), m_keyboard_strobe);
diff --git a/src/mess/drivers/megadriv.c b/src/mess/drivers/megadriv.c
index 132185ecf51..c07214c3643 100644
--- a/src/mess/drivers/megadriv.c
+++ b/src/mess/drivers/megadriv.c
@@ -27,14 +27,14 @@ static TIMER_CALLBACK( mess_io_timeout_timer_callback )
/* J-Cart controller port */
WRITE16_HANDLER( jcart_ctrl_w )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
state->m_jcart_io_data[0] = (data & 1) << 6;
state->m_jcart_io_data[1] = (data & 1) << 6;
}
READ16_HANDLER( jcart_ctrl_r )
{
- md_cons_state *state = space->machine().driver_data<md_cons_state>();
+ md_cons_state *state = space.machine().driver_data<md_cons_state>();
UINT16 retdata = 0;
UINT8 joy[2];
@@ -709,7 +709,7 @@ static UINT16 pico_read_penpos(running_machine &machine, int pen)
static READ16_HANDLER( pico_68k_io_read )
{
- pico_state *state = space->machine().driver_data<pico_state>();
+ pico_state *state = space.machine().driver_data<pico_state>();
UINT8 retdata = 0;
switch (offset)
@@ -733,16 +733,16 @@ static READ16_HANDLER( pico_68k_io_read )
0x2f8 - 0x3f3 (storyware)
*/
case 2:
- retdata = pico_read_penpos(space->machine(), PICO_PENX) >> 8;
+ retdata = pico_read_penpos(space.machine(), PICO_PENX) >> 8;
break;
case 3:
- retdata = pico_read_penpos(space->machine(), PICO_PENX) & 0x00ff;
+ retdata = pico_read_penpos(space.machine(), PICO_PENX) & 0x00ff;
break;
case 4:
- retdata = pico_read_penpos(space->machine(), PICO_PENY) >> 8;
+ retdata = pico_read_penpos(space.machine(), PICO_PENY) >> 8;
break;
case 5:
- retdata = pico_read_penpos(space->machine(), PICO_PENY) & 0x00ff;
+ retdata = pico_read_penpos(space.machine(), PICO_PENY) & 0x00ff;
break;
case 6:
/* Page register :
diff --git a/src/mess/drivers/mikromik.c b/src/mess/drivers/mikromik.c
index 7c5caadcbad..bd2b548530b 100644
--- a/src/mess/drivers/mikromik.c
+++ b/src/mess/drivers/mikromik.c
@@ -537,8 +537,8 @@ WRITE_LINE_MEMBER( mm1_state::dack3_w )
}
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( dmac_intf )
{
diff --git a/src/mess/drivers/mmodular.c b/src/mess/drivers/mmodular.c
index c3cbda6d5db..1875be98310 100644
--- a/src/mess/drivers/mmodular.c
+++ b/src/mess/drivers/mmodular.c
@@ -644,7 +644,7 @@ WRITE8_MEMBER(polgar_state::academy_write_board)
latch_data = data;
// logerror("acad_write_latch %02x\n",data);
- if (data != 0xff) mboard_write_board_8(&space,0, data);
+ if (data != 0xff) mboard_write_board_8(space,0, data);
}
WRITE8_MEMBER(polgar_state::milano_write_board)
@@ -754,7 +754,7 @@ READ8_MEMBER(polgar_state::read_keys_board_monteciv)
UINT8 data = 0;
if (monteciv_select[0] == 0xff && monteciv_select[1] == 0xff) {
- data = mboard_read_board_8(&space,0);
+ data = mboard_read_board_8(space,0);
} else {
if (monteciv_select[0] == 0x0) {
data = ioport("BUTTONS_MONTE2")->read();
@@ -792,14 +792,14 @@ READ8_MEMBER(polgar_state::read_keys_board_academy)
data = ioport("BUTTONS_ACAD")->read();
} else {
// if (latch_data & 0x7f) {
- data = mboard_read_board_8(&space,0);
+ data = mboard_read_board_8(space,0);
// data = milano_read_board(space,0);
// logerror("ReadingBoard %02x\n",latch_data);
// line = get_first_cleared_bit(latch_data);
// tmp = machine.root_device().ioport(board_lines[line])->read();
-// mboard_write_board_8(&space,0, latch_data);
-// data = mboard_read_board_8(&space,0);
+// mboard_write_board_8(space,0, latch_data);
+// data = mboard_read_board_8(space,0);
// logerror("BoardRead Port Offset = %d data %02x Latch %02x\n", offset,data,latch_data);
// printf ("BoardRead Port Offset = %d data %02x Latch %02x\n", offset,data,latch_data);
// } else {
@@ -885,10 +885,10 @@ WRITE16_MEMBER(polgar_state::write_LCD_data)
}
-static void write_IOenable(unsigned char data,address_space *space) {
+static void write_IOenable(unsigned char data,address_space &space) {
- hd44780_device * hd44780 = space->machine().device<hd44780_device>("hd44780");
- device_t *speaker = space->machine().device("beep");
+ hd44780_device * hd44780 = space.machine().device<hd44780_device>("hd44780");
+ device_t *speaker = space.machine().device("beep");
if (BIT(data,5) && BIT(data,4)) {
if (BIT(data,1)) {
@@ -899,15 +899,15 @@ static void write_IOenable(unsigned char data,address_space *space) {
// MAME core does not appear to have this opcode timed right.
// This also allows 'fake' clocks to test ELO at impossibly high speeds on real hardware
// The original programmer says RAM is 2x as fast as the ROM on the 030 machines, maybe waitstates can be put in MAME core someday
-// cpu_spinuntil_time(space->cpu, ATTOTIME_IN_USEC(50));
+// cpu_spinuntil_time(space.cpu, ATTOTIME_IN_USEC(50));
if (BIT(data,0)) {
logerror("Write LCD_DATA [%02x] [%c]\n",lcd32_char,lcd32_char);
// printf("Write LCD_DATA [%02x] [%c]\n",lcd32_char,lcd32_char);
- hd44780->data_write(*space, 128, lcd32_char);
+ hd44780->data_write(space, 128, lcd32_char);
} else {
logerror("Write LCD_CTRL [%02x] [%c]\n",lcd32_char,lcd32_char);
// printf("Write LCD_CTRL [%02x] [%c]\n",lcd32_char,lcd32_char);
- hd44780->control_write(*space, 128, lcd32_char);
+ hd44780->control_write(space, 128, lcd32_char);
}
}
@@ -920,12 +920,12 @@ static void write_IOenable(unsigned char data,address_space *space) {
WRITE32_MEMBER(polgar_state::write_IOenables_32){
- write_IOenable(data>>24,&space);
+ write_IOenable(data>>24,space);
}
WRITE16_MEMBER(polgar_state::write_IOenables)
{
- write_IOenable(data>>8,&space);
+ write_IOenable(data>>8,space);
}
/* Unknown read/write */
diff --git a/src/mess/drivers/nanos.c b/src/mess/drivers/nanos.c
index e48e525e578..74c7c831ca4 100644
--- a/src/mess/drivers/nanos.c
+++ b/src/mess/drivers/nanos.c
@@ -439,17 +439,17 @@ void nanos_state::machine_start()
void nanos_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_write_bank(0x0000, 0x0fff, "bank3");
- space->install_write_bank(0x1000, 0xffff, "bank2");
+ space.install_write_bank(0x0000, 0x0fff, "bank3");
+ space.install_write_bank(0x1000, 0xffff, "bank2");
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x1000);
membank("bank3")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
- floppy_mon_w(floppy_get_device(space->machine(), 0), CLEAR_LINE);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1,1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), CLEAR_LINE);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1,1);
}
static Z80PIO_INTERFACE( nanos_z80pio_intf )
diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c
index 12774c3d066..b0a870e3e7b 100644
--- a/src/mess/drivers/nc.c
+++ b/src/mess/drivers/nc.c
@@ -321,7 +321,7 @@ static const char *const nc_bankhandler_w[]={
static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
{
nc_state *state = machine.driver_data<nc_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int mem_type;
int mem_bank;
char bank1[10];
@@ -332,7 +332,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
mem_type = (state->m_memory_config[bank]>>6) & 0x03;
mem_bank = state->m_memory_config[bank] & 0x03f;
- space->install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_r[bank]);
+ space.install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_r[bank]);
switch (mem_type)
{
@@ -348,7 +348,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
state->membank(bank1)->set_base(addr);
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
LOG(("BANK %d: ROM %d\n",bank,mem_bank));
}
break;
@@ -365,7 +365,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
state->membank(bank1)->set_base(addr);
state->membank(bank5)->set_base(addr);
- space->install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
+ space.install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
LOG(("BANK %d: RAM\n",bank));
}
break;
@@ -389,12 +389,12 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
/* yes */
state->membank(bank5)->set_base(addr);
- space->install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
+ space.install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, nc_bankhandler_w[bank]);
}
else
{
/* no */
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
}
LOG(("BANK %d: CARD-RAM\n",bank));
@@ -402,7 +402,7 @@ static void nc_refresh_memory_bank_config(running_machine &machine, int bank)
else
{
/* if no card connected, then writes fail */
- space->nop_readwrite((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.nop_readwrite((bank * 0x4000), (bank * 0x4000) + 0x3fff);
}
}
break;
diff --git a/src/mess/drivers/nes.c b/src/mess/drivers/nes.c
index 634e42f15fb..92cdd77d19c 100644
--- a/src/mess/drivers/nes.c
+++ b/src/mess/drivers/nes.c
@@ -38,7 +38,7 @@ static WRITE8_DEVICE_HANDLER( psg_4017_w )
WRITE8_MEMBER(nes_state::nes_vh_sprite_dma_w)
{
- m_ppu->spriteram_dma(&space, data);
+ m_ppu->spriteram_dma(space, data);
}
static ADDRESS_MAP_START( nes_map, AS_PROGRAM, 8, nes_state )
diff --git a/src/mess/drivers/next.c b/src/mess/drivers/next.c
index bab9ff5c841..540b4fec45e 100644
--- a/src/mess/drivers/next.c
+++ b/src/mess/drivers/next.c
@@ -304,7 +304,7 @@ void next_state::dma_drq_w(int slot, bool state)
dma_slot &ds = dma_slots[slot];
ds.drq = state;
if(state && (ds.state & DMA_ENABLE)) {
- address_space *space = maincpu->space(AS_PROGRAM);
+ address_space &space = *maincpu->space(AS_PROGRAM);
if(ds.state & DMA_READ) {
while(ds.drq) {
dma_check_update(slot);
@@ -317,7 +317,7 @@ void next_state::dma_drq_w(int slot, bool state)
logerror("DMA: bus error on read slot %d\n", slot);
return;
}
- space->write_byte(ds.current++, val);
+ space.write_byte(ds.current++, val);
dma_check_end(slot, eof);
if(!(ds.state & DMA_ENABLE))
return;
@@ -325,7 +325,7 @@ void next_state::dma_drq_w(int slot, bool state)
} else {
while(ds.drq) {
dma_check_update(slot);
- UINT8 val = space->read_byte(ds.current++);
+ UINT8 val = space.read_byte(ds.current++);
bool eof = ds.current == (ds.limit & 0x7fffffff) && (ds.limit & 0x80000000);
bool err;
dma_write(slot, val, eof, err);
diff --git a/src/mess/drivers/ng_aes.c b/src/mess/drivers/ng_aes.c
index 0a845af96bc..ee73bd7dc61 100644
--- a/src/mess/drivers/ng_aes.c
+++ b/src/mess/drivers/ng_aes.c
@@ -603,7 +603,7 @@ WRITE16_MEMBER(ng_aes_state::main_cpu_bank_select_w)
bank_address = 0x100000;
}
- neogeo_set_main_cpu_bank_address(&space, bank_address);
+ neogeo_set_main_cpu_bank_address(space, bank_address);
}
}
@@ -611,7 +611,7 @@ WRITE16_MEMBER(ng_aes_state::main_cpu_bank_select_w)
static void main_cpu_banking_init( running_machine &machine )
{
ng_aes_state *state = machine.driver_data<ng_aes_state>();
- address_space *mainspace = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &mainspace = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* create vector banks */
state->membank(NEOGEO_BANK_VECTORS)->configure_entry(0, machine.root_device().memregion("mainbios")->base());
@@ -642,21 +642,21 @@ static void set_audio_cpu_banking( running_machine &machine )
}
-static void audio_cpu_bank_select( address_space *space, int region, UINT8 bank )
+static void audio_cpu_bank_select( address_space &space, int region, UINT8 bank )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", space->device().safe_pc(), region, bank);
+ if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", space.device().safe_pc(), region, bank);
state->m_audio_cpu_banks[region] = bank;
- set_audio_cpu_banking(space->machine());
+ set_audio_cpu_banking(space.machine());
}
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_f000_f7ff_r)
{
- audio_cpu_bank_select(&space, 0, offset >> 8);
+ audio_cpu_bank_select(space, 0, offset >> 8);
return 0;
}
@@ -664,7 +664,7 @@ READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_f000_f7ff_r)
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_e000_efff_r)
{
- audio_cpu_bank_select(&space, 1, offset >> 8);
+ audio_cpu_bank_select(space, 1, offset >> 8);
return 0;
}
@@ -672,7 +672,7 @@ READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_e000_efff_r)
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_c000_dfff_r)
{
- audio_cpu_bank_select(&space, 2, offset >> 8);
+ audio_cpu_bank_select(space, 2, offset >> 8);
return 0;
}
@@ -680,15 +680,15 @@ READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_c000_dfff_r)
READ8_MEMBER(ng_aes_state::audio_cpu_bank_select_8000_bfff_r)
{
- audio_cpu_bank_select(&space, 3, offset >> 8);
+ audio_cpu_bank_select(space, 3, offset >> 8);
return 0;
}
-static void _set_audio_cpu_rom_source( address_space *space )
+static void _set_audio_cpu_rom_source( address_space &space )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
/* if (!state->memregion("audiobios")->base()) */
state->m_audio_cpu_rom_source = 1;
@@ -700,16 +700,16 @@ static void _set_audio_cpu_rom_source( address_space *space )
{
state->m_audio_cpu_rom_source_last = state->m_audio_cpu_rom_source;
- space->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
+ space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
- if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space->device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
+ if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", space.device().safe_pc(), state->m_audio_cpu_rom_source ? "CARTRIDGE" : "BIOS");
}
}
-static void set_audio_cpu_rom_source( address_space *space, UINT8 data )
+static void set_audio_cpu_rom_source( address_space &space, UINT8 data )
{
- neogeo_state *state = space->machine().driver_data<neogeo_state>();
+ neogeo_state *state = space.machine().driver_data<neogeo_state>();
state->m_audio_cpu_rom_source = data;
_set_audio_cpu_rom_source(space);
@@ -752,7 +752,7 @@ static void audio_cpu_banking_init( running_machine &machine )
set_audio_cpu_banking(machine);
state->m_audio_cpu_rom_source_last = 0;
- set_audio_cpu_rom_source(machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
+ set_audio_cpu_rom_source(*machine.device("maincpu")->memory().space(AS_PROGRAM), 0);
}
@@ -774,7 +774,7 @@ WRITE16_MEMBER(ng_aes_state::system_control_w)
default:
case 0x00: neogeo_set_screen_dark(machine(), bit); break;
case 0x01: set_main_cpu_vector_table_source(machine(), bit);
- set_audio_cpu_rom_source(&space, bit); /* this is a guess */
+ set_audio_cpu_rom_source(space, bit); /* this is a guess */
break;
case 0x05: neogeo_set_fixed_layer_source(machine(), bit); break;
// case 0x06: set_save_ram_unlock(machine(), bit); break;
@@ -836,9 +836,9 @@ WRITE16_MEMBER(ng_aes_state::system_control_w)
*
*/
-static void neocd_do_dma(address_space* space)
+static void neocd_do_dma(address_space& space)
{
- ng_aes_state *state = space->machine().driver_data<ng_aes_state>();
+ ng_aes_state *state = space.machine().driver_data<ng_aes_state>();
// TODO: Proper DMA timing and control
int count;
// UINT16 word;
@@ -848,28 +848,28 @@ static void neocd_do_dma(address_space* space)
case 0xffdd:
for(count=0;count<state->m_neocd_ctrl.word_count;count++)
{
- //word = space->read_word(state->m_neocd_ctrl.addr_source);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*2),state->m_neocd_ctrl.fill_word);
+ //word = space.read_word(state->m_neocd_ctrl.addr_source);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*2),state->m_neocd_ctrl.fill_word);
}
logerror("CTRL: DMA word-fill transfer of %i bytes\n",count*2);
break;
case 0xfef5:
for(count=0;count<state->m_neocd_ctrl.word_count;count++)
{
- //word = space->read_word(state->m_neocd_ctrl.addr_source);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*4),(state->m_neocd_ctrl.addr_source+(count*4)) >> 16);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*4)+2,(state->m_neocd_ctrl.addr_source+(count*4)) & 0xffff);
+ //word = space.read_word(state->m_neocd_ctrl.addr_source);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*4),(state->m_neocd_ctrl.addr_source+(count*4)) >> 16);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*4)+2,(state->m_neocd_ctrl.addr_source+(count*4)) & 0xffff);
}
logerror("CTRL: DMA mode 2 transfer of %i bytes\n",count*4);
break;
case 0xcffd:
for(count=0;count<state->m_neocd_ctrl.word_count;count++)
{
- //word = space->read_word(state->m_neocd_ctrl.addr_source);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8),((state->m_neocd_ctrl.addr_source+(count*8)) >> 24) | 0xff00);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8)+2,((state->m_neocd_ctrl.addr_source+(count*8)) >> 16) | 0xff00);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8)+4,((state->m_neocd_ctrl.addr_source+(count*8)) >> 8) | 0xff00);
- space->write_word(state->m_neocd_ctrl.addr_source+(count*8)+6,(state->m_neocd_ctrl.addr_source+(count*8)) | 0xff00);
+ //word = space.read_word(state->m_neocd_ctrl.addr_source);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8),((state->m_neocd_ctrl.addr_source+(count*8)) >> 24) | 0xff00);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8)+2,((state->m_neocd_ctrl.addr_source+(count*8)) >> 16) | 0xff00);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8)+4,((state->m_neocd_ctrl.addr_source+(count*8)) >> 8) | 0xff00);
+ space.write_word(state->m_neocd_ctrl.addr_source+(count*8)+6,(state->m_neocd_ctrl.addr_source+(count*8)) | 0xff00);
}
logerror("CTRL: DMA mode 3 transfer of %i bytes\n",count*8);
break;
@@ -929,7 +929,7 @@ WRITE16_MEMBER(ng_aes_state::neocd_control_w)
{
case 0x60/2: // Start DMA transfer
if((data & 0xff) == 0x40)
- neocd_do_dma(&space);
+ neocd_do_dma(space);
break;
case 0x64/2: // source address, high word
m_neocd_ctrl.addr_source = (m_neocd_ctrl.addr_source & 0x0000ffff) | (data << 16);
@@ -1148,7 +1148,7 @@ static void aes_postload(neogeo_state *state)
_set_main_cpu_bank_address(state->machine());
_set_main_cpu_vector_table_source(state->machine());
set_audio_cpu_banking(state->machine());
- _set_audio_cpu_rom_source(state->machine().device("maincpu")->memory().space(AS_PROGRAM));
+ _set_audio_cpu_rom_source(*state->machine().device("maincpu")->memory().space(AS_PROGRAM));
}
static void common_machine_start(running_machine &machine)
@@ -1253,11 +1253,11 @@ MACHINE_START_MEMBER(ng_aes_state,neocd)
MACHINE_RESET_MEMBER(ng_aes_state,neogeo)
{
offs_t offs;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* reset system control registers */
for (offs = 0; offs < 8; offs++)
- system_control_w(*space, offs, 0, 0x00ff);
+ system_control_w(space, offs, 0, 0x00ff);
machine().device("maincpu")->reset();
diff --git a/src/mess/drivers/p8k.c b/src/mess/drivers/p8k.c
index 0d86b5da22e..334979209d5 100644
--- a/src/mess/drivers/p8k.c
+++ b/src/mess/drivers/p8k.c
@@ -219,8 +219,8 @@ static WRITE_LINE_DEVICE_HANDLER( p8k_dma_irq_w )
p8k_daisy_interrupt(device, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( p8k_dma_intf )
{
diff --git a/src/mess/drivers/palm.c b/src/mess/drivers/palm.c
index 3dbba60a9e2..5277161c09b 100644
--- a/src/mess/drivers/palm.c
+++ b/src/mess/drivers/palm.c
@@ -120,9 +120,9 @@ static void palm_spim_exchange( device_t *device )
void palm_state::machine_start()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_bank (0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
- space->install_write_bank(0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_read_bank (0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
+ space.install_write_bank(0x000000, machine().device<ram_device>(RAM_TAG)->size() - 1, machine().device<ram_device>(RAM_TAG)->size() - 1, 0, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
save_item(NAME(m_port_f_latch));
diff --git a/src/mess/drivers/pc6001.c b/src/mess/drivers/pc6001.c
index aaf3baca474..f9a5aff1e94 100644
--- a/src/mess/drivers/pc6001.c
+++ b/src/mess/drivers/pc6001.c
@@ -2068,7 +2068,7 @@ static TIMER_DEVICE_CALLBACK(cassette_callback)
static TIMER_DEVICE_CALLBACK(keyboard_callback)
{
pc6001_state *state = timer.machine().driver_data<pc6001_state>();
- address_space *space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
@@ -2078,7 +2078,7 @@ static TIMER_DEVICE_CALLBACK(keyboard_callback)
{
if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3))
{
- state->m_cur_keycode = check_keyboard_press(space->machine());
+ state->m_cur_keycode = check_keyboard_press(space.machine());
if(IRQ_LOG) printf("KEY IRQ 0x02\n");
state->m_irq_vector = 0x02;
timer.machine().device("maincpu")->execute().set_input_line(0, ASSERT_LINE);
@@ -2089,7 +2089,7 @@ static TIMER_DEVICE_CALLBACK(keyboard_callback)
#if 0
else /* joypad polling */
{
- state->m_cur_keycode = check_joy_press(space->machine());
+ state->m_cur_keycode = check_joy_press(space.machine());
if(state->m_cur_keycode)
{
state->m_irq_vector = 0x16;
diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c
index a5cedb3e992..81fda63c94c 100644
--- a/src/mess/drivers/pc88va.c
+++ b/src/mess/drivers/pc88va.c
@@ -650,10 +650,10 @@ WRITE8_MEMBER(pc88va_state::idp_command_w)
static void tsp_sprite_enable(running_machine &machine, UINT32 spr_offset, UINT8 sw_bit)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->write_word(spr_offset, space->read_word(spr_offset) & ~0x200);
- space->write_word(spr_offset, space->read_word(spr_offset) | (sw_bit & 0x200));
+ space.write_word(spr_offset, space.read_word(spr_offset) & ~0x200);
+ space.write_word(spr_offset, space.read_word(spr_offset) | (sw_bit & 0x200));
}
/* TODO: very preliminary, needs something showable first */
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index b980971437e..3e0981299f7 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -2611,7 +2611,7 @@ static INTERRUPT_GEN(pc9801_vrtc_irq)
{
pc9801_state *state = device->machine().driver_data<pc9801_state>();
#if 0
- address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
static UINT8 test;
if(device->machine().input().code_pressed_once(JOYCODE_BUTTON1))
@@ -2620,7 +2620,7 @@ static INTERRUPT_GEN(pc9801_vrtc_irq)
if(test)
{
popmessage("Go hack go");
- space->write_word(0x55e,space->machine().rand());
+ space.write_word(0x55e,space.machine().rand());
}
#endif
diff --git a/src/mess/drivers/pce220.c b/src/mess/drivers/pce220.c
index 5b44ea70474..06066980191 100644
--- a/src/mess/drivers/pce220.c
+++ b/src/mess/drivers/pce220.c
@@ -873,8 +873,8 @@ void pcg850v_state::machine_start()
void pce220_state::machine_reset()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.unmap_write(0x0000, 0x3fff);
// install the boot code into the first bank
membank("bank1")->set_base(machine().root_device().memregion("user1")->base() + 0x0000);
diff --git a/src/mess/drivers/pcw.c b/src/mess/drivers/pcw.c
index 8fb83df40f4..d1f91ccf999 100644
--- a/src/mess/drivers/pcw.c
+++ b/src/mess/drivers/pcw.c
@@ -234,7 +234,7 @@ READ8_MEMBER(pcw_state::pcw_keyboard_data_r)
static void pcw_update_read_memory_block(running_machine &machine, int block, int bank)
{
pcw_state *state = machine.driver_data<pcw_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
char block_name[10];
sprintf(block_name,"bank%d",block+1);
@@ -243,14 +243,14 @@ static void pcw_update_read_memory_block(running_machine &machine, int block, in
{
/* when upper 16 bytes are accessed use keyboard read
handler */
- space->install_read_handler(
+ space.install_read_handler(
block * 0x04000 + 0x3ff0, block * 0x04000 + 0x3fff, read8_delegate(FUNC(pcw_state::pcw_keyboard_data_r),state));
// LOG(("MEM: read block %i -> bank %i\n",block,bank));
}
else
{
/* restore bank handler across entire block */
- space->install_read_bank(block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff,block_name);
+ space.install_read_bank(block * 0x04000 + 0x0000, block * 0x04000 + 0x3fff,block_name);
// LOG(("MEM: read block %i -> bank %i\n",block,bank));
}
state->membank(block_name)->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + ((bank * 0x4000) % machine.device<ram_device>(RAM_TAG)->size()));
diff --git a/src/mess/drivers/pcw16.c b/src/mess/drivers/pcw16.c
index 2e386866607..93e024c5965 100644
--- a/src/mess/drivers/pcw16.c
+++ b/src/mess/drivers/pcw16.c
@@ -209,43 +209,43 @@ static int pcw16_flash1_bank_handler_r(running_machine &machine, int bank, int o
/* flash 0 */
static READ8_HANDLER(pcw16_flash0_bank_handler0_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),0, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),0, offset);
}
static READ8_HANDLER(pcw16_flash0_bank_handler1_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),1, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),1, offset);
}
static READ8_HANDLER(pcw16_flash0_bank_handler2_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),2, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),2, offset);
}
static READ8_HANDLER(pcw16_flash0_bank_handler3_r)
{
- return pcw16_flash0_bank_handler_r(space->machine(),3, offset);
+ return pcw16_flash0_bank_handler_r(space.machine(),3, offset);
}
/* flash 1 */
static READ8_HANDLER(pcw16_flash1_bank_handler0_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),0, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),0, offset);
}
static READ8_HANDLER(pcw16_flash1_bank_handler1_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),1, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),1, offset);
}
static READ8_HANDLER(pcw16_flash1_bank_handler2_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),2, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),2, offset);
}
static READ8_HANDLER(pcw16_flash1_bank_handler3_r)
{
- return pcw16_flash1_bank_handler_r(space->machine(),3, offset);
+ return pcw16_flash1_bank_handler_r(space.machine(),3, offset);
}
static const struct { read8_space_func func; const char *name; } pcw16_flash0_bank_handlers_r[4] =
@@ -289,46 +289,46 @@ static void pcw16_flash1_bank_handler_w(running_machine &machine, int bank, int
/* flash 0 */
static WRITE8_HANDLER(pcw16_flash0_bank_handler0_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),0, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),0, offset, data);
}
static WRITE8_HANDLER(pcw16_flash0_bank_handler1_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),1, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),1, offset, data);
}
static WRITE8_HANDLER(pcw16_flash0_bank_handler2_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),2, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),2, offset, data);
}
static WRITE8_HANDLER(pcw16_flash0_bank_handler3_w)
{
- pcw16_flash0_bank_handler_w(space->machine(),3, offset, data);
+ pcw16_flash0_bank_handler_w(space.machine(),3, offset, data);
}
/* flash 1 */
static WRITE8_HANDLER(pcw16_flash1_bank_handler0_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),0, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),0, offset, data);
}
static WRITE8_HANDLER(pcw16_flash1_bank_handler1_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),1, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),1, offset, data);
}
static WRITE8_HANDLER(pcw16_flash1_bank_handler2_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),2, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),2, offset, data);
}
static WRITE8_HANDLER(pcw16_flash1_bank_handler3_w)
{
- pcw16_flash1_bank_handler_w(space->machine(),3, offset, data);
+ pcw16_flash1_bank_handler_w(space.machine(),3, offset, data);
}
static const struct { write8_space_func func; const char *name; } pcw16_flash0_bank_handlers_w[4] =
@@ -369,36 +369,36 @@ READ8_MEMBER(pcw16_state::pcw16_no_mem_r)
/*
static void pcw16_set_bank_handlers(running_machine &machine, int bank, PCW16_RAM_TYPE type)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
pcw16_state *state = machine.driver_data<pcw16_state>();
switch (type) {
case PCW16_MEM_ROM:
// rom
- space->install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
break;
case PCW16_MEM_FLASH_1:
// sram
- space->install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_r[bank].func, pcw16_flash0_bank_handlers_r[bank].name);
- space->install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_w[bank].func, pcw16_flash0_bank_handlers_w[bank].name);
+ space.install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_r[bank].func, pcw16_flash0_bank_handlers_r[bank].name);
+ space.install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash0_bank_handlers_w[bank].func, pcw16_flash0_bank_handlers_w[bank].name);
break;
case PCW16_MEM_FLASH_2:
- space->install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_r[bank].func, pcw16_flash1_bank_handlers_r[bank].name);
- space->install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_w[bank].func, pcw16_flash1_bank_handlers_w[bank].name);
+ space.install_legacy_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_r[bank].func, pcw16_flash1_bank_handlers_r[bank].name);
+ space.install_legacy_write_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_flash1_bank_handlers_w[bank].func, pcw16_flash1_bank_handlers_w[bank].name);
break;
case PCW16_MEM_NONE:
- space->install_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, read8_delegate(FUNC(pcw16_state::pcw16_no_mem_r),state));
- space->nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
+ space.install_read_handler((bank * 0x4000), (bank * 0x4000) + 0x3fff, read8_delegate(FUNC(pcw16_state::pcw16_no_mem_r),state));
+ space.nop_write((bank * 0x4000), (bank * 0x4000) + 0x3fff);
break;
default:
case PCW16_MEM_DRAM:
// dram
- space->install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
- space->install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_write_handler_dram[bank]);
+ space.install_read_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_read_handler_dram[bank]);
+ space.install_write_bank((bank * 0x4000), (bank * 0x4000) + 0x3fff, pcw16_write_handler_dram[bank]);
break;
}
@@ -1254,36 +1254,36 @@ WRITE8_MEMBER(pcw16_state::pcw16_system_control_w)
/* write to Super I/O chip. FDC Data Rate. */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_datarate_w)
{
- pc_fdc_w(&space, PC_FDC_DATA_RATE_REGISTER,data);
+ pc_fdc_w(space, PC_FDC_DATA_RATE_REGISTER,data);
}
/* write to Super I/O chip. FDC Digital output register */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_digital_output_register_w)
{
- pc_fdc_w(&space, PC_FDC_DIGITAL_OUTPUT_REGISTER, data);
+ pc_fdc_w(space, PC_FDC_DIGITAL_OUTPUT_REGISTER, data);
}
/* write to Super I/O chip. FDC Data Register */
WRITE8_MEMBER(pcw16_state::pcw16_superio_fdc_data_w)
{
- pc_fdc_w(&space, PC_FDC_DATA_REGISTER, data);
+ pc_fdc_w(space, PC_FDC_DATA_REGISTER, data);
}
/* write to Super I/O chip. FDC Data Register */
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_data_r)
{
- return pc_fdc_r(&space, PC_FDC_DATA_REGISTER);
+ return pc_fdc_r(space, PC_FDC_DATA_REGISTER);
}
/* write to Super I/O chip. FDC Main Status Register */
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_main_status_register_r)
{
- return pc_fdc_r(&space, PC_FDC_MAIN_STATUS_REGISTER);
+ return pc_fdc_r(space, PC_FDC_MAIN_STATUS_REGISTER);
}
READ8_MEMBER(pcw16_state::pcw16_superio_fdc_digital_input_register_r)
{
- return pc_fdc_r(&space, PC_FDC_DIGITIAL_INPUT_REGISTER);
+ return pc_fdc_r(space, PC_FDC_DIGITIAL_INPUT_REGISTER);
}
static void pcw16_fdc_interrupt(running_machine &machine, int state)
diff --git a/src/mess/drivers/pentagon.c b/src/mess/drivers/pentagon.c
index a447a6a5ba8..735a25ce818 100644
--- a/src/mess/drivers/pentagon.c
+++ b/src/mess/drivers/pentagon.c
@@ -112,16 +112,16 @@ MACHINE_RESET_MEMBER(pentagon_state,pentagon)
{
UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer();
device_t *beta = machine().device(BETA_DISK_TAG);
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_bank(0x0000, 0x3fff, "bank1");
- space->unmap_write(0x0000, 0x3fff);
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
+ space.unmap_write(0x0000, 0x3fff);
if (beta->started()) {
betadisk_enable(beta);
betadisk_clear_status(beta);
}
- space->set_direct_update_handler(direct_update_delegate(FUNC(pentagon_state::pentagon_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(pentagon_state::pentagon_direct), this));
memset(messram,0,128*1024);
diff --git a/src/mess/drivers/pipbug.c b/src/mess/drivers/pipbug.c
index 0e1d2d812df..b95737a8e1d 100644
--- a/src/mess/drivers/pipbug.c
+++ b/src/mess/drivers/pipbug.c
@@ -92,7 +92,7 @@ static const serial_terminal_interface terminal_intf =
QUICKLOAD_LOAD( pipbug )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x0440;
int exec_addr;
@@ -149,7 +149,7 @@ QUICKLOAD_LOAD( pipbug )
for (i = quick_addr; i < quick_length; i++)
{
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
}
/* display a message about the loaded quickload */
diff --git a/src/mess/drivers/psion.c b/src/mess/drivers/psion.c
index 625fe511852..693a8aee108 100644
--- a/src/mess/drivers/psion.c
+++ b/src/mess/drivers/psion.c
@@ -101,7 +101,7 @@ WRITE8_MEMBER( psion_state::hd63701_int_reg_w )
break;
}
- m6801_io_w(&space, offset, data);
+ m6801_io_w(space, offset, data);
}
READ8_MEMBER( psion_state::hd63701_int_reg_r )
@@ -112,7 +112,7 @@ READ8_MEMBER( psion_state::hd63701_int_reg_r )
/* datapack i/o data bus */
return (m_pack1->data_r() | m_pack2->data_r()) & (~m_port2_ddr);
case 0x14:
- return (m6801_io_r(&space, offset)&0x7f) | (m_stby_pwr<<7);
+ return (m6801_io_r(space, offset)&0x7f) | (m_stby_pwr<<7);
case 0x15:
/*
x--- ---- ON key active high
@@ -125,9 +125,9 @@ READ8_MEMBER( psion_state::hd63701_int_reg_r )
/* datapack control lines */
return (m_pack1->control_r() | (m_pack2->control_r() & 0x8f)) | ((m_pack2->control_r() & 0x10)<<1);
case 0x08:
- m6801_io_w(&space, offset, m_tcsr_value);
+ m6801_io_w(space, offset, m_tcsr_value);
default:
- return m6801_io_r(&space, offset);
+ return m6801_io_r(space, offset);
}
}
diff --git a/src/mess/drivers/psx.c b/src/mess/drivers/psx.c
index 3c642b1dd44..b01134e0c83 100644
--- a/src/mess/drivers/psx.c
+++ b/src/mess/drivers/psx.c
@@ -455,7 +455,7 @@ DIRECT_UPDATE_MEMBER(psx1_state::psx_setopbase)
static QUICKLOAD_LOAD( psx_exe_load )
{
psx1_state *state = image.device().machine().driver_data<psx1_state>();
- address_space *space = image.device().machine().device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *image.device().machine().device( "maincpu")->memory().space( AS_PROGRAM );
state->m_exe_size = 0;
state->m_exe_buffer = (UINT8*)malloc( quickload_size );
@@ -470,7 +470,7 @@ static QUICKLOAD_LOAD( psx_exe_load )
return IMAGE_INIT_FAIL;
}
state->m_exe_size = quickload_size;
- space->set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_setopbase), state));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(psx1_state::psx_setopbase), state));
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c
index a13afeec735..da8e4f36183 100644
--- a/src/mess/drivers/px4.c
+++ b/src/mess/drivers/px4.c
@@ -497,36 +497,36 @@ READ8_MEMBER(px4_state::px4_str_r)
}
/* helper function to map rom capsules */
-static void install_rom_capsule(address_space *space, int size, const char *region)
+static void install_rom_capsule(address_space &space, int size, const char *region)
{
- px4_state *state = space->machine().driver_data<px4_state>();
+ px4_state *state = space.machine().driver_data<px4_state>();
/* ram, part 1 */
- space->install_readwrite_bank(0x0000, 0xdfff - size, "bank1");
+ space.install_readwrite_bank(0x0000, 0xdfff - size, "bank1");
state->membank("bank1")->set_base(state->m_ram->pointer());
/* actual rom data, part 1 */
- space->install_read_bank(0xe000 - size, 0xffff - size, "bank2");
- space->nop_write(0xe000 - size, 0xffff - size);
- state->membank("bank2")->set_base(space->machine().root_device().memregion(region)->base() + (size - 0x2000));
+ space.install_read_bank(0xe000 - size, 0xffff - size, "bank2");
+ space.nop_write(0xe000 - size, 0xffff - size);
+ state->membank("bank2")->set_base(space.machine().root_device().memregion(region)->base() + (size - 0x2000));
/* rom data, part 2 */
if (size != 0x2000)
{
- space->install_read_bank(0x10000 - size, 0xdfff, "bank3");
- space->nop_write(0x10000 - size, 0xdfff);
+ space.install_read_bank(0x10000 - size, 0xdfff, "bank3");
+ space.nop_write(0x10000 - size, 0xdfff);
state->membank("bank3")->set_base(state->memregion(region)->base());
}
/* ram, continued */
- space->install_readwrite_bank(0xe000, 0xffff, "bank4");
+ space.install_readwrite_bank(0xe000, 0xffff, "bank4");
state->membank("bank4")->set_base(state->m_ram->pointer() + 0xe000);
}
/* bank register */
WRITE8_MEMBER(px4_state::px4_bankr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
if (VERBOSE)
logerror("%s: px4_bankr_w (0x%02x)\n", machine().describe_context(), data);
@@ -538,16 +538,16 @@ WRITE8_MEMBER(px4_state::px4_bankr_w)
{
case 0x00:
/* system bank */
- space_program->install_read_bank(0x0000, 0x7fff, "bank1");
- space_program->nop_write(0x0000, 0x7fff);
+ space_program.install_read_bank(0x0000, 0x7fff, "bank1");
+ space_program.nop_write(0x0000, 0x7fff);
membank("bank1")->set_base(machine().root_device().memregion("os")->base());
- space_program->install_readwrite_bank(0x8000, 0xffff, "bank2");
+ space_program.install_readwrite_bank(0x8000, 0xffff, "bank2");
membank("bank2")->set_base(m_ram->pointer() + 0x8000);
break;
case 0x04:
/* memory */
- space_program->install_readwrite_bank(0x0000, 0xffff, "bank1");
+ space_program.install_readwrite_bank(0x0000, 0xffff, "bank1");
membank("bank1")->set_base(m_ram->pointer());
break;
diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c
index bc5a70683b8..388cd8e819a 100644
--- a/src/mess/drivers/qx10.c
+++ b/src/mess/drivers/qx10.c
@@ -377,8 +377,8 @@ WRITE_LINE_MEMBER( qx10_state::tc_w )
Channel 2: GDC
Channel 3: Option slots
*/
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static I8237_INTERFACE( qx10_dma8237_1_interface )
{
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index d6972c1250a..8b9a0ea596c 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -167,7 +167,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_lmpr_r)
WRITE8_MEMBER(samcoupe_state::samcoupe_lmpr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_lmpr = data;
samcoupe_update_memory(space_program);
@@ -180,7 +180,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_hmpr_r)
WRITE8_MEMBER(samcoupe_state::samcoupe_hmpr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_hmpr = data;
samcoupe_update_memory(space_program);
@@ -193,7 +193,7 @@ READ8_MEMBER(samcoupe_state::samcoupe_vmpr_r)
WRITE8_MEMBER(samcoupe_state::samcoupe_vmpr_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_vmpr = data;
samcoupe_update_memory(space_program);
diff --git a/src/mess/drivers/sc2.c b/src/mess/drivers/sc2.c
index 81256de167e..8af42a73ed1 100644
--- a/src/mess/drivers/sc2.c
+++ b/src/mess/drivers/sc2.c
@@ -41,7 +41,7 @@ public:
READ8_MEMBER( sc2_state::sc2_beep )
{
- //if (!space->debugger_access())
+ //if (!space.debugger_access())
{
m_beep_state = ~m_beep_state;
diff --git a/src/mess/drivers/scorpion.c b/src/mess/drivers/scorpion.c
index 185f76edafa..050a207dc6e 100644
--- a/src/mess/drivers/scorpion.c
+++ b/src/mess/drivers/scorpion.c
@@ -326,15 +326,15 @@ MACHINE_RESET_MEMBER(scorpion_state,scorpion)
{
UINT8 *messram = machine().device<ram_device>(RAM_TAG)->pointer();
device_t *beta = machine().device(BETA_DISK_TAG);
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_ram_0000 = NULL;
- space->install_read_bank(0x0000, 0x3fff, "bank1");
- space->install_write_handler(0x0000, 0x3fff, write8_delegate(FUNC(scorpion_state::scorpion_0000_w),this));
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_handler(0x0000, 0x3fff, write8_delegate(FUNC(scorpion_state::scorpion_0000_w),this));
betadisk_disable(beta);
betadisk_clear_status(beta);
- space->set_direct_update_handler(direct_update_delegate(FUNC(scorpion_state::scorpion_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(scorpion_state::scorpion_direct), this));
memset(messram,0,256*1024);
diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c
index d6a4d0c6362..31b50d730dd 100644
--- a/src/mess/drivers/spc1000.c
+++ b/src/mess/drivers/spc1000.c
@@ -224,15 +224,15 @@ INPUT_PORTS_END
void spc1000_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem = memregion("maincpu")->base();
UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
- space->install_read_bank(0x0000, 0x7fff, "bank1");
- space->install_read_bank(0x8000, 0xffff, "bank3");
+ space.install_read_bank(0x0000, 0x7fff, "bank1");
+ space.install_read_bank(0x8000, 0xffff, "bank3");
- space->install_write_bank(0x0000, 0x7fff, "bank2");
- space->install_write_bank(0x8000, 0xffff, "bank4");
+ space.install_write_bank(0x0000, 0x7fff, "bank2");
+ space.install_write_bank(0x8000, 0xffff, "bank4");
membank("bank1")->set_base(mem);
membank("bank2")->set_base(ram);
diff --git a/src/mess/drivers/spec128.c b/src/mess/drivers/spec128.c
index 32c9f54e1a5..1286a22a2d1 100644
--- a/src/mess/drivers/spec128.c
+++ b/src/mess/drivers/spec128.c
@@ -171,7 +171,7 @@ static const ay8910_interface spectrum_ay_interface =
static WRITE8_HANDLER(spectrum_128_port_7ffd_w)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
/* D0-D2: RAM page located at 0x0c000-0x0ffff */
/* D3 - Screen select (screen 0 in ram page 5, screen 1 in ram page 7 */
@@ -186,7 +186,7 @@ static WRITE8_HANDLER(spectrum_128_port_7ffd_w)
state->m_port_7ffd_data = data;
/* update memory */
- spectrum_128_update_memory(space->machine());
+ spectrum_128_update_memory(space.machine());
}
void spectrum_128_update_memory(running_machine &machine)
@@ -228,8 +228,8 @@ void spectrum_128_update_memory(running_machine &machine)
static READ8_HANDLER ( spectrum_128_ula_r )
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
- int vpos = space->machine().primary_screen->vpos();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
+ int vpos = space.machine().primary_screen->vpos();
return vpos<193 ? state->m_screen_location[0x1800|(vpos&0xf8)<<2]:0xff;
}
diff --git a/src/mess/drivers/specpls3.c b/src/mess/drivers/specpls3.c
index 4c49bfce559..b89a5408b13 100644
--- a/src/mess/drivers/specpls3.c
+++ b/src/mess/drivers/specpls3.c
@@ -183,35 +183,35 @@ static const int spectrum_plus3_memory_selections[]=
static WRITE8_HANDLER(spectrum_plus3_port_3ffd_w)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==1)
- upd765_data_w(space->machine().device("upd765"), *space, 0,data);
+ upd765_data_w(space.machine().device("upd765"), space, 0,data);
}
static READ8_HANDLER(spectrum_plus3_port_3ffd_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==0)
return 0xff;
else
- return upd765_data_r(space->machine().device("upd765"), *space, 0);
+ return upd765_data_r(space.machine().device("upd765"), space, 0);
}
static READ8_HANDLER(spectrum_plus3_port_2ffd_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
if (state->m_floppy==0)
return 0xff;
else
- return upd765_status_r(space->machine().device("upd765"), *space, 0);
+ return upd765_status_r(space.machine().device("upd765"), space, 0);
}
void spectrum_plus3_update_memory(running_machine &machine)
{
spectrum_state *state = machine.driver_data<spectrum_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_port_7ffd_data & 8)
@@ -258,7 +258,7 @@ void spectrum_plus3_update_memory(running_machine &machine)
ChosenROM = machine.root_device().memregion("maincpu")->base() + 0x010000 + (ROMSelection << 14);
state->membank("bank1")->set_base(ChosenROM);
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
logerror("rom switch: %02x\n", ROMSelection);
}
@@ -277,7 +277,7 @@ void spectrum_plus3_update_memory(running_machine &machine)
ram_data = messram + (memory_selection[0] << 14);
state->membank("bank1")->set_base(ram_data);
/* allow writes to 0x0000-0x03fff */
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
ram_data = messram + (memory_selection[1] << 14);
state->membank("bank2")->set_base(ram_data);
@@ -301,7 +301,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_7ffd_w)
/* D4 - ROM select - which rom paged into 0x0000-0x03fff */
/* D5 - Disable paging */
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
/* disable paging? */
if (state->m_port_7ffd_data & 0x20)
@@ -311,7 +311,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_7ffd_w)
state->m_port_7ffd_data = data;
/* update memory */
- spectrum_plus3_update_memory(space->machine());
+ spectrum_plus3_update_memory(space.machine());
}
static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w)
@@ -321,12 +321,12 @@ static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w)
/* D3 - Disk motor on/off */
/* D4 - parallel port strobe */
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
- floppy_mon_w(floppy_get_device(space->machine(), 0), !BIT(data, 3));
- floppy_mon_w(floppy_get_device(space->machine(), 1), !BIT(data, 3));
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1, 1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 1), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), !BIT(data, 3));
+ floppy_mon_w(floppy_get_device(space.machine(), 1), !BIT(data, 3));
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), 1, 1);
state->m_port_1ffd_data = data;
@@ -334,7 +334,7 @@ static WRITE8_HANDLER(spectrum_plus3_port_1ffd_w)
if ((state->m_port_7ffd_data & 0x20)==0)
{
/* no */
- spectrum_plus3_update_memory(space->machine());
+ spectrum_plus3_update_memory(space.machine());
}
}
diff --git a/src/mess/drivers/spectrum.c b/src/mess/drivers/spectrum.c
index 779841271fd..93c8971c9d4 100644
--- a/src/mess/drivers/spectrum.c
+++ b/src/mess/drivers/spectrum.c
@@ -620,22 +620,22 @@ INPUT_PORTS_END
DRIVER_INIT_MEMBER(spectrum_state,spectrum)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
switch (machine().device<ram_device>(RAM_TAG)->size())
{
case 48*1024:
- space->install_ram(0x8000, 0xffff, NULL); // Fall through
+ space.install_ram(0x8000, 0xffff, NULL); // Fall through
case 16*1024:
- space->install_ram(0x5b00, 0x7fff, NULL);
+ space.install_ram(0x5b00, 0x7fff, NULL);
}
}
MACHINE_RESET_MEMBER(spectrum_state,spectrum)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->set_direct_update_handler(direct_update_delegate(FUNC(spectrum_state::spectrum_direct), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(spectrum_state::spectrum_direct), this));
m_port_7ffd_data = -1;
m_port_1ffd_data = -1;
diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c
index fe6e75cab64..d9758ba0eb4 100644
--- a/src/mess/drivers/super6.c
+++ b/src/mess/drivers/super6.c
@@ -396,8 +396,8 @@ static Z80DART_INTERFACE( dart_intf )
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/drivers/timex.c b/src/mess/drivers/timex.c
index a0a15ceffd6..d9673f0b8eb 100644
--- a/src/mess/drivers/timex.c
+++ b/src/mess/drivers/timex.c
@@ -171,22 +171,22 @@ static const ay8910_interface spectrum_ay_interface =
static READ8_HANDLER(ts2068_port_f4_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
return state->m_port_f4_data;
}
static WRITE8_HANDLER(ts2068_port_f4_w)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
state->m_port_f4_data = data;
- ts2068_update_memory(space->machine());
+ ts2068_update_memory(space.machine());
}
static READ8_HANDLER(ts2068_port_ff_r)
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
return state->m_port_ff_data;
}
@@ -199,10 +199,10 @@ static WRITE8_HANDLER(ts2068_port_ff_w)
Bit 6 17ms Interrupt Inhibit
Bit 7 Cartridge (0) / EXROM (1) select
*/
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
state->m_port_ff_data = data;
- ts2068_update_memory(space->machine());
+ ts2068_update_memory(space.machine());
logerror("Port %04x write %02x\n", offset, data);
}
@@ -228,7 +228,7 @@ void ts2068_update_memory(running_machine &machine)
{
spectrum_state *state = machine.driver_data<spectrum_state>();
UINT8 *messram = machine.device<ram_device>(RAM_TAG)->pointer();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
unsigned char *ChosenROM, *ExROM;
const timex_cart_t *timex_cart = timex_cart_data();
int timex_cart_type = timex_cart->type;
@@ -241,8 +241,8 @@ void ts2068_update_memory(running_machine &machine)
{
if (state->m_port_ff_data & 0x80)
{
- space->install_read_bank(0x0000, 0x1fff, "bank1");
- space->unmap_write(0x0000, 0x1fff);
+ space.install_read_bank(0x0000, 0x1fff, "bank1");
+ space.unmap_write(0x0000, 0x1fff);
state->membank("bank1")->set_base(ExROM);
logerror("0000-1fff EXROM\n");
}
@@ -251,18 +251,18 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank1")->set_base(DOCK);
- space->install_read_bank(0x0000, 0x1fff, "bank1");
+ space.install_read_bank(0x0000, 0x1fff, "bank1");
if (timex_cart_chunks&0x01)
- space->install_write_bank(0x0000, 0x1fff, "bank9");
+ space.install_write_bank(0x0000, 0x1fff, "bank9");
else
- space->unmap_write(0x0000, 0x1fff);
+ space.unmap_write(0x0000, 0x1fff);
}
else
{
- space->nop_read(0x0000, 0x1fff);
- space->unmap_write(0x0000, 0x1fff);
+ space.nop_read(0x0000, 0x1fff);
+ space.unmap_write(0x0000, 0x1fff);
}
logerror("0000-1fff Cartridge\n");
}
@@ -271,8 +271,8 @@ void ts2068_update_memory(running_machine &machine)
{
ChosenROM = machine.root_device().memregion("maincpu")->base() + 0x010000;
state->membank("bank1")->set_base(ChosenROM);
- space->install_read_bank(0x0000, 0x1fff, "bank1");
- space->unmap_write(0x0000, 0x1fff);
+ space.install_read_bank(0x0000, 0x1fff, "bank1");
+ space.unmap_write(0x0000, 0x1fff);
logerror("0000-1fff HOME\n");
}
@@ -281,8 +281,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank2")->set_base(ExROM);
- space->install_read_bank(0x2000, 0x3fff, "bank2");
- space->unmap_write(0x2000, 0x3fff);
+ space.install_read_bank(0x2000, 0x3fff, "bank2");
+ space.unmap_write(0x2000, 0x3fff);
logerror("2000-3fff EXROM\n");
}
else
@@ -290,17 +290,17 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank2")->set_base(DOCK+0x2000);
- space->install_read_bank(0x2000, 0x3fff, "bank2");
+ space.install_read_bank(0x2000, 0x3fff, "bank2");
if (timex_cart_chunks&0x02)
- space->install_write_bank(0x2000, 0x3fff, "bank10");
+ space.install_write_bank(0x2000, 0x3fff, "bank10");
else
- space->unmap_write(0x2000, 0x3fff);
+ space.unmap_write(0x2000, 0x3fff);
}
else
{
- space->nop_read(0x2000, 0x3fff);
- space->unmap_write(0x2000, 0x3fff);
+ space.nop_read(0x2000, 0x3fff);
+ space.unmap_write(0x2000, 0x3fff);
}
logerror("2000-3fff Cartridge\n");
}
@@ -309,8 +309,8 @@ void ts2068_update_memory(running_machine &machine)
{
ChosenROM = machine.root_device().memregion("maincpu")->base() + 0x012000;
state->membank("bank2")->set_base(ChosenROM);
- space->install_read_bank(0x2000, 0x3fff, "bank2");
- space->unmap_write(0x2000, 0x3fff);
+ space.install_read_bank(0x2000, 0x3fff, "bank2");
+ space.unmap_write(0x2000, 0x3fff);
logerror("2000-3fff HOME\n");
}
@@ -319,8 +319,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank3")->set_base(ExROM);
- space->install_read_bank(0x4000, 0x5fff, "bank3");
- space->unmap_write(0x4000, 0x5fff);
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
+ space.unmap_write(0x4000, 0x5fff);
logerror("4000-5fff EXROM\n");
}
else
@@ -328,16 +328,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank3")->set_base(DOCK+0x4000);
- space->install_read_bank(0x4000, 0x5fff, "bank3");
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
if (timex_cart_chunks&0x04)
- space->install_write_bank(0x4000, 0x5fff, "bank11");
+ space.install_write_bank(0x4000, 0x5fff, "bank11");
else
- space->unmap_write(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
}
else
{
- space->nop_read(0x4000, 0x5fff);
- space->unmap_write(0x4000, 0x5fff);
+ space.nop_read(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
}
logerror("4000-5fff Cartridge\n");
}
@@ -346,8 +346,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank3")->set_base(messram);
state->membank("bank11")->set_base(messram);
- space->install_read_bank(0x4000, 0x5fff, "bank3");
- space->install_write_bank(0x4000, 0x5fff, "bank11");
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
+ space.install_write_bank(0x4000, 0x5fff, "bank11");
logerror("4000-5fff RAM\n");
}
@@ -356,8 +356,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank4")->set_base(ExROM);
- space->install_read_bank(0x6000, 0x7fff, "bank4");
- space->unmap_write(0x6000, 0x7fff);
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
+ space.unmap_write(0x6000, 0x7fff);
logerror("6000-7fff EXROM\n");
}
else
@@ -365,16 +365,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank4")->set_base(DOCK+0x6000);
- space->install_read_bank(0x6000, 0x7fff, "bank4");
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
if (timex_cart_chunks&0x08)
- space->install_write_bank(0x6000, 0x7fff, "bank12");
+ space.install_write_bank(0x6000, 0x7fff, "bank12");
else
- space->unmap_write(0x6000, 0x7fff);
+ space.unmap_write(0x6000, 0x7fff);
}
else
{
- space->nop_read(0x6000, 0x7fff);
- space->unmap_write(0x6000, 0x7fff);
+ space.nop_read(0x6000, 0x7fff);
+ space.unmap_write(0x6000, 0x7fff);
}
logerror("6000-7fff Cartridge\n");
}
@@ -383,8 +383,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank4")->set_base(messram + 0x2000);
state->membank("bank12")->set_base(messram + 0x2000);
- space->install_read_bank(0x6000, 0x7fff, "bank4");
- space->install_write_bank(0x6000, 0x7fff, "bank12");
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
+ space.install_write_bank(0x6000, 0x7fff, "bank12");
logerror("6000-7fff RAM\n");
}
@@ -393,8 +393,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank5")->set_base(ExROM);
- space->install_read_bank(0x8000, 0x9fff, "bank5");
- space->unmap_write(0x8000, 0x9fff);
+ space.install_read_bank(0x8000, 0x9fff, "bank5");
+ space.unmap_write(0x8000, 0x9fff);
logerror("8000-9fff EXROM\n");
}
else
@@ -402,16 +402,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank5")->set_base(DOCK+0x8000);
- space->install_read_bank(0x8000, 0x9fff,"bank5");
+ space.install_read_bank(0x8000, 0x9fff,"bank5");
if (timex_cart_chunks&0x10)
- space->install_write_bank(0x8000, 0x9fff,"bank13");
+ space.install_write_bank(0x8000, 0x9fff,"bank13");
else
- space->unmap_write(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
}
else
{
- space->nop_read(0x8000, 0x9fff);
- space->unmap_write(0x8000, 0x9fff);
+ space.nop_read(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
}
logerror("8000-9fff Cartridge\n");
}
@@ -420,8 +420,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank5")->set_base(messram + 0x4000);
state->membank("bank13")->set_base(messram + 0x4000);
- space->install_read_bank(0x8000, 0x9fff,"bank5");
- space->install_write_bank(0x8000, 0x9fff,"bank13");
+ space.install_read_bank(0x8000, 0x9fff,"bank5");
+ space.install_write_bank(0x8000, 0x9fff,"bank13");
logerror("8000-9fff RAM\n");
}
@@ -430,8 +430,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank6")->set_base(ExROM);
- space->install_read_bank(0xa000, 0xbfff, "bank6");
- space->unmap_write(0xa000, 0xbfff);
+ space.install_read_bank(0xa000, 0xbfff, "bank6");
+ space.unmap_write(0xa000, 0xbfff);
logerror("a000-bfff EXROM\n");
}
else
@@ -439,17 +439,17 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank6")->set_base(DOCK+0xa000);
- space->install_read_bank(0xa000, 0xbfff, "bank6");
+ space.install_read_bank(0xa000, 0xbfff, "bank6");
if (timex_cart_chunks&0x20)
- space->install_write_bank(0xa000, 0xbfff, "bank14");
+ space.install_write_bank(0xa000, 0xbfff, "bank14");
else
- space->unmap_write(0xa000, 0xbfff);
+ space.unmap_write(0xa000, 0xbfff);
}
else
{
- space->nop_read(0xa000, 0xbfff);
- space->unmap_write(0xa000, 0xbfff);
+ space.nop_read(0xa000, 0xbfff);
+ space.unmap_write(0xa000, 0xbfff);
}
logerror("a000-bfff Cartridge\n");
}
@@ -458,8 +458,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank6")->set_base(messram + 0x6000);
state->membank("bank14")->set_base(messram + 0x6000);
- space->install_read_bank(0xa000, 0xbfff, "bank6");
- space->install_write_bank(0xa000, 0xbfff, "bank14");
+ space.install_read_bank(0xa000, 0xbfff, "bank6");
+ space.install_write_bank(0xa000, 0xbfff, "bank14");
logerror("a000-bfff RAM\n");
}
@@ -468,8 +468,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank7")->set_base(ExROM);
- space->install_read_bank(0xc000, 0xdfff, "bank7");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank7");
+ space.unmap_write(0xc000, 0xdfff);
logerror("c000-dfff EXROM\n");
}
else
@@ -477,16 +477,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank7")->set_base(DOCK+0xc000);
- space->install_read_bank(0xc000, 0xdfff, "bank7");
+ space.install_read_bank(0xc000, 0xdfff, "bank7");
if (timex_cart_chunks&0x40)
- space->install_write_bank(0xc000, 0xdfff, "bank15");
+ space.install_write_bank(0xc000, 0xdfff, "bank15");
else
- space->unmap_write(0xc000, 0xdfff);
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
- space->nop_read(0xc000, 0xdfff);
- space->unmap_write(0xc000, 0xdfff);
+ space.nop_read(0xc000, 0xdfff);
+ space.unmap_write(0xc000, 0xdfff);
}
logerror("c000-dfff Cartridge\n");
}
@@ -495,8 +495,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank7")->set_base(messram + 0x8000);
state->membank("bank15")->set_base(messram + 0x8000);
- space->install_read_bank(0xc000, 0xdfff, "bank7");
- space->install_write_bank(0xc000, 0xdfff, "bank15");
+ space.install_read_bank(0xc000, 0xdfff, "bank7");
+ space.install_write_bank(0xc000, 0xdfff, "bank15");
logerror("c000-dfff RAM\n");
}
@@ -505,8 +505,8 @@ void ts2068_update_memory(running_machine &machine)
if (state->m_port_ff_data & 0x80)
{
state->membank("bank8")->set_base(ExROM);
- space->install_read_bank(0xe000, 0xffff, "bank8");
- space->unmap_write(0xe000, 0xffff);
+ space.install_read_bank(0xe000, 0xffff, "bank8");
+ space.unmap_write(0xe000, 0xffff);
logerror("e000-ffff EXROM\n");
}
else
@@ -514,16 +514,16 @@ void ts2068_update_memory(running_machine &machine)
if (timex_cart_type == TIMEX_CART_DOCK)
{
state->membank("bank8")->set_base(DOCK+0xe000);
- space->install_read_bank(0xe000, 0xffff, "bank8");
+ space.install_read_bank(0xe000, 0xffff, "bank8");
if (timex_cart_chunks&0x80)
- space->install_write_bank(0xe000, 0xffff, "bank16");
+ space.install_write_bank(0xe000, 0xffff, "bank16");
else
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0xe000, 0xffff);
}
else
{
- space->nop_read(0xe000, 0xffff);
- space->unmap_write(0xe000, 0xffff);
+ space.nop_read(0xe000, 0xffff);
+ space.unmap_write(0xe000, 0xffff);
}
logerror("e000-ffff Cartridge\n");
}
@@ -532,8 +532,8 @@ void ts2068_update_memory(running_machine &machine)
{
state->membank("bank8")->set_base(messram + 0xa000);
state->membank("bank16")->set_base(messram + 0xa000);
- space->install_read_bank(0xe000, 0xffff, "bank8");
- space->install_write_bank(0xe000, 0xffff, "bank16");
+ space.install_read_bank(0xe000, 0xffff, "bank8");
+ space.install_write_bank(0xe000, 0xffff, "bank16");
logerror("e000-ffff RAM\n");
}
}
@@ -578,7 +578,7 @@ MACHINE_RESET_MEMBER(spectrum_state,ts2068)
static WRITE8_HANDLER( tc2048_port_ff_w )
{
- spectrum_state *state = space->machine().driver_data<spectrum_state>();
+ spectrum_state *state = space.machine().driver_data<spectrum_state>();
state->m_port_ff_data = data;
logerror("Port %04x write %02x\n", offset, data);
diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c
index fa1a930e8ff..8906665c52c 100644
--- a/src/mess/drivers/trs80m2.c
+++ b/src/mess/drivers/trs80m2.c
@@ -694,8 +694,8 @@ static TRS80M2_KEYBOARD_INTERFACE( kb_intf )
// Z80DMA_INTERFACE( dma_intf )
//-------------------------------------------------
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c
index d408f9e88d0..fb55f278e5a 100644
--- a/src/mess/drivers/tvc.c
+++ b/src/mess/drivers/tvc.c
@@ -18,21 +18,21 @@
#define TVC_INSTALL_ROM_BANK(_bank,_tag,_start,_end) \
if (m_bank_type[_bank] != TVC_ROM_BANK) \
{ \
- space->install_read_bank(_start, _end, _tag); \
- space->unmap_write(_start, _end); \
+ space.install_read_bank(_start, _end, _tag); \
+ space.unmap_write(_start, _end); \
m_bank_type[_bank] = TVC_ROM_BANK; \
} \
#define TVC_INSTALL_RAM_BANK(_bank,_tag,_start,_end) \
if (m_bank_type[_bank] != TVC_RAM_BANK) \
{ \
- space->install_readwrite_bank(_start, _end, _tag); \
+ space.install_readwrite_bank(_start, _end, _tag); \
m_bank_type[_bank] = TVC_RAM_BANK; \
} \
void tvc_state::tvc_set_mem_page(UINT8 data)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
switch(data & 0x18)
{
case 0x00 : // system ROM selected
@@ -56,7 +56,7 @@ void tvc_state::tvc_set_mem_page(UINT8 data)
}
else
{
- space->unmap_readwrite(0x0000, 0x3fff);
+ space.unmap_readwrite(0x0000, 0x3fff);
m_bank_type[0] = -1;
}
break;
@@ -76,7 +76,7 @@ void tvc_state::tvc_set_mem_page(UINT8 data)
}
else
{
- space->unmap_readwrite(0x8000, 0xbfff);
+ space.unmap_readwrite(0x8000, 0xbfff);
m_bank_type[2] = -1;
}
}
@@ -99,14 +99,14 @@ void tvc_state::tvc_set_mem_page(UINT8 data)
}
else
{
- space->unmap_readwrite(0xc000, 0xffff);
+ space.unmap_readwrite(0xc000, 0xffff);
m_bank_type[3] = -1;
}
break;
case 0xc0 : // External ROM selected
TVC_INSTALL_ROM_BANK(3, "bank4", 0xc000, 0xffff);
membank("bank4")->set_base(memregion("ext")->base());
- space->install_readwrite_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(tvc_state::tvc_expansion_r), this), write8_delegate(FUNC(tvc_state::tvc_expansion_w), this), 0);
+ space.install_readwrite_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(tvc_state::tvc_expansion_r), this), write8_delegate(FUNC(tvc_state::tvc_expansion_w), this), 0);
m_bank_type[3] = -1;
break;
}
diff --git a/src/mess/drivers/vc4000.c b/src/mess/drivers/vc4000.c
index c54c92e766f..8989b621ddc 100644
--- a/src/mess/drivers/vc4000.c
+++ b/src/mess/drivers/vc4000.c
@@ -530,7 +530,7 @@ ROM_END
QUICKLOAD_LOAD(vc4000)
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
int i;
int quick_addr = 0x08c0;
int exec_addr;
@@ -567,12 +567,12 @@ QUICKLOAD_LOAD(vc4000)
quick_addr = quick_data[1] * 256 + quick_data[2];
exec_addr = quick_data[3] * 256 + quick_data[4];
- space->write_byte(0x08be, quick_data[3]);
- space->write_byte(0x08bf, quick_data[4]);
+ space.write_byte(0x08be, quick_data[3]);
+ space.write_byte(0x08bf, quick_data[4]);
for (i = 0; i < quick_length - 5; i++)
if ((quick_addr + i) < 0x1600)
- space->write_byte(i + quick_addr, quick_data[i+5]);
+ space.write_byte(i + quick_addr, quick_data[i+5]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : start=%04X : end=%04X : exec=%04X",quick_length-5,quick_addr,quick_addr+quick_length-5,exec_addr);
@@ -617,7 +617,7 @@ QUICKLOAD_LOAD(vc4000)
for (i = quick_addr; i < quick_length; i++)
if (i < 0x1600)
- space->write_byte(i, quick_data[i]);
+ space.write_byte(i, quick_data[i]);
/* display a message about the loaded quickload */
image.message(" Quickload: size=%04X : exec=%04X",quick_length,exec_addr);
diff --git a/src/mess/drivers/vidbrain.c b/src/mess/drivers/vidbrain.c
index bad5ffe29d3..7f9d4a7c5c3 100644
--- a/src/mess/drivers/vidbrain.c
+++ b/src/mess/drivers/vidbrain.c
@@ -449,7 +449,7 @@ WRITE_LINE_MEMBER( vidbrain_state::hblank_w )
}
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
static UV201_INTERFACE( uv_intf )
{
diff --git a/src/mess/drivers/vii.c b/src/mess/drivers/vii.c
index 04fc81554aa..d8cc78ad3f6 100644
--- a/src/mess/drivers/vii.c
+++ b/src/mess/drivers/vii.c
@@ -215,7 +215,7 @@ static void vii_set_pixel(vii_state *state, UINT32 offset, UINT16 rgb)
static void vii_blit(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT32 xoff, UINT32 yoff, UINT32 attr, UINT32 ctrl, UINT32 bitmap_addr, UINT16 tile)
{
vii_state *state = machine.driver_data<vii_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT32 h = 8 << ((attr & PAGE_TILE_HEIGHT_MASK) >> PAGE_TILE_HEIGHT_SHIFT);
UINT32 w = 8 << ((attr & PAGE_TILE_WIDTH_MASK) >> PAGE_TILE_WIDTH_SHIFT);
@@ -247,7 +247,7 @@ static void vii_blit(running_machine &machine, bitmap_rgb32 &bitmap, const recta
bits <<= nc;
if(nbits < nc)
{
- UINT16 b = space->read_word((m++ & 0x3fffff) << 1);
+ UINT16 b = space.read_word((m++ & 0x3fffff) << 1);
b = (b << 8) | (b >> 8);
bits |= b << (nc - nbits);
nbits += 16;
@@ -291,7 +291,7 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
UINT32 tilemap = regs[4];
UINT32 palette_map = regs[5];
UINT32 h, w, hn, wn;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if(!(ctrl & PAGE_ENABLE_MASK))
{
@@ -313,7 +313,7 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
{
for(x0 = 0; x0 < wn; x0++)
{
- UINT16 tile = space->read_word((tilemap + x0 + wn * y0) << 1);
+ UINT16 tile = space.read_word((tilemap + x0 + wn * y0) << 1);
UINT16 palette = 0;
UINT32 xx, yy;
@@ -322,7 +322,7 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
continue;
}
- palette = space->read_word((palette_map + (x0 + wn * y0) / 2) << 1);
+ palette = space.read_word((palette_map + (x0 + wn * y0) / 2) << 1);
if(x0 & 1)
{
palette >>= 8;
@@ -353,16 +353,16 @@ static void vii_blit_page(running_machine &machine, bitmap_rgb32 &bitmap, const
static void vii_blit_sprite(running_machine &machine, bitmap_rgb32 &bitmap, const rectangle &cliprect, int depth, UINT32 base_addr)
{
vii_state *state = machine.driver_data<vii_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 tile, attr;
INT16 x, y;
UINT32 h, w;
UINT32 bitmap_addr = 0x40 * state->m_video_regs[0x22];
- tile = space->read_word((base_addr + 0) << 1);
- x = space->read_word((base_addr + 1) << 1);
- y = space->read_word((base_addr + 2) << 1);
- attr = space->read_word((base_addr + 3) << 1);
+ tile = space.read_word((base_addr + 0) << 1);
+ x = space.read_word((base_addr + 1) << 1);
+ y = space.read_word((base_addr + 2) << 1);
+ attr = space.read_word((base_addr + 3) << 1);
if(!tile)
{
@@ -404,7 +404,7 @@ static void vii_blit_sprites(running_machine &machine, bitmap_rgb32 &bitmap, con
for(n = 0; n < 256; n++)
{
- //if(space->read_word((0x2c00 + 4*n) << 1))
+ //if(space.read_word((0x2c00 + 4*n) << 1))
{
vii_blit_sprite(machine, bitmap, cliprect, depth, 0x2c00 + 4*n);
}
diff --git a/src/mess/drivers/vt520.c b/src/mess/drivers/vt520.c
index a5077d99ead..09083b37bf4 100644
--- a/src/mess/drivers/vt520.c
+++ b/src/mess/drivers/vt520.c
@@ -52,9 +52,9 @@ INPUT_PORTS_END
void vt520_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = memregion("maincpu")->base();
- space->unmap_write(0x0000, 0xffff);
+ space.unmap_write(0x0000, 0xffff);
membank("bank1")->set_base(rom + 0x70000);
}
diff --git a/src/mess/drivers/vtech1.c b/src/mess/drivers/vtech1.c
index c05af7292c4..b9583cd2895 100644
--- a/src/mess/drivers/vtech1.c
+++ b/src/mess/drivers/vtech1.c
@@ -209,7 +209,7 @@ public:
static SNAPSHOT_LOAD( vtech1 )
{
vtech1_state *vtech1 = image.device().machine().driver_data<vtech1_state>();
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 i, header[24];
UINT16 start, end, size;
char pgmname[18];
@@ -241,20 +241,20 @@ static SNAPSHOT_LOAD( vtech1 )
switch (header[21])
{
case VZ_BASIC: /* 0xF0 */
- space->write_byte(0x78a4, start % 256); /* start of basic program */
- space->write_byte(0x78a5, start / 256);
- space->write_byte(0x78f9, end % 256); /* end of basic program */
- space->write_byte(0x78fa, end / 256);
- space->write_byte(0x78fb, end % 256); /* start variable table */
- space->write_byte(0x78fc, end / 256);
- space->write_byte(0x78fd, end % 256); /* start free mem, end variable table */
- space->write_byte(0x78fe, end / 256);
+ space.write_byte(0x78a4, start % 256); /* start of basic program */
+ space.write_byte(0x78a5, start / 256);
+ space.write_byte(0x78f9, end % 256); /* end of basic program */
+ space.write_byte(0x78fa, end / 256);
+ space.write_byte(0x78fb, end % 256); /* start variable table */
+ space.write_byte(0x78fc, end / 256);
+ space.write_byte(0x78fd, end % 256); /* start free mem, end variable table */
+ space.write_byte(0x78fe, end / 256);
image.message(" %s (B)\nsize=%04X : start=%04X : end=%04X",pgmname,size,start,end);
break;
case VZ_MCODE: /* 0xF1 */
- space->write_byte(0x788e, start % 256); /* usr subroutine address */
- space->write_byte(0x788f, start / 256);
+ space.write_byte(0x788e, start % 256); /* usr subroutine address */
+ space.write_byte(0x788f, start / 256);
image.message(" %s (M)\nsize=%04X : start=%04X : end=%04X",pgmname,size,start,end);
image.device().machine().device("maincpu")->state().set_pc(start); /* start program */
break;
diff --git a/src/mess/drivers/x07.c b/src/mess/drivers/x07.c
index 8423f9b76d1..f3eff9f3b41 100644
--- a/src/mess/drivers/x07.c
+++ b/src/mess/drivers/x07.c
@@ -1042,7 +1042,7 @@ static DEVICE_IMAGE_LOAD( x07_card )
{
running_machine &machine = image.device().machine();
x07_state *state = machine.driver_data<x07_state>();
- address_space *space = state->m_maincpu->space( AS_PROGRAM );
+ address_space &space = *state->m_maincpu->space( AS_PROGRAM );
UINT16 ram_size = state->m_ram->size();
if (image.software_entry() == NULL)
@@ -1050,8 +1050,8 @@ static DEVICE_IMAGE_LOAD( x07_card )
UINT8 *rom = machine.memory().region_alloc( "card", image.length(), 1, ENDIANNESS_LITTLE )->base();
image.fread(rom, image.length());
- space->install_ram(ram_size, ram_size + 0xfff);
- space->install_rom(0x6000, 0x7fff, rom);
+ space.install_ram(ram_size, ram_size + 0xfff);
+ space.install_rom(0x6000, 0x7fff, rom);
}
else
{
@@ -1061,8 +1061,8 @@ static DEVICE_IMAGE_LOAD( x07_card )
{
// 0x4000 - 0x4fff 4KB RAM
// 0x6000 - 0x7fff 8KB ROM
- space->install_ram(ram_size, ram_size + 0xfff);
- space->install_rom(0x6000, 0x7fff, image.get_software_region("rom"));
+ space.install_ram(ram_size, ram_size + 0xfff);
+ space.install_rom(0x6000, 0x7fff, image.get_software_region("rom"));
}
else
{
diff --git a/src/mess/drivers/x1.c b/src/mess/drivers/x1.c
index 7d30350b316..29f2adc8340 100644
--- a/src/mess/drivers/x1.c
+++ b/src/mess/drivers/x1.c
@@ -1631,7 +1631,7 @@ READ8_MEMBER( x1_state::x1_io_r )
else if(offset >= 0x4000 && offset <= 0xffff) { return m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)]; }
else
{
- //logerror("(PC=%06x) Read i/o address %04x\n",space->device().safe_pc(),offset);
+ //logerror("(PC=%06x) Read i/o address %04x\n",space.device().safe_pc(),offset);
}
return 0xff;
}
@@ -1674,7 +1674,7 @@ WRITE8_MEMBER( x1_state::x1_io_w )
else if(offset >= 0x4000 && offset <= 0xffff) { m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)] = data; }
else
{
- //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space->device().safe_pc(),data,offset);
+ //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space.device().safe_pc(),data,offset);
}
}
@@ -1721,7 +1721,7 @@ READ8_MEMBER( x1_state::x1turbo_io_r )
else if(offset >= 0x4000 && offset <= 0xffff) { return m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)]; }
else
{
- //logerror("(PC=%06x) Read i/o address %04x\n",space->device().safe_pc(),offset);
+ //logerror("(PC=%06x) Read i/o address %04x\n",space.device().safe_pc(),offset);
}
return 0xff;
}
@@ -1777,7 +1777,7 @@ WRITE8_MEMBER( x1_state::x1turbo_io_w )
else if(offset >= 0x4000 && offset <= 0xffff) { m_gfx_bitmap_ram[offset-0x4000+(m_scrn_reg.gfx_bank*0xc000)] = data; }
else
{
- //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space->device().safe_pc(),data,offset);
+ //logerror("(PC=%06x) Write %02x at i/o address %04x\n",space.device().safe_pc(),data,offset);
}
}
@@ -1916,8 +1916,8 @@ static const mc6845_interface mc6845_intf =
NULL /* update address callback */
};
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( x1_dma )
{
@@ -1938,7 +1938,7 @@ static Z80DMA_INTERFACE( x1_dma )
static INPUT_CHANGED( ipl_reset )
{
- //address_space *space = field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ //address_space &space = *field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
x1_state *state = field.machine().driver_data<x1_state>();
state->m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
@@ -2407,7 +2407,7 @@ static IRQ_CALLBACK(x1_irq_callback)
TIMER_DEVICE_CALLBACK(x1_keyboard_callback)
{
x1_state *state = timer.machine().driver_data<x1_state>();
- address_space *space = timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ address_space &space = *timer.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
UINT32 key1 = timer.machine().root_device().ioport("key1")->read();
UINT32 key2 = timer.machine().root_device().ioport("key2")->read();
UINT32 key3 = timer.machine().root_device().ioport("key3")->read();
@@ -2422,7 +2422,7 @@ TIMER_DEVICE_CALLBACK(x1_keyboard_callback)
if((key1 != state->m_old_key1) || (key2 != state->m_old_key2) || (key3 != state->m_old_key3) || (key4 != state->m_old_key4) || (f_key != state->m_old_fkey))
{
// generate keyboard IRQ
- state->x1_sub_io_w(*space,0,0xe6);
+ state->x1_sub_io_w(space,0,0xe6);
state->m_irq_vector = state->m_key_irq_vector;
state->m_key_irq_flag = 1;
timer.machine().device("x1_cpu")->execute().set_input_line(0,ASSERT_LINE);
diff --git a/src/mess/drivers/x1twin.c b/src/mess/drivers/x1twin.c
index 35e62a8bca9..11c2bd7fdf2 100644
--- a/src/mess/drivers/x1twin.c
+++ b/src/mess/drivers/x1twin.c
@@ -107,7 +107,7 @@ static const mc6845_interface mc6845_intf =
static INPUT_CHANGED( ipl_reset )
{
- //address_space *space = field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
+ //address_space &space = *field.machine().device("x1_cpu")->memory().space(AS_PROGRAM);
x1twin_state *state = field.machine().driver_data<x1twin_state>();
state->m_x1_cpu->set_input_line(INPUT_LINE_RESET, newval ? CLEAR_LINE : ASSERT_LINE);
diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c
index 2050166a61a..d3921946fdf 100644
--- a/src/mess/drivers/x68k.c
+++ b/src/mess/drivers/x68k.c
@@ -346,14 +346,14 @@ static TIMER_CALLBACK( x68k_led_callback )
// 4 channel DMA controller (Hitachi HD63450)
static WRITE16_HANDLER( x68k_dmac_w )
{
- device_t* device = space->machine().device("hd63450");
- hd63450_w(device, *space, offset, data, mem_mask);
+ device_t* device = space.machine().device("hd63450");
+ hd63450_w(device, space, offset, data, mem_mask);
}
static READ16_HANDLER( x68k_dmac_r )
{
- device_t* device = space->machine().device("hd63450");
- return hd63450_r(device, *space, offset, mem_mask);
+ device_t* device = space.machine().device("hd63450");
+ return hd63450_r(device, space, offset, mem_mask);
}
static void x68k_keyboard_ctrl_w(x68k_state *state, int data)
@@ -583,18 +583,18 @@ static int x68k_read_mouse(running_machine &machine)
*/
static READ16_HANDLER( x68k_scc_r )
{
- scc8530_t *scc = space->machine().device<scc8530_t>("scc");
+ scc8530_t *scc = space.machine().device<scc8530_t>("scc");
offset %= 4;
switch(offset)
{
case 0:
- return scc->reg_r(*space, 0);
+ return scc->reg_r(space, 0);
case 1:
- return x68k_read_mouse(space->machine());
+ return x68k_read_mouse(space.machine());
case 2:
- return scc->reg_r(*space, 1);
+ return scc->reg_r(space, 1);
case 3:
- return scc->reg_r(*space, 3);
+ return scc->reg_r(space, 3);
default:
return 0xff;
}
@@ -602,14 +602,14 @@ static READ16_HANDLER( x68k_scc_r )
static WRITE16_HANDLER( x68k_scc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
- scc8530_t *scc = space->machine().device<scc8530_t>("scc");
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ scc8530_t *scc = space.machine().device<scc8530_t>("scc");
offset %= 4;
switch(offset)
{
case 0:
- scc->reg_w(*space, 0,(UINT8)data);
+ scc->reg_w(space, 0,(UINT8)data);
if((scc->get_reg_b(5) & 0x02) != state->m_scc_prev)
{
if(scc->get_reg_b(5) & 0x02) // Request to Send
@@ -622,13 +622,13 @@ static WRITE16_HANDLER( x68k_scc_w )
}
break;
case 1:
- scc->reg_w(*space, 2,(UINT8)data);
+ scc->reg_w(space, 2,(UINT8)data);
break;
case 2:
- scc->reg_w(*space, 1,(UINT8)data);
+ scc->reg_w(space, 1,(UINT8)data);
break;
case 3:
- scc->reg_w(*space, 3,(UINT8)data);
+ scc->reg_w(space, 3,(UINT8)data);
break;
}
state->m_scc_prev = scc->get_reg_b(5) & 0x02;
@@ -967,14 +967,14 @@ static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
// NEC uPD72065 at 0xe94000
static WRITE16_HANDLER( x68k_fdc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
- device_t *fdc = space->machine().device("upd72065");
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ device_t *fdc = space.machine().device("upd72065");
unsigned int drive, x;
switch(offset)
{
case 0x00:
case 0x01:
- upd765_data_w(fdc, *space, 0,data);
+ upd765_data_w(fdc, space, 0,data);
break;
case 0x02: // drive option signal control
x = data & 0x0f;
@@ -989,8 +989,8 @@ static WRITE16_HANDLER( x68k_fdc_w )
output_set_indexed_value("eject_drv",drive,(data & 0x40) ? 1 : 0);
if(data & 0x20) // ejects disk
{
- (dynamic_cast<device_image_interface *>(floppy_get_device(space->machine(), drive)))->unload();
- floppy_mon_w(floppy_get_device(space->machine(), drive), ASSERT_LINE);
+ (dynamic_cast<device_image_interface *>(floppy_get_device(space.machine(), drive)))->unload();
+ floppy_mon_w(floppy_get_device(space.machine(), drive), ASSERT_LINE);
}
}
}
@@ -1001,14 +1001,14 @@ static WRITE16_HANDLER( x68k_fdc_w )
case 0x03:
state->m_fdc.media_density[data & 0x03] = data & 0x10;
state->m_fdc.motor[data & 0x03] = data & 0x80;
- floppy_mon_w(floppy_get_device(space->machine(), data & 0x03), !BIT(data, 7));
+ floppy_mon_w(floppy_get_device(space.machine(), data & 0x03), !BIT(data, 7));
if(data & 0x80)
{
for(drive=0;drive<4;drive++) // enable motor for this drive
{
if(drive == (data & 0x03))
{
- floppy_mon_w(floppy_get_device(space->machine(), drive), CLEAR_LINE);
+ floppy_mon_w(floppy_get_device(space.machine(), drive), CLEAR_LINE);
output_set_indexed_value("access_drv",drive,0);
}
else
@@ -1019,14 +1019,14 @@ static WRITE16_HANDLER( x68k_fdc_w )
{
for(drive=0;drive<4;drive++)
{
- floppy_mon_w(floppy_get_device(space->machine(), drive), ASSERT_LINE);
+ floppy_mon_w(floppy_get_device(space.machine(), drive), ASSERT_LINE);
output_set_indexed_value("access_drv",drive,1);
}
}
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0),1,1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 1),1,1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 2),1,1);
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 3),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 2),1,1);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 3),1,1);
#if 0
for(drive=0;drive<4;drive++)
{
@@ -1039,24 +1039,24 @@ static WRITE16_HANDLER( x68k_fdc_w )
logerror("FDC: Drive #%i: Drive selection set to %02x\n",data & 0x03,data);
break;
default:
-// logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",space->device().safe_pc(),data,offset);
+// logerror("FDC: [%08x] Wrote %04x to invalid FDC port %04x\n",space.device().safe_pc(),data,offset);
break;
}
}
static READ16_HANDLER( x68k_fdc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
unsigned int ret;
int x;
- device_t *fdc = space->machine().device("upd72065");
+ device_t *fdc = space.machine().device("upd72065");
switch(offset)
{
case 0x00:
- return upd765_status_r(fdc, *space, 0);
+ return upd765_status_r(fdc, space, 0);
case 0x01:
- return upd765_data_r(fdc, *space, 0);
+ return upd765_data_r(fdc, space, 0);
case 0x02:
ret = 0x00;
for(x=0;x<4;x++)
@@ -1126,7 +1126,7 @@ static WRITE16_HANDLER( x68k_fm_w )
{
case 0x00:
case 0x01:
- ym2151_w(space->machine().device("ym2151"), *space, offset, data);
+ ym2151_w(space.machine().device("ym2151"), space, offset, data);
break;
}
}
@@ -1134,7 +1134,7 @@ static WRITE16_HANDLER( x68k_fm_w )
static READ16_HANDLER( x68k_fm_r )
{
if(offset == 0x01)
- return ym2151_r(space->machine().device("ym2151"), *space, 1);
+ return ym2151_r(space.machine().device("ym2151"), space, 1);
return 0xffff;
}
@@ -1172,7 +1172,7 @@ static WRITE8_DEVICE_HANDLER( x68k_ct_w )
*/
static WRITE16_HANDLER( x68k_ioc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
switch(offset)
{
case 0x00:
@@ -1205,7 +1205,7 @@ static WRITE16_HANDLER( x68k_ioc_w )
static READ16_HANDLER( x68k_ioc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
switch(offset)
{
case 0x00:
@@ -1238,7 +1238,7 @@ static READ16_HANDLER( x68k_ioc_r )
*/
static WRITE16_HANDLER( x68k_sysport_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
switch(offset)
{
case 0x00:
@@ -1255,14 +1255,14 @@ static WRITE16_HANDLER( x68k_sysport_w )
state->m_sysport.sram_writeprotect = data;
break;
default:
-// logerror("SYS: [%08x] Wrote %04x to invalid or unimplemented system port %04x\n",space->device().safe_pc(),data,offset);
+// logerror("SYS: [%08x] Wrote %04x to invalid or unimplemented system port %04x\n",space.device().safe_pc(),data,offset);
break;
}
}
static READ16_HANDLER( x68k_sysport_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
int ret = 0;
switch(offset)
{
@@ -1284,7 +1284,7 @@ static READ16_HANDLER( x68k_sysport_r )
#ifdef UNUSED_FUNCTION
static READ16_HANDLER( x68k_mfp_r )
{
- device_t *x68k_mfp = space->machine().device(MC68901_TAG);
+ device_t *x68k_mfp = space.machine().device(MC68901_TAG);
return mc68901_register_r(x68k_mfp, offset);
}
@@ -1292,11 +1292,11 @@ static READ16_HANDLER( x68k_mfp_r )
static READ16_HANDLER( x68k_mfp_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
// Initial settings indicate that IRQs are generated for FM (YM2151), Receive buffer error or full,
// MFP Timer C, and the power switch
-// logerror("MFP: [%08x] Reading offset %i\n",space->device().safe_pc(),offset);
+// logerror("MFP: [%08x] Reading offset %i\n",space.device().safe_pc(),offset);
switch(offset)
{
#if 0
@@ -1310,7 +1310,7 @@ static READ16_HANDLER( x68k_mfp_r )
// ret |= 0x08; // FM IRQ signal
if(machine.primary_screen->hpos() > state->m_crtc.width - 32)
ret |= 0x80; // Hsync signal
-// logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",space->device().safe_pc(),offset,ret);
+// logerror("MFP: [%08x] Reading offset %i (ret=%02x)\n",space.device().safe_pc(),offset,ret);
return ret; // bit 5 is always 1
case 3:
return state->m_mfp.iera;
@@ -1350,14 +1350,14 @@ static READ16_HANDLER( x68k_mfp_r )
case 23:
return x68k_keyboard_pop_scancode(state);
default:
- if (ACCESSING_BITS_0_7) return state->m_mfpdev->read(*space, offset);
+ if (ACCESSING_BITS_0_7) return state->m_mfpdev->read(space, offset);
}
return 0xffff;
}
static WRITE16_HANDLER( x68k_mfp_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* For the Interrupt registers, the bits are set out as such:
Reg A - bit 7: GPIP7 (HSync)
@@ -1477,11 +1477,11 @@ static WRITE16_HANDLER( x68k_mfp_w )
// Keyboard control command.
state->m_mfp.usart.send_buffer = data;
x68k_keyboard_ctrl_w(state, data);
-// logerror("MFP: [%08x] USART Sent data %04x\n",space->device().safe_pc(),data);
+// logerror("MFP: [%08x] USART Sent data %04x\n",space.device().safe_pc(),data);
}
break;
default:
- if (ACCESSING_BITS_0_7) state->m_mfpdev->write(*space, offset, data & 0xff);
+ if (ACCESSING_BITS_0_7) state->m_mfpdev->write(space, offset, data & 0xff);
return;
}
}
@@ -1489,28 +1489,28 @@ static WRITE16_HANDLER( x68k_mfp_w )
static WRITE16_HANDLER( x68k_ppi_w )
{
- i8255_device *ppi = space->machine().device<i8255_device>("ppi8255");
- ppi->write(*space,offset & 0x03,data);
+ i8255_device *ppi = space.machine().device<i8255_device>("ppi8255");
+ ppi->write(space,offset & 0x03,data);
}
static READ16_HANDLER( x68k_ppi_r )
{
- i8255_device *ppi = space->machine().device<i8255_device>("ppi8255");
- return ppi->read(*space,offset & 0x03);
+ i8255_device *ppi = space.machine().device<i8255_device>("ppi8255");
+ return ppi->read(space,offset & 0x03);
}
static READ16_HANDLER( x68k_rtc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
- return state->m_rtc->read(*space, offset);
+ return state->m_rtc->read(space, offset);
}
static WRITE16_HANDLER( x68k_rtc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
- state->m_rtc->write(*space, offset, data);
+ state->m_rtc->write(space, offset, data);
}
static WRITE_LINE_DEVICE_HANDLER( x68k_rtc_alarm_irq )
@@ -1540,7 +1540,7 @@ static WRITE_LINE_DEVICE_HANDLER( x68k_rtc_alarm_irq )
static WRITE16_HANDLER( x68k_sram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(state->m_sysport.sram_writeprotect == 0x31)
{
@@ -1550,12 +1550,12 @@ static WRITE16_HANDLER( x68k_sram_w )
static READ16_HANDLER( x68k_sram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
// HACKS!
// if(offset == 0x5a/2) // 0x5a should be 0 if no SASI HDs are present.
// return 0x0000;
if(offset == 0x08/2)
- return space->machine().device<ram_device>(RAM_TAG)->size() >> 16; // RAM size
+ return space.machine().device<ram_device>(RAM_TAG)->size() >> 16; // RAM size
#if 0
if(offset == 0x46/2)
return 0x0024;
@@ -1569,9 +1569,9 @@ static READ16_HANDLER( x68k_sram_r )
static READ32_HANDLER( x68k_sram32_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(offset == 0x08/4)
- return (space->machine().device<ram_device>(RAM_TAG)->size() & 0xffff0000); // RAM size
+ return (space.machine().device<ram_device>(RAM_TAG)->size() & 0xffff0000); // RAM size
#if 0
if(offset == 0x46/2)
return 0x0024;
@@ -1585,7 +1585,7 @@ static READ32_HANDLER( x68k_sram32_r )
static WRITE32_HANDLER( x68k_sram32_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(state->m_sysport.sram_writeprotect == 0x31)
{
COMBINE_DATA(state->m_nvram32 + offset);
@@ -1594,13 +1594,13 @@ static WRITE32_HANDLER( x68k_sram32_w )
static WRITE16_HANDLER( x68k_vid_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
int val;
if(offset < 0x100) // Graphic layer palette
{
COMBINE_DATA(state->m_video.gfx_pal+offset);
val = state->m_video.gfx_pal[offset];
- palette_set_color_rgb(space->machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
+ palette_set_color_rgb(space.machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
return;
}
@@ -1608,7 +1608,7 @@ static WRITE16_HANDLER( x68k_vid_w )
{
COMBINE_DATA(state->m_video.text_pal+(offset-0x100));
val = state->m_video.text_pal[offset-0x100];
- palette_set_color_rgb(space->machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
+ palette_set_color_rgb(space.machine(),offset,(val & 0x07c0) >> 3,(val & 0xf800) >> 8,(val & 0x003e) << 2);
return;
}
@@ -1649,7 +1649,7 @@ static WRITE16_HANDLER( x68k_vid_w )
static READ16_HANDLER( x68k_vid_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(offset < 0x100)
return state->m_video.gfx_pal[offset];
@@ -1709,77 +1709,77 @@ static TIMER_CALLBACK(x68k_bus_error)
static READ16_HANDLER( x68k_rom0_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location contains the address of some expansion device ROM, if no ROM exists,
then access causes a bus error */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
}
return 0xff;
}
static WRITE16_HANDLER( x68k_rom0_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location contains the address of some expansion device ROM, if no ROM exists,
then access causes a bus error */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), 0xbffffc+offset);
}
}
static READ16_HANDLER( x68k_emptyram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location is unused RAM, access here causes a bus error
Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
}
return 0xff;
}
static WRITE16_HANDLER( x68k_emptyram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* this location is unused RAM, access here causes a bus error
Often a method for detecting amount of installed RAM, is to read or write at 1MB intervals, until a bus error occurs */
state->m_current_vector[2] = 0x02; // bus error
state->m_current_irq_line = 2;
-// space->machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
+// space.machine().device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
if(state->ioport("options")->read() & 0x02)
{
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(4), FUNC(x68k_bus_error), offset);
}
}
static READ16_HANDLER( x68k_exp_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* These are expansion devices, if not present, they cause a bus error */
if(state->ioport("options")->read() & 0x02)
{
@@ -1788,7 +1788,7 @@ static READ16_HANDLER( x68k_exp_r )
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
// machine.device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
}
return 0xffff;
@@ -1796,7 +1796,7 @@ static READ16_HANDLER( x68k_exp_r )
static WRITE16_HANDLER( x68k_exp_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
/* These are expansion devices, if not present, they cause a bus error */
if(state->ioport("options")->read() & 0x02)
{
@@ -1805,7 +1805,7 @@ static WRITE16_HANDLER( x68k_exp_w )
offset *= 2;
if(ACCESSING_BITS_0_7)
offset++;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(16), FUNC(x68k_bus_error), 0xeafa00+offset);
// machine.device("maincpu")->execute().set_input_line_and_vector(2,ASSERT_LINE,state->m_current_vector[2]);
}
}
@@ -2622,21 +2622,21 @@ MACHINE_RESET_MEMBER(x68k_state,x68000)
MACHINE_START_MEMBER(x68k_state,x68000)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Install RAM handlers */
m_spriteram = (UINT16*)(*memregion("user1"));
- space->install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_r));
- space->install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_w));
- space->install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
+ space.install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_r));
+ space.install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_emptyram_w));
+ space.install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
- space->install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_r));
- space->install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_w));
+ space.install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_r));
+ space.install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram_w));
membank("bank2")->set_base(m_gvram16); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_r));
- space->install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_w));
+ space.install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_r));
+ space.install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram_w));
membank("bank3")->set_base(m_tvram16); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_r));
- space->install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_w));
+ space.install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_r));
+ space.install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram_w));
membank("bank4")->set_base(m_nvram16); // so that code in SRAM is executable, there is an option for booting from SRAM
// start keyboard timer
@@ -2652,21 +2652,21 @@ MACHINE_START_MEMBER(x68k_state,x68000)
MACHINE_START_MEMBER(x68k_state,x68030)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Install RAM handlers */
m_spriteram = (UINT16*)(*memregion("user1"));
- space->install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_r),0xffffffff);
- space->install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_w),0xffffffff);
- space->install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
+ space.install_legacy_read_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_r),0xffffffff);
+ space.install_legacy_write_handler(0x000000,0xbffffb,0xffffffff,0,FUNC(x68k_rom0_w),0xffffffff);
+ space.install_readwrite_bank(0x000000,machine().device<ram_device>(RAM_TAG)->size()-1,0xffffffff,0,"bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
- space->install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_r));
- space->install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_w));
+ space.install_legacy_read_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_r));
+ space.install_legacy_write_handler(0xc00000,0xdfffff,0xffffffff,0,FUNC(x68k_gvram32_w));
membank("bank2")->set_base(m_gvram32); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_r));
- space->install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_w));
+ space.install_legacy_read_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_r));
+ space.install_legacy_write_handler(0xe00000,0xe7ffff,0xffffffff,0,FUNC(x68k_tvram32_w));
membank("bank3")->set_base(m_tvram32); // so that code in VRAM is executable - needed for Terra Cresta
- space->install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_r));
- space->install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_w));
+ space.install_legacy_read_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_r));
+ space.install_legacy_write_handler(0xed0000,0xed3fff,0xffffffff,0,FUNC(x68k_sram32_w));
membank("bank4")->set_base(m_nvram32); // so that code in SRAM is executable, there is an option for booting from SRAM
// start keyboard timer
diff --git a/src/mess/formats/ace_ace.c b/src/mess/formats/ace_ace.c
index 50270920112..e89e680f5cb 100644
--- a/src/mess/formats/ace_ace.c
+++ b/src/mess/formats/ace_ace.c
@@ -27,7 +27,7 @@ SNAPSHOT_LOAD( ace )
{
cpu_device *cpu = image.device().machine().firstcpu;
UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base();
- address_space *space = cpu->space(AS_PROGRAM);
+ address_space &space = *cpu->space(AS_PROGRAM);
unsigned char ace_repeat, ace_byte, loop;
int done=0, ace_index=0x2000;
@@ -108,7 +108,7 @@ SNAPSHOT_LOAD( ace )
/* Copy data to the address space */
for (ace_index = 0x2000; ace_index < 0x8000; ace_index++)
- space->write_byte(ace_index, RAM[ace_index]);
+ space.write_byte(ace_index, RAM[ace_index]);
return IMAGE_INIT_PASS;
}
diff --git a/src/mess/formats/cbm_snqk.c b/src/mess/formats/cbm_snqk.c
index 76ad3cfe76c..a71d52ce45a 100644
--- a/src/mess/formats/cbm_snqk.c
+++ b/src/mess/formats/cbm_snqk.c
@@ -30,7 +30,7 @@ static int general_cbm_loadsnap( device_image_interface &image, const char *file
UINT32 bytesread;
UINT16 address = 0;
int i;
- address_space *space = image.device().machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *image.device().machine().firstcpu->space(AS_PROGRAM);
if (!file_type)
goto error;
@@ -79,7 +79,7 @@ static int general_cbm_loadsnap( device_image_interface &image, const char *file
goto error;
for (i = 0; i < snapshot_size; i++)
- space->write_byte(address + i + offset, data[i]);
+ space.write_byte(address + i + offset, data[i]);
cbm_sethiaddress(image.device().machine(), address + snapshot_size);
free(data);
@@ -93,14 +93,14 @@ error:
static void cbm_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
-
- space->write_byte(0x31, hiaddress & 0xff);
- space->write_byte(0x2f, hiaddress & 0xff);
- space->write_byte(0x2d, hiaddress & 0xff);
- space->write_byte(0x32, hiaddress >> 8);
- space->write_byte(0x30, hiaddress >> 8);
- space->write_byte(0x2e, hiaddress >> 8);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
+
+ space.write_byte(0x31, hiaddress & 0xff);
+ space.write_byte(0x2f, hiaddress & 0xff);
+ space.write_byte(0x2d, hiaddress & 0xff);
+ space.write_byte(0x32, hiaddress >> 8);
+ space.write_byte(0x30, hiaddress >> 8);
+ space.write_byte(0x2e, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_c16 )
@@ -120,14 +120,14 @@ QUICKLOAD_LOAD( cbm_vc20 )
static void cbm_pet_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
-
- space->write_byte(0x2e, hiaddress & 0xff);
- space->write_byte(0x2c, hiaddress & 0xff);
- space->write_byte(0x2a, hiaddress & 0xff);
- space->write_byte(0x2f, hiaddress >> 8);
- space->write_byte(0x2d, hiaddress >> 8);
- space->write_byte(0x2b, hiaddress >> 8);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
+
+ space.write_byte(0x2e, hiaddress & 0xff);
+ space.write_byte(0x2c, hiaddress & 0xff);
+ space.write_byte(0x2a, hiaddress & 0xff);
+ space.write_byte(0x2f, hiaddress >> 8);
+ space.write_byte(0x2d, hiaddress >> 8);
+ space.write_byte(0x2b, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_pet )
@@ -137,14 +137,14 @@ QUICKLOAD_LOAD( cbm_pet )
static void cbm_pet1_quick_sethiaddress(running_machine &machine, UINT16 hiaddress)
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
-
- space->write_byte(0x80, hiaddress & 0xff);
- space->write_byte(0x7e, hiaddress & 0xff);
- space->write_byte(0x7c, hiaddress & 0xff);
- space->write_byte(0x81, hiaddress >> 8);
- space->write_byte(0x7f, hiaddress >> 8);
- space->write_byte(0x7d, hiaddress >> 8);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
+
+ space.write_byte(0x80, hiaddress & 0xff);
+ space.write_byte(0x7e, hiaddress & 0xff);
+ space.write_byte(0x7c, hiaddress & 0xff);
+ space.write_byte(0x81, hiaddress >> 8);
+ space.write_byte(0x7f, hiaddress >> 8);
+ space.write_byte(0x7d, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_pet1 )
@@ -154,10 +154,10 @@ QUICKLOAD_LOAD( cbm_pet1 )
static void cbmb_quick_sethiaddress(running_machine &machine, UINT16 hiaddress)
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
- space->write_byte(0xf0046, hiaddress & 0xff);
- space->write_byte(0xf0047, hiaddress >> 8);
+ space.write_byte(0xf0046, hiaddress & 0xff);
+ space.write_byte(0xf0047, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbmb )
@@ -172,10 +172,10 @@ QUICKLOAD_LOAD( p500 )
static void cbm_c65_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
- space->write_byte(0x82, hiaddress & 0xff);
- space->write_byte(0x83, hiaddress >> 8);
+ space.write_byte(0x82, hiaddress & 0xff);
+ space.write_byte(0x83, hiaddress >> 8);
}
QUICKLOAD_LOAD( cbm_c65 )
diff --git a/src/mess/formats/m65_snqk.c b/src/mess/formats/m65_snqk.c
index 8c2dcac0cd4..7103ec24a70 100644
--- a/src/mess/formats/m65_snqk.c
+++ b/src/mess/formats/m65_snqk.c
@@ -219,7 +219,7 @@ static void microtan_snapshot_copy(running_machine &machine, UINT8 *snapshot_buf
{
microtan_state *state = machine.driver_data<microtan_state>();
UINT8 *RAM = state->memregion("maincpu")->base();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
via6522_device *via_1 = machine.device<via6522_device>("via6522_1");
device_t *ay8910 = machine.device("ay8910.1");
@@ -278,21 +278,21 @@ static void microtan_snapshot_copy(running_machine &machine, UINT8 *snapshot_buf
/* first set of VIA6522 registers */
for (i = 0; i < 16; i++ )
- via_0->write(*space, i, snapshot_buff[base++]);
+ via_0->write(space, i, snapshot_buff[base++]);
/* second set of VIA6522 registers */
for (i = 0; i < 16; i++ )
- via_1->write(*space, i, snapshot_buff[base++]);
+ via_1->write(space, i, snapshot_buff[base++]);
/* microtan IO bff0-bfff */
for (i = 0; i < 16; i++ )
{
RAM[0xbff0+i] = snapshot_buff[base++];
if (i < 4)
- state->microtan_bffx_w(*space, i, RAM[0xbff0+i]);
+ state->microtan_bffx_w(space, i, RAM[0xbff0+i]);
}
- state->microtan_sound_w(*space, 0, snapshot_buff[base++]);
+ state->microtan_sound_w(space, 0, snapshot_buff[base++]);
state->m_chunky_graphics = snapshot_buff[base++];
/* first set of AY8910 registers */
diff --git a/src/mess/formats/spec_snqk.c b/src/mess/formats/spec_snqk.c
index a80f10eb866..3368cfb638c 100644
--- a/src/mess/formats/spec_snqk.c
+++ b/src/mess/formats/spec_snqk.c
@@ -320,7 +320,7 @@ void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
UINT16 start, size, data, status;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (snapsize == SP_NEW_SIZE_16K || snapsize == SP_NEW_SIZE_48K)
{
@@ -415,7 +415,7 @@ void spectrum_setup_sp(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", size, start);
for (i = 0; i < size; i++)
- space->write_byte(start + i, snapdata[SP_OFFSET + SP_NEW_HDR + i]);
+ space.write_byte(start + i, snapdata[SP_OFFSET + SP_NEW_HDR + i]);
/* Set border color */
data = snapdata[SP_OFFSET + 34] & 0x07;
@@ -520,7 +520,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data, addr;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if ((snapsize != SNA48_SIZE) && (state->m_port_7ffd_data == -1))
{
@@ -606,7 +606,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
/* Get PC from stack */
addr = cpu->state().state_int(Z80_SP);
@@ -616,12 +616,12 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
else
logerror("Fetching PC from the stack at SP:%04X\n", addr);
- data = (space->read_byte(addr + 1) << 8) | space->read_byte(addr + 0);
+ data = (space.read_byte(addr + 1) << 8) | space.read_byte(addr + 0);
LOAD_REG(cpu, Z80_PC, data);
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
#endif
addr += 2;
@@ -651,7 +651,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
logerror("Loading bank 2 from offset:0401B\n");
logerror("Loading bank %d from offset:0801B\n", snapdata[SNA128_OFFSET + 2] & 0x07);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SNA48_HDR + i]);
bank_offset = SNA48_SIZE + SNA128_HDR;
for (i = 0; i < 8; i++)
@@ -663,7 +663,7 @@ void spectrum_setup_sna(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
state->m_port_7ffd_data += i;
spectrum_update_paging(machine);
for (j = 0; j < SPECTRUM_BANK; j++)
- space->write_byte(j + 3*SPECTRUM_BANK, snapdata[bank_offset + j]);
+ space.write_byte(j + 3*SPECTRUM_BANK, snapdata[bank_offset + j]);
bank_offset += SPECTRUM_BANK;
}
}
@@ -739,7 +739,7 @@ void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[ACH_OFFSET + 0] << 8) | snapdata[ACH_OFFSET + 4];
LOAD_REG(cpu, Z80_AF, data);
@@ -804,7 +804,7 @@ void spectrum_setup_ach(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[ACH_HDR + SPECTRUM_BANK + i]);
+ space.write_byte(BASE_RAM + i, snapdata[ACH_HDR + SPECTRUM_BANK + i]);
/* Set border color */
data = snapdata[ACH_OFFSET + 156] & 0x07;
@@ -872,7 +872,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 addr, data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = snapdata[PRG_OFFSET + 0];
if (data != 0x05)
@@ -915,7 +915,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[PRG_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[PRG_HDR + i]);
addr = (snapdata[PRG_OFFSET + 241] << 8) | snapdata[PRG_OFFSET + 240];
if (addr < BASE_RAM || addr > 4*SPECTRUM_BANK - 6)
@@ -923,7 +923,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
else
logerror("Fetching registers IFF1/2, R, AF and PC from the stack at SP:%04X\n", addr);
- data = space->read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
+ data = space.read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
LOAD_REG(cpu, Z80_IFF1, BIT(data, 2));
LOAD_REG(cpu, Z80_IFF2, BIT(data, 2));
@@ -931,22 +931,22 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr);
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
- data = space->read_byte(addr + 1);
+ data = space.read_byte(addr + 1);
LOAD_REG(cpu, Z80_R, data);
- data = (space->read_byte(addr + 3) << 8) | space->read_byte(addr + 2);
+ data = (space.read_byte(addr + 3) << 8) | space.read_byte(addr + 2);
LOAD_REG(cpu, Z80_AF, data);
- data = (space->read_byte(addr + 5) << 8) | space->read_byte(addr + 4);
+ data = (space.read_byte(addr + 5) << 8) | space.read_byte(addr + 4);
LOAD_REG(cpu, Z80_PC, data);
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
- space->write_byte(addr + 2, 0);
- space->write_byte(addr + 3, 0);
- space->write_byte(addr + 4, 0);
- space->write_byte(addr + 5, 0);
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 2, 0);
+ space.write_byte(addr + 3, 0);
+ space.write_byte(addr + 4, 0);
+ space.write_byte(addr + 5, 0);
#endif
addr += 6;
@@ -954,7 +954,7 @@ void spectrum_setup_prg(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
cpu->state().set_state_int(Z80_SP, addr);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1042,7 +1042,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
UINT16 addr = 0, data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[PLUSD_OFFSET + 15] << 8) | snapdata[PLUSD_OFFSET + 14];
LOAD_REG(cpu, Z80_BC, data);
@@ -1085,7 +1085,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[PLUSD48_HDR + i]);
+ space.write_byte(BASE_RAM + i, snapdata[PLUSD48_HDR + i]);
}
else
{
@@ -1111,7 +1111,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
};
logerror("Loading bank %d from offset:%05X\n", i, PLUSD128_HDR + i*SPECTRUM_BANK);
for (j = 0; j < SPECTRUM_BANK; j++)
- space->write_byte(j + addr, snapdata[j + PLUSD128_HDR + i*SPECTRUM_BANK]);
+ space.write_byte(j + addr, snapdata[j + PLUSD128_HDR + i*SPECTRUM_BANK]);
}
state->m_port_7ffd_data = snapdata[PLUSD_OFFSET + 22];
logerror ("Port 7FFD:%02X\n", state->m_port_7ffd_data);
@@ -1125,7 +1125,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
else
logerror("Fetching registers IFF1/2, R, AF and PC from the stack at SP:%04X\n", addr);
- data = space->read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
+ data = space.read_byte(addr + 0); // IFF1/2: (bit 2, 0=DI/1=EI)
LOAD_REG(cpu, Z80_IFF1, BIT(data, 2));
LOAD_REG(cpu, Z80_IFF2, BIT(data, 2));
@@ -1133,22 +1133,22 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_IRQ0, intr);
machine.device("maincpu")->execute().set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
- data = space->read_byte(addr + 1);
+ data = space.read_byte(addr + 1);
LOAD_REG(cpu, Z80_R, data);
- data = (space->read_byte(addr + 3) << 8) | space->read_byte(addr + 2);
+ data = (space.read_byte(addr + 3) << 8) | space.read_byte(addr + 2);
LOAD_REG(cpu, Z80_AF, data);
- data = (space->read_byte(addr + 5) << 8) | space->read_byte(addr + 4);
+ data = (space.read_byte(addr + 5) << 8) | space.read_byte(addr + 4);
LOAD_REG(cpu, Z80_PC, data);
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
- space->write_byte(addr + 2, 0);
- space->write_byte(addr + 3, 0);
- space->write_byte(addr + 4, 0);
- space->write_byte(addr + 5, 0);
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 2, 0);
+ space.write_byte(addr + 3, 0);
+ space.write_byte(addr + 4, 0);
+ space.write_byte(addr + 5, 0);
#endif
addr += 6;
@@ -1156,7 +1156,7 @@ void spectrum_setup_plusd(running_machine &machine, UINT8 *snapdata, UINT32 snap
cpu->state().set_state_int(Z80_SP, addr);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1210,7 +1210,7 @@ void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SEM_OFFSET + 1] << 8) | snapdata[SEM_OFFSET + 0];
LOAD_REG(cpu, Z80_AF, data);
@@ -1273,10 +1273,10 @@ void spectrum_setup_sem(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SEM_SIGNATURE + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SEM_SIGNATURE + i]);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1329,7 +1329,7 @@ void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SIT_OFFSET + 7] << 8) | snapdata[SIT_OFFSET + 6];
LOAD_REG(cpu, Z80_AF, data);
@@ -1392,7 +1392,7 @@ void spectrum_setup_sit(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
logerror("Skipping the 16K ROM dump at offset:%04X\n", SIT_OFFSET + 28);
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[SIT_HDR + SPECTRUM_BANK + i]);
+ space.write_byte(BASE_RAM + i, snapdata[SIT_HDR + SPECTRUM_BANK + i]);
/* Set border color */
data = snapdata[SIT_OFFSET + 27] & 0x07;
@@ -1459,7 +1459,7 @@ void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
UINT16 data, mode;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
logerror("Skipping last 132 bytes of the 16K ROM dump at offset:0000\n");
@@ -1536,10 +1536,10 @@ void spectrum_setup_zx(running_machine &machine, UINT8 *snapdata, UINT32 snapsiz
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[132 + i]);
+ space.write_byte(BASE_RAM + i, snapdata[132 + i]);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -1591,7 +1591,7 @@ void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SNP_OFFSET + 1] << 8) | snapdata[SNP_OFFSET + 0];
LOAD_REG(cpu, Z80_AF, data);
@@ -1654,7 +1654,7 @@ void spectrum_setup_snp(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* Memory dump */
logerror("Loading %04X bytes of RAM at %04X\n", 3*SPECTRUM_BANK, BASE_RAM);
for (i = 0; i < 3*SPECTRUM_BANK; i++)
- space->write_byte(BASE_RAM + i, snapdata[i]);
+ space.write_byte(BASE_RAM + i, snapdata[i]);
/* Set border color */
data = snapdata[SNP_OFFSET + 2] & 0x07;
@@ -1768,7 +1768,7 @@ static void spectrum_snx_decompress_block(running_machine &machine, UINT8 *sourc
{
UINT8 counthi, countlo, compress, fill;
UINT16 block = 0, count, i, j, numbytes;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
i = SNX_HDR - 1;
numbytes = 0;
@@ -1798,7 +1798,7 @@ static void spectrum_snx_decompress_block(running_machine &machine, UINT8 *sourc
fill = source[++i];
logerror("Dest:%04X Filler:%02X\n", BASE_RAM + numbytes, fill);
for(j = 0; j < count; j++)
- space->write_byte(BASE_RAM + numbytes + j, fill);
+ space.write_byte(BASE_RAM + numbytes + j, fill);
numbytes += count;
}
else
@@ -1806,7 +1806,7 @@ static void spectrum_snx_decompress_block(running_machine &machine, UINT8 *sourc
logerror("Dest:%04X\n", BASE_RAM + numbytes);
j = 0;
while (j < count)
- space->write_byte(BASE_RAM + numbytes + j++, source[++i]);
+ space.write_byte(BASE_RAM + numbytes + j++, source[++i]);
numbytes += count;
}
}
@@ -1818,7 +1818,7 @@ void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 data, addr;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
data = (snapdata[SNX_OFFSET + 4] << 8) | snapdata[SNX_OFFSET + 5];
if (data != 0x25)
@@ -1893,11 +1893,11 @@ void spectrum_setup_snx(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
else
logerror("Fetching PC from the stack at SP:%04X\n", addr);
- LOAD_REG(cpu, Z80_PC, (space->read_byte(addr + 1) << 8) | space->read_byte(addr + 0));
+ LOAD_REG(cpu, Z80_PC, (space.read_byte(addr + 1) << 8) | space.read_byte(addr + 0));
#if 0
- space->write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
- space->write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
+ space.write_byte(addr + 0, 0); // It's been reported that zeroing these locations fixes the loading
+ space.write_byte(addr + 1, 0); // of a few images that were snapshot at a "wrong" instant
#endif
addr += 2;
@@ -1972,7 +1972,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
UINT16 addr, data;
spectrum_state *state = machine.driver_data<spectrum_state>();
device_t *cpu = machine.device("maincpu");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_port_7ffd_data == -1)
{
@@ -2063,7 +2063,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
};
logerror("Loading bank %d from offset:%05X\n", banks[i], FRZ_HDR + i*SPECTRUM_BANK);
for (j = 0; j < SPECTRUM_BANK; j++)
- space->write_byte(j + addr, snapdata[j + FRZ_HDR + i*SPECTRUM_BANK]);
+ space.write_byte(j + addr, snapdata[j + FRZ_HDR + i*SPECTRUM_BANK]);
}
state->m_port_7ffd_data = snapdata[FRZ_OFFSET + 1];
logerror ("Port 7FFD:%02X\n", state->m_port_7ffd_data);
@@ -2071,7 +2071,7 @@ void spectrum_setup_frz(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
spectrum_update_paging(machine);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
@@ -2083,7 +2083,7 @@ static void spectrum_z80_decompress_block(running_machine &machine,UINT8 *source
{
UINT8 ch;
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
do
{
@@ -2115,14 +2115,14 @@ static void spectrum_z80_decompress_block(running_machine &machine,UINT8 *source
for (i = 0; i < count; i++)
{
- space->write_byte(dest, data);
+ space.write_byte(dest, data);
dest++;
}
}
else
{
/* single 0x0ed */
- space->write_byte(dest, ch);
+ space.write_byte(dest, ch);
dest++;
source++;
size--;
@@ -2131,7 +2131,7 @@ static void spectrum_z80_decompress_block(running_machine &machine,UINT8 *source
else
{
/* not 0x0ed */
- space->write_byte(dest, ch);
+ space.write_byte(dest, ch);
dest++;
source++;
size--;
@@ -2194,7 +2194,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
int i;
UINT8 lo, hi, data;
SPECTRUM_Z80_SNAPSHOT_TYPE z80_type;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
z80_type = spectrum_identify_z80(snapdata, snapsize);
@@ -2331,7 +2331,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
{
logerror("Not compressed\n"); /* not compressed */
for (i = 0; i < 49152; i++)
- space->write_byte(i + 16384, snapdata[30 + i]);
+ space.write_byte(i + 16384, snapdata[30 + i]);
}
else
{
@@ -2412,7 +2412,7 @@ void spectrum_setup_z80(running_machine &machine, UINT8 *snapdata, UINT32 snapsi
/* not compressed */
for (i = 0; i < 16384; i++)
- space->write_byte(i + Dest, pSource[i]);
+ space.write_byte(i + Dest, pSource[i]);
}
else
{
@@ -2520,10 +2520,10 @@ error:
void spectrum_setup_scr(running_machine &machine, UINT8 *quickdata, UINT32 quicksize)
{
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
for (i = 0; i < quicksize; i++)
- space->write_byte(i + BASE_RAM, quickdata[i]);
+ space.write_byte(i + BASE_RAM, quickdata[i]);
log_quickload(quicksize == SCR_SIZE ? "SCREEN$" : "SCREEN$ (Mono)", BASE_RAM, quicksize, 0, EXEC_NA);
}
@@ -2560,16 +2560,16 @@ void spectrum_setup_raw(running_machine &machine, UINT8 *quickdata, UINT32 quick
UINT8 data;
UINT16 start, len;
spectrum_state *state = machine.driver_data<spectrum_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
start = (quickdata[RAW_OFFSET + 4] << 8) | quickdata[RAW_OFFSET + 3];
len = (quickdata[RAW_OFFSET + 2] << 8) | quickdata[RAW_OFFSET + 1];
for (i = 0; i < len; i++)
- space->write_byte(i + start, quickdata[i + RAW_HDR]);
+ space.write_byte(i + start, quickdata[i + RAW_HDR]);
/* Set border color */
- data = (space->read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
+ data = (space.read_byte(0x5c48) >> 3) & 0x07; // Get the current border color from BORDCR system variable.
state->m_port_fe_data = (state->m_port_fe_data & 0xf8) | data;
spectrum_border_update(machine, data);
logerror("Border color:%02X\n", data);
diff --git a/src/mess/formats/z80bin.c b/src/mess/formats/z80bin.c
index 363fdaad98d..bbce778f05b 100644
--- a/src/mess/formats/z80bin.c
+++ b/src/mess/formats/z80bin.c
@@ -122,18 +122,18 @@ QUICKLOAD_LOAD( mbee_z80bin )
autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
device_t *cpu = image.device().machine().device("maincpu");
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->write_word(0xa6, execute_address); /* fix the EXEC command */
+ space.write_word(0xa6, execute_address); /* fix the EXEC command */
if (autorun)
{
- space->write_word(0xa2, execute_address); /* fix warm-start vector to get around some copy-protections */
+ space.write_word(0xa2, execute_address); /* fix warm-start vector to get around some copy-protections */
cpu->state().set_pc(execute_address);
}
else
{
- space->write_word(0xa2, 0x8517);
+ space.write_word(0xa2, 0x8517);
}
}
@@ -158,9 +158,9 @@ QUICKLOAD_LOAD( sorcerer )
/* check to see if autorun is on (I hate how this works) */
autorun = image.device().machine().root_device().ioport("CONFIG")->read_safe(0xFF) & 1;
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
- if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (space->read_byte(0xdffa) != 0xc3))
+ if ((execute_address >= 0xc000) && (execute_address <= 0xdfff) && (space.read_byte(0xdffa) != 0xc3))
return IMAGE_INIT_FAIL; /* can't run a program if the cartridge isn't in */
/* Since Exidy Basic is by Microsoft, it needs some preprocessing before it can be run.
@@ -182,17 +182,17 @@ QUICKLOAD_LOAD( sorcerer )
};
for (i = 0; i < ARRAY_LENGTH(data); i++)
- space->write_byte(0xf01f + i, data[i]);
+ space.write_byte(0xf01f + i, data[i]);
if (!autorun)
- space->write_word(0xf028,0xc3dd);
+ space.write_word(0xf028,0xc3dd);
/* tell BASIC where program ends */
- space->write_byte(0x1b7, end_address & 0xff);
- space->write_byte(0x1b8, (end_address >> 8) & 0xff);
+ space.write_byte(0x1b7, end_address & 0xff);
+ space.write_byte(0x1b8, (end_address >> 8) & 0xff);
if ((execute_address != 0xc858) && autorun)
- space->write_word(0xf028, execute_address);
+ space.write_word(0xf028, execute_address);
image.device().machine().device("maincpu")->state().set_pc(0xf01f);
}
diff --git a/src/mess/includes/samcoupe.h b/src/mess/includes/samcoupe.h
index 9954ee10b01..1992772f7f5 100644
--- a/src/mess/includes/samcoupe.h
+++ b/src/mess/includes/samcoupe.h
@@ -92,7 +92,7 @@ void samcoupe_irq(device_t *device, UINT8 src);
/*----------- defined in machine/samcoupe.c -----------*/
-void samcoupe_update_memory(address_space *space);
+void samcoupe_update_memory(address_space &space);
UINT8 samcoupe_mouse_r(running_machine &machine);
diff --git a/src/mess/machine/990_hd.c b/src/mess/machine/990_hd.c
index 495829c28d0..2afbe6c0977 100644
--- a/src/mess/machine/990_hd.c
+++ b/src/mess/machine/990_hd.c
@@ -1025,11 +1025,11 @@ WRITE16_HANDLER(ti990_hdc_w)
hdc.w[offset] = (hdc.w[offset] & ((~w_mask[offset]) | mem_mask)) | (data & w_mask[offset] & ~mem_mask);
if ((offset == 0) || (offset == 7))
- update_interrupt(space->machine());
+ update_interrupt(space.machine());
if ((offset == 7) && (old_data & w7_idle) && ! (data & w7_idle))
{ /* idle has been cleared: start command execution */
- execute_command(space->machine());
+ execute_command(space.machine());
}
}
}
diff --git a/src/mess/machine/a7800.c b/src/mess/machine/a7800.c
index 0263a1bdf5f..3f34c96d9be 100644
--- a/src/mess/machine/a7800.c
+++ b/src/mess/machine/a7800.c
@@ -72,7 +72,7 @@ const riot6532_interface a7800_r6532_interface =
static void a7800_driver_init(running_machine &machine, int ispal, int lines)
{
a7800_state *state = machine.driver_data<a7800_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
state->m_ROM = state->memregion("maincpu")->base();
state->m_ispal = ispal;
state->m_lines = lines;
@@ -85,9 +85,9 @@ static void a7800_driver_init(running_machine &machine, int ispal, int lines)
state->membank("bank7")->set_base(&state->m_ROM[0x2000]); /* MAINRAM */
/* Brutal hack put in as a consequence of new memory system; fix this */
- space->install_readwrite_bank(0x0480, 0x04FF,"bank10");
+ space.install_readwrite_bank(0x0480, 0x04FF,"bank10");
state->membank("bank10")->set_base(state->m_ROM + 0x0480);
- space->install_readwrite_bank(0x1800, 0x27FF, "bank11");
+ space.install_readwrite_bank(0x1800, 0x27FF, "bank11");
state->membank("bank11")->set_base(state->m_ROM + 0x1800);
}
@@ -107,7 +107,7 @@ DRIVER_INIT_MEMBER(a7800_state,a7800_pal)
void a7800_state::machine_reset()
{
UINT8 *memory;
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_ctrl_lock = 0;
m_ctrl_reg = 0;
@@ -124,7 +124,7 @@ void a7800_state::machine_reset()
if (m_cart_type & 0x01)
{
pokey_device *pokey = machine().device<pokey_device>("pokey");
- space->install_readwrite_handler(0x4000, 0x7FFF, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
+ space.install_readwrite_handler(0x4000, 0x7FFF, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
}
}
diff --git a/src/mess/machine/aim65.c b/src/mess/machine/aim65.c
index 823d0c9bf41..81dd1298767 100644
--- a/src/mess/machine/aim65.c
+++ b/src/mess/machine/aim65.c
@@ -141,10 +141,10 @@ WRITE8_MEMBER( aim65_state::aim65_riot_a_w )
void aim65_state::machine_start()
{
ram_device *ram = machine().device<ram_device>(RAM_TAG);
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Init RAM */
- space->install_ram(0x0000, ram->size() - 1, ram->pointer());
+ space.install_ram(0x0000, ram->size() - 1, ram->pointer());
m_pb_save = 0;
}
diff --git a/src/mess/machine/amigacd.c b/src/mess/machine/amigacd.c
index cfdb28bbca6..071692296d0 100644
--- a/src/mess/machine/amigacd.c
+++ b/src/mess/machine/amigacd.c
@@ -82,7 +82,7 @@ static void check_interrupts( running_machine &machine )
return;
/* otherwise, generate the IRQ */
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
static TIMER_CALLBACK(dmac_dma_proc)
@@ -131,7 +131,7 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x20:
{
UINT8 v = dmac_data.istr;
- LOG(( "DMAC: PC=%08x - ISTR Read(%04x)\n", space->device().safe_pc(), dmac_data.istr ));
+ LOG(( "DMAC: PC=%08x - ISTR Read(%04x)\n", space.device().safe_pc(), dmac_data.istr ));
dmac_data.istr &= ~0x0f;
return v;
@@ -140,35 +140,35 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x21:
{
- LOG(( "DMAC: PC=%08x - CNTR Read(%04x)\n", space->device().safe_pc(), dmac_data.cntr ));
+ LOG(( "DMAC: PC=%08x - CNTR Read(%04x)\n", space.device().safe_pc(), dmac_data.cntr ));
return dmac_data.cntr;
}
break;
case 0x40: /* wtc hi */
{
- LOG(( "DMAC: PC=%08x - WTC HI Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - WTC HI Read\n", space.device().safe_pc() ));
return (dmac_data.wtc >> 16);
}
break;
case 0x41: /* wtc lo */
{
- LOG(( "DMAC: PC=%08x - WTC LO Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - WTC LO Read\n", space.device().safe_pc() ));
return dmac_data.wtc;
}
break;
case 0x42: /* acr hi */
{
- LOG(( "DMAC: PC=%08x - ACR HI Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - ACR HI Read\n", space.device().safe_pc() ));
return (dmac_data.acr >> 16);
}
break;
case 0x43: /* acr lo */
{
- LOG(( "DMAC: PC=%08x - ACR LO Read\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - ACR LO Read\n", space.device().safe_pc() ));
return dmac_data.acr;
}
break;
@@ -176,15 +176,15 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x48: /* wd33c93 SCSI expansion */
case 0x49:
{
- LOG(( "DMAC: PC=%08x - WD33C93 Read(%d)\n", space->device().safe_pc(), offset & 1 ));
+ LOG(( "DMAC: PC=%08x - WD33C93 Read(%d)\n", space.device().safe_pc(), offset & 1 ));
return 0x00; /* Not available without SCSI expansion */
}
break;
case 0x50:
{
- LOG(( "DMAC: PC=%08x - CDROM RESP Read\n", space->device().safe_pc() ));
- return matsucd_response_r(space->machine());
+ LOG(( "DMAC: PC=%08x - CDROM RESP Read\n", space.device().safe_pc() ));
+ return matsucd_response_r(space.machine());
}
break;
@@ -192,7 +192,7 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x52:
case 0x53:
{
- LOG(( "DMAC: PC=%08x - XT IO Read(%d)\n", space->device().safe_pc(), (offset & 3)-1 ));
+ LOG(( "DMAC: PC=%08x - XT IO Read(%d)\n", space.device().safe_pc(), (offset & 3)-1 ));
return 0xff;
}
break;
@@ -214,42 +214,42 @@ static READ16_HANDLER( amiga_dmac_r )
case 0x66:
case 0x67:
{
- device_t *tpi = space->machine().device("tpi6525");
- LOG(( "DMAC: PC=%08x - TPI6525 Read(%d)\n", space->device().safe_pc(), (offset - 0x58) ));
- return tpi6525_r(tpi, *space, offset - 0x58);
+ device_t *tpi = space.machine().device("tpi6525");
+ LOG(( "DMAC: PC=%08x - TPI6525 Read(%d)\n", space.device().safe_pc(), (offset - 0x58) ));
+ return tpi6525_r(tpi, space, offset - 0x58);
}
break;
case 0x70: /* DMA start strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->adjust(attotime::from_msec( CD_SECTOR_TIME ));
}
break;
case 0x71: /* DMA stop strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->reset( );
}
break;
case 0x72: /* Clear IRQ strobe */
{
- LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space.device().safe_pc() ));
dmac_data.istr &= ~ISTR_INT_P;
}
break;
case 0x74: /* Flush strobe */
{
- LOG(( "DMAC: PC=%08x - Flush Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - Flush Strobe\n", space.device().safe_pc() ));
dmac_data.istr |= ISTR_FE_FLG;
}
break;
default:
- logerror( "DMAC-READ: PC=%08x, offset = %02x\n", space->device().safe_pc(), offset );
+ logerror( "DMAC-READ: PC=%08x, offset = %02x\n", space.device().safe_pc(), offset );
break;
}
@@ -264,15 +264,15 @@ static WRITE16_HANDLER( amiga_dmac_w )
{
case 0x21: /* control write */
{
- LOG(( "DMAC: PC=%08x - CNTR Write(%04x)\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - CNTR Write(%04x)\n", space.device().safe_pc(), data ));
dmac_data.cntr = data;
- check_interrupts(space->machine());
+ check_interrupts(space.machine());
}
break;
case 0x40: /* wtc hi */
{
- LOG(( "DMAC: PC=%08x - WTC HI Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - WTC HI Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.wtc &= 0x0000ffff;
dmac_data.wtc |= ((UINT32)data) << 16;
}
@@ -280,7 +280,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x41: /* wtc lo */
{
- LOG(( "DMAC: PC=%08x - WTC LO Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - WTC LO Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.wtc &= 0xffff0000;
dmac_data.wtc |= data;
}
@@ -288,7 +288,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x42: /* acr hi */
{
- LOG(( "DMAC: PC=%08x - ACR HI Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - ACR HI Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.acr &= 0x0000ffff;
dmac_data.acr |= ((UINT32)data) << 16;
}
@@ -296,7 +296,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x43: /* acr lo */
{
- LOG(( "DMAC: PC=%08x - ACR LO Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - ACR LO Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.acr &= 0xffff0000;
dmac_data.acr |= data;
}
@@ -304,7 +304,7 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x47: /* dawr */
{
- LOG(( "DMAC: PC=%08x - DAWR Write - data = %04x\n", space->device().safe_pc(), data ));
+ LOG(( "DMAC: PC=%08x - DAWR Write - data = %04x\n", space.device().safe_pc(), data ));
dmac_data.dawr = data;
}
break;
@@ -312,15 +312,15 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x48: /* wd33c93 SCSI expansion */
case 0x49:
{
- LOG(( "DMAC: PC=%08x - WD33C93 Write(%d) - data = %04x\n", space->device().safe_pc(), offset & 1, data ));
+ LOG(( "DMAC: PC=%08x - WD33C93 Write(%d) - data = %04x\n", space.device().safe_pc(), offset & 1, data ));
/* Not available without SCSI expansion */
}
break;
case 0x50:
{
- LOG(( "DMAC: PC=%08x - CDROM CMD Write - data = %04x\n", space->device().safe_pc(), data ));
- matsucd_command_w(space->machine(), data );
+ LOG(( "DMAC: PC=%08x - CDROM CMD Write - data = %04x\n", space.device().safe_pc(), data ));
+ matsucd_command_w(space.machine(), data );
}
break;
@@ -341,42 +341,42 @@ static WRITE16_HANDLER( amiga_dmac_w )
case 0x66:
case 0x67:
{
- device_t *tpi = space->machine().device("tpi6525");
- LOG(( "DMAC: PC=%08x - TPI6525 Write(%d) - data = %04x\n", space->device().safe_pc(), (offset - 0x58), data ));
- tpi6525_w(tpi, *space, offset - 0x58, data);
+ device_t *tpi = space.machine().device("tpi6525");
+ LOG(( "DMAC: PC=%08x - TPI6525 Write(%d) - data = %04x\n", space.device().safe_pc(), (offset - 0x58), data ));
+ tpi6525_w(tpi, space, offset - 0x58, data);
}
break;
case 0x70: /* DMA start strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Start Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->adjust(attotime::from_msec( CD_SECTOR_TIME ));
}
break;
case 0x71: /* DMA stop strobe */
{
- LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - DMA Stop Strobe\n", space.device().safe_pc() ));
dmac_data.dma_timer->reset( );
}
break;
case 0x72: /* Clear IRQ strobe */
{
- LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - IRQ Clear Strobe\n", space.device().safe_pc() ));
dmac_data.istr &= ~ISTR_INT_P;
}
break;
case 0x74: /* Flush Strobe */
{
- LOG(( "DMAC: PC=%08x - Flush Strobe\n", space->device().safe_pc() ));
+ LOG(( "DMAC: PC=%08x - Flush Strobe\n", space.device().safe_pc() ));
dmac_data.istr |= ISTR_FE_FLG;
}
break;
default:
- logerror( "DMAC-WRITE: PC=%08x, offset = %02x, data = %04x\n", space->device().safe_pc(), offset, data );
+ logerror( "DMAC-WRITE: PC=%08x, offset = %02x, data = %04x\n", space.device().safe_pc(), offset, data );
break;
}
}
@@ -389,15 +389,15 @@ static WRITE16_HANDLER( amiga_dmac_w )
static void dmac_install(running_machine &machine, offs_t base)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->install_legacy_read_handler(base, base + 0xFFFF, FUNC(amiga_dmac_r));
- space->install_legacy_write_handler(base, base + 0xFFFF, FUNC(amiga_dmac_w));
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_legacy_read_handler(base, base + 0xFFFF, FUNC(amiga_dmac_r));
+ space.install_legacy_write_handler(base, base + 0xFFFF, FUNC(amiga_dmac_w));
}
static void dmac_uninstall(running_machine &machine, offs_t base)
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_readwrite(base, base + 0xFFFF);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ space.unmap_readwrite(base, base + 0xFFFF);
}
static const amiga_autoconfig_device dmac_device =
@@ -457,7 +457,7 @@ static TIMER_CALLBACK(tp6525_delayed_irq)
if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 )
{
- amiga_custom_w(machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*machine.device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
else
{
@@ -474,7 +474,7 @@ static void amigacd_tpi6525_irq_trampoline(device_t *device, int level)
{
if ( (CUSTOM_REG(REG_INTREQ) & INTENA_PORTS) == 0 )
{
- amiga_custom_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
+ amiga_custom_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), REG_INTREQ, 0x8000 | INTENA_PORTS, 0xffff);
}
else
{
diff --git a/src/mess/machine/amigacrt.c b/src/mess/machine/amigacrt.c
index cccaa5f24b5..55bf8e90cf2 100644
--- a/src/mess/machine/amigacrt.c
+++ b/src/mess/machine/amigacrt.c
@@ -112,8 +112,8 @@ static void amiga_ar1_nmi( running_machine &machine )
static WRITE16_HANDLER( amiga_ar1_chipmem_w )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
- int pc = space->device().safe_pc();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
+ int pc = space.device().safe_pc();
/* see if we're inside the AR1 rom */
if ( ((pc >> 16) & 0xff ) != 0xf0 )
@@ -124,7 +124,7 @@ static WRITE16_HANDLER( amiga_ar1_chipmem_w )
{
/* trigger an NMI or spurious irq */
amigacrt.ar1_spurious = (offset == 0x60/2) ? 0 : 1;
- space->machine().scheduler().timer_set(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime(28), FUNC(amiga_ar1_delayed_nmi));
+ space.machine().scheduler().timer_set(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(28), FUNC(amiga_ar1_delayed_nmi));
}
}
@@ -192,11 +192,11 @@ static void amiga_ar23_freeze( running_machine &machine );
static READ16_HANDLER( amiga_ar23_cia_r )
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
if ( ACCESSING_BITS_0_7 && offset == 2048 && pc >= 0x40 && pc < 0x120 )
{
- amiga_ar23_freeze(space->machine());
+ amiga_ar23_freeze(space.machine());
}
return amiga_cia_r( space, offset, mem_mask );
@@ -206,11 +206,11 @@ static WRITE16_HANDLER( amiga_ar23_mode_w )
{
if ( data & 2 )
{
- space->install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_ar23_cia_r));
+ space.install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_ar23_cia_r));
}
else
{
- space->install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_cia_r));
+ space.install_legacy_read_handler(0xbfd000, 0xbfefff, FUNC(amiga_cia_r));
}
amigacrt.ar23_mode = (data&0x3);
@@ -221,7 +221,7 @@ static WRITE16_HANDLER( amiga_ar23_mode_w )
static READ16_HANDLER( amiga_ar23_mode_r )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
UINT16 *mem = (UINT16 *)(*state->memregion( "user2" ));
if ( ACCESSING_BITS_0_7 )
@@ -241,7 +241,7 @@ static READ16_HANDLER( amiga_ar23_mode_r )
}
/* overlay disabled, map RAM on 0x000000 */
- space->install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1");
+ space.install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1");
}
}
@@ -250,11 +250,11 @@ static READ16_HANDLER( amiga_ar23_mode_r )
static WRITE16_HANDLER( amiga_ar23_chipmem_w )
{
- amiga_state *state = space->machine().driver_data<amiga_state>();
+ amiga_state *state = space.machine().driver_data<amiga_state>();
if ( offset == (0x08/2) )
{
if ( amigacrt.ar23_mode & 1 )
- amiga_ar23_freeze(space->machine());
+ amiga_ar23_freeze(space.machine());
}
(*state->m_chip_ram_w)(state, offset * 2, data );
@@ -299,7 +299,7 @@ static void amiga_ar23_nmi( running_machine &machine )
#if 0
static WRITE16_HANDLER( amiga_ar23_custom_w )
{
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
/* see if we're inside the AR2 rom */
if ( ((pc >> 16) & 0xfe ) != 0x40 )
@@ -320,7 +320,7 @@ static READ16_HANDLER( amiga_ar23_custom_r )
{
UINT16 data = amiga_custom_r( offset, mem_mask );
- int pc = space->device().safe_pc();
+ int pc = space.device().safe_pc();
/* see if we're inside the AR2 rom */
if ( ((pc >> 16) & 0xfe ) != 0x40 )
diff --git a/src/mess/machine/amstr_pc.c b/src/mess/machine/amstr_pc.c
index 38aefd9b2cc..27a04dad0f7 100644
--- a/src/mess/machine/amstr_pc.c
+++ b/src/mess/machine/amstr_pc.c
@@ -153,8 +153,8 @@ WRITE8_HANDLER( pc1640_port60_w )
pc1640.port61=data;
if (data==0x30) pc1640.port62=(pc1640.port65&0x10)>>4;
else if (data==0x34) pc1640.port62=pc1640.port65&0xf;
- pit8253_gate2_w(space->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( space->machine(), data & 0x02 );
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
pc_keyb_set_clock(data&0x40);
break;
case 4:
@@ -191,7 +191,7 @@ READ8_HANDLER( pc1640_port60_r )
case 2:
data = pc1640.port62;
- if (pit8253_get_output(space->machine().device("pit8253"), 2))
+ if (pit8253_get_output(space.machine().device("pit8253"), 2))
data |= 0x20;
break;
}
@@ -200,26 +200,26 @@ READ8_HANDLER( pc1640_port60_r )
READ8_HANDLER( pc200_port378_r )
{
- device_t *lpt = space->machine().device("lpt_1");
- UINT8 data = pc_lpt_r(lpt, *space, offset);
+ device_t *lpt = space.machine().device("lpt_1");
+ UINT8 data = pc_lpt_r(lpt, space, offset);
if (offset == 1)
- data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
+ data = (data & ~7) | (space.machine().root_device().ioport("DSW0")->read() & 7);
if (offset == 2)
- data = (data & ~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xc0);
+ data = (data & ~0xe0) | (space.machine().root_device().ioport("DSW0")->read() & 0xc0);
return data;
}
READ8_HANDLER( pc200_port278_r )
{
- device_t *lpt = space->machine().device("lpt_2");
- UINT8 data = pc_lpt_r(lpt, *space, offset);
+ device_t *lpt = space.machine().device("lpt_2");
+ UINT8 data = pc_lpt_r(lpt, space, offset);
if (offset == 1)
- data = (data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
+ data = (data & ~7) | (space.machine().root_device().ioport("DSW0")->read() & 7);
if (offset == 2)
- data = (data & ~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xc0);
+ data = (data & ~0xe0) | (space.machine().root_device().ioport("DSW0")->read() & 0xc0);
return data;
}
@@ -227,23 +227,23 @@ READ8_HANDLER( pc200_port278_r )
READ8_HANDLER( pc1640_port378_r )
{
- device_t *lpt = space->machine().device("lpt_1");
- UINT8 data = pc_lpt_r(lpt, *space, offset);
+ device_t *lpt = space.machine().device("lpt_1");
+ UINT8 data = pc_lpt_r(lpt, space, offset);
if (offset == 1)
- data=(data & ~7) | (space->machine().root_device().ioport("DSW0")->read() & 7);
+ data=(data & ~7) | (space.machine().root_device().ioport("DSW0")->read() & 7);
if (offset == 2)
{
switch (pc1640.dipstate)
{
case 0:
- data = (data&~0xe0) | (space->machine().root_device().ioport("DSW0")->read() & 0xe0);
+ data = (data&~0xe0) | (space.machine().root_device().ioport("DSW0")->read() & 0xe0);
break;
case 1:
- data = (data&~0xe0) | ((space->machine().root_device().ioport("DSW0")->read() & 0xe000)>>8);
+ data = (data&~0xe0) | ((space.machine().root_device().ioport("DSW0")->read() & 0xe000)>>8);
break;
case 2:
- data = (data&~0xe0) | ((space->machine().root_device().ioport("DSW0")->read() & 0xe00)>>4);
+ data = (data&~0xe0) | ((space.machine().root_device().ioport("DSW0")->read() & 0xe00)>>4);
break;
}
@@ -254,7 +254,7 @@ READ8_HANDLER( pc1640_port378_r )
READ8_HANDLER( pc1640_port3d0_r )
{
if (offset==0xa) pc1640.dipstate=0;
- return space->read_byte(0x3d0+offset);
+ return space.read_byte(0x3d0+offset);
}
READ8_HANDLER( pc1640_port4278_r )
@@ -273,22 +273,22 @@ READ8_HANDLER( pc1640_port278_r )
READ8_HANDLER( pc1640_mouse_x_r )
{
- return pc1640.mouse.x - space->machine().root_device().ioport("pc_mouse_x")->read();
+ return pc1640.mouse.x - space.machine().root_device().ioport("pc_mouse_x")->read();
}
READ8_HANDLER( pc1640_mouse_y_r )
{
- return pc1640.mouse.y - space->machine().root_device().ioport("pc_mouse_y")->read();
+ return pc1640.mouse.y - space.machine().root_device().ioport("pc_mouse_y")->read();
}
WRITE8_HANDLER( pc1640_mouse_x_w )
{
- pc1640.mouse.x = data + space->machine().root_device().ioport("pc_mouse_x")->read();
+ pc1640.mouse.x = data + space.machine().root_device().ioport("pc_mouse_x")->read();
}
WRITE8_HANDLER( pc1640_mouse_y_w )
{
- pc1640.mouse.y = data + space->machine().root_device().ioport("pc_mouse_y")->read();
+ pc1640.mouse.y = data + space.machine().root_device().ioport("pc_mouse_y")->read();
}
INPUT_PORTS_START( amstrad_keyboard )
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index c32af3c9cad..f682f042217 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -1196,21 +1196,21 @@ static void amstrad_setLowerRom(running_machine &machine)
}
else // CPC+/GX4000
{
- //address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ //address_space &space = *state->m_maincpu->space(AS_PROGRAM);
/* if ( state->m_asic.enabled && ( state->m_asic.rmr2 & 0x18 ) == 0x18 )
{
- space->install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),state));
- space->install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),state));
- space->install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),state));
- space->install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),state));
+ space.install_read_handler(0x4000, 0x5fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_r),state));
+ space.install_read_handler(0x6000, 0x7fff, read8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_r),state));
+ space.install_write_handler(0x4000, 0x5fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_4000_w),state));
+ space.install_write_handler(0x6000, 0x7fff, write8_delegate(FUNC(amstrad_state::amstrad_plus_asic_6000_w),state));
}
else
{
- space->install_read_bank(0x4000, 0x5fff, "bank3");
- space->install_read_bank(0x6000, 0x7fff, "bank4");
- space->install_write_bank(0x4000, 0x5fff, "bank11");
- space->install_write_bank(0x6000, 0x7fff, "bank12");
+ space.install_read_bank(0x4000, 0x5fff, "bank3");
+ space.install_read_bank(0x6000, 0x7fff, "bank4");
+ space.install_write_bank(0x4000, 0x5fff, "bank11");
+ space.install_write_bank(0x6000, 0x7fff, "bank12");
}
*/
if(state->m_AmstradCPC_RamBanks[0] != NULL)
diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c
index 8f37bd314e6..5172a1571a8 100644
--- a/src/mess/machine/apollo.c
+++ b/src/mess/machine/apollo.c
@@ -826,20 +826,20 @@ WRITE8_DEVICE_HANDLER(apollo_ptm_w) {
***************************************************************************/
static DEVICE_RESET( apollo_rtc ) {
- address_space *space = device->machine().device(MAINCPU)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU)->memory().space(AS_PROGRAM);
apollo_state *state = device->machine().driver_data<apollo_state>();
- UINT8 year = state->apollo_rtc_r(*space, 9);
+ UINT8 year = state->apollo_rtc_r(space, 9);
// change year according to configuration settings
if (year < 20 && apollo_config(APOLLO_CONF_DATE_1990))
{
year+=80;
- state->apollo_rtc_w(*space, 9, year);
+ state->apollo_rtc_w(space, 9, year);
}
else if (year >= 80 && !apollo_config(APOLLO_CONF_DATE_1990))
{
year -=80;
- state->apollo_rtc_w(*space, 9, year);
+ state->apollo_rtc_w(space, 9, year);
}
//SLOG1(("reset apollo_rtc year=%d", year));
@@ -872,13 +872,13 @@ READ8_MEMBER(apollo_state::apollo_rtc_r)
static TIMER_CALLBACK( apollo_rtc_timer )
{
apollo_state *state = machine.driver_data<apollo_state>();
- address_space *space = machine.device(MAINCPU)->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device(MAINCPU)->memory().space(AS_PROGRAM);
// FIXME: reading register 0x0c will clear all interrupt flags
- if ((state->apollo_rtc_r(*space, 0x0c) & 0x80))
+ if ((state->apollo_rtc_r(space, 0x0c) & 0x80))
{
//SLOG2(("apollo_rtc_timer - set_irq_line %d", APOLLO_IRQ_RTC));
- apollo_pic_set_irq_line(&space->device(), APOLLO_IRQ_RTC, 1);
+ apollo_pic_set_irq_line(&space.device(), APOLLO_IRQ_RTC, 1);
}
}
@@ -1343,11 +1343,11 @@ static DEVICE_RESET( apollo_fdc ) {
WRITE8_MEMBER(apollo_state::apollo_fdc_w){
SLOG1(("writing FDC upd765 at offset %X = %02x", offset, data));
- pc_fdc_w(&space, offset, data);
+ pc_fdc_w(space, offset, data);
}
READ8_MEMBER(apollo_state::apollo_fdc_r){
- UINT8 data = pc_fdc_r(&space, offset);
+ UINT8 data = pc_fdc_r(space, offset);
SLOG1(("reading FDC upd765 at offset %X = %02x", offset, data));
return data;
}
diff --git a/src/mess/machine/apple1.c b/src/mess/machine/apple1.c
index a444a672423..afc78e1dbd7 100644
--- a/src/mess/machine/apple1.c
+++ b/src/mess/machine/apple1.c
@@ -143,9 +143,9 @@ static const UINT8 apple1_control_keymap[] =
DRIVER_INIT_MEMBER(apple1_state,apple1)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Set up the handlers for MESS's dynamically-sized RAM. */
- space->install_readwrite_bank(0x0000, machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ space.install_readwrite_bank(0x0000, machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
/* Poll the keyboard input ports periodically. These include both
diff --git a/src/mess/machine/apple2.c b/src/mess/machine/apple2.c
index b9cec454571..53f07a16e4d 100644
--- a/src/mess/machine/apple2.c
+++ b/src/mess/machine/apple2.c
@@ -59,7 +59,7 @@ void apple2_setup_memory(running_machine &machine, const apple2_memmap_config *c
void apple2_update_memory(running_machine &machine)
{
apple2_state *state = machine.driver_data<apple2_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int i, bank;
char rbank[10], wbank[10];
int full_update = 0;
@@ -166,15 +166,15 @@ void apple2_update_memory(running_machine &machine)
/* install the actual handlers */
if (begin <= end_r) {
if (rh) {
- space->install_read_handler(begin, end_r, *rh);
+ space.install_read_handler(begin, end_r, *rh);
} else {
- space->install_read_bank(begin, end_r, rbank);
+ space.install_read_bank(begin, end_r, rbank);
}
}
/* did we 'go past the end?' */
if (end_r < state->m_mem_config.memmap[i].end)
- space->nop_read(end_r + 1, state->m_mem_config.memmap[i].end);
+ space.nop_read(end_r + 1, state->m_mem_config.memmap[i].end);
/* set the memory bank */
if (rbase)
@@ -254,19 +254,19 @@ void apple2_update_memory(running_machine &machine)
/* install the actual handlers */
if (begin <= end_w) {
if (wh) {
- space->install_write_handler(begin, end_w, *wh);
+ space.install_write_handler(begin, end_w, *wh);
} else {
if (wh_nop) {
- space->nop_write(begin, end_w);
+ space.nop_write(begin, end_w);
} else {
- space->install_write_bank(begin, end_w, wbank);
+ space.install_write_bank(begin, end_w, wbank);
}
}
}
/* did we 'go past the end?' */
if (end_w < state->m_mem_config.memmap[i].end)
- space->nop_write(end_w + 1, state->m_mem_config.memmap[i].end);
+ space.nop_write(end_w + 1, state->m_mem_config.memmap[i].end);
/* set the memory bank */
if (wbase)
diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c
index 87e2edff1c9..3fc4c0dd472 100644
--- a/src/mess/machine/apple2gs.c
+++ b/src/mess/machine/apple2gs.c
@@ -801,7 +801,7 @@ static TIMER_CALLBACK(apple2gs_scanline_tick)
static READ8_HANDLER( gssnd_r )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
UINT8 ret = 0;
switch (offset)
@@ -819,7 +819,7 @@ static READ8_HANDLER( gssnd_r )
}
else
{
- state->m_sndglu_dummy_read = state->m_es5503->read(*space, state->m_sndglu_addr);
+ state->m_sndglu_dummy_read = state->m_es5503->read(space, state->m_sndglu_addr);
}
if (state->m_sndglu_ctrl & 0x20) // auto-increment
@@ -842,7 +842,7 @@ static READ8_HANDLER( gssnd_r )
static WRITE8_HANDLER( gssnd_w )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
switch (offset)
{
case 0: // control
@@ -855,12 +855,12 @@ static WRITE8_HANDLER( gssnd_w )
case 1: // data write
if (state->m_sndglu_ctrl & 0x40) // docram access
{
- UINT8 *docram = space->machine().root_device().memregion("es5503")->base();
+ UINT8 *docram = space.machine().root_device().memregion("es5503")->base();
docram[state->m_sndglu_addr] = data;
}
else
{
- state->m_es5503->write(*space, state->m_sndglu_addr, data);
+ state->m_es5503->write(space, state->m_sndglu_addr, data);
}
if (state->m_sndglu_ctrl & 0x20) // auto-increment
@@ -1013,7 +1013,7 @@ READ8_MEMBER( apple2gs_state::apple2gs_c0xx_r )
case 0x3D: /* C03D - SOUNDDATA */
case 0x3E: /* C03E - SOUNDADRL */
case 0x3F: /* C03F - SOUNDADRH */
- result = gssnd_r(&space, offset & 0x03);
+ result = gssnd_r(space, offset & 0x03);
break;
case 0x41: /* C041 - INTEN */
@@ -1174,7 +1174,7 @@ WRITE8_MEMBER( apple2gs_state::apple2gs_c0xx_w )
case 0x3D: /* C03D - SOUNDDATA */
case 0x3E: /* C03E - SOUNDADRL */
case 0x3F: /* C03F - SOUNDADRH */
- gssnd_w(&space, offset & 0x03, data);
+ gssnd_w(space, offset & 0x03, data);
break;
case 0x41: /* C041 - INTEN */
@@ -1747,19 +1747,19 @@ DIRECT_UPDATE_MEMBER(apple2gs_state::apple2gs_opbase)
-static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0x00C000); }
-static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0x01C000); }
-static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0xE0C000); }
-static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(*space, space->machine(), offset | 0xE1C000); }
+static READ8_HANDLER( apple2gs_00Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0x00C000); }
+static READ8_HANDLER( apple2gs_01Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0x01C000); }
+static READ8_HANDLER( apple2gs_E0Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0xE0C000); }
+static READ8_HANDLER( apple2gs_E1Cxxx_r ) { return apple2gs_xxCxxx_r(space, space.machine(), offset | 0xE1C000); }
-static WRITE8_HANDLER( apple2gs_00Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0x00C000, data); }
-static WRITE8_HANDLER( apple2gs_01Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0x01C000, data); }
-static WRITE8_HANDLER( apple2gs_E0Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0xE0C000, data); }
-static WRITE8_HANDLER( apple2gs_E1Cxxx_w ) { apple2gs_xxCxxx_w(*space, space->machine(), offset | 0xE1C000, data); }
+static WRITE8_HANDLER( apple2gs_00Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0x00C000, data); }
+static WRITE8_HANDLER( apple2gs_01Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0x01C000, data); }
+static WRITE8_HANDLER( apple2gs_E0Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0xE0C000, data); }
+static WRITE8_HANDLER( apple2gs_E1Cxxx_w ) { apple2gs_xxCxxx_w(space, space.machine(), offset | 0xE1C000, data); }
static WRITE8_HANDLER( apple2gs_Exxxxx_w )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
state->m_slowmem[offset] = data;
}
@@ -1770,14 +1770,14 @@ static WRITE8_HANDLER( apple2gs_E12xxx_w ) { apple2gs_Exxxxx_w(space, offset + 0
static WRITE8_HANDLER( apple2gs_slowmem_w )
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
state->m_slowmem[offset] = data;
if ((offset >= 0x19e00) && (offset < 0x19fff))
{
int color = (offset - 0x19e00) >> 1;
- palette_set_color_rgb(space->machine(), color + 16,
+ palette_set_color_rgb(space.machine(), color + 16,
((state->m_slowmem[0x19E00 + (color * 2) + 1] >> 0) & 0x0F) * 17,
((state->m_slowmem[0x19E00 + (color * 2) + 0] >> 4) & 0x0F) * 17,
((state->m_slowmem[0x19E00 + (color * 2) + 0] >> 0) & 0x0F) * 17);
@@ -1788,7 +1788,7 @@ static WRITE8_HANDLER( apple2gs_slowmem_w )
// which doesn't drive the bus results in reading back the bank number.
static READ8_HANDLER(apple2gs_bank_echo_r)
{
- apple2gs_state *state = space->machine().driver_data<apple2gs_state>();
+ apple2gs_state *state = space.machine().driver_data<apple2gs_state>();
return state->m_echo_bank + (offset>>16);
}
@@ -1796,7 +1796,7 @@ static READ8_HANDLER(apple2gs_bank_echo_r)
static void apple2gs_setup_memory(running_machine &machine)
{
apple2gs_state *state = machine.driver_data<apple2gs_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
offs_t begin, end;
apple2_memmap_config cfg;
@@ -1812,10 +1812,10 @@ static void apple2gs_setup_memory(running_machine &machine)
int ramsize = machine.device<ram_device>(RAM_TAG)->size();
// ROM 03 hardware: the quoted "1 MB" for a base machine doesn't include banks e0/e1, so map accordingly
- space->install_readwrite_bank(0x010000, ramsize - 1, "bank1");
+ space.install_readwrite_bank(0x010000, ramsize - 1, "bank1");
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x010000);
- space->install_legacy_read_handler( ramsize, 0xdfffff, FUNC(apple2gs_bank_echo_r));
+ space.install_legacy_read_handler( ramsize, 0xdfffff, FUNC(apple2gs_bank_echo_r));
state->m_echo_bank = (ramsize >> 16);
}
else
@@ -1823,44 +1823,44 @@ static void apple2gs_setup_memory(running_machine &machine)
int ramsize = machine.device<ram_device>(RAM_TAG)->size()-0x30000;
// ROM 00/01 hardware: the quoted "256K" for a base machine *does* include banks e0/e1.
- space->install_readwrite_bank(0x010000, ramsize - 1 + 0x10000, "bank1");
+ space.install_readwrite_bank(0x010000, ramsize - 1 + 0x10000, "bank1");
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x010000);
- space->install_legacy_read_handler( ramsize + 0x10000, 0xdfffff, FUNC(apple2gs_bank_echo_r));
+ space.install_legacy_read_handler( ramsize + 0x10000, 0xdfffff, FUNC(apple2gs_bank_echo_r));
state->m_echo_bank = (ramsize+0x10000) >> 16;
}
/* install hi memory */
- space->install_read_bank(0xe00000, 0xe1ffff, "bank2");
- space->install_legacy_write_handler(0xe00000, 0xe1ffff, FUNC(apple2gs_slowmem_w));
- space->install_legacy_write_handler(0xe00400, 0xe007ff, FUNC(apple2gs_E004xx_w));
- space->install_legacy_write_handler(0xe02000, 0xe03fff, FUNC(apple2gs_E02xxx_w));
- space->install_legacy_write_handler(0xe10400, 0xe107ff, FUNC(apple2gs_E104xx_w));
- space->install_legacy_write_handler(0xe12000, 0xe13fff, FUNC(apple2gs_E12xxx_w));
+ space.install_read_bank(0xe00000, 0xe1ffff, "bank2");
+ space.install_legacy_write_handler(0xe00000, 0xe1ffff, FUNC(apple2gs_slowmem_w));
+ space.install_legacy_write_handler(0xe00400, 0xe007ff, FUNC(apple2gs_E004xx_w));
+ space.install_legacy_write_handler(0xe02000, 0xe03fff, FUNC(apple2gs_E02xxx_w));
+ space.install_legacy_write_handler(0xe10400, 0xe107ff, FUNC(apple2gs_E104xx_w));
+ space.install_legacy_write_handler(0xe12000, 0xe13fff, FUNC(apple2gs_E12xxx_w));
state->membank("bank2")->set_base(state->m_slowmem);
/* install alternate ROM bank */
begin = 0x1000000 - machine.root_device().memregion("maincpu")->bytes();
end = 0xffffff;
- space->install_read_bank(begin, end, "bank3");
+ space.install_read_bank(begin, end, "bank3");
state->membank("bank3")->set_base(machine.root_device().memregion("maincpu")->base());
/* install new xxC000-xxCFFF handlers */
- space->install_legacy_read_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_r));
- space->install_legacy_write_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_w));
- space->install_legacy_read_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_r));
- space->install_legacy_write_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_w));
- space->install_legacy_read_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_r));
- space->install_legacy_write_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_w));
- space->install_legacy_read_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_r));
- space->install_legacy_write_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_w));
- space->set_direct_update_handler(direct_update_delegate(FUNC(apple2gs_state::apple2gs_opbase), state));
+ space.install_legacy_read_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_r));
+ space.install_legacy_write_handler(0x00c000, 0x00cfff, FUNC(apple2gs_00Cxxx_w));
+ space.install_legacy_read_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_r));
+ space.install_legacy_write_handler(0x01c000, 0x01cfff, FUNC(apple2gs_01Cxxx_w));
+ space.install_legacy_read_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_r));
+ space.install_legacy_write_handler(0xe0c000, 0xe0cfff, FUNC(apple2gs_E0Cxxx_w));
+ space.install_legacy_read_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_r));
+ space.install_legacy_write_handler(0xe1c000, 0xe1cfff, FUNC(apple2gs_E1Cxxx_w));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(apple2gs_state::apple2gs_opbase), state));
/* install aux memory writes (for shadowing) */
- space->install_write_handler(0x010400, 0x0107FF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux0400_w), state));
- space->install_write_handler(0x012000, 0x013FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux2000_w), state));
- space->install_write_handler(0x014000, 0x019FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux4000_w), state));
+ space.install_write_handler(0x010400, 0x0107FF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux0400_w), state));
+ space.install_write_handler(0x012000, 0x013FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux2000_w), state));
+ space.install_write_handler(0x014000, 0x019FFF, write8_delegate(FUNC(apple2gs_state::apple2gs_aux4000_w), state));
/* setup the Apple II memory system */
memset(&cfg, 0, sizeof(cfg));
@@ -1879,7 +1879,7 @@ static void apple2gs_setup_memory(running_machine &machine)
static READ8_HANDLER( apple2gs_read_vector )
{
- return space->read_byte(offset | 0xFF0000);
+ return space.read_byte(offset | 0xFF0000);
}
MACHINE_RESET_MEMBER(apple2gs_state,apple2gs)
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index 0f249e1b5f1..4eb3919e703 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -327,7 +327,7 @@ static void apple3_update_memory(running_machine &machine)
apple3_state *state = machine.driver_data<apple3_state>();
UINT16 bank;
UINT8 page;
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (LOG_MEMORY)
{
@@ -374,71 +374,71 @@ static void apple3_update_memory(running_machine &machine)
/* install bank 8 (C000-CFFF) */
if (state->m_via_0_a & 0x40)
{
- space->install_read_handler(0xC000, 0xC0FF, read8_delegate(FUNC(apple3_state::apple3_c0xx_r),state));
- space->install_write_handler(0xC000, 0xC0FF, write8_delegate(FUNC(apple3_state::apple3_c0xx_w),state));
+ space.install_read_handler(0xC000, 0xC0FF, read8_delegate(FUNC(apple3_state::apple3_c0xx_r),state));
+ space.install_write_handler(0xC000, 0xC0FF, write8_delegate(FUNC(apple3_state::apple3_c0xx_w),state));
}
else
{
- space->install_read_bank(0xC000, 0xC0FF, "bank8");
+ space.install_read_bank(0xC000, 0xC0FF, "bank8");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC000, 0xC0FF);
+ space.unmap_write(0xC000, 0xC0FF);
else
- space->install_write_bank(0xC000, 0xC0FF, "bank8");
+ space.install_write_bank(0xC000, 0xC0FF, "bank8");
apple3_setbank(machine,"bank8", ~0, 0x4000);
}
/* install bank 9 (C100-C4FF) */
if (state->m_via_0_a & 0x40)
{
- space->nop_readwrite(0xC100, 0xC4FF);
+ space.nop_readwrite(0xC100, 0xC4FF);
}
else
{
- space->install_read_bank(0xC100, 0xC4FF, "bank9");
+ space.install_read_bank(0xC100, 0xC4FF, "bank9");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC100, 0xC4FF);
+ space.unmap_write(0xC100, 0xC4FF);
else
- space->install_write_bank(0xC100, 0xC4FF, "bank9");
+ space.install_write_bank(0xC100, 0xC4FF, "bank9");
apple3_setbank(machine,"bank9", ~0, 0x4100);
}
/* install bank 10 (C500-C7FF) */
- space->install_read_bank(0xC500, 0xC7FF, "bank10");
+ space.install_read_bank(0xC500, 0xC7FF, "bank10");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC500, 0xC7FF);
+ space.unmap_write(0xC500, 0xC7FF);
else
- space->install_write_bank(0xC500, 0xC7FF, "bank10");
+ space.install_write_bank(0xC500, 0xC7FF, "bank10");
apple3_setbank(machine,"bank10", ~0, 0x4500);
/* install bank 11 (C800-CFFF) */
if (state->m_via_0_a & 0x40)
{
- space->nop_readwrite(0xC800, 0xCFFF);
+ space.nop_readwrite(0xC800, 0xCFFF);
}
else
{
- space->install_read_bank(0xC800, 0xCFFF, "bank11");
+ space.install_read_bank(0xC800, 0xCFFF, "bank11");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xC800, 0xCFFF);
+ space.unmap_write(0xC800, 0xCFFF);
else
- space->install_write_bank(0xC800, 0xCFFF, "bank11");
+ space.install_write_bank(0xC800, 0xCFFF, "bank11");
apple3_setbank(machine,"bank11", ~0, 0x4800);
}
/* install bank 6 (D000-EFFF) */
- space->install_read_bank(0xD000, 0xEFFF, "bank6");
+ space.install_read_bank(0xD000, 0xEFFF, "bank6");
if (state->m_via_0_a & 0x08)
- space->unmap_write(0xD000, 0xEFFF);
+ space.unmap_write(0xD000, 0xEFFF);
else
- space->install_write_bank(0xD000, 0xEFFF, "bank6");
+ space.install_write_bank(0xD000, 0xEFFF, "bank6");
apple3_setbank(machine,"bank6", ~0, 0x5000);
/* install bank 7 (F000-FFFF) */
- space->install_read_bank(0xF000, 0xFFFF, "bank7");
+ space.install_read_bank(0xF000, 0xFFFF, "bank7");
if (state->m_via_0_a & 0x09)
- space->unmap_write(0xF000, 0xFFFF);
+ space.unmap_write(0xF000, 0xFFFF);
else
- space->install_write_bank(0xF000, 0xFFFF, "bank7");
+ space.install_write_bank(0xF000, 0xFFFF, "bank7");
if (state->m_via_0_a & 0x01)
state->membank("bank7")->set_base(machine.root_device().memregion("maincpu")->base());
else
@@ -446,11 +446,11 @@ static void apple3_update_memory(running_machine &machine)
/* reinstall VIA handlers */
{
- via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
- via6522_device *via_1 = space->machine().device<via6522_device>("via6522_1");
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ via6522_device *via_1 = space.machine().device<via6522_device>("via6522_1");
- space->install_readwrite_handler(0xFFD0, 0xFFDF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_0), write8_delegate(FUNC(via6522_device::write),via_0));
- space->install_readwrite_handler(0xFFE0, 0xFFEF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_1), write8_delegate(FUNC(via6522_device::write),via_1));
+ space.install_readwrite_handler(0xFFD0, 0xFFDF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_0), write8_delegate(FUNC(via6522_device::write),via_0));
+ space.install_readwrite_handler(0xFFE0, 0xFFEF, 0, 0, read8_delegate(FUNC(via6522_device::read),via_1), write8_delegate(FUNC(via6522_device::write),via_1));
}
}
diff --git a/src/mess/machine/at.c b/src/mess/machine/at.c
index a4da925c3b7..1ad1e1f938b 100644
--- a/src/mess/machine/at.c
+++ b/src/mess/machine/at.c
@@ -316,7 +316,7 @@ WRITE8_MEMBER( at_state::at_portb_w )
static void init_at_common(running_machine &machine)
{
at_state *state = machine.driver_data<at_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
// The CS4031 chipset does this itself
if (machine.device("cs4031") == NULL)
@@ -327,8 +327,8 @@ static void init_at_common(running_machine &machine)
if (machine.device<ram_device>(RAM_TAG)->size() > 0x0a0000)
{
offs_t ram_limit = 0x100000 + machine.device<ram_device>(RAM_TAG)->size() - 0x0a0000;
- space->install_read_bank(0x100000, ram_limit - 1, "bank1");
- space->install_write_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_read_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_write_bank(0x100000, ram_limit - 1, "bank1");
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0xa0000);
}
}
diff --git a/src/mess/machine/ataricrt.c b/src/mess/machine/ataricrt.c
index 01992420a4b..7f3fe7c9f5e 100644
--- a/src/mess/machine/ataricrt.c
+++ b/src/mess/machine/ataricrt.c
@@ -172,7 +172,7 @@ static WRITE8_HANDLER( x32_bank_w )
{
// printf("written %x\n", data);
int bank = data & 0x03;
- space->machine().root_device().membank("8000")->set_base(space->machine().root_device().memregion("lslot")->base() + bank * 0x2000);
+ space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + bank * 0x2000);
}
static WRITE8_HANDLER( w64_bank_w )
@@ -180,9 +180,9 @@ static WRITE8_HANDLER( w64_bank_w )
// printf("write to %x\n", offset);
if (offset < 8)
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + offset * 0x2000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + offset * 0x2000);
else
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base());
// FIXME: writes to 0x8-0xf should disable the cart
}
@@ -192,9 +192,9 @@ static WRITE8_HANDLER( ex64_bank_w )
// printf("write to %x\n", offset);
if (offset < 8)
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + (7 - offset) * 0x2000);
else
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base());
// FIXME: writes to 0x8-0xf should disable the cart
}
@@ -202,14 +202,14 @@ static WRITE8_HANDLER( bbsb_bankl_w )
{
// printf("write to %x\n", 0x8000 + offset);
if (offset >= 0xff6 && offset <= 0xff9)
- space->machine().root_device().membank("8000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000);
+ space.machine().root_device().membank("8000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x0000 + (offset - 0xff6) * 0x1000);
}
static WRITE8_HANDLER( bbsb_bankh_w )
{
// printf("write to %x\n", 0x9000 + offset);
if (offset >= 0xff6 && offset <= 0xff9)
- space->machine().root_device().membank("9000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000);
+ space.machine().root_device().membank("9000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000 + (offset - 0xff6) * 0x1000);
}
static WRITE8_HANDLER( oss_034m_w )
@@ -218,28 +218,28 @@ static WRITE8_HANDLER( oss_034m_w )
{
case 0:
case 1:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base());
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 2:
case 6:
// docs says this should put 0xff in the 0xa000 bank -> let's point to the end of the cart
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x4000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x4000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 3:
case 7:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x1000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
case 4:
case 5:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x2000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
break;
default:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xa000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xb000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000);
break;
}
}
@@ -249,20 +249,20 @@ static WRITE8_HANDLER( oss_m091_w )
switch (offset & 0x09)
{
case 0:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x1000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x1000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
case 1:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x3000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x3000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
case 8:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xa000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("maincpu")->base() + 0xb000);
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xa000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("maincpu")->base() + 0xb000);
break;
case 9:
- space->machine().root_device().membank("a000")->set_base(space->machine().root_device().memregion("lslot")->base() + 0x2000);
- space->machine().root_device().membank("b000")->set_base(space->machine().root_device().memregion("lslot")->base());
+ space.machine().root_device().membank("a000")->set_base(space.machine().root_device().memregion("lslot")->base() + 0x2000);
+ space.machine().root_device().membank("b000")->set_base(space.machine().root_device().memregion("lslot")->base());
break;
}
}
@@ -284,14 +284,14 @@ static WRITE8_HANDLER( bbsb_bankh_w )
static READ8_HANDLER( bbsb_bankl_r )
{
// return data from the selected bank (0,1,2,3)
- UINT8 *mem = space->machine().root_device().memregion("lslot")->base();
+ UINT8 *mem = space.machine().root_device().memregion("lslot")->base();
return &mem[0x0000 + bbsb_bankl * 0x1000];
}
static READ8_HANDLER( bbsb_bankh_r )
{
// return data from the selected bank (4,5,6,7)
- UINT8 *mem = space->machine().root_device().memregion("lslot")->base();
+ UINT8 *mem = space.machine().root_device().memregion("lslot")->base();
return &mem[0x4000 + bbsb_bankh * 0x1000];
}
#endif
@@ -658,19 +658,19 @@ static UINT8 xegs_cart = 0;
static WRITE8_HANDLER( xegs_bankswitch )
{
- UINT8 *cart = space->machine().root_device().memregion("user1")->base();
+ UINT8 *cart = space.machine().root_device().memregion("user1")->base();
data &= xegs_banks - 1;
- space->machine().root_device().membank("bank0")->set_base(cart + data * 0x2000);
+ space.machine().root_device().membank("bank0")->set_base(cart + data * 0x2000);
}
MACHINE_START( xegs )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *cart = space->machine().root_device().memregion("user1")->base();
- UINT8 *cpu = space->machine().root_device().memregion("maincpu")->base();
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
+ UINT8 *cart = space.machine().root_device().memregion("user1")->base();
+ UINT8 *cpu = space.machine().root_device().memregion("maincpu")->base();
atari_machine_start(machine);
- space->install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch));
+ space.install_legacy_write_handler(0xd500, 0xd5ff, FUNC(xegs_bankswitch));
if (xegs_cart)
{
diff --git a/src/mess/machine/b2m.c b/src/mess/machine/b2m.c
index 61db41b0606..4af961ebacf 100644
--- a/src/mess/machine/b2m.c
+++ b/src/mess/machine/b2m.c
@@ -44,20 +44,20 @@ static void b2m_set_bank(running_machine &machine,int bank)
{
UINT8 *rom;
b2m_state *state = machine.driver_data<b2m_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
- space->install_write_bank(0x0000, 0x27ff, "bank1");
- space->install_write_bank(0x2800, 0x2fff, "bank2");
- space->install_write_bank(0x3000, 0x6fff, "bank3");
- space->install_write_bank(0x7000, 0xdfff, "bank4");
- space->install_write_bank(0xe000, 0xffff, "bank5");
+ space.install_write_bank(0x0000, 0x27ff, "bank1");
+ space.install_write_bank(0x2800, 0x2fff, "bank2");
+ space.install_write_bank(0x3000, 0x6fff, "bank3");
+ space.install_write_bank(0x7000, 0xdfff, "bank4");
+ space.install_write_bank(0xe000, 0xffff, "bank5");
rom = state->memregion("maincpu")->base();
switch(bank) {
case 0 :
case 1 :
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x2800);
@@ -67,8 +67,8 @@ static void b2m_set_bank(running_machine &machine,int bank)
break;
#if 0
case 1 :
- space->unmap_write(0x3000, 0x6fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x3000, 0x6fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x2800);
@@ -78,42 +78,42 @@ static void b2m_set_bank(running_machine &machine,int bank)
break;
#endif
case 2 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x10000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
break;
case 3 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x14000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
break;
case 4 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x18000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
break;
case 5 :
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(ram);
- space->install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
+ space.install_read_handler(0x2800, 0x2fff, read8_delegate(FUNC(b2m_state::b2m_keyboard_r),state));
state->membank("bank3")->set_base(ram + 0x1c000);
state->membank("bank4")->set_base(ram + 0x7000);
state->membank("bank5")->set_base(rom + 0x10000);
@@ -127,11 +127,11 @@ static void b2m_set_bank(running_machine &machine,int bank)
state->membank("bank5")->set_base(ram + 0xe000);
break;
case 7 :
- space->unmap_write(0x0000, 0x27ff);
- space->unmap_write(0x2800, 0x2fff);
- space->unmap_write(0x3000, 0x6fff);
- space->unmap_write(0x7000, 0xdfff);
- space->unmap_write(0xe000, 0xffff);
+ space.unmap_write(0x0000, 0x27ff);
+ space.unmap_write(0x2800, 0x2fff);
+ space.unmap_write(0x3000, 0x6fff);
+ space.unmap_write(0x7000, 0xdfff);
+ space.unmap_write(0xe000, 0xffff);
state->membank("bank1")->set_base(rom + 0x10000);
state->membank("bank2")->set_base(rom + 0x10000);
diff --git a/src/mess/machine/bebox.c b/src/mess/machine/bebox.c
index 817fcf39e0d..b8fb66d5954 100644
--- a/src/mess/machine/bebox.c
+++ b/src/mess/machine/bebox.c
@@ -142,25 +142,25 @@ static void bebox_mbreg32_w(UINT32 *target, UINT64 data, UINT64 mem_mask)
READ64_HANDLER( bebox_cpu0_imask_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
return ((UINT64) state->m_cpu_imask[0]) << 32;
}
READ64_HANDLER( bebox_cpu1_imask_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
return ((UINT64) state->m_cpu_imask[1]) << 32;
}
READ64_HANDLER( bebox_interrupt_sources_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
return ((UINT64) state->m_interrupts) << 32;
}
WRITE64_HANDLER( bebox_cpu0_imask_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT32 old_imask = state->m_cpu_imask[0];
bebox_mbreg32_w(&state->m_cpu_imask[0], data, mem_mask);
@@ -170,15 +170,15 @@ WRITE64_HANDLER( bebox_cpu0_imask_w )
if (LOG_CPUIMASK)
{
logerror("BeBox CPU #0 pc=0x%08X imask=0x%08x\n",
- (unsigned) space->device().safe_pc( ), state->m_cpu_imask[0]);
+ (unsigned) space.device().safe_pc( ), state->m_cpu_imask[0]);
}
- bebox_update_interrupts(space->machine());
+ bebox_update_interrupts(space.machine());
}
}
WRITE64_HANDLER( bebox_cpu1_imask_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT32 old_imask = state->m_cpu_imask[1];
bebox_mbreg32_w(&state->m_cpu_imask[1], data, mem_mask);
@@ -188,20 +188,20 @@ WRITE64_HANDLER( bebox_cpu1_imask_w )
if (LOG_CPUIMASK)
{
logerror("BeBox CPU #1 pc=0x%08X imask=0x%08x\n",
- (unsigned) space->device() .safe_pc( ), state->m_cpu_imask[1]);
+ (unsigned) space.device() .safe_pc( ), state->m_cpu_imask[1]);
}
- bebox_update_interrupts(space->machine());
+ bebox_update_interrupts(space.machine());
}
}
READ64_HANDLER( bebox_crossproc_interrupts_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT32 result;
result = state->m_crossproc_interrupts;
/* return a different result depending on which CPU is accessing this handler */
- if (space != space->machine().device("ppc1")->memory().space(AS_PROGRAM))
+ if (&space != space.machine().device("ppc1")->memory().space(AS_PROGRAM))
result |= 0x02000000;
else
result &= ~0x02000000;
@@ -211,7 +211,7 @@ READ64_HANDLER( bebox_crossproc_interrupts_r )
WRITE64_HANDLER( bebox_crossproc_interrupts_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
static const struct
{
UINT32 mask;
@@ -249,7 +249,7 @@ WRITE64_HANDLER( bebox_crossproc_interrupts_w )
*/
}
- space->machine().device(cputags[crossproc_map[i].cpunum])->execute().set_input_line(crossproc_map[i].inputline, line);
+ space.machine().device(cputags[crossproc_map[i].cpunum])->execute().set_input_line(crossproc_map[i].inputline, line);
}
}
}
@@ -260,7 +260,7 @@ WRITE64_HANDLER( bebox_processor_resets_w )
if (b & 0x20)
{
- space->machine().device("ppc2")->execute().set_input_line(INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE);
+ space.machine().device("ppc2")->execute().set_input_line(INPUT_LINE_RESET, (b & 0x80) ? CLEAR_LINE : ASSERT_LINE);
}
}
@@ -453,10 +453,10 @@ static const struct pc_fdc_interface bebox_fdc_interface =
READ64_HANDLER( bebox_interrupt_ack_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
int result;
result = pic8259_acknowledge( state->m_devices.pic8259_master );
- bebox_set_irq_bit(space->machine(), 5, 0); /* HACK */
+ bebox_set_irq_bit(space.machine(), 5, 0); /* HACK */
return ((UINT64) result) << 56;
}
@@ -514,8 +514,8 @@ static device_t *ide_device(running_machine &machine)
return machine.device("ide");
}
-READ8_HANDLER( bebox_800001F0_r ) { return ide_controller_r(ide_device(space->machine()), offset + 0x1F0, 1); }
-WRITE8_HANDLER( bebox_800001F0_w ) { ide_controller_w(ide_device(space->machine()), offset + 0x1F0, 1, data); }
+READ8_HANDLER( bebox_800001F0_r ) { return ide_controller_r(ide_device(space.machine()), offset + 0x1F0, 1); }
+WRITE8_HANDLER( bebox_800001F0_w ) { ide_controller_w(ide_device(space.machine()), offset + 0x1F0, 1, data); }
READ64_HANDLER( bebox_800003F0_r )
{
@@ -524,13 +524,13 @@ READ64_HANDLER( bebox_800003F0_r )
if (((mem_mask >> 8) & 0xFF) == 0)
{
result &= ~(0xFF << 8);
- result |= ide_controller_r(ide_device(space->machine()), 0x3F6, 1) << 8;
+ result |= ide_controller_r(ide_device(space.machine()), 0x3F6, 1) << 8;
}
if (((mem_mask >> 0) & 0xFF) == 0)
{
result &= ~(0xFF << 0);
- result |= ide_controller_r(ide_device(space->machine()), 0x3F7, 1) << 0;
+ result |= ide_controller_r(ide_device(space.machine()), 0x3F7, 1) << 0;
}
return result;
}
@@ -541,10 +541,10 @@ WRITE64_HANDLER( bebox_800003F0_w )
write64be_with_write8_handler(pc_fdc_w, space, offset, data, mem_mask | 0xFFFF);
if (((mem_mask >> 8) & 0xFF) == 0)
- ide_controller_w(ide_device(space->machine()), 0x3F6, 1, (data >> 8) & 0xFF);
+ ide_controller_w(ide_device(space.machine()), 0x3F6, 1, (data >> 8) & 0xFF);
if (((mem_mask >> 0) & 0xFF) == 0)
- ide_controller_w(ide_device(space->machine()), 0x3F7, 1, (data >> 0) & 0xFF);
+ ide_controller_w(ide_device(space.machine()), 0x3F7, 1, (data >> 0) & 0xFF);
}
@@ -588,7 +588,7 @@ static WRITE64_HANDLER( bebox_video_w )
READ8_HANDLER(bebox_page_r)
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
UINT8 data = state->m_at_pages[offset % 0x10];
switch(offset % 8)
@@ -612,7 +612,7 @@ READ8_HANDLER(bebox_page_r)
WRITE8_HANDLER(bebox_page_w)
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
state->m_at_pages[offset % 0x10] = data;
switch(offset % 8)
@@ -639,7 +639,7 @@ WRITE8_HANDLER(bebox_page_w)
WRITE8_HANDLER(bebox_80000480_w)
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
switch(offset % 8)
{
case 1:
@@ -679,19 +679,19 @@ static WRITE_LINE_DEVICE_HANDLER( bebox_dma_hrq_changed )
static READ8_HANDLER( bebox_dma_read_byte )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16)
& 0x7FFF0000;
- return space->read_byte(page_offset + offset);
+ return space.read_byte(page_offset + offset);
}
static WRITE8_HANDLER( bebox_dma_write_byte )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
offs_t page_offset = (((offs_t) state->m_dma_offset[0][state->m_dma_channel]) << 16)
& 0x7FFF0000;
- space->write_byte(page_offset + offset, data);
+ space.write_byte(page_offset + offset, data);
}
@@ -789,7 +789,7 @@ const struct pit8253_config bebox_pit8254_config =
READ8_HANDLER( bebox_flash_r )
{
- fujitsu_29f016a_device *flash = space->machine().device<fujitsu_29f016a_device>("flash");
+ fujitsu_29f016a_device *flash = space.machine().device<fujitsu_29f016a_device>("flash");
offset = (offset & ~7) | (7 - (offset & 7));
return flash->read(offset);
}
@@ -797,7 +797,7 @@ READ8_HANDLER( bebox_flash_r )
WRITE8_HANDLER( bebox_flash_w )
{
- fujitsu_29f016a_device *flash = space->machine().device<fujitsu_29f016a_device>("flash");
+ fujitsu_29f016a_device *flash = space.machine().device<fujitsu_29f016a_device>("flash");
offset = (offset & ~7) | (7 - (offset & 7));
flash->write(offset, data);
}
@@ -840,7 +840,7 @@ static const struct kbdc8042_interface bebox_8042_interface =
static READ64_HANDLER( scsi53c810_r )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
int reg = offset*8;
UINT64 r = 0;
if (!(mem_mask & U64(0xff00000000000000))) {
@@ -874,7 +874,7 @@ static READ64_HANDLER( scsi53c810_r )
static WRITE64_HANDLER( scsi53c810_w )
{
- bebox_state *state = space->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
int reg = offset*8;
if (!(mem_mask & U64(0xff00000000000000))) {
state->m_lsi53c810->lsi53c810_reg_w(reg+0, data >> 56);
@@ -955,11 +955,11 @@ void scsi53c810_pci_write(device_t *busdevice, device_t *device, int function, i
/* brutal ugly hack; at some point the PCI code should be handling this stuff */
if (state->m_scsi53c810_data[5] != 0xFFFFFFF0)
{
- address_space *space = device->machine().device("ppc1")->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device("ppc1")->memory().space(AS_PROGRAM);
addr = (state->m_scsi53c810_data[5] | 0xC0000000) & ~0xFF;
- space->install_legacy_read_handler(addr, addr + 0xFF, FUNC(scsi53c810_r));
- space->install_legacy_write_handler(addr, addr + 0xFF, FUNC(scsi53c810_w));
+ space.install_legacy_read_handler(addr, addr + 0xFF, FUNC(scsi53c810_r));
+ space.install_legacy_write_handler(addr, addr + 0xFF, FUNC(scsi53c810_w));
}
}
break;
diff --git a/src/mess/machine/c64.c b/src/mess/machine/c64.c
index c47cdafc0e6..f5c501111f9 100644
--- a/src/mess/machine/c64.c
+++ b/src/mess/machine/c64.c
@@ -238,7 +238,7 @@ const mos6526_interface c64_pal_cia1 =
WRITE8_HANDLER( c64_roml_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
state->m_memory[offset + 0x8000] = data;
@@ -248,37 +248,37 @@ WRITE8_HANDLER( c64_roml_w )
WRITE8_HANDLER( c64_write_io )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
- sid6581_device *sid = space->machine().device<sid6581_device>("sid6581");
- device_t *vic2 = space->machine().device("vic2");
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
+ sid6581_device *sid = space.machine().device<sid6581_device>("sid6581");
+ device_t *vic2 = space.machine().device("vic2");
state->m_io_mirror[offset] = data;
if (offset < 0x400)
- vic2_port_w(vic2, *space, offset & 0x3ff, data);
+ vic2_port_w(vic2, space, offset & 0x3ff, data);
else if (offset < 0x800)
- sid->write(*space, offset & 0x3ff, data);
+ sid->write(space, offset & 0x3ff, data);
else if (offset < 0xc00)
state->m_colorram[offset & 0x3ff] = data | 0xf0;
else if (offset < 0xd00)
- mos6526_w(cia_0, *space, offset, data);
+ mos6526_w(cia_0, space, offset, data);
else if (offset < 0xe00)
{
if (state->m_cia1_on)
- mos6526_w(cia_1, *space, offset, data);
+ mos6526_w(cia_1, space, offset, data);
else
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
}
else if (offset < 0xf00)
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 1 */
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 1 */
else
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 2 */
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data)); /* i/o 2 */
}
WRITE8_HANDLER( c64_ioarea_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
if (state->m_io_enabled)
c64_write_io(space, offset, data);
else
@@ -287,17 +287,17 @@ WRITE8_HANDLER( c64_ioarea_w )
READ8_HANDLER( c64_read_io )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
- sid6581_device *sid = space->machine().device<sid6581_device>("sid6581");
- device_t *vic2 = space->machine().device("vic2");
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
+ sid6581_device *sid = space.machine().device<sid6581_device>("sid6581");
+ device_t *vic2 = space.machine().device("vic2");
if (offset < 0x400)
- return vic2_port_r(vic2, *space, offset & 0x3ff);
+ return vic2_port_r(vic2, space, offset & 0x3ff);
else if (offset < 0x800)
- return sid->read(*space, offset & 0x3ff);
+ return sid->read(space, offset & 0x3ff);
else if (offset < 0xc00)
return state->m_colorram[offset & 0x3ff];
@@ -305,24 +305,24 @@ READ8_HANDLER( c64_read_io )
else if (offset < 0xd00)
{
if (offset & 1)
- cia_set_port_mask_value(cia_0, 1, space->machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
+ cia_set_port_mask_value(cia_0, 1, space.machine().root_device().ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[9] : c64_keyline[8] );
else
cia_set_port_mask_value(cia_0, 0, state->ioport("CTRLSEL")->read() & 0x80 ? c64_keyline[8] : c64_keyline[9] );
- return mos6526_r(cia_0, *space, offset);
+ return mos6526_r(cia_0, space, offset);
}
else if (state->m_cia1_on && (offset < 0xe00))
- return mos6526_r(cia_1, *space, offset);
+ return mos6526_r(cia_1, space, offset);
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
return 0xff;
}
READ8_HANDLER( c64_ioarea_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
return state->m_io_enabled ? c64_read_io(space, offset) : state->m_io_ram_r_ptr[offset];
}
@@ -727,13 +727,13 @@ int c64_paddle_read( device_t *device, address_space &space, int which )
READ8_HANDLER( c64_colorram_read )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
return state->m_colorram[offset & 0x3ff];
}
WRITE8_HANDLER( c64_colorram_write )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
state->m_colorram[offset & 0x3ff] = data | 0xf0;
}
@@ -1377,7 +1377,7 @@ static WRITE8_HANDLER( hugo_bank_w )
int bank = ((data >> 3) & 0x0e) | BIT(data, 7);
- map_cartridge_roml(space->machine(), bank * 0x2000);
+ map_cartridge_roml(space.machine(), bank * 0x2000);
}
static void load_hugo_cartridge(device_image_interface &image)
@@ -1407,7 +1407,7 @@ static void load_hugo_cartridge(device_image_interface &image)
static WRITE8_HANDLER( easy_calc_result_bank_w )
{
- map_cartridge_romh(space->machine(), 0x2000 + (!offset * 0x2000));
+ map_cartridge_romh(space.machine(), 0x2000 + (!offset * 0x2000));
}
static void load_easy_calc_result_cartridge(device_image_interface &image)
@@ -1454,7 +1454,7 @@ static WRITE8_HANDLER( pagefox_bank_w )
*/
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 *cart = state->memregion("user1")->base();
if (data == 0xff)
@@ -1486,12 +1486,12 @@ static WRITE8_HANDLER( pagefox_bank_w )
{
state->m_roml = state->m_c64_roml;
- map_cartridge_roml(space->machine(), address);
- map_cartridge_romh(space->machine(), address + 0x2000);
+ map_cartridge_roml(space.machine(), address);
+ map_cartridge_romh(space.machine(), address + 0x2000);
}
}
- c64_bankswitch(space->machine(), 0);
+ c64_bankswitch(space.machine(), 0);
}
static void load_pagefox_cartridge(device_image_interface &image)
@@ -1506,7 +1506,7 @@ static void load_pagefox_cartridge(device_image_interface &image)
static WRITE8_HANDLER( multiscreen_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 *cart = state->memregion("user1")->base();
int bank = data & 0x0f;
offs_t address = bank * 0x4000;
@@ -1517,7 +1517,7 @@ static WRITE8_HANDLER( multiscreen_bank_w )
state->m_roml = cart + address;
state->m_roml_writable = 1;
- map_cartridge_romh(space->machine(), 0x2000);
+ map_cartridge_romh(space.machine(), 0x2000);
}
else
{
@@ -1525,11 +1525,11 @@ static WRITE8_HANDLER( multiscreen_bank_w )
state->m_roml = state->m_c64_roml;
state->m_roml_writable = 0;
- map_cartridge_roml(space->machine(), address);
- map_cartridge_romh(space->machine(), address + 0x2000);
+ map_cartridge_roml(space.machine(), address);
+ map_cartridge_romh(space.machine(), address + 0x2000);
}
- c64_bankswitch(space->machine(), 0);
+ c64_bankswitch(space.machine(), 0);
}
static void load_multiscreen_cartridge(device_image_interface &image)
@@ -1545,7 +1545,7 @@ static void load_multiscreen_cartridge(device_image_interface &image)
static WRITE8_HANDLER( simons_basic_bank_w )
{
- set_game_line(space->machine(), !BIT(data, 0));
+ set_game_line(space.machine(), !BIT(data, 0));
}
static void load_simons_basic_cartridge(device_image_interface &image)
@@ -1561,14 +1561,14 @@ static void load_simons_basic_cartridge(device_image_interface &image)
static READ8_HANDLER( super_explode_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
return state->m_roml[0x1f00 | offset];
}
static WRITE8_HANDLER( super_explode_bank_w )
{
- map_cartridge_roml(space->machine(), BIT(data, 7) * 0x2000);
+ map_cartridge_roml(space.machine(), BIT(data, 7) * 0x2000);
}
static void load_super_explode_cartridge(device_image_interface &image)
@@ -1577,8 +1577,8 @@ static void load_super_explode_cartridge(device_image_interface &image)
map_cartridge_roml(image.device().machine(), 0x0000);
- address_space *space = image.device().machine().firstcpu->space(AS_PROGRAM);
- space->install_legacy_read_handler(0xdf00, 0xdfff, FUNC(super_explode_r));
+ address_space &space = *image.device().machine().firstcpu->space(AS_PROGRAM);
+ space.install_legacy_read_handler(0xdf00, 0xdfff, FUNC(super_explode_r));
install_io2_handler(super_explode_bank_w);
}
@@ -1700,7 +1700,7 @@ static DEVICE_IMAGE_LOAD( max_cart )
static WRITE8_HANDLER( fc3_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 3
// working:
// not working:
@@ -1730,7 +1730,7 @@ static WRITE8_HANDLER( fc3_bank_w )
static WRITE8_HANDLER( ocean1_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 5
// working: Double Dragon, Ghostbusters, Terminator 2
// not working: Pang, Robocop 2, Toki
@@ -1765,7 +1765,7 @@ static WRITE8_HANDLER( ocean1_bank_w )
static WRITE8_HANDLER( funplay_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 7
// working:
// not working:
@@ -1795,7 +1795,7 @@ static WRITE8_HANDLER( funplay_bank_w )
static WRITE8_HANDLER( supergames_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 8
// working:
// not working:
@@ -1834,7 +1834,7 @@ static WRITE8_HANDLER( supergames_bank_w )
static WRITE8_HANDLER( c64gs_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 15
// working:
// not working: The Last Ninja Remix
@@ -1858,7 +1858,7 @@ static WRITE8_HANDLER( c64gs_bank_w )
static READ8_HANDLER( dinamic_bank_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 17
// working: Satan
// not working:
@@ -1883,7 +1883,7 @@ static READ8_HANDLER( dinamic_bank_r )
static READ8_HANDLER( zaxxon_bank_r )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 18
// working:
// not working:
@@ -1906,7 +1906,7 @@ static READ8_HANDLER( zaxxon_bank_r )
static WRITE8_HANDLER( domark_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 19
// working:
// not working:
@@ -1929,7 +1929,7 @@ static WRITE8_HANDLER( domark_bank_w )
static WRITE8_HANDLER( comal80_bank_w )
{
- legacy_c64_state *state = space->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
// Type # 21
// working: Comal 80
// not working:
@@ -1959,7 +1959,7 @@ static WRITE8_HANDLER( comal80_bank_w )
static void setup_c64_custom_mappers(running_machine &machine)
{
legacy_c64_state *state = machine.driver_data<legacy_c64_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
switch (state->m_cart.mapper)
{
@@ -1968,20 +1968,20 @@ static void setup_c64_custom_mappers(running_machine &machine)
case KCS_PC: /* Type # 2 not working */
break;
case FINAL_CART_III: /* Type # 3 not working - 4 16k banks, loaded at 0x8000, banks chosen by writing to 0xdfff */
- space->install_legacy_write_handler( 0xdfff, 0xdfff, FUNC(fc3_bank_w) );
+ space.install_legacy_write_handler( 0xdfff, 0xdfff, FUNC(fc3_bank_w) );
break;
case SIMONS_BASIC: /* Type # 4 not working */
break;
case OCEAN_1: /* Type # 5 - up to 64 8k banks, loaded at 0x8000 or 0xa000, banks chosen by writing to 0xde00 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(ocean1_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(ocean1_bank_w) );
break;
case EXPERT: /* Type # 6 not working */
break;
case FUN_PLAY: /* Type # 7 - 16 8k banks, loaded at 0x8000, banks chosen by writing to 0xde00 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(funplay_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(funplay_bank_w) );
break;
case SUPER_GAMES: /* Type # 8 not working */
- space->install_legacy_write_handler( 0xdf00, 0xdf00, FUNC(supergames_bank_w) );
+ space.install_legacy_write_handler( 0xdf00, 0xdf00, FUNC(supergames_bank_w) );
break;
case ATOMIC_POWER: /* Type # 9 not working */
break;
@@ -1996,21 +1996,21 @@ static void setup_c64_custom_mappers(running_machine &machine)
case MAGIC_FORMEL: /* Type # 14 not working */
break;
case C64GS: /* Type # 15 - up to 64 8k banks, loaded at 0x8000, banks chosen by writing to 0xde00 + bank */
- space->install_legacy_write_handler( 0xde00, 0xdeff, FUNC(c64gs_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xdeff, FUNC(c64gs_bank_w) );
break;
case DINAMIC: /* Type # 17 - 16 8k banks, loaded at 0x8000, banks chosen by reading to 0xde00 + bank */
- space->install_legacy_read_handler( 0xde00, 0xdeff, FUNC(dinamic_bank_r) );
+ space.install_legacy_read_handler( 0xde00, 0xdeff, FUNC(dinamic_bank_r) );
break;
case ZAXXON: /* Type # 18 */
- space->install_legacy_read_handler( 0x8000, 0x9fff, FUNC(zaxxon_bank_r) );
+ space.install_legacy_read_handler( 0x8000, 0x9fff, FUNC(zaxxon_bank_r) );
break;
case DOMARK: /* Type # 19 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(domark_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(domark_bank_w) );
break;
case SUPER_SNAP_5: /* Type # 20 not working */
break;
case COMAL_80: /* Type # 21 - 4 16k banks, loaded at 0x8000, banks chosen by writing to 0xde00 */
- space->install_legacy_write_handler( 0xde00, 0xde00, FUNC(comal80_bank_w) );
+ space.install_legacy_write_handler( 0xde00, 0xde00, FUNC(comal80_bank_w) );
break;
case GENERIC_CRT: /* Type # 0 - single bank, no bankswitch, loaded at start with correct size and place */
default:
diff --git a/src/mess/machine/c65.c b/src/mess/machine/c65.c
index 8e8a76f9eac..c2aab1fd340 100644
--- a/src/mess/machine/c65.c
+++ b/src/mess/machine/c65.c
@@ -219,22 +219,22 @@ const mos6526_interface c65_cia1 =
/* dma controller and bankswitch hardware ?*/
static READ8_HANDLER( c65_read_mem )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
UINT8 result;
if (offset <= 0x0ffff)
result = state->m_memory[offset];
else
- result = space->read_byte(offset);
+ result = space.read_byte(offset);
return result;
}
static WRITE8_HANDLER( c65_write_mem )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
if (offset <= 0x0ffff)
state->m_memory[offset] = data;
else
- space->write_byte(offset, data);
+ space.write_byte(offset, data);
}
/* dma chip at 0xd700
@@ -268,7 +268,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
PAIR pair, src, dst, len;
UINT8 cmd, fill;
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch (offset & 3)
{
@@ -299,7 +299,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
case 0:
if (src.d == 0x3ffff) state->m_dump_dma = 1;
if (state->m_dump_dma)
- DBG_LOG(space->machine(), 1,"dma copy job",
+ DBG_LOG(space.machine(), 1,"dma copy job",
("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
len.w.l, src.d, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1) ) );
@@ -333,7 +333,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
}
break;
case 3:
- DBG_LOG(space->machine(), 3,"dma fill job",
+ DBG_LOG(space.machine(), 3,"dma fill job",
("len:%.4x value:%.2x dst:%.6x sub:%.2x modrm:%.2x\n",
len.w.l, fill, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1)));
@@ -341,7 +341,7 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
c65_write_mem(space, dst.d++, fill);
break;
case 0x30:
- DBG_LOG(space->machine(), 1,"dma copy down",
+ DBG_LOG(space.machine(), 1,"dma copy down",
("len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
len.w.l, src.d, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1) ) );
@@ -349,14 +349,14 @@ static void c65_dma_port_w( running_machine &machine, int offset, int value )
c65_write_mem(space, dst.d--,c65_read_mem(space, src.d--));
break;
default:
- DBG_LOG(space->machine(), 1,"dma job",
+ DBG_LOG(space.machine(), 1,"dma job",
("cmd:%.2x len:%.4x src:%.6x dst:%.6x sub:%.2x modrm:%.2x\n",
cmd,len.w.l, src.d, dst.d, c65_read_mem(space, pair.d),
c65_read_mem(space, pair.d + 1)));
}
break;
default:
- DBG_LOG(space->machine(), 1, "dma chip write", ("%.3x %.2x\n", offset, value));
+ DBG_LOG(space.machine(), 1, "dma chip write", ("%.3x %.2x\n", offset, value));
break;
}
}
@@ -615,48 +615,48 @@ static int c65_fdc_r( running_machine &machine, int offset )
static READ8_HANDLER( c65_ram_expansion_r )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
UINT8 data = 0xff;
- if (space->machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
+ if (space.machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
data = state->m_expansion_ram.reg;
return data;
}
static WRITE8_HANDLER( c65_ram_expansion_w )
{
- c65_state *state = space->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
offs_t expansion_ram_begin;
offs_t expansion_ram_end;
- if (space->machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
+ if (space.machine().device<ram_device>(RAM_TAG)->size() > (128 * 1024))
{
state->m_expansion_ram.reg = data;
expansion_ram_begin = 0x80000;
- expansion_ram_end = 0x80000 + (space->machine().device<ram_device>(RAM_TAG)->size() - 128*1024) - 1;
+ expansion_ram_end = 0x80000 + (space.machine().device<ram_device>(RAM_TAG)->size() - 128*1024) - 1;
if (data == 0x00) {
- space->install_readwrite_bank(expansion_ram_begin, expansion_ram_end,"bank16");
- state->membank("bank16")->set_base(space->machine().device<ram_device>(RAM_TAG)->pointer() + 128*1024);
+ space.install_readwrite_bank(expansion_ram_begin, expansion_ram_end,"bank16");
+ state->membank("bank16")->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer() + 128*1024);
} else {
- space->nop_readwrite(expansion_ram_begin, expansion_ram_end);
+ space.nop_readwrite(expansion_ram_begin, expansion_ram_end);
}
}
}
static WRITE8_HANDLER( c65_write_io )
{
- sid6581_device *sid_0 = space->machine().device<sid6581_device>("sid_r");
- sid6581_device *sid_1 = space->machine().device<sid6581_device>("sid_l");
- device_t *vic3 = space->machine().device("vic3");
+ sid6581_device *sid_0 = space.machine().device<sid6581_device>("sid_r");
+ sid6581_device *sid_1 = space.machine().device<sid6581_device>("sid_l");
+ device_t *vic3 = space.machine().device("vic3");
switch (offset & 0xf00)
{
case 0x000:
if (offset < 0x80)
- vic3_port_w(vic3, *space, offset & 0x7f, data);
+ vic3_port_w(vic3, space, offset & 0x7f, data);
else if (offset < 0xa0)
- c65_fdc_w(space->machine(), offset&0x1f,data);
+ c65_fdc_w(space.machine(), offset&0x1f,data);
else
{
c65_ram_expansion_w(space, offset&0x1f, data);
@@ -666,61 +666,61 @@ static WRITE8_HANDLER( c65_write_io )
case 0x100:
case 0x200:
case 0x300:
- vic3_palette_w(vic3, *space, offset - 0x100, data);
+ vic3_palette_w(vic3, space, offset - 0x100, data);
break;
case 0x400:
if (offset<0x420) /* maybe 0x20 */
- sid_0->write(*space, offset & 0x3f, data);
+ sid_0->write(space, offset & 0x3f, data);
else if (offset<0x440)
- sid_1->write(*space, offset & 0x3f, data);
+ sid_1->write(space, offset & 0x3f, data);
else
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
break;
case 0x500:
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset, data));
break;
case 0x600:
- c65_6511_port_w(space->machine(), offset&0xff,data);
+ c65_6511_port_w(space.machine(), offset&0xff,data);
break;
case 0x700:
- c65_dma_port_w(space->machine(), offset&0xff, data);
+ c65_dma_port_w(space.machine(), offset&0xff, data);
break;
}
}
static WRITE8_HANDLER( c65_write_io_dc00 )
{
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
switch (offset & 0xf00)
{
case 0x000:
- mos6526_w(cia_0, *space, offset, data);
+ mos6526_w(cia_0, space, offset, data);
break;
case 0x100:
- mos6526_w(cia_1, *space, offset, data);
+ mos6526_w(cia_1, space, offset, data);
break;
case 0x200:
case 0x300:
- DBG_LOG(space->machine(), 1, "io write", ("%.3x %.2x\n", offset+0xc00, data));
+ DBG_LOG(space.machine(), 1, "io write", ("%.3x %.2x\n", offset+0xc00, data));
break;
}
}
static READ8_HANDLER( c65_read_io )
{
- sid6581_device *sid_0 = space->machine().device<sid6581_device>("sid_r");
- sid6581_device *sid_1 = space->machine().device<sid6581_device>("sid_l");
- device_t *vic3 = space->machine().device("vic3");
+ sid6581_device *sid_0 = space.machine().device<sid6581_device>("sid_r");
+ sid6581_device *sid_1 = space.machine().device<sid6581_device>("sid_l");
+ device_t *vic3 = space.machine().device("vic3");
switch (offset & 0xf00)
{
case 0x000:
if (offset < 0x80)
- return vic3_port_r(vic3, *space, offset & 0x7f);
+ return vic3_port_r(vic3, space, offset & 0x7f);
if (offset < 0xa0)
- return c65_fdc_r(space->machine(), offset&0x1f);
+ return c65_fdc_r(space.machine(), offset&0x1f);
else
{
return c65_ram_expansion_r(space, offset&0x1f);
@@ -731,40 +731,40 @@ static READ8_HANDLER( c65_read_io )
case 0x200:
case 0x300:
/* read only !? */
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
break;
case 0x400:
if (offset < 0x420)
- return sid_0->read(*space, offset & 0x3f);
+ return sid_0->read(space, offset & 0x3f);
if (offset < 0x440)
- return sid_1->read(*space, offset & 0x3f);
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ return sid_1->read(space, offset & 0x3f);
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
break;
case 0x500:
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset));
break;
case 0x600:
- return c65_6511_port_r(space->machine(), offset&0xff);
+ return c65_6511_port_r(space.machine(), offset&0xff);
case 0x700:
- return c65_dma_port_r(space->machine(), offset&0xff);
+ return c65_dma_port_r(space.machine(), offset&0xff);
}
return 0xff;
}
static READ8_HANDLER( c65_read_io_dc00 )
{
- device_t *cia_0 = space->machine().device("cia_0");
- device_t *cia_1 = space->machine().device("cia_1");
+ device_t *cia_0 = space.machine().device("cia_0");
+ device_t *cia_1 = space.machine().device("cia_1");
switch (offset & 0x300)
{
case 0x000:
- return mos6526_r(cia_0, *space, offset);
+ return mos6526_r(cia_0, space, offset);
case 0x100:
- return mos6526_r(cia_1, *space, offset);
+ return mos6526_r(cia_1, space, offset);
case 0x200:
case 0x300:
- DBG_LOG(space->machine(), 1, "io read", ("%.3x\n", offset+0xc00));
+ DBG_LOG(space.machine(), 1, "io read", ("%.3x\n", offset+0xc00));
break;
}
return 0xff;
diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c
index fa651d64d23..a4e2712a9f4 100644
--- a/src/mess/machine/cgenie.c
+++ b/src/mess/machine/cgenie.c
@@ -19,8 +19,8 @@
#include "machine/ram.h"
#define AYWriteReg(chip,port,value) \
- ay8910_address_w(ay8910, *space, 0,port); \
- ay8910_data_w(ay8910, *space, 0,value)
+ ay8910_address_w(ay8910, space, 0,port); \
+ ay8910_data_w(ay8910, space, 0,value)
#define TAPE_HEADER "Colour Genie - Virtual Tape File"
@@ -47,7 +47,7 @@ static TIMER_CALLBACK( handle_cassette_input )
void cgenie_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
device_t *ay8910 = machine().device("ay8910");
UINT8 *ROM = memregion("maincpu")->base();
@@ -84,21 +84,21 @@ void cgenie_state::machine_reset()
{
if ( machine().root_device().ioport("DSW0")->read() & 0x80 )
{
- space->install_read_bank(0xc000, 0xdfff, "bank10");
- space->nop_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank10");
+ space.nop_write(0xc000, 0xdfff);
membank("bank10")->set_base(&ROM[0x0c000]);
logerror("cgenie DOS enabled\n");
memcpy(&ROM[0x0c000],&ROM[0x10000], 0x2000);
}
else
{
- space->nop_readwrite(0xc000, 0xdfff);
+ space.nop_readwrite(0xc000, 0xdfff);
logerror("cgenie DOS disabled (no floppy image given)\n");
}
}
else
{
- space->nop_readwrite(0xc000, 0xdfff);
+ space.nop_readwrite(0xc000, 0xdfff);
logerror("cgenie DOS disabled\n");
memset(&machine().root_device().memregion("maincpu")->base()[0x0c000], 0x00, 0x2000);
}
@@ -106,14 +106,14 @@ void cgenie_state::machine_reset()
/* copy EXT ROM, if enabled or wipe out that memory area */
if( machine().root_device().ioport("DSW0")->read() & 0x20 )
{
- space->install_rom(0xe000, 0xefff, 0); // mess 0135u3 need to check
+ space.install_rom(0xe000, 0xefff, 0); // mess 0135u3 need to check
logerror("cgenie EXT enabled\n");
memcpy(&machine().root_device().memregion("maincpu")->base()[0x0e000],
&machine().root_device().memregion("maincpu")->base()[0x12000], 0x1000);
}
else
{
- space->nop_readwrite(0xe000, 0xefff);
+ space.nop_readwrite(0xe000, 0xefff);
logerror("cgenie EXT disabled\n");
memset(&machine().root_device().memregion("maincpu")->base()[0x0e000], 0x00, 0x1000);
}
@@ -124,7 +124,7 @@ void cgenie_state::machine_reset()
void cgenie_state::machine_start()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *gfx = memregion("gfx2")->base();
int i;
@@ -147,8 +147,8 @@ void cgenie_state::machine_start()
memset(gfx + i * 8, i, 8);
/* set up RAM */
- space->install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
- space->install_legacy_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, FUNC(cgenie_videoram_w));
+ space.install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ space.install_legacy_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, FUNC(cgenie_videoram_w));
m_videoram = machine().device<ram_device>(RAM_TAG)->pointer();
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
machine().scheduler().timer_pulse(attotime::from_hz(11025), FUNC(handle_cassette_input));
@@ -173,10 +173,10 @@ void cgenie_state::machine_start()
WRITE8_HANDLER( cgenie_port_ff_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
int port_ff_changed = state->m_port_ff ^ data;
- space->machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? -1.0 : 1.0 );
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? -1.0 : 1.0 );
/* background bits changed ? */
if( port_ff_changed & FF_BGD )
@@ -224,7 +224,7 @@ WRITE8_HANDLER( cgenie_port_ff_w )
b = 15;
}
}
- palette_set_color_rgb(space->machine(), 0, r, g, b);
+ palette_set_color_rgb(space.machine(), 0, r, g, b);
}
/* character mode changed ? */
@@ -237,7 +237,7 @@ WRITE8_HANDLER( cgenie_port_ff_w )
/* graphics mode changed ? */
if( port_ff_changed & FF_FGR )
{
- cgenie_mode_select(space->machine(), data & FF_FGR);
+ cgenie_mode_select(space.machine(), data & FF_FGR);
}
state->m_port_ff = data;
@@ -246,7 +246,7 @@ WRITE8_HANDLER( cgenie_port_ff_w )
READ8_HANDLER( cgenie_port_ff_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
UINT8 data = state->m_port_ff & ~0x01;
data |= state->m_cass_bit;
@@ -268,25 +268,25 @@ int cgenie_port_xx_r( int offset )
READ8_HANDLER( cgenie_psg_port_a_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_psg_a_inp;
}
READ8_HANDLER( cgenie_psg_port_b_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
if( state->m_psg_a_out < 0xd0 )
{
/* comparator value */
state->m_psg_b_inp = 0x00;
- if( space->machine().root_device().ioport("JOY0")->read() > state->m_psg_a_out )
+ if( space.machine().root_device().ioport("JOY0")->read() > state->m_psg_a_out )
state->m_psg_b_inp |= 0x80;
- if( space->machine().root_device().ioport("JOY1")->read() > state->m_psg_a_out )
+ if( space.machine().root_device().ioport("JOY1")->read() > state->m_psg_a_out )
state->m_psg_b_inp |= 0x40;
- if( space->machine().root_device().ioport("JOY2")->read() > state->m_psg_a_out )
+ if( space.machine().root_device().ioport("JOY2")->read() > state->m_psg_a_out )
state->m_psg_b_inp |= 0x20;
if( state->ioport("JOY3")->read() > state->m_psg_a_out )
@@ -298,113 +298,113 @@ READ8_HANDLER( cgenie_psg_port_b_r )
state->m_psg_b_inp = 0xFF;
if( !(state->m_psg_a_out & 0x01) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP0")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP0")->read();
if( !(state->m_psg_a_out & 0x02) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP1")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP1")->read();
if( !(state->m_psg_a_out & 0x04) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP2")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP2")->read();
if( !(state->m_psg_a_out & 0x08) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP3")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP3")->read();
if( !(state->m_psg_a_out & 0x10) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP4")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP4")->read();
if( !(state->m_psg_a_out & 0x20) )
- state->m_psg_b_inp &= ~space->machine().root_device().ioport("KP5")->read();
+ state->m_psg_b_inp &= ~space.machine().root_device().ioport("KP5")->read();
}
return state->m_psg_b_inp;
}
WRITE8_HANDLER( cgenie_psg_port_a_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_psg_a_out = data;
}
WRITE8_HANDLER( cgenie_psg_port_b_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_psg_b_out = data;
}
READ8_HANDLER( cgenie_status_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0 */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0;
- return wd17xx_status_r(fdc, *space, offset);
+ return wd17xx_status_r(fdc, space, offset);
}
READ8_HANDLER( cgenie_track_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
- return wd17xx_track_r(fdc, *space, offset);
+ return wd17xx_track_r(fdc, space, offset);
}
READ8_HANDLER( cgenie_sector_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
- return wd17xx_sector_r(fdc, *space, offset);
+ return wd17xx_sector_r(fdc, space, offset);
}
READ8_HANDLER(cgenie_data_r )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return 0xff;
- return wd17xx_data_r(fdc, *space, offset);
+ return wd17xx_data_r(fdc, space, offset);
}
WRITE8_HANDLER( cgenie_command_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, return immediately */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_command_w(fdc, *space, offset, data);
+ wd17xx_command_w(fdc, space, offset, data);
}
WRITE8_HANDLER( cgenie_track_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_track_w(fdc, *space, offset, data);
+ wd17xx_track_w(fdc, space, offset, data);
}
WRITE8_HANDLER( cgenie_sector_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_sector_w(fdc, *space, offset, data);
+ wd17xx_sector_w(fdc, space, offset, data);
}
WRITE8_HANDLER( cgenie_data_w )
{
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */
- if( (space->machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
+ if( (space.machine().root_device().ioport("DSW0")->read() & 0x80) == 0 )
return;
- wd17xx_data_w(fdc, *space, offset, data);
+ wd17xx_data_w(fdc, space, offset, data);
}
READ8_HANDLER( cgenie_irq_status_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
int result = state->m_irq_status;
state->m_irq_status &= ~(IRQ_TIMER | IRQ_FDC);
@@ -452,8 +452,8 @@ const wd17xx_interface cgenie_wd17xx_interface =
WRITE8_HANDLER( cgenie_motor_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
- device_t *fdc = space->machine().device("wd179x");
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
+ device_t *fdc = space.machine().device("wd179x");
UINT8 drive = 255;
logerror("cgenie motor_w $%02X\n", data);
@@ -488,28 +488,28 @@ WRITE8_HANDLER( cgenie_motor_w )
int result = 0;
if( offset & 0x01 )
- result |= space->machine().root_device().ioport("ROW0")->read();
+ result |= space.machine().root_device().ioport("ROW0")->read();
if( offset & 0x02 )
- result |= space->machine().root_device().ioport("ROW1")->read();
+ result |= space.machine().root_device().ioport("ROW1")->read();
if( offset & 0x04 )
- result |= space->machine().root_device().ioport("ROW2")->read();
+ result |= space.machine().root_device().ioport("ROW2")->read();
if( offset & 0x08 )
- result |= space->machine().root_device().ioport("ROW3")->read();
+ result |= space.machine().root_device().ioport("ROW3")->read();
if( offset & 0x10 )
- result |= space->machine().root_device().ioport("ROW4")->read();
+ result |= space.machine().root_device().ioport("ROW4")->read();
if( offset & 0x20 )
- result |= space->machine().root_device().ioport("ROW5")->read();
+ result |= space.machine().root_device().ioport("ROW5")->read();
if( offset & 0x40 )
- result |= space->machine().root_device().ioport("ROW6")->read();
+ result |= space.machine().root_device().ioport("ROW6")->read();
if( offset & 0x80 )
- result |= space->machine().root_device().ioport("ROW7")->read();
+ result |= space.machine().root_device().ioport("ROW7")->read();
return result;
}
@@ -527,7 +527,7 @@ int cgenie_videoram_r( running_machine &machine, int offset )
WRITE8_HANDLER( cgenie_videoram_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
UINT8 *videoram = state->m_videoram;
/* write to video RAM */
if( data == videoram[offset] )
@@ -537,13 +537,13 @@ WRITE8_HANDLER( cgenie_videoram_w )
READ8_HANDLER( cgenie_colorram_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_colorram[offset] | 0xf0;
}
WRITE8_HANDLER( cgenie_colorram_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
/* only bits 0 to 3 */
data &= 15;
/* nothing changed ? */
@@ -553,18 +553,18 @@ WRITE8_HANDLER( cgenie_colorram_w )
/* set new value */
state->m_colorram[offset] = data;
/* make offset relative to video frame buffer offset */
- offset = (offset + (cgenie_get_register(space->machine(), 12) << 8) + cgenie_get_register(space->machine(), 13)) & 0x3ff;
+ offset = (offset + (cgenie_get_register(space.machine(), 12) << 8) + cgenie_get_register(space.machine(), 13)) & 0x3ff;
}
READ8_HANDLER( cgenie_fontram_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_fontram[offset];
}
WRITE8_HANDLER( cgenie_fontram_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
UINT8 *dp;
if( data == state->m_fontram[offset] )
@@ -574,7 +574,7 @@ WRITE8_HANDLER( cgenie_fontram_w )
state->m_fontram[offset] = data;
/* convert eight pixels */
- dp = const_cast<UINT8 *>(space->machine().gfx[0]->get_data(256 + offset/8) + (offset % 8) * space->machine().gfx[0]->width());
+ dp = const_cast<UINT8 *>(space.machine().gfx[0]->get_data(256 + offset/8) + (offset % 8) * space.machine().gfx[0]->width());
dp[0] = (data & 0x80) ? 1 : 0;
dp[1] = (data & 0x40) ? 1 : 0;
dp[2] = (data & 0x20) ? 1 : 0;
@@ -599,7 +599,7 @@ INTERRUPT_GEN( cgenie_frame_interrupt )
state->m_tv_mode = state->ioport("DSW0")->read() & 0x10;
/* force setting of background color */
state->m_port_ff ^= FF_BGD0;
- cgenie_port_ff_w(device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_port_ff ^ FF_BGD0);
+ cgenie_port_ff_w(*device->machine().device("maincpu")->memory().space(AS_PROGRAM), 0, state->m_port_ff ^ FF_BGD0);
}
}
diff --git a/src/mess/machine/comx_clm.c b/src/mess/machine/comx_clm.c
index 41ddcb834b9..4dd001b91ec 100644
--- a/src/mess/machine/comx_clm.c
+++ b/src/mess/machine/comx_clm.c
@@ -251,7 +251,7 @@ void comx_clm_device::comx_ds_w(int state)
UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
{
- address_space *space = machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine().firstcpu->space(AS_PROGRAM);
UINT8 data = 0xff;
@@ -265,7 +265,7 @@ UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
}
else if (offset == 0xd801)
{
- data = m_crtc->register_r(*space, 0);
+ data = m_crtc->register_r(space, 0);
}
return data;
@@ -278,7 +278,7 @@ UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
void comx_clm_device::comx_mwr_w(offs_t offset, UINT8 data)
{
- address_space *space = machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine().firstcpu->space(AS_PROGRAM);
if (offset >= 0xd000 && offset < 0xd800)
{
@@ -286,10 +286,10 @@ void comx_clm_device::comx_mwr_w(offs_t offset, UINT8 data)
}
else if (offset == 0xd800)
{
- m_crtc->address_w(*space, 0, data);
+ m_crtc->address_w(space, 0, data);
}
else if (offset == 0xd801)
{
- m_crtc->register_w(*space, 0, data);
+ m_crtc->register_w(space, 0, data);
}
}
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index 21fa573bb55..49634356280 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -276,7 +276,7 @@ READ16_MEMBER(concept_state::concept_io_r)
{
int slot = ((offset >> 4) & 7) - 1;
if (m_expansion_slots[slot].reg_read)
- return m_expansion_slots[slot].reg_read(&space, offset & 0xf);
+ return m_expansion_slots[slot].reg_read(space, offset & 0xf);
}
break;
@@ -299,7 +299,7 @@ READ16_MEMBER(concept_state::concept_io_r)
int slot = ((offset >> 8) & 7) - 1;
LOG(("concept_io_r: Slot ROM memory accessed for slot %d at address 0x03%4.4x\n", slot, offset << 1));
if (m_expansion_slots[slot].rom_read)
- return m_expansion_slots[slot].rom_read(&space, offset & 0xff);
+ return m_expansion_slots[slot].rom_read(space, offset & 0xff);
}
break;
@@ -418,7 +418,7 @@ WRITE16_MEMBER(concept_state::concept_io_w)
LOG(("concept_io_w: Slot I/O register written for slot %d at address 0x03%4.4x, data: 0x%4.4x\n",
slot, offset << 1, data));
if (m_expansion_slots[slot].reg_write)
- m_expansion_slots[slot].reg_write(&space, offset & 0xf, data);
+ m_expansion_slots[slot].reg_write(space, offset & 0xf, data);
}
break;
@@ -441,7 +441,7 @@ WRITE16_MEMBER(concept_state::concept_io_w)
int slot = ((offset >> 8) & 7) - 1;
LOG(("concept_io_w: Slot ROM memory written to for slot %d at address 0x03%4.4x, data: 0x%4.4x\n", slot, offset << 1, data));
if (m_expansion_slots[slot].rom_write)
- m_expansion_slots[slot].rom_write(&space, offset & 0xff, data);
+ m_expansion_slots[slot].rom_write(space, offset & 0xff, data);
}
break;
@@ -589,8 +589,8 @@ const wd17xx_interface concept_wd17xx_interface =
static READ8_HANDLER(concept_fdc_reg_r)
{
- concept_state *state = space->machine().driver_data<concept_state>();
- device_t *fdc = space->machine().device("wd179x");
+ concept_state *state = space.machine().driver_data<concept_state>();
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
case 0:
@@ -599,19 +599,19 @@ static READ8_HANDLER(concept_fdc_reg_r)
case 8:
/* FDC STATUS REG */
- return wd17xx_status_r(fdc, *space, offset);
+ return wd17xx_status_r(fdc, space, offset);
case 9:
/* FDC TRACK REG */
- return wd17xx_track_r(fdc, *space, offset);
+ return wd17xx_track_r(fdc, space, offset);
case 10:
/* FDC SECTOR REG */
- return wd17xx_sector_r(fdc, *space, offset);
+ return wd17xx_sector_r(fdc, space, offset);
case 11:
/* FDC DATA REG */
- return wd17xx_data_r(fdc, *space, offset);
+ return wd17xx_data_r(fdc, space, offset);
}
return 0;
@@ -619,9 +619,9 @@ static READ8_HANDLER(concept_fdc_reg_r)
static WRITE8_HANDLER(concept_fdc_reg_w)
{
- concept_state *state = space->machine().driver_data<concept_state>();
+ concept_state *state = space.machine().driver_data<concept_state>();
int current_drive;
- device_t *fdc = space->machine().device("wd179x");
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
case 0:
@@ -635,27 +635,27 @@ static WRITE8_HANDLER(concept_fdc_reg_w)
// floppy_drive_set_motor_state(floppy_get_device(machine, current_drive), (data & LC_MOTOROF_mask) == 0 ? 1 : 0);
/*flp_8in = (data & LC_FLP8IN_mask) != 0;*/
wd17xx_dden_w(fdc, BIT(data, 7));
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), current_drive), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), current_drive), 1, 0);
break;
case 8:
/* FDC COMMAMD REG */
- wd17xx_command_w(fdc, *space, offset, data);
+ wd17xx_command_w(fdc, space, offset, data);
break;
case 9:
/* FDC TRACK REG */
- wd17xx_track_w(fdc, *space, offset, data);
+ wd17xx_track_w(fdc, space, offset, data);
break;
case 10:
/* FDC SECTOR REG */
- wd17xx_sector_w(fdc, *space, offset, data);
+ wd17xx_sector_w(fdc, space, offset, data);
break;
case 11:
/* FDC DATA REG */
- wd17xx_data_w(fdc, *space, offset, data);
+ wd17xx_data_w(fdc, space, offset, data);
break;
}
}
diff --git a/src/mess/machine/corvushd.c b/src/mess/machine/corvushd.c
index 13c0b8818f2..d29a3097808 100644
--- a/src/mess/machine/corvushd.c
+++ b/src/mess/machine/corvushd.c
@@ -1622,14 +1622,14 @@ READ8_HANDLER ( corvus_hdc_data_r ) {
c->xmit_bytes = 0; // We don't have anything more to say
c->recv_bytes = 0; // No active commands
- space->machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_HTC_MODE);
+ space.machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_HTC_MODE);
// c->status &= ~(CONTROLLER_DIRECTION | CONTROLLER_BUSY); // Put us in Idle, Host-to-Controller mode
} else {
//
// Not finished with this packet. Insert an interbyte delay and then let the host continue
//
- space->machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
+ space.machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
}
return result;
@@ -1692,7 +1692,7 @@ WRITE8_HANDLER ( corvus_hdc_data_w ) {
// to the user with us Ready for more data and in Host-to-Controller mode.
//
if(c->offset == c->recv_bytes) { // We've received enough data to process
- corvus_process_command_packet(space->machine(), c->invalid_command_flag);
+ corvus_process_command_packet(space.machine(), c->invalid_command_flag);
} else {
//
// Reset the four-second timer since we received some data
@@ -1703,6 +1703,6 @@ WRITE8_HANDLER ( corvus_hdc_data_w ) {
// Make the controller busy for a few microseconds while the command is processed
//
c->status |= CONTROLLER_BUSY;
- space->machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
+ space.machine().scheduler().timer_set((attotime::from_usec(INTERBYTE_DELAY)), FUNC(corvus_hdc_callback), CALLBACK_SAME_MODE);
}
}
diff --git a/src/mess/machine/cpc_ssa1.c b/src/mess/machine/cpc_ssa1.c
index d8f3e5d71db..59586d1a407 100644
--- a/src/mess/machine/cpc_ssa1.c
+++ b/src/mess/machine/cpc_ssa1.c
@@ -187,28 +187,28 @@ cpc_dkspeech_device::cpc_dkspeech_device(const machine_config &mconfig, const ch
void cpc_ssa1_device::device_start()
{
device_t* cpu = machine().device("maincpu");
- address_space* space = cpu->memory().space(AS_IO);
+ address_space& space = *cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
m_rom = memregion("sp0256")->base();
// m_sp0256_device = subdevice("sp0256");
- space->install_readwrite_handler(0xfaee,0xfaee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
- space->install_readwrite_handler(0xfbee,0xfbee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
+ space.install_readwrite_handler(0xfaee,0xfaee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
+ space.install_readwrite_handler(0xfbee,0xfbee,0,0,read8_delegate(FUNC(cpc_ssa1_device::ssa1_r),this),write8_delegate(FUNC(cpc_ssa1_device::ssa1_w),this));
}
void cpc_dkspeech_device::device_start()
{
device_t* cpu = machine().device("maincpu");
- address_space* space = cpu->memory().space(AS_IO);
+ address_space& space = *cpu->memory().space(AS_IO);
m_slot = dynamic_cast<cpc_expansion_slot_device *>(owner());
m_rom = memregion("sp0256")->base();
// m_sp0256_device = subdevice("sp0256");
- space->install_readwrite_handler(0xfbfe,0xfbfe,0,0,read8_delegate(FUNC(cpc_dkspeech_device::dkspeech_r),this),write8_delegate(FUNC(cpc_dkspeech_device::dkspeech_w),this));
+ space.install_readwrite_handler(0xfbfe,0xfbfe,0,0,read8_delegate(FUNC(cpc_dkspeech_device::dkspeech_r),this),write8_delegate(FUNC(cpc_dkspeech_device::dkspeech_w),this));
}
//-------------------------------------------------
diff --git a/src/mess/machine/dccons.c b/src/mess/machine/dccons.c
index 3d672c6ee84..4a3ebf2231d 100644
--- a/src/mess/machine/dccons.c
+++ b/src/mess/machine/dccons.c
@@ -147,7 +147,7 @@ static TIMER_CALLBACK( atapi_xfer_end )
static READ32_HANDLER( atapi_r )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
int reg, data;
if (mem_mask == 0x0000ffff) // word-wide command read
@@ -261,7 +261,7 @@ static READ32_HANDLER( atapi_r )
}
#endif
- mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, space->device().safe_pc());
+ mame_printf_debug("ATAPI: read reg %d = %x (PC=%x)\n", reg, data, space.device().safe_pc());
}
// printf( "atapi_r( %08x, %08x ) %08x\n", offset, mem_mask, data );
@@ -270,7 +270,7 @@ static READ32_HANDLER( atapi_r )
static WRITE32_HANDLER( atapi_w )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
int reg;
// printf( "atapi_w( %08x, %08x, %08x )\n", offset, mem_mask, data );
@@ -369,7 +369,7 @@ static WRITE32_HANDLER( atapi_w )
case 0x45: // PLAY
atapi_regs[ATAPI_REG_CMDSTATUS] = ATAPI_STAT_BSY;
- atapi_timer->adjust( downcast<cpu_device *>(&space->device())->cycles_to_attotime(ATAPI_CYCLES_PER_SECTOR ) );
+ atapi_timer->adjust( downcast<cpu_device *>(&space.device())->cycles_to_attotime(ATAPI_CYCLES_PER_SECTOR ) );
break;
}
@@ -420,11 +420,11 @@ static WRITE32_HANDLER( atapi_w )
}
#endif
atapi_regs[reg] = data;
-// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, space->device().safe_pc());
+// mame_printf_debug("ATAPI: reg %d = %x (offset %x mask %x PC=%x)\n", reg, data, offset, mem_mask, space.device().safe_pc());
if (reg == ATAPI_REG_CMDSTATUS)
{
- printf("ATAPI command %x issued! (PC=%x)\n", data, space->device().safe_pc());
+ printf("ATAPI command %x issued! (PC=%x)\n", data, space.device().safe_pc());
switch (data)
{
@@ -491,7 +491,7 @@ static WRITE32_HANDLER( atapi_w )
atapi_regs[ATAPI_REG_COUNTLOW] = 0;
atapi_regs[ATAPI_REG_COUNTHIGH] = 2;
- gdrom_raise_irq(space->machine());
+ gdrom_raise_irq(space.machine());
break;
case 0xef: // SET FEATURES
@@ -512,7 +512,7 @@ static WRITE32_HANDLER( atapi_w )
atapi_data_ptr = 0;
atapi_data_len = 0;
- gdrom_raise_irq(space->machine());
+ gdrom_raise_irq(space.machine());
break;
default:
@@ -603,7 +603,7 @@ READ64_HANDLER( dc_mess_gdrom_r )
off=offset << 1;
}
-// printf("gdrom_r: @ %x (off %x), mask %llx (PC %x)\n", offset, off, mem_mask, space->device().safe_pc());
+// printf("gdrom_r: @ %x (off %x), mask %llx (PC %x)\n", offset, off, mem_mask, space.device().safe_pc());
if (offset == 3)
{
@@ -632,7 +632,7 @@ WRITE64_HANDLER( dc_mess_gdrom_w )
off=offset << 1;
}
-// printf("GDROM: [%08x=%x]write %llx to %x, mask %llx (PC %x)\n", 0x5f7000+off*4, dat, data, offset, mem_mask, space->device().safe_pc());
+// printf("GDROM: [%08x=%x]write %llx to %x, mask %llx (PC %x)\n", 0x5f7000+off*4, dat, data, offset, mem_mask, space.device().safe_pc());
if (off >= 0x20)
{
@@ -667,23 +667,23 @@ INLINE int decode_reg32_64(running_machine &machine, UINT32 offset, UINT64 mem_m
READ64_HANDLER( dc_mess_g1_ctrl_r )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
mame_printf_verbose("G1CTRL: Unmapped read %08x\n", 0x5f7400+reg*4);
return (UINT64)state->g1bus_regs[reg] << shift;
}
WRITE64_HANDLER( dc_mess_g1_ctrl_w )
{
- dc_state *state = space->machine().driver_data<dc_state>();
+ dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat; //, old
- reg = decode_reg32_64(space->machine(), offset, mem_mask, &shift);
+ reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
// old = state->g1bus_regs[reg];
@@ -701,7 +701,7 @@ WRITE64_HANDLER( dc_mess_g1_ctrl_w )
}
atapi_xferbase = state->g1bus_regs[SB_GDSTAR];
- atapi_timer->adjust(space->machine().device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))));
+ atapi_timer->adjust(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime((ATAPI_CYCLES_PER_SECTOR * (atapi_xferlen/2048))));
}
break;
}
diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c
index 4ab54b510bc..983c9b999bd 100644
--- a/src/mess/machine/dgn_beta.c
+++ b/src/mess/machine/dgn_beta.c
@@ -366,7 +366,7 @@ static void SetDefaultTask(running_machine &machine)
// Return the value of a page register
READ8_HANDLER( dgn_beta_page_r )
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
return state->m_PageRegs[state->m_PIATaskReg][offset].value;
}
@@ -376,16 +376,16 @@ READ8_HANDLER( dgn_beta_page_r )
WRITE8_HANDLER( dgn_beta_page_w )
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
state->m_PageRegs[state->m_PIATaskReg][offset].value=data;
LOG_PAGE_WRITE(("PageRegWrite : task=$%X offset=$%X value=$%X\n",state->m_PIATaskReg,offset,data));
if (state->m_EnableMapRegs)
{
- UpdateBanks(space->machine(), offset,offset);
+ UpdateBanks(space.machine(), offset,offset);
if (offset==15)
- UpdateBanks(space->machine(), offset+1,offset+1);
+ UpdateBanks(space.machine(), offset+1,offset+1);
}
}
@@ -399,87 +399,87 @@ static void dgn_beta_bank_memory(running_machine &machine, int offset, int data,
static WRITE8_HANDLER( dgnbeta_ram_b0_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,0);
+ dgn_beta_bank_memory(space.machine(),offset,data,0);
}
static WRITE8_HANDLER( dgnbeta_ram_b1_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,1);
+ dgn_beta_bank_memory(space.machine(),offset,data,1);
}
static WRITE8_HANDLER( dgnbeta_ram_b2_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,2);
+ dgn_beta_bank_memory(space.machine(),offset,data,2);
}
static WRITE8_HANDLER( dgnbeta_ram_b3_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,3);
+ dgn_beta_bank_memory(space.machine(),offset,data,3);
}
static WRITE8_HANDLER( dgnbeta_ram_b4_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,4);
+ dgn_beta_bank_memory(space.machine(),offset,data,4);
}
static WRITE8_HANDLER( dgnbeta_ram_b5_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,5);
+ dgn_beta_bank_memory(space.machine(),offset,data,5);
}
static WRITE8_HANDLER( dgnbeta_ram_b6_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,6);
+ dgn_beta_bank_memory(space.machine(),offset,data,6);
}
static WRITE8_HANDLER( dgnbeta_ram_b7_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,7);
+ dgn_beta_bank_memory(space.machine(),offset,data,7);
}
static WRITE8_HANDLER( dgnbeta_ram_b8_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,8);
+ dgn_beta_bank_memory(space.machine(),offset,data,8);
}
static WRITE8_HANDLER( dgnbeta_ram_b9_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,9);
+ dgn_beta_bank_memory(space.machine(),offset,data,9);
}
static WRITE8_HANDLER( dgnbeta_ram_bA_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,10);
+ dgn_beta_bank_memory(space.machine(),offset,data,10);
}
static WRITE8_HANDLER( dgnbeta_ram_bB_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,11);
+ dgn_beta_bank_memory(space.machine(),offset,data,11);
}
static WRITE8_HANDLER( dgnbeta_ram_bC_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,12);
+ dgn_beta_bank_memory(space.machine(),offset,data,12);
}
static WRITE8_HANDLER( dgnbeta_ram_bD_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,13);
+ dgn_beta_bank_memory(space.machine(),offset,data,13);
}
static WRITE8_HANDLER( dgnbeta_ram_bE_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,14);
+ dgn_beta_bank_memory(space.machine(),offset,data,14);
}
static WRITE8_HANDLER( dgnbeta_ram_bF_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,15);
+ dgn_beta_bank_memory(space.machine(),offset,data,15);
}
static WRITE8_HANDLER( dgnbeta_ram_bG_w )
{
- dgn_beta_bank_memory(space->machine(),offset,data,16);
+ dgn_beta_bank_memory(space.machine(),offset,data,16);
}
/*
@@ -934,22 +934,22 @@ const wd17xx_interface dgnbeta_wd17xx_interface =
READ8_HANDLER(dgnbeta_wd2797_r)
{
int result = 0;
- device_t *fdc = space->machine().device(FDC_TAG);
+ device_t *fdc = space.machine().device(FDC_TAG);
switch(offset & 0x03)
{
case 0:
- result = wd17xx_status_r(fdc, *space, 0);
+ result = wd17xx_status_r(fdc, space, 0);
LOG_DISK(("Disk status=%2.2X\n",result));
break;
case 1:
- result = wd17xx_track_r(fdc, *space, 0);
+ result = wd17xx_track_r(fdc, space, 0);
break;
case 2:
- result = wd17xx_sector_r(fdc, *space, 0);
+ result = wd17xx_sector_r(fdc, space, 0);
break;
case 3:
- result = wd17xx_data_r(fdc, *space, 0);
+ result = wd17xx_data_r(fdc, space, 0);
break;
default:
break;
@@ -960,8 +960,8 @@ READ8_HANDLER(dgnbeta_wd2797_r)
WRITE8_HANDLER(dgnbeta_wd2797_w)
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
- device_t *fdc = space->machine().device(FDC_TAG);
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
+ device_t *fdc = space.machine().device(FDC_TAG);
state->m_wd2797_written=1;
@@ -972,16 +972,16 @@ WRITE8_HANDLER(dgnbeta_wd2797_w)
/* But only for Type 3/4 commands */
if(data & 0x80)
wd17xx_set_side(fdc,(data & 0x02) ? 1 : 0);
- wd17xx_command_w(fdc, *space, 0, data);
+ wd17xx_command_w(fdc, space, 0, data);
break;
case 1:
- wd17xx_track_w(fdc, *space, 0, data);
+ wd17xx_track_w(fdc, space, 0, data);
break;
case 2:
- wd17xx_sector_w(fdc, *space, 0, data);
+ wd17xx_sector_w(fdc, space, 0, data);
break;
case 3:
- wd17xx_data_w(fdc, *space, 0, data);
+ wd17xx_data_w(fdc, space, 0, data);
break;
};
}
diff --git a/src/mess/machine/europc.c b/src/mess/machine/europc.c
index afe31335093..0eef5b92566 100644
--- a/src/mess/machine/europc.c
+++ b/src/mess/machine/europc.c
@@ -114,15 +114,15 @@ WRITE8_HANDLER ( europc_jim_w )
}
// mode= data&0x10?AGA_COLOR:AGA_MONO;
// mode= data&0x10?AGA_COLOR:AGA_OFF;
- pc_aga_set_mode(space->machine(), europc_jim.mode);
+ pc_aga_set_mode(space.machine(), europc_jim.mode);
if (data & 0x80) europc_jim.state = 0;
break;
case 4:
switch(data & 0xc0)
{
- case 0x00: space->machine().device("maincpu")->set_clock_scale(1.0 / 2); break;
- case 0x40: space->machine().device("maincpu")->set_clock_scale(3.0 / 4); break;
- default: space->machine().device("maincpu")->set_clock_scale(1); break;
+ case 0x00: space.machine().device("maincpu")->set_clock_scale(1.0 / 2); break;
+ case 0x40: space.machine().device("maincpu")->set_clock_scale(3.0 / 4); break;
+ default: space.machine().device("maincpu")->set_clock_scale(1); break;
}
break;
case 0xa:
@@ -178,8 +178,8 @@ WRITE8_HANDLER( europc_pio_w )
europc_pio.port61=data;
// if (data == 0x30) pc1640.port62 = (pc1640.port65 & 0x10) >> 4;
// else if (data == 0x34) pc1640.port62 = pc1640.port65 & 0xf;
- pit8253_gate2_w(space->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata(space->machine(), BIT(data, 1));
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata(space.machine(), BIT(data, 1));
pc_keyb_set_clock(BIT(data, 6));
break;
}
@@ -201,7 +201,7 @@ WRITE8_HANDLER( europc_pio_w )
data = europc_pio.port61;
break;
case 2:
- if (pit8253_get_output(space->machine().device("pit8253"), 2))
+ if (pit8253_get_output(space.machine().device("pit8253"), 2))
data |= 0x20;
break;
}
diff --git a/src/mess/machine/galaxy.c b/src/mess/machine/galaxy.c
index f9e76756319..937985f41c7 100644
--- a/src/mess/machine/galaxy.c
+++ b/src/mess/machine/galaxy.c
@@ -155,13 +155,13 @@ SNAPSHOT_LOAD( galaxy )
DRIVER_INIT_MEMBER(galaxy_state,galaxy)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_readwrite_bank( 0x2800, 0x2800 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.install_readwrite_bank( 0x2800, 0x2800 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
membank("bank1")->set_base(machine().device<ram_device>(RAM_TAG)->pointer());
if (machine().device<ram_device>(RAM_TAG)->size() < (6 + 48) * 1024)
{
- space->nop_readwrite( 0x2800 + machine().device<ram_device>(RAM_TAG)->size(), 0xffff);
+ space.nop_readwrite( 0x2800 + machine().device<ram_device>(RAM_TAG)->size(), 0xffff);
}
}
@@ -171,15 +171,15 @@ DRIVER_INIT_MEMBER(galaxy_state,galaxy)
MACHINE_RESET_MEMBER(galaxy_state,galaxy)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* ROM 2 enable/disable */
if (machine().root_device().ioport("ROM2")->read()) {
- space->install_read_bank(0x1000, 0x1fff, "bank10");
+ space.install_read_bank(0x1000, 0x1fff, "bank10");
} else {
- space->nop_read(0x1000, 0x1fff);
+ space.nop_read(0x1000, 0x1fff);
}
- space->nop_write(0x1000, 0x1fff);
+ space.nop_write(0x1000, 0x1fff);
if (machine().root_device().ioport("ROM2")->read())
membank("bank10")->set_base(machine().root_device().memregion("maincpu")->base() + 0x1000);
@@ -196,7 +196,7 @@ DRIVER_INIT_MEMBER(galaxy_state,galaxyp)
MACHINE_RESET_MEMBER(galaxy_state,galaxyp)
{
UINT8 *ROM = machine().root_device().memregion("maincpu")->base();
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(galaxy_irq_callback);
@@ -205,8 +205,8 @@ MACHINE_RESET_MEMBER(galaxy_state,galaxyp)
ROM[0x03fa] = 0x00;
ROM[0x03fb] = 0xe0;
- space->install_read_bank(0xe000, 0xefff, "bank11");
- space->nop_write(0xe000, 0xefff);
+ space.install_read_bank(0xe000, 0xefff, "bank11");
+ space.nop_write(0xe000, 0xefff);
membank("bank11")->set_base(memregion("maincpu")->base() + 0xe000);
m_interrupts_enabled = TRUE;
}
diff --git a/src/mess/machine/gb.c b/src/mess/machine/gb.c
index 9d23997a3e0..2c4b9fa4a56 100644
--- a/src/mess/machine/gb.c
+++ b/src/mess/machine/gb.c
@@ -154,7 +154,7 @@ static void gb_rom8_6000( running_machine &machine, UINT8 *addr )
static void gb_init(running_machine &machine)
{
gb_state *state = machine.driver_data<gb_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
/* Initialize the memory banks */
state->m_MBC1Mode = 0;
@@ -182,63 +182,63 @@ static void gb_init(running_machine &machine)
case MBC_NONE:
break;
case MBC_MMM01:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_0000_w),state) );
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_2000_w),state));
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_4000_w),state));
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_6000_w),state));
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_0000_w),state) );
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_2000_w),state));
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_4000_w),state));
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_mmm01_6000_w),state));
break;
case MBC_MBC1:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1),state) );
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1),state) );
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1),state) );
break;
case MBC_MBC2:
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc2),state) );
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc2),state) );
break;
case MBC_MBC3:
case MBC_HUC1: /* Possibly wrong */
case MBC_HUC3: /* Possibly wrong */
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc3),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc3),state) );
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc3),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc3),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc3),state) );
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc3),state) );
break;
case MBC_MBC5:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc5),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc5),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc5),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc5),state) );
break;
case MBC_MBC6:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc6),state) );
- space->install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_1),state) );
- space->install_write_handler( 0x3000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_2),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc6),state) );
+ space.install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_1),state) );
+ space.install_write_handler( 0x3000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc6_2),state) );
break;
case MBC_MBC7:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
- space->install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc7),state) );
- space->install_write_handler( 0x3000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_unknown_mbc7),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) );
+ space.install_write_handler( 0x2000, 0x2fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc7),state) );
+ space.install_write_handler( 0x3000, 0x7fff, write8_delegate(FUNC(gb_state::gb_rom_bank_unknown_mbc7),state) );
break;
case MBC_TAMA5:
- space->install_write_handler( 0xA000, 0xBFFF, write8_delegate(FUNC(gb_state::gb_ram_tama5),state) );
+ space.install_write_handler( 0xA000, 0xBFFF, write8_delegate(FUNC(gb_state::gb_ram_tama5),state) );
break;
case MBC_WISDOM:
- space->install_write_handler( 0x0000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_wisdom),state) );
+ space.install_write_handler( 0x0000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_wisdom),state) );
break;
case MBC_MBC1_KOR:
- space->install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
- space->install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1_kor),state) );
- space->install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1_kor),state) );
- space->install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1_kor),state) );
+ space.install_write_handler( 0x0000, 0x1fff, write8_delegate(FUNC(gb_state::gb_ram_enable),state) ); /* We don't emulate RAM enable yet */
+ space.install_write_handler( 0x2000, 0x3fff, write8_delegate(FUNC(gb_state::gb_rom_bank_select_mbc1_kor),state) );
+ space.install_write_handler( 0x4000, 0x5fff, write8_delegate(FUNC(gb_state::gb_ram_bank_select_mbc1_kor),state) );
+ space.install_write_handler( 0x6000, 0x7fff, write8_delegate(FUNC(gb_state::gb_mem_mode_select_mbc1_kor),state) );
break;
case MBC_MEGADUCK:
- space->install_write_handler( 0x0001, 0x0001, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type1),state) );
- space->install_write_handler( 0xB000, 0xB000, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type2),state) );
+ space.install_write_handler( 0x0001, 0x0001, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type1),state) );
+ space.install_write_handler( 0xB000, 0xB000, write8_delegate(FUNC(gb_state::megaduck_rom_bank_select_type2),state) );
break;
}
- gb_sound_w(space->machine().device("custom"), *space, 0x16, 0x00 ); /* Initialize sound hardware */
+ gb_sound_w(space.machine().device("custom"), space, 0x16, 0x00 ); /* Initialize sound hardware */
state->m_divcount = 0;
state->m_triggering_irq = 0;
diff --git a/src/mess/machine/hd63450.c b/src/mess/machine/hd63450.c
index 26c1f1df0ee..0e4c5c35b25 100644
--- a/src/mess/machine/hd63450.c
+++ b/src/mess/machine/hd63450.c
@@ -237,7 +237,7 @@ void hd63450_write(device_t* device, int offset, int data, UINT16 mem_mask)
static void dma_transfer_start(device_t* device, int channel, int dir)
{
- address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
hd63450_t* dmac = get_safe_token(device);
dmac->in_progress[channel] = 1;
dmac->reg[channel].csr &= ~0xe0;
@@ -245,9 +245,9 @@ static void dma_transfer_start(device_t* device, int channel, int dir)
dmac->reg[channel].csr &= ~0x30; // Reset Error and Normal termination bits
if((dmac->reg[channel].ocr & 0x0c) != 0x00) // Array chain or Link array chain
{
- dmac->reg[channel].mar = space->read_word(dmac->reg[channel].bar) << 16;
- dmac->reg[channel].mar |= space->read_word(dmac->reg[channel].bar+2);
- dmac->reg[channel].mtc = space->read_word(dmac->reg[channel].bar+4);
+ dmac->reg[channel].mar = space.read_word(dmac->reg[channel].bar) << 16;
+ dmac->reg[channel].mar |= space.read_word(dmac->reg[channel].bar+2);
+ dmac->reg[channel].mtc = space.read_word(dmac->reg[channel].bar+4);
if(dmac->reg[channel].btc > 0)
dmac->reg[channel].btc--;
}
@@ -314,7 +314,7 @@ static void dma_transfer_continue(device_t* device, int channel)
void hd63450_single_transfer(device_t* device, int x)
{
- address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
+ address_space &space = *device->machine().firstcpu->space(AS_PROGRAM);
int data;
int datasize = 1;
hd63450_t* dmac = get_safe_token(device);
@@ -328,7 +328,7 @@ void hd63450_single_transfer(device_t* device, int x)
data = dmac->intf->dma_read[x](device->machine(),dmac->reg[x].mar);
if(data == -1)
return; // not ready to receive data
- space->write_byte(dmac->reg[x].mar,data);
+ space.write_byte(dmac->reg[x].mar,data);
datasize = 1;
}
else
@@ -336,25 +336,25 @@ void hd63450_single_transfer(device_t* device, int x)
switch(dmac->reg[x].ocr & 0x30) // operation size
{
case 0x00: // 8 bit
- data = space->read_byte(dmac->reg[x].dar); // read from device address
- space->write_byte(dmac->reg[x].mar, data); // write to memory address
+ data = space.read_byte(dmac->reg[x].dar); // read from device address
+ space.write_byte(dmac->reg[x].mar, data); // write to memory address
datasize = 1;
break;
case 0x10: // 16 bit
- data = space->read_word(dmac->reg[x].dar); // read from device address
- space->write_word(dmac->reg[x].mar, data); // write to memory address
+ data = space.read_word(dmac->reg[x].dar); // read from device address
+ space.write_word(dmac->reg[x].mar, data); // write to memory address
datasize = 2;
break;
case 0x20: // 32 bit
- data = space->read_word(dmac->reg[x].dar) << 16; // read from device address
- data |= space->read_word(dmac->reg[x].dar+2);
- space->write_word(dmac->reg[x].mar, (data & 0xffff0000) >> 16); // write to memory address
- space->write_word(dmac->reg[x].mar+2, data & 0x0000ffff);
+ data = space.read_word(dmac->reg[x].dar) << 16; // read from device address
+ data |= space.read_word(dmac->reg[x].dar+2);
+ space.write_word(dmac->reg[x].mar, (data & 0xffff0000) >> 16); // write to memory address
+ space.write_word(dmac->reg[x].mar+2, data & 0x0000ffff);
datasize = 4;
break;
case 0x30: // 8 bit packed (?)
- data = space->read_byte(dmac->reg[x].dar); // read from device address
- space->write_byte(dmac->reg[x].mar, data); // write to memory address
+ data = space.read_byte(dmac->reg[x].dar); // read from device address
+ space.write_byte(dmac->reg[x].mar, data); // write to memory address
datasize = 1;
break;
}
@@ -365,7 +365,7 @@ void hd63450_single_transfer(device_t* device, int x)
{
if(dmac->intf->dma_write[x])
{
- data = space->read_byte(dmac->reg[x].mar);
+ data = space.read_byte(dmac->reg[x].mar);
dmac->intf->dma_write[x](device->machine(), dmac->reg[x].mar,data);
datasize = 1;
}
@@ -374,25 +374,25 @@ void hd63450_single_transfer(device_t* device, int x)
switch(dmac->reg[x].ocr & 0x30) // operation size
{
case 0x00: // 8 bit
- data = space->read_byte(dmac->reg[x].mar); // read from memory address
- space->write_byte(dmac->reg[x].dar, data); // write to device address
+ data = space.read_byte(dmac->reg[x].mar); // read from memory address
+ space.write_byte(dmac->reg[x].dar, data); // write to device address
datasize = 1;
break;
case 0x10: // 16 bit
- data = space->read_word(dmac->reg[x].mar); // read from memory address
- space->write_word(dmac->reg[x].dar, data); // write to device address
+ data = space.read_word(dmac->reg[x].mar); // read from memory address
+ space.write_word(dmac->reg[x].dar, data); // write to device address
datasize = 2;
break;
case 0x20: // 32 bit
- data = space->read_word(dmac->reg[x].mar) << 16; // read from memory address
- data |= space->read_word(dmac->reg[x].mar+2); // read from memory address
- space->write_word(dmac->reg[x].dar, (data & 0xffff0000) >> 16); // write to device address
- space->write_word(dmac->reg[x].dar+2, data & 0x0000ffff); // write to device address
+ data = space.read_word(dmac->reg[x].mar) << 16; // read from memory address
+ data |= space.read_word(dmac->reg[x].mar+2); // read from memory address
+ space.write_word(dmac->reg[x].dar, (data & 0xffff0000) >> 16); // write to device address
+ space.write_word(dmac->reg[x].dar+2, data & 0x0000ffff); // write to device address
datasize = 4;
break;
case 0x30: // 8 bit packed (?)
- data = space->read_byte(dmac->reg[x].mar); // read from memory address
- space->write_byte(dmac->reg[x].dar, data); // write to device address
+ data = space.read_byte(dmac->reg[x].mar); // read from memory address
+ space.write_byte(dmac->reg[x].dar, data); // write to device address
datasize = 1;
break;
}
@@ -424,9 +424,9 @@ void hd63450_single_transfer(device_t* device, int x)
{
dmac->reg[x].btc--;
dmac->reg[x].bar+=6;
- dmac->reg[x].mar = space->read_word(dmac->reg[x].bar) << 16;
- dmac->reg[x].mar |= space->read_word(dmac->reg[x].bar+2);
- dmac->reg[x].mtc = space->read_word(dmac->reg[x].bar+4);
+ dmac->reg[x].mar = space.read_word(dmac->reg[x].bar) << 16;
+ dmac->reg[x].mar |= space.read_word(dmac->reg[x].bar+2);
+ dmac->reg[x].mtc = space.read_word(dmac->reg[x].bar+4);
return;
}
dmac->timer[x]->adjust(attotime::zero);
diff --git a/src/mess/machine/hec2hrp.c b/src/mess/machine/hec2hrp.c
index 979259380de..e9c589de947 100644
--- a/src/mess/machine/hec2hrp.c
+++ b/src/mess/machine/hec2hrp.c
@@ -55,7 +55,7 @@
#endif
static void Mise_A_Jour_Etat(running_machine &machine, int Adresse, int Value );
-static void Update_Sound(address_space *space, UINT8 data);
+static void Update_Sound(address_space &space, UINT8 data);
static cassette_image_device *cassette_device_image(running_machine &machine);
@@ -115,7 +115,7 @@ void hector_minidisc_init(running_machine &machine)
/* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
floppy_mon_w(floppy_get_device(machine, 0), 0); // Moteur floppy A:
- //floppy_mon_w(floppy_get_device(space->machine(), 1), BIT(data, 7)); // Moteur floppy B:, not implanted on the real machine
+ //floppy_mon_w(floppy_get_device(space.machine(), 1), BIT(data, 7)); // Moteur floppy B:, not implanted on the real machine
//Set the drive ready !
floppy_drive_set_ready_state(floppy_get_device(machine, 0), FLOPPY_DRIVE_READY, 0);// Disc 0 ready !
@@ -307,12 +307,12 @@ READ8_MEMBER(hec2hrp_state::hector_keyboard_r)
WRITE8_MEMBER(hec2hrp_state::hector_sn_2000_w)
{
Mise_A_Jour_Etat(machine(), 0x2000+ offset, data);
- Update_Sound(&space, data);
+ Update_Sound(space, data);
}
WRITE8_MEMBER(hec2hrp_state::hector_sn_2800_w)
{
Mise_A_Jour_Etat(machine(), 0x2800+ offset, data);
- Update_Sound(&space, data);
+ Update_Sound(space, data);
}
READ8_MEMBER(hec2hrp_state::hector_cassette_r)
{
@@ -364,7 +364,7 @@ WRITE8_MEMBER(hec2hrp_state::hector_sn_3000_w)
{
/* Update sn76477 only when necessary!*/
Mise_A_Jour_Etat( machine(), 0x3000, data & 7 );
- Update_Sound(&space, data & 7);
+ Update_Sound(space, data & 7);
}
m_oldstate3000 = data & 7;
}
@@ -790,11 +790,11 @@ static void Init_Value_SN76477_Hector(running_machine &machine)
state->m_ValMixer = 0;
}
-static void Update_Sound(address_space *space, UINT8 data)
+static void Update_Sound(address_space &space, UINT8 data)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* keep device*/
- device_t *sn76477 = space->machine().device("sn76477");
+ device_t *sn76477 = space.machine().device("sn76477");
/* MIXER*/
sn76477_mixer_a_w(sn76477, ((state->m_ValMixer & 0x04)==4) ? 1 : 0);
diff --git a/src/mess/machine/hecdisk2.c b/src/mess/machine/hecdisk2.c
index bf6a97b32d5..aaf28a31bb1 100644
--- a/src/mess/machine/hecdisk2.c
+++ b/src/mess/machine/hecdisk2.c
@@ -165,14 +165,14 @@ void hector_disc2_reset(running_machine &machine)
/*****************************************************************************/
READ8_HANDLER( hector_disc2_io00_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Switch Disc 2 to RAM to let full RAM acces */
state->membank("bank3")->set_entry(DISCII_BANK_RAM);
return 0;
}
WRITE8_HANDLER( hector_disc2_io00_port_w)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Switch Disc 2 to RAM to let full RAM acces */
state->membank("bank3")->set_entry(DISCII_BANK_RAM);
}
@@ -187,7 +187,7 @@ WRITE8_HANDLER( hector_disc2_io20_port_w)
}
READ8_HANDLER( hector_disc2_io30_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
return state->m_hector_disc2_data_r_ready;
}
WRITE8_HANDLER( hector_disc2_io30_port_w)
@@ -197,7 +197,7 @@ WRITE8_HANDLER( hector_disc2_io30_port_w)
READ8_HANDLER( hector_disc2_io40_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Read data send by Hector, by Disc2*/
state->m_hector_disc2_data_r_ready = 0x00; /* Clear memory info read ready*/
return state->m_hector_disc2_data_read; /* send the data !*/
@@ -205,27 +205,27 @@ READ8_HANDLER( hector_disc2_io40_port_r)
WRITE8_HANDLER( hector_disc2_io40_port_w) /* Write data send by Disc2, to Hector*/
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
state->m_hector_disc2_data_write = data; /* Memorization data*/
state->m_hector_disc2_data_w_ready = 0x80; /* Memorization data write ready in D7*/
}
READ8_HANDLER( hector_disc2_io50_port_r) /*Read memory info write ready*/
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
return state->m_hector_disc2_data_w_ready;
}
WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
- device_t *fdc = space->machine().device("upd765");
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
+ device_t *fdc = space.machine().device("upd765");
/* FDC Motor Control - Bit 0/1 defines the state of the FDD 0/1 motor */
- floppy_mon_w(floppy_get_device(space->machine(), 0), BIT(data, 0)); // Moteur floppy A:
- floppy_mon_w(floppy_get_device(space->machine(), 1), BIT(data, 1)); // Moteur floppy B:
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), FLOPPY_DRIVE_READY,!BIT(data, 0));
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 1), FLOPPY_DRIVE_READY,!BIT(data, 1));
+ floppy_mon_w(floppy_get_device(space.machine(), 0), BIT(data, 0)); // Moteur floppy A:
+ floppy_mon_w(floppy_get_device(space.machine(), 1), BIT(data, 1)); // Moteur floppy B:
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), FLOPPY_DRIVE_READY,!BIT(data, 0));
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), FLOPPY_DRIVE_READY,!BIT(data, 1));
/* Write bit TC uPD765 on D4 of port I/O 50 */
upd765_tc_w(fdc, BIT(data, 4)); // Seems not used...
@@ -236,7 +236,7 @@ WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
/* if RNMI is OK, try to lauch an NMI*/
if (state->m_hector_disc2_RNMI)
- valid_interrupt(space->machine());
+ valid_interrupt(space.machine());
}
//Here we must take the exchange with uPD against AM_DEVREADWRITE
@@ -245,10 +245,10 @@ WRITE8_HANDLER( hector_disc2_io50_port_w) /* I/O Port to the stuff of Disc2*/
// AM_RANGE(0x061,0x061) AM_DEVREADWRITE("upd765",upd765_data_r,upd765_data_w)
READ8_HANDLER( hector_disc2_io61_port_r)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
UINT8 data;
- device_t *fdc = space->machine().device("upd765");
- data = upd765_data_r(fdc,*space, 0); //Get the result
+ device_t *fdc = space.machine().device("upd765");
+ data = upd765_data_r(fdc,space, 0); //Get the result
// if ST0 == 0x28 (drive A:) or 0x29 (drive B:) => add 0x40
// and correct the ST1 and ST2 (patch)
@@ -280,7 +280,7 @@ READ8_HANDLER( hector_disc2_io61_port_r)
}
WRITE8_HANDLER( hector_disc2_io61_port_w)
{
- hec2hrp_state *state = space->machine().driver_data<hec2hrp_state>();
+ hec2hrp_state *state = space.machine().driver_data<hec2hrp_state>();
/* Data useful to patch the RESULT in case of write command */
state->m_hector_cmd[9]=state->m_hector_cmd[8]; //hector_cmd_8 = Cde number when state->m_hector_nb_cde = 9
state->m_hector_cmd[8]=state->m_hector_cmd[7]; //hector_cmd_7 = Drive
@@ -308,20 +308,20 @@ WRITE8_HANDLER( hector_disc2_io61_port_w)
state->m_print=0;
#endif
- device_t *fdc = space->machine().device("upd765");
- upd765_data_w(fdc,*space, 0, data);
+ device_t *fdc = space.machine().device("upd765");
+ upd765_data_w(fdc,space, 0, data);
}
// AM_RANGE(0x070,0x07f) AM_DEVREADWRITE("upd765",upd765_dack_r,upd765_dack_w)
READ8_HANDLER( hector_disc2_io70_port_r) // Gestion du DMA
{
UINT8 data;
- device_t *fdc = space->machine().device("upd765");
- data = upd765_dack_r(fdc,*space, 0);
+ device_t *fdc = space.machine().device("upd765");
+ data = upd765_dack_r(fdc,space, 0);
return data;
}
WRITE8_HANDLER( hector_disc2_io70_port_w)
{
- device_t *fdc = space->machine().device("upd765");
- upd765_dack_w(fdc,*space, 0, data);
+ device_t *fdc = space.machine().device("upd765");
+ upd765_dack_w(fdc,space, 0, data);
}
diff --git a/src/mess/machine/hp48.c b/src/mess/machine/hp48.c
index 4851167b17d..2b728f305e8 100644
--- a/src/mess/machine/hp48.c
+++ b/src/mess/machine/hp48.c
@@ -368,9 +368,9 @@ static void hp48_update_annunciators(hp48_state *state)
static WRITE8_HANDLER ( hp48_io_w )
{
- hp48_state *state = space->machine().driver_data<hp48_state>();
+ hp48_state *state = space.machine().driver_data<hp48_state>();
LOG(( "%05x %f hp48_io_w: off=%02x data=%x\n",
- space->device().safe_pcbase(), space->machine().time().as_double(), offset, data ));
+ space.device().safe_pcbase(), space.machine().time().as_double(), offset, data ));
switch( offset )
{
@@ -413,14 +413,14 @@ static WRITE8_HANDLER ( hp48_io_w )
/* cards */
case 0x0e:
- LOG(( "%05x: card control write %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card control write %02x\n", space.device().safe_pcbase(), data ));
/* bit 0: software interrupt */
if ( data & 1 )
{
LOG(( "%f hp48_io_w: software interrupt requested\n",
- space->machine().time().as_double() ));
- hp48_pulse_irq( space->machine(), SATURN_IRQ_LINE );
+ space.machine().time().as_double() ));
+ hp48_pulse_irq( space.machine(), SATURN_IRQ_LINE );
data &= ~1;
}
@@ -432,7 +432,7 @@ static WRITE8_HANDLER ( hp48_io_w )
break;
case 0x0f:
- LOG(( "%05x: card info write %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card info write %02x\n", space.device().safe_pcbase(), data ));
state->m_io[0x0f] = data;
break;
@@ -447,7 +447,7 @@ static WRITE8_HANDLER ( hp48_io_w )
case 0x17:
/* second nibble of sent data */
state->m_io[offset] = data;
- hp48_rs232_send_byte(space->machine());
+ hp48_rs232_send_byte(space.machine());
break;
/* XXX not implemented:
@@ -483,7 +483,7 @@ static WRITE8_HANDLER ( hp48_io_w )
static READ8_HANDLER ( hp48_io_r )
{
- hp48_state *state = space->machine().driver_data<hp48_state>();
+ hp48_state *state = space.machine().driver_data<hp48_state>();
UINT8 data = 0;
switch( offset )
@@ -517,7 +517,7 @@ static READ8_HANDLER ( hp48_io_r )
case 0x29:
{
int last_line = HP48_IO_8(0x28) & 0x3f; /* last line of main bitmap before menu */
- int cur_line = space->machine().primary_screen->vpos();
+ int cur_line = space.machine().primary_screen->vpos();
if ( last_line <= 1 ) last_line = 0x3f;
data = ( cur_line >= 0 && cur_line <= last_line ) ? last_line - cur_line : 0;
if ( offset == 0x29 )
@@ -548,8 +548,8 @@ static READ8_HANDLER ( hp48_io_r )
{
/* second nibble of received data */
- //device_image_interface *xmodem = dynamic_cast<device_image_interface *>(space->machine().device("rs232_x"));
- //device_image_interface *kermit = dynamic_cast<device_image_interface *>(space->machine().device("rs232_k"));
+ //device_image_interface *xmodem = dynamic_cast<device_image_interface *>(space.machine().device("rs232_x"));
+ //device_image_interface *kermit = dynamic_cast<device_image_interface *>(space.machine().device("rs232_k"));
state->m_io[0x11] &= ~1; /* clear byte received */
data = state->m_io[offset];
@@ -563,7 +563,7 @@ static READ8_HANDLER ( hp48_io_r )
/* cards */
case 0x0e: /* detection */
data = state->m_io[0x0e];
- LOG(( "%05x: card control read %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card control read %02x\n", space.device().safe_pcbase(), data ));
break;
case 0x0f: /* card info */
data = 0;
@@ -581,7 +581,7 @@ static READ8_HANDLER ( hp48_io_r )
if ( state->m_port_size[0] && state->m_port_write[0] ) data |= 4;
if ( state->m_port_size[1] && state->m_port_write[1] ) data |= 8;
}
- LOG(( "%05x: card info read %02x\n", space->device().safe_pcbase(), data ));
+ LOG(( "%05x: card info read %02x\n", space.device().safe_pcbase(), data ));
break;
@@ -589,7 +589,7 @@ static READ8_HANDLER ( hp48_io_r )
}
LOG(( "%05x %f hp48_io_r: off=%02x data=%x\n",
- space->device().safe_pcbase(), space->machine().time().as_double(), offset, data ));
+ space.device().safe_pcbase(), space.machine().time().as_double(), offset, data ));
return data;
}
@@ -598,12 +598,12 @@ static READ8_HANDLER ( hp48_io_r )
static READ8_HANDLER ( hp48_bank_r )
{
- hp48_state *state = space->machine().driver_data<hp48_state>();
+ hp48_state *state = space.machine().driver_data<hp48_state>();
/* bit 0: ignored, bits 2-5: bank number, bit 6: enable */
offset &= 0x7e;
if ( state->m_bank_switch != offset )
{
- LOG(( "%05x %f hp48_bank_r: off=%03x\n", space->device().safe_pcbase(), space->machine().time().as_double(), offset ));
+ LOG(( "%05x %f hp48_bank_r: off=%03x\n", space.device().safe_pcbase(), space.machine().time().as_double(), offset ));
state->m_bank_switch = offset;
hp48_apply_modules(state);
}
@@ -709,7 +709,7 @@ static void hp48_apply_modules(hp48_state *state)
{
int i;
int nce2_enable = 1;
- address_space* space = state->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *state->machine().device("maincpu")->memory().space(AS_PROGRAM);
state->m_io_addr = 0x100000;
@@ -772,23 +772,23 @@ static void hp48_apply_modules(hp48_state *state)
}
if (state->m_modules[i].data)
- space->install_read_bank( base, end, 0, mirror, bank );
+ space.install_read_bank( base, end, 0, mirror, bank );
else
{
if (state->m_modules[i].read != NULL)
- space->install_legacy_read_handler( base, end, 0, mirror, state->m_modules[i].read, state->m_modules[i].read_name);
+ space.install_legacy_read_handler( base, end, 0, mirror, state->m_modules[i].read, state->m_modules[i].read_name);
}
if (state->m_modules[i].isnop)
- space->nop_write(base, end, 0, mirror);
+ space.nop_write(base, end, 0, mirror);
else
{
if (state->m_modules[i].data)
- space->install_write_bank( base, end, 0, mirror, bank );
+ space.install_write_bank( base, end, 0, mirror, bank );
else
{
if (state->m_modules[i].write != NULL)
- space->install_legacy_write_handler( base, end, 0, mirror, state->m_modules[i].write, state->m_modules[i].write_name );
+ space.install_legacy_write_handler( base, end, 0, mirror, state->m_modules[i].write, state->m_modules[i].write_name );
}
}
diff --git a/src/mess/machine/intv.c b/src/mess/machine/intv.c
index ef3726f1a0e..a9bccab0fba 100644
--- a/src/mess/machine/intv.c
+++ b/src/mess/machine/intv.c
@@ -697,7 +697,7 @@ INTERRUPT_GEN( intv_interrupt )
}
/* hand 0 == left, 1 == right, 2 == ECS hand controller 1, 3 == ECS hand controller 2 */
-UINT8 intv_control_r(address_space *space, int hand)
+UINT8 intv_control_r(address_space &space, int hand)
{
static const char* const keypad_name[] = { "KEYPAD1", "KEYPAD2", "KEYPAD3", "KEYPAD4" };
static const UINT8 keypad_table[] =
@@ -728,7 +728,7 @@ UINT8 intv_control_r(address_space *space, int hand)
UINT8 rv = 0xFF;
/* keypad */
- x = space->machine().root_device().ioport(keypad_name[hand])->read();
+ x = space.machine().root_device().ioport(keypad_name[hand])->read();
for (y = 0; y < 16; y++)
{
if (x & (1 << y))
@@ -737,12 +737,12 @@ UINT8 intv_control_r(address_space *space, int hand)
}
}
- switch ((space->machine().root_device().ioport("OPTIONS")->read() >> hand) & 1)
+ switch ((space.machine().root_device().ioport("OPTIONS")->read() >> hand) & 1)
{
case 0: /* disc == digital */
default:
- x = space->machine().root_device().ioport(disc_name[hand])->read();
+ x = space.machine().root_device().ioport(disc_name[hand])->read();
for (y = 0; y < 16; y++)
{
if (x & (1 << y))
@@ -754,8 +754,8 @@ UINT8 intv_control_r(address_space *space, int hand)
case 1: /* disc == _fake_ analog */
- x = space->machine().root_device().ioport(discx_name[hand])->read();
- y = space->machine().root_device().ioport(discy_name[hand])->read();
+ x = space.machine().root_device().ioport(discx_name[hand])->read();
+ y = space.machine().root_device().ioport(discy_name[hand])->read();
rv &= discyx_table[y / 32][x / 32];
}
@@ -764,18 +764,18 @@ UINT8 intv_control_r(address_space *space, int hand)
READ8_MEMBER( intv_state::intv_left_control_r )
{
- return intv_control_r(&space, 0);
+ return intv_control_r(space, 0);
}
READ8_MEMBER( intv_state::intv_right_control_r )
{
- return intv_control_r(&space, 1);
+ return intv_control_r(space, 1);
}
READ8_MEMBER( intv_state::intv_ecs_porta_r )
{
if (ioport("ECS_CNTRLSEL")->read() == 0)
- return intv_control_r(&space, 2);
+ return intv_control_r(space, 2);
else
return 0xff; // not sure what to return here, maybe it should be last output?
}
@@ -786,7 +786,7 @@ READ8_MEMBER( intv_state::intv_ecs_portb_r )
{
case 0x00: // hand controller
{
- return intv_control_r(&space, 3);
+ return intv_control_r(space, 3);
}
case 0x01: // synthesizer keyboard
{
diff --git a/src/mess/machine/iq151_staper.c b/src/mess/machine/iq151_staper.c
index 2c072c531eb..a43b5015f6a 100644
--- a/src/mess/machine/iq151_staper.c
+++ b/src/mess/machine/iq151_staper.c
@@ -93,10 +93,10 @@ void iq151_staper_device::device_timer(emu_timer &timer, device_timer_id id, int
void iq151_staper_device::io_read(offs_t offset, UINT8 &data)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
if (offset >= 0xf8 && offset < 0xfc)
- data = m_ppi->read(*space, offset & 0x03);
+ data = m_ppi->read(space, offset & 0x03);
}
//-------------------------------------------------
@@ -105,10 +105,10 @@ void iq151_staper_device::io_read(offs_t offset, UINT8 &data)
void iq151_staper_device::io_write(offs_t offset, UINT8 data)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
if (offset >= 0xf8 && offset < 0xfc)
- m_ppi->write(*space, offset & 0x03, data);
+ m_ppi->write(space, offset & 0x03, data);
}
diff --git a/src/mess/machine/isa.c b/src/mess/machine/isa.c
index 1fa0f0a6efd..a6613ccc81c 100644
--- a/src/mess/machine/isa.c
+++ b/src/mess/machine/isa.c
@@ -327,15 +327,15 @@ void isa8_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t m
void isa8_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, UINT8 *data)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->install_readwrite_bank(start, end, mask, mirror, tag );
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.install_readwrite_bank(start, end, mask, mirror, tag );
machine().root_device().membank(tag)->set_base(data);
}
void isa8_device::unmap_bank(offs_t start, offs_t end, offs_t mask, offs_t mirror)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->unmap_readwrite(start, end, mask, mirror);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.unmap_readwrite(start, end, mask, mirror);
}
void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, const char *tag, const char *region)
@@ -346,25 +346,25 @@ void isa8_device::install_rom(device_t *dev, offs_t start, offs_t end, offs_t ma
UINT8 *dest = machine().root_device().memregion("isa")->base() + start - 0xc0000;
memcpy(dest,src, end - start + 1);
} else {
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->install_read_bank(start, end, mask, mirror, tag);
- space->unmap_write(start, end, mask, mirror);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.install_read_bank(start, end, mask, mirror, tag);
+ space.unmap_write(start, end, mask, mirror);
machine().root_device().membank(tag)->set_base(machine().root_device().memregion(dev->subtag(tempstring, region))->base());
}
}
void isa8_device::unmap_rom(offs_t start, offs_t end, offs_t mask, offs_t mirror)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->unmap_read(start, end, mask, mirror);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.unmap_read(start, end, mask, mirror);
}
bool isa8_device::is_option_rom_space_available(offs_t start, int size)
{
m_maincpu = machine().device<cpu_device>(m_cputag);
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
for(int i = 0; i < size; i += 4096) // 4KB granularity should be enough
- if(space->get_read_ptr(start + i)) return false;
+ if(space.get_read_ptr(start + i)) return false;
return true;
}
diff --git a/src/mess/machine/kaypro.c b/src/mess/machine/kaypro.c
index a4345ec83cf..6a27798195a 100644
--- a/src/mess/machine/kaypro.c
+++ b/src/mess/machine/kaypro.c
@@ -327,8 +327,8 @@ MACHINE_RESET_MEMBER(kaypro_state,kayproii)
MACHINE_RESET_MEMBER(kaypro_state,kaypro2x)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
- kaypro2x_system_port_w(*space, 0, 0x80);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ kaypro2x_system_port_w(space, 0, 0x80);
MACHINE_RESET_CALL_MEMBER(kay_kbd);
}
@@ -346,7 +346,7 @@ MACHINE_RESET_MEMBER(kaypro_state,kaypro2x)
QUICKLOAD_LOAD( kayproii )
{
kaypro_state *state = image.device().machine().driver_data<kaypro_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = state->memregion("rambank")->base();
UINT16 i;
UINT8 data;
@@ -359,7 +359,7 @@ QUICKLOAD_LOAD( kayproii )
RAM[i+0x100] = data;
}
- state->common_pio_system_w(*space, 0, state->m_system_port & 0x7f); // switch TPA in
+ state->common_pio_system_w(space, 0, state->m_system_port & 0x7f); // switch TPA in
RAM[0x80]=0; // clear out command tail
RAM[0x81]=0;
state->m_maincpu->set_pc(0x100); // start program
@@ -369,7 +369,7 @@ QUICKLOAD_LOAD( kayproii )
QUICKLOAD_LOAD( kaypro2x )
{
kaypro_state *state = image.device().machine().driver_data<kaypro_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
UINT8 *RAM = state->memregion("rambank")->base();
UINT16 i;
UINT8 data;
@@ -381,7 +381,7 @@ QUICKLOAD_LOAD( kaypro2x )
RAM[i+0x100] = data;
}
- state->kaypro2x_system_port_w(*space, 0, state->m_system_port & 0x7f);
+ state->kaypro2x_system_port_w(space, 0, state->m_system_port & 0x7f);
RAM[0x80]=0;
RAM[0x81]=0;
state->m_maincpu->set_pc(0x100);
diff --git a/src/mess/machine/kc.c b/src/mess/machine/kc.c
index a9ca5981cac..918e915e8f7 100644
--- a/src/mess/machine/kc.c
+++ b/src/mess/machine/kc.c
@@ -61,10 +61,10 @@ QUICKLOAD_LOAD(kc)
datasize = image.length() - 128;
}
- address_space *space = state->m_maincpu->space( AS_PROGRAM );
+ address_space &space = *state->m_maincpu->space( AS_PROGRAM );
for (i=0; i<datasize; i++)
- space->write_byte((addr+i) & 0xffff, data[i+128]);
+ space.write_byte((addr+i) & 0xffff, data[i+128]);
if (execution_address != 0 && header->number_addresses >= 3 )
{
@@ -290,7 +290,7 @@ void kc_state::cassette_set_motor(int motor_state)
/* update status of memory area 0x0000-0x03fff */
void kc_state::update_0x00000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
/* access ram? */
if (m_pio_data[0] & (1<<1))
@@ -298,7 +298,7 @@ void kc_state::update_0x00000()
LOG(("ram0 enabled\n"));
/* yes; set address of bank */
- space->install_read_bank(0x0000, 0x3fff, "bank1");
+ space.install_read_bank(0x0000, 0x3fff, "bank1");
membank("bank1")->set_base(m_ram_base);
/* write protect ram? */
@@ -308,34 +308,34 @@ void kc_state::update_0x00000()
LOG(("ram0 write protected\n"));
/* ram is enabled and write protected */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
}
else
{
LOG(("ram0 write enabled\n"));
/* ram is enabled and write enabled */
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
}
}
else
{
LOG(("Module at 0x0000\n"));
- space->install_read_handler (0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_read), this), 0);
- space->install_write_handler(0x0000, 0x3fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_write), this), 0);
+ space.install_read_handler (0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_read), this), 0);
+ space.install_write_handler(0x0000, 0x3fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_write), this), 0);
}
}
/* update status of memory area 0x4000-0x07fff */
void kc_state::update_0x04000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
LOG(("Module at 0x4000\n"));
- space->install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
- space->install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
+ space.install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
+ space.install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
}
@@ -343,7 +343,7 @@ void kc_state::update_0x04000()
/* update memory address 0x0c000-0x0e000 */
void kc_state::update_0x0c000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if ((m_pio_data[0] & (1<<7)) && memregion("basic")->base() != NULL)
{
@@ -351,22 +351,22 @@ void kc_state::update_0x0c000()
LOG(("BASIC rom 0x0c000\n"));
membank("bank4")->set_base(memregion("basic")->base());
- space->install_read_bank(0xc000, 0xdfff, "bank4");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank4");
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
LOG(("Module at 0x0c000\n"));
- space->install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
- space->install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
+ space.install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
+ space.install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
}
}
/* update memory address 0x0e000-0x0ffff */
void kc_state::update_0x0e000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_pio_data[0] & (1<<0))
{
@@ -374,15 +374,15 @@ void kc_state::update_0x0e000()
LOG(("CAOS rom 0x0e000\n"));
/* read will access the rom */
membank("bank5")->set_base(memregion("caos")->base() + 0x2000);
- space->install_read_bank(0xe000, 0xffff, "bank5");
- space->unmap_write(0xe000, 0xffff);
+ space.install_read_bank(0xe000, 0xffff, "bank5");
+ space.unmap_write(0xe000, 0xffff);
}
else
{
LOG(("Module at 0x0e000\n"));
- space->install_read_handler (0xe000, 0xffff, 0, 0, read8_delegate(FUNC(kc_state::expansion_e000_r), this), 0);
- space->install_write_handler(0xe000, 0xffff, 0, 0, write8_delegate(FUNC(kc_state::expansion_e000_w), this), 0);
+ space.install_read_handler (0xe000, 0xffff, 0, 0, read8_delegate(FUNC(kc_state::expansion_e000_r), this), 0);
+ space.install_write_handler(0xe000, 0xffff, 0, 0, write8_delegate(FUNC(kc_state::expansion_e000_w), this), 0);
}
}
@@ -390,7 +390,7 @@ void kc_state::update_0x0e000()
/* update status of memory area 0x08000-0x0ffff */
void kc_state::update_0x08000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_pio_data[0] & (1<<2))
{
@@ -398,14 +398,14 @@ void kc_state::update_0x08000()
LOG(("IRM enabled\n"));
membank("bank3")->set_base(m_video_ram);
- space->install_readwrite_bank(0x8000, 0xbfff, "bank3");
+ space.install_readwrite_bank(0x8000, 0xbfff, "bank3");
}
else
{
LOG(("Module at 0x8000!\n"));
- space->install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
- space->install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
+ space.install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
+ space.install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
}
}
@@ -413,7 +413,7 @@ void kc_state::update_0x08000()
/* update status of memory area 0x4000-0x07fff */
void kc85_4_state::update_0x04000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
/* access ram? */
if (m_port_86_data & (1<<0))
@@ -421,7 +421,7 @@ void kc85_4_state::update_0x04000()
LOG(("RAM4 enabled\n"));
/* yes */
- space->install_read_bank(0x4000, 0x7fff, "bank2");
+ space.install_read_bank(0x4000, 0x7fff, "bank2");
/* set address of bank */
membank("bank2")->set_base(m_ram_base + 0x4000);
@@ -432,22 +432,22 @@ void kc85_4_state::update_0x04000()
LOG(("ram4 write protected\n"));
/* ram is enabled and write protected */
- space->nop_write(0x4000, 0x7fff);
+ space.nop_write(0x4000, 0x7fff);
}
else
{
LOG(("ram4 write enabled\n"));
/* ram is enabled and write enabled */
- space->install_write_bank(0x4000, 0x7fff, "bank2");
+ space.install_write_bank(0x4000, 0x7fff, "bank2");
}
}
else
{
LOG(("Module at 0x4000\n"));
- space->install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
- space->install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
+ space.install_read_handler (0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(kc_state::expansion_4000_r), this), 0);
+ space.install_write_handler(0x4000, 0x7fff, 0, 0, write8_delegate(FUNC(kc_state::expansion_4000_w), this), 0);
}
}
@@ -455,7 +455,7 @@ void kc85_4_state::update_0x04000()
/* update memory address 0x0c000-0x0e000 */
void kc85_4_state::update_0x0c000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_port_86_data & (1<<7))
{
@@ -463,8 +463,8 @@ void kc85_4_state::update_0x0c000()
LOG(("CAOS rom 0x0c000\n"));
membank("bank4")->set_base(memregion("caos")->base());
- space->install_read_bank(0xc000, 0xdfff, "bank4");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank4");
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
@@ -476,22 +476,22 @@ void kc85_4_state::update_0x0c000()
int bank = memregion("basic")->bytes() == 0x8000 ? (m_port_86_data>>5) & 0x03 : 0;
membank("bank4")->set_base(memregion("basic")->base() + (bank << 13));
- space->install_read_bank(0xc000, 0xdfff, "bank4");
- space->unmap_write(0xc000, 0xdfff);
+ space.install_read_bank(0xc000, 0xdfff, "bank4");
+ space.unmap_write(0xc000, 0xdfff);
}
else
{
LOG(("Module at 0x0c000\n"));
- space->install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
- space->install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
+ space.install_read_handler (0xc000, 0xdfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_c000_r), this), 0);
+ space.install_write_handler(0xc000, 0xdfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_c000_w), this), 0);
}
}
}
void kc85_4_state::update_0x08000()
{
- address_space *space = m_maincpu->space( AS_PROGRAM );
+ address_space &space = *m_maincpu->space( AS_PROGRAM );
if (m_pio_data[0] & (1<<2))
{
@@ -501,10 +501,10 @@ void kc85_4_state::update_0x08000()
UINT8* ram_page = m_video_ram + ((BIT(m_port_84_data, 2)<<15) | (BIT(m_port_84_data, 1)<<14));
membank("bank3")->set_base(ram_page);
- space->install_readwrite_bank(0x8000, 0xa7ff, "bank3");
+ space.install_readwrite_bank(0x8000, 0xa7ff, "bank3");
membank("bank6")->set_base(m_video_ram + 0x2800);
- space->install_readwrite_bank(0xa800, 0xbfff, "bank6");
+ space.install_readwrite_bank(0xa800, 0xbfff, "bank6");
}
else if (m_pio_data[1] & (1<<5))
{
@@ -530,8 +530,8 @@ void kc85_4_state::update_0x08000()
membank("bank3")->set_base(mem_ptr);
membank("bank6")->set_base(mem_ptr + 0x2800);
- space->install_read_bank(0x8000, 0xa7ff, "bank3");
- space->install_read_bank(0xa800, 0xbfff, "bank6");
+ space.install_read_bank(0x8000, 0xa7ff, "bank3");
+ space.install_read_bank(0xa800, 0xbfff, "bank6");
/* write protect RAM8 ? */
if ((m_pio_data[1] & (1<<6)) == 0)
@@ -539,24 +539,24 @@ void kc85_4_state::update_0x08000()
/* ram8 is enabled and write protected */
LOG(("RAM8 write protected\n"));
- space->nop_write(0x8000, 0xa7ff);
- space->nop_write(0xa800, 0xbfff);
+ space.nop_write(0x8000, 0xa7ff);
+ space.nop_write(0xa800, 0xbfff);
}
else
{
LOG(("RAM8 write enabled\n"));
/* ram8 is enabled and write enabled */
- space->install_write_bank(0x8000, 0xa7ff, "bank3");
- space->install_write_bank(0xa800, 0xbfff, "bank6");
+ space.install_write_bank(0x8000, 0xa7ff, "bank3");
+ space.install_write_bank(0xa800, 0xbfff, "bank6");
}
}
else
{
LOG(("Module at 0x8000\n"));
- space->install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
- space->install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
+ space.install_read_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(kc_state::expansion_8000_r), this), 0);
+ space.install_write_handler(0x8000, 0xbfff, 0, 0, write8_delegate(FUNC(kc_state::expansion_8000_w), this), 0);
}
}
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index f7f7982ca60..f993ee07d86 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -237,13 +237,13 @@ INLINE void COPS_send_data_if_possible(running_machine &machine)
{
lisa_state *state = machine.driver_data<lisa_state>();
via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if ((! state->m_hold_COPS_data) && state->m_fifo_size && (! state->m_COPS_Ready))
{
// printf("COPsim: sending %02x to VIA\n", state->m_fifo_data[state->m_fifo_head]);
- via_0->write_porta(*space, 0, state->m_fifo_data[state->m_fifo_head]); /* output data */
+ via_0->write_porta(space, 0, state->m_fifo_data[state->m_fifo_head]); /* output data */
if (state->m_fifo_head == state->m_mouse_data_offset)
state->m_mouse_data_offset = -1; /* we just phased out the mouse data in buffer */
state->m_fifo_head = (state->m_fifo_head+1) & 0x7;
@@ -427,7 +427,7 @@ static TIMER_CALLBACK(read_COPS_command)
lisa_state *state = machine.driver_data<lisa_state>();
int command;
via6522_device *via_0 = machine.device<via6522_device>("via6522_0");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
state->m_COPS_Ready = 0;
@@ -435,7 +435,7 @@ static TIMER_CALLBACK(read_COPS_command)
COPS_send_data_if_possible(machine);
/* some pull-ups allow the COPS to read 1s when the VIA port is not set as output */
- command = (state->m_COPS_command | (~ via_0->read(*space, VIA_DDRA))) & 0xff;
+ command = (state->m_COPS_command | (~ via_0->read(space, VIA_DDRA))) & 0xff;
// printf("Dropping Ready, command = %02x\n", command);
diff --git a/src/mess/machine/llc.c b/src/mess/machine/llc.c
index 3c39837c2d2..8125a708562 100644
--- a/src/mess/machine/llc.c
+++ b/src/mess/machine/llc.c
@@ -152,18 +152,18 @@ DRIVER_INIT_MEMBER(llc_state,llc2)
MACHINE_RESET_MEMBER(llc_state,llc2)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
- space->unmap_write(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x4000);
- space->unmap_write(0x6000, 0xbfff);
+ space.unmap_write(0x6000, 0xbfff);
membank("bank3")->set_base(machine().root_device().memregion("maincpu")->base() + 0x6000);
- space->install_write_bank(0xc000, 0xffff, "bank4");
+ space.install_write_bank(0xc000, 0xffff, "bank4");
membank("bank4")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0xc000);
}
diff --git a/src/mess/machine/lux21046.c b/src/mess/machine/lux21046.c
index de30bb01ce6..081b3331d8c 100644
--- a/src/mess/machine/lux21046.c
+++ b/src/mess/machine/lux21046.c
@@ -223,8 +223,8 @@ WRITE_LINE_MEMBER( luxor_55_21046_device::dma_int_w )
m_maincpu->set_input_line(INPUT_LINE_IRQ0, m_fdc_irq | m_dma_irq);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
static Z80DMA_INTERFACE( dma_intf )
{
diff --git a/src/mess/machine/lviv.c b/src/mess/machine/lviv.c
index 3e481f5fbe8..24360aa8a61 100644
--- a/src/mess/machine/lviv.c
+++ b/src/mess/machine/lviv.c
@@ -232,19 +232,19 @@ I8255A_INTERFACE( lviv_ppi8255_interface_1 )
void lviv_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem;
- space->set_direct_update_handler(direct_update_delegate(FUNC(lviv_state::lviv_directoverride), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(lviv_state::lviv_directoverride), this));
m_video_ram = machine().device<ram_device>(RAM_TAG)->pointer() + 0xc000;
m_startup_mem_map = 1;
- space->unmap_write(0x0000, 0x3fff);
- space->unmap_write(0x4000, 0x7fff);
- space->unmap_write(0x8000, 0xbfff);
- space->unmap_write(0xC000, 0xffff);
+ space.unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x4000, 0x7fff);
+ space.unmap_write(0x8000, 0xbfff);
+ space.unmap_write(0xC000, 0xffff);
mem = memregion("maincpu")->base();
membank("bank1")->set_base(mem + 0x010000);
diff --git a/src/mess/machine/lynx.c b/src/mess/machine/lynx.c
index 6b75baf37bb..9e5b26590b7 100644
--- a/src/mess/machine/lynx.c
+++ b/src/mess/machine/lynx.c
@@ -1655,7 +1655,7 @@ static TIMER_CALLBACK(lynx_uart_timer)
static READ8_HANDLER(lynx_uart_r)
{
- lynx_state *state = space->machine().driver_data<lynx_state>();
+ lynx_state *state = space.machine().driver_data<lynx_state>();
UINT8 value = 0x00;
switch (offset)
{
@@ -1769,7 +1769,7 @@ READ8_MEMBER(lynx_state::mikey_read)
case 0x8c:
case 0x8d:
- value = lynx_uart_r(&space, offset);
+ value = lynx_uart_r(space, offset);
break;
default:
diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c
index 9a90bd8d79f..b0264c8d0c1 100644
--- a/src/mess/machine/mac.c
+++ b/src/mess/machine/mac.c
@@ -212,7 +212,7 @@ static void mac_install_memory(running_machine &machine, offs_t memory_begin, of
offs_t memory_size, void *memory_data, int is_rom, const char *bank)
{
mac_state *state = machine.driver_data<mac_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
offs_t memory_mask;
memory_size = MIN(memory_size, (memory_end + 1 - memory_begin));
@@ -220,12 +220,12 @@ static void mac_install_memory(running_machine &machine, offs_t memory_begin, of
if (!is_rom)
{
- space->install_readwrite_bank(memory_begin, memory_end, memory_mask, 0, bank);
+ space.install_readwrite_bank(memory_begin, memory_end, memory_mask, 0, bank);
}
else
{
- space->unmap_write(memory_begin, memory_end, memory_mask, 0);
- space->install_read_bank(memory_begin, memory_end, memory_mask, 0, bank);
+ space.unmap_write(memory_begin, memory_end, memory_mask, 0);
+ space.install_read_bank(memory_begin, memory_end, memory_mask, 0, bank);
}
state->membank(bank)->set_base(memory_data);
@@ -410,12 +410,12 @@ void mac_state::v8_resize()
}
else
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT32 onboard_amt, simm_amt, simm_size;
static const UINT32 simm_sizes[4] = { 0, 2*1024*1024, 4*1024*1024, 8*1024*1024 };
// force unmap of entire RAM region
- space->unmap_write(0, 0x9fffff, 0x9fffff, 0);
+ space.unmap_write(0, 0x9fffff, 0x9fffff, 0);
// LC and Classic II have 2 MB built-in, all other V8-style machines have 4 MB
// we reserve the first 2 or 4 MB of mess_ram for the onboard,
@@ -501,14 +501,14 @@ void mac_state::set_memory_overlay(int overlay)
}
else if ((m_model == MODEL_MAC_PORTABLE) || (m_model == MODEL_MAC_PB100) || (m_model == MODEL_MAC_IIVX) || (m_model == MODEL_MAC_IIFX))
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x000000, 0x9fffff, 0x9fffff, 0);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.unmap_write(0x000000, 0x9fffff, 0x9fffff, 0);
mac_install_memory(machine(), 0x000000, memory_size-1, memory_size, memory_data, is_rom, "bank1");
}
else if ((m_model == MODEL_MAC_PB140) || (m_model == MODEL_MAC_PB160) || ((m_model >= MODEL_MAC_PBDUO_210) && (m_model <= MODEL_MAC_PBDUO_270c)))
{
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x000000, 0xffffff, 0xffffff, 0);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ space.unmap_write(0x000000, 0xffffff, 0xffffff, 0);
mac_install_memory(machine(), 0x000000, memory_size-1, memory_size, memory_data, is_rom, "bank1");
}
else if ((m_model >= MODEL_MAC_II) && (m_model <= MODEL_MAC_SE30))
@@ -1049,7 +1049,7 @@ WRITE16_MEMBER ( mac_state::macii_scsi_w )
{
int reg = (offset>>3) & 0xf;
-// logerror("macplus_scsi_w: data %x offset %x mask %x (PC=%x)\n", data, offset, mem_mask, space->device().safe_pc());
+// logerror("macplus_scsi_w: data %x offset %x mask %x (PC=%x)\n", data, offset, mem_mask, space.device().safe_pc());
if ((reg == 0) && (offset == 0x100))
{
@@ -1814,7 +1814,7 @@ void mac_state::machine_reset()
if (m_model >= MODEL_MAC_POWERMAC_6100 && m_model <= MODEL_MAC_POWERMAC_8100)
{
- m_awacs->set_dma_base(m_maincpu->space(AS_PROGRAM), 0x10000, 0x12000);
+ m_awacs->set_dma_base(*m_maincpu->space(AS_PROGRAM), 0x10000, 0x12000);
}
// start 60.15 Hz timer for most systems
diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c
index 0918ad7e8b4..9e7b7858ed7 100644
--- a/src/mess/machine/mbc55x.c
+++ b/src/mess/machine/mbc55x.c
@@ -339,7 +339,7 @@ WRITE8_MEMBER(mbc55x_state::mbc55x_kb_usart_w)
static void set_ram_size(running_machine &machine)
{
mbc55x_state *state = machine.driver_data<mbc55x_state>();
- address_space *space = machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
int ramsize = state->m_ram->size();
int nobanks = ramsize / RAM_BANK_SIZE;
char bank[10];
@@ -363,21 +363,21 @@ static void set_ram_size(running_machine &machine)
if(bankno<nobanks)
{
state->membank(bank)->set_base(map_base);
- space->install_readwrite_bank(bank_base, bank_base+(RAM_BANK_SIZE-1), bank);
+ space.install_readwrite_bank(bank_base, bank_base+(RAM_BANK_SIZE-1), bank);
logerror("Mapping bank %d at %05X to RAM\n",bankno,bank_base);
}
else
{
- space->nop_readwrite(bank_base, bank_base+(RAM_BANK_SIZE-1));
+ space.nop_readwrite(bank_base, bank_base+(RAM_BANK_SIZE-1));
logerror("Mapping bank %d at %05X to NOP\n",bankno,bank_base);
}
}
// Graphics red and blue plane memory mapping, green is in main memory
state->membank(RED_PLANE_TAG)->set_base(&state->m_video_mem[RED_PLANE_OFFSET]);
- space->install_readwrite_bank(RED_PLANE_MEMBASE, RED_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), RED_PLANE_TAG);
+ space.install_readwrite_bank(RED_PLANE_MEMBASE, RED_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), RED_PLANE_TAG);
state->membank(BLUE_PLANE_TAG)->set_base(&state->m_video_mem[BLUE_PLANE_OFFSET]);
- space->install_readwrite_bank(BLUE_PLANE_MEMBASE, BLUE_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), BLUE_PLANE_TAG);
+ space.install_readwrite_bank(BLUE_PLANE_MEMBASE, BLUE_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), BLUE_PLANE_TAG);
}
DRIVER_INIT_MEMBER(mbc55x_state,mbc55x)
@@ -434,10 +434,10 @@ static void mbc55x_debug(running_machine &machine, int ref, int params, const ch
static int instruction_hook(device_t &device, offs_t curpc)
{
mbc55x_state *state = device.machine().driver_data<mbc55x_state>();
- address_space *space = device.memory().space(AS_PROGRAM);
+ address_space &space = *device.memory().space(AS_PROGRAM);
UINT8 *addr_ptr;
- addr_ptr = (UINT8*)space->get_read_ptr(curpc);
+ addr_ptr = (UINT8*)space.get_read_ptr(curpc);
if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD))
{
diff --git a/src/mess/machine/mbee.c b/src/mess/machine/mbee.c
index 8154c98e6da..f3d3f6dbd9e 100644
--- a/src/mess/machine/mbee.c
+++ b/src/mess/machine/mbee.c
@@ -565,14 +565,14 @@ INTERRUPT_GEN( mbee_interrupt )
#if 0
mbee_state *state = device->machine().driver_data<mbee_state>();
- //address_space *space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
+ //address_space &space = *device->machine().device("maincpu")->memory().space(AS_PROGRAM);
/* The printer status connects to the pio ASTB pin, and the printer changing to not
busy should signal an interrupt routine at B61C, (next line) but this doesn't work.
The line below does what the interrupt should be doing. */
/* But it would break any program loaded to that area of memory, such as CP/M programs */
//state->m_z80pio->strobe_a(centronics_busy_r(state->m_printer)); /* signal int when not busy (L->H) */
- //space->write_byte(0x109, centronics_busy_r(state->m_printer));
+ //space.write_byte(0x109, centronics_busy_r(state->m_printer));
/* once per frame, pulse the PIO B bit 7 - it is in the schematic as an option,
@@ -754,7 +754,7 @@ QUICKLOAD_LOAD( mbee )
{
mbee_state *state = image.device().machine().driver_data<mbee_state>();
device_t *cpu = image.device().machine().device("maincpu");
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT16 i, j;
UINT8 data, sw = image.device().machine().root_device().ioport("CONFIG")->read() & 1; /* reading the dipswitch: 1 = autorun */
@@ -772,7 +772,7 @@ QUICKLOAD_LOAD( mbee )
}
if ((j < state->m_size) || (j > 0xefff))
- space->write_byte(j, data);
+ space.write_byte(j, data);
else
{
image.message("Not enough memory in this microbee");
@@ -782,11 +782,11 @@ QUICKLOAD_LOAD( mbee )
if (sw)
{
- space->write_word(0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */
+ space.write_word(0xa2,0x801e); /* fix warm-start vector to get around some copy-protections */
cpu->state().set_pc(0x801e);
}
else
- space->write_word(0xa2,0x8517);
+ space.write_word(0xa2,0x8517);
}
else if (!mame_stricmp(image.filetype(), "com"))
{
@@ -802,7 +802,7 @@ QUICKLOAD_LOAD( mbee )
}
if ((j < state->m_size) || (j > 0xefff))
- space->write_byte(j, data);
+ space.write_byte(j, data);
else
{
image.message("Not enough memory in this microbee");
diff --git a/src/mess/machine/mboard.c b/src/mess/machine/mboard.c
index d17e36af32c..00923fcf058 100644
--- a/src/mess/machine/mboard.c
+++ b/src/mess/machine/mboard.c
@@ -196,15 +196,15 @@ READ32_HANDLER( mboard_read_board_32 )
WRITE8_HANDLER( mboard_write_board_8 )
{
- write_board(space->machine(),data);
+ write_board(space.machine(),data);
logerror("Write Board Port Data = %02x\n",data);
}
WRITE16_HANDLER( mboard_write_board_16 )
{
- if (data & 0xff) write_board(space->machine(),data);
+ if (data & 0xff) write_board(space.machine(),data);
logerror("write board 16 %08x\n",data);
- write_board(space->machine(),data>>8);
+ write_board(space.machine(),data>>8);
}
WRITE32_HANDLER( mboard_write_board_32 )
@@ -212,20 +212,20 @@ WRITE32_HANDLER( mboard_write_board_32 )
// data |= data << 24;
//printf("write board %08x %08x\n",offset,data);
logerror("write board 32 o: %08x d: %08x\n",offset,data);
- if (offset) write_board(space->machine(),data);
- else write_board(space->machine(),data>>24);
+ if (offset) write_board(space.machine(),data);
+ else write_board(space.machine(),data>>24);
}
WRITE8_HANDLER( mboard_write_LED_8 )
{
write_LED(data);
- space->device().execute().spin_until_time(attotime::from_usec(7));
+ space.device().execute().spin_until_time(attotime::from_usec(7));
}
WRITE16_HANDLER( mboard_write_LED_16 )
{
write_LED(data >> 8);
- space->device().execute().spin_until_time(attotime::from_usec(9));
+ space.device().execute().spin_until_time(attotime::from_usec(9));
}
WRITE32_HANDLER( mboard_write_LED_32 )
@@ -235,7 +235,7 @@ WRITE32_HANDLER( mboard_write_LED_32 )
if (offset) write_LED(data);
else write_LED(data >> 24);
logerror("write LED 32 o: %08x d: %08x\n",offset,data);
-// space->device().execute().spin_until_time(ATTOTIME_IN_USEC(20));
+// space.device().execute().spin_until_time(ATTOTIME_IN_USEC(20));
}
diff --git a/src/mess/machine/microtan.c b/src/mess/machine/microtan.c
index ba608562cee..4d2c7927e47 100644
--- a/src/mess/machine/microtan.c
+++ b/src/mess/machine/microtan.c
@@ -515,7 +515,7 @@ DRIVER_INIT_MEMBER(microtan_state,microtan)
{
UINT8 *dst = memregion("gfx2")->base();
int i;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
for (i = 0; i < 256; i++)
{
@@ -556,14 +556,14 @@ DRIVER_INIT_MEMBER(microtan_state,microtan)
switch (read_dsw(machine()) & 3)
{
case 0: // 1K only :)
- space->nop_readwrite(0x0400, 0xbbff);
+ space.nop_readwrite(0x0400, 0xbbff);
break;
case 1: // +7K TANEX
- space->install_ram(0x0400, 0x1fff,NULL);
- space->nop_readwrite(0x2000, 0xbbff);
+ space.install_ram(0x0400, 0x1fff,NULL);
+ space.nop_readwrite(0x2000, 0xbbff);
break;
default: // +7K TANEX + 40K TANRAM
- space->install_ram(0x0400, 0xbbff, NULL);
+ space.install_ram(0x0400, 0xbbff, NULL);
break;
}
diff --git a/src/mess/machine/mpc105.c b/src/mess/machine/mpc105.c
index f0b46acf50b..9e2b2e2f327 100644
--- a/src/mess/machine/mpc105.c
+++ b/src/mess/machine/mpc105.c
@@ -94,11 +94,11 @@ void mpc105_device::update_memory()
if (m_bank_base > 0)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
/* first clear everything out */
- space->nop_read(0x00000000, 0x3FFFFFFF);
- space->nop_read(0x00000000, 0x3FFFFFFF);
+ space.nop_read(0x00000000, 0x3FFFFFFF);
+ space.nop_read(0x00000000, 0x3FFFFFFF);
}
for (bank = 0; bank < MPC105_MEMORYBANK_COUNT; bank++)
diff --git a/src/mess/machine/msx_slot.c b/src/mess/machine/msx_slot.c
index dac30951d8f..96f818c0a8b 100644
--- a/src/mess/machine/msx_slot.c
+++ b/src/mess/machine/msx_slot.c
@@ -353,13 +353,13 @@ static READ8_HANDLER (konami_scc_bank5)
{
if ((offset & 0xff) >= 0xe0)
{
- return k051649_test_r (space->machine().device("k051649"), *space, offset & 0xff);
+ return k051649_test_r (space.machine().device("k051649"), space, offset & 0xff);
}
return 0xff;
}
else
{
- return k051649_waveform_r (space->machine().device("k051649"), *space, offset & 0x7f);
+ return k051649_waveform_r (space.machine().device("k051649"), space, offset & 0x7f);
}
}
@@ -1234,14 +1234,14 @@ MSX_SLOT_RESET(diskrom)
static READ8_HANDLER (msx_diskrom_page1_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
- case 0: return wd17xx_status_r (fdc, *space, 0);
- case 1: return wd17xx_track_r (fdc, *space, 0);
- case 2: return wd17xx_sector_r (fdc, *space, 0);
- case 3: return wd17xx_data_r (fdc, *space, 0);
+ case 0: return wd17xx_status_r (fdc, space, 0);
+ case 1: return wd17xx_track_r (fdc, space, 0);
+ case 2: return wd17xx_sector_r (fdc, space, 0);
+ case 3: return wd17xx_data_r (fdc, space, 0);
case 7: return state->m_dsk_stat;
default:
return state->m_state[1]->m_mem[offset + 0x3ff8];
@@ -1250,20 +1250,20 @@ static READ8_HANDLER (msx_diskrom_page1_r)
static READ8_HANDLER (msx_diskrom_page2_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
if (offset >= 0x7f8)
{
switch (offset)
{
case 0x7f8:
- return wd17xx_status_r (fdc, *space, 0);
+ return wd17xx_status_r (fdc, space, 0);
case 0x7f9:
- return wd17xx_track_r (fdc, *space, 0);
+ return wd17xx_track_r (fdc, space, 0);
case 0x7fa:
- return wd17xx_sector_r (fdc, *space, 0);
+ return wd17xx_sector_r (fdc, space, 0);
case 0x7fb:
- return wd17xx_data_r (fdc, *space, 0);
+ return wd17xx_data_r (fdc, space, 0);
case 0x7ff:
return state->m_dsk_stat;
default:
@@ -1363,14 +1363,14 @@ MSX_SLOT_RESET(diskrom2)
static READ8_HANDLER (msx_diskrom2_page1_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
switch (offset)
{
- case 0: return wd17xx_status_r(fdc, *space, 0);
- case 1: return wd17xx_track_r(fdc, *space, 0);
- case 2: return wd17xx_sector_r(fdc, *space, 0);
- case 3: return wd17xx_data_r(fdc, *space, 0);
+ case 0: return wd17xx_status_r(fdc, space, 0);
+ case 1: return wd17xx_track_r(fdc, space, 0);
+ case 2: return wd17xx_sector_r(fdc, space, 0);
+ case 3: return wd17xx_data_r(fdc, space, 0);
case 4: return state->m_dsk_stat;
default:
return state->m_state[1]->m_mem[offset + 0x3ff8];
@@ -1379,20 +1379,20 @@ static READ8_HANDLER (msx_diskrom2_page1_r)
static READ8_HANDLER (msx_diskrom2_page2_r)
{
- msx_state *state = space->machine().driver_data<msx_state>();
- device_t *fdc = space->machine().device("wd179x");
+ msx_state *state = space.machine().driver_data<msx_state>();
+ device_t *fdc = space.machine().device("wd179x");
if (offset >= 0x7b8)
{
switch (offset)
{
case 0x7b8:
- return wd17xx_status_r (fdc, *space, 0);
+ return wd17xx_status_r (fdc, space, 0);
case 0x7b9:
- return wd17xx_track_r (fdc, *space, 0);
+ return wd17xx_track_r (fdc, space, 0);
case 0x7ba:
- return wd17xx_sector_r (fdc, *space, 0);
+ return wd17xx_sector_r (fdc, space, 0);
case 0x7bb:
- return wd17xx_data_r (fdc, *space, 0);
+ return wd17xx_data_r (fdc, space, 0);
case 0x7bc:
return state->m_dsk_stat;
default:
@@ -2184,7 +2184,7 @@ MSX_SLOT_RESET(soundcartridge)
static READ8_HANDLER (soundcartridge_scc)
{
- msx_state *state = space->machine().driver_data<msx_state>();
+ msx_state *state = space.machine().driver_data<msx_state>();
int reg;
@@ -2198,7 +2198,7 @@ static READ8_HANDLER (soundcartridge_scc)
if (reg < 0x80)
{
- return k051649_waveform_r (space->machine().device("k051649"), *space, reg);
+ return k051649_waveform_r (space.machine().device("k051649"), space, reg);
}
else if (reg < 0xa0)
{
@@ -2207,11 +2207,11 @@ static READ8_HANDLER (soundcartridge_scc)
else if (reg < 0xc0)
{
/* read wave 5 */
- return k051649_waveform_r (space->machine().device("k051649"), *space, 0x80 + (reg & 0x1f));
+ return k051649_waveform_r (space.machine().device("k051649"), space, 0x80 + (reg & 0x1f));
}
else if (reg < 0xe0)
{
- return k051649_test_r (space->machine().device("k051649"), *space, reg);
+ return k051649_test_r (space.machine().device("k051649"), space, reg);
}
return 0xff;
@@ -2219,7 +2219,7 @@ static READ8_HANDLER (soundcartridge_scc)
static READ8_HANDLER (soundcartridge_sccp)
{
- msx_state *state = space->machine().driver_data<msx_state>();
+ msx_state *state = space.machine().driver_data<msx_state>();
int reg;
if (offset >= 0x7e0)
@@ -2232,11 +2232,11 @@ static READ8_HANDLER (soundcartridge_sccp)
if (reg < 0xa0)
{
- return k052539_waveform_r (space->machine().device("k051649"), *space, reg);
+ return k052539_waveform_r (space.machine().device("k051649"), space, reg);
}
else if (reg >= 0xc0 && reg < 0xe0)
{
- return k051649_test_r (space->machine().device("k051649"), *space, reg);
+ return k051649_test_r (space.machine().device("k051649"), space, reg);
}
return 0xff;
diff --git a/src/mess/machine/mz700.c b/src/mess/machine/mz700.c
index 4b3dfa1a6f9..e47ca57cfcb 100644
--- a/src/mess/machine/mz700.c
+++ b/src/mess/machine/mz700.c
@@ -627,7 +627,7 @@ WRITE8_MEMBER(mz_state::mz800_display_mode_w)
// {
// logerror("mz800_display_mode_w: switching mode to %s\n", (BIT(data, 3) ? "mz700" : "mz800"));
// m_mz700_mode = BIT(data, 3);
-// mz700_bank_4_w(machine().device("maincpu")->memory().&space(AS_PROGRAM), 0, 0);
+// mz700_bank_4_w(*machine().device("maincpu")->memory().&space(AS_PROGRAM), 0, 0);
// }
}
diff --git a/src/mess/machine/nes.c b/src/mess/machine/nes.c
index 73e3eedba4f..5bbe950cf07 100644
--- a/src/mess/machine/nes.c
+++ b/src/mess/machine/nes.c
@@ -36,7 +36,7 @@ static void fds_irq(device_t *device, int scanline, int vblank, int blanked);
static void init_nes_core( running_machine &machine )
{
nes_state *state = machine.driver_data<nes_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
static const char *const bank_names[] = { "bank1", "bank2", "bank3", "bank4" };
int prg_banks = (state->m_prg_chunks == 1) ? (2 * 2) : (state->m_prg_chunks * 2);
int i;
@@ -46,7 +46,7 @@ static void init_nes_core( running_machine &machine )
// other pointers got set in the loading routine
/* Brutal hack put in as a consequence of the new memory system; we really need to fix the NES code */
- space->install_readwrite_bank(0x0000, 0x07ff, 0, 0x1800, "bank10");
+ space.install_readwrite_bank(0x0000, 0x07ff, 0, 0x1800, "bank10");
machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0, 0x1fff, FUNC(nes_chr_r), FUNC(nes_chr_w));
machine.device("ppu")->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x2000, 0x3eff, FUNC(nes_nt_r), FUNC(nes_nt_w));
@@ -68,12 +68,12 @@ static void init_nes_core( running_machine &machine )
if (state->m_fds_ram == NULL)
state->m_fds_ram = auto_alloc_array(machine, UINT8, 0x8000);
- space->install_read_handler(0x4030, 0x403f, read8_delegate(FUNC(nes_state::nes_fds_r),state));
- space->install_read_bank(0x6000, 0xdfff, "bank2");
- space->install_read_bank(0xe000, 0xffff, "bank1");
+ space.install_read_handler(0x4030, 0x403f, read8_delegate(FUNC(nes_state::nes_fds_r),state));
+ space.install_read_bank(0x6000, 0xdfff, "bank2");
+ space.install_read_bank(0xe000, 0xffff, "bank1");
- space->install_write_handler(0x4020, 0x402f, write8_delegate(FUNC(nes_state::nes_fds_w),state));
- space->install_write_bank(0x6000, 0xdfff, "bank2");
+ space.install_write_handler(0x4020, 0x402f, write8_delegate(FUNC(nes_state::nes_fds_w),state));
+ space.install_write_bank(0x6000, 0xdfff, "bank2");
state->membank("bank1")->set_base(&state->m_rom[0xe000]);
state->membank("bank2")->set_base(state->m_fds_ram);
@@ -84,11 +84,11 @@ static void init_nes_core( running_machine &machine )
pcb_handlers_setup(machine);
/* Set up the memory handlers for the mapper */
- space->install_read_bank(0x8000, 0x9fff, "bank1");
- space->install_read_bank(0xa000, 0xbfff, "bank2");
- space->install_read_bank(0xc000, 0xdfff, "bank3");
- space->install_read_bank(0xe000, 0xffff, "bank4");
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_read_bank(0x8000, 0x9fff, "bank1");
+ space.install_read_bank(0xa000, 0xbfff, "bank2");
+ space.install_read_bank(0xc000, 0xdfff, "bank3");
+ space.install_read_bank(0xe000, 0xffff, "bank4");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
/* configure banks 1-4 */
for (i = 0; i < 4; i++)
@@ -161,35 +161,35 @@ static void init_nes_core( running_machine &machine )
// there are still some quirk about writes to bank5... I hope to fix them soon. (mappers 34,45,52,246 have both mid_w and WRAM-->check)
if (state->m_mmc_write_mid)
- space->install_legacy_write_handler(0x6000, 0x7fff, state->m_mmc_write_mid,state->m_mmc_write_mid_name);
+ space.install_legacy_write_handler(0x6000, 0x7fff, state->m_mmc_write_mid,state->m_mmc_write_mid_name);
if (state->m_mmc_write)
- space->install_legacy_write_handler(0x8000, 0xffff, state->m_mmc_write, state->m_mmc_write_name);
+ space.install_legacy_write_handler(0x8000, 0xffff, state->m_mmc_write, state->m_mmc_write_name);
// In fact, we also allow single pcbs to overwrite the bank read handlers defined above,
// because some pcbs (mainly pirate ones) require protection values to be read instead of
// the expected ROM banks: these handlers, though, must take care of the ROM access as well
if (state->m_mmc_read_mid)
- space->install_legacy_read_handler(0x6000, 0x7fff, state->m_mmc_read_mid,state->m_mmc_read_mid_name);
+ space.install_legacy_read_handler(0x6000, 0x7fff, state->m_mmc_read_mid,state->m_mmc_read_mid_name);
if (state->m_mmc_read)
- space->install_legacy_read_handler(0x8000, 0xffff, state->m_mmc_read,state->m_mmc_read_name);
+ space.install_legacy_read_handler(0x8000, 0xffff, state->m_mmc_read,state->m_mmc_read_name);
// install additional handlers
if (state->m_pcb_id == BTL_SMB2B || state->m_mapper == 50)
{
- space->install_legacy_write_handler(0x4020, 0x403f, FUNC(smb2jb_extra_w));
- space->install_legacy_write_handler(0x40a0, 0x40bf, FUNC(smb2jb_extra_w));
+ space.install_legacy_write_handler(0x4020, 0x403f, FUNC(smb2jb_extra_w));
+ space.install_legacy_write_handler(0x40a0, 0x40bf, FUNC(smb2jb_extra_w));
}
if (state->m_pcb_id == KAISER_KS7017)
{
- space->install_legacy_read_handler(0x4030, 0x4030, FUNC(ks7017_extra_r));
- space->install_legacy_write_handler(0x4020, 0x40ff, FUNC(ks7017_extra_w));
+ space.install_legacy_read_handler(0x4030, 0x4030, FUNC(ks7017_extra_r));
+ space.install_legacy_write_handler(0x4020, 0x40ff, FUNC(ks7017_extra_w));
}
if (state->m_pcb_id == UNL_603_5052)
{
- space->install_legacy_read_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_r));
- space->install_legacy_write_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_w));
+ space.install_legacy_read_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_r));
+ space.install_legacy_write_handler(0x4020, 0x40ff, FUNC(unl_6035052_extra_w));
}
if (state->m_pcb_id == WAIXING_SH2)
diff --git a/src/mess/machine/nes_ines.c b/src/mess/machine/nes_ines.c
index 547b9203895..e791df460c7 100644
--- a/src/mess/machine/nes_ines.c
+++ b/src/mess/machine/nes_ines.c
@@ -47,17 +47,17 @@ static void ffe_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( mapper6_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mapper6_l_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x1fe:
state->m_mmc_latch1 = data & 0x80;
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
break;
case 0x1ff:
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x401:
@@ -75,19 +75,19 @@ static WRITE8_HANDLER( mapper6_l_w )
static WRITE8_HANDLER( mapper6_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mapper6_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_mmc_latch1) // when in "FFE mode" we are forced to use CHRRAM/EXRAM bank?
{
- prg16_89ab(space->machine(), data >> 2);
- // chr8(space->machine(), data & 0x03, ???);
+ prg16_89ab(space.machine(), data >> 2);
+ // chr8(space.machine(), data & 0x03, ???);
// due to lack of info on the exact behavior, we simply act as if mmc_latch1=1
if (state->m_mmc_chr_source == CHRROM)
- chr8(space->machine(), data & 0x03, CHRROM);
+ chr8(space.machine(), data & 0x03, CHRROM);
}
else if (state->m_mmc_chr_source == CHRROM) // otherwise, we can use CHRROM (when present)
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -105,8 +105,8 @@ static WRITE8_HANDLER( mapper8_w )
{
LOG_MMC(("mapper8_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data & 0x07, CHRROM);
- prg16_89ab(space->machine(), data >> 3);
+ chr8(space.machine(), data & 0x07, CHRROM);
+ prg16_89ab(space.machine(), data >> 3);
}
/*************************************************************
@@ -123,16 +123,16 @@ static WRITE8_HANDLER( mapper8_w )
static WRITE8_HANDLER( mapper17_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mapper17_l_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x1fe:
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
break;
case 0x1ff:
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x401:
@@ -147,16 +147,16 @@ static WRITE8_HANDLER( mapper17_l_w )
break;
case 0x404:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x405:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x406:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x407:
- prg8_ef(space->machine(), data);
+ prg8_ef(space.machine(), data);
break;
case 0x410:
@@ -167,7 +167,7 @@ static WRITE8_HANDLER( mapper17_l_w )
case 0x415:
case 0x416:
case 0x417:
- chr1_x(space->machine(), offset & 7, data, CHRROM);
+ chr1_x(space.machine(), offset & 7, data, CHRROM);
break;
}
}
diff --git a/src/mess/machine/nes_mmc.c b/src/mess/machine/nes_mmc.c
index 68955202724..8a068ecfef4 100644
--- a/src/mess/machine/nes_mmc.c
+++ b/src/mess/machine/nes_mmc.c
@@ -167,7 +167,7 @@ static WRITE8_HANDLER( mapper17_l_w );
WRITE8_HANDLER( nes_chr_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = offset >> 10;
if (state->m_chr_map[bank].source == CHRRAM)
@@ -178,7 +178,7 @@ WRITE8_HANDLER( nes_chr_w )
READ8_HANDLER( nes_chr_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = offset >> 10;
// a few CNROM boards contained copy protection schemes through
@@ -193,7 +193,7 @@ READ8_HANDLER( nes_chr_r )
WRITE8_HANDLER( nes_nt_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int page = ((offset & 0xc00) >> 10);
if (state->m_nt_page[page].writable == 0)
@@ -204,7 +204,7 @@ WRITE8_HANDLER( nes_nt_w )
READ8_HANDLER( nes_nt_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int page = ((offset & 0xc00) >> 10);
if (state->m_nt_page[page].source == MMC5FILL)
@@ -219,7 +219,7 @@ READ8_HANDLER( nes_nt_r )
WRITE8_HANDLER( nes_low_mapper_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
if (state->m_mmc_write_low)
(*state->m_mmc_write_low)(space, offset, data);
@@ -229,7 +229,7 @@ WRITE8_HANDLER( nes_low_mapper_w )
READ8_HANDLER( nes_low_mapper_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
if (state->m_mmc_read_low)
return (*state->m_mmc_read_low)(space, offset);
diff --git a/src/mess/machine/nes_pcb.c b/src/mess/machine/nes_pcb.c
index c5e486f3938..7b8a66c65b0 100644
--- a/src/mess/machine/nes_pcb.c
+++ b/src/mess/machine/nes_pcb.c
@@ -718,7 +718,7 @@ static WRITE8_HANDLER( uxrom_w )
{
LOG_MMC(("uxrom_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -741,7 +741,7 @@ static WRITE8_HANDLER( uxrom_cc_w )
{
LOG_MMC(("uxrom_cc_w, offset: %04x, data: %02x\n", offset, data));
- prg16_cdef(space->machine(), data);
+ prg16_cdef(space.machine(), data);
}
/*************************************************************
@@ -764,7 +764,7 @@ static WRITE8_HANDLER( un1rom_w )
{
LOG_MMC(("un1rom_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), data >> 2);
+ prg16_89ab(space.machine(), data >> 2);
}
/*************************************************************
@@ -793,12 +793,12 @@ static WRITE8_HANDLER( un1rom_w )
static WRITE8_HANDLER( cnrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cnrom_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_ce_mask)
{
- chr8(space->machine(), data & ~state->m_ce_mask, CHRROM);
+ chr8(space.machine(), data & ~state->m_ce_mask, CHRROM);
if ((data & state->m_ce_mask) == state->m_ce_state)
state->m_chr_open_bus = 0;
@@ -806,7 +806,7 @@ static WRITE8_HANDLER( cnrom_w )
state->m_chr_open_bus = 1;
}
else
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -849,7 +849,7 @@ static WRITE8_HANDLER( bandai_pt554_m_w )
static WRITE8_HANDLER( cprom_w )
{
LOG_MMC(("cprom_w, offset: %04x, data: %02x\n", offset, data));
- chr4_4(space->machine(), data, CHRRAM);
+ chr4_4(space.machine(), data, CHRRAM);
}
/*************************************************************
@@ -872,8 +872,8 @@ static WRITE8_HANDLER( axrom_w )
{
LOG_MMC(("axrom_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- prg32(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -894,7 +894,7 @@ static WRITE8_HANDLER( bxrom_w )
/* Deadly Towers is really a BxROM game - the demo screens look wrong using mapper 7. */
LOG_MMC(("bxrom_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -913,8 +913,8 @@ static WRITE8_HANDLER( gxrom_w )
{
LOG_MMC(("gxrom_w, offset %04x, data: %02x\n", offset, data));
- prg32(space->machine(), (data & 0xf0) >> 4);
- chr8(space->machine(), data & 0x0f, CHRROM);
+ prg32(space.machine(), (data & 0xf0) >> 4);
+ chr8(space.machine(), data & 0x0f, CHRROM);
}
/*************************************************************
@@ -933,9 +933,9 @@ static TIMER_CALLBACK( mmc1_resync_callback )
}
-static void mmc1_set_wram( address_space *space, int board )
+static void mmc1_set_wram( address_space &space, int board )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
nes_state *state = machine.driver_data<nes_state>();
UINT8 bank = BIT(state->m_mmc_reg[0], 4) ? BIT(state->m_mmc_reg[1], 4) : BIT(state->m_mmc_reg[1], 3);
@@ -943,10 +943,10 @@ static void mmc1_set_wram( address_space *space, int board )
{
case STD_SXROM: // here also reads are disabled!
if (!BIT(state->m_mmc_reg[3], 4))
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_readwrite(0x6000, 0x7fff);
+ space.unmap_readwrite(0x6000, 0x7fff);
break;
}
case STD_SXROM_A: // ignore WRAM enable bit
@@ -957,10 +957,10 @@ static void mmc1_set_wram( address_space *space, int board )
break;
case STD_SOROM: // there are 2 WRAM banks only and battery is bank 2 for the cart (hence, we invert bank, because we have battery first)
if (!BIT(state->m_mmc_reg[3], 4))
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_readwrite(0x6000, 0x7fff);
+ space.unmap_readwrite(0x6000, 0x7fff);
break;
}
case STD_SOROM_A: // ignore WRAM enable bit
@@ -1005,9 +1005,9 @@ static void mmc1_set_prg( running_machine &machine )
}
}
-static void mmc1_set_prg_wram( address_space *space, int board )
+static void mmc1_set_prg_wram( address_space &space, int board )
{
- mmc1_set_prg(space->machine());
+ mmc1_set_prg(space.machine());
mmc1_set_wram(space, board);
}
@@ -1025,9 +1025,9 @@ static void mmc1_set_chr( running_machine &machine )
chr8(machine, (state->m_mmc_reg[1] & 0x1f) >> 1, state->m_mmc_chr_source);
}
-static void common_sxrom_write_handler( address_space *space, offs_t offset, UINT8 data, int board )
+static void common_sxrom_write_handler( address_space &space, offs_t offset, UINT8 data, int board )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
nes_state *state = machine.driver_data<nes_state>();
/* Note that there is only one latch and shift counter, shared amongst the 4 regs */
/* Space Shuttle will not work if they have independent variables. */
@@ -1044,7 +1044,7 @@ static void common_sxrom_write_handler( address_space *space, offs_t offset, UIN
else
{
state->m_mmc1_reg_write_enable = 0;
- space->machine().scheduler().synchronize(FUNC(mmc1_resync_callback));
+ space.machine().scheduler().synchronize(FUNC(mmc1_resync_callback));
}
if (data & 0x80)
@@ -1103,7 +1103,7 @@ static void common_sxrom_write_handler( address_space *space, offs_t offset, UIN
static WRITE8_HANDLER( sxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sxrom_w, offset: %04x, data: %02x\n", offset, data));
common_sxrom_write_handler(space, offset, data, state->m_pcb_id);
@@ -1152,35 +1152,35 @@ static void mmc2_latch( device_t *device, offs_t offset )
static WRITE8_HANDLER( pxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("pxrom_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x2000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x3000:
state->m_mmc_reg[0] = data;
if (state->m_mmc_latch1 == 0xfd)
- chr4_0(space->machine(), state->m_mmc_reg[0], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_reg[0], CHRROM);
break;
case 0x4000:
state->m_mmc_reg[1] = data;
if (state->m_mmc_latch1 == 0xfe)
- chr4_0(space->machine(), state->m_mmc_reg[1], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_reg[1], CHRROM);
break;
case 0x5000:
state->m_mmc_reg[2] = data;
if (state->m_mmc_latch2 == 0xfd)
- chr4_4(space->machine(), state->m_mmc_reg[2], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_reg[2], CHRROM);
break;
case 0x6000:
state->m_mmc_reg[3] = data;
if (state->m_mmc_latch2 == 0xfe)
- chr4_4(space->machine(), state->m_mmc_reg[3], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_reg[3], CHRROM);
break;
case 0x7000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
default:
LOG_MMC(("MMC2 uncaught w: %04x:%02x\n", offset, data));
@@ -1206,7 +1206,7 @@ static WRITE8_HANDLER( fxrom_w )
switch (offset & 0x7000)
{
case 0x2000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
pxrom_w(space, offset, data);
@@ -1222,9 +1222,9 @@ static WRITE8_HANDLER( fxrom_w )
*************************************************************/
-static void mmc3_set_wram( address_space *space )
+static void mmc3_set_wram( address_space &space )
{
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
nes_state *state = machine.driver_data<nes_state>();
// skip this function if we are emulating a MMC3 clone with mid writes
@@ -1232,18 +1232,18 @@ static void mmc3_set_wram( address_space *space )
return;
if (BIT(state->m_mmc3_wram_protect, 7))
- space->install_readwrite_bank(0x6000, 0x7fff, "bank5");
+ space.install_readwrite_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_readwrite(0x6000, 0x7fff);
+ space.unmap_readwrite(0x6000, 0x7fff);
return;
}
if (!BIT(state->m_mmc3_wram_protect, 6))
- space->install_write_bank(0x6000, 0x7fff, "bank5");
+ space.install_write_bank(0x6000, 0x7fff, "bank5");
else
{
- space->unmap_write(0x6000, 0x7fff);
+ space.unmap_write(0x6000, 0x7fff);
return;
}
}
@@ -1299,7 +1299,7 @@ static void mmc3_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( txrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
LOG_MMC(("txrom_w, offset: %04x, data: %02x\n", offset, data));
@@ -1312,11 +1312,11 @@ static WRITE8_HANDLER( txrom_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -1326,18 +1326,18 @@ static WRITE8_HANDLER( txrom_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2001:
@@ -1377,7 +1377,7 @@ static WRITE8_HANDLER( txrom_w )
static WRITE8_HANDLER( hkrom_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 write_hi, write_lo;
LOG_MMC(("hkrom_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -1397,7 +1397,7 @@ static WRITE8_HANDLER( hkrom_m_w )
static READ8_HANDLER( hkrom_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("hkrom_m_r, offset: %04x\n", offset));
if (offset < 0x1000)
@@ -1418,7 +1418,7 @@ static READ8_HANDLER( hkrom_m_r )
static WRITE8_HANDLER( hkrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc6_helper;
LOG_MMC(("hkrom_w, offset: %04x, data: %02x\n", offset, data));
@@ -1433,11 +1433,11 @@ static WRITE8_HANDLER( hkrom_w )
/* Has PRG Mode changed? */
if (BIT(mmc6_helper, 6))
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (BIT(mmc6_helper, 7))
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x2001:
@@ -1546,7 +1546,7 @@ static void tqrom_set_chr( running_machine &machine )
static WRITE8_HANDLER( tqrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
LOG_MMC(("tqrom_w, offset: %04x, data: %02x\n", offset, data));
@@ -1558,11 +1558,11 @@ static WRITE8_HANDLER( tqrom_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- tqrom_set_chr(space->machine());
+ tqrom_set_chr(space.machine());
break;
case 0x0001: /* $8001 */
cmd = state->m_mmc3_latch & 0x07;
@@ -1571,12 +1571,12 @@ static WRITE8_HANDLER( tqrom_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- tqrom_set_chr(space->machine());
+ tqrom_set_chr(space.machine());
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
@@ -1598,7 +1598,7 @@ static WRITE8_HANDLER( tqrom_w )
static WRITE8_HANDLER( zz_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper = data & 0x07;
LOG_MMC(("zz_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -1606,8 +1606,8 @@ static WRITE8_HANDLER( zz_m_w )
state->m_mmc_prg_mask = (mmc_helper << 1) | 0x07;
state->m_mmc_chr_base = BIT(mmc_helper, 2) << 7;
state->m_mmc_chr_mask = 0x7f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
/*************************************************************
@@ -1621,15 +1621,15 @@ static WRITE8_HANDLER( zz_m_w )
static WRITE8_HANDLER( qj_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("qj_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_prg_base = BIT(data, 0) << 4;
state->m_mmc_prg_mask = 0x0f;
state->m_mmc_chr_base = BIT(data, 0) << 7;
state->m_mmc_chr_mask = 0x7f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
/*************************************************************
@@ -1858,7 +1858,7 @@ static void mmc5_ppu_mirror( running_machine &machine, int page, int src )
static READ8_HANDLER( exrom_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int retVal;
/* $5c00 - $5fff: extended videoram attributes */
@@ -1895,13 +1895,13 @@ static READ8_HANDLER( exrom_l_r )
static WRITE8_HANDLER( exrom_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
// LOG_MMC(("Mapper 5 write, offset: %04x, data: %02x\n", offset + 0x4100, data));
/* Send $5000-$5015 to the sound chip */
if ((offset >= 0xf00) && (offset <= 0xf15))
{
- nes_psg_w(state->m_sound, *space, offset & 0x1f, data);
+ nes_psg_w(state->m_sound, space, offset & 0x1f, data);
return;
}
@@ -1917,7 +1917,7 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x1000: /* $5100 */
state->m_mmc5_prg_mode = data & 0x03;
- // mmc5_update_prg(space->machine());
+ // mmc5_update_prg(space.machine());
LOG_MMC(("MMC5 rom bank mode: %02x\n", data));
break;
@@ -1945,17 +1945,17 @@ static WRITE8_HANDLER( exrom_l_w )
case 0x1004: /* $5104 - Extra VRAM (EXRAM) control */
state->m_mmc5_vram_control = data & 0x03;
// update render
- mmc5_update_render_mode(space->machine());
+ mmc5_update_render_mode(space.machine());
LOG_MMC(("MMC5 exram control: %02x\n", data));
break;
case 0x1005: /* $5105 */
- mmc5_ppu_mirror(space->machine(), 0, data & 0x03);
- mmc5_ppu_mirror(space->machine(), 1, (data & 0x0c) >> 2);
- mmc5_ppu_mirror(space->machine(), 2, (data & 0x30) >> 4);
- mmc5_ppu_mirror(space->machine(), 3, (data & 0xc0) >> 6);
+ mmc5_ppu_mirror(space.machine(), 0, data & 0x03);
+ mmc5_ppu_mirror(space.machine(), 1, (data & 0x0c) >> 2);
+ mmc5_ppu_mirror(space.machine(), 2, (data & 0x30) >> 4);
+ mmc5_ppu_mirror(space.machine(), 3, (data & 0xc0) >> 6);
// update render
- mmc5_update_render_mode(space->machine());
+ mmc5_update_render_mode(space.machine());
break;
/* tile data for MMC5 flood-fill NT mode */
@@ -1979,9 +1979,9 @@ static WRITE8_HANDLER( exrom_l_w )
LOG_MMC(("MMC5 mid RAM bank select: %02x\n", data & 0x07));
// FIXME: a few Koei games have both WRAM & BWRAM but here we don't support this (yet)
if (state->m_battery)
- wram_bank(space->machine(), data, NES_BATTERY);
+ wram_bank(space.machine(), data, NES_BATTERY);
else
- wram_bank(space->machine(), data, NES_WRAM);
+ wram_bank(space.machine(), data, NES_WRAM);
break;
@@ -1990,7 +1990,7 @@ static WRITE8_HANDLER( exrom_l_w )
case 0x1016: /* $5116 */
case 0x1017: /* $5117 */
state->m_mmc5_prg_regs[offset & 3] = data;
- mmc5_update_prg(space->machine());
+ mmc5_update_prg(space.machine());
break;
#if 0
@@ -2009,7 +2009,7 @@ static WRITE8_HANDLER( exrom_l_w )
state->m_mmc5_vrom_regA[offset & 0x07] = data;
state->m_mmc5_last_chr_a = 1;
if (state->m_ppu->get_current_scanline() == 240 || !state->m_ppu->is_sprite_8x16())
- mmc5_update_chr_a(space->machine());
+ mmc5_update_chr_a(space.machine());
}
break;
@@ -2022,7 +2022,7 @@ static WRITE8_HANDLER( exrom_l_w )
state->m_mmc5_vrom_regB[offset & 0x03] = data;
state->m_mmc5_last_chr_a = 0;
if (state->m_ppu->get_current_scanline() == 240 || !state->m_ppu->is_sprite_8x16())
- mmc5_update_chr_b(space->machine());
+ mmc5_update_chr_b(space.machine());
break;
case 0x1030: /* $5130 */
@@ -2044,7 +2044,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[0] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_0(space->machine(), state->m_MMC5_vrom_bank[0], CHRROM);
+ chr1_0(space.machine(), state->m_MMC5_vrom_bank[0], CHRROM);
// state->m_nes_vram_sprite[0] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[0] = 4;
// vrom_page_a = 1;
@@ -2058,13 +2058,13 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x02:
/* 2k switch */
- chr2_0(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_0(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[1] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_1(space->machine(), state->m_MMC5_vrom_bank[1], CHRROM);
+ chr1_1(space.machine(), state->m_MMC5_vrom_bank[1], CHRROM);
// state->m_nes_vram_sprite[1] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[1] = 5;
// vrom_page_a = 1;
@@ -2080,7 +2080,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[2] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_2(space->machine(), state->m_MMC5_vrom_bank[2], CHRROM);
+ chr1_2(space.machine(), state->m_MMC5_vrom_bank[2], CHRROM);
// state->m_nes_vram_sprite[2] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[2] = 6;
// vrom_page_a = 1;
@@ -2093,17 +2093,17 @@ static WRITE8_HANDLER( exrom_l_w )
switch (state->m_mmc5_chr_mode)
{
case 0x01:
- chr4_0(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
break;
case 0x02:
/* 2k switch */
- chr2_2(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_2(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[3] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_3(space->machine(), state->m_MMC5_vrom_bank[3], CHRROM);
+ chr1_3(space.machine(), state->m_MMC5_vrom_bank[3], CHRROM);
// state->m_nes_vram_sprite[3] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[3] = 7;
// vrom_page_a = 1;
@@ -2119,7 +2119,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[4] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_4(space->machine(), state->m_MMC5_vrom_bank[4], CHRROM);
+ chr1_4(space.machine(), state->m_MMC5_vrom_bank[4], CHRROM);
// state->m_nes_vram_sprite[4] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[0] = 0;
// vrom_page_a = 0;
@@ -2133,13 +2133,13 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x02:
/* 2k switch */
- chr2_4(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_4(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[5] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_5(space->machine(), state->m_MMC5_vrom_bank[5], CHRROM);
+ chr1_5(space.machine(), state->m_MMC5_vrom_bank[5], CHRROM);
// state->m_nes_vram_sprite[5] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[1] = 1;
// vrom_page_a = 0;
@@ -2155,7 +2155,7 @@ static WRITE8_HANDLER( exrom_l_w )
/* 1k switch */
state->m_MMC5_vrom_bank[6] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_6(space->machine(), state->m_MMC5_vrom_bank[6], CHRROM);
+ chr1_6(space.machine(), state->m_MMC5_vrom_bank[6], CHRROM);
// state->m_nes_vram_sprite[6] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[2] = 2;
// vrom_page_a = 0;
@@ -2169,21 +2169,21 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x00:
/* 8k switch */
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
break;
case 0x01:
/* 4k switch */
- chr4_4(space->machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
case 0x02:
/* 2k switch */
- chr2_6(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_6(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
state->m_MMC5_vrom_bank[7] = data | (state->m_mmc5_high_chr << 8);
// mapper5_sync_vrom(0);
- chr1_7(space->machine(), state->m_MMC5_vrom_bank[7], CHRROM);
+ chr1_7(space.machine(), state->m_MMC5_vrom_bank[7], CHRROM);
// state->m_nes_vram_sprite[7] = state->m_MMC5_vrom_bank[0] * 64;
// vrom_next[3] = 3;
// vrom_page_a = 0;
@@ -2201,7 +2201,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[0]] = data * 64;
// nes_vram[0 + (vrom_page_a*4)] = data * 64;
// nes_vram[0] = data * 64;
- chr1_4(space->machine(), state->m_MMC5_vrom_bank[8], CHRROM);
+ chr1_4(space.machine(), state->m_MMC5_vrom_bank[8], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2217,8 +2217,8 @@ static WRITE8_HANDLER( exrom_l_w )
{
case 0x02:
/* 2k switch */
- chr2_0(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
- chr2_4(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_0(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_4(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
@@ -2226,7 +2226,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[1]] = data * 64;
// nes_vram[1 + (vrom_page_a*4)] = data * 64;
// nes_vram[1] = data * 64;
- chr1_5(space->machine(), state->m_MMC5_vrom_bank[9], CHRROM);
+ chr1_5(space.machine(), state->m_MMC5_vrom_bank[9], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2246,7 +2246,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[2]] = data * 64;
// nes_vram[2 + (vrom_page_a*4)] = data * 64;
// nes_vram[2] = data * 64;
- chr1_6(space->machine(), state->m_MMC5_vrom_bank[10], CHRROM);
+ chr1_6(space.machine(), state->m_MMC5_vrom_bank[10], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2263,18 +2263,18 @@ static WRITE8_HANDLER( exrom_l_w )
case 0x00:
/* 8k switch */
/* switches in first half of an 8K bank!) */
- chr4_0(space->machine(), data << 1, CHRROM);
- chr4_4(space->machine(), data << 1, CHRROM);
+ chr4_0(space.machine(), data << 1, CHRROM);
+ chr4_4(space.machine(), data << 1, CHRROM);
break;
case 0x01:
/* 4k switch */
- chr4_0(space->machine(), data, CHRROM);
- chr4_4(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
case 0x02:
/* 2k switch */
- chr2_2(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
- chr2_6(space->machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_2(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
+ chr2_6(space.machine(), data | (state->m_mmc5_high_chr << 8), CHRROM);
break;
case 0x03:
/* 1k switch */
@@ -2282,7 +2282,7 @@ static WRITE8_HANDLER( exrom_l_w )
// nes_vram[vrom_next[3]] = data * 64;
// nes_vram[3 + (vrom_page_a*4)] = data * 64;
// nes_vram[3] = data * 64;
- chr1_7(space->machine(), state->m_MMC5_vrom_bank[11], CHRROM);
+ chr1_7(space.machine(), state->m_MMC5_vrom_bank[11], CHRROM);
// mapper5_sync_vrom(1);
if (!state->m_vrom_page_b)
{
@@ -2397,38 +2397,38 @@ static void ntbrom_mirror( running_machine &machine, int mirror, int mirr0, int
static WRITE8_HANDLER( ntbrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ntbrom_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x1000:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x2000:
- chr2_4(space->machine(), data, CHRROM);
+ chr2_4(space.machine(), data, CHRROM);
break;
case 0x3000:
- chr2_6(space->machine(), data, CHRROM);
+ chr2_6(space.machine(), data, CHRROM);
break;
case 0x4000:
state->m_mmc_latch1 = data & 0x7f;
- ntbrom_mirror(space->machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
+ ntbrom_mirror(space.machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
break;
case 0x5000:
state->m_mmc_latch2 = data & 0x7f;
- ntbrom_mirror(space->machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
+ ntbrom_mirror(space.machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
break;
case 0x6000:
state->m_mmc_reg[0] = data & 0x13;
- ntbrom_mirror(space->machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
+ ntbrom_mirror(space.machine(), state->m_mmc_reg[0], state->m_mmc_latch1, state->m_mmc_latch2);
break;
case 0x7000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
LOG_MMC(("ntbrom_w uncaught write, offset: %04x, data: %02x\n", offset, data));
@@ -2476,7 +2476,7 @@ static void jxrom_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( jxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("jxrom_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x6000)
@@ -2489,41 +2489,41 @@ static WRITE8_HANDLER( jxrom_w )
switch (state->m_mmc_latch1)
{
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
- chr1_x(space->machine(), state->m_mmc_latch1, data, CHRROM);
+ chr1_x(space.machine(), state->m_mmc_latch1, data, CHRROM);
break;
case 8:
if (!(data & 0x40))
{
// is PRG ROM
- space->unmap_write(0x6000, 0x7fff);
- prg8_67(space->machine(), data & 0x3f);
+ space.unmap_write(0x6000, 0x7fff);
+ prg8_67(space.machine(), data & 0x3f);
}
else if (data & 0x80)
{
// is PRG RAM
- space->install_write_bank(0x6000, 0x7fff, "bank5");
+ space.install_write_bank(0x6000, 0x7fff, "bank5");
state->m_prg_bank[4] = state->m_battery_bank5_start + (data & 0x3f);
state->membank("bank5")->set_entry(state->m_prg_bank[4]);
}
break;
case 9:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0a:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0b:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0c:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x0d:
@@ -2569,7 +2569,7 @@ static WRITE8_HANDLER( jxrom_w )
static WRITE8_HANDLER( dxrom_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("dxrom_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x2000)
@@ -2580,14 +2580,14 @@ static WRITE8_HANDLER( dxrom_w )
case 1:
switch (state->m_mmc_latch1 & 0x07)
{
- case 0: chr2_0(space->machine(), data >> 1, CHRROM); break;
- case 1: chr2_2(space->machine(), data >> 1, CHRROM); break;
- case 2: chr1_4(space->machine(), data | 0x40, CHRROM); break;
- case 3: chr1_5(space->machine(), data | 0x40, CHRROM); break;
- case 4: chr1_6(space->machine(), data | 0x40, CHRROM); break;
- case 5: chr1_7(space->machine(), data | 0x40, CHRROM); break;
- case 6: prg8_89(space->machine(), data); break;
- case 7: prg8_ab(space->machine(), data); break;
+ case 0: chr2_0(space.machine(), data >> 1, CHRROM); break;
+ case 1: chr2_2(space.machine(), data >> 1, CHRROM); break;
+ case 2: chr1_4(space.machine(), data | 0x40, CHRROM); break;
+ case 3: chr1_5(space.machine(), data | 0x40, CHRROM); break;
+ case 4: chr1_6(space.machine(), data | 0x40, CHRROM); break;
+ case 5: chr1_7(space.machine(), data | 0x40, CHRROM); break;
+ case 6: prg8_89(space.machine(), data); break;
+ case 7: prg8_ab(space.machine(), data); break;
}
break;
case 0:
@@ -2616,7 +2616,7 @@ static WRITE8_HANDLER( namcot3453_w )
// additional mirroring control when writing to even addresses
if (!(offset & 1))
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
dxrom_w(space, offset, data);
}
@@ -2635,14 +2635,14 @@ static WRITE8_HANDLER( namcot3453_w )
static WRITE8_HANDLER( namcot3446_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot3446_w, offset: %04x, data: %02x\n", offset, data));
// NEStopia does not have this!
if (offset >= 0x2000)
{
if (!(offset & 1))
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
return;
}
@@ -2651,12 +2651,12 @@ static WRITE8_HANDLER( namcot3446_w )
case 1:
switch (state->m_mmc_latch1 & 0x07)
{
- case 2: chr2_0(space->machine(), data, CHRROM); break;
- case 3: chr2_2(space->machine(), data, CHRROM); break;
- case 4: chr2_4(space->machine(), data, CHRROM); break;
- case 5: chr2_6(space->machine(), data, CHRROM); break;
- case 6: BIT(state->m_mmc_latch1, 6) ? prg8_cd(space->machine(), data) : prg8_89(space->machine(), data); break;
- case 7: prg8_ab(space->machine(), data); break;
+ case 2: chr2_0(space.machine(), data, CHRROM); break;
+ case 3: chr2_2(space.machine(), data, CHRROM); break;
+ case 4: chr2_4(space.machine(), data, CHRROM); break;
+ case 5: chr2_6(space.machine(), data, CHRROM); break;
+ case 6: BIT(state->m_mmc_latch1, 6) ? prg8_cd(space.machine(), data) : prg8_89(space.machine(), data); break;
+ case 7: prg8_ab(space.machine(), data); break;
}
break;
case 0:
@@ -2680,7 +2680,7 @@ static WRITE8_HANDLER( namcot3446_w )
static WRITE8_HANDLER( namcot3425_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mode;
LOG_MMC(("namcot3425_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x2000)
@@ -2692,26 +2692,26 @@ static WRITE8_HANDLER( namcot3425_w )
mode = state->m_mmc_latch1 & 0x07;
switch (mode)
{
- case 0: chr2_0(space->machine(), data >> 1, CHRROM); break;
- case 1: chr2_2(space->machine(), data >> 1, CHRROM); break;
+ case 0: chr2_0(space.machine(), data >> 1, CHRROM); break;
+ case 1: chr2_2(space.machine(), data >> 1, CHRROM); break;
case 2:
case 3:
case 4:
case 5:
- chr1_x(space->machine(), 2 + mode, data, CHRROM);
+ chr1_x(space.machine(), 2 + mode, data, CHRROM);
state->m_mmc_reg[mode - 2] = BIT(data, 5);
if (!BIT(state->m_mmc_latch1, 7))
{
- set_nt_page(space->machine(), 0, CIRAM, state->m_mmc_reg[0], 1);
- set_nt_page(space->machine(), 1, CIRAM, state->m_mmc_reg[1], 1);
- set_nt_page(space->machine(), 2, CIRAM, state->m_mmc_reg[2], 1);
- set_nt_page(space->machine(), 3, CIRAM, state->m_mmc_reg[3], 1);
+ set_nt_page(space.machine(), 0, CIRAM, state->m_mmc_reg[0], 1);
+ set_nt_page(space.machine(), 1, CIRAM, state->m_mmc_reg[1], 1);
+ set_nt_page(space.machine(), 2, CIRAM, state->m_mmc_reg[2], 1);
+ set_nt_page(space.machine(), 3, CIRAM, state->m_mmc_reg[3], 1);
}
else
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
break;
- case 6: prg8_89(space->machine(), data); break;
- case 7: prg8_ab(space->machine(), data); break;
+ case 6: prg8_89(space.machine(), data); break;
+ case 7: prg8_ab(space.machine(), data); break;
}
break;
case 0:
@@ -2734,11 +2734,11 @@ static WRITE8_HANDLER( namcot3425_w )
static WRITE8_HANDLER( dis_74x377_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("dis_74x377_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data >> 4, state->m_mmc_chr_source);
- prg32(space->machine(), data & 0x0f);
+ chr8(space.machine(), data >> 4, state->m_mmc_chr_source);
+ prg32(space.machine(), data & 0x0f);
}
/*************************************************************
@@ -2753,7 +2753,7 @@ static WRITE8_HANDLER( dis_74x139x74_m_w )
{
LOG_MMC(("dis_74x139x74_m_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), ((data & 0x02) >> 1) | ((data & 0x01) << 1), CHRROM);
+ chr8(space.machine(), ((data & 0x02) >> 1) | ((data & 0x01) << 1), CHRROM);
}
/*************************************************************
@@ -2770,8 +2770,8 @@ static WRITE8_HANDLER( dis_74x161x138_m_w )
{
LOG_MMC(("dis_74x161x138_m_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data >> 2, CHRROM);
- prg32(space->machine(), data);
+ chr8(space.machine(), data >> 2, CHRROM);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -2788,13 +2788,13 @@ static WRITE8_HANDLER( dis_74x161x138_m_w )
static WRITE8_HANDLER( dis_74x161x161x32_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("dis_74x161x161x32_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_hard_mirroring) // there are two 'variants' depending on hardwired or mapper ctrl mirroring
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- chr8(space->machine(), data, CHRROM);
- prg16_89ab(space->machine(), data >> 4);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ chr8(space.machine(), data, CHRROM);
+ prg16_89ab(space.machine(), data >> 4);
}
/*************************************************************
@@ -2842,25 +2842,25 @@ static void bandai_lz_irq( device_t *device, int scanline, int vblank, int blank
static WRITE8_HANDLER( lz93d50_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("lz93d50_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x000f)
{
case 0: case 1: case 2: case 3:
case 4: case 5: case 6: case 7:
- chr1_x(space->machine(), offset & 0x07, data, state->m_mmc_chr_source);
+ chr1_x(space.machine(), offset & 0x07, data, state->m_mmc_chr_source);
break;
case 8:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
case 9:
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x0a:
@@ -2880,7 +2880,7 @@ static WRITE8_HANDLER( lz93d50_w )
static WRITE8_HANDLER( lz93d50_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("lz93d50_m_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_battery && !state->m_wram)
@@ -2906,7 +2906,7 @@ static void fjump2_set_prg( running_machine &machine )
static WRITE8_HANDLER( fjump2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fjump2_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x000f)
@@ -2914,11 +2914,11 @@ static WRITE8_HANDLER( fjump2_w )
case 0: case 1: case 2: case 3:
case 4: case 5: case 6: case 7:
state->m_mmc_reg[offset & 0x000f] = data;
- fjump2_set_prg(space->machine());
+ fjump2_set_prg(space.machine());
break;
case 8:
state->m_mmc_latch1 = (data & 0x0f);
- fjump2_set_prg(space->machine());
+ fjump2_set_prg(space.machine());
break;
default:
lz93d50_m_w(space, offset & 0x0f, data);
@@ -2942,7 +2942,7 @@ static WRITE8_HANDLER( bandai_ks_w )
{
LOG_MMC(("bandai_ks_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), data ^ 0x08);
+ prg16_89ab(space.machine(), data ^ 0x08);
}
/*************************************************************
@@ -2960,16 +2960,16 @@ static WRITE8_HANDLER( bandai_ks_w )
static WRITE8_HANDLER( bandai_ok_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("mapper96_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
state->m_mmc_latch1 = data;
mmc_helper = (state->m_mmc_latch1 & 0x03) | (data & 0x04);
- chr4_0(space->machine(), mmc_helper, CHRRAM);
- chr4_4(space->machine(), 0x03 | (data & 0x04), CHRRAM);
+ chr4_0(space.machine(), mmc_helper, CHRRAM);
+ chr4_4(space.machine(), 0x03 | (data & 0x04), CHRRAM);
}
/*************************************************************
@@ -2986,8 +2986,8 @@ static WRITE8_HANDLER( lrog017_w )
{
LOG_MMC(("lrog017_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
- chr2_0(space->machine(), (data >> 4), CHRROM);
+ prg32(space.machine(), data);
+ chr2_0(space.machine(), (data >> 4), CHRROM);
}
/*************************************************************
@@ -3002,9 +3002,9 @@ static WRITE8_HANDLER( irem_hd_w )
{
LOG_MMC(("irem_hd_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
- chr8(space->machine(), data >> 4, CHRROM);
- prg16_89ab(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ chr8(space.machine(), data >> 4, CHRROM);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -3025,8 +3025,8 @@ static WRITE8_HANDLER( tam_s1_w )
if (offset < 0x4000)
{
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
- prg16_cdef(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ prg16_cdef(space.machine(), data);
}
}
@@ -3042,25 +3042,25 @@ static WRITE8_HANDLER( tam_s1_w )
static WRITE8_HANDLER( g101_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("g101_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
// NEStopia here differs a little bit
- state->m_mmc_latch1 ? prg8_cd(space->machine(), data) : prg8_89(space->machine(), data);
+ state->m_mmc_latch1 ? prg8_cd(space.machine(), data) : prg8_89(space.machine(), data);
break;
case 0x1000:
state->m_mmc_latch1 = BIT(data, 1);
if (!state->m_hard_mirroring) // there are two 'variants' depending on hardwired or mapper ctrl mirroring
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
}
}
@@ -3098,17 +3098,17 @@ static void h3001_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( h3001_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("h3001_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x7fff)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1001:
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x1003:
@@ -3128,16 +3128,16 @@ static WRITE8_HANDLER( h3001_w )
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000: case 0x3001: case 0x3002: case 0x3003:
case 0x3004: case 0x3005: case 0x3006: case 0x3007:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x4000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
default:
@@ -3211,7 +3211,7 @@ static void ss88006_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( ss88006_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("mapper18_w, offset: %04x, data: %02x\n", offset, data));
@@ -3219,27 +3219,27 @@ static WRITE8_HANDLER( ss88006_w )
{
case 0x0000:
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0xf0) | (data & 0x0f);
- prg8_89(space->machine(), state->m_mmc_prg_bank[0]);
+ prg8_89(space.machine(), state->m_mmc_prg_bank[0]);
break;
case 0x0001:
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0x0f) | (data << 4);
- prg8_89(space->machine(), state->m_mmc_prg_bank[0]);
+ prg8_89(space.machine(), state->m_mmc_prg_bank[0]);
break;
case 0x0002:
state->m_mmc_prg_bank[1] = (state->m_mmc_prg_bank[1] & 0xf0) | (data & 0x0f);
- prg8_ab(space->machine(), state->m_mmc_prg_bank[1]);
+ prg8_ab(space.machine(), state->m_mmc_prg_bank[1]);
break;
case 0x0003:
state->m_mmc_prg_bank[1] = (state->m_mmc_prg_bank[1] & 0x0f) | (data << 4);
- prg8_ab(space->machine(), state->m_mmc_prg_bank[1]);
+ prg8_ab(space.machine(), state->m_mmc_prg_bank[1]);
break;
case 0x1000:
state->m_mmc_prg_bank[2] = (state->m_mmc_prg_bank[2] & 0xf0) | (data & 0x0f);
- prg8_cd(space->machine(), state->m_mmc_prg_bank[2]);
+ prg8_cd(space.machine(), state->m_mmc_prg_bank[2]);
break;
case 0x1001:
state->m_mmc_prg_bank[2] = (state->m_mmc_prg_bank[2] & 0x0f) | (data << 4);
- prg8_cd(space->machine(), state->m_mmc_prg_bank[2]);
+ prg8_cd(space.machine(), state->m_mmc_prg_bank[2]);
break;
/* $9002, 3 (1002, 3) uncaught = Jaleco Baseball writes 0 */
@@ -3255,7 +3255,7 @@ static WRITE8_HANDLER( ss88006_w )
else
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x6000:
@@ -3282,10 +3282,10 @@ static WRITE8_HANDLER( ss88006_w )
case 0x7002:
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
@@ -3310,8 +3310,8 @@ static WRITE8_HANDLER( ss88006_w )
static WRITE8_HANDLER( jf11_m_w )
{
LOG_MMC(("jf11_m_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data, CHRROM);
- prg32(space->machine(), data >> 4);
+ chr8(space.machine(), data, CHRROM);
+ prg32(space.machine(), data >> 4);
}
/*************************************************************
@@ -3334,8 +3334,8 @@ static WRITE8_HANDLER( jf13_m_w )
if (offset == 0)
{
- prg32(space->machine(), (data >> 4) & 0x03);
- chr8(space->machine(), ((data >> 4) & 0x04) | (data & 0x03), CHRROM);
+ prg32(space.machine(), (data >> 4) & 0x03);
+ chr8(space.machine(), ((data >> 4) & 0x04) | (data & 0x03), CHRROM);
}
if (offset == 0x1000)
@@ -3361,9 +3361,9 @@ static WRITE8_HANDLER( jf16_w )
{
LOG_MMC(("jf16_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- chr8(space->machine(), data >> 4, CHRROM);
- prg16_89ab(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ chr8(space.machine(), data >> 4, CHRROM);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -3386,9 +3386,9 @@ static WRITE8_HANDLER( jf17_w )
LOG_MMC(("jf17_w, offset: %04x, data: %02x\n", offset, data));
if (BIT(data, 7))
- prg16_89ab(space->machine(), data & 0x0f);
+ prg16_89ab(space.machine(), data & 0x0f);
if (BIT(data, 6))
- chr8(space->machine(), data & 0x0f, CHRROM);
+ chr8(space.machine(), data & 0x0f, CHRROM);
if (BIT(data, 5) && !BIT(data,4))
LOG_MMC(("Jaleco JF-17 sound write, data: %02x\n", data & 0x1f));
}
@@ -3412,9 +3412,9 @@ static WRITE8_HANDLER( jf19_w )
LOG_MMC(("jf19_w, offset: %04x, data: %02x\n", offset, data));
if (BIT(data, 7))
- prg16_cdef(space->machine(), data & 0x0f);
+ prg16_cdef(space.machine(), data & 0x0f);
if (BIT(data, 6))
- chr8(space->machine(), data & 0x0f, CHRROM);
+ chr8(space.machine(), data & 0x0f, CHRROM);
if (BIT(data, 5) && !BIT(data,4))
LOG_MMC(("Jaleco JF-19 sound write, data: %02x\n", data & 0x1f));
}
@@ -3433,34 +3433,34 @@ static WRITE8_HANDLER( jf19_w )
static WRITE8_HANDLER( konami_vrc1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("konami_vrc1_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1000:
- set_nt_mirroring(space->machine(), (data & 0x01) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (data & 0x01) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & 0x0f) | ((data & 0x02) << 3);
state->m_mmc_vrom_bank[1] = (state->m_mmc_vrom_bank[1] & 0x0f) | ((data & 0x04) << 2);
- chr4_0(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
- chr4_4(space->machine(), state->m_mmc_vrom_bank[1], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_vrom_bank[1], CHRROM);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x4000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x6000:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & 0x10) | (data & 0x0f);
- chr4_0(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr4_0(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x7000:
state->m_mmc_vrom_bank[1] = (state->m_mmc_vrom_bank[1] & 0x10) | (data & 0x0f);
- chr4_4(space->machine(), state->m_mmc_vrom_bank[1], CHRROM);
+ chr4_4(space.machine(), state->m_mmc_vrom_bank[1], CHRROM);
break;
}
}
@@ -3475,7 +3475,7 @@ static WRITE8_HANDLER( konami_vrc1_w )
static WRITE8_HANDLER( konami_vrc2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank, shift, mask;
UINT32 shifted_offs = (offset & 0x7000)
| ((offset << (9 - state->m_vrc_ls_prg_a)) & 0x200)
@@ -3483,19 +3483,19 @@ static WRITE8_HANDLER( konami_vrc2_w )
LOG_MMC(("konami_vrc2_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x1000)
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
else if (offset < 0x2000)
{
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
}
else if (offset < 0x3000)
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
else if (offset < 0x7000)
{
bank = ((shifted_offs & 0x7000) - 0x3000) / 0x0800 + BIT(shifted_offs, 9);
@@ -3503,7 +3503,7 @@ static WRITE8_HANDLER( konami_vrc2_w )
mask = (0xf0 >> shift);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & mask)
| (((data >> state->m_vrc_ls_chr) & 0x0f) << shift);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
}
else
logerror("konami_vrc2_w uncaught write, addr: %04x value: %02x\n", offset + 0x8000, data);
@@ -3524,7 +3524,7 @@ static WRITE8_HANDLER( konami_vrc2_w )
static WRITE8_HANDLER( konami_vrc3_w )
{
LOG_MMC(("konami_vrc3_w, offset: %04x, data: %02x\n", offset, data));
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
switch (offset & 0x7000)
{
@@ -3546,7 +3546,7 @@ static WRITE8_HANDLER( konami_vrc3_w )
state->m_IRQ_count |= (data & 0x0f) << 4;
break;
case 0x7000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
logerror("konami_vrc3_w uncaught write, offset %04x, data: %02x\n", offset, data);
@@ -3591,7 +3591,7 @@ static void konami_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( konami_vrc4_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank, shift, mask;
UINT32 shifted_offs = (offset & 0x7000)
| ((offset << (9 - state->m_vrc_ls_prg_a)) & 0x200)
@@ -3601,10 +3601,10 @@ static WRITE8_HANDLER( konami_vrc4_w )
if (offset < 0x1000)
{
state->m_mmc_prg_bank[0] = data;
- vrc4_set_prg(space->machine());
+ vrc4_set_prg(space.machine());
}
else if (offset >= 0x2000 && offset < 0x3000)
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
else
{
switch (shifted_offs & 0x7300)
@@ -3613,16 +3613,16 @@ static WRITE8_HANDLER( konami_vrc4_w )
case 0x1100:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x1200:
case 0x1300:
state->m_mmc_latch1 = data & 0x02;
- vrc4_set_prg(space->machine());
+ vrc4_set_prg(space.machine());
break;
case 0x3000:
case 0x3100:
@@ -3644,7 +3644,7 @@ static WRITE8_HANDLER( konami_vrc4_w )
shift = BIT(shifted_offs, 8) * 4;
mask = (0xf0 >> shift);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & mask) | ((data & 0x0f) << shift);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x7000:
state->m_IRQ_count_latch = (state->m_IRQ_count_latch & 0xf0) | (data & 0x0f);
@@ -3680,7 +3680,7 @@ static WRITE8_HANDLER( konami_vrc4_w )
static WRITE8_HANDLER( konami_vrc6_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
UINT32 shifted_offs = (offset & 0x7000)
| ((offset << (9 - state->m_vrc_ls_prg_a)) & 0x200)
@@ -3688,9 +3688,9 @@ static WRITE8_HANDLER( konami_vrc6_w )
LOG_MMC(("konami_vrc6_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x1000)
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
else if (offset >= 0x4000 && offset < 0x5000)
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
else
{
switch (shifted_offs & 0x7300)
@@ -3709,10 +3709,10 @@ static WRITE8_HANDLER( konami_vrc6_w )
case 0x3300:
switch (data & 0x0c)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x04: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x08: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x0c: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x04: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x08: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x0c: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x5000:
@@ -3724,7 +3724,7 @@ static WRITE8_HANDLER( konami_vrc6_w )
case 0x6200:
case 0x6300:
bank = ((shifted_offs & 0x7000) - 0x5000) / 0x0400 + ((shifted_offs & 0x0300) >> 8);
- chr1_x(space->machine(), bank, data, CHRROM);
+ chr1_x(space.machine(), bank, data, CHRROM);
break;
case 0x7000:
state->m_IRQ_count_latch = data;
@@ -3760,23 +3760,23 @@ static WRITE8_HANDLER( konami_vrc6_w )
static WRITE8_HANDLER( konami_vrc7_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("konami_vrc7_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7018)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0008:
case 0x0010:
case 0x0018:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x1000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
/* TODO: there are sound regs in here */
@@ -3798,16 +3798,16 @@ static WRITE8_HANDLER( konami_vrc7_w )
case 0x5010:
case 0x5018:
bank = ((offset & 0x7000) - 0x2000) / 0x0800 + ((offset & 0x0018) ? 1 : 0);
- chr1_x(space->machine(), bank, data, state->m_mmc_chr_source);
+ chr1_x(space.machine(), bank, data, state->m_mmc_chr_source);
break;
case 0x6000:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x6008: case 0x6010: case 0x6018:
@@ -3864,7 +3864,7 @@ static void namcot_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( namcot163_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot163_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -3885,7 +3885,7 @@ static WRITE8_HANDLER( namcot163_l_w )
static READ8_HANDLER( namcot163_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot163_l_r, offset: %04x\n", offset));
offset += 0x100;
@@ -3912,7 +3912,7 @@ static void namcot163_set_mirror( running_machine &machine, UINT8 page, UINT8 da
static WRITE8_HANDLER( namcot163_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("namcot163_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7800)
{
@@ -3920,29 +3920,29 @@ static WRITE8_HANDLER( namcot163_w )
case 0x1000: case 0x1800:
case 0x2000: case 0x2800:
case 0x3000: case 0x3800:
- chr1_x(space->machine(), offset / 0x800, data, CHRROM);
+ chr1_x(space.machine(), offset / 0x800, data, CHRROM);
break;
case 0x4000:
- namcot163_set_mirror(space->machine(), 0, data);
+ namcot163_set_mirror(space.machine(), 0, data);
break;
case 0x4800:
- namcot163_set_mirror(space->machine(), 1, data);
+ namcot163_set_mirror(space.machine(), 1, data);
break;
case 0x5000:
- namcot163_set_mirror(space->machine(), 2, data);
+ namcot163_set_mirror(space.machine(), 2, data);
break;
case 0x5800:
- namcot163_set_mirror(space->machine(), 3, data);
+ namcot163_set_mirror(space.machine(), 3, data);
break;
case 0x6000:
- prg8_89(space->machine(), data & 0x3f);
+ prg8_89(space.machine(), data & 0x3f);
break;
case 0x6800:
state->m_mmc_latch1 = data & 0xc0; // this should enable High CHRRAM, but we still have to properly implement it!
- prg8_ab(space->machine(), data & 0x3f);
+ prg8_ab(space.machine(), data & 0x3f);
break;
case 0x7000:
- prg8_cd(space->machine(), data & 0x3f);
+ prg8_cd(space.machine(), data & 0x3f);
break;
case 0x7800:
LOG_MMC(("Namcot-163 sound address write, data: %02x\n", data));
@@ -3964,16 +3964,16 @@ static WRITE8_HANDLER( namcot163_w )
static WRITE8_HANDLER( sunsoft1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sunsoft1_m_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_chr_chunks)
{
- chr4_0(space->machine(), data & 0x0f, CHRROM);
- chr4_4(space->machine(), data >> 4, CHRROM);
+ chr4_0(space.machine(), data & 0x0f, CHRROM);
+ chr4_4(space.machine(), data >> 4, CHRROM);
}
else
- prg16_89ab(space->machine(), data & 0x0f);
+ prg16_89ab(space.machine(), data & 0x0f);
}
/*************************************************************
@@ -3989,16 +3989,16 @@ static WRITE8_HANDLER( sunsoft1_m_w )
static WRITE8_HANDLER( sunsoft2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 sunsoft_helper = (data & 0x07) | ((data & 0x80) ? 0x08 : 0x00);
LOG_MMC(("sunsoft2_w, offset: %04x, data: %02x\n", offset, data));
if (!state->m_hard_mirroring) // there are two 'variants' depending on hardwired or mapper ctrl mirroring
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
if (state->m_chr_chunks)
- chr8(space->machine(), sunsoft_helper, CHRROM);
+ chr8(space.machine(), sunsoft_helper, CHRROM);
- prg16_89ab(space->machine(), data >> 4);
+ prg16_89ab(space.machine(), data >> 4);
}
/*************************************************************
@@ -4036,22 +4036,22 @@ static void sunsoft3_irq( device_t *device, int scanline, int vblank, int blanke
static WRITE8_HANDLER( sunsoft3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sunsoft3_w, offset %04x, data: %02x\n", offset, data));
switch (offset & 0x7800)
{
case 0x0800:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x1800:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x2800:
- chr2_4(space->machine(), data, CHRROM);
+ chr2_4(space.machine(), data, CHRROM);
break;
case 0x3800:
- chr2_6(space->machine(), data, CHRROM);
+ chr2_6(space.machine(), data, CHRROM);
break;
case 0x4000:
case 0x4800:
@@ -4068,14 +4068,14 @@ static WRITE8_HANDLER( sunsoft3_w )
case 0x6800:
switch (data & 3)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x7800:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
default:
LOG_MMC(("sunsoft3_w uncaught write, offset: %04x, data: %02x\n", offset, data));
@@ -4104,29 +4104,29 @@ static WRITE8_HANDLER( tc0190fmc_w )
switch (offset & 0x7003)
{
case 0x0000:
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg8_89(space->machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x0003:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x2000:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 0x2001:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 0x2002:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
case 0x2003:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
}
}
@@ -4152,13 +4152,13 @@ static WRITE8_HANDLER( tc0190fmc_w )
static WRITE8_HANDLER( tc0190fmc_p16_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("tc0190fmc_p16_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7003)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
case 0x0002:
@@ -4182,7 +4182,7 @@ static WRITE8_HANDLER( tc0190fmc_p16_w )
state->m_IRQ_enable = 0;
break;
case 0x6000:
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -4203,32 +4203,32 @@ static WRITE8_HANDLER( tc0190fmc_p16_w )
static WRITE8_HANDLER( x1005_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("x1005_m_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x1ef0:
- chr2_0(space->machine(), (data & 0x7f) >> 1, CHRROM);
+ chr2_0(space.machine(), (data & 0x7f) >> 1, CHRROM);
break;
case 0x1ef1:
- chr2_2(space->machine(), (data & 0x7f) >> 1, CHRROM);
+ chr2_2(space.machine(), (data & 0x7f) >> 1, CHRROM);
break;
case 0x1ef2:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 0x1ef3:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 0x1ef4:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
case 0x1ef5:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
case 0x1ef6:
case 0x1ef7:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
break;
case 0x1ef8:
case 0x1ef9:
@@ -4236,15 +4236,15 @@ static WRITE8_HANDLER( x1005_m_w )
break;
case 0x1efa:
case 0x1efb:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1efc:
case 0x1efd:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x1efe:
case 0x1eff:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
default:
logerror("mapper80_m_w uncaught addr: %04x, value: %02x\n", offset + 0x6000, data);
@@ -4259,7 +4259,7 @@ static WRITE8_HANDLER( x1005_m_w )
static READ8_HANDLER( x1005_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("x1005a_m_r, offset: %04x\n", offset));
if (offset >= 0x1f00 && state->m_mapper_ram != NULL && state->m_mmc_latch1 == 0xa3)
@@ -4281,12 +4281,12 @@ static WRITE8_HANDLER( x1005a_m_w )
switch (offset)
{
case 0x1ef0:
- set_nt_page(space->machine(), 0, CIRAM, (data & 0x80) ? 1 : 0, 1);
- set_nt_page(space->machine(), 1, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 0, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 1, CIRAM, (data & 0x80) ? 1 : 0, 1);
break;
case 0x1ef1:
- set_nt_page(space->machine(), 2, CIRAM, (data & 0x80) ? 1 : 0, 1);
- set_nt_page(space->machine(), 3, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 2, CIRAM, (data & 0x80) ? 1 : 0, 1);
+ set_nt_page(space.machine(), 3, CIRAM, (data & 0x80) ? 1 : 0, 1);
break;
}
@@ -4330,7 +4330,7 @@ static void x1017_set_chr( running_machine &machine )
static WRITE8_HANDLER( x1017_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 reg = offset & 0x07;
LOG_MMC(("x1017_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -4341,7 +4341,7 @@ static WRITE8_HANDLER( x1017_m_w )
if (state->m_mmc_vrom_bank[reg] != data)
{
state->m_mmc_vrom_bank[reg] = data;
- x1017_set_chr(space->machine());
+ x1017_set_chr(space.machine());
}
break;
case 0x1ef2:
@@ -4351,13 +4351,13 @@ static WRITE8_HANDLER( x1017_m_w )
if (state->m_mmc_vrom_bank[reg] != data)
{
state->m_mmc_vrom_bank[reg] = data;
- x1017_set_chr(space->machine());
+ x1017_set_chr(space.machine());
}
break;
case 0x1ef6:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
state->m_mmc_latch1 = ((data & 0x02) << 1);
- x1017_set_chr(space->machine());
+ x1017_set_chr(space.machine());
break;
case 0x1ef7:
case 0x1ef8:
@@ -4365,13 +4365,13 @@ static WRITE8_HANDLER( x1017_m_w )
state->m_mmc_reg[(offset & 0x0f) - 7] = data;
break;
case 0x1efa:
- prg8_89(space->machine(), data >> 2);
+ prg8_89(space.machine(), data >> 2);
break;
case 0x1efb:
- prg8_ab(space->machine(), data >> 2);
+ prg8_ab(space.machine(), data >> 2);
break;
case 0x1efc:
- prg8_cd(space->machine(), data >> 2);
+ prg8_cd(space.machine(), data >> 2);
break;
default:
logerror("x1017_m_w uncaught write, addr: %04x, value: %02x\n", offset + 0x6000, data);
@@ -4381,7 +4381,7 @@ static WRITE8_HANDLER( x1017_m_w )
static READ8_HANDLER( x1017_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("x1017_m_r, offset: %04x\n", offset));
// 2+2+1 KB of Internal RAM can be independently enabled/disabled!
@@ -4418,10 +4418,10 @@ static WRITE8_HANDLER( agci_50282_w )
LOG_MMC(("agci_50282_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x8000;
- data |= (space->read_byte(offset) & 1);
+ data |= (space.read_byte(offset) & 1);
- chr8(space->machine(), data >> 4, CHRROM);
- prg32(space->machine(), data);
+ chr8(space.machine(), data >> 4, CHRROM);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -4439,13 +4439,13 @@ static WRITE8_HANDLER( nina01_m_w )
switch (offset)
{
case 0x1ffd:
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
break;
case 0x1ffe:
- chr4_0(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
break;
case 0x1fff:
- chr4_4(space->machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
}
}
@@ -4469,8 +4469,8 @@ static WRITE8_HANDLER( nina06_l_w )
if (!(offset & 0x0100))
{
- prg32(space->machine(), data >> 3);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 3);
+ chr8(space.machine(), data, CHRROM);
}
}
@@ -4488,20 +4488,20 @@ static WRITE8_HANDLER( ae_act52_w )
UINT8 pmode;
LOG_MMC(("ae_act52_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(offset, 13) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
cbank = (data & 0x03) | ((offset & 0x0f) << 2);
- chr8(space->machine(), cbank, CHRROM);
+ chr8(space.machine(), cbank, CHRROM);
pmode = offset & 0x20;
pbank = (offset & 0x1fc0) >> 6;
if (pmode)
{
- prg16_89ab(space->machine(), pbank);
- prg16_cdef(space->machine(), pbank);
+ prg16_89ab(space.machine(), pbank);
+ prg16_cdef(space.machine(), pbank);
}
else
- prg32(space->machine(), pbank >> 1);
+ prg32(space.machine(), pbank >> 1);
}
@@ -4528,12 +4528,12 @@ static WRITE8_HANDLER( cne_decathl_w )
return;
if (offset < 0x00a5)
{
- prg32(space->machine(), (offset - 0x0065) & 0x03);
+ prg32(space.machine(), (offset - 0x0065) & 0x03);
return;
}
if (offset < 0x00e5)
{
- chr8(space->machine(), (offset - 0x00a5) & 0x07, CHRROM);
+ chr8(space.machine(), (offset - 0x00a5) & 0x07, CHRROM);
}
}
@@ -4556,7 +4556,7 @@ static WRITE8_HANDLER( cne_decathl_w )
static WRITE8_HANDLER( cne_fsb_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cne_fsb_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x0800)
@@ -4564,28 +4564,28 @@ static WRITE8_HANDLER( cne_fsb_m_w )
switch (offset & 0x0007)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0003:
- prg8_ef(space->machine(), data);
+ prg8_ef(space.machine(), data);
break;
case 0x0004:
- chr2_0(space->machine(), data, CHRROM);
+ chr2_0(space.machine(), data, CHRROM);
break;
case 0x0005:
- chr2_2(space->machine(), data, CHRROM);
+ chr2_2(space.machine(), data, CHRROM);
break;
case 0x0006:
- chr2_4(space->machine(), data, CHRROM);
+ chr2_4(space.machine(), data, CHRROM);
break;
case 0x0007:
- chr2_6(space->machine(), data, CHRROM);
+ chr2_6(space.machine(), data, CHRROM);
break;
}
}
@@ -4614,8 +4614,8 @@ static WRITE8_HANDLER( cne_shlz_l_w )
{
LOG_MMC(("cne_shlz_l_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 4);
- chr8(space->machine(), data & 0x0f, CHRROM);
+ prg32(space.machine(), data >> 4);
+ chr8(space.machine(), data & 0x0f, CHRROM);
}
/*************************************************************
@@ -4632,21 +4632,21 @@ static WRITE8_HANDLER( cne_shlz_l_w )
static WRITE8_HANDLER( caltron6in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("caltron6in1_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_latch1 = offset & 0xff;
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg32(space->machine(), offset & 0x07);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg32(space.machine(), offset & 0x07);
}
static WRITE8_HANDLER( caltron6in1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("caltron6in1_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_mmc_latch1 & 0x04)
- chr8(space->machine(), ((state->m_mmc_latch1 & 0x18) >> 1) | (data & 0x03), CHRROM);
+ chr8(space.machine(), ((state->m_mmc_latch1 & 0x18) >> 1) | (data & 0x03), CHRROM);
}
/*************************************************************
@@ -4668,7 +4668,7 @@ static WRITE8_HANDLER( caltron6in1_w )
static WRITE8_HANDLER( bf9093_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bf9093_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
@@ -4676,13 +4676,13 @@ static WRITE8_HANDLER( bf9093_w )
case 0x0000:
case 0x1000:
if (!state->m_hard_mirroring)
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
break;
case 0x4000:
case 0x5000:
case 0x6000:
case 0x7000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
}
}
@@ -4714,7 +4714,7 @@ static void bf9096_set_prg( running_machine &machine )
static WRITE8_HANDLER( bf9096_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bf9096_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x2000)
@@ -4722,7 +4722,7 @@ static WRITE8_HANDLER( bf9096_w )
else
state->m_mmc_latch2 = data;
- bf9096_set_prg(space->machine());
+ bf9096_set_prg(space.machine());
}
/*************************************************************
@@ -4739,7 +4739,7 @@ static WRITE8_HANDLER( bf9096_w )
static WRITE8_HANDLER( golden5_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("golden5_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x4000)
@@ -4747,15 +4747,15 @@ static WRITE8_HANDLER( golden5_w )
if (data & 0x08)
{
state->m_mmc_prg_bank[0] = ((data & 0x07) << 4) | (state->m_mmc_prg_bank[0] & 0x0f);
- prg16_89ab(space->machine(), state->m_mmc_prg_bank[0]);
- prg16_cdef(space->machine(), ((data & 0x07) << 4) | 0x0f);
+ prg16_89ab(space.machine(), state->m_mmc_prg_bank[0]);
+ prg16_cdef(space.machine(), ((data & 0x07) << 4) | 0x0f);
}
}
else
{
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0x70) | (data & 0x0f);
- prg16_89ab(space->machine(), state->m_mmc_prg_bank[0]);
+ prg16_89ab(space.machine(), state->m_mmc_prg_bank[0]);
}
}
@@ -4774,7 +4774,7 @@ static WRITE8_HANDLER( golden5_w )
static WRITE8_HANDLER( cony_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x1000 && offset < 0x1103) // from 0x5100-0x51ff
@@ -4783,7 +4783,7 @@ static WRITE8_HANDLER( cony_l_w )
static READ8_HANDLER( cony_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_r, offset: %04x\n", offset));
if (offset == 0x0f00) // 0x5000
@@ -4833,7 +4833,7 @@ static void cony_set_chr( running_machine &machine )
static WRITE8_HANDLER( cony_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
@@ -4844,24 +4844,24 @@ static WRITE8_HANDLER( cony_w )
case 0x30ff:
case 0x31ff:
state->m_mapper83_reg[8] = data;
- cony_set_prg(space->machine());
- cony_set_chr(space->machine());
+ cony_set_prg(space.machine());
+ cony_set_chr(space.machine());
break;
case 0x0100:
state->m_mmc_reg[0] = data & 0x80;
switch (data & 0x03)
{
case 0:
- set_nt_mirroring(space->machine(), PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_VERT);
break;
case 1:
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
break;
case 2:
- set_nt_mirroring(space->machine(), PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_LOW);
break;
case 3:
- set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH);
break;
}
break;
@@ -4873,13 +4873,13 @@ static WRITE8_HANDLER( cony_w )
state->m_IRQ_count = (data << 8) | (state->m_IRQ_count & 0xff);
break;
case 0x0300:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0301:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0302:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0312:
case 0x0313:
@@ -4891,11 +4891,11 @@ static WRITE8_HANDLER( cony_w )
case 0x0316:
case 0x0317:
state->m_mapper83_reg[offset - 0x0310] = data;
- cony_set_chr(space->machine());
+ cony_set_chr(space.machine());
break;
case 0x0318:
state->m_mapper83_reg[9] = data;
- cony_set_prg(space->machine());
+ cony_set_prg(space.machine());
break;
}
}
@@ -4915,7 +4915,7 @@ static WRITE8_HANDLER( cony_w )
static WRITE8_HANDLER( yoko_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x1300) // from 0x5400
@@ -4924,7 +4924,7 @@ static WRITE8_HANDLER( yoko_l_w )
static READ8_HANDLER( yoko_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("cony_l_r, offset: %04x\n", offset));
if (offset >= 0x0f00 && offset < 0x1300) // 0x5000
@@ -4968,22 +4968,22 @@ static void yoko_set_chr( running_machine &machine )
static WRITE8_HANDLER( yoko_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("yoko_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x0c17)
{
case 0x0000:
state->m_mmc_reg[1] = data;
- yoko_set_prg(space->machine());
+ yoko_set_prg(space.machine());
break;
case 0x400:
state->m_mmc_reg[0] = data;
if (data & 1)
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
else
- set_nt_mirroring(space->machine(), PPU_MIRROR_VERT);
- yoko_set_prg(space->machine());
+ set_nt_mirroring(space.machine(), PPU_MIRROR_VERT);
+ yoko_set_prg(space.machine());
break;
case 0x0800:
state->m_IRQ_count = (state->m_IRQ_count & 0xff00) | data;
@@ -4996,14 +4996,14 @@ static WRITE8_HANDLER( yoko_w )
case 0x0c01:
case 0x0c02:
state->m_mapper83_reg[offset & 3] = data;
- yoko_set_prg(space->machine());
+ yoko_set_prg(space.machine());
break;
case 0x0c10:
case 0x0c11:
case 0x0c16:
case 0x0c17:
state->m_mapper83_reg[4 + (offset & 3)] = data;
- yoko_set_chr(space->machine());
+ yoko_set_chr(space.machine());
break;
}
}
@@ -5024,7 +5024,7 @@ static WRITE8_HANDLER( dreamtech_l_w )
offset += 0x100;
if (offset == 0x1020) /* 0x5020 */
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
}
/*************************************************************
@@ -5042,16 +5042,16 @@ static WRITE8_HANDLER( dreamtech_l_w )
static WRITE8_HANDLER( fukutake_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fukutake_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset >= 0x200 && offset < 0x400)
{
if (offset & 1)
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
else
- wram_bank(space->machine(), data >> 6, NES_WRAM);
+ wram_bank(space.machine(), data >> 6, NES_WRAM);
}
else if (offset >= 0x400 && offset < 0xf00)
state->m_mapper_ram[offset - 0x400] = data;
@@ -5059,7 +5059,7 @@ static WRITE8_HANDLER( fukutake_l_w )
static READ8_HANDLER( fukutake_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fukutake_l_r offset: %04x\n", offset));
offset += 0x100;
@@ -5106,22 +5106,22 @@ static void futuremedia_irq( device_t *device, int scanline, int vblank, int bla
static WRITE8_HANDLER( futuremedia_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("futuremedia_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0003:
- prg8_ef(space->machine(), data);
+ prg8_ef(space.machine(), data);
break;
case 0x2000:
case 0x2001:
@@ -5131,11 +5131,11 @@ static WRITE8_HANDLER( futuremedia_w )
case 0x2005:
case 0x2006:
case 0x2007:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x5000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4001:
@@ -5169,7 +5169,7 @@ static WRITE8_HANDLER( futuremedia_w )
static WRITE8_HANDLER( gouder_sf4_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[256] =
{
0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x59,0x49,0x19,0x09,0x59,0x49,0x19,0x09,
@@ -5197,12 +5197,12 @@ static WRITE8_HANDLER( gouder_sf4_l_w )
else if (!(offset < 0xf00))
state->m_mmc_reg[4] = data;
else if (!(offset < 0x700))
- prg32(space->machine(), ((data >> 3) & 0x02) | (data & 0x01));
+ prg32(space.machine(), ((data >> 3) & 0x02) | (data & 0x01));
}
static READ8_HANDLER( gouder_sf4_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("gouder_sf4_l_r, offset: %04x\n", offset));
if (!(offset < 0x1700))
@@ -5238,8 +5238,8 @@ static WRITE8_HANDLER( henggedianzi_w )
{
LOG_MMC(("henggedianzi_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg32(space.machine(), data);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -5263,14 +5263,14 @@ static WRITE8_HANDLER( heng_xjzb_l_w )
offset += 0x4100;
if (offset & 0x5000)
- prg32(space->machine(), data >> 1);
+ prg32(space.machine(), data >> 1);
}
static WRITE8_HANDLER( heng_xjzb_w )
{
LOG_MMC(("heng_xjzb_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -5295,9 +5295,9 @@ static WRITE8_HANDLER( hes6in1_l_w )
if (!(offset & 0x100))
{
- prg32(space->machine(), (data & 0x38) >> 3);
- chr8(space->machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ prg32(space.machine(), (data & 0x38) >> 3);
+ chr8(space.machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
}
@@ -5307,8 +5307,8 @@ static WRITE8_HANDLER( hes_l_w )
if (!(offset & 0x100))
{
- prg32(space->machine(), (data & 0x38) >> 3);
- chr8(space->machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
+ prg32(space.machine(), (data & 0x38) >> 3);
+ chr8(space.machine(), (data & 0x07) | ((data & 0x40) >> 3), CHRROM);
}
}
@@ -5326,13 +5326,13 @@ static WRITE8_HANDLER( hes_l_w )
static WRITE8_HANDLER( hosenkan_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("hosenkan_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7003)
{
case 0x0001:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
state->m_mmc_latch1 = data;
@@ -5341,28 +5341,28 @@ static WRITE8_HANDLER( hosenkan_w )
switch (state->m_mmc_latch1)
{
case 0:
- chr2_0(space->machine(), data >> 1, CHRROM);
+ chr2_0(space.machine(), data >> 1, CHRROM);
break;
case 1:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 2:
- chr2_2(space->machine(), data >> 1, CHRROM);
+ chr2_2(space.machine(), data >> 1, CHRROM);
break;
case 3:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
case 4:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 5:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 6:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 7:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
}
break;
@@ -5401,10 +5401,10 @@ static WRITE8_HANDLER( ks7058_w )
switch (offset & 0x7080)
{
case 0x7000:
- chr4_0(space->machine(), data, CHRROM);
+ chr4_0(space.machine(), data, CHRROM);
break;
case 0x7080:
- chr4_4(space->machine(), data, CHRROM);
+ chr4_4(space.machine(), data, CHRROM);
break;
}
}
@@ -5423,11 +5423,11 @@ static WRITE8_HANDLER( ks7058_w )
static WRITE8_HANDLER( ks7022_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7022_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0)
- set_nt_mirroring(space->machine(), BIT(data, 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 2) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (offset == 0x2000)
state->m_mmc_latch1 = data & 0x0f;
@@ -5435,17 +5435,17 @@ static WRITE8_HANDLER( ks7022_w )
static READ8_HANDLER( ks7022_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7022_r, offset: %04x\n", offset));
if (offset == 0x7ffc)
{
- chr8(space->machine(), state->m_mmc_latch1, CHRROM);
- prg16_89ab(space->machine(), state->m_mmc_latch1);
- prg16_cdef(space->machine(), state->m_mmc_latch1);
+ chr8(space.machine(), state->m_mmc_latch1, CHRROM);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
+ prg16_cdef(space.machine(), state->m_mmc_latch1);
}
- return mmc_hi_access_rom(space->machine(), offset);
+ return mmc_hi_access_rom(space.machine(), offset);
}
/*************************************************************
@@ -5489,7 +5489,7 @@ static void ks7032_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( ks7032_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7032_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
@@ -5514,7 +5514,7 @@ static WRITE8_HANDLER( ks7032_w )
break;
case 0x7000:
state->m_mmc_reg[state->m_mmc_latch1] = data;
- ks7032_prg_update(space->machine());
+ ks7032_prg_update(space.machine());
break;
}
}
@@ -5534,7 +5534,7 @@ static WRITE8_HANDLER( ks7032_w )
static WRITE8_HANDLER( ks202_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks202_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
@@ -5559,14 +5559,14 @@ static WRITE8_HANDLER( ks202_w )
break;
case 0x7000:
state->m_mmc_reg[state->m_mmc_latch1] = data;
- ks7032_prg_update(space->machine());
+ ks7032_prg_update(space.machine());
switch (offset & 0xc00)
{
case 0x800:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
break;
case 0xc00:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
}
break;
@@ -5604,7 +5604,7 @@ static void mmc_fds_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( ks7017_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7022_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -5613,12 +5613,12 @@ static WRITE8_HANDLER( ks7017_l_w )
state->m_mmc_latch1 = ((offset >> 2) & 0x03) | ((offset >> 4) & 0x04);
if (offset >= 0x1000 && offset < 0x1100)
- prg16_89ab(space->machine(), state->m_mmc_latch1);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
}
WRITE8_HANDLER( ks7017_extra_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7017_extra_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x20;
@@ -5630,12 +5630,12 @@ WRITE8_HANDLER( ks7017_extra_w )
state->m_IRQ_count = (state->m_IRQ_count & 0x00ff) | (data << 8);
if (offset == 0x0025) /* 0x4025 */
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
READ8_HANDLER( ks7017_extra_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ks7017_extra_r, offset: %04x\n", offset));
state->m_IRQ_status &= ~0x01;
@@ -5659,7 +5659,7 @@ READ8_HANDLER( ks7017_extra_r )
static WRITE8_HANDLER( kay_pp_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kay_pp_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -5683,7 +5683,7 @@ static WRITE8_HANDLER( kay_pp_l_w )
static READ8_HANDLER( kay_pp_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kay_pp_l_r, offset: %04x\n", offset));
offset += 0x100;
@@ -5763,30 +5763,30 @@ static void kay_pp_chr_cb( running_machine &machine, int start, int bank, int so
static WRITE8_HANDLER( kay_pp_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kay_pp_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6003)
{
case 0x0000:
txrom_w(space, offset, data);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x0001:
state->m_mmc_reg[6] = (BIT(data, 0) << 5) | (BIT(data, 1) << 4) | (BIT(data, 2) << 3)
| (BIT(data, 3) << 2) | (BIT(data, 4) << 1) | BIT(data, 5);
if (!state->m_mmc_reg[7])
- kay_pp_update_regs(space->machine());
+ kay_pp_update_regs(space.machine());
txrom_w(space, offset, data);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x0003:
state->m_mmc_reg[5] = data;
- kay_pp_update_regs(space->machine());
+ kay_pp_update_regs(space.machine());
txrom_w(space, 0x0000, data);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
default:
@@ -5821,18 +5821,18 @@ static void kasing_prg_cb( running_machine &machine, int start, int bank )
static WRITE8_HANDLER( kasing_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kasing_m_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x01)
{
case 0x00:
state->m_mmc_reg[0] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x01:
state->m_mmc_chr_base = (data & 0x01) ? 0x100 : 0x000;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
}
}
@@ -5856,8 +5856,8 @@ static WRITE8_HANDLER( magics_md_w )
{
LOG_MMC(("magics_md_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 1);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 1);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -5895,7 +5895,7 @@ static void nanjing_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( nanjing_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("nanjing_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -5906,7 +5906,7 @@ static WRITE8_HANDLER( nanjing_l_w )
if (offset == 0x1100) // 0x5100
{
if (data == 6)
- prg32(space->machine(), 3);
+ prg32(space.machine(), 3);
return;
}
@@ -5925,19 +5925,19 @@ static WRITE8_HANDLER( nanjing_l_w )
case 0x200:
state->m_mmc_reg[BIT(offset, 9)] = data;
if (!BIT(state->m_mmc_reg[0], 7) && state->m_ppu->get_current_scanline() <= 127)
- chr8(space->machine(), 0, CHRRAM);
+ chr8(space.machine(), 0, CHRRAM);
break;
case 0x300:
state->m_mmc_latch1 = data;
break;
}
- prg32(space->machine(), (state->m_mmc_reg[0] & 0x0f) | ((state->m_mmc_reg[1] & 0x0f) << 4));
+ prg32(space.machine(), (state->m_mmc_reg[0] & 0x0f) | ((state->m_mmc_reg[1] & 0x0f) << 4));
}
static READ8_HANDLER( nanjing_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 value = 0;
LOG_MMC(("nanjing_l_r, offset: %04x\n", offset));
@@ -6003,7 +6003,7 @@ static WRITE8_HANDLER( nitra_w )
static WRITE8_HANDLER( ntdec_asder_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("ntdec_asder_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
@@ -6015,37 +6015,37 @@ static WRITE8_HANDLER( ntdec_asder_w )
switch (state->m_mmc_latch1)
{
case 0:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 1:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 2:
data &= 0xfe;
- chr1_0(space->machine(), data, CHRROM);
- chr1_1(space->machine(), data + 1, CHRROM);
+ chr1_0(space.machine(), data, CHRROM);
+ chr1_1(space.machine(), data + 1, CHRROM);
break;
case 3:
data &= 0xfe;
- chr1_2(space->machine(), data, CHRROM);
- chr1_3(space->machine(), data + 1, CHRROM);
+ chr1_2(space.machine(), data, CHRROM);
+ chr1_3(space.machine(), data + 1, CHRROM);
break;
case 4:
- chr1_4(space->machine(), data, CHRROM);
+ chr1_4(space.machine(), data, CHRROM);
break;
case 5:
- chr1_5(space->machine(), data, CHRROM);
+ chr1_5(space.machine(), data, CHRROM);
break;
case 6:
- chr1_6(space->machine(), data, CHRROM);
+ chr1_6(space.machine(), data, CHRROM);
break;
case 7:
- chr1_7(space->machine(), data, CHRROM);
+ chr1_7(space.machine(), data, CHRROM);
break;
}
break;
case 0x6000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -6072,16 +6072,16 @@ static WRITE8_HANDLER( ntdec_fh_m_w )
switch (offset & 0x03)
{
case 0:
- chr4_0(space->machine(), data >> 2, CHRROM);
+ chr4_0(space.machine(), data >> 2, CHRROM);
break;
case 1:
- chr2_4(space->machine(), data >> 1, CHRROM);
+ chr2_4(space.machine(), data >> 1, CHRROM);
break;
case 2:
- chr2_6(space->machine(), data >> 1 , CHRROM);
+ chr2_6(space.machine(), data >> 1 , CHRROM);
break;
case 3:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
}
}
@@ -6103,7 +6103,7 @@ static WRITE8_HANDLER( ntdec_fh_m_w )
static WRITE8_HANDLER( daou306_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("daou306_w, offset: %04x, data: %02x\n", offset, data));
int reg = BIT(offset, 2) ? 8 : 0;
@@ -6112,51 +6112,51 @@ static WRITE8_HANDLER( daou306_w )
case 0x4000:
case 0x4004:
state->m_mmc_reg[reg + 0] = data;
- chr1_0(space->machine(), state->m_mmc_reg[0] | (state->m_mmc_reg[8] << 8), CHRROM);
+ chr1_0(space.machine(), state->m_mmc_reg[0] | (state->m_mmc_reg[8] << 8), CHRROM);
break;
case 0x4001:
case 0x4005:
state->m_mmc_reg[reg + 1] = data;
- chr1_1(space->machine(), state->m_mmc_reg[1] | (state->m_mmc_reg[9] << 8), CHRROM);
+ chr1_1(space.machine(), state->m_mmc_reg[1] | (state->m_mmc_reg[9] << 8), CHRROM);
break;
case 0x4002:
case 0x4006:
state->m_mmc_reg[reg + 2] = data;
- chr1_2(space->machine(), state->m_mmc_reg[2] | (state->m_mmc_reg[10] << 8), CHRROM);
+ chr1_2(space.machine(), state->m_mmc_reg[2] | (state->m_mmc_reg[10] << 8), CHRROM);
break;
case 0x4003:
case 0x4007:
state->m_mmc_reg[reg + 3] = data;
- chr1_3(space->machine(), state->m_mmc_reg[3] | (state->m_mmc_reg[11] << 8), CHRROM);
+ chr1_3(space.machine(), state->m_mmc_reg[3] | (state->m_mmc_reg[11] << 8), CHRROM);
break;
case 0x4008:
case 0x400c:
state->m_mmc_reg[reg + 4] = data;
- chr1_4(space->machine(), state->m_mmc_reg[4] | (state->m_mmc_reg[12] << 8), CHRROM);
+ chr1_4(space.machine(), state->m_mmc_reg[4] | (state->m_mmc_reg[12] << 8), CHRROM);
break;
case 0x4009:
case 0x400d:
state->m_mmc_reg[reg + 5] = data;
- chr1_5(space->machine(), state->m_mmc_reg[5] | (state->m_mmc_reg[13] << 8), CHRROM);
+ chr1_5(space.machine(), state->m_mmc_reg[5] | (state->m_mmc_reg[13] << 8), CHRROM);
break;
case 0x400a:
case 0x400e:
state->m_mmc_reg[reg + 6] = data;
- chr1_6(space->machine(), state->m_mmc_reg[6] | (state->m_mmc_reg[14] << 8), CHRROM);
+ chr1_6(space.machine(), state->m_mmc_reg[6] | (state->m_mmc_reg[14] << 8), CHRROM);
break;
case 0x400b:
case 0x400f:
state->m_mmc_reg[reg + 7] = data;
- chr1_7(space->machine(), state->m_mmc_reg[7] | (state->m_mmc_reg[15] << 8), CHRROM);
+ chr1_7(space.machine(), state->m_mmc_reg[7] | (state->m_mmc_reg[15] << 8), CHRROM);
break;
case 0x4010:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
case 0x4014:
if (data & 1)
- set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ);
else
- set_nt_mirroring(space->machine(), PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), PPU_MIRROR_VERT);
break;
}
}
@@ -6178,11 +6178,11 @@ static WRITE8_HANDLER( daou306_w )
static WRITE8_HANDLER( gs2015_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("gs2015_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset);
- chr8(space->machine(), offset >> 1, state->m_mmc_chr_source);
+ prg32(space.machine(), offset);
+ chr8(space.machine(), offset >> 1, state->m_mmc_chr_source);
}
/*************************************************************
@@ -6211,15 +6211,15 @@ static WRITE8_HANDLER( rcm_tf_w )
{
case 0x00:
case 0x30:
- prg32(space->machine(), offset & 0x0f);
+ prg32(space.machine(), offset & 0x0f);
break;
case 0x10:
case 0x20:
- prg16_89ab(space->machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
- prg16_cdef(space->machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
+ prg16_89ab(space.machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
+ prg16_cdef(space.machine(), ((offset & 0x0f) << 1) | ((offset & 0x20) >> 4));
break;
}
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -6238,11 +6238,11 @@ static WRITE8_HANDLER( rcm_tf_w )
static WRITE8_HANDLER( rex_dbz_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("rex_dbz_l_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[0] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
/* we would need to use this read handler in 0x6000-0x7fff as well */
@@ -6330,18 +6330,18 @@ static void rex_sl1632_set_chr( running_machine &machine, UINT8 chr, int chr_bas
static WRITE8_HANDLER( rex_sl1632_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map14_helper1, map14_helper2, mmc_helper, cmd;
LOG_MMC(("rex_sl1632_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0x2131)
{
state->m_mmc_reg[0] = data;
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
if (!(state->m_mmc_reg[0] & 0x02))
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
if (state->m_mmc_reg[0] & 0x02)
@@ -6354,11 +6354,11 @@ static WRITE8_HANDLER( rex_sl1632_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -6368,22 +6368,22 @@ static WRITE8_HANDLER( rex_sl1632_w )
case 0: case 1: // these have to be changed due to the different way rex_sl1632_set_chr works (it handles 1k banks)!
state->m_mmc_vrom_bank[2 * cmd] = data;
state->m_mmc_vrom_bank[2 * cmd + 1] = data;
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd + 2] = data;
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
break;
default:
@@ -6397,7 +6397,7 @@ static WRITE8_HANDLER( rex_sl1632_w )
offset = ((offset & 0x02) | (offset >> 10)) >> 1;
map14_helper2 = ((offset + 2) & 0x07) + 4; // '+4' because first 4 state->m_mmc_extra_banks are for PRG!
state->m_mmc_extra_bank[map14_helper2] = (state->m_mmc_extra_bank[map14_helper2] & (0xf0 >> map14_helper1)) | ((data & 0x0f) << map14_helper1);
- rex_sl1632_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ rex_sl1632_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
else
{
@@ -6406,12 +6406,12 @@ static WRITE8_HANDLER( rex_sl1632_w )
case 0x0000:
case 0x2000:
state->m_mmc_extra_bank[offset >> 13] = data;
- rex_sl1632_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ rex_sl1632_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x1000:
state->m_mmc_reg[1] = data;
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_reg[1], 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -6431,24 +6431,24 @@ static WRITE8_HANDLER( rex_sl1632_w )
static WRITE8_HANDLER( rumblestation_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("rumblestation_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & 0x01) | ((data & 0x0f) << 1);
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & 0x07) | ((data & 0xf0) >> 1);
- prg32(space->machine(), state->m_mmc_prg_bank[0]);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ prg32(space.machine(), state->m_mmc_prg_bank[0]);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
}
static WRITE8_HANDLER( rumblestation_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("rumblestation_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_prg_bank[0] = (state->m_mmc_prg_bank[0] & ~0x01) | (data & 0x01);
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x07) | ((data & 0x70) >> 4);
- prg32(space->machine(), state->m_mmc_prg_bank[0]);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ prg32(space.machine(), state->m_mmc_prg_bank[0]);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
}
/*************************************************************
@@ -6487,7 +6487,7 @@ static void sachen_set_mirror( running_machine &machine, UINT8 nt ) // used by m
static WRITE8_HANDLER( sachen_74x374_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sachen_74x374_l_w, offset: %04x, data: %02x\n", offset, data));
/* write happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6501,22 +6501,22 @@ static WRITE8_HANDLER( sachen_74x374_l_w )
{
case 0x02:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x08) | ((data << 3) & 0x08);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
- prg32(space->machine(), data & 0x01);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ prg32(space.machine(), data & 0x01);
break;
case 0x04:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x04) | ((data << 2) & 0x04);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x05:
- prg32(space->machine(), data & 0x07);
+ prg32(space.machine(), data & 0x07);
break;
case 0x06:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x03) | ((data << 0) & 0x03);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x07:
- sachen_set_mirror(space->machine(), (data >> 1) & 0x03);
+ sachen_set_mirror(space.machine(), (data >> 1) & 0x03);
break;
default:
break;
@@ -6527,7 +6527,7 @@ static WRITE8_HANDLER( sachen_74x374_l_w )
static READ8_HANDLER( sachen_74x374_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sachen_74x374_l_r, offset: %04x", offset));
/* read happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6539,7 +6539,7 @@ static READ8_HANDLER( sachen_74x374_l_r )
static WRITE8_HANDLER( sachen_74x374a_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sachen_74x374a_l_w, offset: %04x, data: %02x\n", offset, data));
/* write happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6552,26 +6552,26 @@ static WRITE8_HANDLER( sachen_74x374a_l_w )
switch (state->m_mmc_latch1 & 0x07)
{
case 0x00:
- prg32(space->machine(), 0);
- chr8(space->machine(), 3, CHRROM);
+ prg32(space.machine(), 0);
+ chr8(space.machine(), 3, CHRROM);
break;
case 0x02:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x08) | ((data << 3) & 0x08);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x04:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x01) | ((data << 0) & 0x01);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x05:
- prg32(space->machine(), data & 0x01);
+ prg32(space.machine(), data & 0x01);
break;
case 0x06:
state->m_mmc_vrom_bank[0] = (state->m_mmc_vrom_bank[0] & ~0x06) | ((data << 1) & 0x06);
- chr8(space->machine(), state->m_mmc_vrom_bank[0], CHRROM);
+ chr8(space.machine(), state->m_mmc_vrom_bank[0], CHRROM);
break;
case 0x07:
- sachen_set_mirror(space->machine(), BIT(data, 0));
+ sachen_set_mirror(space.machine(), BIT(data, 0));
break;
default:
break;
@@ -6588,9 +6588,9 @@ static WRITE8_HANDLER( sachen_74x374a_l_w )
*************************************************************/
-static void common_s8259_write_handler( address_space *space, offs_t offset, UINT8 data, int board )
+static void common_s8259_write_handler( address_space &space, offs_t offset, UINT8 data, int board )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank_helper1, bank_helper2, shift, add1, add2, add3;
/* write happens only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
@@ -6605,20 +6605,20 @@ static void common_s8259_write_handler( address_space *space, offs_t offset, UIN
switch (state->m_mmc_latch1)
{
case 0x05:
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
break;
case 0x07:
- sachen_set_mirror(space->machine(), BIT(data, 0) ? 0 : (data >> 1) & 0x03);
+ sachen_set_mirror(space.machine(), BIT(data, 0) ? 0 : (data >> 1) & 0x03);
break;
default:
if (board == SACHEN_8259D)
{
if (state->m_mmc_chr_source == CHRROM)
{
- chr1_0(space->machine(), (state->m_sachen_reg[0] & 0x07), CHRROM);
- chr1_1(space->machine(), (state->m_sachen_reg[1] & 0x07) | (state->m_sachen_reg[4] << 4 & 0x10), CHRROM);
- chr1_2(space->machine(), (state->m_sachen_reg[2] & 0x07) | (state->m_sachen_reg[4] << 3 & 0x10), CHRROM);
- chr1_3(space->machine(), (state->m_sachen_reg[3] & 0x07) | (state->m_sachen_reg[4] << 2 & 0x10) | (state->m_sachen_reg[6] << 3 & 0x08), CHRROM);
+ chr1_0(space.machine(), (state->m_sachen_reg[0] & 0x07), CHRROM);
+ chr1_1(space.machine(), (state->m_sachen_reg[1] & 0x07) | (state->m_sachen_reg[4] << 4 & 0x10), CHRROM);
+ chr1_2(space.machine(), (state->m_sachen_reg[2] & 0x07) | (state->m_sachen_reg[4] << 3 & 0x10), CHRROM);
+ chr1_3(space.machine(), (state->m_sachen_reg[3] & 0x07) | (state->m_sachen_reg[4] << 2 & 0x10) | (state->m_sachen_reg[6] << 3 & 0x08), CHRROM);
}
}
else
@@ -6632,10 +6632,10 @@ static void common_s8259_write_handler( address_space *space, offs_t offset, UIN
if (state->m_mmc_chr_source == CHRROM)
{
- chr2_0(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 0] & 0x07) | bank_helper2) << shift, CHRROM);
- chr2_2(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 1] & 0x07) | bank_helper2) << shift | add1, CHRROM);
- chr2_4(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 2] & 0x07) | bank_helper2) << shift | add2, CHRROM);
- chr2_6(space->machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 3] & 0x07) | bank_helper2) << shift | add3, CHRROM);
+ chr2_0(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 0] & 0x07) | bank_helper2) << shift, CHRROM);
+ chr2_2(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 1] & 0x07) | bank_helper2) << shift | add1, CHRROM);
+ chr2_4(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 2] & 0x07) | bank_helper2) << shift | add2, CHRROM);
+ chr2_6(space.machine(), ((state->m_sachen_reg[bank_helper1 ? 0 : 3] & 0x07) | bank_helper2) << shift | add3, CHRROM);
}
}
break;
@@ -6646,7 +6646,7 @@ static void common_s8259_write_handler( address_space *space, offs_t offset, UIN
static WRITE8_HANDLER( s8259_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("s8259_w, type: %d, offset: %04x, data: %02x\n", state->m_pcb_id, offset, data));
common_s8259_write_handler(space, offset, data, state->m_pcb_id);
@@ -6654,7 +6654,7 @@ static WRITE8_HANDLER( s8259_l_w )
static WRITE8_HANDLER( s8259_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("s8259_w, type: %d, offset: %04x, data: %02x\n", state->m_pcb_id, offset, data));
common_s8259_write_handler(space, (offset + 0x100) & 0xfff, data, state->m_pcb_id);
@@ -6675,10 +6675,10 @@ static WRITE8_HANDLER( s8259_m_w )
static WRITE8_HANDLER( sa009_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sa009_l_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data, state->m_mmc_chr_source);
+ chr8(space.machine(), data, state->m_mmc_chr_source);
}
/*************************************************************
@@ -6697,7 +6697,7 @@ static WRITE8_HANDLER( sa0036_w )
{
LOG_MMC(("sa0036_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), data >> 7, CHRROM);
+ chr8(space.machine(), data >> 7, CHRROM);
}
/*************************************************************
@@ -6716,8 +6716,8 @@ static WRITE8_HANDLER( sa0037_w )
{
LOG_MMC(("sa0037_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 3);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 3);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -6738,7 +6738,7 @@ static WRITE8_HANDLER( sa72007_l_w )
/* only if we are at 0x4100 + k * 0x200, but 0x4100 is offset = 0 */
if (!(offset & 0x100))
- chr8(space->machine(), data >> 7, CHRROM);
+ chr8(space.machine(), data >> 7, CHRROM);
}
/*************************************************************
@@ -6757,8 +6757,8 @@ static WRITE8_HANDLER( sa72008_l_w )
{
LOG_MMC(("sa72008_l_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 2);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 2);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -6802,8 +6802,8 @@ static WRITE8_HANDLER( tcu01_l_w )
if ((offset & 0x103) == 0x002)
{
- prg32(space->machine(), ((data >> 6) & 0x02) | ((data >> 2) & 0x01));
- chr8(space->machine(), data >> 3, CHRROM);
+ prg32(space.machine(), ((data >> 6) & 0x02) | ((data >> 2) & 0x01));
+ chr8(space.machine(), data >> 3, CHRROM);
}
}
@@ -6835,19 +6835,19 @@ static WRITE8_HANDLER( tcu01_w )
static WRITE8_HANDLER( tcu02_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("tcu02_l_w, offset: %04x, data: %02x\n", offset, data));
if ((offset & 0x103) == 0x002)
{
state->m_mmc_latch1 = (data & 0x30) | ((data + 3) & 0x0f);
- chr8(space->machine(), state->m_mmc_latch1, CHRROM);
+ chr8(space.machine(), state->m_mmc_latch1, CHRROM);
}
}
static READ8_HANDLER( tcu02_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("tcu02_l_r, offset: %04x\n", offset));
if ((offset & 0x103) == 0x000)
@@ -6867,7 +6867,7 @@ static READ8_HANDLER( tcu02_l_r )
static WRITE8_HANDLER( subor0_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 subor_helper1, subor_helper2;
LOG_MMC(("subor0_w, offset: %04x, data: %02x\n", offset, data));
@@ -6892,8 +6892,8 @@ static WRITE8_HANDLER( subor0_w )
subor_helper2 = 0x20;
}
- prg16_89ab(space->machine(), subor_helper1);
- prg16_cdef(space->machine(), subor_helper2);
+ prg16_89ab(space.machine(), subor_helper1);
+ prg16_cdef(space.machine(), subor_helper2);
}
/*************************************************************
@@ -6906,7 +6906,7 @@ static WRITE8_HANDLER( subor0_w )
static WRITE8_HANDLER( subor1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 subor_helper1, subor_helper2;
LOG_MMC(("subor1_w, offset: %04x, data: %02x\n", offset, data));
@@ -6931,8 +6931,8 @@ static WRITE8_HANDLER( subor1_w )
subor_helper2 = 0x07;
}
- prg16_89ab(space->machine(), subor_helper1);
- prg16_cdef(space->machine(), subor_helper2);
+ prg16_89ab(space.machine(), subor_helper1);
+ prg16_cdef(space.machine(), subor_helper2);
}
/*************************************************************
@@ -6990,56 +6990,56 @@ static void sgame_boog_set_prg( running_machine &machine )
static WRITE8_HANDLER( sgame_boog_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sgame_boog_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset == 0x1000)
{
state->m_mmc_reg[0] = data;
- sgame_boog_set_prg(space->machine());
+ sgame_boog_set_prg(space.machine());
}
else if (offset == 0x1001)
{
state->m_mmc_reg[1] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
else if (offset == 0x1007)
{
state->m_mmc3_latch = 0;
state->m_mmc_reg[2] = data;
- sgame_boog_set_prg(space->machine());
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ sgame_boog_set_prg(space.machine());
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
static WRITE8_HANDLER( sgame_boog_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sgame_boog_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0x0000)
{
state->m_mmc_reg[0] = data;
- sgame_boog_set_prg(space->machine());
+ sgame_boog_set_prg(space.machine());
}
else if (offset == 0x0001)
{
state->m_mmc_reg[1] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
else if (offset == 0x0007)
{
state->m_mmc3_latch = 0;
state->m_mmc_reg[2] = data;
- sgame_boog_set_prg(space->machine());
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ sgame_boog_set_prg(space.machine());
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
static WRITE8_HANDLER( sgame_boog_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[8] = {0,2,5,3,6,1,7,4};
LOG_MMC(("sgame_boog_w, offset: %04x, data: %02x\n", offset, data));
@@ -7076,7 +7076,7 @@ static WRITE8_HANDLER( sgame_boog_w )
if (!state->m_mmc_reg[2])
txrom_w(space, 0x4000, data);
else
- set_nt_mirroring(space->machine(), ((data >> 7) | data) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), ((data >> 7) | data) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4001:
@@ -7118,24 +7118,24 @@ static WRITE8_HANDLER( sgame_boog_w )
static WRITE8_HANDLER( sgame_lion_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sgame_lion_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_map114_reg = data;
if (state->m_map114_reg & 0x80)
{
- prg16_89ab(space->machine(), data & 0x1f);
- prg16_cdef(space->machine(), data & 0x1f);
+ prg16_89ab(space.machine(), data & 0x1f);
+ prg16_cdef(space.machine(), data & 0x1f);
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
static WRITE8_HANDLER( sgame_lion_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[8] = {0, 3, 1, 5, 6, 7, 2, 4};
LOG_MMC(("sgame_lion_w, offset: %04x, data: %02x\n", offset, data));
@@ -7144,7 +7144,7 @@ static WRITE8_HANDLER( sgame_lion_w )
switch (offset & 0x6000)
{
case 0x0000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
state->m_map114_reg_enabled = 1;
@@ -7190,8 +7190,8 @@ static WRITE8_HANDLER( tengen_800008_w )
{
LOG_MMC(("tengen_800008_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data >> 3);
- chr8(space->machine(), data, CHRROM);
+ prg32(space.machine(), data >> 3);
+ chr8(space.machine(), data, CHRROM);
}
/*************************************************************
@@ -7302,7 +7302,7 @@ static void tengen_800032_set_chr( running_machine &machine )
static WRITE8_HANDLER( tengen_800032_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map64_helper, cmd;
LOG_MMC(("tengen_800032_w, offset: %04x, data: %02x\n", offset, data));
@@ -7314,11 +7314,11 @@ static WRITE8_HANDLER( tengen_800032_w )
/* Has PRG Mode changed? */
if (map64_helper & 0x40)
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
/* Has CHR Mode changed? */
if (map64_helper & 0xa0)
- tengen_800032_set_chr(space->machine());
+ tengen_800032_set_chr(space.machine());
break;
case 0x0001:
@@ -7329,25 +7329,25 @@ static WRITE8_HANDLER( tengen_800032_w )
case 2: case 3:
case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- tengen_800032_set_chr(space->machine());
+ tengen_800032_set_chr(space.machine());
break;
case 6: case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
case 8: case 9:
state->m_mmc_vrom_bank[cmd - 2] = data;
- tengen_800032_set_chr(space->machine());
+ tengen_800032_set_chr(space.machine());
break;
case 0x0f:
state->m_mmc_prg_bank[2] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x4000:
@@ -7399,7 +7399,7 @@ static void tengen_800037_set_mirror( running_machine &machine )
static WRITE8_HANDLER( tengen_800037_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map158_helper, cmd;
LOG_MMC(("tengen_800037_w, offset: %04x, data: %02x\n", offset, data));
@@ -7411,13 +7411,13 @@ static WRITE8_HANDLER( tengen_800037_w )
/* Has PRG Mode changed? */
if (map158_helper & 0x40)
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
/* Has CHR Mode changed? */
if (map158_helper & 0xa0)
{
- tengen_800032_set_chr(space->machine());
- tengen_800037_set_mirror(space->machine());
+ tengen_800032_set_chr(space.machine());
+ tengen_800037_set_mirror(space.machine());
}
break;
@@ -7429,21 +7429,21 @@ static WRITE8_HANDLER( tengen_800037_w )
case 2: case 3:
case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- tengen_800032_set_chr(space->machine());
- tengen_800037_set_mirror(space->machine());
+ tengen_800032_set_chr(space.machine());
+ tengen_800037_set_mirror(space.machine());
break;
case 6: case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
case 8: case 9:
state->m_mmc_vrom_bank[cmd - 2] = data;
- tengen_800032_set_chr(space->machine());
- tengen_800037_set_mirror(space->machine());
+ tengen_800032_set_chr(space.machine());
+ tengen_800037_set_mirror(space.machine());
break;
case 0x0f:
state->m_mmc_prg_bank[2] = data;
- tengen_800032_set_prg(space->machine());
+ tengen_800032_set_prg(space.machine());
break;
}
break;
@@ -7475,7 +7475,7 @@ static WRITE8_HANDLER( tengen_800037_w )
static WRITE8_HANDLER( txc_22211_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211_l_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 4)
@@ -7484,7 +7484,7 @@ static WRITE8_HANDLER( txc_22211_l_w )
static READ8_HANDLER( txc_22211_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211_l_r, offset: %04x\n", offset));
if (offset == 0x0000)
@@ -7495,11 +7495,11 @@ static READ8_HANDLER( txc_22211_l_r )
static WRITE8_HANDLER( txc_22211_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), state->m_txc_reg[2] >> 2);
- chr8(space->machine(), state->m_txc_reg[2], CHRROM);
+ prg32(space.machine(), state->m_txc_reg[2] >> 2);
+ chr8(space.machine(), state->m_txc_reg[2], CHRROM);
}
/*************************************************************
@@ -7519,11 +7519,11 @@ static WRITE8_HANDLER( txc_22211_w )
static WRITE8_HANDLER( txc_22211b_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211b_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), state->m_txc_reg[2] >> 2);
- chr8(space->machine(), (((data ^ state->m_txc_reg[2]) >> 3) & 0x02) | (((data ^ state->m_txc_reg[2]) >> 5) & 0x01), CHRROM);
+ prg32(space.machine(), state->m_txc_reg[2] >> 2);
+ chr8(space.machine(), (((data ^ state->m_txc_reg[2]) >> 3) & 0x02) | (((data ^ state->m_txc_reg[2]) >> 5) & 0x01), CHRROM);
}
/*************************************************************
@@ -7543,7 +7543,7 @@ static WRITE8_HANDLER( txc_22211b_w )
static READ8_HANDLER( txc_22211c_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("txc_22211c_l_r, offset: %04x\n", offset));
if (offset == 0x0000)
@@ -7570,7 +7570,7 @@ static WRITE8_HANDLER( txc_tw_l_w )
{
LOG_MMC(("txctw_l_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), (data >> 4) | data);
+ prg32(space.machine(), (data >> 4) | data);
}
static WRITE8_HANDLER( txc_tw_m_w )
@@ -7606,8 +7606,8 @@ static WRITE8_HANDLER( txc_strikewolf_w )
if ((offset >= 0x400) && (offset < 0x7fff))
{
- prg32(space->machine(), data >> 4);
- chr8(space->machine(), data & 0x0f, CHRROM);
+ prg32(space.machine(), data >> 4);
+ chr8(space.machine(), data & 0x0f, CHRROM);
}
}
@@ -7636,7 +7636,7 @@ static WRITE8_HANDLER( txc_mxmdhtwo_w )
{
LOG_MMC(("txc_mxmdhtwo_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -7698,7 +7698,7 @@ static WRITE8_HANDLER( waixing_a_w )
switch (offset & 0x6001)
{
case 0x2000:
- waixing_set_mirror(space->machine(), data); //maybe data & 0x03?
+ waixing_set_mirror(space.machine(), data); //maybe data & 0x03?
break;
case 0x2001:
@@ -7815,7 +7815,7 @@ static void waixing_e_chr_cb( running_machine &machine, int start, int bank, int
static WRITE8_HANDLER( waixing_f_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 cmd;
LOG_MMC(("waixing_f_w, offset: %04x, data: %02x\n", offset, data));
@@ -7826,7 +7826,7 @@ static WRITE8_HANDLER( waixing_f_w )
if (cmd >= 6)
{
state->m_mmc_prg_bank[cmd - 6] = data & ((data > 0x3f) ? 0x4f : 0x3f);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else
waixing_a_w(space, offset, data);
@@ -7876,7 +7876,7 @@ static void waixing_g_set_chr( running_machine &machine, int chr_base, int chr_m
static WRITE8_HANDLER( waixing_g_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 MMC3_helper, cmd;
LOG_MMC(("waixing_g_w, offset: %04x, data: %02x\n", offset, data));
@@ -7888,11 +7888,11 @@ static WRITE8_HANDLER( waixing_g_w )
/* Has PRG Mode changed? */
if (MMC3_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (MMC3_helper & 0x80)
- waixing_g_set_chr(space->machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ waixing_g_set_chr(space.machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -7902,18 +7902,18 @@ static WRITE8_HANDLER( waixing_g_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- waixing_g_set_chr(space->machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ waixing_g_set_chr(space.machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
case 8:
case 9:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
case 0x0a: case 0x0b:
state->m_mmc_vrom_bank[cmd - 4] = data;
- waixing_g_set_chr(space->machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ waixing_g_set_chr(space.machine(), state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
}
break;
@@ -7947,7 +7947,7 @@ static void waixing_h_chr_cb( running_machine &machine, int start, int bank, int
static WRITE8_HANDLER( waixing_h_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 cmd;
LOG_MMC(("waixing_h_w, offset: %04x, data: %02x\n", offset, data));
@@ -7960,7 +7960,7 @@ static WRITE8_HANDLER( waixing_h_w )
case 0: // in this case we set prg_base in addition to state->m_mmc_vrom_bank!
state->m_mmc_prg_base = (data << 5) & 0x40;
state->m_mmc_prg_mask = 0x3f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
txrom_w(space, offset, data);
default:
txrom_w(space, offset, data);
@@ -7993,17 +7993,17 @@ static WRITE8_HANDLER( waixing_h_w )
static WRITE8_HANDLER( waixing_sgz_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, bank;
LOG_MMC(("waixing_sgz_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7000)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000:
case 0x4000:
@@ -8015,7 +8015,7 @@ static WRITE8_HANDLER( waixing_sgz_w )
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x0f) << 4);
else
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x7000:
switch (offset & 0x0c)
@@ -8056,17 +8056,17 @@ static WRITE8_HANDLER( waixing_sgz_w )
static WRITE8_HANDLER( waixing_sgzlz_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("waixing_sgzlz_l_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x700:
- set_nt_mirroring(space->machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x701:
state->m_mmc_latch1 = (state->m_mmc_latch1 & 0x0c) | ((data >> 1) & 0x03);
- prg32(space->machine(), state->m_mmc_latch1);
+ prg32(space.machine(), state->m_mmc_latch1);
break;
case 0x702:
state->m_mmc_latch1 = (state->m_mmc_latch1 & 0x03) | ((data << 2) & 0x0c);
@@ -8089,7 +8089,7 @@ static WRITE8_HANDLER( waixing_sgzlz_l_w )
static WRITE8_HANDLER( waixing_ffv_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("waixing_ffv_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100; /* the checks work better on addresses */
@@ -8104,15 +8104,15 @@ static WRITE8_HANDLER( waixing_ffv_l_w )
case 0x20:
case 0x40:
case 0x60:
- prg16_89ab(space->machine(), mmc_helper | ((state->m_mmc_reg[0] >> 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
- prg16_cdef(space->machine(), mmc_helper & 0x1f);
+ prg16_89ab(space.machine(), mmc_helper | ((state->m_mmc_reg[0] >> 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
+ prg16_cdef(space.machine(), mmc_helper & 0x1f);
break;
case 0x50:
- prg32(space->machine(), (mmc_helper >> 1) | (state->m_mmc_reg[0] & 0x0f));
+ prg32(space.machine(), (mmc_helper >> 1) | (state->m_mmc_reg[0] & 0x0f));
break;
case 0x70:
- prg16_89ab(space->machine(), mmc_helper | ((state->m_mmc_reg[0] << 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
- prg16_cdef(space->machine(), mmc_helper & 0x1f);
+ prg16_89ab(space.machine(), mmc_helper | ((state->m_mmc_reg[0] << 1) & 0x10) | (state->m_mmc_reg[0] & 0x0f));
+ prg16_cdef(space.machine(), mmc_helper & 0x1f);
break;
}
}
@@ -8141,14 +8141,14 @@ static WRITE8_HANDLER( waixing_zs_w )
{
LOG_MMC(("waixing_zs_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset >> 3);
+ prg32(space.machine(), offset >> 3);
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
}
@@ -8171,7 +8171,7 @@ static WRITE8_HANDLER( waixing_dq8_w )
{
LOG_MMC(("waixing_dq8_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset >> 3);
+ prg32(space.machine(), offset >> 3);
}
@@ -8194,36 +8194,36 @@ static WRITE8_HANDLER( waixing_ps2_w )
LOG_MMC(("waixing_ps2_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
switch (offset & 0x0fff)
{
case 0x000:
- prg8_89(space->machine(), (map15_helper + 0) ^ map15_flip);
- prg8_ab(space->machine(), (map15_helper + 1) ^ map15_flip);
- prg8_cd(space->machine(), (map15_helper + 2) ^ map15_flip);
- prg8_ef(space->machine(), (map15_helper + 3) ^ map15_flip);
+ prg8_89(space.machine(), (map15_helper + 0) ^ map15_flip);
+ prg8_ab(space.machine(), (map15_helper + 1) ^ map15_flip);
+ prg8_cd(space.machine(), (map15_helper + 2) ^ map15_flip);
+ prg8_ef(space.machine(), (map15_helper + 3) ^ map15_flip);
break;
case 0x001:
map15_helper |= map15_flip;
- prg8_89(space->machine(), map15_helper);
- prg8_ab(space->machine(), map15_helper + 1);
- prg8_cd(space->machine(), map15_helper + 1);
- prg8_ef(space->machine(), map15_helper + 1);
+ prg8_89(space.machine(), map15_helper);
+ prg8_ab(space.machine(), map15_helper + 1);
+ prg8_cd(space.machine(), map15_helper + 1);
+ prg8_ef(space.machine(), map15_helper + 1);
break;
case 0x002:
map15_helper |= map15_flip;
- prg8_89(space->machine(), map15_helper);
- prg8_ab(space->machine(), map15_helper);
- prg8_cd(space->machine(), map15_helper);
- prg8_ef(space->machine(), map15_helper);
+ prg8_89(space.machine(), map15_helper);
+ prg8_ab(space.machine(), map15_helper);
+ prg8_cd(space.machine(), map15_helper);
+ prg8_ef(space.machine(), map15_helper);
break;
case 0x003:
map15_helper |= map15_flip;
- prg8_89(space->machine(), map15_helper);
- prg8_ab(space->machine(), map15_helper + 1);
- prg8_cd(space->machine(), map15_helper);
- prg8_ef(space->machine(), map15_helper + 1);
+ prg8_89(space.machine(), map15_helper);
+ prg8_ab(space.machine(), map15_helper + 1);
+ prg8_cd(space.machine(), map15_helper);
+ prg8_ef(space.machine(), map15_helper + 1);
break;
}
}
@@ -8266,7 +8266,7 @@ static void waixing_sec_chr_cb( running_machine &machine, int start, int bank, i
static WRITE8_HANDLER( waixing_sec_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("waixing_sec_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -8274,8 +8274,8 @@ static WRITE8_HANDLER( waixing_sec_l_w )
if (offset == 0x1000)
{
state->m_mmc_reg[0] = data & 0x02;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -8303,7 +8303,7 @@ static void waixing_sh2_chr_cb( running_machine &machine, int start, int bank, i
READ8_HANDLER( waixing_sh2_chr_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = offset >> 10;
UINT8 val = state->m_chr_map[bank].access[offset & 0x3ff]; // this would be usual return value
int chr_helper;
@@ -8317,9 +8317,9 @@ READ8_HANDLER( waixing_sh2_chr_r )
state->m_mmc_reg[offset >> 12] = chr_helper;
if (offset & 0x1000)
- chr4_4(space->machine(), state->m_mmc_reg[1], state->m_mmc_reg[1] ? CHRRAM : CHRROM);
+ chr4_4(space.machine(), state->m_mmc_reg[1], state->m_mmc_reg[1] ? CHRRAM : CHRROM);
else
- chr4_0(space->machine(), state->m_mmc_reg[0], state->m_mmc_reg[0] ? CHRRAM : CHRROM);
+ chr4_0(space.machine(), state->m_mmc_reg[0], state->m_mmc_reg[0] ? CHRRAM : CHRROM);
return val;
}
@@ -8354,7 +8354,7 @@ static void unl_8237_chr_cb( running_machine &machine, int start, int bank, int
static WRITE8_HANDLER( unl_8237_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_8237_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -8364,27 +8364,27 @@ static WRITE8_HANDLER( unl_8237_l_w )
if (state->m_mmc_reg[0] & 0x80)
{
if (state->m_mmc_reg[0] & 0x20)
- prg32(space->machine(), (state->m_mmc_reg[0] & 0x0f) >> 1);
+ prg32(space.machine(), (state->m_mmc_reg[0] & 0x0f) >> 1);
else
{
- prg16_89ab(space->machine(), state->m_mmc_reg[0] & 0x1f);
- prg16_cdef(space->machine(), state->m_mmc_reg[0] & 0x1f);
+ prg16_89ab(space.machine(), state->m_mmc_reg[0] & 0x1f);
+ prg16_cdef(space.machine(), state->m_mmc_reg[0] & 0x1f);
}
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset == 0x1001)
{
state->m_mmc_reg[1] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
static WRITE8_HANDLER( unl_8237_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
static const UINT8 conv_table[8] = {0, 2, 6, 1, 7, 3, 4, 5};
LOG_MMC(("unl_8237_w offset: %04x, data: %02x\n", offset, data));
@@ -8392,7 +8392,7 @@ static WRITE8_HANDLER( unl_8237_w )
{
case 0x0000:
case 0x1000:
- set_nt_mirroring(space->machine(), (data | (data >> 7)) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (data | (data >> 7)) & 0x01 ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
@@ -8441,7 +8441,7 @@ static void unl_ax5705_set_prg( running_machine &machine )
static WRITE8_HANDLER( unl_ax5705_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("unl_ax5705_w offset: %04x, data: %02x\n", offset, data));
@@ -8449,14 +8449,14 @@ static WRITE8_HANDLER( unl_ax5705_w )
{
case 0x0000:
state->m_mmc_prg_bank[0] = (data & 0x05) | ((data & 0x08) >> 2) | ((data & 0x02) << 2);
- unl_ax5705_set_prg(space->machine());
+ unl_ax5705_set_prg(space.machine());
break;
case 0x0008:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
state->m_mmc_prg_bank[1] = (data & 0x05) | ((data & 0x08) >> 2) | ((data & 0x02) << 2);
- unl_ax5705_set_prg(space->machine());
+ unl_ax5705_set_prg(space.machine());
break;
/* CHR banks 0, 1, 4, 5 */
case 0x2008:
@@ -8465,7 +8465,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x400a:
bank = ((offset & 0x4000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x2009:
case 0x200b:
@@ -8473,7 +8473,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x400b:
bank = ((offset & 0x4000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x04) << 3) | ((data & 0x02) << 5) | ((data & 0x09) << 4);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
/* CHR banks 2, 3, 6, 7 */
case 0x4000:
@@ -8482,7 +8482,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x6002:
bank = 2 + ((offset & 0x2000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
case 0x4001:
case 0x4003:
@@ -8490,7 +8490,7 @@ static WRITE8_HANDLER( unl_ax5705_w )
case 0x6003:
bank = 2 + ((offset & 0x2000) ? 4 : 0) + ((offset & 0x0002) ? 1 : 0);
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0x0f) | ((data & 0x04) << 3) | ((data & 0x02) << 5) | ((data & 0x09) << 4);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], CHRROM);
break;
}
}
@@ -8509,8 +8509,8 @@ static WRITE8_HANDLER( unl_cc21_w )
{
LOG_MMC(("unl_cc21_w offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 1) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
- chr8(space->machine(), (offset & 0x01), CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 1) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ chr8(space.machine(), (offset & 0x01), CHRROM);
}
/*************************************************************
@@ -8605,7 +8605,7 @@ static WRITE8_HANDLER( ks7057_w )
static WRITE8_HANDLER( unl_t230_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("unl_t230_w offset: %04x, data: %02x\n", offset, data));
@@ -8614,7 +8614,7 @@ static WRITE8_HANDLER( unl_t230_w )
case 0x0000:
break;
case 0x2000:
- prg16_89ab(space->machine(), data);
+ prg16_89ab(space.machine(), data);
break;
// the part below works like VRC-2. how was the original board wired up?
@@ -8625,10 +8625,10 @@ static WRITE8_HANDLER( unl_t230_w )
case 0x100c:
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
@@ -8654,7 +8654,7 @@ static WRITE8_HANDLER( unl_t230_w )
else
state->m_mmc_vrom_bank[bank] = (state->m_mmc_vrom_bank[bank] & 0xf0) | (data & 0x0f);
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[bank], state->m_mmc_chr_source);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[bank], state->m_mmc_chr_source);
break;
case 0x7000:
state->m_IRQ_count_latch &= ~0x0f;
@@ -8714,7 +8714,7 @@ static void kof96_chr_cb( running_machine &machine, int start, int bank, int sou
static WRITE8_HANDLER( kof96_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 new_bank;
LOG_MMC(("kof96_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -8728,15 +8728,15 @@ static WRITE8_HANDLER( kof96_l_w )
new_bank = (state->m_mmc_reg[0] & 0x1f);
if (state->m_mmc_reg[0] & 0x20)
- prg32(space->machine(), new_bank >> 2);
+ prg32(space.machine(), new_bank >> 2);
else
{
- prg16_89ab(space->machine(), new_bank);
- prg16_cdef(space->machine(), new_bank);
+ prg16_89ab(space.machine(), new_bank);
+ prg16_cdef(space.machine(), new_bank);
}
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset >= 0x1000)
@@ -8760,13 +8760,13 @@ static WRITE8_HANDLER( kof96_l_w )
if (!state->m_mmc_reg[3] && offset > 0x1000)
{
state->m_mmc_reg[3] = 1;
- space->write_byte(0x4017, 0x40);
+ space.write_byte(0x4017, 0x40);
}
}
static READ8_HANDLER( kof96_l_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kof96_l_r, offset: %04x\n", offset));
offset += 0x100;
@@ -8778,7 +8778,7 @@ static READ8_HANDLER( kof96_l_r )
static WRITE8_HANDLER( kof96_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("kof96_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6003)
@@ -8800,9 +8800,9 @@ static WRITE8_HANDLER( kof96_w )
state->m_mmc_reg[2] = 0;
if (data == 0x28)
- prg8_cd(space->machine(), 0x17);
+ prg8_cd(space.machine(), 0x17);
else if (data == 0x2a)
- prg8_ab(space->machine(), 0x0f);
+ prg8_ab(space.machine(), 0x0f);
break;
default:
@@ -8829,7 +8829,7 @@ static WRITE8_HANDLER( kof96_w )
static WRITE8_HANDLER( mk2_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("mk2_m_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x1000)
@@ -8837,17 +8837,17 @@ static WRITE8_HANDLER( mk2_m_w )
case 0x0000:
switch (offset & 0x03)
{
- case 0x00: chr2_0(space->machine(), data, CHRROM); break;
- case 0x01: chr2_2(space->machine(), data, CHRROM); break;
- case 0x02: chr2_4(space->machine(), data, CHRROM); break;
- case 0x03: chr2_6(space->machine(), data, CHRROM); break;
+ case 0x00: chr2_0(space.machine(), data, CHRROM); break;
+ case 0x01: chr2_2(space.machine(), data, CHRROM); break;
+ case 0x02: chr2_4(space.machine(), data, CHRROM); break;
+ case 0x03: chr2_6(space.machine(), data, CHRROM); break;
}
break;
case 0x1000:
switch (offset & 0x03)
{
- case 0x00: prg8_89(space->machine(), data); break;
- case 0x01: prg8_ab(space->machine(), data); break;
+ case 0x00: prg8_89(space.machine(), data); break;
+ case 0x01: prg8_ab(space.machine(), data); break;
case 0x02: state->m_IRQ_enable = 0; state->m_IRQ_count = 0; break;
case 0x03: state->m_IRQ_enable = 1; state->m_IRQ_count = 7; break;
}
@@ -8885,18 +8885,18 @@ static void n625092_set_prg( running_machine &machine, UINT8 reg1, UINT8 reg2 )
static WRITE8_HANDLER( n625092_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("n625092_w, offset: %04x, data: %02x\n", offset, data));
if (offset < 0x4000)
{
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
offset = (offset >> 1) & 0xff;
if (state->m_mmc_latch1 != offset)
{
state->m_mmc_latch1 = offset;
- n625092_set_prg(space->machine(), state->m_mmc_latch1, state->m_mmc_latch2);
+ n625092_set_prg(space.machine(), state->m_mmc_latch1, state->m_mmc_latch2);
}
}
else
@@ -8906,7 +8906,7 @@ static WRITE8_HANDLER( n625092_w )
if (state->m_mmc_latch2 != offset)
{
state->m_mmc_latch2 = offset;
- n625092_set_prg(space->machine(), state->m_mmc_latch1, state->m_mmc_latch2);
+ n625092_set_prg(space.machine(), state->m_mmc_latch1, state->m_mmc_latch2);
}
}
}
@@ -8943,20 +8943,20 @@ static void sc127_irq( device_t *device, int scanline, int vblank, int blanked )
static WRITE8_HANDLER( sc127_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("sc127_w, offset: %04x, data: %02x\n", offset, data));
switch (offset)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x0001:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0002:
// state->m_mmc_prg_bank[offset & 0x02] = data;
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x1000:
case 0x1001:
@@ -8967,7 +8967,7 @@ static WRITE8_HANDLER( sc127_w )
case 0x1006:
case 0x1007:
// state->m_mmc_vrom_bank[offset & 0x07] = data;
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x4002:
state->m_IRQ_enable = 0;
@@ -8979,7 +8979,7 @@ static WRITE8_HANDLER( sc127_w )
state->m_IRQ_count = data;
break;
case 0x5001:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
}
}
@@ -8999,12 +8999,12 @@ static WRITE8_HANDLER( sc127_w )
static WRITE8_HANDLER( smb2j_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int bank = (((offset >> 8) & 0x03) * 0x20) + (offset & 0x1f);
LOG_MMC(("smb2j_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (offset & 0x0800)
{
@@ -9018,7 +9018,7 @@ static WRITE8_HANDLER( smb2j_w )
else
{
LOG_MMC(("smb2j_w, selecting upper 16KB bank of #%02x\n", bank));
- prg16_cdef(space->machine(), 2 * bank + 1);
+ prg16_cdef(space.machine(), 2 * bank + 1);
}
}
else
@@ -9031,7 +9031,7 @@ static WRITE8_HANDLER( smb2j_w )
else
{
LOG_MMC(("smb2j_w, selecting lower 16KB bank of #%02x\n", bank));
- prg16_89ab(space->machine(), 2 * bank);
+ prg16_89ab(space.machine(), 2 * bank);
}
}
}
@@ -9047,7 +9047,7 @@ static WRITE8_HANDLER( smb2j_w )
else
{
LOG_MMC(("smb2j_w, selecting 32KB bank #%02x\n", bank));
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
}
}
}
@@ -9087,7 +9087,7 @@ static void smb2jb_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( smb2jb_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 prg;
LOG_MMC(("smb2jb_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -9096,7 +9096,7 @@ static WRITE8_HANDLER( smb2jb_l_w )
{
case 0x020:
prg = (data & 0x08) | ((data & 0x06) >> 1) | ((data & 0x01) << 2);
- prg8_cd(space->machine(), prg);
+ prg8_cd(space.machine(), prg);
break;
case 0x120:
state->m_IRQ_enable = data & 0x01;
@@ -9111,7 +9111,7 @@ WRITE8_HANDLER( smb2jb_extra_w )
LOG_MMC(("smb2jb_extra_w, offset: %04x, data: %02x\n", offset, data));
prg = (data & 0x08) | ((data & 0x06) >> 1) | ((data & 0x01) << 2);
- prg8_cd(space->machine(), prg);
+ prg8_cd(space.machine(), prg);
}
/*************************************************************
@@ -9136,7 +9136,7 @@ static void unl_sf3_set_chr( running_machine &machine, UINT8 chr_source, int chr
static WRITE8_HANDLER( unl_sf3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
LOG_MMC(("unl_sf3_w, offset: %04x, data: %02x\n", offset, data));
@@ -9148,11 +9148,11 @@ static WRITE8_HANDLER( unl_sf3_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- unl_sf3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ unl_sf3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -9161,12 +9161,12 @@ static WRITE8_HANDLER( unl_sf3_w )
{
case 0: case 2: case 4:
state->m_mmc_vrom_bank[cmd >> 1] = data;
- unl_sf3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ unl_sf3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
@@ -9199,10 +9199,10 @@ static WRITE8_HANDLER( unl_xzy_l_w )
switch (offset)
{
case 0x1ef1: /* 0x5ff1 */
- prg32(space->machine(), data >> 1);
+ prg32(space.machine(), data >> 1);
break;
case 0x1ef2: /* 0x5ff2 */
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
break;
}
}
@@ -9225,13 +9225,13 @@ static void racmate_update_banks( running_machine &machine )
static WRITE8_HANDLER( unl_racmate_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_racmate_w offset: %04x, data: %02x\n", offset, data));
if (offset == 0x3000)
{
state->m_mmc_latch1 = data;
- racmate_update_banks(space->machine());
+ racmate_update_banks(space.machine());
}
}
@@ -9250,7 +9250,7 @@ static WRITE8_HANDLER( unl_racmate_w )
static WRITE8_HANDLER( unl_fs304_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_fs304_l_w, offset: %04x, data: %02x\n", offset, data));
int bank;
offset += 0x100;
@@ -9259,8 +9259,8 @@ static WRITE8_HANDLER( unl_fs304_l_w )
{
state->m_mmc_reg[(offset >> 8) & 3] = data;
bank = ((state->m_mmc_reg[2] & 0x0f) << 4) | BIT(state->m_mmc_reg[1], 1) | (state->m_mmc_reg[0] & 0x0e);
- prg32(space->machine(), bank);
- chr8(space->machine(), 0, CHRRAM);
+ prg32(space.machine(), bank);
+ chr8(space.machine(), 0, CHRRAM);
}
}
@@ -9308,7 +9308,7 @@ static WRITE8_HANDLER( btl_smb11_w )
// is the code fine for ai senshi nicol?!?
static WRITE8_HANDLER( btl_mariobaby_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_mariobaby_w, offset: %04x, data: %02x\n", offset, data));
if (offset >= 0x7000)
@@ -9316,10 +9316,10 @@ static WRITE8_HANDLER( btl_mariobaby_w )
switch (offset & 0x03)
{
case 0x00:
- prg8_67(space->machine(), data);
+ prg8_67(space.machine(), data);
break;
case 0x01:
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x02:
/* Check if IRQ is being enabled */
@@ -9369,7 +9369,7 @@ static void btl_smb2a_irq( device_t *device, int scanline, int vblank, int blank
static WRITE8_HANDLER( btl_smb2a_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_smb2a_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6000)
@@ -9382,7 +9382,7 @@ static WRITE8_HANDLER( btl_smb2a_w )
state->m_IRQ_enable = 1;
break;
case 0x6000:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
}
}
@@ -9402,7 +9402,7 @@ static WRITE8_HANDLER( btl_smb2a_w )
static WRITE8_HANDLER( whirl2706_w )
{
LOG_MMC(("whirl2706_w, offset: %04x, data: %02x\n", offset, data));
- prg8_67(space->machine(), data);
+ prg8_67(space.machine(), data);
}
/*************************************************************
@@ -9423,7 +9423,7 @@ static WRITE8_HANDLER( btl_tobi_l_w )
offset += 0x100;
if ((offset & 0x43c0) == 0x41c0)
- prg8_67(space->machine(), data & 0x07);
+ prg8_67(space.machine(), data & 0x07);
}
/*************************************************************
@@ -9456,36 +9456,36 @@ static void btl_smb3_irq( device_t *device, int scanline, int vblank, int blanke
static WRITE8_HANDLER( btl_smb3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_smb3_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x0f)
{
case 0x00:
case 0x02:
- chr1_x(space->machine(), offset & 0x07, data & 0xfe, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data & 0xfe, CHRROM);
break;
case 0x01:
case 0x03:
- chr1_x(space->machine(), offset & 0x07, data | 0x01, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data | 0x01, CHRROM);
break;
case 0x04: case 0x05:
case 0x06: case 0x07:
- chr1_x(space->machine(), offset & 0x07, data, CHRROM);
+ chr1_x(space.machine(), offset & 0x07, data, CHRROM);
break;
case 0x08:
- prg8_89(space->machine(), data | 0x10);
+ prg8_89(space.machine(), data | 0x10);
break;
case 0x09:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x0a:
- prg8_cd(space->machine(), data);
+ prg8_cd(space.machine(), data);
break;
case 0x0b:
- prg8_ef(space->machine(), data | 0x10);
+ prg8_ef(space.machine(), data | 0x10);
break;
case 0x0c:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x0d:
state->m_IRQ_count = 0;
@@ -9531,20 +9531,20 @@ static void btl_dn_irq( device_t *device, int scanline, int vblank, int blanked
static WRITE8_HANDLER( btl_dn_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("btl_dn_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x7003)
{
case 0x0000:
- prg8_89(space->machine(), data);
+ prg8_89(space.machine(), data);
break;
case 0x1000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2000:
- prg8_ab(space->machine(), data);
+ prg8_ab(space.machine(), data);
break;
case 0x3000:
case 0x3002:
@@ -9555,7 +9555,7 @@ static WRITE8_HANDLER( btl_dn_w )
case 0x6000:
case 0x6002:
bank = ((offset & 0x7000) - 0x3000) / 0x0800 + ((offset & 0x0002) >> 3);
- chr1_x(space->machine(), bank, data, CHRROM);
+ chr1_x(space.machine(), bank, data, CHRROM);
break;
case 0x7000:
state->m_IRQ_count = data;
@@ -9577,7 +9577,7 @@ static WRITE8_HANDLER( btl_dn_w )
static WRITE8_HANDLER( btl_pika_y2k_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_pika_y2k_w, offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x6001)
@@ -9597,7 +9597,7 @@ static WRITE8_HANDLER( btl_pika_y2k_w )
// strange WRAM usage: it is protected at start, and gets unprotected after the first write to 0xa000
static WRITE8_HANDLER( btl_pika_y2k_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_pika_y2k_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_wram[offset] = data;
@@ -9605,7 +9605,7 @@ static WRITE8_HANDLER( btl_pika_y2k_m_w )
static READ8_HANDLER( btl_pika_y2k_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("btl_pika_y2k_m_r, offset: %04x\n", offset));
return state->m_wram[offset] ^ (state->m_mmc_latch2 & state->m_mmc_reg[0]);
@@ -9716,7 +9716,7 @@ static void fk23c_set_chr( running_machine &machine )
static WRITE8_HANDLER( fk23c_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fk23c_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -9726,15 +9726,15 @@ static WRITE8_HANDLER( fk23c_l_w )
{
state->m_mmc_reg[offset & 0x03] = data;
- fk23c_set_prg(space->machine());
- fk23c_set_chr(space->machine());
+ fk23c_set_prg(space.machine());
+ fk23c_set_chr(space.machine());
}
}
}
static WRITE8_HANDLER( fk23c_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fk23c_w, offset: %04x, data: %02x\n", offset, data));
if (state->m_mmc_reg[0] & 0x40)
@@ -9744,7 +9744,7 @@ static WRITE8_HANDLER( fk23c_w )
else
{
state->m_mmc_cmd1 = data & 0x03;
- fk23c_set_chr(space->machine());
+ fk23c_set_chr(space.machine());
}
}
else
@@ -9755,15 +9755,15 @@ static WRITE8_HANDLER( fk23c_w )
if ((state->m_mmc_reg[3] & 0x02) && (state->m_mmc3_latch & 0x08))
{
state->m_mmc_reg[4 | (state->m_mmc3_latch & 0x03)] = data;
- fk23c_set_prg(space->machine());
- fk23c_set_chr(space->machine());
+ fk23c_set_prg(space.machine());
+ fk23c_set_chr(space.machine());
}
else
txrom_w(space, offset, data);
break;
case 0x2000:
- set_nt_mirroring(space->machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), data ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
default:
@@ -9806,7 +9806,7 @@ static void bmc_64in1nr_set_prg( running_machine &machine )
static WRITE8_HANDLER( bmc_64in1nr_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_64in1nr_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -9817,17 +9817,17 @@ static WRITE8_HANDLER( bmc_64in1nr_l_w )
case 0x1002:
case 0x1003:
state->m_mmc_reg[offset & 0x03] = data;
- bmc_64in1nr_set_prg(space->machine());
- chr8(space->machine(), ((state->m_mmc_reg[0] >> 1) & 0x03) | (state->m_mmc_reg[2] << 2), CHRROM);
+ bmc_64in1nr_set_prg(space.machine());
+ chr8(space.machine(), ((state->m_mmc_reg[0] >> 1) & 0x03) | (state->m_mmc_reg[2] << 2), CHRROM);
break;
}
if (offset == 0x1000) /* reg[0] also sets mirroring */
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
static WRITE8_HANDLER( bmc_64in1nr_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_64in1nr_w offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[3] = data; // reg[3] is currently unused?!?
@@ -9847,11 +9847,11 @@ static WRITE8_HANDLER( bmc_190in1_w )
{
LOG_MMC(("bmc_190in1_w offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
offset >>= 2;
- prg16_89ab(space->machine(), offset);
- prg16_cdef(space->machine(), offset);
- chr8(space->machine(), offset, CHRROM);
+ prg16_89ab(space.machine(), offset);
+ prg16_cdef(space.machine(), offset);
+ chr8(space.machine(), offset, CHRROM);
}
/*************************************************************
@@ -9870,16 +9870,16 @@ static WRITE8_HANDLER( bmc_a65as_w )
LOG_MMC(("bmc_a65as_w offset: %04x, data: %02x\n", offset, data));
if (data & 0x80)
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HIGH : PPU_MIRROR_LOW);
else
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (data & 0x40)
- prg32(space->machine(), data >> 1);
+ prg32(space.machine(), data >> 1);
else
{
- prg16_89ab(space->machine(), helper | (data & 0x07));
- prg16_cdef(space->machine(), helper | 0x07);
+ prg16_89ab(space.machine(), helper | (data & 0x07));
+ prg16_cdef(space.machine(), helper | 0x07);
}
}
@@ -9898,7 +9898,7 @@ static WRITE8_HANDLER( bmc_gs2004_w )
{
LOG_MMC(("bmc_gs2004_w offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -9917,9 +9917,9 @@ static WRITE8_HANDLER( bmc_gs2013_w )
LOG_MMC(("bmc_gs2013_w offset: %04x, data: %02x\n", offset, data));
if (data & 0x08)
- prg32(space->machine(), data & 0x09);
+ prg32(space.machine(), data & 0x09);
else
- prg32(space->machine(), data & 0x07);
+ prg32(space.machine(), data & 0x07);
}
/*************************************************************
@@ -9954,27 +9954,27 @@ static void bmc_s24in1sc03_chr_cb( running_machine &machine, int start, int bank
static WRITE8_HANDLER( bmc_s24in1sc03_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_s24in1sc03_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset == 0x1ff0)
{
state->m_mmc_reg[0] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset == 0x1ff1)
{
state->m_mmc_reg[1] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
if (offset == 0x1ff2)
{
state->m_mmc_reg[2] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -9990,23 +9990,23 @@ static WRITE8_HANDLER( bmc_s24in1sc03_l_w )
static WRITE8_HANDLER( bmc_t262_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("bmc_t262_w offset: %04x, data: %02x\n", offset, data));
if (state->m_mmc_latch2 || offset == 0)
{
state->m_mmc_latch1 = (state->m_mmc_latch1 & 0x38) | (data & 0x07);
- prg16_89ab(space->machine(), state->m_mmc_latch1);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
}
else
{
state->m_mmc_latch2 = 1;
- set_nt_mirroring(space->machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
mmc_helper = ((offset >> 3) & 0x20) | ((offset >> 2) & 0x18);
state->m_mmc_latch1 = mmc_helper | (state->m_mmc_latch1 & 0x07);
- prg16_89ab(space->machine(), state->m_mmc_latch1);
- prg16_cdef(space->machine(), mmc_helper | 0x07);
+ prg16_89ab(space.machine(), state->m_mmc_latch1);
+ prg16_cdef(space.machine(), mmc_helper | 0x07);
}
}
@@ -10023,7 +10023,7 @@ static WRITE8_HANDLER( bmc_t262_w )
static WRITE8_HANDLER( bmc_ws_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper;
LOG_MMC(("bmc_ws_m_w offset: %04x, data: %02x\n", offset, data));
@@ -10035,16 +10035,16 @@ static WRITE8_HANDLER( bmc_ws_m_w )
if (!state->m_mmc_latch1)
{
state->m_mmc_latch1 = data & 0x20;
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
mmc_helper = (~data & 0x08) >> 3;
- prg16_89ab(space->machine(), data & ~mmc_helper);
- prg16_cdef(space->machine(), data | mmc_helper);
+ prg16_89ab(space.machine(), data & ~mmc_helper);
+ prg16_cdef(space.machine(), data | mmc_helper);
}
break;
case 1:
if (!state->m_mmc_latch1)
{
- chr8(space->machine(), data, CHRROM);
+ chr8(space.machine(), data, CHRROM);
}
break;
}
@@ -10072,16 +10072,16 @@ static WRITE8_HANDLER( novel1_w )
{
LOG_MMC(("novel1_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset & 0x03);
- chr8(space->machine(), offset & 0x07, CHRROM);
+ prg32(space.machine(), offset & 0x03);
+ chr8(space.machine(), offset & 0x07, CHRROM);
}
static WRITE8_HANDLER( novel2_w )
{
LOG_MMC(("novel2_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset >> 1);
- chr8(space->machine(), offset >> 3, CHRROM);
+ prg32(space.machine(), offset >> 1);
+ chr8(space.machine(), offset >> 3, CHRROM);
}
/*************************************************************
@@ -10099,7 +10099,7 @@ static WRITE8_HANDLER( novel2_w )
static WRITE8_HANDLER( bmc_gka_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_gka_w, offset: %04x, data: %02x\n", offset, data));
if (offset & 0x0800)
@@ -10108,16 +10108,16 @@ static WRITE8_HANDLER( bmc_gka_w )
state->m_mmc_latch1 = data;
if (state->m_mmc_latch2 & 0x80)
- prg32(space->machine(), 2 | (state->m_mmc_latch2 >> 6));
+ prg32(space.machine(), 2 | (state->m_mmc_latch2 >> 6));
else
{
- prg16_89ab(space->machine(), (state->m_mmc_latch2 >> 5) & 0x03);
- prg16_cdef(space->machine(), (state->m_mmc_latch2 >> 5) & 0x03);
+ prg16_89ab(space.machine(), (state->m_mmc_latch2 >> 5) & 0x03);
+ prg16_cdef(space.machine(), (state->m_mmc_latch2 >> 5) & 0x03);
}
- set_nt_mirroring(space->machine(), (state->m_mmc_latch2 & 0x08) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), (state->m_mmc_latch2 & 0x08) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), (state->m_mmc_latch1 & 0x03) | (state->m_mmc_latch2 & 0x07) | ((state->m_mmc_latch2 & 0x10) >> 1), CHRROM);
+ chr8(space.machine(), (state->m_mmc_latch1 & 0x03) | (state->m_mmc_latch2 & 0x07) | ((state->m_mmc_latch2 & 0x10) >> 1), CHRROM);
}
@@ -10137,7 +10137,7 @@ static WRITE8_HANDLER( bmc_gka_w )
static WRITE8_HANDLER( sng32_w )
{
LOG_MMC(("sng32_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data);
+ prg32(space.machine(), data);
}
/*************************************************************
@@ -10155,14 +10155,14 @@ static WRITE8_HANDLER( sng32_w )
static WRITE8_HANDLER( bmc_gkb_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank = (offset & 0x40) ? 0 : 1;
LOG_MMC(("bmc_gkb_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset & ~bank);
- prg16_cdef(space->machine(), offset | bank);
- chr8(space->machine(), offset >> 3, state->m_mmc_chr_source);
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg16_89ab(space.machine(), offset & ~bank);
+ prg16_cdef(space.machine(), offset | bank);
+ chr8(space.machine(), offset >> 3, state->m_mmc_chr_source);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10182,19 +10182,19 @@ static WRITE8_HANDLER( bmc_super700in1_w )
{
LOG_MMC(("bmc_super700in1_w, offset :%04x, data: %02x\n", offset, data));
- chr8(space->machine(), ((offset & 0x1f) << 2) | (data & 0x03), CHRROM);
+ chr8(space.machine(), ((offset & 0x1f) << 2) | (data & 0x03), CHRROM);
if (offset & 0x20)
{
- prg16_89ab(space->machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
- prg16_cdef(space->machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
+ prg16_89ab(space.machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
+ prg16_cdef(space.machine(), (offset & 0x40) | ((offset >> 8) & 0x3f));
}
else
{
- prg32(space->machine(), ((offset & 0x40) | ((offset >> 8) & 0x3f)) >> 1);
+ prg32(space.machine(), ((offset & 0x40) | ((offset >> 8) & 0x3f)) >> 1);
}
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10214,11 +10214,11 @@ static WRITE8_HANDLER( bmc_36in1_w )
{
LOG_MMC(("bmc_36in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset & 0x07);
- prg16_cdef(space->machine(), offset & 0x07);
- chr8(space->machine(), offset & 0x07, CHRROM);
+ prg16_89ab(space.machine(), offset & 0x07);
+ prg16_cdef(space.machine(), offset & 0x07);
+ chr8(space.machine(), offset & 0x07, CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10238,8 +10238,8 @@ static WRITE8_HANDLER( bmc_21in1_w )
{
LOG_MMC(("bmc_21in1_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), offset & 0x03);
- chr8(space->machine(), offset & 0x03, CHRROM);
+ prg32(space.machine(), offset & 0x03);
+ chr8(space.machine(), offset & 0x03, CHRROM);
}
/*************************************************************
@@ -10261,11 +10261,11 @@ static WRITE8_HANDLER( bmc_150in1_w )
LOG_MMC(("bmc_150in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank + (((bank & 0x06) == 0x06) ? 1 : 0));
- chr8(space->machine(), bank, CHRROM);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank + (((bank & 0x06) == 0x06) ? 1 : 0));
+ chr8(space.machine(), bank, CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10285,9 +10285,9 @@ static WRITE8_HANDLER( bmc_35in1_w )
{
LOG_MMC(("bmc_35in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), (data >> 2) & 0x03);
- prg16_cdef(space->machine(), (data >> 2) & 0x03);
- chr8(space->machine(), data & 0x03, CHRROM);
+ prg16_89ab(space.machine(), (data >> 2) & 0x03);
+ prg16_cdef(space.machine(), (data >> 2) & 0x03);
+ chr8(space.machine(), data & 0x03, CHRROM);
}
/*************************************************************
@@ -10309,11 +10309,11 @@ static WRITE8_HANDLER( bmc_64in1_w )
LOG_MMC(("bmc_64in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset & ~bank);
- prg16_cdef(space->machine(), offset | bank);
- chr8(space->machine(), offset & ~bank, CHRROM);
+ prg16_89ab(space.machine(), offset & ~bank);
+ prg16_cdef(space.machine(), offset | bank);
+ chr8(space.machine(), offset & ~bank, CHRROM);
- set_nt_mirroring(space->machine(), BIT(data, 4) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 4) ? PPU_MIRROR_HORZ: PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10331,7 +10331,7 @@ static WRITE8_HANDLER( bmc_64in1_w )
static WRITE8_HANDLER( bmc_15in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_15in1_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset & 0x0800)
@@ -10340,8 +10340,8 @@ static WRITE8_HANDLER( bmc_15in1_m_w )
state->m_mmc_prg_mask = (data & 0x02) ? 0x0f : 0x1f;
state->m_mmc_chr_base = (data & 0x03) << 7;
state->m_mmc_chr_mask = (data & 0x02) ? 0x7f : 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -10362,16 +10362,16 @@ static WRITE8_HANDLER( bmc_hik300_w )
{
LOG_MMC(("bmc_hik300_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), offset, CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ chr8(space.machine(), offset, CHRROM);
if (offset < 0x4000)
{
- prg16_89ab(space->machine(), offset);
- prg16_cdef(space->machine(), offset);
+ prg16_89ab(space.machine(), offset);
+ prg16_cdef(space.machine(), offset);
}
else
- prg32(space->machine(), offset >> 1);
+ prg32(space.machine(), offset >> 1);
}
/*************************************************************
@@ -10391,9 +10391,9 @@ static WRITE8_HANDLER( supergun20in1_w )
{
LOG_MMC(("supergun20in1_w, offset: %04x, data: %02x\n", offset, data));
- prg16_89ab(space->machine(), offset >> 2);
- prg16_cdef(space->machine(), offset >> 2);
- chr8(space->machine(), offset, CHRROM);
+ prg16_89ab(space.machine(), offset >> 2);
+ prg16_cdef(space.machine(), offset >> 2);
+ chr8(space.machine(), offset, CHRROM);
}
/*************************************************************
@@ -10417,8 +10417,8 @@ static WRITE8_HANDLER( bmc_72in1_w )
LOG_MMC(("bmc_72in1_w, offset: %04x, data: %02x\n", offset, data));
- chr8(space->machine(), offset, CHRROM);
- set_nt_mirroring(space->machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ chr8(space.machine(), offset, CHRROM);
+ set_nt_mirroring(space.machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
hi_bank = offset & 0x40;
size_16 = offset & 0x1000;
@@ -10429,11 +10429,11 @@ static WRITE8_HANDLER( bmc_72in1_w )
if (hi_bank)
bank ++;
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
}
/*************************************************************
@@ -10452,7 +10452,7 @@ static WRITE8_HANDLER( bmc_72in1_w )
// does this work for super42in1 as well?!?
static WRITE8_HANDLER( bmc_76in1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
int hi_bank;
int size_16;
int bank;
@@ -10464,7 +10464,7 @@ static WRITE8_HANDLER( bmc_76in1_w )
else
state->m_mmc_latch1 = data;
- set_nt_mirroring(space->machine(), BIT(state->m_mmc_latch1, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(state->m_mmc_latch1, 6) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
hi_bank = state->m_mmc_latch1 & 0x01;
size_16 = state->m_mmc_latch1 & 0x20;
@@ -10476,11 +10476,11 @@ static WRITE8_HANDLER( bmc_76in1_w )
if (hi_bank)
bank ++;
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
}
/*************************************************************
@@ -10513,21 +10513,21 @@ static WRITE8_HANDLER( bmc_1200in1_w )
if (hi_bank)
bank ++;
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
if (!(offset & 0x80))
{
if (offset & 0x200)
- prg16_cdef(space->machine(), ((bank << 1) & 0x38) + 7);
+ prg16_cdef(space.machine(), ((bank << 1) & 0x38) + 7);
else
- prg16_cdef(space->machine(), ((bank << 1) & 0x38));
+ prg16_cdef(space.machine(), ((bank << 1) & 0x38));
}
- set_nt_mirroring(space->machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 1) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
}
/*************************************************************
@@ -10547,18 +10547,18 @@ static WRITE8_HANDLER( bmc_31in1_w )
{
LOG_MMC(("bmc_31in1_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), offset, CHRROM);
+ set_nt_mirroring(space.machine(), BIT(data, 5) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ chr8(space.machine(), offset, CHRROM);
if ((offset & 0x1e) == 0)
{
- prg16_89ab(space->machine(), 0);
- prg16_89ab(space->machine(), 1);
+ prg16_89ab(space.machine(), 0);
+ prg16_89ab(space.machine(), 1);
}
else
{
- prg16_89ab(space->machine(), offset & 0x1f);
- prg16_89ab(space->machine(), offset & 0x1f);
+ prg16_89ab(space.machine(), offset & 0x1f);
+ prg16_89ab(space.machine(), offset & 0x1f);
}
}
@@ -10582,21 +10582,21 @@ static WRITE8_HANDLER( bmc_22g_w )
if (1) // this should flip at reset
{
- prg16_89ab(space->machine(), data & 0x07);
+ prg16_89ab(space.machine(), data & 0x07);
}
else
{
if (data & 0x20)
{
- prg16_89ab(space->machine(), (data & 0x1f) + 8);
- prg16_cdef(space->machine(), (data & 0x1f) + 8);
+ prg16_89ab(space.machine(), (data & 0x1f) + 8);
+ prg16_cdef(space.machine(), (data & 0x1f) + 8);
}
else
{
- prg16_89ab(space->machine(), (data & 0x1f) + 8);
- prg16_cdef(space->machine(), (data & 0x1f) + 9);
+ prg16_89ab(space.machine(), (data & 0x1f) + 8);
+ prg16_cdef(space.machine(), (data & 0x1f) + 9);
}
- set_nt_mirroring(space->machine(), BIT(data, 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
+ set_nt_mirroring(space.machine(), BIT(data, 6) ? PPU_MIRROR_VERT : PPU_MIRROR_HORZ);
}
}
@@ -10617,10 +10617,10 @@ static WRITE8_HANDLER( bmc_20in1_w )
{
LOG_MMC(("bmc_20in1_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 7) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg16_89ab(space->machine(), (offset & 0x1e));
- prg16_cdef(space->machine(), (offset & 0x1e) | ((offset & 0x20) ? 1 : 0));
+ prg16_89ab(space.machine(), (offset & 0x1e));
+ prg16_cdef(space.machine(), (offset & 0x1e) | ((offset & 0x20) ? 1 : 0));
}
/*************************************************************
@@ -10643,10 +10643,10 @@ static WRITE8_HANDLER( bmc_110in1_w )
LOG_MMC(("bmc_110in1_w, offset: %04x, data: %02x\n", offset, data));
- set_nt_mirroring(space->machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- prg16_89ab(space->machine(), map255_helper1 & ~map255_helper2);
- prg16_cdef(space->machine(), map255_helper1 | map255_helper2);
- chr8(space->machine(), ((offset >> 8) & 0x40) | (offset & 0x3f), CHRROM);
+ set_nt_mirroring(space.machine(), (offset & 0x2000) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ prg16_89ab(space.machine(), map255_helper1 & ~map255_helper2);
+ prg16_cdef(space.machine(), map255_helper1 | map255_helper2);
+ chr8(space.machine(), ((offset >> 8) & 0x40) | (offset & 0x3f), CHRROM);
}
/*************************************************************
@@ -10664,7 +10664,7 @@ static WRITE8_HANDLER( bmc_110in1_w )
static WRITE8_HANDLER( bmc_sbig7_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 page;
LOG_MMC(("bmc_sbig7_w, offset: %04x, data: %02x\n", offset, data));
@@ -10679,8 +10679,8 @@ static WRITE8_HANDLER( bmc_sbig7_w )
state->m_mmc_prg_mask = (page > 5) ? 0x1f : 0x0f;
state->m_mmc_chr_base = page << 7;
state->m_mmc_chr_mask = (page > 5) ? 0xff : 0x7f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
default:
@@ -10704,7 +10704,7 @@ static WRITE8_HANDLER( bmc_sbig7_w )
static WRITE8_HANDLER( bmc_hik8_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_hik8_m_w, offset: %04x, data: %02x\n", offset, data));
/* This bit is the "register lock". Once register are locked, writes go to WRAM
@@ -10731,8 +10731,8 @@ static WRITE8_HANDLER( bmc_hik8_m_w )
else
state->m_mmc_chr_mask = 0xff; // i.e. we use the vrom_bank with no masking
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
}
@@ -10752,7 +10752,7 @@ static WRITE8_HANDLER( bmc_hik8_m_w )
static WRITE8_HANDLER( bmc_hik4in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_hik4in1_m_w, offset: %04x, data: %02x\n", offset, data));
/* mid writes only work when WRAM is enabled. not sure if I should
@@ -10764,14 +10764,14 @@ static WRITE8_HANDLER( bmc_hik4in1_m_w )
{
state->m_mmc_prg_base = (data & 0xc0) >> 2;
state->m_mmc_prg_mask = 0x0f;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else
- prg32(space->machine(), (data & 0x30) >> 4);
+ prg32(space.machine(), (data & 0x30) >> 4);
state->m_mmc_chr_base = (data & 0xc0) << 1;
state->m_mmc_chr_mask = 0x7f;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -10806,17 +10806,17 @@ static void bmc_ball11_set_banks( running_machine &machine )
static WRITE8_HANDLER( bmc_ball11_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_ball11_m_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[0] = ((data >> 1) & 0x01) | ((data >> 3) & 0x02);
- bmc_ball11_set_banks(space->machine());
+ bmc_ball11_set_banks(space.machine());
}
static WRITE8_HANDLER( bmc_ball11_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_ball11_w, offset: %04x, data: %02x\n", offset, data));
@@ -10828,7 +10828,7 @@ static WRITE8_HANDLER( bmc_ball11_w )
case 0x2000:
case 0x6000:
state->m_mmc_reg[1] = data & 0x0f;
- bmc_ball11_set_banks(space->machine());
+ bmc_ball11_set_banks(space.machine());
break;
}
}
@@ -10850,7 +10850,7 @@ static WRITE8_HANDLER( bmc_ball11_w )
static WRITE8_HANDLER( bmc_mario7in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map52_helper1, map52_helper2;
LOG_MMC(("bmc_mario7in1_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -10866,8 +10866,8 @@ static WRITE8_HANDLER( bmc_mario7in1_m_w )
state->m_mmc_prg_mask = map52_helper1 ? 0x0f : 0x1f;
state->m_mmc_chr_base = ((data & 0x20) << 4) | ((data & 0x04) << 6) | (map52_helper2 ? ((data & 0x10) << 3) : 0);
state->m_mmc_chr_mask = map52_helper2 ? 0x7f : 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
state->m_map52_reg_written = 1;
}
@@ -10893,7 +10893,7 @@ static WRITE8_HANDLER( bmc_mario7in1_m_w )
static WRITE8_HANDLER( bmc_gold7in1_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 map52_helper1, map52_helper2;
LOG_MMC(("bmc_gold7in1_m_w, offset: %04x, data: %02x\n", offset, data));
@@ -10906,8 +10906,8 @@ static WRITE8_HANDLER( bmc_gold7in1_m_w )
state->m_mmc_prg_mask = map52_helper1 ? 0x0f : 0x1f;
state->m_mmc_chr_base = ((data & 0x20) << 3) | ((data & 0x04) << 7) | (map52_helper2 ? ((data & 0x10) << 3) : 0);
state->m_mmc_chr_mask = map52_helper2 ? 0x7f : 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
state->m_map52_reg_written = BIT(data, 7); // mc_2hikg & mc_s3nt3 write here multiple time
}
@@ -10963,7 +10963,7 @@ static void bmc_gc6in1_set_chr( running_machine &machine, UINT8 chr )
static WRITE8_HANDLER( bmc_gc6in1_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank;
LOG_MMC(("bmc_gc6in1_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -10974,16 +10974,16 @@ static WRITE8_HANDLER( bmc_gc6in1_l_w )
if (data & 0x80)
{
bank = (data & 0x0f) | ((state->m_mmc_reg[1] & 0x03) << 4);
- prg16_89ab(space->machine(), bank);
- prg16_cdef(space->machine(), bank);
+ prg16_89ab(space.machine(), bank);
+ prg16_cdef(space.machine(), bank);
}
else
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else if (offset == 0x1001)
{
state->m_mmc_reg[1] = data;
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
else if (offset == 0x1007)
{
@@ -10993,7 +10993,7 @@ static WRITE8_HANDLER( bmc_gc6in1_l_w )
static WRITE8_HANDLER( bmc_gc6in1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
static const UINT8 conv_table[8] = {0, 6, 3, 7, 5, 2, 4, 1};
LOG_MMC(("bmc_gc6in1_w, offset: %04x, data: %02x\n", offset, data));
@@ -11008,11 +11008,11 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
break;
case 0x0001:
@@ -11022,12 +11022,12 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
@@ -11052,11 +11052,11 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
/* Has PRG Mode changed? */
if (mmc_helper & 0x40)
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
/* Has CHR Mode changed? */
if (mmc_helper & 0x80)
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
state->m_mmc_reg[3] = 1;
break;
@@ -11071,12 +11071,12 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
case 0: case 1: // these do not need to be separated: we take care of them in set_chr!
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- bmc_gc6in1_set_chr(space->machine(), state->m_mmc_chr_source);
+ bmc_gc6in1_set_chr(space.machine(), state->m_mmc_chr_source);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- bmc_gc6in1_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ bmc_gc6in1_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
}
@@ -11084,7 +11084,7 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
case 0x2001:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
default:
@@ -11111,7 +11111,7 @@ static WRITE8_HANDLER( bmc_gc6in1_w )
static WRITE8_HANDLER( bmc_family4646_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_family4646_m_w, offset: %04x, data: %02x\n", offset, data));
if (offset == 0x01)
@@ -11120,8 +11120,8 @@ static WRITE8_HANDLER( bmc_family4646_m_w )
state->m_mmc_prg_mask = 0x1f;
state->m_mmc_chr_base = (data & 0x20) << 3;
state->m_mmc_chr_mask = 0xff;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
}
}
@@ -11133,34 +11133,34 @@ static WRITE8_HANDLER( bmc_family4646_m_w )
static WRITE8_HANDLER( bmc_vt5201_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_vt5201_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_latch1 = BIT(offset, 8);
// not sure about this mirroring bit!!
// without it TN 95 in 1 has glitches in Lunar Ball; with it TN 95 in 1 has glitches in Galaxian!
- set_nt_mirroring(space->machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 3) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
if (BIT(offset, 7))
{
- prg16_89ab(space->machine(), (offset >> 4) & 0x07);
- prg16_cdef(space->machine(), (offset >> 4) & 0x07);
+ prg16_89ab(space.machine(), (offset >> 4) & 0x07);
+ prg16_cdef(space.machine(), (offset >> 4) & 0x07);
}
else
- prg32(space->machine(), (offset >> 5) & 0x03);
- chr8(space->machine(), offset, CHRROM);
+ prg32(space.machine(), (offset >> 5) & 0x03);
+ chr8(space.machine(), offset, CHRROM);
}
static READ8_HANDLER( bmc_vt5201_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_vt5201_r, offset: %04x\n", offset));
// state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
if (state->m_mmc_latch1)
return state->m_mmc_dipsetting; // cart mode, depending on the Dip Switches (always zero atm, given we have no way to add cart-based DIPs)
else
- return mmc_hi_access_rom(space->machine(), offset);
+ return mmc_hi_access_rom(space.machine(), offset);
}
/*************************************************************
@@ -11187,7 +11187,7 @@ static void bmc_bs5_update_banks( running_machine &machine )
static WRITE8_HANDLER( bmc_bs5_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bs5_helper = (offset & 0xc00) >> 10;
LOG_MMC(("bmc_bs5_w, offset: %04x, data: %02x\n", offset, data));
// state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
@@ -11202,7 +11202,7 @@ static WRITE8_HANDLER( bmc_bs5_w )
state->m_mmc_prg_bank[bs5_helper] = offset & 0x0f;
break;
}
- bmc_bs5_update_banks(space->machine());
+ bmc_bs5_update_banks(space.machine());
}
/*************************************************************
@@ -11220,15 +11220,15 @@ static WRITE8_HANDLER( bmc_810544_w )
if (!BIT(offset, 6))
{
- prg16_89ab(space->machine(), (bank << 1) | BIT(offset, 5));
- prg16_cdef(space->machine(), (bank << 1) | BIT(offset, 5));
+ prg16_89ab(space.machine(), (bank << 1) | BIT(offset, 5));
+ prg16_cdef(space.machine(), (bank << 1) | BIT(offset, 5));
}
else
- prg32(space->machine(), bank);
+ prg32(space.machine(), bank);
- set_nt_mirroring(space->machine(), BIT(offset, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(offset, 4) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), offset & 0x0f, CHRROM);
+ chr8(space.machine(), offset & 0x0f, CHRROM);
}
/*************************************************************
@@ -11247,15 +11247,15 @@ static WRITE8_HANDLER( bmc_ntd03_w )
if (BIT(offset, 7))
{
- prg16_89ab(space->machine(), pbank | BIT(offset, 6));
- prg16_cdef(space->machine(), pbank | BIT(offset, 6));
+ prg16_89ab(space.machine(), pbank | BIT(offset, 6));
+ prg16_cdef(space.machine(), pbank | BIT(offset, 6));
}
else
- prg32(space->machine(), pbank >> 1);
+ prg32(space.machine(), pbank >> 1);
- set_nt_mirroring(space->machine(), BIT(offset, 10) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(offset, 10) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
- chr8(space->machine(), cbank, CHRROM);
+ chr8(space.machine(), cbank, CHRROM);
}
/*************************************************************
@@ -11288,7 +11288,7 @@ static void bmc_gb63_update( running_machine &machine )
static WRITE8_HANDLER( bmc_gb63_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_gb63_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_reg[offset & 1] = data;
@@ -11298,14 +11298,14 @@ static WRITE8_HANDLER( bmc_gb63_w )
static READ8_HANDLER( bmc_gb63_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("bmc_gb63_r, offset: %04x\n", offset));
// state->m_mmc_dipsetting = state->ioport("CARTDIPS")->read();
if (state->m_mmc_latch1 == 1)
return 0xff; // open bus
else
- return mmc_hi_access_rom(space->machine(), offset);
+ return mmc_hi_access_rom(space.machine(), offset);
}
/*************************************************************
@@ -11318,8 +11318,8 @@ static WRITE8_HANDLER( edu2k_w )
{
LOG_MMC(("edu2k_w, offset: %04x, data: %02x\n", offset, data));
- prg32(space->machine(), data & 0x1f);
- wram_bank(space->machine(), (data & 0xc0) >> 6, NES_WRAM);
+ prg32(space.machine(), data & 0x1f);
+ wram_bank(space.machine(), (data & 0xc0) >> 6, NES_WRAM);
}
/*************************************************************
@@ -11338,7 +11338,7 @@ static void h2288_prg_cb( running_machine &machine, int start, int bank )
static WRITE8_HANDLER( h2288_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("h2288_l_w offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -11349,11 +11349,11 @@ static WRITE8_HANDLER( h2288_l_w )
{
UINT8 helper1 = (state->m_mmc_reg[0] & 0x05) | ((state->m_mmc_reg[0] >> 2) & 0x0a);
UINT8 helper2 = BIT(state->m_mmc_reg[0], 1);
- prg16_89ab(space->machine(), helper1 & ~helper2);
- prg16_cdef(space->machine(), helper1 | helper2);
+ prg16_89ab(space.machine(), helper1 & ~helper2);
+ prg16_cdef(space.machine(), helper1 | helper2);
}
else
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
}
}
@@ -11444,7 +11444,7 @@ static void shjy3_update( running_machine &machine )
static WRITE8_HANDLER( shjy3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, shift;
LOG_MMC(("shjy3_w, offset: %04x, data: %02x\n", offset, data));
@@ -11472,10 +11472,10 @@ static WRITE8_HANDLER( shjy3_w )
case 0x1400:
switch (data & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
break;
case 0x7000:
@@ -11491,7 +11491,7 @@ static WRITE8_HANDLER( shjy3_w )
break;
}
}
- shjy3_update(space->machine());
+ shjy3_update(space.machine());
}
/*************************************************************
@@ -11506,7 +11506,7 @@ static WRITE8_HANDLER( shjy3_w )
WRITE8_HANDLER( unl_6035052_extra_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_6035052_extra_w, offset: %04x, data: %02x\n", offset, data));
state->m_mmc_latch1 = data & 0x03;
if (state->m_mmc_latch1 == 1)
@@ -11515,7 +11515,7 @@ WRITE8_HANDLER( unl_6035052_extra_w )
READ8_HANDLER( unl_6035052_extra_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("unl_6035052_extra_r, offset: %04x\n", offset));
return state->m_mmc_latch1;
}
@@ -11572,7 +11572,7 @@ INLINE void pjoy84_set_base_mask( running_machine &machine )
static WRITE8_HANDLER( pjoy84_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("pjoy84_m_w offset: %04x, data: %02x\n", offset, data));
switch (offset & 0x03)
@@ -11584,12 +11584,12 @@ static WRITE8_HANDLER( pjoy84_m_w )
case 0x01:
case 0x02:
state->m_mmc_reg[offset & 0x03] = data;
- pjoy84_set_base_mask(space->machine());
+ pjoy84_set_base_mask(space.machine());
if (state->m_mmc_reg[3] & 0x10)
- chr8(space->machine(), (state->m_mmc_chr_base >> 3) | (state->m_mmc_reg[2] & 0x0f), state->m_mmc_chr_source);
+ chr8(space.machine(), (state->m_mmc_chr_base >> 3) | (state->m_mmc_reg[2] & 0x0f), state->m_mmc_chr_source);
else
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
}
@@ -11652,7 +11652,7 @@ static void someri_mmc1_set_chr( running_machine &machine )
static WRITE8_HANDLER( someri_mmc1_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
assert(state->m_mmc_cmd1 == 2);
@@ -11662,7 +11662,7 @@ static WRITE8_HANDLER( someri_mmc1_w )
state->m_mmc1_latch = 0;
state->m_mmc_reg[0] |= 0x0c;
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_prg(space.machine());
return;
}
@@ -11682,26 +11682,26 @@ static WRITE8_HANDLER( someri_mmc1_w )
state->m_mmc_reg[0] = state->m_mmc1_latch;
switch (state->m_mmc_reg[0] & 0x03)
{
- case 0: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 1: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
- case 2: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 3: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
+ case 0: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 1: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
+ case 2: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 3: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
}
- someri_mmc1_set_chr(space->machine());
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_chr(space.machine());
+ someri_mmc1_set_prg(space.machine());
break;
case 0x2000:
state->m_mmc_reg[1] = state->m_mmc1_latch;
- someri_mmc1_set_chr(space->machine());
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_chr(space.machine());
+ someri_mmc1_set_prg(space.machine());
break;
case 0x4000:
state->m_mmc_reg[2] = state->m_mmc1_latch;
- someri_mmc1_set_chr(space->machine());
+ someri_mmc1_set_chr(space.machine());
break;
case 0x6000:
state->m_mmc_reg[3] = state->m_mmc1_latch;
- someri_mmc1_set_prg(space->machine());
+ someri_mmc1_set_prg(space.machine());
break;
}
@@ -11712,7 +11712,7 @@ static WRITE8_HANDLER( someri_mmc1_w )
// MMC3 Mode emulation
static WRITE8_HANDLER( someri_mmc3_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 mmc_helper, cmd;
assert(state->m_mmc_cmd1 == 1);
@@ -11723,10 +11723,10 @@ static WRITE8_HANDLER( someri_mmc3_w )
state->m_mmc3_latch = data;
if (mmc_helper & 0x40)
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
if (mmc_helper & 0x80)
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 0x0001:
@@ -11736,18 +11736,18 @@ static WRITE8_HANDLER( someri_mmc3_w )
case 0: case 1:
case 2: case 3: case 4: case 5:
state->m_mmc_vrom_bank[cmd] = data;
- mmc3_set_chr(space->machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
+ mmc3_set_chr(space.machine(), state->m_mmc_chr_source, state->m_mmc_chr_base, state->m_mmc_chr_mask);
break;
case 6:
case 7:
state->m_mmc_prg_bank[cmd - 6] = data;
- mmc3_set_prg(space->machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
+ mmc3_set_prg(space.machine(), state->m_mmc_prg_base, state->m_mmc_prg_mask);
break;
}
break;
case 0x2000:
- set_nt_mirroring(space->machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
+ set_nt_mirroring(space.machine(), BIT(data, 0) ? PPU_MIRROR_HORZ : PPU_MIRROR_VERT);
break;
case 0x2001: break;
case 0x4000: state->m_IRQ_count_latch = data; break;
@@ -11760,7 +11760,7 @@ static WRITE8_HANDLER( someri_mmc3_w )
// VRC2 Mode emulation
static WRITE8_HANDLER( someri_vrc2_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
UINT8 bank, shift;
assert(state->m_mmc_cmd1 == 0);
@@ -11768,22 +11768,22 @@ static WRITE8_HANDLER( someri_vrc2_w )
if (offset < 0x1000)
{
state->m_mmc_prg_bank[4] = data;
- prg8_89(space->machine(), state->m_mmc_prg_bank[4]);
+ prg8_89(space.machine(), state->m_mmc_prg_bank[4]);
}
else if (offset < 0x2000)
{
switch (data & 0x03)
{
- case 0x00: set_nt_mirroring(space->machine(), PPU_MIRROR_VERT); break;
- case 0x01: set_nt_mirroring(space->machine(), PPU_MIRROR_HORZ); break;
- case 0x02: set_nt_mirroring(space->machine(), PPU_MIRROR_LOW); break;
- case 0x03: set_nt_mirroring(space->machine(), PPU_MIRROR_HIGH); break;
+ case 0x00: set_nt_mirroring(space.machine(), PPU_MIRROR_VERT); break;
+ case 0x01: set_nt_mirroring(space.machine(), PPU_MIRROR_HORZ); break;
+ case 0x02: set_nt_mirroring(space.machine(), PPU_MIRROR_LOW); break;
+ case 0x03: set_nt_mirroring(space.machine(), PPU_MIRROR_HIGH); break;
}
}
else if (offset < 0x3000)
{
state->m_mmc_prg_bank[5] = data;
- prg8_ab(space->machine(), state->m_mmc_prg_bank[5]);
+ prg8_ab(space.machine(), state->m_mmc_prg_bank[5]);
}
else if (offset < 0x7000)
{
@@ -11791,13 +11791,13 @@ static WRITE8_HANDLER( someri_vrc2_w )
shift = BIT(offset, 2) * 4;
data = (data & 0x0f) << shift;
state->m_mmc_vrom_bank[6 + bank] = data | state->m_mmc_chr_base;
- chr1_x(space->machine(), bank, state->m_mmc_vrom_bank[6 + bank], CHRROM);
+ chr1_x(space.machine(), bank, state->m_mmc_vrom_bank[6 + bank], CHRROM);
}
}
static WRITE8_HANDLER( someri_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("someri_w mode %d, offset: %04x, data: %02x\n", state->m_mmc_cmd1, offset, data));
switch (state->m_mmc_cmd1)
@@ -11834,7 +11834,7 @@ static void someri_mode_update( running_machine &machine )
static WRITE8_HANDLER( someri_l_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("someri_l_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
@@ -11844,7 +11844,7 @@ static WRITE8_HANDLER( someri_l_w )
state->m_mmc_chr_base = ((state->m_mmc_cmd1 & 0x04) << 6);
if (state->m_mmc_cmd1 != 1)
state->m_IRQ_enable = 0;
- someri_mode_update(space->machine());
+ someri_mode_update(space.machine());
}
}
@@ -11859,7 +11859,7 @@ static WRITE8_HANDLER( someri_l_w )
static WRITE8_HANDLER( fujiya_m_w )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fujiya_m_w, offset: %04x, data: %02x\n", offset, data));
offset += 0x6000;
@@ -11869,7 +11869,7 @@ static WRITE8_HANDLER( fujiya_m_w )
static READ8_HANDLER( fujiya_m_r )
{
- nes_state *state = space->machine().driver_data<nes_state>();
+ nes_state *state = space.machine().driver_data<nes_state>();
LOG_MMC(("fujiya_m_r, offset: %04x\n", offset));
offset += 0x6000;
diff --git a/src/mess/machine/northbridge.c b/src/mess/machine/northbridge.c
index 15bcd161d7b..ecca90f816c 100644
--- a/src/mess/machine/northbridge.c
+++ b/src/mess/machine/northbridge.c
@@ -24,15 +24,15 @@ northbridge_device::northbridge_device(const machine_config &mconfig, device_typ
void northbridge_device::device_start()
{
- address_space* space = machine().device(":maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device(":maincpu")->memory().space(AS_PROGRAM);
machine().root_device().membank("bank10")->set_base(m_ram->pointer());
if (m_ram->size() > 0x0a0000)
{
offs_t ram_limit = 0x100000 + m_ram->size() - 0x0a0000;
- space->install_read_bank(0x100000, ram_limit - 1, "bank1");
- space->install_write_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_read_bank(0x100000, ram_limit - 1, "bank1");
+ space.install_write_bank(0x100000, ram_limit - 1, "bank1");
machine().root_device().membank("bank1")->set_base(m_ram->pointer() + 0xa0000);
}
}
diff --git a/src/mess/machine/nubus.c b/src/mess/machine/nubus.c
index 031559570c6..c72e69ec588 100644
--- a/src/mess/machine/nubus.c
+++ b/src/mess/machine/nubus.c
@@ -233,8 +233,8 @@ void nubus_device::install_bank(offs_t start, offs_t end, offs_t mask, offs_t mi
{
// printf("install_bank: %s @ %x->%x mask %x mirror %x\n", tag, start, end, mask, mirror);
m_maincpu = machine().device<cpu_device>(m_cputag);
- address_space *space = m_maincpu->space(AS_PROGRAM);
- space->install_readwrite_bank(start, end, mask, mirror, tag );
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
+ space.install_readwrite_bank(start, end, mask, mirror, tag );
machine().root_device().membank(tag)->set_base(data);
}
diff --git a/src/mess/machine/oric.c b/src/mess/machine/oric.c
index 4016fa0784c..21417fb1bba 100644
--- a/src/mess/machine/oric.c
+++ b/src/mess/machine/oric.c
@@ -427,17 +427,17 @@ static void oric_install_apple2_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
device_t *fdc = machine.device("fdc");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_is_telestrat)
return;
- space->install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
- space->install_read_bank(0x0320, 0x03ff, "bank4");
+ space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
+ space.install_read_bank(0x0320, 0x03ff, "bank4");
- space->install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
+ space.install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
state->membank("bank4")->set_base( state->memregion("maincpu")->base() + 0x014000 + 0x020);
}
@@ -446,7 +446,7 @@ static void oric_enable_memory(running_machine &machine, int low, int high, int
{
oric_state *state = machine.driver_data<oric_state>();
int i;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_is_telestrat)
return;
@@ -455,33 +455,33 @@ static void oric_enable_memory(running_machine &machine, int low, int high, int
switch(i) {
case 1:
if (rd) {
- space->install_read_bank(0xc000, 0xdfff, "bank1");
+ space.install_read_bank(0xc000, 0xdfff, "bank1");
} else {
- space->nop_read(0xc000, 0xdfff);
+ space.nop_read(0xc000, 0xdfff);
}
if (wr) {
- space->install_write_bank(0xc000, 0xdfff, "bank5");
+ space.install_write_bank(0xc000, 0xdfff, "bank5");
} else {
- space->unmap_write(0xc000, 0xdfff);
+ space.unmap_write(0xc000, 0xdfff);
}
break;
case 2:
if (rd) {
- space->install_read_bank(0xe000, 0xf7ff, "bank2");
+ space.install_read_bank(0xe000, 0xf7ff, "bank2");
} else {
- space->nop_read(0xe000, 0xf7ff);
+ space.nop_read(0xe000, 0xf7ff);
}
if (wr) {
- space->install_write_bank(0xe000, 0xf7ff, "bank6");
+ space.install_write_bank(0xe000, 0xf7ff, "bank6");
} else {
- space->unmap_write(0xe000, 0xf7ff);
+ space.unmap_write(0xe000, 0xf7ff);
}
break;
case 3:
if (rd) {
- space->install_read_bank(0xf800, 0xffff, "bank3");
+ space.install_read_bank(0xf800, 0xffff, "bank3");
} else {
- space->nop_read(0xf800, 0xffff);
+ space.nop_read(0xf800, 0xffff);
}
break;
}
@@ -551,17 +551,17 @@ static void oric_install_apple2_v2_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
device_t *fdc = machine.device("fdc");
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
- space->install_read_bank(0x0320, 0x03ff, "bank4");
+ space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_legacy_read_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_r));
+ space.install_read_bank(0x0320, 0x03ff, "bank4");
- space->install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
- space->install_write_handler(0x0380, 0x0383, write8_delegate(FUNC(oric_state::apple2_v2_interface_w),state));
+ space.install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_legacy_write_handler(*fdc, 0x0310, 0x031f, FUNC(applefdc_w));
+ space.install_write_handler(0x0380, 0x0383, write8_delegate(FUNC(oric_state::apple2_v2_interface_w),state));
- state->apple2_v2_interface_w(*space, 0, 0);
+ state->apple2_v2_interface_w(space, 0, 0);
}
/********************/
@@ -755,16 +755,16 @@ WRITE8_MEMBER(oric_state::oric_jasmin_w)
static void oric_install_jasmin_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
/* romdis */
state->m_port_3fb_w = 1;
oric_jasmin_set_mem_0x0c000(machine);
- space->install_read_handler(0x0300, 0x03ef, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_read_handler(0x03f0, 0x03ff, read8_delegate(FUNC(oric_state::oric_jasmin_r),state));
+ space.install_read_handler(0x0300, 0x03ef, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_read_handler(0x03f0, 0x03ff, read8_delegate(FUNC(oric_state::oric_jasmin_r),state));
- space->install_write_handler(0x0300, 0x03ef, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_write_handler(0x03f0, 0x03ff, write8_delegate(FUNC(oric_state::oric_jasmin_w),state));
+ space.install_write_handler(0x0300, 0x03ef, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_write_handler(0x03f0, 0x03ff, write8_delegate(FUNC(oric_state::oric_jasmin_w),state));
}
/*********************************/
@@ -978,15 +978,15 @@ WRITE8_MEMBER(oric_state::oric_microdisc_w)
static void oric_install_microdisc_interface(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_read_handler(0x0310, 0x031f, read8_delegate(FUNC(oric_state::oric_microdisc_r),state));
- space->install_read_handler(0x0320, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_read_handler(0x0300, 0x030f, read8_delegate(FUNC(oric_state::oric_IO_r),state));
+ space.install_read_handler(0x0310, 0x031f, read8_delegate(FUNC(oric_state::oric_microdisc_r),state));
+ space.install_read_handler(0x0320, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),state));
- space->install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
- space->install_write_handler(0x0310, 0x031f, write8_delegate(FUNC(oric_state::oric_microdisc_w),state));
- space->install_write_handler(0x0320, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_write_handler(0x0300, 0x030f, write8_delegate(FUNC(oric_state::oric_IO_w),state));
+ space.install_write_handler(0x0310, 0x031f, write8_delegate(FUNC(oric_state::oric_microdisc_w),state));
+ space.install_write_handler(0x0320, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),state));
/* disable os rom, enable microdisc rom */
/* 0x0c000-0x0dfff will be ram, 0x0e000-0x0ffff will be microdisc rom */
@@ -1064,7 +1064,7 @@ void oric_state::machine_start()
void oric_state::machine_reset()
{
int disc_interface_id = machine().root_device().ioport("FLOPPY")->read() & 0x07;
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
if (m_is_telestrat)
return;
@@ -1095,8 +1095,8 @@ void oric_state::machine_reset()
}
else
{
- space->install_read_handler(0x0300, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),this));
- space->install_write_handler(0x0300, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),this));
+ space.install_read_handler(0x0300, 0x03ff, read8_delegate(FUNC(oric_state::oric_IO_r),this));
+ space.install_write_handler(0x0300, 0x03ff, write8_delegate(FUNC(oric_state::oric_IO_w),this));
}
}
break;
@@ -1246,7 +1246,7 @@ CB2
static void telestrat_refresh_mem(running_machine &machine)
{
oric_state *state = machine.driver_data<oric_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
telestrat_mem_block *mem_block = &state->m_telestrat_blocks[state->m_telestrat_bank_selection];
@@ -1256,23 +1256,23 @@ static void telestrat_refresh_mem(running_machine &machine)
{
state->membank("bank1")->set_base(mem_block->ptr);
state->membank("bank2")->set_base(mem_block->ptr);
- space->install_read_bank(0xc000, 0xffff, "bank1");
- space->install_write_bank(0xc000, 0xffff, "bank2");
+ space.install_read_bank(0xc000, 0xffff, "bank1");
+ space.install_write_bank(0xc000, 0xffff, "bank2");
}
break;
case TELESTRAT_MEM_BLOCK_ROM:
{
state->membank("bank1")->set_base(mem_block->ptr);
- space->install_read_bank(0xc000, 0xffff, "bank1");
- space->nop_write(0xc000, 0xffff);
+ space.install_read_bank(0xc000, 0xffff, "bank1");
+ space.nop_write(0xc000, 0xffff);
}
break;
default:
case TELESTRAT_MEM_BLOCK_UNDEFINED:
{
- space->nop_readwrite(0xc000, 0xffff);
+ space.nop_readwrite(0xc000, 0xffff);
}
break;
}
diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c
index d2100d061f6..e1f8665a9b8 100644
--- a/src/mess/machine/orion.c
+++ b/src/mess/machine/orion.c
@@ -268,12 +268,12 @@ static void orionz80_switch_bank(running_machine &machine)
orion_state *state = machine.driver_data<orion_state>();
UINT8 bank_select;
UINT8 segment_select;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
bank_select = (state->m_orionz80_dispatcher & 0x0c) >> 2;
segment_select = state->m_orionz80_dispatcher & 0x03;
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
if ((state->m_orionz80_dispatcher & 0x80)==0)
{ // dispatcher on
state->membank("bank1")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0x10000 * bank_select + segment_select * 0x4000 );
@@ -287,19 +287,19 @@ static void orionz80_switch_bank(running_machine &machine)
if ((state->m_orionz80_dispatcher & 0x20) == 0)
{
- space->install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
- space->install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
- space->install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),state));
- space->install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
- space->install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
- space->install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),state));
-
- space->install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
- space->install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),state));
- space->unmap_write(0xfc00, 0xfeff);
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
+ space.install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
+ space.install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
+ space.install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),state));
+ space.install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
+ space.install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
+ space.install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),state));
+
+ space.install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
+ space.install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),state));
+ space.unmap_write(0xfc00, 0xfeff);
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
state->membank("bank3")->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + 0xf000);
state->membank("bank5")->set_base(machine.root_device().memregion("maincpu")->base() + 0xf800);
@@ -328,25 +328,25 @@ WRITE8_MEMBER(orion_state::orionz80_dispatcher_w)
MACHINE_RESET_MEMBER(orion_state,orionz80)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
- space->install_write_bank(0x4000, 0xefff, "bank2");
- space->install_write_bank(0xf000, 0xf3ff, "bank3");
+ space.unmap_write(0x0000, 0x3fff);
+ space.install_write_bank(0x4000, 0xefff, "bank2");
+ space.install_write_bank(0xf000, 0xf3ff, "bank3");
- space->install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),this));
- space->install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),this));
- space->install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),this));
- space->install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),this));
- space->install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),this));
- space->install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),this));
+ space.install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),this));
+ space.install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),this));
+ space.install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orionz80_floppy_rtc_w),this));
+ space.install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),this));
+ space.install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),this));
+ space.install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orionz80_floppy_rtc_r),this));
- space->install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),this));
- space->install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),this));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),this));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),this));
- space->unmap_write(0xfc00, 0xfeff);
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),this));
+ space.install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),this));
+ space.install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionz80_memory_page_w),this));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),this));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(orion_state::orionz80_dispatcher_w),this));
+ space.unmap_write(0xfc00, 0xfeff);
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),this));
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0xf800);
@@ -413,7 +413,7 @@ WRITE8_MEMBER(orion_state::orionz80_io_w)
static void orionpro_bank_switch(running_machine &machine)
{
orion_state *state = machine.driver_data<orion_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int page = state->m_orionpro_page & 7; // we have only 8 pages
int is128 = (state->m_orionpro_dispatcher & 0x80) ? 1 : 0;
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
@@ -422,14 +422,14 @@ static void orionpro_bank_switch(running_machine &machine)
{
page = state->m_orionpro_128_page & 7;
}
- space->install_write_bank(0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x2000, 0x3fff, "bank2");
- space->install_write_bank(0x4000, 0x7fff, "bank3");
- space->install_write_bank(0x8000, 0xbfff, "bank4");
- space->install_write_bank(0xc000, 0xefff, "bank5");
- space->install_write_bank(0xf000, 0xf3ff, "bank6");
- space->install_write_bank(0xf400, 0xf7ff, "bank7");
- space->install_write_bank(0xf800, 0xffff, "bank8");
+ space.install_write_bank(0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x2000, 0x3fff, "bank2");
+ space.install_write_bank(0x4000, 0x7fff, "bank3");
+ space.install_write_bank(0x8000, 0xbfff, "bank4");
+ space.install_write_bank(0xc000, 0xefff, "bank5");
+ space.install_write_bank(0xf000, 0xf3ff, "bank6");
+ space.install_write_bank(0xf400, 0xf7ff, "bank7");
+ space.install_write_bank(0xf800, 0xffff, "bank8");
if ((state->m_orionpro_dispatcher & 0x01)==0x00)
@@ -444,12 +444,12 @@ static void orionpro_bank_switch(running_machine &machine)
}
if ((state->m_orionpro_dispatcher & 0x10)==0x10)
{ // ROM1 enabled
- space->unmap_write(0x0000, 0x1fff);
+ space.unmap_write(0x0000, 0x1fff);
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base() + 0x20000);
}
if ((state->m_orionpro_dispatcher & 0x08)==0x08)
{ // ROM2 enabled
- space->unmap_write(0x2000, 0x3fff);
+ space.unmap_write(0x2000, 0x3fff);
state->membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x22000 + (state->m_orionpro_rom2_segment & 7) * 0x2000);
}
@@ -477,20 +477,20 @@ static void orionpro_bank_switch(running_machine &machine)
{
state->membank("bank6")->set_base(ram + 0x10000 * 0 + 0xf000);
- space->install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
- space->install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
- space->unmap_write(0xf600, 0xf6ff);
- space->install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orion128_floppy_w),state));
- space->install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
- space->install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
- space->unmap_read(0xf600, 0xf6ff);
- space->install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orion128_floppy_r),state));
-
- space->install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
- space->install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionpro_memory_page_w),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
- space->unmap_write(0xfb00, 0xfeff);
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
+ space.install_write_handler(0xf400, 0xf4ff, write8_delegate(FUNC(orion_state::orion128_system_w),state));
+ space.install_write_handler(0xf500, 0xf5ff, write8_delegate(FUNC(orion_state::orion128_romdisk_w),state));
+ space.unmap_write(0xf600, 0xf6ff);
+ space.install_write_handler(0xf700, 0xf7ff, write8_delegate(FUNC(orion_state::orion128_floppy_w),state));
+ space.install_read_handler(0xf400, 0xf4ff, read8_delegate(FUNC(orion_state::orion128_system_r),state));
+ space.install_read_handler(0xf500, 0xf5ff, read8_delegate(FUNC(orion_state::orion128_romdisk_r),state));
+ space.unmap_read(0xf600, 0xf6ff);
+ space.install_read_handler(0xf700, 0xf7ff, read8_delegate(FUNC(orion_state::orion128_floppy_r),state));
+
+ space.install_write_handler(0xf800, 0xf8ff, write8_delegate(FUNC(orion_state::orion128_video_mode_w),state));
+ space.install_write_handler(0xf900, 0xf9ff, write8_delegate(FUNC(orion_state::orionpro_memory_page_w),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(orion_state::orion128_video_page_w),state));
+ space.unmap_write(0xfb00, 0xfeff);
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(orion_state::orionz80_sound_w),state));
state->membank("bank8")->set_base(ram + 0x10000 * 0 + 0xf800);
diff --git a/src/mess/machine/osborne1.c b/src/mess/machine/osborne1.c
index d67d9a11ba8..5809a2815fc 100644
--- a/src/mess/machine/osborne1.c
+++ b/src/mess/machine/osborne1.c
@@ -426,9 +426,9 @@ static void osborne1_load_proc(device_image_interface &image)
void osborne1_state::machine_reset()
{
int drive;
- address_space* space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Initialize memory configuration */
- osborne1_bankswitch_w( *space, 0x00, 0 );
+ osborne1_bankswitch_w( space, 0x00, 0 );
m_pia_0_irq_state = FALSE;
m_pia_1_irq_state = FALSE;
@@ -441,7 +441,7 @@ void osborne1_state::machine_reset()
for(drive=0;drive<2;drive++)
floppy_install_load_proc(floppy_get_device(machine(), drive), osborne1_load_proc);
- space->set_direct_update_handler(direct_update_delegate(FUNC(osborne1_state::osborne1_opbase), this));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(osborne1_state::osborne1_opbase), this));
}
@@ -524,9 +524,9 @@ int osborne1_daisy_device::z80daisy_irq_ack()
osborne1_state *state = machine().driver_data<osborne1_state>();
/* Enable ROM and I/O when IRQ is acknowledged */
UINT8 old_bankswitch = state->m_bankswitch;
- address_space* space = device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *device().machine().device("maincpu")->memory().space(AS_PROGRAM);
- state->osborne1_bankswitch_w( *space, 0, 0 );
+ state->osborne1_bankswitch_w( space, 0, 0 );
state->m_bankswitch = old_bankswitch;
state->m_in_irq_handler = 1;
return 0xF8;
diff --git a/src/mess/machine/partner.c b/src/mess/machine/partner.c
index a9d5b4d8066..19c5b09aca6 100644
--- a/src/mess/machine/partner.c
+++ b/src/mess/machine/partner.c
@@ -125,12 +125,12 @@ WRITE8_MEMBER(partner_state::partner_floppy_w){
static void partner_iomap_bank(running_machine &machine,UINT8 *rom)
{
partner_state *state = machine.driver_data<partner_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch(state->m_win_mem_page) {
case 2 :
// FDD
- space->install_write_handler(0xdc00, 0xddff, write8_delegate(FUNC(partner_state::partner_floppy_w),state));
- space->install_read_handler (0xdc00, 0xddff, read8_delegate(FUNC(partner_state::partner_floppy_r),state));
+ space.install_write_handler(0xdc00, 0xddff, write8_delegate(FUNC(partner_state::partner_floppy_w),state));
+ space.install_read_handler (0xdc00, 0xddff, read8_delegate(FUNC(partner_state::partner_floppy_r),state));
break;
case 4 :
// Timer
@@ -143,28 +143,28 @@ static void partner_iomap_bank(running_machine &machine,UINT8 *rom)
static void partner_bank_switch(running_machine &machine)
{
partner_state *state = machine.driver_data<partner_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *rom = state->memregion("maincpu")->base();
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
- space->install_write_bank(0x0000, 0x07ff, "bank1");
- space->install_write_bank(0x0800, 0x3fff, "bank2");
- space->install_write_bank(0x4000, 0x5fff, "bank3");
- space->install_write_bank(0x6000, 0x7fff, "bank4");
- space->install_write_bank(0x8000, 0x9fff, "bank5");
- space->install_write_bank(0xa000, 0xb7ff, "bank6");
- space->install_write_bank(0xb800, 0xbfff, "bank7");
- space->install_write_bank(0xc000, 0xc7ff, "bank8");
- space->install_write_bank(0xc800, 0xcfff, "bank9");
- space->install_write_bank(0xd000, 0xd7ff, "bank10");
- space->unmap_write(0xdc00, 0xddff);
- space->install_read_bank (0xdc00, 0xddff, "bank11");
- space->unmap_write(0xe000, 0xe7ff);
- space->unmap_write(0xe800, 0xffff);
+ space.install_write_bank(0x0000, 0x07ff, "bank1");
+ space.install_write_bank(0x0800, 0x3fff, "bank2");
+ space.install_write_bank(0x4000, 0x5fff, "bank3");
+ space.install_write_bank(0x6000, 0x7fff, "bank4");
+ space.install_write_bank(0x8000, 0x9fff, "bank5");
+ space.install_write_bank(0xa000, 0xb7ff, "bank6");
+ space.install_write_bank(0xb800, 0xbfff, "bank7");
+ space.install_write_bank(0xc000, 0xc7ff, "bank8");
+ space.install_write_bank(0xc800, 0xcfff, "bank9");
+ space.install_write_bank(0xd000, 0xd7ff, "bank10");
+ space.unmap_write(0xdc00, 0xddff);
+ space.install_read_bank (0xdc00, 0xddff, "bank11");
+ space.unmap_write(0xe000, 0xe7ff);
+ space.unmap_write(0xe800, 0xffff);
// BANK 1 (0x0000 - 0x07ff)
if (state->m_mem_page==0) {
- space->unmap_write(0x0000, 0x07ff);
+ space.unmap_write(0x0000, 0x07ff);
state->membank("bank1")->set_base(rom + 0x10000);
} else {
if (state->m_mem_page==7) {
@@ -187,7 +187,7 @@ static void partner_bank_switch(running_machine &machine)
} else {
if (state->m_mem_page==10) {
//window 1
- space->unmap_write(0x4000, 0x5fff);
+ space.unmap_write(0x4000, 0x5fff);
partner_window_1(machine, 3, 0, rom);
} else {
state->membank("bank3")->set_base(ram + 0x4000);
@@ -206,13 +206,13 @@ static void partner_bank_switch(running_machine &machine)
case 5:
case 10:
//window 2
- space->unmap_write(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
partner_window_2(machine, 5, 0, rom);
break;
case 8:
case 9:
//window 1
- space->unmap_write(0x8000, 0x9fff);
+ space.unmap_write(0x8000, 0x9fff);
partner_window_1(machine, 5, 0, rom);
break;
case 7:
@@ -228,13 +228,13 @@ static void partner_bank_switch(running_machine &machine)
case 5:
case 10:
//window 2
- space->unmap_write(0xa000, 0xb7ff);
+ space.unmap_write(0xa000, 0xb7ff);
partner_window_2(machine, 6, 0, rom);
break;
case 6:
case 8:
//BASIC
- space->unmap_write(0xa000, 0xb7ff);
+ space.unmap_write(0xa000, 0xb7ff);
state->membank("bank6")->set_base(rom + 0x12000); // BASIC
break;
case 7:
@@ -251,13 +251,13 @@ static void partner_bank_switch(running_machine &machine)
case 5:
case 10:
//window 2
- space->unmap_write(0xb800, 0xbfff);
+ space.unmap_write(0xb800, 0xbfff);
partner_window_2(machine, 7, 0x1800, rom);
break;
case 6:
case 8:
//BASIC
- space->unmap_write(0xb800, 0xbfff);
+ space.unmap_write(0xb800, 0xbfff);
state->membank("bank7")->set_base(rom + 0x13800); // BASIC
break;
case 7:
@@ -275,7 +275,7 @@ static void partner_bank_switch(running_machine &machine)
break;
case 8:
case 10:
- space->unmap_write(0xc000, 0xc7ff);
+ space.unmap_write(0xc000, 0xc7ff);
state->membank("bank8")->set_base(rom + 0x10000);
break;
default:
@@ -291,11 +291,11 @@ static void partner_bank_switch(running_machine &machine)
case 8:
case 9:
// window 2
- space->unmap_write(0xc800, 0xcfff);
+ space.unmap_write(0xc800, 0xcfff);
partner_window_2(machine, 9, 0, rom);
break;
case 10:
- space->unmap_write(0xc800, 0xcfff);
+ space.unmap_write(0xc800, 0xcfff);
state->membank("bank9")->set_base(rom + 0x10800);
break;
default:
@@ -311,7 +311,7 @@ static void partner_bank_switch(running_machine &machine)
case 8:
case 9:
// window 2
- space->unmap_write(0xd000, 0xd7ff);
+ space.unmap_write(0xd000, 0xd7ff);
partner_window_2(machine, 10, 0x0800, rom);
break;
default:
@@ -366,8 +366,8 @@ static WRITE_LINE_DEVICE_HANDLER( hrq_w )
i8257_hlda_w(device, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
I8257_INTERFACE( partner_dma )
{
diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c
index c3a2e8968d0..c48578eeb0e 100644
--- a/src/mess/machine/pc.c
+++ b/src/mess/machine/pc.c
@@ -1405,7 +1405,7 @@ DRIVER_INIT_MEMBER(pc_state,mc1502)
mess_init_pc_common(machine(), 0, NULL, pc_set_irq_line);
}
-static READ8_HANDLER( input_port_0_r ) { return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return space.machine().root_device().ioport("IN0")->read(); }
DRIVER_INIT_MEMBER(pc_state,pc1640)
{
@@ -1422,7 +1422,7 @@ DRIVER_INIT_MEMBER(pc_state,pc_vga)
mess_init_pc_common(machine(), PCCOMMON_KEYBOARD_PC, pc_set_keyb_int, pc_set_irq_line);
pc_vga_init(machine(), ::input_port_0_r, NULL);
- pc_vga_io_init(machine(), machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, machine().device("maincpu")->memory().space(AS_IO), 0x0000);
+ pc_vga_io_init(machine(), *machine().device("maincpu")->memory().space(AS_PROGRAM), 0xa0000, *machine().device("maincpu")->memory().space(AS_IO), 0x0000);
}
static IRQ_CALLBACK(pc_irq_callback)
diff --git a/src/mess/machine/pc1350.c b/src/mess/machine/pc1350.c
index 4d75ad63d73..c322cf5a111 100644
--- a/src/mess/machine/pc1350.c
+++ b/src/mess/machine/pc1350.c
@@ -99,32 +99,32 @@ static TIMER_CALLBACK(pc1350_power_up)
MACHINE_START( pc1350 )
{
pc1350_state *state = machine.driver_data<pc1350_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
state->m_power = 1;
machine.scheduler().timer_set(attotime::from_seconds(1), FUNC(pc1350_power_up));
- space->install_readwrite_bank(0x6000, 0x6fff, "bank1");
+ space.install_readwrite_bank(0x6000, 0x6fff, "bank1");
state->membank("bank1")->set_base(&machine.device<ram_device>(RAM_TAG)->pointer()[0x0000]);
if (machine.device<ram_device>(RAM_TAG)->size() >= 0x3000)
{
- space->install_readwrite_bank(0x4000, 0x5fff, "bank2");
+ space.install_readwrite_bank(0x4000, 0x5fff, "bank2");
state->membank("bank2")->set_base(&machine.device<ram_device>(RAM_TAG)->pointer()[0x1000]);
}
else
{
- space->nop_readwrite(0x4000, 0x5fff);
+ space.nop_readwrite(0x4000, 0x5fff);
}
if (machine.device<ram_device>(RAM_TAG)->size() >= 0x5000)
{
- space->install_readwrite_bank(0x2000, 0x3fff, "bank3");
+ space.install_readwrite_bank(0x2000, 0x3fff, "bank3");
state->membank("bank3")->set_base(&machine.device<ram_device>(RAM_TAG)->pointer()[0x3000]);
}
else
{
- space->nop_readwrite(0x2000, 0x3fff);
+ space.nop_readwrite(0x2000, 0x3fff);
}
device_t *main_cpu = machine.device("maincpu");
diff --git a/src/mess/machine/pc1403.c b/src/mess/machine/pc1403.c
index 1f1642c5f93..0411bb50f66 100644
--- a/src/mess/machine/pc1403.c
+++ b/src/mess/machine/pc1403.c
@@ -19,7 +19,7 @@
WRITE8_HANDLER(pc1403_asic_write)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
state->m_asic[offset>>9]=data;
switch( (offset>>9) ){
case 0/*0x3800*/:
@@ -39,7 +39,7 @@ WRITE8_HANDLER(pc1403_asic_write)
READ8_HANDLER(pc1403_asic_read)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
UINT8 data=state->m_asic[offset>>9];
switch( (offset>>9) ){
case 0: case 1: case 2:
diff --git a/src/mess/machine/pc_fdc.c b/src/mess/machine/pc_fdc.c
index 8d2055d0161..80feb880aec 100644
--- a/src/mess/machine/pc_fdc.c
+++ b/src/mess/machine/pc_fdc.c
@@ -275,10 +275,10 @@ static WRITE8_HANDLER( pc_fdc_dor_w )
int selected_drive;
int floppy_count;
- floppy_count = floppy_get_count(space->machine());
+ floppy_count = floppy_get_count(space.machine());
if (floppy_count > (fdc->digital_output_register & 0x03))
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), fdc->digital_output_register & 0x03), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), fdc->digital_output_register & 0x03), 1, 0);
fdc->digital_output_register = data;
@@ -286,34 +286,34 @@ static WRITE8_HANDLER( pc_fdc_dor_w )
/* set floppy drive motor state */
if (floppy_count > 0)
- floppy_mon_w(floppy_get_device(space->machine(), 0), !BIT(data, 4));
+ floppy_mon_w(floppy_get_device(space.machine(), 0), !BIT(data, 4));
if (floppy_count > 1)
- floppy_mon_w(floppy_get_device(space->machine(), 1), !BIT(data, 5));
+ floppy_mon_w(floppy_get_device(space.machine(), 1), !BIT(data, 5));
if (floppy_count > 2)
- floppy_mon_w(floppy_get_device(space->machine(), 2), !BIT(data, 6));
+ floppy_mon_w(floppy_get_device(space.machine(), 2), !BIT(data, 6));
if (floppy_count > 3)
- floppy_mon_w(floppy_get_device(space->machine(), 3), !BIT(data, 7));
+ floppy_mon_w(floppy_get_device(space.machine(), 3), !BIT(data, 7));
if ((data>>4) & (1<<selected_drive))
{
if (floppy_count > selected_drive)
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), selected_drive), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), selected_drive), 1, 0);
}
/* changing the DMA enable bit, will affect the terminal count state
from reaching the fdc - if dma is enabled this will send it through
otherwise it will be ignored */
- pc_fdc_set_tc_state(space->machine(), fdc->tc_state);
+ pc_fdc_set_tc_state(space.machine(), fdc->tc_state);
/* changing the DMA enable bit, will affect the dma drq state
from reaching us - if dma is enabled this will send it through
otherwise it will be ignored */
- pc_fdc_hw_dma_drq(pc_get_device(space->machine()), fdc->dma_state);
+ pc_fdc_hw_dma_drq(pc_get_device(space.machine()), fdc->dma_state);
/* changing the DMA enable bit, will affect the irq state
from reaching us - if dma is enabled this will send it through
otherwise it will be ignored */
- pc_fdc_hw_interrupt(pc_get_device(space->machine()), fdc->int_state);
+ pc_fdc_hw_interrupt(pc_get_device(space.machine()), fdc->int_state);
/* reset? */
if ((fdc->digital_output_register & PC_FDC_FLAGS_DOR_FDC_ENABLED)==0)
@@ -336,17 +336,17 @@ static WRITE8_HANDLER( pc_fdc_dor_w )
what is not yet clear is if this is a result of the drives ready state
changing...
*/
- upd765_ready_w(pc_get_device(space->machine()),1);
+ upd765_ready_w(pc_get_device(space.machine()),1);
/* set FDC at reset */
- upd765_reset_w(pc_get_device(space->machine()), 1);
+ upd765_reset_w(pc_get_device(space.machine()), 1);
}
else
{
- pc_fdc_set_tc_state(space->machine(), 0);
+ pc_fdc_set_tc_state(space.machine(), 0);
/* release reset on fdc */
- upd765_reset_w(pc_get_device(space->machine()), 0);
+ upd765_reset_w(pc_get_device(space.machine()), 0);
}
}
@@ -381,16 +381,16 @@ static WRITE8_HANDLER( pcjr_fdc_dor_w )
{
int floppy_count;
- floppy_count = floppy_get_count(space->machine());
+ floppy_count = floppy_get_count(space.machine());
/* set floppy drive motor state */
if (floppy_count > 0)
- floppy_mon_w(floppy_get_device(space->machine(), 0), BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), BIT(data, 0) ? CLEAR_LINE : ASSERT_LINE);
if ( data & 0x01 )
{
if ( floppy_count )
- floppy_drive_set_ready_state(floppy_get_device(space->machine(), 0), 1, 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 0);
}
/* Is the watchdog timer disabled */
@@ -399,7 +399,7 @@ static WRITE8_HANDLER( pcjr_fdc_dor_w )
fdc->watchdog->adjust( attotime::never );
if ( fdc->fdc_interface.pc_fdc_interrupt )
{
- fdc->fdc_interface.pc_fdc_interrupt(space->machine(), 0 );
+ fdc->fdc_interface.pc_fdc_interrupt(space.machine(), 0 );
}
} else {
/* Check for 1->0 watchdog trigger */
@@ -431,17 +431,17 @@ static WRITE8_HANDLER( pcjr_fdc_dor_w )
what is not yet clear is if this is a result of the drives ready state
changing...
*/
- upd765_ready_w(pc_get_device(space->machine()),1);
+ upd765_ready_w(pc_get_device(space.machine()),1);
/* set FDC at reset */
- upd765_reset_w(pc_get_device(space->machine()), 1);
+ upd765_reset_w(pc_get_device(space.machine()), 1);
}
else
{
- pc_fdc_set_tc_state(space->machine(), 0);
+ pc_fdc_set_tc_state(space.machine(), 0);
/* release reset on fdc */
- upd765_reset_w(pc_get_device(space->machine()), 0);
+ upd765_reset_w(pc_get_device(space.machine()), 0);
}
logerror("pcjr_fdc_dor_w: changing dor from %02x to %02x\n", fdc->digital_output_register, data);
@@ -498,22 +498,22 @@ READ8_HANDLER ( pc_fdc_r )
case 3: /* tape drive select? */
break;
case 4:
- data = upd765_status_r(pc_get_device(space->machine()), *space, 0);
+ data = upd765_status_r(pc_get_device(space.machine()), space, 0);
break;
case 5:
- data = upd765_data_r(pc_get_device(space->machine()), *space, offset);
+ data = upd765_data_r(pc_get_device(space.machine()), space, offset);
break;
case 6: /* FDC reserved */
break;
case 7:
- device_t *dev = floppy_get_device(space->machine(), fdc->digital_output_register & 0x03);
+ device_t *dev = floppy_get_device(space.machine(), fdc->digital_output_register & 0x03);
data = fdc->digital_input_register;
if(dev) data |= (!floppy_dskchg_r(dev)<<7);
break;
}
if (LOG_FDC)
- logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) space->machine().firstcpu->pc(), offset, data);
+ logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
return data;
}
@@ -522,9 +522,9 @@ READ8_HANDLER ( pc_fdc_r )
WRITE8_HANDLER ( pc_fdc_w )
{
if (LOG_FDC)
- logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space->machine().firstcpu->pc(), offset, data);
+ logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
- pc_fdc_check_data_rate(space->machine()); // check every time a command may start
+ pc_fdc_check_data_rate(space.machine()); // check every time a command may start
switch(offset)
{
case 0: /* n/a */
@@ -537,10 +537,10 @@ WRITE8_HANDLER ( pc_fdc_w )
/* tape drive select? */
break;
case 4:
- pc_fdc_data_rate_w(space->machine(), data);
+ pc_fdc_data_rate_w(space.machine(), data);
break;
case 5:
- upd765_data_w(pc_get_device(space->machine()), *space, 0, data);
+ upd765_data_w(pc_get_device(space.machine()), space, 0, data);
break;
case 6:
/* FDC reserved */
@@ -555,7 +555,7 @@ WRITE8_HANDLER ( pc_fdc_w )
* 1 0 250 kbps
* 1 1 1000 kbps
*/
- pc_fdc_data_rate_w(space->machine(), data & 3);
+ pc_fdc_data_rate_w(space.machine(), data & 3);
break;
}
}
@@ -563,7 +563,7 @@ WRITE8_HANDLER ( pc_fdc_w )
WRITE8_HANDLER ( pcjr_fdc_w )
{
if (LOG_FDC)
- logerror("pcjr_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space->machine().firstcpu->pc(), offset, data);
+ logerror("pcjr_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
switch(offset)
{
diff --git a/src/mess/machine/pc_joy.c b/src/mess/machine/pc_joy.c
index 5ed975cb067..ccb84871670 100644
--- a/src/mess/machine/pc_joy.c
+++ b/src/mess/machine/pc_joy.c
@@ -17,8 +17,8 @@ READ8_HANDLER ( pc_JOY_r )
{
UINT8 data = 0xf;
int delta;
- attotime new_time = space->machine().time();
- ioport_port *joystick_port = space->machine().root_device().ioport("pc_joy");
+ attotime new_time = space.machine().time();
+ ioport_port *joystick_port = space.machine().root_device().ioport("pc_joy");
delta = ((new_time - JOY_time) * 256 * 1000).seconds;
if (joystick_port != NULL)
@@ -32,10 +32,10 @@ READ8_HANDLER ( pc_JOY_r )
//}
//else
{
- if (space->machine().root_device().ioport("pc_joy_1")->read() < delta) data &= ~0x01;
- if (space->machine().root_device().ioport("pc_joy_2")->read() < delta) data &= ~0x02;
- if (space->machine().root_device().ioport("pc_joy_3")->read() < delta) data &= ~0x04;
- if (space->machine().root_device().ioport("pc_joy_4")->read() < delta) data &= ~0x08;
+ if (space.machine().root_device().ioport("pc_joy_1")->read() < delta) data &= ~0x01;
+ if (space.machine().root_device().ioport("pc_joy_2")->read() < delta) data &= ~0x02;
+ if (space.machine().root_device().ioport("pc_joy_3")->read() < delta) data &= ~0x04;
+ if (space.machine().root_device().ioport("pc_joy_4")->read() < delta) data &= ~0x08;
}
}
else
@@ -50,7 +50,7 @@ READ8_HANDLER ( pc_JOY_r )
WRITE8_HANDLER ( pc_JOY_w )
{
- JOY_time = space->machine().time();
+ JOY_time = space.machine().time();
}
INPUT_PORTS_START( pc_joystick_none )
diff --git a/src/mess/machine/pc_joy.h b/src/mess/machine/pc_joy.h
index b3951ff1c59..28f9bf88d29 100644
--- a/src/mess/machine/pc_joy.h
+++ b/src/mess/machine/pc_joy.h
@@ -26,8 +26,8 @@ public:
pc_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ioport_constructor device_input_ports() const;
- DECLARE_READ8_MEMBER(joy_port_r) { return pc_JOY_r(&space, offset); }
- DECLARE_WRITE8_MEMBER(joy_port_w) { pc_JOY_w(&space, offset, data); }
+ DECLARE_READ8_MEMBER(joy_port_r) { return pc_JOY_r(space, offset); }
+ DECLARE_WRITE8_MEMBER(joy_port_w) { pc_JOY_w(space, offset, data); }
protected:
virtual void device_start() {}
};
diff --git a/src/mess/machine/pecom.c b/src/mess/machine/pecom.c
index 6fac0a4b32c..43505223283 100644
--- a/src/mess/machine/pecom.c
+++ b/src/mess/machine/pecom.c
@@ -27,15 +27,15 @@ void pecom_state::machine_start()
void pecom_state::machine_reset()
{
UINT8 *rom = machine().root_device().memregion(CDP1802_TAG)->base();
- address_space *space = machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device(CDP1802_TAG)->memory().space(AS_PROGRAM);
- space->unmap_write(0x0000, 0x3fff);
- space->install_write_bank(0x4000, 0x7fff, "bank2");
- space->unmap_write(0xf000, 0xf7ff);
- space->unmap_write(0xf800, 0xffff);
- space->install_read_bank (0xf000, 0xf7ff, "bank3");
- space->install_read_bank (0xf800, 0xffff, "bank4");
+ space.unmap_write(0x0000, 0x3fff);
+ space.install_write_bank(0x4000, 0x7fff, "bank2");
+ space.unmap_write(0xf000, 0xf7ff);
+ space.unmap_write(0xf800, 0xffff);
+ space.install_read_bank (0xf000, 0xf7ff, "bank3");
+ space.install_read_bank (0xf800, 0xffff, "bank4");
membank("bank1")->set_base(rom + 0x8000);
membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x4000);
membank("bank3")->set_base(rom + 0xf000);
diff --git a/src/mess/machine/pet.c b/src/mess/machine/pet.c
index b4c2284278a..7e98c66d549 100644
--- a/src/mess/machine/pet.c
+++ b/src/mess/machine/pet.c
@@ -405,44 +405,44 @@ const via6522_interface pet_via =
static WRITE8_HANDLER( cbm8096_io_w )
{
- via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
- pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1");
- mc6845_device *mc6845 = space->machine().device<mc6845_device>("crtc");
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ pia6821_device *pia_0 = space.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = space.machine().device<pia6821_device>("pia_1");
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>("crtc");
if (offset < 0x10) ;
- else if (offset < 0x14) pia_0->write(*space, offset & 3, data);
+ else if (offset < 0x14) pia_0->write(space, offset & 3, data);
else if (offset < 0x20) ;
- else if (offset < 0x24) pia_1->write(*space, offset & 3, data);
+ else if (offset < 0x24) pia_1->write(space, offset & 3, data);
else if (offset < 0x40) ;
- else if (offset < 0x50) via_0->write(*space, offset & 0xf, data);
+ else if (offset < 0x50) via_0->write(space, offset & 0xf, data);
else if (offset < 0x80) ;
- else if (offset == 0x80) mc6845->address_w(*space, 0, data);
- else if (offset == 0x81) mc6845->register_w(*space, 0, data);
+ else if (offset == 0x80) mc6845->address_w(space, 0, data);
+ else if (offset == 0x81) mc6845->register_w(space, 0, data);
}
static READ8_HANDLER( cbm8096_io_r )
{
- via6522_device *via_0 = space->machine().device<via6522_device>("via6522_0");
- pia6821_device *pia_0 = space->machine().device<pia6821_device>("pia_0");
- pia6821_device *pia_1 = space->machine().device<pia6821_device>("pia_1");
- mc6845_device *mc6845 = space->machine().device<mc6845_device>("crtc");
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
+ pia6821_device *pia_0 = space.machine().device<pia6821_device>("pia_0");
+ pia6821_device *pia_1 = space.machine().device<pia6821_device>("pia_1");
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>("crtc");
int data = 0xff;
if (offset < 0x10) ;
- else if (offset < 0x14) data = pia_0->read(*space, offset & 3);
+ else if (offset < 0x14) data = pia_0->read(space, offset & 3);
else if (offset < 0x20) ;
- else if (offset < 0x24) data = pia_1->read(*space, offset & 3);
+ else if (offset < 0x24) data = pia_1->read(space, offset & 3);
else if (offset < 0x40) ;
- else if (offset < 0x50) data = via_0->read(*space, offset & 0xf);
+ else if (offset < 0x50) data = via_0->read(space, offset & 0xf);
else if (offset < 0x80) ;
- else if (offset == 0x81) data = mc6845->register_r(*space, 0);
+ else if (offset == 0x81) data = mc6845->register_r(space, 0);
return data;
}
static WRITE8_HANDLER( pet80_bank1_w )
{
- pet_state *state = space->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
state->m_pet80_bank1_base[offset] = data;
}
@@ -459,56 +459,56 @@ static WRITE8_HANDLER( pet80_bank1_w )
*/
WRITE8_HANDLER( cbm8096_w )
{
- pet_state *state = space->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
if (data & 0x80)
{
if (data & 0x40)
{
- space->install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
- space->install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
+ space.install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
+ space.install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
}
else
{
- space->install_read_bank(0xe800, 0xefff, "bank7");
+ space.install_read_bank(0xe800, 0xefff, "bank7");
if (!(data & 2))
- space->install_write_bank(0xe800, 0xefff, "bank7");
+ space.install_write_bank(0xe800, 0xefff, "bank7");
else
- space->nop_write(0xe800, 0xefff);
+ space.nop_write(0xe800, 0xefff);
}
if ((data & 2) == 0) {
- space->install_write_bank(0xc000, 0xe7ff, "bank6");
- space->install_write_bank(0xf000, 0xffef, "bank8");
- space->install_write_bank(0xfff1, 0xffff, "bank9");
+ space.install_write_bank(0xc000, 0xe7ff, "bank6");
+ space.install_write_bank(0xf000, 0xffef, "bank8");
+ space.install_write_bank(0xfff1, 0xffff, "bank9");
} else {
- space->nop_write(0xc000, 0xe7ff);
- space->nop_write(0xf000, 0xffef);
- space->nop_write(0xfff1, 0xffff);
+ space.nop_write(0xc000, 0xe7ff);
+ space.nop_write(0xf000, 0xffef);
+ space.nop_write(0xfff1, 0xffff);
}
if (data & 0x20)
{
state->m_pet80_bank1_base = state->m_memory + 0x8000;
state->membank("bank1")->set_base(state->m_pet80_bank1_base);
- space->install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
+ space.install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
}
else
{
if (!(data & 1))
- space->install_write_bank(0x8000, 0x8fff, "bank1");
+ space.install_write_bank(0x8000, 0x8fff, "bank1");
else
- space->nop_write(0x8000, 0x8fff);
+ space.nop_write(0x8000, 0x8fff);
}
if ((data & 1) == 0 ){
- space->install_write_bank(0x9000, 0x9fff, "bank2");
- space->install_write_bank(0xa000, 0xafff, "bank3");
- space->install_write_bank(0xb000, 0xbfff, "bank4");
+ space.install_write_bank(0x9000, 0x9fff, "bank2");
+ space.install_write_bank(0xa000, 0xafff, "bank3");
+ space.install_write_bank(0xb000, 0xbfff, "bank4");
} else {
- space->nop_write(0x9000, 0x9fff);
- space->nop_write(0xa000, 0xafff);
- space->nop_write(0xb000, 0xbfff);
+ space.nop_write(0x9000, 0x9fff);
+ space.nop_write(0xa000, 0xafff);
+ space.nop_write(0xb000, 0xbfff);
}
if (data & 4)
@@ -559,28 +559,28 @@ WRITE8_HANDLER( cbm8096_w )
{
state->m_pet80_bank1_base = state->m_memory + 0x8000;
state->membank("bank1")->set_base(state->m_pet80_bank1_base );
- space->install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
+ space.install_legacy_write_handler(0x8000, 0x8fff, FUNC(pet80_bank1_w));
state->membank("bank2")->set_base(state->m_memory + 0x9000);
- space->unmap_write(0x9000, 0x9fff);
+ space.unmap_write(0x9000, 0x9fff);
state->membank("bank3")->set_base(state->m_memory + 0xa000);
- space->unmap_write(0xa000, 0xafff);
+ space.unmap_write(0xa000, 0xafff);
state->membank("bank4")->set_base(state->m_memory + 0xb000);
- space->unmap_write(0xb000, 0xbfff);
+ space.unmap_write(0xb000, 0xbfff);
state->membank("bank6")->set_base(state->m_memory + 0xc000);
- space->unmap_write(0xc000, 0xe7ff);
+ space.unmap_write(0xc000, 0xe7ff);
- space->install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
- space->install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
+ space.install_legacy_read_handler(0xe800, 0xefff, FUNC(cbm8096_io_r));
+ space.install_legacy_write_handler(0xe800, 0xefff, FUNC(cbm8096_io_w));
state->membank("bank8")->set_base(state->m_memory + 0xf000);
- space->unmap_write(0xf000, 0xffef);
+ space.unmap_write(0xf000, 0xffef);
state->membank("bank9")->set_base(state->m_memory + 0xfff1);
- space->unmap_write(0xfff1, 0xffff);
+ space.unmap_write(0xfff1, 0xffff);
}
}
@@ -591,7 +591,7 @@ READ8_HANDLER( superpet_r )
WRITE8_HANDLER( superpet_w )
{
- pet_state *state = space->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
switch (offset)
{
case 0:
@@ -749,7 +749,7 @@ void pet_state::machine_reset()
{
machine().device("maincpu")->memory().space(AS_PROGRAM)->nop_write(0xfff0, 0xfff0);
}
- cbm8096_w(machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
+ cbm8096_w(*machine().device("maincpu")->memory().space(AS_PROGRAM), 0, 0);
}
//removed cbm_drive_0_config (machine().root_device().ioport("CFG")->read() & 2 ? IEEE : 0, 8);
diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c
index 31140974e4f..97f24d1a25e 100644
--- a/src/mess/machine/pk8020.c
+++ b/src/mess/machine/pk8020.c
@@ -231,7 +231,7 @@ WRITE8_MEMBER(pk8020_state::devices_w)
static void pk8020_set_bank(running_machine &machine,UINT8 data)
{
pk8020_state *state = machine.driver_data<pk8020_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem = state->memregion("maincpu")->base();
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
@@ -239,60 +239,60 @@ static void pk8020_set_bank(running_machine &machine,UINT8 data)
case 0x00 :
{
// ROM
- space->install_read_bank (0x0000, 0x37ff, "bank1");
- space->install_write_bank(0x0000, 0x37ff, "bank2");
+ space.install_read_bank (0x0000, 0x37ff, "bank1");
+ space.install_write_bank(0x0000, 0x37ff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// Keyboard
- space->install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0x3800, 0x39ff, "bank3");
+ space.install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0x3800, 0x39ff, "bank3");
state->membank("bank3")->set_base(ram + 0x3800);
// System reg
- space->install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
// RAM
- space->install_read_bank (0x4000, 0xffff, "bank4");
- space->install_write_bank(0x4000, 0xffff, "bank5");
+ space.install_read_bank (0x4000, 0xffff, "bank4");
+ space.install_write_bank(0x4000, 0xffff, "bank5");
state->membank("bank4")->set_base(ram + 0x4000);
state->membank("bank5")->set_base(ram + 0x4000);
}
break;
case 0x01 : {
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xffff, "bank3");
- space->install_write_bank(0x2000, 0xffff, "bank4");
+ space.install_read_bank (0x2000, 0xffff, "bank3");
+ space.install_write_bank(0x2000, 0xffff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
}
break;
case 0x02 : {
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xffff, "bank3");
- space->install_write_bank(0x4000, 0xffff, "bank4");
+ space.install_read_bank (0x4000, 0xffff, "bank3");
+ space.install_write_bank(0x4000, 0xffff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
}
break;
case 0x03 : {
// RAM
- space->install_read_bank (0x0000, 0xffff, "bank1");
- space->install_write_bank(0x0000, 0xffff, "bank2");
+ space.install_read_bank (0x0000, 0xffff, "bank1");
+ space.install_write_bank(0x0000, 0xffff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
}
@@ -301,545 +301,545 @@ static void pk8020_set_bank(running_machine &machine,UINT8 data)
case 0x05 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xf7ff, "bank3");
- space->install_write_bank(0x2000, 0xf7ff, "bank4");
+ space.install_read_bank (0x2000, 0xf7ff, "bank3");
+ space.install_write_bank(0x2000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x06 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xf7ff, "bank3");
- space->install_write_bank(0x4000, 0xf7ff, "bank4");
+ space.install_read_bank (0x4000, 0xf7ff, "bank3");
+ space.install_write_bank(0x4000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x07 :
{
// RAM
- space->install_read_bank (0x0000, 0xf7ff, "bank1");
- space->install_write_bank(0x0000, 0xf7ff, "bank2");
+ space.install_read_bank (0x0000, 0xf7ff, "bank1");
+ space.install_write_bank(0x0000, 0xf7ff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank3");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank3");
state->membank("bank3")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x08 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// Keyboard
- space->install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0x3800, 0x39ff, "bank3");
+ space.install_read_handler (0x3800, 0x39ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0x3800, 0x39ff, "bank3");
state->membank("bank3")->set_base(ram + 0x3800);
// System reg
- space->install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0x3a00, 0x3aff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0x3a00, 0x3aff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0x3b00, 0x3bff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0x3b00, 0x3bff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0x3c00, 0x3fff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0x3c00, 0x3fff, write8_delegate(FUNC(pk8020_state::text_w),state));
// RAM
- space->install_read_bank (0x4000, 0xbfff, "bank4");
- space->install_write_bank(0x4000, 0xbfff, "bank5");
+ space.install_read_bank (0x4000, 0xbfff, "bank4");
+ space.install_write_bank(0x4000, 0xbfff, "bank5");
state->membank("bank4")->set_base(ram + 0x4000);
state->membank("bank5")->set_base(ram + 0x4000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x09 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xbfff, "bank3");
- space->install_write_bank(0x2000, 0xbfff, "bank4");
+ space.install_read_bank (0x2000, 0xbfff, "bank3");
+ space.install_write_bank(0x2000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x0A :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xbfff, "bank3");
- space->install_write_bank(0x4000, 0xbfff, "bank4");
+ space.install_read_bank (0x4000, 0xbfff, "bank3");
+ space.install_write_bank(0x4000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x0B :
{
// RAM
- space->install_read_bank (0x0000, 0xbfff, "bank1");
- space->install_write_bank(0x0000, 0xbfff, "bank2");
+ space.install_read_bank (0x0000, 0xbfff, "bank1");
+ space.install_write_bank(0x0000, 0xbfff, "bank2");
state->membank("bank1")->set_base(ram + 0x0000);
state->membank("bank2")->set_base(ram + 0x0000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x0C :
case 0x0D :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0x3fff, "bank3");
- space->install_write_bank(0x2000, 0x3fff, "bank4");
+ space.install_read_bank (0x2000, 0x3fff, "bank3");
+ space.install_write_bank(0x2000, 0x3fff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Video RAM
- space->install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
// RAM
- space->install_read_bank (0x8000, 0xfdff, "bank5");
- space->install_write_bank(0x8000, 0xfdff, "bank6");
+ space.install_read_bank (0x8000, 0xfdff, "bank5");
+ space.install_write_bank(0x8000, 0xfdff, "bank6");
state->membank("bank5")->set_base(ram + 0x8000);
state->membank("bank6")->set_base(ram + 0x8000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x0E :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// Video RAM
- space->install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
// RAM
- space->install_read_bank (0x8000, 0xfdff, "bank5");
- space->install_write_bank(0x8000, 0xfdff, "bank6");
+ space.install_read_bank (0x8000, 0xfdff, "bank5");
+ space.install_write_bank(0x8000, 0xfdff, "bank6");
state->membank("bank5")->set_base(ram + 0x8000);
state->membank("bank6")->set_base(ram + 0x8000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x0F :
{
// RAM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(ram + 0x0000);
state->membank("bank2")->set_base(ram + 0x0000);
// Video RAM
- space->install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0x4000, 0x7fff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0x4000, 0x7fff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
// RAM
- space->install_read_bank (0x8000, 0xfdff, "bank3");
- space->install_write_bank(0x8000, 0xfdff, "bank4");
+ space.install_read_bank (0x8000, 0xfdff, "bank3");
+ space.install_write_bank(0x8000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x8000);
state->membank("bank4")->set_base(ram + 0x8000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x10 :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xf7ff, "bank3");
- space->install_write_bank(0x6000, 0xf7ff, "bank4");
+ space.install_read_bank (0x6000, 0xf7ff, "bank3");
+ space.install_write_bank(0x6000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x11 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xf7ff, "bank3");
- space->install_write_bank(0x2000, 0xf7ff, "bank4");
+ space.install_read_bank (0x2000, 0xf7ff, "bank3");
+ space.install_write_bank(0x2000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x12 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xf7ff, "bank3");
- space->install_write_bank(0x4000, 0xf7ff, "bank4");
+ space.install_read_bank (0x4000, 0xf7ff, "bank3");
+ space.install_write_bank(0x4000, 0xf7ff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank5");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank5");
state->membank("bank5")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x13 :
{
// RAM
- space->install_read_bank (0x0000, 0xf7ff, "bank1");
- space->install_write_bank(0x0000, 0xf7ff, "bank2");
+ space.install_read_bank (0x0000, 0xf7ff, "bank1");
+ space.install_write_bank(0x0000, 0xf7ff, "bank2");
state->membank("bank1")->set_base(ram + 0x0000);
state->membank("bank2")->set_base(ram + 0x0000);
// Keyboard
- space->install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
- space->install_write_bank(0xf800, 0xf9ff, "bank3");
+ space.install_read_handler (0xf800, 0xf9ff, read8_delegate(FUNC(pk8020_state::keyboard_r),state));
+ space.install_write_bank(0xf800, 0xf9ff, "bank3");
state->membank("bank3")->set_base(ram + 0xf800);
// System reg
- space->install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xfa00, 0xfaff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xfa00, 0xfaff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Devices
- space->install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfb00, 0xfbff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfb00, 0xfbff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// Text Video Memory
- space->install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
- space->install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
+ space.install_read_handler (0xfc00, 0xffff, read8_delegate(FUNC(pk8020_state::text_r),state));
+ space.install_write_handler(0xfc00, 0xffff, write8_delegate(FUNC(pk8020_state::text_w),state));
}
break;
case 0x14 :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xfdff, "bank3");
- space->install_write_bank(0x6000, 0xfdff, "bank4");
+ space.install_read_bank (0x6000, 0xfdff, "bank3");
+ space.install_write_bank(0x6000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x15 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xfdff, "bank3");
- space->install_write_bank(0x2000, 0xfdff, "bank4");
+ space.install_read_bank (0x2000, 0xfdff, "bank3");
+ space.install_write_bank(0x2000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x16 :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xfdff, "bank3");
- space->install_write_bank(0x4000, 0xfdff, "bank4");
+ space.install_read_bank (0x4000, 0xfdff, "bank3");
+ space.install_write_bank(0x4000, 0xfdff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x17 :
{
// RAM
- space->install_read_bank (0x0000, 0xfdff, "bank1");
- space->install_write_bank(0x0000, 0xfdff, "bank2");
+ space.install_read_bank (0x0000, 0xfdff, "bank1");
+ space.install_write_bank(0x0000, 0xfdff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// Devices
- space->install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
- space->install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
+ space.install_read_handler (0xfe00, 0xfeff, read8_delegate(FUNC(pk8020_state::devices_r),state));
+ space.install_write_handler(0xfe00, 0xfeff, write8_delegate(FUNC(pk8020_state::devices_w),state));
// System reg
- space->install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xff00, 0xffff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xff00, 0xffff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
}
break;
case 0x18 :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xbeff, "bank3");
- space->install_write_bank(0x6000, 0xbeff, "bank4");
+ space.install_read_bank (0x6000, 0xbeff, "bank3");
+ space.install_write_bank(0x6000, 0xbeff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x19 :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xbeff, "bank3");
- space->install_write_bank(0x2000, 0xbeff, "bank4");
+ space.install_read_bank (0x2000, 0xbeff, "bank3");
+ space.install_write_bank(0x2000, 0xbeff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1A :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xbeff, "bank3");
- space->install_write_bank(0x4000, 0xbeff, "bank4");
+ space.install_read_bank (0x4000, 0xbeff, "bank3");
+ space.install_write_bank(0x4000, 0xbeff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1B :
{
// RAM
- space->install_read_bank (0x0000, 0xbeff, "bank1");
- space->install_write_bank(0x0000, 0xbeff, "bank2");
+ space.install_read_bank (0x0000, 0xbeff, "bank1");
+ space.install_write_bank(0x0000, 0xbeff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// System reg
- space->install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
- space->install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
+ space.install_read_handler (0xbf00, 0xbfff, read8_delegate(FUNC(pk8020_state::sysreg_r),state));
+ space.install_write_handler(0xbf00, 0xbfff, write8_delegate(FUNC(pk8020_state::sysreg_w),state));
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1C :
{
// ROM
- space->install_read_bank (0x0000, 0x5fff, "bank1");
- space->install_write_bank(0x0000, 0x5fff, "bank2");
+ space.install_read_bank (0x0000, 0x5fff, "bank1");
+ space.install_write_bank(0x0000, 0x5fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x6000, 0xbfff, "bank3");
- space->install_write_bank(0x6000, 0xbfff, "bank4");
+ space.install_read_bank (0x6000, 0xbfff, "bank3");
+ space.install_write_bank(0x6000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x6000);
state->membank("bank4")->set_base(ram + 0x6000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1D :
{
// ROM
- space->install_read_bank (0x0000, 0x1fff, "bank1");
- space->install_write_bank(0x0000, 0x1fff, "bank2");
+ space.install_read_bank (0x0000, 0x1fff, "bank1");
+ space.install_write_bank(0x0000, 0x1fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x2000, 0xbfff, "bank3");
- space->install_write_bank(0x2000, 0xbfff, "bank4");
+ space.install_read_bank (0x2000, 0xbfff, "bank3");
+ space.install_write_bank(0x2000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x2000);
state->membank("bank4")->set_base(ram + 0x2000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1E :
{
// ROM
- space->install_read_bank (0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x0000, 0x3fff, "bank2");
+ space.install_read_bank (0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank2");
state->membank("bank1")->set_base(mem + 0x10000);
state->membank("bank2")->set_base(ram + 0x0000);
// RAM
- space->install_read_bank (0x4000, 0xbfff, "bank3");
- space->install_write_bank(0x4000, 0xbfff, "bank4");
+ space.install_read_bank (0x4000, 0xbfff, "bank3");
+ space.install_write_bank(0x4000, 0xbfff, "bank4");
state->membank("bank3")->set_base(ram + 0x4000);
state->membank("bank4")->set_base(ram + 0x4000);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
case 0x1F :
{
// RAM
- space->install_read_bank (0x0000, 0xbfff, "bank1");
- space->install_write_bank(0x0000, 0xbfff, "bank2");
+ space.install_read_bank (0x0000, 0xbfff, "bank1");
+ space.install_write_bank(0x0000, 0xbfff, "bank2");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram);
// Video RAM
- space->install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
- space->install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
+ space.install_read_handler (0xc000, 0xffff, read8_delegate(FUNC(pk8020_state::gzu_r),state));
+ space.install_write_handler(0xc000, 0xffff, write8_delegate(FUNC(pk8020_state::gzu_w),state));
}
break;
diff --git a/src/mess/machine/pmd85.c b/src/mess/machine/pmd85.c
index 7367082e900..457bfae527a 100644
--- a/src/mess/machine/pmd85.c
+++ b/src/mess/machine/pmd85.c
@@ -28,20 +28,20 @@ enum {PMD85_1, PMD85_2, PMD85_2A, PMD85_2B, PMD85_3, ALFA, MATO, C2717};
static void pmd851_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x0fff);
- space->nop_write(0x1000, 0x1fff);
- space->unmap_write(0x2000, 0x2fff);
- space->nop_write(0x3000, 0x3fff);
+ space.unmap_write(0x0000, 0x0fff);
+ space.nop_write(0x1000, 0x1fff);
+ space.unmap_write(0x2000, 0x2fff);
+ space.nop_write(0x3000, 0x3fff);
- space->nop_read(0x1000, 0x1fff);
- space->nop_read(0x3000, 0x3fff);
+ space.nop_read(0x1000, 0x1fff);
+ space.nop_read(0x3000, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank3")->set_base(mem + 0x010000);
@@ -53,14 +53,14 @@ static void pmd851_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x0fff, "bank1");
- space->install_write_bank(0x1000, 0x1fff, "bank2");
- space->install_write_bank(0x2000, 0x2fff, "bank3");
- space->install_write_bank(0x3000, 0x3fff, "bank4");
- space->install_write_bank(0x4000, 0x7fff, "bank5");
+ space.install_write_bank(0x0000, 0x0fff, "bank1");
+ space.install_write_bank(0x1000, 0x1fff, "bank2");
+ space.install_write_bank(0x2000, 0x2fff, "bank3");
+ space.install_write_bank(0x3000, 0x3fff, "bank4");
+ space.install_write_bank(0x4000, 0x7fff, "bank5");
- space->install_read_bank(0x1000, 0x1fff, "bank2");
- space->install_read_bank(0x3000, 0x3fff, "bank4");
+ space.install_read_bank(0x1000, 0x1fff, "bank2");
+ space.install_read_bank(0x3000, 0x3fff, "bank4");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x1000);
@@ -73,15 +73,15 @@ static void pmd851_update_memory(running_machine &machine)
static void pmd852a_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x0fff);
- space->unmap_write(0x2000, 0x2fff);
+ space.unmap_write(0x0000, 0x0fff);
+ space.unmap_write(0x2000, 0x2fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(ram + 0x9000);
@@ -97,8 +97,8 @@ static void pmd852a_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x0fff, "bank1");
- space->install_write_bank(0x2000, 0x2fff, "bank3");
+ space.install_write_bank(0x0000, 0x0fff, "bank1");
+ space.install_write_bank(0x2000, 0x2fff, "bank3");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x1000);
@@ -149,16 +149,16 @@ static void pmd853_update_memory(running_machine &machine)
static void alfa_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x0fff);
- space->unmap_write(0x1000, 0x33ff);
- space->nop_write(0x3400, 0x3fff);
+ space.unmap_write(0x0000, 0x0fff);
+ space.unmap_write(0x1000, 0x33ff);
+ space.nop_write(0x3400, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(mem + 0x011000);
@@ -169,9 +169,9 @@ static void alfa_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x0fff, "bank1");
- space->install_write_bank(0x1000, 0x33ff, "bank2");
- space->install_write_bank(0x3400, 0x3fff, "bank3");
+ space.install_write_bank(0x0000, 0x0fff, "bank1");
+ space.install_write_bank(0x1000, 0x33ff, "bank2");
+ space.install_write_bank(0x3400, 0x3fff, "bank3");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x1000);
@@ -183,14 +183,14 @@ static void alfa_update_memory(running_machine &machine)
static void mato_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
UINT8 *mem = state->memregion("maincpu")->base();
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(ram + 0xc000);
@@ -199,7 +199,7 @@ static void mato_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x4000);
@@ -209,13 +209,13 @@ static void mato_update_memory(running_machine &machine)
static void c2717_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *mem = state->memregion("maincpu")->base();
UINT8 *ram = machine.device<ram_device>(RAM_TAG)->pointer();
if (state->m_startup_mem_map)
{
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(mem + 0x010000);
state->membank("bank2")->set_base(ram + 0x4000);
@@ -224,7 +224,7 @@ static void c2717_update_memory(running_machine &machine)
}
else
{
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
state->membank("bank1")->set_base(ram);
state->membank("bank2")->set_base(ram + 0x4000);
}
diff --git a/src/mess/machine/pokemini.c b/src/mess/machine/pokemini.c
index f9010140ef8..c50f105904a 100644
--- a/src/mess/machine/pokemini.c
+++ b/src/mess/machine/pokemini.c
@@ -395,7 +395,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
static const int timer_to_cycles_fast[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
static const int timer_to_cycles_slow[8] = { 128, 256, 512, 1024, 2048, 4096, 8192, 16384 };
- //logerror( "%0X: Write to hardware address: %02X, %02X\n", space->device() .safe_pc( ), offset, data );
+ //logerror( "%0X: Write to hardware address: %02X, %02X\n", space.device() .safe_pc( ), offset, data );
switch( offset )
{
@@ -1416,7 +1416,7 @@ DEVICE_IMAGE_LOAD( pokemini_cart )
static TIMER_CALLBACK( pokemini_prc_counter_callback )
{
pokemini_state *state = machine.driver_data<pokemini_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
state->m_prc.count++;
/* Check for overflow */
@@ -1440,7 +1440,7 @@ static TIMER_CALLBACK( pokemini_prc_counter_callback )
UINT8 tile = state->m_p_ram[ 0x360 + ( y * state->m_prc.map_size_x ) + x ];
int i;
for( i = 0; i < 8; i++ ) {
- state->m_p_ram[ ( y * 96 ) + ( x * 8 ) + i ] = space->read_byte( state->m_prc.bg_tiles + ( tile * 8 ) + i );
+ state->m_p_ram[ ( y * 96 ) + ( x * 8 ) + i ] = space.read_byte( state->m_prc.bg_tiles + ( tile * 8 ) + i );
}
}
}
@@ -1471,8 +1471,8 @@ static TIMER_CALLBACK( pokemini_prc_counter_callback )
int rel_x = ( spr_flag & 0x01 ) ? 15 - i : i;
UINT32 s = spr_base + ( ( rel_x & 0x08 ) << 2 ) + ( rel_x & 0x07 );
- mask = ~ ( space->read_byte( s ) | ( space->read_byte( s + 8 ) << 8 ) );
- gfx = space->read_byte( s + 16 ) | ( space->read_byte( s + 24 ) << 8 );
+ mask = ~ ( space.read_byte( s ) | ( space.read_byte( s + 8 ) << 8 ) );
+ gfx = space.read_byte( s + 16 ) | ( space.read_byte( s + 24 ) << 8 );
/* Are the colors inverted? */
if ( spr_flag & 0x04 )
diff --git a/src/mess/machine/poly88.c b/src/mess/machine/poly88.c
index 2174bb7ee31..30533997c0d 100644
--- a/src/mess/machine/poly88.c
+++ b/src/mess/machine/poly88.c
@@ -258,7 +258,7 @@ WRITE8_MEMBER(poly88_state::poly88_intr_w)
SNAPSHOT_LOAD( poly88 )
{
- address_space *space = image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *image.device().machine().device("maincpu")->memory().space(AS_PROGRAM);
UINT8* data= auto_alloc_array(image.device().machine(), UINT8, snapshot_size);
UINT16 recordNum;
UINT16 recordLen;
@@ -290,7 +290,7 @@ SNAPSHOT_LOAD( poly88 )
switch(recordType) {
case 0 :
/* 00 Absolute */
- memcpy(space->get_read_ptr(address ), data + pos ,recordLen);
+ memcpy(space.get_read_ptr(address ), data + pos ,recordLen);
break;
case 1 :
/* 01 Comment */
diff --git a/src/mess/machine/pp01.c b/src/mess/machine/pp01.c
index c6e98560f84..c34f91aecf4 100644
--- a/src/mess/machine/pp01.c
+++ b/src/mess/machine/pp01.c
@@ -85,7 +85,7 @@ static void pp01_set_memory(running_machine &machine,UINT8 block, UINT8 data)
{
pp01_state *state = machine.driver_data<pp01_state>();
UINT8 *mem = state->memregion("maincpu")->base();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT16 startaddr = block*0x1000;
UINT16 endaddr = ((block+1)*0x1000)-1;
UINT8 blocknum = block + 1;
@@ -93,40 +93,40 @@ static void pp01_set_memory(running_machine &machine,UINT8 block, UINT8 data)
sprintf(bank,"bank%d",blocknum);
if (data>=0xE0 && data<=0xEF) {
// This is RAM
- space->install_read_bank (startaddr, endaddr, bank);
+ space.install_read_bank (startaddr, endaddr, bank);
switch(data) {
case 0xe6 :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_1_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_1_w),state));
break;
case 0xe7 :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_2_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_r_2_w),state));
break;
case 0xea :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_1_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_1_w),state));
break;
case 0xeb :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_2_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_g_2_w),state));
break;
case 0xee :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_1_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_1_w),state));
break;
case 0xef :
- space->install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_2_w),state));
+ space.install_write_handler(startaddr, endaddr, write8_delegate(FUNC(pp01_state::pp01_video_b_2_w),state));
break;
default :
- space->install_write_bank(startaddr, endaddr, bank);
+ space.install_write_bank(startaddr, endaddr, bank);
break;
}
state->membank(bank)->set_base(machine.device<ram_device>(RAM_TAG)->pointer() + (data & 0x0F)* 0x1000);
} else if (data>=0xF8) {
- space->install_read_bank (startaddr, endaddr, bank);
- space->unmap_write(startaddr, endaddr);
+ space.install_read_bank (startaddr, endaddr, bank);
+ space.unmap_write(startaddr, endaddr);
state->membank(bank)->set_base(mem + ((data & 0x0F)-8)* 0x1000+0x10000);
} else {
logerror("%02x %02x\n",block,data);
- space->unmap_readwrite (startaddr, endaddr);
+ space.unmap_readwrite (startaddr, endaddr);
}
}
diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c
index 275a4570cab..f30cd7011c5 100644
--- a/src/mess/machine/primo.c
+++ b/src/mess/machine/primo.c
@@ -47,23 +47,23 @@ INTERRUPT_GEN( primo_vblank_interrupt )
static void primo_update_memory(running_machine &machine)
{
primo_state *state = machine.driver_data<primo_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch (state->m_port_FD & 0x03)
{
case 0x00: /* Original ROM */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()+0x10000);
break;
case 0x01: /* EPROM extension 1 */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base()+0x14000);
break;
case 0x02: /* RAM */
- space->install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
state->membank("bank1")->set_base(machine.root_device().memregion("maincpu")->base());
break;
case 0x03: /* EPROM extension 2 */
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
state->membank("bank1")->set_base(state->memregion("maincpu")->base()+0x18000);
break;
}
diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c
index 21f57829315..01b7e70d555 100644
--- a/src/mess/machine/radio86.c
+++ b/src/mess/machine/radio86.c
@@ -140,8 +140,8 @@ static WRITE_LINE_DEVICE_HANDLER( hrq_w )
i8257_hlda_w(device, state);
}
-static UINT8 memory_read_byte(address_space *space, offs_t address) { return space->read_byte(address); }
-static void memory_write_byte(address_space *space, offs_t address, UINT8 data) { space->write_byte(address, data); }
+static UINT8 memory_read_byte(address_space &space, offs_t address) { return space.read_byte(address); }
+static void memory_write_byte(address_space &space, offs_t address, UINT8 data) { space.write_byte(address, data); }
I8257_INTERFACE( radio86_dma )
{
diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c
index e3ff3805861..b406b89c9b7 100644
--- a/src/mess/machine/rmnimbus.c
+++ b/src/mess/machine/rmnimbus.c
@@ -1346,10 +1346,10 @@ static void nimbus_debug(running_machine &machine, int ref, int params, const ch
static int instruction_hook(device_t &device, offs_t curpc)
{
rmnimbus_state *state = device.machine().driver_data<rmnimbus_state>();
- address_space *space = device.memory().space(AS_PROGRAM);
+ address_space &space = *device.memory().space(AS_PROGRAM);
UINT8 *addr_ptr;
- addr_ptr = (UINT8*)space->get_read_ptr(curpc);
+ addr_ptr = (UINT8*)space.get_read_ptr(curpc);
if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD))
{
@@ -1713,19 +1713,19 @@ static void decode_subbios(device_t *device,offs_t pc, UINT8 raw_flag)
}
}
-static void *get_dssi_ptr(address_space *space, UINT16 ds, UINT16 si)
+static void *get_dssi_ptr(address_space &space, UINT16 ds, UINT16 si)
{
int addr;
addr=((ds<<4)+si);
// OUTPUT_SEGOFS("DS:SI",ds,si);
- return space->get_read_ptr(addr);
+ return space.get_read_ptr(addr);
}
static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *params;
int count;
@@ -1743,7 +1743,7 @@ static void decode_dssi_generic(device_t *device,UINT16 ds, UINT16 si, UINT8 ra
static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *addr_ptr;
t_area_params *area_params;
@@ -1755,7 +1755,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT
if (!raw_flag)
OUTPUT_SEGOFS("SegBrush:OfsBrush",area_params->seg_brush,area_params->ofs_brush);
- brush=(t_nimbus_brush *)space->get_read_ptr(LINEAR_ADDR(area_params->seg_brush,area_params->ofs_brush));
+ brush=(t_nimbus_brush *)space.get_read_ptr(LINEAR_ADDR(area_params->seg_brush,area_params->ofs_brush));
if(raw_flag)
{
@@ -1776,7 +1776,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT
OUTPUT_SEGOFS("SegData:OfsData",area_params->seg_data,area_params->ofs_data);
}
- addr_ptr = (UINT16 *)space->get_read_ptr(LINEAR_ADDR(area_params->seg_data,area_params->ofs_data));
+ addr_ptr = (UINT16 *)space.get_read_ptr(LINEAR_ADDR(area_params->seg_data,area_params->ofs_data));
for(cocount=0; cocount < area_params->count; cocount++)
{
if(raw_flag)
@@ -1796,7 +1796,7 @@ static void decode_dssi_f_fill_area(device_t *device,UINT16 ds, UINT16 si, UINT
static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT8 *char_ptr;
t_plot_string_params *plot_string_params;
@@ -1812,7 +1812,7 @@ static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UIN
logerror("x=%d, y=%d, length=%d\n",plot_string_params->x,plot_string_params->y,plot_string_params->length);
- char_ptr=(UINT8*)space->get_read_ptr(LINEAR_ADDR(plot_string_params->seg_data,plot_string_params->ofs_data));
+ char_ptr=(UINT8*)space.get_read_ptr(LINEAR_ADDR(plot_string_params->seg_data,plot_string_params->ofs_data));
if (plot_string_params->length==0xFFFF)
logerror("%s",char_ptr);
@@ -1825,7 +1825,7 @@ static void decode_dssi_f_plot_character_string(device_t *device,UINT16 ds, UIN
static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *new_colours;
int colour;
new_colours=(UINT16 *)get_dssi_ptr(space,ds,si);
@@ -1842,7 +1842,7 @@ static void decode_dssi_f_set_new_clt(device_t *device,UINT16 ds, UINT16 si, UI
static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *params;
params=(UINT16 *)get_dssi_ptr(space,ds,si);
@@ -1856,7 +1856,7 @@ static void decode_dssi_f_plonk_char(device_t *device,UINT16 ds, UINT16 si, UIN
static void decode_dssi_f_rw_sectors(device_t *device,UINT16 ds, UINT16 si, UINT8 raw_flag)
{
- address_space *space = device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
+ address_space &space = *device->machine().device(MAINCPU_TAG)->memory().space(AS_PROGRAM);
UINT16 *params;
int param_no;
@@ -1992,7 +1992,7 @@ static const nimbus_blocks ramblocks[] =
static void nimbus_bank_memory(running_machine &machine)
{
rmnimbus_state *state = machine.driver_data<rmnimbus_state>();
- address_space *space = machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( MAINCPU_TAG)->memory().space( AS_PROGRAM );
int ramsize = machine.device<ram_device>(RAM_TAG)->size();
int ramblock = 0;
int blockno;
@@ -2049,12 +2049,12 @@ static void nimbus_bank_memory(running_machine &machine)
map_base=(ramsel==0x07) ? map_blocks[map_blockno] : &map_blocks[map_blockno][block_ofs*1024];
state->membank(bank)->set_base(map_base);
- space->install_readwrite_bank(memmap[blockno].start, memmap[blockno].end, bank);
+ space.install_readwrite_bank(memmap[blockno].start, memmap[blockno].end, bank);
//if(LOG_RAM) logerror(", base=%X\n",(int)map_base);
}
else
{
- space->nop_readwrite(memmap[blockno].start, memmap[blockno].end);
+ space.nop_readwrite(memmap[blockno].start, memmap[blockno].end);
if(LOG_RAM) logerror("NOP\n");
}
}
diff --git a/src/mess/machine/s3c44b0.c b/src/mess/machine/s3c44b0.c
index a23d564936f..c27f92e5170 100644
--- a/src/mess/machine/s3c44b0.c
+++ b/src/mess/machine/s3c44b0.c
@@ -2001,10 +2001,10 @@ SCREEN_UPDATE_RGB32( s3c44b0 )
DEVICE_START( s3c44b0 )
{
running_machine &machine = device->machine();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM);
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM);
s3c44b0_t *s3c44b0 = get_token( device);
s3c44b0->iface = (const s3c44b0_interface *)device->static_config();
- s3c44b0->space = space;
+ s3c44b0->space = &space;
s3c44b0->cpu = downcast<cpu_device *>(device->machine().device( "maincpu"));
for (int i = 0; i < 6; i++) s3c44b0->pwm.timer[i] = machine.scheduler().timer_alloc(FUNC(s3c44b0_pwm_timer_exp), (void*)device);
for (int i = 0; i < 2; i++) s3c44b0->uart[i].timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_uart_timer_exp), (void*)device);
@@ -2016,23 +2016,23 @@ DEVICE_START( s3c44b0 )
s3c44b0->adc.timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_adc_timer_exp), (void*)device);
s3c44b0->iic.timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_iic_timer_exp), (void*)device);
s3c44b0->iis.timer = machine.scheduler().timer_alloc(FUNC(s3c44b0_iis_timer_exp), (void*)device);
- space->install_legacy_readwrite_handler( *device, 0x01c00000, 0x01c0000b, 0, 0, FUNC(s3c44b0_cpuwrap_r), FUNC(s3c44b0_cpuwrap_w));
- space->install_legacy_readwrite_handler( *device, 0x01d00000, 0x01d0002b, 0, 0, FUNC(s3c44b0_uart_0_r), FUNC(s3c44b0_uart_0_w));
- space->install_legacy_readwrite_handler( *device, 0x01d04000, 0x01d0402b, 0, 0, FUNC(s3c44b0_uart_1_r), FUNC(s3c44b0_uart_1_w));
- space->install_legacy_readwrite_handler( *device, 0x01d14000, 0x01d14013, 0, 0, FUNC(s3c44b0_sio_r), FUNC(s3c44b0_sio_w));
- space->install_legacy_readwrite_handler( *device, 0x01d18000, 0x01d18013, 0, 0, FUNC(s3c44b0_iis_r), FUNC(s3c44b0_iis_w));
- space->install_legacy_readwrite_handler( *device, 0x01d20000, 0x01d20057, 0, 0, FUNC(s3c44b0_gpio_r), FUNC(s3c44b0_gpio_w));
- space->install_legacy_readwrite_handler( *device, 0x01d30000, 0x01d3000b, 0, 0, FUNC(s3c44b0_wdt_r), FUNC(s3c44b0_wdt_w));
- space->install_legacy_readwrite_handler( *device, 0x01d40000, 0x01d4000b, 0, 0, FUNC(s3c44b0_adc_r), FUNC(s3c44b0_adc_w));
- space->install_legacy_readwrite_handler( *device, 0x01d50000, 0x01d5004f, 0, 0, FUNC(s3c44b0_pwm_r), FUNC(s3c44b0_pwm_w));
- space->install_legacy_readwrite_handler( *device, 0x01d60000, 0x01d6000f, 0, 0, FUNC(s3c44b0_iic_r), FUNC(s3c44b0_iic_w));
- space->install_legacy_readwrite_handler( *device, 0x01d80000, 0x01d8000f, 0, 0, FUNC(s3c44b0_clkpow_r), FUNC(s3c44b0_clkpow_w));
- space->install_legacy_readwrite_handler( *device, 0x01e00000, 0x01e0003f, 0, 0, FUNC(s3c44b0_irq_r), FUNC(s3c44b0_irq_w));
- space->install_legacy_readwrite_handler( *device, 0x01e80000, 0x01e8001b, 0, 0, FUNC(s3c44b0_zdma_0_r), FUNC(s3c44b0_zdma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x01e80020, 0x01e8003b, 0, 0, FUNC(s3c44b0_zdma_1_r), FUNC(s3c44b0_zdma_1_w));
- space->install_legacy_readwrite_handler( *device, 0x01f00000, 0x01f00047, 0, 0, FUNC(s3c44b0_lcd_r), FUNC(s3c44b0_lcd_w));
- space->install_legacy_readwrite_handler( *device, 0x01f80000, 0x01f8001b, 0, 0, FUNC(s3c44b0_bdma_0_r), FUNC(s3c44b0_bdma_0_w));
- space->install_legacy_readwrite_handler( *device, 0x01f80020, 0x01f8003b, 0, 0, FUNC(s3c44b0_bdma_1_r), FUNC(s3c44b0_bdma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x01c00000, 0x01c0000b, 0, 0, FUNC(s3c44b0_cpuwrap_r), FUNC(s3c44b0_cpuwrap_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d00000, 0x01d0002b, 0, 0, FUNC(s3c44b0_uart_0_r), FUNC(s3c44b0_uart_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d04000, 0x01d0402b, 0, 0, FUNC(s3c44b0_uart_1_r), FUNC(s3c44b0_uart_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d14000, 0x01d14013, 0, 0, FUNC(s3c44b0_sio_r), FUNC(s3c44b0_sio_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d18000, 0x01d18013, 0, 0, FUNC(s3c44b0_iis_r), FUNC(s3c44b0_iis_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d20000, 0x01d20057, 0, 0, FUNC(s3c44b0_gpio_r), FUNC(s3c44b0_gpio_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d30000, 0x01d3000b, 0, 0, FUNC(s3c44b0_wdt_r), FUNC(s3c44b0_wdt_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d40000, 0x01d4000b, 0, 0, FUNC(s3c44b0_adc_r), FUNC(s3c44b0_adc_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d50000, 0x01d5004f, 0, 0, FUNC(s3c44b0_pwm_r), FUNC(s3c44b0_pwm_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d60000, 0x01d6000f, 0, 0, FUNC(s3c44b0_iic_r), FUNC(s3c44b0_iic_w));
+ space.install_legacy_readwrite_handler( *device, 0x01d80000, 0x01d8000f, 0, 0, FUNC(s3c44b0_clkpow_r), FUNC(s3c44b0_clkpow_w));
+ space.install_legacy_readwrite_handler( *device, 0x01e00000, 0x01e0003f, 0, 0, FUNC(s3c44b0_irq_r), FUNC(s3c44b0_irq_w));
+ space.install_legacy_readwrite_handler( *device, 0x01e80000, 0x01e8001b, 0, 0, FUNC(s3c44b0_zdma_0_r), FUNC(s3c44b0_zdma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x01e80020, 0x01e8003b, 0, 0, FUNC(s3c44b0_zdma_1_r), FUNC(s3c44b0_zdma_1_w));
+ space.install_legacy_readwrite_handler( *device, 0x01f00000, 0x01f00047, 0, 0, FUNC(s3c44b0_lcd_r), FUNC(s3c44b0_lcd_w));
+ space.install_legacy_readwrite_handler( *device, 0x01f80000, 0x01f8001b, 0, 0, FUNC(s3c44b0_bdma_0_r), FUNC(s3c44b0_bdma_0_w));
+ space.install_legacy_readwrite_handler( *device, 0x01f80020, 0x01f8003b, 0, 0, FUNC(s3c44b0_bdma_1_r), FUNC(s3c44b0_bdma_1_w));
}
const device_type S3C44B0 = &device_creator<s3c44b0_device>;
diff --git a/src/mess/machine/samcoupe.c b/src/mess/machine/samcoupe.c
index bedd0fef7ec..49fd966fa43 100644
--- a/src/mess/machine/samcoupe.c
+++ b/src/mess/machine/samcoupe.c
@@ -22,42 +22,42 @@
MEMORY BANKING
***************************************************************************/
-static void samcoupe_update_bank(address_space *space, int bank_num, UINT8 *memory, int is_readonly)
+static void samcoupe_update_bank(address_space &space, int bank_num, UINT8 *memory, int is_readonly)
{
char bank[10];
sprintf(bank,"bank%d",bank_num);
- samcoupe_state *state = space->machine().driver_data<samcoupe_state>();
+ samcoupe_state *state = space.machine().driver_data<samcoupe_state>();
if (memory)
{
state->membank(bank)->set_base(memory);
- space->install_read_bank (((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
+ space.install_read_bank (((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
if (is_readonly) {
- space->unmap_write(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
+ space.unmap_write(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
} else {
- space->install_write_bank(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
+ space.install_write_bank(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF, bank);
}
} else {
- space->nop_readwrite(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
+ space.nop_readwrite(((bank_num-1) * 0x4000), ((bank_num-1) * 0x4000) + 0x3FFF);
}
}
-static void samcoupe_install_ext_mem(address_space *space)
+static void samcoupe_install_ext_mem(address_space &space)
{
- samcoupe_state *state = space->machine().driver_data<samcoupe_state>();
+ samcoupe_state *state = space.machine().driver_data<samcoupe_state>();
UINT8 *mem;
/* bank 3 */
- if (state->m_lext >> 6 < space->machine().device<ram_device>(RAM_TAG)->size() >> 20)
- mem = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(space->machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_lext >> 6) * 0x100000 + (state->m_lext & 0x3f) * 0x4000];
+ if (state->m_lext >> 6 < space.machine().device<ram_device>(RAM_TAG)->size() >> 20)
+ mem = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(space.machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_lext >> 6) * 0x100000 + (state->m_lext & 0x3f) * 0x4000];
else
mem = NULL;
samcoupe_update_bank(space, 3, mem, FALSE);
/* bank 4 */
- if (state->m_hext >> 6 < space->machine().device<ram_device>(RAM_TAG)->size() >> 20)
- mem = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(space->machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_hext >> 6) * 0x100000 + (state->m_hext & 0x3f) * 0x4000];
+ if (state->m_hext >> 6 < space.machine().device<ram_device>(RAM_TAG)->size() >> 20)
+ mem = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(space.machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) + (state->m_hext >> 6) * 0x100000 + (state->m_hext & 0x3f) * 0x4000];
else
mem = NULL;
@@ -65,10 +65,10 @@ static void samcoupe_install_ext_mem(address_space *space)
}
-void samcoupe_update_memory(address_space *space)
+void samcoupe_update_memory(address_space &space)
{
- samcoupe_state *state = space->machine().driver_data<samcoupe_state>();
- const int PAGE_MASK = ((space->machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) / 0x4000) - 1;
+ samcoupe_state *state = space.machine().driver_data<samcoupe_state>();
+ const int PAGE_MASK = ((space.machine().device<ram_device>(RAM_TAG)->size() & 0xfffff) / 0x4000) - 1;
UINT8 *rom = state->memregion("maincpu")->base();
UINT8 *memory;
int is_readonly;
@@ -77,7 +77,7 @@ void samcoupe_update_memory(address_space *space)
if (state->m_lmpr & LMPR_RAM0) /* Is ram paged in at bank 1 */
{
if ((state->m_lmpr & 0x1F) <= PAGE_MASK)
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_lmpr & PAGE_MASK) * 0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_lmpr & PAGE_MASK) * 0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
is_readonly = FALSE;
@@ -92,7 +92,7 @@ void samcoupe_update_memory(address_space *space)
/* BANK2 */
if (((state->m_lmpr + 1) & 0x1f) <= PAGE_MASK)
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_lmpr + 1) & PAGE_MASK) * 0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_lmpr + 1) & PAGE_MASK) * 0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
samcoupe_update_bank(space, 2, memory, FALSE);
@@ -106,7 +106,7 @@ void samcoupe_update_memory(address_space *space)
{
/* BANK3 */
if ((state->m_hmpr & 0x1F) <= PAGE_MASK )
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_hmpr & PAGE_MASK)*0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[(state->m_hmpr & PAGE_MASK)*0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
samcoupe_update_bank(space, 3, memory, FALSE);
@@ -121,7 +121,7 @@ void samcoupe_update_memory(address_space *space)
else
{
if (((state->m_hmpr + 1) & 0x1f) <= PAGE_MASK)
- memory = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_hmpr + 1) & PAGE_MASK) * 0x4000];
+ memory = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_hmpr + 1) & PAGE_MASK) * 0x4000];
else
memory = NULL; /* Attempt to page in non existant ram region */
is_readonly = FALSE;
@@ -131,15 +131,15 @@ void samcoupe_update_memory(address_space *space)
/* video memory location */
if (state->m_vmpr & 0x40) /* if bit set in 2 bank screen mode */
- state->m_videoram = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1e) & PAGE_MASK) * 0x4000];
+ state->m_videoram = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1e) & PAGE_MASK) * 0x4000];
else
- state->m_videoram = &space->machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1f) & PAGE_MASK) * 0x4000];
+ state->m_videoram = &space.machine().device<ram_device>(RAM_TAG)->pointer()[((state->m_vmpr & 0x1f) & PAGE_MASK) * 0x4000];
}
WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w)
{
- address_space *space_program = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space_program = *machine().device("maincpu")->memory().space(AS_PROGRAM);
if (offset & 1)
m_hext = data;
@@ -160,17 +160,17 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w)
static READ8_DEVICE_HANDLER( samcoupe_rtc_r )
{
- address_space *spaceio = device->machine().device("maincpu")->memory().space(AS_IO);
+ address_space &spaceio = *device->machine().device("maincpu")->memory().space(AS_IO);
msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
- return rtc->read(*spaceio,offset >> 12);
+ return rtc->read(spaceio,offset >> 12);
}
static WRITE8_DEVICE_HANDLER( samcoupe_rtc_w )
{
- address_space *spaceio = device->machine().device("maincpu")->memory().space(AS_IO);
+ address_space &spaceio = *device->machine().device("maincpu")->memory().space(AS_IO);
msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
- rtc->write(*spaceio,offset >> 12, data);
+ rtc->write(spaceio,offset >> 12, data);
}
@@ -244,8 +244,8 @@ void samcoupe_state::machine_start()
void samcoupe_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
- address_space *spaceio = machine().device("maincpu")->memory().space(AS_IO);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &spaceio = *machine().device("maincpu")->memory().space(AS_IO);
/* initialize state */
m_lmpr = 0x0f; /* ROM0 paged in, ROM1 paged out RAM Banks */
@@ -263,12 +263,12 @@ void samcoupe_state::machine_reset()
{
/* install RTC */
device_t *rtc = machine().device("sambus_clock");
- spaceio->install_legacy_readwrite_handler(*rtc, 0xef, 0xef, 0xffff, 0xff00, FUNC(samcoupe_rtc_r), FUNC(samcoupe_rtc_w));
+ spaceio.install_legacy_readwrite_handler(*rtc, 0xef, 0xef, 0xffff, 0xff00, FUNC(samcoupe_rtc_r), FUNC(samcoupe_rtc_w));
}
else
{
/* no RTC support */
- spaceio->unmap_readwrite(0xef, 0xef, 0xffff, 0xff00);
+ spaceio.unmap_readwrite(0xef, 0xef, 0xffff, 0xff00);
}
/* initialize memory */
diff --git a/src/mess/machine/sgi.c b/src/mess/machine/sgi.c
index bf4e9611a62..4f439ccb856 100644
--- a/src/mess/machine/sgi.c
+++ b/src/mess/machine/sgi.c
@@ -78,181 +78,181 @@ READ32_HANDLER( sgi_mc_r )
{
case 0x0000:
case 0x0004:
- //verboselog( space->machine(), 3, "CPU Control 0 Read: %08x (%08x)\n", pMC->nCPUControl0, mem_mask );
+ //verboselog( space.machine(), 3, "CPU Control 0 Read: %08x (%08x)\n", pMC->nCPUControl0, mem_mask );
return pMC->nCPUControl0;
case 0x0008:
case 0x000c:
- //verboselog( space->machine(), 2, "CPU Control 1 Read: %08x (%08x)\n", pMC->nCPUControl1, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Control 1 Read: %08x (%08x)\n", pMC->nCPUControl1, mem_mask );
return pMC->nCPUControl1;
case 0x0010:
case 0x0014:
- //verboselog( space->machine(), 2, "Watchdog Timer Read: %08x (%08x)\n", pMC->nWatchdog, mem_mask );
+ //verboselog( space.machine(), 2, "Watchdog Timer Read: %08x (%08x)\n", pMC->nWatchdog, mem_mask );
return pMC->nWatchdog;
case 0x0018:
case 0x001c:
- //verboselog( space->machine(), 2, "System ID Read: %08x (%08x)\n", pMC->nSysID, mem_mask );
+ //verboselog( space.machine(), 2, "System ID Read: %08x (%08x)\n", pMC->nSysID, mem_mask );
return pMC->nSysID;
case 0x0028:
case 0x002c:
- //verboselog( space->machine(), 2, "RPSS Divider Read: %08x (%08x)\n", pMC->nRPSSDiv, mem_mask );
+ //verboselog( space.machine(), 2, "RPSS Divider Read: %08x (%08x)\n", pMC->nRPSSDiv, mem_mask );
return pMC->nRPSSDiv;
case 0x0030:
case 0x0034:
- //verboselog( space->machine(), 2, "R4000 EEPROM Read\n" );
+ //verboselog( space.machine(), 2, "R4000 EEPROM Read\n" );
return 0;
case 0x0040:
case 0x0044:
- //verboselog( space->machine(), 2, "Refresh Count Preload Read: %08x (%08x)\n", pMC->nRefCntPreload, mem_mask );
+ //verboselog( space.machine(), 2, "Refresh Count Preload Read: %08x (%08x)\n", pMC->nRefCntPreload, mem_mask );
return pMC->nRefCntPreload;
case 0x0048:
case 0x004c:
- //verboselog( space->machine(), 2, "Refresh Count Read: %08x (%08x)\n", pMC->nRefCnt, mem_mask );
+ //verboselog( space.machine(), 2, "Refresh Count Read: %08x (%08x)\n", pMC->nRefCnt, mem_mask );
return pMC->nRefCnt;
case 0x0080:
case 0x0084:
- //verboselog( space->machine(), 2, "GIO64 Arbitration Param Read: %08x (%08x)\n", pMC->nGIO64ArbParam, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Arbitration Param Read: %08x (%08x)\n", pMC->nGIO64ArbParam, mem_mask );
return pMC->nGIO64ArbParam;
case 0x0088:
case 0x008c:
- //verboselog( space->machine(), 2, "Arbiter CPU Time Read: %08x (%08x)\n", pMC->nArbCPUTime, mem_mask );
+ //verboselog( space.machine(), 2, "Arbiter CPU Time Read: %08x (%08x)\n", pMC->nArbCPUTime, mem_mask );
return pMC->nArbCPUTime;
case 0x0098:
case 0x009c:
- //verboselog( space->machine(), 2, "Arbiter Long Burst Time Read: %08x (%08x)\n", pMC->nArbBurstTime, mem_mask );
+ //verboselog( space.machine(), 2, "Arbiter Long Burst Time Read: %08x (%08x)\n", pMC->nArbBurstTime, mem_mask );
return pMC->nArbBurstTime;
case 0x00c0:
case 0x00c4:
- //verboselog( space->machine(), 3, "Memory Configuration Register 0 Read: %08x (%08x)\n", pMC->nMemCfg0, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 0 Read: %08x (%08x)\n", pMC->nMemCfg0, mem_mask );
return pMC->nMemCfg0;
case 0x00c8:
case 0x00cc:
- //verboselog( space->machine(), 3, "Memory Configuration Register 1 Read: %08x (%08x)\n", pMC->nMemCfg1, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 1 Read: %08x (%08x)\n", pMC->nMemCfg1, mem_mask );
return pMC->nMemCfg1;
case 0x00d0:
case 0x00d4:
- //verboselog( space->machine(), 2, "CPU Memory Access Config Params Read: %08x (%08x)\n", pMC->nCPUMemAccCfg, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Memory Access Config Params Read: %08x (%08x)\n", pMC->nCPUMemAccCfg, mem_mask );
return pMC->nCPUMemAccCfg;
case 0x00d8:
case 0x00dc:
- //verboselog( space->machine(), 2, "GIO Memory Access Config Params Read: %08x (%08x)\n", pMC->nGIOMemAccCfg, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Memory Access Config Params Read: %08x (%08x)\n", pMC->nGIOMemAccCfg, mem_mask );
return pMC->nGIOMemAccCfg;
case 0x00e0:
case 0x00e4:
- //verboselog( space->machine(), 2, "CPU Error Address Read: %08x (%08x)\n", pMC->nCPUErrorAddr, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Error Address Read: %08x (%08x)\n", pMC->nCPUErrorAddr, mem_mask );
return pMC->nCPUErrorAddr;
case 0x00e8:
case 0x00ec:
- //verboselog( space->machine(), 2, "CPU Error Status Read: %08x (%08x)\n", pMC->nCPUErrorStatus, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Error Status Read: %08x (%08x)\n", pMC->nCPUErrorStatus, mem_mask );
return pMC->nCPUErrorStatus;
case 0x00f0:
case 0x00f4:
- //verboselog( space->machine(), 2, "GIO Error Address Read: %08x (%08x)\n", pMC->nGIOErrorAddr, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Error Address Read: %08x (%08x)\n", pMC->nGIOErrorAddr, mem_mask );
return pMC->nGIOErrorAddr;
case 0x00f8:
case 0x00fc:
- //verboselog( space->machine(), 2, "GIO Error Status Read: %08x (%08x)\n", pMC->nGIOErrorStatus, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Error Status Read: %08x (%08x)\n", pMC->nGIOErrorStatus, mem_mask );
return pMC->nGIOErrorStatus;
case 0x0100:
case 0x0104:
- //verboselog( space->machine(), 2, "System Semaphore Read: %08x (%08x)\n", pMC->nSysSemaphore, mem_mask );
+ //verboselog( space.machine(), 2, "System Semaphore Read: %08x (%08x)\n", pMC->nSysSemaphore, mem_mask );
return pMC->nSysSemaphore;
case 0x0108:
case 0x010c:
- //verboselog( space->machine(), 2, "GIO Lock Read: %08x (%08x)\n", pMC->nGIOLock, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Lock Read: %08x (%08x)\n", pMC->nGIOLock, mem_mask );
return pMC->nGIOLock;
case 0x0110:
case 0x0114:
- //verboselog( space->machine(), 2, "EISA Lock Read: %08x (%08x)\n", pMC->nEISALock, mem_mask );
+ //verboselog( space.machine(), 2, "EISA Lock Read: %08x (%08x)\n", pMC->nEISALock, mem_mask );
return pMC->nEISALock;
case 0x0150:
case 0x0154:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Mask Read: %08x (%08x)\n", pMC->nGIO64TransMask, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Mask Read: %08x (%08x)\n", pMC->nGIO64TransMask, mem_mask );
return pMC->nGIO64TransMask;
case 0x0158:
case 0x015c:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Substitution Bits Read: %08x (%08x)\n", pMC->nGIO64Subst, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Substitution Bits Read: %08x (%08x)\n", pMC->nGIO64Subst, mem_mask );
return pMC->nGIO64Subst;
case 0x0160:
case 0x0164:
- //verboselog( space->machine(), 2, "DMA Interrupt Cause: %08x (%08x)\n", pMC->nDMAIntrCause, mem_mask );
+ //verboselog( space.machine(), 2, "DMA Interrupt Cause: %08x (%08x)\n", pMC->nDMAIntrCause, mem_mask );
return pMC->nDMAIntrCause;
case 0x0168:
case 0x016c:
- //verboselog( space->machine(), 2, "DMA Control Read: %08x (%08x)\n", pMC->nDMAControl, mem_mask );
+ //verboselog( space.machine(), 2, "DMA Control Read: %08x (%08x)\n", pMC->nDMAControl, mem_mask );
return pMC->nDMAControl;
case 0x0180:
case 0x0184:
- //verboselog( space->machine(), 2, "DMA TLB Entry 0 High Read: %08x (%08x)\n", pMC->nDMATLBEntry0Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 0 High Read: %08x (%08x)\n", pMC->nDMATLBEntry0Hi, mem_mask );
return pMC->nDMATLBEntry0Hi;
case 0x0188:
case 0x018c:
- //verboselog( space->machine(), 2, "DMA TLB Entry 0 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry0Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 0 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry0Lo, mem_mask );
return pMC->nDMATLBEntry0Lo;
case 0x0190:
case 0x0194:
- //verboselog( space->machine(), 2, "DMA TLB Entry 1 High Read: %08x (%08x)\n", pMC->nDMATLBEntry1Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 1 High Read: %08x (%08x)\n", pMC->nDMATLBEntry1Hi, mem_mask );
return pMC->nDMATLBEntry1Hi;
case 0x0198:
case 0x019c:
- //verboselog( space->machine(), 2, "DMA TLB Entry 1 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry1Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 1 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry1Lo, mem_mask );
return pMC->nDMATLBEntry1Lo;
case 0x01a0:
case 0x01a4:
- //verboselog( space->machine(), 2, "DMA TLB Entry 2 High Read: %08x (%08x)\n", pMC->nDMATLBEntry2Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 2 High Read: %08x (%08x)\n", pMC->nDMATLBEntry2Hi, mem_mask );
return pMC->nDMATLBEntry2Hi;
case 0x01a8:
case 0x01ac:
- //verboselog( space->machine(), 2, "DMA TLB Entry 2 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry2Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 2 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry2Lo, mem_mask );
return pMC->nDMATLBEntry2Lo;
case 0x01b0:
case 0x01b4:
- //verboselog( space->machine(), 2, "DMA TLB Entry 3 High Read: %08x (%08x)\n", pMC->nDMATLBEntry3Hi, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 3 High Read: %08x (%08x)\n", pMC->nDMATLBEntry3Hi, mem_mask );
return pMC->nDMATLBEntry3Hi;
case 0x01b8:
case 0x01bc:
- //verboselog( space->machine(), 2, "DMA TLB Entry 3 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry3Lo, mem_mask );
+ //verboselog( space.machine(), 2, "DMA TLB Entry 3 Low Read: %08x (%08x)\n", pMC->nDMATLBEntry3Lo, mem_mask );
return pMC->nDMATLBEntry3Lo;
case 0x1000:
case 0x1004:
- //verboselog( space->machine(), 2, "RPSS 100ns Counter Read: %08x (%08x)\n", pMC->nRPSSCounter, mem_mask );
+ //verboselog( space.machine(), 2, "RPSS 100ns Counter Read: %08x (%08x)\n", pMC->nRPSSCounter, mem_mask );
return pMC->nRPSSCounter;
case 0x2000:
case 0x2004:
case 0x2008:
case 0x200c:
- //verboselog( space->machine(), 0, "DMA Memory Address Read: %08x (%08x)\n", pMC->nDMAMemAddr, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Memory Address Read: %08x (%08x)\n", pMC->nDMAMemAddr, mem_mask );
return pMC->nDMAMemAddr;
case 0x2010:
case 0x2014:
- //verboselog( space->machine(), 0, "DMA Line Count and Width Read: %08x (%08x)\n", pMC->nDMALineCntWidth, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Count and Width Read: %08x (%08x)\n", pMC->nDMALineCntWidth, mem_mask );
return pMC->nDMALineCntWidth;
case 0x2018:
case 0x201c:
- //verboselog( space->machine(), 0, "DMA Line Zoom and Stride Read: %08x (%08x)\n", pMC->nDMALineZoomStride, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Zoom and Stride Read: %08x (%08x)\n", pMC->nDMALineZoomStride, mem_mask );
return pMC->nDMALineZoomStride;
case 0x2020:
case 0x2024:
case 0x2028:
case 0x202c:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Read: %08x (%08x)\n", pMC->nDMAGIO64Addr, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Read: %08x (%08x)\n", pMC->nDMAGIO64Addr, mem_mask );
return pMC->nDMAGIO64Addr;
case 0x2030:
case 0x2034:
- //verboselog( space->machine(), 0, "DMA Mode Write: %08x (%08x)\n", pMC->nDMAMode, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Mode Write: %08x (%08x)\n", pMC->nDMAMode, mem_mask );
return pMC->nDMAMode;
case 0x2038:
case 0x203c:
- //verboselog( space->machine(), 0, "DMA Zoom Count Read: %08x (%08x)\n", pMC->nDMAZoomByteCnt, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Zoom Count Read: %08x (%08x)\n", pMC->nDMAZoomByteCnt, mem_mask );
return pMC->nDMAZoomByteCnt;
// case 0x2040:
// case 0x2044:
-// //verboselog( space->machine(), 2, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
+// //verboselog( space.machine(), 2, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
// Start DMA
// pMC->nDMARunning = 1;
// break;
case 0x2048:
case 0x204c:
- //verboselog( space->machine(), 0, "VDMA Running Read: %08x (%08x)\n", pMC->nDMARunning, mem_mask );
+ //verboselog( space.machine(), 0, "VDMA Running Read: %08x (%08x)\n", pMC->nDMARunning, mem_mask );
if( pMC->nDMARunning == 1 )
{
pMC->nDMARunning = 0;
@@ -263,7 +263,7 @@ READ32_HANDLER( sgi_mc_r )
return 0;
}
}
- //verboselog( space->machine(), 0, "Unmapped MC read: 0x%08x (%08x)\n", 0x1fa00000 + offset, mem_mask );
+ //verboselog( space.machine(), 0, "Unmapped MC read: 0x%08x (%08x)\n", 0x1fa00000 + offset, mem_mask );
return 0;
}
@@ -274,210 +274,210 @@ WRITE32_HANDLER( sgi_mc_w )
{
case 0x0000:
case 0x0004:
- //verboselog( space->machine(), 2, "CPU Control 0 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Control 0 Write: %08x (%08x)\n", data, mem_mask );
pMC->nCPUControl0 = data;
break;
case 0x0008:
case 0x000c:
- //verboselog( space->machine(), 2, "CPU Control 1 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Control 1 Write: %08x (%08x)\n", data, mem_mask );
pMC->nCPUControl1 = data;
break;
case 0x0010:
case 0x0014:
- //verboselog( space->machine(), 2, "Watchdog Timer Clear" );
+ //verboselog( space.machine(), 2, "Watchdog Timer Clear" );
pMC->nWatchdog = 0;
break;
case 0x0028:
case 0x002c:
- //verboselog( space->machine(), 2, "RPSS Divider Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "RPSS Divider Write: %08x (%08x)\n", data, mem_mask );
pMC->nRPSSDiv = data;
break;
case 0x0030:
case 0x0034:
- //verboselog( space->machine(), 2, "R4000 EEPROM Write\n" );
+ //verboselog( space.machine(), 2, "R4000 EEPROM Write\n" );
break;
case 0x0040:
case 0x0044:
- //verboselog( space->machine(), 2, "Refresh Count Preload Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "Refresh Count Preload Write: %08x (%08x)\n", data, mem_mask );
pMC->nRefCntPreload = data;
break;
case 0x0080:
case 0x0084:
- //verboselog( space->machine(), 2, "GIO64 Arbitration Param Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Arbitration Param Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIO64ArbParam = data;
break;
case 0x0088:
case 0x008c:
- //verboselog( space->machine(), 3, "Arbiter CPU Time Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Arbiter CPU Time Write: %08x (%08x)\n", data, mem_mask );
pMC->nArbCPUTime = data;
break;
case 0x0098:
case 0x009c:
- //verboselog( space->machine(), 3, "Arbiter Long Burst Time Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Arbiter Long Burst Time Write: %08x (%08x)\n", data, mem_mask );
pMC->nArbBurstTime = data;
break;
case 0x00c0:
case 0x00c4:
- //verboselog( space->machine(), 3, "Memory Configuration Register 0 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 0 Write: %08x (%08x)\n", data, mem_mask );
pMC->nMemCfg0 = data;
break;
case 0x00c8:
case 0x00cc:
- //verboselog( space->machine(), 3, "Memory Configuration Register 1 Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 3, "Memory Configuration Register 1 Write: %08x (%08x)\n", data, mem_mask );
pMC->nMemCfg1 = data;
break;
case 0x00d0:
case 0x00d4:
- //verboselog( space->machine(), 2, "CPU Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "CPU Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
pMC->nCPUMemAccCfg = data;
break;
case 0x00d8:
case 0x00dc:
- //verboselog( space->machine(), 2, "GIO Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Memory Access Config Params Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIOMemAccCfg = data;
break;
case 0x00e8:
case 0x00ec:
- //verboselog( space->machine(), 2, "CPU Error Status Clear\n" );
+ //verboselog( space.machine(), 2, "CPU Error Status Clear\n" );
pMC->nCPUErrorStatus = 0;
break;
case 0x00f8:
case 0x00fc:
- //verboselog( space->machine(), 2, "GIO Error Status Clear\n" );
+ //verboselog( space.machine(), 2, "GIO Error Status Clear\n" );
pMC->nGIOErrorStatus = 0;
break;
case 0x0100:
case 0x0104:
- //verboselog( space->machine(), 2, "System Semaphore Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "System Semaphore Write: %08x (%08x)\n", data, mem_mask );
pMC->nSysSemaphore = data;
break;
case 0x0108:
case 0x010c:
- //verboselog( space->machine(), 2, "GIO Lock Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO Lock Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIOLock = data;
break;
case 0x0110:
case 0x0114:
- //verboselog( space->machine(), 2, "EISA Lock Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "EISA Lock Write: %08x (%08x)\n", data, mem_mask );
pMC->nEISALock = data;
break;
case 0x0150:
case 0x0154:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Mask Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Mask Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIO64TransMask = data;
break;
case 0x0158:
case 0x015c:
- //verboselog( space->machine(), 2, "GIO64 Translation Address Substitution Bits Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 2, "GIO64 Translation Address Substitution Bits Write: %08x (%08x)\n", data, mem_mask );
pMC->nGIO64Subst = data;
break;
case 0x0160:
case 0x0164:
- //verboselog( space->machine(), 0, "DMA Interrupt Cause Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Interrupt Cause Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAIntrCause = data;
break;
case 0x0168:
case 0x016c:
- //verboselog( space->machine(), 0, "DMA Control Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Control Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAControl = data;
break;
case 0x0180:
case 0x0184:
- //verboselog( space->machine(), 0, "DMA TLB Entry 0 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 0 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry0Hi = data;
break;
case 0x0188:
case 0x018c:
- //verboselog( space->machine(), 0, "DMA TLB Entry 0 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 0 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry0Lo = data;
break;
case 0x0190:
case 0x0194:
- //verboselog( space->machine(), 0, "DMA TLB Entry 1 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 1 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry1Hi = data;
break;
case 0x0198:
case 0x019c:
- //verboselog( space->machine(), 0, "DMA TLB Entry 1 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 1 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry1Lo = data;
break;
case 0x01a0:
case 0x01a4:
- //verboselog( space->machine(), 0, "DMA TLB Entry 2 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 2 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry2Hi = data;
break;
case 0x01a8:
case 0x01ac:
- //verboselog( space->machine(), 0, "DMA TLB Entry 2 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 2 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry2Lo = data;
break;
case 0x01b0:
case 0x01b4:
- //verboselog( space->machine(), 0, "DMA TLB Entry 3 High Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 3 High Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry3Hi = data;
break;
case 0x01b8:
case 0x01bc:
- //verboselog( space->machine(), 0, "DMA TLB Entry 3 Low Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA TLB Entry 3 Low Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMATLBEntry3Lo = data;
break;
case 0x2000:
case 0x2004:
- //verboselog( space->machine(), 0, "DMA Memory Address Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Memory Address Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAMemAddr = data;
break;
case 0x2008:
case 0x200c:
- //verboselog( space->machine(), 0, "DMA Memory Address + Default Params Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Memory Address + Default Params Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAMemAddr = data;
break;
case 0x2010:
case 0x2014:
- //verboselog( space->machine(), 0, "DMA Line Count and Width Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Count and Width Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMALineCntWidth = data;
break;
case 0x2018:
case 0x201c:
- //verboselog( space->machine(), 0, "DMA Line Zoom and Stride Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Line Zoom and Stride Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMALineZoomStride = data;
break;
case 0x2020:
case 0x2024:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAGIO64Addr = data;
break;
case 0x2028:
case 0x202c:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Write + Start DMA: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Write + Start DMA: %08x (%08x)\n", data, mem_mask );
pMC->nDMAGIO64Addr = data;
// Start DMA
pMC->nDMARunning = 1;
break;
case 0x2030:
case 0x2034:
- //verboselog( space->machine(), 0, "DMA Mode Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Mode Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAMode = data;
break;
case 0x2038:
case 0x203c:
- //verboselog( space->machine(), 0, "DMA Zoom Count + Byte Count Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Zoom Count + Byte Count Write: %08x (%08x)\n", data, mem_mask );
pMC->nDMAZoomByteCnt = data;
break;
case 0x2040:
case 0x2044:
- //verboselog( space->machine(), 0, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA Start Write: %08x (%08x)\n", data, mem_mask );
// Start DMA
pMC->nDMARunning = 1;
break;
case 0x2070:
case 0x2074:
- //verboselog( space->machine(), 0, "DMA GIO64 Address Write + Default Params Write + Start DMA: %08x (%08x)\n", data, mem_mask );
+ //verboselog( space.machine(), 0, "DMA GIO64 Address Write + Default Params Write + Start DMA: %08x (%08x)\n", data, mem_mask );
pMC->nDMAGIO64Addr = data;
// Start DMA
pMC->nDMARunning = 1;
break;
default:
- //verboselog( space->machine(), 0, "Unmapped MC write: 0x%08x: %08x (%08x)\n", 0x1fa00000 + offset, data, mem_mask );
+ //verboselog( space.machine(), 0, "Unmapped MC write: 0x%08x: %08x (%08x)\n", 0x1fa00000 + offset, data, mem_mask );
break;
}
}
diff --git a/src/mess/machine/sms.c b/src/mess/machine/sms.c
index 67081761ddc..5b71684f899 100644
--- a/src/mess/machine/sms.c
+++ b/src/mess/machine/sms.c
@@ -27,7 +27,7 @@
#define LGUN_X_INTERVAL 4
-static void setup_rom(address_space *space);
+static void setup_rom(address_space &space);
static TIMER_CALLBACK( rapid_fire_callback )
@@ -427,12 +427,12 @@ static UINT8 sms_vdp_hcount( running_machine &machine )
}
-static void sms_vdp_hcount_latch( address_space *space )
+static void sms_vdp_hcount_latch( address_space &space )
{
- sms_state *state = space->machine().driver_data<sms_state>();
- UINT8 value = sms_vdp_hcount(space->machine());
+ sms_state *state = space.machine().driver_data<sms_state>();
+ UINT8 value = sms_vdp_hcount(space.machine());
- state->m_vdp->hcount_latch_write(*space, 0, value);
+ state->m_vdp->hcount_latch_write(space, 0, value);
}
@@ -556,12 +556,12 @@ INPUT_CHANGED( lgun2_changed )
}
-static void sms_get_inputs( address_space *space )
+static void sms_get_inputs( address_space &space )
{
- sms_state *state = space->machine().driver_data<sms_state>();
+ sms_state *state = space.machine().driver_data<sms_state>();
UINT8 data = 0x00;
- UINT32 cpu_cycles = downcast<cpu_device *>(&space->device())->total_cycles();
- running_machine &machine = space->machine();
+ UINT32 cpu_cycles = downcast<cpu_device *>(&space.device())->total_cycles();
+ running_machine &machine = space.machine();
state->m_input_port0 = 0xff;
state->m_input_port1 = 0xff;
@@ -722,7 +722,7 @@ READ8_MEMBER(sms_state::sms_fm_detect_r)
}
else
{
- sms_get_inputs(&space);
+ sms_get_inputs(space);
return m_input_port0;
}
}
@@ -753,7 +753,7 @@ WRITE8_MEMBER(sms_state::sms_io_control_w)
if (hcount_latch)
{
- sms_vdp_hcount_latch(&space);
+ sms_vdp_hcount_latch(space);
}
m_ctrl_reg = data;
@@ -808,7 +808,7 @@ READ8_MEMBER(sms_state::sms_input_port_0_r)
}
else
{
- sms_get_inputs(&space);
+ sms_get_inputs(space);
return m_input_port0;
}
}
@@ -820,7 +820,7 @@ READ8_MEMBER(sms_state::sms_input_port_1_r)
if (m_bios_port & IO_CHIP)
return 0xff;
- sms_get_inputs(&space);
+ sms_get_inputs(space);
/* Reset Button */
m_input_port1 = (m_input_port1 & 0xef) | (ioport("RESET")->read_safe(0x01) & 0x01) << 4;
@@ -1228,7 +1228,7 @@ WRITE8_MEMBER(sms_state::sms_bios_w)
logerror("bios write %02x, pc: %04x\n", data, space.device().safe_pc());
- setup_rom(&space);
+ setup_rom(space);
}
@@ -1363,9 +1363,9 @@ static void sms_machine_stop( running_machine &machine )
}
-static void setup_rom( address_space *space )
+static void setup_rom( address_space &space )
{
- sms_state *state = space->machine().driver_data<sms_state>();
+ sms_state *state = space.machine().driver_data<sms_state>();
/* 1. set up bank pointers to point to nothing */
state->membank("bank1")->set_base(state->m_banking_none);
@@ -1950,56 +1950,56 @@ MACHINE_START_MEMBER(sms_state,sms)
MACHINE_RESET_MEMBER(sms_state,sms)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
m_ctrl_reg = 0xff;
if (m_has_fm)
m_fm_detect = 0x01;
- m_mapper_ram = (UINT8*)space->get_write_ptr(0xdffc);
+ m_mapper_ram = (UINT8*)space.get_write_ptr(0xdffc);
m_bios_port = 0;
if ( m_cartridge[m_current_cartridge].features & CF_CODEMASTERS_MAPPER )
{
/* Install special memory handlers */
- space->install_write_handler(0x0000, 0x0000, write8_delegate(FUNC(sms_state::sms_codemasters_page0_w),this));
- space->install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_codemasters_page1_w),this));
+ space.install_write_handler(0x0000, 0x0000, write8_delegate(FUNC(sms_state::sms_codemasters_page0_w),this));
+ space.install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_codemasters_page1_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_KOREAN_ZEMINA_MAPPER )
{
- space->install_write_handler(0x0000, 0x0003, write8_delegate(FUNC(sms_state::sms_korean_zemina_banksw_w),this));
+ space.install_write_handler(0x0000, 0x0003, write8_delegate(FUNC(sms_state::sms_korean_zemina_banksw_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_JANGGUN_MAPPER )
{
- space->install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_janggun_bank0_w),this));
- space->install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_janggun_bank1_w),this));
- space->install_write_handler(0x8000, 0x8000, write8_delegate(FUNC(sms_state::sms_janggun_bank2_w),this));
- space->install_write_handler(0xA000, 0xA000,write8_delegate(FUNC(sms_state::sms_janggun_bank3_w),this));
+ space.install_write_handler(0x4000, 0x4000, write8_delegate(FUNC(sms_state::sms_janggun_bank0_w),this));
+ space.install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_janggun_bank1_w),this));
+ space.install_write_handler(0x8000, 0x8000, write8_delegate(FUNC(sms_state::sms_janggun_bank2_w),this));
+ space.install_write_handler(0xA000, 0xA000,write8_delegate(FUNC(sms_state::sms_janggun_bank3_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_4PAK_MAPPER )
{
- space->install_write_handler(0x3ffe, 0x3ffe, write8_delegate(FUNC(sms_state::sms_4pak_page0_w),this));
- space->install_write_handler(0x7fff, 0x7fff, write8_delegate(FUNC(sms_state::sms_4pak_page1_w),this));
- space->install_write_handler(0xbfff, 0xbfff, write8_delegate(FUNC(sms_state::sms_4pak_page2_w),this));
+ space.install_write_handler(0x3ffe, 0x3ffe, write8_delegate(FUNC(sms_state::sms_4pak_page0_w),this));
+ space.install_write_handler(0x7fff, 0x7fff, write8_delegate(FUNC(sms_state::sms_4pak_page1_w),this));
+ space.install_write_handler(0xbfff, 0xbfff, write8_delegate(FUNC(sms_state::sms_4pak_page2_w),this));
}
if ( m_cartridge[m_current_cartridge].features & CF_TVDRAW )
{
- space->install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_tvdraw_axis_w),this));
- space->install_read_handler(0x8000, 0x8000, read8_delegate(FUNC(sms_state::sms_tvdraw_status_r),this));
- space->install_read_handler(0xa000, 0xa000, read8_delegate(FUNC(sms_state::sms_tvdraw_data_r),this));
- space->nop_write(0xa000, 0xa000);
+ space.install_write_handler(0x6000, 0x6000, write8_delegate(FUNC(sms_state::sms_tvdraw_axis_w),this));
+ space.install_read_handler(0x8000, 0x8000, read8_delegate(FUNC(sms_state::sms_tvdraw_status_r),this));
+ space.install_read_handler(0xa000, 0xa000, read8_delegate(FUNC(sms_state::sms_tvdraw_data_r),this));
+ space.nop_write(0xa000, 0xa000);
m_cartridge[m_current_cartridge].m_tvdraw_data = 0;
}
if ( m_cartridge[m_current_cartridge].features & CF_93C46_EEPROM )
{
- space->install_write_handler(0x8000,0x8000, write8_delegate(FUNC(sms_state::sms_93c46_w),this));
- space->install_read_handler(0x8000,0x8000, read8_delegate(FUNC(sms_state::sms_93c46_r),this));
+ space.install_write_handler(0x8000,0x8000, write8_delegate(FUNC(sms_state::sms_93c46_w),this));
+ space.install_read_handler(0x8000,0x8000, read8_delegate(FUNC(sms_state::sms_93c46_r),this));
}
if (m_cartridge[m_current_cartridge].features & CF_GG_SMS_MODE)
@@ -2061,7 +2061,7 @@ WRITE8_MEMBER(sms_state::sms_store_cart_select_w)
setup_cart_banks(machine());
membank("bank10")->set_base(m_banking_cart[3] + 0x2000);
- setup_rom(&space);
+ setup_rom(space);
}
diff --git a/src/mess/machine/snescart.c b/src/mess/machine/snescart.c
index 124a3258687..109db62e314 100644
--- a/src/mess/machine/snescart.c
+++ b/src/mess/machine/snescart.c
@@ -504,7 +504,7 @@ static UINT32 snes_find_hilo_mode( device_image_interface &image, UINT8 *buffer,
static int snes_find_addon_chip( running_machine &machine )
{
snes_state *state = machine.driver_data<snes_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int supported_type = 1;
int dsp_prg_offset = 0;
@@ -686,7 +686,7 @@ static int snes_find_addon_chip( running_machine &machine )
static void snes_cart_log_info( running_machine &machine, int total_blocks, int supported )
{
snes_state *state = machine.driver_data<snes_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
char title[21], rom_id[4], company_id[2];
int i, company, has_ram = 0, has_sram = 0;
@@ -763,7 +763,7 @@ static DEVICE_IMAGE_LOAD( snes_cart )
int supported_type = 1;
running_machine &machine = image.device().machine();
snes_state *state = machine.driver_data<snes_state>();
- address_space *space = machine.device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine.device( "maincpu")->memory().space( AS_PROGRAM );
int total_blocks, read_blocks, has_bsx_slot = 0, st_bios = 0;
UINT32 offset, int_header_offs;
UINT8 *ROM = state->memregion("cart")->base();
diff --git a/src/mess/machine/sorcerer.c b/src/mess/machine/sorcerer.c
index bef57d35603..697bf7548d1 100644
--- a/src/mess/machine/sorcerer.c
+++ b/src/mess/machine/sorcerer.c
@@ -306,7 +306,7 @@ SNAPSHOT_LOAD(sorcerer)
{
device_t *cpu = image.device().machine().device("maincpu");
UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base();
- address_space *space = cpu->memory().space(AS_PROGRAM);
+ address_space &space = *cpu->memory().space(AS_PROGRAM);
UINT8 header[28];
unsigned char s_byte;
@@ -325,7 +325,7 @@ SNAPSHOT_LOAD(sorcerer)
for (int i = 0; i < 0xc000; i++)
{
image.fread( &s_byte, 1);
- space->write_byte(i, s_byte);
+ space.write_byte(i, s_byte);
}
image.fread( RAM+0xc000, 0x4000);
@@ -360,20 +360,20 @@ void sorcerer_state::machine_start()
UINT16 endmem = 0xbfff;
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
/* configure RAM */
switch (m_ram->size())
{
case 8*1024:
- space->unmap_readwrite(0x2000, endmem);
+ space.unmap_readwrite(0x2000, endmem);
break;
case 16*1024:
- space->unmap_readwrite(0x4000, endmem);
+ space.unmap_readwrite(0x4000, endmem);
break;
case 32*1024:
- space->unmap_readwrite(0x8000, endmem);
+ space.unmap_readwrite(0x8000, endmem);
break;
}
}
@@ -387,27 +387,27 @@ MACHINE_START_MEMBER(sorcerer_state,sorcererd)
UINT16 endmem = 0xbbff;
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
/* configure RAM */
switch (m_ram->size())
{
case 8*1024:
- space->unmap_readwrite(0x2000, endmem);
+ space.unmap_readwrite(0x2000, endmem);
break;
case 16*1024:
- space->unmap_readwrite(0x4000, endmem);
+ space.unmap_readwrite(0x4000, endmem);
break;
case 32*1024:
- space->unmap_readwrite(0x8000, endmem);
+ space.unmap_readwrite(0x8000, endmem);
break;
}
}
void sorcerer_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
/* Initialize cassette interface */
m_cass_data.output.length = 0;
@@ -416,7 +416,7 @@ void sorcerer_state::machine_reset()
m_cass_data.input.bit = 1;
m_fe = 0xff;
- sorcerer_fe_w(*space, 0, 0, 0xff);
+ sorcerer_fe_w(space, 0, 0, 0xff);
membank("boot")->set_entry(1);
machine().scheduler().timer_set(attotime::from_usec(10), FUNC(sorcerer_reset));
diff --git a/src/mess/machine/special.c b/src/mess/machine/special.c
index ae102dcfe06..2a32bafbe52 100644
--- a/src/mess/machine/special.c
+++ b/src/mess/machine/special.c
@@ -136,33 +136,33 @@ READ8_MEMBER( special_state::specimx_video_color_r )
void special_state::specimx_set_bank(offs_t i, UINT8 data)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
UINT8 *ram = m_ram->pointer();
- space->install_write_bank(0xc000, 0xffbf, "bank3");
- space->install_write_bank(0xffc0, 0xffdf, "bank4");
+ space.install_write_bank(0xc000, 0xffbf, "bank3");
+ space.install_write_bank(0xffc0, 0xffdf, "bank4");
membank("bank4")->set_base(ram + 0xffc0);
switch(i)
{
case 0 :
- space->install_write_bank(0x0000, 0x8fff, "bank1");
- space->install_write_handler(0x9000, 0xbfff, write8_delegate(FUNC(special_state::video_memory_w), this));
+ space.install_write_bank(0x0000, 0x8fff, "bank1");
+ space.install_write_handler(0x9000, 0xbfff, write8_delegate(FUNC(special_state::video_memory_w), this));
membank("bank1")->set_base(ram);
membank("bank2")->set_base(ram + 0x9000);
membank("bank3")->set_base(ram + 0xc000);
break;
case 1 :
- space->install_write_bank(0x0000, 0x8fff, "bank1");
- space->install_write_bank(0x9000, 0xbfff, "bank2");
+ space.install_write_bank(0x0000, 0x8fff, "bank1");
+ space.install_write_bank(0x9000, 0xbfff, "bank2");
membank("bank1")->set_base(ram + 0x10000);
membank("bank2")->set_base(ram + 0x19000);
membank("bank3")->set_base(ram + 0x1c000);
break;
case 2 :
- space->unmap_write(0x0000, 0x8fff);
- space->unmap_write(0x9000, 0xbfff);
+ space.unmap_write(0x0000, 0x8fff);
+ space.unmap_write(0x9000, 0xbfff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base() + 0x10000);
membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0x19000);
@@ -273,14 +273,14 @@ void special_state::erik_set_bank()
UINT8 bank4 = (m_RR_register >> 6) & 3;
UINT8 *mem = memregion("maincpu")->base();
UINT8 *ram = m_ram->pointer();
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
- space->install_write_bank(0x0000, 0x3fff, "bank1");
- space->install_write_bank(0x4000, 0x8fff, "bank2");
- space->install_write_bank(0x9000, 0xbfff, "bank3");
- space->install_write_bank(0xc000, 0xefff, "bank4");
- space->install_write_bank(0xf000, 0xf7ff, "bank5");
- space->install_write_bank(0xf800, 0xffff, "bank6");
+ space.install_write_bank(0x0000, 0x3fff, "bank1");
+ space.install_write_bank(0x4000, 0x8fff, "bank2");
+ space.install_write_bank(0x9000, 0xbfff, "bank3");
+ space.install_write_bank(0xc000, 0xefff, "bank4");
+ space.install_write_bank(0xf000, 0xf7ff, "bank5");
+ space.install_write_bank(0xf800, 0xffff, "bank6");
switch(bank1)
{
@@ -290,7 +290,7 @@ void special_state::erik_set_bank()
membank("bank1")->set_base(ram + 0x10000*(bank1-1));
break;
case 0:
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(mem + 0x10000);
break;
}
@@ -302,7 +302,7 @@ void special_state::erik_set_bank()
membank("bank2")->set_base(ram + 0x10000*(bank2-1) + 0x4000);
break;
case 0:
- space->unmap_write(0x4000, 0x8fff);
+ space.unmap_write(0x4000, 0x8fff);
membank("bank2")->set_base(mem + 0x14000);
break;
}
@@ -314,7 +314,7 @@ void special_state::erik_set_bank()
membank("bank3")->set_base(ram + 0x10000*(bank3-1) + 0x9000);
break;
case 0:
- space->unmap_write(0x9000, 0xbfff);
+ space.unmap_write(0x9000, 0xbfff);
membank("bank3")->set_base(mem + 0x19000);
break;
}
@@ -328,11 +328,11 @@ void special_state::erik_set_bank()
membank("bank6")->set_base(ram + 0x10000*(bank4-1) + 0x0f800);
break;
case 0:
- space->unmap_write(0xc000, 0xefff);
+ space.unmap_write(0xc000, 0xefff);
membank("bank4")->set_base(mem + 0x1c000);
- space->unmap_write(0xf000, 0xf7ff);
- space->nop_read(0xf000, 0xf7ff);
- space->install_readwrite_handler(0xf800, 0xf803, 0, 0x7fc, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi));
+ space.unmap_write(0xf000, 0xf7ff);
+ space.nop_read(0xf000, 0xf7ff);
+ space.install_readwrite_handler(0xf800, 0xf803, 0, 0x7fc, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi));
break;
}
}
diff --git a/src/mess/machine/tandy1t.c b/src/mess/machine/tandy1t.c
index 526915f6eae..c003f4c5a20 100644
--- a/src/mess/machine/tandy1t.c
+++ b/src/mess/machine/tandy1t.c
@@ -165,9 +165,9 @@ static struct
WRITE8_HANDLER ( pc_t1t_p37x_w )
{
-// DBG_LOG(2,"T1T_p37x_w",("%.5x #%d $%02x\n", space->device().safe_pc( ),offset, data));
+// DBG_LOG(2,"T1T_p37x_w",("%.5x #%d $%02x\n", space.device().safe_pc( ),offset, data));
if (offset!=4)
- logerror("T1T_p37x_w %.5x #%d $%02x\n", space->device().safe_pc( ),offset, data);
+ logerror("T1T_p37x_w %.5x #%d $%02x\n", space.device().safe_pc( ),offset, data);
tandy.data[offset]=data;
switch( offset )
{
@@ -180,7 +180,7 @@ WRITE8_HANDLER ( pc_t1t_p37x_w )
READ8_HANDLER ( pc_t1t_p37x_r )
{
int data = tandy.data[offset];
-// DBG_LOG(1,"T1T_p37x_r",("%.5x #%d $%02x\n", space->device().safe_pc( ), offset, data));
+// DBG_LOG(1,"T1T_p37x_r",("%.5x #%d $%02x\n", space.device().safe_pc( ), offset, data));
return data;
}
@@ -203,8 +203,8 @@ WRITE8_HANDLER ( tandy1000_pio_w )
{
case 1:
tandy_ppi.portb = data;
- pit8253_gate2_w(space->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( space->machine(), data & 0x02 );
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
pc_keyb_set_clock(data&0x40);
if ( data & 0x80 )
{
@@ -214,9 +214,9 @@ WRITE8_HANDLER ( tandy1000_pio_w )
case 2:
tandy_ppi.portc = data;
if (data & 8)
- space->machine().device("maincpu")->set_clock_scale(1);
+ space.machine().device("maincpu")->set_clock_scale(1);
else
- space->machine().device("maincpu")->set_clock_scale(4.77/8);
+ space.machine().device("maincpu")->set_clock_scale(4.77/8);
break;
}
}
@@ -261,7 +261,7 @@ READ8_HANDLER( tandy1000_bank_r )
{
UINT8 data = 0xFF;
- logerror( "%s: tandy1000_bank_r: offset = %x\n", space->machine().describe_context(), offset );
+ logerror( "%s: tandy1000_bank_r: offset = %x\n", space.machine().describe_context(), offset );
switch( offset )
{
@@ -276,13 +276,13 @@ READ8_HANDLER( tandy1000_bank_r )
WRITE8_HANDLER( tandy1000_bank_w )
{
- logerror( "%s: tandy1000_bank_w: offset = %x, data = %02x\n", space->machine().describe_context(), offset, data );
+ logerror( "%s: tandy1000_bank_w: offset = %x, data = %02x\n", space.machine().describe_context(), offset, data );
switch( offset )
{
case 0x00: /* FFEA */
tandy.bios_bank = data;
- tandy1000_set_bios_bank(space->machine());
+ tandy1000_set_bios_bank(space.machine());
break;
}
}
diff --git a/src/mess/machine/tf20.c b/src/mess/machine/tf20.c
index b5f6086ca4a..d1cc7fe9a17 100644
--- a/src/mess/machine/tf20.c
+++ b/src/mess/machine/tf20.c
@@ -71,8 +71,8 @@ static TIMER_DEVICE_CALLBACK( serial_clock )
/* a read from this location disables the rom */
static READ8_HANDLER( tf20_rom_disable )
{
- tf20_state *tf20 = get_safe_token(space->device().owner());
- address_space *prg = space->device().memory().space(AS_PROGRAM);
+ tf20_state *tf20 = get_safe_token(space.device().owner());
+ address_space *prg = space.device().memory().space(AS_PROGRAM);
/* switch in ram */
prg->install_ram(0x0000, 0x7fff, tf20->ram->pointer());
@@ -82,9 +82,9 @@ static READ8_HANDLER( tf20_rom_disable )
static READ8_HANDLER( tf20_dip_r )
{
- logerror("%s: tf20_dip_r\n", space->machine().describe_context());
+ logerror("%s: tf20_dip_r\n", space.machine().describe_context());
- return space->machine().root_device().ioport("tf20_dip")->read();
+ return space.machine().root_device().ioport("tf20_dip")->read();
}
static TIMER_CALLBACK( tf20_upd765_tc_reset )
@@ -105,8 +105,8 @@ static READ8_DEVICE_HANDLER( tf20_upd765_tc_r )
static WRITE8_HANDLER( tf20_fdc_control_w )
{
- tf20_state *tf20 = get_safe_token(space->device().owner());
- logerror("%s: tf20_fdc_control_w %02x\n", space->machine().describe_context(), data);
+ tf20_state *tf20 = get_safe_token(space.device().owner());
+ logerror("%s: tf20_fdc_control_w %02x\n", space.machine().describe_context(), data);
/* bit 0, motor on signal */
floppy_mon_w(tf20->floppy_0, !BIT(data, 0));
diff --git a/src/mess/machine/thomflop.c b/src/mess/machine/thomflop.c
index 7d885061da1..1d7dd4fe31f 100644
--- a/src/mess/machine/thomflop.c
+++ b/src/mess/machine/thomflop.c
@@ -273,14 +273,14 @@ static UINT8 to7_5p14_select;
static READ8_HANDLER ( to7_5p14_r )
{
- device_t *fdc = space->machine().device("wd2793");
+ device_t *fdc = space.machine().device("wd2793");
if ( offset < 4 )
- return wd17xx_r( fdc, *space, offset );
+ return wd17xx_r( fdc, space, offset );
else if ( offset == 8 )
return to7_5p14_select;
else
- logerror ( "%f $%04x to7_5p14_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x to7_5p14_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
@@ -288,9 +288,9 @@ static READ8_HANDLER ( to7_5p14_r )
static WRITE8_HANDLER( to7_5p14_w )
{
- device_t *fdc = space->machine().device("wd2793");
+ device_t *fdc = space.machine().device("wd2793");
if ( offset < 4 )
- wd17xx_w( fdc, *space, offset, data );
+ wd17xx_w( fdc, space, offset, data );
else if ( offset == 8 )
{
/* drive select */
@@ -304,7 +304,7 @@ static WRITE8_HANDLER( to7_5p14_w )
case 4: drive = 2; side = 0; break;
case 5: drive = 3; side = 1; break;
default:
- logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data );
+ logerror( "%f $%04x to7_5p14_w: invalid drive select pattern $%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data );
}
wd17xx_dden_w(fdc, BIT(data, 7));
@@ -313,17 +313,17 @@ static WRITE8_HANDLER( to7_5p14_w )
if ( drive != -1 )
{
- thom_floppy_active( space->machine(), 0 );
+ thom_floppy_active( space.machine(), 0 );
wd17xx_set_drive( fdc, drive );
wd17xx_set_side( fdc, side );
LOG(( "%f $%04x to7_5p14_w: $%02X set drive=%i side=%i density=%s\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(),
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(),
data, drive, side, (BIT(data, 7) ? "FM" : "MFM")));
}
}
else
logerror ( "%f $%04x to7_5p14_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
@@ -362,11 +362,11 @@ static UINT8 to7_5p14sd_select;
static READ8_HANDLER ( to7_5p14sd_r )
{
if ( offset < 8 )
- return mc6843_r( space->machine().device("mc6843"), *space, offset );
+ return mc6843_r( space.machine().device("mc6843"), space, offset );
else if ( offset >= 8 && offset <= 9 )
return to7_5p14sd_select;
else
- logerror ( "%f $%04x to7_5p14sd_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x to7_5p14sd_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
@@ -375,7 +375,7 @@ static READ8_HANDLER ( to7_5p14sd_r )
static WRITE8_HANDLER( to7_5p14sd_w )
{
if ( offset < 8 )
- mc6843_w( space->machine().device("mc6843"), *space, offset, data );
+ mc6843_w( space.machine().device("mc6843"), space, offset, data );
else if ( offset >= 8 && offset <= 9 )
{
/* drive select */
@@ -406,16 +406,16 @@ static WRITE8_HANDLER( to7_5p14sd_w )
if ( drive != -1 )
{
- thom_floppy_active( space->machine(), 0 );
- mc6843_set_drive( space->machine().device("mc6843"), drive );
- mc6843_set_side( space->machine().device("mc6843"), side );
+ thom_floppy_active( space.machine(), 0 );
+ mc6843_set_drive( space.machine().device("mc6843"), drive );
+ mc6843_set_side( space.machine().device("mc6843"), side );
LOG(( "%f $%04x to7_5p14sd_w: $%02X set drive=%i side=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data, drive, side ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data, drive, side ));
}
}
else
logerror ( "%f $%04x to7_5p14sd_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
static void to7_5p14_index_pulse_callback( device_t *controller,device_t *image, int state )
@@ -700,9 +700,9 @@ static READ8_HANDLER ( to7_qdd_r )
{
case 0: /* MC6852 status */
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_r: STAT=$%02X irq=%i pe=%i ovr=%i und=%i tr=%i rd=%i ncts=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), to7qdd->status,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), to7qdd->status,
to7qdd->status & QDD_S_IRQ ? 1 : 0,
to7qdd->status & QDD_S_PE ? 1 : 0,
to7qdd->status & QDD_S_OVR ? 1 : 0,
@@ -714,23 +714,23 @@ static READ8_HANDLER ( to7_qdd_r )
case 1: /* MC6852 data input => read byte from disk */
to7qdd->status &= ~(QDD_S_RDA | QDD_S_PE | QDD_S_OVR);
- to7_qdd_stat_update(space->machine());
- return to7_qdd_read_byte(space->machine());
+ to7_qdd_stat_update(space.machine());
+ return to7_qdd_read_byte(space.machine());
case 8: /* floppy status */
{
UINT8 data = 0;
- device_image_interface* img = dynamic_cast<device_image_interface *>(to7_qdd_image(space->machine()));
+ device_image_interface* img = dynamic_cast<device_image_interface *>(to7_qdd_image(space.machine()));
if ( ! img->exists() )
data |= 0x40; /* disk present */
if ( to7qdd->index_pulse )
data |= 0x80; /* disk start */
- VLOG(( "%f $%04x to7_qdd_r: STATUS8 $%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x to7_qdd_r: STATUS8 $%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
return data;
}
default:
- logerror ( "%f $%04x to7_qdd_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x to7_qdd_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -750,9 +750,9 @@ static WRITE8_HANDLER( to7_qdd_w )
to7qdd->status &= ~(QDD_S_TDRA | QDD_S_TUF);
to7qdd->ctrl1 = ( data & ~(QDD_C1_RRESET | QDD_C1_TRESET) ) |( data & (QDD_C1_RRESET | QDD_C1_TRESET) & to7qdd->ctrl1 );
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_w: CTRL1=$%02X reset=%c%c %s%sirq=%c%c\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
data & QDD_C1_RRESET ? 'r' : '-', data & QDD_C1_TRESET ? 't' : '-',
data & QDD_C1_STRIPSYNC ? "strip-sync " : "",
data & QDD_C1_CLRSYNC ? "clear-sync " : "",
@@ -774,9 +774,9 @@ static WRITE8_HANDLER( to7_qdd_w )
int bits, parity;
bits = bit[ (data >> 3) & 7 ];
parity = par[ (data >> 3) & 7 ];
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_w: CTRL2=$%02X bits=%i par=%s blen=%i under=%s%s\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
bits, parname[ parity ], data & QDD_C2_BLEN ? 1 : 2,
data & QDD_C2_TSYNC ? "sync" : "ff",
data & QDD_C2_EIE ? "irq-err" : "" ));
@@ -792,9 +792,9 @@ static WRITE8_HANDLER( to7_qdd_w )
to7qdd->status &= ~QDD_S_TUF;
if ( data & QDD_C3_CLRCTS )
to7qdd->status &= ~QDD_S_NCTS;
- to7_qdd_stat_update(space->machine());
+ to7_qdd_stat_update(space.machine());
VLOG(( "%f $%04x to7_qdd_w: CTRL3=$%02X %s%ssync-len=%i sync-mode=%s\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
data & QDD_C3_CLRTUF ? "clr-tuf " : "",
data & QDD_C3_CLRCTS ? "clr-cts " : "",
data & QDD_C3_SYNCLEN ? 1 : 2,
@@ -802,11 +802,11 @@ static WRITE8_HANDLER( to7_qdd_w )
break;
case 2: /* MC6852 sync code => write byte to disk */
- to7_qdd_write_byte( space->machine(), data );
+ to7_qdd_write_byte( space.machine(), data );
break;
case 3: /* MC6852 data out => does not seem to be used */
- VLOG(( "%f $%04x to7_qdd_w: ignored WDATA=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x to7_qdd_w: ignored WDATA=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
}
@@ -814,16 +814,16 @@ static WRITE8_HANDLER( to7_qdd_w )
case 8: /* set drive */
to7qdd->drive = data;
- VLOG(( "%f $%04x to7_qdd_w: DRIVE=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x to7_qdd_w: DRIVE=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
case 12: /* motor pulse ? */
- thom_floppy_active( space->machine(), 0 );
- VLOG(( "%f $%04x to7_qdd_w: MOTOR=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ thom_floppy_active( space.machine(), 0 );
+ VLOG(( "%f $%04x to7_qdd_w: MOTOR=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
default:
- logerror ( "%f $%04x to7_qdd_w: invalid write offset %i (data=$%02X)\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror ( "%f $%04x to7_qdd_w: invalid write offset %i (data=$%02X)\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1264,13 +1264,13 @@ READ8_HANDLER ( thmfc_floppy_r )
case 0: /* STAT0 */
thmfc1->stat0 ^= THMFC1_STAT0_SYNCHRO | THMFC1_STAT0_BYTE_READY_POL;
- VLOG(( "%f $%04x thmfc_floppy_r: STAT0=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), thmfc1->stat0 ));
+ VLOG(( "%f $%04x thmfc_floppy_r: STAT0=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), thmfc1->stat0 ));
return thmfc1->stat0;
case 1: /* STAT1 */
{
UINT8 data = 0;
- device_image_interface * img = dynamic_cast<device_image_interface *>(thmfc_floppy_image(space->machine()));
+ device_image_interface * img = dynamic_cast<device_image_interface *>(thmfc_floppy_image(space.machine()));
int flags = floppy_drive_get_flag_state( &img->device(), -1 );
if ( thmfc_floppy_is_qdd(img) )
{
@@ -1296,16 +1296,16 @@ READ8_HANDLER ( thmfc_floppy_r )
data |= 0x10;
if (!floppy_wpt_r(&img->device()))
data |= 0x04;
- VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x thmfc_floppy_r: STAT1=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
return data;
}
case 3: /* RDATA */
if ( thmfc1->op == THMFC1_OP_READ_SECT || thmfc1->op == THMFC1_OP_READ_ADDR )
- return thmfc_floppy_read_byte(space->machine());
+ return thmfc_floppy_read_byte(space.machine());
else
- return thmfc_floppy_raw_read_byte(space->machine());
+ return thmfc_floppy_raw_read_byte(space.machine());
case 6:
return 0;
@@ -1314,12 +1314,12 @@ READ8_HANDLER ( thmfc_floppy_r )
{
/* undocumented => emulate TO7 QDD controller ? */
UINT8 data = thmfc1->ipl << 7;
- VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ VLOG(( "%f $%04x thmfc_floppy_r: STAT8=$%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
return data;
}
default:
- logerror ( "%f $%04x thmfc_floppy_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror ( "%f $%04x thmfc_floppy_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1333,11 +1333,11 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case 0: /* CMD0 */
{
int wsync = (data >> 4) & 1;
- int qdd = thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space->machine())));
+ int qdd = thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space.machine())));
chrn_id id;
thmfc1->formatting = (data >> 2) & 1;
LOG (( "%f $%04x thmfc_floppy_w: CMD0=$%02X dens=%s wsync=%i dsync=%i fmt=%i op=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
(BIT(data, 5) ? "FM" : "MFM"),
wsync, (data >> 3) & 1,
thmfc1->formatting, data & 3 ));
@@ -1356,7 +1356,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case THMFC1_OP_WRITE_SECT:
if ( qdd )
logerror( "thmfc_floppy_w: smart operation 1 not supported for QDD\n" );
- else if ( thmfc_floppy_find_sector( space->machine(), &id ) )
+ else if ( thmfc_floppy_find_sector( space.machine(), &id ) )
{
thmfc1->sector_id = id.data_id;
thmfc1->data_idx = 0;
@@ -1371,7 +1371,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case THMFC1_OP_READ_ADDR:
if ( qdd )
logerror( "thmfc_floppy_w: smart operation 2 not supported for QDD\n" );
- else if ( thmfc_floppy_find_sector( space->machine(), &id ) )
+ else if ( thmfc_floppy_find_sector( space.machine(), &id ) )
{
thmfc1->data_size =
thom_floppy_make_addr( id, thmfc1->data, thmfc1->sector_size );
@@ -1387,10 +1387,10 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case THMFC1_OP_READ_SECT:
if ( qdd )
logerror( "thmfc_floppy_w: smart operation 3 not supported for QDD\n" );
- else if ( thmfc_floppy_find_sector( space->machine(), &id ) )
+ else if ( thmfc_floppy_find_sector( space.machine(), &id ) )
{
thmfc1->data_size = thom_floppy_make_sector
- ( thmfc_floppy_image(space->machine()), id, thmfc1->data, thmfc1->sector_size );
+ ( thmfc_floppy_image(space.machine()), id, thmfc1->data, thmfc1->sector_size );
assert( thmfc1->data_size < sizeof( thmfc1->data ) );
thmfc1->data_finish = thmfc1->sector_size + 4;
thmfc1->data_idx = 1;
@@ -1404,7 +1404,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
/* synchronize to word, if needed (QDD only) */
if ( wsync && qdd ) {
if ( ! thmfc1->data_raw_size )
- thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(space->machine()), thmfc1->data );
+ thmfc1->data_raw_size = thom_qdd_make_disk ( thmfc_floppy_image(space.machine()), thmfc1->data );
while ( thmfc1->data_raw_idx < thmfc1->data_raw_size &&
thmfc1->data[ thmfc1->data_raw_idx ] != thmfc1->wsync )
{
@@ -1423,12 +1423,12 @@ WRITE8_HANDLER ( thmfc_floppy_w )
if ( thmfc1->sector_size > 256 )
{
logerror( "$%04x thmfc_floppy_w: sector size %i > 256 not handled\n",
- space->machine().device("maincpu")->safe_pcbase(), thmfc1->sector_size );
+ space.machine().device("maincpu")->safe_pcbase(), thmfc1->sector_size );
thmfc1->sector_size = 256;
}
LOG (( "%f $%04x thmfc_floppy_w: CMD1=$%02X sect-size=%i comp=%i head=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
thmfc1->sector_size, (data >> 1) & 7, thmfc1->side ));
break;
@@ -1439,7 +1439,7 @@ WRITE8_HANDLER ( thmfc_floppy_w )
int seek = 0, motor;
thmfc1->drive = data & 2;
- img = thmfc_floppy_image(space->machine());
+ img = thmfc_floppy_image(space.machine());
if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(img)))
{
motor = !(data & 0x40);
@@ -1451,13 +1451,13 @@ WRITE8_HANDLER ( thmfc_floppy_w )
seek = (data & 0x20) ? 1 : -1;
motor = (data >> 2) & 1;
thmfc1->drive |= 1 ^ ((data >> 6) & 1);
- img = thmfc_floppy_image(space->machine());
+ img = thmfc_floppy_image(space.machine());
}
- thom_floppy_active( space->machine(), 0 );
+ thom_floppy_active( space.machine(), 0 );
LOG (( "%f $%04x thmfc_floppy_w: CMD2=$%02X drv=%i step=%i motor=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
thmfc1->drive, seek, motor ));
if ( seek )
@@ -1478,17 +1478,17 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case 3: /* WDATA */
thmfc1->wsync = data;
- if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space->machine()))))
- thmfc_floppy_qdd_write_byte( space->machine(), data );
+ if ( thmfc_floppy_is_qdd(dynamic_cast<device_image_interface *>(thmfc_floppy_image(space.machine()))))
+ thmfc_floppy_qdd_write_byte( space.machine(), data );
else if ( thmfc1->op==THMFC1_OP_WRITE_SECT )
- thmfc_floppy_write_byte( space->machine(), data );
+ thmfc_floppy_write_byte( space.machine(), data );
else if ( thmfc1->formatting )
- thmfc_floppy_format_byte( space->machine(), data );
+ thmfc_floppy_format_byte( space.machine(), data );
else
{
/* TODO: implement other forms of raw track writing */
LOG (( "%f $%04x thmfc_floppy_w: ignored raw WDATA $%02X\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
}
break;
@@ -1496,32 +1496,32 @@ WRITE8_HANDLER ( thmfc_floppy_w )
case 4: /* WCLK (unemulated) */
/* clock configuration: FF for data, 0A for synchro */
LOG (( "%f $%04x thmfc_floppy_w: WCLK=$%02X (%s)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
(data == 0xff) ? "data" : (data == 0x0A) ? "synchro" : "?" ));
break;
case 5: /* WSECT */
thmfc1->sector = data;
LOG (( "%f $%04x thmfc_floppy_w: WSECT=%i\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
case 6: /* WTRCK */
thmfc1->track = data;
LOG (( "%f $%04x thmfc_floppy_w: WTRCK=%i (real=%i)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data,
- floppy_drive_get_current_track( thmfc_floppy_image(space->machine()) ) ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data,
+ floppy_drive_get_current_track( thmfc_floppy_image(space.machine()) ) ));
break;
case 7: /* WCELL */
/* precompensation (unemulated) */
LOG (( "%f $%04x thmfc_floppy_w: WCELL=$%02X\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), data ));
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), data ));
break;
default:
logerror ( "%f $%04x thmfc_floppy_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1715,17 +1715,17 @@ static void to7_network_reset( running_machine &machine )
static READ8_HANDLER ( to7_network_r )
{
if ( offset < 4 )
- return mc6854_r( space->machine().device("mc6854"), *space, offset );
+ return mc6854_r( space.machine().device("mc6854"), space, offset );
if ( offset == 8 )
{
/* network ID of the computer */
- UINT8 id = space->machine().root_device().ioport("fconfig")->read() >> 3;
- VLOG(( "%f $%04x to7_network_r: read id $%02X\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), id ));
+ UINT8 id = space.machine().root_device().ioport("fconfig")->read() >> 3;
+ VLOG(( "%f $%04x to7_network_r: read id $%02X\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), id ));
return id;
}
- logerror( "%f $%04x to7_network_r: invalid read offset %i\n", space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "%f $%04x to7_network_r: invalid read offset %i\n", space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
@@ -1734,11 +1734,11 @@ static READ8_HANDLER ( to7_network_r )
static WRITE8_HANDLER ( to7_network_w )
{
if ( offset < 4 )
- mc6854_w( space->machine().device("mc6854"), *space, offset, data );
+ mc6854_w( space.machine().device("mc6854"), space, offset, data );
else
{
logerror( "%f $%04x to7_network_w: invalid write offset %i (data=$%02X)\n",
- space->machine().time().as_double(), space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().time().as_double(), space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1861,7 +1861,7 @@ WRITE8_HANDLER ( to7_floppy_w )
if ( offset == 8 )
{
to7_floppy_bank = 3 + (data & 3);
- space->machine().root_device().membank( THOM_FLOP_BANK )->set_entry( to7_floppy_bank );
+ space.machine().root_device().membank( THOM_FLOP_BANK )->set_entry( to7_floppy_bank );
VLOG (( "to7_floppy_w: set CD 90-351 ROM bank to %i\n", data & 3 ));
}
else
diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c
index e1d515deb25..66ed9eb393e 100644
--- a/src/mess/machine/thomson.c
+++ b/src/mess/machine/thomson.c
@@ -447,14 +447,14 @@ DEVICE_IMAGE_LOAD( to7_cartridge )
static void to7_update_cart_bank(running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int bank = 0;
if ( thom_cart_nb_banks )
{
bank = thom_cart_bank % thom_cart_nb_banks;
if ( bank != old_cart_bank && old_cart_bank < 0 )
{
- space->install_legacy_read_handler(0x0000, 0x0003, FUNC(to7_cartridge_r) );
+ space.install_legacy_read_handler(0x0000, 0x0003, FUNC(to7_cartridge_r) );
}
}
if ( bank != old_cart_bank )
@@ -481,7 +481,7 @@ WRITE8_HANDLER ( to7_cartridge_w )
return;
thom_cart_bank = offset & 3;
- to7_update_cart_bank(space->machine());
+ to7_update_cart_bank(space.machine());
}
@@ -489,12 +489,12 @@ WRITE8_HANDLER ( to7_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_HANDLER ( to7_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- to7_update_cart_bank(space->machine());
+ to7_update_cart_bank(space.machine());
}
return data;
}
@@ -939,22 +939,22 @@ const mea8000_interface to7_speech = { "speech", DEVCB_NULL };
READ8_HANDLER ( to7_modem_mea8000_r )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
{
return 0;
}
- if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
+ if ( space.machine().root_device().ioport("mconfig")->read() & 1 )
{
- device_t* device = space->machine().device("mea8000" );
- return mea8000_r( device, *space, offset );
+ device_t* device = space.machine().device("mea8000" );
+ return mea8000_r( device, space, offset );
}
else
{
- acia6850_device* acia = space->machine().device<acia6850_device>("acia6850" );
+ acia6850_device* acia = space.machine().device<acia6850_device>("acia6850" );
switch (offset) {
- case 0: return acia->status_read(*space, offset );
- case 1: return acia->data_read(*space, offset );
+ case 0: return acia->status_read(space, offset );
+ case 1: return acia->data_read(space, offset );
default: return 0;
}
}
@@ -964,17 +964,17 @@ READ8_HANDLER ( to7_modem_mea8000_r )
WRITE8_HANDLER ( to7_modem_mea8000_w )
{
- if ( space->machine().root_device().ioport("mconfig")->read() & 1 )
+ if ( space.machine().root_device().ioport("mconfig")->read() & 1 )
{
- device_t* device = space->machine().device("mea8000" );
- mea8000_w( device, *space, offset, data );
+ device_t* device = space.machine().device("mea8000" );
+ mea8000_w( device, space, offset, data );
}
else
{
- acia6850_device* acia = space->machine().device<acia6850_device>("acia6850" );
+ acia6850_device* acia = space.machine().device<acia6850_device>("acia6850" );
switch (offset) {
- case 0: acia->control_write( *space, offset, data );
- case 1: acia->data_write( *space, offset, data );
+ case 0: acia->control_write( space, offset, data );
+ case 1: acia->data_write( space, offset, data );
}
}
}
@@ -1283,7 +1283,7 @@ READ8_HANDLER ( to7_midi_r )
/* bit 6: parity error (ignored) */
/* bit 7: interrupt */
LOG_MIDI(( "$%04x %f to7_midi_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, irq=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to7_midi_status,
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to7_midi_status,
(to7_midi_status & ACIA_6850_RDRF) ? 1 : 0,
(to7_midi_status & ACIA_6850_TDRE) ? 1 : 0,
(to7_midi_status & ACIA_6850_OVRN) ? 1 : 0,
@@ -1294,7 +1294,7 @@ READ8_HANDLER ( to7_midi_r )
case 1: /* get input data */
{
UINT8 data = chardev_in( to7_midi_chardev );
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to7_midi_status &= ~(ACIA_6850_irq | ACIA_6850_RDRF);
if ( to7_midi_overrun )
@@ -1303,8 +1303,8 @@ READ8_HANDLER ( to7_midi_r )
to7_midi_status &= ~ACIA_6850_OVRN;
to7_midi_overrun = 0;
LOG_MIDI(( "$%04x %f to7_midi_r: read data $%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
- to7_midi_update_irq( space->machine() );
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
+ to7_midi_update_irq( space.machine() );
}
return data;
}
@@ -1312,7 +1312,7 @@ READ8_HANDLER ( to7_midi_r )
default:
logerror( "$%04x to7_midi_r: invalid offset %i\n",
- space->machine().device("maincpu")->safe_pcbase(), offset );
+ space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1331,7 +1331,7 @@ WRITE8_HANDLER ( to7_midi_w )
if ( (data & 3) == 3 )
{
/* reset */
- LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
+ LOG_MIDI(( "$%04x %f to7_midi_w: reset (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
to7_midi_overrun = 0;
to7_midi_status = 2;
to7_midi_intr = 0;
@@ -1348,7 +1348,7 @@ WRITE8_HANDLER ( to7_midi_w )
static const int stop[8] = { 2,2,1,1,2,1,1,1 };
static const char parity[8] = { 'e','o','e','o','-','-','e','o' };
LOG_MIDI(( "$%04x %f to7_midi_w: set control to $%02X (bits=%i, stop=%i, parity=%c, intr in=%i out=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
data,
bits[ (data >> 2) & 7 ],
stop[ (data >> 2) & 7 ],
@@ -1357,12 +1357,12 @@ WRITE8_HANDLER ( to7_midi_w )
(to7_midi_intr & 3) ? 1 : 0));
}
}
- to7_midi_update_irq( space->machine() );
+ to7_midi_update_irq( space.machine() );
break;
case 1: /* output data */
- LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
+ LOG_MIDI(( "$%04x %f to7_midi_w: write data $%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
if ( data == 0x55 )
/* cable-detect: shortcut */
chardev_fake_in( to7_midi_chardev, 0x55 );
@@ -1376,7 +1376,7 @@ WRITE8_HANDLER ( to7_midi_w )
default:
- logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror( "$%04x to7_midi_w: invalid offset %i (data=$%02X) \n", space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -1487,7 +1487,7 @@ MACHINE_RESET ( to7 )
MACHINE_START ( to7 )
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8* mem = machine.root_device().memregion("maincpu")->base();
UINT8* ram = machine.device<ram_device>(RAM_TAG)->pointer();
@@ -1515,8 +1515,8 @@ MACHINE_START ( to7 )
/* install 16 KB or 16 KB + 8 KB memory extensions */
/* BASIC instruction to see free memory: ?FRE(0) */
int extram = machine.device<ram_device>(RAM_TAG)->size() - 24*1024;
- space->install_write_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK);
- space->install_read_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK );
+ space.install_write_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK);
+ space.install_read_bank(0x8000, 0x8000 + extram - 1, THOM_RAM_BANK );
machine.root_device().membank( THOM_RAM_BANK )->configure_entry( 0, ram + 0x6000);
machine.root_device().membank( THOM_RAM_BANK )->set_entry( 0 );
}
@@ -1568,7 +1568,7 @@ static READ8_DEVICE_HANDLER ( to770_sys_porta_in )
static void to770_update_ram_bank(running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 portb = sys_pia->port_b_z_mask();
int bank;
@@ -1602,7 +1602,7 @@ static void to770_update_ram_bank(running_machine &machine)
{
/* RAM size is 48 KB only and unavailable bank
* requested */
- space->nop_readwrite(0xa000, 0xdfff);
+ space.nop_readwrite(0xa000, 0xdfff);
}
old_ram_bank = bank;
LOG_BANK(( "to770_update_ram_bank: RAM bank change %i\n", bank ));
@@ -1675,8 +1675,8 @@ const mc6846_interface to770_timer =
READ8_HANDLER ( to770_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
int count, inil, init, lt3;
count = to7_lightpen ? l.count : v.count;
inil = to7_lightpen ? l.inil : v.inil;
@@ -1690,7 +1690,7 @@ READ8_HANDLER ( to770_gatearray_r )
case 2: return (lt3 << 7) | (inil << 6);
case 3: return (init << 7);
default:
- logerror( "$%04x to770_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to770_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1907,8 +1907,8 @@ const pia6821_interface mo5_pia6821_sys =
READ8_HANDLER ( mo5_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), MO5_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), MO5_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
int count, inil, init, lt3;
count = to7_lightpen ? l.count : v.count;
inil = to7_lightpen ? l.inil : v.inil;
@@ -1921,7 +1921,7 @@ READ8_HANDLER ( mo5_gatearray_r )
case 2: return (lt3 << 7) | (inil << 6);
case 3: return (init << 7);
default:
- logerror( "$%04x mo5_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x mo5_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -1992,7 +1992,7 @@ DEVICE_IMAGE_LOAD( mo5_cartridge )
static void mo5_update_cart_bank(running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int rom_is_ram = mo5_reg_cart & 4;
int bank = 0;
int bank_is_read_only = 0;
@@ -2006,8 +2006,8 @@ static void mo5_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff);
}
LOG_BANK(( "mo5_update_cart_bank: CART is cartridge bank %i (A7CB style)\n", bank ));
}
@@ -2022,12 +2022,12 @@ static void mo5_update_cart_bank(running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff );
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
}
LOG_BANK(( "mo5_update_cart_bank: CART is nanonetwork RAM bank %i (%s)\n",
mo5_reg_cart & 3,
@@ -2045,9 +2045,9 @@ static void mo5_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 0 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
- space->install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo5_cartridge_r) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
+ space.install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo5_cartridge_r) );
}
LOG_BANK(( "mo5_update_cart_bank: CART is cartridge bank %i\n", bank ));
}
@@ -2055,8 +2055,8 @@ static void mo5_update_cart_bank(running_machine &machine)
/* internal ROM */
if ( old_cart_bank != 0 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo5_cartridge_w) );
LOG_BANK(( "mo5_update_cart_bank: CART is internal\n"));
}
}
@@ -2083,7 +2083,7 @@ WRITE8_HANDLER ( mo5_cartridge_w )
return;
thom_cart_bank = offset & 3;
- mo5_update_cart_bank(space->machine());
+ mo5_update_cart_bank(space.machine());
}
@@ -2091,12 +2091,12 @@ WRITE8_HANDLER ( mo5_cartridge_w )
/* read signal to bffc-bfff generates a bank switch */
READ8_HANDLER ( mo5_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + 0xbffc + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- mo5_update_cart_bank(space->machine());
+ mo5_update_cart_bank(space.machine());
}
return data;
}
@@ -2107,7 +2107,7 @@ READ8_HANDLER ( mo5_cartridge_r )
WRITE8_HANDLER ( mo5_ext_w )
{
mo5_reg_cart = data;
- mo5_update_cart_bank(space->machine());
+ mo5_update_cart_bank(space.machine());
}
@@ -2203,14 +2203,14 @@ MACHINE_START ( mo5 )
WRITE8_HANDLER ( to9_ieee_w )
{
- logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, offset );
+ logerror( "$%04x %f to9_ieee_w: unhandled write $%02X to register %i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data, offset );
}
READ8_HANDLER ( to9_ieee_r )
{
- logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset );
+ logerror( "$%04x %f to9_ieee_r: unhandled read from register %i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), offset );
return 0;
}
@@ -2226,8 +2226,8 @@ READ8_HANDLER ( to9_ieee_r )
READ8_HANDLER ( to9_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), TO9_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), TO9_LIGHTPEN_DECAL, to7_lightpen_step - 1, 0 );
int count, inil, init, lt3;
count = to7_lightpen ? l.count : v.count;
inil = to7_lightpen ? l.inil : v.inil;
@@ -2241,7 +2241,7 @@ READ8_HANDLER ( to9_gatearray_r )
case 2: return (lt3 << 7) | (inil << 6);
case 3: return (v.init << 7) | (init << 6); /* != TO7/70 */
default:
- logerror( "$%04x to9_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to9_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -2315,7 +2315,7 @@ READ8_HANDLER ( to9_vreg_r )
case 0: /* palette data */
{
UINT8 c = to9_palette_data[ to9_palette_idx ];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
@@ -2339,7 +2339,7 @@ READ8_HANDLER ( to9_vreg_r )
WRITE8_HANDLER ( to9_vreg_w )
{
- LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset, 0xe7da + offset, data ));
+ LOG_VIDEO(( "$%04x %f to9_vreg_w: off=%i ($%04X) data=$%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), offset, 0xe7da + offset, data ));
switch ( offset )
{
@@ -2351,7 +2351,7 @@ WRITE8_HANDLER ( to9_vreg_w )
idx = to9_palette_idx / 2;
color = to9_palette_data[ 2 * idx + 1 ];
color = to9_palette_data[ 2 * idx ] | (color << 8);
- thom_set_palette( space->machine(), idx ^ 8, color & 0x1fff );
+ thom_set_palette( space.machine(), idx ^ 8, color & 0x1fff );
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
@@ -2362,11 +2362,11 @@ WRITE8_HANDLER ( to9_vreg_w )
break;
case 2: /* video mode */
- to9_set_video_mode( space->machine(), data, 0 );
+ to9_set_video_mode( space.machine(), data, 0 );
break;
case 3: /* border color */
- thom_set_border_color( space->machine(), data & 15 );
+ thom_set_border_color( space.machine(), data & 15 );
break;
default:
@@ -2394,7 +2394,7 @@ static UINT8 to9_soft_bank;
static void to9_update_cart_bank(running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int bank = 0;
int slot = ( mc6846_get_output_port(machine.device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */
@@ -2407,7 +2407,7 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 4)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
LOG_BANK(( "to9_update_cart_bank: CART is BASIC bank %i\n", to9_soft_bank ));
}
@@ -2419,7 +2419,7 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 4)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
LOG_BANK(( "to9_update_cart_bank: CART is software 1 bank %i\n", to9_soft_bank ));
}
@@ -2431,7 +2431,7 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 4)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
LOG_BANK(( "to9_update_cart_bank: CART is software 2 bank %i\n", to9_soft_bank ));
}
@@ -2445,16 +2445,16 @@ static void to9_update_cart_bank(running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to9_cartridge_w) );
- space->install_legacy_read_handler( 0x0000, 0x0003, FUNC(to9_cartridge_r) );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to9_cartridge_w) );
+ space.install_legacy_read_handler( 0x0000, 0x0003, FUNC(to9_cartridge_r) );
}
LOG_BANK(( "to9_update_cart_bank: CART is cartridge bank %i\n", thom_cart_bank ));
}
} else
if ( old_cart_bank != 0 )
{
- space->nop_read( 0x0000, 0x3fff);
+ space.nop_read( 0x0000, 0x3fff);
LOG_BANK(( "to9_update_cart_bank: CART is unmapped\n"));
}
break;
@@ -2478,7 +2478,7 @@ static void to9_update_cart_bank_postload(running_machine *machine)
/* write signal to 0000-1fff generates a bank switch */
WRITE8_HANDLER ( to9_cartridge_w )
{
- int slot = ( mc6846_get_output_port(space->machine().device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */
+ int slot = ( mc6846_get_output_port(space.machine().device("mc6846")) >> 4 ) & 3; /* bits 4-5: ROM bank */
if ( offset >= 0x2000 )
return;
@@ -2487,7 +2487,7 @@ WRITE8_HANDLER ( to9_cartridge_w )
thom_cart_bank = offset & 3;
else
to9_soft_bank = offset & 3;
- to9_update_cart_bank(space->machine());
+ to9_update_cart_bank(space.machine());
}
@@ -2495,12 +2495,12 @@ WRITE8_HANDLER ( to9_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_HANDLER ( to9_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- to9_update_cart_bank(space->machine());
+ to9_update_cart_bank(space.machine());
}
return data;
}
@@ -2510,7 +2510,7 @@ READ8_HANDLER ( to9_cartridge_r )
static void to9_update_ram_bank (running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 port = mc6846_get_output_port(machine.device("mc6846"));
UINT8 portb = sys_pia->port_b_z_mask();
UINT8 disk = ((port >> 2) & 1) | ((port >> 5) & 2); /* bits 6,2: RAM bank */
@@ -2545,7 +2545,7 @@ static void to9_update_ram_bank (running_machine &machine)
}
else
{
- space->nop_readwrite( 0xa000, 0xdfff);
+ space.nop_readwrite( 0xa000, 0xdfff);
}
old_ram_bank = bank;
LOG_BANK(( "to9_update_ram_bank: bank %i selected (pia=$%02X disk=%i)\n", bank, portb & 0xf8, disk ));
@@ -2668,7 +2668,7 @@ READ8_HANDLER ( to9_kbd_r )
/* bit 7: interrupt */
LOG_KBD(( "$%04x %f to9_kbd_r: status $%02X (rdrf=%i, tdre=%i, ovrn=%i, pe=%i, irq=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to9_kbd_status,
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to9_kbd_status,
(to9_kbd_status & ACIA_6850_RDRF) ? 1 : 0,
(to9_kbd_status & ACIA_6850_TDRE) ? 1 : 0,
(to9_kbd_status & ACIA_6850_OVRN) ? 1 : 0,
@@ -2677,7 +2677,7 @@ READ8_HANDLER ( to9_kbd_r )
return to9_kbd_status;
case 1: /* get input data */
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to9_kbd_status &= ~(ACIA_6850_irq | ACIA_6850_PE);
if ( to9_kbd_overrun )
@@ -2685,13 +2685,13 @@ READ8_HANDLER ( to9_kbd_r )
else
to9_kbd_status &= ~(ACIA_6850_OVRN | ACIA_6850_RDRF);
to9_kbd_overrun = 0;
- LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), to9_kbd_in ));
- to9_kbd_update_irq(space->machine());
+ LOG_KBD(( "$%04x %f to9_kbd_r: read data $%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), to9_kbd_in ));
+ to9_kbd_update_irq(space.machine());
}
return to9_kbd_in;
default:
- logerror( "$%04x to9_kbd_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to9_kbd_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
return 0;
}
}
@@ -2713,7 +2713,7 @@ WRITE8_HANDLER ( to9_kbd_w )
to9_kbd_overrun = 0;
to9_kbd_status = ACIA_6850_TDRE;
to9_kbd_intr = 0;
- LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data ));
+ LOG_KBD(( "$%04x %f to9_kbd_w: reset (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
}
else
{
@@ -2727,19 +2727,19 @@ WRITE8_HANDLER ( to9_kbd_w )
to9_kbd_intr = data >> 5;
LOG_KBD(( "$%04x %f to9_kbd_w: set control to $%02X (parity=%i, intr in=%i out=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
data, to9_kbd_parity, to9_kbd_intr >> 2,
(to9_kbd_intr & 3) ? 1 : 0 ));
}
- to9_kbd_update_irq(space->machine());
+ to9_kbd_update_irq(space.machine());
break;
case 1: /* output data */
to9_kbd_status &= ~(ACIA_6850_irq | ACIA_6850_TDRE);
- to9_kbd_update_irq(space->machine());
+ to9_kbd_update_irq(space.machine());
/* TODO: 1 ms delay here ? */
to9_kbd_status |= ACIA_6850_TDRE; /* data transmit ready again */
- to9_kbd_update_irq(space->machine());
+ to9_kbd_update_irq(space.machine());
switch ( data )
{
@@ -2758,19 +2758,19 @@ WRITE8_HANDLER ( to9_kbd_w )
case 0xFE: to9_kbd_periph = 0; break;
default:
- logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data );
+ logerror( "$%04x %f to9_kbd_w: unknown kbd command %02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data );
}
- thom_set_caps_led( space->machine(), !to9_kbd_caps );
+ thom_set_caps_led( space.machine(), !to9_kbd_caps );
LOG(( "$%04x %f to9_kbd_w: kbd command %02X (caps=%i, pad=%i, periph=%i)\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data,
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data,
to9_kbd_caps, to9_kbd_pad, to9_kbd_periph ));
break;
default:
- logerror( "$%04x to9_kbd_w: invalid offset %i (data=$%02X) \n", space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror( "$%04x to9_kbd_w: invalid offset %i (data=$%02X) \n", space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -3573,7 +3573,7 @@ static void to8_update_floppy_bank_postload(running_machine *machine)
static void to8_update_ram_bank (running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 bank = 0;
if ( to8_reg_sys1 & 0x10 )
@@ -3617,8 +3617,8 @@ static void to8_update_ram_bank (running_machine &machine)
{
/* RAM size is 256 KB only and unavailable
* bank requested */
- space->nop_readwrite( 0xa000, 0xbfff);
- space->nop_readwrite( 0xc000, 0xdfff);
+ space.nop_readwrite( 0xa000, 0xbfff);
+ space.nop_readwrite( 0xc000, 0xdfff);
}
to8_data_vpage = bank;
old_ram_bank = bank;
@@ -3637,7 +3637,7 @@ static void to8_update_ram_bank_postload(running_machine *machine)
static void to8_update_cart_bank (running_machine &machine)
{
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int bank = 0;
int bank_is_read_only = 0;
@@ -3656,14 +3656,14 @@ static void to8_update_cart_bank (running_machine &machine)
{
if (old_cart_bank < 8 || old_cart_bank > 11)
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
if ( bank_is_read_only )
{
- space->nop_write( 0x0000, 0x3fff);
+ space.nop_write( 0x0000, 0x3fff);
}
else
{
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
}
}
}
@@ -3673,12 +3673,12 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->nop_write( 0x0000, 0x3fff);
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.nop_write( 0x0000, 0x3fff);
}
else
{
- space->install_readwrite_bank( 0x0000, 0x3fff,THOM_CART_BANK);
+ space.install_readwrite_bank( 0x0000, 0x3fff,THOM_CART_BANK);
}
}
}
@@ -3687,7 +3687,7 @@ static void to8_update_cart_bank (running_machine &machine)
{
/* RAM size is 256 KB only and unavailable
* bank requested */
- space->nop_readwrite( 0x0000, 0x3fff);
+ space.nop_readwrite( 0x0000, 0x3fff);
}
LOG_BANK(( "to8_update_cart_bank: CART is RAM bank %i (%s)\n",
to8_cart_vpage,
@@ -3699,17 +3699,17 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->nop_write( 0x0000, 0x3fff);
+ space.nop_write( 0x0000, 0x3fff);
}
else
{
if (to8_cart_vpage < 4)
{
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_vcart_w));
}
else
{
- space->install_readwrite_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_readwrite_bank( 0x0000, 0x3fff, THOM_CART_BANK );
}
}
LOG_BANK(( "to8_update_cart_bank: update CART bank %i write status to %s\n",
@@ -3729,8 +3729,8 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 4 || old_cart_bank > 7 )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
}
LOG_BANK(( "to8_update_cart_bank: CART is internal bank %i\n", to8_soft_bank ));
}
@@ -3745,9 +3745,9 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
- space->install_legacy_read_handler( 0x0000, 0x0003, FUNC(to8_cartridge_r) );
+ space.install_read_bank( 0x0000, 0x3fff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0x0000, 0x3fff, FUNC(to8_cartridge_w) );
+ space.install_legacy_read_handler( 0x0000, 0x0003, FUNC(to8_cartridge_r) );
}
LOG_BANK(( "to8_update_cart_bank: CART is external cartridge bank %i\n", bank ));
}
@@ -3756,7 +3756,7 @@ static void to8_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank != 0 )
{
- space->nop_read( 0x0000, 0x3fff);
+ space.nop_read( 0x0000, 0x3fff);
LOG_BANK(( "to8_update_cart_bank: CART is unmapped\n"));
}
}
@@ -3789,7 +3789,7 @@ WRITE8_HANDLER ( to8_cartridge_w )
else
thom_cart_bank = offset & 3;
- to8_update_cart_bank(space->machine());
+ to8_update_cart_bank(space.machine());
}
@@ -3797,12 +3797,12 @@ WRITE8_HANDLER ( to8_cartridge_w )
/* read signal to 0000-0003 generates a bank switch */
READ8_HANDLER ( to8_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- to8_update_cart_bank(space->machine());
+ to8_update_cart_bank(space.machine());
}
return data;
}
@@ -3833,7 +3833,7 @@ static void to8_floppy_reset( running_machine &machine )
READ8_HANDLER ( to8_floppy_r )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
return 0;
if ( (to8_reg_sys1 & 0x80) && THOM_FLOPPY_EXT )
@@ -3871,8 +3871,8 @@ WRITE8_HANDLER ( to8_floppy_w )
READ8_HANDLER ( to8_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), TO8_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), TO8_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
int count, inil, init, lt3;
UINT8 res;
count = to7_lightpen ? l.count : v.count;
@@ -3893,9 +3893,9 @@ READ8_HANDLER ( to8_gatearray_r )
case 1: /* ram register / lightpen register 2 */
if ( to7_lightpen )
{
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
- thom_firq_2( space->machine(), 0 );
+ thom_firq_2( space.machine(), 0 );
to8_lightpen_intr = 0;
}
res = count & 0xff;
@@ -3916,12 +3916,12 @@ READ8_HANDLER ( to8_gatearray_r )
break;
default:
- logerror( "$%04x to8_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x to8_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
res = 0;
}
LOG_VIDEO(( "$%04x %f to8_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xe7e4 + offset, res, to7_lightpen ));
return res;
@@ -3932,7 +3932,7 @@ READ8_HANDLER ( to8_gatearray_r )
WRITE8_HANDLER ( to8_gatearray_w )
{
LOG_VIDEO(( "$%04x %f to8_gatearray_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xe7e4 + offset, data ));
switch ( offset )
@@ -3946,25 +3946,25 @@ WRITE8_HANDLER ( to8_gatearray_w )
if ( to8_reg_sys1 & 0x10 )
{
to8_reg_ram = data;
- to8_update_ram_bank(space->machine());
+ to8_update_ram_bank(space.machine());
}
break;
case 2: /* cartridge register */
to8_reg_cart = data;
- to8_update_cart_bank(space->machine());
+ to8_update_cart_bank(space.machine());
break;
case 3: /* system register 1 */
to8_reg_sys1 = data;
- to8_update_floppy_bank(space->machine());
- to8_update_ram_bank(space->machine());
- to8_update_cart_bank(space->machine());
+ to8_update_floppy_bank(space.machine());
+ to8_update_ram_bank(space.machine());
+ to8_update_cart_bank(space.machine());
break;
default:
logerror( "$%04x to8_gatearray_w: invalid offset %i (data=$%02X)\n",
- space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -3979,7 +3979,7 @@ READ8_HANDLER ( to8_vreg_r )
/* 0xe7dc from external floppy drive aliases the video gate-array */
if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) && ( to8_reg_sys1 & 0x80 ) )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
return 0;
if ( THOM_FLOPPY_EXT )
@@ -3994,7 +3994,7 @@ READ8_HANDLER ( to8_vreg_r )
case 0: /* palette data */
{
UINT8 c = to9_palette_data[ to9_palette_idx ];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
@@ -4019,7 +4019,7 @@ READ8_HANDLER ( to8_vreg_r )
WRITE8_HANDLER ( to8_vreg_w )
{
LOG_VIDEO(( "$%04x %f to8_vreg_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xe7da + offset, data ));
switch ( offset )
@@ -4032,7 +4032,7 @@ WRITE8_HANDLER ( to8_vreg_w )
idx = to9_palette_idx / 2;
color = to9_palette_data[ 2 * idx + 1 ];
color = to9_palette_data[ 2 * idx ] | (color << 8);
- thom_set_palette( space->machine(), idx, color & 0x1fff );
+ thom_set_palette( space.machine(), idx, color & 0x1fff );
to9_palette_idx = ( to9_palette_idx + 1 ) & 31;
}
break;
@@ -4042,7 +4042,7 @@ WRITE8_HANDLER ( to8_vreg_w )
break;
case 2: /* display register */
- to9_set_video_mode( space->machine(), data, 1 );
+ to9_set_video_mode( space.machine(), data, 1 );
break;
case 3: /* system register 2 */
@@ -4055,8 +4055,8 @@ WRITE8_HANDLER ( to8_vreg_w )
else
{
to8_reg_sys2 = data;
- thom_set_video_page( space->machine(), data >> 6 );
- thom_set_border_color( space->machine(), data & 15 );
+ thom_set_video_page( space.machine(), data >> 6 );
+ thom_set_border_color( space.machine(), data & 15 );
}
break;
@@ -4498,12 +4498,12 @@ static void mo6_update_ram_bank_postload(running_machine *machine)
static void mo6_update_cart_bank (running_machine &machine)
{
pia6821_device *sys_pia = machine.device<pia6821_device>(THOM_PIA_SYS );
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int b = (sys_pia->a_output() >> 5) & 1;
int bank = 0;
int bank_is_read_only = 0;
- // space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ // space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
if ( ( ( to8_reg_sys1 & 0x40 ) && ( to8_reg_cart & 0x20 ) ) || ( ! ( to8_reg_sys1 & 0x40 ) && ( mo5_reg_cart & 4 ) ) )
{
@@ -4520,14 +4520,14 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if (old_cart_bank < 8 || old_cart_bank > 11)
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
if ( bank_is_read_only )
{
- space->nop_write( 0xb000, 0xefff);
+ space.nop_write( 0xb000, 0xefff);
}
else
{
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
}
}
}
@@ -4538,12 +4538,12 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.nop_write( 0xb000, 0xefff);
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff,THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff,THOM_CART_BANK);
}
}
}
@@ -4555,17 +4555,17 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->nop_write( 0xb000, 0xefff);
+ space.nop_write( 0xb000, 0xefff);
}
else
{
if (to8_cart_vpage < 4)
{
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(to8_vcart_w));
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK );
}
}
LOG_BANK(( "mo6_update_cart_bank: update CART bank %i write status to %s\n",
@@ -4582,8 +4582,8 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.nop_write( 0xb000, 0xefff);
}
LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i (A7CB style)\n", bank ));
}
@@ -4600,11 +4600,11 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff);
} else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
}
}
LOG_BANK(( "mo6_update_cart_bank: CART is RAM bank %i (MO5 compat.) (%s)\n",
@@ -4615,12 +4615,12 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( bank_is_read_only )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->nop_write( 0xb000, 0xefff);
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.nop_write( 0xb000, 0xefff);
}
else
{
- space->install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_readwrite_bank( 0xb000, 0xefff, THOM_CART_BANK);
}
LOG_BANK(( "mo5_update_cart_bank: update CART bank %i write status to %s\n",
to8_cart_vpage,
@@ -4647,8 +4647,8 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 4 || old_cart_bank > 7 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK);
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
}
LOG_BANK(( "mo6_update_cart_bank: CART is internal ROM bank %i\n", b ));
}
@@ -4663,9 +4663,9 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank < 0 || old_cart_bank > 3 )
{
- space->install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
- space->install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
- space->install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo6_cartridge_r) );
+ space.install_read_bank( 0xb000, 0xefff, THOM_CART_BANK );
+ space.install_legacy_write_handler( 0xb000, 0xefff, FUNC(mo6_cartridge_w) );
+ space.install_legacy_read_handler( 0xbffc, 0xbfff, FUNC(mo6_cartridge_r) );
}
LOG_BANK(( "mo6_update_cart_bank: CART is external cartridge bank %i\n", bank ));
}
@@ -4674,7 +4674,7 @@ static void mo6_update_cart_bank (running_machine &machine)
{
if ( old_cart_bank != 0 )
{
- space->nop_read( 0xb000, 0xefff );
+ space.nop_read( 0xb000, 0xefff );
LOG_BANK(( "mo6_update_cart_bank: CART is unmapped\n"));
}
}
@@ -4704,7 +4704,7 @@ WRITE8_HANDLER ( mo6_cartridge_w )
return;
thom_cart_bank = offset & 3;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
}
@@ -4712,12 +4712,12 @@ WRITE8_HANDLER ( mo6_cartridge_w )
/* read signal generates a bank switch */
READ8_HANDLER ( mo6_cartridge_r )
{
- UINT8* pos = space->machine().root_device().memregion( "maincpu" )->base() + 0x10000;
+ UINT8* pos = space.machine().root_device().memregion( "maincpu" )->base() + 0x10000;
UINT8 data = pos[offset + 0xbffc + (thom_cart_bank % thom_cart_nb_banks) * 0x4000];
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
thom_cart_bank = offset & 3;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
}
return data;
}
@@ -4728,7 +4728,7 @@ WRITE8_HANDLER ( mo6_ext_w )
{
/* MO5 network extension compatible */
mo5_reg_cart = data;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
}
@@ -4930,8 +4930,8 @@ const pia6821_interface mo6_pia6821_sys =
READ8_HANDLER ( mo6_gatearray_r )
{
- struct thom_vsignal v = thom_get_vsignal(space->machine());
- struct thom_vsignal l = thom_get_lightpen_vsignal( space->machine(), MO6_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
+ struct thom_vsignal v = thom_get_vsignal(space.machine());
+ struct thom_vsignal l = thom_get_lightpen_vsignal( space.machine(), MO6_LIGHTPEN_DECAL, to7_lightpen_step - 1, 6 );
int count, inil, init, lt3;
UINT8 res;
count = to7_lightpen ? l.count : v.count;
@@ -4952,9 +4952,9 @@ READ8_HANDLER ( mo6_gatearray_r )
case 1: /* ram register / lightpen register 2 */
if ( to7_lightpen )
{
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
{
- thom_firq_2( space->machine(), 0 );
+ thom_firq_2( space.machine(), 0 );
to8_lightpen_intr = 0;
}
res = count & 0xff;
@@ -4975,12 +4975,12 @@ READ8_HANDLER ( mo6_gatearray_r )
break;
default:
- logerror( "$%04x mo6_gatearray_r: invalid offset %i\n", space->machine().device("maincpu")->safe_pcbase(), offset );
+ logerror( "$%04x mo6_gatearray_r: invalid offset %i\n", space.machine().device("maincpu")->safe_pcbase(), offset );
res = 0;
}
LOG_VIDEO(( "$%04x %f mo6_gatearray_r: off=%i ($%04X) res=$%02X lightpen=%i\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xa7e4 + offset, res, to7_lightpen ));
return res;
@@ -4991,7 +4991,7 @@ READ8_HANDLER ( mo6_gatearray_r )
WRITE8_HANDLER ( mo6_gatearray_w )
{
LOG_VIDEO(( "$%04x %f mo6_gatearray_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xa7e4 + offset, data ));
switch ( offset )
@@ -5005,23 +5005,23 @@ WRITE8_HANDLER ( mo6_gatearray_w )
if ( to8_reg_sys1 & 0x10 )
{
to8_reg_ram = data;
- mo6_update_ram_bank(space->machine());
+ mo6_update_ram_bank(space.machine());
}
break;
case 2: /* cartridge register */
to8_reg_cart = data;
- mo6_update_cart_bank(space->machine());
+ mo6_update_cart_bank(space.machine());
break;
case 3: /* system register 1 */
to8_reg_sys1 = data;
- mo6_update_ram_bank(space->machine());
- mo6_update_cart_bank(space->machine());
+ mo6_update_ram_bank(space.machine());
+ mo6_update_cart_bank(space.machine());
break;
default:
- logerror( "$%04x mo6_gatearray_w: invalid offset %i (data=$%02X)\n", space->machine().device("maincpu")->safe_pcbase(), offset, data );
+ logerror( "$%04x mo6_gatearray_w: invalid offset %i (data=$%02X)\n", space.machine().device("maincpu")->safe_pcbase(), offset, data );
}
}
@@ -5035,7 +5035,7 @@ READ8_HANDLER ( mo6_vreg_r )
/* 0xa7dc from external floppy drive aliases the video gate-array */
if ( ( offset == 3 ) && ( to8_reg_ram & 0x80 ) )
{
- if ( !space->debugger_access() )
+ if ( !space.debugger_access() )
return to7_floppy_r( space, 0xc );
}
@@ -5061,7 +5061,7 @@ READ8_HANDLER ( mo6_vreg_r )
WRITE8_HANDLER ( mo6_vreg_w )
{
LOG_VIDEO(( "$%04x %f mo6_vreg_w: off=%i ($%04X) data=$%02X\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(),
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(),
offset, 0xa7da + offset, data ));
switch ( offset )
@@ -5076,7 +5076,7 @@ WRITE8_HANDLER ( mo6_vreg_w )
if ( ( to8_reg_sys1 & 0x80 ) && ( to8_reg_ram & 0x80 ) )
to7_floppy_w( space, 0xc, data );
else
- to9_set_video_mode( space->machine(), data, 2 );
+ to9_set_video_mode( space.machine(), data, 2 );
break;
case 3: /* system register 2 */
@@ -5086,9 +5086,9 @@ WRITE8_HANDLER ( mo6_vreg_w )
else
{
to8_reg_sys2 = data;
- thom_set_video_page( space->machine(), data >> 6 );
- thom_set_border_color( space->machine(), data & 15 );
- mo6_update_cart_bank(space->machine());
+ thom_set_video_page( space.machine(), data >> 6 );
+ thom_set_border_color( space.machine(), data & 15 );
+ mo6_update_cart_bank(space.machine());
}
break;
@@ -5213,13 +5213,13 @@ MACHINE_START ( mo6 )
READ8_HANDLER ( mo5nr_net_r )
{
- if ( space->debugger_access() )
+ if ( space.debugger_access() )
return 0;
if ( to7_controller_type )
return to7_floppy_r ( space, offset );
- logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), offset );
+ logerror( "$%04x %f mo5nr_net_r: read from reg %i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), offset );
return 0;
}
@@ -5232,7 +5232,7 @@ WRITE8_HANDLER ( mo5nr_net_w )
to7_floppy_w ( space, offset, data );
else
logerror( "$%04x %f mo5nr_net_w: write $%02X to reg %i\n",
- space->machine().device("maincpu")->safe_pcbase(), space->machine().time().as_double(), data, offset );
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data, offset );
}
@@ -5245,7 +5245,7 @@ WRITE8_HANDLER ( mo5nr_net_w )
READ8_HANDLER( mo5nr_prn_r )
{
- centronics_device *printer = space->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
UINT8 result = 0;
result |= !printer->busy_r() << 7;
@@ -5256,7 +5256,7 @@ READ8_HANDLER( mo5nr_prn_r )
WRITE8_HANDLER( mo5nr_prn_w )
{
- centronics_device *printer = space->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
/* TODO: understand other bits */
printer->strobe_w(BIT(data, 3));
diff --git a/src/mess/machine/ti85.c b/src/mess/machine/ti85.c
index 7147beff7aa..f065c7f8017 100644
--- a/src/mess/machine/ti85.c
+++ b/src/mess/machine/ti85.c
@@ -38,17 +38,17 @@ static TIMER_CALLBACK(ti85_timer_callback)
}
}
-inline void ti8x_update_bank(address_space *space, UINT8 bank, UINT8 *base, UINT8 page, bool is_ram)
+inline void ti8x_update_bank(address_space &space, UINT8 bank, UINT8 *base, UINT8 page, bool is_ram)
{
- ti85_state *state = space->machine().driver_data<ti85_state>();
+ ti85_state *state = space.machine().driver_data<ti85_state>();
static const char *const tag[] = {"bank1", "bank2", "bank3", "bank4"};
state->membank(tag[bank&3])->set_base(base + (0x4000 * page));
if (is_ram)
- space->install_write_bank(bank * 0x4000, bank * 0x4000 + 0x3fff, tag[bank&3]);
+ space.install_write_bank(bank * 0x4000, bank * 0x4000 + 0x3fff, tag[bank&3]);
else
- space->nop_write(bank * 0x4000, bank * 0x4000 + 0x3fff);
+ space.nop_write(bank * 0x4000, bank * 0x4000 + 0x3fff);
}
static void update_ti85_memory (running_machine &machine)
@@ -60,7 +60,7 @@ static void update_ti85_memory (running_machine &machine)
static void update_ti83p_memory (running_machine &machine)
{
ti85_state *state = machine.driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
if (state->m_ti8x_memory_page_1 & 0x40)
{
@@ -84,7 +84,7 @@ static void update_ti83p_memory (running_machine &machine)
static void update_ti86_memory (running_machine &machine)
{
ti85_state *state = machine.driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
if (state->m_ti8x_memory_page_1 & 0x40)
{
@@ -112,7 +112,7 @@ static void update_ti86_memory (running_machine &machine)
void ti85_state::machine_start()
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_bios = memregion("bios")->base();
m_timer_interrupt_mask = 0;
@@ -133,8 +133,8 @@ void ti85_state::machine_start()
machine().scheduler().timer_pulse(attotime::from_hz(200), FUNC(ti85_timer_callback));
- space->unmap_write(0x0000, 0x3fff);
- space->unmap_write(0x4000, 0x7fff);
+ space.unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x4000, 0x7fff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios + 0x04000);
}
@@ -149,7 +149,7 @@ MACHINE_RESET_MEMBER(ti85_state,ti85)
MACHINE_START_MEMBER(ti85_state,ti83p)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_bios = memregion("bios")->base();
m_timer_interrupt_mask = 0;
@@ -171,9 +171,9 @@ MACHINE_START_MEMBER(ti85_state,ti83p)
m_ti8x_ram = auto_alloc_array(machine(), UINT8, 32*1024);
memset(m_ti8x_ram, 0, sizeof(UINT8)*32*1024);
- space->unmap_write(0x0000, 0x3fff);
- space->unmap_write(0x4000, 0x7fff);
- space->unmap_write(0x8000, 0xbfff);
+ space.unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x4000, 0x7fff);
+ space.unmap_write(0x8000, 0xbfff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios);
@@ -187,7 +187,7 @@ MACHINE_START_MEMBER(ti85_state,ti83p)
MACHINE_START_MEMBER(ti85_state,ti86)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_bios = memregion("bios")->base();
m_timer_interrupt_mask = 0;
@@ -209,7 +209,7 @@ MACHINE_START_MEMBER(ti85_state,ti86)
m_ti8x_ram = auto_alloc_array(machine(), UINT8, 128*1024);
memset(m_ti8x_ram, 0, sizeof(UINT8)*128*1024);
- space->unmap_write(0x0000, 0x3fff);
+ space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(m_bios);
membank("bank2")->set_base(m_bios + 0x04000);
@@ -608,7 +608,7 @@ static void ti8x_snapshot_setup_registers (running_machine &machine, UINT8 * dat
static void ti85_setup_snapshot (running_machine &machine, UINT8 * data)
{
ti85_state *state = machine.driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
int i;
unsigned char lo,hi;
unsigned char * hdw = data + 0x8000 + 0x94;
@@ -617,7 +617,7 @@ static void ti85_setup_snapshot (running_machine &machine, UINT8 * data)
/* Memory dump */
for (i = 0; i < 0x8000; i++)
- space->write_byte(i + 0x8000, data[i+0x94]);
+ space.write_byte(i + 0x8000, data[i+0x94]);
state->m_keypad_mask = hdw[0x00]&0x7f;
diff --git a/src/mess/machine/trs80.c b/src/mess/machine/trs80.c
index b420bea7fe2..01232da6a84 100644
--- a/src/mess/machine/trs80.c
+++ b/src/mess/machine/trs80.c
@@ -892,9 +892,9 @@ MACHINE_RESET_MEMBER(trs80_state,trs80m4)
MACHINE_RESET_MEMBER(trs80_state,lnw80)
{
- address_space *space = m_maincpu->space(AS_PROGRAM);
+ address_space &space = *m_maincpu->space(AS_PROGRAM);
m_cassette_data = 0;
m_reg_load = 1;
- lnw80_fe_w(*space, 0, 0);
+ lnw80_fe_w(space, 0, 0);
}
diff --git a/src/mess/machine/upd71071.c b/src/mess/machine/upd71071.c
index e174ce846eb..4259cdee307 100644
--- a/src/mess/machine/upd71071.c
+++ b/src/mess/machine/upd71071.c
@@ -123,7 +123,7 @@ static TIMER_CALLBACK(dma_transfer_timer)
// single byte or word transfer
device_t* device = (device_t*)ptr;
upd71071_t* dmac = get_safe_token(device);
- address_space* space = device->machine().device(dmac->intf->cputag)->memory().space(AS_PROGRAM);
+ address_space& space = *device->machine().device(dmac->intf->cputag)->memory().space(AS_PROGRAM);
int channel = param;
UINT16 data = 0; // data to transfer
@@ -134,7 +134,7 @@ static TIMER_CALLBACK(dma_transfer_timer)
case 0x04: // I/O -> memory
if(dmac->intf->dma_read[channel])
data = dmac->intf->dma_read[channel](device->machine());
- space->write_byte(dmac->reg.address_current[channel],data & 0xff);
+ space.write_byte(dmac->reg.address_current[channel],data & 0xff);
if(dmac->reg.mode_control[channel] & 0x20) // Address direction
dmac->reg.address_current[channel]--;
else
@@ -152,7 +152,7 @@ static TIMER_CALLBACK(dma_transfer_timer)
dmac->reg.count_current[channel]--;
break;
case 0x08: // memory -> I/O
- data = space->read_byte(dmac->reg.address_current[channel]);
+ data = space.read_byte(dmac->reg.address_current[channel]);
if(dmac->intf->dma_read[channel])
dmac->intf->dma_write[channel](device->machine(),data);
if(dmac->reg.mode_control[channel] & 0x20) // Address direction
diff --git a/src/mess/machine/vector06.c b/src/mess/machine/vector06.c
index b313119afb0..394ae4d8b77 100644
--- a/src/mess/machine/vector06.c
+++ b/src/mess/machine/vector06.c
@@ -170,13 +170,13 @@ void vector06_state::machine_start()
void vector06_state::machine_reset()
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
machine().device("maincpu")->execute().set_irq_acknowledge_callback(vector06_irq_callback);
- space->install_read_bank (0x0000, 0x7fff, "bank1");
- space->install_write_bank(0x0000, 0x7fff, "bank2");
- space->install_read_bank (0x8000, 0xffff, "bank3");
- space->install_write_bank(0x8000, 0xffff, "bank4");
+ space.install_read_bank (0x0000, 0x7fff, "bank1");
+ space.install_write_bank(0x0000, 0x7fff, "bank2");
+ space.install_read_bank (0x8000, 0xffff, "bank3");
+ space.install_write_bank(0x8000, 0xffff, "bank4");
membank("bank1")->set_base(memregion("maincpu")->base() + 0x10000);
membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x0000);
diff --git a/src/mess/machine/vtech2.c b/src/mess/machine/vtech2.c
index d0758f8c67c..e06c146ad64 100644
--- a/src/mess/machine/vtech2.c
+++ b/src/mess/machine/vtech2.c
@@ -31,19 +31,19 @@ static const UINT8 laser_fdc_wrprot[2] = {0x80, 0x80};
static void mwa_bank(running_machine &machine, int bank, int offs, int data);
/* wrappers for bank #1 to #4 */
-static WRITE8_HANDLER ( mwa_bank1 ) { mwa_bank(space->machine(), 0,offset,data); }
-static WRITE8_HANDLER ( mwa_bank2 ) { mwa_bank(space->machine(), 1,offset,data); }
-static WRITE8_HANDLER ( mwa_bank3 ) { mwa_bank(space->machine(), 2,offset,data); }
-static WRITE8_HANDLER ( mwa_bank4 ) { mwa_bank(space->machine(), 3,offset,data); }
+static WRITE8_HANDLER ( mwa_bank1 ) { mwa_bank(space.machine(), 0,offset,data); }
+static WRITE8_HANDLER ( mwa_bank2 ) { mwa_bank(space.machine(), 1,offset,data); }
+static WRITE8_HANDLER ( mwa_bank3 ) { mwa_bank(space.machine(), 2,offset,data); }
+static WRITE8_HANDLER ( mwa_bank4 ) { mwa_bank(space.machine(), 3,offset,data); }
/* read from banked memory (handle memory mapped i/o) */
static int mra_bank(running_machine &machine, int bank, int offs);
/* wrappers for bank #1 to #4 */
-static READ8_HANDLER ( mra_bank1 ) { return mra_bank(space->machine(),0,offset); }
-static READ8_HANDLER ( mra_bank2 ) { return mra_bank(space->machine(),1,offset); }
-static READ8_HANDLER ( mra_bank3 ) { return mra_bank(space->machine(),2,offset); }
-static READ8_HANDLER ( mra_bank4 ) { return mra_bank(space->machine(),3,offset); }
+static READ8_HANDLER ( mra_bank1 ) { return mra_bank(space.machine(),0,offset); }
+static READ8_HANDLER ( mra_bank2 ) { return mra_bank(space.machine(),1,offset); }
+static READ8_HANDLER ( mra_bank3 ) { return mra_bank(space.machine(),2,offset); }
+static READ8_HANDLER ( mra_bank4 ) { return mra_bank(space.machine(),3,offset); }
/* read banked memory (handle memory mapped i/o) */
static const struct { read8_space_func func; const char *name; } mra_bank_soft[4] =
diff --git a/src/mess/machine/wswan.c b/src/mess/machine/wswan.c
index 9efc0c83209..2912d891507 100644
--- a/src/mess/machine/wswan.c
+++ b/src/mess/machine/wswan.c
@@ -223,7 +223,7 @@ MACHINE_START_MEMBER(wswan_state,wscolor)
void wswan_state::machine_reset()
{
- address_space *space = machine().device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &space = *machine().device( "maincpu")->memory().space( AS_PROGRAM );
/* Intialize ports */
memcpy( m_ws_portram, ws_portram_init, 256 );
@@ -231,8 +231,8 @@ void wswan_state::machine_reset()
/* Initialize VDP */
memset( &m_vdp, 0, sizeof( m_vdp ) );
- m_vdp.vram = (UINT8*)space->get_read_ptr(0);
- m_vdp.palette_vram = (UINT8*)space->get_read_ptr(( m_system_type == TYPE_WSC ) ? 0xFE00 : 0 );
+ m_vdp.vram = (UINT8*)space.get_read_ptr(0);
+ m_vdp.palette_vram = (UINT8*)space.get_read_ptr(( m_system_type == TYPE_WSC ) ? 0xFE00 : 0 );
m_vdp.current_line = 145; /* Randomly chosen, beginning of VBlank period to give cart some time to boot up */
m_vdp.color_mode = 0;
m_vdp.colors_16 = 0;
@@ -1459,9 +1459,9 @@ static TIMER_CALLBACK(wswan_scanline_interrupt)
/* Handle Sound DMA */
if ( ( state->m_sound_dma.enable & 0x88 ) == 0x80 )
{
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM );
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM );
/* TODO: Output sound DMA byte */
- state->wswan_port_w( *space, 0x89, space->read_byte(state->m_sound_dma.source ) );
+ state->wswan_port_w( space, 0x89, space.read_byte(state->m_sound_dma.source ) );
state->m_sound_dma.size--;
state->m_sound_dma.source = ( state->m_sound_dma.source + 1 ) & 0x0FFFFF;
if ( state->m_sound_dma.size == 0 )
diff --git a/src/mess/machine/x68k_neptunex.c b/src/mess/machine/x68k_neptunex.c
index 58fb3868162..f045b52b09c 100644
--- a/src/mess/machine/x68k_neptunex.c
+++ b/src/mess/machine/x68k_neptunex.c
@@ -47,14 +47,14 @@ void x68k_neptune_device::device_start()
device_t* cpu = machine().device("maincpu");
char mac[7];
UINT32 num = rand();
- address_space* space = cpu->memory().space(AS_PROGRAM);
+ address_space& space = *cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
memset(m_prom, 0x57, 16);
sprintf(mac+2, "\x1b%c%c%c", (num >> 16) & 0xff, (num >> 8) & 0xff, num & 0xff);
mac[0] = 0; mac[1] = 0; // avoid gcc warning
memcpy(m_prom, mac, 6);
m_dp8390->set_mac(mac);
- space->install_readwrite_handler(0xece000,0xece3ff,read16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_r),this),write16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_w),this),0xffffffff);
+ space.install_readwrite_handler(0xece000,0xece3ff,read16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_r),this),write16_delegate(FUNC(x68k_neptune_device::x68k_neptune_port_w),this),0xffffffff);
}
void x68k_neptune_device::device_reset() {
diff --git a/src/mess/machine/x68k_scsiext.c b/src/mess/machine/x68k_scsiext.c
index b9e33e81c0e..4c207dd2906 100644
--- a/src/mess/machine/x68k_scsiext.c
+++ b/src/mess/machine/x68k_scsiext.c
@@ -68,13 +68,13 @@ void x68k_scsiext_device::device_start()
device_t* cpu = machine().device("maincpu");
UINT8* ROM;
astring temp;
- address_space* space = cpu->memory().space(AS_PROGRAM);
+ address_space& space = *cpu->memory().space(AS_PROGRAM);
m_slot = dynamic_cast<x68k_expansion_slot_device *>(owner());
- space->install_read_bank(0xea0020,0xea1fff,0,0,"scsi_ext");
- space->unmap_write(0xea0020,0xea1fff,0,0);
+ space.install_read_bank(0xea0020,0xea1fff,0,0,"scsi_ext");
+ space.unmap_write(0xea0020,0xea1fff,0,0);
ROM = machine().root_device().memregion(subtag(temp,"scsiexrom"))->base();
machine().root_device().membank("scsi_ext")->set_base(ROM);
- space->install_readwrite_handler(0xea0000,0xea001f,0,0,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff);
+ space.install_readwrite_handler(0xea0000,0xea001f,0,0,read8_delegate(FUNC(x68k_scsiext_device::register_r),this),write8_delegate(FUNC(x68k_scsiext_device::register_w),this),0x00ff00ff);
}
void x68k_scsiext_device::device_reset()
diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c
index ff97265ea7b..47e7394119a 100644
--- a/src/mess/machine/z80ne.c
+++ b/src/mess/machine/z80ne.c
@@ -184,12 +184,12 @@ DIRECT_UPDATE_MEMBER(z80ne_state::z80ne_nmi_delay_count)
*/
DIRECT_UPDATE_MEMBER(z80ne_state::z80ne_reset_delay_count)
{
- address_space *space = machine().device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("z80ne")->memory().space(AS_PROGRAM);
/*
* TODO: when debugger is active, his memory access causes this callback
*
*/
- if(!space->debugger_access())
+ if(!space.debugger_access())
m_reset_delay_counter--;
if (!m_reset_delay_counter)
@@ -213,7 +213,7 @@ static void reset_lx388(running_machine &machine)
static void reset_lx382_banking(running_machine &machine)
{
z80ne_state *state = machine.driver_data<z80ne_state>();
- address_space *space = machine.device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("z80ne")->memory().space(AS_PROGRAM);
/* switch to ROM bank at address 0x0000 */
state->membank("bank1")->set_entry(1);
@@ -221,13 +221,13 @@ static void reset_lx382_banking(running_machine &machine)
/* after the first 3 bytes have been read from ROM, switch the RAM back in */
state->m_reset_delay_counter = 2;
- space->set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
}
static void reset_lx390_banking(running_machine &machine)
{
z80ne_state *state = machine.driver_data<z80ne_state>();
- address_space *space = machine.device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("z80ne")->memory().space(AS_PROGRAM);
state->m_reset_delay_counter = 0;
switch (machine.root_device().ioport("CONFIG")->read() & 0x07) {
@@ -240,7 +240,7 @@ static void reset_lx390_banking(running_machine &machine)
state->membank("bank4")->set_entry(0); /* RAM at 0xF000 */
/* after the first 3 bytes have been read from ROM, switch the RAM back in */
state->m_reset_delay_counter = 2;
- space->set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
+ space.set_direct_update_handler(direct_update_delegate(FUNC(z80ne_state::z80ne_reset_delay_count), state));
break;
case 0x02: /* EP548 16k BASIC */
if (VERBOSE)
@@ -288,7 +288,7 @@ static void reset_lx390_banking(running_machine &machine)
MACHINE_RESET_MEMBER(z80ne_state,z80ne_base)
{
int i;
- address_space *space = machine().device("z80ne")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("z80ne")->memory().space(AS_PROGRAM);
LOG(("In MACHINE_RESET z80ne_base\n"));
@@ -336,7 +336,7 @@ MACHINE_RESET_MEMBER(z80ne_state,z80ne_base)
ay31015_set_transmitter_clock( m_ay31015, m_cass_data.speed * 16.0);
m_nmi_delay_counter = 0;
- lx385_ctrl_w(*space, 0, 0);
+ lx385_ctrl_w(space, 0, 0);
}
diff --git a/src/mess/machine/zx.c b/src/mess/machine/zx.c
index 1d26d10c68c..adb15f86cc8 100644
--- a/src/mess/machine/zx.c
+++ b/src/mess/machine/zx.c
@@ -13,9 +13,9 @@
#define DEBUG_ZX81_PORTS 1
#define DEBUG_ZX81_VSYNC 1
-#define LOG_ZX81_IOR(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space->machine().primary_screen->vpos(), _comment); } while (0)
-#define LOG_ZX81_IOW(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space->machine().primary_screen->vpos(), _comment); } while (0)
-#define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", space->machine().primary_screen->vpos()); } while (0)
+#define LOG_ZX81_IOR(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOR: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().primary_screen->vpos(), _comment); } while (0)
+#define LOG_ZX81_IOW(_comment) do { if (DEBUG_ZX81_PORTS) logerror("ZX81 IOW: %04x, Data: %02x, Scanline: %d (%s)\n", offset, data, space.machine().primary_screen->vpos(), _comment); } while (0)
+#define LOG_ZX81_VSYNC do { if (DEBUG_ZX81_VSYNC) logerror("VSYNC starts in scanline: %d\n", space.machine().primary_screen->vpos()); } while (0)
WRITE8_MEMBER(zx_state::zx_ram_w)
@@ -44,10 +44,10 @@ READ8_MEMBER( zx_state::zx_ram_r )
DRIVER_INIT_MEMBER(zx_state,zx)
{
- address_space *space = machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine().device("maincpu")->memory().space(AS_PROGRAM);
- space->install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
- space->install_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, write8_delegate(FUNC(zx_state::zx_ram_w),this));
+ space.install_read_bank(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, "bank1");
+ space.install_write_handler(0x4000, 0x4000 + machine().device<ram_device>(RAM_TAG)->size() - 1, write8_delegate(FUNC(zx_state::zx_ram_w),this));
membank("bank1")->set_base(memregion("maincpu")->base() + 0x4000);
}
diff --git a/src/mess/video/a7800.c b/src/mess/video/a7800.c
index e78c5265918..0e05127d4cb 100644
--- a/src/mess/video/a7800.c
+++ b/src/mess/video/a7800.c
@@ -28,7 +28,7 @@
#define TRIGGER_HSYNC 64717
-#define READ_MEM(x) space->read_byte(x)
+#define READ_MEM(x) space.read_byte(x)
/********** Maria ***********/
@@ -86,7 +86,7 @@ void a7800_state::video_start()
static void maria_draw_scanline(running_machine &machine)
{
a7800_state *state = machine.driver_data<a7800_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
unsigned int graph_adr,data_addr;
int width,hpos,pal,mode,ind;
unsigned int dl;
@@ -321,7 +321,7 @@ TIMER_DEVICE_CALLBACK( a7800_interrupt )
a7800_state *state = timer.machine().driver_data<a7800_state>();
int frame_scanline;
UINT8 *ROM = timer.machine().root_device().memregion("maincpu")->base();
- address_space* space = timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *timer.machine().device("maincpu")->memory().space(AS_PROGRAM);
state->m_maria_scanline++;
diff --git a/src/mess/video/ac1.c b/src/mess/video/ac1.c
index a9566b833ee..728cc44cfd2 100644
--- a/src/mess/video/ac1.c
+++ b/src/mess/video/ac1.c
@@ -29,13 +29,13 @@ void ac1_state::video_start()
SCREEN_UPDATE_IND16( ac1 )
{
int x,y;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(y = 0; y < 16; y++ )
{
for(x = 0; x < 64; x++ )
{
- int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64);
+ int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, 63*6-x*6,15*8-y*8);
}
}
@@ -45,13 +45,13 @@ SCREEN_UPDATE_IND16( ac1 )
SCREEN_UPDATE_IND16( ac1_32 )
{
int x,y;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(y = 0; y < 32; y++ )
{
for(x = 0; x < 64; x++ )
{
- int code = space->read_byte(AC1_VIDEO_MEMORY + x + y*64);
+ int code = space.read_byte(AC1_VIDEO_MEMORY + x + y*64);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, 63*6-x*6,31*8-y*8);
}
}
diff --git a/src/mess/video/apple3.c b/src/mess/video/apple3.c
index cfcea2b8c7b..8cc15336dea 100644
--- a/src/mess/video/apple3.c
+++ b/src/mess/video/apple3.c
@@ -40,7 +40,7 @@ static const UINT32 text_map[] =
void apple3_write_charmem(running_machine &machine)
{
apple3_state *state = machine.driver_data<apple3_state>();
- address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space& space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
static const UINT32 screen_hole_map[] =
{
0x478, 0x4f8, 0x578, 0x5f8, 0x678, 0x6f8, 0x778, 0x7f8
@@ -52,12 +52,12 @@ void apple3_write_charmem(running_machine &machine)
{
for (j = 0; j < 4; j++)
{
- addr = 0x7f & space->read_byte(screen_hole_map[i] + 0x400 + j + 0);
- val = space->read_byte(screen_hole_map[i] + j + 0);
+ addr = 0x7f & space.read_byte(screen_hole_map[i] + 0x400 + j + 0);
+ val = space.read_byte(screen_hole_map[i] + j + 0);
state->m_char_mem[((addr * 8) + ((i & 3) * 2) + 0) & 0x3ff] = val;
- addr = 0x7f & space->read_byte(screen_hole_map[i] + 0x400 + j + 4);
- val = space->read_byte(screen_hole_map[i] + j + 4);
+ addr = 0x7f & space.read_byte(screen_hole_map[i] + 0x400 + j + 4);
+ val = space.read_byte(screen_hole_map[i] + j + 4);
state->m_char_mem[((addr * 8) + ((i & 3) * 2) + 1) & 0x3ff] = val;
}
}
diff --git a/src/mess/video/bbc.c b/src/mess/video/bbc.c
index 05ac2730f6c..e132ede0151 100644
--- a/src/mess/video/bbc.c
+++ b/src/mess/video/bbc.c
@@ -611,12 +611,12 @@ WRITE8_MEMBER(bbc_state::bbc_6845_w)
READ8_HANDLER (bbc_6845_r)
{
- mc6845_device *mc6845 = space->machine().device<mc6845_device>("mc6845");
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>("mc6845");
switch (offset&1)
{
- case 0: return mc6845->status_r(*space,0); break;
- case 1: return mc6845->register_r(*space,0); break;
+ case 0: return mc6845->status_r(space,0); break;
+ case 1: return mc6845->register_r(space,0); break;
}
return 0;
diff --git a/src/mess/video/cgenie.c b/src/mess/video/cgenie.c
index 689f00992bb..043d97a35a8 100644
--- a/src/mess/video/cgenie.c
+++ b/src/mess/video/cgenie.c
@@ -58,7 +58,7 @@ static void cgenie_offset_xy(cgenie_state *state)
***************************************************************************/
WRITE8_HANDLER ( cgenie_register_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
//int addr;
switch (state->m_crt.idx)
@@ -160,7 +160,7 @@ WRITE8_HANDLER ( cgenie_register_w )
***************************************************************************/
WRITE8_HANDLER ( cgenie_index_w )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_crt.idx = data & 15;
}
@@ -169,8 +169,8 @@ WRITE8_HANDLER ( cgenie_index_w )
***************************************************************************/
READ8_HANDLER ( cgenie_register_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
- return cgenie_get_register(space->machine(), state->m_crt.idx);
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
+ return cgenie_get_register(space.machine(), state->m_crt.idx);
}
/***************************************************************************
@@ -222,7 +222,7 @@ int cgenie_get_register(running_machine &machine, int indx)
***************************************************************************/
READ8_HANDLER ( cgenie_index_r )
{
- cgenie_state *state = space->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_crt.idx;
}
diff --git a/src/mess/video/cirrus.c b/src/mess/video/cirrus.c
index b2e43c84069..16c4d71ba41 100644
--- a/src/mess/video/cirrus.c
+++ b/src/mess/video/cirrus.c
@@ -163,7 +163,7 @@ const struct pc_svga_interface cirrus_svga_interface =
void cirrus_device::device_start()
{
pc_vga_init(machine(), NULL, &cirrus_svga_interface);
- pc_vga_io_init(machine(), machine().device("ppc1")->memory().space(AS_PROGRAM), 0xC00A0000, machine().device("ppc1")->memory().space(AS_PROGRAM), 0x80000000);
+ pc_vga_io_init(machine(), *machine().device("ppc1")->memory().space(AS_PROGRAM), 0xC00A0000, *machine().device("ppc1")->memory().space(AS_PROGRAM), 0x80000000);
}
//-------------------------------------------------
diff --git a/src/mess/video/dai.c b/src/mess/video/dai.c
index 895138ab858..f173e60f121 100644
--- a/src/mess/video/dai.c
+++ b/src/mess/video/dai.c
@@ -58,7 +58,7 @@ void dai_state::video_start()
SCREEN_UPDATE_IND16( dai )
{
dai_state *state = screen.machine().driver_data<dai_state>();
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
int i, j, k, l;
UINT8* char_rom = state->memregion("gfx1")->base();
@@ -102,8 +102,8 @@ SCREEN_UPDATE_IND16( dai )
while (current_scan_line < dai_scan_lines)
{
- mode = space->read_byte(current_video_memory_address--);
- colour = space->read_byte(current_video_memory_address--);
+ mode = space.read_byte(current_video_memory_address--);
+ colour = space.read_byte(current_video_memory_address--);
line_repeat_count = mode & 0x0f;
horizontal_resolution = (mode & 0x30) >> 4;
display_mode = (mode & 0xc0) >> 6;
@@ -123,8 +123,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<11; i++)
{
@@ -143,8 +143,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -163,8 +163,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<22; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -182,8 +182,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -202,8 +202,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<44; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -220,8 +220,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -240,8 +240,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<66; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -258,8 +258,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -284,8 +284,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<11; i++)
{
@@ -304,8 +304,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -325,8 +325,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<22; i++)
{
@@ -345,8 +345,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -366,8 +366,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<44; i++)
{
@@ -385,8 +385,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -405,8 +405,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (i=0; i<66; i++)
{
@@ -424,8 +424,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address);
- current_data_2 = space->read_byte(current_video_memory_address-1);
+ current_data_1 = space.read_byte(current_video_memory_address);
+ current_data_2 = space.read_byte(current_video_memory_address-1);
current_video_memory_address-=2;
for (j=0; j<=line_repeat_count; j++)
{
@@ -450,8 +450,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<11; i++)
{
@@ -470,8 +470,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -490,8 +490,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<22; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -509,8 +509,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -529,8 +529,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<44; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -547,8 +547,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -567,8 +567,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<66; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -585,8 +585,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -610,8 +610,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<11; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -629,8 +629,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<11; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -649,8 +649,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<22; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -668,8 +668,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<22; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -688,8 +688,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<44; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -706,8 +706,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<44; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
@@ -725,8 +725,8 @@ SCREEN_UPDATE_IND16( dai )
switch (unit_mode)
{
case 0:
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (i=0; i<66; i++)
{
for (j=0; j<=line_repeat_count; j++)
@@ -743,8 +743,8 @@ SCREEN_UPDATE_IND16( dai )
case 1:
for (i=0; i<66; i++)
{
- current_data_1 = space->read_byte(current_video_memory_address--);
- current_data_2 = space->read_byte(current_video_memory_address--);
+ current_data_1 = space.read_byte(current_video_memory_address--);
+ current_data_2 = space.read_byte(current_video_memory_address--);
for (j=0; j<=line_repeat_count; j++)
{
for (k=0; k<8; k++)
diff --git a/src/mess/video/dgn_beta.c b/src/mess/video/dgn_beta.c
index 3881af5e88c..747f6cacb94 100644
--- a/src/mess/video/dgn_beta.c
+++ b/src/mess/video/dgn_beta.c
@@ -298,6 +298,6 @@ void dgnbeta_vid_set_gctrl(running_machine &machine, int data)
/* Write handler for colour, pallate ram */
WRITE8_HANDLER(dgnbeta_colour_ram_w)
{
- dgn_beta_state *state = space->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
state->m_ColourRAM[offset]=data&0x0f; /* Colour ram 4 bit and write only to CPU */
}
diff --git a/src/mess/video/epnick.c b/src/mess/video/epnick.c
index 5bd81760def..0e50d3aeabc 100644
--- a/src/mess/video/epnick.c
+++ b/src/mess/video/epnick.c
@@ -968,7 +968,7 @@ READ8_HANDLER( nick_reg_r )
WRITE8_HANDLER( epnick_reg_w )
{
- ep_state *state = space->machine().driver_data<ep_state>();
+ ep_state *state = space.machine().driver_data<ep_state>();
NICK_STATE *nick = state->nick;
//mame_printf_info("Nick write %02x %02x\r\n",offset, data);
diff --git a/src/mess/video/galaxy.c b/src/mess/video/galaxy.c
index db652cecf24..08bae05ecd7 100644
--- a/src/mess/video/galaxy.c
+++ b/src/mess/video/galaxy.c
@@ -16,7 +16,7 @@
static TIMER_CALLBACK( gal_video )
{
galaxy_state *state = machine.driver_data<galaxy_state>();
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
int y, x;
if (state->m_interrupts_enabled == TRUE)
{
@@ -39,7 +39,7 @@ static TIMER_CALLBACK( gal_video )
}
else
{
- state->m_code = space->read_byte(addr) & 0xbf;
+ state->m_code = space.read_byte(addr) & 0xbf;
state->m_code += (state->m_code & 0x80) >> 1;
state->m_code = gfx[(state->m_code & 0x7f) +(dat << 7 )] ^ 0xff;
state->m_first = 0;
@@ -68,7 +68,7 @@ static TIMER_CALLBACK( gal_video )
}
else
{
- state->m_code = space->read_byte(addr) ^ 0xff;
+ state->m_code = space.read_byte(addr) ^ 0xff;
state->m_first = 0;
}
y = state->m_gal_cnt / 48 - 2;
@@ -81,7 +81,7 @@ static TIMER_CALLBACK( gal_video )
}
if ((x / 8 >= 11) && (x / 8 < 44))
{
- state->m_code = space->read_byte(state->m_start_addr + y * 32 + (state->m_gal_cnt % 48) - 11) ^ 0xff;
+ state->m_code = space.read_byte(state->m_start_addr + y * 32 + (state->m_gal_cnt % 48) - 11) ^ 0xff;
}
else
{
diff --git a/src/mess/video/gb.c b/src/mess/video/gb.c
index dc036c7001d..7adbd2ef0e9 100644
--- a/src/mess/video/gb.c
+++ b/src/mess/video/gb.c
@@ -1222,7 +1222,7 @@ void gb_video_reset( running_machine &machine, int mode )
gb_state *state = machine.driver_data<gb_state>();
int i;
int vram_size = 0x2000;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
emu_timer *old_timer = state->m_lcd.lcd_timer;
memset( &state->m_lcd, 0, sizeof(state->m_lcd) );
@@ -1291,10 +1291,10 @@ void gb_video_reset( running_machine &machine, int mode )
machine.scheduler().timer_set(machine.device<cpu_device>("maincpu")->cycles_to_attotime(1), FUNC(gb_video_init_vbl));
/* Initialize some video registers */
- state->gb_video_w( *space, 0x0, 0x91 ); /* LCDCONT */
- state->gb_video_w( *space, 0x7, 0xFC ); /* BGRDPAL */
- state->gb_video_w( *space, 0x8, 0xFC ); /* SPR0PAL */
- state->gb_video_w( *space, 0x9, 0xFC ); /* SPR1PAL */
+ state->gb_video_w( space, 0x0, 0x91 ); /* LCDCONT */
+ state->gb_video_w( space, 0x7, 0xFC ); /* BGRDPAL */
+ state->gb_video_w( space, 0x8, 0xFC ); /* SPR0PAL */
+ state->gb_video_w( space, 0x9, 0xFC ); /* SPR1PAL */
CURLINE = state->m_lcd.current_line = 0;
LCDSTAT = ( LCDSTAT & 0xF8 ) | 0x05;
@@ -1332,14 +1332,14 @@ static void gbc_hdma(running_machine &machine, UINT16 length)
{
gb_state *state = machine.driver_data<gb_state>();
UINT16 src, dst;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
src = ((UINT16)HDMA1 << 8) | (HDMA2 & 0xF0);
dst = ((UINT16)(HDMA3 & 0x1F) << 8) | (HDMA4 & 0xF0);
dst |= 0x8000;
while( length > 0 )
{
- space->write_byte( dst++, space->read_byte( src++ ) );
+ space.write_byte( dst++, space.read_byte( src++ ) );
length--;
}
HDMA1 = src >> 8;
diff --git a/src/mess/video/gf4500.c b/src/mess/video/gf4500.c
index e85f4b7fc5d..23e833289f2 100644
--- a/src/mess/video/gf4500.c
+++ b/src/mess/video/gf4500.c
@@ -94,7 +94,7 @@ READ32_HANDLER( gf4500_r )
}
if ((offset < (GF4500_FRAMEBUF_OFFSET / 4)) || (offset >= ((GF4500_FRAMEBUF_OFFSET + (321 * 240 * 2)) / 4)))
{
- verboselog( space->machine(), 9, "(GFO) %08X -> %08X\n", 0x34000000 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(GFO) %08X -> %08X\n", 0x34000000 + (offset << 2), data);
}
return data;
}
@@ -104,7 +104,7 @@ WRITE32_HANDLER( gf4500_w )
COMBINE_DATA(&gf4500.data[offset]);
if ((offset < (GF4500_FRAMEBUF_OFFSET / 4)) || (offset >= ((GF4500_FRAMEBUF_OFFSET + (321 * 240 * 2)) / 4)))
{
- verboselog( space->machine(), 9, "(GFO) %08X <- %08X\n", 0x34000000 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(GFO) %08X <- %08X\n", 0x34000000 + (offset << 2), data);
}
switch (offset)
{
diff --git a/src/mess/video/hp48.c b/src/mess/video/hp48.c
index 9f1b406516d..bf932171ccf 100644
--- a/src/mess/video/hp48.c
+++ b/src/mess/video/hp48.c
@@ -123,14 +123,14 @@ void hp48_state::palette_init()
data >>= 1
#define draw_quart \
- UINT8 data = space->read_byte( addr ); \
+ UINT8 data = space.read_byte( addr ); \
draw_pixel; draw_pixel; draw_pixel; draw_pixel;
SCREEN_UPDATE_IND16 ( hp48 )
{
hp48_state *state = screen.machine().driver_data<hp48_state>();
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
int x, y, xp, i, addr;
int display = HP48_IO_4(0) >> 3; /* 1=on, 0=off */
int left_margin = HP48_IO_4(0) & 7; /* 0..7 pixels for main bitmap */
diff --git a/src/mess/video/intv.c b/src/mess/video/intv.c
index 44ab0f4292e..7c9ac63300d 100644
--- a/src/mess/video/intv.c
+++ b/src/mess/video/intv.c
@@ -729,7 +729,7 @@ void intv_stic_screenrefresh(running_machine &machine)
READ8_MEMBER( intv_state::intvkbd_tms9927_r )
{
- //intv_state *state = space->machine().driver_data<intv_state>();
+ //intv_state *state = space.machine().driver_data<intv_state>();
UINT8 rv;
switch (offset)
{
@@ -752,7 +752,7 @@ void intv_stic_screenrefresh(running_machine &machine)
WRITE8_MEMBER( intv_state::intvkbd_tms9927_w )
{
- //intv_state *state = space->machine().driver_data<intv_state>();
+ //intv_state *state = space.machine().driver_data<intv_state>();
switch (offset)
{
case 3:
diff --git a/src/mess/video/iq151_grafik.c b/src/mess/video/iq151_grafik.c
index 4d2853f2026..26f96ee1fc7 100644
--- a/src/mess/video/iq151_grafik.c
+++ b/src/mess/video/iq151_grafik.c
@@ -130,8 +130,8 @@ void iq151_grafik_device::io_read(offs_t offset, UINT8 &data)
{
if (offset >= 0xd0 && offset < 0xd4)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
- data = m_ppi8255->read(*space, offset & 3);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
+ data = m_ppi8255->read(space, offset & 3);
}
else if (offset == 0xd4)
{
@@ -150,8 +150,8 @@ void iq151_grafik_device::io_write(offs_t offset, UINT8 data)
{
if (offset >= 0xd0 && offset < 0xd4)
{
- address_space* space = machine().device("maincpu")->memory().space(AS_IO);
- m_ppi8255->write(*space, offset & 3, data);
+ address_space& space = *machine().device("maincpu")->memory().space(AS_IO);
+ m_ppi8255->write(space, offset & 3, data);
}
else if (offset == 0xd4)
{
diff --git a/src/mess/video/irisha.c b/src/mess/video/irisha.c
index a8d2b18f2c5..36129fcac03 100644
--- a/src/mess/video/irisha.c
+++ b/src/mess/video/irisha.c
@@ -20,15 +20,15 @@ SCREEN_UPDATE_IND16( irisha )
UINT8 code1; //, code2;
UINT8 col;
int y, x, b;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
// draw image
for (y = 0; y < 200; y++)
{
for (x = 0; x < 40; x++)
{
- code1 = space->read_byte(0xe000 + x + y * 40);
-// code2 = space->read_byte(0xc000 + x + y * 40);
+ code1 = space.read_byte(0xe000 + x + y * 40);
+// code2 = space.read_byte(0xc000 + x + y * 40);
for (b = 0; b < 8; b++)
{
col = ((code1 >> b) & 0x01);
diff --git a/src/mess/video/isa_cga.c b/src/mess/video/isa_cga.c
index 38394eaae77..24399eb247a 100644
--- a/src/mess/video/isa_cga.c
+++ b/src/mess/video/isa_cga.c
@@ -2013,9 +2013,9 @@ void isa8_cga_pc1512_device::device_start()
m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate( FUNC(isa8_cga_pc1512_device::io_read), this ), write8_delegate( FUNC(isa8_cga_pc1512_device::io_write), this ) );
m_isa->install_bank(0xb8000, 0xbbfff, 0, 0, "bank1", m_vram);
- address_space *space = machine().firstcpu->space( AS_PROGRAM );
+ address_space &space = *machine().firstcpu->space( AS_PROGRAM );
- space->install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
+ space.install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
}
void isa8_cga_pc1512_device::device_reset()
diff --git a/src/mess/video/isa_svga_cirrus.c b/src/mess/video/isa_svga_cirrus.c
index 2a8c9636a33..da4d8bc5f4a 100644
--- a/src/mess/video/isa_svga_cirrus.c
+++ b/src/mess/video/isa_svga_cirrus.c
@@ -58,7 +58,7 @@ isa8_svga_cirrus_device::isa8_svga_cirrus_device(const machine_config &mconfig,
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa8_svga_cirrus_device::device_start()
{
diff --git a/src/mess/video/isa_svga_s3.c b/src/mess/video/isa_svga_s3.c
index 7a3c7888e7a..5e8f0166122 100644
--- a/src/mess/video/isa_svga_s3.c
+++ b/src/mess/video/isa_svga_s3.c
@@ -58,7 +58,7 @@ isa16_svga_s3_device::isa16_svga_s3_device(const machine_config &mconfig, const
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa16_svga_s3_device::device_start()
{
diff --git a/src/mess/video/isa_svga_tseng.c b/src/mess/video/isa_svga_tseng.c
index 151bab29839..863ac977e90 100644
--- a/src/mess/video/isa_svga_tseng.c
+++ b/src/mess/video/isa_svga_tseng.c
@@ -57,7 +57,7 @@ isa8_svga_et4k_device::isa8_svga_et4k_device(const machine_config &mconfig, cons
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa8_svga_et4k_device::device_start()
{
diff --git a/src/mess/video/isa_vga.c b/src/mess/video/isa_vga.c
index 4705cdb474d..765555bcec4 100644
--- a/src/mess/video/isa_vga.c
+++ b/src/mess/video/isa_vga.c
@@ -57,7 +57,7 @@ isa8_vga_device::isa8_vga_device(const machine_config &mconfig, const char *tag,
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa8_vga_device::device_start()
{
diff --git a/src/mess/video/isa_vga_ati.c b/src/mess/video/isa_vga_ati.c
index 5d02810c16b..67f5dff6de7 100644
--- a/src/mess/video/isa_vga_ati.c
+++ b/src/mess/video/isa_vga_ati.c
@@ -61,7 +61,7 @@ isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconf
//-------------------------------------------------
// device_start - device-specific startup
//-------------------------------------------------
-static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space->machine().root_device().ioport("IN0")->read(); }
+static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); }
void isa16_vga_gfxultra_device::device_start()
{
diff --git a/src/mess/video/kramermc.c b/src/mess/video/kramermc.c
index f3f9ea13a17..da08a453071 100644
--- a/src/mess/video/kramermc.c
+++ b/src/mess/video/kramermc.c
@@ -30,13 +30,13 @@ void kramermc_state::video_start()
SCREEN_UPDATE_IND16( kramermc )
{
int x,y;
- address_space *space = screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *screen.machine().device("maincpu")->memory().space(AS_PROGRAM);
for(y = 0; y < 16; y++ )
{
for(x = 0; x < 64; x++ )
{
- int code = space->read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
+ int code = space.read_byte(KRAMERMC_VIDEO_MEMORY + x + y*64);
drawgfx_opaque(bitmap, cliprect, screen.machine().gfx[0], code , 0, 0,0, x*8,y*8);
}
}
diff --git a/src/mess/video/newport.c b/src/mess/video/newport.c
index 42fc6d2eb77..f37adb1832c 100644
--- a/src/mess/video/newport.c
+++ b/src/mess/video/newport.c
@@ -233,7 +233,7 @@ SCREEN_UPDATE_RGB32( newport )
static WRITE32_HANDLER( newport_cmap0_w )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -253,7 +253,7 @@ static WRITE32_HANDLER( newport_cmap0_w )
static READ32_HANDLER( newport_cmap0_r )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -271,7 +271,7 @@ static READ32_HANDLER( newport_cmap0_r )
static READ32_HANDLER( newport_cmap1_r )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -290,7 +290,7 @@ static READ32_HANDLER( newport_cmap1_r )
static READ32_HANDLER( newport_xmap0_r )
{
UINT8 nModeIdx;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -339,7 +339,7 @@ static READ32_HANDLER( newport_xmap0_r )
static WRITE32_HANDLER( newport_xmap0_w )
{
UINT8 n8BitVal = data & 0x000000ff;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -378,7 +378,7 @@ static WRITE32_HANDLER( newport_xmap0_w )
static READ32_HANDLER( newport_xmap1_r )
{
UINT8 nModeIdx;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -427,7 +427,7 @@ static READ32_HANDLER( newport_xmap1_r )
static WRITE32_HANDLER( newport_xmap1_w )
{
UINT8 n8BitVal = data & 0x000000ff;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -466,7 +466,7 @@ static WRITE32_HANDLER( newport_xmap1_w )
static READ32_HANDLER( newport_vc2_r )
{
UINT16 ret16;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nDCBRegSelect )
{
@@ -491,7 +491,7 @@ static READ32_HANDLER( newport_vc2_r )
static WRITE32_HANDLER( newport_vc2_w )
{
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
switch( pNVID->REX3.nXFerWidth )
{
@@ -608,7 +608,7 @@ static WRITE32_HANDLER( newport_vc2_w )
READ32_HANDLER( newport_rex3_r )
{
// UINT32 nTemp;
- //running_machine &machine = space->machine();
+ //running_machine &machine = space.machine();
// if( offset >= ( 0x0800 / 4 ) )
// {
@@ -984,7 +984,7 @@ static void DoREX3Command(running_machine &machine)
WRITE32_HANDLER( newport_rex3_w )
{
UINT32 nTemp=0;
- running_machine &machine = space->machine();
+ running_machine &machine = space.machine();
if( offset & 0x00000200 )
{
diff --git a/src/mess/video/nubus_cb264.c b/src/mess/video/nubus_cb264.c
index 7f8a3037759..bcc75ac0785 100644
--- a/src/mess/video/nubus_cb264.c
+++ b/src/mess/video/nubus_cb264.c
@@ -247,7 +247,7 @@ WRITE32_MEMBER( nubus_cb264_device::cb264_w )
break;
default:
-// printf("cb264_w: %x to reg %x (mask %x PC %x)\n", data, offset*4, mem_mask, space->device().safe_pc());
+// printf("cb264_w: %x to reg %x (mask %x PC %x)\n", data, offset*4, mem_mask, space.device().safe_pc());
break;
}
}
diff --git a/src/mess/video/oric.c b/src/mess/video/oric.c
index fc4ba22ec74..f07136781d2 100644
--- a/src/mess/video/oric.c
+++ b/src/mess/video/oric.c
@@ -68,7 +68,7 @@ static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
oric_state *state = machine.driver_data<oric_state>();
/* attribute */
UINT8 attribute = c & 0x03f;
- address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
+ address_space &space = *machine.device("maincpu")->memory().space(AS_PROGRAM);
switch ((attribute>>3) & 0x03)
{
@@ -115,7 +115,7 @@ static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
if (state->m_ram)
state->m_vh_state.char_base = state->m_ram + (offs_t)0x09800;
else
- state->m_vh_state.char_base = (UINT8 *)space->get_read_ptr(0x09800);
+ state->m_vh_state.char_base = (UINT8 *)space.get_read_ptr(0x09800);
}
else
{
@@ -124,7 +124,7 @@ static void oric_vh_update_attribute(running_machine &machine, UINT8 c)
if (state->m_ram)
state->m_vh_state.char_base = state->m_ram + (offs_t)0x0b400;
else
- state->m_vh_state.char_base = (UINT8 *)space->get_read_ptr(0x0b400);
+ state->m_vh_state.char_base = (UINT8 *)space.get_read_ptr(0x0b400);
}
/* changing the mode also changes the position of the standard charset and alternative charset */
oric_refresh_charset(state);
diff --git a/src/mess/video/pc1251.c b/src/mess/video/pc1251.c
index fbec83e4f78..98cbb376592 100644
--- a/src/mess/video/pc1251.c
+++ b/src/mess/video/pc1251.c
@@ -97,7 +97,7 @@ static const POCKETC_FIGURE busy={
READ8_HANDLER(pc1251_lcd_read)
{
- pc1251_state *state = space->machine().driver_data<pc1251_state>();
+ pc1251_state *state = space.machine().driver_data<pc1251_state>();
int data;
data = state->m_reg[offset&0xff];
logerror("pc1251 read %.3x %.2x\n",offset,data);
@@ -106,7 +106,7 @@ static const POCKETC_FIGURE busy={
WRITE8_HANDLER(pc1251_lcd_write)
{
- pc1251_state *state = space->machine().driver_data<pc1251_state>();
+ pc1251_state *state = space.machine().driver_data<pc1251_state>();
logerror("pc1251 write %.3x %.2x\n",offset,data);
state->m_reg[offset&0xff] = data;
}
diff --git a/src/mess/video/pc1350.c b/src/mess/video/pc1350.c
index dae4669ee1f..d31b9035913 100644
--- a/src/mess/video/pc1350.c
+++ b/src/mess/video/pc1350.c
@@ -97,7 +97,7 @@ static const POCKETC_FIGURE busy={
READ8_HANDLER(pc1350_lcd_read)
{
- pc1350_state *state = space->machine().driver_data<pc1350_state>();
+ pc1350_state *state = space.machine().driver_data<pc1350_state>();
int data;
data = state->m_reg[offset&0xfff];
logerror("pc1350 read %.3x %.2x\n",offset,data);
@@ -106,7 +106,7 @@ static const POCKETC_FIGURE busy={
WRITE8_HANDLER(pc1350_lcd_write)
{
- pc1350_state *state = space->machine().driver_data<pc1350_state>();
+ pc1350_state *state = space.machine().driver_data<pc1350_state>();
logerror("pc1350 write %.3x %.2x\n",offset,data);
state->m_reg[offset&0xfff] = data;
}
diff --git a/src/mess/video/pc1401.c b/src/mess/video/pc1401.c
index 2c628bc7bd3..70ceb084649 100644
--- a/src/mess/video/pc1401.c
+++ b/src/mess/video/pc1401.c
@@ -19,14 +19,14 @@
READ8_HANDLER(pc1401_lcd_read)
{
- pc1401_state *state = space->machine().driver_data<pc1401_state>();
+ pc1401_state *state = space.machine().driver_data<pc1401_state>();
offset&=0xff;
return state->m_reg[offset];
}
WRITE8_HANDLER(pc1401_lcd_write)
{
- pc1401_state *state = space->machine().driver_data<pc1401_state>();
+ pc1401_state *state = space.machine().driver_data<pc1401_state>();
offset&=0xff;
state->m_reg[offset]=data;
}
diff --git a/src/mess/video/pc1403.c b/src/mess/video/pc1403.c
index 1bf67e46b62..bf844af9f6a 100644
--- a/src/mess/video/pc1403.c
+++ b/src/mess/video/pc1403.c
@@ -52,13 +52,13 @@ VIDEO_START( pc1403 )
READ8_HANDLER(pc1403_lcd_read)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
return state->m_reg[offset];
}
WRITE8_HANDLER(pc1403_lcd_write)
{
- pc1403_state *state = space->machine().driver_data<pc1403_state>();
+ pc1403_state *state = space.machine().driver_data<pc1403_state>();
state->m_reg[offset]=data;
}
diff --git a/src/mess/video/pc_aga.c b/src/mess/video/pc_aga.c
index 7d6dbef092a..5f8bda52964 100644
--- a/src/mess/video/pc_aga.c
+++ b/src/mess/video/pc_aga.c
@@ -12,7 +12,7 @@
#include "video/cgapal.h"
-#define CGA_MONITOR (space->machine().root_device().ioport("VIDEO")->read() & 0x1C)
+#define CGA_MONITOR (space.machine().root_device().ioport("VIDEO")->read() & 0x1C)
#define CGA_MONITOR_RGB 0x00 /* Colour RGB */
#define CGA_MONITOR_MONO 0x04 /* Greyscale RGB */
#define CGA_MONITOR_COMPOSITE 0x08 /* Colour composite */
@@ -496,17 +496,17 @@ static READ8_HANDLER ( pc_aga_mda_r )
UINT8 data = 0xFF;
if ( aga.mode == AGA_MONO ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch( offset )
{
case 0: case 2: case 4: case 6:
/* return last written mc6845 address value here? */
break;
case 1: case 3: case 5: case 7:
- data = mc6845->register_r(*space, offset);
+ data = mc6845->register_r(space, offset);
break;
case 10:
- data = (space->machine().root_device().ioport("IN0")->read() & 0x80 ) | 0x08 | aga.mda_status;
+ data = (space.machine().root_device().ioport("IN0")->read() & 0x80 ) | 0x08 | aga.mda_status;
aga.mda_status ^= 0x01;
break;
/* 12, 13, 14 are the LPT1 ports */
@@ -518,14 +518,14 @@ static READ8_HANDLER ( pc_aga_mda_r )
static WRITE8_HANDLER ( pc_aga_mda_w )
{
if ( aga.mode == AGA_MONO ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch( offset )
{
case 0: case 2: case 4: case 6:
- mc6845->address_w( *space, offset, data );
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845->register_w( *space, offset, data );
+ mc6845->register_w( space, offset, data );
break;
case 8:
aga.mda_mode_control = data;
@@ -551,13 +551,13 @@ static READ8_HANDLER ( pc_aga_cga_r )
UINT8 data = 0xFF;
if ( aga.mode == AGA_COLOR ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch( offset ) {
case 0: case 2: case 4: case 6:
/* return last written mc6845 address value here? */
break;
case 1: case 3: case 5: case 7:
- data = mc6845->register_r( *space, offset);
+ data = mc6845->register_r( space, offset);
break;
case 10:
data = aga.vsync | ( ( data & 0x40 ) >> 4 ) | aga.hsync;
@@ -597,14 +597,14 @@ static void pc_aga_set_palette_luts(void) {
static WRITE8_HANDLER ( pc_aga_cga_w )
{
if ( aga.mode == AGA_COLOR ) {
- mc6845_device *mc6845 = space->machine().device<mc6845_device>(AGA_MC6845_NAME);
+ mc6845_device *mc6845 = space.machine().device<mc6845_device>(AGA_MC6845_NAME);
switch(offset) {
case 0: case 2: case 4: case 6:
- mc6845->address_w( *space, offset, data );
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845->register_w( *space, offset, data );
+ mc6845->register_w( space, offset, data );
break;
case 8:
aga.cga_mode_control = data;
@@ -689,19 +689,19 @@ void pc_aga_set_mode(running_machine &machine, AGA_MODE mode)
VIDEO_START( pc_aga )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
switch(buswidth)
{
case 8:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w) );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w) );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w) );
break;
case 16:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w), 0xffff );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc200_videoram_r), FUNC(pc200_videoram_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_aga_cga_r), FUNC(pc_aga_cga_w), 0xffff );
break;
@@ -720,19 +720,19 @@ VIDEO_START( pc_aga )
VIDEO_START( pc200 )
{
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
switch(buswidth)
{
case 8:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w) );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w) );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w) );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w) );
break;
case 16:
- space->install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w), 0xffff );
+ space.install_legacy_readwrite_handler(0xb0000, 0xbffff, FUNC(pc_aga_videoram_r), FUNC(pc_aga_videoram_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3b0, 0x3bf, FUNC(pc_aga_mda_r), FUNC(pc_aga_mda_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc200_cga_r), FUNC(pc200_cga_w), 0xffff );
break;
@@ -836,11 +836,11 @@ WRITE8_HANDLER( pc200_cga_w )
if ((pc200.porte & 7) != (data & 7))
{
if (data & 4)
- pc_aga_set_mode(space->machine(), AGA_OFF);
+ pc_aga_set_mode(space.machine(), AGA_OFF);
else if (data & 2)
- pc_aga_set_mode(space->machine(), AGA_MONO);
+ pc_aga_set_mode(space.machine(), AGA_MONO);
else
- pc_aga_set_mode(space->machine(), AGA_COLOR);
+ pc_aga_set_mode(space.machine(), AGA_COLOR);
}
pc200.porte = data;
break;
@@ -868,7 +868,7 @@ READ8_HANDLER ( pc200_cga_r )
case 0xe:
// 0x20 low cga
// 0x10 low special
- result = space->machine().root_device().ioport("DSW0")->read() & 0x38;
+ result = space.machine().root_device().ioport("DSW0")->read() & 0x38;
break;
default:
diff --git a/src/mess/video/pc_t1t.c b/src/mess/video/pc_t1t.c
index 79a16814dc2..c252c6962f7 100644
--- a/src/mess/video/pc_t1t.c
+++ b/src/mess/video/pc_t1t.c
@@ -771,12 +771,12 @@ WRITE8_HANDLER ( pc_T1T_w )
switch( offset )
{
case 0: case 2: case 4: case 6:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->address_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->address_w( space, offset, data );
break;
case 1: case 3: case 5: case 7:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->register_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->register_w( space, offset, data );
break;
case 8:
pc_t1t_mode_control_w(data);
@@ -798,7 +798,7 @@ WRITE8_HANDLER ( pc_T1T_w )
pc_t1t_vga_data_w(data);
break;
case 15:
- pc_t1t_bank_w(space->machine(), data);
+ pc_t1t_bank_w(space.machine(), data);
break;
}
}
@@ -811,17 +811,17 @@ WRITE8_HANDLER( pc_pcjr_w )
switch( offset )
{
case 0: case 4:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->address_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->address_w( space, offset, data );
break;
case 1: case 5:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- mc6845->register_w( *space, offset, data );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ mc6845->register_w( space, offset, data );
break;
case 10:
if ( pcjr.address_data_ff & 0x01 )
{
- pc_pcjr_vga_data_w( space->machine(), data );
+ pc_pcjr_vga_data_w( space.machine(), data );
}
else
{
@@ -835,7 +835,7 @@ WRITE8_HANDLER( pc_pcjr_w )
case 12:
break;
case 15:
- pc_pcjr_bank_w(space->machine(), data);
+ pc_pcjr_bank_w(space.machine(), data);
break;
default:
@@ -856,8 +856,8 @@ WRITE8_HANDLER( pc_pcjr_w )
break;
case 1: case 3: case 5: case 7:
- mc6845 = space->machine().device<mc6845_device>(T1000_MC6845_NAME);
- data = mc6845->register_r( *space, offset );
+ mc6845 = space.machine().device<mc6845_device>(T1000_MC6845_NAME);
+ data = mc6845->register_r( space, offset );
break;
case 8:
@@ -922,7 +922,7 @@ static WRITE_LINE_DEVICE_HANDLER( pcjr_vsync_changed )
static VIDEO_START( pc_t1t )
{
int buswidth;
- address_space *space = machine.firstcpu->space(AS_PROGRAM);
+ address_space &space = *machine.firstcpu->space(AS_PROGRAM);
address_space *spaceio = machine.firstcpu->space(AS_IO);
pcjr.chr_gen = machine.root_device().memregion("gfx1")->base();
@@ -934,12 +934,12 @@ static VIDEO_START( pc_t1t )
switch(buswidth)
{
case 8:
- space->install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w) );
+ space.install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w) );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_T1T_w) );
break;
case 16:
- space->install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w), 0xffff );
+ space.install_legacy_readwrite_handler(0xb8000, 0xbffff, FUNC(pc_t1t_videoram_r), FUNC(pc_t1t_videoram_w), 0xffff );
spaceio->install_legacy_readwrite_handler(0x3d0, 0x3df, FUNC(pc_T1T_r),FUNC(pc_T1T_w), 0xffff );
break;
diff --git a/src/mess/video/stic.c b/src/mess/video/stic.c
index 5d6bee63072..6c3985daf04 100644
--- a/src/mess/video/stic.c
+++ b/src/mess/video/stic.c
@@ -6,7 +6,7 @@
READ16_MEMBER( intv_state::intv_stic_r )
{
-// intv_state *state = space->machine().driver_data<intv_state>();
+// intv_state *state = space.machine().driver_data<intv_state>();
//logerror("%x = stic_r(%x)\n",0,offset);
if (m_bus_copy_mode || !m_stic_handshake)
{
@@ -75,7 +75,7 @@ READ16_MEMBER( intv_state::intv_stic_r )
WRITE16_MEMBER( intv_state::intv_stic_w )
{
- //intv_state *state = space->machine().driver_data<intv_state>();
+ //intv_state *state = space.machine().driver_data<intv_state>();
intv_sprite_type *s;
//logerror("stic_w(%x) = %x\n",offset,data);
diff --git a/src/mess/video/ti85.c b/src/mess/video/ti85.c
index 8b3335083f8..b569bfd19cf 100644
--- a/src/mess/video/ti85.c
+++ b/src/mess/video/ti85.c
@@ -150,7 +150,7 @@ void ti85_state::video_start()
SCREEN_UPDATE_IND16( ti85 )
{
ti85_state *state = screen.machine().driver_data<ti85_state>();
- address_space *space = state->m_maincpu->space(AS_PROGRAM);
+ address_space &space = *state->m_maincpu->space(AS_PROGRAM);
int x,y,b;
int brightnes;
int lcdmem;
@@ -170,7 +170,7 @@ SCREEN_UPDATE_IND16( ti85 )
for (y=0; y<state->m_ti_screen_y_size; y++)
for (x=0; x<state->m_ti_screen_x_size; x++)
- *(state->m_frames+(state->m_ti_number_of_frames-1)*state->m_ti_video_memory_size+y*state->m_ti_screen_x_size+x) = space->read_byte(lcdmem+y*state->m_ti_screen_x_size+x);
+ *(state->m_frames+(state->m_ti_number_of_frames-1)*state->m_ti_video_memory_size+y*state->m_ti_screen_x_size+x) = space.read_byte(lcdmem+y*state->m_ti_screen_x_size+x);
for (y=0; y<state->m_ti_screen_y_size; y++)
for (x=0; x<state->m_ti_screen_x_size; x++)
diff --git a/src/mess/video/x68k.c b/src/mess/video/x68k.c
index f03b8a6cb21..10f8cde887f 100644
--- a/src/mess/video/x68k.c
+++ b/src/mess/video/x68k.c
@@ -377,7 +377,7 @@ TIMER_CALLBACK(x68k_crtc_vblank_irq)
*/
WRITE16_HANDLER( x68k_crtc_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
COMBINE_DATA(state->m_crtc.reg+offset);
switch(offset)
{
@@ -390,12 +390,12 @@ WRITE16_HANDLER( x68k_crtc_w )
case 6:
case 7:
case 8:
- x68k_crtc_refresh_mode(space->machine());
+ x68k_crtc_refresh_mode(space.machine());
break;
case 9: // CRTC raster IRQ (GPIP6)
{
attotime irq_time;
- irq_time = space->machine().primary_screen->time_until_pos((data) / state->m_crtc.vmultiple,2);
+ irq_time = space.machine().primary_screen->time_until_pos((data) / state->m_crtc.vmultiple,2);
if(irq_time.as_double() > 0)
state->m_raster_irq->adjust(irq_time, (data) / state->m_crtc.vmultiple);
@@ -442,14 +442,14 @@ WRITE16_HANDLER( x68k_crtc_w )
if(data & 0x0400)
state->m_crtc.interlace = 1;
}*/
- x68k_crtc_refresh_mode(space->machine());
+ x68k_crtc_refresh_mode(space.machine());
break;
case 576: // operation register
state->m_crtc.operation = data;
if(data & 0x08) // text screen raster copy
{
x68k_crtc_text_copy(state, (state->m_crtc.reg[22] & 0xff00) >> 8,(state->m_crtc.reg[22] & 0x00ff));
- space->machine().scheduler().timer_set(attotime::from_msec(1), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
+ space.machine().scheduler().timer_set(attotime::from_msec(1), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
}
if(data & 0x02) // high-speed graphic screen clear
{
@@ -457,16 +457,16 @@ WRITE16_HANDLER( x68k_crtc_w )
memset(state->m_gvram32,0,0x40000);
else
memset(state->m_gvram16,0,0x40000);
- space->machine().scheduler().timer_set(attotime::from_msec(10), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
+ space.machine().scheduler().timer_set(attotime::from_msec(10), FUNC(x68k_crtc_operation_end), 0x02); // time taken to do operation is a complete guess.
}
break;
}
-// logerror("CRTC: [%08x] Wrote %04x to CRTC register %i\n",space->machine().device("maincpu")->safe_pc(),data,offset);
+// logerror("CRTC: [%08x] Wrote %04x to CRTC register %i\n",space.machine().device("maincpu")->safe_pc(),data,offset);
}
READ16_HANDLER( x68k_crtc_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
#if 0
switch(offset)
{
@@ -478,7 +478,7 @@ READ16_HANDLER( x68k_crtc_r )
if(offset < 24)
{
-// logerror("CRTC: [%08x] Read %04x from CRTC register %i\n",space->machine().device("maincpu")->safe_pc(),state->m_crtc.reg[offset],offset);
+// logerror("CRTC: [%08x] Read %04x from CRTC register %i\n",space.machine().device("maincpu")->safe_pc(),state->m_crtc.reg[offset],offset);
switch(offset)
{
case 9:
@@ -507,7 +507,7 @@ READ16_HANDLER( x68k_crtc_r )
WRITE16_HANDLER( x68k_gvram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
UINT16* gvram;
// int xloc,yloc,pageoffset;
/*
@@ -580,7 +580,7 @@ WRITE16_HANDLER( x68k_gvram_w )
WRITE16_HANDLER( x68k_tvram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
UINT16* tvram;
UINT16 text_mask;
@@ -617,7 +617,7 @@ WRITE16_HANDLER( x68k_tvram_w )
READ16_HANDLER( x68k_gvram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
const UINT16* gvram;
UINT16 ret = 0;
@@ -665,7 +665,7 @@ READ16_HANDLER( x68k_gvram_r )
READ16_HANDLER( x68k_tvram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
const UINT16* tvram;
if(state->m_is_32bit)
@@ -726,7 +726,7 @@ WRITE32_HANDLER( x68k_gvram32_w )
WRITE16_HANDLER( x68k_spritereg_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
COMBINE_DATA(state->m_spritereg+offset);
switch(offset)
{
@@ -775,7 +775,7 @@ WRITE16_HANDLER( x68k_spritereg_w )
READ16_HANDLER( x68k_spritereg_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
if(offset >= 0x400 && offset < 0x404)
return state->m_spritereg[offset] & 0x3ff;
return state->m_spritereg[offset];
@@ -783,7 +783,7 @@ READ16_HANDLER( x68k_spritereg_r )
WRITE16_HANDLER( x68k_spriteram_w )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
COMBINE_DATA(state->m_spriteram+offset);
state->m_video.tile8_dirty[offset / 16] = 1;
state->m_video.tile16_dirty[offset / 64] = 1;
@@ -808,7 +808,7 @@ WRITE16_HANDLER( x68k_spriteram_w )
READ16_HANDLER( x68k_spriteram_r )
{
- x68k_state *state = space->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
return state->m_spriteram[offset];
}