Go to file
Aaron Giles c85c035c5d (Wow, I had no idea quite so many drivers were using driver_data!)
Defined new class driver_data_t, which all driver_data classes must
derive from. Updated all class definitions to inherit from the new
class, and to call it in the constructor. Also changed the alloc()
signature to return a driver_data_t pointer instead of a void *.

Renamed and hid machine->driver_data as machine->m_driver_data.
Added a new templatized method machine->driver_data<class> which returns
a properly downcast'ed version of the driver data. Updated all code
which looked like this:

  mydriver_state *state = (mydriver_state *)machine->driver_data;

to this:

  mydriver_state *state = machine->driver_data<mydriver_state>();

The new function does a downcast<> which in debug builds dynamically
verifies that you're actually casting to the right type.

Changed atarigen_state to be a base class from which all the related
Atari drivers derive their state from.

For MESS: this was mostly a bulk search/replace, in 4 steps in
src/mame:

1. Add ": public driver_data_t" to each driver state class definition:

Search:  (class [a-z0-9_]+_state)$
Replace: \1 : public driver_data_t

2. Change the static alloc function to return a driver_data_t *:

Search:  static void \*alloc\(
Replace: static driver_data_t \*alloc\(

3. Change the constructor to initialize driver_data_t:

Search:  ([a-z0-9_]+_state\(running_machine \&machine\)) { }
Replace: \1\r\n\t\t: driver_data_t(machine) { }

4. Replace the state fetchers to use the new templatized function:

Search:  \(([a-z0-9_]+_state) \*\)(.*)machine->driver_data
Replace: \2machine->driver_data<\1>()
2010-08-04 15:37:08 +00:00
docs Changed behavior of -watchdog option to act like a real watchdog. It now 2009-12-24 02:52:17 +00:00
src (Wow, I had no idea quite so many drivers were using driver_data!) 2010-08-04 15:37:08 +00:00
.gitattributes The dsp561xx CPU core now generates accurate disassembly for Konami Polygonet hardware 2010-08-04 05:11:00 +00:00
makefile Created CPU-specific device types for all CPUs, using new macros 2010-07-03 00:12:44 +00:00