diff --git a/src/mame/drivers/kickgoal.c b/src/mame/drivers/kickgoal.c index 36f2b1f9a16..4e3b14558da 100644 --- a/src/mame/drivers/kickgoal.c +++ b/src/mame/drivers/kickgoal.c @@ -305,7 +305,8 @@ static int m6295_bank; static UINT16 m6295_key_delay; static INTERRUPT_GEN( kickgoal_interrupt ) { - if ((okim6295_status_0_r(device->machine,0) & 0x08) == 0) + const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM); + if ((okim6295_status_0_r(space,0) & 0x08) == 0) { switch(kickgoal_melody_loop) { @@ -334,8 +335,8 @@ static INTERRUPT_GEN( kickgoal_interrupt ) if (kickgoal_melody_loop) { // logerror("Changing to sample %02x\n",kickgoal_melody_loop); - okim6295_data_0_w(device->machine,0,((0x80 | kickgoal_melody_loop) & 0xff)); - okim6295_data_0_w(device->machine,0,0x81); + okim6295_data_0_w(space,0,((0x80 | kickgoal_melody_loop) & 0xff)); + okim6295_data_0_w(space,0,0x81); } } if ( input_code_pressed_once(KEYCODE_PGUP) ) @@ -412,9 +413,9 @@ static INTERRUPT_GEN( kickgoal_interrupt ) { if (m6295_key_delay >= (0x80 * oki_time_base)) { - okim6295_data_0_w(device->machine,0,0x78); - okim6295_data_0_w(device->machine,0,(0x80 | m6295_comm)); - okim6295_data_0_w(device->machine,0,0x11); + okim6295_data_0_w(space,0,0x78); + okim6295_data_0_w(space,0,(0x80 | m6295_comm)); + okim6295_data_0_w(space,0,0x11); popmessage("Playing sound %02x on Bank %02x",m6295_comm,m6295_bank); diff --git a/src/mame/drivers/wgp.c b/src/mame/drivers/wgp.c index 7c6f3f6b0f0..aea1ad39a6c 100644 --- a/src/mame/drivers/wgp.c +++ b/src/mame/drivers/wgp.c @@ -635,15 +635,15 @@ static WRITE8_HANDLER( sound_bankswitch_w ) static WRITE16_HANDLER( wgp_sound_w ) { if (offset == 0) - taitosound_port_w (space->machine, 0, data & 0xff); + taitosound_port_w (space, 0, data & 0xff); else if (offset == 1) - taitosound_comm_w (space->machine, 0, data & 0xff); + taitosound_comm_w (space, 0, data & 0xff); } static READ16_HANDLER( wgp_sound_r ) { if (offset == 1) - return ((taitosound_comm_r (space->machine, 0) & 0xff)); + return ((taitosound_comm_r (space, 0) & 0xff)); else return 0; } diff --git a/src/mame/video/crshrace.c b/src/mame/video/crshrace.c index b148b72ea01..9bd83b682f8 100644 --- a/src/mame/video/crshrace.c +++ b/src/mame/video/crshrace.c @@ -215,6 +215,7 @@ popmessage("gfxctrl = %02x",gfxctrl); VIDEO_EOF( crshrace ) { - buffer_spriteram16_w(machine,0,0,0xffff); - buffer_spriteram16_2_w(machine,0,0,0xffff); + const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + buffer_spriteram16_w(space,0,0,0xffff); + buffer_spriteram16_2_w(space,0,0,0xffff); } diff --git a/src/mame/video/dogfgt.c b/src/mame/video/dogfgt.c index 37c083b2f52..d218214a34d 100644 --- a/src/mame/video/dogfgt.c +++ b/src/mame/video/dogfgt.c @@ -220,6 +220,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan VIDEO_UPDATE( dogfgt ) { + const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM); static int lastflip,lastpixcolor; int offs; @@ -230,7 +231,7 @@ VIDEO_UPDATE( dogfgt ) lastpixcolor = pixcolor; for (offs = 0;offs < BITMAPRAM_SIZE;offs++) - internal_bitmapram_w(screen->machine,offs,bitmapram[offs]); + internal_bitmapram_w(space,offs,bitmapram[offs]); } diff --git a/src/mame/video/groundfx.c b/src/mame/video/groundfx.c index 0c91ca0f69d..c099223855f 100644 --- a/src/mame/video/groundfx.c +++ b/src/mame/video/groundfx.c @@ -220,6 +220,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan VIDEO_UPDATE( groundfx ) { + const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM); UINT8 layer[5]; UINT8 pivlayer[3]; UINT16 priority; @@ -261,12 +262,12 @@ VIDEO_UPDATE( groundfx ) it's contents the usual way. */ - if (TC0100SCN_long_r(screen->machine,0x4090/4,0xffffffff) || TC0480SCP_long_r(screen->machine,0x20/4,0xffffffff)==0x240866) { /* Anything in text layer - really stupid hack */ + if (TC0100SCN_long_r(space,0x4090/4,0xffffffff) || TC0480SCP_long_r(space,0x20/4,0xffffffff)==0x240866) { /* Anything in text layer - really stupid hack */ TC0480SCP_tilemap_draw(bitmap,cliprect,layer[1],0,2); TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,4); TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,8); // TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[2],0,0); - if (TC0480SCP_long_r(screen->machine,0x20/4,0xffffffff)!=0x240866) /* Stupid hack for start of race */ + if (TC0480SCP_long_r(space,0x20/4,0xffffffff)!=0x240866) /* Stupid hack for start of race */ TC0480SCP_tilemap_draw(bitmap,&hack_cliprect,layer[0],0,0); draw_sprites(screen->machine,bitmap,cliprect,1,44,-574); } else { diff --git a/src/mame/video/hd63484.c b/src/mame/video/hd63484.c index a9f035a5c8b..5513806d105 100644 --- a/src/mame/video/hd63484.c +++ b/src/mame/video/hd63484.c @@ -1358,7 +1358,7 @@ WRITE16_HANDLER( HD63484_data_w ) if (regno & 0x80) regno += 2; /* autoincrement */ logerror("PC %05x: HD63484 register %02x write %04x\n",cpu_get_pc(space->cpu),regno,HD63484_reg[regno/2]); if (regno == 0) /* FIFO */ - HD63484_command_w(space, HD63484_reg[0]); + HD63484_command_w(space->machine, HD63484_reg[0]); } READ16_HANDLER( HD63484_data_r ) diff --git a/src/mame/video/homedata.c b/src/mame/video/homedata.c index 18109f4533c..87ad5ae75b5 100644 --- a/src/mame/video/homedata.c +++ b/src/mame/video/homedata.c @@ -48,7 +48,7 @@ static tilemap *bg_tilemap[2][4]; ***************************************************************************/ -static void mrokumei_handleblit( running_machine *machine, int rom_base ) +static void mrokumei_handleblit( const address_space *space, int rom_base ) { int i; int DestParam; @@ -56,7 +56,7 @@ static void mrokumei_handleblit( running_machine *machine, int rom_base ) int DestAddr; int BaseAddr; int opcode,data,NumTiles; - UINT8 *pBlitData = memory_region(machine, "user1") + rom_base; + UINT8 *pBlitData = memory_region(space->machine, "user1") + rom_base; DestParam = blitter_param[(blitter_param_count-4)&3]*256+ @@ -116,7 +116,7 @@ static void mrokumei_handleblit( running_machine *machine, int rom_base ) } /* i!=0 */ if (data) /* 00 is a nop */ - mrokumei_videoram_w( machine, BaseAddr + DestAddr, data ); + mrokumei_videoram_w( space, BaseAddr + DestAddr, data ); if (homedata_vreg[1] & 0x80) /* flip screen */ { @@ -132,17 +132,17 @@ static void mrokumei_handleblit( running_machine *machine, int rom_base ) } /* for(;;) */ finish: - cpu_set_input_line(machine->cpu[0],M6809_FIRQ_LINE,HOLD_LINE); + cpu_set_input_line(space->machine->cpu[0],M6809_FIRQ_LINE,HOLD_LINE); } -static void reikaids_handleblit( running_machine *machine, int rom_base ) +static void reikaids_handleblit( const address_space *space, int rom_base ) { int i; UINT16 DestParam; int flipx; int SourceAddr, BaseAddr; int DestAddr; - UINT8 *pBlitData = memory_region(machine, "user1") + rom_base; + UINT8 *pBlitData = memory_region(space->machine, "user1") + rom_base; int opcode,data,NumTiles; @@ -220,7 +220,7 @@ static void reikaids_handleblit( running_machine *machine, int rom_base ) addr ^= 0x007c; } - reikaids_videoram_w( machine, addr, dat ); + reikaids_videoram_w( space, addr, dat ); } } @@ -232,17 +232,17 @@ static void reikaids_handleblit( running_machine *machine, int rom_base ) } finish: - cpu_set_input_line(machine->cpu[0],M6809_FIRQ_LINE,HOLD_LINE); + cpu_set_input_line(space->machine->cpu[0],M6809_FIRQ_LINE,HOLD_LINE); } -static void pteacher_handleblit( running_machine *machine, int rom_base ) +static void pteacher_handleblit( const address_space *space, int rom_base ) { int i; int DestParam; int SourceAddr; int DestAddr, BaseAddr; int opcode,data,NumTiles; - UINT8 *pBlitData = memory_region(machine, "user1") + rom_base; + UINT8 *pBlitData = memory_region(space->machine, "user1") + rom_base; DestParam = blitter_param[(blitter_param_count-4)&3]*256+ @@ -308,7 +308,7 @@ static void pteacher_handleblit( running_machine *machine, int rom_base ) if ((addr & 0x2080) == 0) { addr = ((addr & 0xc000) >> 2) | ((addr & 0x1f00) >> 1) | (addr & 0x7f); - pteacher_videoram_w( machine, addr, data ); + pteacher_videoram_w( space, addr, data ); } } @@ -320,7 +320,7 @@ static void pteacher_handleblit( running_machine *machine, int rom_base ) } /* for(;;) */ finish: - cpu_set_input_line(machine->cpu[0],M6809_FIRQ_LINE,HOLD_LINE); + cpu_set_input_line(space->machine->cpu[0],M6809_FIRQ_LINE,HOLD_LINE); } @@ -650,7 +650,7 @@ WRITE8_HANDLER( pteacher_blitter_bank_w ) WRITE8_HANDLER( mrokumei_blitter_start_w ) { - if (data & 0x80) mrokumei_handleblit(space->machine, ((blitter_bank & 0x04) >> 2) * 0x10000); + if (data & 0x80) mrokumei_handleblit(space, ((blitter_bank & 0x04) >> 2) * 0x10000); /* bit 0 = bank switch; used by hourouki to access the optional service mode ROM (not available in current dump) */ @@ -658,12 +658,12 @@ WRITE8_HANDLER( mrokumei_blitter_start_w ) WRITE8_HANDLER( reikaids_blitter_start_w ) { - reikaids_handleblit(space->machine, (blitter_bank & 3) * 0x10000); + reikaids_handleblit(space, (blitter_bank & 3) * 0x10000); } WRITE8_HANDLER( pteacher_blitter_start_w ) { - pteacher_handleblit(space->machine, (blitter_bank >> 5) * 0x10000 & (memory_region_length(space->machine, "user1") - 1)); + pteacher_handleblit(space, (blitter_bank >> 5) * 0x10000 & (memory_region_length(space->machine, "user1") - 1)); } diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c index 37e33dd2395..544af20c5a1 100644 --- a/src/mame/video/leland.c +++ b/src/mame/video/leland.c @@ -336,7 +336,7 @@ WRITE8_HANDLER( leland_mvram_port_w ) READ8_HANDLER( leland_mvram_port_r ) { - return leland_vram_port_r(space, offset, 0); + return leland_vram_port_r(space->machine, offset, 0); } @@ -355,13 +355,13 @@ WRITE8_HANDLER( leland_slave_video_addr_w ) WRITE8_HANDLER( leland_svram_port_w ) { - leland_vram_port_w(space, offset, data, 1); + leland_vram_port_w(space->machine, offset, data, 1); } READ8_HANDLER( leland_svram_port_r ) { - return leland_vram_port_r(space, offset, 1); + return leland_vram_port_r(space->machine, offset, 1); } @@ -382,7 +382,7 @@ WRITE8_HANDLER( ataxx_mvram_port_w ) WRITE8_HANDLER( ataxx_svram_port_w ) { offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); - leland_vram_port_w(space, offset, data, 1); + leland_vram_port_w(space->machine, offset, data, 1); } @@ -396,14 +396,14 @@ WRITE8_HANDLER( ataxx_svram_port_w ) READ8_HANDLER( ataxx_mvram_port_r ) { offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); - return leland_vram_port_r(space, offset, 0); + return leland_vram_port_r(space->machine, offset, 0); } READ8_HANDLER( ataxx_svram_port_r ) { offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); - return leland_vram_port_r(space, offset, 1); + return leland_vram_port_r(space->machine, offset, 1); } diff --git a/src/mame/video/niyanpai.c b/src/mame/video/niyanpai.c index 88494e8ccaa..d2191fa0656 100644 --- a/src/mame/video/niyanpai.c +++ b/src/mame/video/niyanpai.c @@ -86,10 +86,10 @@ WRITE16_HANDLER( niyanpai_palette_w ) ******************************************************************************/ -static int niyanpai_blitter_r(running_machine *machine, int vram, int offset) +static int niyanpai_blitter_r(const address_space *space, int vram, int offset) { int ret; - UINT8 *GFXROM = memory_region(machine, "gfx1"); + UINT8 *GFXROM = memory_region(space->machine, "gfx1"); switch (offset) { @@ -101,7 +101,7 @@ static int niyanpai_blitter_r(running_machine *machine, int vram, int offset) return ret; } -static void niyanpai_blitter_w(running_machine *machine, int vram, int offset, int data) +static void niyanpai_blitter_w(const address_space *space, int vram, int offset, int data) { switch (offset) { @@ -113,7 +113,7 @@ static void niyanpai_blitter_w(running_machine *machine, int vram, int offset, i // if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)"); niyanpai_flipscreen[vram] = (data & 0x40) ? 0 : 1; niyanpai_dispflag[vram] = (data & 0x80) ? 1 : 0; - niyanpai_vramflip(machine, vram); + niyanpai_vramflip(space->machine, vram); break; case 0x01: niyanpai_scrollx[vram] = (niyanpai_scrollx[vram] & 0x0100) | data; break; case 0x02: niyanpai_scrollx[vram] = (niyanpai_scrollx[vram] & 0x00ff) | ((data << 8) & 0x0100); break; @@ -128,7 +128,7 @@ static void niyanpai_blitter_w(running_machine *machine, int vram, int offset, i case 0x0b: blitter_destx[vram] = (blitter_destx[vram] & 0x00ff) | (data << 8); break; case 0x0c: blitter_desty[vram] = (blitter_desty[vram] & 0xff00) | data; break; case 0x0d: blitter_desty[vram] = (blitter_desty[vram] & 0x00ff) | (data << 8); - niyanpai_gfxdraw(machine, vram); + niyanpai_gfxdraw(space->machine, vram); break; default: break; }