Previous 199869 Revisions Next

r17799 Tuesday 11th September, 2012 at 16:29:26 UTC by Aaron Giles
Add ambiguous execute() and memory() methods to the
device_execute/memory_interfaces respectively in order
to catch unnecessary usage of the corresponding device_t
methods. Removed all existing redundant usage.
[Aaron Giles]
[src/emu]diexec.h dimemory.h distate.h
[src/emu/machine]latch8.c
[src/emu/sound]scsp.c
[src/emu/video]pc_cga.c pc_vga.c
[src/mame/audio]8080bw.c atarijsa.c cage.c dcs.c harddriv.c
[src/mame/drivers]8080bw.c deshoros.c gunbustr.c harddriv.c igs017.c magictg.c metro.c midqslvr.c multigam.c namcos22.c pacman.c pntnpuzl.c segae.c
[src/mame/machine]snes.c
[src/mame/video]namcos22.c
[src/mess/drivers]a5105.c a7000.c abc1600.c abc80x.c ace.c adam.c apricot.c apricotf.c atarist.c atom.c avigo.c bigbord2.c bml3.c bw12.c bw2.c c64.c camplynx.c cosmicos.c cxhumax.c elf.c exp85.c fk1.c fp1100.c kyocera.c lc80.c m5.c mc1000.c micronic.c mikromik.c mpf1.c msbc1.c mstation.c newbrain.c next.c ob68k1a.c osi.c pasopia7.c pc1512.c pc8001.c pc8401a.c pce220.c pcfx.c plus4.c poly.c portfoli.c prestige.c prof80.c px8.c ql.c rex6000.c sg1000.c super6.c supracan.c tandy2k.c tek405x.c tiki100.c tmc1800.c tmc600.c tvc.c unixpc.c v1050.c vic10.c victor9k.c vii.c vixen.c wangpc.c x07.c xerox820.c xor100.c z88.c z9001.c
[src/mess/formats]ace_ace.c atom_atm.c cbm_snqk.c comx35_comx.c trs_cmd.c
[src/mess/machine]advision.c amstrad.c c128.c c64.c compis.c comx_clm.c genpc.c hd63450.c kaypro.c kc.c kc_d004.c mac.c mbee.c pc.c sorcerer.c special.c ti85.c trs80.c wswan.c
[src/mess/video]atarist.c isa_cga.c newbrain.c pc_aga.c pc_t1t.c ti85.c

