Fix a couple of compile warnings

This commit is contained in:
Couriersud 2008-11-15 11:21:20 +00:00
parent b2446584f6
commit 0182454e02
9 changed files with 45 additions and 41 deletions

View File

@ -305,7 +305,8 @@ static int m6295_bank;
static UINT16 m6295_key_delay; static UINT16 m6295_key_delay;
static INTERRUPT_GEN( kickgoal_interrupt ) 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) switch(kickgoal_melody_loop)
{ {
@ -334,8 +335,8 @@ static INTERRUPT_GEN( kickgoal_interrupt )
if (kickgoal_melody_loop) if (kickgoal_melody_loop)
{ {
// logerror("Changing to sample %02x\n",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(space,0,((0x80 | kickgoal_melody_loop) & 0xff));
okim6295_data_0_w(device->machine,0,0x81); okim6295_data_0_w(space,0,0x81);
} }
} }
if ( input_code_pressed_once(KEYCODE_PGUP) ) if ( input_code_pressed_once(KEYCODE_PGUP) )
@ -412,9 +413,9 @@ static INTERRUPT_GEN( kickgoal_interrupt )
{ {
if (m6295_key_delay >= (0x80 * oki_time_base)) if (m6295_key_delay >= (0x80 * oki_time_base))
{ {
okim6295_data_0_w(device->machine,0,0x78); okim6295_data_0_w(space,0,0x78);
okim6295_data_0_w(device->machine,0,(0x80 | m6295_comm)); okim6295_data_0_w(space,0,(0x80 | m6295_comm));
okim6295_data_0_w(device->machine,0,0x11); okim6295_data_0_w(space,0,0x11);
popmessage("Playing sound %02x on Bank %02x",m6295_comm,m6295_bank); popmessage("Playing sound %02x on Bank %02x",m6295_comm,m6295_bank);

View File

@ -635,15 +635,15 @@ static WRITE8_HANDLER( sound_bankswitch_w )
static WRITE16_HANDLER( wgp_sound_w ) static WRITE16_HANDLER( wgp_sound_w )
{ {
if (offset == 0) if (offset == 0)
taitosound_port_w (space->machine, 0, data & 0xff); taitosound_port_w (space, 0, data & 0xff);
else if (offset == 1) 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 ) static READ16_HANDLER( wgp_sound_r )
{ {
if (offset == 1) if (offset == 1)
return ((taitosound_comm_r (space->machine, 0) & 0xff)); return ((taitosound_comm_r (space, 0) & 0xff));
else return 0; else return 0;
} }

View File

@ -215,6 +215,7 @@ popmessage("gfxctrl = %02x",gfxctrl);
VIDEO_EOF( crshrace ) VIDEO_EOF( crshrace )
{ {
buffer_spriteram16_w(machine,0,0,0xffff); const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
buffer_spriteram16_2_w(machine,0,0,0xffff); buffer_spriteram16_w(space,0,0,0xffff);
buffer_spriteram16_2_w(space,0,0,0xffff);
} }

View File

@ -220,6 +220,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
VIDEO_UPDATE( dogfgt ) VIDEO_UPDATE( dogfgt )
{ {
const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
static int lastflip,lastpixcolor; static int lastflip,lastpixcolor;
int offs; int offs;
@ -230,7 +231,7 @@ VIDEO_UPDATE( dogfgt )
lastpixcolor = pixcolor; lastpixcolor = pixcolor;
for (offs = 0;offs < BITMAPRAM_SIZE;offs++) for (offs = 0;offs < BITMAPRAM_SIZE;offs++)
internal_bitmapram_w(screen->machine,offs,bitmapram[offs]); internal_bitmapram_w(space,offs,bitmapram[offs]);
} }

View File

@ -220,6 +220,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
VIDEO_UPDATE( groundfx ) VIDEO_UPDATE( groundfx )
{ {
const address_space *space = cpu_get_address_space(screen->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
UINT8 layer[5]; UINT8 layer[5];
UINT8 pivlayer[3]; UINT8 pivlayer[3];
UINT16 priority; UINT16 priority;
@ -261,12 +262,12 @@ VIDEO_UPDATE( groundfx )
it's contents the usual way. 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[1],0,2);
TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,4); TC0480SCP_tilemap_draw(bitmap,cliprect,layer[2],0,4);
TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,8); TC0480SCP_tilemap_draw(bitmap,cliprect,layer[3],0,8);
// TC0100SCN_tilemap_draw(machine,bitmap,cliprect,0,pivlayer[2],0,0); // 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); TC0480SCP_tilemap_draw(bitmap,&hack_cliprect,layer[0],0,0);
draw_sprites(screen->machine,bitmap,cliprect,1,44,-574); draw_sprites(screen->machine,bitmap,cliprect,1,44,-574);
} else { } else {

View File

@ -1358,7 +1358,7 @@ WRITE16_HANDLER( HD63484_data_w )
if (regno & 0x80) regno += 2; /* autoincrement */ 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]); logerror("PC %05x: HD63484 register %02x write %04x\n",cpu_get_pc(space->cpu),regno,HD63484_reg[regno/2]);
if (regno == 0) /* FIFO */ if (regno == 0) /* FIFO */
HD63484_command_w(space, HD63484_reg[0]); HD63484_command_w(space->machine, HD63484_reg[0]);
} }
READ16_HANDLER( HD63484_data_r ) READ16_HANDLER( HD63484_data_r )

View File

@ -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 i;
int DestParam; int DestParam;
@ -56,7 +56,7 @@ static void mrokumei_handleblit( running_machine *machine, int rom_base )
int DestAddr; int DestAddr;
int BaseAddr; int BaseAddr;
int opcode,data,NumTiles; int opcode,data,NumTiles;
UINT8 *pBlitData = memory_region(machine, "user1") + rom_base; UINT8 *pBlitData = memory_region(space->machine, "user1") + rom_base;
DestParam = DestParam =
blitter_param[(blitter_param_count-4)&3]*256+ blitter_param[(blitter_param_count-4)&3]*256+
@ -116,7 +116,7 @@ static void mrokumei_handleblit( running_machine *machine, int rom_base )
} /* i!=0 */ } /* i!=0 */
if (data) /* 00 is a nop */ 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 */ if (homedata_vreg[1] & 0x80) /* flip screen */
{ {
@ -132,17 +132,17 @@ static void mrokumei_handleblit( running_machine *machine, int rom_base )
} /* for(;;) */ } /* for(;;) */
finish: 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; int i;
UINT16 DestParam; UINT16 DestParam;
int flipx; int flipx;
int SourceAddr, BaseAddr; int SourceAddr, BaseAddr;
int DestAddr; int DestAddr;
UINT8 *pBlitData = memory_region(machine, "user1") + rom_base; UINT8 *pBlitData = memory_region(space->machine, "user1") + rom_base;
int opcode,data,NumTiles; int opcode,data,NumTiles;
@ -220,7 +220,7 @@ static void reikaids_handleblit( running_machine *machine, int rom_base )
addr ^= 0x007c; 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: 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 i;
int DestParam; int DestParam;
int SourceAddr; int SourceAddr;
int DestAddr, BaseAddr; int DestAddr, BaseAddr;
int opcode,data,NumTiles; int opcode,data,NumTiles;
UINT8 *pBlitData = memory_region(machine, "user1") + rom_base; UINT8 *pBlitData = memory_region(space->machine, "user1") + rom_base;
DestParam = DestParam =
blitter_param[(blitter_param_count-4)&3]*256+ 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) if ((addr & 0x2080) == 0)
{ {
addr = ((addr & 0xc000) >> 2) | ((addr & 0x1f00) >> 1) | (addr & 0x7f); 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(;;) */ } /* for(;;) */
finish: 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 ) 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 /* bit 0 = bank switch; used by hourouki to access the
optional service mode ROM (not available in current dump) */ 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 ) 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 ) 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));
} }

