From a300da217858eca134d8123bc40de809128b7bff Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 22 May 2008 03:23:28 +0000 Subject: From: Atari Ace [mailto:atari_ace@verizon.net] Subject: [patch] More Machine->machine changes, add machine to irq callbacks Hi mamedev, Here are two more patches to eliminate Machine globals. The first patch was autogenerated by the attached fixup script. That script has been updated to catch additional cases which it previously missed (when Machine is the last parameter to a function or Machine is used in an assignment). This makes ~50 more files deprecat.h free. A sizable chunk (~20%) of the remaining uses of the Machine global in the drivers are due to irq callbacks for sound and machine updates. Typically such callbacks need to call cpunum_set_input_line, which requires a machine parameter, so if the callbacks don't pass the machine parameter, these routines have no choice but to reference the global variable. The second patch attempts to address most cases of this by adding the machine parameter to the callback interfaces. This allows us to remove #include "deprecat.h" from ~150 files, at the cost of having to fix up hundreds of callbacks. In total, these patches reduced the number of files with deprecat.h from 783 to 575. ~aa --- src/emu/sound/es5506.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/emu/sound/es5506.h') diff --git a/src/emu/sound/es5506.h b/src/emu/sound/es5506.h index 7d8e247e49f..ea74b6eb3d4 100644 --- a/src/emu/sound/es5506.h +++ b/src/emu/sound/es5506.h @@ -12,7 +12,7 @@ struct ES5505interface { int region0; /* memory region where the sample ROM lives */ int region1; /* memory region where the sample ROM lives */ - void (*irq_callback)(int state); /* irq callback */ + void (*irq_callback)(running_machine *machine, int state); /* irq callback */ UINT16 (*read_port)(void); /* input port read */ }; @@ -33,7 +33,7 @@ struct ES5506interface int region1; /* memory region where the sample ROM lives */ int region2; /* memory region where the sample ROM lives */ int region3; /* memory region where the sample ROM lives */ - void (*irq_callback)(int state); /* irq callback */ + void (*irq_callback)(running_machine *machine, int state); /* irq callback */ UINT16 (*read_port)(void); /* input port read */ }; -- cgit v1.2.3-70-g09d2