This update is the below two patches, plus the remaining changes

necessary to remove 12 of the final 14 references to the global
Machine. The remaining 2 are in fatalerror() and logerror(), which
are both local to mame.c, so Machine is now fully static.

--

From: Atari Ace [mailto:atari_ace@verizon.net] 
Sent: Thursday, December 18, 2008 5:47 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Make Machine static followup

Hi mamedev,

This incremental patch to my last patch undoes the change that caches
the ppu2c0x videorom.  I changed the code back to how it behaved
originally, using an existing machine on the chip struct to eliminate
the one troublesome Machine reference.

~aa

--

From: Atari Ace [mailto:atari_ace@verizon.net] 
Sent: Thursday, December 18, 2008 2:54 PM
To: submit@mamedev.org
Cc: atariace@hotmail.com
Subject: [patch] Make Machine static!

Hi mamedev,

This large patch completes the removal of the use of Machine
throughout MAME.  It does so primarily by adding machine, device or
space to various apis and modifying the callers, but for some
remaining cases it adds a new api, mame_get_running_machine(), which
will be called instead.  There are only 14 uses of this api currently,
and that number should drop over time.

There are a few changes of note:
1.  6821pia.c.  I attached machine to the 'device' structure.  I'm
working on converting this to a proper device, but that change isn't
ready.
2.  fddebug.c.  I added a proper header so that the apis won't get
accidentally converted to static again.
3.  scsi.c.  I added a machine to SCSIInstance.
4.  system16.c.  I modified sys16_patch_code to take an array of
patches.
4.  custom.h.  I added the owning sound device to the reset/stop
routines as well as the token.  Note that passing only the device
would require exposing the internals of custom_sound, as the token
passed is not the device token, but the token returned from the
CUSTOM_START routine.  Better ideas here are welcome.
4.  ppc2c0x.c.  To avoid changing more interfaces, the init routine
saves the videorom location rather than looks it up each time.

I tried to choose what I felt was the natural parameter for an api,
rather than always pass machine, but in some cases I used machine to
limit the number of additional changes.  Some additional cleanup here
is probably warranted, I'll look into that later once I'm recovered
from this two-week project.

~aa
This commit is contained in:
Aaron Giles 2008-12-19 19:40:22 +00:00
parent 42c9aeff39
commit f36fc8641e
480 changed files with 2796 additions and 2751 deletions

2
.gitattributes vendored
View File

@ -127,7 +127,7 @@ src/emu/cpu/hd6309/hd6309.c svneol=native#text/plain
src/emu/cpu/hd6309/hd6309.h svneol=native#text/plain
src/emu/cpu/i386/cycles.h svneol=native#text/plain
src/emu/cpu/i386/i386.c svneol=native#text/plain
src/emu/cpu/i386/i386.h svneol=native#text/plain
src/emu/cpu/i386/i386.h -text svneol=native#text/plain
src/emu/cpu/i386/i386dasm.c svneol=native#text/plain
src/emu/cpu/i386/i386op16.c svneol=native#text/plain
src/emu/cpu/i386/i386op32.c svneol=native#text/plain

View File

@ -181,7 +181,7 @@ struct _dsp32_state
int icount;
UINT8 lastpins;
UINT32 ppc;
void (*output_pins_changed)(UINT32 pins);
void (*output_pins_changed)(const device_config *device, UINT32 pins);
const device_config *device;
const address_space *program;
};
@ -283,7 +283,7 @@ static void update_pcr(dsp32_state *cpustate, UINT16 newval)
if (newoutput != cpustate->lastpins)
{
cpustate->lastpins = newoutput;
(*cpustate->output_pins_changed)(newoutput);
(*cpustate->output_pins_changed)(cpustate->device, newoutput);
}
}
}

View File

@ -70,7 +70,7 @@ enum
typedef struct _dsp32_config dsp32_config;
struct _dsp32_config
{
void (*output_pins_changed)(UINT32 pins); /* a change has occurred on an output pin */
void (*output_pins_changed)(const device_config *device, UINT32 pins); /* a change has occurred on an output pin */
};

View File

@ -1,22 +1,25 @@
#pragma once
#ifndef __I386INTF_H__
#define __I386INTF_H__
#define INPUT_LINE_A20 1
#include "cpuintrf.h"
CPU_GET_INFO( i386 );
CPU_GET_INFO( i486 );
CPU_GET_INFO( pentium );
CPU_GET_INFO( mediagx );
#define CPU_I386 CPU_GET_INFO_NAME( i386 )
#define CPU_I486 CPU_GET_INFO_NAME( i486 )
#define CPU_PENTIUM CPU_GET_INFO_NAME( pentium )
#define CPU_MEDIAGX CPU_GET_INFO_NAME( mediagx )
#endif /* __I386INTF_H__ */
#pragma once
#ifndef __I386INTF_H__
#define __I386INTF_H__
#define INPUT_LINE_A20 1
#include "cpuintrf.h"
// mingw has this defined for 32-bit compiles
#undef i386
CPU_GET_INFO( i386 );
CPU_GET_INFO( i486 );
CPU_GET_INFO( pentium );
CPU_GET_INFO( mediagx );
#define CPU_I386 CPU_GET_INFO_NAME( i386 )
#define CPU_I486 CPU_GET_INFO_NAME( i486 )
#define CPU_PENTIUM CPU_GET_INFO_NAME( pentium )
#define CPU_MEDIAGX CPU_GET_INFO_NAME( mediagx )
#endif /* __I386INTF_H__ */

View File

@ -134,7 +134,7 @@ enum
STRUCTURES AND TYPEDEFS
***************************************************************************/
typedef void (*ppc4xx_spu_tx_handler)(UINT8 data);
typedef void (*ppc4xx_spu_tx_handler)(const device_config *device, UINT8 data);
typedef struct _powerpc_config powerpc_config;
struct _powerpc_config

View File

