From dbd1965d0e1005b9a11c8b7989e8f32338fe9a88 Mon Sep 17 00:00:00 2001 From: Couriersud Date: Wed, 5 Mar 2008 22:01:37 +0000 Subject: [PATCH] * pass running_machine parameter to construct_map_##_name, i.e. ADDRESS_MAP_START * Change "Machine->" to "machine->" in AM_BASE_MEMBER, AM_SIZE_MEMBER * Pass Machine in construct_address_map This is not perfect yet, but there is no need any longer to include deprecat.h in drivers using AM_*_MEMBER. --- src/emu/memory.c | 6 +++--- src/emu/memory.h | 14 +++++++------- src/emu/render.c | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/emu/memory.c b/src/emu/memory.c index e101d51c733..30e0c49dbd3 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -1205,13 +1205,13 @@ void construct_address_map(address_map *map, const machine_config *drv, int cpun /* start by constructing the internal CPU map */ if (internal_map) - map = (*internal_map)(map); + map = (*internal_map)(Machine, map); /* construct the standard map */ if (drv->cpu[cpunum].construct_map[spacenum][0]) - map = (*drv->cpu[cpunum].construct_map[spacenum][0])(map); + map = (*drv->cpu[cpunum].construct_map[spacenum][0])(Machine, map); if (drv->cpu[cpunum].construct_map[spacenum][1]) - map = (*drv->cpu[cpunum].construct_map[spacenum][1])(map); + map = (*drv->cpu[cpunum].construct_map[spacenum][1])(Machine, map); } diff --git a/src/emu/memory.h b/src/emu/memory.h index 5892b36b407..08ab44068f5 100644 --- a/src/emu/memory.h +++ b/src/emu/memory.h @@ -608,15 +608,15 @@ struct _address_space void construct_address_map(address_map *map, const machine_config *drv, int cpunum, int spacenum); /* ----- a typedef for pointers to these functions ----- */ -typedef address_map *(*construct_map_t)(address_map *map); +typedef address_map *(*construct_map_t)(running_machine *machine, address_map *map); /* use this to declare external references to a machine driver */ #define ADDRESS_MAP_EXTERN(_name) \ -address_map *construct_map_##_name(address_map *map) \ +address_map *construct_map_##_name(running_machine *machine, address_map *map) \ /* ----- macros for starting, ending, and setting map flags ----- */ #define ADDRESS_MAP_START(_name,_space,_bits) \ -address_map *construct_map_##_name(address_map *map) \ +address_map *construct_map_##_name(running_machine *machine, address_map *map) \ { \ extern read##_bits##_machine_func port_tag_to_handler##_bits(const char *); \ typedef read##_bits##_machine_func _rmf_t; \ @@ -700,15 +700,15 @@ address_map *construct_map_##_name(address_map *map) \ map->base = (void **)(base = _base); \ #define AM_BASE_MEMBER(_struct, _member) \ - if (Machine != NULL && Machine->driver_data != NULL) \ - map->base = (void **)(base = &((_struct *)Machine->driver_data)->_member);\ + if (machine != NULL && machine->driver_data != NULL) \ + map->base = (void **)(base = &((_struct *)machine->driver_data)->_member);\ #define AM_SIZE(_size) \ map->size = _size; \ #define AM_SIZE_MEMBER(_struct, _member) \ - if (Machine != NULL && Machine->driver_data != NULL) \ - map->size = &((_struct *)Machine->driver_data)->_member; \ + if (machine != NULL && machine->driver_data != NULL) \ + map->size = &((_struct *)machine->driver_data)->_member; \ /* ----- common shortcuts ----- */ #define AM_READWRITE(_read,_write) AM_READ(_read) AM_WRITE(_write) diff --git a/src/emu/render.c b/src/emu/render.c index d2ff3e85717..f1707225d0e 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -1940,10 +1940,10 @@ static int remove_clear_extent(const render_bounds *bounds) INT32 *max = &clear_extents[MAX_CLEAR_EXTENTS]; INT32 *last = &clear_extents[clear_extent_count]; INT32 *ext = &clear_extents[0]; - INT32 boundsx0 = ceil(bounds->x0); - INT32 boundsx1 = floor(bounds->x1); - INT32 boundsy0 = ceil(bounds->y0); - INT32 boundsy1 = floor(bounds->y1); + INT32 boundsx0 = (UINT32) ceil(bounds->x0); + INT32 boundsx1 = (INT32) floor(bounds->x1); + INT32 boundsy0 = (INT32) ceil(bounds->y0); + INT32 boundsy1 = (INT32) floor(bounds->y1); INT32 y0, y1 = 0; /* loop over Y extents */