trunk/src/mame/audio/atarijsa.c
r17798r17799
147147
148148   /* install POKEY memory handlers */
149149   if (pokey != NULL)
150      jsacpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x2c00, 0x2c0f, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
150      jsacpu->space(AS_PROGRAM)->install_readwrite_handler(0x2c00, 0x2c0f, read8_delegate(FUNC(pokey_device::read),pokey), write8_delegate(FUNC(pokey_device::write),pokey));
151151
152152   init_save_state(machine);
153153   atarijsa_reset();
trunk/src/mame/audio/cage.c
r17798r17799
177177   state->timer[1] = machine.device<timer_device>("cage_timer1");
178178
179179   if (speedup)
180      state->speedup_ram = state->cpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(speedup, speedup, FUNC(speedup_w));
180      state->speedup_ram = state->cpu->space(AS_PROGRAM)->install_legacy_write_handler(speedup, speedup, FUNC(speedup_w));
181181
182182   for (chan = 0; chan < DAC_BUFFER_CHANNELS; chan++)
183183   {
trunk/src/mame/audio/dcs.c
r17798r17799
21412141      machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2), param);
21422142      return;
21432143   }
2144   output_latch_w(dcs.cpu->memory().space(AS_PROGRAM), 0, 0x000a, 0xffff);
2144   output_latch_w(dcs.cpu->space(AS_PROGRAM), 0, 0x000a, 0xffff);
21452145}
21462146
21472147
r17798r17799
21532153      machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback1), param);
21542154      return;
21552155   }
2156   output_latch_w(dcs.cpu->memory().space(AS_PROGRAM), 0, param, 0xffff);
2156   output_latch_w(dcs.cpu->space(AS_PROGRAM), 0, param, 0xffff);
21572157
21582158   /* chain to the next word we need to write back */
21592159   machine.scheduler().timer_set(attotime::from_usec(1), FUNC(s1_ack_callback2));
r17798r17799
22852285
22862286static TIMER_CALLBACK( s2_ack_callback )
22872287{
2288   address_space *space = dcs.cpu->memory().space(AS_PROGRAM);
2288   address_space *space = dcs.cpu->space(AS_PROGRAM);
22892289
22902290   /* if the output is full, stall for a usec */
22912291   if (IS_OUTPUT_FULL())
trunk/src/mame/audio/8080bw.c
r17798r17799
898898
899899static void schaser_reinit_555_time_remain(_8080bw_state *state)
900900{
901   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
901   address_space *space = state->m_maincpu->space(AS_PROGRAM);
902902   state->m_schaser_effect_555_time_remain = attotime::from_double(state->m_schaser_effect_555_time_remain_savable);
903903   state->schaser_sh_port_2_w(*space, 0, state->m_port_2_last_extra);
904904}
trunk/src/mame/audio/harddriv.c
r17798r17799
231231
232232READ16_MEMBER(harddriv_state::hdsnd68k_320ports_r)
233233{
234   address_space *iospace = m_sounddsp->memory().space(AS_IO);
235   return iospace->read_word((offset & 7) << 1);
234   return m_sounddsp->space(AS_IO)->read_word((offset & 7) << 1);
236235}
237236
238237
239238WRITE16_MEMBER(harddriv_state::hdsnd68k_320ports_w)
240239{
241   address_space *iospace = m_sounddsp->memory().space(AS_IO);
242   iospace->write_word((offset & 7) << 1, data);
240   m_sounddsp->space(AS_IO)->write_word((offset & 7) << 1, data);
243241}
244242
245243
trunk/src/mame/machine/snes.c
r17798r17799
135135{
136136   snes_state *state = machine.driver_data<snes_state>();
137137   // make sure we're in the 65816's context since we're messing with the OAM and stuff
138   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
138   address_space *space = state->m_maincpu->space(AS_PROGRAM);
139139
140140   if (!(snes_ppu.screen_disabled)) //Reset OAM address, byuu says it happens at H=10
141141   {
r17798r17799
148148static TIMER_CALLBACK( snes_reset_hdma )
149149{
150150   snes_state *state = machine.driver_data<snes_state>();
151   address_space *cpu0space = state->m_maincpu->memory().space(AS_PROGRAM);
151   address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
152152   snes_hdma_init(cpu0space);
153153}
154154
155155static TIMER_CALLBACK( snes_update_io )
156156{
157157   snes_state *state = machine.driver_data<snes_state>();
158   address_space *cpu0space = state->m_maincpu->memory().space(AS_PROGRAM);
158   address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
159159   state->m_io_read(cpu0space->machine());
160160   snes_ram[HVBJOY] &= 0xfe;      /* Clear busy bit */
161161
r17798r17799
233233   // hdma reset happens at scanline 0, H=~6
234234   if (snes_ppu.beam.current_vert == 0)
235235   {
236      address_space *cpu0space = state->m_maincpu->memory().space(AS_PROGRAM);
236      address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
237237      snes_hdma_init(cpu0space);
238238   }
239239
r17798r17799
257257static TIMER_CALLBACK( snes_hblank_tick )
258258{
259259   snes_state *state = machine.driver_data<snes_state>();
260   address_space *cpu0space = state->m_maincpu->memory().space(AS_PROGRAM);
260   address_space *cpu0space = state->m_maincpu->space(AS_PROGRAM);
261261   int nextscan;
262262
263263   snes_ppu.beam.current_vert = machine.primary_screen->vpos();
trunk/src/mame/video/namcos22.c
r17798r17799
28182818      FILE *f = fopen( "dump.txt", "wb" );
28192819      if( f )
28202820      {
2821         address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
2821         address_space *space = state->m_maincpu->space(AS_PROGRAM);
28222822
28232823         if (1) // czram
28242824         {
r17798r17799
28832883      FILE *f = fopen( "dump.txt", "wb" );
28842884      if( f )
28852885      {
2886         address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
2886         address_space *space = state->m_maincpu->space(AS_PROGRAM);
28872887
28882888         //Dump(space, f,0x90000000, 0x90000003, "led?" );
28892889         Dump(space, f,0x90010000, 0x90017fff, "cz_ram");
trunk/src/mame/drivers/igs017.c
r17798r17799
33993399{
34003400   igs017_state *state = machine.driver_data<igs017_state>();
34013401   MACHINE_RESET_CALL( mgcs );
3402   state->lhzb2a_input_addr_w(*state->m_maincpu->memory().space(AS_PROGRAM), 0, 0xf0);
3402   state->lhzb2a_input_addr_w(*state->m_maincpu->space(AS_PROGRAM), 0, 0xf0);
34033403}
34043404
34053405static MACHINE_CONFIG_START( lhzb2a, igs017_state )
trunk/src/mame/drivers/metro.c
r17798r17799
133133static void update_irq_state( running_machine &machine )
134134{
135135   metro_state *state = machine.driver_data<metro_state>();
136   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
136   address_space *space = state->m_maincpu->space(AS_PROGRAM);
137137
138138   /*  Get the pending IRQs (only the enabled ones, e.g. where irq_enable is *0*)  */
139139   UINT16 irq = state->metro_irq_cause_r(*space, 0, 0xffff) & ~*state->m_irq_enable;
r17798r17799
266266static int metro_io_callback( device_t *device, int ioline, int state )
267267{
268268   metro_state *driver_state = device->machine().driver_data<metro_state>();
269   address_space *space = driver_state->m_maincpu->memory().space(AS_PROGRAM);
269   address_space *space = driver_state->m_maincpu->space(AS_PROGRAM);
270270   UINT8 data = 0;
271271
272272   switch (ioline)
trunk/src/mame/drivers/deshoros.c
r17798r17799
252252
253253void destiny_state::machine_reset()
254254{
255   bank_select_w(*m_maincpu->memory().space(AS_PROGRAM), 0, 0);
255   bank_select_w(*m_maincpu->space(AS_PROGRAM), 0, 0);
256256}
257257
258258static MACHINE_CONFIG_START( destiny, destiny_state )
trunk/src/mame/drivers/segae.c
r17798r17799
511511{
512512   systeme_state::driver_start();
513513
514   m_maincpu->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::ridleofp_port_f8_read), this));
515   m_maincpu->memory().space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::ridleofp_port_fa_write), this));
514   m_maincpu->space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::ridleofp_port_f8_read), this));
515   m_maincpu->space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::ridleofp_port_fa_write), this));
516516}
517517
518518
r17798r17799
520520{
521521   systeme_state::driver_start();
522522
523   m_maincpu->memory().space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this));
524   m_maincpu->memory().space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::hangonjr_port_fa_write), this));
523   m_maincpu->space(AS_IO)->install_read_handler(0xf8, 0xf8, read8_delegate(FUNC(systeme_state::hangonjr_port_f8_read), this));
524   m_maincpu->space(AS_IO)->install_write_handler(0xfa, 0xfa, write8_delegate(FUNC(systeme_state::hangonjr_port_fa_write), this));
525525}
526526
527527
trunk/src/mame/drivers/multigam.c
r17798r17799
872872      state->m_supergm3_chr_bank == 0x40 )
873873   {
874874      // VRAM
875      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
876      ppu->memory().space(AS_PROGRAM)->install_write_bank(0x0000, 0x1fff, "bank1");
875      ppu->space(AS_PROGRAM)->install_read_bank(0x0000, 0x1fff, "bank1");
876      ppu->space(AS_PROGRAM)->install_write_bank(0x0000, 0x1fff, "bank1");
877877      state->membank("bank1")->set_base(state->m_vram);
878878
879879      if (state->m_supergm3_chr_bank == 0x40)
r17798r17799
881881   }
882882   else
883883   {
884      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2");
885      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3");
886      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x0800, 0x0bff, "bank4");
887      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x0c00, 0x0fff, "bank5");
888      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x1000, 0x13ff, "bank6");
889      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x1400, 0x17ff, "bank7");
890      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x1800, 0x1bff, "bank8");
891      ppu->memory().space(AS_PROGRAM)->install_read_bank(0x1c00, 0x1fff, "bank9");
892      ppu->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x1fff);
884      ppu->space(AS_PROGRAM)->install_read_bank(0x0000, 0x03ff, "bank2");
885      ppu->space(AS_PROGRAM)->install_read_bank(0x0400, 0x07ff, "bank3");
886      ppu->space(AS_PROGRAM)->install_read_bank(0x0800, 0x0bff, "bank4");
887      ppu->space(AS_PROGRAM)->install_read_bank(0x0c00, 0x0fff, "bank5");
888      ppu->space(AS_PROGRAM)->install_read_bank(0x1000, 0x13ff, "bank6");
889      ppu->space(AS_PROGRAM)->install_read_bank(0x1400, 0x17ff, "bank7");
890      ppu->space(AS_PROGRAM)->install_read_bank(0x1800, 0x1bff, "bank8");
891      ppu->space(AS_PROGRAM)->install_read_bank(0x1c00, 0x1fff, "bank9");
892      ppu->space(AS_PROGRAM)->unmap_write(0x0000, 0x1fff);
893893
894894      set_videorom_bank(machine, 0, 8, 0, 8);
895895   }
trunk/src/mame/drivers/midqslvr.c
r17798r17799
251251
252252static UINT8 piix4_config_r(device_t *busdevice, device_t *device, int function, int reg)
253253{
254   address_space *space = busdevice->machine().firstcpu->memory().space( AS_PROGRAM );
254   address_space *space = busdevice->machine().firstcpu->space( AS_PROGRAM );
255255   midqslvr_state *state = busdevice->machine().driver_data<midqslvr_state>();
256256
257257   function &= 3;
trunk/src/mame/drivers/magictg.c
r17798r17799
761761            UINT32 src_addr = (page << 14) | m_adsp_regs.bdma_external_addr;
762762
763763            if (type == 0)
764               addr_space = m_adsp->memory().space(AS_PROGRAM);
764               addr_space = m_adsp->space(AS_PROGRAM);
765765            else
766               addr_space = m_adsp->memory().space(AS_DATA);
766               addr_space = m_adsp->space(AS_DATA);
767767
768768            if (dir == 0)
769769            {
trunk/src/mame/drivers/namcos22.c
r17798r17799
26912691            int i;
26922692            for (i = 0; i < 16; i++)
26932693            {
2694               generic_pulse_irq_line(m_mcu->execute(), M37710_LINE_TIMERA3TICK, 1);
2694               generic_pulse_irq_line(*m_mcu, M37710_LINE_TIMERA3TICK, 1);
26952695            }
26962696         }
26972697
r17798r17799
54485448{
54495449   namcos22_state *state = machine.driver_data<namcos22_state>();
54505450   if (MCU_SPEEDUP)
5451      state->m_mcu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x80, 0x81, read16_delegate(FUNC(namcos22_state::mcuc74_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state));
5451      state->m_mcu->space(AS_PROGRAM)->install_readwrite_handler(0x80, 0x81, read16_delegate(FUNC(namcos22_state::mcuc74_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state));
54525452}
54535453
54545454static void install_130_speedup(running_machine &machine)
r17798r17799
54565456   namcos22_state *state = machine.driver_data<namcos22_state>();
54575457   // install speedup cheat for 1.30 MCU BIOS
54585458   if (MCU_SPEEDUP)
5459      state->m_mcu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos22_state::mcu130_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state));
5459      state->m_mcu->space(AS_PROGRAM)->install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos22_state::mcu130_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state));
54605460}
54615461
54625462static void install_141_speedup(running_machine &machine)
r17798r17799
54645464   namcos22_state *state = machine.driver_data<namcos22_state>();
54655465   // install speedup cheat for 1.41 MCU BIOS
54665466   if (MCU_SPEEDUP)
5467      state->m_mcu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos22_state::mcu141_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state));
5467      state->m_mcu->space(AS_PROGRAM)->install_readwrite_handler(0x82, 0x83, read16_delegate(FUNC(namcos22_state::mcu141_speedup_r),state), write16_delegate(FUNC(namcos22_state::mcu_speedup_w),state));
54685468}
54695469
54705470static void namcos22_init( running_machine &machine, int game_type )
r17798r17799
54875487   namcos22_state *state = machine.driver_data<namcos22_state>();
54885488   namcos22_init(machine, game_type);
54895489
5490   state->m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::alpineracer_mcu_adc_r),state));
5491   state->m_mcu->memory().space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state));
5490   state->m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::alpineracer_mcu_adc_r),state));
5491   state->m_mcu->space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::alpine_mcu_port5_w),state));
54925492
54935493   state->m_motor_timer = machine.scheduler().timer_alloc(FUNC(alpine_steplock_callback));
54945494   state->m_motor_timer->reset();
r17798r17799
55175517{
55185518   alpine_init_common(machine(), NAMCOS22_ALPINE_SURFER);
55195519
5520   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler (0x200000, 0x200003, read32_delegate(FUNC(namcos22_state::alpinesa_prot_r),this));
5521   m_maincpu->memory().space(AS_PROGRAM)->install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(namcos22_state::alpinesa_prot_w),this));
5520   m_maincpu->space(AS_PROGRAM)->install_read_handler (0x200000, 0x200003, read32_delegate(FUNC(namcos22_state::alpinesa_prot_r),this));
5521   m_maincpu->space(AS_PROGRAM)->install_write_handler(0x300000, 0x300003, write32_delegate(FUNC(namcos22_state::alpinesa_prot_w),this));
55225522   install_141_speedup(machine());
55235523
55245524   m_keycus_id = 0x01a9;
r17798r17799
55295529   namcos22_init(machine(), NAMCOS22_AIR_COMBAT22);
55305530
55315531   // S22-BIOS ver1.20 namco all rights reserved 94/12/21
5532   m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::airco22_mcu_adc_r),this));
5532   m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::airco22_mcu_adc_r),this));
55335533}
55345534
55355535DRIVER_INIT_MEMBER(namcos22_state,propcycl)
r17798r17799
55525552//   pROM[0x22296/4] |= 0x00004e75;
55535553
55545554   namcos22_init(machine(), NAMCOS22_PROP_CYCLE);
5555   m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::propcycle_mcu_adc_r),this));
5556   m_mcu->memory().space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::propcycle_mcu_port5_w),this));
5555   m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::propcycle_mcu_adc_r),this));
5556   m_mcu->space(AS_IO)->install_write_handler(M37710_PORT5, M37710_PORT5, write8_delegate(FUNC(namcos22_state::propcycle_mcu_port5_w),this));
55575557   install_141_speedup(machine());
55585558}
55595559
r17798r17799
56135613{
56145614   namcos22_init(machine(), NAMCOS22_CYBER_CYCLES);
56155615
5616   m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::cybrcycc_mcu_adc_r),this));
5616   m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::cybrcycc_mcu_adc_r),this));
56175617   install_130_speedup(machine());
56185618
56195619   m_keycus_id = 0x0387;
r17798r17799
56305630{
56315631   namcos22_init(machine(), NAMCOS22_TOKYO_WARS);
56325632
5633   m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::tokyowar_mcu_adc_r),this));
5633   m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::tokyowar_mcu_adc_r),this));
56345634   install_141_speedup(machine());
56355635
56365636   m_keycus_id = 0x01a8;
r17798r17799
56395639DRIVER_INIT_MEMBER(namcos22_state,aquajet)
56405640{
56415641   namcos22_init(machine(), NAMCOS22_AQUA_JET);
5642   m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::aquajet_mcu_adc_r),this));
5642   m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::aquajet_mcu_adc_r),this));
56435643   install_141_speedup(machine());
56445644}
56455645
r17798r17799
56475647{
56485648   namcos22_init(machine(), NAMCOS22_DIRT_DASH);
56495649
5650   m_mcu->memory().space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::cybrcycc_mcu_adc_r),this));
5650   m_mcu->space(AS_IO)->install_read_handler(M37710_ADC0_L, M37710_ADC7_H, read8_delegate(FUNC(namcos22_state::cybrcycc_mcu_adc_r),this));
56515651   install_141_speedup(machine());
56525652
56535653   m_keycus_id = 0x01a2;
trunk/src/mame/drivers/8080bw.c
r17798r17799
25332533{
25342534   _8080bw_state *state = machine.driver_data<_8080bw_state>();
25352535
2536   state->invmulti_bank_w(*state->m_maincpu->memory().space(AS_PROGRAM), 0, 0);
2536   state->invmulti_bank_w(*state->m_maincpu->space(AS_PROGRAM), 0, 0);
25372537
25382538   MACHINE_RESET_CALL(mw8080bw);
25392539}
trunk/src/mame/drivers/harddriv.c
r17798r17799
39993999   /* install handlers for the compact driving games' inputs */
40004000   if (compact_inputs)
40014001   {
4002      state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(hdc68k_wheel_r));
4003      state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x408000, 0x408001, FUNC(hdc68k_wheel_edge_reset_w));
4004      state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hdc68k_port1_r));
4002      state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x400000, 0x400001, FUNC(hdc68k_wheel_r));
4003      state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x408000, 0x408001, FUNC(hdc68k_wheel_edge_reset_w));
4004      state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hdc68k_port1_r));
40054005   }
40064006}
40074007
r17798r17799
40124012   harddriv_state *state = machine.driver_data<harddriv_state>();
40134013
40144014   /* install ADSP program RAM */
4015   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_adsp_program_r), FUNC(hd68k_adsp_program_w));
4015   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_adsp_program_r), FUNC(hd68k_adsp_program_w));
40164016
40174017   /* install ADSP data RAM */
4018   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w));
4018   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w));
40194019
40204020   /* install ADSP serial buffer RAM */
4021   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x813fff, FUNC(hd68k_adsp_buffer_r), FUNC(hd68k_adsp_buffer_w));
4021   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x810000, 0x813fff, FUNC(hd68k_adsp_buffer_r), FUNC(hd68k_adsp_buffer_w));
40224022
40234023   /* install ADSP control locations */
4024   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x818000, 0x81801f, FUNC(hd68k_adsp_control_w));
4025   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x818060, 0x81807f, FUNC(hd68k_adsp_irq_clear_w));
4026   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x838000, 0x83ffff, FUNC(hd68k_adsp_irq_state_r));
4024   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x818000, 0x81801f, FUNC(hd68k_adsp_control_w));
4025   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x818060, 0x81807f, FUNC(hd68k_adsp_irq_clear_w));
4026   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x838000, 0x83ffff, FUNC(hd68k_adsp_irq_state_r));
40274027}
40284028
40294029
r17798r17799
40334033   harddriv_state *state = machine.driver_data<harddriv_state>();
40344034
40354035   /* install ADSP program RAM */
4036   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_ds3_program_r), FUNC(hd68k_ds3_program_w));
4036   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x800000, 0x807fff, FUNC(hd68k_ds3_program_r), FUNC(hd68k_ds3_program_w));
40374037
40384038   /* install ADSP data RAM */
4039   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w));
4040   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x80c000, 0x80dfff, FUNC(hdds3_special_r), FUNC(hdds3_special_w));
4039   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x808000, 0x80bfff, FUNC(hd68k_adsp_data_r), FUNC(hd68k_adsp_data_w));
4040   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x80c000, 0x80dfff, FUNC(hdds3_special_r), FUNC(hdds3_special_w));
40414041
40424042   /* install ADSP control locations */
4043   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_r));
4044   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x820800, 0x820fff, FUNC(hd68k_ds3_girq_state_r));
4045   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_w));
4046   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x821000, 0x8217ff, FUNC(hd68k_adsp_irq_clear_w));
4047   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_r));
4048   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x822800, 0x822fff, FUNC(hd68k_ds3_sirq_state_r));
4049   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_w));
4050   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x823800, 0x823fff, FUNC(hd68k_ds3_control_w));
4043   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_r));
4044   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x820800, 0x820fff, FUNC(hd68k_ds3_girq_state_r));
4045   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x820000, 0x8207ff, FUNC(hd68k_ds3_gdata_w));
4046   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x821000, 0x8217ff, FUNC(hd68k_adsp_irq_clear_w));
4047   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_r));
4048   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x822800, 0x822fff, FUNC(hd68k_ds3_sirq_state_r));
4049   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x822000, 0x8227ff, FUNC(hd68k_ds3_sdata_w));
4050   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x823800, 0x823fff, FUNC(hd68k_ds3_control_w));
40514051
40524052   /* if we have a sound DSP, boot it */
40534053   if (state->m_ds4cpu1 != NULL)
r17798r17799
41324132   UINT8 *usr3 = state->memregion("user3")->base();
41334133
41344134   /* install ASIC61 */
4135   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
4135   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x85c000, 0x85c7ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
41364136
41374137   /* install control registers */
4138   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x85c800, 0x85c81f, FUNC(hd68k_dsk_control_w));
4138   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x85c800, 0x85c81f, FUNC(hd68k_dsk_control_w));
41394139
41404140   /* install extra RAM */
4141   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x900000, 0x90ffff, FUNC(hd68k_dsk_ram_r), FUNC(hd68k_dsk_ram_w));
4141   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x900000, 0x90ffff, FUNC(hd68k_dsk_ram_r), FUNC(hd68k_dsk_ram_w));
41424142   state->m_dsk_ram = (UINT16 *)(usr3 + 0x40000);
41434143
41444144   /* install extra ZRAM */
4145   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x910000, 0x910fff, FUNC(hd68k_dsk_zram_r), FUNC(hd68k_dsk_zram_w));
4145   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x910000, 0x910fff, FUNC(hd68k_dsk_zram_r), FUNC(hd68k_dsk_zram_w));
41464146   state->m_dsk_zram = (UINT16 *)(usr3 + 0x50000);
41474147
41484148   /* install ASIC65 */
4149   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x914000, 0x917fff, FUNC(asic65_data_w));
4150   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x914000, 0x917fff, FUNC(asic65_r));
4151   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x918000, 0x91bfff, FUNC(asic65_io_r));
4149   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x914000, 0x917fff, FUNC(asic65_data_w));
4150   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x914000, 0x917fff, FUNC(asic65_r));
4151   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x918000, 0x91bfff, FUNC(asic65_io_r));
41524152
41534153   /* install extra ROM */
4154   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x940000, 0x9fffff, FUNC(hd68k_dsk_small_rom_r));
4154   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x940000, 0x9fffff, FUNC(hd68k_dsk_small_rom_r));
41554155   state->m_dsk_rom = (UINT16 *)(usr3 + 0x00000);
41564156
41574157   /* set up the ASIC65 */
r17798r17799
41664166   UINT8 *usr3 = state->memregion("user3")->base();
41674167
41684168   /* install ASIC65 */
4169   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w));
4170   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x824000, 0x824003, FUNC(asic65_r));
4171   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x825000, 0x825001, FUNC(asic65_io_r));
4169   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x824000, 0x824003, FUNC(asic65_data_w));
4170   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x824000, 0x824003, FUNC(asic65_r));
4171   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x825000, 0x825001, FUNC(asic65_io_r));
41724172
41734173   /* install ASIC61 */
4174   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x827000, 0x8277ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
4174   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x827000, 0x8277ff, FUNC(hd68k_dsk_dsp32_r), FUNC(hd68k_dsk_dsp32_w));
41754175
41764176   /* install control registers */
4177   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x827800, 0x82781f, FUNC(hd68k_dsk_control_w));
4177   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x827800, 0x82781f, FUNC(hd68k_dsk_control_w));
41784178
41794179   /* install extra RAM */
4180   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0x880000, 0x8bffff, FUNC(hd68k_dsk_ram_r), FUNC(hd68k_dsk_ram_w));
4180   state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0x880000, 0x8bffff, FUNC(hd68k_dsk_ram_r), FUNC(hd68k_dsk_ram_w));
41814181   state->m_dsk_ram = (UINT16 *)(usr3 + 0x100000);
41824182
41834183   /* install extra ROM */
4184   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x900000, 0x9fffff, FUNC(hd68k_dsk_rom_r));
4184   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x900000, 0x9fffff, FUNC(hd68k_dsk_rom_r));
41854185   state->m_dsk_rom = (UINT16 *)(usr3 + 0x000000);
41864186
41874187   /* set up the ASIC65 */
r17798r17799
41954195   harddriv_state *state = machine.driver_data<harddriv_state>();
41964196
41974197   /* install ASIC65 */
4198   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w));
4199   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x900000, 0x900003, FUNC(asic65_r));
4200   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x901000, 0x910001, FUNC(asic65_io_r));
4198   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x900000, 0x900003, FUNC(asic65_data_w));
4199   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x900000, 0x900003, FUNC(asic65_r));
4200   state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x901000, 0x910001, FUNC(asic65_io_r));
42014201
42024202   /* set up the ASIC65 */
42034203   asic65_config(machine, ASIC65_STEELTAL);
42044204
42054205   /* install DSPCOM control */
4206   state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x904000, 0x90401f, FUNC(hddspcom_control_w));
4206   state->m_maincpu->space(AS_PROGRAM)->install_legacy_write_handler(0x904000, 0x90401f, FUNC(hddspcom_control_w));
42074207}
42084208
42094209
r17798r17799
42154215   hdsnd_init(machine);
42164216
42174217   /* install sound handlers */
4218   state->m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r),state), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w),state));
4219   state->m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r),state));
4220   state->m_maincpu->memory().space(AS_PROGRAM)->install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w),state));
4218   state->m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(0x840000, 0x840001, read16_delegate(FUNC(harddriv_state::hd68k_snd_data_r),state), write16_delegate(FUNC(harddriv_state::hd68k_snd_data_w),state));
4219   state->m_maincpu->space(AS_PROGRAM)->install_read_handler(0x844000, 0x844001, read16_delegate(FUNC(harddriv_state::hd68k_snd_status_r),state));
4220   state->m_maincpu->space(AS_PROGRAM)->install_write_handler(0x84c000, 0x84c001, write16_delegate(FUNC(harddriv_state::hd68k_snd_reset_w),state));
42214221}
42224222
42234223
r17798r17799
42384238   init_driver_sound(machine());
42394239
42404240   /* set up gsp speedup handler */
4241   m_gsp_speedup_addr[0] = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w));
4242   m_gsp_speedup_addr[1] = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w));
4243   m_gsp->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r));
4241   m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w));
4242   m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w));
4243   m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r));
42444244   m_gsp_speedup_pc = 0xffc00f10;
42454245
42464246   /* set up msp speedup handler */
4247   m_msp_speedup_addr = m_msp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w));
4248   m_msp->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r));
4247   m_msp_speedup_addr = m_msp->space(AS_PROGRAM)->install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w));
4248   m_msp->space(AS_PROGRAM)->install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r));
42494249   m_msp_speedup_pc = 0x00723b00;
42504250
42514251   /* set up adsp speedup handlers */
4252   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4252   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
42534253}
42544254
42554255
r17798r17799
42624262   init_driver_sound(machine());
42634263
42644264   /* set up gsp speedup handler */
4265   m_gsp_speedup_addr[0] = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w));
4266   m_gsp_speedup_addr[1] = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w));
4267   m_gsp->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r));
4265   m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w));
4266   m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w));
4267   m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r));
42684268   m_gsp_speedup_pc = 0xfff40ff0;
42694269
42704270   /* set up msp speedup handler */
4271   m_msp_speedup_addr = m_msp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w));
4272   m_msp->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r));
4271   m_msp_speedup_addr = m_msp->space(AS_PROGRAM)->install_legacy_write_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_w));
4272   m_msp->space(AS_PROGRAM)->install_legacy_read_handler(0x00751b00, 0x00751b0f, FUNC(hdmsp_speedup_r));
42734273   m_msp_speedup_pc = 0x00723b00;
42744274
42754275   /* set up adsp speedup handlers */
4276   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4276   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
42774277}
42784278
42794279
r17798r17799
42864286   atarijsa_init(machine(), "IN0", 0x0020);
42874287
42884288   /* set up gsp speedup handler */
4289   m_gsp_speedup_addr[0] = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w));
4290   m_gsp_speedup_addr[1] = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w));
4291   m_gsp->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r));
4289   m_gsp_speedup_addr[0] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup1_w));
4290   m_gsp_speedup_addr[1] = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfffcfc00, 0xfffcfc0f, FUNC(hdgsp_speedup2_w));
4291   m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff9fc00, 0xfff9fc0f, FUNC(hdgsp_speedup_r));
42924292   m_gsp_speedup_pc = 0xfff41070;
42934293
42944294   /* set up adsp speedup handlers */
4295   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4295   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
42964296}
42974297
42984298
r17798r17799
43074307
43084308   /* set up the slapstic */
43094309   slapstic_init(machine(), 117);
4310   m_m68k_slapstic_base = m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w));
4310   m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w));
43114311
43124312   /* synchronization */
4313   m_rddsp32_sync[0] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w));
4314   m_rddsp32_sync[1] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w));
4313   m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w));
4314   m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w));
43154315
43164316   /* set up adsp speedup handlers */
4317   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4317   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
43184318}
43194319
43204320
r17798r17799
43304330
43314331   /* set up the slapstic */
43324332   slapstic_init(machine, 117);
4333   state->m_m68k_slapstic_base = state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w));
4333   state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w));
43344334
43354335   /* synchronization */
4336   state->m_rddsp32_sync[0] = state->m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w));
4337   state->m_rddsp32_sync[1] = state->m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w));
4336   state->m_rddsp32_sync[0] = state->m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w));
4337   state->m_rddsp32_sync[1] = state->m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w));
43384338
43394339   /* set up protection hacks */
4340   state->m_gsp_protection = state->m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(gsp_protection, gsp_protection + 0x0f, FUNC(hdgsp_protection_w));
4340   state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(gsp_protection, gsp_protection + 0x0f, FUNC(hdgsp_protection_w));
43414341
43424342   /* set up gsp speedup handler */
4343   state->m_gsp_speedup_addr[0] = state->m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_w));
4344   state->m_gsp->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_r));
4343   state->m_gsp_speedup_addr[0] = state->m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_w));
4344   state->m_gsp->space(AS_PROGRAM)->install_legacy_read_handler(0xfff76f60, 0xfff76f6f, FUNC(rdgsp_speedup1_r));
43454345   state->m_gsp_speedup_pc = 0xfff43a00;
43464346
43474347   /* set up adsp speedup handlers */
4348   state->m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4348   state->m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
43494349}
43504350
43514351DRIVER_INIT_MEMBER(harddriv_state,racedrivc) { racedrivc_init_common(machine(), 0xfff95cd0); }
r17798r17799
43574357   /* this unpleasantness prevents racedrivb1 and racedrivg1 from crashing MAME during boot */
43584358   /* both clear the DSP32C's RAM and then release it from reset, causing it to run through */
43594359   /* its address space recursively executing instructions */
4360   m_dsp32->memory().space(AS_PROGRAM)->install_read_handler(0x002000, 0x5fffff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this));
4361   m_dsp32->memory().space(AS_PROGRAM)->install_read_handler(0x640000, 0xfff7ff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this));
4360   m_dsp32->space(AS_PROGRAM)->install_read_handler(0x002000, 0x5fffff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this));
4361   m_dsp32->space(AS_PROGRAM)->install_read_handler(0x640000, 0xfff7ff, read32_delegate(FUNC(harddriv_state::rddsp_unmap_r),this));
43624362
43634363   DRIVER_INIT_CALL(racedriv);
43644364}
r17798r17799
43854385   init_dspcom(machine);
43864386   atarijsa_init(machine, "IN0", 0x0020);
43874387
4388   state->m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x908000, 0x908001, read16_delegate(FUNC(harddriv_state::steeltal_dummy_r),state));
4388   state->m_maincpu->space(AS_PROGRAM)->install_read_handler(0x908000, 0x908001, read16_delegate(FUNC(harddriv_state::steeltal_dummy_r),state));
43894389
43904390   /* set up the SLOOP */
43914391   if (!proto_sloop)
43924392   {
4393      state->m_m68k_slapstic_base = state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_sloop_r), FUNC(st68k_sloop_w));
4394      state->m_m68k_sloop_alt_base = state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0x4e000, 0x4ffff, FUNC(st68k_sloop_alt_r));
4393      state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_sloop_r), FUNC(st68k_sloop_w));
4394      state->m_m68k_sloop_alt_base = state->m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0x4e000, 0x4ffff, FUNC(st68k_sloop_alt_r));
43954395   }
43964396   else
4397      state->m_m68k_slapstic_base = state->m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_protosloop_r), FUNC(st68k_protosloop_w));
4397      state->m_m68k_slapstic_base = state->m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(st68k_protosloop_r), FUNC(st68k_protosloop_w));
43984398
43994399   /* set up protection hacks */
4400   state->m_gsp_protection = state->m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff965d0, 0xfff965df, FUNC(hdgsp_protection_w));
4400   state->m_gsp_protection = state->m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff965d0, 0xfff965df, FUNC(hdgsp_protection_w));
44014401
44024402   /* set up adsp speedup handlers */
4403   state->m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4404   state->m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r));
4403   state->m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4404   state->m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r));
44054405   state->m_ds3_speedup_addr = &state->m_adsp_data_memory[0x1f99];
44064406   state->m_ds3_speedup_pc = 0xff;
44074407   state->m_ds3_transfer_pc = ds3_transfer_pc;
r17798r17799
44234423
44244424   /* set up the slapstic */
44254425   slapstic_init(machine(), 117);
4426   m_m68k_slapstic_base = m_maincpu->memory().space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w));
4426   m_m68k_slapstic_base = m_maincpu->space(AS_PROGRAM)->install_legacy_readwrite_handler(0xe0000, 0xfffff, FUNC(rd68k_slapstic_r), FUNC(rd68k_slapstic_w));
44274427
4428   m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r));
4428   m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r));
44294429
44304430   /* synchronization */
4431   m_rddsp32_sync[0] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w));
4432   m_rddsp32_sync[1] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w));
4431   m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613c00, 0x613c03, FUNC(rddsp32_sync0_w));
4432   m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x613e00, 0x613e03, FUNC(rddsp32_sync1_w));
44334433
44344434   /* set up protection hacks */
4435   m_gsp_protection = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff960a0, 0xfff960af, FUNC(hdgsp_protection_w));
4435   m_gsp_protection = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff960a0, 0xfff960af, FUNC(hdgsp_protection_w));
44364436
44374437   /* set up adsp speedup handlers */
4438   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4439   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r));
4438   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4439   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r));
44404440   m_ds3_speedup_addr = &m_adsp_data_memory[0x1f99];
44414441   m_ds3_speedup_pc = 0xff;
44424442   m_ds3_transfer_pc = 0x43672;
r17798r17799
44514451   init_ds3(machine());
44524452   init_dsk2(machine());
44534453
4454   m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r));
4454   m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r));
44554455
44564456   /* synchronization */
4457   m_rddsp32_sync[0] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w));
4458   m_rddsp32_sync[1] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w));
4457   m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w));
4458   m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w));
44594459
44604460   /* set up protection hacks */
4461   m_gsp_protection = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff943f0, 0xfff943ff, FUNC(hdgsp_protection_w));
4461   m_gsp_protection = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff943f0, 0xfff943ff, FUNC(hdgsp_protection_w));
44624462
44634463   /* set up adsp speedup handlers */
4464   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4465   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r));
4464   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4465   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f99, 0x1f99, FUNC(hdds3_speedup_r));
44664466   m_ds3_speedup_addr = &m_adsp_data_memory[0x1f99];
44674467   m_ds3_speedup_pc = 0x2da;
44684468   m_ds3_transfer_pc = 0x407b8;
r17798r17799
44774477   init_ds3(machine());
44784478   init_dsk2(machine());
44794479
4480   m_maincpu->memory().space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r));
4480   m_maincpu->space(AS_PROGRAM)->install_legacy_read_handler(0xa80000, 0xafffff, FUNC(hda68k_port1_r));
44814481
44824482   /* synchronization */
4483   m_rddsp32_sync[0] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w));
4484   m_rddsp32_sync[1] = m_dsp32->memory().space(AS_PROGRAM)->install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w));
4483   m_rddsp32_sync[0] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21fe00, 0x21fe03, FUNC(rddsp32_sync0_w));
4484   m_rddsp32_sync[1] = m_dsp32->space(AS_PROGRAM)->install_legacy_write_handler(0x21ff00, 0x21ff03, FUNC(rddsp32_sync1_w));
44854485
44864486   /* set up protection hacks */
4487   m_gsp_protection = m_gsp->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xfff916c0, 0xfff916cf, FUNC(hdgsp_protection_w));
4487   m_gsp_protection = m_gsp->space(AS_PROGRAM)->install_legacy_write_handler(0xfff916c0, 0xfff916cf, FUNC(hdgsp_protection_w));
44884488
44894489   /* set up adsp speedup handlers */
4490   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4491   m_adsp->memory().space(AS_DATA)->install_legacy_read_handler(0x1f9a, 0x1f9a, FUNC(hdds3_speedup_r));
4490   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1fff, 0x1fff, FUNC(hdadsp_speedup_r));
4491   m_adsp->space(AS_DATA)->install_legacy_read_handler(0x1f9a, 0x1f9a, FUNC(hdds3_speedup_r));
44924492   m_ds3_speedup_addr = &m_adsp_data_memory[0x1f9a];
44934493   m_ds3_speedup_pc = 0x2d9;
44944494   m_ds3_transfer_pc = 0X407da;
trunk/src/mame/drivers/gunbustr.c
r17798r17799
443443DRIVER_INIT_MEMBER(gunbustr_state,gunbustr)
444444{
445445   /* Speedup handler */
446   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x203acc, 0x203acf, read32_delegate(FUNC(gunbustr_state::main_cycle_r),this));
446   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x203acc, 0x203acf, read32_delegate(FUNC(gunbustr_state::main_cycle_r),this));
447447}
448448
449449DRIVER_INIT_MEMBER(gunbustr_state,gunbustrj)
trunk/src/mame/drivers/pntnpuzl.c
r17798r17799
323323
324324   /* TODO: change this! */
325325   if(newval)
326      generic_pulse_irq_line(m_maincpu->execute(), (UINT8)(FPTR)param, 1);
326      generic_pulse_irq_line(*m_maincpu, (UINT8)(FPTR)param, 1);
327327}
328328
329329static INPUT_PORTS_START( pntnpuzl )
trunk/src/mame/drivers/pacman.c
r17798r17799
389389static MACHINE_RESET( superabc )
390390{
391391   pacman_state *state = machine.driver_data<pacman_state>();
392   state->superabc_bank_w(*state->m_maincpu->memory().space(AS_PROGRAM), 0, 0);
392   state->superabc_bank_w(*state->m_maincpu->space(AS_PROGRAM), 0, 0);
393393}
394394
395395
r17798r17799
57455745static void maketrax_rom_decode(running_machine &machine)
57465746{
57475747   pacman_state *state = machine.driver_data<pacman_state>();
5748   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
5748   address_space *space = state->m_maincpu->space(AS_PROGRAM);
57495749   UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
57505750   UINT8 *rom = machine.root_device().memregion("maincpu")->base();
57515751
r17798r17799
57695769DRIVER_INIT_MEMBER(pacman_state,maketrax)
57705770{
57715771   /* set up protection handlers */
5772   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x5080, 0x50bf, read8_delegate(FUNC(pacman_state::maketrax_special_port2_r),this));
5773   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::maketrax_special_port3_r),this));
5772   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x5080, 0x50bf, read8_delegate(FUNC(pacman_state::maketrax_special_port2_r),this));
5773   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::maketrax_special_port3_r),this));
57745774
57755775   maketrax_rom_decode(machine());
57765776}
r17798r17799
57785778static void korosuke_rom_decode(running_machine &machine)
57795779{
57805780   pacman_state *state = machine.driver_data<pacman_state>();
5781   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
5781   address_space *space = state->m_maincpu->space(AS_PROGRAM);
57825782   UINT8 *decrypted = auto_alloc_array(machine, UINT8, 0x4000);
57835783   UINT8 *rom = machine.root_device().memregion("maincpu")->base();
57845784
r17798r17799
58025802DRIVER_INIT_MEMBER(pacman_state,korosuke)
58035803{
58045804   /* set up protection handlers */
5805   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x5080, 0x5080, read8_delegate(FUNC(pacman_state::korosuke_special_port2_r),this));
5806   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::korosuke_special_port3_r),this));
5805   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x5080, 0x5080, read8_delegate(FUNC(pacman_state::korosuke_special_port2_r),this));
5806   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x50c0, 0x50ff, read8_delegate(FUNC(pacman_state::korosuke_special_port3_r),this));
58075807
58085808   korosuke_rom_decode(machine());
58095809}
r17798r17799
61056105DRIVER_INIT_MEMBER(pacman_state,mspacii)
61066106{
61076107   // protection
6108   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x504d, 0x506f, read8_delegate(FUNC(pacman_state::mspacii_protection_r), this));
6108   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x504d, 0x506f, read8_delegate(FUNC(pacman_state::mspacii_protection_r), this));
61096109}
61106110
61116111DRIVER_INIT_MEMBER(pacman_state,superabc)
r17798r17799
61666166{
61676167
61686168   /* extra memory */
6169   m_maincpu->memory().space(AS_PROGRAM)->install_ram(0x4800, 0x4bff);
6169   m_maincpu->space(AS_PROGRAM)->install_ram(0x4800, 0x4bff);
61706170
61716171   /* protection? */
6172   m_maincpu->memory().space(AS_PROGRAM)->install_read_handler(0x3000, 0x3fff, read8_delegate(FUNC(pacman_state::cannonbp_protection_r),this));
6172   m_maincpu->space(AS_PROGRAM)->install_read_handler(0x3000, 0x3fff, read8_delegate(FUNC(pacman_state::cannonbp_protection_r),this));
61736173}
61746174
61756175
trunk/src/emu/video/pc_cga.c
r17798r17799
329329static VIDEO_START( pc_cga )
330330{
331331   int buswidth;
332   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
333   address_space *spaceio = machine.firstcpu->memory().space(AS_IO);
332   address_space *space = machine.firstcpu->space(AS_PROGRAM);
333   address_space *spaceio = machine.firstcpu->space(AS_IO);
334334
335335   space->install_readwrite_bank(0xb8000, 0xbbfff, 0, 0x04000, "bank11" );
336   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
336   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
337337   UINT64 mask = 0;
338338   switch(buswidth)
339339   {
r17798r17799
370370static VIDEO_START( pc_cga32k )
371371{
372372   int buswidth;
373   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
374   address_space *spaceio = machine.firstcpu->memory().space(AS_IO);
373   address_space *space = machine.firstcpu->space(AS_PROGRAM);
374   address_space *spaceio = machine.firstcpu->space(AS_IO);
375375
376376
377377   space->install_readwrite_bank(0xb8000, 0xbffff, "bank11" );
378   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
378   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
379379   UINT64 mask = 0;
380380   switch(buswidth)
381381   {
r17798r17799
12011201   case 0x0f:
12021202      // Not sure if some all CGA cards have ability to upload char definition
12031203      // The original CGA card had a char rom
1204      UINT8 buswidth = space->machine().firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
1205      address_space *space_prg = space->machine().firstcpu->memory().space(AS_PROGRAM);
1204      UINT8 buswidth = space->machine().firstcpu->space_config(AS_PROGRAM)->m_databus_width;
1205      address_space *space_prg = space->machine().firstcpu->space(AS_PROGRAM);
12061206      cga.p3df = data;
12071207      if (data & 1) {
12081208         UINT64 mask = 0;
r17798r17799
16351635   cga.videoram_size = 0x10000;
16361636   cga.videoram = auto_alloc_array(machine, UINT8, 0x10000 );
16371637
1638   address_space *space = machine.firstcpu->memory().space( AS_PROGRAM );
1639   address_space *io_space = machine.firstcpu->memory().space( AS_IO );
1638   address_space *space = machine.firstcpu->space( AS_PROGRAM );
1639   address_space *io_space = machine.firstcpu->space( AS_IO );
16401640
16411641   space->install_read_bank( 0xb8000, 0xbbfff, 0, 0x0C000, "bank1" );
16421642   machine.root_device().membank("bank1")->set_base(cga.videoram + videoram_offset[0]);
trunk/src/emu/video/pc_vga.c
r17798r17799
20152015   int buswidth;
20162016   UINT64 mask = 0;
20172017
2018   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
2018   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
20192019   switch(buswidth)
20202020   {
20212021      case 8:
r17798r17799
24402440   int buswidth;
24412441   UINT64 mask = 0;
24422442
2443   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
2443   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
24442444   switch(buswidth)
24452445   {
24462446      case 8:
r17798r17799
44614461   int buswidth;
44624462   UINT64 mask = 0;
44634463
4464   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
4464   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
44654465   switch(buswidth)
44664466   {
44674467      case 8:
trunk/src/emu/distate.h
r17798r17799
233233}
234234
235235
236//-------------------------------------------------
237//  device_state - return a pointer to the device
238//  state interface for this device
239//-------------------------------------------------
240
241inline device_state_interface *device_state(device_t *device)
242{
243   device_state_interface *intf;
244   if (!device->interface(intf))
245      throw emu_fatalerror("Device '%s' does not have state interface", device->tag());
246   return intf;
247}
248
249
250236#endif   /* __DISTATE_H__ */
trunk/src/emu/sound/scsp.c
r17798r17799
702702static void SCSP_UpdateReg(scsp_state *scsp, int reg)
703703{
704704   /* temporary hack until this is converted to a device */
705   address_space *space = scsp->device->machine().firstcpu->memory().space(AS_PROGRAM);
705   address_space *space = scsp->device->machine().firstcpu->space(AS_PROGRAM);
706706
707707   switch(reg&0x3f)
708708   {
r17798r17799
13251325      case 0x416:
13261326         COMBINE_DATA(&scsp->dma_regs[((offset-0x412)/2) & 3]);
13271327         if(ACCESSING_BITS_8_15 && offset*2 == 0x416)
1328            dma_scsp(device->machine().firstcpu->memory().space(AS_PROGRAM), scsp);
1328            dma_scsp(device->machine().firstcpu->space(AS_PROGRAM), scsp);
13291329         break;
13301330      case 0x42a:      //check main cpu IRQ
13311331         scsp->main_irq(1);
trunk/src/emu/machine/latch8.c
r17798r17799
8282   if (latch8->has_read)
8383   {
8484      /*  temporary hack until all relevant systems are devices */
85      address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
85      address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
8686      int i;
8787      for (i=0; i<8; i++)
8888      {
trunk/src/emu/diexec.h
r17798r17799
220220   // required operation overrides
221221   void run() { execute_run(); }
222222
223   // deliberately ambiguous functions; if you have the execute interface
224   // just use it
225   device_execute_interface &execute() { return *this; }
226
223227protected:
224228   // internal helpers
225229   void run_thread_wrapper();
trunk/src/emu/dimemory.h
r17798r17799
123123   bool write(address_spacenum spacenum, offs_t offset, int size, UINT64 value) { return memory_write(spacenum, offset, size, value); }
124124   bool readop(offs_t offset, int size, UINT64 &value) { return memory_readop(offset, size, value); }
125125
126   // deliberately ambiguous functions; if you have the memory interface
127   // just use it
128   device_memory_interface &memory() { return *this; }
129
126130protected:
127131   // required overrides
128132   virtual const address_space_config *memory_space_config(address_spacenum spacenum) const = 0;
trunk/src/mess/machine/mbee.c
r17798r17799
222222
223223WRITE8_MEMBER( mbee_state::mbee_04_w )   // address
224224{
225   address_space *mem = m_maincpu->memory().space(AS_IO);
225   address_space *mem = m_maincpu->space(AS_IO);
226226   machine().device<mc146818_device>("rtc")->write(*mem, 0, data);
227227}
228228
229229WRITE8_MEMBER( mbee_state::mbee_06_w )   // write
230230{
231   address_space *mem = m_maincpu->memory().space(AS_IO);
231   address_space *mem = m_maincpu->space(AS_IO);
232232   machine().device<mc146818_device>("rtc")->write(*mem, 1, data);
233233}
234234
235235READ8_MEMBER( mbee_state::mbee_07_r )   // read
236236{
237   address_space *mem = m_maincpu->memory().space(AS_IO);
237   address_space *mem = m_maincpu->space(AS_IO);
238238   return machine().device<mc146818_device>("rtc")->read(*mem, 1);
239239}
240240
r17798r17799
263263
264264WRITE8_MEMBER( mbee_state::mbee256_50_w )
265265{
266   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
266   address_space *mem = m_maincpu->space(AS_PROGRAM);
267267
268268   // primary low banks
269269   membank("boot")->set_entry((data & 3) | ((data & 0x20) >> 3));
r17798r17799
345345
346346WRITE8_MEMBER( mbee_state::mbee128_50_w )
347347{
348   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
348   address_space *mem = m_maincpu->space(AS_PROGRAM);
349349
350350   // primary low banks
351351   membank("boot")->set_entry((data & 3));
trunk/src/mess/machine/trs80.c
r17798r17799
216216    d0 Select bit 0 */
217217
218218   /* get address space instead of io space */
219   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
219   address_space *mem = m_maincpu->space(AS_PROGRAM);
220220   UINT8 *base = memregion("maincpu")->base();
221221
222222   m_mode = (m_mode & 0x73) | (data & 0x8c);
r17798r17799
561561    d0 inverse video (entire screen) */
562562
563563   /* get address space instead of io space */
564   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
564   address_space *mem = m_maincpu->space(AS_PROGRAM);
565565
566566   m_mode = (m_mode & 0x87) | ((data & 0x0f) << 3);
567567
r17798r17799
867867MACHINE_RESET( trs80m4 )
868868{
869869   trs80_state *state = machine.driver_data<trs80_state>();
870   address_space *mem = state->m_maincpu->memory().space(AS_PROGRAM);
870   address_space *mem = state->m_maincpu->space(AS_PROGRAM);
871871   state->m_cassette_data = 0;
872872
873873   mem->install_read_bank (0x0000, 0x0fff, "bank1");
r17798r17799
896896MACHINE_RESET( lnw80 )
897897{
898898   trs80_state *state = machine.driver_data<trs80_state>();
899   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
899   address_space *space = state->m_maincpu->space(AS_PROGRAM);
900900   state->m_cassette_data = 0;
901901   state->m_reg_load = 1;
902902   state->lnw80_fe_w(*space, 0, 0);
trunk/src/mess/machine/wswan.c
r17798r17799
357357
358358WRITE8_MEMBER( wswan_state::wswan_port_w )
359359{
360   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
360   address_space *mem = m_maincpu->space(AS_PROGRAM);
361361   wswan_state *state = machine().driver_data<wswan_state>();
362362   UINT8 input;
363363   logerror( "PC=%X: port write %02X <- %02X\n", mem->device().safe_pc(), offset, data );
trunk/src/mess/machine/kaypro.c
r17798r17799
4242    d0 drive A */
4343
4444   /* get address space */
45   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
45   address_space *mem = m_maincpu->space(AS_PROGRAM);
4646
4747   if (data & 0x80)
4848   {
r17798r17799
329329MACHINE_RESET( kaypro2x )
330330{
331331   kaypro_state *state = machine.driver_data<kaypro_state>();
332   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
332   address_space *space = state->m_maincpu->space(AS_PROGRAM);
333333   state->kaypro2x_system_port_w(*space, 0, 0x80);
334334   MACHINE_RESET_CALL(kay_kbd);
335335}
r17798r17799
348348QUICKLOAD_LOAD( kayproii )
349349{
350350   kaypro_state *state = image.device().machine().driver_data<kaypro_state>();
351   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
351   address_space *space = state->m_maincpu->space(AS_PROGRAM);
352352   UINT8 *RAM = state->memregion("rambank")->base();
353353   UINT16 i;
354354   UINT8 data;
r17798r17799
371371QUICKLOAD_LOAD( kaypro2x )
372372{
373373   kaypro_state *state = image.device().machine().driver_data<kaypro_state>();
374   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
374   address_space *space = state->m_maincpu->space(AS_PROGRAM);
375375   UINT8 *RAM = state->memregion("rambank")->base();
376376   UINT16 i;
377377   UINT8 data;
trunk/src/mess/machine/c64.c
r17798r17799
12601260***************************************************************************/
12611261
12621262#define install_write_handler(_start, _end, _handler) \
1263   image.device().machine().firstcpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(_start, _end, FUNC(_handler));
1263   image.device().machine().firstcpu->space(AS_PROGRAM)->install_legacy_write_handler(_start, _end, FUNC(_handler));
12641264
12651265#define install_io1_handler(_handler) \
1266   image.device().machine().firstcpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xde00, 0xde00, 0, 0xff, FUNC(_handler));
1266   image.device().machine().firstcpu->space(AS_PROGRAM)->install_legacy_write_handler(0xde00, 0xde00, 0, 0xff, FUNC(_handler));
12671267
12681268#define install_io2_handler(_handler) \
1269   image.device().machine().firstcpu->memory().space(AS_PROGRAM)->install_legacy_write_handler(0xdf00, 0xdf00, 0, 0xff, FUNC(_handler));
1269   image.device().machine().firstcpu->space(AS_PROGRAM)->install_legacy_write_handler(0xdf00, 0xdf00, 0, 0xff, FUNC(_handler));
12701270
12711271#define allocate_cartridge_timer(_period, _func) \
12721272   legacy_c64_state *state = image.device().machine().driver_data<legacy_c64_state>(); \
r17798r17799
15771577
15781578   map_cartridge_roml(image.device().machine(), 0x0000);
15791579
1580   address_space *space = image.device().machine().firstcpu->memory().space(AS_PROGRAM);
1580   address_space *space = image.device().machine().firstcpu->space(AS_PROGRAM);
15811581   space->install_legacy_read_handler(0xdf00, 0xdfff, FUNC(super_explode_r));
15821582
15831583   install_io2_handler(super_explode_bank_w);
trunk/src/mess/machine/hd63450.c
r17798r17799
239239
240240static void dma_transfer_start(device_t* device, int channel, int dir)
241241{
242   address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
242   address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
243243   hd63450_t* dmac = get_safe_token(device);
244244   dmac->in_progress[channel] = 1;
245245   dmac->reg[channel].csr &= ~0xe0;
r17798r17799
316316
317317void hd63450_single_transfer(device_t* device, int x)
318318{
319   address_space *space = device->machine().firstcpu->memory().space(AS_PROGRAM);
319   address_space *space = device->machine().firstcpu->space(AS_PROGRAM);
320320   int data;
321321   int datasize = 1;
322322   hd63450_t* dmac = get_safe_token(device);
trunk/src/mess/machine/pc.c
r17798r17799
14091409
14101410DRIVER_INIT_MEMBER(pc_state,pc1640)
14111411{
1412   address_space *io_space = machine().firstcpu->memory().space( AS_IO );
1412   address_space *io_space = machine().firstcpu->space( AS_IO );
14131413
14141414   io_space->install_legacy_read_handler(0x278, 0x27b, FUNC(pc1640_port278_r), 0xffff);
14151415   io_space->install_legacy_read_handler(0x4278, 0x427b, FUNC(pc1640_port4278_r), 0xffff);
trunk/src/mess/machine/comx_clm.c
r17798r17799
251251
252252UINT8 comx_clm_device::comx_mrd_r(offs_t offset, int *extrom)
253253{
254   address_space *space = machine().firstcpu->memory().space(AS_PROGRAM);
254   address_space *space = machine().firstcpu->space(AS_PROGRAM);
255255
256256   UINT8 data = 0xff;
257257
r17798r17799
278278
279279void comx_clm_device::comx_mwr_w(offs_t offset, UINT8 data)
280280{
281   address_space *space = machine().firstcpu->memory().space(AS_PROGRAM);
281   address_space *space = machine().firstcpu->space(AS_PROGRAM);
282282
283283   if (offset >= 0xd000 && offset < 0xd800)
284284   {
trunk/src/mess/machine/advision.c
r17798r17799
3030   /* configure EA banking */
3131   membank("bank1")->configure_entry(0, memregion("bios")->base());
3232   membank("bank1")->configure_entry(1, memregion(I8048_TAG)->base());
33   m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x03ff, "bank1");
33   m_maincpu->space(AS_PROGRAM)->install_readwrite_bank(0x0000, 0x03ff, "bank1");
3434   membank("bank1")->set_entry(0);
3535
3636   /* allocate external RAM */
trunk/src/mess/machine/c128.c
r17798r17799
452452
453453   if ((!m_game && m_exrom) || (charen && (loram || hiram)))
454454   {
455      m_subcpu->memory().space(AS_PROGRAM)->install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(c128_state::read_io), this));
455      m_subcpu->space(AS_PROGRAM)->install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(c128_state::read_io), this));
456456      m_write_io = 1;
457457   }
458458   else
459459   {
460      m_subcpu->memory().space(AS_PROGRAM)->install_read_bank(0xd000, 0xdfff, "bank5");
460      m_subcpu->space(AS_PROGRAM)->install_read_bank(0xd000, 0xdfff, "bank5");
461461      m_write_io = 0;
462462      if ((!charen && (loram || hiram)))
463463         membank("bank13")->set_base(m_chargen);
r17798r17799
636636      else
637637         m_ram_top = 0x10000;
638638
639      m_subcpu->memory().space(AS_PROGRAM)->install_read_handler(0xff00, 0xff04, read8_delegate(FUNC(c128_state::mmu8722_ff00_r), this));
639      m_subcpu->space(AS_PROGRAM)->install_read_handler(0xff00, 0xff04, read8_delegate(FUNC(c128_state::mmu8722_ff00_r), this));
640640
641641      if (MMU_IO_ON)
642642      {
643643         m_write_io = 1;
644         m_subcpu->memory().space(AS_PROGRAM)->install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(c128_state::read_io), this));
644         m_subcpu->space(AS_PROGRAM)->install_read_handler(0xd000, 0xdfff, read8_delegate(FUNC(c128_state::read_io), this));
645645      }
646646      else
647647      {
648648         m_write_io = 0;
649         m_subcpu->memory().space(AS_PROGRAM)->install_read_bank(0xd000, 0xdfff, "bank13");
649         m_subcpu->space(AS_PROGRAM)->install_read_bank(0xd000, 0xdfff, "bank13");
650650      }
651651
652652
r17798r17799
10251025
10261026   bankswitch_64(0);
10271027
1028   m_memory[0x000] = m_subcpu->memory().space(AS_PROGRAM)->read_byte(0);
1029   m_memory[0x001] = m_subcpu->memory().space(AS_PROGRAM)->read_byte(1);
1028   m_memory[0x000] = m_subcpu->space(AS_PROGRAM)->read_byte(0);
1029   m_memory[0x001] = m_subcpu->space(AS_PROGRAM)->read_byte(1);
10301030}
10311031
10321032READ8_MEMBER( c128_state::cpu_r)
trunk/src/mess/machine/genpc.c
r17798r17799
570570
571571void ibm5160_mb_device::install_device(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_device_func rhandler, const char* rhandler_name, write8_device_func whandler, const char *whandler_name)
572572{
573   int buswidth = machine().firstcpu->memory().space_config(AS_IO)->m_databus_width;
573   int buswidth = machine().firstcpu->space_config(AS_IO)->m_databus_width;
574574   switch(buswidth)
575575   {
576576      case 8:
577         m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0);
577         m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name, 0);
578578         break;
579579      case 16:
580         m_maincpu->memory().space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff);
580         m_maincpu->space(AS_IO)->install_legacy_readwrite_handler(*dev, start, end, mask, mirror, rhandler, rhandler_name, whandler, whandler_name,0xffff);
581581         break;
582582      default:
583583         fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth);
r17798r17799
587587
588588void ibm5160_mb_device::install_device_write(device_t *dev, offs_t start, offs_t end, offs_t mask, offs_t mirror, write8_device_func whandler, const char *whandler_name)
589589{
590   int buswidth = machine().firstcpu->memory().space_config(AS_IO)->m_databus_width;
590   int buswidth = machine().firstcpu->space_config(AS_IO)->m_databus_width;
591591   switch(buswidth)
592592   {
593593      case 8:
594         m_maincpu->memory().space(AS_IO)->install_legacy_write_handler(*dev, start, end, mask, mirror, whandler, whandler_name,0);
594         m_maincpu->space(AS_IO)->install_legacy_write_handler(*dev, start, end, mask, mirror, whandler, whandler_name,0);
595595         break;
596596      case 16:
597         m_maincpu->memory().space(AS_IO)->install_legacy_write_handler(*dev, start, end, mask, mirror, whandler, whandler_name, 0xffff);
597         m_maincpu->space(AS_IO)->install_legacy_write_handler(*dev, start, end, mask, mirror, whandler, whandler_name, 0xffff);
598598         break;
599599      default:
600600         fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth);
r17798r17799
604604
605605void ibm5160_mb_device::install_device(offs_t start, offs_t end, offs_t mask, offs_t mirror, read8_delegate rhandler, write8_delegate whandler)
606606{
607   int buswidth = m_maincpu->memory().space_config(AS_IO)->m_databus_width;
607   int buswidth = m_maincpu->space_config(AS_IO)->m_databus_width;
608608   switch(buswidth)
609609   {
610610      case 8:
611         m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0);
611         m_maincpu->space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0);
612612         break;
613613      case 16:
614         m_maincpu->memory().space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff);
614         m_maincpu->space(AS_IO)->install_readwrite_handler(start, end, mask, mirror, rhandler, whandler, 0xffff);
615615         break;
616616      default:
617617         fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth);
r17798r17799
631631   install_device(m_pit8253, 0x0040, 0x0043, 0, 0, FUNC(pit8253_r), FUNC(pit8253_w) );
632632
633633   //  install_device(m_ppi8255, 0x0060, 0x0063, 0, 0, FUNC(i8255a_r), FUNC(i8255a_w) );
634   int buswidth = machine().firstcpu->memory().space_config(AS_IO)->m_databus_width;
634   int buswidth = machine().firstcpu->space_config(AS_IO)->m_databus_width;
635635   switch(buswidth)
636636   {
637637      case 8:
638         m_maincpu->memory().space(AS_IO)->install_readwrite_handler(0x0060, 0x0063, 0, 0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi8255), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi8255), 0);
638         m_maincpu->space(AS_IO)->install_readwrite_handler(0x0060, 0x0063, 0, 0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi8255), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi8255), 0);
639639         break;
640640      case 16:
641         m_maincpu->memory().space(AS_IO)->install_readwrite_handler(0x0060, 0x0063, 0, 0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi8255), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi8255), 0xffff);
641         m_maincpu->space(AS_IO)->install_readwrite_handler(0x0060, 0x0063, 0, 0, read8_delegate(FUNC(i8255_device::read), (i8255_device*)m_ppi8255), write8_delegate(FUNC(i8255_device::write), (i8255_device*)m_ppi8255), 0xffff);
642642         break;
643643      default:
644644         fatalerror("IBM5160_MOTHERBOARD: Bus width %d not supported\n", buswidth);
trunk/src/mess/machine/sorcerer.c
r17798r17799
361361
362362   UINT16 endmem = 0xbfff;
363363
364   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
364   address_space *space = state->m_maincpu->space(AS_PROGRAM);
365365   /* configure RAM */
366366   switch (state->m_ram->size())
367367   {
r17798r17799
389389
390390   UINT16 endmem = 0xbbff;
391391
392   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
392   address_space *space = state->m_maincpu->space(AS_PROGRAM);
393393   /* configure RAM */
394394   switch (state->m_ram->size())
395395   {
trunk/src/mess/machine/amstrad.c
r17798r17799
11971197   }
11981198   else  // CPC+/GX4000
11991199   {
1200      //address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
1200      //address_space *space = state->m_maincpu->space(AS_PROGRAM);
12011201
12021202/*      if ( state->m_asic.enabled && ( state->m_asic.rmr2 & 0x18 ) == 0x18 )
12031203        {
r17798r17799
21762176static void amstrad_handle_snapshot(running_machine &machine, unsigned char *pSnapshot)
21772177{
21782178   amstrad_state *state = machine.driver_data<amstrad_state>();
2179   address_space* space = state->m_maincpu->memory().space(AS_PROGRAM);
2179   address_space* space = state->m_maincpu->space(AS_PROGRAM);
21802180   mc6845_device *mc6845 = state->m_crtc;
21812181   device_t *ay8910 = state->m_ay;
21822182   int RegData;
r17798r17799
24592459static void update_psg(running_machine &machine)
24602460{
24612461   amstrad_state *state = machine.driver_data<amstrad_state>();
2462   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
2462   address_space *space = state->m_maincpu->space(AS_PROGRAM);
24632463   device_t *ay8910 = state->m_ay;
24642464   mc146818_device *rtc = state->m_rtc;
24652465
r17798r17799
28332833static void amstrad_common_init(running_machine &machine)
28342834{
28352835   amstrad_state *state = machine.driver_data<amstrad_state>();
2836   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
2836   address_space *space = state->m_maincpu->space(AS_PROGRAM);
28372837   device_t* romexp;
28382838   rom_image_device* romimage;
28392839   char str[20];
r17798r17799
29822982MACHINE_RESET( plus )
29832983{
29842984   amstrad_state *state = machine.driver_data<amstrad_state>();
2985   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
2985   address_space *space = state->m_maincpu->space(AS_PROGRAM);
29862986   int i;
29872987   UINT8 *rom = state->memregion("maincpu")->base();
29882988
r17798r17799
30343034MACHINE_RESET( gx4000 )
30353035{
30363036   amstrad_state *state = machine.driver_data<amstrad_state>();
3037   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
3037   address_space *space = state->m_maincpu->space(AS_PROGRAM);
30383038   int i;
30393039   UINT8 *rom = state->memregion("maincpu")->base();
30403040
trunk/src/mess/machine/kc_d004.c
r17798r17799
336336            if (data & 0x02)
337337            {
338338               for (int i=0; i<0xfc00; i++)
339                  m_cpu->memory().space(AS_PROGRAM)->write_byte(i, 0);
339                  m_cpu->space(AS_PROGRAM)->write_byte(i, 0);
340340
341341               device_set_input_line(m_cpu, INPUT_LINE_RESET, ASSERT_LINE);
342342            }
trunk/src/mess/machine/ti85.c
r17798r17799
6060static void update_ti83p_memory (running_machine &machine)
6161{
6262   ti85_state *state = machine.driver_data<ti85_state>();
63   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
63   address_space *space = state->m_maincpu->space(AS_PROGRAM);
6464
6565   if (state->m_ti8x_memory_page_1 & 0x40)
6666   {
r17798r17799
8484static void update_ti86_memory (running_machine &machine)
8585{
8686   ti85_state *state = machine.driver_data<ti85_state>();
87   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
87   address_space *space = state->m_maincpu->space(AS_PROGRAM);
8888
8989   if (state->m_ti8x_memory_page_1 & 0x40)
9090   {
r17798r17799
113113MACHINE_START( ti81 )
114114{
115115   ti85_state *state = machine.driver_data<ti85_state>();
116   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
116   address_space *space = state->m_maincpu->space(AS_PROGRAM);
117117   state->m_bios = state->memregion("bios")->base();
118118
119119   state->m_timer_interrupt_mask = 0;
r17798r17799
152152MACHINE_START( ti83p )
153153{
154154   ti85_state *state = machine.driver_data<ti85_state>();
155   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
155   address_space *space = state->m_maincpu->space(AS_PROGRAM);
156156   state->m_bios = state->memregion("bios")->base();
157157
158158   state->m_timer_interrupt_mask = 0;
r17798r17799
191191MACHINE_START( ti86 )
192192{
193193   ti85_state *state = machine.driver_data<ti85_state>();
194   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
194   address_space *space = state->m_maincpu->space(AS_PROGRAM);
195195   state->m_bios = state->memregion("bios")->base();
196196
197197   state->m_timer_interrupt_mask = 0;
r17798r17799
612612static void ti85_setup_snapshot (running_machine &machine, UINT8 * data)
613613{
614614   ti85_state *state = machine.driver_data<ti85_state>();
615   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
615   address_space *space = state->m_maincpu->space(AS_PROGRAM);
616616   int i;
617617   unsigned char lo,hi;
618618   unsigned char * hdw = data + 0x8000 + 0x94;
trunk/src/mess/machine/compis.c
r17798r17799
10541054
10551055WRITE16_MEMBER( compis_state::compis_i186_internal_port_w )
10561056{
1057   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
1058   address_space *io = m_maincpu->memory().space(AS_IO);
1057   address_space *mem = m_maincpu->space(AS_PROGRAM);
1058   address_space *io = m_maincpu->space(AS_IO);
10591059   int temp, which, data16 = data;
10601060
10611061   switch (offset)
trunk/src/mess/machine/mac.c
r17798r17799
18141814
18151815   if (m_model >= MODEL_MAC_POWERMAC_6100 && m_model <= MODEL_MAC_POWERMAC_8100)
18161816   {
1817      m_awacs->set_dma_base(m_maincpu->memory().space(AS_PROGRAM), 0x10000, 0x12000);
1817      m_awacs->set_dma_base(m_maincpu->space(AS_PROGRAM), 0x10000, 0x12000);
18181818   }
18191819
18201820   // start 60.15 Hz timer for most systems
trunk/src/mess/machine/special.c
r17798r17799
137137
138138void special_state::specimx_set_bank(offs_t i, UINT8 data)
139139{
140   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
140   address_space *space = m_maincpu->space(AS_PROGRAM);
141141   UINT8 *ram = m_ram->pointer();
142142
143143   space->install_write_bank(0xc000, 0xffbf, "bank3");
r17798r17799
276276   UINT8 bank4 = (m_RR_register >> 6) & 3;
277277   UINT8 *mem = memregion("maincpu")->base();
278278   UINT8 *ram = m_ram->pointer();
279   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
279   address_space *space = m_maincpu->space(AS_PROGRAM);
280280
281281   space->install_write_bank(0x0000, 0x3fff, "bank1");
282282   space->install_write_bank(0x4000, 0x8fff, "bank2");
trunk/src/mess/machine/kc.c
r17798r17799
6161      datasize = image.length() - 128;
6262   }
6363
64   address_space *space = state->m_maincpu->memory().space( AS_PROGRAM );
64   address_space *space = state->m_maincpu->space( AS_PROGRAM );
6565
6666   for (i=0; i<datasize; i++)
6767      space->write_byte((addr+i) & 0xffff, data[i+128]);
r17798r17799
290290/* update status of memory area 0x0000-0x03fff */
291291void kc_state::update_0x00000()
292292{
293   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
293   address_space *space = m_maincpu->space( AS_PROGRAM );
294294
295295   /* access ram? */
296296   if (m_pio_data[0] & (1<<1))
r17798r17799
330330/* update status of memory area 0x4000-0x07fff */
331331void kc_state::update_0x04000()
332332{
333   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
333   address_space *space = m_maincpu->space( AS_PROGRAM );
334334
335335   LOG(("Module at 0x4000\n"));
336336
r17798r17799
343343/* update memory address 0x0c000-0x0e000 */
344344void kc_state::update_0x0c000()
345345{
346   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
346   address_space *space = m_maincpu->space( AS_PROGRAM );
347347
348348   if ((m_pio_data[0] & (1<<7)) && memregion("basic")->base() != NULL)
349349   {
r17798r17799
366366/* update memory address 0x0e000-0x0ffff */
367367void kc_state::update_0x0e000()
368368{
369   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
369   address_space *space = m_maincpu->space( AS_PROGRAM );
370370
371371   if (m_pio_data[0] & (1<<0))
372372   {
r17798r17799
390390/* update status of memory area 0x08000-0x0ffff */
391391void kc_state::update_0x08000()
392392{
393   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
393   address_space *space = m_maincpu->space( AS_PROGRAM );
394394
395395    if (m_pio_data[0] & (1<<2))
396396    {
r17798r17799
413413/* update status of memory area 0x4000-0x07fff */
414414void kc85_4_state::update_0x04000()
415415{
416   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
416   address_space *space = m_maincpu->space( AS_PROGRAM );
417417
418418   /* access ram? */
419419   if (m_port_86_data & (1<<0))
r17798r17799
455455/* update memory address 0x0c000-0x0e000 */
456456void kc85_4_state::update_0x0c000()
457457{
458   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
458   address_space *space = m_maincpu->space( AS_PROGRAM );
459459
460460   if (m_port_86_data & (1<<7))
461461   {
r17798r17799
491491
492492void kc85_4_state::update_0x08000()
493493{
494   address_space *space = m_maincpu->memory().space( AS_PROGRAM );
494   address_space *space = m_maincpu->space( AS_PROGRAM );
495495
496496   if (m_pio_data[0] & (1<<2))
497497   {
trunk/src/mess/video/isa_cga.c
r17798r17799
15951595      // TODO: This should be moved to card implementations that actually had this feature
15961596      m_p3df = data;
15971597      if (data & 1) {
1598         address_space *space_prg = machine().firstcpu->memory().space(AS_PROGRAM);
1598         address_space *space_prg = machine().firstcpu->space(AS_PROGRAM);
15991599
16001600         space_prg->install_readwrite_handler(0xb8000, 0xb87ff, read8_delegate( FUNC(isa8_cga_device::char_ram_read), this), write8_delegate(FUNC(isa8_cga_device::char_ram_write), this) );
16011601      } else {
r17798r17799
20132013   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 ) );
20142014   m_isa->install_bank(0xb8000, 0xbbfff, 0, 0, "bank1", m_vram);
20152015
2016    address_space *space = machine().firstcpu->memory().space( AS_PROGRAM );
2016    address_space *space = machine().firstcpu->space( AS_PROGRAM );
20172017
20182018    space->install_write_handler( 0xb8000, 0xbbfff, 0, 0x0C000, write8_delegate( FUNC(isa8_cga_pc1512_device::vram_w), this ) );
20192019}
trunk/src/mess/video/atarist.c
r17798r17799
180180
181181inline void st_state::shifter_load()
182182{
183   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
183   address_space *program = m_maincpu->space(AS_PROGRAM);
184184   UINT16 data = program->read_word(m_shifter_ofs);
185185
186186   m_shifter_ir[m_shifter_bitplane] = data;
r17798r17799
619619
620620void st_state::blitter_source()
621621{
622   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
622   address_space *program = m_maincpu->space(AS_PROGRAM);
623623   UINT16 data = program->read_word(m_blitter_src);
624624
625625   if (m_blitter_src_inc_x < 0)
r17798r17799
669669
670670void st_state::blitter_op(UINT16 s, UINT32 dstaddr, UINT16 mask)
671671{
672   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
672   address_space *program = m_maincpu->space(AS_PROGRAM);
673673
674674   UINT16 d = program->read_word(dstaddr);
675675   UINT16 result = 0;
trunk/src/mess/video/pc_t1t.c
r17798r17799
922922static VIDEO_START( pc_t1t )
923923{
924924   int buswidth;
925   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
926   address_space *spaceio = machine.firstcpu->memory().space(AS_IO);
925   address_space *space = machine.firstcpu->space(AS_PROGRAM);
926   address_space *spaceio = machine.firstcpu->space(AS_IO);
927927
928928   pcjr.chr_gen = machine.root_device().memregion("gfx1")->base();
929929   pcjr.update_row = NULL;
930930   pcjr.bank = 0;
931931   pcjr.chr_size = 16;
932932
933   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
933   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
934934   switch(buswidth)
935935   {
936936      case 8:
r17798r17799
953953static VIDEO_START( pc_pcjr )
954954{
955955   int buswidth;
956   address_space *spaceio = machine.firstcpu->memory().space(AS_IO);
956   address_space *spaceio = machine.firstcpu->space(AS_IO);
957957
958958   pcjr.chr_gen = machine.root_device().memregion("gfx1")->base();
959959   pcjr.update_row = NULL;
r17798r17799
961961   pcjr.mode_control = 0x08;
962962   pcjr.chr_size = 8;
963963
964   buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
964   buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
965965   switch(buswidth)
966966   {
967967      case 8:
trunk/src/mess/video/newbrain.c
r17798r17799
1515
1616void newbrain_state::screen_update(bitmap_ind16 &bitmap, const rectangle &cliprect)
1717{
18   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
18   address_space *program = m_maincpu->space(AS_PROGRAM);
1919
2020   int y, sx;
2121   int columns = (m_tvctl & NEWBRAIN_VIDEO_80L) ? 80 : 40;
trunk/src/mess/video/pc_aga.c
r17798r17799
689689
690690VIDEO_START( pc_aga )
691691{
692   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
693   address_space *spaceio = machine.firstcpu->memory().space(AS_IO);
694   int buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
692   address_space *space = machine.firstcpu->space(AS_PROGRAM);
693   address_space *spaceio = machine.firstcpu->space(AS_IO);
694   int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
695695   switch(buswidth)
696696   {
697697      case 8:
r17798r17799
720720
721721VIDEO_START( pc200 )
722722{
723   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
724   address_space *spaceio = machine.firstcpu->memory().space(AS_IO);
725   int buswidth = machine.firstcpu->memory().space_config(AS_PROGRAM)->m_databus_width;
723   address_space *space = machine.firstcpu->space(AS_PROGRAM);
724   address_space *spaceio = machine.firstcpu->space(AS_IO);
725   int buswidth = machine.firstcpu->space_config(AS_PROGRAM)->m_databus_width;
726726   switch(buswidth)
727727   {
728728      case 8:
trunk/src/mess/video/ti85.c
r17798r17799
151151SCREEN_UPDATE_IND16( ti85 )
152152{
153153   ti85_state *state = screen.machine().driver_data<ti85_state>();
154   address_space *space = state->m_maincpu->memory().space(AS_PROGRAM);
154   address_space *space = state->m_maincpu->space(AS_PROGRAM);
155155   int x,y,b;
156156   int brightnes;
157157   int lcdmem;
trunk/src/mess/formats/ace_ace.c
r17798r17799
2727{
2828   cpu_device *cpu = image.device().machine().firstcpu;
2929   UINT8 *RAM = image.device().machine().root_device().memregion(cpu->tag())->base();
30   address_space *space = cpu->memory().space(AS_PROGRAM);
30   address_space *space = cpu->space(AS_PROGRAM);
3131   unsigned char ace_repeat, ace_byte, loop;
3232   int done=0, ace_index=0x2000;
3333
trunk/src/mess/formats/atom_atm.c
r17798r17799
2626
2727static void image_fread_memory(device_image_interface &image, UINT16 addr, UINT32 count)
2828{
29   void *ptr = image.device().machine().firstcpu->memory().space(AS_PROGRAM)->get_write_ptr(addr);
29   void *ptr = image.device().machine().firstcpu->space(AS_PROGRAM)->get_write_ptr(addr);
3030
3131   image.fread( ptr, count);
3232}
trunk/src/mess/formats/comx35_comx.c
r17798r17799
4747
4848QUICKLOAD_LOAD( comx35_comx )
4949{
50   address_space *program = image.device().machine().firstcpu->memory().space(AS_PROGRAM);
50   address_space *program = image.device().machine().firstcpu->space(AS_PROGRAM);
5151
5252   UINT8 header[16] = {0};
5353   int size = image.length();
trunk/src/mess/formats/trs_cmd.c
r17798r17799
3535
3636QUICKLOAD_LOAD( trs80_cmd )
3737{
38    address_space *program = image.device().machine().firstcpu->memory().space(AS_PROGRAM);
38    address_space *program = image.device().machine().firstcpu->space(AS_PROGRAM);
3939
4040   UINT8 type, length;
4141   UINT8 data[0x100];
trunk/src/mess/formats/cbm_snqk.c
r17798r17799
3030   UINT32 bytesread;
3131   UINT16 address = 0;
3232   int i;
33   address_space *space = image.device().machine().firstcpu->memory().space(AS_PROGRAM);
33   address_space *space = image.device().machine().firstcpu->space(AS_PROGRAM);
3434
3535   if (!file_type)
3636      goto error;
r17798r17799
9393
9494static void cbm_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
9595{
96   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
96   address_space *space = machine.firstcpu->space(AS_PROGRAM);
9797
9898   space->write_byte(0x31, hiaddress & 0xff);
9999   space->write_byte(0x2f, hiaddress & 0xff);
r17798r17799
120120
121121static void cbm_pet_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
122122{
123   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
123   address_space *space = machine.firstcpu->space(AS_PROGRAM);
124124
125125   space->write_byte(0x2e, hiaddress & 0xff);
126126   space->write_byte(0x2c, hiaddress & 0xff);
r17798r17799
137137
138138static void cbm_pet1_quick_sethiaddress(running_machine &machine, UINT16 hiaddress)
139139{
140   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
140   address_space *space = machine.firstcpu->space(AS_PROGRAM);
141141
142142   space->write_byte(0x80, hiaddress & 0xff);
143143   space->write_byte(0x7e, hiaddress & 0xff);
r17798r17799
154154
155155static void cbmb_quick_sethiaddress(running_machine &machine, UINT16 hiaddress)
156156{
157   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
157   address_space *space = machine.firstcpu->space(AS_PROGRAM);
158158
159159   space->write_byte(0xf0046, hiaddress & 0xff);
160160   space->write_byte(0xf0047, hiaddress >> 8);
r17798r17799
172172
173173static void cbm_c65_quick_sethiaddress( running_machine &machine, UINT16 hiaddress )
174174{
175   address_space *space = machine.firstcpu->memory().space(AS_PROGRAM);
175   address_space *space = machine.firstcpu->space(AS_PROGRAM);
176176
177177   space->write_byte(0x82, hiaddress & 0xff);
178178   space->write_byte(0x83, hiaddress >> 8);
trunk/src/mess/drivers/elf.c
r17798r17799
236236
237237void elf2_state::machine_start()
238238{
239   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
239   address_space *program = m_maincpu->space(AS_PROGRAM);
240240
241241   /* initialize LED displays */
242242   m_led_l->rbi_w(1);
trunk/src/mess/drivers/pc8401a.c
r17798r17799
7272
7373void pc8401a_state::bankswitch(UINT8 data)
7474{
75   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
75   address_space *program = m_maincpu->space(AS_PROGRAM);
7676
7777   int rombank = data & 0x03;
7878   int ram0000 = (data >> 2) & 0x03;
trunk/src/mess/drivers/mc1000.c
r17798r17799
2626
2727void mc1000_state::bankswitch()
2828{
29   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
29   address_space *program = m_maincpu->space(AS_PROGRAM);
3030
3131   /* MC6845 video RAM */
3232   membank("bank2")->set_entry(m_mc6845_bank);
r17798r17799
323323
324324void mc1000_state::machine_start()
325325{
326   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
326   address_space *program = m_maincpu->space(AS_PROGRAM);
327327
328328   /* setup memory banking */
329329   UINT8 *rom = memregion(Z80_TAG)->base();
trunk/src/mess/drivers/adam.c
r17798r17799
245245
246246void adam_state::bankswitch()
247247{
248   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
248   address_space *program = m_maincpu->space(AS_PROGRAM);
249249   UINT8 *ram = m_ram->pointer();
250250
251251   switch (m_mioc & 0x03)
trunk/src/mess/drivers/msbc1.c
r17798r17799
6565
6666void msbc1_state::machine_reset()
6767{
68   void *ram = machine().firstcpu->memory().space(AS_PROGRAM)->get_write_ptr(0);
68   void *ram = machine().firstcpu->space(AS_PROGRAM)->get_write_ptr(0);
6969   UINT8 *rom = memregion(MC68000R12_TAG)->base();
7070
7171   memcpy(ram, rom, 8);
trunk/src/mess/drivers/unixpc.c
r17798r17799
7171
7272void unixpc_state::machine_reset()
7373{
74   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
74   address_space *program = m_maincpu->space(AS_PROGRAM);
7575
7676   // force ROM into lower mem on reset
7777   romlmap_w(*program, 0, 0, 0xffff);
trunk/src/mess/drivers/pc1512.c
r17798r17799
888888
889889READ8_MEMBER( pc1512_state::memr_r )
890890{
891   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
891   address_space *program = m_maincpu->space(AS_PROGRAM);
892892   offs_t page_offset = m_dma_page[m_dma_channel] << 16;
893893
894894   return program->read_byte(page_offset + offset);
r17798r17799
896896
897897WRITE8_MEMBER( pc1512_state::memw_w )
898898{
899   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
899   address_space *program = m_maincpu->space(AS_PROGRAM);
900900   offs_t page_offset = m_dma_page[m_dma_channel] << 16;
901901
902902   program->write_byte(page_offset + offset, data);
r17798r17799
12101210
12111211   if (ram_size < 640 * 1024)
12121212   {
1213      address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1213      address_space *program = m_maincpu->space(AS_PROGRAM);
12141214      program->unmap_readwrite(ram_size, 0x9ffff);
12151215   }
12161216
trunk/src/mess/drivers/vii.c
r17798r17799
441441
442442void vii_state::vii_do_dma(UINT32 len)
443443{
444   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
444   address_space *mem = m_maincpu->space(AS_PROGRAM);
445445   UINT32 src = m_video_regs[0x70];
446446   UINT32 dst = m_video_regs[0x71] + 0x2c00;
447447   UINT32 j;
r17798r17799
612612
613613void vii_state::spg_do_dma(UINT32 len)
614614{
615   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
615   address_space *mem = m_maincpu->space(AS_PROGRAM);
616616
617617   UINT32 src = ((m_io_regs[0x101] & 0x3f) << 16) | m_io_regs[0x100];
618618   UINT32 dst = m_io_regs[0x103] & 0x3fff;
trunk/src/mess/drivers/xor100.c
r17798r17799
5757
5858void xor100_state::bankswitch()
5959{
60   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
60   address_space *program = m_maincpu->space(AS_PROGRAM);
6161   int banks = m_ram->size() / 0x10000;
6262
6363   switch (m_mode)
trunk/src/mess/drivers/fp1100.c
r17798r17799
171171   irq_mask = data;
172172   ///printf("%02x\n",data);
173173   // FIXME - the below 2 lines are needed, otherwise nothing ever gets written to videoram
174   address_space *mem = m_subcpu->memory().space(AS_PROGRAM);
174   address_space *mem = m_subcpu->space(AS_PROGRAM);
175175   data = mem->read_byte(0xe800);
176176}
177177
trunk/src/mess/drivers/tmc600.c
r17798r17799
237237
238238void tmc600_state::machine_start()
239239{
240   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
240   address_space *program = m_maincpu->space(AS_PROGRAM);
241241
242242   /* configure RAM */
243243   switch (m_ram->size())
trunk/src/mess/drivers/poly.c
r17798r17799
165165{
166166   m_term_data = data;
167167   //m_term_key = 1;
168   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
168   address_space *mem = m_maincpu->space(AS_PROGRAM);
169169   mem->write_byte(0xebec, data); // this has to be 0xecf1 for bios 1
170170   mem->write_byte(0xebd0, 1); // any non-zero here
171171}
trunk/src/mess/drivers/ace.c
r17798r17799
590590
591591void ace_state::machine_start()
592592{
593   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
593   address_space *program = m_maincpu->space(AS_PROGRAM);
594594
595595   /* configure RAM */
596596   switch (m_ram->size())
trunk/src/mess/drivers/mpf1.c
r17798r17799
479479DRIVER_INIT_MEMBER(mpf1_state,mpf1)
480480{
481481
482   m_maincpu->memory().space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(mpf1_state::mpf1_direct_update_handler), this));
482   m_maincpu->space(AS_PROGRAM)->set_direct_update_handler(direct_update_delegate(FUNC(mpf1_state::mpf1_direct_update_handler), this));
483483}
484484
485485COMP( 1979, mpf1,  0,    0, mpf1, mpf1, mpf1_state,  mpf1, "Multitech", "Micro Professor 1", 0)
trunk/src/mess/drivers/plus4.c
r17798r17799
802802
803803READ8_MEMBER( plus4_state::exp_dma_r )
804804{
805   return m_maincpu->memory().space(AS_PROGRAM)->read_byte(offset);
805   return m_maincpu->space(AS_PROGRAM)->read_byte(offset);
806806}
807807
808808WRITE8_MEMBER( plus4_state::exp_dma_w )
809809{
810   m_maincpu->memory().space(AS_PROGRAM)->write_byte(offset, data);
810   m_maincpu->space(AS_PROGRAM)->write_byte(offset, data);
811811}
812812
813813WRITE_LINE_MEMBER( plus4_state::exp_irq_w )
trunk/src/mess/drivers/atarist.c
r17798r17799
6767   if (m_fdc_fifo_empty[m_fdc_fifo_sel]) return;
6868
6969   if (m_fdc_dmabytes) {
70      address_space *program = m_maincpu->memory().space(AS_PROGRAM);
70      address_space *program = m_maincpu->space(AS_PROGRAM);
7171      for (int i = 0; i < 8; i++) {
7272         UINT16 data = m_fdc_fifo[m_fdc_fifo_sel][i];
7373
r17798r17799
9898void st_state::fill_dma_fifo()
9999{
100100   if (m_fdc_dmabytes) {
101      address_space *program = m_maincpu->memory().space(AS_PROGRAM);
101      address_space *program = m_maincpu->space(AS_PROGRAM);
102102      for (int i = 0; i < 8; i++) {
103103         UINT16 data = program->read_word(m_dma_base);
104104
r17798r17799
21422142
21432143void st_state::configure_memory()
21442144{
2145   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
2145   address_space *program = m_maincpu->space(AS_PROGRAM);
21462146
21472147   switch (m_ram->size())
21482148   {
r17798r17799
22922292void stbook_state::machine_start()
22932293{
22942294   /* configure RAM banking */
2295   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
2295   address_space *program = m_maincpu->space(AS_PROGRAM);
22962296
22972297   switch (m_ram->size())
22982298   {
trunk/src/mess/drivers/sg1000.c
r17798r17799
642642
643643void sg1000_state::install_cartridge(UINT8 *ptr, int size)
644644{
645   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
645   address_space *program = m_maincpu->space(AS_PROGRAM);
646646
647647   switch (size)
648648   {
r17798r17799
825825
826826void sc3000_state::install_cartridge(UINT8 *ptr, int size)
827827{
828   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
828   address_space *program = m_maincpu->space(AS_PROGRAM);
829829
830830   /* include SG-1000 mapping */
831831   sg1000_state::install_cartridge(ptr, size);
trunk/src/mess/drivers/px8.c
r17798r17799
7575
7676void px8_state::bankswitch()
7777{
78   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
78   address_space *program = m_maincpu->space(AS_PROGRAM);
7979   UINT8 *ram = m_ram->pointer();
8080   UINT8 *ipl_rom = memregion(UPD70008_TAG)->base();
8181
trunk/src/mess/drivers/mikromik.c
r17798r17799
757757
758758void mm1_state::machine_reset()
759759{
760   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
760   address_space *program = m_maincpu->space(AS_PROGRAM);
761761   int i;
762762
763763   // reset LS259
trunk/src/mess/drivers/osi.c
r17798r17799
674674
675675void sb2m600_state::machine_start()
676676{
677   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
677   address_space *program = m_maincpu->space(AS_PROGRAM);
678678
679679   /* configure RAM banking */
680680   membank("bank1")->configure_entry(0, memregion(M6502_TAG)->base());
r17798r17799
699699
700700void c1p_state::machine_start()
701701{
702   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
702   address_space *program = m_maincpu->space(AS_PROGRAM);
703703
704704   /* configure RAM banking */
705705   membank("bank1")->configure_entry(0, memregion(M6502_TAG)->base());
trunk/src/mess/drivers/rex6000.c
r17798r17799
153153
154154WRITE8_MEMBER( rex6000_state::bankswitch_w )
155155{
156   address_space* program = m_maincpu->memory().space(AS_PROGRAM);
156   address_space* program = m_maincpu->space(AS_PROGRAM);
157157
158158   m_bank[offset&3] = data;
159159
r17798r17799
451451}
452452void rex6000_state::machine_reset()
453453{
454   address_space* program = m_maincpu->memory().space(AS_PROGRAM);
454   address_space* program = m_maincpu->space(AS_PROGRAM);
455455
456456   program->install_readwrite_handler(0x8000, 0x9fff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0x8000_r), this), write8_delegate(FUNC(rex6000_state::flash_0x8000_w), this));
457457   program->install_readwrite_handler(0xa000, 0xbfff, 0, 0, read8_delegate(FUNC(rex6000_state::flash_0xa000_r), this), write8_delegate(FUNC(rex6000_state::flash_0xa000_w), this));
r17798r17799
492492            }
493493            else
494494            {
495               data =  m_flash[mem_type]->memory().space(0)->read_byte(((lcd_bank & 0x7f)<<13) | (y*30 + x));
495               data =  m_flash[mem_type]->space(0)->read_byte(((lcd_bank & 0x7f)<<13) | (y*30 + x));
496496            }
497497
498498
trunk/src/mess/drivers/v1050.c
r17798r17799
126126
127127void v1050_state::bankswitch()
128128{
129   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
129   address_space *program = m_maincpu->space(AS_PROGRAM);
130130
131131   int bank = (m_bank >> 1) & 0x03;
132132
r17798r17799
10201020
10211021void v1050_state::machine_start()
10221022{
1023   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1023   address_space *program = m_maincpu->space(AS_PROGRAM);
10241024
10251025   // initialize SASI bus
10261026   m_sasibus->init_scsibus(256);
trunk/src/mess/drivers/ql.c
r17798r17799
941941
942942void ql_state::machine_reset()
943943{
944   address_space   *program   = m_maincpu->memory().space(AS_PROGRAM);
944   address_space   *program   = m_maincpu->space(AS_PROGRAM);
945945
946946   m_disk_type=ioport(QL_CONFIG_PORT)->read() & DISK_TYPE_MASK;
947947   logerror("disktype=%d\n",m_disk_type);
trunk/src/mess/drivers/abc80x.c
r17798r17799
192192
193193void abc800_state::bankswitch()
194194{
195   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
195   address_space *program = m_maincpu->space(AS_PROGRAM);
196196
197197   if (m_fetch_charram)
198198   {
r17798r17799
213213
214214void abc802_state::bankswitch()
215215{
216   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
216   address_space *program = m_maincpu->space(AS_PROGRAM);
217217
218218   if (m_lrs)
219219   {
r17798r17799
235235
236236void abc806_state::bankswitch()
237237{
238   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
238   address_space *program = m_maincpu->space(AS_PROGRAM);
239239   UINT32 videoram_mask = m_ram->size() - (32 * 1024) - 1;
240240   int bank;
241241   char bank_name[10];
trunk/src/mess/drivers/a7000.c
r17798r17799
604604
605605void a7000_state::viddma_transfer_start()
606606{
607   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
607   address_space *mem = m_maincpu->space(AS_PROGRAM);
608608   UINT32 src = m_viddma_addr_start;
609609   UINT32 dst = 0;
610610   UINT32 size = m_viddma_addr_end;
trunk/src/mess/drivers/bigbord2.c
r17798r17799
415415
416416WRITE_LINE_MEMBER( bigbord2_state::frame )
417417{
418   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
418   address_space *space = m_maincpu->space(AS_PROGRAM);
419419   static UINT8 framecnt;
420420   framecnt++;
421421
trunk/src/mess/drivers/tvc.c
r17798r17799
3232
3333void tvc_state::tvc_set_mem_page(UINT8 data)
3434{
35   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
35   address_space *space = m_maincpu->space(AS_PROGRAM);
3636   switch(data & 0x18)
3737   {
3838      case 0x00 : // system ROM selected
trunk/src/mess/drivers/tmc1800.c
r17798r17799
167167
168168void tmc2000_state::bankswitch()
169169{
170   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
170   address_space *program = m_maincpu->space(AS_PROGRAM);
171171   UINT8 *ram = m_ram->pointer();
172172   UINT8 *rom = memregion(CDP1802_TAG)->base();
173173
r17798r17799
220220WRITE8_MEMBER( nano_state::bankswitch_w )
221221{
222222   /* enable RAM */
223   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
223   address_space *program = m_maincpu->space(AS_PROGRAM);
224224   UINT8 *ram = m_ram->pointer();
225225   program->install_ram(0x0000, 0x0fff, 0, 0x7000, ram);
226226
r17798r17799
745745   m_cti->reset();
746746
747747   /* enable ROM */
748   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
748   address_space *program = m_maincpu->space(AS_PROGRAM);
749749   UINT8 *rom = memregion(CDP1802_TAG)->base();
750750   program->install_rom(0x0000, 0x01ff, 0, 0x7e00, rom);
751751}
trunk/src/mess/drivers/newbrain.c
r17798r17799
6666
6767void newbrain_eim_state::bankswitch()
6868{
69   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
69   address_space *program = m_maincpu->space(AS_PROGRAM);
7070   int bank;
7171
7272   for (bank = 1; bank < 9; bank++)
r17798r17799
104104
105105void newbrain_state::bankswitch()
106106{
107   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
107   address_space *program = m_maincpu->space(AS_PROGRAM);
108108   int bank;
109109
110110   for (bank = 1; bank < 9; bank++)
trunk/src/mess/drivers/wangpc.c
r17798r17799
696696
697697READ8_MEMBER( wangpc_state::memr_r )
698698{
699   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
699   address_space *program = m_maincpu->space(AS_PROGRAM);
700700   offs_t addr = (m_dma_page[m_dack] << 16) | offset;
701701
702702   return program->read_byte(addr);
r17798r17799
704704
705705WRITE8_MEMBER( wangpc_state::memw_w )
706706{
707   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
707   address_space *program = m_maincpu->space(AS_PROGRAM);
708708   offs_t addr = (m_dma_page[m_dack] << 16) | offset;
709709
710710   program->write_byte(addr, data);
trunk/src/mess/drivers/fk1.c
r17798r17799
295295
296296READ8_MEMBER( fk1_state::fk1_bank_ram_r )
297297{
298   address_space *space_mem = m_maincpu->memory().space(AS_PROGRAM);
298   address_space *space_mem = m_maincpu->space(AS_PROGRAM);
299299   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
300300
301301   space_mem->install_write_bank(0x0000, 0x3fff, "bank1");
r17798r17799
306306
307307READ8_MEMBER( fk1_state::fk1_bank_rom_r )
308308{
309   address_space *space_mem = m_maincpu->memory().space(AS_PROGRAM);
309   address_space *space_mem = m_maincpu->space(AS_PROGRAM);
310310   space_mem->unmap_write(0x0000, 0x3fff);
311311   membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base());
312312   membank("bank2")->set_base(machine().device<ram_device>(RAM_TAG)->pointer() + 0x10000);
r17798r17799
425425
426426MACHINE_RESET_MEMBER( fk1_state )
427427{
428   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
428   address_space *space = m_maincpu->space(AS_PROGRAM);
429429   UINT8 *ram = machine().device<ram_device>(RAM_TAG)->pointer();
430430
431431   space->unmap_write(0x0000, 0x3fff);
trunk/src/mess/drivers/camplynx.c
r17798r17799
127127WRITE8_MEMBER( camplynx_state::lynx128k_bank_w )
128128{
129129   /* get address space */
130   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
130   address_space *mem = m_maincpu->space(AS_PROGRAM);
131131   UINT8 *base = mem->machine().root_device().memregion("maincpu")->base();
132132
133133   /* Set read banks */
r17798r17799
328328static MACHINE_RESET( lynx128k )
329329{
330330   camplynx_state *state = machine.driver_data<camplynx_state>();
331   address_space *mem = state->m_maincpu->memory().space(AS_PROGRAM);
331   address_space *mem = state->m_maincpu->space(AS_PROGRAM);
332332   mem->install_read_bank (0x0000, 0x1fff, "bank1");
333333   mem->install_read_bank (0x2000, 0x3fff, "bank2");
334334   mem->install_read_bank (0x4000, 0x5fff, "bank3");
trunk/src/mess/drivers/kyocera.c
r17798r17799
104104
105105void pc8201_state::bankswitch(UINT8 data)
106106{
107   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
107   address_space *program = m_maincpu->space(AS_PROGRAM);
108108
109109   int rom_bank = data & 0x03;
110110   int ram_bank = (data >> 2) & 0x03;
r17798r17799
454454
455455void tandy200_state::bankswitch(UINT8 data)
456456{
457   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
457   address_space *program = m_maincpu->space(AS_PROGRAM);
458458
459459   int rom_bank = data & 0x03;
460460   int ram_bank = (data >> 2) & 0x03;
r17798r17799
11271127
11281128void kc85_state::machine_start()
11291129{
1130   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1130   address_space *program = m_maincpu->space(AS_PROGRAM);
11311131
11321132   /* initialize RTC */
11331133   m_rtc->cs_w(1);
r17798r17799
11941194
11951195void trsm100_state::machine_start()
11961196{
1197   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1197   address_space *program = m_maincpu->space(AS_PROGRAM);
11981198
11991199   /* initialize RTC */
12001200   m_rtc->cs_w(1);
trunk/src/mess/drivers/bml3.c
r17798r17799
634634
635635void bml3_state::machine_reset()
636636{
637   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
637   address_space *mem = m_maincpu->space(AS_PROGRAM);
638638
639639   /* defaults */
640640   mem->install_rom(0xa000, 0xfeff,mem->machine().root_device().memregion("maincpu")->base() + 0xa000);
r17798r17799
698698
699699WRITE8_MEMBER(bml3_state::bml3_piaA_w)
700700{
701   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
701   address_space *mem = m_maincpu->space(AS_PROGRAM);
702702   /* ROM banking:
703703    -0-- --0- 0xa000 - 0xbfff ROM R RAM W
704704    -1-- --0- 0xa000 - 0xbfff RAM R/W
trunk/src/mess/drivers/tiki100.c
r17798r17799
4444
4545void tiki100_state::bankswitch()
4646{
47   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
47   address_space *program = m_maincpu->space(AS_PROGRAM);
4848
4949   if (m_vire)
5050   {
trunk/src/mess/drivers/abc1600.c
r17798r17799
182182   else if (offset < 0x180000)
183183   {
184184      // video RAM
185      address_space *program = m_maincpu->memory().space(AS_PROGRAM);
185      address_space *program = m_maincpu->space(AS_PROGRAM);
186186      data = video_ram_r(*program, offset);
187187   }
188188   else
r17798r17799
209209   else if (offset < 0x180000)
210210   {
211211      // video RAM
212      address_space *program = m_maincpu->memory().space(AS_PROGRAM);
212      address_space *program = m_maincpu->space(AS_PROGRAM);
213213      video_ram_w(*program, offset, data);
214214   }
215215   else
r17798r17799
242242
243243UINT8 abc1600_state::read_internal_io(offs_t offset)
244244{
245   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
245   address_space *program = m_maincpu->space(AS_PROGRAM);
246246   UINT8 data = 0;
247247
248248   if (X11)
r17798r17799
467467
468468void abc1600_state::write_internal_io(offs_t offset, UINT8 data)
469469{
470   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
470   address_space *program = m_maincpu->space(AS_PROGRAM);
471471
472472   if (X11)
473473   {
r17798r17799
770770
771771UINT8 abc1600_state::read_supervisor_memory(offs_t offset)
772772{
773   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
773   address_space *program = m_maincpu->space(AS_PROGRAM);
774774   UINT8 data = 0;
775775
776776   if (!A2 && !A1)
r17798r17799
799799
800800void abc1600_state::write_supervisor_memory(offs_t offset, UINT8 data)
801801{
802   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
802   address_space *program = m_maincpu->space(AS_PROGRAM);
803803
804804   if (!A2 && !A1)
805805   {
r17798r17799
18791879
18801880void abc1600_state::machine_reset()
18811881{
1882   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1882   address_space *program = m_maincpu->space(AS_PROGRAM);
18831883
18841884   // clear special control register
18851885   for (int i = 0; i < 8; i++)
trunk/src/mess/drivers/ob68k1a.c
r17798r17799
288288
289289void ob68k1a_state::machine_start()
290290{
291   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
291   address_space *program = m_maincpu->space(AS_PROGRAM);
292292
293293   // configure RAM
294294   switch (m_ram->size())
r17798r17799
306306
307307void ob68k1a_state::machine_reset()
308308{
309   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
309   address_space *program = m_maincpu->space(AS_PROGRAM);
310310
311311   // initialize COM8116
312312//  m_dbrg->stt_w(program, 0, 0x01);
trunk/src/mess/drivers/tandy2k.c
r17798r17799
4949
5050READ8_MEMBER( tandy2k_state::videoram_r )
5151{
52   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
52   address_space *program = m_maincpu->space(AS_PROGRAM);
5353
5454   offs_t addr = (m_vram_base << 15) | (offset << 1);
5555   UINT16 data = program->read_word(addr);
r17798r17799
319319static CRT9007_DRAW_SCANLINE( tandy2k_crt9007_display_pixels )
320320{
321321    tandy2k_state *state = device->machine().driver_data<tandy2k_state>();
322    address_space *program = state->m_maincpu->memory().space(AS_PROGRAM);
322    address_space *program = state->m_maincpu->space(AS_PROGRAM);
323323
324324    for (int sx = 0; sx < x_count; sx++)
325325    {
r17798r17799
670670void tandy2k_state::machine_start()
671671{
672672   // memory banking
673   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
673   address_space *program = m_maincpu->space(AS_PROGRAM);
674674   UINT8 *ram = m_ram->pointer();
675675   int ram_size = m_ram->size();
676676
trunk/src/mess/drivers/x07.c
r17798r17799
10421042{
10431043   running_machine &machine = image.device().machine();
10441044   x07_state *state = machine.driver_data<x07_state>();
1045   address_space *space = state->m_maincpu->memory().space( AS_PROGRAM );
1045   address_space *space = state->m_maincpu->space( AS_PROGRAM );
10461046   UINT16 ram_size = state->m_ram->size();
10471047
10481048   if (image.software_entry() == NULL)
r17798r17799
14541454   save_item(NAME(m_cursor.on));
14551455
14561456   /* install RAM */
1457   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1457   address_space *program = m_maincpu->space(AS_PROGRAM);
14581458   program->install_ram(0x0000, m_ram->size() - 1, m_ram->pointer());
14591459}
14601460
trunk/src/mess/drivers/z9001.c
r17798r17799
147147static TIMER_DEVICE_CALLBACK( timer_callback )
148148{
149149   z9001_state *state = timer.machine().driver_data<z9001_state>();
150   state->m_maincpu->memory().space(AS_PROGRAM)->write_byte(0x006a, 0);
150   state->m_maincpu->space(AS_PROGRAM)->write_byte(0x006a, 0);
151151}
152152
153153MACHINE_RESET_MEMBER( z9001_state )
r17798r17799
221221
222222WRITE8_MEMBER( z9001_state::kbd_put )
223223{
224   m_maincpu->memory().space(AS_PROGRAM)->write_byte(0x0025, data);
224   m_maincpu->space(AS_PROGRAM)->write_byte(0x0025, data);
225225}
226226
227227static ASCII_KEYBOARD_INTERFACE( keyboard_intf )
trunk/src/mess/drivers/pasopia7.c
r17798r17799
576576
577577   if(m_mio_sel)
578578   {
579      address_space *ram_space = m_maincpu->memory().space(AS_PROGRAM);
579      address_space *ram_space = m_maincpu->space(AS_PROGRAM);
580580
581581      m_mio_sel = 0;
582582      //printf("%08x\n",offset);
r17798r17799
627627
628628   if(m_mio_sel)
629629   {
630      address_space *ram_space = m_maincpu->memory().space(AS_PROGRAM);
630      address_space *ram_space = m_maincpu->space(AS_PROGRAM);
631631      m_mio_sel = 0;
632632      ram_space->write_byte(offset, data);
633633      return;
trunk/src/mess/drivers/exp85.c
r17798r17799
190190
191191void exp85_state::machine_start()
192192{
193   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
193   address_space *program = m_maincpu->space(AS_PROGRAM);
194194
195195   /* setup memory banking */
196196   program->install_read_bank(0x0000, 0x07ff, "bank1");
trunk/src/mess/drivers/m5.c
r17798r17799
617617
618618void m5_state::machine_start()
619619{
620   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
620   address_space *program = m_maincpu->space(AS_PROGRAM);
621621
622622   // configure RAM
623623   switch (m_ram->size())
trunk/src/mess/drivers/a5105.c
r17798r17799
220220
221221WRITE8_MEMBER( a5105_state::a5105_memsel_w )
222222{
223   address_space *prog = m_maincpu->memory().space( AS_PROGRAM );
223   address_space *prog = m_maincpu->space( AS_PROGRAM );
224224
225225   if (m_memsel[0] != ((data & 0x03) >> 0))
226226   {
r17798r17799
455455
456456MACHINE_RESET_MEMBER(a5105_state)
457457{
458   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
458   address_space *space = m_maincpu->space(AS_PROGRAM);
459459   a5105_ab_w(*space, 0, 9); // turn motor off
460460   beep_set_frequency(m_beep, 500);
461461
trunk/src/mess/drivers/bw12.c
r17798r17799
5151
5252void bw12_state::bankswitch()
5353{
54   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
54   address_space *program = m_maincpu->space(AS_PROGRAM);
5555
5656   switch (m_bank)
5757   {
trunk/src/mess/drivers/prestige.c
r17798r17799
120120
121121WRITE8_MEMBER( prestige_state::bankswitch_w )
122122{
123   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
123   address_space *program = m_maincpu->space(AS_PROGRAM);
124124
125125   switch (offset)
126126   {
trunk/src/mess/drivers/z88.c
r17798r17799
6767      // install read bank
6868      if (m_bank_type[bank] != Z88_BANK_ROM)
6969      {
70         m_maincpu->memory().space(AS_PROGRAM)->install_read_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag);
71         m_maincpu->memory().space(AS_PROGRAM)->unmap_write(bank<<14, (bank<<14) + 0x3fff);
70         m_maincpu->space(AS_PROGRAM)->install_read_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag);
71         m_maincpu->space(AS_PROGRAM)->unmap_write(bank<<14, (bank<<14) + 0x3fff);
7272         m_bank_type[bank] = Z88_BANK_ROM;
7373      }
7474
r17798r17799
8181         // install readwrite bank
8282         if (m_bank_type[bank] != Z88_BANK_RAM)
8383         {
84            m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag);
84            m_maincpu->space(AS_PROGRAM)->install_readwrite_bank(bank<<14, (bank<<14) + 0x3fff, bank_tag);
8585            m_bank_type[bank] = Z88_BANK_RAM;
8686         }
8787
r17798r17799
9292      {
9393         if (m_bank_type[bank] != Z88_BANK_UNMAP)
9494         {
95            m_maincpu->memory().space(AS_PROGRAM)->unmap_readwrite(bank<<14, (bank<<14) + 0x3fff);
95            m_maincpu->space(AS_PROGRAM)->unmap_readwrite(bank<<14, (bank<<14) + 0x3fff);
9696            m_bank_type[bank] = Z88_BANK_UNMAP;
9797         }
9898      }
r17798r17799
107107         switch (bank)
108108         {
109109            case 0:
110               m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(z88_state::bank0_cart_r), this), write8_delegate(FUNC(z88_state::bank0_cart_w), this));
110               m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(0x0000, 0x3fff, 0, 0, read8_delegate(FUNC(z88_state::bank0_cart_r), this), write8_delegate(FUNC(z88_state::bank0_cart_w), this));
111111               break;
112112            case 1:
113               m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(z88_state::bank1_cart_r), this), write8_delegate(FUNC(z88_state::bank1_cart_w), this));
113               m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(0x4000, 0x7fff, 0, 0, read8_delegate(FUNC(z88_state::bank1_cart_r), this), write8_delegate(FUNC(z88_state::bank1_cart_w), this));
114114               break;
115115            case 2:
116               m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(z88_state::bank2_cart_r), this), write8_delegate(FUNC(z88_state::bank2_cart_w), this));
116               m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(0x8000, 0xbfff, 0, 0, read8_delegate(FUNC(z88_state::bank2_cart_r), this), write8_delegate(FUNC(z88_state::bank2_cart_w), this));
117117               break;
118118            case 3:
119               m_maincpu->memory().space(AS_PROGRAM)->install_readwrite_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(z88_state::bank3_cart_r), this), write8_delegate(FUNC(z88_state::bank3_cart_w), this));
119               m_maincpu->space(AS_PROGRAM)->install_readwrite_handler(0xc000, 0xffff, 0, 0, read8_delegate(FUNC(z88_state::bank3_cart_r), this), write8_delegate(FUNC(z88_state::bank3_cart_w), this));
120120               break;
121121         }
122122
r17798r17799
128128   // override setting for lower 8k of bank 0
129129   if (bank == 0)
130130   {
131      m_maincpu->memory().space(AS_PROGRAM)->install_read_bank(0, 0x1fff, "bank1");
131      m_maincpu->space(AS_PROGRAM)->install_read_bank(0, 0x1fff, "bank1");
132132
133133      // enable RAM
134134      if (rams)
135         m_maincpu->memory().space(AS_PROGRAM)->install_write_bank(0, 0x1fff, "bank1");
135         m_maincpu->space(AS_PROGRAM)->install_write_bank(0, 0x1fff, "bank1");
136136      else
137         m_maincpu->memory().space(AS_PROGRAM)->unmap_write(0, 0x1fff);
137         m_maincpu->space(AS_PROGRAM)->unmap_write(0, 0x1fff);
138138
139139      membank("bank1")->set_entry(rams & 1);
140140   }
trunk/src/mess/drivers/pce220.c
r17798r17799
337337   // set to 1 after boot for restore the ram in the first bank
338338   if (data & 0x01)
339339   {
340      address_space *space_prg = m_maincpu->memory().space(AS_PROGRAM);
340      address_space *space_prg = m_maincpu->space(AS_PROGRAM);
341341      space_prg->install_write_bank(0x0000, 0x3fff, "bank1");
342342      membank("bank1")->set_entry(0);
343343   }
r17798r17799
469469
470470WRITE8_MEMBER( pcg850v_state::g850v_bank_w )
471471{
472   address_space *space_prg = m_maincpu->memory().space(AS_PROGRAM);
472   address_space *space_prg = m_maincpu->space(AS_PROGRAM);
473473
474474   if (data < 0x16)
475475   {
r17798r17799
872872
873873void pce220_state::machine_reset()
874874{
875   address_space *space = m_maincpu->memory().space(AS_PROGRAM);
875   address_space *space = m_maincpu->space(AS_PROGRAM);
876876   space->unmap_write(0x0000, 0x3fff);
877877
878878   // install the boot code into the first bank
trunk/src/mess/drivers/cxhumax.c
r17798r17799
154154      //we're in disabled debug_printf
155155      unsigned char* buf = (unsigned char *)alloca(200);
156156      unsigned char temp;
157      address_space *program = m_maincpu->memory().space(AS_PROGRAM);
157      address_space *program = m_maincpu->space(AS_PROGRAM);
158158
159159      memset(buf,0,200);
160160
trunk/src/mess/drivers/next.c
r17798r17799
304304   dma_slot &ds = dma_slots[slot];
305305   ds.drq = state;
306306   if(state && (ds.state & DMA_ENABLE)) {
307      address_space *space = maincpu->memory().space(AS_PROGRAM);
307      address_space *space = maincpu->space(AS_PROGRAM);
308308      if(ds.state & DMA_READ) {
309309         while(ds.drq) {
310310            dma_check_update(slot);
trunk/src/mess/drivers/prof80.c
r17798r17799
4848
4949void prof80_state::bankswitch()
5050{
51   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
51   address_space *program = m_maincpu->space(AS_PROGRAM);
5252   UINT8 *ram = m_ram->pointer();
5353   UINT8 *rom = memregion(Z80_TAG)->base();
5454   int bank;
trunk/src/mess/drivers/victor9k.c
r17798r17799
7575static MC6845_UPDATE_ROW( victor9k_update_row )
7676{
7777   victor9k_state *state = device->machine().driver_data<victor9k_state>();
78   address_space *program = state->m_maincpu->memory().space(AS_PROGRAM);
78   address_space *program = state->m_maincpu->space(AS_PROGRAM);
7979   const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
8080
8181   if (BIT(ma, 13))
r17798r17799
926926   device_set_irq_callback(m_maincpu, victor9k_irq_callback);
927927
928928   // memory banking
929   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
929   address_space *program = m_maincpu->space(AS_PROGRAM);
930930   program->install_ram(0x00000, m_ram->size() - 1, m_ram->pointer());
931931}
932932
trunk/src/mess/drivers/pc8001.c
r17798r17799
448448
449449READ8_MEMBER( pc8001_state::dma_io_r )
450450{
451   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
451   address_space *program = m_maincpu->space(AS_PROGRAM);
452452
453453   return program->read_byte(offset);
454454}
455455
456456WRITE8_MEMBER( pc8001_state::dma_io_w )
457457{
458   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
458   address_space *program = m_maincpu->space(AS_PROGRAM);
459459
460460   program->write_byte(offset, data);
461461}
r17798r17799
483483
484484void pc8001_state::machine_start()
485485{
486   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
486   address_space *program = m_maincpu->space(AS_PROGRAM);
487487
488488   /* initialize RTC */
489489   m_rtc->cs_w(1);
trunk/src/mess/drivers/bw2.c
r17798r17799
5151
5252    */
5353
54   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
54   address_space *program = m_maincpu->space(AS_PROGRAM);
5555
5656   int max_ram_bank = 0;
5757
r17798r17799
133133
134134    */
135135
136   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
136   address_space *program = m_maincpu->space(AS_PROGRAM);
137137
138138   int max_ram_bank = BANK_RAM1;
139139
r17798r17799
200200
201201WRITE8_MEMBER( bw2_state::ramcard_bank_w )
202202{
203   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
203   address_space *program = m_maincpu->space(AS_PROGRAM);
204204
205205   UINT8 ramcard_bank = data & 0x0f;
206206   UINT32 bank_offset = ramcard_bank * 0x8000;
trunk/src/mess/drivers/portfoli.c
r17798r17799
438438
439439WRITE8_MEMBER( portfolio_state::ncc1_w )
440440{
441   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
441   address_space *program = m_maincpu->space(AS_PROGRAM);
442442
443443   if (BIT(data, 0))
444444   {
r17798r17799
763763
764764void portfolio_state::machine_start()
765765{
766   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
766   address_space *program = m_maincpu->space(AS_PROGRAM);
767767
768768   /* set CPU interrupt vector callback */
769769   device_set_irq_callback(m_maincpu, portfolio_int_ack);
r17798r17799
801801
802802void portfolio_state::machine_reset()
803803{
804   address_space *io = m_maincpu->memory().space(AS_IO);
804   address_space *io = m_maincpu->space(AS_IO);
805805
806806   // peripherals
807807   m_pid = ioport("PERIPHERAL")->read();
trunk/src/mess/drivers/atom.c
r17798r17799
123123
124124void atom_state::bankswitch()
125125{
126   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
126   address_space *program = m_maincpu->space(AS_PROGRAM);
127127
128128   UINT8 *eprom = memregion(EXTROM_TAG)->base() + (m_eprom << 12);
129129
r17798r17799
648648    generator. I don't know if this is hardware, or random data because the
649649    ram chips are not cleared at start-up. So at this time, these numbers
650650    are poked into the memory to simulate it. When I have more details I will fix it */
651   UINT8 *m_baseram = (UINT8 *)m_maincpu->memory().space(AS_PROGRAM)->get_write_ptr(0x0000);
651   UINT8 *m_baseram = (UINT8 *)m_maincpu->space(AS_PROGRAM)->get_write_ptr(0x0000);
652652
653653   m_baseram[0x08] = machine().rand() & 0x0ff;
654654   m_baseram[0x09] = machine().rand() & 0x0ff;
trunk/src/mess/drivers/apricot.c
r17798r17799
256256
257257DRIVER_INIT_MEMBER(apricot_state,apricot)
258258{
259   address_space *prg = m_maincpu->memory().space(AS_PROGRAM);
259   address_space *prg = m_maincpu->space(AS_PROGRAM);
260260
261261   UINT8 *ram = m_ram->pointer();
262262   UINT32 ram_size = m_ram->size();
trunk/src/mess/drivers/lc80.c
r17798r17799
296296
297297void lc80_state::machine_start()
298298{
299   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
299   address_space *program = m_maincpu->space(AS_PROGRAM);
300300
301301   /* setup memory banking */
302302   membank("bank1")->configure_entry(0, memregion(Z80_TAG)->base()); // TODO
trunk/src/mess/drivers/supracan.c
r17798r17799
990990{
991991   acan_dma_regs_t *acan_dma_regs = &m_acan_dma_regs;
992992   int ch = (offset < 0x10/2) ? 0 : 1;
993   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
993   address_space *mem = m_maincpu->space(AS_PROGRAM);
994994
995995   switch(offset)
996996   {
r17798r17799
11251125
11261126READ8_MEMBER( supracan_state::supracan_6502_soundmem_r )
11271127{
1128   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
1128   address_space *mem = m_maincpu->space(AS_PROGRAM);
11291129   UINT8 data = m_soundram[offset];
11301130
11311131   switch(offset)
r17798r17799
13541354
13551355WRITE16_MEMBER( supracan_state::supracan_68k_soundram_w )
13561356{
1357   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
1357   address_space *mem = m_maincpu->space(AS_PROGRAM);
13581358   m_soundram[offset*2 + 1] = data & 0xff;
13591359   m_soundram[offset*2 + 0] = data >> 8;
13601360
r17798r17799
13771377
13781378READ16_MEMBER( supracan_state::supracan_68k_soundram_r )
13791379{
1380   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
1380   address_space *mem = m_maincpu->space(AS_PROGRAM);
13811381   UINT16 val = m_soundram[offset*2 + 0] << 8;
13821382   val |= m_soundram[offset*2 + 1];
13831383
r17798r17799
14511451
14521452READ16_MEMBER( supracan_state::supracan_video_r )
14531453{
1454   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
1454   address_space *mem = m_maincpu->space(AS_PROGRAM);
14551455   UINT16 data = m_video_regs[offset];
14561456
14571457   switch(offset)
r17798r17799
15541554
15551555WRITE16_MEMBER( supracan_state::supracan_video_w )
15561556{
1557   address_space *mem = m_maincpu->memory().space(AS_PROGRAM);
1557   address_space *mem = m_maincpu->space(AS_PROGRAM);
15581558   acan_sprdma_regs_t *acan_sprdma_regs = &m_acan_sprdma_regs;
15591559   int i;
15601560
trunk/src/mess/drivers/tek405x.c
r17798r17799
117117
118118void tek4051_state::bankswitch(UINT8 data)
119119{
120   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
120   address_space *program = m_maincpu->space(AS_PROGRAM);
121121
122122   //int d = data & 0x07;
123123   int lbs = (data >> 3) & 0x07;
r17798r17799
11671167
11681168void tek4051_state::machine_start()
11691169{
1170   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
1170   address_space *program = m_maincpu->space(AS_PROGRAM);
11711171
11721172   // configure RAM
11731173   switch (m_ram->size())
trunk/src/mess/drivers/apricotf.c
r17798r17799
3232
3333UINT32 f1_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
3434{
35   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
35   address_space *program = m_maincpu->space(AS_PROGRAM);
3636   int lines = m_200_256 ? 200 : 256;
3737
3838   for (int y = 0; y < lines; y++)
trunk/src/mess/drivers/mstation.c
r17798r17799
173173
174174void mstation_state::refresh_memory(UINT8 bank, UINT8 chip_select)
175175{
176   address_space* program = m_maincpu->memory().space(AS_PROGRAM);
176   address_space* program = m_maincpu->space(AS_PROGRAM);
177177   int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000);
178178   char bank_tag[6];
179179
trunk/src/mess/drivers/pcfx.c
r17798r17799
6767
6868READ8_MEMBER(pcfx_state::extio_r)
6969{
70   address_space *io_space = m_maincpu->memory().space(AS_IO);
70   address_space *io_space = m_maincpu->space(AS_IO);
7171
7272   return io_space->read_byte(offset);
7373}
7474
7575WRITE8_MEMBER(pcfx_state::extio_w)
7676{
77   address_space *io_space = m_maincpu->memory().space(AS_IO);
77   address_space *io_space = m_maincpu->space(AS_IO);
7878
7979   io_space->write_byte(offset, data);
8080}
trunk/src/mess/drivers/avigo.c
r17798r17799
158158
159159void avigo_state::refresh_memory(UINT8 bank, UINT8 chip_select)
160160{
161   address_space* space = m_maincpu->memory().space(AS_PROGRAM);
161   address_space* space = m_maincpu->space(AS_PROGRAM);
162162   int &active_flash = (bank == 1 ? m_flash_at_0x4000 : m_flash_at_0x8000);
163163   char bank_tag[6];
164164
r17798r17799
830830static QUICKLOAD_LOAD(avigo)
831831{
832832   avigo_state *state = image.device().machine().driver_data<avigo_state>();
833   address_space* flash1 = state->m_flashes[1]->memory().space(0);
833   address_space* flash1 = state->m_flashes[1]->space(0);
834834   const char *systemname = image.device().machine().system().name;
835835   UINT32 first_app_page = (0x50000>>14);
836836   int app_page;
trunk/src/mess/drivers/super6.c
r17798r17799
3030
3131void super6_state::bankswitch()
3232{
33   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
33   address_space *program = m_maincpu->space(AS_PROGRAM);
3434   UINT8 *ram = m_ram->pointer();
3535   UINT8 *rom = memregion(Z80_TAG)->base();
3636
trunk/src/mess/drivers/c64.c
r17798r17799
849849
850850READ8_MEMBER( c64_state::exp_dma_r )
851851{
852   return m_maincpu->memory().space(AS_PROGRAM)->read_byte(offset);
852   return m_maincpu->space(AS_PROGRAM)->read_byte(offset);
853853}
854854
855855WRITE8_MEMBER( c64_state::exp_dma_w )
856856{
857   m_maincpu->memory().space(AS_PROGRAM)->write_byte(offset, data);
857   m_maincpu->space(AS_PROGRAM)->write_byte(offset, data);
858858}
859859
860860WRITE_LINE_MEMBER( c64_state::exp_irq_w )
trunk/src/mess/drivers/xerox820.c
r17798r17799
143143
144144void xerox820_state::bankswitch(int bank)
145145{
146   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
146   address_space *program = m_maincpu->space(AS_PROGRAM);
147147   UINT8 *ram = m_ram->pointer();
148148
149149   if (bank)
r17798r17799
162162
163163void xerox820ii_state::bankswitch(int bank)
164164{
165   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
165   address_space *program = m_maincpu->space(AS_PROGRAM);
166166   UINT8 *ram = m_ram->pointer();
167167
168168   if (bank)
trunk/src/mess/drivers/micronic.c
r17798r17799
164164   if (data < 2)
165165   {
166166      membank("bank1")->set_entry(data);
167      m_maincpu->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x7fff);
167      m_maincpu->space(AS_PROGRAM)->unmap_write(0x0000, 0x7fff);
168168   }
169169   else
170170   {
171171      membank("bank1")->set_entry((data <= m_banks_num) ? data : m_banks_num);
172      m_maincpu->memory().space(AS_PROGRAM)->install_write_bank(0x0000, 0x7fff, "bank1");
172      m_maincpu->space(AS_PROGRAM)->install_write_bank(0x0000, 0x7fff, "bank1");
173173   }
174174}
175175
r17798r17799
342342void micronic_state::machine_reset()
343343{
344344   membank("bank1")->set_entry(0);
345   m_maincpu->memory().space(AS_PROGRAM)->unmap_write(0x0000, 0x7fff);
345   m_maincpu->space(AS_PROGRAM)->unmap_write(0x0000, 0x7fff);
346346}
347347
348348
trunk/src/mess/drivers/cosmicos.c
r17798r17799
252252
253253void cosmicos_state::set_ram_mode()
254254{
255   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
255   address_space *program = m_maincpu->space(AS_PROGRAM);
256256   UINT8 *ram = m_ram->pointer();
257257
258258   if (m_ram_disable)
r17798r17799
486486
487487void cosmicos_state::machine_start()
488488{
489   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
489   address_space *program = m_maincpu->space(AS_PROGRAM);
490490
491491   /* initialize LED display */
492492   m_led->rbi_w(1);
trunk/src/mess/drivers/vic10.c
r17798r17799
124124
125125READ8_MEMBER( vic10_state::vic_videoram_r )
126126{
127   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
127   address_space *program = m_maincpu->space(AS_PROGRAM);
128128
129129   if (offset < 0x3000)
130130      return program->read_byte(offset);
trunk/src/mess/drivers/vixen.c
r17798r17799
809809
810810void vixen_state::machine_reset()
811811{
812   address_space *program = m_maincpu->memory().space(AS_PROGRAM);
812   address_space *program = m_maincpu->space(AS_PROGRAM);
813813
814814   program->install_read_bank(0x0000, 0xefff, 0xfff, 0, "bank1");
815815   program->install_write_bank(0x0000, 0xefff, 0xfff, 0, "bank2");
r17798r17799
910910   {
911911      if (m_reset)
912912      {
913         address_space *program = m_maincpu->memory().space(AS_PROGRAM);
913         address_space *program = m_maincpu->space(AS_PROGRAM);
914914
915915         program->install_read_bank(0x0000, 0xefff, "bank1");
916916         program->install_write_bank(0x0000, 0xefff, "bank2");

Previous 199869 Revisions Next


© 1997-2024 The MAME Team