View File

@ -336,7 +336,7 @@ WRITE8_HANDLER( leland_mvram_port_w )
READ8_HANDLER( leland_mvram_port_r ) 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 ) 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 ) 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 ) WRITE8_HANDLER( ataxx_svram_port_w )
{ {
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); 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 ) READ8_HANDLER( ataxx_mvram_port_r )
{ {
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); 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 ) READ8_HANDLER( ataxx_svram_port_r )
{ {
offset = ((offset >> 1) & 0x07) | ((offset << 3) & 0x08) | (offset & 0x10); 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);
} }

View File

@ -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; int ret;
UINT8 *GFXROM = memory_region(machine, "gfx1"); UINT8 *GFXROM = memory_region(space->machine, "gfx1");
switch (offset) switch (offset)
{ {
@ -101,7 +101,7 @@ static int niyanpai_blitter_r(running_machine *machine, int vram, int offset)
return ret; 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) 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)"); // if (data & 0x20) popmessage("Unknown GFX Flag!! (0x20)");
niyanpai_flipscreen[vram] = (data & 0x40) ? 0 : 1; niyanpai_flipscreen[vram] = (data & 0x40) ? 0 : 1;
niyanpai_dispflag[vram] = (data & 0x80) ? 1 : 0; niyanpai_dispflag[vram] = (data & 0x80) ? 1 : 0;
niyanpai_vramflip(machine, vram); niyanpai_vramflip(space->machine, vram);
break; break;
case 0x01: niyanpai_scrollx[vram] = (niyanpai_scrollx[vram] & 0x0100) | data; 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; 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 0x0b: blitter_destx[vram] = (blitter_destx[vram] & 0x00ff) | (data << 8); break;
case 0x0c: blitter_desty[vram] = (blitter_desty[vram] & 0xff00) | data; break; case 0x0c: blitter_desty[vram] = (blitter_desty[vram] & 0xff00) | data; break;
case 0x0d: blitter_desty[vram] = (blitter_desty[vram] & 0x00ff) | (data << 8); case 0x0d: blitter_desty[vram] = (blitter_desty[vram] & 0x00ff) | (data << 8);
niyanpai_gfxdraw(machine, vram); niyanpai_gfxdraw(space->machine, vram);
break; break;
default: break; default: break;
} }