summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/jangou.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-02-25 06:28:03 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-02-25 06:28:03 +0000
commitcfa887f3de933df22134893751072819c7aa1e02 (patch)
tree7e048056ee2487e7a98d54eeb93a15f052a59746 /src/mame/drivers/jangou.c
parentcff01e5501239ea93293e26b28b04b915d4d0c1c (diff)
Changed all driver_data structs into classes with a simple
constructor and a static allocation function. Changed MDRV_DRIVER_DATA to reference driver_data::alloc instead of just providing a size. This function is called to allocate the driver data. This allows objects to be embedded in the state data and be properly initialized. Ideally, new driver_data constructors should perform initialization actions in the constructor, but for now most just use auto_alloc_clear() to blast everything to zero. Moved driver data allocation after device list construction so that devices can be found when the driver data is constructed.
Diffstat (limited to 'src/mame/drivers/jangou.c')
-rw-r--r--src/mame/drivers/jangou.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mame/drivers/jangou.c b/src/mame/drivers/jangou.c
index 79c1cd16215..6fc8d9710b8 100644
--- a/src/mame/drivers/jangou.c
+++ b/src/mame/drivers/jangou.c
@@ -33,9 +33,13 @@ $c088-$c095 player tiles
#define MASTER_CLOCK XTAL_19_968MHz
-typedef struct _jangou_state jangou_state;
-struct _jangou_state
+class jangou_state
{
+public:
+ static void *alloc(running_machine &machine) { return auto_alloc_clear(&machine, jangou_state(machine)); }
+
+ jangou_state(running_machine &machine) { }
+
/* video-related */
UINT8 *blit_buffer;
UINT8 pen_data[0x10];