@ -1656,7 +1656,7 @@ static TIMER_CALLBACK( ppc4xx_spu_callback )
{
/* if we have a transmit handler, send it that way */
if (ppc->spu.tx_handler != NULL)
(*ppc->spu.tx_handler)(ppc->spu.txbuf);
(*ppc->spu.tx_handler)(ppc->device, ppc->spu.txbuf);
/* indicate that we have moved it to the shift register */
ppc->spu.regs[SPU4XX_LINE_STATUS] |= 0x04;

View File

@ -987,7 +987,7 @@ static void upd7810_sio_output(upd7810_state *cpustate)
{
TXD = cpustate->txs & 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TXD,TXD);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TXD,TXD);
cpustate->txs >>= 1;
cpustate->txcnt--;
if (0 == cpustate->txcnt)
@ -1086,7 +1086,7 @@ static void upd7810_sio_input(upd7810_state *cpustate)
if (cpustate->rxcnt > 0)
{
if (cpustate->config.io_callback)
RXD = (*cpustate->config.io_callback)(UPD7810_RXD,RXD);
RXD = (*cpustate->config.io_callback)(cpustate->device,UPD7810_RXD,RXD);
cpustate->rxs = (cpustate->rxs >> 1) | ((UINT16)RXD << 15);
cpustate->rxcnt--;
if (0 == cpustate->rxcnt)
@ -1288,7 +1288,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
/* timer 1 chained with timer 0 ? */
if ((TMM & 0xe0) == 0x60)
@ -1303,7 +1303,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@ -1325,7 +1325,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
/* timer 1 chained with timer 0 ? */
if ((TMM & 0xe0) == 0x60)
@ -1340,7 +1340,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@ -1376,7 +1376,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@ -1396,7 +1396,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
}
}
@ -1417,7 +1417,7 @@ static void upd7810_timers(upd7810_state *cpustate, int cycles)
{
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
OVCF -= 3;
}
}
@ -1609,7 +1609,7 @@ static void upd78c05_timers(upd7810_state *cpustate, int cycles)
if (0x00 == (TMM & 0x03)) {
TO ^= 1;
if (cpustate->config.io_callback)
(*cpustate->config.io_callback)(UPD7810_TO,TO);
(*cpustate->config.io_callback)(cpustate->device,UPD7810_TO,TO);
}
while ( cpustate->ovc0 <= 0 ) {

View File

@ -31,7 +31,7 @@ typedef enum
* It will be called whenever an output signal changes or a new
* input line state is to be sampled.
*/
typedef int (*upd7810_io_callback)(int ioline, int state);
typedef int (*upd7810_io_callback)(const device_config *device, int ioline, int state);
// use it as reset parameter in the Machine struct
typedef struct {

View File

@ -10,7 +10,6 @@
***************************************************************************/
#include "driver.h"
#include "deprecat.h"
/* mingw-gcc defines this */
#undef i386

View File

@ -21,10 +21,6 @@
#include <stddef.h>
// mingw has this defined for 32-bit compiles
#undef i386
/***************************************************************************
CONSTANTS
***************************************************************************/

View File

@ -3083,8 +3083,8 @@ static void memory_view_write(debug_view_memory *memdata, UINT8 size, offs_t off
#ifdef FD1094_HACK
if (memdata->desc->base == memory_region(view->machine, "user2"))
{
extern void fd1094_regenerate_key(void);
fd1094_regenerate_key();
extern void fd1094_regenerate_key(running_machine *machine);
fd1094_regenerate_key(view->machine);
}
#endif
}

View File

@ -21,11 +21,33 @@
/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
typedef struct _machine_entry machine_entry;
struct _machine_entry
{
machine_entry * next;
running_machine * machine;
};
/***************************************************************************
GLOBAL VARIABLES
***************************************************************************/
static machine_entry *machine_list;
static int atexit_registered;
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
static void debugger_flush_traces(void);
static void debugger_exit(running_machine *machine);
@ -42,12 +64,28 @@ void debugger_init(running_machine *machine)
/* only if debugging is enabled */
if (machine->debug_flags & DEBUG_FLAG_ENABLED)
{
machine_entry *entry;
/* initialize the submodules */
debug_cpu_init(machine);
debug_command_init(machine);
debug_console_init(machine);
debug_view_init(machine);
debug_comment_init(machine);
atexit(debugger_flush_traces);
/* allocate a new entry for our global list */
add_exit_callback(machine, debugger_exit);
entry = malloc_or_die(sizeof(*entry));
entry->next = machine_list;
entry->machine = machine;
machine_list = entry;
/* register an atexit handler if we haven't yet */
if (!atexit_registered)
atexit(debugger_flush_all_traces_on_abnormal_exit);
atexit_registered = TRUE;
/* listen in on the errorlog */
add_logerror_callback(machine, debug_errorlog_write_line);
}
}
@ -65,13 +103,40 @@ void debugger_refresh_display(running_machine *machine)
/*-------------------------------------------------
debugger_flush_traces - flush any traces in
the event of an aborted execution
debugger_exit - remove ourself from the
global list of active machines for cleanup
-------------------------------------------------*/
static void debugger_flush_traces(void)
static void debugger_exit(running_machine *machine)
{
extern running_machine *Machine;
if (Machine != NULL)
debug_cpu_flush_traces(Machine);
machine_entry **entryptr;
/* remove this machine from the list; it came down cleanly */
for (entryptr = &machine_list; *entryptr != NULL; entryptr = &(*entryptr)->next)
if ((*entryptr)->machine == machine)
{
machine_entry *deleteme = *entryptr;
*entryptr = deleteme->next;
free(deleteme);
break;
}
}
/*-------------------------------------------------
debugger_flush_all_traces_on_abnormal_exit -
flush any traces in the event of an aborted
execution
-------------------------------------------------*/
void debugger_flush_all_traces_on_abnormal_exit(void)
{
/* clear out the machine list and flush traces on each one */
while (machine_list != NULL)
{
machine_entry *deleteme = machine_list;
debug_cpu_flush_traces(deleteme->machine);
machine_list = deleteme->next;
free(deleteme);
}
}

View File

@ -30,6 +30,9 @@ void debugger_init(running_machine *machine);
/* redraw the current video display */
void debugger_refresh_display(running_machine *machine);
/* OSD can call this to safely flush all traces in the event of a crash */
void debugger_flush_all_traces_on_abnormal_exit(void);
/***************************************************************************

View File

@ -19,21 +19,6 @@
#include "devintrf.h"
/*************************************
*
* Global access to the currently
* executing machine.
*
* Please investigate if it is
* possible to use a passed in
* 'machine' argument.
*
*************************************/
extern running_machine *Machine;
/*************************************
*
* Old way of allowing "VBLANK"

View File

@ -49,9 +49,9 @@ typedef void (*opcode_handler)(running_machine *machine);
#define OPCODE_HANDLER(name) void name(running_machine *machine)
static opcode_handler dma_opcode[256];
INLINE UINT32 FETCH(void)
INLINE UINT32 FETCH(running_machine *machine)
{
UINT32 r = intf->fetch(lsi810.dsp);
UINT32 r = intf->fetch(machine, lsi810.dsp);
lsi810.dsp += 4;
return r;
}
@ -74,13 +74,13 @@ static OPCODE_HANDLER( dmaop_invalid )
static OPCODE_HANDLER( dmaop_move_memory )
{
UINT32 src = FETCH();
UINT32 dst = FETCH();
UINT32 src = FETCH(machine);
UINT32 dst = FETCH(machine);
int count;
count = lsi810.dcmd & 0xffffff;
if(intf->dma_callback != NULL) {
intf->dma_callback(src, dst, count, 1);
intf->dma_callback(machine, src, dst, count, 1);
}
}
@ -89,7 +89,7 @@ static OPCODE_HANDLER( dmaop_interrupt )
if(lsi810.dcmd & 0x100000) {
fatalerror("LSI53C810: INTFLY opcode not implemented");
}
lsi810.dsps = FETCH();
lsi810.dsps = FETCH(machine);
lsi810.istat |= 0x1; /* DMA interrupt pending */
lsi810.dstat |= 0x4; /* SIR (SCRIPTS Interrupt Instruction Received) */
@ -107,12 +107,12 @@ static OPCODE_HANDLER( dmaop_block_move )
UINT32 count;
INT32 dsps;
address = FETCH();
address = FETCH(machine);
count = lsi810.dcmd & 0x00ffffff;
// normal indirect
if (lsi810.dcmd & 0x20000000)
address = intf->fetch(address);
address = intf->fetch(machine, address);
// table indirect
if (lsi810.dcmd & 0x10000000)
@ -149,7 +149,7 @@ static OPCODE_HANDLER( dmaop_select )
{
UINT32 operand;
operand = FETCH();
operand = FETCH(machine);
if (lsi810.scntl0 & 0x01)
{
@ -174,7 +174,7 @@ static OPCODE_HANDLER( dmaop_wait_disconnect )
{
UINT32 operand;
operand = FETCH();
operand = FETCH(machine);
if (lsi810.scntl0 & 0x01)
{
@ -192,7 +192,7 @@ static OPCODE_HANDLER( dmaop_wait_reselect )
{
UINT32 operand;
operand = FETCH();
operand = FETCH(machine);
if (lsi810.scntl0 & 0x01)
{
@ -210,7 +210,7 @@ static OPCODE_HANDLER( dmaop_set )
{
UINT32 operand;
operand = FETCH();
operand = FETCH(machine);
/* initiator mode */
if (lsi810.dcmd & 0x8)
@ -239,7 +239,7 @@ static OPCODE_HANDLER( dmaop_clear )
{
UINT32 operand;
operand = FETCH();
operand = FETCH(machine);
/* initiator mode */
if (lsi810.dcmd & 0x8)
@ -339,12 +339,12 @@ static int scripts_compute_branch(void)
return passed;
}
static UINT32 scripts_get_jump_dest(void)
static UINT32 scripts_get_jump_dest(running_machine *machine)
{
INT32 dsps;
UINT32 dest;
dsps = FETCH();
dsps = FETCH(machine);
/* relative or absolute addressing? */
if (lsi810.dcmd & 0x00800000)
@ -357,7 +357,7 @@ static UINT32 scripts_get_jump_dest(void)
logerror("dsps = %x, dsp = %x\n", dsps, lsi810.dsp);
dsps += lsi810.dsp;
}
}
dest = (UINT32)dsps;
@ -370,11 +370,11 @@ static OPCODE_HANDLER( dmaop_jump )
{
if (scripts_compute_branch())
{
lsi810.dsp = scripts_get_jump_dest();
lsi810.dsp = scripts_get_jump_dest(machine);
}
else
{
FETCH(); // skip operand to continue on
FETCH(machine); // skip operand to continue on
}
}
@ -386,11 +386,11 @@ static OPCODE_HANDLER( dmaop_call )
lsi810.temp = lsi810.dsp;
// and go
lsi810.dsp = scripts_get_jump_dest();
lsi810.dsp = scripts_get_jump_dest(machine);
}
else
{
FETCH(); // skip operand to continue on
FETCH(machine); // skip operand to continue on
}
}
@ -404,7 +404,7 @@ static OPCODE_HANDLER( dmaop_return )
}
else
{
FETCH(); // skip operand to continue on
FETCH(machine); // skip operand to continue on
}
}
@ -431,11 +431,11 @@ static void dma_exec(running_machine *machine)
if (DASM_OPCODES)
{
char buf[256];
lsi53c810_dasm(buf, lsi810.dsp);
lsi53c810_dasm(machine, buf, lsi810.dsp);
logerror("0x%08X: %s\n", lsi810.dsp, buf);
}
lsi810.dcmd = FETCH();
lsi810.dcmd = FETCH(machine);
op = (lsi810.dcmd >> 24) & 0xff;
dma_opcode[op](machine);
@ -614,7 +614,7 @@ WRITE8_HANDLER( lsi53c810_reg_w )
if(lsi810.dcntl & 0x14 && !lsi810.halted) /* single-step & start DMA */
{
int op;
lsi810.dcmd = FETCH();
lsi810.dcmd = FETCH(space->machine);
op = (lsi810.dcmd >> 24) & 0xff;
dma_opcode[op](space->machine);
@ -666,7 +666,7 @@ static void add_opcode(UINT8 op, UINT8 mask, opcode_handler handler)
}
}
void lsi53c810_init(const struct LSI53C810interface *interface)
void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface)
{
int i;
@ -701,7 +701,7 @@ void lsi53c810_init(const struct LSI53C810interface *interface)
// try to open the devices
for (i = 0; i < interface->scsidevs->devs_present; i++)
{
SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
}
}
@ -760,16 +760,16 @@ void *lsi53c810_get_device(int id)
*
*************************************/
static UINT32 lsi53c810_dasm_fetch(UINT32 pc)
static UINT32 lsi53c810_dasm_fetch(running_machine *machine, UINT32 pc)
{
return intf->fetch(pc);
return intf->fetch(machine, pc);
}
unsigned lsi53c810_dasm(char *buf, UINT32 pc)
unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc)
{
unsigned result = 0;
const char *op_mnemonic = NULL;
UINT32 op = lsi53c810_dasm_fetch(pc);
UINT32 op = lsi53c810_dasm_fetch(machine, pc);
UINT32 dest;
int i;
@ -782,7 +782,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
if ((op & 0xF8000000) == 0x40000000)
{
/* SELECT */
dest = lsi53c810_dasm_fetch(pc + 4);
dest = lsi53c810_dasm_fetch(machine, pc + 4);
buf += sprintf(buf, "SELECT%s %d, 0x%08X",
(op & 0x01000000) ? " ATN" : "",
@ -841,7 +841,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
case 0x98000000: op_mnemonic = "INT"; break;
}
dest = lsi53c810_dasm_fetch(pc + 4);
dest = lsi53c810_dasm_fetch(machine, pc + 4);
if (op & 0x00800000)
{
@ -887,7 +887,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
else if ((op & 0xE0000000) == 0x00000000)
{
/* MOVE FROM */
dest = lsi53c810_dasm_fetch(pc + 4);
dest = lsi53c810_dasm_fetch(machine, pc + 4);
buf += sprintf(buf, "MOVE FROM 0x%08X, WHEN %s",
dest, phases[(op >> 24) & 0x07]);
@ -897,7 +897,7 @@ unsigned lsi53c810_dasm(char *buf, UINT32 pc)
else if ((op & 0xE0000000) == 0x20000000)
{
/* MOVE PTR */
dest = lsi53c810_dasm_fetch(pc + 4);
dest = lsi53c810_dasm_fetch(machine, pc + 4);
buf += sprintf(buf, "MOVE 0x%08X, PTR 0x%08X, WHEN %s",
(op & 0x00FFFFFF), dest, phases[(op >> 24) & 0x07]);

View File

@ -7,11 +7,11 @@ struct LSI53C810interface
{
const SCSIConfigTable *scsidevs; /* SCSI devices */
void (*irq_callback)(running_machine *machine, int); /* IRQ callback */
void (*dma_callback)(UINT32, UINT32, int, int); /* DMA callback */
UINT32 (*fetch)(UINT32 dsp);
void (*dma_callback)(running_machine *machine, UINT32, UINT32, int, int); /* DMA callback */
UINT32 (*fetch)(running_machine *machine, UINT32 dsp);
};
extern void lsi53c810_init(const struct LSI53C810interface *interface);
extern void lsi53c810_init(running_machine *machine, const struct LSI53C810interface *interface);
extern void lsi53c810_exit(const struct LSI53C810interface *interface);
extern void lsi53c810_read_data(int bytes, UINT8 *pData);
@ -22,6 +22,6 @@ extern void *lsi53c810_get_device(int id);
READ8_HANDLER( lsi53c810_reg_r );
WRITE8_HANDLER( lsi53c810_reg_w );
unsigned lsi53c810_dasm(char *buf, UINT32 pc);
unsigned lsi53c810_dasm(running_machine *machine, char *buf, UINT32 pc);
#endif

View File

@ -5,7 +5,6 @@
**********************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "6821pia.h"
@ -24,6 +23,7 @@
typedef struct _pia6821 pia6821;
struct _pia6821
{
running_machine *machine;
const pia6821_interface *intf;
UINT8 in_a;
@ -125,6 +125,7 @@ void pia_config(running_machine *machine, int which, const pia6821_interface *in
p = &pias[which];
memset(p, 0, sizeof(pias[0]));
p->machine = machine;
p->intf = intf;
state_save_register_item(machine, "6821pia", NULL, which, p->in_a);
@ -176,12 +177,14 @@ void pia_reset(void)
/* zap each structure, preserving the interface and swizzle */
for (i = 0; i < MAX_PIA; i++)
{
running_machine *machine = pias[i].machine;
const pia6821_interface *intf = pias[i].intf;
if (intf == NULL) continue;
memset(&pias[i], 0, sizeof(pias[i]));
pias[i].machine = machine;
pias[i].intf = intf;
/*
@ -195,8 +198,8 @@ void pia_reset(void)
pias[i].in_ca2 = TRUE;
/* clear the IRQs */
if (intf->irq_a_func) (*intf->irq_a_func)(Machine, FALSE);
if (intf->irq_b_func) (*intf->irq_b_func)(Machine, FALSE);
if (intf->irq_a_func) (*intf->irq_a_func)(machine, FALSE);
if (intf->irq_b_func) (*intf->irq_b_func)(machine, FALSE);
}
}
@ -586,24 +589,24 @@ UINT8 pia_read(int which, offs_t offset)
default: /* impossible */
case 0x00:
if (OUTPUT_SELECTED(p->ctl_a))
ret = port_a_r(Machine, which);
ret = port_a_r(p->machine, which);
else
ret = ddr_a_r(Machine, which);
ret = ddr_a_r(p->machine, which);
break;
case 0x01:
ret = control_a_r(Machine, which);
ret = control_a_r(p->machine, which);
break;
case 0x02:
if (OUTPUT_SELECTED(p->ctl_b))
ret = port_b_r(Machine, which);
ret = port_b_r(p->machine, which);
else
ret = ddr_b_r(Machine, which);
ret = ddr_b_r(p->machine, which);
break;
case 0x03:
ret = control_b_r(Machine, which);
ret = control_b_r(p->machine, which);
break;
}
@ -821,24 +824,24 @@ void pia_write(int which, offs_t offset, UINT8 data)
default: /* impossible */
case 0x00:
if (OUTPUT_SELECTED(p->ctl_a))
port_a_w(Machine, which, data);
port_a_w(p->machine, which, data);
else
ddr_a_w(Machine, which, data);
ddr_a_w(p->machine, which, data);
break;
case 0x01:
control_a_w(Machine, which, data);
control_a_w(p->machine, which, data);
break;
case 0x02:
if (OUTPUT_SELECTED(p->ctl_b))
port_b_w(Machine, which, data);
port_b_w(p->machine, which, data);
else
ddr_b_w(Machine, which, data);
ddr_b_w(p->machine, which, data);
break;
case 0x03:
control_b_w(Machine, which, data);
control_b_w(p->machine, which, data);
break;
}
}
@ -893,7 +896,7 @@ UINT8 pia_get_output_a(int which)
p->out_a_needs_pulled = FALSE;
return get_out_a_value(Machine, which);
return get_out_a_value(p->machine, which);
}
@ -931,11 +934,11 @@ void pia_set_input_ca1(int which, int data)
p->irq_a1 = TRUE;
/* update externals */
update_interrupts(Machine, p);
update_interrupts(p->machine, p);
/* CA2 is configured as output and in read strobe mode and cleared by a CA1 transition */
if (C2_OUTPUT(p->ctl_a) && C2_STROBE_MODE(p->ctl_a) && STROBE_C1_RESET(p->ctl_a))
set_out_ca2(Machine, which, TRUE);
set_out_ca2(p->machine, which, TRUE);
}
/* set the new value for CA1 */
@ -979,7 +982,7 @@ void pia_set_input_ca2(int which, int data)
p->irq_a2 = TRUE;
/* update externals */
update_interrupts(Machine, p);
update_interrupts(p->machine, p);
}
/* set the new value for CA2 */
@ -1084,7 +1087,7 @@ void pia_set_input_cb1(int which, int data)
p->irq_b1 = 1;
/* update externals */
update_interrupts(Machine, p);
update_interrupts(p->machine, p);
/* If CB2 is configured as a write-strobe output which is reset by a CB1
transition, this reset will only happen when a read from port B implicitly
@ -1133,7 +1136,7 @@ void pia_set_input_cb2(int which, int data)
p->irq_b2 = 1;
/* update externals */
update_interrupts(Machine, p);
update_interrupts(p->machine, p);
}
/* set the new value for CA2 */

View File

