diff --git a/src/emu/cpu/m6800/6800ops.c b/src/emu/cpu/m6800/6800ops.c index 18e7de53b1d..8bb40b3f07b 100644 --- a/src/emu/cpu/m6800/6800ops.c +++ b/src/emu/cpu/m6800/6800ops.c @@ -234,7 +234,7 @@ OP_HANDLER( bra ) UINT8 t; IMMBYTE(t); PC+=SIGNED(t); - CHANGE_PC(); + CHANGE_PC(m68_state); /* speed up busy loops */ if (t==0xfe) EAT_CYCLES; } @@ -402,7 +402,7 @@ OP_HANDLER( pulx ) OP_HANDLER( rts ) { PULLWORD(pPC); - CHANGE_PC(); + CHANGE_PC(m68_state); } /* $3a ABX inherent ----- */ @@ -419,7 +419,7 @@ OP_HANDLER( rti ) PULLBYTE(A); PULLWORD(pX); PULLWORD(pPC); - CHANGE_PC(); + CHANGE_PC(m68_state); CHECK_IRQ_LINES(m68_state); /* HJB 990417 */ } @@ -466,7 +466,7 @@ OP_HANDLER( swi ) PUSHBYTE(CC); SEI; PCD = RM16(0xfffa); - CHANGE_PC(); + CHANGE_PC(m68_state); } /* $40 NEGA inherent ?**** */ @@ -797,7 +797,7 @@ OP_HANDLER( tst_ix ) /* $6e JMP indexed ----- */ OP_HANDLER( jmp_ix ) { - INDEXED; PC=EA; CHANGE_PC(); + INDEXED; PC=EA; CHANGE_PC(m68_state); } /* $6f CLR indexed -0100 */ @@ -946,7 +946,7 @@ OP_HANDLER( tst_ex ) /* $7e JMP extended ----- */ OP_HANDLER( jmp_ex ) { - EXTENDED; PC=EA; CHANGE_PC(); /* TS 971002 */ + EXTENDED; PC=EA; CHANGE_PC(m68_state); /* TS 971002 */ } /* $7f CLR extended -0100 */ @@ -1091,7 +1091,7 @@ OP_HANDLER( bsr ) IMMBYTE(t); PUSHWORD(pPC); PC += SIGNED(t); - CHANGE_PC(); /* TS 971002 */ + CHANGE_PC(m68_state); /* TS 971002 */ } /* $8e LDS immediate -**0- */ @@ -1258,7 +1258,7 @@ OP_HANDLER( jsr_di ) DIRECT; PUSHWORD(pPC); PC = EA; - CHANGE_PC(); + CHANGE_PC(m68_state); } /* $9e LDS direct -**0- */ @@ -1433,7 +1433,7 @@ OP_HANDLER( jsr_ix ) INDEXED; PUSHWORD(pPC); PC = EA; - CHANGE_PC(); + CHANGE_PC(m68_state); } /* $ae LDS indexed -**0- */ @@ -1610,7 +1610,7 @@ OP_HANDLER( jsr_ex ) EXTENDED; PUSHWORD(pPC); PC = EA; - CHANGE_PC(); + CHANGE_PC(m68_state); } /* $be LDS extended -**0- */ diff --git a/src/emu/cpuintrf.h b/src/emu/cpuintrf.h index b65a9fd8ad1..833ad3cccca 100644 --- a/src/emu/cpuintrf.h +++ b/src/emu/cpuintrf.h @@ -774,7 +774,7 @@ INLINE int cpu_get_index(const device_config *cpu) the given CPU's address space -------------------------------------------------*/ -INLINE address_space *cpu_get_address_space(const device_config *cpu, int spacenum) +INLINE const address_space *cpu_get_address_space(const device_config *cpu, int spacenum) { cpu_class_header *classheader = cpu->classtoken; return classheader->space[spacenum]; diff --git a/src/mame/audio/toaplan2.c b/src/mame/audio/toaplan2.c index a64e4bb3b3f..45d34a564a9 100644 --- a/src/mame/audio/toaplan2.c +++ b/src/mame/audio/toaplan2.c @@ -71,77 +71,77 @@ static const UINT8 fixeight_cmd_snd[128] = /*78*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -static void play_oki_sound(running_machine *machine, int game_sound, int data) +static void play_oki_sound(const address_space *space, int game_sound, int data) { - int status = okim6295_status_0_r(machine,0); + int status = okim6295_status_0_r(space,0); logerror("Playing sample %02x from command %02x\n",game_sound,data); if (game_sound != 0) { if ((status & 0x01) == 0) { - okim6295_data_0_w(machine,0,(0x80 | game_sound)); - okim6295_data_0_w(machine,0,0x11); + okim6295_data_0_w(space,0,(0x80 | game_sound)); + okim6295_data_0_w(space,0,0x11); } else if ((status & 0x02) == 0) { - okim6295_data_0_w(machine,0,(0x80 | game_sound)); - okim6295_data_0_w(machine,0,0x21); + okim6295_data_0_w(space,0,(0x80 | game_sound)); + okim6295_data_0_w(space,0,0x21); } else if ((status & 0x04) == 0) { - okim6295_data_0_w(machine,0,(0x80 | game_sound)); - okim6295_data_0_w(machine,0,0x41); + okim6295_data_0_w(space,0,(0x80 | game_sound)); + okim6295_data_0_w(space,0,0x41); } else if ((status & 0x08) == 0) { - okim6295_data_0_w(machine,0,(0x80 | game_sound)); - okim6295_data_0_w(machine,0,0x81); + okim6295_data_0_w(space,0,(0x80 | game_sound)); + okim6295_data_0_w(space,0,0x81); } } } -void dogyuun_okisnd_w(running_machine *machine, int data) +void dogyuun_okisnd_w(const address_space *space, int data) { /* Need a board to determine the sound commands */ // popmessage("Writing %04x to Sound CPU",data); } -void kbash_okisnd_w(running_machine *machine, int data) +void kbash_okisnd_w(const address_space *space, int data) { // popmessage("Writing %04x to Sound CPU",data); if (data == 0) { - okim6295_data_0_w(machine,0,0x78); /* Stop playing effects */ + okim6295_data_0_w(space,0,0x78); /* Stop playing effects */ } else if ((data > 0) && (data < 128)) { - play_oki_sound(machine, kbash_cmd_snd[data], data); + play_oki_sound(space, kbash_cmd_snd[data], data); } } -void fixeight_okisnd_w(running_machine *machine, int data) +void fixeight_okisnd_w(const address_space *space, int data) { // popmessage("Writing %04x to Sound CPU",data); if (data == 0) { - okim6295_data_0_w(machine,0,0x78); /* Stop playing effects */ + okim6295_data_0_w(space,0,0x78); /* Stop playing effects */ } else if ((data > 0) && (data < 128)) { - play_oki_sound(machine, fixeight_cmd_snd[data], data); + play_oki_sound(space, fixeight_cmd_snd[data], data); } } -void batsugun_okisnd_w(running_machine *machine, int data) +void batsugun_okisnd_w(const address_space *space, int data) { // popmessage("Writing %04x to Sound CPU",data); if (data == 0) { - okim6295_data_0_w(machine,0,0x78); /* Stop playing effects */ + okim6295_data_0_w(space,0,0x78); /* Stop playing effects */ } else if ((data > 0) && (data < 64)) { - play_oki_sound(machine, batsugun_cmd_snd[data], data); + play_oki_sound(space, batsugun_cmd_snd[data], data); } } diff --git a/src/mame/drivers/toaplan2.c b/src/mame/drivers/toaplan2.c index 093d372423d..d33f97d8cc6 100644 --- a/src/mame/drivers/toaplan2.c +++ b/src/mame/drivers/toaplan2.c @@ -843,7 +843,7 @@ static WRITE16_HANDLER( dogyuun_snd_cpu_w ) if (ACCESSING_BITS_0_7) { mcu_data = data; - dogyuun_okisnd_w(space->machine, data); + dogyuun_okisnd_w(space, data); } logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port\n",cpu_get_previouspc(space->cpu),mcu_data); } @@ -862,7 +862,7 @@ static WRITE16_HANDLER( kbash_snd_cpu_w ) { if (ACCESSING_BITS_0_7) { - kbash_okisnd_w(space->machine, data); + kbash_okisnd_w(space, data); } logerror("PC:%06x Writing Sound command (%04x) to the NEC V25+ secondary CPU\n",cpu_get_previouspc(space->cpu),data); } @@ -899,7 +899,7 @@ static WRITE16_HANDLER( fixeight_sec_cpu_w ) if (mcu_data & 0xff00) { mcu_data = (mcu_data & 0xff00) | (data & 0xff); - fixeight_okisnd_w(space->machine, data); + fixeight_okisnd_w(space, data); } else if (mcu_data == 0xff00) { @@ -943,7 +943,7 @@ static WRITE16_HANDLER( batsugun_snd_cpu_w ) if (ACCESSING_BITS_0_7) { mcu_data = data; - batsugun_okisnd_w(space->machine, data); + batsugun_okisnd_w(space, data); } logerror("PC:%06x Writing command (%04x) to the NEC V25+ secondary CPU port %02x\n",cpu_get_previouspc(space->cpu),mcu_data,(offset*2)); } diff --git a/src/mame/includes/toaplan2.h b/src/mame/includes/toaplan2.h index 193842e6274..efb465742c1 100644 --- a/src/mame/includes/toaplan2.h +++ b/src/mame/includes/toaplan2.h @@ -1,9 +1,9 @@ /*----------- defined in audio/toaplan2.c -----------*/ -void dogyuun_okisnd_w(running_machine *machine, int data); -void kbash_okisnd_w(running_machine *machine, int data); -void fixeight_okisnd_w(running_machine *machine, int data); -void batsugun_okisnd_w(running_machine *machine, int data); +void dogyuun_okisnd_w(const address_space *space, int data); +void kbash_okisnd_w(const address_space *space, int data); +void fixeight_okisnd_w(const address_space *space, int data); +void batsugun_okisnd_w(const address_space *space, int data); /*----------- defined in drivers/toaplan2.c -----------*/ diff --git a/src/mame/video/toaplan1.c b/src/mame/video/toaplan1.c index 3f86c3a34cd..2173e80d3b8 100644 --- a/src/mame/video/toaplan1.c +++ b/src/mame/video/toaplan1.c @@ -318,12 +318,14 @@ static void toaplan1_set_scrolls(void) static STATE_POSTLOAD( rallybik_flipscreen ) { - rallybik_bcu_flipscreen_w(machine, 0, bcu_flipscreen, 0xffff); + const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + rallybik_bcu_flipscreen_w(space, 0, bcu_flipscreen, 0xffff); } static STATE_POSTLOAD( toaplan1_flipscreen ) { - toaplan1_bcu_flipscreen_w(machine, 0, bcu_flipscreen, 0xffff); + const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); + toaplan1_bcu_flipscreen_w(space, 0, bcu_flipscreen, 0xffff); } @@ -599,7 +601,7 @@ WRITE16_HANDLER( toaplan1_bcu_control_w ) if (toaplan1_unk_reset_port && toaplan1_reset) { toaplan1_reset = 0; - toaplan1_reset_sound(space->machine,0,0,0); + toaplan1_reset_sound(space,0,0,0); } } @@ -1229,18 +1231,21 @@ VIDEO_UPDATE( demonwld ) VIDEO_EOF( rallybik ) { - buffer_spriteram16_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); } VIDEO_EOF( toaplan1 ) { - buffer_spriteram16_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); memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); } VIDEO_EOF( samesame ) { - buffer_spriteram16_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); memcpy(toaplan1_buffered_spritesizeram16, toaplan1_spritesizeram16, TOAPLAN1_SPRITESIZERAM_SIZE); cpu_set_input_line(machine->cpu[0], MC68000_IRQ_2, HOLD_LINE); /* Frame done */ }