Many casts added to the core files, and various other tweaks

to make them compile as either C or C++.
This commit is contained in:
Aaron Giles 2009-03-12 07:43:03 +00:00
parent feb4e2c8b3
commit eb539cce9d
116 changed files with 751 additions and 732 deletions

View File

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
fseek(src, 0, SEEK_SET); fseek(src, 0, SEEK_SET);
/* allocate memory */ /* allocate memory */
buffer = malloc(bytes + 1); buffer = (unsigned char *)malloc(bytes + 1);
if (buffer == NULL) if (buffer == NULL)
{ {
fprintf(stderr, "Out of memory allocating %d byte buffer\n", bytes); fprintf(stderr, "Out of memory allocating %d byte buffer\n", bytes);

View File

@ -128,10 +128,10 @@ static int render_font_save_cached(render_font *font, const char *filename, UINT
numchars++; numchars++;
/* allocate an array to hold the character data */ /* allocate an array to hold the character data */
chartable = malloc(numchars * CACHED_CHAR_SIZE); chartable = (UINT8 *)malloc(numchars * CACHED_CHAR_SIZE);
/* allocate a temp buffer to compress into */ /* allocate a temp buffer to compress into */
tempbuffer = malloc(65536); tempbuffer = (UINT8 *)malloc(65536);
if (chartable == NULL || tempbuffer == NULL) if (chartable == NULL || tempbuffer == NULL)
goto error; goto error;
@ -405,7 +405,7 @@ int main(int argc, char *argv[])
bdcname = argv[argc - 1]; bdcname = argv[argc - 1];
/* allocate a font */ /* allocate a font */
font = malloc(sizeof(*font)); font = (render_font *)malloc(sizeof(*font));
if (font == NULL) if (font == NULL)
return 1; return 1;
memset(font, 0, sizeof(*font)); memset(font, 0, sizeof(*font));

View File

@ -233,7 +233,7 @@ int main(int argc, char *argv[])
fseek(f, 0, SEEK_SET); fseek(f, 0, SEEK_SET);
// allocate a buffer // allocate a buffer
buffer = malloc(size + 1); buffer = (char *)malloc(size + 1);
if (buffer == NULL) if (buffer == NULL)
{ {
fclose(f); fclose(f);

View File

@ -82,7 +82,7 @@ int audit_images(core_options *options, const game_driver *gamedrv, UINT32 valid
if (records > 0) if (records > 0)
{ {
/* allocate memory for the records */ /* allocate memory for the records */
*audit = malloc_or_die(sizeof(**audit) * records); *audit = (audit_record *)malloc_or_die(sizeof(**audit) * records);
memset(*audit, 0, sizeof(**audit) * records); memset(*audit, 0, sizeof(**audit) * records);
record = *audit; record = *audit;
@ -163,7 +163,7 @@ int audit_samples(core_options *options, const game_driver *gamedrv, audit_recor
goto skip; goto skip;
/* allocate memory for the records */ /* allocate memory for the records */
*audit = malloc_or_die(sizeof(**audit) * records); *audit = (audit_record *)malloc_or_die(sizeof(**audit) * records);
memset(*audit, 0, sizeof(**audit) * records); memset(*audit, 0, sizeof(**audit) * records);
record = *audit; record = *audit;

View File

@ -82,6 +82,7 @@ enum _script_state
SCRIPT_STATE_COUNT SCRIPT_STATE_COUNT
}; };
typedef enum _script_state script_state; typedef enum _script_state script_state;
DECLARE_ENUM_OPERATORS(script_state)
@ -265,7 +266,7 @@ void cheat_init(running_machine *machine)
add_exit_callback(machine, cheat_exit); add_exit_callback(machine, cheat_exit);
/* allocate memory */ /* allocate memory */
cheatinfo = auto_malloc(sizeof(*cheatinfo)); cheatinfo = (cheat_private *)auto_malloc(sizeof(*cheatinfo));
memset(cheatinfo, 0, sizeof(*cheatinfo)); memset(cheatinfo, 0, sizeof(*cheatinfo));
machine->cheat_data = cheatinfo; machine->cheat_data = cheatinfo;
@ -343,7 +344,7 @@ void cheat_render_text(running_machine *machine)
void *cheat_get_next_menu_entry(running_machine *machine, void *previous, const char **description, const char **state, UINT32 *flags) void *cheat_get_next_menu_entry(running_machine *machine, void *previous, const char **description, const char **state, UINT32 *flags)
{ {
cheat_private *cheatinfo = machine->cheat_data; cheat_private *cheatinfo = machine->cheat_data;
cheat_entry *preventry = previous; cheat_entry *preventry = (cheat_entry *)previous;
cheat_entry *cheat; cheat_entry *cheat;
/* NULL previous means get the first */ /* NULL previous means get the first */
@ -455,7 +456,7 @@ void *cheat_get_next_menu_entry(running_machine *machine, void *previous, const
int cheat_activate(running_machine *machine, void *entry) int cheat_activate(running_machine *machine, void *entry)
{ {
cheat_private *cheatinfo = machine->cheat_data; cheat_private *cheatinfo = machine->cheat_data;
cheat_entry *cheat = entry; cheat_entry *cheat = (cheat_entry *)entry;
int changed = FALSE; int changed = FALSE;
/* if we have no parameter and no run or off script, but we do have an on script, it's a oneshot cheat */ /* if we have no parameter and no run or off script, but we do have an on script, it's a oneshot cheat */
@ -479,7 +480,7 @@ int cheat_activate(running_machine *machine, void *entry)
int cheat_select_default_state(running_machine *machine, void *entry) int cheat_select_default_state(running_machine *machine, void *entry)
{ {
cheat_private *cheatinfo = machine->cheat_data; cheat_private *cheatinfo = machine->cheat_data;
cheat_entry *cheat = entry; cheat_entry *cheat = (cheat_entry *)entry;
int changed = FALSE; int changed = FALSE;
/* if we have no parameter and no run or off script, it's either text or a oneshot cheat */ /* if we have no parameter and no run or off script, it's either text or a oneshot cheat */
@ -508,7 +509,7 @@ int cheat_select_default_state(running_machine *machine, void *entry)
int cheat_select_previous_state(running_machine *machine, void *entry) int cheat_select_previous_state(running_machine *machine, void *entry)
{ {
cheat_private *cheatinfo = machine->cheat_data; cheat_private *cheatinfo = machine->cheat_data;
cheat_entry *cheat = entry; cheat_entry *cheat = (cheat_entry *)entry;
int changed = FALSE; int changed = FALSE;
/* if we have no parameter and no run or off script, it's either text or a oneshot cheat */ /* if we have no parameter and no run or off script, it's either text or a oneshot cheat */
@ -584,7 +585,7 @@ int cheat_select_previous_state(running_machine *machine, void *entry)
int cheat_select_next_state(running_machine *machine, void *entry) int cheat_select_next_state(running_machine *machine, void *entry)
{ {
cheat_private *cheatinfo = machine->cheat_data; cheat_private *cheatinfo = machine->cheat_data;
cheat_entry *cheat = entry; cheat_entry *cheat = (cheat_entry *)entry;
int changed = FALSE; int changed = FALSE;
/* if we have no parameter and no run or off script, it's a oneshot cheat */ /* if we have no parameter and no run or off script, it's a oneshot cheat */
@ -937,7 +938,7 @@ static cheat_entry *cheat_entry_load(running_machine *machine, const char *filen
} }
/* allocate memory for the cheat */ /* allocate memory for the cheat */
cheat = malloc_or_die(sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar)); cheat = (cheat_entry *)malloc_or_die(sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar));
memset(cheat, 0, sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar)); memset(cheat, 0, sizeof(*cheat) + (tempcount - 1) * sizeof(cheat->tempvar));
cheat->numtemp = tempcount; cheat->numtemp = tempcount;
@ -1108,7 +1109,7 @@ static cheat_parameter *cheat_parameter_load(const char *filename, xml_data_node
cheat_parameter *param; cheat_parameter *param;
/* allocate memory for it */ /* allocate memory for it */
param = malloc_or_die(sizeof(*param)); param = (cheat_parameter *)malloc_or_die(sizeof(*param));
memset(param, 0, sizeof(*param)); memset(param, 0, sizeof(*param));
/* read the core attributes */ /* read the core attributes */
@ -1126,7 +1127,7 @@ static cheat_parameter *cheat_parameter_load(const char *filename, xml_data_node
parameter_item *curitem; parameter_item *curitem;
/* allocate memory for it */ /* allocate memory for it */
curitem = malloc_or_die(sizeof(*curitem)); curitem = (parameter_item *)malloc_or_die(sizeof(*curitem));
memset(curitem, 0, sizeof(*curitem)); memset(curitem, 0, sizeof(*curitem));
/* check for NULL text */ /* check for NULL text */
@ -1237,7 +1238,7 @@ static cheat_script *cheat_script_load(running_machine *machine, const char *fil
const char *state; const char *state;
/* allocate memory for it */ /* allocate memory for it */
script = malloc_or_die(sizeof(*script)); script = (cheat_script *)malloc_or_die(sizeof(*script));
memset(script, 0, sizeof(*script)); memset(script, 0, sizeof(*script));
/* read the core attributes */ /* read the core attributes */
@ -1352,7 +1353,7 @@ static script_entry *script_entry_load(running_machine *machine, const char *fil
EXPRERR experr; EXPRERR experr;
/* allocate memory for it */ /* allocate memory for it */
entry = malloc_or_die(sizeof(*entry)); entry = (script_entry *)malloc_or_die(sizeof(*entry));
memset(entry, 0, sizeof(*entry)); memset(entry, 0, sizeof(*entry));
/* read the condition if present */ /* read the condition if present */
@ -1422,7 +1423,7 @@ static script_entry *script_entry_load(running_machine *machine, const char *fil
output_argument *curarg; output_argument *curarg;
/* allocate memory for it */ /* allocate memory for it */
curarg = malloc_or_die(sizeof(*curarg)); curarg = (output_argument *)malloc_or_die(sizeof(*curarg));
memset(curarg, 0, sizeof(*curarg)); memset(curarg, 0, sizeof(*curarg));
/* first extract attributes */ /* first extract attributes */

View File

@ -440,7 +440,7 @@ int cli_info_listclones(core_options *options, const char *gamename)
int cli_info_listbrothers(core_options *options, const char *gamename) int cli_info_listbrothers(core_options *options, const char *gamename)
{ {
UINT8 *didit = malloc_or_die(driver_list_get_count(drivers)); UINT8 *didit = (UINT8 *)malloc_or_die(driver_list_get_count(drivers));
astring *filename = astring_alloc(); astring *filename = astring_alloc();
int drvindex, count = 0; int drvindex, count = 0;
@ -954,7 +954,7 @@ static void identify_data(const char *name, const UINT8 *data, int length, romid
{ {
/* now determine the new data length and allocate temporary memory for it */ /* now determine the new data length and allocate temporary memory for it */
length = jedbin_output(&jed, NULL, 0); length = jedbin_output(&jed, NULL, 0);
tempjed = malloc(length); tempjed = (UINT8 *)malloc(length);
if (tempjed == NULL) if (tempjed == NULL)
return; return;

View File

@ -92,7 +92,7 @@ void config_register(running_machine *machine, const char *nodename, config_call
config_type **ptype; config_type **ptype;
/* allocate a new type */ /* allocate a new type */
newtype = auto_malloc(sizeof(*newtype)); newtype = (config_type *)auto_malloc(sizeof(*newtype));
newtype->next = NULL; newtype->next = NULL;
newtype->name = nodename; newtype->name = nodename;
newtype->load = load; newtype->load = load;

View File

@ -631,7 +631,7 @@ static void adjust_timer_interrupt(hyperstone_state *cpustate)
static TIMER_CALLBACK( e132xs_timer_callback ) static TIMER_CALLBACK( e132xs_timer_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
hyperstone_state *cpustate = device->token; hyperstone_state *cpustate = device->token;
int update = param; int update = param;

View File

@ -808,7 +808,7 @@ static void add_opcode_output_table_entry(opcode_struct* op, char* name)
*/ */
static int DECL_SPEC compare_nof_true_bits(const void* aptr, const void* bptr) static int DECL_SPEC compare_nof_true_bits(const void* aptr, const void* bptr)
{ {
const opcode_struct *a = aptr, *b = bptr; const opcode_struct *a = (const opcode_struct *)aptr, *b = (const opcode_struct *)bptr;
if(a->bits != b->bits) if(a->bits != b->bits)
return a->bits - b->bits; return a->bits - b->bits;
if(a->op_mask != b->op_mask) if(a->op_mask != b->op_mask)
@ -863,7 +863,7 @@ static void set_opcode_struct(opcode_struct* src, opcode_struct* dst, int ea_mod
static void generate_opcode_handler(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* opinfo, int ea_mode) static void generate_opcode_handler(FILE* filep, body_struct* body, replace_struct* replace, opcode_struct* opinfo, int ea_mode)
{ {
char str[MAX_LINE_LENGTH+1]; char str[MAX_LINE_LENGTH+1];
opcode_struct* op = malloc(sizeof(opcode_struct)); opcode_struct* op = (opcode_struct *)malloc(sizeof(opcode_struct));
/* Set the opcode structure and write the tables, prototypes, etc */ /* Set the opcode structure and write the tables, prototypes, etc */
set_opcode_struct(opinfo, op, ea_mode); set_opcode_struct(opinfo, op, ea_mode);
@ -956,7 +956,7 @@ static void generate_opcode_cc_variants(FILE* filep, body_struct* body, replace_
char replnot[20]; char replnot[20];
int i; int i;
int old_length = replace->length; int old_length = replace->length;
opcode_struct* op = malloc(sizeof(opcode_struct)); opcode_struct* op = (opcode_struct *)malloc(sizeof(opcode_struct));
*op = *op_in; *op = *op_in;
@ -995,8 +995,8 @@ static void process_opcode_handlers(FILE* filep)
char oper_spec_proc[MAX_LINE_LENGTH+1]; char oper_spec_proc[MAX_LINE_LENGTH+1];
char oper_spec_ea[MAX_LINE_LENGTH+1]; char oper_spec_ea[MAX_LINE_LENGTH+1];
opcode_struct* opinfo; opcode_struct* opinfo;
replace_struct* replace = malloc(sizeof(replace_struct)); replace_struct* replace = (replace_struct*)malloc(sizeof(replace_struct));
body_struct* body = malloc(sizeof(body_struct)); body_struct* body = (body_struct*)malloc(sizeof(body_struct));
for(;;) for(;;)
{ {

View File

@ -1192,7 +1192,7 @@ UINT8 upi41_master_r(const device_config *device, UINT8 a0)
static TIMER_CALLBACK( master_callback ) static TIMER_CALLBACK( master_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
mcs48_state *cpustate = device->token; mcs48_state *cpustate = device->token;
UINT8 a0 = (param >> 8) & 1; UINT8 a0 = (param >> 8) & 1;
UINT8 data = param; UINT8 data = param;

View File

@ -706,7 +706,7 @@ void mips3com_get_info(mips3_state *mips, UINT32 state, cpuinfo *info)
static TIMER_CALLBACK( compare_int_callback ) static TIMER_CALLBACK( compare_int_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
cpu_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE); cpu_set_input_line(device, MIPS3_IRQ5, ASSERT_LINE);
} }

View File

@ -101,7 +101,7 @@ static char *sconcat(char *dest, const char *src)
char *r; char *r;
int len = strlen(src); int len = strlen(src);
int pos = dest ? strlen(dest) : 0; int pos = dest ? strlen(dest) : 0;
r = realloc(dest, pos+len+2); r = (char *)realloc(dest, pos+len+2);
memcpy(r + pos, src, len); memcpy(r + pos, src, len);
r[pos+len] = '\n'; r[pos+len] = '\n';
r[pos+len+1] = 0; r[pos+len+1] = 0;

View File

@ -223,7 +223,7 @@ void cpuexec_init(running_machine *machine)
attotime min_quantum; attotime min_quantum;
/* allocate global state */ /* allocate global state */
machine->cpuexec_data = auto_malloc(sizeof(*machine->cpuexec_data)); machine->cpuexec_data = (cpuexec_private *)auto_malloc(sizeof(*machine->cpuexec_data));
memset(machine->cpuexec_data, 0, sizeof(*machine->cpuexec_data)); memset(machine->cpuexec_data, 0, sizeof(*machine->cpuexec_data));
/* set the core scheduling quantum */ /* set the core scheduling quantum */
@ -457,7 +457,7 @@ static DEVICE_START( cpu )
assert(device->machine->config != NULL); assert(device->machine->config != NULL);
/* get pointers to our data */ /* get pointers to our data */
config = device->inline_config; config = (const cpu_config *)device->inline_config;
header = cpu_get_class_header(device); header = cpu_get_class_header(device);
classdata = get_class_data(device); classdata = get_class_data(device);
@ -553,7 +553,7 @@ static DEVICE_START( cpu )
static DEVICE_RESET( cpu ) static DEVICE_RESET( cpu )
{ {
cpu_class_data *classdata = get_class_data(device); cpu_class_data *classdata = get_class_data(device);
const cpu_config *config = device->inline_config; const cpu_config *config = (const cpu_config *)device->inline_config;
cpu_reset_func reset; cpu_reset_func reset;
int line; int line;
@ -685,7 +685,7 @@ static DEVICE_SET_INFO( cpu )
DEVICE_GET_INFO( cpu ) DEVICE_GET_INFO( cpu )
{ {
const cpu_config *config = (device != NULL) ? device->inline_config : NULL; const cpu_config *config = (device != NULL) ? (const cpu_config *)device->inline_config : NULL;
cpuinfo cinfo = { 0 }; cpuinfo cinfo = { 0 };
switch (state) switch (state)
@ -1363,7 +1363,7 @@ static void on_vblank(const device_config *device, void *param, int vblank_state
/* find any CPUs that have this screen as their VBLANK interrupt source */ /* find any CPUs that have this screen as their VBLANK interrupt source */
for (cpu = device->machine->cpu[0]; cpu != NULL; cpu = cpu->typenext) for (cpu = device->machine->cpu[0]; cpu != NULL; cpu = cpu->typenext)
{ {
const cpu_config *config = cpu->inline_config; const cpu_config *config = (const cpu_config *)cpu->inline_config;
cpu_class_data *classdata = get_class_data(cpu); cpu_class_data *classdata = get_class_data(cpu);
int cpu_interested; int cpu_interested;
@ -1410,8 +1410,8 @@ static void on_vblank(const device_config *device, void *param, int vblank_state
static TIMER_CALLBACK( trigger_partial_frame_interrupt ) static TIMER_CALLBACK( trigger_partial_frame_interrupt )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
const cpu_config *config = device->inline_config; const cpu_config *config = (const cpu_config *)device->inline_config;
cpu_class_data *classdata = get_class_data(device); cpu_class_data *classdata = get_class_data(device);
if (classdata->iloops == 0) if (classdata->iloops == 0)
@ -1436,8 +1436,8 @@ static TIMER_CALLBACK( trigger_partial_frame_interrupt )
static TIMER_CALLBACK( trigger_periodic_interrupt ) static TIMER_CALLBACK( trigger_periodic_interrupt )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
const cpu_config *config = device->inline_config; const cpu_config *config = (const cpu_config *)device->inline_config;
/* bail if there is no routine */ /* bail if there is no routine */
if (config->timed_interrupt != NULL && !cpu_is_suspended(device, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) if (config->timed_interrupt != NULL && !cpu_is_suspended(device, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE))
@ -1462,7 +1462,7 @@ static TIMER_CALLBACK( triggertime_callback )
static TIMER_CALLBACK( empty_event_queue ) static TIMER_CALLBACK( empty_event_queue )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
cpu_class_data *classdata = get_class_data(device); cpu_class_data *classdata = get_class_data(device);
cpu_input_data *inputline = &classdata->input[param]; cpu_input_data *inputline = &classdata->input[param];
int curevent; int curevent;

View File

@ -322,7 +322,7 @@ static UINT64 execute_if(void *globalref, void *ref, UINT32 params, const UINT64
static UINT64 global_get(void *globalref, void *ref) static UINT64 global_get(void *globalref, void *ref)
{ {
global_entry *global = ref; global_entry *global = (global_entry *)ref;
switch (global->size) switch (global->size)
{ {
case 1: return *(UINT8 *)global->base; case 1: return *(UINT8 *)global->base;
@ -340,7 +340,7 @@ static UINT64 global_get(void *globalref, void *ref)
static void global_set(void *globalref, void *ref, UINT64 value) static void global_set(void *globalref, void *ref, UINT64 value)
{ {
global_entry *global = ref; global_entry *global = (global_entry *)ref;
switch (global->size) switch (global->size)
{ {
case 1: *(UINT8 *)global->base = value; break; case 1: *(UINT8 *)global->base = value; break;

View File

@ -404,7 +404,7 @@ void debug_console_register_command(running_machine *machine, const char *comman
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call debug_console_register_command() at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call debug_console_register_command() at init time!");
assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running"); assert_always((machine->debug_flags & DEBUG_FLAG_ENABLED) != 0, "Cannot call debug_console_register_command() when debugger is not running");
cmd = auto_malloc(sizeof(*cmd)); cmd = (debug_command *)auto_malloc(sizeof(*cmd));
memset(cmd, 0, sizeof(*cmd)); memset(cmd, 0, sizeof(*cmd));
/* fill in the command */ /* fill in the command */

View File

@ -158,7 +158,7 @@ void debug_cpu_init(running_machine *machine)
int regnum; int regnum;
/* allocate and reset globals */ /* allocate and reset globals */
machine->debugcpu_data = global = auto_malloc(sizeof(*global)); machine->debugcpu_data = global = (debugcpu_private *)auto_malloc(sizeof(*global));
memset(global, 0, sizeof(*global)); memset(global, 0, sizeof(*global));
global->execution_state = EXECUTION_STATE_STOPPED; global->execution_state = EXECUTION_STATE_STOPPED;
global->bpindex = 1; global->bpindex = 1;
@ -190,7 +190,7 @@ void debug_cpu_init(running_machine *machine)
cpu_debug_data *info; cpu_debug_data *info;
/* allocate some information */ /* allocate some information */
info = auto_malloc(sizeof(*info)); info = (cpu_debug_data *)auto_malloc(sizeof(*info));
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
classheader->debug = info; classheader->debug = info;
@ -983,7 +983,7 @@ int debug_cpu_breakpoint_set(const device_config *device, offs_t address, parsed
assert_always(device != NULL, "debug_cpu_breakpoint_set() called with invalid cpu!"); assert_always(device != NULL, "debug_cpu_breakpoint_set() called with invalid cpu!");
/* allocate breakpoint */ /* allocate breakpoint */
bp = malloc_or_die(sizeof(*bp)); bp = (debug_cpu_breakpoint *)malloc_or_die(sizeof(*bp));
bp->index = global->bpindex++; bp->index = global->bpindex++;
bp->enabled = TRUE; bp->enabled = TRUE;
bp->address = address; bp->address = address;
@ -991,7 +991,7 @@ int debug_cpu_breakpoint_set(const device_config *device, offs_t address, parsed
bp->action = NULL; bp->action = NULL;
if (action != NULL) if (action != NULL)
{ {
bp->action = malloc_or_die(strlen(action) + 1); bp->action = (char *)malloc_or_die(strlen(action) + 1);
strcpy(bp->action, action); strcpy(bp->action, action);
} }
@ -1087,7 +1087,7 @@ int debug_cpu_watchpoint_set(const address_space *space, int type, offs_t addres
{ {
debugcpu_private *global = space->machine->debugcpu_data; debugcpu_private *global = space->machine->debugcpu_data;
cpu_debug_data *info = cpu_get_debug_data(space->cpu); cpu_debug_data *info = cpu_get_debug_data(space->cpu);
debug_cpu_watchpoint *wp = malloc_or_die(sizeof(*wp)); debug_cpu_watchpoint *wp = (debug_cpu_watchpoint *)malloc_or_die(sizeof(*wp));
/* fill in the structure */ /* fill in the structure */
wp->index = global->wpindex++; wp->index = global->wpindex++;
@ -1099,7 +1099,7 @@ int debug_cpu_watchpoint_set(const address_space *space, int type, offs_t addres
wp->action = NULL; wp->action = NULL;
if (action != NULL) if (action != NULL)
{ {
wp->action = malloc_or_die(strlen(action) + 1); wp->action = (char *)malloc_or_die(strlen(action) + 1);
strcpy(wp->action, action); strcpy(wp->action, action);
} }
@ -1245,7 +1245,7 @@ void debug_cpu_trace(const device_config *device, FILE *file, int trace_over, co
info->trace.trace_over_target = ~0; info->trace.trace_over_target = ~0;
if (action != NULL) if (action != NULL)
{ {
info->trace.action = malloc_or_die(strlen(action) + 1); info->trace.action = (char *)malloc_or_die(strlen(action) + 1);
strcpy(info->trace.action, action); strcpy(info->trace.action, action);
} }
@ -1313,7 +1313,7 @@ int debug_cpu_hotspot_track(const device_config *device, int numspots, int thres
if (numspots > 0) if (numspots > 0)
{ {
/* allocate memory for hotspots */ /* allocate memory for hotspots */
info->hotspots = malloc_or_die(sizeof(*info->hotspots) * numspots); info->hotspots = (debug_hotspot_entry *)malloc_or_die(sizeof(*info->hotspots) * numspots);
memset(info->hotspots, 0xff, sizeof(*info->hotspots) * numspots); memset(info->hotspots, 0xff, sizeof(*info->hotspots) * numspots);
/* fill in the info */ /* fill in the info */
@ -2429,7 +2429,7 @@ static const device_config *expression_cpu_index(running_machine *machine, const
static UINT64 expression_read_memory(void *param, const char *name, int space, UINT32 address, int size) static UINT64 expression_read_memory(void *param, const char *name, int space, UINT32 address, int size)
{ {
running_machine *machine = param; running_machine *machine = (running_machine *)param;
const device_config *cpu = NULL; const device_config *cpu = NULL;
switch (space) switch (space)
@ -2532,9 +2532,9 @@ static UINT64 expression_read_program_direct(const address_space *space, int opc
/* get the base of memory, aligned to the address minus the lowbits */ /* get the base of memory, aligned to the address minus the lowbits */
if (opcode & 1) if (opcode & 1)
base = memory_decrypted_read_ptr(space, address & ~lowmask); base = (UINT8 *)memory_decrypted_read_ptr(space, address & ~lowmask);
else else
base = memory_get_read_ptr(space, address & ~lowmask); base = (UINT8 *)memory_get_read_ptr(space, address & ~lowmask);
/* if we have a valid base, return the appropriate byte */ /* if we have a valid base, return the appropriate byte */
if (base != NULL) if (base != NULL)
@ -2634,7 +2634,7 @@ static UINT64 expression_read_eeprom(running_machine *machine, offs_t address, i
static void expression_write_memory(void *param, const char *name, int space, UINT32 address, int size, UINT64 data) static void expression_write_memory(void *param, const char *name, int space, UINT32 address, int size, UINT64 data)
{ {
running_machine *machine = param; running_machine *machine = (running_machine *)param;
const device_config *cpu = NULL; const device_config *cpu = NULL;
switch (space) switch (space)
@ -2743,9 +2743,9 @@ static void expression_write_program_direct(const address_space *space, int opco
/* get the base of memory, aligned to the address minus the lowbits */ /* get the base of memory, aligned to the address minus the lowbits */
if (opcode & 1) if (opcode & 1)
base = memory_decrypted_read_ptr(space, address & ~lowmask); base = (UINT8 *)memory_decrypted_read_ptr(space, address & ~lowmask);
else else
base = memory_get_read_ptr(space, address & ~lowmask); base = (UINT8 *)memory_get_read_ptr(space, address & ~lowmask);
/* if we have a valid base, write the appropriate byte */ /* if we have a valid base, write the appropriate byte */
if (base != NULL) if (base != NULL)
@ -2866,7 +2866,7 @@ static void expression_write_eeprom(running_machine *machine, offs_t address, in
static EXPRERR expression_validate(void *param, const char *name, int space) static EXPRERR expression_validate(void *param, const char *name, int space)
{ {
running_machine *machine = param; running_machine *machine = (running_machine *)param;
const device_config *cpu = NULL; const device_config *cpu = NULL;
switch (space) switch (space)
@ -2928,7 +2928,7 @@ static EXPRERR expression_validate(void *param, const char *name, int space)
static UINT64 get_wpaddr(void *globalref, void *ref) static UINT64 get_wpaddr(void *globalref, void *ref)
{ {
running_machine *machine = globalref; running_machine *machine = (running_machine *)globalref;
return machine->debugcpu_data->wpaddr; return machine->debugcpu_data->wpaddr;
} }
@ -2940,7 +2940,7 @@ static UINT64 get_wpaddr(void *globalref, void *ref)
static UINT64 get_wpdata(void *globalref, void *ref) static UINT64 get_wpdata(void *globalref, void *ref)
{ {
running_machine *machine = globalref; running_machine *machine = (running_machine *)globalref;
return machine->debugcpu_data->wpdata; return machine->debugcpu_data->wpdata;
} }
@ -2952,7 +2952,7 @@ static UINT64 get_wpdata(void *globalref, void *ref)
static UINT64 get_cpunum(void *globalref, void *ref) static UINT64 get_cpunum(void *globalref, void *ref)
{ {
running_machine *machine = globalref; running_machine *machine = (running_machine *)globalref;
return cpu_get_index(machine->debugcpu_data->visiblecpu); return cpu_get_index(machine->debugcpu_data->visiblecpu);
} }
@ -2985,7 +2985,7 @@ static void set_tempvar(void *globalref, void *ref, UINT64 value)
static UINT64 get_beamx(void *globalref, void *ref) static UINT64 get_beamx(void *globalref, void *ref)
{ {
const device_config *screen = ref; const device_config *screen = (const device_config *)ref;
return (screen != NULL) ? video_screen_get_hpos(screen) : 0; return (screen != NULL) ? video_screen_get_hpos(screen) : 0;
} }
@ -2996,7 +2996,7 @@ static UINT64 get_beamx(void *globalref, void *ref)
static UINT64 get_beamy(void *globalref, void *ref) static UINT64 get_beamy(void *globalref, void *ref)
{ {
const device_config *screen = ref; const device_config *screen = (const device_config *)ref;
return (screen != NULL) ? video_screen_get_vpos(screen) : 0; return (screen != NULL) ? video_screen_get_vpos(screen) : 0;
} }
@ -3007,7 +3007,7 @@ static UINT64 get_beamy(void *globalref, void *ref)
static UINT64 get_frame(void *globalref, void *ref) static UINT64 get_frame(void *globalref, void *ref)
{ {
const device_config *screen = ref; const device_config *screen = (const device_config *)ref;
return (screen != NULL) ? video_screen_get_frame_number(screen) : 0; return (screen != NULL) ? video_screen_get_frame_number(screen) : 0;
} }
@ -3019,7 +3019,7 @@ static UINT64 get_frame(void *globalref, void *ref)
static UINT64 get_current_pc(void *globalref, void *ref) static UINT64 get_current_pc(void *globalref, void *ref)
{ {
const device_config *device = globalref; const device_config *device = (const device_config *)globalref;
return cpu_get_pc(device); return cpu_get_pc(device);
} }
@ -3031,7 +3031,7 @@ static UINT64 get_current_pc(void *globalref, void *ref)
static UINT64 get_cycles(void *globalref, void *ref) static UINT64 get_cycles(void *globalref, void *ref)
{ {
const device_config *device = globalref; const device_config *device = (const device_config *)globalref;
return *cpu_get_icount_ptr(device); return *cpu_get_icount_ptr(device);
} }
@ -3043,7 +3043,7 @@ static UINT64 get_cycles(void *globalref, void *ref)
static UINT64 get_logunmap(void *globalref, void *ref) static UINT64 get_logunmap(void *globalref, void *ref)
{ {
const address_space *space = ref; const address_space *space = (const address_space *)ref;
return (space != NULL) ? memory_get_log_unmap(space) : TRUE; return (space != NULL) ? memory_get_log_unmap(space) : TRUE;
} }
@ -3055,7 +3055,7 @@ static UINT64 get_logunmap(void *globalref, void *ref)
static void set_logunmap(void *globalref, void *ref, UINT64 value) static void set_logunmap(void *globalref, void *ref, UINT64 value)
{ {
const address_space *space = ref; const address_space *space = (const address_space *)ref;
if (space != NULL) if (space != NULL)
memory_set_log_unmap(space, value ? 1 : 0); memory_set_log_unmap(space, value ? 1 : 0);
} }
@ -3068,7 +3068,7 @@ static void set_logunmap(void *globalref, void *ref, UINT64 value)
static UINT64 get_cpu_reg(void *globalref, void *ref) static UINT64 get_cpu_reg(void *globalref, void *ref)
{ {
const device_config *device = globalref; const device_config *device = (const device_config *)globalref;
return cpu_get_reg(device, (FPTR)ref); return cpu_get_reg(device, (FPTR)ref);
} }
@ -3080,6 +3080,6 @@ static UINT64 get_cpu_reg(void *globalref, void *ref)
static void set_cpu_reg(void *globalref, void *ref, UINT64 value) static void set_cpu_reg(void *globalref, void *ref, UINT64 value)
{ {
const device_config *device = globalref; const device_config *device = (const device_config *)globalref;
cpu_set_reg(device, (FPTR)ref, value); cpu_set_reg(device, (FPTR)ref, value);
} }

View File

@ -342,7 +342,7 @@ void debug_view_init(running_machine *machine)
debugvw_private *global; debugvw_private *global;
/* allocate memory for our globals */ /* allocate memory for our globals */
global = machine->debugvw_data = auto_malloc(sizeof(*machine->debugvw_data)); global = machine->debugvw_data = (debugvw_private *)auto_malloc(sizeof(*machine->debugvw_data));
memset(global, 0, sizeof(*global)); memset(global, 0, sizeof(*global));
/* register for some manual cleanup */ /* register for some manual cleanup */
@ -387,7 +387,7 @@ debug_view *debug_view_alloc(running_machine *machine, int type, debug_view_osd_
assert(type >= 0 && type < ARRAY_LENGTH(callback_table)); assert(type >= 0 && type < ARRAY_LENGTH(callback_table));
/* allocate memory for the view */ /* allocate memory for the view */
view = malloc(sizeof(*view)); view = (debug_view *)malloc(sizeof(*view));
if (view == NULL) if (view == NULL)
return NULL; return NULL;
memset(view, 0, sizeof(*view)); memset(view, 0, sizeof(*view));
@ -405,7 +405,7 @@ debug_view *debug_view_alloc(running_machine *machine, int type, debug_view_osd_
/* allocate memory for the buffer */ /* allocate memory for the buffer */
view->viewdata_size = view->visible.y * view->visible.x; view->viewdata_size = view->visible.y * view->visible.x;
view->viewdata = malloc(sizeof(view->viewdata[0]) * view->viewdata_size); view->viewdata = (debug_view_char *)malloc(sizeof(view->viewdata[0]) * view->viewdata_size);
if (view->viewdata == NULL) if (view->viewdata == NULL)
{ {
free(view); free(view);
@ -499,7 +499,7 @@ void debug_view_end_update(debug_view *view)
if (size > view->viewdata_size) if (size > view->viewdata_size)
{ {
view->viewdata_size = size; view->viewdata_size = size;
view->viewdata = realloc(view->viewdata, sizeof(view->viewdata[0]) * view->viewdata_size); view->viewdata = (debug_view_char *)realloc(view->viewdata, sizeof(view->viewdata[0]) * view->viewdata_size);
} }
/* update the view */ /* update the view */
@ -908,7 +908,7 @@ static int textbuf_view_alloc(debug_view *view, text_buffer *textbuf)
debug_view_textbuf *textdata; debug_view_textbuf *textdata;
/* allocate memory */ /* allocate memory */
textdata = malloc(sizeof(*textdata)); textdata = (debug_view_textbuf *)malloc(sizeof(*textdata));
if (textdata == NULL) if (textdata == NULL)
return FALSE; return FALSE;
memset(textdata, 0, sizeof(*textdata)); memset(textdata, 0, sizeof(*textdata));
@ -930,7 +930,7 @@ static int textbuf_view_alloc(debug_view *view, text_buffer *textbuf)
static void textbuf_view_free(debug_view *view) static void textbuf_view_free(debug_view *view)
{ {
debug_view_textbuf *textdata = view->extra_data; debug_view_textbuf *textdata = (debug_view_textbuf *)view->extra_data;
/* free any memory we callocated */ /* free any memory we callocated */
if (textdata != NULL) if (textdata != NULL)
@ -946,7 +946,7 @@ static void textbuf_view_free(debug_view *view)
static void textbuf_view_update(debug_view *view) static void textbuf_view_update(debug_view *view)
{ {
debug_view_textbuf *textdata = view->extra_data; debug_view_textbuf *textdata = (debug_view_textbuf *)view->extra_data;
debug_view_char *dest = view->viewdata; debug_view_char *dest = view->viewdata;
UINT32 curseq = 0, row; UINT32 curseq = 0, row;
@ -1014,7 +1014,7 @@ static void textbuf_view_update(debug_view *view)
static void textbuf_view_notify(debug_view *view, view_notification type) static void textbuf_view_notify(debug_view *view, view_notification type)
{ {
debug_view_textbuf *textdata = view->extra_data; debug_view_textbuf *textdata = (debug_view_textbuf *)view->extra_data;
if (type == VIEW_NOTIFY_VISIBLE_CHANGED) if (type == VIEW_NOTIFY_VISIBLE_CHANGED)
{ {
@ -1053,7 +1053,7 @@ static const registers_subview_item *registers_view_enumerate_subviews(running_m
/* determine the string and allocate a subview large enough */ /* determine the string and allocate a subview large enough */
astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu)); astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu));
subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); subview = (registers_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
memset(subview, 0, sizeof(*subview)); memset(subview, 0, sizeof(*subview));
/* populate the subview */ /* populate the subview */
@ -1087,7 +1087,7 @@ static int registers_view_alloc(debug_view *view)
return FALSE; return FALSE;
/* allocate memory */ /* allocate memory */
regdata = malloc(sizeof(*regdata)); regdata = (debug_view_registers *)malloc(sizeof(*regdata));
if (regdata == NULL) if (regdata == NULL)
return FALSE; return FALSE;
memset(regdata, 0, sizeof(*regdata)); memset(regdata, 0, sizeof(*regdata));
@ -1108,7 +1108,7 @@ static int registers_view_alloc(debug_view *view)
static void registers_view_free(debug_view *view) static void registers_view_free(debug_view *view)
{ {
debug_view_registers *regdata = view->extra_data; debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
/* free any memory we callocated */ /* free any memory we callocated */
if (regdata != NULL) if (regdata != NULL)
@ -1124,7 +1124,7 @@ static void registers_view_free(debug_view *view)
static void registers_view_add_register(debug_view *view, int regnum, const char *str) static void registers_view_add_register(debug_view *view, int regnum, const char *str)
{ {
debug_view_registers *regdata = view->extra_data; debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
int tagstart, taglen, valstart, vallen; int tagstart, taglen, valstart, vallen;
const char *colon; const char *colon;
@ -1183,7 +1183,7 @@ static void registers_view_add_register(debug_view *view, int regnum, const char
static void registers_view_recompute(debug_view *view) static void registers_view_recompute(debug_view *view)
{ {
debug_view_registers *regdata = view->extra_data; debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
int regnum, maxtaglen, maxvallen; int regnum, maxtaglen, maxvallen;
const cpu_state_table *table; const cpu_state_table *table;
@ -1296,7 +1296,7 @@ static void registers_view_recompute(debug_view *view)
static void registers_view_update(debug_view *view) static void registers_view_update(debug_view *view)
{ {
const device_config *screen = view->machine->primary_screen; const device_config *screen = view->machine->primary_screen;
debug_view_registers *regdata = view->extra_data; debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
debug_view_char *dest = view->viewdata; debug_view_char *dest = view->viewdata;
UINT64 total_cycles; UINT64 total_cycles;
UINT32 row, i; UINT32 row, i;
@ -1434,7 +1434,7 @@ const registers_subview_item *registers_view_get_subview_list(debug_view *view)
int registers_view_get_subview(debug_view *view) int registers_view_get_subview(debug_view *view)
{ {
debug_view_registers *regdata = view->extra_data; debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
const registers_subview_item *subview; const registers_subview_item *subview;
int index = 0; int index = 0;
@ -1460,7 +1460,7 @@ int registers_view_get_subview(debug_view *view)
void registers_view_set_subview(debug_view *view, int index) void registers_view_set_subview(debug_view *view, int index)
{ {
const registers_subview_item *subview = registers_view_get_subview_by_index(view->machine->debugvw_data->registers_subviews, index); const registers_subview_item *subview = registers_view_get_subview_by_index(view->machine->debugvw_data->registers_subviews, index);
debug_view_registers *regdata = view->extra_data; debug_view_registers *regdata = (debug_view_registers *)view->extra_data;
assert(view->type == DVT_REGISTERS); assert(view->type == DVT_REGISTERS);
assert(subview != NULL); assert(subview != NULL);
@ -1506,7 +1506,7 @@ static const disasm_subview_item *disasm_view_enumerate_subviews(running_machine
/* determine the string and allocate a subview large enough */ /* determine the string and allocate a subview large enough */
astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu)); astring_printf(tempstring, "CPU '%s' (%s)", cpu->tag, cpu_get_name(cpu));
subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); subview = (disasm_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
memset(subview, 0, sizeof(*subview)); memset(subview, 0, sizeof(*subview));
/* populate the subview */ /* populate the subview */
@ -1543,7 +1543,7 @@ static int disasm_view_alloc(debug_view *view)
return FALSE; return FALSE;
/* allocate disasm */ /* allocate disasm */
dasmdata = malloc(sizeof(*dasmdata)); dasmdata = (debug_view_disasm *)malloc(sizeof(*dasmdata));
if (dasmdata == NULL) if (dasmdata == NULL)
return FALSE; return FALSE;
memset(dasmdata, 0, sizeof(*dasmdata)); memset(dasmdata, 0, sizeof(*dasmdata));
@ -1580,7 +1580,7 @@ static int disasm_view_alloc(debug_view *view)
static void disasm_view_free(debug_view *view) static void disasm_view_free(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
/* free any disasm we callocated */ /* free any disasm we callocated */
if (dasmdata != NULL) if (dasmdata != NULL)
@ -1615,7 +1615,7 @@ static void disasm_view_notify(debug_view *view, view_notification type)
static void disasm_view_char(debug_view *view, int chval) static void disasm_view_char(debug_view *view, int chval)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
debug_view_xy origcursor = view->cursor; debug_view_xy origcursor = view->cursor;
UINT8 end_buffer = 3; UINT8 end_buffer = 3;
INT32 temp; INT32 temp;
@ -1824,7 +1824,7 @@ static void disasm_view_generate_bytes(const address_space *space, offs_t pcbyte
static int disasm_view_recompute(debug_view *view, offs_t pc, int startline, int lines) static int disasm_view_recompute(debug_view *view, offs_t pc, int startline, int lines)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
const address_space *space = dasmdata->space; const address_space *space = dasmdata->space;
int minbytes, maxbytes, maxbytes_clamped; int minbytes, maxbytes, maxbytes_clamped;
int changed = FALSE; int changed = FALSE;
@ -1864,12 +1864,12 @@ static int disasm_view_recompute(debug_view *view, offs_t pc, int startline, int
/* allocate address array */ /* allocate address array */
if (dasmdata->byteaddress != NULL) if (dasmdata->byteaddress != NULL)
free(dasmdata->byteaddress); free(dasmdata->byteaddress);
dasmdata->byteaddress = malloc_or_die(sizeof(dasmdata->byteaddress[0]) * dasmdata->allocated.y); dasmdata->byteaddress = (offs_t *)malloc_or_die(sizeof(dasmdata->byteaddress[0]) * dasmdata->allocated.y);
/* allocate disassembly buffer */ /* allocate disassembly buffer */
if (dasmdata->dasm != NULL) if (dasmdata->dasm != NULL)
free(dasmdata->dasm); free(dasmdata->dasm);
dasmdata->dasm = malloc_or_die(sizeof(dasmdata->dasm[0]) * dasmdata->allocated.x * dasmdata->allocated.y); dasmdata->dasm = (char *)malloc_or_die(sizeof(dasmdata->dasm[0]) * dasmdata->allocated.x * dasmdata->allocated.y);
} }
/* iterate over lines */ /* iterate over lines */
@ -1955,7 +1955,7 @@ static int disasm_view_recompute(debug_view *view, offs_t pc, int startline, int
static void disasm_view_update(debug_view *view) static void disasm_view_update(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
const address_space *space = dasmdata->space; const address_space *space = dasmdata->space;
debug_view_char *dest = view->viewdata; debug_view_char *dest = view->viewdata;
int recomputed_this_time = FALSE; int recomputed_this_time = FALSE;
@ -2163,7 +2163,7 @@ const disasm_subview_item *disasm_view_get_subview_list(debug_view *view)
int disasm_view_get_subview(debug_view *view) int disasm_view_get_subview(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
const disasm_subview_item *subview; const disasm_subview_item *subview;
int index = 0; int index = 0;
@ -2188,7 +2188,7 @@ int disasm_view_get_subview(debug_view *view)
const char *disasm_view_get_expression(debug_view *view) const char *disasm_view_get_expression(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -2203,7 +2203,7 @@ const char *disasm_view_get_expression(debug_view *view)
disasm_right_column disasm_view_get_right_column(debug_view *view) disasm_right_column disasm_view_get_right_column(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -2219,7 +2219,7 @@ disasm_right_column disasm_view_get_right_column(debug_view *view)
UINT32 disasm_view_get_backward_steps(debug_view *view) UINT32 disasm_view_get_backward_steps(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -2235,7 +2235,7 @@ UINT32 disasm_view_get_backward_steps(debug_view *view)
UINT32 disasm_view_get_disasm_width(debug_view *view) UINT32 disasm_view_get_disasm_width(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -2251,7 +2251,7 @@ UINT32 disasm_view_get_disasm_width(debug_view *view)
offs_t disasm_view_get_selected_address(debug_view *view) offs_t disasm_view_get_selected_address(debug_view *view)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -2267,7 +2267,7 @@ offs_t disasm_view_get_selected_address(debug_view *view)
void disasm_view_set_subview(debug_view *view, int index) void disasm_view_set_subview(debug_view *view, int index)
{ {
const disasm_subview_item *subview = disasm_view_get_subview_by_index(view->machine->debugvw_data->disasm_subviews, index); const disasm_subview_item *subview = disasm_view_get_subview_by_index(view->machine->debugvw_data->disasm_subviews, index);
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
assert(subview != NULL); assert(subview != NULL);
@ -2295,7 +2295,7 @@ void disasm_view_set_subview(debug_view *view, int index)
void disasm_view_set_expression(debug_view *view, const char *expression) void disasm_view_set_expression(debug_view *view, const char *expression)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
assert(expression != NULL); assert(expression != NULL);
@ -2314,7 +2314,7 @@ void disasm_view_set_expression(debug_view *view, const char *expression)
void disasm_view_set_right_column(debug_view *view, disasm_right_column contents) void disasm_view_set_right_column(debug_view *view, disasm_right_column contents)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
assert(contents == DASM_RIGHTCOL_RAW || contents == DASM_RIGHTCOL_ENCRYPTED || contents == DASM_RIGHTCOL_COMMENTS); assert(contents == DASM_RIGHTCOL_RAW || contents == DASM_RIGHTCOL_ENCRYPTED || contents == DASM_RIGHTCOL_COMMENTS);
@ -2337,7 +2337,7 @@ void disasm_view_set_right_column(debug_view *view, disasm_right_column contents
void disasm_view_set_backward_steps(debug_view *view, UINT32 steps) void disasm_view_set_backward_steps(debug_view *view, UINT32 steps)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
@ -2359,7 +2359,7 @@ void disasm_view_set_backward_steps(debug_view *view, UINT32 steps)
void disasm_view_set_disasm_width(debug_view *view, UINT32 width) void disasm_view_set_disasm_width(debug_view *view, UINT32 width)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
assert(view->type == DVT_DISASSEMBLY); assert(view->type == DVT_DISASSEMBLY);
@ -2381,7 +2381,7 @@ void disasm_view_set_disasm_width(debug_view *view, UINT32 width)
void disasm_view_set_selected_address(debug_view *view, offs_t address) void disasm_view_set_selected_address(debug_view *view, offs_t address)
{ {
debug_view_disasm *dasmdata = view->extra_data; debug_view_disasm *dasmdata = (debug_view_disasm *)view->extra_data;
offs_t byteaddress = memory_address_to_byte(dasmdata->space, address) & dasmdata->space->logbytemask; offs_t byteaddress = memory_address_to_byte(dasmdata->space, address) & dasmdata->space->logbytemask;
int line; int line;
@ -2429,7 +2429,7 @@ static const memory_subview_item *memory_view_enumerate_subviews(running_machine
/* determine the string and allocate a subview large enough */ /* determine the string and allocate a subview large enough */
astring_printf(tempstring, "CPU '%s' (%s) %s memory", cpu->tag, cpu_get_name(cpu), space->name); astring_printf(tempstring, "CPU '%s' (%s) %s memory", cpu->tag, cpu_get_name(cpu), space->name);
subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); subview = (memory_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
memset(subview, 0, sizeof(*subview)); memset(subview, 0, sizeof(*subview));
/* populate the subview */ /* populate the subview */
@ -2459,7 +2459,7 @@ static const memory_subview_item *memory_view_enumerate_subviews(running_machine
/* determine the string and allocate a subview large enough */ /* determine the string and allocate a subview large enough */
astring_printf(tempstring, "Region '%s'", rgntag); astring_printf(tempstring, "Region '%s'", rgntag);
subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); subview = (memory_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
memset(subview, 0, sizeof(*subview)); memset(subview, 0, sizeof(*subview));
/* populate the subview */ /* populate the subview */
@ -2497,7 +2497,7 @@ static const memory_subview_item *memory_view_enumerate_subviews(running_machine
/* determine the string and allocate a subview large enough */ /* determine the string and allocate a subview large enough */
astring_printf(tempstring, "%s", strrchr(name, '/') + 1); astring_printf(tempstring, "%s", strrchr(name, '/') + 1);
subview = auto_malloc(sizeof(*subview) + astring_len(tempstring)); subview = (memory_subview_item *)auto_malloc(sizeof(*subview) + astring_len(tempstring));
memset(subview, 0, sizeof(*subview)); memset(subview, 0, sizeof(*subview));
/* populate the subview */ /* populate the subview */
@ -2536,7 +2536,7 @@ static int memory_view_alloc(debug_view *view)
return FALSE; return FALSE;
/* allocate memory */ /* allocate memory */
memdata = malloc(sizeof(*memdata)); memdata = (debug_view_memory *)malloc(sizeof(*memdata));
if (memdata == NULL) if (memdata == NULL)
return FALSE; return FALSE;
memset(memdata, 0, sizeof(*memdata)); memset(memdata, 0, sizeof(*memdata));
@ -2570,7 +2570,7 @@ static int memory_view_alloc(debug_view *view)
static void memory_view_free(debug_view *view) static void memory_view_free(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
/* free any memory we allocated */ /* free any memory we allocated */
if (memdata != NULL) if (memdata != NULL)
@ -2608,7 +2608,7 @@ static void memory_view_notify(debug_view *view, view_notification type)
static void memory_view_update(debug_view *view) static void memory_view_update(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
const address_space *space = memdata->desc->space; const address_space *space = memdata->desc->space;
const memory_view_pos *posdata; const memory_view_pos *posdata;
UINT32 row; UINT32 row;
@ -2704,7 +2704,7 @@ static void memory_view_update(debug_view *view)
static void memory_view_char(debug_view *view, int chval) static void memory_view_char(debug_view *view, int chval)
{ {
static const char hexvals[] = "0123456789abcdef"; static const char hexvals[] = "0123456789abcdef";
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
offs_t address; offs_t address;
char *hexchar; char *hexchar;
int ismapped; int ismapped;
@ -2777,7 +2777,7 @@ static void memory_view_char(debug_view *view, int chval)
break; break;
default: default:
hexchar = strchr(hexvals, tolower(chval)); hexchar = (char *)strchr(hexvals, tolower(chval));
if (hexchar == NULL) if (hexchar == NULL)
break; break;
ismapped = memory_view_read(memdata, memdata->bytes_per_chunk, address, &data); ismapped = memory_view_read(memdata, memdata->bytes_per_chunk, address, &data);
@ -2824,7 +2824,7 @@ static void memory_view_char(debug_view *view, int chval)
static void memory_view_recompute(debug_view *view) static void memory_view_recompute(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
const address_space *space = memdata->desc->space; const address_space *space = memdata->desc->space;
offs_t cursoraddr; offs_t cursoraddr;
UINT8 cursorshift; UINT8 cursorshift;
@ -2904,7 +2904,7 @@ static void memory_view_recompute(debug_view *view)
static int memory_view_needs_recompute(debug_view *view) static int memory_view_needs_recompute(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
const address_space *space = memdata->desc->space; const address_space *space = memdata->desc->space;
int recompute = view->recompute; int recompute = view->recompute;
@ -2931,7 +2931,7 @@ static int memory_view_needs_recompute(debug_view *view)
static void memory_view_get_cursor_pos(debug_view *view, offs_t *address, UINT8 *shift) static void memory_view_get_cursor_pos(debug_view *view, offs_t *address, UINT8 *shift)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
const memory_view_pos *posdata = &memory_pos_table[memdata->bytes_per_chunk]; const memory_view_pos *posdata = &memory_pos_table[memdata->bytes_per_chunk];
int xposition, chunknum, chunkoffs; int xposition, chunknum, chunkoffs;
@ -2967,7 +2967,7 @@ static void memory_view_get_cursor_pos(debug_view *view, offs_t *address, UINT8
static void memory_view_set_cursor_pos(debug_view *view, offs_t address, UINT8 shift) static void memory_view_set_cursor_pos(debug_view *view, offs_t address, UINT8 shift)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
const memory_view_pos *posdata = &memory_pos_table[memdata->bytes_per_chunk]; const memory_view_pos *posdata = &memory_pos_table[memdata->bytes_per_chunk];
int chunknum; int chunknum;
@ -3131,7 +3131,7 @@ const memory_subview_item *memory_view_get_subview_list(debug_view *view)
int memory_view_get_subview(debug_view *view) int memory_view_get_subview(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
@ -3148,7 +3148,7 @@ int memory_view_get_subview(debug_view *view)
const char *memory_view_get_expression(debug_view *view) const char *memory_view_get_expression(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -3163,7 +3163,7 @@ const char *memory_view_get_expression(debug_view *view)
UINT8 memory_view_get_bytes_per_chunk(debug_view *view) UINT8 memory_view_get_bytes_per_chunk(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -3178,7 +3178,7 @@ UINT8 memory_view_get_bytes_per_chunk(debug_view *view)
UINT32 memory_view_get_chunks_per_row(debug_view *view) UINT32 memory_view_get_chunks_per_row(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -3193,7 +3193,7 @@ UINT32 memory_view_get_chunks_per_row(debug_view *view)
UINT8 memory_view_get_reverse(debug_view *view) UINT8 memory_view_get_reverse(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -3209,7 +3209,7 @@ UINT8 memory_view_get_reverse(debug_view *view)
UINT8 memory_view_get_ascii(debug_view *view) UINT8 memory_view_get_ascii(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -3225,7 +3225,7 @@ UINT8 memory_view_get_ascii(debug_view *view)
UINT8 memory_view_get_physical(debug_view *view) UINT8 memory_view_get_physical(debug_view *view)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
debug_view_begin_update(view); debug_view_begin_update(view);
debug_view_end_update(view); debug_view_end_update(view);
@ -3241,7 +3241,7 @@ UINT8 memory_view_get_physical(debug_view *view)
void memory_view_set_subview(debug_view *view, int index) void memory_view_set_subview(debug_view *view, int index)
{ {
const memory_subview_item *subview = memory_view_get_subview_by_index(view->machine->debugvw_data->memory_subviews, index); const memory_subview_item *subview = memory_view_get_subview_by_index(view->machine->debugvw_data->memory_subviews, index);
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
assert(subview != NULL); assert(subview != NULL);
@ -3271,7 +3271,7 @@ void memory_view_set_subview(debug_view *view, int index)
void memory_view_set_expression(debug_view *view, const char *expression) void memory_view_set_expression(debug_view *view, const char *expression)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
assert(expression != NULL); assert(expression != NULL);
@ -3290,7 +3290,7 @@ void memory_view_set_expression(debug_view *view, const char *expression)
void memory_view_set_bytes_per_chunk(debug_view *view, UINT8 chunkbytes) void memory_view_set_bytes_per_chunk(debug_view *view, UINT8 chunkbytes)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
assert(chunkbytes < ARRAY_LENGTH(memory_pos_table) && memory_pos_table[chunkbytes].spacing != 0); assert(chunkbytes < ARRAY_LENGTH(memory_pos_table) && memory_pos_table[chunkbytes].spacing != 0);
@ -3325,7 +3325,7 @@ void memory_view_set_bytes_per_chunk(debug_view *view, UINT8 chunkbytes)
void memory_view_set_chunks_per_row(debug_view *view, UINT32 rowchunks) void memory_view_set_chunks_per_row(debug_view *view, UINT32 rowchunks)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
@ -3354,7 +3354,7 @@ void memory_view_set_chunks_per_row(debug_view *view, UINT32 rowchunks)
void memory_view_set_reverse(debug_view *view, UINT8 reverse) void memory_view_set_reverse(debug_view *view, UINT8 reverse)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
@ -3381,7 +3381,7 @@ void memory_view_set_reverse(debug_view *view, UINT8 reverse)
void memory_view_set_ascii(debug_view *view, UINT8 ascii) void memory_view_set_ascii(debug_view *view, UINT8 ascii)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);
@ -3408,7 +3408,7 @@ void memory_view_set_ascii(debug_view *view, UINT8 ascii)
void memory_view_set_physical(debug_view *view, UINT8 physical) void memory_view_set_physical(debug_view *view, UINT8 physical)
{ {
debug_view_memory *memdata = view->extra_data; debug_view_memory *memdata = (debug_view_memory *)view->extra_data;
assert(view->type == DVT_MEMORY); assert(view->type == DVT_MEMORY);

View File

@ -304,7 +304,7 @@ INLINE EXPRERR pop_token_lval(parsed_expression *expr, parse_token *token, const
/* to be an lval, the token must be a valid read/write symbol or a memory token */ /* to be an lval, the token must be a valid read/write symbol or a memory token */
if (token->type == TOK_SYMBOL) if (token->type == TOK_SYMBOL)
{ {
symbol_entry *symbol = token->value.p; symbol_entry *symbol = (symbol_entry *)token->value.p;
if (symbol == NULL || symbol->type != SMT_REGISTER || symbol->info.reg.setter == NULL) if (symbol == NULL || symbol->type != SMT_REGISTER || symbol->info.reg.setter == NULL)
return MAKE_EXPRERR_NOT_LVAL(token->offset); return MAKE_EXPRERR_NOT_LVAL(token->offset);
} }
@ -332,7 +332,7 @@ INLINE EXPRERR pop_token_rval(parsed_expression *expr, parse_token *token, const
/* symbol tokens get resolved down to number tokens */ /* symbol tokens get resolved down to number tokens */
if (token->type == TOK_SYMBOL) if (token->type == TOK_SYMBOL)
{ {
symbol_entry *symbol = token->value.p; symbol_entry *symbol = (symbol_entry *)token->value.p;
if (symbol == NULL || (symbol->type != SMT_REGISTER && symbol->type != SMT_VALUE)) if (symbol == NULL || (symbol->type != SMT_REGISTER && symbol->type != SMT_VALUE))
return MAKE_EXPRERR_NOT_RVAL(token->offset); return MAKE_EXPRERR_NOT_RVAL(token->offset);
token->type = TOK_NUMBER; token->type = TOK_NUMBER;
@ -371,7 +371,7 @@ INLINE UINT64 get_lval_value(parsed_expression *expr, parse_token *token, const
{ {
if (token->type == TOK_SYMBOL) if (token->type == TOK_SYMBOL)
{ {
symbol_entry *symbol = token->value.p; symbol_entry *symbol = (symbol_entry *)token->value.p;
if (symbol != NULL && symbol->type == SMT_REGISTER) if (symbol != NULL && symbol->type == SMT_REGISTER)
return (*symbol->info.reg.getter)(symbol->table->globalref, symbol->ref); return (*symbol->info.reg.getter)(symbol->table->globalref, symbol->ref);
} }
@ -396,7 +396,7 @@ INLINE void set_lval_value(parsed_expression *expr, parse_token *token, const sy
{ {
if (token->type == TOK_SYMBOL) if (token->type == TOK_SYMBOL)
{ {
symbol_entry *symbol = token->value.p; symbol_entry *symbol = (symbol_entry *)token->value.p;
if (symbol != NULL && symbol->type == SMT_REGISTER && symbol->info.reg.setter) if (symbol != NULL && symbol->type == SMT_REGISTER && symbol->info.reg.setter)
(*symbol->info.reg.setter)(symbol->table->globalref, symbol->ref, value); (*symbol->info.reg.setter)(symbol->table->globalref, symbol->ref, value);
} }
@ -618,7 +618,7 @@ static EXPRERR parse_string_into_tokens(const char *stringstart, parsed_expressi
expr->table = table; expr->table = table;
/* make a copy of the original string */ /* make a copy of the original string */
expr->original_string = malloc(strlen(stringstart) + 1); expr->original_string = (char *)malloc(strlen(stringstart) + 1);
if (!expr->original_string) if (!expr->original_string)
return MAKE_EXPRERR_OUT_OF_MEMORY(0); return MAKE_EXPRERR_OUT_OF_MEMORY(0);
strcpy(expr->original_string, stringstart); strcpy(expr->original_string, stringstart);
@ -1214,7 +1214,7 @@ static EXPRERR execute_function(parsed_expression *expr, parse_token *token)
/* if it is a function symbol, break out of the loop */ /* if it is a function symbol, break out of the loop */
if (peek->type == TOK_SYMBOL) if (peek->type == TOK_SYMBOL)
{ {
symbol = peek->value.p; symbol = (symbol_entry *)peek->value.p;
if (symbol != NULL && symbol->type == SMT_FUNCTION) if (symbol != NULL && symbol->type == SMT_FUNCTION)
{ {
pop_token(expr, &t1); pop_token(expr, &t1);
@ -1666,7 +1666,7 @@ static char *add_expression_string(parsed_expression *expr, const char *string,
expression_string *expstring; expression_string *expstring;
/* allocate memory */ /* allocate memory */
expstring = malloc(sizeof(expression_string) + length); expstring = (expression_string *)malloc(sizeof(expression_string) + length);
if (expstring == NULL) if (expstring == NULL)
return NULL; return NULL;
@ -1800,7 +1800,7 @@ EXPRERR expression_parse(const char *expression, const symbol_table *table, cons
goto cleanup; goto cleanup;
/* allocate memory for the result */ /* allocate memory for the result */
*result = malloc(sizeof(temp_expression)); *result = (parsed_expression *)malloc(sizeof(temp_expression));
if (!*result) if (!*result)
{ {
exprerr = MAKE_EXPRERR_OUT_OF_MEMORY(0); exprerr = MAKE_EXPRERR_OUT_OF_MEMORY(0);
@ -1920,7 +1920,7 @@ symbol_table *symtable_alloc(symbol_table *parent, void *globalref)
symbol_table *table; symbol_table *table;
/* allocate memory for the table */ /* allocate memory for the table */
table = malloc(sizeof(*table)); table = (symbol_table *)malloc(sizeof(*table));
if (!table) if (!table)
return NULL; return NULL;
@ -1980,13 +1980,13 @@ int symtable_add(symbol_table *table, const char *name, const symbol_entry *entr
} }
/* otherwise, allocate a new entry */ /* otherwise, allocate a new entry */
symbol = malloc(sizeof(*symbol)); symbol = (internal_symbol_entry *)malloc(sizeof(*symbol));
if (!symbol) if (!symbol)
return 0; return 0;
memset(symbol, 0, sizeof(*symbol)); memset(symbol, 0, sizeof(*symbol));
/* allocate space for a copy of the string */ /* allocate space for a copy of the string */
newstring = malloc(strlen(name) + 1); newstring = (char *)malloc(strlen(name) + 1);
if (!newstring) if (!newstring)
{ {
free(symbol); free(symbol);

View File

@ -88,12 +88,12 @@ text_buffer *text_buffer_alloc(UINT32 bytes, UINT32 lines)
text_buffer *text; text_buffer *text;
/* allocate memory for the text buffer object */ /* allocate memory for the text buffer object */
text = malloc(sizeof(*text)); text = (text_buffer *)malloc(sizeof(*text));
if (!text) if (!text)
return NULL; return NULL;
/* allocate memory for the buffer itself */ /* allocate memory for the buffer itself */
text->buffer = malloc(bytes); text->buffer = (char *)malloc(bytes);
if (!text->buffer) if (!text->buffer)
{ {
free(text); free(text);
@ -101,7 +101,7 @@ text_buffer *text_buffer_alloc(UINT32 bytes, UINT32 lines)
} }
/* allocate memory for the lines array */ /* allocate memory for the lines array */
text->lineoffs = malloc(lines * sizeof(text->lineoffs[0])); text->lineoffs = (INT32 *)malloc(lines * sizeof(text->lineoffs[0]));
if (!text->lineoffs) if (!text->lineoffs)
{ {
free(text->buffer); free(text->buffer);

View File

@ -75,7 +75,7 @@ void debugger_init(running_machine *machine)
/* allocate a new entry for our global list */ /* allocate a new entry for our global list */
add_exit_callback(machine, debugger_exit); add_exit_callback(machine, debugger_exit);
entry = malloc_or_die(sizeof(*entry)); entry = (machine_entry *)malloc_or_die(sizeof(*entry));
entry->next = machine_list; entry->next = machine_list;
entry->machine = machine; entry->machine = machine;
machine_list = entry; machine_list = entry;

View File

@ -31,7 +31,7 @@ static READ_LINE_DEVICE_HANDLER( trampoline_read_port_to_read_line )
static READ_LINE_DEVICE_HANDLER( trampoline_read8_to_read_line ) static READ_LINE_DEVICE_HANDLER( trampoline_read8_to_read_line )
{ {
const devcb_resolved_read_line *resolved = (const devcb_resolved_read_line *)device; const devcb_resolved_read_line *resolved = (const devcb_resolved_read_line *)device;
return ((*resolved->real.readdevice)(resolved->realtarget, 0) & 1) ? ASSERT_LINE : CLEAR_LINE; return ((*resolved->real.readdevice)((const device_config *)resolved->realtarget, 0) & 1) ? ASSERT_LINE : CLEAR_LINE;
} }
void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, const device_config *device) void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_read_line *config, const device_config *device)
@ -95,13 +95,13 @@ void devcb_resolve_read_line(devcb_resolved_read_line *resolved, const devcb_rea
static WRITE_LINE_DEVICE_HANDLER( trampoline_write8_to_write_line ) static WRITE_LINE_DEVICE_HANDLER( trampoline_write8_to_write_line )
{ {
const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device; const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device;
(*resolved->real.writedevice)(resolved->realtarget, 0, state); (*resolved->real.writedevice)((const device_config *)resolved->realtarget, 0, state);
} }
static WRITE_LINE_DEVICE_HANDLER( trampoline_writecpu_to_write_line ) static WRITE_LINE_DEVICE_HANDLER( trampoline_writecpu_to_write_line )
{ {
const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device; const devcb_resolved_write_line *resolved = (const devcb_resolved_write_line *)device;
const device_config *cpu = resolved->realtarget; const device_config *cpu = (const device_config *)resolved->realtarget;
cpu_set_input_line(cpu, resolved->real.writeline, state ? ASSERT_LINE : CLEAR_LINE); cpu_set_input_line(cpu, resolved->real.writeline, state ? ASSERT_LINE : CLEAR_LINE);
} }
@ -176,7 +176,7 @@ static READ8_DEVICE_HANDLER( trampoline_read_port_to_read8 )
static READ8_DEVICE_HANDLER( trampoline_read_line_to_read8 ) static READ8_DEVICE_HANDLER( trampoline_read_line_to_read8 )
{ {
const devcb_resolved_read8 *resolved = (const devcb_resolved_read8 *)device; const devcb_resolved_read8 *resolved = (const devcb_resolved_read8 *)device;
return (*resolved->real.readline)(resolved->realtarget); return (*resolved->real.readline)((const device_config *)resolved->realtarget);
} }
void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, const device_config *device) void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *config, const device_config *device)
@ -238,7 +238,7 @@ void devcb_resolve_read8(devcb_resolved_read8 *resolved, const devcb_read8 *conf
static WRITE8_DEVICE_HANDLER( trampoline_write_line_to_write8 ) static WRITE8_DEVICE_HANDLER( trampoline_write_line_to_write8 )
{ {
const devcb_resolved_write8 *resolved = (const devcb_resolved_write8 *)device; const devcb_resolved_write8 *resolved = (const devcb_resolved_write8 *)device;
(*resolved->real.writeline)(resolved->realtarget, (data & 1) ? ASSERT_LINE : CLEAR_LINE); (*resolved->real.writeline)((const device_config *)resolved->realtarget, (data & 1) ? ASSERT_LINE : CLEAR_LINE);
} }
void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, const device_config *device) void devcb_resolve_write8(devcb_resolved_write8 *resolved, const devcb_write8 *config, const device_config *device)

View File

@ -111,7 +111,7 @@ device_config *device_list_add(device_config **listheadptr, const device_config
configlen = (UINT32)devtype_get_info_int(type, DEVINFO_INT_INLINE_CONFIG_BYTES); configlen = (UINT32)devtype_get_info_int(type, DEVINFO_INT_INLINE_CONFIG_BYTES);
/* allocate a new device */ /* allocate a new device */
device = malloc_or_die(sizeof(*device) + strlen(tag) + configlen); device = (device_config *)malloc_or_die(sizeof(*device) + strlen(tag) + configlen);
/* populate device relationships */ /* populate device relationships */
device->next = NULL; device->next = NULL;
@ -121,7 +121,7 @@ device_config *device_list_add(device_config **listheadptr, const device_config
/* populate device properties */ /* populate device properties */
device->type = type; device->type = type;
device->devclass = devtype_get_info_int(type, DEVINFO_INT_CLASS); device->devclass = (device_class)(INT32)devtype_get_info_int(type, DEVINFO_INT_CLASS);
device->set_info = (device_set_info_func)devtype_get_info_fct(type, DEVINFO_FCT_SET_INFO); device->set_info = (device_set_info_func)devtype_get_info_fct(type, DEVINFO_FCT_SET_INFO);
device->execute = NULL; device->execute = NULL;

View File

@ -90,7 +90,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
gfx_element *gfx; gfx_element *gfx;
/* allocate memory for the gfx_element structure */ /* allocate memory for the gfx_element structure */
gfx = malloc_or_die(sizeof(*gfx)); gfx = (gfx_element *)malloc_or_die(sizeof(*gfx));
memset(gfx, 0, sizeof(*gfx)); memset(gfx, 0, sizeof(*gfx));
/* fill in the data */ /* fill in the data */
@ -120,7 +120,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
} }
else else
{ {
UINT32 *buffer = malloc_or_die(sizeof(buffer[0]) * gfx->layout.width); UINT32 *buffer = (UINT32 *)malloc_or_die(sizeof(buffer[0]) * gfx->layout.width);
memcpy(buffer, gfx->layout.extxoffs, sizeof(gfx->layout.extxoffs[0]) * gfx->layout.width); memcpy(buffer, gfx->layout.extxoffs, sizeof(gfx->layout.extxoffs[0]) * gfx->layout.width);
gfx->layout.extxoffs = buffer; gfx->layout.extxoffs = buffer;
} }
@ -135,7 +135,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
} }
else else
{ {
UINT32 *buffer = malloc_or_die(sizeof(buffer[0]) * gfx->layout.height); UINT32 *buffer = (UINT32 *)malloc_or_die(sizeof(buffer[0]) * gfx->layout.height);
memcpy(buffer, gfx->layout.extyoffs, sizeof(gfx->layout.extyoffs[0]) * gfx->layout.height); memcpy(buffer, gfx->layout.extyoffs, sizeof(gfx->layout.extyoffs[0]) * gfx->layout.height);
gfx->layout.extyoffs = buffer; gfx->layout.extyoffs = buffer;
} }
@ -143,10 +143,10 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
/* allocate a pen usage array for entries with 32 pens or less */ /* allocate a pen usage array for entries with 32 pens or less */
if (gfx->color_depth <= 32) if (gfx->color_depth <= 32)
gfx->pen_usage = malloc_or_die(gfx->total_elements * sizeof(*gfx->pen_usage)); gfx->pen_usage = (UINT32 *)malloc_or_die(gfx->total_elements * sizeof(*gfx->pen_usage));
/* allocate a dirty array */ /* allocate a dirty array */
gfx->dirty = malloc_or_die(gfx->total_elements * sizeof(*gfx->dirty)); gfx->dirty = (UINT8 *)malloc_or_die(gfx->total_elements * sizeof(*gfx->dirty));
memset(gfx->dirty, 1, gfx->total_elements * sizeof(*gfx->dirty)); memset(gfx->dirty, 1, gfx->total_elements * sizeof(*gfx->dirty));
/* raw graphics case */ /* raw graphics case */
@ -173,7 +173,7 @@ gfx_element *gfx_element_alloc(running_machine *machine, const gfx_layout *gl, c
gfx->char_modulo = gfx->line_modulo * gfx->origheight; gfx->char_modulo = gfx->line_modulo * gfx->origheight;
/* allocate memory for the data */ /* allocate memory for the data */
gfx->gfxdata = malloc_or_die(gfx->total_elements * gfx->char_modulo); gfx->gfxdata = (UINT8 *)malloc_or_die(gfx->total_elements * gfx->char_modulo);
} }
return gfx; return gfx;

View File

@ -114,7 +114,7 @@ void driver_list_get_approx_matches(const game_driver * const driverlist[], cons
int shufnum; int shufnum;
/* allocate a temporary list */ /* allocate a temporary list */
templist = malloc_or_die(driver_list_get_count(driverlist) * sizeof(*templist)); templist = (const game_driver **)malloc_or_die(driver_list_get_count(driverlist) * sizeof(*templist));
/* build up a list of valid entries */ /* build up a list of valid entries */
for (drvnum = driver_count = 0; driverlist[drvnum] != NULL; drvnum++) for (drvnum = driver_count = 0; driverlist[drvnum] != NULL; drvnum++)
@ -145,7 +145,7 @@ void driver_list_get_approx_matches(const game_driver * const driverlist[], cons
} }
/* allocate some temp memory */ /* allocate some temp memory */
penalty = malloc_or_die(matches * sizeof(*penalty)); penalty = (int *)malloc_or_die(matches * sizeof(*penalty));
/* initialize everyone's states */ /* initialize everyone's states */
for (matchnum = 0; matchnum < matches; matchnum++) for (matchnum = 0; matchnum < matches; matchnum++)

View File

@ -95,14 +95,14 @@ static void configure_rgb_shadows(running_machine *machine, int mode, float fact
void palette_init(running_machine *machine) void palette_init(running_machine *machine)
{ {
int format; palette_private *palette = (palette_private *)auto_malloc(sizeof(*palette));
palette_private *palette = auto_malloc(sizeof(*palette));
const device_config *device = video_screen_first(machine->config); const device_config *device = video_screen_first(machine->config);
bitmap_format format;
/* get the format from the first screen, or use BITMAP_FORMAT_INVALID, if screenless */ /* get the format from the first screen, or use BITMAP_FORMAT_INVALID, if screenless */
if (device != NULL) if (device != NULL)
{ {
screen_config *config = device->inline_config; screen_config *config = (screen_config *)device->inline_config;
format = config->format; format = config->format;
} }
else else
@ -146,8 +146,8 @@ void palette_init(running_machine *machine)
/* set up save/restore of the palette */ /* set up save/restore of the palette */
numcolors = palette_get_num_colors(machine->palette); numcolors = palette_get_num_colors(machine->palette);
palette->save_pen = auto_malloc(sizeof(*palette->save_pen) * numcolors); palette->save_pen = (pen_t *)auto_malloc(sizeof(*palette->save_pen) * numcolors);
palette->save_bright = auto_malloc(sizeof(*palette->save_bright) * numcolors); palette->save_bright = (float *)auto_malloc(sizeof(*palette->save_bright) * numcolors);
state_save_register_global_pointer(machine, palette->save_pen, numcolors); state_save_register_global_pointer(machine, palette->save_pen, numcolors);
state_save_register_global_pointer(machine, palette->save_bright, numcolors); state_save_register_global_pointer(machine, palette->save_bright, numcolors);
state_save_register_presave(machine, palette_presave, palette); state_save_register_presave(machine, palette_presave, palette);
@ -330,7 +330,7 @@ colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize)
assert(palettesize > 0); assert(palettesize > 0);
/* allocate the colortable */ /* allocate the colortable */
ctable = auto_malloc(sizeof(*ctable)); ctable = (colortable_t *)auto_malloc(sizeof(*ctable));
memset(ctable, 0, sizeof(*ctable)); memset(ctable, 0, sizeof(*ctable));
/* fill in the basics */ /* fill in the basics */
@ -339,13 +339,13 @@ colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize)
ctable->palentries = palettesize; ctable->palentries = palettesize;
/* allocate the raw colortable */ /* allocate the raw colortable */
ctable->raw = auto_malloc(ctable->entries * sizeof(*ctable->raw)); ctable->raw = (UINT16 *)auto_malloc(ctable->entries * sizeof(*ctable->raw));
for (index = 0; index < ctable->entries; index++) for (index = 0; index < ctable->entries; index++)
ctable->raw[index] = index % ctable->palentries; ctable->raw[index] = index % ctable->palentries;
state_save_register_global_pointer(machine, ctable->raw, ctable->entries); state_save_register_global_pointer(machine, ctable->raw, ctable->entries);
/* allocate the palette */ /* allocate the palette */
ctable->palette = auto_malloc(ctable->palentries * sizeof(*ctable->palette)); ctable->palette = (rgb_t *)auto_malloc(ctable->palentries * sizeof(*ctable->palette));
for (index = 0; index < ctable->palentries; index++) for (index = 0; index < ctable->palentries; index++)
ctable->palette[index] = MAKE_ARGB(0x80,0xff,0xff,0xff); ctable->palette[index] = MAKE_ARGB(0x80,0xff,0xff,0xff);
state_save_register_global_pointer(machine, ctable->palette, ctable->palentries); state_save_register_global_pointer(machine, ctable->palette, ctable->palentries);
@ -536,7 +536,7 @@ pen_t get_white_pen(running_machine *machine)
static void palette_presave(running_machine *machine, void *param) static void palette_presave(running_machine *machine, void *param)
{ {
int numcolors = palette_get_num_colors(machine->palette); int numcolors = palette_get_num_colors(machine->palette);
palette_private *palette = param; palette_private *palette = (palette_private *)param;
int index; int index;
/* fill the save arrays with updated pen and brightness information */ /* fill the save arrays with updated pen and brightness information */
@ -556,7 +556,7 @@ static void palette_presave(running_machine *machine, void *param)
static void palette_postload(running_machine *machine, void *param) static void palette_postload(running_machine *machine, void *param)
{ {
int numcolors = palette_get_num_colors(machine->palette); int numcolors = palette_get_num_colors(machine->palette);
palette_private *palette = param; palette_private *palette = (palette_private *)param;
int index; int index;
/* reset the pen and brightness for each entry */ /* reset the pen and brightness for each entry */
@ -660,7 +660,7 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal
{ {
case BITMAP_FORMAT_INDEXED16: case BITMAP_FORMAT_INDEXED16:
/* create a dummy 1:1 mapping */ /* create a dummy 1:1 mapping */
machine->pens = pentable = auto_malloc((total_colors + 2) * sizeof(machine->pens[0])); machine->pens = pentable = (pen_t *)auto_malloc((total_colors + 2) * sizeof(machine->pens[0]));
for (i = 0; i < total_colors + 2; i++) for (i = 0; i < total_colors + 2; i++)
pentable[i] = i; pentable[i] = i;
break; break;
@ -690,7 +690,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
/* if we have shadows, allocate shadow tables */ /* if we have shadows, allocate shadow tables */
if (machine->config->video_attributes & VIDEO_HAS_SHADOWS) if (machine->config->video_attributes & VIDEO_HAS_SHADOWS)
{ {
pen_t *table = auto_malloc(65536 * sizeof(*table)); pen_t *table = (pen_t *)auto_malloc(65536 * sizeof(*table));
int i; int i;
/* palettized mode gets a single 64k table in slots 0 and 2 */ /* palettized mode gets a single 64k table in slots 0 and 2 */
@ -713,7 +713,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa
/* if we have hilights, allocate shadow tables */ /* if we have hilights, allocate shadow tables */
if (machine->config->video_attributes & VIDEO_HAS_HIGHLIGHTS) if (machine->config->video_attributes & VIDEO_HAS_HIGHLIGHTS)
{ {
pen_t *table = auto_malloc(65536 * sizeof(*table)); pen_t *table = (pen_t *)auto_malloc(65536 * sizeof(*table));
int i; int i;
/* palettized mode gets a single 64k table in slots 1 and 3 */ /* palettized mode gets a single 64k table in slots 1 and 3 */

View File

@ -181,7 +181,7 @@ file_error mame_fopen_ram(const void *data, UINT32 length, UINT32 openflags, mam
file_error filerr; file_error filerr;
/* allocate the file itself */ /* allocate the file itself */
*file = malloc(sizeof(**file)); *file = (mame_file *)malloc(sizeof(**file));
if (*file == NULL) if (*file == NULL)
return FILERR_OUT_OF_MEMORY; return FILERR_OUT_OF_MEMORY;
@ -222,7 +222,7 @@ static file_error fopen_internal(core_options *opts, const char *searchpath, con
return FILERR_INVALID_ACCESS; return FILERR_INVALID_ACCESS;
/* allocate the file itself */ /* allocate the file itself */
*file = malloc(sizeof(**file)); *file = (mame_file *)malloc(sizeof(**file));
if (*file == NULL) if (*file == NULL)
return FILERR_OUT_OF_MEMORY; return FILERR_OUT_OF_MEMORY;
@ -651,7 +651,7 @@ mame_path *mame_openpath(core_options *opts, const char *searchpath)
mame_path *path; mame_path *path;
/* allocate a new mame_path */ /* allocate a new mame_path */
path = malloc(sizeof(*path)); path = (mame_path *)malloc(sizeof(*path));
if (path == NULL) if (path == NULL)
return NULL; return NULL;
memset(path, 0, sizeof(*path)); memset(path, 0, sizeof(*path));
@ -779,7 +779,7 @@ const char *mame_fhash(mame_file *file, UINT32 functions)
return file->hash; return file->hash;
/* read the data if we can */ /* read the data if we can */
filedata = core_fbuffer(file->file); filedata = (const UINT8 *)core_fbuffer(file->file);
if (filedata == NULL) if (filedata == NULL)
return file->hash; return file->hash;
@ -853,7 +853,7 @@ static file_error load_zipped_file(mame_file *file)
assert(file->zipfile != NULL); assert(file->zipfile != NULL);
/* allocate some memory */ /* allocate some memory */
file->zipdata = malloc(file->ziplength); file->zipdata = (UINT8 *)malloc(file->ziplength);
if (file->zipdata == NULL) if (file->zipdata == NULL)
return FILERR_OUT_OF_MEMORY; return FILERR_OUT_OF_MEMORY;

View File

@ -459,7 +459,7 @@ int hash_data_extract_binary_checksum(const char* data, unsigned int function, u
int hash_data_has_info(const char* data, unsigned int info) int hash_data_has_info(const char* data, unsigned int info)
{ {
char* res = strstr(data, info_strings[info]); char* res = (char*)strstr(data, info_strings[info]);
if (!res) if (!res)
return 0; return 0;

View File

@ -601,7 +601,7 @@ static void print_game_display(FILE *out, const game_driver *game, const machine
/* iterate over screens */ /* iterate over screens */
for (screen = video_screen_first(config); screen != NULL; screen = video_screen_next(screen)) for (screen = video_screen_first(config); screen != NULL; screen = video_screen_next(screen))
{ {
const screen_config *scrconfig = screen->inline_config; const screen_config *scrconfig = (const screen_config *)screen->inline_config;
fprintf(out, "\t\t<display"); fprintf(out, "\t\t<display");

View File

@ -624,7 +624,7 @@ time_t input_port_init(running_machine *machine, const input_port_token *tokens)
time_t basetime; time_t basetime;
/* allocate memory for our data structure */ /* allocate memory for our data structure */
machine->input_port_data = auto_malloc(sizeof(*machine->input_port_data)); machine->input_port_data = (input_port_private *)auto_malloc(sizeof(*machine->input_port_data));
memset(machine->input_port_data, 0, sizeof(*machine->input_port_data)); memset(machine->input_port_data, 0, sizeof(*machine->input_port_data));
portdata = machine->input_port_data; portdata = machine->input_port_data;
@ -857,7 +857,7 @@ void input_field_set_user_settings(const input_field_config *field, const input_
/* copy the basics */ /* copy the basics */
for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++) for (seqtype = 0; seqtype < ARRAY_LENGTH(settings->seq); seqtype++)
{ {
const input_seq *defseq = input_type_seq(field->port->machine, field->type, field->player, seqtype); const input_seq *defseq = input_type_seq(field->port->machine, field->type, field->player, (input_seq_type)seqtype);
if (input_seq_cmp(defseq, &settings->seq[seqtype]) == 0) if (input_seq_cmp(defseq, &settings->seq[seqtype]) == 0)
field->state->seq[seqtype] = default_seq; field->state->seq[seqtype] = default_seq;
else else
@ -1500,7 +1500,7 @@ static void init_port_types(running_machine *machine)
for (typenum = 0; typenum < ARRAY_LENGTH(core_types); typenum++) for (typenum = 0; typenum < ARRAY_LENGTH(core_types); typenum++)
{ {
/* allocate memory for the state and link it to the end of the list */ /* allocate memory for the state and link it to the end of the list */
*stateptr = auto_malloc(sizeof(**stateptr)); *stateptr = (input_type_state *)auto_malloc(sizeof(**stateptr));
memset(*stateptr, 0, sizeof(**stateptr)); memset(*stateptr, 0, sizeof(**stateptr));
/* copy the type description and link the previous description to it */ /* copy the type description and link the previous description to it */
@ -1550,7 +1550,7 @@ static void init_port_state(running_machine *machine)
input_port_state *portstate; input_port_state *portstate;
/* allocate a new input_port_info structure */ /* allocate a new input_port_info structure */
portstate = auto_malloc(sizeof(*portstate)); portstate = (input_port_state *)auto_malloc(sizeof(*portstate));
memset(portstate, 0, sizeof(*portstate)); memset(portstate, 0, sizeof(*portstate));
((input_port_config *)port)->state = portstate; ((input_port_config *)port)->state = portstate;
((input_port_config *)port)->machine = machine; ((input_port_config *)port)->machine = machine;
@ -1567,7 +1567,7 @@ static void init_port_state(running_machine *machine)
int seqtype; int seqtype;
/* allocate a new input_field_info structure */ /* allocate a new input_field_info structure */
fieldstate = auto_malloc(sizeof(*fieldstate)); fieldstate = (input_field_state *)auto_malloc(sizeof(*fieldstate));
memset(fieldstate, 0, sizeof(*fieldstate)); memset(fieldstate, 0, sizeof(*fieldstate));
((input_field_config *)field)->state = fieldstate; ((input_field_config *)field)->state = fieldstate;
@ -1714,7 +1714,7 @@ static callback_field_info *init_field_callback_info(const input_field_config *f
input_port_value mask; input_port_value mask;
/* allocate memory */ /* allocate memory */
info = auto_malloc(sizeof(*info)); info = (callback_field_info *)auto_malloc(sizeof(*info));
memset(info, 0, sizeof(*info)); memset(info, 0, sizeof(*info));
/* fill in the data */ /* fill in the data */
@ -1737,7 +1737,7 @@ static analog_field_state *init_field_analog_state(const input_field_config *fie
input_port_value mask; input_port_value mask;
/* allocate memory */ /* allocate memory */
state = auto_malloc(sizeof(*state)); state = (analog_field_state *)auto_malloc(sizeof(*state));
memset(state, 0, sizeof(*state)); memset(state, 0, sizeof(*state));
/* compute the shift amount and number of bits */ /* compute the shift amount and number of bits */
@ -2403,7 +2403,7 @@ static input_port_config *port_config_detokenize(input_port_config *listhead, co
TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32); TOKEN_GET_UINT64_UNPACK2(ipt, mask, 32, defval, 32);
if (curport == NULL) if (curport == NULL)
return error_buf_append(errorbuf, errorbuflen, "INPUT_TOKEN_FIELD encountered with no active port (mask=%X defval=%X)\n", mask, defval); return (input_port_config *)error_buf_append(errorbuf, errorbuflen, "INPUT_TOKEN_FIELD encountered with no active port (mask=%X defval=%X)\n", mask, defval);
if (curfield != NULL) if (curfield != NULL)
field_config_insert(curfield, &maskbits, errorbuf, errorbuflen); field_config_insert(curfield, &maskbits, errorbuf, errorbuflen);
@ -2953,7 +2953,7 @@ static input_port_config *port_config_alloc(const input_port_config **listhead)
input_port_config *config; input_port_config *config;
/* allocate memory */ /* allocate memory */
config = malloc_or_die(sizeof(*config)); config = (input_port_config *)malloc_or_die(sizeof(*config));
memset(config, 0, sizeof(*config)); memset(config, 0, sizeof(*config));
/* add it to the tail */ /* add it to the tail */
@ -3015,7 +3015,7 @@ static input_field_config *field_config_alloc(input_port_config *port, int type,
int seqtype; int seqtype;
/* allocate memory */ /* allocate memory */
config = malloc_or_die(sizeof(*config)); config = (input_field_config *)malloc_or_die(sizeof(*config));
memset(config, 0, sizeof(*config)); memset(config, 0, sizeof(*config));
/* fill in the basic field values */ /* fill in the basic field values */
@ -3123,7 +3123,7 @@ static input_setting_config *setting_config_alloc(input_field_config *field, inp
input_setting_config *config; input_setting_config *config;
/* allocate memory */ /* allocate memory */
config = malloc_or_die(sizeof(*config)); config = (input_setting_config *)malloc_or_die(sizeof(*config));
memset(config, 0, sizeof(*config)); memset(config, 0, sizeof(*config));
/* fill in the basic setting values */ /* fill in the basic setting values */
@ -3183,7 +3183,7 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
const char *comma, *colon, *number; const char *comma, *colon, *number;
/* allocate a new entry */ /* allocate a new entry */
*tailptr = malloc_or_die(sizeof(**tailptr)); *tailptr = (input_field_diplocation *)malloc_or_die(sizeof(**tailptr));
memset(*tailptr, 0, sizeof(**tailptr)); memset(*tailptr, 0, sizeof(**tailptr));
entries++; entries++;
@ -3203,7 +3203,7 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
/* allocate and copy the name if it is present */ /* allocate and copy the name if it is present */
if (colon != NULL) if (colon != NULL)
{ {
(*tailptr)->swname = lastname = malloc_or_die(colon - tempbuf + 1); (*tailptr)->swname = lastname = (char *)malloc_or_die(colon - tempbuf + 1);
strncpy(lastname, tempbuf, colon - tempbuf); strncpy(lastname, tempbuf, colon - tempbuf);
lastname[colon - tempbuf] = 0; lastname[colon - tempbuf] = 0;
number = colon + 1; number = colon + 1;
@ -3218,7 +3218,7 @@ static const input_field_diplocation *diplocation_list_alloc(const input_field_c
error_buf_append(errorbuf, errorbuflen, "Switch location '%s' missing switch name!\n", location); error_buf_append(errorbuf, errorbuflen, "Switch location '%s' missing switch name!\n", location);
lastname = (char *)"UNK"; lastname = (char *)"UNK";
} }
(*tailptr)->swname = namecopy = malloc_or_die(strlen(lastname) + 1); (*tailptr)->swname = namecopy = (char *)malloc_or_die(strlen(lastname) + 1);
strcpy(namecopy, lastname); strcpy(namecopy, lastname);
} }
@ -3450,8 +3450,8 @@ static void load_remap_table(running_machine *machine, xml_data_node *parentnode
int remapnum; int remapnum;
/* allocate tables */ /* allocate tables */
oldtable = malloc_or_die(count * sizeof(*oldtable)); oldtable = (input_code *)malloc_or_die(count * sizeof(*oldtable));
newtable = malloc_or_die(count * sizeof(*newtable)); newtable = (input_code *)malloc_or_die(count * sizeof(*newtable));
/* build up the remap table */ /* build up the remap table */
count = 0; count = 0;

View File

@ -59,6 +59,7 @@ enum _input_seq_type
SEQ_TYPE_TOTAL SEQ_TYPE_TOTAL
}; };
typedef enum _input_seq_type input_seq_type; typedef enum _input_seq_type input_seq_type;
DECLARE_ENUM_OPERATORS(input_seq_type)
/* conditions for DIP switches */ /* conditions for DIP switches */

View File

@ -677,7 +677,7 @@ static void input_frame(running_machine *machine)
int changed = FALSE; int changed = FALSE;
/* update the state of all the keys and see if any changed state */ /* update the state of all the keys and see if any changed state */
for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
@ -695,7 +695,7 @@ static void input_frame(running_machine *machine)
} }
/* if the keyboard state is stable, copy it over */ /* if the keyboard state is stable, copy it over */
for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
@ -729,7 +729,7 @@ input_device *input_device_add(running_machine *machine, input_device_class devc
assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM); assert(devclass != DEVICE_CLASS_INVALID && devclass < DEVICE_CLASS_MAXIMUM);
/* allocate a new device */ /* allocate a new device */
devlist->list = auto_realloc(devlist->list, (devlist->count + 1) * sizeof(devlist->list[0])); devlist->list = (input_device *)auto_realloc(devlist->list, (devlist->count + 1) * sizeof(devlist->list[0]));
device = &devlist->list[devlist->count++]; device = &devlist->list[devlist->count++];
memset(device, 0, sizeof(*device)); memset(device, 0, sizeof(*device));
@ -769,7 +769,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
/* if we have a generic ID, pick a new internal one */ /* if we have a generic ID, pick a new internal one */
if (itemid >= ITEM_ID_OTHER_SWITCH && itemid <= ITEM_ID_OTHER_AXIS_RELATIVE) if (itemid >= ITEM_ID_OTHER_SWITCH && itemid <= ITEM_ID_OTHER_AXIS_RELATIVE)
for (itemid = ITEM_ID_MAXIMUM + 1; itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; itemid++) for (itemid = (input_item_id)(ITEM_ID_MAXIMUM + 1); itemid <= ITEM_ID_ABSOLUTE_MAXIMUM; itemid++)
if (device->item[itemid] == NULL) if (device->item[itemid] == NULL)
break; break;
assert(itemid <= ITEM_ID_ABSOLUTE_MAXIMUM); assert(itemid <= ITEM_ID_ABSOLUTE_MAXIMUM);
@ -778,7 +778,7 @@ void input_device_item_add(input_device *device, const char *name, void *interna
assert(device->item[itemid] == NULL); assert(device->item[itemid] == NULL);
/* allocate a new item and copy data into it */ /* allocate a new item and copy data into it */
item = auto_malloc(sizeof(*item)); item = (input_device_item *)auto_malloc(sizeof(*item));
memset(item, 0, sizeof(*item)); memset(item, 0, sizeof(*item));
device->item[itemid] = item; device->item[itemid] = item;
device->maxitem = MAX(device->maxitem, itemid); device->maxitem = MAX(device->maxitem, itemid);
@ -947,7 +947,7 @@ input_code input_code_from_input_item_id(input_item_id itemid)
input_device_class devclass; input_device_class devclass;
/* iterate over device classes and devices */ /* iterate over device classes and devices */
for (devclass = DEVICE_CLASS_INVALID + 1; devclass < DEVICE_CLASS_MAXIMUM; devclass++) for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
{ {
input_device_list *devlist = &device_list[devclass]; input_device_list *devlist = &device_list[devclass];
int devnum; int devnum;
@ -977,7 +977,7 @@ input_code input_code_poll_switches(int reset)
code_pressed_memory_reset(); code_pressed_memory_reset();
/* iterate over device classes and devices */ /* iterate over device classes and devices */
for (devclass = DEVICE_CLASS_INVALID + 1; devclass < DEVICE_CLASS_MAXIMUM; devclass++) for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
{ {
input_device_list *devlist = &device_list[devclass]; input_device_list *devlist = &device_list[devclass];
int devnum; int devnum;
@ -989,7 +989,7 @@ input_code input_code_poll_switches(int reset)
input_item_id itemid; input_item_id itemid;
/* iterate over items within each device */ /* iterate over items within each device */
for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL) if (item != NULL)
@ -1072,7 +1072,7 @@ input_code input_code_poll_keyboard_switches(int reset)
input_item_id itemid; input_item_id itemid;
/* iterate over items within each device */ /* iterate over items within each device */
for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH) if (item != NULL && item->itemclass == ITEM_CLASS_SWITCH)
@ -1098,7 +1098,7 @@ input_code input_code_poll_axes(int reset)
input_device_class devclass; input_device_class devclass;
/* iterate over device classes and devices */ /* iterate over device classes and devices */
for (devclass = DEVICE_CLASS_INVALID + 1; devclass < DEVICE_CLASS_MAXIMUM; devclass++) for (devclass = DEVICE_CLASS_FIRST_VALID; devclass < DEVICE_CLASS_MAXIMUM; devclass++)
{ {
input_device_list *devlist = &device_list[devclass]; input_device_list *devlist = &device_list[devclass];
int devnum; int devnum;
@ -1110,7 +1110,7 @@ input_code input_code_poll_axes(int reset)
input_item_id itemid; input_item_id itemid;
/* iterate over items within each device */ /* iterate over items within each device */
for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL) if (item != NULL)
@ -1292,7 +1292,7 @@ input_code input_code_from_token(const char *_token)
for (numtokens = 0; numtokens < ARRAY_LENGTH(token); ) for (numtokens = 0; numtokens < ARRAY_LENGTH(token); )
{ {
/* make a token up to the next underscore */ /* make a token up to the next underscore */
char *score = strchr(_token, '_'); char *score = (char *)strchr(_token, '_');
token[numtokens++] = astring_dupch(_token, (score == NULL) ? strlen(_token) : (score - _token)); token[numtokens++] = astring_dupch(_token, (score == NULL) ? strlen(_token) : (score - _token));
/* if we hit the end, we're done, else advance our pointer */ /* if we hit the end, we're done, else advance our pointer */
@ -1323,7 +1323,7 @@ input_code input_code_from_token(const char *_token)
/* if we're a standard code, default the itemclass based on it */ /* if we're a standard code, default the itemclass based on it */
if (standard) if (standard)
itemclass = input_item_standard_class(devclass, itemid); itemclass = input_item_standard_class((input_device_class)devclass, (input_item_id)itemid);
/* otherwise, keep parsing */ /* otherwise, keep parsing */
else else
@ -1336,7 +1336,7 @@ input_code input_code_from_token(const char *_token)
device = &device_list[devclass].list[devindex]; device = &device_list[devclass].list[devindex];
/* if not a standard code, look it up in the device specific codes */ /* if not a standard code, look it up in the device specific codes */
for (itemid = ITEM_ID_INVALID + 1; itemid <= device->maxitem; itemid++) for (itemid = ITEM_ID_FIRST_VALID; itemid <= device->maxitem; itemid++)
{ {
input_device_item *item = device->item[itemid]; input_device_item *item = device->item[itemid];
if (item != NULL && item->token != NULL && astring_cmp(token[curtok], item->token) == 0) if (item != NULL && item->token != NULL && astring_cmp(token[curtok], item->token) == 0)

View File

@ -74,13 +74,15 @@
enum _input_device_class enum _input_device_class
{ {
DEVICE_CLASS_INVALID, DEVICE_CLASS_INVALID,
DEVICE_CLASS_KEYBOARD, DEVICE_CLASS_FIRST_VALID,
DEVICE_CLASS_KEYBOARD = DEVICE_CLASS_FIRST_VALID,
DEVICE_CLASS_MOUSE, DEVICE_CLASS_MOUSE,
DEVICE_CLASS_LIGHTGUN, DEVICE_CLASS_LIGHTGUN,
DEVICE_CLASS_JOYSTICK, DEVICE_CLASS_JOYSTICK,
DEVICE_CLASS_MAXIMUM DEVICE_CLASS_MAXIMUM
}; };
typedef enum _input_device_class input_device_class; typedef enum _input_device_class input_device_class;
DECLARE_ENUM_OPERATORS(input_device_class)
/* input item classes */ /* input item classes */
@ -114,9 +116,10 @@ typedef enum _input_item_modifier input_item_modifier;
enum _input_item_id enum _input_item_id
{ {
ITEM_ID_INVALID, ITEM_ID_INVALID,
ITEM_ID_FIRST_VALID,
/* standard keyboard IDs */ /* standard keyboard IDs */
ITEM_ID_A, ITEM_ID_A = ITEM_ID_FIRST_VALID,
ITEM_ID_B, ITEM_ID_B,
ITEM_ID_C, ITEM_ID_C,
ITEM_ID_D, ITEM_ID_D,
@ -334,6 +337,7 @@ enum _input_item_id
ITEM_ID_ABSOLUTE_MAXIMUM = 0xfff ITEM_ID_ABSOLUTE_MAXIMUM = 0xfff
}; };
typedef enum _input_item_id input_item_id; typedef enum _input_item_id input_item_id;
DECLARE_ENUM_OPERATORS(input_item_id)
/* expanded codes referencing specific devices for input definitions */ /* expanded codes referencing specific devices for input definitions */

View File

@ -361,7 +361,7 @@ int input_seq_poll(input_seq *finalseq)
{ {
/* increment the modifier, wrapping back to none */ /* increment the modifier, wrapping back to none */
input_item_modifier oldmod = INPUT_CODE_MODIFIER(lastcode); input_item_modifier oldmod = INPUT_CODE_MODIFIER(lastcode);
input_item_modifier newmod = (oldmod < ITEM_MODIFIER_NEG) ? oldmod + 1 : ITEM_MODIFIER_NONE; input_item_modifier newmod = (oldmod < ITEM_MODIFIER_NEG) ? (input_item_modifier)(oldmod + 1) : ITEM_MODIFIER_NONE;
newcode = INPUT_CODE_SET_MODIFIER(newcode, newmod); newcode = INPUT_CODE_SET_MODIFIER(newcode, newmod);
/* back up over the previous code so we can re-append */ /* back up over the previous code so we can re-append */
@ -511,7 +511,7 @@ astring *input_seq_to_tokens(astring *string, const input_seq *seq)
int input_seq_from_tokens(const char *string, input_seq *seq) int input_seq_from_tokens(const char *string, input_seq *seq)
{ {
char *strcopy = malloc_or_die(strlen(string) + 1); char *strcopy = (char *)malloc_or_die(strlen(string) + 1);
char *str = strcopy; char *str = strcopy;
int result = FALSE; int result = FALSE;

View File

@ -380,7 +380,7 @@ static void via_shift(const device_config *device)
static TIMER_CALLBACK( via_shift_callback ) static TIMER_CALLBACK( via_shift_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
via_shift(device); via_shift(device);
} }
@ -391,7 +391,7 @@ static TIMER_CALLBACK( via_shift_callback )
static TIMER_CALLBACK( via_t1_timeout ) static TIMER_CALLBACK( via_t1_timeout )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
via6522_t *v = get_token(device); via6522_t *v = get_token(device);
if (T1_CONTINUOUS (v->acr)) if (T1_CONTINUOUS (v->acr))
@ -424,7 +424,7 @@ static TIMER_CALLBACK( via_t1_timeout )
static TIMER_CALLBACK( via_t2_timeout ) static TIMER_CALLBACK( via_t2_timeout )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
via6522_t *v = get_token(device); via6522_t *v = get_token(device);
v->t2_active = 0; v->t2_active = 0;

View File

@ -448,7 +448,7 @@ static void cia_timer_underflow(const device_config *device, int timer)
static TIMER_CALLBACK( cia_timer_proc ) static TIMER_CALLBACK( cia_timer_proc )
{ {
cia_timer *timer = ptr; cia_timer *timer = (cia_timer *)ptr;
cia_state *cia = timer->cia; cia_state *cia = timer->cia;
cia_timer_underflow(cia->device, timer - cia->timer); cia_timer_underflow(cia->device, timer - cia->timer);
@ -554,7 +554,7 @@ void cia_clock_tod(const device_config *device)
static TIMER_CALLBACK( cia_clock_tod_callback ) static TIMER_CALLBACK( cia_clock_tod_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
cia_clock_tod(device); cia_clock_tod(device);
} }

View File

@ -166,7 +166,7 @@ INLINE UINT8 get_timer(riot6532_state *riot)
static TIMER_CALLBACK( timer_end_callback ) static TIMER_CALLBACK( timer_end_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
riot6532_state *riot = get_safe_token(device); riot6532_state *riot = get_safe_token(device);
assert(riot->timerstate != TIMER_IDLE); assert(riot->timerstate != TIMER_IDLE);
@ -434,7 +434,7 @@ static DEVICE_START( riot6532 )
/* set static values */ /* set static values */
riot->device = device; riot->device = device;
riot->intf = device->static_config; riot->intf = (riot6532_interface *)device->static_config;
riot->index = device_list_index(device->machine->config->devicelist, RIOT6532, device->tag); riot->index = device_list_index(device->machine->config->devicelist, RIOT6532, device->tag);
/* configure the ports */ /* configure the ports */

View File

@ -355,7 +355,7 @@ static void reload_count(running_machine *machine, int which, int idx)
if (idx == 2) duration = attotime_mul(duration, currptr->t3_divisor); if (idx == 2) duration = attotime_mul(duration, currptr->t3_divisor);
PLOG(("MC6840 #%d: reload_count(%d): output = %lf\n", which, idx, attotime_to_double(duration))); PLOG(("MC6840 #%d: reload_count(%d): output = %lf\n", which, idx, attotime_to_double(duration)));
if (!currptr->control_reg[idx] & 0x02) if (!(currptr->control_reg[idx] & 0x02))
{ {
if (!currptr->intf->external_clock[idx]) if (!currptr->intf->external_clock[idx])
{ {
@ -739,7 +739,7 @@ void ptm6840_set_ext_clock(int which, int counter, int clock)
ptm6840 *currptr = ptm + which; ptm6840 *currptr = ptm + which;
currptr->external_clock[counter] = clock; currptr->external_clock[counter] = clock;
if (!currptr->control_reg[counter] & 0x02) if (!(currptr->control_reg[counter] & 0x02))
{ {
if (!currptr->intf->external_clock[counter]) if (!currptr->intf->external_clock[counter])
{ {

View File

@ -39,12 +39,13 @@ enum serial_state
STOP2, STOP2,
}; };
enum parity_type enum _parity_type
{ {
NONE, NONE,
ODD, ODD,
EVEN EVEN
}; };
typedef enum _parity_type parity_type;
typedef struct _acia6850_t acia6850_t; typedef struct _acia6850_t acia6850_t;
struct _acia6850_t struct _acia6850_t
@ -80,7 +81,7 @@ struct _acia6850_t
/* TX/RX state */ /* TX/RX state */
int bits; int bits;
enum parity_type parity; parity_type parity;
int stopbits; int stopbits;
int tx_int; int tx_int;
@ -295,7 +296,7 @@ WRITE8_DEVICE_HANDLER( acia6850_ctrl_w )
wordsel = (data & CR4_2) >> 2; wordsel = (data & CR4_2) >> 2;
acia_p->bits = ACIA6850_WORD[wordsel][0]; acia_p->bits = ACIA6850_WORD[wordsel][0];
acia_p->parity = ACIA6850_WORD[wordsel][1]; acia_p->parity = (parity_type)ACIA6850_WORD[wordsel][1];
acia_p->stopbits = ACIA6850_WORD[wordsel][2]; acia_p->stopbits = ACIA6850_WORD[wordsel][2];
// Transmitter Control Bits // Transmitter Control Bits
@ -565,7 +566,7 @@ static void tx_tick(const device_config *device)
static TIMER_CALLBACK( transmit_event ) static TIMER_CALLBACK( transmit_event )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
acia6850_t *acia_p = get_token(device); acia6850_t *acia_p = get_token(device);
tx_tick(device); tx_tick(device);
acia_p->tx_counter = 0; acia_p->tx_counter = 0;
@ -756,7 +757,7 @@ static void rx_tick(const device_config *device)
static TIMER_CALLBACK( receive_event ) static TIMER_CALLBACK( receive_event )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
acia6850_t *acia_p = get_token(device); acia6850_t *acia_p = get_token(device);
rx_tick(device); rx_tick(device);
acia_p->rx_counter = 0; acia_p->rx_counter = 0;

View File

@ -120,7 +120,7 @@ static void duart68681_update_interrupts(duart68681_state *duart68681)
static TIMER_CALLBACK( duart_timer_callback ) static TIMER_CALLBACK( duart_timer_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
duart68681_state *duart68681 = get_safe_token(device); duart68681_state *duart68681 = get_safe_token(device);
duart68681->ISR |= INT_COUNTER_READY; duart68681->ISR |= INT_COUNTER_READY;
@ -275,7 +275,7 @@ static UINT8 duart68681_read_rx_fifo(duart68681_state *duart68681, int ch)
static TIMER_CALLBACK( tx_timer_callback ) static TIMER_CALLBACK( tx_timer_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
duart68681_state *duart68681 = get_safe_token(device); duart68681_state *duart68681 = get_safe_token(device);
int ch = param & 1; int ch = param & 1;
@ -592,7 +592,7 @@ static DEVICE_RESET(duart68681)
duart68681_state *duart68681 = get_safe_token(device); duart68681_state *duart68681 = get_safe_token(device);
memset(duart68681, 0, sizeof(duart68681_state)); memset(duart68681, 0, sizeof(duart68681_state));
duart68681->duart_config = device->static_config; duart68681->duart_config = (const duart68681_config *)device->static_config;
duart68681->device = device; duart68681->device = device;
duart68681->IVR = 0x0f; duart68681->IVR = 0x0f;

View File

@ -73,7 +73,7 @@ static int timer_running(ttl74123_t *chip)
static TIMER_CALLBACK( output_callback ) static TIMER_CALLBACK( output_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
ttl74123_t *chip = get_safe_token(device); ttl74123_t *chip = get_safe_token(device);
chip->intf->output_changed_cb(device, 0, param); chip->intf->output_changed_cb(device, 0, param);
@ -93,7 +93,7 @@ static void set_output(const device_config *device)
static TIMER_CALLBACK( clear_callback ) static TIMER_CALLBACK( clear_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
ttl74123_t *chip = get_safe_token(device); ttl74123_t *chip = get_safe_token(device);
int output = timer_running(chip); int output = timer_running(chip);
@ -191,7 +191,7 @@ static DEVICE_START( ttl74123 )
ttl74123_t *chip = get_safe_token(device); ttl74123_t *chip = get_safe_token(device);
/* validate arguments */ /* validate arguments */
chip->intf = device->static_config; chip->intf = (ttl74123_config *)device->static_config;
assert_always(chip->intf, "No interface specified"); assert_always(chip->intf, "No interface specified");
assert_always((chip->intf->connection_type != TTL74123_GROUNDED) || (chip->intf->cap >= CAP_U(0.01)), "Only capacitors >= 0.01uF supported for GROUNDED type"); assert_always((chip->intf->connection_type != TTL74123_GROUNDED) || (chip->intf->cap >= CAP_U(0.01)), "Only capacitors >= 0.01uF supported for GROUNDED type");

View File

@ -114,7 +114,7 @@ static int dma8237_do_operation(const device_config *device, int channel)
static TIMER_CALLBACK( dma8237_timerproc ) static TIMER_CALLBACK( dma8237_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
dma8237_t *dma8237 = get_safe_token(device); dma8237_t *dma8237 = get_safe_token(device);
int channel = param % 4; int channel = param % 4;
int done; int done;
@ -134,7 +134,7 @@ static TIMER_CALLBACK( dma8237_timerproc )
static TIMER_CALLBACK( dma8237_msbflip_timerproc ) static TIMER_CALLBACK( dma8237_msbflip_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
dma8237_t *dma8237 = get_safe_token(device); dma8237_t *dma8237 = get_safe_token(device);
dma8237->msb ^= 1; dma8237->msb ^= 1;
} }
@ -394,7 +394,7 @@ void dma8237_run_transfer(const device_config *device, int channel)
static DEVICE_START( dma8237 ) { static DEVICE_START( dma8237 ) {
dma8237_t *dma8237 = get_safe_token(device); dma8237_t *dma8237 = get_safe_token(device);
dma8237->intf = device->static_config; dma8237->intf = (struct dma8237_interface *)device->static_config;
} }

View File

@ -501,7 +501,7 @@ UINT8 ppi8255_get_port_c( const device_config *device ) {
static DEVICE_START( ppi8255 ) { static DEVICE_START( ppi8255 ) {
ppi8255_t *ppi8255 = get_safe_token(device); ppi8255_t *ppi8255 = get_safe_token(device);
ppi8255->intf = device->static_config; ppi8255->intf = (const ppi8255_interface *)device->static_config;
devcb_resolve_read8(&ppi8255->port_read[0], &ppi8255->intf->port_a_read, device); devcb_resolve_read8(&ppi8255->port_read[0], &ppi8255->intf->port_a_read, device);
devcb_resolve_read8(&ppi8255->port_read[1], &ppi8255->intf->port_b_read, device); devcb_resolve_read8(&ppi8255->port_read[1], &ppi8255->intf->port_b_read, device);

View File

@ -153,7 +153,7 @@ static int dma8257_do_operation(const device_config *device, int channel)
static TIMER_CALLBACK( dma8257_timerproc ) static TIMER_CALLBACK( dma8257_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
dma8257_t *dma8257 = get_safe_token(device); dma8257_t *dma8257 = get_safe_token(device);
int i, channel = 0, rr; int i, channel = 0, rr;
int done; int done;
@ -186,7 +186,7 @@ static TIMER_CALLBACK( dma8257_timerproc )
static TIMER_CALLBACK( dma8257_msbflip_timerproc ) static TIMER_CALLBACK( dma8257_msbflip_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
dma8257_t *dma8257 = get_safe_token(device); dma8257_t *dma8257 = get_safe_token(device);
dma8257->msb ^= 1; dma8257->msb ^= 1;
} }
@ -324,7 +324,7 @@ WRITE8_DEVICE_HANDLER( dma8257_w )
static TIMER_CALLBACK( dma8257_drq_write_callback ) static TIMER_CALLBACK( dma8257_drq_write_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
dma8257_t *dma8257 = get_safe_token(device); dma8257_t *dma8257 = get_safe_token(device);
int channel = param >> 1; int channel = param >> 1;
int state = param & 0x01; int state = param & 0x01;
@ -368,7 +368,7 @@ static DEVICE_START( dma8257 )
assert(device->tag != NULL); assert(device->tag != NULL);
//dma8257->device_type = device_type; //dma8257->device_type = device_type;
dma8257->intf = device->static_config; dma8257->intf = (dma8257_interface *)device->static_config;
dma8257->status = 0x0f; dma8257->status = 0x0f;
dma8257->timer = timer_alloc(device->machine, dma8257_timerproc, (void *) device); dma8257->timer = timer_alloc(device->machine, dma8257_timerproc, (void *) device);

View File

@ -137,15 +137,15 @@ static DEVICE_START(at28c16)
assert(device->machine != NULL); assert(device->machine != NULL);
assert(device->machine->config != NULL); assert(device->machine->config != NULL);
c->data = auto_malloc( SIZE_DATA ); c->data = (UINT8 *)auto_malloc( SIZE_DATA );
c->id = auto_malloc( SIZE_ID ); c->id = (UINT8 *)auto_malloc( SIZE_ID );
c->a9_12v = 0; c->a9_12v = 0;
c->oe_12v = 0; c->oe_12v = 0;
c->last_write = -1; c->last_write = -1;
c->write_timer = timer_alloc(device->machine, write_finished, c ); c->write_timer = timer_alloc(device->machine, write_finished, c );
c->default_data = device->region; c->default_data = device->region;
config = device->inline_config; config = (const at28c16_config *)device->inline_config;
if (config->id != NULL) if (config->id != NULL)
c->default_id = memory_region( device->machine, config->id ); c->default_id = memory_region( device->machine, config->id );

View File

@ -75,7 +75,7 @@ static void set_sr_line(cdp1852_t *cdp1852, int level)
static TIMER_CALLBACK( cdp1852_scan_tick ) static TIMER_CALLBACK( cdp1852_scan_tick )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
cdp1852_t *cdp1852 = get_safe_token(device); cdp1852_t *cdp1852 = get_safe_token(device);
switch (cdp1852->mode) switch (cdp1852->mode)
@ -161,7 +161,7 @@ static DEVICE_START( cdp1852 )
devcb_resolve_write_line(&cdp1852->out_sr_func, &intf->out_sr_func, device); devcb_resolve_write_line(&cdp1852->out_sr_func, &intf->out_sr_func, device);
/* set initial values */ /* set initial values */
cdp1852->mode = intf->mode; cdp1852->mode = (cdp1852_mode)intf->mode;
if (device->clock > 0) if (device->clock > 0)
{ {

View File

@ -49,11 +49,11 @@
TYPE DEFINITIONS TYPE DEFINITIONS
***************************************************************************/ ***************************************************************************/
typedef enum _cdp1852_mode cdp1852_mode;
enum _cdp1852_mode { enum _cdp1852_mode {
CDP1852_MODE_INPUT = 0, CDP1852_MODE_INPUT = 0,
CDP1852_MODE_OUTPUT CDP1852_MODE_OUTPUT
}; };
typedef enum _cdp1852_mode cdp1852_mode;
typedef struct _cdp1852_interface cdp1852_interface; typedef struct _cdp1852_interface cdp1852_interface;
struct _cdp1852_interface struct _cdp1852_interface

View File

@ -20,7 +20,7 @@ static int cr589_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance ); SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch( command[ 0 ] ) switch( command[ 0 ] )
@ -48,7 +48,7 @@ static void cr589_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataLe
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance ); SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch( command[ 0 ] ) switch( command[ 0 ] )
@ -81,7 +81,7 @@ static void cr589_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance ); SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch( command[ 0 ] ) switch( command[ 0 ] )
@ -111,7 +111,7 @@ static void cr589_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void cr589_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = scsiInstance->machine; running_machine *machine = scsiInstance->machine;
SCSICr589 *our_this = SCSIThis( &SCSIClassCr589, scsiInstance ); SCSICr589 *our_this = (SCSICr589 *)SCSIThis( &SCSIClassCr589, scsiInstance );
our_this->download = 0; our_this->download = 0;
memcpy( &our_this->buffer[ identity_offset ], "MATSHITACD-ROM CR-589 GS0N", 28 ); memcpy( &our_this->buffer[ identity_offset ], "MATSHITACD-ROM CR-589 GS0N", 28 );
@ -128,24 +128,24 @@ static int cr589_dispatch( int operation, void *file, INT64 intparm, void *ptrpa
switch( operation ) switch( operation )
{ {
case SCSIOP_EXEC_COMMAND: case SCSIOP_EXEC_COMMAND:
return cr589_exec_command( file, ptrparm ); return cr589_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
case SCSIOP_READ_DATA: case SCSIOP_READ_DATA:
cr589_read_data( file, ptrparm, intparm ); cr589_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_WRITE_DATA: case SCSIOP_WRITE_DATA:
cr589_write_data( file, ptrparm, intparm ); cr589_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_ALLOC_INSTANCE: case SCSIOP_ALLOC_INSTANCE:
params = ptrparm; params = (SCSIAllocInstanceParams *)ptrparm;
SCSIBase( &SCSIClassCr589, operation, file, intparm, ptrparm ); SCSIBase( &SCSIClassCr589, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
cr589_alloc_instance( params->instance, params->diskregion ); cr589_alloc_instance( params->instance, params->diskregion );
return 0; return 0;
} }
return SCSIBase( &SCSIClassCr589, operation, file, intparm, ptrparm ); return SCSIBase( &SCSIClassCr589, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
} }
const SCSIClass SCSIClassCr589 = const SCSIClass SCSIClassCr589 =

View File

@ -83,7 +83,7 @@ static void f3853_timer_start(const device_config *device, UINT8 value)
static TIMER_CALLBACK( f3853_timer_callback ) static TIMER_CALLBACK( f3853_timer_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
f3853_t *f3853 = get_safe_token( device ); f3853_t *f3853 = get_safe_token( device );
if (f3853->timer_enable) if (f3853->timer_enable)
@ -167,7 +167,7 @@ static DEVICE_START( f3853 )
UINT8 reg=0xfe; UINT8 reg=0xfe;
int i; int i;
f3853->config = device->static_config; f3853->config = (const f3853_config *)device->static_config;
for (i=254/*known to get 0xfe after 255 cycles*/; i>=0; i--) for (i=254/*known to get 0xfe after 255 cycles*/; i>=0; i--)
{ {

View File

@ -373,7 +373,7 @@ NVRAM_HANDLER( generic_randfill )
mame_fread(file, nvram_select(), generic_nvram_size); mame_fread(file, nvram_select(), generic_nvram_size);
else else
{ {
UINT8 *nvram = nvram_select(); UINT8 *nvram = (UINT8 *)nvram_select();
for (i = 0; i < generic_nvram_size; i++) for (i = 0; i < generic_nvram_size; i++)
nvram[i] = mame_rand(machine); nvram[i] = mame_rand(machine);
} }
@ -570,7 +570,7 @@ static void interrupt_reset(running_machine *machine)
static TIMER_CALLBACK( clear_all_lines ) static TIMER_CALLBACK( clear_all_lines )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
int inputcount = cpu_get_input_lines(device); int inputcount = cpu_get_input_lines(device);
int line; int line;
@ -587,7 +587,7 @@ static TIMER_CALLBACK( clear_all_lines )
static TIMER_CALLBACK( irq_pulse_clear ) static TIMER_CALLBACK( irq_pulse_clear )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
int irqline = param; int irqline = param;
cpu_set_input_line(device, irqline, CLEAR_LINE); cpu_set_input_line(device, irqline, CLEAR_LINE);
} }
@ -770,6 +770,6 @@ READ32_HANDLER( watchdog_reset32_r ) { watchdog_reset(space->machine); return 0x
CUSTOM_INPUT( custom_port_read ) CUSTOM_INPUT( custom_port_read )
{ {
const char *tag = param; const char *tag = (const char *)param;
return input_port_read(field->port->machine, tag); return input_port_read(field->port->machine, tag);
} }

View File

@ -86,12 +86,12 @@ void i2cmem_init( running_machine *machine, int chip, int slave_address, int pag
if( data == NULL ) if( data == NULL )
{ {
data = auto_malloc( data_size ); data = (unsigned char *)auto_malloc( data_size );
} }
if( page_size > 0 ) if( page_size > 0 )
{ {
page = auto_malloc( page_size ); page = (unsigned char *)auto_malloc( page_size );
} }
c->slave_address = slave_address; c->slave_address = slave_address;

View File

@ -196,7 +196,7 @@ INLINE ide_state *get_safe_token(const device_config *device)
INLINE void signal_interrupt(ide_state *ide) INLINE void signal_interrupt(ide_state *ide)
{ {
const ide_config *config = ide->device->inline_config; const ide_config *config = (const ide_config *)ide->device->inline_config;
LOG(("IDE interrupt assert\n")); LOG(("IDE interrupt assert\n"));
@ -210,7 +210,7 @@ INLINE void signal_interrupt(ide_state *ide)
INLINE void clear_interrupt(ide_state *ide) INLINE void clear_interrupt(ide_state *ide)
{ {
const ide_config *config = ide->device->inline_config; const ide_config *config = (const ide_config *)ide->device->inline_config;
LOG(("IDE interrupt clear\n")); LOG(("IDE interrupt clear\n"));
@ -228,7 +228,7 @@ INLINE void clear_interrupt(ide_state *ide)
static TIMER_CALLBACK( delayed_interrupt ) static TIMER_CALLBACK( delayed_interrupt )
{ {
ide_state *ide = ptr; ide_state *ide = (ide_state *)ptr;
ide->status &= ~IDE_STATUS_BUSY; ide->status &= ~IDE_STATUS_BUSY;
signal_interrupt(ide); signal_interrupt(ide);
} }
@ -236,7 +236,7 @@ static TIMER_CALLBACK( delayed_interrupt )
static TIMER_CALLBACK( delayed_interrupt_buffer_ready ) static TIMER_CALLBACK( delayed_interrupt_buffer_ready )
{ {
ide_state *ide = ptr; ide_state *ide = (ide_state *)ptr;
ide->status &= ~IDE_STATUS_BUSY; ide->status &= ~IDE_STATUS_BUSY;
ide->status |= IDE_STATUS_BUFFER_READY; ide->status |= IDE_STATUS_BUFFER_READY;
signal_interrupt(ide); signal_interrupt(ide);
@ -289,7 +289,7 @@ void ide_set_user_password(const device_config *device, const UINT8 *password)
static TIMER_CALLBACK( reset_callback ) static TIMER_CALLBACK( reset_callback )
{ {
device_reset(ptr); device_reset((const device_config *)ptr);
} }
@ -595,7 +595,7 @@ static void ide_build_features(ide_state *ide)
static TIMER_CALLBACK( security_error_done ) static TIMER_CALLBACK( security_error_done )
{ {
ide_state *ide = ptr; ide_state *ide = (ide_state *)ptr;
/* clear error state */ /* clear error state */
ide->status &= ~IDE_STATUS_ERROR; ide->status &= ~IDE_STATUS_ERROR;
@ -763,7 +763,7 @@ static void read_sector_done(ide_state *ide)
static TIMER_CALLBACK( read_sector_done_callback ) static TIMER_CALLBACK( read_sector_done_callback )
{ {
read_sector_done(ptr); read_sector_done((ide_state *)ptr);
} }
@ -965,7 +965,7 @@ static void write_sector_done(ide_state *ide)
static TIMER_CALLBACK( write_sector_done_callback ) static TIMER_CALLBACK( write_sector_done_callback )
{ {
write_sector_done(ptr); write_sector_done((ide_state *)ptr);
} }
@ -1677,7 +1677,7 @@ static DEVICE_START( ide_controller )
ide->device = device; ide->device = device;
/* set MAME harddisk handle */ /* set MAME harddisk handle */
config = device->inline_config; config = (const ide_config *)device->inline_config;
ide->disk = hard_disk_open(get_disk_handle((config->master != NULL) ? config->master : device->tag)); ide->disk = hard_disk_open(get_disk_handle((config->master != NULL) ? config->master : device->tag));
assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n"); assert_always(config->slave == NULL, "IDE controller does not yet support slave drives\n");

View File

@ -50,7 +50,7 @@ static struct flash_chip chips[FLASH_CHIPS_MAX];
static TIMER_CALLBACK( erase_finished ) static TIMER_CALLBACK( erase_finished )
{ {
struct flash_chip *c = ptr; struct flash_chip *c = (struct flash_chip *)ptr;
switch( c->flash_mode ) switch( c->flash_mode )
{ {
@ -159,13 +159,13 @@ UINT32 intelflash_read(int chip, UINT32 address)
{ {
case 8: case 8:
{ {
UINT8 *flash_memory = c->flash_memory; UINT8 *flash_memory = (UINT8 *)c->flash_memory;
data = flash_memory[ address ]; data = flash_memory[ address ];
} }
break; break;
case 16: case 16:
{ {
UINT16 *flash_memory = c->flash_memory; UINT16 *flash_memory = (UINT16 *)c->flash_memory;
data = flash_memory[ address ]; data = flash_memory[ address ];
} }
break; break;
@ -345,13 +345,13 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
{ {
case 8: case 8:
{ {
UINT8 *flash_memory = c->flash_memory; UINT8 *flash_memory = (UINT8 *)c->flash_memory;
memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 ); memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 );
} }
break; break;
case 16: case 16:
{ {
UINT16 *flash_memory = c->flash_memory; UINT16 *flash_memory = (UINT16 *)c->flash_memory;
memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 ); memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
} }
break; break;
@ -372,7 +372,7 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
{ {
case 8: case 8:
{ {
UINT8 *flash_memory = c->flash_memory; UINT8 *flash_memory = (UINT8 *)c->flash_memory;
flash_memory[ address ] = data; flash_memory[ address ] = data;
} }
break; break;
@ -387,13 +387,13 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
{ {
case 8: case 8:
{ {
UINT8 *flash_memory = c->flash_memory; UINT8 *flash_memory = (UINT8 *)c->flash_memory;
flash_memory[ address ] = data; flash_memory[ address ] = data;
} }
break; break;
case 16: case 16:
{ {
UINT16 *flash_memory = c->flash_memory; UINT16 *flash_memory = (UINT16 *)c->flash_memory;
flash_memory[ address ] = data; flash_memory[ address ] = data;
} }
break; break;
@ -412,13 +412,13 @@ void intelflash_write(int chip, UINT32 address, UINT32 data)
{ {
case 8: case 8:
{ {
UINT8 *flash_memory = c->flash_memory; UINT8 *flash_memory = (UINT8 *)c->flash_memory;
memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 ); memset( &flash_memory[ address & ~0xffff ], 0xff, 64 * 1024 );
} }
break; break;
case 16: case 16:
{ {
UINT16 *flash_memory = c->flash_memory; UINT16 *flash_memory = (UINT16 *)c->flash_memory;
memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 ); memset( &flash_memory[ address & ~0x7fff ], 0xff, 64 * 1024 );
} }
break; break;

View File

@ -51,7 +51,7 @@ static void update(const device_config *device, UINT8 new_val, UINT8 mask)
static TIMER_CALLBACK( latch8_timerproc ) static TIMER_CALLBACK( latch8_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
UINT8 new_val = param & 0xFF; UINT8 new_val = param & 0xFF;
UINT8 mask = param >> 8; UINT8 mask = param >> 8;
@ -96,7 +96,7 @@ READ8_DEVICE_HANDLER( latch8_r )
} }
} }
return (res & ~latch8->intf->maskout) ^ latch8->intf->xor; return (res & ~latch8->intf->maskout) ^ latch8->intf->xorvalue;
} }
@ -188,7 +188,7 @@ static DEVICE_START( latch8 )
int i; int i;
/* validate arguments */ /* validate arguments */
latch8->intf = device->inline_config; latch8->intf = (latch8_config *)device->inline_config;
latch8->value = 0x0; latch8->value = 0x0;

View File

@ -36,7 +36,7 @@ struct _latch8_config
{ {
/* only for byte reads, does not affect bit reads and node_map */ /* only for byte reads, does not affect bit reads and node_map */
UINT32 maskout; UINT32 maskout;
UINT32 xor; /* after mask */ UINT32 xorvalue; /* after mask */
UINT32 nosync; UINT32 nosync;
UINT32 node_map[8]; UINT32 node_map[8];
const char * node_device[8]; const char * node_device[8];
@ -57,7 +57,7 @@ struct _latch8_config
/* Bit mask specifying bits to be inverted */ /* Bit mask specifying bits to be inverted */
#define MDRV_LATCH8_INVERT(_xor) \ #define MDRV_LATCH8_INVERT(_xor) \
MDRV_DEVICE_CONFIG_DATA32(latch8_config, xor, _xor) MDRV_DEVICE_CONFIG_DATA32(latch8_config, xorvalue, _xor)
/* Bit mask specifying bits not needing cpu synchronization. */ /* Bit mask specifying bits not needing cpu synchronization. */
#define MDRV_LATCH8_NOSYNC(_nosync) \ #define MDRV_LATCH8_NOSYNC(_nosync) \

View File

@ -197,7 +197,7 @@ INLINE void update_audio(laserdisc_state *ld)
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
if (ldcore->audiocustom != NULL) if (ldcore->audiocustom != NULL)
{ {
sound_token *token = ldcore->audiocustom->token; sound_token *token = (sound_token *)ldcore->audiocustom->token;
stream_update(token->stream); stream_update(token->stream);
} }
} }
@ -290,7 +290,7 @@ static void update_slider_pos(ldcore_data *ldcore, attotime curtime)
static void vblank_state_changed(const device_config *screen, void *param, int vblank_state) static void vblank_state_changed(const device_config *screen, void *param, int vblank_state)
{ {
const device_config *device = param; const device_config *device = (const device_config *)param;
laserdisc_state *ld = get_safe_token(device); laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
attotime curtime = timer_get_time(screen->machine); attotime curtime = timer_get_time(screen->machine);
@ -318,7 +318,7 @@ static void vblank_state_changed(const device_config *screen, void *param, int v
static TIMER_CALLBACK( perform_player_update ) static TIMER_CALLBACK( perform_player_update )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
attotime curtime = timer_get_time(machine); attotime curtime = timer_get_time(machine);
@ -940,7 +940,7 @@ static void process_track_data(const device_config *device)
static DEVICE_START( laserdisc_sound ) static DEVICE_START( laserdisc_sound )
{ {
sound_token *token = device->token; sound_token *token = (sound_token *)device->token;
token->stream = stream_create(device, 0, 2, 48000, token, custom_stream_callback); token->stream = stream_create(device, 0, 2, 48000, token, custom_stream_callback);
token->ld = NULL; token->ld = NULL;
} }
@ -975,7 +975,7 @@ DEVICE_GET_INFO( laserdisc_sound )
static STREAM_UPDATE( custom_stream_callback ) static STREAM_UPDATE( custom_stream_callback )
{ {
sound_token *token = param; sound_token *token = (sound_token *)param;
laserdisc_state *ld = token->ld; laserdisc_state *ld = token->ld;
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
stream_sample_t *dst0 = outputs[0]; stream_sample_t *dst0 = outputs[0];
@ -1103,7 +1103,7 @@ static void configuration_save(running_machine *machine, int config_type, xml_da
/* iterate over disc devices */ /* iterate over disc devices */
for (device = device_list_first(machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC)) for (device = device_list_first(machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC))
{ {
laserdisc_config *origconfig = device->inline_config; laserdisc_config *origconfig = (laserdisc_config *)device->inline_config;
laserdisc_state *ld = get_safe_token(device); laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
xml_data_node *overnode; xml_data_node *overnode;
@ -1195,7 +1195,7 @@ VIDEO_UPDATE( laserdisc )
if (laserdisc != NULL) if (laserdisc != NULL)
{ {
const rectangle *visarea = video_screen_get_visible_area(screen); const rectangle *visarea = video_screen_get_visible_area(screen);
laserdisc_state *ld = laserdisc->token; laserdisc_state *ld = (laserdisc_state *)laserdisc->token;
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
bitmap_t *overbitmap = ldcore->overbitmap[ldcore->overindex]; bitmap_t *overbitmap = ldcore->overbitmap[ldcore->overindex];
bitmap_t *vidbitmap = NULL; bitmap_t *vidbitmap = NULL;
@ -1299,7 +1299,7 @@ void laserdisc_set_config(const device_config *device, const laserdisc_config *c
static void init_disc(const device_config *device) static void init_disc(const device_config *device)
{ {
const laserdisc_config *config = device->inline_config; const laserdisc_config *config = (const laserdisc_config *)device->inline_config;
laserdisc_state *ld = get_safe_token(device); laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore = ld->core; ldcore_data *ldcore = ld->core;
chd_error err; chd_error err;
@ -1349,7 +1349,7 @@ static void init_disc(const device_config *device)
ldcore->chdtracks = totalhunks / 2; ldcore->chdtracks = totalhunks / 2;
/* allocate memory for the precomputed per-frame metadata */ /* allocate memory for the precomputed per-frame metadata */
ldcore->vbidata = auto_malloc(totalhunks * VBI_PACKED_BYTES); ldcore->vbidata = (UINT8 *)auto_malloc(totalhunks * VBI_PACKED_BYTES);
err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL, NULL); err = chd_get_metadata(ldcore->disc, AV_LD_METADATA_TAG, 0, ldcore->vbidata, totalhunks * VBI_PACKED_BYTES, &vbilength, NULL, NULL);
if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES) if (err != CHDERR_NONE || vbilength != totalhunks * VBI_PACKED_BYTES)
fatalerror("Precomputed VBI metadata missing or incorrect size"); fatalerror("Precomputed VBI metadata missing or incorrect size");
@ -1382,7 +1382,7 @@ static void init_video(const device_config *device)
fillbitmap_yuy16(frame->bitmap, 40, 109, 240); fillbitmap_yuy16(frame->bitmap, 40, 109, 240);
/* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */ /* make a copy of the bitmap that clips out the VBI and horizontal blanking areas */
frame->visbitmap = auto_malloc(sizeof(*frame->visbitmap)); frame->visbitmap = (bitmap_t *)auto_malloc(sizeof(*frame->visbitmap));
*frame->visbitmap = *frame->bitmap; *frame->visbitmap = *frame->bitmap;
frame->visbitmap->base = BITMAP_ADDR16(frame->visbitmap, 44, frame->bitmap->width * 8 / 720); frame->visbitmap->base = BITMAP_ADDR16(frame->visbitmap, 44, frame->bitmap->width * 8 / 720);
frame->visbitmap->height -= 44; frame->visbitmap->height -= 44;
@ -1410,8 +1410,8 @@ static void init_video(const device_config *device)
if (ldcore->config.overwidth > 0 && ldcore->config.overheight > 0 && ldcore->config.overupdate != NULL) if (ldcore->config.overwidth > 0 && ldcore->config.overheight > 0 && ldcore->config.overupdate != NULL)
{ {
ldcore->overenable = TRUE; ldcore->overenable = TRUE;
ldcore->overbitmap[0] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, ldcore->config.overformat); ldcore->overbitmap[0] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
ldcore->overbitmap[1] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, ldcore->config.overformat); ldcore->overbitmap[1] = auto_bitmap_alloc(ldcore->config.overwidth, ldcore->config.overheight, (bitmap_format)ldcore->config.overformat);
ldcore->overtex = render_texture_alloc(NULL, NULL); ldcore->overtex = render_texture_alloc(NULL, NULL);
if (ldcore->overtex == NULL) if (ldcore->overtex == NULL)
fatalerror("Out of memory allocating overlay texture"); fatalerror("Out of memory allocating overlay texture");
@ -1435,8 +1435,8 @@ static void init_audio(const device_config *device)
/* allocate audio buffers */ /* allocate audio buffers */
ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million; ldcore->audiomaxsamples = ((UINT64)ldcore->samplerate * 1000000 + ldcore->fps_times_1million - 1) / ldcore->fps_times_1million;
ldcore->audiobufsize = ldcore->audiomaxsamples * 4; ldcore->audiobufsize = ldcore->audiomaxsamples * 4;
ldcore->audiobuffer[0] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[0][0])); ldcore->audiobuffer[0] = (INT16 *)auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[0][0]));
ldcore->audiobuffer[1] = auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[1][0])); ldcore->audiobuffer[1] = (INT16 *)auto_malloc(ldcore->audiobufsize * sizeof(ldcore->audiobuffer[1][0]));
} }
@ -1451,7 +1451,7 @@ static void init_audio(const device_config *device)
static DEVICE_START( laserdisc ) static DEVICE_START( laserdisc )
{ {
const laserdisc_config *config = device->inline_config; const laserdisc_config *config = (const laserdisc_config *)device->inline_config;
laserdisc_state *ld = get_safe_token(device); laserdisc_state *ld = get_safe_token(device);
ldcore_data *ldcore; ldcore_data *ldcore;
int statesize; int statesize;
@ -1470,7 +1470,7 @@ static DEVICE_START( laserdisc )
ld->device = device; ld->device = device;
/* allocate memory for the core state */ /* allocate memory for the core state */
ld->core = auto_malloc(sizeof(*ld->core)); ld->core = (ldcore_data *)auto_malloc(sizeof(*ld->core));
memset(ld->core, 0, sizeof(*ld->core)); memset(ld->core, 0, sizeof(*ld->core));
ldcore = ld->core; ldcore = ld->core;
@ -1478,7 +1478,7 @@ static DEVICE_START( laserdisc )
statesize = 0; statesize = 0;
for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++) for (index = 0; index < ARRAY_LENGTH(player_interfaces); index++)
statesize = MAX(statesize, player_interfaces[index]->statesize); statesize = MAX(statesize, player_interfaces[index]->statesize);
ld->player = auto_malloc(statesize); ld->player = (ldplayer_data *)auto_malloc(statesize);
memset(ld->player, 0, statesize); memset(ld->player, 0, statesize);
/* copy config data to the live state */ /* copy config data to the live state */
@ -1549,7 +1549,7 @@ static DEVICE_RESET( laserdisc )
/* attempt to wire up the audio */ /* attempt to wire up the audio */
if (ldcore->audiocustom != NULL) if (ldcore->audiocustom != NULL)
{ {
sound_token *token = ldcore->audiocustom->token; sound_token *token = (sound_token *)ldcore->audiocustom->token;
token->ld = ld; token->ld = ld;
stream_set_sample_rate(token->stream, ldcore->samplerate); stream_set_sample_rate(token->stream, ldcore->samplerate);
} }
@ -1608,8 +1608,8 @@ DEVICE_GET_INFO( laserdisc )
/* if we have a device, figure out where our config lives */ /* if we have a device, figure out where our config lives */
if (device != NULL) if (device != NULL)
{ {
laserdisc_state *ld = device->token; laserdisc_state *ld = (laserdisc_state *)device->token;
config = device->inline_config; config = (const laserdisc_config *)device->inline_config;
if (ld != NULL && ld->core != NULL) if (ld != NULL && ld->core != NULL)
{ {
config = &ld->core->config; config = &ld->core->config;

View File

@ -137,7 +137,7 @@ typedef void (*laserdisc_init_func)(laserdisc_state *ld);
typedef void (*laserdisc_vsync_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); typedef void (*laserdisc_vsync_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
typedef INT32 (*laserdisc_update_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime); typedef INT32 (*laserdisc_update_func)(laserdisc_state *ld, const vbi_metadata *vbi, int fieldnum, attotime curtime);
typedef void (*laserdisc_overlay_func)(laserdisc_state *ld, bitmap_t *bitmap); typedef void (*laserdisc_overlay_func)(laserdisc_state *ld, bitmap_t *bitmap);
typedef void (*laserdisc_w_func)(laserdisc_state *ld, UINT8 prev, UINT8 new); typedef void (*laserdisc_w_func)(laserdisc_state *ld, UINT8 prev, UINT8 newval);
typedef UINT8 (*laserdisc_r_func)(laserdisc_state *ld); typedef UINT8 (*laserdisc_r_func)(laserdisc_state *ld);

View File

@ -521,7 +521,7 @@ static void pr8210_control_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
static TIMER_CALLBACK( vsync_off ) static TIMER_CALLBACK( vsync_off )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ld->player->vsync = FALSE; ld->player->vsync = FALSE;
} }
@ -535,7 +535,7 @@ static TIMER_CALLBACK( vsync_off )
static TIMER_CALLBACK( vbi_data_fetch ) static TIMER_CALLBACK( vbi_data_fetch )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
UINT8 focus_on = !(player->port1 & 0x08); UINT8 focus_on = !(player->port1 & 0x08);
UINT8 laser_on = !(player->port2 & 0x01); UINT8 laser_on = !(player->port2 & 0x01);
@ -1097,7 +1097,7 @@ static void simutrek_init(laserdisc_state *ld)
static TIMER_CALLBACK( irq_off ) static TIMER_CALLBACK( irq_off )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
cpu_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, CLEAR_LINE); cpu_set_input_line(player->simutrek.cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
if (LOG_SIMUTREK) if (LOG_SIMUTREK)
@ -1181,7 +1181,7 @@ static void simutrek_data_w(laserdisc_state *ld, UINT8 prev, UINT8 data)
static TIMER_CALLBACK( simutrek_latched_data_w ) static TIMER_CALLBACK( simutrek_latched_data_w )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
/* store the data and set the ready flag */ /* store the data and set the ready flag */

View File

@ -333,7 +333,7 @@ static UINT8 ldv1000_status_r(laserdisc_state *ld)
static TIMER_CALLBACK( vsync_off ) static TIMER_CALLBACK( vsync_off )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ld->player->vsync = FALSE; ld->player->vsync = FALSE;
} }
@ -347,7 +347,7 @@ static TIMER_CALLBACK( vsync_off )
static TIMER_CALLBACK( vbi_data_fetch ) static TIMER_CALLBACK( vbi_data_fetch )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
UINT8 focus_on = !(player->portb1 & 0x01); UINT8 focus_on = !(player->portb1 & 0x01);
UINT8 laser_on = (player->portb1 & 0x40); UINT8 laser_on = (player->portb1 & 0x40);
@ -398,7 +398,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
static TIMER_DEVICE_CALLBACK( multijump_timer ) static TIMER_DEVICE_CALLBACK( multijump_timer )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
int direction; int direction;

View File

@ -321,7 +321,7 @@ static UINT8 vp931_data_ready(laserdisc_state *ld)
static TIMER_CALLBACK( vbi_data_fetch ) static TIMER_CALLBACK( vbi_data_fetch )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
int which = param & 3; int which = param & 3;
int line = param >> 2; int line = param >> 2;
@ -364,7 +364,7 @@ static TIMER_CALLBACK( vbi_data_fetch )
static TIMER_CALLBACK( deferred_data_w ) static TIMER_CALLBACK( deferred_data_w )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
/* set the value and mark it pending */ /* set the value and mark it pending */
@ -389,7 +389,7 @@ static TIMER_CALLBACK( deferred_data_w )
static TIMER_CALLBACK( irq_off ) static TIMER_CALLBACK( irq_off )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
cpu_set_input_line(ld->player->cpu, MCS48_INPUT_IRQ, CLEAR_LINE); cpu_set_input_line(ld->player->cpu, MCS48_INPUT_IRQ, CLEAR_LINE);
} }
@ -401,7 +401,7 @@ static TIMER_CALLBACK( irq_off )
static TIMER_CALLBACK( datastrobe_off ) static TIMER_CALLBACK( datastrobe_off )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ld->player->datastrobe = 0; ld->player->datastrobe = 0;
} }
@ -412,7 +412,7 @@ static TIMER_CALLBACK( datastrobe_off )
static TIMER_CALLBACK( erp_off ) static TIMER_CALLBACK( erp_off )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ld->player->daticerp = 0; ld->player->daticerp = 0;
} }
@ -423,7 +423,7 @@ static TIMER_CALLBACK( erp_off )
static TIMER_DEVICE_CALLBACK( track_timer ) static TIMER_DEVICE_CALLBACK( track_timer )
{ {
laserdisc_state *ld = ptr; laserdisc_state *ld = (laserdisc_state *)ptr;
ldplayer_data *player = ld->player; ldplayer_data *player = ld->player;
/* advance by the count and toggle the state */ /* advance by the count and toggle the state */

View File

@ -199,7 +199,7 @@ static TIMER_CALLBACK( mc146818_timer )
void mc146818_init(running_machine *machine, MC146818_TYPE type) void mc146818_init(running_machine *machine, MC146818_TYPE type)
{ {
mc146818 = auto_malloc(sizeof(*mc146818)); mc146818 = (struct mc146818_chip *)auto_malloc(sizeof(*mc146818));
memset(mc146818, 0, sizeof(*mc146818)); memset(mc146818, 0, sizeof(*mc146818));
mc146818->type = type; mc146818->type = type;
mc146818->last_refresh = timer_get_time(machine); mc146818->last_refresh = timer_get_time(machine);

View File

@ -211,7 +211,7 @@ static DEVICE_START( pci_bus )
assert(device->machine->config != NULL); assert(device->machine->config != NULL);
/* store a pointer back to the device */ /* store a pointer back to the device */
pcibus->config = device->inline_config; pcibus->config = (const pci_bus_config *)device->inline_config;
pcibus->busdevice = device; pcibus->busdevice = device;
pcibus->devicenum = -1; pcibus->devicenum = -1;

View File

@ -80,7 +80,7 @@ INLINE pic8259_t *get_safe_token(const device_config *device) {
static TIMER_CALLBACK( pic8259_timerproc ) static TIMER_CALLBACK( pic8259_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
pic8259_t *pic8259 = get_safe_token(device); pic8259_t *pic8259 = get_safe_token(device);
int irq; int irq;
UINT8 mask; UINT8 mask;
@ -394,7 +394,7 @@ WRITE8_DEVICE_HANDLER( pic8259_w )
static DEVICE_START( pic8259 ) { static DEVICE_START( pic8259 ) {
pic8259_t *pic8259 = get_safe_token(device); pic8259_t *pic8259 = get_safe_token(device);
pic8259->intf = device->static_config; pic8259->intf = (const struct pic8259_interface *)device->static_config;
pic8259->timer = timer_alloc( device->machine, pic8259_timerproc, (void *)device ); pic8259->timer = timer_alloc( device->machine, pic8259_timerproc, (void *)device );
} }

View File

@ -657,7 +657,7 @@ static void update(const device_config *device, struct pit8253_timer *timer)
static TIMER_CALLBACK( update_timer_cb ) static TIMER_CALLBACK( update_timer_cb )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
pit8253_t *pit8253 = get_safe_token(device); pit8253_t *pit8253 = get_safe_token(device);
struct pit8253_timer *timer = get_timer(pit8253,param); struct pit8253_timer *timer = get_timer(pit8253,param);
@ -1042,7 +1042,7 @@ static void common_start( const device_config *device, int device_type ) {
pit8253_t *pit8253 = get_safe_token(device); pit8253_t *pit8253 = get_safe_token(device);
int timerno; int timerno;
pit8253->config = device->static_config; pit8253->config = (const struct pit8253_config *)device->static_config;
pit8253->device_type = device_type; pit8253->device_type = device_type;
/* register for state saving */ /* register for state saving */

View File

@ -42,7 +42,7 @@ static int scsicd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
cdrom_file *cdrom = our_this->cdrom; cdrom_file *cdrom = our_this->cdrom;
const device_config *cdda; const device_config *cdda;
@ -310,7 +310,7 @@ static void scsicd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
int i; int i;
UINT32 last_phys_frame; UINT32 last_phys_frame;
@ -629,7 +629,7 @@ static void scsicd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch (command[ 0 ]) switch (command[ 0 ])
@ -673,7 +673,7 @@ static void scsicd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = scsiInstance->machine; running_machine *machine = scsiInstance->machine;
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->lba = 0; our_this->lba = 0;
our_this->blocks = 0; our_this->blocks = 0;
@ -707,7 +707,7 @@ static void scsicd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
static void scsicd_delete_instance( SCSIInstance *scsiInstance ) static void scsicd_delete_instance( SCSIInstance *scsiInstance )
{ {
#ifndef MESS #ifndef MESS
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
if( our_this->cdrom ) if( our_this->cdrom )
{ {
cdrom_close( our_this->cdrom ); cdrom_close( our_this->cdrom );
@ -717,13 +717,13 @@ static void scsicd_delete_instance( SCSIInstance *scsiInstance )
static void scsicd_get_device( SCSIInstance *scsiInstance, cdrom_file **cdrom ) static void scsicd_get_device( SCSIInstance *scsiInstance, cdrom_file **cdrom )
{ {
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
*cdrom = our_this->cdrom; *cdrom = our_this->cdrom;
} }
static void scsicd_set_device( SCSIInstance *scsiInstance, cdrom_file *cdrom ) static void scsicd_set_device( SCSIInstance *scsiInstance, cdrom_file *cdrom )
{ {
SCSICd *our_this = SCSIThis( &SCSIClassCDROM, scsiInstance ); SCSICd *our_this = (SCSICd *)SCSIThis( &SCSIClassCDROM, scsiInstance );
our_this->cdrom = cdrom; our_this->cdrom = cdrom;
} }
@ -734,36 +734,36 @@ static int scsicd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
switch (operation) switch (operation)
{ {
case SCSIOP_EXEC_COMMAND: case SCSIOP_EXEC_COMMAND:
return scsicd_exec_command( file, ptrparm ); return scsicd_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
case SCSIOP_READ_DATA: case SCSIOP_READ_DATA:
scsicd_read_data( file, ptrparm, intparm ); scsicd_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_WRITE_DATA: case SCSIOP_WRITE_DATA:
scsicd_write_data( file, ptrparm, intparm ); scsicd_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_ALLOC_INSTANCE: case SCSIOP_ALLOC_INSTANCE:
params = ptrparm; params = (SCSIAllocInstanceParams *)ptrparm;
SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm ); SCSIBase( &SCSIClassCDROM, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
scsicd_alloc_instance( params->instance, params->diskregion ); scsicd_alloc_instance( params->instance, params->diskregion );
return 0; return 0;
case SCSIOP_DELETE_INSTANCE: case SCSIOP_DELETE_INSTANCE:
scsicd_delete_instance( file ); scsicd_delete_instance( (SCSIInstance *)file );
break; break;
case SCSIOP_GET_DEVICE: case SCSIOP_GET_DEVICE:
scsicd_get_device( file, ptrparm ); scsicd_get_device( (SCSIInstance *)file, (cdrom_file **)ptrparm );
return 0; return 0;
case SCSIOP_SET_DEVICE: case SCSIOP_SET_DEVICE:
scsicd_set_device( file, ptrparm ); scsicd_set_device( (SCSIInstance *)file, (cdrom_file *)ptrparm );
return 0; return 0;
} }
return SCSIBase( &SCSIClassCDROM, operation, file, intparm, ptrparm ); return SCSIBase( &SCSIClassCDROM, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
} }
const SCSIClass SCSIClassCDROM = const SCSIClass SCSIClassCDROM =

View File

@ -17,7 +17,7 @@ static int scsidev_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
// SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); // SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch( command[ 0 ] ) switch( command[ 0 ] )
@ -36,7 +36,7 @@ static void scsidev_read_data( SCSIInstance *scsiInstance, UINT8 *data, int data
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
// SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); // SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch( command[ 0 ] ) switch( command[ 0 ] )
@ -51,7 +51,7 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
// SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); // SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch( command[ 0 ] ) switch( command[ 0 ] )
@ -64,19 +64,19 @@ static void scsidev_write_data( SCSIInstance *scsiInstance, UINT8 *data, int dat
static void scsidev_set_phase( SCSIInstance *scsiInstance, int phase ) static void scsidev_set_phase( SCSIInstance *scsiInstance, int phase )
{ {
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
our_this->phase = phase; our_this->phase = phase;
} }
static int scsidev_get_phase( SCSIInstance *scsiInstance ) static int scsidev_get_phase( SCSIInstance *scsiInstance )
{ {
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
return our_this->phase; return our_this->phase;
} }
static void scsidev_set_command( SCSIInstance *scsiInstance, void *command, int commandLength ) static void scsidev_set_command( SCSIInstance *scsiInstance, void *command, int commandLength )
{ {
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
if( commandLength > sizeof( our_this->command ) ) if( commandLength > sizeof( our_this->command ) )
{ {
@ -92,7 +92,7 @@ static void scsidev_set_command( SCSIInstance *scsiInstance, void *command, int
static int scsidev_get_command( SCSIInstance *scsiInstance, void **command ) static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
{ {
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
*command = our_this->command; *command = our_this->command;
return our_this->commandLength; return our_this->commandLength;
} }
@ -100,7 +100,7 @@ static int scsidev_get_command( SCSIInstance *scsiInstance, void **command )
static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void scsidev_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = scsiInstance->machine; running_machine *machine = scsiInstance->machine;
SCSIDev *our_this = SCSIThis( &SCSIClassDevice, scsiInstance ); SCSIDev *our_this = (SCSIDev *)SCSIThis( &SCSIClassDevice, scsiInstance );
state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command ); state_save_register_item_array( machine, "scsidev", diskregion, 0, our_this->command );
state_save_register_item( machine, "scsidev", diskregion, 0, our_this->commandLength ); state_save_register_item( machine, "scsidev", diskregion, 0, our_this->commandLength );
@ -114,38 +114,38 @@ static int scsidev_dispatch( int operation, void *file, INT64 intparm, void *ptr
switch( operation ) switch( operation )
{ {
case SCSIOP_EXEC_COMMAND: case SCSIOP_EXEC_COMMAND:
return scsidev_exec_command( file, ptrparm ); return scsidev_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
case SCSIOP_READ_DATA: case SCSIOP_READ_DATA:
scsidev_read_data( file, ptrparm, intparm ); scsidev_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
break; break;
case SCSIOP_WRITE_DATA: case SCSIOP_WRITE_DATA:
scsidev_write_data( file, ptrparm, intparm ); scsidev_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
break; break;
case SCSIOP_SET_PHASE: case SCSIOP_SET_PHASE:
scsidev_set_phase( file, intparm ); scsidev_set_phase( (SCSIInstance *)file, intparm );
return 0; return 0;
case SCSIOP_GET_PHASE: case SCSIOP_GET_PHASE:
return scsidev_get_phase( file ); return scsidev_get_phase( (SCSIInstance *)file );
case SCSIOP_SET_COMMAND: case SCSIOP_SET_COMMAND:
scsidev_set_command( file, ptrparm, intparm ); scsidev_set_command( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_GET_COMMAND: case SCSIOP_GET_COMMAND:
return scsidev_get_command( file, ptrparm ); return scsidev_get_command( (SCSIInstance *)file, (void **)ptrparm );
case SCSIOP_ALLOC_INSTANCE: case SCSIOP_ALLOC_INSTANCE:
params = ptrparm; params = (SCSIAllocInstanceParams *)ptrparm;
params->instance = SCSIMalloc( params->machine, file ); params->instance = SCSIMalloc( params->machine, (const SCSIClass *)file );
scsidev_alloc_instance( params->instance, params->diskregion ); scsidev_alloc_instance( params->instance, params->diskregion );
return 0; return 0;
case SCSIOP_DELETE_INSTANCE: case SCSIOP_DELETE_INSTANCE:
free( file ); free( (SCSIInstance *)file );
return 0; return 0;
} }
return 0; return 0;

View File

@ -27,7 +27,7 @@ static int scsihd_exec_command( SCSIInstance *scsiInstance, UINT8 *statusCode )
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch ( command[0] ) switch ( command[0] )
@ -103,7 +103,7 @@ static void scsihd_read_data( SCSIInstance *scsiInstance, UINT8 *data, int dataL
int i; int i;
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch ( command[0] ) switch ( command[0] )
@ -194,7 +194,7 @@ static void scsihd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
{ {
UINT8 *command; UINT8 *command;
int commandLength; int commandLength;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
SCSIGetCommand( scsiInstance, &command, &commandLength ); SCSIGetCommand( scsiInstance, &command, &commandLength );
switch ( command[0] ) switch ( command[0] )
@ -225,7 +225,7 @@ static void scsihd_write_data( SCSIInstance *scsiInstance, UINT8 *data, int data
static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion ) static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskregion )
{ {
running_machine *machine = scsiInstance->machine; running_machine *machine = scsiInstance->machine;
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->lba = 0; our_this->lba = 0;
our_this->blocks = 0; our_this->blocks = 0;
@ -249,7 +249,7 @@ static void scsihd_alloc_instance( SCSIInstance *scsiInstance, const char *diskr
static void scsihd_delete_instance( SCSIInstance *scsiInstance ) static void scsihd_delete_instance( SCSIInstance *scsiInstance )
{ {
#ifndef MESS #ifndef MESS
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
if( our_this->disk ) if( our_this->disk )
{ {
@ -260,13 +260,13 @@ static void scsihd_delete_instance( SCSIInstance *scsiInstance )
static void scsihd_get_device( SCSIInstance *scsiInstance, hard_disk_file **disk ) static void scsihd_get_device( SCSIInstance *scsiInstance, hard_disk_file **disk )
{ {
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
*disk = our_this->disk; *disk = our_this->disk;
} }
static void scsihd_set_device( SCSIInstance *scsiInstance, hard_disk_file *disk ) static void scsihd_set_device( SCSIInstance *scsiInstance, hard_disk_file *disk )
{ {
SCSIHd *our_this = SCSIThis( &SCSIClassHARDDISK, scsiInstance ); SCSIHd *our_this = (SCSIHd *)SCSIThis( &SCSIClassHARDDISK, scsiInstance );
our_this->disk = disk; our_this->disk = disk;
} }
@ -277,36 +277,36 @@ static int scsihd_dispatch(int operation, void *file, INT64 intparm, void *ptrpa
switch (operation) switch (operation)
{ {
case SCSIOP_EXEC_COMMAND: case SCSIOP_EXEC_COMMAND:
return scsihd_exec_command( file, ptrparm ); return scsihd_exec_command( (SCSIInstance *)file, (UINT8 *)ptrparm );
case SCSIOP_READ_DATA: case SCSIOP_READ_DATA:
scsihd_read_data( file, ptrparm, intparm ); scsihd_read_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_WRITE_DATA: case SCSIOP_WRITE_DATA:
scsihd_write_data( file, ptrparm, intparm ); scsihd_write_data( (SCSIInstance *)file, (UINT8 *)ptrparm, intparm );
return 0; return 0;
case SCSIOP_ALLOC_INSTANCE: case SCSIOP_ALLOC_INSTANCE:
params = ptrparm; params = (SCSIAllocInstanceParams *)ptrparm;
SCSIBase( &SCSIClassHARDDISK, operation, file, intparm, ptrparm ); SCSIBase( &SCSIClassHARDDISK, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
scsihd_alloc_instance( params->instance, params->diskregion ); scsihd_alloc_instance( params->instance, params->diskregion );
return 0; return 0;
case SCSIOP_DELETE_INSTANCE: case SCSIOP_DELETE_INSTANCE:
scsihd_delete_instance( file ); scsihd_delete_instance( (SCSIInstance *)file );
break; break;
case SCSIOP_GET_DEVICE: case SCSIOP_GET_DEVICE:
scsihd_get_device( file, ptrparm ); scsihd_get_device( (SCSIInstance *)file, (hard_disk_file **)ptrparm );
return 0; return 0;
case SCSIOP_SET_DEVICE: case SCSIOP_SET_DEVICE:
scsihd_set_device( file, ptrparm ); scsihd_set_device( (SCSIInstance *)file, (hard_disk_file *)ptrparm );
return 0; return 0;
} }
return SCSIBase( &SCSIClassHARDDISK, operation, file, intparm, ptrparm ); return SCSIBase( &SCSIClassHARDDISK, operation, (SCSIInstance *)file, intparm, (UINT8 *)ptrparm );
} }
const SCSIClass SCSIClassHARDDISK = const SCSIClass SCSIClassHARDDISK =

View File

@ -510,7 +510,7 @@ WRITE16_DEVICE_HANDLER( smc91c9x_w )
static DEVICE_START( smc91c9x ) static DEVICE_START( smc91c9x )
{ {
const smc91c9x_config *config = device->inline_config; const smc91c9x_config *config = (const smc91c9x_config *)device->inline_config;
smc91c9x_state *smc = get_safe_token(device); smc91c9x_state *smc = get_safe_token(device);
/* validate some basic stuff */ /* validate some basic stuff */

View File

@ -308,7 +308,7 @@ static DEVICE_START(timekeeper)
c->month = make_bcd( systime.local_time.month + 1 ); c->month = make_bcd( systime.local_time.month + 1 );
c->year = make_bcd( systime.local_time.year % 100 ); c->year = make_bcd( systime.local_time.year % 100 );
c->century = make_bcd( systime.local_time.year / 100 ); c->century = make_bcd( systime.local_time.year / 100 );
c->data = auto_malloc( c->size ); c->data = (UINT8 *)auto_malloc( c->size );
c->default_data = device->region; c->default_data = device->region;
if (c->default_data != NULL) if (c->default_data != NULL)

View File

@ -798,7 +798,7 @@ void wd33c93_init( running_machine *machine, const struct WD33C93interface *inte
/* allocate a timer for commands */ /* allocate a timer for commands */
scsi_data.cmd_timer = timer_alloc(machine, wd33c93_complete_cb, NULL); scsi_data.cmd_timer = timer_alloc(machine, wd33c93_complete_cb, NULL);
scsi_data.temp_input = auto_malloc( TEMP_INPUT_LEN ); scsi_data.temp_input = (UINT8 *)auto_malloc( TEMP_INPUT_LEN );
// state_save_register_item_array(machine, "wd33c93", NULL, 0, scsi_data); // state_save_register_item_array(machine, "wd33c93", NULL, 0, scsi_data);
} }

View File

@ -88,12 +88,12 @@ static DEVICE_START(x2212)
assert(device->machine != NULL); assert(device->machine != NULL);
assert(device->machine->config != NULL); assert(device->machine->config != NULL);
c->sram = auto_malloc( SIZE_DATA ); c->sram = (UINT8 *)auto_malloc( SIZE_DATA );
c->e2prom = auto_malloc( SIZE_DATA ); c->e2prom = (UINT8 *)auto_malloc( SIZE_DATA );
c->store = 1; c->store = 1;
c->array_recall = 1; c->array_recall = 1;
config = device->static_config; config = (const x2212_config *)device->static_config;
if( config != NULL && config->data != NULL ) if( config != NULL && config->data != NULL )
{ {
c->default_data = memory_region( device->machine, config->data ); c->default_data = memory_region( device->machine, config->data );

View File

@ -115,7 +115,7 @@ void x76f041_init( running_machine *machine, int chip, UINT8 *data )
if( data == NULL ) if( data == NULL )
{ {
data = auto_malloc( data = (UINT8 *)auto_malloc(
SIZE_RESPONSE_TO_RESET + SIZE_RESPONSE_TO_RESET +
SIZE_READ_PASSWORD + SIZE_READ_PASSWORD +
SIZE_WRITE_PASSWORD + SIZE_WRITE_PASSWORD +

View File

@ -84,7 +84,7 @@ void x76f100_init( running_machine *machine, int chip, UINT8 *data )
if( data == NULL ) if( data == NULL )
{ {
data = auto_malloc( data = (UINT8 *)auto_malloc(
SIZE_RESPONSE_TO_RESET + SIZE_RESPONSE_TO_RESET +
SIZE_READ_PASSWORD + SIZE_READ_PASSWORD +
SIZE_WRITE_PASSWORD + SIZE_WRITE_PASSWORD +

View File

@ -138,7 +138,7 @@ static void interrupt_check(const device_config *device)
static TIMER_CALLBACK( timercallback ) static TIMER_CALLBACK( timercallback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
z80ctc *ctc = get_safe_token(device); z80ctc *ctc = get_safe_token(device);
ctc_channel *channel = &ctc->channel[param]; ctc_channel *channel = &ctc->channel[param];
@ -461,7 +461,7 @@ static void z80ctc_irq_reti(const device_config *device)
static DEVICE_START( z80ctc ) static DEVICE_START( z80ctc )
{ {
const z80ctc_interface *intf = device->static_config; const z80ctc_interface *intf = (const z80ctc_interface *)device->static_config;
astring *tempstring = astring_alloc(); astring *tempstring = astring_alloc();
z80ctc *ctc = get_safe_token(device); z80ctc *ctc = get_safe_token(device);
int ch; int ch;

View File

@ -201,7 +201,7 @@ static int z80dma_do_write(const device_config *device)
static TIMER_CALLBACK( z80dma_timerproc ) static TIMER_CALLBACK( z80dma_timerproc )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
z80dma_t *cntx = get_safe_token(device); z80dma_t *cntx = get_safe_token(device);
int done; int done;
@ -390,7 +390,7 @@ WRITE8_DEVICE_HANDLER( z80dma_w )
static TIMER_CALLBACK( z80dma_rdy_write_callback ) static TIMER_CALLBACK( z80dma_rdy_write_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
int state = param & 0x01; int state = param & 0x01;
z80dma_t *cntx = get_safe_token(device); z80dma_t *cntx = get_safe_token(device);
@ -447,7 +447,7 @@ static DEVICE_START( z80dma )
assert(device != NULL); assert(device != NULL);
assert(device->tag != NULL); assert(device->tag != NULL);
z80dma->intf = device->static_config; z80dma->intf = (const z80dma_interface *)device->static_config;
z80dma->timer = timer_alloc(device->machine, z80dma_timerproc, (void *) device); z80dma->timer = timer_alloc(device->machine, z80dma_timerproc, (void *) device);

View File

@ -535,7 +535,7 @@ WRITE8_DEVICE_HANDLER(z80pio_w)
static DEVICE_START( z80pio ) static DEVICE_START( z80pio )
{ {
const z80pio_interface *intf = device->static_config; const z80pio_interface *intf = (const z80pio_interface *)device->static_config;
z80pio_t *z80pio = get_safe_token( device ); z80pio_t *z80pio = get_safe_token( device );
z80pio->intr = intf->intr; z80pio->intr = intf->intr;

View File

@ -524,7 +524,7 @@ READ8_DEVICE_HANDLER( z80sio_get_rts )
static TIMER_CALLBACK( change_input_line ) static TIMER_CALLBACK( change_input_line )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
z80sio *sio = get_safe_token(device); z80sio *sio = get_safe_token(device);
sio_channel *chan = &sio->chan[param & 1]; sio_channel *chan = &sio->chan[param & 1];
UINT8 line = (param >> 8) & 0xff; UINT8 line = (param >> 8) & 0xff;
@ -607,7 +607,7 @@ WRITE8_DEVICE_HANDLER( z80sio_receive_data )
static TIMER_CALLBACK( serial_callback ) static TIMER_CALLBACK( serial_callback )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
z80sio *sio = get_safe_token(device); z80sio *sio = get_safe_token(device);
sio_channel *chan = &sio->chan[param]; sio_channel *chan = &sio->chan[param];
int ch = param; int ch = param;
@ -782,7 +782,7 @@ static void z80sio_irq_reti(const device_config *device)
static DEVICE_START( z80sio ) static DEVICE_START( z80sio )
{ {
const z80sio_interface *intf = device->static_config; const z80sio_interface *intf = (const z80sio_interface *)device->static_config;
astring *tempstring = astring_alloc(); astring *tempstring = astring_alloc();
z80sio *sio = get_safe_token(device); z80sio *sio = get_safe_token(device);
void *ptr = (void *)device; void *ptr = (void *)device;

View File

@ -458,7 +458,7 @@ void add_frame_callback(running_machine *machine, void (*callback)(running_machi
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_frame_callback at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_frame_callback at init time!");
/* allocate memory */ /* allocate memory */
cb = malloc_or_die(sizeof(*cb)); cb = (callback_item *)malloc_or_die(sizeof(*cb));
/* add us to the end of the list */ /* add us to the end of the list */
cb->func.frame = callback; cb->func.frame = callback;
@ -481,7 +481,7 @@ void add_reset_callback(running_machine *machine, void (*callback)(running_machi
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_reset_callback at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_reset_callback at init time!");
/* allocate memory */ /* allocate memory */
cb = malloc_or_die(sizeof(*cb)); cb = (callback_item *)malloc_or_die(sizeof(*cb));
/* add us to the end of the list */ /* add us to the end of the list */
cb->func.reset = callback; cb->func.reset = callback;
@ -504,7 +504,7 @@ void add_pause_callback(running_machine *machine, void (*callback)(running_machi
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_pause_callback at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_pause_callback at init time!");
/* allocate memory */ /* allocate memory */
cb = malloc_or_die(sizeof(*cb)); cb = (callback_item *)malloc_or_die(sizeof(*cb));
/* add us to the end of the list */ /* add us to the end of the list */
cb->func.pause = callback; cb->func.pause = callback;
@ -527,7 +527,7 @@ void add_exit_callback(running_machine *machine, void (*callback)(running_machin
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_exit_callback at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_exit_callback at init time!");
/* allocate memory */ /* allocate memory */
cb = malloc_or_die(sizeof(*cb)); cb = (callback_item *)malloc_or_die(sizeof(*cb));
/* add us to the head of the list */ /* add us to the head of the list */
cb->func.exit = callback; cb->func.exit = callback;
@ -782,7 +782,7 @@ UINT8 *memory_region_alloc(running_machine *machine, const char *name, UINT32 le
fatalerror("memory_region_alloc called with duplicate region name \"%s\"\n", name); fatalerror("memory_region_alloc called with duplicate region name \"%s\"\n", name);
/* allocate the region */ /* allocate the region */
info = malloc_or_die(sizeof(*info) + length); info = (region_info *)malloc_or_die(sizeof(*info) + length);
info->next = NULL; info->next = NULL;
info->name = astring_dupc(name); info->name = astring_dupc(name);
info->length = length; info->length = length;
@ -1247,7 +1247,7 @@ void add_logerror_callback(running_machine *machine, void (*callback)(running_ma
assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_logerror_callback at init time!"); assert_always(mame_get_phase(machine) == MAME_PHASE_INIT, "Can only call add_logerror_callback at init time!");
cb = auto_malloc(sizeof(*cb)); cb = (callback_item *)auto_malloc(sizeof(*cb));
cb->func.log = callback; cb->func.log = callback;
cb->next = NULL; cb->next = NULL;
@ -1318,7 +1318,7 @@ void mame_parse_ini_files(core_options *options, const game_driver *driver)
config = machine_config_alloc(driver->machine_config); config = machine_config_alloc(driver->machine_config);
for (device = video_screen_first(config); device != NULL; device = video_screen_next(device)) for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
{ {
const screen_config *scrconfig = device->inline_config; const screen_config *scrconfig = (const screen_config *)device->inline_config;
if (scrconfig->type == SCREEN_TYPE_VECTOR) if (scrconfig->type == SCREEN_TYPE_VECTOR)
{ {
parse_ini_file(options, "vector"); parse_ini_file(options, "vector");
@ -1387,13 +1387,13 @@ static running_machine *create_machine(const game_driver *driver)
int cpunum; int cpunum;
/* allocate memory for the machine */ /* allocate memory for the machine */
machine = malloc(sizeof(*machine)); machine = (running_machine *)malloc(sizeof(*machine));
if (machine == NULL) if (machine == NULL)
goto error; goto error;
memset(machine, 0, sizeof(*machine)); memset(machine, 0, sizeof(*machine));
/* allocate memory for the internal mame_data */ /* allocate memory for the internal mame_data */
machine->mame_data = malloc(sizeof(*machine->mame_data)); machine->mame_data = (mame_private *)malloc(sizeof(*machine->mame_data));
if (machine->mame_data == NULL) if (machine->mame_data == NULL)
goto error; goto error;
memset(machine->mame_data, 0, sizeof(*machine->mame_data)); memset(machine->mame_data, 0, sizeof(*machine->mame_data));

View File

@ -174,6 +174,18 @@ enum
COMMON MACROS COMMON MACROS
***************************************************************************/ ***************************************************************************/
/* Macro for declaring enumerator operators for easier porting */
#ifdef __cplusplus
#define DECLARE_ENUM_OPERATORS(type) \
inline void operator++(type &value) { value = (type)((int)value + 1); } \
inline void operator++(type &value, int) { value = (type)((int)value + 1); } \
inline void operator--(type &value) { value = (type)((int)value - 1); } \
inline void operator--(type &value, int) { value = (type)((int)value - 1); }
#else
#define DECLARE_ENUM_OPERATORS(type)
#endif
/* Standard MAME assertion macros */ /* Standard MAME assertion macros */
#undef assert #undef assert
#undef assert_always #undef assert_always
@ -182,7 +194,7 @@ enum
#define assert(x) do { if (!(x)) fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0) #define assert(x) do { if (!(x)) fatalerror("assert: %s:%d: %s", __FILE__, __LINE__, #x); } while (0)
#define assert_always(x, msg) do { if (!(x)) fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0) #define assert_always(x, msg) do { if (!(x)) fatalerror("Fatal error: %s\nCaused by assert: %s:%d: %s", msg, __FILE__, __LINE__, #x); } while (0)
#else #else
#define assert(x) #define assert(x) do { } while (0)
#define assert_always(x, msg) do { if (!(x)) fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0) #define assert_always(x, msg) do { if (!(x)) fatalerror("Fatal error: %s (%s:%d)", msg, __FILE__, __LINE__); } while (0)
#endif #endif

View File

@ -69,7 +69,7 @@ machine_config *machine_config_alloc(const machine_config_token *tokens)
machine_config *config; machine_config *config;
/* allocate a new configuration object */ /* allocate a new configuration object */
config = malloc_or_die(sizeof(*config)); config = (machine_config *)malloc_or_die(sizeof(*config));
memset(config, 0, sizeof(*config)); memset(config, 0, sizeof(*config));
/* parse tokens into the config */ /* parse tokens into the config */
@ -318,7 +318,7 @@ static void machine_config_detokenize(machine_config *config, const machine_conf
if (depth == 0) if (depth == 0)
for (device = config->devicelist; device != NULL; device = device->next) for (device = config->devicelist; device != NULL; device = device->next)
{ {
tokens = device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG); tokens = (const machine_config_token *)device_get_info_ptr(device, DEVINFO_PTR_MACHINE_CONFIG);
if (tokens != NULL) if (tokens != NULL)
machine_config_detokenize(config, tokens, device, depth + 1); machine_config_detokenize(config, tokens, device, depth + 1);
} }

View File

@ -441,7 +441,7 @@ INLINE void add_bank_reference(bank_info *bank, const address_space *space)
return; return;
/* allocate a new entry and fill it */ /* allocate a new entry and fill it */
(*refptr) = malloc_or_die(sizeof(**refptr)); (*refptr) = (bank_reference *)malloc_or_die(sizeof(**refptr));
(*refptr)->next = NULL; (*refptr)->next = NULL;
(*refptr)->space = space; (*refptr)->space = space;
} }
@ -471,7 +471,7 @@ INLINE UINT8 read_byte_generic(const address_space *space, offs_t byteaddress)
if (entry < STATIC_RAM) if (entry < STATIC_RAM)
result = (*handler->bankbaseptr)[byteoffset]; result = (*handler->bankbaseptr)[byteoffset];
else else
result = (*handler->handler.read.shandler8)(handler->object, byteoffset); result = (*handler->handler.read.shandler8)((const address_space *)handler->object, byteoffset);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
return result; return result;
@ -501,7 +501,7 @@ INLINE void write_byte_generic(const address_space *space, offs_t byteaddress, U
if (entry < STATIC_RAM) if (entry < STATIC_RAM)
(*handler->bankbaseptr)[byteoffset] = data; (*handler->bankbaseptr)[byteoffset] = data;
else else
(*handler->handler.write.shandler8)(handler->object, byteoffset, data); (*handler->handler.write.shandler8)((const address_space *)handler->object, byteoffset, data);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
} }
@ -531,7 +531,7 @@ INLINE UINT16 read_word_generic(const address_space *space, offs_t byteaddress,
if (entry < STATIC_RAM) if (entry < STATIC_RAM)
result = *(UINT16 *)&(*handler->bankbaseptr)[byteoffset & ~1]; result = *(UINT16 *)&(*handler->bankbaseptr)[byteoffset & ~1];
else else
result = (*handler->handler.read.shandler16)(handler->object, byteoffset >> 1, mem_mask); result = (*handler->handler.read.shandler16)((const address_space *)handler->object, byteoffset >> 1, mem_mask);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
return result; return result;
@ -564,7 +564,7 @@ INLINE void write_word_generic(const address_space *space, offs_t byteaddress, U
*dest = (*dest & ~mem_mask) | (data & mem_mask); *dest = (*dest & ~mem_mask) | (data & mem_mask);
} }
else else
(*handler->handler.write.shandler16)(handler->object, byteoffset >> 1, data, mem_mask); (*handler->handler.write.shandler16)((const address_space *)handler->object, byteoffset >> 1, data, mem_mask);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
} }
@ -594,7 +594,7 @@ INLINE UINT32 read_dword_generic(const address_space *space, offs_t byteaddress,
if (entry < STATIC_RAM) if (entry < STATIC_RAM)
result = *(UINT32 *)&(*handler->bankbaseptr)[byteoffset & ~3]; result = *(UINT32 *)&(*handler->bankbaseptr)[byteoffset & ~3];
else else
result = (*handler->handler.read.shandler32)(handler->object, byteoffset >> 2, mem_mask); result = (*handler->handler.read.shandler32)((const address_space *)handler->object, byteoffset >> 2, mem_mask);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
return result; return result;
@ -627,7 +627,7 @@ INLINE void write_dword_generic(const address_space *space, offs_t byteaddress,
*dest = (*dest & ~mem_mask) | (data & mem_mask); *dest = (*dest & ~mem_mask) | (data & mem_mask);
} }
else else
(*handler->handler.write.shandler32)(handler->object, byteoffset >> 2, data, mem_mask); (*handler->handler.write.shandler32)((const address_space *)handler->object, byteoffset >> 2, data, mem_mask);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
} }
@ -657,7 +657,7 @@ INLINE UINT64 read_qword_generic(const address_space *space, offs_t byteaddress,
if (entry < STATIC_RAM) if (entry < STATIC_RAM)
result = *(UINT64 *)&(*handler->bankbaseptr)[byteoffset & ~7]; result = *(UINT64 *)&(*handler->bankbaseptr)[byteoffset & ~7];
else else
result = (*handler->handler.read.shandler64)(handler->object, byteoffset >> 3, mem_mask); result = (*handler->handler.read.shandler64)((const address_space *)handler->object, byteoffset >> 3, mem_mask);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
return result; return result;
@ -690,7 +690,7 @@ INLINE void write_qword_generic(const address_space *space, offs_t byteaddress,
*dest = (*dest & ~mem_mask) | (data & mem_mask); *dest = (*dest & ~mem_mask) | (data & mem_mask);
} }
else else
(*handler->handler.write.shandler64)(handler->object, offset >> 3, data, mem_mask); (*handler->handler.write.shandler64)((const address_space *)handler->object, offset >> 3, data, mem_mask);
profiler_mark(PROFILER_END); profiler_mark(PROFILER_END);
} }
@ -712,7 +712,7 @@ void memory_init(running_machine *machine)
add_exit_callback(machine, memory_exit); add_exit_callback(machine, memory_exit);
/* allocate our private data */ /* allocate our private data */
memdata = machine->memory_data = auto_malloc(sizeof(*machine->memory_data)); memdata = machine->memory_data = (memory_private *)auto_malloc(sizeof(*machine->memory_data));
memset(memdata, 0, sizeof(*memdata)); memset(memdata, 0, sizeof(*memdata));
/* build up the cpudata array with info about all CPUs and address spaces */ /* build up the cpudata array with info about all CPUs and address spaces */
@ -765,11 +765,11 @@ const address_space *memory_find_address_space(const device_config *cpu, int spa
address_map *address_map_alloc(const device_config *device, const game_driver *driver, int spacenum) address_map *address_map_alloc(const device_config *device, const game_driver *driver, int spacenum)
{ {
const cpu_config *cpuconfig = device->inline_config; const cpu_config *cpuconfig = (const cpu_config *)device->inline_config;
const addrmap_token *internal_map; const addrmap_token *internal_map;
address_map *map; address_map *map;
map = malloc_or_die(sizeof(*map)); map = (address_map *)malloc_or_die(sizeof(*map));
memset(map, 0, sizeof(*map)); memset(map, 0, sizeof(*map));
/* append the internal CPU map (first so it takes priority) */ /* append the internal CPU map (first so it takes priority) */
@ -1027,7 +1027,7 @@ void memory_configure_bank(running_machine *machine, int banknum, int startentry
/* if we have no bankptr yet, set it to the first entry */ /* if we have no bankptr yet, set it to the first entry */
if (memdata->bank_ptr[banknum] == NULL) if (memdata->bank_ptr[banknum] == NULL)
memdata->bank_ptr[banknum] = bank->entry[0]; memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[0];
} }
@ -1058,7 +1058,7 @@ void memory_configure_bank_decrypted(running_machine *machine, int banknum, int
/* if we have no bankptr yet, set it to the first entry */ /* if we have no bankptr yet, set it to the first entry */
if (memdata->bankd_ptr[banknum] == NULL) if (memdata->bankd_ptr[banknum] == NULL)
memdata->bankd_ptr[banknum] = bank->entryd[0]; memdata->bankd_ptr[banknum] = (UINT8 *)bank->entryd[0];
} }
@ -1085,8 +1085,8 @@ void memory_set_bank(running_machine *machine, int banknum, int entrynum)
/* set the base */ /* set the base */
bank->curentry = entrynum; bank->curentry = entrynum;
memdata->bank_ptr[banknum] = bank->entry[entrynum]; memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[entrynum];
memdata->bankd_ptr[banknum] = bank->entryd[entrynum]; memdata->bankd_ptr[banknum] = (UINT8 *)bank->entryd[entrynum];
/* invalidate all the direct references to any referenced address spaces */ /* invalidate all the direct references to any referenced address spaces */
for (ref = bank->reflist; ref != NULL; ref = ref->next) for (ref = bank->reflist; ref != NULL; ref = ref->next)
@ -1134,7 +1134,7 @@ void memory_set_bankptr(running_machine *machine, int banknum, void *base)
validate_auto_malloc_memory(base, bank->byteend - bank->bytestart + 1); validate_auto_malloc_memory(base, bank->byteend - bank->bytestart + 1);
/* set the base */ /* set the base */
memdata->bank_ptr[banknum] = base; memdata->bank_ptr[banknum] = (UINT8 *)base;
/* invalidate all the direct references to any referenced address spaces */ /* invalidate all the direct references to any referenced address spaces */
for (ref = bank->reflist; ref != NULL; ref = ref->next) for (ref = bank->reflist; ref != NULL; ref = ref->next)
@ -1181,7 +1181,7 @@ UINT8 *_memory_install_handler8(const address_space *space, offs_t addrstart, of
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT8 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1198,7 +1198,7 @@ UINT16 *_memory_install_handler16(const address_space *space, offs_t addrstart,
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT16 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1215,7 +1215,7 @@ UINT32 *_memory_install_handler32(const address_space *space, offs_t addrstart,
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT32 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1232,7 +1232,7 @@ UINT64 *_memory_install_handler64(const address_space *space, offs_t addrstart,
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name); space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, spacerw, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT64 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1270,7 +1270,7 @@ UINT8 *_memory_install_device_handler8(const address_space *space, const device_
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); space_map_range(spacerw, ROW_WRITE, 8, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT8 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1287,7 +1287,7 @@ UINT16 *_memory_install_device_handler16(const address_space *space, const devic
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); space_map_range(spacerw, ROW_WRITE, 16, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT16 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1304,7 +1304,7 @@ UINT32 *_memory_install_device_handler32(const address_space *space, const devic
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); space_map_range(spacerw, ROW_WRITE, 32, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT32 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1321,7 +1321,7 @@ UINT64 *_memory_install_device_handler64(const address_space *space, const devic
if (whandler != NULL) if (whandler != NULL)
space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name); space_map_range(spacerw, ROW_WRITE, 64, 0, addrstart, addrend, addrmask, addrmirror, (genf *)whandler, (void *)device, whandler_name);
mem_dump(space->machine); mem_dump(space->machine);
return space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart)); return (UINT64 *)space_find_backing_memory(spacerw, memory_address_to_byte(spacerw, addrstart));
} }
@ -1494,7 +1494,7 @@ static void memory_init_spaces(running_machine *machine)
int spacenum; int spacenum;
/* create a global watchpoint-filled table */ /* create a global watchpoint-filled table */
memdata->wptable = auto_malloc(1 << LEVEL1_BITS); memdata->wptable = (UINT8 *)auto_malloc(1 << LEVEL1_BITS);
memset(memdata->wptable, STATIC_WATCHPOINT, 1 << LEVEL1_BITS); memset(memdata->wptable, STATIC_WATCHPOINT, 1 << LEVEL1_BITS);
/* loop over CPUs */ /* loop over CPUs */
@ -1502,7 +1502,7 @@ static void memory_init_spaces(running_machine *machine)
for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++)
if (cpu_get_addrbus_width(device, spacenum) > 0) if (cpu_get_addrbus_width(device, spacenum) > 0)
{ {
address_space *space = malloc_or_die(sizeof(*space)); address_space *space = (address_space *)malloc_or_die(sizeof(*space));
int logbits = cpu_get_logaddr_width(device, spacenum); int logbits = cpu_get_logaddr_width(device, spacenum);
int ashift = cpu_get_addrbus_shift(device, spacenum); int ashift = cpu_get_addrbus_shift(device, spacenum);
int abits = cpu_get_addrbus_width(device, spacenum); int abits = cpu_get_addrbus_width(device, spacenum);
@ -1536,15 +1536,15 @@ static void memory_init_spaces(running_machine *machine)
space->log_unmap = TRUE; space->log_unmap = TRUE;
/* allocate subtable information; we malloc this manually because it will be realloc'ed */ /* allocate subtable information; we malloc this manually because it will be realloc'ed */
space->read.subtable = auto_malloc(sizeof(*space->read.subtable) * SUBTABLE_COUNT); space->read.subtable = (subtable_data *)auto_malloc(sizeof(*space->read.subtable) * SUBTABLE_COUNT);
memset(space->read.subtable, 0, sizeof(*space->read.subtable) * SUBTABLE_COUNT); memset(space->read.subtable, 0, sizeof(*space->read.subtable) * SUBTABLE_COUNT);
space->write.subtable = auto_malloc(sizeof(*space->write.subtable) * SUBTABLE_COUNT); space->write.subtable = (subtable_data *)auto_malloc(sizeof(*space->write.subtable) * SUBTABLE_COUNT);
memset(space->write.subtable, 0, sizeof(*space->write.subtable) * SUBTABLE_COUNT); memset(space->write.subtable, 0, sizeof(*space->write.subtable) * SUBTABLE_COUNT);
/* allocate the handler table */ /* allocate the handler table */
space->read.handlers[0] = auto_malloc(sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers)); space->read.handlers[0] = (handler_data *)auto_malloc(sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers));
memset(space->read.handlers[0], 0, sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers)); memset(space->read.handlers[0], 0, sizeof(*space->read.handlers[0]) * ARRAY_LENGTH(space->read.handlers));
space->write.handlers[0] = auto_malloc(sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers)); space->write.handlers[0] = (handler_data *)auto_malloc(sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers));
memset(space->write.handlers[0], 0, sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers)); memset(space->write.handlers[0], 0, sizeof(*space->write.handlers[0]) * ARRAY_LENGTH(space->write.handlers));
for (entrynum = 1; entrynum < ARRAY_LENGTH(space->read.handlers); entrynum++) for (entrynum = 1; entrynum < ARRAY_LENGTH(space->read.handlers); entrynum++)
{ {
@ -1568,8 +1568,8 @@ static void memory_init_spaces(running_machine *machine)
space->write.handlers[STATIC_WATCHPOINT]->bytemask = ~0; space->write.handlers[STATIC_WATCHPOINT]->bytemask = ~0;
/* allocate memory; these aren't auto-malloc'ed as we need to expand them */ /* allocate memory; these aren't auto-malloc'ed as we need to expand them */
space->read.table = malloc_or_die(1 << LEVEL1_BITS); space->read.table = (UINT8 *)malloc_or_die(1 << LEVEL1_BITS);
space->write.table = malloc_or_die(1 << LEVEL1_BITS); space->write.table = (UINT8 *)malloc_or_die(1 << LEVEL1_BITS);
/* initialize everything to unmapped */ /* initialize everything to unmapped */
memset(space->read.table, STATIC_UNMAP, 1 << LEVEL1_BITS); memset(space->read.table, STATIC_UNMAP, 1 << LEVEL1_BITS);
@ -1836,7 +1836,7 @@ static void memory_init_allocate(running_machine *machine)
block = block_allocate(space, curbytestart, curbyteend, NULL); block = block_allocate(space, curbytestart, curbyteend, NULL);
/* assign memory that intersected the new block */ /* assign memory that intersected the new block */
unassigned = block_assign_intersecting(space, curbytestart, curbyteend, block); unassigned = block_assign_intersecting(space, curbytestart, curbyteend, (UINT8 *)block);
} }
} }
} }
@ -1888,7 +1888,7 @@ static void memory_init_locate(running_machine *machine)
for (entry = ref->space->map->entrylist; entry != NULL; entry = entry->next) for (entry = ref->space->map->entrylist; entry != NULL; entry = entry->next)
if (entry->bytestart == bank->bytestart) if (entry->bytestart == bank->bytestart)
{ {
memdata->bank_ptr[banknum] = entry->memory; memdata->bank_ptr[banknum] = (UINT8 *)entry->memory;
foundit = TRUE; foundit = TRUE;
VPRINTF(("assigned bank %d pointer to memory from range %08X-%08X [%p]\n", banknum, entry->addrstart, entry->addrend, entry->memory)); VPRINTF(("assigned bank %d pointer to memory from range %08X-%08X [%p]\n", banknum, entry->addrstart, entry->addrend, entry->memory));
break; break;
@ -1896,7 +1896,7 @@ static void memory_init_locate(running_machine *machine)
/* if the entry was set ahead of time, override the automatically found pointer */ /* if the entry was set ahead of time, override the automatically found pointer */
if (!bank->dynamic && bank->curentry != MAX_BANK_ENTRIES) if (!bank->dynamic && bank->curentry != MAX_BANK_ENTRIES)
memdata->bank_ptr[banknum] = bank->entry[bank->curentry]; memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[bank->curentry];
} }
} }
@ -2059,7 +2059,7 @@ static void map_detokenize(address_map *map, const game_driver *driver, const ch
/* start a new range */ /* start a new range */
case ADDRMAP_TOKEN_RANGE: case ADDRMAP_TOKEN_RANGE:
entry = *entryptr = malloc_or_die(sizeof(**entryptr)); entry = *entryptr = (address_map_entry *)malloc_or_die(sizeof(**entryptr));
entryptr = &entry->next; entryptr = &entry->next;
memset(entry, 0, sizeof(*entry)); memset(entry, 0, sizeof(*entry));
TOKEN_GET_UINT64_UNPACK2(tokens, entry->addrstart, 32, entry->addrend, 32); TOKEN_GET_UINT64_UNPACK2(tokens, entry->addrstart, 32, entry->addrend, 32);
@ -2200,7 +2200,7 @@ static void space_map_range_private(address_space *space, read_or_write readorwr
/* assign a bank to the adjusted addresses */ /* assign a bank to the adjusted addresses */
handler = (genf *)bank_assign_dynamic(space, readorwrite, bytestart, byteend); handler = (genf *)bank_assign_dynamic(space, readorwrite, bytestart, byteend);
if (memdata->bank_ptr[HANDLER_TO_BANK(handler)] == NULL) if (memdata->bank_ptr[HANDLER_TO_BANK(handler)] == NULL)
memdata->bank_ptr[HANDLER_TO_BANK(handler)] = space_find_backing_memory(space, bytestart); memdata->bank_ptr[HANDLER_TO_BANK(handler)] = (UINT8 *)space_find_backing_memory(space, bytestart);
} }
/* then do a normal installation */ /* then do a normal installation */
@ -2433,7 +2433,7 @@ static STATE_POSTLOAD( bank_reattach )
{ {
/* if this entry has a changed entry, set the appropriate pointer */ /* if this entry has a changed entry, set the appropriate pointer */
if (bank->curentry != MAX_BANK_ENTRIES) if (bank->curentry != MAX_BANK_ENTRIES)
memdata->bank_ptr[banknum] = bank->entry[bank->curentry]; memdata->bank_ptr[banknum] = (UINT8 *)bank->entry[bank->curentry];
} }
} }
} }
@ -2816,7 +2816,7 @@ static UINT8 subtable_alloc(address_table *tabledata)
if (subindex >= tabledata->subtable_alloc) if (subindex >= tabledata->subtable_alloc)
{ {
tabledata->subtable_alloc += SUBTABLE_ALLOC; tabledata->subtable_alloc += SUBTABLE_ALLOC;
tabledata->table = realloc(tabledata->table, (1 << LEVEL1_BITS) + (tabledata->subtable_alloc << LEVEL2_BITS)); tabledata->table = (UINT8 *)realloc(tabledata->table, (1 << LEVEL1_BITS) + (tabledata->subtable_alloc << LEVEL2_BITS));
if (!tabledata->table) if (!tabledata->table)
fatalerror("error: ran out of memory allocating memory subtable"); fatalerror("error: ran out of memory allocating memory subtable");
} }
@ -3030,7 +3030,7 @@ static direct_range *direct_range_find(address_space *space, offs_t byteaddress,
if (range != NULL) if (range != NULL)
space->direct.freerangelist = range->next; space->direct.freerangelist = range->next;
else else
range = malloc_or_die(sizeof(*range)); range = (direct_range *)malloc_or_die(sizeof(*range));
/* fill in the range */ /* fill in the range */
table_derive_range(&space->read, byteaddress, &range->bytestart, &range->byteend); table_derive_range(&space->read, byteaddress, &range->bytestart, &range->byteend);
@ -3102,7 +3102,7 @@ static void *block_allocate(const address_space *space, offs_t bytestart, offs_t
bytestoalloc += byteend - bytestart + 1; bytestoalloc += byteend - bytestart + 1;
/* allocate and clear the memory */ /* allocate and clear the memory */
block = malloc_or_die(bytestoalloc); block = (memory_block *)malloc_or_die(bytestoalloc);
memset(block, 0, bytestoalloc); memset(block, 0, bytestoalloc);
if (allocatemem) if (allocatemem)
memory = block + 1; memory = block + 1;
@ -3134,7 +3134,7 @@ static void *block_allocate(const address_space *space, offs_t bytestart, offs_t
block->isallocated = allocatemem; block->isallocated = allocatemem;
block->bytestart = bytestart; block->bytestart = bytestart;
block->byteend = byteend; block->byteend = byteend;
block->data = memory; block->data = (UINT8 *)memory;
/* attach us to the head of the list */ /* attach us to the head of the list */
block->next = memdata->memory_block_list; block->next = memdata->memory_block_list;
@ -3534,7 +3534,7 @@ static READ16_HANDLER( stub_read8_from_16 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT8)(mem_mask >> shift) != 0) if ((UINT8)(mem_mask >> shift) != 0)
result |= (*handler->subhandler.read.shandler8)(handler->subobject, offset) << shift; result |= (*handler->subhandler.read.shandler8)((const address_space *)handler->subobject, offset) << shift;
offset++; offset++;
} }
return result; return result;
@ -3558,7 +3558,7 @@ static READ32_HANDLER( stub_read8_from_32 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT8)(mem_mask >> shift) != 0) if ((UINT8)(mem_mask >> shift) != 0)
result |= (*handler->subhandler.read.shandler8)(handler->subobject, offset) << shift; result |= (*handler->subhandler.read.shandler8)((const address_space *)handler->subobject, offset) << shift;
offset++; offset++;
} }
return result; return result;
@ -3582,7 +3582,7 @@ static READ64_HANDLER( stub_read8_from_64 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT8)(mem_mask >> shift) != 0) if ((UINT8)(mem_mask >> shift) != 0)
result |= (UINT64)(*handler->subhandler.read.shandler8)(handler->subobject, offset) << shift; result |= (UINT64)(*handler->subhandler.read.shandler8)((const address_space *)handler->subobject, offset) << shift;
offset++; offset++;
} }
return result; return result;
@ -3606,7 +3606,7 @@ static READ32_HANDLER( stub_read16_from_32 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT16)(mem_mask >> shift) != 0) if ((UINT16)(mem_mask >> shift) != 0)
result |= (*handler->subhandler.read.shandler16)(handler->subobject, offset, mem_mask >> shift) << shift; result |= (*handler->subhandler.read.shandler16)((const address_space *)handler->subobject, offset, mem_mask >> shift) << shift;
offset++; offset++;
} }
return result; return result;
@ -3630,7 +3630,7 @@ static READ64_HANDLER( stub_read16_from_64 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT16)(mem_mask >> shift) != 0) if ((UINT16)(mem_mask >> shift) != 0)
result |= (UINT64)(*handler->subhandler.read.shandler16)(handler->subobject, offset, mem_mask >> shift) << shift; result |= (UINT64)(*handler->subhandler.read.shandler16)((const address_space *)handler->subobject, offset, mem_mask >> shift) << shift;
offset++; offset++;
} }
return result; return result;
@ -3654,7 +3654,7 @@ static READ64_HANDLER( stub_read32_from_64 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT32)(mem_mask >> shift) != 0) if ((UINT32)(mem_mask >> shift) != 0)
result |= (UINT64)(*handler->subhandler.read.shandler32)(handler->subobject, offset, mem_mask >> shift) << shift; result |= (UINT64)(*handler->subhandler.read.shandler32)((const address_space *)handler->subobject, offset, mem_mask >> shift) << shift;
offset++; offset++;
} }
return result; return result;
@ -3682,7 +3682,7 @@ static WRITE16_HANDLER( stub_write8_from_16 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT8)(mem_mask >> shift) != 0) if ((UINT8)(mem_mask >> shift) != 0)
(*handler->subhandler.write.shandler8)(handler->subobject, offset, data >> shift); (*handler->subhandler.write.shandler8)((const address_space *)handler->subobject, offset, data >> shift);
offset++; offset++;
} }
} }
@ -3704,7 +3704,7 @@ static WRITE32_HANDLER( stub_write8_from_32 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT8)(mem_mask >> shift) != 0) if ((UINT8)(mem_mask >> shift) != 0)
(*handler->subhandler.write.shandler8)(handler->subobject, offset, data >> shift); (*handler->subhandler.write.shandler8)((const address_space *)handler->subobject, offset, data >> shift);
offset++; offset++;
} }
} }
@ -3726,7 +3726,7 @@ static WRITE64_HANDLER( stub_write8_from_64 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT8)(mem_mask >> shift) != 0) if ((UINT8)(mem_mask >> shift) != 0)
(*handler->subhandler.write.shandler8)(handler->subobject, offset, data >> shift); (*handler->subhandler.write.shandler8)((const address_space *)handler->subobject, offset, data >> shift);
offset++; offset++;
} }
} }
@ -3748,7 +3748,7 @@ static WRITE32_HANDLER( stub_write16_from_32 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT16)(mem_mask >> shift) != 0) if ((UINT16)(mem_mask >> shift) != 0)
(*handler->subhandler.write.shandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift); (*handler->subhandler.write.shandler16)((const address_space *)handler->subobject, offset, data >> shift, mem_mask >> shift);
offset++; offset++;
} }
} }
@ -3770,7 +3770,7 @@ static WRITE64_HANDLER( stub_write16_from_64 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT16)(mem_mask >> shift) != 0) if ((UINT16)(mem_mask >> shift) != 0)
(*handler->subhandler.write.shandler16)(handler->subobject, offset, data >> shift, mem_mask >> shift); (*handler->subhandler.write.shandler16)((const address_space *)handler->subobject, offset, data >> shift, mem_mask >> shift);
offset++; offset++;
} }
} }
@ -3792,7 +3792,7 @@ static WRITE64_HANDLER( stub_write32_from_64 )
{ {
int shift = *subshift++; int shift = *subshift++;
if ((UINT32)(mem_mask >> shift) != 0) if ((UINT32)(mem_mask >> shift) != 0)
(*handler->subhandler.write.shandler32)(handler->subobject, offset, data >> shift, mem_mask >> shift); (*handler->subhandler.write.shandler32)((const address_space *)handler->subobject, offset, data >> shift, mem_mask >> shift);
offset++; offset++;
} }
} }

View File

@ -78,7 +78,7 @@ static void output_exit(running_machine *machine);
INLINE const char *copy_string(const char *string) INLINE const char *copy_string(const char *string)
{ {
char *newstring = malloc_or_die(strlen(string) + 1); char *newstring = (char *)malloc_or_die(strlen(string) + 1);
strcpy(newstring, string); strcpy(newstring, string);
return newstring; return newstring;
} }
@ -118,7 +118,7 @@ INLINE output_item *find_item(const char *string)
INLINE output_item *create_new_item(const char *outname, INT32 value) INLINE output_item *create_new_item(const char *outname, INT32 value)
{ {
output_item *item = malloc_or_die(sizeof(*item)); output_item *item = (output_item *)malloc_or_die(sizeof(*item));
UINT32 hash = get_hash(outname); UINT32 hash = get_hash(outname);
/* fill in the data */ /* fill in the data */
@ -343,7 +343,7 @@ void output_set_notifier(const char *outname, output_notifier_func callback, voi
/* find the end of the list and add to it */ /* find the end of the list and add to it */
while (*headptr != NULL) while (*headptr != NULL)
headptr = &(*headptr)->next; headptr = &(*headptr)->next;
*headptr = malloc_or_die(sizeof(**headptr)); *headptr = (output_notify *)malloc_or_die(sizeof(**headptr));
/* fill in the new record */ /* fill in the new record */
(*headptr)->next = NULL; (*headptr)->next = NULL;

View File

@ -343,7 +343,7 @@ INLINE container_item *alloc_container_item(void)
if (result != NULL) if (result != NULL)
container_item_free_list = result->next; container_item_free_list = result->next;
else else
result = malloc_or_die(sizeof(*result)); result = (container_item *)malloc_or_die(sizeof(*result));
memset(result, 0, sizeof(*result)); memset(result, 0, sizeof(*result));
return result; return result;
@ -375,7 +375,7 @@ INLINE render_primitive *alloc_render_primitive(int type)
if (result != NULL) if (result != NULL)
render_primitive_free_list = result->next; render_primitive_free_list = result->next;
else else
result = malloc_or_die(sizeof(*result)); result = (render_primitive *)malloc_or_die(sizeof(*result));
/* clear to 0 */ /* clear to 0 */
memset(result, 0, sizeof(*result)); memset(result, 0, sizeof(*result));
@ -426,7 +426,7 @@ INLINE void add_render_ref(render_ref **list, void *refptr)
if (ref != NULL) if (ref != NULL)
render_ref_free_list = ref->next; render_ref_free_list = ref->next;
else else
ref = malloc_or_die(sizeof(*ref)); ref = (render_ref *)malloc_or_die(sizeof(*ref));
/* set the refptr and link us into the list */ /* set the refptr and link us into the list */
ref->refptr = refptr; ref->refptr = refptr;
@ -1073,7 +1073,7 @@ render_target *render_target_alloc(running_machine *machine, const char *layoutf
int listnum; int listnum;
/* allocate memory for the target */ /* allocate memory for the target */
target = malloc_or_die(sizeof(*target)); target = (render_target *)malloc_or_die(sizeof(*target));
memset(target, 0, sizeof(*target)); memset(target, 0, sizeof(*target));
/* add it to the end of the list */ /* add it to the end of the list */
@ -1468,7 +1468,7 @@ void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT3
if (item->element == NULL) if (item->element == NULL)
{ {
const device_config *screen = device_list_find_by_index(target->machine->config->devicelist, VIDEO_SCREEN, item->index); const device_config *screen = device_list_find_by_index(target->machine->config->devicelist, VIDEO_SCREEN, item->index);
const screen_config *scrconfig = screen->inline_config; const screen_config *scrconfig = (const screen_config *)screen->inline_config;
const rectangle vectorvis = { 0, 639, 0, 479 }; const rectangle vectorvis = { 0, 639, 0, 479 };
const rectangle *visarea = NULL; const rectangle *visarea = NULL;
render_container *container = get_screen_container_by_index(item->index); render_container *container = get_screen_container_by_index(item->index);
@ -2433,7 +2433,7 @@ render_texture *render_texture_alloc(texture_scaler_func scaler, void *param)
int texnum; int texnum;
/* allocate a new group */ /* allocate a new group */
texture = malloc_or_die(sizeof(*texture) * TEXTURE_GROUP_SIZE); texture = (render_texture *)malloc_or_die(sizeof(*texture) * TEXTURE_GROUP_SIZE);
memset(texture, 0, sizeof(*texture) * TEXTURE_GROUP_SIZE); memset(texture, 0, sizeof(*texture) * TEXTURE_GROUP_SIZE);
/* add them to the list */ /* add them to the list */
@ -2672,7 +2672,7 @@ static const rgb_t *texture_get_adjusted_palette(render_texture *texture, render
numentries = palette_get_num_colors(texture->palette) * palette_get_num_groups(texture->palette); numentries = palette_get_num_colors(texture->palette) * palette_get_num_groups(texture->palette);
if (texture->bcglookup == NULL || texture->bcglookup_entries < numentries) if (texture->bcglookup == NULL || texture->bcglookup_entries < numentries)
{ {
texture->bcglookup = realloc(texture->bcglookup, numentries * sizeof(*texture->bcglookup)); texture->bcglookup = (rgb_t *)realloc(texture->bcglookup, numentries * sizeof(*texture->bcglookup));
texture->bcglookup_entries = numentries; texture->bcglookup_entries = numentries;
} }
for (index = 0; index < numentries; index++) for (index = 0; index < numentries; index++)
@ -2699,7 +2699,7 @@ static const rgb_t *texture_get_adjusted_palette(render_texture *texture, render
adjusted = palette_entry_list_adjusted(texture->palette); adjusted = palette_entry_list_adjusted(texture->palette);
if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 32) if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 32)
{ {
texture->bcglookup = realloc(texture->bcglookup, 4 * 32 * sizeof(*texture->bcglookup)); texture->bcglookup = (rgb_t *)realloc(texture->bcglookup, 4 * 32 * sizeof(*texture->bcglookup));
texture->bcglookup_entries = 4 * 32; texture->bcglookup_entries = 4 * 32;
} }
@ -2731,7 +2731,7 @@ static const rgb_t *texture_get_adjusted_palette(render_texture *texture, render
adjusted = palette_entry_list_adjusted(texture->palette); adjusted = palette_entry_list_adjusted(texture->palette);
if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 256) if (texture->bcglookup == NULL || texture->bcglookup_entries < 4 * 256)
{ {
texture->bcglookup = realloc(texture->bcglookup, 4 * 256 * sizeof(*texture->bcglookup)); texture->bcglookup = (rgb_t *)realloc(texture->bcglookup, 4 * 256 * sizeof(*texture->bcglookup));
texture->bcglookup_entries = 4 * 256; texture->bcglookup_entries = 4 * 256;
} }
@ -2770,7 +2770,7 @@ static render_container *render_container_alloc(running_machine *machine)
int color; int color;
/* allocate and clear memory */ /* allocate and clear memory */
container = malloc_or_die(sizeof(*container)); container = (render_container *)malloc_or_die(sizeof(*container));
memset(container, 0, sizeof(*container)); memset(container, 0, sizeof(*container));
/* default values */ /* default values */

View File

@ -141,7 +141,7 @@ render_font *render_font_alloc(const char *filename)
render_font *font; render_font *font;
/* allocate and clear memory */ /* allocate and clear memory */
font = malloc_or_die(sizeof(*font)); font = (render_font *)malloc_or_die(sizeof(*font));
memset(font, 0, sizeof(*font)); memset(font, 0, sizeof(*font));
/* attempt to load the cached version of the font first */ /* attempt to load the cached version of the font first */
@ -150,7 +150,7 @@ render_font *render_font_alloc(const char *filename)
/* if we failed, clean up and realloc */ /* if we failed, clean up and realloc */
render_font_free(font); render_font_free(font);
font = malloc_or_die(sizeof(*font)); font = (render_font *)malloc_or_die(sizeof(*font));
memset(font, 0, sizeof(*font)); memset(font, 0, sizeof(*font));
/* load the raw data instead */ /* load the raw data instead */
@ -434,7 +434,7 @@ static int render_font_load_cached_bdf(render_font *font, const char *filename)
/* determine the file size and allocate memory */ /* determine the file size and allocate memory */
font->rawsize = mame_fsize(file); font->rawsize = mame_fsize(file);
data = malloc_or_die(font->rawsize + 1); data = (char *)malloc_or_die(font->rawsize + 1);
/* read and hash the first chunk */ /* read and hash the first chunk */
bytes = mame_fread(file, data, MIN(CACHED_BDF_HASH_SIZE, font->rawsize)); bytes = mame_fread(file, data, MIN(CACHED_BDF_HASH_SIZE, font->rawsize));
@ -584,7 +584,7 @@ static int render_font_load_bdf(render_font *font)
/* if we don't have a subtable yet, make one */ /* if we don't have a subtable yet, make one */
if (font->chars[charnum / 256] == NULL) if (font->chars[charnum / 256] == NULL)
{ {
font->chars[charnum / 256] = malloc_or_die(256 * sizeof(font->chars[0][0])); font->chars[charnum / 256] = (render_font_char *)malloc_or_die(256 * sizeof(font->chars[0][0]));
memset(font->chars[charnum / 256], 0, 256 * sizeof(font->chars[0][0])); memset(font->chars[charnum / 256], 0, 256 * sizeof(font->chars[0][0]));
} }
@ -642,7 +642,7 @@ static int render_font_load_cached(render_font *font, mame_file *file, UINT32 ha
goto error; goto error;
/* now read the rest of the data */ /* now read the rest of the data */
data = malloc_or_die(filesize - CACHED_HEADER_SIZE); data = (UINT8 *)malloc_or_die(filesize - CACHED_HEADER_SIZE);
bytes_read = mame_fread(file, data, filesize - CACHED_HEADER_SIZE); bytes_read = mame_fread(file, data, filesize - CACHED_HEADER_SIZE);
if (bytes_read != filesize - CACHED_HEADER_SIZE) if (bytes_read != filesize - CACHED_HEADER_SIZE)
goto error; goto error;
@ -658,7 +658,7 @@ static int render_font_load_cached(render_font *font, mame_file *file, UINT32 ha
/* if we don't have a subtable yet, make one */ /* if we don't have a subtable yet, make one */
if (font->chars[chnum / 256] == NULL) if (font->chars[chnum / 256] == NULL)
{ {
font->chars[chnum / 256] = malloc_or_die(256 * sizeof(font->chars[0][0])); font->chars[chnum / 256] = (render_font_char *)malloc_or_die(256 * sizeof(font->chars[0][0]));
memset(font->chars[chnum / 256], 0, 256 * sizeof(font->chars[0][0])); memset(font->chars[chnum / 256], 0, 256 * sizeof(font->chars[0][0]));
} }
@ -728,11 +728,11 @@ static int render_font_save_cached(render_font *font, const char *filename, UINT
} }
/* allocate an array to hold the character data */ /* allocate an array to hold the character data */
chartable = malloc_or_die(numchars * CACHED_CHAR_SIZE); chartable = (UINT8 *)malloc_or_die(numchars * CACHED_CHAR_SIZE);
memset(chartable, 0, numchars * CACHED_CHAR_SIZE); memset(chartable, 0, numchars * CACHED_CHAR_SIZE);
/* allocate a temp buffer to compress into */ /* allocate a temp buffer to compress into */
tempbuffer = malloc_or_die(65536); tempbuffer = (UINT8 *)malloc_or_die(65536);
/* write the header */ /* write the header */
dest = tempbuffer; dest = tempbuffer;

View File

@ -217,7 +217,7 @@ INLINE void reduce_fraction(int *num, int *den)
INLINE const char *copy_string(const char *string) INLINE const char *copy_string(const char *string)
{ {
char *newstring = malloc_or_die(strlen(string) + 1); char *newstring = (char *)malloc_or_die(strlen(string) + 1);
strcpy(newstring, string); strcpy(newstring, string);
return newstring; return newstring;
} }
@ -348,7 +348,7 @@ void layout_view_recompute(layout_view *view, int layerconfig)
static void layout_element_scale(bitmap_t *dest, const bitmap_t *source, const rectangle *sbounds, void *param) static void layout_element_scale(bitmap_t *dest, const bitmap_t *source, const rectangle *sbounds, void *param)
{ {
element_texture *elemtex = param; element_texture *elemtex = (element_texture *)param;
element_component *component; element_component *component;
/* iterate over components that are part of the current state */ /* iterate over components that are part of the current state */
@ -1340,7 +1340,7 @@ static int get_variable_value(const machine_config *config, const char *string,
for (device = video_screen_first(config); device != NULL; device = video_screen_next(device)) for (device = video_screen_first(config); device != NULL; device = video_screen_next(device))
{ {
int scrnum = device_list_index(config->devicelist, VIDEO_SCREEN, device->tag); int scrnum = device_list_index(config->devicelist, VIDEO_SCREEN, device->tag);
const screen_config *scrconfig = device->inline_config; const screen_config *scrconfig = (const screen_config *)device->inline_config;
/* native X aspect factor */ /* native X aspect factor */
sprintf(temp, "~scr%dnativexaspect~", scrnum); sprintf(temp, "~scr%dnativexaspect~", scrnum);
@ -1509,7 +1509,7 @@ layout_file *layout_file_load(const machine_config *config, const char *dirname,
return NULL; return NULL;
/* allocate the layout group object first */ /* allocate the layout group object first */
file = malloc_or_die(sizeof(*file)); file = (layout_file *)malloc_or_die(sizeof(*file));
memset(file, 0, sizeof(*file)); memset(file, 0, sizeof(*file));
/* find the layout node */ /* find the layout node */
@ -1579,7 +1579,7 @@ static layout_element *load_layout_element(const machine_config *config, xml_dat
int first; int first;
/* allocate a new element */ /* allocate a new element */
element = malloc_or_die(sizeof(*element)); element = (layout_element *)malloc_or_die(sizeof(*element));
memset(element, 0, sizeof(*element)); memset(element, 0, sizeof(*element));
/* extract the name */ /* extract the name */
@ -1642,7 +1642,7 @@ static layout_element *load_layout_element(const machine_config *config, xml_dat
} }
/* allocate an array of element textures for the states */ /* allocate an array of element textures for the states */
element->elemtex = malloc_or_die((element->maxstate + 1) * sizeof(element->elemtex[0])); element->elemtex = (element_texture *)malloc_or_die((element->maxstate + 1) * sizeof(element->elemtex[0]));
for (state = 0; state <= element->maxstate; state++) for (state = 0; state <= element->maxstate; state++)
{ {
element->elemtex[state].element = element; element->elemtex[state].element = element;
@ -1668,7 +1668,7 @@ static element_component *load_element_component(const machine_config *config, x
element_component *component; element_component *component;
/* allocate memory for the component */ /* allocate memory for the component */
component = malloc_or_die(sizeof(*component)); component = (element_component *)malloc_or_die(sizeof(*component));
memset(component, 0, sizeof(*component)); memset(component, 0, sizeof(*component));
/* fetch common data */ /* fetch common data */
@ -1699,7 +1699,7 @@ static element_component *load_element_component(const machine_config *config, x
/* allocate a copy of the string */ /* allocate a copy of the string */
component->type = COMPONENT_TYPE_TEXT; component->type = COMPONENT_TYPE_TEXT;
string = malloc_or_die(strlen(text) + 1); string = (char *)malloc_or_die(strlen(text) + 1);
strcpy(string, text); strcpy(string, text);
component->string = string; component->string = string;
} }
@ -1756,7 +1756,7 @@ static layout_view *load_layout_view(const machine_config *config, xml_data_node
int layer; int layer;
/* first allocate memory */ /* first allocate memory */
view = malloc_or_die(sizeof(*view)); view = (layout_view *)malloc_or_die(sizeof(*view));
memset(view, 0, sizeof(*view)); memset(view, 0, sizeof(*view));
/* allocate a copy of the name */ /* allocate a copy of the name */
@ -1810,7 +1810,7 @@ static view_item *load_view_item(const machine_config *config, xml_data_node *it
const char *name; const char *name;
/* allocate a new item */ /* allocate a new item */
item = malloc_or_die(sizeof(*item)); item = (view_item *)malloc_or_die(sizeof(*item));
memset(item, 0, sizeof(*item)); memset(item, 0, sizeof(*item));
/* allocate a copy of the output name */ /* allocate a copy of the output name */

View File

@ -83,9 +83,9 @@ void render_resample_argb_bitmap_hq(void *dest, UINT32 drowpixels, UINT32 dwidth
/* if the source is higher res than the target, use full averaging */ /* if the source is higher res than the target, use full averaging */
if (dx > 0x1000 || dy > 0x1000) if (dx > 0x1000 || dy > 0x1000)
resample_argb_bitmap_average(dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy); resample_argb_bitmap_average((UINT32 *)dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy);
else else
resample_argb_bitmap_bilinear(dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy); resample_argb_bitmap_bilinear((UINT32 *)dest, drowpixels, dwidth, dheight, sbase, source->rowpixels, swidth, sheight, color, dx, dy);
} }

View File

@ -20,13 +20,13 @@
TYPE DEFINITIONS TYPE DEFINITIONS
***************************************************************************/ ***************************************************************************/
typedef enum _memory_block_overlap memory_block_overlap;
enum _memory_block_overlap enum _memory_block_overlap
{ {
OVERLAP_NONE, OVERLAP_NONE,
OVERLAP_PARTIAL, OVERLAP_PARTIAL,
OVERLAP_FULL OVERLAP_FULL
}; };
typedef enum _memory_block_overlap memory_block_overlap;
@ -260,7 +260,7 @@ char *auto_strdup_allow_null_file_line(const char *str, const char *file, int li
astring *auto_astring_alloc_file_line(const char *file, int line) astring *auto_astring_alloc_file_line(const char *file, int line)
{ {
return restrack_register_object(OBJTYPE_ASTRING, astring_alloc(), 0, file, line); return (astring *)restrack_register_object(OBJTYPE_ASTRING, astring_alloc(), 0, file, line);
} }
@ -271,7 +271,7 @@ astring *auto_astring_alloc_file_line(const char *file, int line)
bitmap_t *auto_bitmap_alloc_file_line(int width, int height, bitmap_format format, const char *file, int line) bitmap_t *auto_bitmap_alloc_file_line(int width, int height, bitmap_format format, const char *file, int line)
{ {
return restrack_register_object(OBJTYPE_BITMAP, bitmap_alloc(width, height, format), width * height, file, line); return (bitmap_t *)restrack_register_object(OBJTYPE_BITMAP, bitmap_alloc(width, height, format), width * height, file, line);
} }
@ -317,7 +317,7 @@ void validate_auto_malloc_memory(void *memory, size_t memory_size)
static void astring_destructor(void *object, size_t size) static void astring_destructor(void *object, size_t size)
{ {
astring_free(object); astring_free((astring *)object);
} }
@ -328,7 +328,7 @@ static void astring_destructor(void *object, size_t size)
static void bitmap_destructor(void *object, size_t size) static void bitmap_destructor(void *object, size_t size)
{ {
bitmap_free(object); bitmap_free((bitmap_t *)object);
} }
@ -341,7 +341,7 @@ static memory_block_overlap pool_contains_block(object_pool *pool, void *ptr, si
{ {
memory_block_overlap overlap = OVERLAP_NONE; memory_block_overlap overlap = OVERLAP_NONE;
object_pool_iterator *iter; object_pool_iterator *iter;
UINT8 *ptrstart = ptr; UINT8 *ptrstart = (UINT8 *)ptr;
UINT8 *ptrend = ptrstart + size - 1; UINT8 *ptrend = ptrstart + size - 1;
void *blockptr = NULL; void *blockptr = NULL;
size_t blocksize = 0; size_t blocksize = 0;

View File

@ -125,7 +125,7 @@ void set_disk_handle(const char *region, mame_file *file, chd_file *chdfile)
chd.origfile = file; chd.origfile = file;
/* we're okay, add to the list of disks */ /* we're okay, add to the list of disks */
*chd_list_tailptr = auto_malloc(sizeof(**chd_list_tailptr)); *chd_list_tailptr = (open_chd *)auto_malloc(sizeof(**chd_list_tailptr));
**chd_list_tailptr = chd; **chd_list_tailptr = chd;
chd_list_tailptr = &(*chd_list_tailptr)->next; chd_list_tailptr = &(*chd_list_tailptr)->next;
} }
@ -165,7 +165,7 @@ const rom_source *rom_first_source(const game_driver *drv, const machine_config
if (config != NULL) if (config != NULL)
for (device = config->devicelist; device != NULL; device = device->next) for (device = config->devicelist; device != NULL; device = device->next)
{ {
const rom_entry *devromp = device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION); const rom_entry *devromp = (const rom_entry *)device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
if (devromp != NULL) if (devromp != NULL)
return (rom_source *)device; return (rom_source *)device;
} }
@ -191,7 +191,7 @@ const rom_source *rom_next_source(const game_driver *drv, const machine_config *
/* look for further devices with ROM definitions */ /* look for further devices with ROM definitions */
for ( ; device != NULL; device = device->next) for ( ; device != NULL; device = device->next)
{ {
const rom_entry *devromp = device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION); const rom_entry *devromp = (const rom_entry *)device_get_info_ptr(device, DEVINFO_PTR_ROM_REGION);
if (devromp != NULL) if (devromp != NULL)
return (rom_source *)device; return (rom_source *)device;
} }
@ -211,7 +211,7 @@ const rom_entry *rom_first_region(const game_driver *drv, const rom_source *sour
if (source == NULL || rom_source_is_gamedrv(drv, source)) if (source == NULL || rom_source_is_gamedrv(drv, source))
romp = drv->rom; romp = drv->rom;
else else
romp = device_get_info_ptr((const device_config *)source, DEVINFO_PTR_ROM_REGION); romp = (const rom_entry *)device_get_info_ptr((const device_config *)source, DEVINFO_PTR_ROM_REGION);
return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL; return (romp != NULL && !ROMENTRY_ISEND(romp)) ? romp : NULL;
} }
@ -757,7 +757,7 @@ static int read_rom_data(rom_load_data *romdata, const rom_entry *romp)
/* use a temporary buffer for complex loads */ /* use a temporary buffer for complex loads */
tempbufsize = MIN(TEMPBUFFER_MAX_SIZE, numbytes); tempbufsize = MIN(TEMPBUFFER_MAX_SIZE, numbytes);
tempbuf = malloc_or_die(tempbufsize); tempbuf = (UINT8 *)malloc_or_die(tempbufsize);
/* chunky reads for complex loads */ /* chunky reads for complex loads */
skip += groupsize; skip += groupsize;
@ -1225,7 +1225,7 @@ static void process_disk_entries(rom_load_data *romdata, const char *regiontag,
/* we're okay, add to the list of disks */ /* we're okay, add to the list of disks */
LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp))); LOG(("Assigning to handle %d\n", DISK_GETINDEX(romp)));
*chd_list_tailptr = auto_malloc(sizeof(**chd_list_tailptr)); *chd_list_tailptr = (open_chd *)auto_malloc(sizeof(**chd_list_tailptr));
**chd_list_tailptr = chd; **chd_list_tailptr = chd;
chd_list_tailptr = &(*chd_list_tailptr)->next; chd_list_tailptr = &(*chd_list_tailptr)->next;
} }

View File

@ -166,7 +166,7 @@ INLINE speaker_info *index_to_input(running_machine *machine, int index, int *in
/* scan through the speakers until we find the indexed input */ /* scan through the speakers until we find the indexed input */
for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
{ {
speaker_info *info = curspeak->token; speaker_info *info = (speaker_info *)curspeak->token;
if (index < count + info->inputs) if (index < count + info->inputs)
{ {
*input = index - count; *input = index - count;
@ -202,9 +202,9 @@ void sound_init(running_machine *machine)
VPRINTF(("total speakers = %d\n", speaker_output_count(machine->config))); VPRINTF(("total speakers = %d\n", speaker_output_count(machine->config)));
/* allocate memory for mix buffers */ /* allocate memory for mix buffers */
leftmix = auto_malloc(machine->sample_rate * sizeof(*leftmix)); leftmix = (INT32 *)auto_malloc(machine->sample_rate * sizeof(*leftmix));
rightmix = auto_malloc(machine->sample_rate * sizeof(*rightmix)); rightmix = (INT32 *)auto_malloc(machine->sample_rate * sizeof(*rightmix));
finalmix = auto_malloc(machine->sample_rate * sizeof(*finalmix)); finalmix = (INT16 *)auto_malloc(machine->sample_rate * sizeof(*finalmix));
/* allocate a global timer for sound timing */ /* allocate a global timer for sound timing */
sound_update_timer = timer_alloc(machine, sound_update, NULL); sound_update_timer = timer_alloc(machine, sound_update, NULL);
@ -270,7 +270,7 @@ static DEVICE_START( sound )
assert(device->machine->config != NULL); assert(device->machine->config != NULL);
/* get pointers to our data */ /* get pointers to our data */
config = device->inline_config; config = (const sound_config *)device->inline_config;
classdata = get_class_data(device); classdata = get_class_data(device);
/* get the chip's start function */ /* get the chip's start function */
@ -324,7 +324,7 @@ static DEVICE_START( sound )
static DEVICE_CUSTOM_CONFIG( sound ) static DEVICE_CUSTOM_CONFIG( sound )
{ {
sound_config *config = device->inline_config; sound_config *config = (sound_config *)device->inline_config;
switch (entrytype) switch (entrytype)
{ {
@ -341,7 +341,7 @@ static DEVICE_CUSTOM_CONFIG( sound )
/* allocate a new route */ /* allocate a new route */
for (routeptr = &config->routelist; *routeptr != NULL; routeptr = &(*routeptr)->next) ; for (routeptr = &config->routelist; *routeptr != NULL; routeptr = &(*routeptr)->next) ;
*routeptr = malloc_or_die(sizeof(**routeptr)); *routeptr = (sound_route *)malloc_or_die(sizeof(**routeptr));
(*routeptr)->next = NULL; (*routeptr)->next = NULL;
(*routeptr)->output = output; (*routeptr)->output = output;
(*routeptr)->input = input; (*routeptr)->input = input;
@ -372,7 +372,7 @@ static DEVICE_CUSTOM_CONFIG( sound )
DEVICE_GET_INFO( sound ) DEVICE_GET_INFO( sound )
{ {
const sound_config *config = (device != NULL) ? device->inline_config : NULL; const sound_config *config = (device != NULL) ? (const sound_config *)device->inline_config : NULL;
switch (state) switch (state)
{ {
@ -425,7 +425,7 @@ static void route_sound(running_machine *machine)
/* first count up the inputs for each speaker */ /* first count up the inputs for each speaker */
for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound)) for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound))
{ {
const sound_config *config = sound->inline_config; const sound_config *config = (const sound_config *)sound->inline_config;
int numoutputs = stream_get_device_outputs(sound); int numoutputs = stream_get_device_outputs(sound);
const sound_route *route; const sound_route *route;
@ -452,7 +452,7 @@ static void route_sound(running_machine *machine)
{ {
info->mixer_stream = stream_create(curspeak, info->inputs, 1, machine->sample_rate, info, mixer_update); info->mixer_stream = stream_create(curspeak, info->inputs, 1, machine->sample_rate, info, mixer_update);
state_save_register_postload(machine, mixer_postload, info->mixer_stream); state_save_register_postload(machine, mixer_postload, info->mixer_stream);
info->input = auto_malloc(info->inputs * sizeof(*info->input)); info->input = (speaker_input *)auto_malloc(info->inputs * sizeof(*info->input));
info->inputs = 0; info->inputs = 0;
} }
else else
@ -462,7 +462,7 @@ static void route_sound(running_machine *machine)
/* iterate again over all the sound chips */ /* iterate again over all the sound chips */
for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound)) for (sound = sound_first(machine->config); sound != NULL; sound = sound_next(sound))
{ {
const sound_config *config = sound->inline_config; const sound_config *config = (const sound_config *)sound->inline_config;
int numoutputs = stream_get_device_outputs(sound); int numoutputs = stream_get_device_outputs(sound);
const sound_route *route; const sound_route *route;
@ -693,7 +693,7 @@ static TIMER_CALLBACK( sound_update )
/* force all the speaker streams to generate the proper number of samples */ /* force all the speaker streams to generate the proper number of samples */
for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
{ {
speaker_info *spk = curspeak->token; speaker_info *spk = (speaker_info *)curspeak->token;
const stream_sample_t *stream_buf; const stream_sample_t *stream_buf;
/* get the output buffer */ /* get the output buffer */
@ -801,7 +801,7 @@ static TIMER_CALLBACK( sound_update )
static STREAM_UPDATE( mixer_update ) static STREAM_UPDATE( mixer_update )
{ {
speaker_info *speaker = param; speaker_info *speaker = (speaker_info *)param;
int numinputs = speaker->inputs; int numinputs = speaker->inputs;
int pos; int pos;
@ -828,7 +828,7 @@ static STREAM_UPDATE( mixer_update )
static STATE_POSTLOAD( mixer_postload ) static STATE_POSTLOAD( mixer_postload )
{ {
sound_stream *stream = param; sound_stream *stream = (sound_stream *)param;
stream_set_sample_rate(stream, machine->sample_rate); stream_set_sample_rate(stream, machine->sample_rate);
} }
@ -845,10 +845,10 @@ static STATE_POSTLOAD( mixer_postload )
static DEVICE_START( speaker_output ) static DEVICE_START( speaker_output )
{ {
speaker_info *info = device->token; speaker_info *info = (speaker_info *)device->token;
/* copy in all the relevant info */ /* copy in all the relevant info */
info->speaker = device->inline_config; info->speaker = (const speaker_config *)device->inline_config;
info->tag = device->tag; info->tag = device->tag;
} }
@ -937,7 +937,7 @@ int sound_get_user_gain_count(running_machine *machine)
/* count up the number of speaker inputs */ /* count up the number of speaker inputs */
for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak)) for (curspeak = speaker_output_first(machine->config); curspeak != NULL; curspeak = speaker_output_next(curspeak))
{ {
speaker_info *info = curspeak->token; speaker_info *info = (speaker_info *)curspeak->token;
count += info->inputs; count += info->inputs;
} }
return count; return count;

View File

@ -157,7 +157,7 @@ static void update_prd_changed_timer(cdp1869_t *cdp1869)
static TIMER_CALLBACK( prd_changed_tick ) static TIMER_CALLBACK( prd_changed_tick )
{ {
const device_config *device = ptr; const device_config *device = (const device_config *)ptr;
cdp1869_t *cdp1869 = get_safe_token(device); cdp1869_t *cdp1869 = get_safe_token(device);
devcb_call_write_line(&cdp1869->out_prd_func, param); devcb_call_write_line(&cdp1869->out_prd_func, param);

View File

@ -2,7 +2,7 @@
#include "filter.h" #include "filter.h"
static filter* filter_alloc(void) { static filter* filter_alloc(void) {
filter* f = malloc_or_die(sizeof(filter)); filter* f = (filter *)malloc_or_die(sizeof(filter));
return f; return f;
} }
@ -20,7 +20,7 @@ void filter_state_reset(filter* f, filter_state* s) {
filter_state* filter_state_alloc(void) { filter_state* filter_state_alloc(void) {
int i; int i;
filter_state* s = malloc_or_die(sizeof(filter_state)); filter_state* s = (filter_state *)malloc_or_die(sizeof(filter_state));
s->prev_mac = 0; s->prev_mac = 0;
for(i=0;i<FILTER_ORDER_MAX;++i) for(i=0;i<FILTER_ORDER_MAX;++i)
s->xprev[i] = 0; s->xprev[i] = 0;

View File

@ -28,7 +28,7 @@ static STREAM_UPDATE( filter_rc_update )
{ {
stream_sample_t *src = inputs[0]; stream_sample_t *src = inputs[0];
stream_sample_t *dst = outputs[0]; stream_sample_t *dst = outputs[0];
filter_rc_state *info = param; filter_rc_state *info = (filter_rc_state *)param;
int memory = info->memory; int memory = info->memory;
switch (info->type) switch (info->type)
@ -93,7 +93,7 @@ static void set_RC_info(filter_rc_state *info, int type, double R1, double R2, d
static DEVICE_START( filter_rc ) static DEVICE_START( filter_rc )
{ {
filter_rc_state *info = get_safe_token(device); filter_rc_state *info = get_safe_token(device);
const flt_rc_config *conf = device->static_config; const flt_rc_config *conf = (const flt_rc_config *)device->static_config;
info->device = device; info->device = device;
info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update); info->stream = stream_create(device, 1, 1, device->machine->sample_rate, info, filter_rc_update);

View File

@ -25,7 +25,7 @@ static STREAM_UPDATE( filter_volume_update )
{ {
stream_sample_t *src = inputs[0]; stream_sample_t *src = inputs[0];
stream_sample_t *dst = outputs[0]; stream_sample_t *dst = outputs[0];
filter_volume_state *info = param; filter_volume_state *info = (filter_volume_state *)param;
while (samples--) while (samples--)
*dst++ = (*src++ * info->gain) >> 8; *dst++ = (*src++ * info->gain) >> 8;

View File

@ -126,7 +126,7 @@ void wav_add_data_32(wav_file *wav, INT32 *data, int samples, int shift)
if (!wav) return; if (!wav) return;
/* allocate temp memory */ /* allocate temp memory */
temp = malloc(samples * sizeof(temp[0])); temp = (INT16 *)malloc(samples * sizeof(temp[0]));
if (!temp) if (!temp)
return; return;
@ -154,7 +154,7 @@ void wav_add_data_16lr(wav_file *wav, INT16 *left, INT16 *right, int samples)
if (!wav) return; if (!wav) return;
/* allocate temp memory */ /* allocate temp memory */
temp = malloc(samples * 2 * sizeof(temp[0])); temp = (INT16 *)malloc(samples * 2 * sizeof(temp[0]));
if (!temp) if (!temp)
return; return;
@ -179,7 +179,7 @@ void wav_add_data_32lr(wav_file *wav, INT32 *left, INT32 *right, int samples, in
if (!wav) return; if (!wav) return;
/* allocate temp memory */ /* allocate temp memory */
temp = malloc(samples * 2 * sizeof(temp[0])); temp = (INT16 *)malloc(samples * 2 * sizeof(temp[0]));
if (!temp) if (!temp)
return; return;

View File

@ -133,19 +133,19 @@ INLINE void flip_data(state_entry *entry)
switch (entry->typesize) switch (entry->typesize)
{ {
case 2: case 2:
data16 = entry->data; data16 = (UINT16 *)entry->data;
for (count = 0; count < entry->typecount; count++) for (count = 0; count < entry->typecount; count++)
data16[count] = FLIPENDIAN_INT16(data16[count]); data16[count] = FLIPENDIAN_INT16(data16[count]);
break; break;
case 4: case 4:
data32 = entry->data; data32 = (UINT32 *)entry->data;
for (count = 0; count < entry->typecount; count++) for (count = 0; count < entry->typecount; count++)
data32[count] = FLIPENDIAN_INT32(data32[count]); data32[count] = FLIPENDIAN_INT32(data32[count]);
break; break;
case 8: case 8:
data64 = entry->data; data64 = (UINT64 *)entry->data;
for (count = 0; count < entry->typecount; count++) for (count = 0; count < entry->typecount; count++)
data64[count] = FLIPENDIAN_INT64(data64[count]); data64[count] = FLIPENDIAN_INT64(data64[count]);
break; break;
@ -165,7 +165,7 @@ INLINE void flip_data(state_entry *entry)
void state_init(running_machine *machine) void state_init(running_machine *machine)
{ {
machine->state_data = auto_malloc(sizeof(*machine->state_data)); machine->state_data = (state_private *)auto_malloc(sizeof(*machine->state_data));
memset(machine->state_data, 0, sizeof(*machine->state_data)); memset(machine->state_data, 0, sizeof(*machine->state_data));
} }
@ -264,7 +264,7 @@ void state_save_register_memory(running_machine *machine, const char *module, co
/* didn't find one; allocate a new one */ /* didn't find one; allocate a new one */
next = *entryptr; next = *entryptr;
*entryptr = malloc_or_die(sizeof(**entryptr)); *entryptr = (state_entry *)malloc_or_die(sizeof(**entryptr));
memset(*entryptr, 0, sizeof(**entryptr)); memset(*entryptr, 0, sizeof(**entryptr));
/* fill in the rest */ /* fill in the rest */
@ -314,7 +314,7 @@ void state_save_register_presave(running_machine *machine, state_presave_func fu
fatalerror("Duplicate save state function (%p, %p)", param, func); fatalerror("Duplicate save state function (%p, %p)", param, func);
/* allocate a new entry */ /* allocate a new entry */
*cbptr = malloc_or_die(sizeof(state_callback)); *cbptr = (state_callback *)malloc_or_die(sizeof(state_callback));
/* fill it in */ /* fill it in */
(*cbptr)->next = NULL; (*cbptr)->next = NULL;
@ -345,7 +345,7 @@ void state_save_register_postload(running_machine *machine, state_postload_func
fatalerror("Duplicate save state function (%p, %p)", param, func); fatalerror("Duplicate save state function (%p, %p)", param, func);
/* allocate a new entry */ /* allocate a new entry */
*cbptr = malloc_or_die(sizeof(state_callback)); *cbptr = (state_callback *)malloc_or_die(sizeof(state_callback));
/* fill it in */ /* fill it in */
(*cbptr)->next = NULL; (*cbptr)->next = NULL;

View File

@ -52,7 +52,7 @@ typedef enum _state_save_error state_save_error;
#define IS_COMPATIBLE_TYPE(_valtype, _checktype) \ #define IS_COMPATIBLE_TYPE(_valtype, _checktype) \
(sizeof(_valtype) == sizeof(_checktype) && TYPES_COMPATIBLE(typeof(_valtype), _checktype)) (sizeof(_valtype) == sizeof(_checktype) && TYPES_COMPATIBLE(_valtype, _checktype))
#define IS_VALID_SAVE_TYPE(_valtype) \ #define IS_VALID_SAVE_TYPE(_valtype) \
(IS_COMPATIBLE_TYPE(_valtype, double) || IS_COMPATIBLE_TYPE(_valtype, float) || \ (IS_COMPATIBLE_TYPE(_valtype, double) || IS_COMPATIBLE_TYPE(_valtype, float) || \

View File

@ -218,7 +218,7 @@ void streams_init(running_machine *machine)
streams_private *strdata; streams_private *strdata;
/* allocate memory for our private data */ /* allocate memory for our private data */
strdata = auto_malloc(sizeof(*strdata)); strdata = (streams_private *)auto_malloc(sizeof(*strdata));
memset(strdata, 0, sizeof(*strdata)); memset(strdata, 0, sizeof(*strdata));
/* reset globals */ /* reset globals */
@ -343,7 +343,7 @@ sound_stream *stream_create(const device_config *device, int inputs, int outputs
char statetag[30]; char statetag[30];
/* allocate memory */ /* allocate memory */
stream = auto_malloc(sizeof(*stream)); stream = (sound_stream *)auto_malloc(sizeof(*stream));
memset(stream, 0, sizeof(*stream)); memset(stream, 0, sizeof(*stream));
VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream)); VPRINTF(("stream_create(%d, %d, %d) => %p\n", inputs, outputs, sample_rate, stream));
@ -365,9 +365,9 @@ sound_stream *stream_create(const device_config *device, int inputs, int outputs
/* allocate space for the inputs */ /* allocate space for the inputs */
if (inputs > 0) if (inputs > 0)
{ {
stream->input = auto_malloc(inputs * sizeof(*stream->input)); stream->input = (stream_input *)auto_malloc(inputs * sizeof(*stream->input));
memset(stream->input, 0, inputs * sizeof(*stream->input)); memset(stream->input, 0, inputs * sizeof(*stream->input));
stream->input_array = auto_malloc(inputs * sizeof(*stream->input_array)); stream->input_array = (stream_sample_t **)auto_malloc(inputs * sizeof(*stream->input_array));
memset(stream->input_array, 0, inputs * sizeof(*stream->input_array)); memset(stream->input_array, 0, inputs * sizeof(*stream->input_array));
} }
@ -382,9 +382,9 @@ sound_stream *stream_create(const device_config *device, int inputs, int outputs
/* allocate space for the outputs */ /* allocate space for the outputs */
if (outputs > 0) if (outputs > 0)
{ {
stream->output = auto_malloc(outputs * sizeof(*stream->output)); stream->output = (stream_output *)auto_malloc(outputs * sizeof(*stream->output));
memset(stream->output, 0, outputs * sizeof(*stream->output)); memset(stream->output, 0, outputs * sizeof(*stream->output));
stream->output_array = auto_malloc(outputs * sizeof(*stream->output_array)); stream->output_array = (stream_sample_t **)auto_malloc(outputs * sizeof(*stream->output_array));
memset(stream->output_array, 0, outputs * sizeof(*stream->output_array)); memset(stream->output_array, 0, outputs * sizeof(*stream->output_array));
} }
@ -698,7 +698,7 @@ void stream_set_output_gain(sound_stream *stream, int output, float gain)
static STATE_POSTLOAD( stream_postload ) static STATE_POSTLOAD( stream_postload )
{ {
streams_private *strdata = machine->streams_data; streams_private *strdata = machine->streams_data;
sound_stream *stream = param; sound_stream *stream = (sound_stream *)param;
int outputnum; int outputnum;
/* recompute the same rate information */ /* recompute the same rate information */
@ -737,7 +737,7 @@ static void allocate_resample_buffers(streams_private *strdata, sound_stream *st
for (inputnum = 0; inputnum < stream->inputs; inputnum++) for (inputnum = 0; inputnum < stream->inputs; inputnum++)
{ {
stream_input *input = &stream->input[inputnum]; stream_input *input = &stream->input[inputnum];
input->resample = auto_realloc(input->resample, stream->resample_bufalloc * sizeof(input->resample[0])); input->resample = (stream_sample_t *)auto_realloc(input->resample, stream->resample_bufalloc * sizeof(input->resample[0]));
} }
} }
} }
@ -767,7 +767,7 @@ static void allocate_output_buffers(streams_private *strdata, sound_stream *stre
for (outputnum = 0; outputnum < stream->outputs; outputnum++) for (outputnum = 0; outputnum < stream->outputs; outputnum++)
{ {
stream_output *output = &stream->output[outputnum]; stream_output *output = &stream->output[outputnum];
output->buffer = auto_realloc(output->buffer, stream->output_bufalloc * sizeof(output->buffer[0])); output->buffer = (stream_sample_t *)auto_realloc(output->buffer, stream->output_bufalloc * sizeof(output->buffer[0]));
memset(&output->buffer[oldsize], 0, (stream->output_bufalloc - oldsize) * sizeof(output->buffer[0])); memset(&output->buffer[oldsize], 0, (stream->output_bufalloc - oldsize) * sizeof(output->buffer[0]));
} }
} }

View File

@ -324,7 +324,7 @@ tilemap *tilemap_create(running_machine *machine, tile_get_info_func tile_get_in
int group; int group;
/* allocate the tilemap itself */ /* allocate the tilemap itself */
tmap = malloc_or_die(sizeof(*tmap)); tmap = (tilemap *)malloc_or_die(sizeof(*tmap));
memset(tmap, 0, sizeof(*tmap)); memset(tmap, 0, sizeof(*tmap));
/* fill in the basic metrics */ /* fill in the basic metrics */
@ -354,18 +354,18 @@ tilemap *tilemap_create(running_machine *machine, tile_get_info_func tile_get_in
/* initialize scroll information */ /* initialize scroll information */
tmap->scrollrows = 1; tmap->scrollrows = 1;
tmap->scrollcols = 1; tmap->scrollcols = 1;
tmap->rowscroll = malloc_or_die(tmap->height * sizeof(*tmap->rowscroll)); tmap->rowscroll = (INT32 *)malloc_or_die(tmap->height * sizeof(*tmap->rowscroll));
memset(tmap->rowscroll, 0, tmap->height * sizeof(*tmap->rowscroll)); memset(tmap->rowscroll, 0, tmap->height * sizeof(*tmap->rowscroll));
tmap->colscroll = malloc_or_die(tmap->width * sizeof(*tmap->colscroll)); tmap->colscroll = (INT32 *)malloc_or_die(tmap->width * sizeof(*tmap->colscroll));
memset(tmap->colscroll, 0, tmap->width * sizeof(*tmap->colscroll)); memset(tmap->colscroll, 0, tmap->width * sizeof(*tmap->colscroll));
/* allocate the pixel data cache */ /* allocate the pixel data cache */
tmap->pixmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED16); tmap->pixmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED16);
/* allocate transparency mapping data */ /* allocate transparency mapping data */
tmap->tileflags = malloc_or_die(tmap->max_logical_index); tmap->tileflags = (UINT8 *)malloc_or_die(tmap->max_logical_index);
tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8); tmap->flagsmap = bitmap_alloc(tmap->width, tmap->height, BITMAP_FORMAT_INDEXED8);
tmap->pen_to_flags = malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS); tmap->pen_to_flags = (UINT8 *)malloc_or_die(sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
memset(tmap->pen_to_flags, 0, sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS); memset(tmap->pen_to_flags, 0, sizeof(tmap->pen_to_flags[0]) * MAX_PEN_TO_FLAGS * TILEMAP_NUM_GROUPS);
for (group = 0; group < TILEMAP_NUM_GROUPS; group++) for (group = 0; group < TILEMAP_NUM_GROUPS; group++)
tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0); tilemap_map_pens_to_layer(tmap, group, 0, 0, TILEMAP_PIXEL_LAYER0);
@ -1095,7 +1095,7 @@ static void tilemap_exit(running_machine *machine)
static STATE_POSTLOAD( tilemap_postload ) static STATE_POSTLOAD( tilemap_postload )
{ {
/* recompute the mappings for this tilemap */ /* recompute the mappings for this tilemap */
tilemap *tmap = param; tilemap *tmap = (tilemap *)param;
mappings_update(tmap); mappings_update(tmap);
} }
@ -1157,8 +1157,8 @@ static void mappings_create(tilemap *tmap)
tmap->max_memory_index++; tmap->max_memory_index++;
/* allocate the necessary mappings */ /* allocate the necessary mappings */
tmap->memory_to_logical = malloc_or_die(tmap->max_memory_index * sizeof(*tmap->memory_to_logical)); tmap->memory_to_logical = (tilemap_logical_index *)malloc_or_die(tmap->max_memory_index * sizeof(*tmap->memory_to_logical));
tmap->logical_to_memory = malloc_or_die(tmap->max_logical_index * sizeof(*tmap->logical_to_memory)); tmap->logical_to_memory = (tilemap_memory_index *)malloc_or_die(tmap->max_logical_index * sizeof(*tmap->logical_to_memory));
/* update the mappings */ /* update the mappings */
mappings_update(tmap); mappings_update(tmap);
@ -1969,7 +1969,7 @@ static void scanline_draw_masked_null(void *dest, const UINT16 *source, const UI
static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
UINT16 *dest = _dest; UINT16 *dest = (UINT16 *)_dest;
int pal = pcode >> 16; int pal = pcode >> 16;
int i; int i;
@ -2012,7 +2012,7 @@ static void scanline_draw_opaque_ind16(void *_dest, const UINT16 *source, int co
static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
UINT16 *dest = _dest; UINT16 *dest = (UINT16 *)_dest;
int pal = pcode >> 16; int pal = pcode >> 16;
int i; int i;
@ -2046,7 +2046,7 @@ static void scanline_draw_masked_ind16(void *_dest, const UINT16 *source, const
static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT16 *dest = _dest; UINT16 *dest = (UINT16 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2076,7 +2076,7 @@ static void scanline_draw_opaque_rgb16(void *_dest, const UINT16 *source, int co
static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT16 *dest = _dest; UINT16 *dest = (UINT16 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2108,7 +2108,7 @@ static void scanline_draw_masked_rgb16(void *_dest, const UINT16 *source, const
static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT16 *dest = _dest; UINT16 *dest = (UINT16 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2139,7 +2139,7 @@ static void scanline_draw_opaque_rgb16_alpha(void *_dest, const UINT16 *source,
static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT16 *dest = _dest; UINT16 *dest = (UINT16 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2171,7 +2171,7 @@ static void scanline_draw_masked_rgb16_alpha(void *_dest, const UINT16 *source,
static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT32 *dest = _dest; UINT32 *dest = (UINT32 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2201,7 +2201,7 @@ static void scanline_draw_opaque_rgb32(void *_dest, const UINT16 *source, int co
static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT32 *dest = _dest; UINT32 *dest = (UINT32 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2233,7 +2233,7 @@ static void scanline_draw_masked_rgb32(void *_dest, const UINT16 *source, const
static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT32 *dest = _dest; UINT32 *dest = (UINT32 *)_dest;
int i; int i;
/* priority case */ /* priority case */
@ -2264,7 +2264,7 @@ static void scanline_draw_opaque_rgb32_alpha(void *_dest, const UINT16 *source,
static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha) static void scanline_draw_masked_rgb32_alpha(void *_dest, const UINT16 *source, const UINT8 *maskptr, int mask, int value, int count, const pen_t *pens, UINT8 *pri, UINT32 pcode, UINT8 alpha)
{ {
const pen_t *clut = &pens[pcode >> 16]; const pen_t *clut = &pens[pcode >> 16];
UINT32 *dest = _dest; UINT32 *dest = (UINT32 *)_dest;
int i; int i;
/* priority case */ /* priority case */

View File

@ -300,7 +300,7 @@ void timer_init(running_machine *machine)
int i; int i;
/* allocate global data */ /* allocate global data */
global = machine->timer_data = auto_malloc(sizeof(*global)); global = machine->timer_data = (timer_private *)auto_malloc(sizeof(*global));
memset(global, 0, sizeof(*global)); memset(global, 0, sizeof(*global));
/* we need to wait until the first call to timer_cyclestorun before using real CPU times */ /* we need to wait until the first call to timer_cyclestorun before using real CPU times */
@ -339,7 +339,7 @@ void timer_init(running_machine *machine)
void timer_destructor(void *ptr, size_t size) void timer_destructor(void *ptr, size_t size)
{ {
timer_remove(ptr); timer_remove((emu_timer *)ptr);
} }
@ -1056,9 +1056,9 @@ attotime timer_device_firetime(const device_config *timer)
static TIMER_CALLBACK( periodic_timer_device_timer_callback ) static TIMER_CALLBACK( periodic_timer_device_timer_callback )
{ {
const device_config *timer = ptr; const device_config *timer = (const device_config *)ptr;
timer_state *state = get_safe_token(timer); timer_state *state = get_safe_token(timer);
timer_config *config = timer->inline_config; timer_config *config = (timer_config *)timer->inline_config;
/* call the real callback */ /* call the real callback */
config->callback(timer, state->ptr, state->param); config->callback(timer, state->ptr, state->param);
@ -1074,9 +1074,9 @@ static TIMER_CALLBACK( periodic_timer_device_timer_callback )
static TIMER_CALLBACK( scanline_timer_device_timer_callback ) static TIMER_CALLBACK( scanline_timer_device_timer_callback )
{ {
int next_vpos; int next_vpos;
const device_config *timer = ptr; const device_config *timer = (const device_config *)ptr;
timer_state *state = get_safe_token(timer); timer_state *state = get_safe_token(timer);
timer_config *config = timer->inline_config; timer_config *config = (timer_config *)timer->inline_config;
/* get the screen device and verify it */ /* get the screen device and verify it */
const device_config *screen = devtag_get_device(timer->machine, config->screen); const device_config *screen = devtag_get_device(timer->machine, config->screen);
@ -1173,7 +1173,7 @@ static DEVICE_START( timer )
assert(device->machine->config != NULL); assert(device->machine->config != NULL);
/* get and validate the configuration */ /* get and validate the configuration */
config = device->inline_config; config = (timer_config *)device->inline_config;
assert(config->type == TIMER_TYPE_PERIODIC || config->type == TIMER_TYPE_SCANLINE || config->type == TIMER_TYPE_GENERIC); assert(config->type == TIMER_TYPE_PERIODIC || config->type == TIMER_TYPE_SCANLINE || config->type == TIMER_TYPE_GENERIC);
assert(config->callback != NULL); assert(config->callback != NULL);

View File

@ -1059,7 +1059,7 @@ astring *game_info_astring(running_machine *machine, astring *string)
for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen)) for (screen = video_screen_first(machine->config); screen != NULL; screen = video_screen_next(screen))
{ {
const screen_config *scrconfig = screen->inline_config; const screen_config *scrconfig = (const screen_config *)screen->inline_config;
if (scrcount > 1) if (scrcount > 1)
{ {
@ -1414,7 +1414,7 @@ const slider_state *ui_get_slider_list(void)
static slider_state *slider_alloc(const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg) static slider_state *slider_alloc(const char *title, INT32 minval, INT32 defval, INT32 maxval, INT32 incval, slider_update update, void *arg)
{ {
int size = sizeof(slider_state) + strlen(title); int size = sizeof(slider_state) + strlen(title);
slider_state *state = auto_malloc(size); slider_state *state = (slider_state *)auto_malloc(size);
memset(state, 0, size); memset(state, 0, size);
state->minval = minval; state->minval = minval;
@ -1488,7 +1488,7 @@ static slider_state *slider_init(running_machine *machine)
/* add screen parameters */ /* add screen parameters */
for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device)) for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
{ {
const screen_config *scrconfig = device->inline_config; const screen_config *scrconfig = (const screen_config *)device->inline_config;
int defxscale = floor(scrconfig->xscale * 1000.0f + 0.5f); int defxscale = floor(scrconfig->xscale * 1000.0f + 0.5f);
int defyscale = floor(scrconfig->yscale * 1000.0f + 0.5f); int defyscale = floor(scrconfig->yscale * 1000.0f + 0.5f);
int defxoffset = floor(scrconfig->xoffset * 1000.0f + 0.5f); int defxoffset = floor(scrconfig->xoffset * 1000.0f + 0.5f);
@ -1531,7 +1531,7 @@ static slider_state *slider_init(running_machine *machine)
for (device = device_list_first(machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC)) for (device = device_list_first(machine->config->devicelist, LASERDISC); device != NULL; device = device_list_next(device, LASERDISC))
{ {
const laserdisc_config *config = device->inline_config; const laserdisc_config *config = (const laserdisc_config *)device->inline_config;
if (config->overupdate != NULL) if (config->overupdate != NULL)
{ {
int defxscale = floor(config->overscalex * 1000.0f + 0.5f); int defxscale = floor(config->overscalex * 1000.0f + 0.5f);
@ -1558,7 +1558,7 @@ static slider_state *slider_init(running_machine *machine)
for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device)) for (device = video_screen_first(machine->config); device != NULL; device = video_screen_next(device))
{ {
const screen_config *scrconfig = device->inline_config; const screen_config *scrconfig = (const screen_config *)device->inline_config;
if (scrconfig->type == SCREEN_TYPE_VECTOR) if (scrconfig->type == SCREEN_TYPE_VECTOR)
{ {
/* add flicker control */ /* add flicker control */
@ -1628,7 +1628,7 @@ static INT32 slider_mixervol(running_machine *machine, void *arg, astring *strin
static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_adjuster(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const input_field_config *field = arg; const input_field_config *field = (const input_field_config *)arg;
input_field_user_settings settings; input_field_user_settings settings;
input_field_get_user_settings(field, &settings); input_field_get_user_settings(field, &settings);
@ -1665,8 +1665,8 @@ static INT32 slider_overclock(running_machine *machine, void *arg, astring *stri
static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_refresh(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
const screen_config *scrconfig = screen->inline_config; const screen_config *scrconfig = (const screen_config *)screen->inline_config;
double defrefresh = ATTOSECONDS_TO_HZ(scrconfig->refresh); double defrefresh = ATTOSECONDS_TO_HZ(scrconfig->refresh);
double refresh; double refresh;
@ -1692,7 +1692,7 @@ static INT32 slider_refresh(running_machine *machine, void *arg, astring *string
static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_brightness(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1715,7 +1715,7 @@ static INT32 slider_brightness(running_machine *machine, void *arg, astring *str
static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_contrast(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1737,7 +1737,7 @@ static INT32 slider_contrast(running_machine *machine, void *arg, astring *strin
static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_gamma(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1760,7 +1760,7 @@ static INT32 slider_gamma(running_machine *machine, void *arg, astring *string,
static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_xscale(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1783,7 +1783,7 @@ static INT32 slider_xscale(running_machine *machine, void *arg, astring *string,
static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_yscale(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1806,7 +1806,7 @@ static INT32 slider_yscale(running_machine *machine, void *arg, astring *string,
static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1829,7 +1829,7 @@ static INT32 slider_xoffset(running_machine *machine, void *arg, astring *string
static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *screen = arg; const device_config *screen = (const device_config *)arg;
render_container *container = render_container_get_screen(screen); render_container *container = render_container_get_screen(screen);
render_container_user_settings settings; render_container_user_settings settings;
@ -1852,7 +1852,7 @@ static INT32 slider_yoffset(running_machine *machine, void *arg, astring *string
static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_overxscale(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *laserdisc = arg; const device_config *laserdisc = (const device_config *)arg;
laserdisc_config settings; laserdisc_config settings;
laserdisc_get_config(laserdisc, &settings); laserdisc_get_config(laserdisc, &settings);
@ -1874,7 +1874,7 @@ static INT32 slider_overxscale(running_machine *machine, void *arg, astring *str
static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_overyscale(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *laserdisc = arg; const device_config *laserdisc = (const device_config *)arg;
laserdisc_config settings; laserdisc_config settings;
laserdisc_get_config(laserdisc, &settings); laserdisc_get_config(laserdisc, &settings);
@ -1896,7 +1896,7 @@ static INT32 slider_overyscale(running_machine *machine, void *arg, astring *str
static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *laserdisc = arg; const device_config *laserdisc = (const device_config *)arg;
laserdisc_config settings; laserdisc_config settings;
laserdisc_get_config(laserdisc, &settings); laserdisc_get_config(laserdisc, &settings);
@ -1918,7 +1918,7 @@ static INT32 slider_overxoffset(running_machine *machine, void *arg, astring *st
static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval) static INT32 slider_overyoffset(running_machine *machine, void *arg, astring *string, INT32 newval)
{ {
const device_config *laserdisc = arg; const device_config *laserdisc = (const device_config *)arg;
laserdisc_config settings; laserdisc_config settings;
laserdisc_get_config(laserdisc, &settings); laserdisc_get_config(laserdisc, &settings);

View File

@ -379,8 +379,8 @@ static void palette_handle_keys(running_machine *machine, ui_gfx_state *state)
/* clamp within range */ /* clamp within range */
if (state->palette.which < 0) if (state->palette.which < 0)
state->palette.which = 1; state->palette.which = 1;
if (state->palette.which > (machine->colortable != NULL)) if (state->palette.which > (int)(machine->colortable != NULL))
state->palette.which = (machine->colortable != NULL); state->palette.which = (int)(machine->colortable != NULL);
/* cache some info in locals */ /* cache some info in locals */
total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->config->total_colors; total = state->palette.which ? colortable_palette_get_size(machine->colortable) : machine->config->total_colors;

Some files were not shown because too many files have changed in this diff Show More