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/2151intf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/emu/sound/2151intf.h') diff --git a/src/emu/sound/2151intf.h b/src/emu/sound/2151intf.h index 6312a296c48..66bab7708ce 100644 --- a/src/emu/sound/2151intf.h +++ b/src/emu/sound/2151intf.h @@ -3,7 +3,7 @@ struct YM2151interface { - void (*irqhandler)(int irq); + void (*irqhandler)(running_machine *machine, int irq); write8_machine_func portwritehandler; }; -- cgit v1.2.3-70-g09d2