@ -47,7 +47,7 @@
struct TTL74148
{
/* callback */
void (*output_cb)(void);
void (*output_cb)(running_machine *machine);
/* inputs */
int input_lines[8]; /* pins 1-4,10-13 */
@ -67,7 +67,7 @@ struct TTL74148
static struct TTL74148 chips[MAX_TTL74148];
void TTL74148_update(int which)
void TTL74148_update(running_machine *machine, int which)
{
if (chips[which].enable_input)
{
@ -131,7 +131,7 @@ void TTL74148_update(int which)
chips[which].last_output_valid = chips[which].output_valid;
chips[which].last_enable_output = chips[which].enable_output;
chips[which].output_cb();
chips[which].output_cb(machine);
}
}

View File

@ -45,14 +45,14 @@
/* The interface structure */
struct TTL74148_interface
{
void (*output_cb)(void);
void (*output_cb)(running_machine *machine);
};
void TTL74148_config(int which, const struct TTL74148_interface *intf);
/* must call TTL74148_update() after setting the inputs */
void TTL74148_update(int which);
void TTL74148_update(running_machine *machine, int which);
void TTL74148_input_line_w(int which, int input_line, int data);
void TTL74148_enable_input_w(int which, int data);

View File

@ -46,7 +46,7 @@
struct TTL7474
{
/* callback */
void (*output_cb)(void);
void (*output_cb)(running_machine *);
/* inputs */
UINT8 clear; /* pin 1/13 */
@ -67,7 +67,7 @@ struct TTL7474
static struct TTL7474 chips[MAX_TTL7474];
void TTL7474_update(int which)
void TTL7474_update(running_machine *machine, int which)
{
if (!chips[which].preset && chips[which].clear) /* line 1 in truth table */
{
@ -101,7 +101,7 @@ void TTL7474_update(int which)
chips[which].last_output = chips[which].output;
chips[which].last_output_comp = chips[which].output_comp;
chips[which].output_cb();
chips[which].output_cb(machine);
}
}

View File

@ -44,14 +44,14 @@
/* The interface structure */
struct TTL7474_interface
{
void (*output_cb)(void);
void (*output_cb)(running_machine *machine);
};
void TTL7474_config(running_machine *machine, int which, const struct TTL7474_interface *intf);
/* must call TTL7474_update() after setting the inputs */
void TTL7474_update(int which);
void TTL7474_update(running_machine *machine, int which);
void TTL7474_clear_w(int which, int data);
void TTL7474_preset_w(int which, int data);

View File

@ -204,8 +204,8 @@
static struct
{
kbdc8042_type_t type;
void (*set_gate_a20)(int a20);
void (*keyboard_interrupt)(int state);
void (*set_gate_a20)(running_machine *machine, int a20);
void (*keyboard_interrupt)(running_machine *machine, int state);
int (*get_out2)(running_machine *machine);
UINT8 inport, outport, data, command;
@ -234,7 +234,7 @@ static struct
static int poll_delay;
static void at_8042_check_keyboard(void);
static void at_8042_check_keyboard(running_machine *machine);
@ -244,7 +244,7 @@ static void at_8042_check_keyboard(void);
***************************************************************************/
static void at_8042_set_outport(UINT8 data, int initial)
static void at_8042_set_outport(running_machine *machine, UINT8 data, int initial)
{
UINT8 change;
change = initial ? 0xFF : (kbdc8042.outport ^ data);
@ -252,7 +252,7 @@ static void at_8042_set_outport(UINT8 data, int initial)
if (change & 0x02)
{
if (kbdc8042.set_gate_a20)
kbdc8042.set_gate_a20(data & 0x02 ? 1 : 0);
kbdc8042.set_gate_a20(machine, data & 0x02 ? 1 : 0);
}
}
@ -261,7 +261,7 @@ static void at_8042_set_outport(UINT8 data, int initial)
static TIMER_CALLBACK( kbdc8042_time )
{
at_keyboard_polling();
at_8042_check_keyboard();
at_8042_check_keyboard(machine);
}
@ -277,12 +277,12 @@ void kbdc8042_init(running_machine *machine, const struct kbdc8042_interface *in
/* ibmat bios wants 0x20 set! (keyboard locked when not set) 0x80 */
kbdc8042.inport = 0xa0;
at_8042_set_outport(0xfe, 1);
at_8042_set_outport(machine, 0xfe, 1);
timer_pulse(machine, ATTOTIME_IN_HZ(60), NULL, 0, kbdc8042_time);
}
static void at_8042_receive(UINT8 data)
static void at_8042_receive(running_machine *machine, UINT8 data)
{
if (LOG_KEYBOARD)
logerror("at_8042_receive Received 0x%02x\n", data);
@ -292,12 +292,12 @@ static void at_8042_receive(UINT8 data)
if (kbdc8042.keyboard_interrupt)
{
kbdc8042.keyboard_interrupt(1);
kbdc8042.keyboard_interrupt(0);
kbdc8042.keyboard_interrupt(machine, 1);
kbdc8042.keyboard_interrupt(machine, 0);
}
}
static void at_8042_check_keyboard(void)
static void at_8042_check_keyboard(running_machine *machine)
{
int data;
@ -305,7 +305,7 @@ static void at_8042_check_keyboard(void)
&& !kbdc8042.mouse.received)
{
if ( (data = at_keyboard_read())!=-1)
at_8042_receive(data);
at_8042_receive(machine, data);
}
}
@ -360,7 +360,7 @@ READ8_HANDLER(kbdc8042_8_r)
/* at386 self test doesn't like this */
at_8042_clear_keyboard_received();
}
at_8042_check_keyboard();
at_8042_check_keyboard(space->machine);
break;
case 1:
@ -395,7 +395,7 @@ READ8_HANDLER(kbdc8042_8_r)
break;
case 4:
at_8042_check_keyboard();
at_8042_check_keyboard(space->machine);
if (kbdc8042.keyboard.received || kbdc8042.mouse.received)
data |= 1;
@ -455,7 +455,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- keyboard clock (output)
* `------------ keyboard data (output)
*/
at_8042_set_outport(data, 0);
at_8042_set_outport(space->machine, data, 0);
break;
case 2:
@ -506,13 +506,13 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.mouse.on = 1;
break;
case 0xa9: /* test mouse */
at_8042_receive(PS2_MOUSE_ON ? 0x00 : 0xff);
at_8042_receive(space->machine, PS2_MOUSE_ON ? 0x00 : 0xff);
break;
case 0xaa: /* selftest */
at_8042_receive(0x55);
at_8042_receive(space->machine, 0x55);
break;
case 0xab: /* test keyboard */
at_8042_receive(KEYBOARD_ON ? 0x00 : 0xff);
at_8042_receive(space->machine, KEYBOARD_ON ? 0x00 : 0xff);
break;
case 0xad: /* disable keyboard interface */
kbdc8042.keyboard.on = 0;
@ -530,7 +530,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* | `----------- 1=primary display is MDA, 0=CGA
* `------------ 1=keyboard not inhibited; 0=inhibited
*/
at_8042_receive(kbdc8042.inport);
at_8042_receive(space->machine, kbdc8042.inport);
break;
case 0xc1: /* read input port 3..0 until write to 0x60 */
kbdc8042.status_read_mode = 1;
@ -539,7 +539,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
kbdc8042.status_read_mode = 2;
break;
case 0xd0: /* read output port */
at_8042_receive(kbdc8042.outport);
at_8042_receive(space->machine, kbdc8042.outport);
break;
case 0xd1:
/* write output port; next byte written to port 60h is placed on
@ -568,7 +568,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
break;
case 0xe0:
/* read test inputs; read T1/T0 test inputs into bit 1/0 */
at_8042_receive(0x00);
at_8042_receive(space->machine, 0x00);
break;
case 0xf0:
@ -585,7 +585,7 @@ WRITE8_HANDLER(kbdc8042_8_w)
* an effect currently is bit 0, which pulses the CPU's reset line
*/
cpu_set_input_line(space->machine->cpu[0], INPUT_LINE_RESET, PULSE_LINE);
at_8042_set_outport(kbdc8042.outport | 0x02, 0);
at_8042_set_outport(space->machine, kbdc8042.outport | 0x02, 0);
break;
}
kbdc8042.sending = 1;

View File

@ -21,8 +21,8 @@ typedef enum
struct kbdc8042_interface
{
kbdc8042_type_t type;
void (*set_gate_a20)(int a20);
void (*keyboard_interrupt)(int state);
void (*set_gate_a20)(running_machine *machine, int a20);
void (*keyboard_interrupt)(running_machine *machine, int state);
int (*get_out2)(running_machine *machine);
};

View File

@ -27,7 +27,7 @@ typedef struct
int output_shift_reg;
int end_conv;
double (*input_callback)(int input);
double (*input_callback)(running_machine *machine, int input);
} ADC1213X;
static ADC1213X adc1213x[MAX_ADC1213X_CHIPS];
@ -53,7 +53,7 @@ void adc1213x_di_w(int chip, int state)
adc1213x[chip].data_in = state & 1;
}
static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst)
static void adc1213x_convert(running_machine *machine, int chip, int channel, int bits16, int lsbfirst)
{
int i;
int bits;
@ -70,42 +70,42 @@ static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst)
{
case 0x8: // H L L L - CH0 (single-ended)
{
input = adc1213x[chip].input_callback(0);
input = adc1213x[chip].input_callback(machine, 0);
break;
}
case 0xc: // H H L L - CH1 (single-ended)
{
input = adc1213x[chip].input_callback(1);
input = adc1213x[chip].input_callback(machine, 1);
break;
}
case 0x9: // H L L H - CH2 (single-ended)
{
input = adc1213x[chip].input_callback(2);
input = adc1213x[chip].input_callback(machine, 2);
break;
}
case 0xd: // H H L H - CH3 (single-ended)
{
input = adc1213x[chip].input_callback(3);
input = adc1213x[chip].input_callback(machine, 3);
break;
}
case 0xa: // H L H L - CH4 (single-ended)
{
input = adc1213x[chip].input_callback(4);
input = adc1213x[chip].input_callback(machine, 4);
break;
}
case 0xe: // H H H L - CH5 (single-ended)
{
input = adc1213x[chip].input_callback(5);
input = adc1213x[chip].input_callback(machine, 5);
break;
}
case 0xb: // H L H H - CH6 (single-ended)
{
input = adc1213x[chip].input_callback(6);
input = adc1213x[chip].input_callback(machine, 6);
break;
}
case 0xf: // H H H H - CH7 (single-ended)
{
input = adc1213x[chip].input_callback(7);
input = adc1213x[chip].input_callback(machine, 7);
break;
}
default:
@ -139,7 +139,7 @@ static void adc1213x_convert(int chip, int channel, int bits16, int lsbfirst)
adc1213x[chip].output_shift_reg >>= 1;
}
void adc1213x_cs_w(int chip, int state)
void adc1213x_cs_w(running_machine *machine, int chip, int state)
{
if (state)
{
@ -153,22 +153,22 @@ void adc1213x_cs_w(int chip, int state)
{
case 0x0: // X X X X L L L L - 12 or 13 Bit MSB First conversion
{
adc1213x_convert(chip, (mode >> 4) & 0xf, 0, 0);
adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 0, 0);
break;
}
case 0x1: // X X X X L L L H - 16 or 17 Bit MSB First conversion
{
adc1213x_convert(chip, (mode >> 4) & 0xf, 1, 0);
adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 1, 0);
break;
}
case 0x4: // X X X X L H L L - 12 or 13 Bit LSB First conversion
{
adc1213x_convert(chip, (mode >> 4) & 0xf, 0, 1);
adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 0, 1);
break;
}
case 0x5: // X X X X L H L H - 16 or 17 Bit LSB First conversion
{
adc1213x_convert(chip, (mode >> 4) & 0xf, 1, 1);
adc1213x_convert(machine, chip, (mode >> 4) & 0xf, 1, 1);
break;
}
@ -237,7 +237,7 @@ int adc1213x_eoc_r(int chip)
return adc1213x[chip].end_conv;
}
void adc1213x_init(int chip, double (*input_callback)( int input ))
void adc1213x_init(int chip, double (*input_callback)( running_machine *machine, int input ))
{
memset(&adc1213x[chip], 0, sizeof(ADC1213X));

View File

@ -9,10 +9,10 @@
int adc1213x_do_r(int chip);
void adc1213x_di_w(int chip, int state);
void adc1213x_cs_w(int chip, int state);
void adc1213x_cs_w(running_machine *machine, int chip, int state);
void adc1213x_sclk_w(int chip, int state);
void adc1213x_conv_w(int chip, int state);
int adc1213x_eoc_r(int chip);
void adc1213x_init(int chip, double (*input_callback)( int input ));
void adc1213x_init(int chip, double (*input_callback)( running_machine *machine, int input ));
#endif

View File

@ -221,7 +221,7 @@ void am53cf96_init( running_machine *machine, const struct AM53CF96interface *in
// try to open the devices
for (i = 0; i < interface->scsidevs->devs_present; i++)
{
SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
}
state_save_register_global_array(machine, scsi_regs);

View File

@ -4,7 +4,6 @@
*/
#include "driver.h"
#include "deprecat.h"
#include "cr589.h"
typedef struct
@ -111,7 +110,7 @@ static void cr589_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
running_machine *machine = Machine;
running_machine *machine = scsiInstance->machine;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance );
our_this->download = 0;

View File

@ -10,7 +10,6 @@
*********************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "config.h"
#include "generic.h"

View File

@ -79,7 +79,7 @@ static int calc_gain_index(int data0, int data1)
}
static void gain_recalc(int which)
static void gain_recalc(running_machine *machine, int which)
{
struct MB87078 *c = chip + which;
int i;
@ -90,21 +90,21 @@ static void gain_recalc(int which)
c->gain[i] = calc_gain_index(c->latch[i], c->latch[4+i]);
if (old_index != c->gain[i])
{
(*c->intf->gain_changed_cb)(i, MB87078_gain_percent[c->gain[i]] );
(*c->intf->gain_changed_cb)(machine, i, MB87078_gain_percent[c->gain[i]] );
}
}
}
void MB87078_start(int which, const struct MB87078interface *intf)
void MB87078_start(running_machine *machine, int which, const struct MB87078interface *intf)
{
if (which >= MAX_MB87078) return;
chip[which].intf = intf;
/* reset chip */
MB87078_reset_comp_w(which,0);
MB87078_reset_comp_w(which,1);
MB87078_reset_comp_w(machine,which,0);
MB87078_reset_comp_w(machine,which,1);
}
@ -115,7 +115,7 @@ void MB87078_stop(void)
}
void MB87078_reset_comp_w(int which, int level)
void MB87078_reset_comp_w(running_machine *machine, int which, int level)
{
struct MB87078 *c = chip + which;
@ -133,11 +133,11 @@ void MB87078_reset_comp_w(int which, int level)
c->latch[6] = 0x2 | 0x4;
c->latch[7] = 0x3 | 0x4;
}
gain_recalc(which);
gain_recalc(machine, which);
}
void MB87078_data_w(int which, int data, int dsel)
void MB87078_data_w(running_machine *machine, int which, int data, int dsel)
{
struct MB87078 *c = chip + which;
@ -152,7 +152,7 @@ void MB87078_data_w(int which, int data, int dsel)
c->channel_latch = data & 3;
c->latch[4+c->channel_latch] = data & 0x1f; //always zero bit 5
}
gain_recalc(which);
gain_recalc(machine, which);
}

View File

@ -74,15 +74,15 @@
/* The interface structure */
struct MB87078interface {
void (*gain_changed_cb)(int channel, int percent /*, float decibels*/);
void (*gain_changed_cb)(running_machine *machine, int channel, int percent /*, float decibels*/);
};
void MB87078_stop(void);
void MB87078_start(int which, const struct MB87078interface *intf);
void MB87078_start(running_machine *machine, int which, const struct MB87078interface *intf);
void MB87078_data_w(int which, int data, int dsel);
void MB87078_reset_comp_w(int which, int level);
void MB87078_data_w(running_machine *machine, int which, int data, int dsel);
void MB87078_reset_comp_w(running_machine *machine, int which, int level);
/* MB87078_gain_decibel_r will return 'channel' gain on chip 'which'.

View File

@ -27,7 +27,7 @@ static struct
int last_touch_state;
int last_x;
int last_y;
void (*tx_callback)(UINT8 data);
void (*tx_callback)(running_machine *machine, UINT8 data);
int (*touch_callback)(int *touch_x, int *touch_y);
} microtouch;
@ -64,7 +64,7 @@ static TIMER_CALLBACK(microtouch_timer_callback)
{
if ( microtouch.tx_buffer_ptr < microtouch.tx_buffer_num )
{
microtouch.tx_callback( microtouch.tx_buffer[microtouch.tx_buffer_ptr++] );
microtouch.tx_callback( machine, microtouch.tx_buffer[microtouch.tx_buffer_ptr++] );
if ( microtouch.tx_buffer_ptr == microtouch.tx_buffer_num )
{
microtouch.tx_buffer_ptr = microtouch.tx_buffer_num = 0;
@ -107,7 +107,7 @@ static TIMER_CALLBACK(microtouch_timer_callback)
}
};
void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data),
void microtouch_init(running_machine *machine, void (*tx_cb)(running_machine *machine, UINT8 data),
int (*touch_cb)(int *touch_x, int *touch_y))
{
memset(&microtouch, 0, sizeof(microtouch));

View File

@ -3,7 +3,7 @@
INPUT_PORTS_EXTERN(microtouch);
void microtouch_init(running_machine *machine, void (*tx_cb)(UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
void microtouch_init(running_machine *machine, void (*tx_cb)(running_machine *machine, UINT8 data), int (*touch_cb)(int *touch_x, int *touch_y));
void microtouch_rx(int count, UINT8* data);
#endif //_MICROTOUCH_H

View File

@ -6,7 +6,7 @@
void init_pc_common(running_machine *machine, UINT32 flags, void (*set_keyb_int_func)(int));
void pc_keyboard(void);
void pc_keyboard(running_machine *machine);
UINT8 pc_keyb_read(void);
void pc_keyb_set_clock(int on);
void pc_keyb_clear(void);

View File

@ -1,10 +1,11 @@
#include "scsi.h"
void SCSIAllocInstance( const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion )
{
SCSIAllocInstanceParams params;
params.instance = NULL;
params.diskregion = diskregion;
params.machine = machine;
scsiClass->dispatch( SCSIOP_ALLOC_INSTANCE, (void *)scsiClass, 0, &params );
*instance = params.instance;
}
@ -102,10 +103,11 @@ int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intpa
return scsiClass->baseClass->dispatch( operation, file, intparm, ptrparm );
}
SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass )
SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass )
{
SCSIInstance *scsiInstance = (SCSIInstance *) malloc_or_die( SCSISizeof( scsiClass ) );
scsiInstance->scsiClass = scsiClass;
scsiInstance->machine = machine;
return scsiInstance;
}

View File

@ -22,12 +22,14 @@ typedef struct _SCSIClass
typedef struct
{
const SCSIClass *scsiClass;
running_machine *machine;
} SCSIInstance;
typedef struct
{
SCSIInstance *instance;
const char *diskregion;
running_machine *machine;
} SCSIAllocInstanceParams;
// commands accepted by a SCSI device's dispatch handler
@ -83,7 +85,7 @@ enum
#define SCSI_PHASE_MESSAGE_OUT ( 6 )
#define SCSI_PHASE_MESSAGE_IN ( 7 )
extern void SCSIAllocInstance( const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion );
extern void SCSIAllocInstance( running_machine *machine, const SCSIClass *scsiClass, SCSIInstance **instance, const char *diskregion );
extern void SCSIDeleteInstance( SCSIInstance *instance );
extern void SCSISetDevice( SCSIInstance *instance, void *device );
extern void SCSIGetDevice( SCSIInstance *instance, void **device );
@ -96,7 +98,7 @@ extern void SCSIReadData( SCSIInstance *instance, void *data, int dataLength );
extern void SCSISetPhase( SCSIInstance *instance, int phase );
extern void SCSIGetPhase( SCSIInstance *instance, int *phase );
extern SCSIInstance *SCSIMalloc( const SCSIClass *scsiClass );
extern SCSIInstance *SCSIMalloc( running_machine *machine, const SCSIClass *scsiClass );
extern int SCSIBase( const SCSIClass *scsiClass, int operation, void *file, INT64 intparm, UINT8 *ptrparm );
extern void *SCSIThis( const SCSIClass *scsiClass, SCSIInstance *instance );
extern int SCSISizeof( const SCSIClass *scsiClass );

View File

@ -11,7 +11,6 @@
#ifdef MESS
#include "devices/chd_cd.h"
#endif
#include "deprecat.h"
#include "scsicd.h"
typedef struct
@ -673,7 +672,7 @@ static void scsicd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
running_machine *machine = Machine;
running_machine *machine = scsiInstance->machine;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->lba = 0;
@ -694,7 +693,7 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
#ifdef MESS
/* TODO: get rid of this ifdef MESS section */
our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( Machine->config->devicelist, CDROM, diskregion ) );
our_this->cdrom = mess_cd_get_cdrom_file( device_list_find_by_tag( machine->config->devicelist, CDROM, diskregion ) );
#else
our_this->cdrom = cdrom_open(get_disk_handle( diskregion ));

View File

@ -5,7 +5,6 @@
***************************************************************************/
#include "scsidev.h"
#include "deprecat.h"
typedef struct
{
@ -28,7 +27,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
return 0;
default:
logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
logerror( "%s: SCSIDEV unknown command %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
return 0;
}
}
@ -43,7 +42,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
switch( command[ 0 ] )
{
default:
logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
logerror( "%s: SCSIDEV unknown read %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
break;
}
}
@ -58,7 +57,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
switch( command[ 0 ] )
{
default:
logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(Machine), command[ 0 ] );
logerror( "%s: SCSIDEV unknown write %02x\n", cpuexec_describe_context(scsiInstance->machine), command[ 0 ] );
break;
}
}
@ -100,7 +99,7 @@ static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
running_machine *machine = Machine;
running_machine *machine = scsiInstance->machine;
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance );
state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
@ -141,7 +140,7 @@ static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptr
case SCSIOP_ALLOC_INSTANCE:
params = ptrparm;
params->instance = SCSIMalloc( file );
params->instance = SCSIMalloc( params->machine, file );
scsidev_alloc_instance( params->instance, params->diskregion );
return 0;

View File

@ -11,7 +11,6 @@
#ifdef MESS
#include "devices/harddriv.h"
#endif
#include "deprecat.h"
#include "scsihd.h"
typedef struct
@ -225,7 +224,7 @@ static void scsihd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{
running_machine *machine = Machine;
running_machine *machine = scsiInstance->machine;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->lba = 0;
@ -236,7 +235,7 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
#ifdef MESS
/* TODO: get rid of this ifdef MESS section */
our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( Machine->config->devicelist, HARDDISK, diskregion ) );
our_this->disk = mess_hd_get_hard_disk_file( device_list_find_by_tag( machine->config->devicelist, HARDDISK, diskregion ) );
#else
our_this->disk = hard_disk_open(get_disk_handle( diskregion ));

View File

@ -792,7 +792,7 @@ void wd33c93_init( running_machine *machine, const struct WD33C93interface *inte
// try to open the devices
for (i = 0; i < interface->scsidevs->devs_present; i++)
{
SCSIAllocInstance( interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
SCSIAllocInstance( machine, interface->scsidevs->devices[i].scsiClass, &devices[interface->scsidevs->devices[i].scsiID], interface->scsidevs->devices[i].diskregion );
}
/* allocate a timer for commands */

View File

@ -181,7 +181,7 @@ struct _mame_private
***************************************************************************/
/* the active machine */
running_machine *Machine;
static running_machine *Machine;
/* the current options */
static core_options *mame_opts;
@ -1144,6 +1144,7 @@ static void fatalerror_common(running_machine *machine, int exitcode, const char
void CLIB_DECL fatalerror(const char *text, ...)
{
extern running_machine *Machine;
running_machine *machine = Machine;
va_list arg;
@ -1202,6 +1203,7 @@ void CLIB_DECL popmessage(const char *format, ...)
void CLIB_DECL logerror(const char *format, ...)
{
extern running_machine *Machine;
running_machine *machine = Machine;
/* currently, we need a machine to do this */

View File

@ -35,7 +35,7 @@ struct tms5110_info
/* static function prototypes */
static STREAM_UPDATE( tms5110_update );
static int speech_rom_read_bit(void)
static int speech_rom_read_bit(const device_config *device)
{
struct tms5110_info *info = sndti_token(SOUND_TMS5110, 0);

View File

@ -10,7 +10,7 @@
typedef struct _tms5110_interface tms5110_interface;
struct _tms5110_interface
{
int (*M0_callback)(void); /* function to be called when chip requests another bit */
int (*M0_callback)(const device_config *device); /* function to be called when chip requests another bit */
void (*load_address)(int addr); /* speech ROM load address callback */
};

View File

@ -34,7 +34,7 @@ static SND_STOP( custom )
{
struct custom_info *info = device->token;
if (info->intf->stop)
(*info->intf->stop)(info->token);
(*info->intf->stop)(device, info->token);
}
@ -42,7 +42,7 @@ static SND_RESET( custom )
{
struct custom_info *info = device->token;
if (info->intf->reset)
(*info->intf->reset)(info->token);
(*info->intf->reset)(device, info->token);
}

View File

@ -7,15 +7,15 @@ typedef struct _custom_sound_interface custom_sound_interface;
struct _custom_sound_interface
{
void *(*start)(const device_config *device, int clock, const custom_sound_interface *config);
void (*stop)(void *token);
void (*reset)(void *token);
void (*stop)(const device_config *device, void *token);
void (*reset)(const device_config *device, void *token);
void *extra_data;
};
void *custom_get_token(int index);
#define CUSTOM_START(name) void *name(const device_config *device, int clock, const custom_sound_interface *config)
#define CUSTOM_STOP(name) void name(void *token)
#define CUSTOM_RESET(name) void name(void *token)
#define CUSTOM_STOP(name) void name(const device_config *device, void *token)
#define CUSTOM_RESET(name) void name(const device_config *device, void *token)
#endif /* __CUSTOM_H__ */

View File

@ -213,10 +213,9 @@ static STREAM_UPDATE( PSXSPU_update )
}
}
static void spu_read( UINT32 n_address, INT32 n_size )
static void spu_read( running_machine *machine, UINT32 n_address, INT32 n_size )
{
struct psxinfo *chip = sndti_token(SOUND_PSXSPU, 0);
running_machine *machine = chip->device->machine;
verboselog( machine, 1, "spu_read( %08x, %08x )\n", n_address, n_size );
while( n_size > 0 )
@ -233,10 +232,9 @@ static void spu_read( UINT32 n_address, INT32 n_size )
}
}
static void spu_write( UINT32 n_address, INT32 n_size )
static void spu_write( running_machine *machine, UINT32 n_address, INT32 n_size )
{
struct psxinfo *chip = sndti_token(SOUND_PSXSPU, 0);
running_machine *machine = chip->device->machine;
verboselog( machine, 1, "spu_write( %08x, %08x )\n", n_address, n_size );
while( n_size > 0 )

View File

@ -16,7 +16,7 @@ READ32_HANDLER( psx_spu_r );
WRITE32_HANDLER( psx_spu_delay_w );
READ32_HANDLER( psx_spu_delay_r );
typedef void ( *spu_handler )( UINT32, INT32 );
typedef void ( *spu_handler )( running_machine *, UINT32, INT32 );
typedef struct _psx_spu_interface psx_spu_interface;
struct _psx_spu_interface

View File

@ -58,7 +58,7 @@
if( sp->sby_line != line_state ) \
{ \
sp->sby_line = line_state; \
if( sp->sby ) sp->sby(sp->sby_line); \
if( sp->sby ) sp->sby(sp->device, sp->sby_line); \
} \
}
@ -77,9 +77,10 @@ struct lpc12_t
struct sp0256
{
const device_config *device;
sound_stream *stream; /* MAME core sound stream */
void (*drq)(int state); /* Data request callback */
void (*sby)(int state); /* Standby callback */
void (*drq)(const device_config *device, int state); /* Data request callback */
void (*sby)(const device_config *device, int state); /* Standby callback */
int sby_line; /* Standby line state */
INT16 *cur_buf; /* Current sound buffer. */
int cur_len; /* Fullness of current sound buffer. */
@ -766,7 +767,7 @@ static void sp0256_micro(struct sp0256 *sp)
sp->ald = 0;
for (i = 0; i < 16; i++)
sp->filt.r[i] = 0;
if( sp->drq) sp->drq(ASSERT_LINE);
if( sp->drq) sp->drq(sp->device, ASSERT_LINE);
}
/* ---------------------------------------------------------------- */
@ -1175,10 +1176,11 @@ static SND_START( sp0256 )
sp = auto_malloc(sizeof(*sp));
memset(sp, 0, sizeof(*sp));
sp->device = device;
sp->drq = intf->lrq_callback;
sp->sby = intf->sby_callback;
if( sp->drq ) sp->drq(ASSERT_LINE);
if( sp->sby ) sp->sby(sp->sby_line = ASSERT_LINE);
if( sp->drq ) sp->drq(device, ASSERT_LINE);
if( sp->sby ) sp->sby(device, sp->sby_line = ASSERT_LINE);
sp->stream = stream_create(device, 0, 1, clock / CLOCK_DIVIDER, sp, sp0256_update);
@ -1236,7 +1238,7 @@ static void sp0256_reset(struct sp0256 *sp)
sp->mode = 0;
sp->page = 0x1000 << 3;
sp->silent = 1;
if( sp->drq ) sp->drq(ASSERT_LINE);
if( sp->drq ) sp->drq(sp->device, ASSERT_LINE);
SET_SBY(ASSERT_LINE)
}
@ -1265,7 +1267,7 @@ WRITE8_HANDLER( sp0256_ALD_w )
/* ---------------------------------------------------------------- */
sp->lrq = 0;
sp->ald = (0xFF & data) << 4;
if( sp->drq ) sp->drq(CLEAR_LINE);
if( sp->drq ) sp->drq(sp->device, CLEAR_LINE);
SET_SBY(CLEAR_LINE)
return;

View File

@ -25,8 +25,8 @@
typedef struct _sp0256_interface sp0256_interface;
struct _sp0256_interface {
void (*lrq_callback)(int state);
void (*sby_callback)(int state);
void (*lrq_callback)(const device_config *device, int state);
void (*sby_callback)(const device_config *device, int state);
};
void sp0256_bitrevbuff(UINT8 *buffer, unsigned int start, unsigned int length);

View File

@ -111,8 +111,9 @@ struct tms5110
UINT8 addr_bit;
/* external callback */
int (*M0_callback)(void);
int (*M0_callback)(const device_config *);
void (*set_load_address)(int);
const device_config *device;
/* these contain data describing the current and previous voice frames */
UINT16 old_energy;
@ -183,6 +184,7 @@ void *tms5110_create(const device_config *device, int variant)
tms = malloc_or_die(sizeof(*tms));
memset(tms, 0, sizeof(*tms));
tms->device = device;
tms5110_set_variant(tms, variant);
state_save_register_device_item_array(device, 0, tms->fifo);
@ -280,7 +282,7 @@ void tms5110_reset_chip(void *chip)
******************************************************************************************/
void tms5110_set_M0_callback(void *chip, int (*func)(void))
void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *))
{
struct tms5110 *tms = chip;
tms->M0_callback = func;
@ -347,7 +349,7 @@ int i;
{
if (tms->M0_callback)
{
int data = (*tms->M0_callback)();
int data = (*tms->M0_callback)(tms->device);
FIFO_data_write(tms, data);
}
else
@ -361,7 +363,7 @@ static void perform_dummy_read(struct tms5110 *tms)
{
if (tms->M0_callback)
{
int data = (*tms->M0_callback)();
int data = (*tms->M0_callback)(tms->device);
if (DEBUG_5110) logerror("TMS5110 performing dummy read; value read = %1i\n", data&1);
}
else

View File

@ -33,7 +33,7 @@ void tms5110_destroy(void *chip);
void tms5110_set_variant(void *chip, int variant);
void tms5110_reset_chip(void *chip);
void tms5110_set_M0_callback(void *chip, int (*func)(void));
void tms5110_set_M0_callback(void *chip, int (*func)(const device_config *));
void tms5110_set_load_address(void *chip, void (*func)(int));
void tms5110_CTL_set(void *chip, int data);

View File

@ -148,6 +148,7 @@ enum
struct upd7759_chip
{
const device_config *device;
sound_stream *channel; /* stream channel for playback */
/* internal clock to output sample rate mapping */
@ -161,7 +162,7 @@ struct upd7759_chip
UINT8 reset; /* current state of the RESET line */
UINT8 start; /* current state of the START line */
UINT8 drq; /* current state of the DRQ line */
void (*drqcallback)(int param); /* drq callback */
void (*drqcallback)(const device_config *device, int param); /* drq callback */
/* internal state machine */
INT8 state; /* current overall chip state */
@ -536,7 +537,7 @@ static TIMER_CALLBACK( upd7759_slave_update )
/* if the DRQ changed, update it */
logerror("slave_update: DRQ %d->%d\n", olddrq, chip->drq);
if (olddrq != chip->drq && chip->drqcallback)
(*chip->drqcallback)(chip->drq);
(*chip->drqcallback)(chip->device, chip->drq);
/* set a timer to go off when that is done */
if (chip->state != STATE_IDLE)
@ -634,6 +635,8 @@ static SND_START( upd7759 )
chip = auto_malloc(sizeof(*chip));
memset(chip, 0, sizeof(*chip));
chip->device = device;
/* allocate a stream channel */
chip->channel = stream_create(device, 0, 1, clock/4, chip, upd7759_update);

View File

@ -13,7 +13,7 @@
typedef struct _upd7759_interface upd7759_interface;
struct _upd7759_interface
{
void (*drqcallback)(int param); /* drq callback (per chip, slave mode only) */
void (*drqcallback)(const device_config *device, int param); /* drq callback (per chip, slave mode only) */
};
void upd7759_set_bank_base(int which, offs_t base);

View File

@ -10,7 +10,6 @@
*********************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "generic.h"
@ -482,10 +481,10 @@ static void updateflip(running_machine *machine)
flip_screen_set - set global flip
-------------------------------------------------*/
void flip_screen_set(int on)
void flip_screen_set(running_machine *machine, int on)
{
flip_screen_x_set(on);
flip_screen_y_set(on);
flip_screen_x_set(machine, on);
flip_screen_y_set(machine, on);
}
@ -494,7 +493,7 @@ void flip_screen_set(int on)
do not call update_flip.
-------------------------------------------------*/
void flip_screen_set_no_update(int on)
void flip_screen_set_no_update(running_machine *machine, int on)
{
/* flip_screen_y is not updated on purpose
* this function is for drivers which
@ -509,13 +508,13 @@ void flip_screen_set_no_update(int on)
flip_screen_x_set - set global horizontal flip
-------------------------------------------------*/
void flip_screen_x_set(int on)
void flip_screen_x_set(running_machine *machine, int on)
{
if (on) on = ~0;
if (flip_screen_x != on)
{
flip_screen_x = on;
updateflip(Machine);
updateflip(machine);
}
}
@ -524,13 +523,13 @@ void flip_screen_x_set(int on)
flip_screen_y_set - set global vertical flip
-------------------------------------------------*/
void flip_screen_y_set(int on)
void flip_screen_y_set(running_machine *machine, int on)
{
if (on) on = ~0;
if (flip_screen_y != on)
{
flip_screen_y = on;
updateflip(Machine);
updateflip(machine);
}
}
@ -539,7 +538,7 @@ void flip_screen_y_set(int on)
flip_screen_get - get global flip
-------------------------------------------------*/
int flip_screen_get(void)
int flip_screen_get(running_machine *machine)
{
return flip_screen_x;
}
@ -549,7 +548,7 @@ int flip_screen_get(void)
flip_screen_x_get - get global x flip
-------------------------------------------------*/
int flip_screen_x_get(void)
int flip_screen_x_get(running_machine *machine)
{
return flip_screen_x;
}
@ -559,12 +558,13 @@ int flip_screen_x_get(void)
flip_screen_get - get global y flip
-------------------------------------------------*/
int flip_screen_y_get(void)
int flip_screen_y_get(running_machine *machine)
{
return flip_screen_y;
}
/***************************************************************************
COMMON PALETTE INITIALIZATION
***************************************************************************/

View File

@ -117,15 +117,15 @@ void buffer_spriteram_2(UINT8 *ptr, int length);
/* ----- global attributes ----- */
/* set global attributes */
void flip_screen_set(int on);
void flip_screen_set_no_update(int on); /* will not call update_flip */
void flip_screen_x_set(int on);
void flip_screen_y_set(int on);
int flip_screen_get(void);
int flip_screen_x_get(void);
int flip_screen_y_get(void);
void flip_screen_set(running_machine *machine, int on);
void flip_screen_set_no_update(running_machine *machine, int on); /* will not call update_flip */
void flip_screen_x_set(running_machine *machine, int on);
void flip_screen_y_set(running_machine *machine, int on);
int flip_screen_get(running_machine *machine);
int flip_screen_x_get(running_machine *machine);
int flip_screen_y_get(running_machine *machine);
//#define flip_screen flip_screen_get()
//#define flip_screen flip_screen_get(machine)

View File

@ -31,7 +31,6 @@
**************************************************************************** */
#include "rendutil.h"
#include "deprecat.h"
#include "vector.h"
@ -193,7 +192,7 @@ VIDEO_START( vector )
* Adds a line end point to the vertices list. The vector processor emulation
* needs to call this.
*/
void vector_add_point (int x, int y, rgb_t color, int intensity)
void vector_add_point (running_machine *machine, int x, int y, rgb_t color, int intensity)
{
point *newpoint;
@ -202,7 +201,7 @@ void vector_add_point (int x, int y, rgb_t color, int intensity)
if (flicker && (intensity > 0))
{
intensity += (intensity * (0x80-(mame_rand(Machine)&0xff)) * flicker)>>16;
intensity += (intensity * (0x80-(mame_rand(machine)&0xff)) * flicker)>>16;
if (intensity < 0)
intensity = 0;
if (intensity > 0xff)

View File

@ -17,7 +17,7 @@ VIDEO_START( vector );
VIDEO_UPDATE( vector );
void vector_clear_list(void);
void vector_add_point(int x, int y, rgb_t color, int intensity);
void vector_add_point(running_machine *machine, int x, int y, rgb_t color, int intensity);
void vector_add_clip(int minx, int miny, int maxx, int maxy);
void vector_set_flicker(float _flicker);

View File

@ -10,7 +10,6 @@
#include "driver.h"
#include "deprecat.h"
#include "cpu/tms32031/tms32031.h"
#include "sound/dmadac.h"
#include "cage.h"
@ -193,7 +192,7 @@ void cage_set_irq_handler(void (*irqhandler)(running_machine *, int))
void cage_reset_w(int state)
{
if (state)
cage_control_w(Machine, 0);
cage_control_w(cage_cpu->machine, 0);
cpu_set_input_line(cage_cpu, INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@ -529,9 +528,10 @@ static TIMER_CALLBACK( deferred_cage_w )
void main_to_cage_w(UINT16 data)
{
running_machine *machine = cage_cpu->machine;
if (LOG_COMM)
logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(Machine), data);
timer_call_after_resynch(Machine, NULL, data, deferred_cage_w);
logerror("%s:Command to CAGE = %04X\n", cpuexec_describe_context(machine), data);
timer_call_after_resynch(machine, NULL, data, deferred_cage_w);
}

View File

@ -18,7 +18,6 @@
#include "driver.h"
#include "cpu/z80/z80.h"
#include "deprecat.h"
#include "cpu/ccpu/ccpu.h"
#include "cpu/z80/z80daisy.h"
#include "machine/z80ctc.h"
@ -53,7 +52,7 @@
*
*************************************/
static void (*sound_handler)(UINT8 sound_val, UINT8 bits_changed);
static void (*sound_handler)(running_machine *,UINT8 sound_val, UINT8 bits_changed);
static UINT8 sound_control;
/* general shift register variables */
@ -86,7 +85,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
/* if something changed, call the sound subroutine */
if ((sound_control != oldval) && sound_handler)
(*sound_handler)(sound_control, sound_control ^ oldval);
(*sound_handler)(space->machine, sound_control, sound_control ^ oldval);
}
@ -97,7 +96,7 @@ WRITE8_HANDLER( cinemat_sound_control_w )
*
*************************************/
static void generic_init(running_machine *machine, void (*callback)(UINT8, UINT8))
static void generic_init(running_machine *machine, void (*callback)(running_machine *,UINT8, UINT8))
{
/* call the standard init */
MACHINE_RESET_CALL(cinemat);
@ -160,10 +159,8 @@ static const samples_interface spacewar_samples_interface =
spacewar_sample_names
};
static void spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void spacewar_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_machine *machine = Machine;
/* Explosion - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
sample_start(0, (mame_rand(machine) & 1) ? 0 : 6, 0);
@ -239,7 +236,7 @@ static const samples_interface barrier_samples_interface =
barrier_sample_names
};
static void barrier_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void barrier_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* Player die - rising edge */
if (SOUNDVAL_RISING_EDGE(0x01))
@ -290,7 +287,7 @@ static const samples_interface speedfrk_samples_interface =
speedfrk_sample_names
};
static void speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void speedfrk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */
if (SOUNDVAL_FALLING_EDGE(0x08))
@ -353,7 +350,7 @@ static const samples_interface starhawk_samples_interface =
starhawk_sample_names
};
static void starhawk_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void starhawk_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* explosion - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -427,7 +424,7 @@ static const samples_interface sundance_samples_interface =
sundance_sample_names
};
static void sundance_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void sundance_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* bong - falling edge */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -495,7 +492,7 @@ static const samples_interface tailg_samples_interface =
tailg_sample_names
};
static void tailg_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void tailg_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */
if (SOUNDVAL_FALLING_EDGE(0x10))
@ -581,7 +578,7 @@ static const samples_interface warrior_samples_interface =
warrior_sample_names
};
static void warrior_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void warrior_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* normal level - 0=on, 1=off */
if (SOUNDVAL_FALLING_EDGE(0x01))
@ -650,7 +647,7 @@ static const samples_interface armora_samples_interface =
armora_sample_names
};
static void armora_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void armora_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@ -749,7 +746,7 @@ static const samples_interface ripoff_samples_interface =
ripoff_sample_names
};
static void ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void ripoff_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x02))
@ -834,9 +831,8 @@ static const samples_interface starcas_samples_interface =
starcas_sample_names
};
static void starcas_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void starcas_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -947,9 +943,8 @@ static const samples_interface solarq_samples_interface =
solarq_sample_names
};
static void solarq_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void solarq_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_machine *machine = Machine;
static float target_volume, current_volume;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1087,7 +1082,7 @@ static const samples_interface boxingb_samples_interface =
boxingb_sample_names
};
static void boxingb_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void boxingb_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
if (SOUNDVAL_RISING_EDGE(0x10))
@ -1216,9 +1211,8 @@ static const samples_interface wotw_samples_interface =
wotw_sample_names
};
static void wotw_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void wotw_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1329,9 +1323,8 @@ static const samples_interface wotwc_samples_interface =
wotwc_sample_names
};
static void wotwc_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void wotwc_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_machine *machine = Machine;
UINT32 target_pitch;
/* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */
@ -1429,10 +1422,8 @@ static TIMER_CALLBACK( synced_sound_w )
}
static void demon_sound_w(UINT8 sound_val, UINT8 bits_changed)
static void demon_sound_w(running_machine *machine, UINT8 sound_val, UINT8 bits_changed)
{
running_machine *machine = Machine;
/* all inputs are inverted */
sound_val = ~sound_val;
@ -1599,7 +1590,7 @@ MACHINE_DRIVER_END
static WRITE8_HANDLER( qb3_sound_w )
{
UINT16 rega = cpu_get_reg(space->machine->cpu[0], CCPU_A);
demon_sound_w(0x00 | (~rega & 0x0f), 0x10);
demon_sound_w(space->machine, 0x00 | (~rega & 0x0f), 0x10);
}

View File

@ -150,7 +150,6 @@
****************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "cpu/adsp2100/adsp2100.h"
#include "dcs.h"
#include "sound/dmadac.h"
@ -319,8 +318,8 @@ struct _dcs_state
UINT8 last_output_full;
UINT8 last_input_empty;
UINT16 progflags;
void (*output_full_cb)(int);
void (*input_empty_cb)(int);
void (*output_full_cb)(running_machine *, int);
void (*input_empty_cb)(running_machine *, int);
UINT16 (*fifo_data_r)(const device_config *device);
UINT16 (*fifo_status_r)(const device_config *device);
@ -824,9 +823,9 @@ static TIMER_CALLBACK( dcs_reset )
SET_INPUT_EMPTY();
SET_OUTPUT_EMPTY();
if (!dcs.last_input_empty && dcs.input_empty_cb)
(*dcs.input_empty_cb)(dcs.last_input_empty = 1);
(*dcs.input_empty_cb)(machine, dcs.last_input_empty = 1);
if (dcs.last_output_full && dcs.output_full_cb)
(*dcs.output_full_cb)(dcs.last_output_full = 0);
(*dcs.output_full_cb)(machine, dcs.last_output_full = 0);
/* boot */
dcs_boot();
@ -1068,7 +1067,7 @@ static WRITE16_HANDLER( dcs_data_bank_select_w )
*
*************************************/
INLINE void sdrc_update_bank_pointers(void)
INLINE void sdrc_update_bank_pointers(running_machine *machine)
{
if (SDRC_SM_EN != 0)
{
@ -1079,15 +1078,15 @@ INLINE void sdrc_update_bank_pointers(void)
{
/* ROM-based; use the memory page to select from ROM */
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
memory_set_bankptr(Machine, 25, &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
memory_set_bankptr(machine, 25, &dcs.sounddata[(SDRC_EPM_PG * pagesize) % dcs.sounddata_words]);
}
else
{
/* RAM-based; use the ROM page to select from ROM, and the memory page to select from RAM */
if (SDRC_ROM_MS == 1 && SDRC_ROM_ST != 3)
memory_set_bankptr(Machine, 25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
memory_set_bankptr(machine, 25, &dcs.bootrom[(SDRC_ROM_PG * 4096 /*pagesize*/) % dcs.bootrom_words]);
if (SDRC_DM_ST != 0)
memory_set_bankptr(Machine, 26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
memory_set_bankptr(machine, 26, &dcs.sounddata[(SDRC_DM_PG * 1024) % dcs.sounddata_words]);
}
}
}
@ -1148,7 +1147,7 @@ static void sdrc_remap_memory(running_machine *machine)
}
/* update the bank pointers */
sdrc_update_bank_pointers();
sdrc_update_bank_pointers(machine);
}
@ -1232,7 +1231,7 @@ static WRITE16_HANDLER( sdrc_w )
if (diff & 0x1833)
sdrc_remap_memory(space->machine);
if (diff & 0x0380)
sdrc_update_bank_pointers();
sdrc_update_bank_pointers(space->machine);
break;
/* offset 1 controls RAM mapping */
@ -1247,7 +1246,7 @@ static WRITE16_HANDLER( sdrc_w )
case 2:
sdrc.reg[2] = data;
if (diff & 0x1fff)
sdrc_update_bank_pointers();
sdrc_update_bank_pointers(space->machine);
break;
/* offset 3 controls security */
@ -1458,7 +1457,7 @@ READ32_HANDLER( dsio_idma_data_r )
DCS COMMUNICATIONS
****************************************************************************/
void dcs_set_io_callbacks(void (*output_full_cb)(int), void (*input_empty_cb)(int))
void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int))
{
dcs.input_empty_cb = input_empty_cb;
dcs.output_full_cb = output_full_cb;
@ -1476,7 +1475,7 @@ int dcs_control_r(void)
{
/* only boost for DCS2 boards */
if (!dcs.auto_ack && !transfer.hle_enabled)
cpuexec_boost_interleave(Machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5));
cpuexec_boost_interleave(dcs.cpu->machine, ATTOTIME_IN_NSEC(500), ATTOTIME_IN_USEC(5));
return dcs.latch_control;
}
@ -1486,10 +1485,10 @@ void dcs_reset_w(int state)
/* going high halts the CPU */
if (state)
{
logerror("%s: DCS reset = %d\n", cpuexec_describe_context(Machine), state);
logerror("%s: DCS reset = %d\n", cpuexec_describe_context(dcs.cpu->machine), state);
/* just run through the init code again */
timer_call_after_resynch(Machine, NULL, 0, dcs_reset);
timer_call_after_resynch(dcs.cpu->machine, NULL, 0, dcs_reset);
cpu_set_input_line(dcs.cpu, INPUT_LINE_RESET, ASSERT_LINE);
}
@ -1541,7 +1540,7 @@ static void dcs_delayed_data_w(running_machine *machine, int data)
/* indicate we are no longer empty */
if (dcs.last_input_empty && dcs.input_empty_cb)
(*dcs.input_empty_cb)(dcs.last_input_empty = 0);
(*dcs.input_empty_cb)(machine, dcs.last_input_empty = 0);
SET_INPUT_FULL();
/* set the data */
@ -1558,21 +1557,21 @@ static TIMER_CALLBACK( dcs_delayed_data_w_callback )
void dcs_data_w(int data)
{
/* preprocess the write */
if (preprocess_write(Machine, data))
if (preprocess_write(dcs.cpu->machine, data))
return;
/* if we are DCS1, set a timer to latch the data */
if (!dcs.sport_timer)
timer_call_after_resynch(Machine, NULL, data, dcs_delayed_data_w_callback);
timer_call_after_resynch(dcs.cpu->machine, NULL, data, dcs_delayed_data_w_callback);
else
dcs_delayed_data_w(Machine, data);
dcs_delayed_data_w(dcs.cpu->machine, data);
}
static WRITE16_HANDLER( input_latch_ack_w )
{
if (!dcs.last_input_empty && dcs.input_empty_cb)
(*dcs.input_empty_cb)(dcs.last_input_empty = 1);
(*dcs.input_empty_cb)(space->machine, dcs.last_input_empty = 1);
SET_INPUT_EMPTY();
cpu_set_input_line(dcs.cpu, ADSP2105_IRQ2, CLEAR_LINE);
}
@ -1596,7 +1595,7 @@ static READ16_HANDLER( input_latch_r )
static TIMER_CALLBACK( latch_delayed_w )
{
if (!dcs.last_output_full && dcs.output_full_cb)
(*dcs.output_full_cb)(dcs.last_output_full = 1);
(*dcs.output_full_cb)(machine, dcs.last_output_full = 1);
SET_OUTPUT_FULL();
dcs.output_data = param;
}
@ -1624,7 +1623,7 @@ static TIMER_CALLBACK( delayed_ack_w_callback )
void dcs_ack_w(void)
{
timer_call_after_resynch(Machine, NULL, 0, delayed_ack_w_callback);
timer_call_after_resynch(dcs.cpu->machine, NULL, 0, delayed_ack_w_callback);
}
@ -1632,12 +1631,12 @@ int dcs_data_r(void)
{
/* data is actually only 8 bit (read from d8-d15) */
if (dcs.last_output_full && dcs.output_full_cb)
(*dcs.output_full_cb)(dcs.last_output_full = 0);
(*dcs.output_full_cb)(dcs.cpu->machine, dcs.last_output_full = 0);
if (dcs.auto_ack)
delayed_ack_w();
if (LOG_DCS_IO)
logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context(Machine), dcs.output_data);
logerror("%s:dcs_data_r(%04X)\n", cpuexec_describe_context(dcs.cpu->machine), dcs.output_data);
return dcs.output_data;
}
@ -2064,7 +2063,7 @@ void dcs_fifo_notify(int count, int max)
if (transfer.state != 5 || transfer.fifo_entries == transfer.writes_left || transfer.fifo_entries >= 256)
{
for ( ; transfer.fifo_entries; transfer.fifo_entries--)
preprocess_write(Machine, (*dcs.fifo_data_r)(dcs.cpu));
preprocess_write(dcs.cpu->machine, (*dcs.fifo_data_r)(dcs.cpu));
}
}
@ -2363,9 +2362,9 @@ static int preprocess_write(running_machine *machine, UINT16 data)
if (result && dcs.input_empty_cb)
{
if (dcs.last_input_empty)
(*dcs.input_empty_cb)(dcs.last_input_empty = 0);
(*dcs.input_empty_cb)(machine, dcs.last_input_empty = 0);
if (!dcs.last_input_empty)
(*dcs.input_empty_cb)(dcs.last_input_empty = 1);
(*dcs.input_empty_cb)(machine, dcs.last_input_empty = 1);
}
return result;
}

View File

@ -17,7 +17,7 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset);
void dcs_set_auto_ack(int state);
void dcs_set_fifo_callbacks(UINT16 (*fifo_data_r)(const device_config *device), UINT16 (*fifo_status_r)(const device_config *device));
void dcs_set_io_callbacks(void (*output_full_cb)(int), void (*input_empty_cb)(int));
void dcs_set_io_callbacks(void (*output_full_cb)(running_machine *, int), void (*input_empty_cb)(running_machine *, int));
int dcs_data_r(void);
void dcs_ack_w(void);

View File

@ -6,7 +6,6 @@
***************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "cpu/m6502/m6502.h"
#include "machine/6532riot.h"
#include "sound/samples.h"
@ -200,9 +199,9 @@ static void trigger_sample(running_machine *machine, UINT8 data)
#ifdef UNUSED_FUNCTION
void gottlieb_knocker(void)
void gottlieb_knocker(running_machine *machine)
{
if (!strcmp(Machine->gamedrv->name,"reactor")) /* reactor */
if (!strcmp(machine->gamedrv->name,"reactor")) /* reactor */
{
}
else if (sndti_exists(SOUND_SAMPLES, 0)) /* qbert */

View File

@ -143,7 +143,6 @@
****************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "memconv.h"
#include "includes/jaguar.h"
#include "cpu/jaguar/jaguar.h"
@ -209,15 +208,15 @@ void jaguar_dsp_resume(running_machine *machine)
*
*************************************/
static void update_gpu_irq(void)
static void update_gpu_irq(running_machine *machine)
{
if (gpu_irq_state & dsp_regs[JINTCTRL] & 0x1f)
{
cpu_set_input_line(Machine->cpu[1], 1, ASSERT_LINE);
jaguar_gpu_resume(Machine);
cpu_set_input_line(machine->cpu[1], 1, ASSERT_LINE);
jaguar_gpu_resume(machine);
}
else
cpu_set_input_line(Machine->cpu[1], 1, CLEAR_LINE);
cpu_set_input_line(machine->cpu[1], 1, CLEAR_LINE);
}
@ -227,7 +226,7 @@ void jaguar_external_int(const device_config *device, int state)
gpu_irq_state |= 1;
else
gpu_irq_state &= ~1;
update_gpu_irq();
update_gpu_irq(device->machine);
}
@ -283,12 +282,12 @@ void cojag_sound_init(running_machine *machine)
*
*************************************/
void cojag_sound_reset(void)
void cojag_sound_reset(running_machine *machine)
{
#if ENABLE_SPEEDUP_HACKS
serial_timer = timer_alloc(Machine, serial_chunky_callback, NULL);
serial_timer = timer_alloc(machine, serial_chunky_callback, NULL);
#else
serial_timer = timer_alloc(Machine, serial_callback, NULL);
serial_timer = timer_alloc(machine, serial_callback, NULL);
#endif
}
@ -323,7 +322,7 @@ WRITE16_HANDLER( jaguar_jerry_regs_w )
{
case JINTCTRL:
gpu_irq_state &= ~(dsp_regs[JINTCTRL] >> 8);
update_gpu_irq();
update_gpu_irq(space->machine);
break;
}

View File

@ -9,14 +9,12 @@
#include "driver.h"
#include "cpu/z80/z80.h"
#include "cpu/m68000/m68000.h"
#include "deprecat.h"
#include "audio/mcr.h"
#include "audio/williams.h"
#include "cpu/m6800/m6800.h"
#include "cpu/m6809/m6809.h"
#include "sound/5220intf.h"
#include "sound/ay8910.h"
#include "sound/dac.h"
#include "audio/williams.h"
#include "includes/mcr.h"
#include "audio/mcr.h"
@ -101,7 +99,7 @@ static const pia6821_interface squawkntalk_pia1_intf;
*
*************************************/
static void ssio_compute_ay8910_modulation(void);
static void ssio_compute_ay8910_modulation(running_machine *machine);
@ -122,7 +120,7 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
if (mcr_sound_config & MCR_SSIO)
{
ssio_sound_cpu = sound_cpu++;
ssio_compute_ay8910_modulation();
ssio_compute_ay8910_modulation(machine);
state_save_register_global_array(machine, ssio_data);
state_save_register_global(machine, ssio_status);
state_save_register_global(machine, ssio_14024_count);
@ -172,48 +170,48 @@ void mcr_sound_init(running_machine *machine, UINT8 config)
/* Advanced Audio */
if (mcr_sound_config & MCR_WILLIAMS_SOUND)
{
williams_cvsd_init(0);
williams_cvsd_init(machine, 0);
sound_cpu++;
dac_index++;
}
}
void mcr_sound_reset(void)
void mcr_sound_reset(running_machine *machine)
{
/* SSIO */
if (mcr_sound_config & MCR_SSIO)
{
ssio_reset_w(1);
ssio_reset_w(0);
ssio_reset_w(machine, 1);
ssio_reset_w(machine, 0);
}
/* Turbo Chip Squeak */
if (mcr_sound_config & MCR_TURBO_CHIP_SQUEAK)
{
turbocs_reset_w(1);
turbocs_reset_w(0);
turbocs_reset_w(machine, 1);
turbocs_reset_w(machine, 0);
}
/* Chip Squeak Deluxe */
if (mcr_sound_config & MCR_CHIP_SQUEAK_DELUXE)
{
csdeluxe_reset_w(1);
csdeluxe_reset_w(0);
csdeluxe_reset_w(machine, 1);
csdeluxe_reset_w(machine, 0);
}
/* Sounds Good */
if (mcr_sound_config & MCR_SOUNDS_GOOD)
{
soundsgood_reset_w(1);
soundsgood_reset_w(0);
soundsgood_reset_w(machine, 1);
soundsgood_reset_w(machine, 0);
}
/* Squawk n Talk */
if (mcr_sound_config & MCR_SQUAWK_N_TALK)
{
squawkntalk_reset_w(1);
squawkntalk_reset_w(0);
squawkntalk_reset_w(machine, 1);
squawkntalk_reset_w(machine, 0);
}
/* Advanced Audio */
@ -269,9 +267,9 @@ void mcr_sound_reset(void)
frequency of sound output. So we simply apply a volume
adjustment to each voice according to the duty cycle.
*/
static void ssio_compute_ay8910_modulation(void)
static void ssio_compute_ay8910_modulation(running_machine *machine)
{
UINT8 *prom = memory_region(Machine, "proms");
UINT8 *prom = memory_region(machine, "proms");
int volval;
/* loop over all possible values of the duty cycle */
@ -393,14 +391,14 @@ READ8_HANDLER( ssio_status_r )
return ssio_status;
}
void ssio_reset_w(int state)
void ssio_reset_w(running_machine *machine, int state)
{
/* going high halts the CPU */
if (state)
{
int i;
cpu_set_input_line(Machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, ASSERT_LINE);
cpu_set_input_line(machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, ASSERT_LINE);
/* latches also get reset */
for (i = 0; i < 4; i++)
@ -410,7 +408,7 @@ void ssio_reset_w(int state)
}
/* going low resets and reactivates the CPU */
else
cpu_set_input_line(Machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, CLEAR_LINE);
cpu_set_input_line(machine->cpu[ssio_sound_cpu], INPUT_LINE_RESET, CLEAR_LINE);
}
READ8_HANDLER( ssio_input_port_r )
@ -583,9 +581,9 @@ READ8_HANDLER( csdeluxe_status_r )
return csdeluxe_status;
}
void csdeluxe_reset_w(int state)
void csdeluxe_reset_w(running_machine *machine, int state)
{
cpu_set_input_line(Machine->cpu[csdeluxe_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(machine->cpu[csdeluxe_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@ -688,10 +686,10 @@ READ8_HANDLER( soundsgood_status_r )
return soundsgood_status;
}
void soundsgood_reset_w(int state)
void soundsgood_reset_w(running_machine *machine, int state)
{
//if (state) mame_printf_debug("SG Reset\n");
cpu_set_input_line(Machine->cpu[soundsgood_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(machine->cpu[soundsgood_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@ -784,9 +782,9 @@ READ8_HANDLER( turbocs_status_r )
return turbocs_status;
}
void turbocs_reset_w(int state)
void turbocs_reset_w(running_machine *machine, int state)
{
cpu_set_input_line(Machine->cpu[turbocs_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(machine->cpu[turbocs_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}
@ -910,9 +908,9 @@ WRITE8_HANDLER( squawkntalk_data_w )
timer_call_after_resynch(space->machine, NULL, data, squawkntalk_delayed_data_w);
}
void squawkntalk_reset_w(int state)
void squawkntalk_reset_w(running_machine *machine, int state)
{
cpu_set_input_line(Machine->cpu[squawkntalk_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(machine->cpu[squawkntalk_sound_cpu], INPUT_LINE_RESET, state ? ASSERT_LINE : CLEAR_LINE);
}

View File

@ -13,30 +13,30 @@
/************ Generic MCR routines ***************/
void mcr_sound_init(running_machine *machine, UINT8 config);
void mcr_sound_reset(void);
void mcr_sound_reset(running_machine *machine);
WRITE8_HANDLER( ssio_data_w );
READ8_HANDLER( ssio_status_r );
READ8_HANDLER( ssio_input_port_r );
WRITE8_HANDLER( ssio_output_port_w );
void ssio_reset_w(int state);
void ssio_reset_w(running_machine *machine, int state);
void ssio_set_custom_input(int which, int mask, read8_space_func handler);
void ssio_set_custom_output(int which, int mask, write8_space_func handler);
WRITE8_HANDLER( csdeluxe_data_w );
READ8_HANDLER( csdeluxe_status_r );
void csdeluxe_reset_w(int state);
void csdeluxe_reset_w(running_machine *machine, int state);
WRITE8_HANDLER( turbocs_data_w );
READ8_HANDLER( turbocs_status_r );
void turbocs_reset_w(int state);
void turbocs_reset_w(running_machine *machine, int state);
WRITE8_HANDLER( soundsgood_data_w );
READ8_HANDLER( soundsgood_status_r );
void soundsgood_reset_w(int state);
void soundsgood_reset_w(running_machine *machine, int state);
WRITE8_HANDLER( squawkntalk_data_w );
void squawkntalk_reset_w(int state);
void squawkntalk_reset_w(running_machine *machine, int state);

View File

@ -322,7 +322,7 @@ static void delayed_sound_2(running_machine *machine, int data)
if (n8080_hardware == 1)
{
flip_screen_set_no_update(data & 0x20);
flip_screen_set_no_update(machine, data & 0x20);
}
if (n8080_hardware == 3)
{

View File

@ -49,7 +49,6 @@ The command format is very simple:
***************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "namco54.h"
#include "cpu/mb88xx/mb88xx.h"
@ -114,14 +113,14 @@ static TIMER_CALLBACK( namco_54xx_irq_clear )
cpu_set_input_line(device, 0, CLEAR_LINE);
}
void namco_54xx_write(UINT8 data)
void namco_54xx_write(running_machine *machine, UINT8 data)
{
const device_config *device = cputag_get_cpu(Machine, CPUTAG_54XX);
const device_config *device = cputag_get_cpu(machine, CPUTAG_54XX);
if (device == NULL)
return;
timer_call_after_resynch(Machine, NULL, data, namco_54xx_latch_callback);
timer_call_after_resynch(machine, NULL, data, namco_54xx_latch_callback);
cpu_set_input_line(device, 0, ASSERT_LINE);
@ -130,5 +129,5 @@ void namco_54xx_write(UINT8 data)
// The input clock to the 06XX interface chip is 64H, that is
// 18432000/6/64 = 48kHz, so it makes sense for the irq line to be
// asserted for one clock cycle ~= 21us.
timer_set(Machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear);
timer_set(machine, ATTOTIME_IN_USEC(21), (void *)device, 0, namco_54xx_irq_clear);
}

View File

@ -9,7 +9,7 @@ ADDRESS_MAP_EXTERN( namco_54xx_map_program, 8 );
ADDRESS_MAP_EXTERN( namco_54xx_map_data, 8 );
ADDRESS_MAP_EXTERN( namco_54xx_map_io, 8 );
void namco_54xx_write(UINT8 data);
void namco_54xx_write(running_machine *machine, UINT8 data);
/* discrete nodes */
#define NAMCO_54XX_0_DATA NODE_01

View File

@ -12,7 +12,6 @@
***************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "machine/7474.h"
#include "sound/flt_rc.h"
@ -84,7 +83,7 @@ WRITE8_DEVICE_HANDLER( scramble_sh_irqtrigger_w )
{
/* the complement of bit 3 is connected to the flip-flop's clock */
TTL7474_clock_w(2, ~data & 0x08);
TTL7474_update(2);
TTL7474_update(device->machine, 2);
/* bit 4 is sound disable */
sound_global_enable(~data & 0x10);
@ -94,21 +93,21 @@ WRITE8_HANDLER( sfx_sh_irqtrigger_w )
{
/* bit 1 is connected to the flip-flop's clock */
TTL7474_clock_w(3, data & 0x01);
TTL7474_update(3);
TTL7474_update(space->machine, 3);
}
WRITE8_DEVICE_HANDLER( mrkougar_sh_irqtrigger_w )
{
/* the complement of bit 3 is connected to the flip-flop's clock */
TTL7474_clock_w(2, ~data & 0x08);
TTL7474_update(2);
TTL7474_update(device->machine, 2);
}
WRITE8_HANDLER( froggrmc_sh_irqtrigger_w )
{
/* the complement of bit 0 is connected to the flip-flop's clock */
TTL7474_clock_w(2, ~data & 0x01);
TTL7474_update(2);
TTL7474_update(space->machine, 2);
}
@ -118,10 +117,10 @@ static IRQ_CALLBACK(scramble_sh_irq_callback)
we need to pulse the CLR line because MAME's core never clears this
line, only asserts it */
TTL7474_clear_w(2, 0);
TTL7474_update(2);
TTL7474_update(device->machine, 2);
TTL7474_clear_w(2, 1);
TTL7474_update(2);
TTL7474_update(device->machine, 2);
return 0xff;
}
@ -132,27 +131,27 @@ static IRQ_CALLBACK(sfx_sh_irq_callback)
we need to pulse the CLR line because MAME's core never clears this
line, only asserts it */
TTL7474_clear_w(3, 0);
TTL7474_update(3);
TTL7474_update(device->machine, 3);
TTL7474_clear_w(3, 1);
TTL7474_update(3);
TTL7474_update(device->machine, 3);
return 0xff;
}
static void scramble_sh_7474_callback(void)
static void scramble_sh_7474_callback(running_machine *machine)
{
/* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */
cpu_set_input_line(Machine->cpu[1], 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(machine->cpu[1], 0, !TTL7474_output_comp_r(2) ? ASSERT_LINE : CLEAR_LINE);
}
static void sfx_sh_7474_callback(void)
static void sfx_sh_7474_callback(running_machine *machine)
{
/* the Q bar is connected to the Z80's INT line. But since INT is complemented, */
/* we need to complement Q bar */
cpu_set_input_line(Machine->cpu[2], 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE);
cpu_set_input_line(machine->cpu[2], 0, !TTL7474_output_comp_r(3) ? ASSERT_LINE : CLEAR_LINE);
}
WRITE8_HANDLER( hotshock_sh_irqtrigger_w )
@ -209,9 +208,8 @@ static const struct TTL7474_interface sfx_sh_7474_intf =
};
void scramble_sh_init(void)
void scramble_sh_init(running_machine *machine)
{
running_machine *machine = Machine;
cpu_set_irq_callback(machine->cpu[1], scramble_sh_irq_callback);
TTL7474_config(machine, 2, &scramble_sh_7474_intf);
@ -220,9 +218,8 @@ void scramble_sh_init(void)
TTL7474_d_w(2, 1);
}
void sfx_sh_init(void)
void sfx_sh_init(running_machine *machine)
{
running_machine *machine = Machine;
cpu_set_irq_callback(machine->cpu[2], sfx_sh_irq_callback);
TTL7474_config(machine, 3, &sfx_sh_7474_intf);
@ -338,9 +335,9 @@ static TIMER_CALLBACK( ad2083_step )
timer_set(machine, ATTOTIME_IN_HZ(AD2083_TMS5110_CLOCK / 2),NULL,1,ad2083_step);
}
static int ad2083_speech_rom_read_bit(void)
static int ad2083_speech_rom_read_bit(const device_config *device)
{
UINT8 *ROM = memory_region(Machine, "tms5110");
UINT8 *ROM = memory_region(device->machine, "tms5110");
int bit;
speech_rom_address %= 4096;

View File

@ -11,7 +11,6 @@
#include "driver.h"
#include "streams.h"
#include "deprecat.h"
#include "segag80v.h"
#include "cpu/mcs48/mcs48.h"
#include "sound/sp0250.h"
@ -311,13 +310,13 @@ static TIMER_CALLBACK( increment_t1_clock )
}
void sega_usb_reset(UINT8 t1_clock_mask)
void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask)
{
/* halt the USB CPU at reset time */
cpu_set_input_line(usb.cpu, INPUT_LINE_RESET, ASSERT_LINE);
/* start the clock timer */
timer_pulse(Machine, attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock);
timer_pulse(machine, attotime_mul(ATTOTIME_IN_HZ(USB_2MHZ_CLOCK), 256), NULL, 0, increment_t1_clock);
usb.t1_clock_mask = t1_clock_mask;
}

View File

@ -14,7 +14,7 @@ WRITE8_HANDLER( sega_speech_control_w );
MACHINE_DRIVER_EXTERN( sega_universal_sound_board );
MACHINE_DRIVER_EXTERN( sega_universal_sound_board_rom );
void sega_usb_reset(UINT8 t1_clock_mask);
void sega_usb_reset(running_machine *machine, UINT8 t1_clock_mask);
READ8_HANDLER( sega_usb_status_r );
WRITE8_HANDLER( sega_usb_data_w );

View File

@ -1,5 +1,4 @@
#include "driver.h"
#include "deprecat.h"
#include "cpu/z80/z80.h"
#include "taitosnd.h"
@ -41,11 +40,11 @@ typedef struct TC0140SYT
static struct TC0140SYT tc0140syt;
static void Interrupt_Controller(void)
static void Interrupt_Controller(running_machine *machine)
{
if ( tc0140syt.nmi_req && tc0140syt.nmi_enabled )
{
cpu_set_input_line(Machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
cpu_set_input_line(machine->cpu[1], INPUT_LINE_NMI, PULSE_LINE );
tc0140syt.nmi_req = 0;
}
}
@ -208,7 +207,7 @@ WRITE8_HANDLER( taitosound_slave_comm_w )
logerror("tc0140syt: Slave cpu written in mode [%02x] data[%02x]\n",tc0140syt.submode, data & 0xff);
}
Interrupt_Controller();
Interrupt_Controller(space->machine);
}
@ -250,7 +249,7 @@ READ8_HANDLER( taitosound_slave_comm_r )
res = 0;
}
Interrupt_Controller();
Interrupt_Controller(space->machine);
return res;
}

View File

@ -23,7 +23,6 @@
****************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "machine/6821pia.h"
#include "cpu/m6809/m6809.h"
#include "williams.h"
@ -259,9 +258,8 @@ MACHINE_DRIVER_END
INITIALIZATION
****************************************************************************/
void williams_cvsd_init(int pianum)
void williams_cvsd_init(running_machine *machine, int pianum)
{
running_machine *machine = Machine;
UINT8 *ROM;
int bank;
@ -296,17 +294,17 @@ void williams_cvsd_init(int pianum)
}
void williams_narc_init(void)
void williams_narc_init(running_machine *machine)
{
UINT8 *ROM;
int bank;
/* configure the CPU */
sound_cpu = cputag_get_cpu(Machine, "narc1");
soundalt_cpu = cputag_get_cpu(Machine, "narc2");
sound_cpu = cputag_get_cpu(machine, "narc1");
soundalt_cpu = cputag_get_cpu(machine, "narc2");
/* configure master CPU banks */
ROM = memory_region(Machine, "narc1");
ROM = memory_region(machine, "narc1");
for (bank = 0; bank < 16; bank++)
{
/*
@ -315,12 +313,12 @@ void williams_narc_init(void)
D3 -> A16
*/
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
memory_configure_bank(Machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
memory_configure_bank(machine, 5, bank, 1, &ROM[0x10000 + offset], 0);
}
memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
memory_set_bankptr(machine, 6, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* configure slave CPU banks */
ROM = memory_region(Machine, "narc2");
ROM = memory_region(machine, "narc2");
for (bank = 0; bank < 16; bank++)
{
/*
@ -329,33 +327,33 @@ void williams_narc_init(void)
D3 -> A16
*/
offs_t offset = 0x8000 * (bank & 1) + 0x10000 * ((bank >> 3) & 1) + 0x20000 * ((bank >> 1) & 3);
memory_configure_bank(Machine, 7, bank, 1, &ROM[0x10000 + offset], 0);
memory_configure_bank(machine, 7, bank, 1, &ROM[0x10000 + offset], 0);
}
memory_set_bankptr(sound_cpu->machine, 8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
memory_set_bankptr(machine, 8, &ROM[0x10000 + 0x4000 + 0x8000 + 0x10000 + 0x20000 * 3]);
/* register for save states */
state_save_register_global(sound_cpu->machine, williams_sound_int_state);
state_save_register_global(sound_cpu->machine, audio_talkback);
state_save_register_global(sound_cpu->machine, audio_sync);
state_save_register_global(machine, williams_sound_int_state);
state_save_register_global(machine, audio_talkback);
state_save_register_global(machine, audio_sync);
}
void williams_adpcm_init(void)
void williams_adpcm_init(running_machine *machine)
{
UINT8 *ROM;
/* configure the CPU */
sound_cpu = cputag_get_cpu(Machine, "adpcm");
sound_cpu = cputag_get_cpu(machine, "adpcm");
soundalt_cpu = NULL;
/* configure banks */
ROM = memory_region(Machine, "adpcm");
memory_configure_bank(Machine, 5, 0, 8, &ROM[0x10000], 0x8000);
memory_set_bankptr(sound_cpu->machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
ROM = memory_region(machine, "adpcm");
memory_configure_bank(machine, 5, 0, 8, &ROM[0x10000], 0x8000);
memory_set_bankptr(machine, 6, &ROM[0x10000 + 0x4000 + 7 * 0x8000]);
/* expand ADPCM data */
/* it is assumed that U12 is loaded @ 0x00000 and U13 is loaded @ 0x40000 */
ROM = memory_region(Machine, "oki");
ROM = memory_region(machine, "oki");
memcpy(ROM + 0x1c0000, ROM + 0x080000, 0x20000); /* expand individual banks */
memcpy(ROM + 0x180000, ROM + 0x0a0000, 0x20000);
memcpy(ROM + 0x140000, ROM + 0x0c0000, 0x20000);
@ -373,8 +371,8 @@ void williams_adpcm_init(void)
memcpy(ROM + 0x020000, ROM + 0x060000, 0x20000);
/* register for save states */
state_save_register_global(sound_cpu->machine, williams_sound_int_state);
state_save_register_global(sound_cpu->machine, audio_talkback);
state_save_register_global(machine, williams_sound_int_state);
state_save_register_global(machine, audio_talkback);
}
@ -477,9 +475,9 @@ static TIMER_CALLBACK( williams_cvsd_delayed_data_w )
}
void williams_cvsd_data_w(int data)
void williams_cvsd_data_w(running_machine *machine, int data)
{
timer_call_after_resynch(Machine, NULL, data, williams_cvsd_delayed_data_w);
timer_call_after_resynch(machine, NULL, data, williams_cvsd_delayed_data_w);
}

View File

@ -8,16 +8,16 @@ MACHINE_DRIVER_EXTERN( williams_cvsd_sound );
MACHINE_DRIVER_EXTERN( williams_adpcm_sound );
MACHINE_DRIVER_EXTERN( williams_narc_sound );
void williams_cvsd_init(int pianum);
void williams_cvsd_data_w(int data);
void williams_cvsd_init(running_machine *machine, int pianum);
void williams_cvsd_data_w(running_machine *machine, int data);
void williams_cvsd_reset_w(int state);
void williams_adpcm_init(void);
void williams_adpcm_init(running_machine *machine);
void williams_adpcm_data_w(int data);
void williams_adpcm_reset_w(int state);
int williams_adpcm_sound_irq_r(void);
void williams_narc_init(void);
void williams_narc_init(running_machine *machine);
void williams_narc_data_w(int data);
void williams_narc_reset_w(int state);
int williams_narc_talkback_r(void);

View File

@ -113,12 +113,12 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
int xx,yy,x;
int delta = 16;
flipx ^= flip_screen_get();
flipy ^= flip_screen_get();
flipx ^= flip_screen_get(machine);
flipy ^= flip_screen_get(machine);
if ((pri&pri_mask)!=priority) continue;
if (flip_screen_get())
if (flip_screen_get(machine))
{
sx = 368 - sx;
sy = 240 - sy;

View File

@ -175,7 +175,7 @@ static void duart_tx(const device_config *device, int channel, UINT8 data)
}
};
static void microtouch_tx(UINT8 data)
static void microtouch_tx(running_machine *machine, UINT8 data)
{
duart68681_rx_data(skattv_devices.duart68681, 0, data);
}

View File

@ -301,7 +301,7 @@ static WRITE8_HANDLER( slave_bankswitch_w )
{
airbustr_bankswitch(space->machine, "slave", 2, data);
flip_screen_set(data & 0x10);
flip_screen_set(space->machine, data & 0x10);
// used at the end of levels, after defeating the boss, to leave trails
pandora_set_clear_bitmap(data&0x20);

View File

@ -114,29 +114,29 @@ static TIMER_CALLBACK( response_timer )
UINT8 data = laserdisc_data_r(laserdisc);
if (data != 0x0a)
mame_printf_debug("Sending serial data = %02X\n", data);
amiga_serial_in_w(data);
amiga_serial_in_w(machine, data);
}
/* if there's more to come, set another timer */
if (laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0);
else
serial_timer_active = FALSE;
}
static void vsync_callback(void)
static void vsync_callback(running_machine *machine)
{
/* if we have data available, set a timer to read it */
if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
{
timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0);
serial_timer_active = TRUE;
}
}
static void serial_w(UINT16 data)
static void serial_w(running_machine *machine, UINT16 data)
{
/* write to the laserdisc player */
laserdisc_data_w(laserdisc, data & 0xff);
@ -144,7 +144,7 @@ static void serial_w(UINT16 data)
/* if we have data available, set a timer to read it */
if (!serial_timer_active && laserdisc_line_r(laserdisc, LASERDISC_LINE_DATA_AVAIL) == ASSERT_LINE)
{
timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(), 0);
timer_adjust_oneshot(serial_timer, amiga_get_serial_char_period(machine), 0);
serial_timer_active = TRUE;
}
}

View File

@ -53,7 +53,7 @@ static WRITE8_HANDLER( ambush_coin_counter_w )
static WRITE8_HANDLER( flip_screen_w )
{
flip_screen_set(data);
flip_screen_set(space->machine, data);
}

View File

@ -173,7 +173,7 @@ static WRITE16_HANDLER( io_w )
COMBINE_DATA(&armedf_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
flip_screen_set(armedf_vreg & 0x1000);
flip_screen_set(space->machine, armedf_vreg & 0x1000);
}
static WRITE16_HANDLER( terraf_io_w )
@ -181,7 +181,7 @@ static WRITE16_HANDLER( terraf_io_w )
COMBINE_DATA(&armedf_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
flip_screen_set(armedf_vreg & 0x1000);
flip_screen_set(space->machine, armedf_vreg & 0x1000);
if ((armedf_vreg & 0x4000) && !(armedf_vreg & 0x0100))
@ -203,7 +203,7 @@ static WRITE16_HANDLER( kodure_io_w )
COMBINE_DATA(&armedf_vreg);
/* bits 0 and 1 of armedf_vreg are coin counters */
/* bit 12 seems to handle screen flipping */
flip_screen_set(armedf_vreg & 0x1000);
flip_screen_set(space->machine, armedf_vreg & 0x1000);
/* This is a temporary condition specification. */
if (!(armedf_vreg & 0x0080))

View File

@ -91,7 +91,7 @@ static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectang
{
int offs;
flip_screen_set_no_update(1);
flip_screen_set_no_update(machine, 1);
for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
{
@ -141,7 +141,7 @@ static void draw_sprites(running_machine *machine,bitmap_t *bitmap,const rectang
inc = 1;
}
if (flip_screen_x_get())
if (flip_screen_x_get(machine))
{
y=240-y;
x=304-x;

View File

@ -62,7 +62,6 @@ DIP locations verified for:
#include "driver.h"
#include "cpu/z80/z80.h"
#include "deprecat.h"
#include "sound/ay8910.h"
#include "sound/5110intf.h"
#include "sound/tms5110.h"
@ -106,9 +105,9 @@ static void reset_talking (const address_space *space)
}
static int bagman_speech_rom_read_bit(void)
static int bagman_speech_rom_read_bit(const device_config *device)
{
UINT8 *ROM = memory_region(Machine, "speech");
UINT8 *ROM = memory_region(device->machine, "speech");
int bit_no = (ls259_buf[0]<<2) | (ls259_buf[1]<<1) | (ls259_buf[2]<<0);
int byte = 0;

View File

@ -46,7 +46,7 @@ static WRITE8_HANDLER( battlane_cpu_command_w )
0x01 = Y Scroll MSB
*/
flip_screen_set(data & 0x80);
flip_screen_set(space->machine, data & 0x80);
/*
I think that the NMI is an inhibitor. It is constantly set

View File

@ -288,7 +288,7 @@ static WRITE16_HANDLER( sound_command_w )
static WRITE16_HANDLER( io_w )
{
COMBINE_DATA(&vreg);
flip_screen_set(vreg & 0x1000);
flip_screen_set(space->machine, vreg & 0x1000);
}
static int read_latch=0;

View File

@ -43,7 +43,7 @@ static WRITE8_HANDLER( bogeyman_8910_control_w )
static int last;
// bit 0 is flipscreen
flip_screen_set(data & 0x01);
flip_screen_set(space->machine, data & 0x01);
// bit 5 goes to 8910 #0 BDIR pin
if ((last & 0x20) == 0x20 && (data & 0x20) == 0x00)

View File

@ -142,7 +142,7 @@ static VIDEO_UPDATE( calorie )
ypos = 0xff - calorie_sprites[x+2];
xpos = calorie_sprites[x+3];
if(flip_screen_get())
if(flip_screen_get(screen->machine))
{
if( calorie_sprites[x+1] & 0x10 )
ypos = 0xff - ypos + 32;
@ -186,7 +186,7 @@ static WRITE8_HANDLER( calorie_bg_w )
static WRITE8_HANDLER( calorie_flipscreen_w )
{
flip_screen_set(data & 1);
flip_screen_set(space->machine, data & 1);
}
static READ8_HANDLER( calorie_soundlatch_r )

View File

@ -55,7 +55,6 @@ Notes:
*/
#include "driver.h"
#include "deprecat.h"
#include "video/ppu2c0x.h"
#include "sound/nes_apu.h"
#include "cpu/m6502/m6502.h"
@ -214,9 +213,9 @@ static PALETTE_INIT( cham24 )
ppu2c0x_init_palette(machine, 0 );
}
static void ppu_irq( int num, int *ppu_regs )
static void ppu_irq( running_machine *machine, int num, int *ppu_regs )
{
cpu_set_input_line(Machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
cpu_set_input_line(machine->cpu[num], INPUT_LINE_NMI, PULSE_LINE );
}
/* our ppu interface */

View File

@ -126,7 +126,7 @@ static WRITE8_HANDLER( chinagat_video_ctrl_w )
ddragon_scrolly_hi = ( ( data & 0x02 ) << 7 );
ddragon_scrollx_hi = ( ( data & 0x01 ) << 8 );
flip_screen_set(~data & 0x04);
flip_screen_set(space->machine, ~data & 0x04);
}
static WRITE8_HANDLER( chinagat_bankswitch_w )

View File

@ -25,7 +25,7 @@ VIDEO_START( citycon );
static READ8_HANDLER( citycon_in_r )
{
return input_port_read(space->machine, flip_screen_get() ? "P2" : "P1");
return input_port_read(space->machine, flip_screen_get(space->machine) ? "P2" : "P1");
}

View File

@ -44,7 +44,7 @@ WRITE8_HANDLER( wiping_sound_w );
static MACHINE_RESET( clshroad )
{
flip_screen_set(0);
flip_screen_set(machine, 0);
}

View File

@ -433,7 +433,7 @@ static WRITE8_HANDLER(scrivi)
{
rotation_sign = !(data & 1);
flip_screen_set(!(data & 4));
flip_screen_set(space->machine, !(data & 4));
scrolly_hi = (data & 0xf0) << 4;

View File

@ -373,7 +373,7 @@ static MACHINE_RESET( cojag )
jaguardsp_ctrl_w(machine->cpu[2], D_CTRL, 0, 0xffffffff);
/* init the sound system */
cojag_sound_reset();
cojag_sound_reset(machine);
/* reset the IDE controller */
devtag_reset(machine, IDE_CONTROLLER, "ide");

View File

@ -462,7 +462,7 @@ static READ8_HANDLER( nomnlnd_port_0_1_r )
static WRITE8_HANDLER( flip_screen_w )
{
flip_screen_set(data&0x80);
flip_screen_set(space->machine, data&0x80);
}

View File

@ -54,9 +54,9 @@ static void pc3092_reset(void)
}
static void pc3092_update(void)
static void pc3092_update(running_machine *machine)
{
flip_screen_set((pc3092_data[1] & 0x01) ? TRUE : FALSE);
flip_screen_set(machine, (pc3092_data[1] & 0x01) ? TRUE : FALSE);
}
@ -66,7 +66,7 @@ static WRITE8_HANDLER( pc3092_w )
if (LOG_PC3092) logerror("%04X: write PC3092 #%d = 0x%02x\n", cpu_get_pc(space->cpu), offset, pc3092_data[offset]);
pc3092_update();
pc3092_update(space->machine);
}

View File

@ -83,7 +83,6 @@ Hardware Info
***************************************************************************/
#include "driver.h"
#include "deprecat.h"
#include "cpu/s2650/s2650.h"
#include "sound/dac.h"
#include "sound/5110intf.h"
@ -252,10 +251,10 @@ static INTERRUPT_GEN( cvs_main_cpu_interrupt )
}
static void cvs_dac_cpu_interrupt(void)
static void cvs_dac_cpu_interrupt(running_machine *machine)
{
cpu_set_input_line_vector(Machine->cpu[CVS_DAC_CPU_INDEX], 0, 0x03);
cpu_set_input_line(Machine->cpu[CVS_DAC_CPU_INDEX], 0, HOLD_LINE);
cpu_set_input_line_vector(machine->cpu[CVS_DAC_CPU_INDEX], 0, 0x03);
cpu_set_input_line(machine->cpu[CVS_DAC_CPU_INDEX], 0, HOLD_LINE);
}
@ -432,13 +431,14 @@ static WRITE8_HANDLER( cvs_tms5110_pdc_w )
}
static int speech_rom_read_bit(void)
static int speech_rom_read_bit(const device_config *device)
{
UINT8 *ROM = memory_region(Machine, "speechdata");
int bit;
running_machine *machine = device->machine;
UINT8 *ROM = memory_region(machine, "speechdata");
int bit;
/* before reading the bit, clamp the address to the region length */
speech_rom_bit_address = speech_rom_bit_address & ((memory_region_length(Machine, "speechdata") * 8) - 1);
speech_rom_bit_address = speech_rom_bit_address & ((memory_region_length(machine, "speechdata") * 8) - 1);
bit = (ROM[speech_rom_bit_address >> 3] >> (speech_rom_bit_address & 0x07)) & 0x01;
/* prepare for next bit */
@ -468,7 +468,7 @@ static WRITE8_HANDLER( audio_command_w )
if (data & 0x80)
{
soundlatch_w(space, 0, data);
cvs_dac_cpu_interrupt();
cvs_dac_cpu_interrupt(space->machine);
LOG(("%04x : CVS: Audio command = %02x\n", cpu_get_pc(space->cpu), data));
}

View File

@ -55,7 +55,7 @@ static WRITE8_HANDLER( bg_bank_w )
tilemap_mark_all_tiles_dirty(bg_tilemap);
}
flip_screen_set(data & 0xc); // probably one bit for flipx and one for flipy
flip_screen_set(space->machine, data & 0xc); // probably one bit for flipx and one for flipy
}
@ -317,7 +317,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = (spriteram[offs+3] - 128) + 256 * (attr & 0x01);
sy = 248 - spriteram[offs];
if (flip_screen_get())
if (flip_screen_get(machine))
{
sx = 240 - sx;
sy = 240 - sy;

View File

@ -104,7 +104,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
if (flip_screen_get())
if (flip_screen_get(machine))
{
y=240-y;
x=304-x;
@ -154,7 +154,7 @@ static VIDEO_START(dblewing)
static VIDEO_UPDATE(dblewing)
{
flip_screen_set( deco16_pf12_control[0]&0x80 );
flip_screen_set(screen->machine, deco16_pf12_control[0]&0x80 );
deco16_pf12_update(deco16_pf1_rowscroll,deco16_pf2_rowscroll);
bitmap_fill(bitmap,cliprect,0); /* not Confirmed */

View File

@ -216,7 +216,7 @@ static WRITE8_HANDLER( ddragon_bankswitch_w )
{
ddragon_scrollx_hi = ((data & 0x01) << 8);
ddragon_scrolly_hi = ((data & 0x02) << 7);
flip_screen_set(~data & 0x04);
flip_screen_set(space->machine, ~data & 0x04);
/* bit 3 unknown */
@ -234,7 +234,7 @@ static WRITE8_HANDLER( toffy_bankswitch_w )
ddragon_scrollx_hi = ((data & 0x01) << 8);
ddragon_scrolly_hi = ((data & 0x02) << 7);
// flip_screen_set(~data & 0x04);
// flip_screen_set(space->machine, ~data & 0x04);
/* bit 3 unknown */
@ -291,7 +291,7 @@ static WRITE8_HANDLER( darktowr_bankswitch_w )
ddragon_scrollx_hi = ((data & 0x01) << 8);
ddragon_scrolly_hi = ((data & 0x02) << 7);
// flip_screen_set(~data & 0x04);
// flip_screen_set(space->machine, ~data & 0x04);
/* bit 3 unknown */

View File

@ -368,7 +368,7 @@ static WRITE8_HANDLER( ghostb_bank_w )
if (data&1) int_enable=1; else int_enable=0;
if (data&2) nmi_enable=1; else nmi_enable=0;
flip_screen_set(data & 0x08);
flip_screen_set(space->machine, data & 0x08);
}
static WRITE8_HANDLER( csilver_control_w )
@ -494,7 +494,7 @@ static WRITE8_HANDLER( shackled_int_w )
static READ8_HANDLER( shackled_sprite_r ) { return spriteram[offset]; }
static WRITE8_HANDLER( shackled_sprite_w ) { spriteram[offset]=data; }
static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(data); }
static WRITE8_HANDLER( flip_screen_w ) { flip_screen_set(space->machine, data); }
/******************************************************************************/

View File

@ -61,7 +61,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
{
int offs;
flip_screen_set_no_update(1);
flip_screen_set_no_update(machine, 1);
for (offs = (0x1400/4)-4;offs >= 0;offs -= 4) // 0x1400 for charlien
{
@ -107,7 +107,7 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectan
inc = 1;
}
if (flip_screen_x_get())
if (flip_screen_x_get(machine))
{
y=240-y;
x=304-x;

View File

@ -50,21 +50,21 @@ static void draw_sprites(running_machine *machine, bitmap_t *bitmap, const recta
sx = spriteram[offs];
sy = 248 - spriteram[offs + 1];
if (flip_screen_x_get()) sx = 248 - sx;
if (flip_screen_y_get()) sy = 248 - sy;
if (flip_screen_x_get(machine)) sx = 248 - sx;
if (flip_screen_y_get(machine)) sy = 248 - sy;
code = spriteram[offs + 3] + ((spriteram[offs + 2] & 0x03) << 8) ;
drawgfx(bitmap,machine->gfx[0],
2 * code,
((spriteram[offs + 2] & 0xf8) >> 3) ,
flip_screen_x_get(),flip_screen_y_get(),
sx,sy + (flip_screen_y_get() ? 8 : -8),
flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy + (flip_screen_y_get(machine) ? 8 : -8),
cliprect,TRANSPARENCY_PEN,0);
drawgfx(bitmap,machine->gfx[0],
2 * code + 1,
((spriteram[offs + 2] & 0xf8) >> 3) ,
flip_screen_x_get(),flip_screen_y_get(),
flip_screen_x_get(machine),flip_screen_y_get(machine),
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}

Some files were not shown because too many files have changed in this diff Show More