diff options
author | Aaron Giles <aaron@aarongiles.com> | 2008-02-18 06:08:39 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2008-02-18 06:08:39 +0000 |
commit | 109bb332f0df5c51e6b7a4d7c45207dc0a5d0785 (patch) | |
tree | 30fbadaee0dc555769bc3bee015cf711bbe2ac30 | |
parent | 3e34860ccc59b665eddc286ba2b5d4959ec70261 (diff) |
The term "driver" is way overloaded in the system.
machine->drv is now machine->config.
Sorry.
153 files changed, 475 insertions, 475 deletions
diff --git a/src/emu/cheat.c b/src/emu/cheat.c index cc2b84e0fdd..ce6af3f2236 100644 --- a/src/emu/cheat.c +++ b/src/emu/cheat.c @@ -8931,7 +8931,7 @@ static UINT8 DefaultEnableRegion(running_machine *machine, SearchRegion * region case kSearchSpeed_Fast: #if HAS_SH2 - if(machine->drv->cpu[0].type == CPU_SH2) + if(machine->config->cpu[0].type == CPU_SH2) { if( (info->targetType == kRegionType_CPU) && (info->targetIdx == 0) && (region->address == 0x06000000)) return 1; @@ -8957,12 +8957,12 @@ static UINT8 DefaultEnableRegion(running_machine *machine, SearchRegion * region #if HAS_TMS34010 /* ----- for exterminator, search bank one ----- */ - if( (machine->drv->cpu[1].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) && + if( (machine->config->cpu[1].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) && (info->targetIdx == 1) && (handler == MWA8_BANK1)) return 1; /* ----- for smashtv, search bank two ----- */ - if( (machine->drv->cpu[0].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) && + if( (machine->config->cpu[0].type == CPU_TMS34010) && (info->targetType == kRegionType_CPU) && (info->targetIdx == 0) && (handler == MWA8_BANK2)) return 1; @@ -11846,7 +11846,7 @@ static void BuildCPUInfoList(running_machine *machine) CPUInfo * info = &cpuInfoList[i]; CPUInfo * regionInfo = ®ionInfoList[REGION_CPU1 + i - REGION_INVALID]; - cpu_type type = machine->drv->cpu[i].type; + cpu_type type = machine->config->cpu[i].type; info->type = type; info->dataBits = cputype_databus_width(type, ADDRESS_SPACE_PROGRAM); diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c index c24df950c59..ff2768728aa 100644 --- a/src/emu/cpuexec.c +++ b/src/emu/cpuexec.c @@ -178,7 +178,7 @@ void cpuexec_init(running_machine *machine) /* loop over all our CPUs */ for (cpunum = 0; cpunum < MAX_CPU; cpunum++) { - cpu_type cputype = machine->drv->cpu[cpunum].type; + cpu_type cputype = machine->config->cpu[cpunum].type; int num_regs; /* if this is a dummy, stop looking */ @@ -188,7 +188,7 @@ void cpuexec_init(running_machine *machine) /* initialize the cpuinfo struct */ memset(&cpu[cpunum], 0, sizeof(cpu[cpunum])); cpu[cpunum].suspend = SUSPEND_REASON_RESET; - cpu[cpunum].clock = (UINT64)machine->drv->cpu[cpunum].clock * cputype_clock_multiplier(cputype) / cputype_clock_divider(cputype); + cpu[cpunum].clock = (UINT64)machine->config->cpu[cpunum].clock * cputype_clock_multiplier(cputype) / cputype_clock_divider(cputype); cpu[cpunum].clockscale = 1.0; cpu[cpunum].localtime = attotime_zero; @@ -216,7 +216,7 @@ void cpuexec_init(running_machine *machine) /* initialize this CPU */ state_save_push_tag(cpunum + 1); num_regs = state_save_get_reg_count(); - if (cpuintrf_init_cpu(cpunum, cputype, cpu[cpunum].clock, machine->drv->cpu[cpunum].reset_param, cpu_irq_callbacks[cpunum])) + if (cpuintrf_init_cpu(cpunum, cputype, cpu[cpunum].clock, machine->config->cpu[cpunum].reset_param, cpu_irq_callbacks[cpunum])) fatalerror("Unable to initialize CPU #%d (%s)", cpunum, cputype_name(cputype)); num_regs = state_save_get_reg_count() - num_regs; state_save_pop_tag(); @@ -259,7 +259,7 @@ static void cpuexec_reset(running_machine *machine) cpu_inittimers(machine); /* set up the watchdog timer; only start off enabled if explicitly configured */ - watchdog_enabled = (machine->drv->watchdog_vblank_count != 0 || attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0); + watchdog_enabled = (machine->config->watchdog_vblank_count != 0 || attotime_compare(machine->config->watchdog_time, attotime_zero) != 0); watchdog_reset(machine); watchdog_enabled = TRUE; @@ -267,7 +267,7 @@ static void cpuexec_reset(running_machine *machine) for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { /* enable all CPUs (except for disabled CPUs) */ - if (!(machine->drv->cpu[cpunum].flags & CPU_DISABLE)) + if (!(machine->config->cpu[cpunum].flags & CPU_DISABLE)) cpunum_resume(cpunum, SUSPEND_ANY_REASON); else cpunum_suspend(cpunum, SUSPEND_REASON_DISABLE, 1); @@ -315,7 +315,7 @@ void cpuexec_timeslice(running_machine *machine) LOG(("cpu_timeslice: target = %s\n", attotime_string(target, 9))); /* process any pending suspends */ - for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) { if (cpu[cpunum].suspend != cpu[cpunum].nextsuspend) LOG(("--> updated CPU%d suspend from %X to %X\n", cpunum, cpu[cpunum].suspend, cpu[cpunum].nextsuspend)); @@ -324,7 +324,7 @@ void cpuexec_timeslice(running_machine *machine) } /* loop over CPUs */ - for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) { /* only process if we're not suspended */ if (!cpu[cpunum].suspend) @@ -370,7 +370,7 @@ void cpuexec_timeslice(running_machine *machine) } /* update the local times of all CPUs */ - for (cpunum = 0; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) { /* if we're suspended and counting, process */ if (cpu[cpunum].suspend && cpu[cpunum].eatcycles && attotime_compare(cpu[cpunum].localtime, target) < 0) @@ -758,7 +758,7 @@ void cpu_trigger(running_machine *machine, int trigger) for (cpunum = 0; cpunum < MAX_CPU; cpunum++) { /* if this is a dummy, stop looking */ - if (machine->drv->cpu[cpunum].type == CPU_DUMMY) + if (machine->config->cpu[cpunum].type == CPU_DUMMY) break; /* see if this is a matching trigger */ @@ -826,12 +826,12 @@ void watchdog_reset(running_machine *machine) timer_adjust_oneshot(watchdog_timer, attotime_never, 0); /* VBLANK-based watchdog? */ - else if (machine->drv->watchdog_vblank_count != 0) - watchdog_counter = machine->drv->watchdog_vblank_count; + else if (machine->config->watchdog_vblank_count != 0) + watchdog_counter = machine->config->watchdog_vblank_count; /* timer-based watchdog? */ - else if (attotime_compare(machine->drv->watchdog_time, attotime_zero) != 0) - timer_adjust_oneshot(watchdog_timer, machine->drv->watchdog_time, 0); + else if (attotime_compare(machine->config->watchdog_time, attotime_zero) != 0) + timer_adjust_oneshot(watchdog_timer, machine->config->watchdog_time, 0); /* default to an obscene amount of time (3 seconds) */ else @@ -959,14 +959,14 @@ static void cpu_vblankreset(running_machine *machine) input_port_vblank_start(); /* check the watchdog */ - if (machine->drv->watchdog_vblank_count != 0 && --watchdog_counter == 0) + if (machine->config->watchdog_vblank_count != 0 && --watchdog_counter == 0) watchdog_callback(machine, NULL, 0); /* reset the cycle counters */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { if (!(cpu[cpunum].suspend & SUSPEND_REASON_DISABLE)) - cpu[cpunum].iloops = machine->drv->cpu[cpunum].vblank_interrupts_per_frame - 1; + cpu[cpunum].iloops = machine->config->cpu[cpunum].vblank_interrupts_per_frame - 1; else cpu[cpunum].iloops = -1; } @@ -1013,10 +1013,10 @@ static TIMER_CALLBACK( cpu_vblankcallback ) if (param != -1) { /* if the CPU has a VBLANK handler, call it */ - if (machine->drv->cpu[cpunum].vblank_interrupt && !cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) + if (machine->config->cpu[cpunum].vblank_interrupt && !cpunum_is_suspended(cpunum, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { cpuintrf_push_context(cpunum); - (*machine->drv->cpu[cpunum].vblank_interrupt)(machine, cpunum); + (*machine->config->cpu[cpunum].vblank_interrupt)(machine, cpunum); cpuintrf_pop_context(); } @@ -1039,7 +1039,7 @@ static TIMER_CALLBACK( cpu_vblankcallback ) if (!--vblank_countdown) { /* do we update the screen now? */ - if (!(machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)) + if (!(machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK)) video_frame_update(machine, FALSE); /* Set the timer to update the screen */ @@ -1067,7 +1067,7 @@ static TIMER_CALLBACK( cpu_vblankcallback ) static TIMER_CALLBACK( cpu_updatecallback ) { /* update the screen if we didn't before */ - if (machine->drv->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) + if (machine->config->video_attributes & VIDEO_UPDATE_AFTER_VBLANK) video_frame_update(machine, FALSE); vblank = 0; @@ -1090,10 +1090,10 @@ static TIMER_CALLBACK( cpu_updatecallback ) static TIMER_CALLBACK( cpu_timedintcallback ) { /* bail if there is no routine */ - if (machine->drv->cpu[param].timed_interrupt != NULL && !cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) + if (machine->config->cpu[param].timed_interrupt != NULL && !cpunum_is_suspended(param, SUSPEND_REASON_HALT | SUSPEND_REASON_RESET | SUSPEND_REASON_DISABLE)) { cpuintrf_push_context(param); - (*machine->drv->cpu[param].timed_interrupt)(machine, param); + (*machine->config->cpu[param].timed_interrupt)(machine, param); cpuintrf_pop_context(); } } @@ -1135,7 +1135,7 @@ static void compute_perfect_interleave(running_machine *machine) /* start with a huge time factor and find the 2nd smallest cycle time */ perfect_interleave = attotime_zero; perfect_interleave.attoseconds = ATTOSECONDS_PER_SECOND - 1; - for (cpunum = 1; machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 1; machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) { /* find the 2nd smallest cycle interval */ if (attoseconds_per_cycle[cpunum] < smallest) @@ -1168,7 +1168,7 @@ static void cpu_inittimers(running_machine *machine) watchdog_timer = timer_alloc(watchdog_callback, NULL); /* allocate a dummy timer at the minimum frequency to break things up */ - ipf = machine->drv->cpu_slices_per_frame; + ipf = machine->config->cpu_slices_per_frame; if (ipf <= 0) ipf = 1; timeslice_period = attotime_make(0, machine->screen[0].refresh / ipf); @@ -1189,7 +1189,7 @@ static void cpu_inittimers(running_machine *machine) max = 1; for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { - ipf = machine->drv->cpu[cpunum].vblank_interrupts_per_frame; + ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; if (ipf > max) max = ipf; } @@ -1200,7 +1200,7 @@ static void cpu_inittimers(running_machine *machine) { for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { - ipf = machine->drv->cpu[cpunum].vblank_interrupts_per_frame; + ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; if (ipf > 0 && (vblank_multiplier % ipf) != 0) break; } @@ -1212,7 +1212,7 @@ static void cpu_inittimers(running_machine *machine) /* initialize the countdown timers and intervals */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { - ipf = machine->drv->cpu[cpunum].vblank_interrupts_per_frame; + ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; if (ipf > 0) cpu[cpunum].vblankint_countdown = cpu[cpunum].vblankint_multiplier = vblank_multiplier / ipf; else @@ -1234,7 +1234,7 @@ static void cpu_inittimers(running_machine *machine) /* start the CPU interrupt timers */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { - ipf = machine->drv->cpu[cpunum].vblank_interrupts_per_frame; + ipf = machine->config->cpu[cpunum].vblank_interrupts_per_frame; /* compute the average number of cycles per interrupt */ if (ipf <= 0) @@ -1242,9 +1242,9 @@ static void cpu_inittimers(running_machine *machine) cpu[cpunum].vblankint_timer = timer_alloc(NULL, NULL); /* see if we need to allocate a CPU timer */ - if (machine->drv->cpu[cpunum].timed_interrupt_period != 0) + if (machine->config->cpu[cpunum].timed_interrupt_period != 0) { - cpu[cpunum].timedint_period = attotime_make(0, machine->drv->cpu[cpunum].timed_interrupt_period); + cpu[cpunum].timedint_period = attotime_make(0, machine->config->cpu[cpunum].timed_interrupt_period); cpu[cpunum].timedint_timer = timer_alloc(cpu_timedintcallback, NULL); timer_adjust_periodic(cpu[cpunum].timedint_timer, cpu[cpunum].timedint_period, cpunum, cpu[cpunum].timedint_period); } diff --git a/src/emu/cpuint.c b/src/emu/cpuint.c index 0b13bfb2d36..c06ad845513 100644 --- a/src/emu/cpuint.c +++ b/src/emu/cpuint.c @@ -121,7 +121,7 @@ void cpuint_init(running_machine *machine) { input_line_state[cpunum][line] = CLEAR_LINE; interrupt_vector[cpunum][line] = - input_line_vector[cpunum][line] = cputype_default_irq_vector(machine->drv->cpu[cpunum].type); + input_line_vector[cpunum][line] = cputype_default_irq_vector(machine->config->cpu[cpunum].type); input_event_index[cpunum][line] = 0; } } @@ -230,7 +230,7 @@ static TIMER_CALLBACK( cpunum_empty_event_queue ) { case PULSE_LINE: /* temporary: PULSE_LINE only makes sense for NMI lines on Z80 */ - assert(machine->drv->cpu[cpunum].type != CPU_Z80 || line == INPUT_LINE_NMI); + assert(machine->config->cpu[cpunum].type != CPU_Z80 || line == INPUT_LINE_NMI); activecpu_set_input_line(line, INTERNAL_ASSERT_LINE); activecpu_set_input_line(line, INTERNAL_CLEAR_LINE); break; diff --git a/src/emu/cpuintrf.c b/src/emu/cpuintrf.c index b4555203d97..6bee32bd6eb 100644 --- a/src/emu/cpuintrf.c +++ b/src/emu/cpuintrf.c @@ -1016,7 +1016,7 @@ void cpuintrf_init(running_machine *machine) /* loop over all defined CPUs */ for (totalcpu = 0; totalcpu < CPU_COUNT; totalcpu++) { - cpu_type cputype = machine->drv->cpu[totalcpu].type; + cpu_type cputype = machine->config->cpu[totalcpu].type; char familyname[256]; int j; diff --git a/src/emu/debug/debugcpu.c b/src/emu/debug/debugcpu.c index 0bda342cc93..9a8c84b3cfa 100644 --- a/src/emu/debug/debugcpu.c +++ b/src/emu/debug/debugcpu.c @@ -193,7 +193,7 @@ void debug_cpu_init(running_machine *machine) /* loop over CPUs and build up their info */ for (cpunum = 0; cpunum < MAX_CPU; cpunum++) { - cpu_type cputype = Machine->drv->cpu[cpunum].type; + cpu_type cputype = Machine->config->cpu[cpunum].type; /* if this is a dummy, stop looking */ if (cputype == CPU_DUMMY) diff --git a/src/emu/emupal.c b/src/emu/emupal.c index 60ff30092e0..76b9ad15b34 100644 --- a/src/emu/emupal.c +++ b/src/emu/emupal.c @@ -116,13 +116,13 @@ void palette_init(running_machine *machine) case BITMAP_FORMAT_RGB15: case BITMAP_FORMAT_RGB32: /* RGB modes can't use color tables */ - assert(machine->drv->color_table_len == 0); + assert(machine->config->color_table_len == 0); break; case BITMAP_FORMAT_INVALID: /* invalid format means no palette - or at least it should */ - assert(machine->drv->total_colors == 0); - assert(machine->drv->color_table_len == 0); + assert(machine->config->total_colors == 0); + assert(machine->config->color_table_len == 0); return; default: @@ -131,7 +131,7 @@ void palette_init(running_machine *machine) } /* allocate all the data structures */ - if (machine->drv->total_colors > 0) + if (machine->config->total_colors > 0) { int numcolors; @@ -164,27 +164,27 @@ void palette_config(running_machine *machine) int i; /* allocate memory for the colortables, if needed */ - if (machine->drv->color_table_len > 0) + if (machine->config->color_table_len > 0) { /* first for the raw colortable */ - colortable = auto_malloc(machine->drv->color_table_len * sizeof(colortable[0])); - for (i = 0; i < machine->drv->color_table_len; i++) + colortable = auto_malloc(machine->config->color_table_len * sizeof(colortable[0])); + for (i = 0; i < machine->config->color_table_len; i++) colortable[i] = i % total_colors; /* then for the remapped colortable */ - remapped_colortable = auto_malloc(machine->drv->color_table_len * sizeof(remapped_colortable[0])); + remapped_colortable = auto_malloc(machine->config->color_table_len * sizeof(remapped_colortable[0])); } /* now let the driver modify the initial palette and colortable */ - if (machine->drv->init_palette) - (*machine->drv->init_palette)(machine, colortable, memory_region(REGION_PROMS)); + if (machine->config->init_palette) + (*machine->config->init_palette)(machine, colortable, memory_region(REGION_PROMS)); /* now compute the remapped_colortable */ - for (i = 0; i < machine->drv->color_table_len; i++) + for (i = 0; i < machine->config->color_table_len; i++) { pen_t color = colortable[i]; - /* check for invalid colors set by machine->drv->init_palette */ + /* check for invalid colors set by machine->config->init_palette */ assert(color < total_colors); remapped_colortable[i] = machine->pens[color]; } @@ -196,7 +196,7 @@ void palette_config(running_machine *machine) /* set the color table base for each graphics element */ for (i = 0; i < MAX_GFX_ELEMENTS; i++) if (machine->gfx[i] != NULL) - machine->gfx[i]->color_base = machine->drv->gfxdecodeinfo[i].color_codes_start; + machine->gfx[i]->color_base = machine->config->gfxdecodeinfo[i].color_codes_start; } @@ -370,7 +370,7 @@ colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize) UINT32 index; assert(machine != NULL); - assert(machine->drv != NULL); + assert(machine->config != NULL); /* allocate the colortable */ ctable = auto_malloc(sizeof(*ctable)); @@ -378,7 +378,7 @@ colortable_t *colortable_alloc(running_machine *machine, UINT32 palettesize) /* fill in the basics */ ctable->machine = machine; - ctable->entries = machine->drv->total_colors; + ctable->entries = machine->config->total_colors; ctable->palentries = palettesize; /* allocate the raw colortable */ @@ -634,14 +634,14 @@ static void allocate_palette(running_machine *machine, palette_private *palette) /* determine the number of groups we need */ numgroups = 1; - if (machine->drv->video_attributes & VIDEO_HAS_SHADOWS) + if (machine->config->video_attributes & VIDEO_HAS_SHADOWS) palette->shadow_group = numgroups++; - if (machine->drv->video_attributes & VIDEO_HAS_HIGHLIGHTS) + if (machine->config->video_attributes & VIDEO_HAS_HIGHLIGHTS) palette->hilight_group = numgroups++; - assert_always(machine->drv->total_colors * numgroups <= 65536, "Error: palette has more than 65536 colors."); + assert_always(machine->config->total_colors * numgroups <= 65536, "Error: palette has more than 65536 colors."); /* allocate a palette object containing all the colors and groups */ - machine->palette = palette_alloc(machine->drv->total_colors, numgroups); + machine->palette = palette_alloc(machine->config->total_colors, numgroups); assert_always(machine->palette != NULL, "Failed to allocate system palette"); /* configure the groups */ @@ -651,7 +651,7 @@ static void allocate_palette(running_machine *machine, palette_private *palette) palette_group_set_contrast(machine->palette, palette->hilight_group, (float)PALETTE_DEFAULT_HIGHLIGHT_FACTOR); /* set the initial colors to a standard rainbow */ - for (index = 0; index < machine->drv->total_colors; index++) + for (index = 0; index < machine->config->total_colors; index++) palette_entry_set_color(machine->palette, index, MAKE_RGB(pal1bit(index >> 0), pal1bit(index >> 1), pal1bit(index >> 2))); /* switch off the color mode */ @@ -731,7 +731,7 @@ static void allocate_color_tables(running_machine *machine, palette_private *pal static void allocate_shadow_tables(running_machine *machine, palette_private *palette) { /* if we have shadows, allocate shadow tables */ - if (machine->drv->video_attributes & VIDEO_HAS_SHADOWS) + if (machine->config->video_attributes & VIDEO_HAS_SHADOWS) { pen_t *table = auto_malloc(65536 * sizeof(*table)); int i; @@ -741,7 +741,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa { palette->shadow_table[0].base = palette->shadow_table[2].base = table; for (i = 0; i < 65536; i++) - table[i] = (i < machine->drv->total_colors) ? (i + machine->drv->total_colors) : i; + table[i] = (i < machine->config->total_colors) ? (i + machine->config->total_colors) : i; } /* RGB mode gets two 32k tables in slots 0 and 2 */ @@ -754,7 +754,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa } /* if we have hilights, allocate shadow tables */ - if (machine->drv->video_attributes & VIDEO_HAS_HIGHLIGHTS) + if (machine->config->video_attributes & VIDEO_HAS_HIGHLIGHTS) { pen_t *table = auto_malloc(65536 * sizeof(*table)); int i; @@ -764,7 +764,7 @@ static void allocate_shadow_tables(running_machine *machine, palette_private *pa { palette->shadow_table[1].base = palette->shadow_table[3].base = table; for (i = 0; i < 65536; i++) - table[i] = (i < machine->drv->total_colors) ? (i + 2 * machine->drv->total_colors) : i; + table[i] = (i < machine->config->total_colors) ? (i + 2 * machine->config->total_colors) : i; } /* RGB mode gets two 32k tables in slots 1 and 3 */ diff --git a/src/emu/machine/generic.c b/src/emu/machine/generic.c index bd5d5152e44..c30decf177a 100644 --- a/src/emu/machine/generic.c +++ b/src/emu/machine/generic.c @@ -96,7 +96,7 @@ void generic_machine_init(running_machine *machine) config_register("counters", counters_load, counters_save); /* for memory cards, request save state and an exit callback */ - if (machine->drv->memcard_handler != NULL) + if (machine->config->memcard_handler != NULL) { state_save_register_global(memcard_inserted); add_exit_callback(machine, memcard_eject); @@ -286,10 +286,10 @@ mame_file *nvram_fopen(running_machine *machine, UINT32 openflags) void nvram_load(void) { - if (Machine->drv->nvram_handler != NULL) + if (Machine->config->nvram_handler != NULL) { mame_file *nvram_file = nvram_fopen(Machine, OPEN_FLAG_READ); - (*Machine->drv->nvram_handler)(Machine, nvram_file, 0); + (*Machine->config->nvram_handler)(Machine, nvram_file, 0); if (nvram_file != NULL) mame_fclose(nvram_file); } @@ -302,12 +302,12 @@ void nvram_load(void) void nvram_save(void) { - if (Machine->drv->nvram_handler != NULL) + if (Machine->config->nvram_handler != NULL) { mame_file *nvram_file = nvram_fopen(Machine, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS); if (nvram_file != NULL) { - (*Machine->drv->nvram_handler)(Machine, nvram_file, 1); + (*Machine->config->nvram_handler)(Machine, nvram_file, 1); mame_fclose(nvram_file); } } @@ -419,8 +419,8 @@ int memcard_create(int index, int overwrite) return 1; /* initialize and then save the card */ - if (Machine->drv->memcard_handler) - (*Machine->drv->memcard_handler)(Machine, file, MEMCARD_CREATE); + if (Machine->config->memcard_handler) + (*Machine->config->memcard_handler)(Machine, file, MEMCARD_CREATE); /* close the file */ mame_fclose(file); @@ -456,8 +456,8 @@ int memcard_insert(int index) return 1; /* initialize and then load the card */ - if (Machine->drv->memcard_handler) - (*Machine->drv->memcard_handler)(Machine, file, MEMCARD_INSERT); + if (Machine->config->memcard_handler) + (*Machine->config->memcard_handler)(Machine, file, MEMCARD_INSERT); /* close the file */ mame_fclose(file); @@ -496,8 +496,8 @@ void memcard_eject(running_machine *machine) } /* initialize and then load the card */ - if (machine->drv->memcard_handler) - (*machine->drv->memcard_handler)(machine, file, MEMCARD_EJECT); + if (machine->config->memcard_handler) + (*machine->config->memcard_handler)(machine, file, MEMCARD_EJECT); /* close the file */ mame_fclose(file); diff --git a/src/emu/mame.c b/src/emu/mame.c index 4d6f5ddb5e0..564f97cc874 100644 --- a/src/emu/mame.c +++ b/src/emu/mame.c @@ -1280,7 +1280,7 @@ int mame_find_cpu_index(running_machine *machine, const char *tag) int cpunum; for (cpunum = 0; cpunum < MAX_CPU; cpunum++) - if (machine->drv->cpu[cpunum].tag && strcmp(machine->drv->cpu[cpunum].tag, tag) == 0) + if (machine->config->cpu[cpunum].tag && strcmp(machine->config->cpu[cpunum].tag, tag) == 0) return cpunum; return -1; @@ -1411,12 +1411,12 @@ static running_machine *create_machine(const game_driver *driver) /* initialize the driver-related variables in the machine */ machine->gamedrv = driver; machine->basename = mame_strdup(driver->name); - machine->drv = machine_config_alloc(driver->drv); + machine->config = machine_config_alloc(driver->drv); /* allocate the driver data */ - if (machine->drv->driver_data_size != 0) + if (machine->config->driver_data_size != 0) { - machine->driver_data = malloc(machine->drv->driver_data_size); + machine->driver_data = malloc(machine->config->driver_data_size); if (machine->driver_data == NULL) goto error; } @@ -1425,8 +1425,8 @@ static running_machine *create_machine(const game_driver *driver) error: if (machine->driver_data != NULL) free(machine->driver_data); - if (machine->drv != NULL) - machine_config_free((machine_config *)machine->drv); + if (machine->config != NULL) + machine_config_free((machine_config *)machine->config); if (machine->mame_data != NULL) free(machine->mame_data); if (machine != NULL) @@ -1449,7 +1449,7 @@ static void reset_machine(running_machine *machine) /* video-related information */ memset(machine->gfx, 0, sizeof(machine->gfx)); for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) - machine->screen[scrnum] = machine->drv->screen[scrnum].defstate; + machine->screen[scrnum] = machine->config->screen[scrnum].defstate; /* palette-related information */ machine->pens = NULL; @@ -1479,8 +1479,8 @@ static void reset_machine(running_machine *machine) machine->streams_data = NULL; /* reset the driver data */ - if (machine->drv->driver_data_size != 0) - memset(machine->driver_data, 0, machine->drv->driver_data_size); + if (machine->config->driver_data_size != 0) + memset(machine->driver_data, 0, machine->config->driver_data_size); } @@ -1494,8 +1494,8 @@ static void destroy_machine(running_machine *machine) assert(machine == Machine); if (machine->driver_data != NULL) free(machine->driver_data); - if (machine->drv != NULL) - machine_config_free((machine_config *)machine->drv); + if (machine->config != NULL) + machine_config_free((machine_config *)machine->config); if (machine->mame_data != NULL) free(machine->mame_data); if (machine->basename != NULL) @@ -1581,9 +1581,9 @@ static void init_machine(running_machine *machine) sound_init(machine); /* call the driver's _START callbacks */ - if (machine->drv->machine_start != NULL) (*machine->drv->machine_start)(machine); - if (machine->drv->sound_start != NULL) (*machine->drv->sound_start)(machine); - if (machine->drv->video_start != NULL) (*machine->drv->video_start)(machine); + if (machine->config->machine_start != NULL) (*machine->config->machine_start)(machine); + if (machine->config->sound_start != NULL) (*machine->config->sound_start)(machine); + if (machine->config->video_start != NULL) (*machine->config->video_start)(machine); /* free memory regions allocated with REGIONFLAG_DISPOSE (typically gfx roms) */ for (num = 0; num < MAX_MEMORY_REGIONS; num++) @@ -1626,12 +1626,12 @@ static TIMER_CALLBACK( soft_reset ) cpuint_reset(); /* run the driver's reset callbacks */ - if (machine->drv->machine_reset != NULL) - (*machine->drv->machine_reset)(machine); - if (machine->drv->sound_reset != NULL) - (*machine->drv->sound_reset)(machine); - if (machine->drv->video_reset != NULL) - (*machine->drv->video_reset)(machine); + if (machine->config->machine_reset != NULL) + (*machine->config->machine_reset)(machine); + if (machine->config->sound_reset != NULL) + (*machine->config->sound_reset)(machine); + if (machine->config->video_reset != NULL) + (*machine->config->video_reset)(machine); /* call all registered reset callbacks */ for (cb = machine->mame_data->reset_callback_list; cb; cb = cb->next) diff --git a/src/emu/mame.h b/src/emu/mame.h index 866bbf826cd..416a457af5c 100644 --- a/src/emu/mame.h +++ b/src/emu/mame.h @@ -174,7 +174,7 @@ struct _running_machine { /* game-related information */ const game_driver * gamedrv; /* points to the definition of the game machine */ - const machine_config * drv; /* points to the constructed machine_config */ + const machine_config * config; /* points to the constructed machine_config */ const char * basename; /* basename used for game-related paths */ /* video-related information */ diff --git a/src/emu/memory.c b/src/emu/memory.c index 2ee2c67696d..0567a01777c 100644 --- a/src/emu/memory.c +++ b/src/emu/memory.c @@ -1227,7 +1227,7 @@ static void init_cpudata(void) memset(&cpudata, 0, sizeof(cpudata)); /* loop over CPUs */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) { /* set the RAM/ROM base */ cpudata[cpunum].op_ram = cpudata[cpunum].op_rom = memory_region(REGION_CPU1 + cpunum); @@ -1276,7 +1276,7 @@ INLINE void adjust_addresses(addrspace_data *space, int ismatchmask, offs_t *sta static void init_addrspace(UINT8 cpunum, UINT8 spacenum) { addrspace_data *space = &cpudata[cpunum].space[spacenum]; - cpu_type cputype = Machine->drv->cpu[cpunum].type; + cpu_type cputype = Machine->config->cpu[cpunum].type; int abits = cputype_addrbus_width(cputype, spacenum); int dbits = cputype_databus_width(cputype, spacenum); int accessorindex = (dbits == 8) ? 0 : (dbits == 16) ? 1 : (dbits == 32) ? 2 : 3; @@ -1309,7 +1309,7 @@ static void init_addrspace(UINT8 cpunum, UINT8 spacenum) space->map = map; space->adjmap = &map[MAX_ADDRESS_MAP_SIZE * 2]; - construct_address_map(map, Machine->drv, cpunum, spacenum); + construct_address_map(map, Machine->config, cpunum, spacenum); /* convert implicit ROM entries to map to the memory region */ if (spacenum == ADDRESS_SPACE_PROGRAM && memory_region(REGION_CPU1 + cpunum)) @@ -1386,7 +1386,7 @@ static void preflight_memory(void) memset(&bankdata, 0, sizeof(bankdata)); /* loop over CPUs */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { @@ -1486,7 +1486,7 @@ static void populate_memory(void) int cpunum, spacenum; /* loop over CPUs and address spaces */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { @@ -2116,7 +2116,7 @@ static void allocate_memory(void) int cpunum, spacenum; /* loop over all CPUs and memory spaces */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { @@ -2347,7 +2347,7 @@ static void find_memory(void) int cpunum, spacenum, banknum; /* loop over CPUs and address spaces */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) if (cpudata[cpunum].spacemask & (1 << spacenum)) { @@ -3475,7 +3475,7 @@ void memory_dump(FILE *file) return; /* loop over CPUs */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum++) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum++) for (spacenum = 0; spacenum < ADDRESS_SPACES; spacenum++) if (cpudata[cpunum].space[spacenum].abits) { diff --git a/src/emu/render.c b/src/emu/render.c index 613939dee5d..186bd59f2d6 100644 --- a/src/emu/render.c +++ b/src/emu/render.c @@ -491,7 +491,7 @@ void render_init(running_machine *machine) /* create a container for each screen and determine its orientation */ for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) - if (Machine->drv->screen[scrnum].tag != NULL) + if (Machine->config->screen[scrnum].tag != NULL) { screen_container[scrnum] = render_container_alloc(); render_container_set_orientation(screen_container[scrnum], Machine->gamedrv->flags & ORIENTATION_MASK); @@ -1373,12 +1373,12 @@ void render_target_get_minimum_size(render_target *target, INT32 *minwidth, INT3 float xscale, yscale; /* we may be called very early, before Machine->visible_area is initialized; handle that case */ - if ((Machine->drv->video_attributes & VIDEO_TYPE_VECTOR) != 0) + if ((Machine->config->video_attributes & VIDEO_TYPE_VECTOR) != 0) visarea = &vectorvis; else if (Machine->screen[item->index].visarea.max_x > Machine->screen[item->index].visarea.min_x) visarea = &Machine->screen[item->index].visarea; else - visarea = &Machine->drv->screen[item->index].defstate.visarea; + visarea = &Machine->config->screen[item->index].defstate.visarea; /* apply target orientation to the bounds */ bounds = item->bounds; @@ -1600,9 +1600,9 @@ static int load_layout_files(render_target *target, const char *layoutfile, int if (*nextfile != NULL) nextfile = &(*nextfile)->next; } - if (Machine->drv->default_layout != NULL) + if (Machine->config->default_layout != NULL) { - *nextfile = layout_file_load(NULL, Machine->drv->default_layout); + *nextfile = layout_file_load(NULL, Machine->config->default_layout); if (*nextfile != NULL) nextfile = &(*nextfile)->next; } @@ -1619,7 +1619,7 @@ static int load_layout_files(render_target *target, const char *layoutfile, int } /* now do the built-in layouts for single-screen games */ - if (Machine->drv->screen[0].tag != NULL && Machine->drv->screen[1].tag == NULL) + if (Machine->config->screen[0].tag != NULL && Machine->config->screen[1].tag == NULL) { if (Machine->gamedrv->flags & ORIENTATION_SWAP_XY) *nextfile = layout_file_load(NULL, layout_vertical); diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c index 8b55d2d7913..dda2b5e04ee 100644 --- a/src/emu/rendlay.c +++ b/src/emu/rendlay.c @@ -1356,8 +1356,8 @@ static int get_variable_value(const char *string, char **outputptr) sprintf(temp, "~scr%dnativexaspect~", scrnum); if (!strncmp(string, temp, strlen(temp))) { - num = Machine->drv->screen[scrnum].defstate.visarea.max_x + 1 - Machine->drv->screen[scrnum].defstate.visarea.min_x; - den = Machine->drv->screen[scrnum].defstate.visarea.max_y + 1 - Machine->drv->screen[scrnum].defstate.visarea.min_y; + num = Machine->config->screen[scrnum].defstate.visarea.max_x + 1 - Machine->config->screen[scrnum].defstate.visarea.min_x; + den = Machine->config->screen[scrnum].defstate.visarea.max_y + 1 - Machine->config->screen[scrnum].defstate.visarea.min_y; reduce_fraction(&num, &den); *outputptr += sprintf(*outputptr, "%d", num); return strlen(temp); @@ -1367,8 +1367,8 @@ static int get_variable_value(const char *string, char **outputptr) sprintf(temp, "~scr%dnativeyaspect~", scrnum); if (!strncmp(string, temp, strlen(temp))) { - num = Machine->drv->screen[scrnum].defstate.visarea.max_x + 1 - Machine->drv->screen[scrnum].defstate.visarea.min_x; - den = Machine->drv->screen[scrnum].defstate.visarea.max_y + 1 - Machine->drv->screen[scrnum].defstate.visarea.min_y; + num = Machine->config->screen[scrnum].defstate.visarea.max_x + 1 - Machine->config->screen[scrnum].defstate.visarea.min_x; + den = Machine->config->screen[scrnum].defstate.visarea.max_y + 1 - Machine->config->screen[scrnum].defstate.visarea.min_y; reduce_fraction(&num, &den); *outputptr += sprintf(*outputptr, "%d", den); return strlen(temp); @@ -1378,7 +1378,7 @@ static int get_variable_value(const char *string, char **outputptr) sprintf(temp, "~scr%dwidth~", scrnum); if (!strncmp(string, temp, strlen(temp))) { - *outputptr += sprintf(*outputptr, "%d", Machine->drv->screen[scrnum].defstate.visarea.max_x + 1 - Machine->drv->screen[0].defstate.visarea.min_x); + *outputptr += sprintf(*outputptr, "%d", Machine->config->screen[scrnum].defstate.visarea.max_x + 1 - Machine->config->screen[0].defstate.visarea.min_x); return strlen(temp); } @@ -1386,7 +1386,7 @@ static int get_variable_value(const char *string, char **outputptr) sprintf(temp, "~scr%dheight~", scrnum); if (!strncmp(string, temp, strlen(temp))) { - *outputptr += sprintf(*outputptr, "%d", Machine->drv->screen[scrnum].defstate.visarea.max_y + 1 - Machine->drv->screen[0].defstate.visarea.min_y); + *outputptr += sprintf(*outputptr, "%d", Machine->config->screen[scrnum].defstate.visarea.max_y + 1 - Machine->config->screen[0].defstate.visarea.min_y); return strlen(temp); } } diff --git a/src/emu/romload.c b/src/emu/romload.c index 7f392364ad5..2c2dbb26912 100644 --- a/src/emu/romload.c +++ b/src/emu/romload.c @@ -451,7 +451,7 @@ static void region_post_process(rom_load_data *romdata, const rom_entry *regiond /* if this is a CPU region, override with the CPU width and endianness */ if (type >= REGION_CPU1 && type < REGION_CPU1 + MAX_CPU) { - cpu_type cputype = Machine->drv->cpu[type - REGION_CPU1].type; + cpu_type cputype = Machine->config->cpu[type - REGION_CPU1].type; if (cputype != CPU_DUMMY) { datawidth = cputype_databus_width(cputype, ADDRESS_SPACE_PROGRAM) / 8; diff --git a/src/emu/sound.c b/src/emu/sound.c index f0eda9be534..2feba021055 100644 --- a/src/emu/sound.c +++ b/src/emu/sound.c @@ -182,7 +182,7 @@ void sound_init(running_machine *machine) Machine->sample_rate = 11025; /* count the speakers */ - for (totalspeakers = 0; Machine->drv->speaker[totalspeakers].tag; totalspeakers++) ; + for (totalspeakers = 0; Machine->config->speaker[totalspeakers].tag; totalspeakers++) ; VPRINTF(("total speakers = %d\n", totalspeakers)); /* allocate memory for mix buffers */ @@ -256,7 +256,7 @@ static void sound_exit(running_machine *machine) /* stop all the sound chips */ for (sndnum = 0; sndnum < MAX_SOUND; sndnum++) - if (Machine->drv->sound[sndnum].type != SOUND_DUMMY) + if (Machine->config->sound[sndnum].type != SOUND_DUMMY) sndintrf_exit_sound(sndnum); /* reset variables */ @@ -287,7 +287,7 @@ static void start_sound_chips(void) /* start up all the sound chips */ for (sndnum = 0; sndnum < MAX_SOUND; sndnum++) { - const sound_config *msound = &Machine->drv->sound[sndnum]; + const sound_config *msound = &Machine->config->sound[sndnum]; sound_info *info; int num_regs; int index; @@ -375,7 +375,7 @@ static void start_speakers(void) /* start up all the speakers */ for (totalspeakers = 0; totalspeakers < MAX_SPEAKER; totalspeakers++) { - const speaker_config *mspeaker = &Machine->drv->speaker[totalspeakers]; + const speaker_config *mspeaker = &Machine->config->speaker[totalspeakers]; speaker_info *info; /* stop when we hit an empty entry */ @@ -546,7 +546,7 @@ static void sound_reset(running_machine *machine) /* reset all the sound chips */ for (sndnum = 0; sndnum < MAX_SOUND; sndnum++) - if (Machine->drv->sound[sndnum].type != SOUND_DUMMY) + if (Machine->config->sound[sndnum].type != SOUND_DUMMY) sndnum_reset(sndnum); } diff --git a/src/emu/ui.c b/src/emu/ui.c index 8f54a529aa8..8c3092d0a7e 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -1051,15 +1051,15 @@ int sprintf_game_info(char *buffer) bufptr += sprintf(bufptr, "%s\n%s %s\n\nCPU:\n", Machine->gamedrv->description, Machine->gamedrv->year, Machine->gamedrv->manufacturer); /* loop over all CPUs */ - for (cpunum = 0; cpunum < MAX_CPU && Machine->drv->cpu[cpunum].type != CPU_DUMMY; cpunum += count) + for (cpunum = 0; cpunum < MAX_CPU && Machine->config->cpu[cpunum].type != CPU_DUMMY; cpunum += count) { - cpu_type type = Machine->drv->cpu[cpunum].type; - int clock = Machine->drv->cpu[cpunum].clock; + cpu_type type = Machine->config->cpu[cpunum].type; + int clock = Machine->config->cpu[cpunum].clock; /* count how many identical CPUs we have */ for (count = 1; cpunum + count < MAX_CPU; count++) - if (Machine->drv->cpu[cpunum + count].type != type || - Machine->drv->cpu[cpunum + count].clock != clock) + if (Machine->config->cpu[cpunum + count].type != type || + Machine->config->cpu[cpunum + count].clock != clock) break; /* if more than one, prepend a #x in front of the CPU name */ @@ -1078,14 +1078,14 @@ int sprintf_game_info(char *buffer) bufptr += sprintf(bufptr, "\nSound:\n"); /* loop over all sound chips */ - for (sndnum = 0; sndnum < MAX_SOUND && Machine->drv->sound[sndnum].type != SOUND_DUMMY; sndnum += count) + for (sndnum = 0; sndnum < MAX_SOUND && Machine->config->sound[sndnum].type != SOUND_DUMMY; sndnum += count) { - sound_type type = Machine->drv->sound[sndnum].type; + sound_type type = Machine->config->sound[sndnum].type; int clock = sndnum_clock(sndnum); /* count how many identical sound chips we have */ for (count = 1; sndnum + count < MAX_SOUND; count++) - if (Machine->drv->sound[sndnum + count].type != type || + if (Machine->config->sound[sndnum + count].type != type || sndnum_clock(sndnum + count) != clock) break; @@ -1104,11 +1104,11 @@ int sprintf_game_info(char *buffer) } /* display vector information for vector games */ - if (Machine->drv->video_attributes & VIDEO_TYPE_VECTOR) + if (Machine->config->video_attributes & VIDEO_TYPE_VECTOR) bufptr += sprintf(bufptr, "\nVector Game\n"); /* display screen resolution and refresh rate info for raster games */ - else if (Machine->drv->video_attributes & VIDEO_TYPE_RASTER) + else if (Machine->config->video_attributes & VIDEO_TYPE_RASTER) bufptr += sprintf(bufptr,"\nScreen Resolution:\n%d " UTF8_MULTIPLY " %d (%s) %f" UTF8_NBSP "Hz\n", Machine->screen[0].visarea.max_x - Machine->screen[0].visarea.min_x + 1, Machine->screen[0].visarea.max_y - Machine->screen[0].visarea.min_y + 1, @@ -1540,12 +1540,12 @@ static void slider_init(void) } for (item = 0; item < MAX_SCREENS; item++) - if (Machine->drv->screen[item].tag != NULL) + if (Machine->config->screen[item].tag != NULL) { - int defxscale = floor(Machine->drv->screen[item].xscale * 1000.0f + 0.5f); - int defyscale = floor(Machine->drv->screen[item].yscale * 1000.0f + 0.5f); - int defxoffset = floor(Machine->drv->screen[item].xoffset * 1000.0f + 0.5f); - int defyoffset = floor(Machine->drv->screen[item].yoffset * 1000.0f + 0.5f); + int defxscale = floor(Machine->config->screen[item].xscale * 1000.0f + 0.5f); + int defyscale = floor(Machine->config->screen[item].yscale * 1000.0f + 0.5f); + int defxoffset = floor(Machine->config->screen[item].xoffset * 1000.0f + 0.5f); + int defyoffset = floor(Machine->config->screen[item].yoffset * 1000.0f + 0.5f); /* add standard brightness/contrast/gamma controls per-screen */ slider_config(&slider_list[slider_count++], 100, 1000, 2000, 10, slider_brightness, item); @@ -1559,7 +1559,7 @@ static void slider_init(void) slider_config(&slider_list[slider_count++], -500, defyoffset, 500, 2, slider_yoffset, item); } - if (Machine->drv->video_attributes & VIDEO_TYPE_VECTOR) + if (Machine->config->video_attributes & VIDEO_TYPE_VECTOR) { /* add flicker control */ slider_config(&slider_list[slider_count++], 0, 0, 1000, 10, slider_flicker, 0); @@ -1714,7 +1714,7 @@ static INT32 slider_overclock(running_machine *machine, INT32 newval, char *buff static INT32 slider_refresh(running_machine *machine, INT32 newval, char *buffer, int arg) { - double defrefresh = ATTOSECONDS_TO_HZ(Machine->drv->screen[arg].defstate.refresh); + double defrefresh = ATTOSECONDS_TO_HZ(Machine->config->screen[arg].defstate.refresh); double refresh; if (buffer != NULL) @@ -1890,7 +1890,7 @@ static char *slider_get_screen_desc(int arg) int screen_count = 0; for (item = 0; item < MAX_SCREENS; item++) - if (Machine->drv->screen[item].tag != NULL) + if (Machine->config->screen[item].tag != NULL) screen_count++; if (screen_count > 1) diff --git a/src/emu/uigfx.c b/src/emu/uigfx.c index 2c4fee7d27e..85722dae8e0 100644 --- a/src/emu/uigfx.c +++ b/src/emu/uigfx.c @@ -155,7 +155,7 @@ UINT32 ui_gfx_ui_handler(running_machine *machine, UINT32 uistate) ui_gfx_state *state = &ui_gfx; /* if we have nothing, implicitly cancel */ - if (Machine->drv->total_colors == 0 && Machine->drv->color_table_len == 0 && Machine->gfx[0] == NULL && tilemap_count() == 0) + if (Machine->config->total_colors == 0 && Machine->config->color_table_len == 0 && Machine->gfx[0] == NULL && tilemap_count() == 0) goto cancel; /* if we're not paused, mark the bitmap dirty */ @@ -168,7 +168,7 @@ again: { case 0: /* if we have a palette, display it */ - if (Machine->drv->total_colors > 0) + if (Machine->config->total_colors > 0) { palette_handler(state); break; @@ -235,7 +235,7 @@ cancel: static void palette_handler(ui_gfx_state *state) { - int total = state->palette.which ? Machine->drv->color_table_len : Machine->drv->total_colors; + int total = state->palette.which ? Machine->config->color_table_len : Machine->config->total_colors; const UINT16 *pens = state->palette.which ? Machine->game_colortable : NULL; const char *title = state->palette.which ? "COLORTABLE" : "PALETTE"; const rgb_t *raw_color = palette_entry_list_raw(Machine->palette); @@ -380,11 +380,11 @@ static void palette_handle_keys(ui_gfx_state *state) /* clamp within range */ if (state->palette.which < 0) state->palette.which = 1; - if (state->palette.which > (Machine->drv->color_table_len != 0)) - state->palette.which = (Machine->drv->color_table_len != 0); + if (state->palette.which > (Machine->config->color_table_len != 0)) + state->palette.which = (Machine->config->color_table_len != 0); /* cache some info in locals */ - total = state->palette.which ? Machine->drv->color_table_len : Machine->drv->total_colors; + total = state->palette.which ? Machine->config->color_table_len : Machine->config->total_colors; /* determine number of entries per row and total */ rowcount = state->palette.count; @@ -771,7 +771,7 @@ static void gfxset_draw_item(const gfx_element *gfx, int index, mame_bitmap *bit }; int width = (rotate & ORIENTATION_SWAP_XY) ? gfx->height : gfx->width; int height = (rotate & ORIENTATION_SWAP_XY) ? gfx->width : gfx->height; - const pen_t *palette = (Machine->drv->total_colors != 0) ? palette_entry_list_raw(Machine->palette) : NULL; + const pen_t *palette = (Machine->config->total_colors != 0) ? palette_entry_list_raw(Machine->palette) : NULL; UINT32 rowpixels = bitmap->rowpixels; const UINT16 *colortable = NULL; UINT32 palette_mask = ~0; diff --git a/src/emu/uimenu.c b/src/emu/uimenu.c index f8318bd0dd7..368c46362af 100644 --- a/src/emu/uimenu.c +++ b/src/emu/uimenu.c @@ -835,7 +835,7 @@ do { \ ADD_MENU("Cheat", menu_cheat, 1); /* add memory card menu */ - if (Machine->drv->memcard_handler != NULL) + if (Machine->config->memcard_handler != NULL) ADD_MENU("Memory Card", menu_memory_card, 0); /* add reset and exit menus */ diff --git a/src/emu/video.c b/src/emu/video.c index cd9479b544a..0399f84811a 100644 --- a/src/emu/video.c +++ b/src/emu/video.c @@ -51,7 +51,7 @@ typedef struct _internal_screen_info internal_screen_info; struct _internal_screen_info { /* pointers to screen configuration and state */ - const screen_config * config; /* pointer to the configuration in the Machine->drv */ + const screen_config * config; /* pointer to the configuration in the Machine->config */ screen_state * state; /* pointer to visible state in Machine structure */ /* textures and bitmaps */ @@ -300,7 +300,7 @@ void video_init(running_machine *machine) /* configure all of the screens */ for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) - if (machine->drv->screen[scrnum].tag != NULL) + if (machine->config->screen[scrnum].tag != NULL) { render_container *container = render_container_get_screen(scrnum); internal_screen_info *info = &viddata->scrinfo[scrnum]; @@ -309,7 +309,7 @@ void video_init(running_machine *machine) info->scanline0_timer = timer_alloc(scanline0_callback, NULL); /* make pointers back to the config and state */ - info->config = &machine->drv->screen[scrnum]; + info->config = &machine->config->screen[scrnum]; info->state = &machine->screen[scrnum]; /* configure the screen with the default parameters */ @@ -329,7 +329,7 @@ void video_init(running_machine *machine) info->vblank_time = attotime_sub_attoseconds(attotime_zero, machine->screen[0].vblank); /* allocate a timer to generate per-scanline updates */ - if (machine->drv->video_attributes & VIDEO_UPDATE_SCANLINE) + if (machine->config->video_attributes & VIDEO_UPDATE_SCANLINE) { info->scanline_timer = timer_alloc(scanline_update_callback, NULL); timer_adjust_oneshot(info->scanline_timer, video_screen_get_time_until_pos(scrnum, 0, 0), scrnum); @@ -341,20 +341,20 @@ void video_init(running_machine *machine) } /* create spriteram buffers if necessary */ - if (machine->drv->video_attributes & VIDEO_BUFFERS_SPRITERAM) + if (machine->config->video_attributes & VIDEO_BUFFERS_SPRITERAM) init_buffered_spriteram(); /* convert the gfx ROMs into character sets. This is done BEFORE calling the driver's */ /* palette_init() routine because it might need to check the machine->gfx[] data */ - if (machine->drv->gfxdecodeinfo != NULL) - allocate_graphics(machine, machine->drv->gfxdecodeinfo); + if (machine->config->gfxdecodeinfo != NULL) + allocate_graphics(machine, machine->config->gfxdecodeinfo); /* configure the palette */ palette_config(machine); /* actually decode the graphics */ - if (machine->drv->gfxdecodeinfo != NULL) - decode_graphics(machine, machine->drv->gfxdecodeinfo); + if (machine->config->gfxdecodeinfo != NULL) + decode_graphics(machine, machine->config->gfxdecodeinfo); /* reset video statics and get out of here */ pdrawgfx_shadow_lowpri = 0; @@ -613,7 +613,7 @@ static void allocate_graphics(running_machine *machine, const gfx_decode_entry * /* if we have a remapped colortable, point our local colortable to it */ machine->gfx[i]->total_colors = gfxdecodeinfo[i].total_color_codes; - machine->gfx[i]->color_base = machine->drv->gfxdecodeinfo[i].color_codes_start; + machine->gfx[i]->color_base = machine->config->gfxdecodeinfo[i].color_codes_start; } } @@ -680,7 +680,7 @@ void video_screen_configure(int scrnum, int width, int height, const rectangle * internal_screen_info *info = &viddata->scrinfo[scrnum]; /* reallocate bitmap if necessary */ - if (!(Machine->drv->video_attributes & VIDEO_TYPE_VECTOR)) + if (!(Machine->config->video_attributes & VIDEO_TYPE_VECTOR)) { int curwidth = 0, curheight = 0; @@ -805,7 +805,7 @@ void video_screen_set_visarea(int scrnum, int min_x, int max_x, int min_y, int m int video_screen_exists(int scrnum) { - return (scrnum >= 0 && scrnum < MAX_SCREENS && Machine->drv->screen[scrnum].tag != NULL); + return (scrnum >= 0 && scrnum < MAX_SCREENS && Machine->config->screen[scrnum].tag != NULL); } @@ -836,7 +836,7 @@ void video_screen_update_partial(int scrnum, int scanline) LOG_PARTIAL_UPDATES(("Partial: video_screen_update_partial(%d,%d): ", scrnum, scanline)); /* these two checks only apply if we're allowed to skip frames */ - if (!(Machine->drv->video_attributes & VIDEO_ALWAYS_UPDATE)) + if (!(Machine->config->video_attributes & VIDEO_ALWAYS_UPDATE)) { /* if skipping this frame, bail */ if (global.skipping_this_frame) @@ -874,8 +874,8 @@ void video_screen_update_partial(int scrnum, int scanline) profiler_mark(PROFILER_VIDEO); LOG_PARTIAL_UPDATES(("updating %d-%d\n", clip.min_y, clip.max_y)); - if (Machine->drv->video_update != NULL) - flags = (*Machine->drv->video_update)(Machine, scrnum, info->bitmap[info->curbitmap], &clip); + if (Machine->config->video_update != NULL) + flags = (*Machine->config->video_update)(Machine, scrnum, info->bitmap[info->curbitmap], &clip); global.partial_updates_this_frame++; profiler_mark(PROFILER_END); @@ -1121,10 +1121,10 @@ void video_frame_update(running_machine *machine, int debug) scanline0_callback(Machine, NULL, 0); /* otherwise, call the video EOF callback */ - else if (Machine->drv->video_eof != NULL) + else if (Machine->config->video_eof != NULL) { profiler_mark(PROFILER_VIDEO); - (*Machine->drv->video_eof)(Machine); + (*Machine->config->video_eof)(Machine); profiler_mark(PROFILER_END); } } @@ -1145,7 +1145,7 @@ static int finish_screen_updates(running_machine *machine) /* finish updating the screens */ for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) - if (machine->drv->screen[scrnum].tag != NULL) + if (machine->config->screen[scrnum].tag != NULL) video_screen_update_partial(scrnum, machine->screen[scrnum].visarea.max_y); /* now add the quads for all the screens */ @@ -1158,7 +1158,7 @@ static int finish_screen_updates(running_machine *machine) if (livemask & (1 << scrnum)) { /* only update if empty and not a vector game; otherwise assume the driver did it directly */ - if ((machine->drv->video_attributes & (VIDEO_TYPE_VECTOR | VIDEO_SELF_RENDER)) == 0) + if ((machine->config->video_attributes & (VIDEO_TYPE_VECTOR | VIDEO_SELF_RENDER)) == 0) { /* if we're not skipping the frame and if the screen actually changed, then update the texture */ if (!global.skipping_this_frame && screen->changed) @@ -1167,7 +1167,7 @@ static int finish_screen_updates(running_machine *machine) rectangle fixedvis = machine->screen[scrnum].visarea; fixedvis.max_x++; fixedvis.max_y++; - render_texture_set_bitmap(screen->texture[screen->curbitmap], bitmap, &fixedvis, machine->drv->screen[scrnum].palette_base, screen->format); + render_texture_set_bitmap(screen->texture[screen->curbitmap], bitmap, &fixedvis, machine->config->screen[scrnum].palette_base, screen->format); screen->curtexture = screen->curbitmap; screen->curbitmap = 1 - screen->curbitmap; } @@ -1726,7 +1726,7 @@ void video_screen_save_snapshot(running_machine *machine, mame_file *fp, int scr png_add_text(&pnginfo, "System", text); /* now do the actual work */ - error = png_write_bitmap(mame_core_file(fp), &pnginfo, machine->video_data->snap_bitmap, machine->drv->total_colors, palette); + error = png_write_bitmap(mame_core_file(fp), &pnginfo, machine->video_data->snap_bitmap, machine->config->total_colors, palette); /* free any data allocated */ png_free(&pnginfo); @@ -1948,7 +1948,7 @@ static void movie_record_frame(running_machine *machine, int scrnum) /* write the next frame */ palette = (machine->palette != NULL) ? palette_entry_list_adjusted(machine->palette) : NULL; - error = mng_capture_frame(mame_core_file(info->movie_file), &pnginfo, bitmap, machine->drv->total_colors, palette); + error = mng_capture_frame(mame_core_file(info->movie_file), &pnginfo, bitmap, machine->config->total_colors, palette); png_free(&pnginfo); if (error != PNGERR_NONE) { diff --git a/src/emu/video/generic.c b/src/emu/video/generic.c index 24e4f599cdc..a3fc52a26a6 100644 --- a/src/emu/video/generic.c +++ b/src/emu/video/generic.c @@ -555,7 +555,7 @@ PALETTE_INIT( RRRR_GGGG_BBBB ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -567,17 +567,17 @@ PALETTE_INIT( RRRR_GGGG_BBBB ) r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* green component */ - bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[i + machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[i + machine->config->total_colors] >> 3) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* blue component */ - bit0 = (color_prom[i + 2*machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[i + 2*machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[i + 2*machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[i + 2*machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[i + 2*machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[i + 2*machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[i + 2*machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[i + 2*machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/audio/atarijsa.c b/src/mame/audio/atarijsa.c index cabd155052c..292eda85ae8 100644 --- a/src/mame/audio/atarijsa.c +++ b/src/mame/audio/atarijsa.c @@ -123,7 +123,7 @@ void atarijsa_init(running_machine *machine, int testport, int testmask) has_tms5220 = has_oki6295 = has_pokey = has_ym2151 = 0; for (i = 0; i < MAX_SOUND; i++) { - switch (Machine->drv->sound[i].type) + switch (Machine->config->sound[i].type) { case SOUND_TMS5220: has_tms5220 = 1; diff --git a/src/mame/audio/exidy.c b/src/mame/audio/exidy.c index 8d421bb4101..f041a05e409 100644 --- a/src/mame/audio/exidy.c +++ b/src/mame/audio/exidy.c @@ -769,7 +769,7 @@ static void *venture_common_sh_start(int clock, const struct CustomSound_interfa has_mc3417 = FALSE; for (i = 0; i < MAX_SOUND; i++) { - if (Machine->drv->sound[i].type == SOUND_MC3417) + if (Machine->config->sound[i].type == SOUND_MC3417) has_mc3417 = TRUE; } diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c index 47eda3b7c1b..f1636a30641 100644 --- a/src/mame/audio/leland.c +++ b/src/mame/audio/leland.c @@ -509,7 +509,7 @@ void *leland_80186_sh_start(int clock, const struct CustomSound_interface *confi /* determine which sound hardware is installed */ has_ym2151 = 0; for (i = 0; i < MAX_SOUND; i++) - if (Machine->drv->sound[i].type == SOUND_YM2151) + if (Machine->config->sound[i].type == SOUND_YM2151) has_ym2151 = 1; /* allocate separate streams for the DMA and non-DMA DACs */ diff --git a/src/mame/audio/namcoc7x.c b/src/mame/audio/namcoc7x.c index d231ad816a9..5fd6035c454 100644 --- a/src/mame/audio/namcoc7x.c +++ b/src/mame/audio/namcoc7x.c @@ -66,7 +66,7 @@ void namcoc7x_on_driver_init(void) // install speedup cheat for (cpunum = 0; cpunum < MAX_CPU; cpunum++) - if (Machine->drv->cpu[cpunum].type == CPU_M37702) + if (Machine->config->cpu[cpunum].type == CPU_M37702) { memory_install_read16_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_r); memory_install_write16_handler(cpunum, ADDRESS_SPACE_PROGRAM, 0x82, 0x83, 0, 0, speedup_w); diff --git a/src/mame/drivers/cardline.c b/src/mame/drivers/cardline.c index b84292f4063..666f4cd2ef7 100644 --- a/src/mame/drivers/cardline.c +++ b/src/mame/drivers/cardline.c @@ -169,7 +169,7 @@ static PALETTE_INIT(cardline) { int i,r,g,b,data; int bit0,bit1,bit2; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { data=color_prom[i]; diff --git a/src/mame/drivers/cherrym.c b/src/mame/drivers/cherrym.c index a215257b72f..0dfd5b9d8f0 100644 --- a/src/mame/drivers/cherrym.c +++ b/src/mame/drivers/cherrym.c @@ -18,7 +18,7 @@ static PALETTE_INIT( cm ) { int i; - for ( i = 0; i < machine->drv->total_colors; i++ ) + for ( i = 0; i < machine->config->total_colors; i++ ) { int bit0,bit1,bit2,bit3,r,g,b; @@ -30,17 +30,17 @@ static PALETTE_INIT( cm ) r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; // green component - bit0 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 3) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 0) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; // blue component - bit0 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01; - bit1 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01; - bit2 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01; - bit3 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01; + bit0 = (color_prom[2*machine->config->total_colors] >> 3) & 0x01; + bit1 = (color_prom[2*machine->config->total_colors] >> 2) & 0x01; + bit2 = (color_prom[2*machine->config->total_colors] >> 1) & 0x01; + bit3 = (color_prom[2*machine->config->total_colors] >> 0) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/drivers/cntsteer.c b/src/mame/drivers/cntsteer.c index 389bc290723..7336671c799 100644 --- a/src/mame/drivers/cntsteer.c +++ b/src/mame/drivers/cntsteer.c @@ -41,7 +41,7 @@ static int bg_bank = 0; static PALETTE_INIT( zerotrgt ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/drivers/cojag.c b/src/mame/drivers/cojag.c index 465da0c2e6a..5579adc3d68 100644 --- a/src/mame/drivers/cojag.c +++ b/src/mame/drivers/cojag.c @@ -1387,7 +1387,7 @@ ROM_END static void cojag_common_init(running_machine *machine, UINT16 gpu_jump_offs, UINT16 spin_pc) { /* copy over the ROM */ - cojag_is_r3000 = (machine->drv->cpu[0].type == CPU_R3041BE); + cojag_is_r3000 = (machine->config->cpu[0].type == CPU_R3041BE); /* install synchronization hooks for GPU */ if (cojag_is_r3000) diff --git a/src/mame/drivers/cps3.c b/src/mame/drivers/cps3.c index fac480c240d..e5812f5aa6d 100644 --- a/src/mame/drivers/cps3.c +++ b/src/mame/drivers/cps3.c @@ -910,13 +910,13 @@ static VIDEO_START(cps3) /* create the char set (gfx will then be updated dynamically from RAM) */ machine->gfx[0] = allocgfx(&cps3_tiles8x8_layout); - machine->gfx[0]->total_colors = machine->drv->total_colors / 16; + machine->gfx[0]->total_colors = machine->config->total_colors / 16; //decode_ssram(); /* create the char set (gfx will then be updated dynamically from RAM) */ machine->gfx[1] = allocgfx(&cps3_tiles16x16_layout); - machine->gfx[1]->total_colors = machine->drv->total_colors / 64; + machine->gfx[1]->total_colors = machine->config->total_colors / 64; machine->gfx[1]->color_granularity=64; //decode_charram(); diff --git a/src/mame/drivers/dec8.c b/src/mame/drivers/dec8.c index 37274f0e5a4..265778f26e0 100644 --- a/src/mame/drivers/dec8.c +++ b/src/mame/drivers/dec8.c @@ -3387,7 +3387,7 @@ static DRIVER_INIT( deco222 ) sound_cpu = 1; /* Oscar has three CPUs */ - if (machine->drv->cpu[2].type != CPU_DUMMY) sound_cpu = 2; + if (machine->config->cpu[2].type != CPU_DUMMY) sound_cpu = 2; /* bits 5 and 6 of the opcodes are swapped */ rom = memory_region(REGION_CPU1+sound_cpu); diff --git a/src/mame/drivers/deniam.c b/src/mame/drivers/deniam.c index 35a3aa24828..23ba134f4b7 100644 --- a/src/mame/drivers/deniam.c +++ b/src/mame/drivers/deniam.c @@ -308,7 +308,7 @@ GFXDECODE_END static void irqhandler(int linestate) { /* system 16c doesn't have the sound CPU */ - if (Machine->drv->cpu[1].type != CPU_DUMMY) + if (Machine->config->cpu[1].type != CPU_DUMMY) cpunum_set_input_line(Machine, 1,0,linestate); } diff --git a/src/mame/drivers/drw80pkr.c b/src/mame/drivers/drw80pkr.c index 185ca7cb329..9c0806438dc 100644 --- a/src/mame/drivers/drw80pkr.c +++ b/src/mame/drivers/drw80pkr.c @@ -127,7 +127,7 @@ static PALETTE_INIT( drw80pkr ) */ int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/drivers/esh.c b/src/mame/drivers/esh.c index 007bc32ab71..4b8569e3e55 100644 --- a/src/mame/drivers/esh.c +++ b/src/mame/drivers/esh.c @@ -215,7 +215,7 @@ static PALETTE_INIT( esh ) int i; /* Oddly enough, the top 4 bits of each byte is 0 */ - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int r,g,b; int bit0,bit1,bit2; diff --git a/src/mame/drivers/firebeat.c b/src/mame/drivers/firebeat.c index c5445ced9f1..1bda7690d2c 100644 --- a/src/mame/drivers/firebeat.c +++ b/src/mame/drivers/firebeat.c @@ -604,7 +604,7 @@ static void GCU_w(int chip, UINT32 offset, UINT32 data, UINT32 mem_mask) visarea.max_y = height-1; // only try and update the screen if the driver says we have one - if(Machine->drv->screen[screen].tag) + if(Machine->config->screen[screen].tag) video_screen_configure(screen, visarea.max_x + 1, visarea.max_y + 1, &visarea, Machine->screen[screen].refresh); } break; diff --git a/src/mame/drivers/genesis.c b/src/mame/drivers/genesis.c index 89afa4f8c04..df97decb2cb 100644 --- a/src/mame/drivers/genesis.c +++ b/src/mame/drivers/genesis.c @@ -158,7 +158,7 @@ MACHINE_START( genesis ) MACHINE_RESET( genesis ) { /* C2 doesn't have a Z80, so we can't just assume */ - if (machine->drv->cpu[1].type == CPU_Z80) + if (machine->config->cpu[1].type == CPU_Z80) { /* the following ensures that the Z80 begins without running away from 0 */ /* 0x76 is just a forced 'halt' as soon as the CPU is initially run */ diff --git a/src/mame/drivers/harddriv.c b/src/mame/drivers/harddriv.c index 59c446bf8c9..4133373b626 100644 --- a/src/mame/drivers/harddriv.c +++ b/src/mame/drivers/harddriv.c @@ -3425,10 +3425,10 @@ static void init_ds3(running_machine *machine) memory_install_write16_handler(hdcpu_main, ADDRESS_SPACE_PROGRAM, 0x823800, 0x823fff, 0, 0, hd68k_ds3_control_w); /* if we have a sound DSP, boot it */ - if (hdcpu_sound != -1 && machine->drv->cpu[hdcpu_sound].type == CPU_ADSP2105) + if (hdcpu_sound != -1 && machine->config->cpu[hdcpu_sound].type == CPU_ADSP2105) adsp2105_load_boot_data((UINT8 *)(memory_region(REGION_CPU1 + hdcpu_sound) + 0x10000), (UINT32 *)(memory_region(REGION_CPU1 + hdcpu_sound))); - if (hdcpu_sounddsp != -1 && machine->drv->cpu[hdcpu_sounddsp].type == CPU_ADSP2105) + if (hdcpu_sounddsp != -1 && machine->config->cpu[hdcpu_sounddsp].type == CPU_ADSP2105) adsp2105_load_boot_data((UINT8 *)(memory_region(REGION_CPU1 + hdcpu_sounddsp) + 0x10000), (UINT32 *)(memory_region(REGION_CPU1 + hdcpu_sounddsp))); diff --git a/src/mame/drivers/hornet.c b/src/mame/drivers/hornet.c index 9828aa1f697..c7e2d2681e7 100644 --- a/src/mame/drivers/hornet.c +++ b/src/mame/drivers/hornet.c @@ -343,10 +343,10 @@ static int K037122_vh_start(running_machine *machine, int chip) machine->gfx[K037122_gfx_index[chip]] = allocgfx(&K037122_char_layout); decodegfx(machine->gfx[K037122_gfx_index[chip]], (UINT8*)K037122_char_ram[chip], 0, machine->gfx[K037122_gfx_index[chip]]->total_elements); - if (machine->drv->color_table_len) - machine->gfx[K037122_gfx_index[chip]]->total_colors = machine->drv->color_table_len / 16; + if (machine->config->color_table_len) + machine->gfx[K037122_gfx_index[chip]]->total_colors = machine->config->color_table_len / 16; else - machine->gfx[K037122_gfx_index[chip]]->total_colors = machine->drv->total_colors / 16; + machine->gfx[K037122_gfx_index[chip]]->total_colors = machine->config->total_colors / 16; return 0; } diff --git a/src/mame/drivers/istellar.c b/src/mame/drivers/istellar.c index d63ca7f4ede..14a0c1b0aa7 100644 --- a/src/mame/drivers/istellar.c +++ b/src/mame/drivers/istellar.c @@ -260,7 +260,7 @@ static PALETTE_INIT( istellar ) int i; /* Oddly enough, the top 4 bits of each byte is 0 */ - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int r,g,b; int bit0,bit1,bit2,bit3; diff --git a/src/mame/drivers/itech8.c b/src/mame/drivers/itech8.c index f72c24cdb93..d172a514d0c 100644 --- a/src/mame/drivers/itech8.c +++ b/src/mame/drivers/itech8.c @@ -546,7 +546,7 @@ void itech8_update_interrupts(running_machine *machine, int periodic, int tms340 if (blitter != -1) blitter_int = blitter; /* handle the 6809 case */ - if (machine->drv->cpu[0].type == CPU_M6809) + if (machine->config->cpu[0].type == CPU_M6809) { /* just modify lines that have changed */ if (periodic != -1) cpunum_set_input_line(machine, 0, INPUT_LINE_NMI, periodic ? ASSERT_LINE : CLEAR_LINE); @@ -628,7 +628,7 @@ static MACHINE_START( sstrike ) static MACHINE_RESET( itech8 ) { /* make sure bank 0 is selected */ - if (machine->drv->cpu[0].type == CPU_M6809) + if (machine->config->cpu[0].type == CPU_M6809) memory_set_bankptr(1, &memory_region(REGION_CPU1)[0x4000]); /* reset the PIA (if used) */ diff --git a/src/mame/drivers/lucky8.c b/src/mame/drivers/lucky8.c index 974b286db5d..1daf1c387f2 100644 --- a/src/mame/drivers/lucky8.c +++ b/src/mame/drivers/lucky8.c @@ -33,7 +33,7 @@ static PALETTE_INIT( lucky8 ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/drivers/marinedt.c b/src/mame/drivers/marinedt.c index 306cc30d066..1aa56ed674e 100644 --- a/src/mame/drivers/marinedt.c +++ b/src/mame/drivers/marinedt.c @@ -410,7 +410,7 @@ static PALETTE_INIT( marinedt ) { int i,r,b,g; - for (i = 0;i < machine->drv->total_colors; i++) + for (i = 0;i < machine->config->total_colors; i++) { int bit0,bit1,bit2; diff --git a/src/mame/drivers/meijinsn.c b/src/mame/drivers/meijinsn.c index 6dbbdb1efec..336611b287d 100644 --- a/src/mame/drivers/meijinsn.c +++ b/src/mame/drivers/meijinsn.c @@ -230,7 +230,7 @@ static PALETTE_INIT( meijinsn ) 3, resistances_rg, weights_g, 0, 1000+1000, 2, resistances_b, weights_b, 0, 1000+1000); - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/drivers/mpu4drvr.c b/src/mame/drivers/mpu4drvr.c index 14e572fa66f..89f2ffa5972 100644 --- a/src/mame/drivers/mpu4drvr.c +++ b/src/mame/drivers/mpu4drvr.c @@ -987,10 +987,10 @@ static VIDEO_START( mpu4_vid ) machine->gfx[mpu4_gfx_index+3] = allocgfx(&mpu4_vid_char_16x16_layout); /* set the color information */ - machine->gfx[mpu4_gfx_index+0]->total_colors = machine->drv->total_colors / 16; - machine->gfx[mpu4_gfx_index+1]->total_colors = machine->drv->total_colors / 16; - machine->gfx[mpu4_gfx_index+2]->total_colors = machine->drv->total_colors / 16; - machine->gfx[mpu4_gfx_index+3]->total_colors = machine->drv->total_colors / 16; + machine->gfx[mpu4_gfx_index+0]->total_colors = machine->config->total_colors / 16; + machine->gfx[mpu4_gfx_index+1]->total_colors = machine->config->total_colors / 16; + machine->gfx[mpu4_gfx_index+2]->total_colors = machine->config->total_colors / 16; + machine->gfx[mpu4_gfx_index+3]->total_colors = machine->config->total_colors / 16; scn2675_IR_pointer = 0; } diff --git a/src/mame/drivers/namcoic.c b/src/mame/drivers/namcoic.c index 2e8dd397adf..851dd0705a6 100644 --- a/src/mame/drivers/namcoic.c +++ b/src/mame/drivers/namcoic.c @@ -276,7 +276,7 @@ static void zdrawgfxzoom(running_machine *machine, { if( gfx ) { - int shadow_offset = (machine->drv->video_attributes&VIDEO_HAS_SHADOWS)?machine->drv->total_colors:0; + int shadow_offset = (machine->config->video_attributes&VIDEO_HAS_SHADOWS)?machine->config->total_colors:0; const pen_t *pal = &machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)]; UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo; int sprite_screen_height = (scaley*gfx->height+0x8000)>>16; diff --git a/src/mame/drivers/nbmj8991.c b/src/mame/drivers/nbmj8991.c index fb207513de1..66840271f61 100644 --- a/src/mame/drivers/nbmj8991.c +++ b/src/mame/drivers/nbmj8991.c @@ -78,7 +78,7 @@ static READ8_HANDLER( nbmj8991_sound_r ) static MACHINE_RESET( nbmj8991 ) { - if (machine->drv->cpu[1].type == CPU_Z80) + if (machine->config->cpu[1].type == CPU_Z80) { memory_configure_bank(1, 0, 4, memory_region(REGION_CPU2) + 0x8000, 0x8000); memory_set_bank(1, 0); diff --git a/src/mame/drivers/nwk-tr.c b/src/mame/drivers/nwk-tr.c index 169f8ac614b..3b3e2e6e3fd 100644 --- a/src/mame/drivers/nwk-tr.c +++ b/src/mame/drivers/nwk-tr.c @@ -279,15 +279,15 @@ int K001604_vh_start(running_machine *machine, int chip) machine->gfx[K001604_gfx_index[chip][1]] = allocgfx(&K001604_char_layout_layer_16x16); decodegfx(machine->gfx[K001604_gfx_index[chip][1]], (UINT8*)&K001604_char_ram[chip][0], 0, machine->gfx[K001604_gfx_index[chip][1]]->total_elements); - if (machine->drv->color_table_len) + if (machine->config->color_table_len) { - machine->gfx[K001604_gfx_index[chip][0]]->total_colors = machine->drv->color_table_len / 16; - machine->gfx[K001604_gfx_index[chip][1]]->total_colors = machine->drv->color_table_len / 16; + machine->gfx[K001604_gfx_index[chip][0]]->total_colors = machine->config->color_table_len / 16; + machine->gfx[K001604_gfx_index[chip][1]]->total_colors = machine->config->color_table_len / 16; } else { - machine->gfx[K001604_gfx_index[chip][0]]->total_colors = machine->drv->total_colors / 16; - machine->gfx[K001604_gfx_index[chip][1]]->total_colors = machine->drv->total_colors / 16; + machine->gfx[K001604_gfx_index[chip][0]]->total_colors = machine->config->total_colors / 16; + machine->gfx[K001604_gfx_index[chip][1]]->total_colors = machine->config->total_colors / 16; } return 0; diff --git a/src/mame/drivers/olibochu.c b/src/mame/drivers/olibochu.c index f1caf4c38e6..ffd9b2d0839 100644 --- a/src/mame/drivers/olibochu.c +++ b/src/mame/drivers/olibochu.c @@ -20,7 +20,7 @@ static PALETTE_INIT( olibochu ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT8 pen; int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/drivers/peplus.c b/src/mame/drivers/peplus.c index 73ce2e0422f..494e3c97dec 100644 --- a/src/mame/drivers/peplus.c +++ b/src/mame/drivers/peplus.c @@ -645,7 +645,7 @@ static PALETTE_INIT( peplus ) */ int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/drivers/pmpoker.c b/src/mame/drivers/pmpoker.c index 1d4b76c1278..df7705838f6 100644 --- a/src/mame/drivers/pmpoker.c +++ b/src/mame/drivers/pmpoker.c @@ -456,7 +456,7 @@ static PALETTE_INIT( pottnpkr ) /* 00000BGR */ if (color_prom == 0) return; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/drivers/rcasino.c b/src/mame/drivers/rcasino.c index 12746e0226b..8fee77cffa9 100644 --- a/src/mame/drivers/rcasino.c +++ b/src/mame/drivers/rcasino.c @@ -44,7 +44,7 @@ static PALETTE_INIT( rcasino ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/drivers/safarir.c b/src/mame/drivers/safarir.c index bc13e5e6c81..bb557db90b8 100644 --- a/src/mame/drivers/safarir.c +++ b/src/mame/drivers/safarir.c @@ -115,7 +115,7 @@ static PALETTE_INIT( safarir ) { int i; - for (i = 0; i < machine->drv->total_colors / 2; i++) + for (i = 0; i < machine->config->total_colors / 2; i++) { palette_set_color(machine, (i * 2) + 0, RGB_BLACK); palette_set_color(machine, (i * 2) + 1, MAKE_RGB(pal1bit(i >> 2), pal1bit(i >> 1), pal1bit(i >> 0))); diff --git a/src/mame/drivers/sbowling.c b/src/mame/drivers/sbowling.c index bfcb0cf56fd..929723169c2 100644 --- a/src/mame/drivers/sbowling.c +++ b/src/mame/drivers/sbowling.c @@ -301,7 +301,7 @@ static PALETTE_INIT( sbowling ) 3, resistances_rg, outputs_g, 0, 100, 2, resistances_b, outputs_b, 0, 100); - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/drivers/segas18.c b/src/mame/drivers/segas18.c index 96cde5fbc0a..0ada3f33227 100644 --- a/src/mame/drivers/segas18.c +++ b/src/mame/drivers/segas18.c @@ -204,7 +204,7 @@ static MACHINE_RESET( system18 ) fd1094_machine_init(); /* if we are running with a real live 8751, we need to boost the interleave at startup */ - if (machine->drv->cpu[2].type == CPU_I8751) + if (machine->config->cpu[2].type == CPU_I8751) timer_call_after_resynch(NULL, 0, boost_interleave); } diff --git a/src/mame/drivers/shanghai.c b/src/mame/drivers/shanghai.c index 64e25775820..e2dc3cd5071 100644 --- a/src/mame/drivers/shanghai.c +++ b/src/mame/drivers/shanghai.c @@ -663,7 +663,7 @@ static PALETTE_INIT( shanghai ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/drivers/shougi.c b/src/mame/drivers/shougi.c index 57c1104fbe6..c1f0b25940a 100644 --- a/src/mame/drivers/shougi.c +++ b/src/mame/drivers/shougi.c @@ -124,7 +124,7 @@ static PALETTE_INIT( shougi ) 3, resistances_rg, weights_g, 0, 1000+1000, 2, resistances_b, weights_b, 0, 1000+1000); - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index 63b2b9379c2..f87c98755fd 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -127,7 +127,7 @@ static VIDEO_START(srmp6) { /* create the char set (gfx will then be updated dynamically from RAM) */ machine->gfx[0] = allocgfx(&tiles8x8_layout); - machine->gfx[0]->total_colors = machine->drv->total_colors / 256; + machine->gfx[0]->total_colors = machine->config->total_colors / 256; machine->gfx[0]->color_granularity=256; tileram = auto_malloc(0x100000*16); diff --git a/src/mame/drivers/superdq.c b/src/mame/drivers/superdq.c index 528df7c864d..9bed96ba091 100644 --- a/src/mame/drivers/superdq.c +++ b/src/mame/drivers/superdq.c @@ -120,7 +120,7 @@ static PALETTE_INIT( superdq ) 2, &resistances[1], bweights, 220, 0); /* initialize the palette with these colors */ - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2; int r, g, b; diff --git a/src/mame/drivers/taito_b.c b/src/mame/drivers/taito_b.c index 61398b7cb02..01efd4aae56 100644 --- a/src/mame/drivers/taito_b.c +++ b/src/mame/drivers/taito_b.c @@ -2609,7 +2609,7 @@ static void mb87078_gain_changed(int channel, int percent) { if (channel==1) { - sound_type type = Machine->drv->sound[0].type; + sound_type type = Machine->config->sound[0].type; sndti_set_output_gain(type, 0, 0, percent / 100.0); sndti_set_output_gain(type, 1, 0, percent / 100.0); sndti_set_output_gain(type, 2, 0, percent / 100.0); diff --git a/src/mame/drivers/tugboat.c b/src/mame/drivers/tugboat.c index d23fbf37538..e0266e17362 100644 --- a/src/mame/drivers/tugboat.c +++ b/src/mame/drivers/tugboat.c @@ -40,7 +40,7 @@ static PALETTE_INIT( tugboat ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int r,g,b,brt; diff --git a/src/mame/drivers/wallc.c b/src/mame/drivers/wallc.c index 155be2fd3d9..fc4cf037bac 100644 --- a/src/mame/drivers/wallc.c +++ b/src/mame/drivers/wallc.c @@ -90,7 +90,7 @@ static PALETTE_INIT( wallc ) 2, resistances_rg, weights_g, 330, 0, 3, resistances_b, weights_b, 330, 655+220); - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit7,r,g,b; diff --git a/src/mame/machine/atarigen.c b/src/mame/machine/atarigen.c index 03ffc07f2d4..61a03b5a513 100644 --- a/src/mame/machine/atarigen.c +++ b/src/mame/machine/atarigen.c @@ -795,7 +795,7 @@ void atarigen_set_vol(running_machine *machine, int volume, sound_type type) int ch; for (ch = 0; ch < MAX_SOUND; ch++) - if (machine->drv->sound[ch].type == type) + if (machine->config->sound[ch].type == type) { int output; for (output = 0; output < 2; output++) diff --git a/src/mame/machine/bublbobl.c b/src/mame/machine/bublbobl.c index 31fa62fcb9a..cc490905393 100644 --- a/src/mame/machine/bublbobl.c +++ b/src/mame/machine/bublbobl.c @@ -30,7 +30,7 @@ WRITE8_HANDLER( bublbobl_bankswitch_w ) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 0x10) ? CLEAR_LINE : ASSERT_LINE); /* bit 5 resets mcu */ - if (Machine->drv->cpu[3].type != CPU_DUMMY) // only if we have a MCU + if (Machine->config->cpu[3].type != CPU_DUMMY) // only if we have a MCU cpunum_set_input_line(Machine, 3, INPUT_LINE_RESET, (data & 0x20) ? CLEAR_LINE : ASSERT_LINE); /* bit 6 enables display */ diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c index 30560c88f14..a846168d45a 100644 --- a/src/mame/machine/leland.c +++ b/src/mame/machine/leland.c @@ -403,7 +403,7 @@ MACHINE_RESET( leland ) memory_set_bankptr(3, &slave_base[0x10000]); /* if we have an I80186 CPU, reset it */ - if (machine->drv->cpu[2].type == CPU_I80186) + if (machine->config->cpu[2].type == CPU_I80186) leland_80186_sound_init(); } diff --git a/src/mame/machine/mexico86.c b/src/mame/machine/mexico86.c index 6132251f2f5..f23812130d8 100644 --- a/src/mame/machine/mexico86.c +++ b/src/mame/machine/mexico86.c @@ -22,7 +22,7 @@ bit 0 = ? (unused?) WRITE8_HANDLER( mexico86_f008_w ) { cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, (data & 4) ? CLEAR_LINE : ASSERT_LINE); - if (Machine->drv->cpu[2].type != CPU_DUMMY) + if (Machine->config->cpu[2].type != CPU_DUMMY) { // mexico 86, knight boy cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, (data & 2) ? CLEAR_LINE : ASSERT_LINE); diff --git a/src/mame/machine/slapstic.c b/src/mame/machine/slapstic.c index 39009cc9ad0..4020f4727e6 100644 --- a/src/mame/machine/slapstic.c +++ b/src/mame/machine/slapstic.c @@ -816,8 +816,8 @@ void slapstic_init(int chip) slapstic_reset(); /* see if we're 68k or 6502/6809 based */ - access_68k = (Machine->drv->cpu[0].type != CPU_M6809 && - Machine->drv->cpu[0].type != CPU_M6502); + access_68k = (Machine->config->cpu[0].type != CPU_M6809 && + Machine->config->cpu[0].type != CPU_M6502); /* save state */ state_save_register_item("slapstic", 0, state); diff --git a/src/mame/machine/taitosj.c b/src/mame/machine/taitosj.c index 420fd199567..dec879331e9 100644 --- a/src/mame/machine/taitosj.c +++ b/src/mame/machine/taitosj.c @@ -57,7 +57,7 @@ MACHINE_RESET( taitosj ) zaccept = 1; zready = 0; busreq = 0; - if (machine->drv->cpu[2].type != CPU_DUMMY) + if (machine->config->cpu[2].type != CPU_DUMMY) cpunum_set_input_line(machine, 2,0,CLEAR_LINE); spacecr_prot_value = 0; diff --git a/src/mame/machine/tnzs.c b/src/mame/machine/tnzs.c index 7636fe6067f..e6a8de85da3 100644 --- a/src/mame/machine/tnzs.c +++ b/src/mame/machine/tnzs.c @@ -743,7 +743,7 @@ WRITE8_HANDLER( tnzs_bankswitch1_w ) /* bit 2 resets the mcu */ if (data & 0x04) { - if (Machine->drv->cpu[2].type == CPU_I8X41) + if (Machine->config->cpu[2].type == CPU_I8X41) cpunum_set_input_line(Machine, 2, INPUT_LINE_RESET, PULSE_LINE); } /* Coin count and lockout is handled by the i8742 */ diff --git a/src/mame/machine/toaplan1.c b/src/mame/machine/toaplan1.c index 10852b39ea1..ad351c6e143 100644 --- a/src/mame/machine/toaplan1.c +++ b/src/mame/machine/toaplan1.c @@ -226,9 +226,9 @@ WRITE16_HANDLER( toaplan1_reset_sound ) if (ACCESSING_LSB && (data == 0)) { logerror("PC:%04x Resetting Sound CPU and Sound chip (%08x)\n",activecpu_get_previouspc(),data); - if (Machine->drv->sound[0].type == SOUND_YM3812) + if (Machine->config->sound[0].type == SOUND_YM3812) sndti_reset(SOUND_YM3812, 0); - if (Machine->drv->cpu[1].type == CPU_Z80) + if (Machine->config->cpu[1].type == CPU_Z80) cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); } } diff --git a/src/mame/video/40love.c b/src/mame/video/40love.c index d01db129c0a..2325426cceb 100644 --- a/src/mame/video/40love.c +++ b/src/mame/video/40love.c @@ -31,7 +31,7 @@ PALETTE_INIT( fortyl ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -43,17 +43,17 @@ PALETTE_INIT( fortyl ) r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* green component */ - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* blue component */ - bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[2*machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[2*machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[2*machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[2*machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/ambush.c b/src/mame/video/ambush.c index 60f6273b2a0..d7918df7775 100644 --- a/src/mame/video/ambush.c +++ b/src/mame/video/ambush.c @@ -24,7 +24,7 @@ PALETTE_INIT( ambush ) { int i; - for (i = 0;i < machine->drv->total_colors; i++) + for (i = 0;i < machine->config->total_colors; i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/ampoker2.c b/src/mame/video/ampoker2.c index 8e110a17533..c8571abff3f 100644 --- a/src/mame/video/ampoker2.c +++ b/src/mame/video/ampoker2.c @@ -41,7 +41,7 @@ PALETTE_INIT( ampoker2 ) 76543210 RRRGGGBB */ - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/video/appoooh.c b/src/mame/video/appoooh.c index 0151cb616a7..7ab560c9191 100644 --- a/src/mame/video/appoooh.c +++ b/src/mame/video/appoooh.c @@ -34,7 +34,7 @@ PALETTE_INIT( appoooh ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT8 pen; int bit0, bit1, bit2, r, g, b; @@ -72,7 +72,7 @@ PALETTE_INIT( robowres ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/video/atarigt.c b/src/mame/video/atarigt.c index e0e1088f776..5bf1c4ba0f4 100644 --- a/src/mame/video/atarigt.c +++ b/src/mame/video/atarigt.c @@ -157,7 +157,7 @@ VIDEO_START( atarigt ) /* map pens 1:1 */ substitute_pens = auto_malloc(65536 * sizeof(*substitute_pens)); - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) substitute_pens[i] = i; machine->pens = substitute_pens; diff --git a/src/mame/video/bagman.c b/src/mame/video/bagman.c index 66476de37b6..1dfa53a4cbe 100644 --- a/src/mame/video/bagman.c +++ b/src/mame/video/bagman.c @@ -60,7 +60,7 @@ PALETTE_INIT( bagman ) 2, resistances_b, weights_b, 470, 0); - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/video/bking.c b/src/mame/video/bking.c index 7a97c0c4271..2975d219820 100644 --- a/src/mame/video/bking.c +++ b/src/mame/video/bking.c @@ -67,7 +67,7 @@ PALETTE_INIT( bking ) 3, &resistances_rg[0], gweights, 0, 0, 2, &resistances_b[0], bweights, 0, 0); - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT16 pen; int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/video/blueprnt.c b/src/mame/video/blueprnt.c index 9b709a852c3..068246b842e 100644 --- a/src/mame/video/blueprnt.c +++ b/src/mame/video/blueprnt.c @@ -20,7 +20,7 @@ PALETTE_INIT( blueprnt ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT8 pen; int r, g, b; diff --git a/src/mame/video/brkthru.c b/src/mame/video/brkthru.c index 8ef829befbb..662cf820ced 100644 --- a/src/mame/video/brkthru.c +++ b/src/mame/video/brkthru.c @@ -46,7 +46,7 @@ PALETTE_INIT( brkthru ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -61,10 +61,10 @@ PALETTE_INIT( brkthru ) bit2 = (color_prom[0] >> 6) & 0x01; bit3 = (color_prom[0] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/btime.c b/src/mame/video/btime.c index fdcb40f766c..94dad1cd00d 100644 --- a/src/mame/video/btime.c +++ b/src/mame/video/btime.c @@ -54,7 +54,7 @@ PALETTE_INIT( btime ) /* This function is also used by Eggs. */ if (color_prom == 0) return; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; @@ -99,7 +99,7 @@ PALETTE_INIT( lnc ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/carjmbre.c b/src/mame/video/carjmbre.c index 69ad17368c6..63c856a7dd7 100644 --- a/src/mame/video/carjmbre.c +++ b/src/mame/video/carjmbre.c @@ -15,7 +15,7 @@ PALETTE_INIT( carjmbre ) { int i,bit0,bit1,bit2,r,g,b; - for (i = 0;i < machine->drv->total_colors; i++) + for (i = 0;i < machine->config->total_colors; i++) { /* red component */ bit0 = (*color_prom >> 0) & 0x01; diff --git a/src/mame/video/carpolo.c b/src/mame/video/carpolo.c index 941f19e9bd4..f67f75e1323 100644 --- a/src/mame/video/carpolo.c +++ b/src/mame/video/carpolo.c @@ -99,7 +99,7 @@ PALETTE_INIT( carpolo ) }; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT8 pen, r, g, b; int bit0, bit1, bit2; diff --git a/src/mame/video/cave.c b/src/mame/video/cave.c index 48dffe6ed28..fc8d4c93183 100644 --- a/src/mame/video/cave.c +++ b/src/mame/video/cave.c @@ -478,8 +478,8 @@ static void cave_vh_start(running_machine *machine, int num) cave_row_effect_offs_n = -1; cave_row_effect_offs_f = 1; - background_color = machine->drv->gfxdecodeinfo[0].color_codes_start + - (machine->drv->gfxdecodeinfo[0].total_color_codes-1) * + background_color = machine->config->gfxdecodeinfo[0].color_codes_start + + (machine->config->gfxdecodeinfo[0].total_color_codes-1) * machine->gfx[0]->color_granularity; switch(cave_kludge) diff --git a/src/mame/video/cclimber.c b/src/mame/video/cclimber.c index 39fac951e22..205f7717d94 100644 --- a/src/mame/video/cclimber.c +++ b/src/mame/video/cclimber.c @@ -50,7 +50,7 @@ PALETTE_INIT( cclimber ) 3, &resistances_rg[0], gweights, 0, 0, 2, &resistances_b[0], bweights, 0, 0); - for (i = 0;i < machine->drv->total_colors; i++) + for (i = 0;i < machine->config->total_colors; i++) { UINT8 data; int bit0, bit1, bit2; diff --git a/src/mame/video/centiped.c b/src/mame/video/centiped.c index dcaa3f8c6eb..b03ffe4c8c0 100644 --- a/src/mame/video/centiped.c +++ b/src/mame/video/centiped.c @@ -277,7 +277,7 @@ PALETTE_INIT( warlords ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT8 pen; int r, g, b; diff --git a/src/mame/video/compgolf.c b/src/mame/video/compgolf.c index 2b33197c8c7..0997a215ea7 100644 --- a/src/mame/video/compgolf.c +++ b/src/mame/video/compgolf.c @@ -16,7 +16,7 @@ PALETTE_INIT( compgolf ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; bit0 = (color_prom[i] >> 0) & 0x01; diff --git a/src/mame/video/cosmic.c b/src/mame/video/cosmic.c index c5719b30a51..e475b3b9964 100644 --- a/src/mame/video/cosmic.c +++ b/src/mame/video/cosmic.c @@ -167,7 +167,7 @@ PALETTE_INIT( cosmicg ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int r = (i > 8) ? 0xff : 0xaa * ((i >> 0) & 1); int g = 0xaa * ((i >> 1) & 1); diff --git a/src/mame/video/crbaloon.c b/src/mame/video/crbaloon.c index 2f20f803ecd..9ab4ef574c3 100644 --- a/src/mame/video/crbaloon.c +++ b/src/mame/video/crbaloon.c @@ -36,7 +36,7 @@ PALETTE_INIT( crbaloon ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { UINT8 pen; int h, r, g, b; diff --git a/src/mame/video/dday.c b/src/mame/video/dday.c index 9475a7b57e0..8138524b042 100644 --- a/src/mame/video/dday.c +++ b/src/mame/video/dday.c @@ -332,7 +332,7 @@ VIDEO_UPDATE( dday ) UINT16 src_pixel = *BITMAP_ADDR16(main_bitmap, y, x); if (*BITMAP_ADDR16(sl_bitmap, y, x) == 0xff) - src_pixel += machine->drv->total_colors; + src_pixel += machine->config->total_colors; *BITMAP_ADDR16(bitmap, y, x) = src_pixel; } diff --git a/src/mame/video/dec8.c b/src/mame/video/dec8.c index 82c2efc6cd8..65332935ebf 100644 --- a/src/mame/video/dec8.c +++ b/src/mame/video/dec8.c @@ -81,7 +81,7 @@ PALETTE_INIT( ghostb ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -95,10 +95,10 @@ PALETTE_INIT( ghostb ) bit2 = (color_prom[i] >> 6) & 0x01; bit3 = (color_prom[i] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[i + machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[i + machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c index 6ad76a9ab85..78919d8df27 100644 --- a/src/mame/video/deco16ic.c +++ b/src/mame/video/deco16ic.c @@ -206,7 +206,7 @@ WRITE16_HANDLER( deco16_buffered_palette_w ) WRITE16_HANDLER( deco16_palette_dma_w ) { - const int m=Machine->drv->total_colors; + const int m=Machine->config->total_colors; int r,g,b,i; for (i=0; i<m; i++) { diff --git a/src/mame/video/deco32.c b/src/mame/video/deco32.c index 18f3d667765..20782a6498e 100644 --- a/src/mame/video/deco32.c +++ b/src/mame/video/deco32.c @@ -168,7 +168,7 @@ WRITE32_HANDLER( deco32_buffered_palette_w ) WRITE32_HANDLER( deco32_palette_dma_w ) { - const int m=Machine->drv->total_colors; + const int m=Machine->config->total_colors; int r,g,b,i; for (i=0; i<m; i++) { diff --git a/src/mame/video/dynax.c b/src/mame/video/dynax.c index 249814ab921..2bd5c96769a 100644 --- a/src/mame/video/dynax.c +++ b/src/mame/video/dynax.c @@ -30,7 +30,7 @@ PALETTE_INIT( sprtmtch ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int x = (color_prom[i]<<8) + color_prom[0x200+i]; /* The bits are in reverse order! */ diff --git a/src/mame/video/espial.c b/src/mame/video/espial.c index 9658221aeb3..d53469045e1 100644 --- a/src/mame/video/espial.c +++ b/src/mame/video/espial.c @@ -46,7 +46,7 @@ PALETTE_INIT( espial ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; @@ -58,13 +58,13 @@ PALETTE_INIT( espial ) r = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; /* green component */ bit0 = (color_prom[i] >> 3) & 0x01; - bit1 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 0) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 1) & 0x01; g = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; /* blue component */ bit0 = 0; - bit1 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 2) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 3) & 0x01; b = 0x21 * bit0 + 0x47 * bit1 + 0x97 * bit2; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/firetrap.c b/src/mame/video/firetrap.c index 3ed3d015c86..18abf857da9 100644 --- a/src/mame/video/firetrap.c +++ b/src/mame/video/firetrap.c @@ -47,7 +47,7 @@ PALETTE_INIT( firetrap ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -62,10 +62,10 @@ PALETTE_INIT( firetrap ) bit2 = (color_prom[i] >> 6) & 0x01; bit3 = (color_prom[i] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[i + machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[i + machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/funworld.c b/src/mame/video/funworld.c index 4fdfc98f87c..b4d5d0b919d 100644 --- a/src/mame/video/funworld.c +++ b/src/mame/video/funworld.c @@ -60,7 +60,7 @@ PALETTE_INIT(funworld) /* RRRBBBGG */ if (color_prom == 0) return; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/fuukifg2.c b/src/mame/video/fuukifg2.c index d7086829fb2..c9ce289b4d2 100644 --- a/src/mame/video/fuukifg2.c +++ b/src/mame/video/fuukifg2.c @@ -89,7 +89,7 @@ PALETTE_INIT( fuuki16 ) /* The game does not initialise the palette at startup. It should be totally black */ - for (pen = 0; pen < machine->drv->total_colors; pen++) + for (pen = 0; pen < machine->config->total_colors; pen++) palette_set_color(machine,pen,MAKE_RGB(0,0,0)); } #endif diff --git a/src/mame/video/gdrawpkr.c b/src/mame/video/gdrawpkr.c index 3dce35b917b..9bf1487be4f 100644 --- a/src/mame/video/gdrawpkr.c +++ b/src/mame/video/gdrawpkr.c @@ -86,7 +86,7 @@ PALETTE_INIT( gdrawpkr ) /* 00000BGR */ if (color_prom == 0) return; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/video/gomoku.c b/src/mame/video/gomoku.c index ee83cdab9f9..3e833fd92c7 100644 --- a/src/mame/video/gomoku.c +++ b/src/mame/video/gomoku.c @@ -32,7 +32,7 @@ PALETTE_INIT( gomoku ) int i; int bit0, bit1, bit2, r, g, b; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { /* red component */ bit0 = (*color_prom >> 0) & 0x01; diff --git a/src/mame/video/gridlee.c b/src/mame/video/gridlee.c index 8a708a83775..d4b7465e47c 100644 --- a/src/mame/video/gridlee.c +++ b/src/mame/video/gridlee.c @@ -45,7 +45,7 @@ PALETTE_INIT( gridlee ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { palette_set_color_rgb(machine,i,pal4bit(color_prom[0x0000]),pal4bit(color_prom[0x0800]),pal4bit(color_prom[0x1000])); color_prom++; diff --git a/src/mame/video/gunsmoke.c b/src/mame/video/gunsmoke.c index de811cd99ff..e357fbd4013 100644 --- a/src/mame/video/gunsmoke.c +++ b/src/mame/video/gunsmoke.c @@ -1,7 +1,7 @@ #include "driver.h" #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) -#define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) +#define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) UINT8 *gunsmoke_scrollx; UINT8 *gunsmoke_scrolly; diff --git a/src/mame/video/harddriv.c b/src/mame/video/harddriv.c index c2780c61928..4b23ea63d49 100644 --- a/src/mame/video/harddriv.c +++ b/src/mame/video/harddriv.c @@ -292,7 +292,7 @@ WRITE16_HANDLER( hdgsp_control_hi_w ) break; case 0x04: - if (Machine->drv->total_colors >= 256 * 8) + if (Machine->config->total_colors >= 256 * 8) update_palette_bank((gfx_palettebank & ~4) | (val << 2)); break; diff --git a/src/mame/video/jack.c b/src/mame/video/jack.c index bf6914c24de..e752d1811a5 100644 --- a/src/mame/video/jack.c +++ b/src/mame/video/jack.c @@ -106,7 +106,7 @@ PALETTE_INIT( joinem ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; bit0 = (color_prom[i] >> 0) & 0x01; diff --git a/src/mame/video/karnov.c b/src/mame/video/karnov.c index e36e03ae7ae..370b9743074 100644 --- a/src/mame/video/karnov.c +++ b/src/mame/video/karnov.c @@ -43,7 +43,7 @@ PALETTE_INIT( karnov ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -57,10 +57,10 @@ PALETTE_INIT( karnov ) bit2 = (color_prom[0] >> 6) & 0x01; bit3 = (color_prom[0] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/kchamp.c b/src/mame/video/kchamp.c index df0f15ced83..9db7be340a3 100644 --- a/src/mame/video/kchamp.c +++ b/src/mame/video/kchamp.c @@ -14,11 +14,11 @@ PALETTE_INIT( kchamp ) { int i, red, green, blue; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { red = color_prom[i]; - green = color_prom[machine->drv->total_colors+i]; - blue = color_prom[2*machine->drv->total_colors+i]; + green = color_prom[machine->config->total_colors+i]; + blue = color_prom[2*machine->config->total_colors+i]; palette_set_color_rgb(machine,i,pal4bit(red),pal4bit(green),pal4bit(blue)); } diff --git a/src/mame/video/konamiic.c b/src/mame/video/konamiic.c index 93a2721f423..8f1afd3a0b8 100644 --- a/src/mame/video/konamiic.c +++ b/src/mame/video/konamiic.c @@ -1216,10 +1216,10 @@ static void decode_gfx(running_machine *machine, int gfx_index, UINT8 *data, UIN decodegfx(machine->gfx[gfx_index], data, 0, machine->gfx[gfx_index]->total_elements); /* set the color information */ - if (machine->drv->color_table_len) - machine->gfx[gfx_index]->total_colors = machine->drv->color_table_len / (1 << bpp); + if (machine->config->color_table_len) + machine->gfx[gfx_index]->total_colors = machine->config->color_table_len / (1 << bpp); else - machine->gfx[gfx_index]->total_colors = machine->drv->total_colors / (1 << bpp); + machine->gfx[gfx_index]->total_colors = machine->config->total_colors / (1 << bpp); } @@ -2548,7 +2548,7 @@ void K051960_vh_start(running_machine *machine,int gfx_memory_region,int plane_o fatalerror("Unknown plane_order"); } - if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (VERBOSE && !(machine->config->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); /* prepare shadow draw table */ @@ -3041,7 +3041,7 @@ void K053245_vh_start(running_machine *machine,int chip, int gfx_memory_region,i fatalerror("Unsupported plane_order"); } - if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (VERBOSE && !(machine->config->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); @@ -3787,12 +3787,12 @@ void K053247_vh_start(running_machine *machine, int gfx_memory_region, int dx, i { if (machine->screen[0].format == BITMAP_FORMAT_RGB32) { - if ((machine->drv->video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS) + if ((machine->config->video_attributes & (VIDEO_HAS_SHADOWS|VIDEO_HAS_HIGHLIGHTS)) != VIDEO_HAS_SHADOWS+VIDEO_HAS_HIGHLIGHTS) popmessage("driver missing SHADOWS or HIGHLIGHTS flag"); } else { - if (!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (!(machine->config->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); } } @@ -3929,7 +3929,7 @@ void K055673_vh_start(running_machine *machine, int gfx_memory_region, int layou fatalerror("Unsupported layout"); } - if (VERBOSE && !(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if (VERBOSE && !(machine->config->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); /* prepare shadow draw table */ @@ -4231,9 +4231,9 @@ void K053247_sprites_draw(running_machine *machine, mame_bitmap *bitmap,const re VIDEO_HAS_SHADOWS | VIDEO_HAS_HIGHLIGHTS */ - if (machine->drv->video_attributes & VIDEO_HAS_SHADOWS) + if (machine->config->video_attributes & VIDEO_HAS_SHADOWS) { - if (bitmap->bpp == 32 && (machine->drv->video_attributes & VIDEO_HAS_HIGHLIGHTS)) + if (bitmap->bpp == 32 && (machine->config->video_attributes & VIDEO_HAS_HIGHLIGHTS)) shdmask = 3; // enable all shadows and highlights else shdmask = 0; // enable default shadows @@ -8285,7 +8285,7 @@ void K053250_draw(running_machine *machine, mame_bitmap *bitmap, const rectangle linedata_offs += line_start * linedata_adv; // pre-advance line info offset for the clipped region // load physical palette base - pal_base = machine->pens + (colorbase << 4) % machine->drv->total_colors; + pal_base = machine->pens + (colorbase << 4) % machine->config->total_colors; // walk the target bitmap within the visible area vertically or horizontally, one line at a time for (line_pos=line_start; line_pos<=line_end; linedata_offs+=linedata_adv, line_pos++) diff --git a/src/mame/video/kopunch.c b/src/mame/video/kopunch.c index 5a74ee92987..f1ebada7a43 100644 --- a/src/mame/video/kopunch.c +++ b/src/mame/video/kopunch.c @@ -12,7 +12,7 @@ PALETTE_INIT( kopunch ) int i; color_prom+=24; /* first 24 colors are black */ - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/lvcards.c b/src/mame/video/lvcards.c index dbefd20d0a9..f7d36bbf3e2 100644 --- a/src/mame/video/lvcards.c +++ b/src/mame/video/lvcards.c @@ -14,7 +14,7 @@ PALETTE_INIT( ponttehk ) { int i; - for ( i = 0; i < machine->drv->total_colors; i++ ) + for ( i = 0; i < machine->config->total_colors; i++ ) { int bit0,bit1,bit2,bit3,r,g,b; @@ -26,17 +26,17 @@ PALETTE_INIT( ponttehk ) r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* green component */ - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* blue component */ - bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[2*machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[2*machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[2*machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[2*machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); @@ -49,7 +49,7 @@ PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough. { int i; - for ( i = 0; i < machine->drv->total_colors; i++ ) + for ( i = 0; i < machine->config->total_colors; i++ ) { int bit0,bit1,bit2,bit3,r,g,b; @@ -61,17 +61,17 @@ PALETTE_INIT( lvcards ) //Ever so slightly different, but different enough. r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* green component */ - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x11; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x11; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x11; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x11; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x11; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x11; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x11; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x11; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* blue component */ - bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x11; - bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x11; - bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x11; - bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x11; + bit0 = (color_prom[2*machine->config->total_colors] >> 0) & 0x11; + bit1 = (color_prom[2*machine->config->total_colors] >> 1) & 0x11; + bit2 = (color_prom[2*machine->config->total_colors] >> 2) & 0x11; + bit3 = (color_prom[2*machine->config->total_colors] >> 3) & 0x11; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/mappy.c b/src/mame/video/mappy.c index eaa339589cd..adc4dc09697 100644 --- a/src/mame/video/mappy.c +++ b/src/mame/video/mappy.c @@ -149,7 +149,7 @@ PALETTE_INIT( mappy ) } /* sprites map to the lower 16 palette entries */ - for (i = 64*4; i < machine->drv->total_colors; i++) + for (i = 64*4; i < machine->config->total_colors; i++) { UINT8 ctabentry = color_prom[i] & 0x0f; colortable_entry_set_value(machine->colortable, i, ctabentry); diff --git a/src/mame/video/mitchell.c b/src/mame/video/mitchell.c index 4ba3e03af7f..e95138f8e34 100644 --- a/src/mame/video/mitchell.c +++ b/src/mame/video/mitchell.c @@ -65,8 +65,8 @@ VIDEO_START( pang ) /* Palette RAM */ - paletteram = auto_malloc(2*machine->drv->total_colors); - memset(paletteram, 0, 2*machine->drv->total_colors); + paletteram = auto_malloc(2*machine->config->total_colors); + memset(paletteram, 0, 2*machine->config->total_colors); } diff --git a/src/mame/video/mouser.c b/src/mame/video/mouser.c index 85a03da0be9..a5940542803 100644 --- a/src/mame/video/mouser.c +++ b/src/mame/video/mouser.c @@ -19,7 +19,7 @@ PALETTE_INIT( mouser ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/mrdo.c b/src/mame/video/mrdo.c index 66b742bdb4d..09338e9bafa 100644 --- a/src/mame/video/mrdo.c +++ b/src/mame/video/mrdo.c @@ -50,7 +50,7 @@ PALETTE_INIT( mrdo ) { int i; #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) const int R1 = 150; const int R2 = 120; diff --git a/src/mame/video/munchmo.c b/src/mame/video/munchmo.c index 10198aa5233..722a5321787 100644 --- a/src/mame/video/munchmo.c +++ b/src/mame/video/munchmo.c @@ -14,7 +14,7 @@ PALETTE_INIT( mnchmobl ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/namcona1.c b/src/mame/video/namcona1.c index 41fbd75726f..c853498ab17 100644 --- a/src/mame/video/namcona1.c +++ b/src/mame/video/namcona1.c @@ -239,10 +239,10 @@ VIDEO_START( namcona1 ) gfx0 = allocgfx( &cg_layout ); gfx1 = allocgfx( &shape_layout ); - gfx0->total_colors = machine->drv->total_colors/256; + gfx0->total_colors = machine->config->total_colors/256; machine->gfx[0] = gfx0; - gfx1->total_colors = machine->drv->total_colors/2; + gfx1->total_colors = machine->config->total_colors/2; machine->gfx[1] = gfx1; } /* namcona1_vh_start */ diff --git a/src/mame/video/ojankohs.c b/src/mame/video/ojankohs.c index 1803f13e07a..75833f55bbf 100644 --- a/src/mame/video/ojankohs.c +++ b/src/mame/video/ojankohs.c @@ -36,24 +36,24 @@ PALETTE_INIT( ojankoy ) int i; int bit0, bit1, bit2, bit3, bit4, r, g, b; - for (i = 0; i < machine->drv->total_colors; i++) { + for (i = 0; i < machine->config->total_colors; i++) { bit0 = (color_prom[0] >> 2) & 0x01; bit1 = (color_prom[0] >> 3) & 0x01; bit2 = (color_prom[0] >> 4) & 0x01; bit3 = (color_prom[0] >> 5) & 0x01; bit4 = (color_prom[0] >> 6) & 0x01; r = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; - bit0 = (color_prom[machine->drv->total_colors] >> 5) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 6) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 7) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 5) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 6) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 7) & 0x01; bit3 = (color_prom[0] >> 0) & 0x01; bit4 = (color_prom[0] >> 1) & 0x01; g = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; - bit4 = (color_prom[machine->drv->total_colors] >> 4) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; + bit4 = (color_prom[machine->config->total_colors] >> 4) & 0x01; b = 0x08 * bit0 + 0x11 * bit1 + 0x21 * bit2 + 0x43 * bit3 + 0x82 * bit4; palette_set_color(machine, i, MAKE_RGB(r, g, b)); diff --git a/src/mame/video/pastelg.c b/src/mame/video/pastelg.c index e7394a048e9..bc3a6165740 100644 --- a/src/mame/video/pastelg.c +++ b/src/mame/video/pastelg.c @@ -39,7 +39,7 @@ PALETTE_INIT( pastelg ) int i; int bit0, bit1, bit2, bit3, r, g, b; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { bit0 = (color_prom[0] >> 0) & 0x01; bit1 = (color_prom[0] >> 1) & 0x01; @@ -51,10 +51,10 @@ PALETTE_INIT( pastelg ) bit2 = (color_prom[0] >> 6) & 0x01; bit3 = (color_prom[0] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/pcktgal.c b/src/mame/video/pcktgal.c index 03e5af89891..90b6c620ff1 100644 --- a/src/mame/video/pcktgal.c +++ b/src/mame/video/pcktgal.c @@ -6,7 +6,7 @@ PALETTE_INIT( pcktgal ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -20,10 +20,10 @@ PALETTE_INIT( pcktgal ) bit2 = (color_prom[i] >> 6) & 0x01; bit3 = (color_prom[i] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[i + machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[i + machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/plygonet.c b/src/mame/video/plygonet.c index 12e9618cd07..fed2e897911 100644 --- a/src/mame/video/plygonet.c +++ b/src/mame/video/plygonet.c @@ -69,10 +69,10 @@ VIDEO_START( polygonet ) machine->gfx[ttl_gfx_index] = allocgfx(&charlayout); decodegfx(machine->gfx[ttl_gfx_index], memory_region(REGION_GFX1), 0, machine->gfx[ttl_gfx_index]->total_elements); - if (machine->drv->color_table_len) - machine->gfx[ttl_gfx_index]->total_colors = machine->drv->color_table_len / 16; + if (machine->config->color_table_len) + machine->gfx[ttl_gfx_index]->total_colors = machine->config->color_table_len / 16; else - machine->gfx[ttl_gfx_index]->total_colors = machine->drv->total_colors / 16; + machine->gfx[ttl_gfx_index]->total_colors = machine->config->total_colors / 16; // create the tilemap ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, 8, 8, 64, 32); diff --git a/src/mame/video/popper.c b/src/mame/video/popper.c index edab429e26e..2e051c89592 100644 --- a/src/mame/video/popper.c +++ b/src/mame/video/popper.c @@ -16,7 +16,7 @@ PALETTE_INIT( popper ) { int i; - for (i = 0;i < machine->drv->total_colors; i++) + for (i = 0;i < machine->config->total_colors; i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/rockola.c b/src/mame/video/rockola.c index 419fb13bbec..e16c8c3d33a 100644 --- a/src/mame/video/rockola.c +++ b/src/mame/video/rockola.c @@ -24,7 +24,7 @@ static tilemap *fg_tilemap; static rgb_t palette[64]; #define TOTAL_COLORS(gfxn) (Machine->gfx[gfxn]->total_colors * Machine->gfx[gfxn]->color_granularity) -#define COLOR(gfxn,offs) (Machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs) +#define COLOR(gfxn,offs) (Machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs) @@ -39,7 +39,7 @@ PALETTE_INIT( rockola ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; @@ -214,7 +214,7 @@ PALETTE_INIT( satansat ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2, r, g, b; diff --git a/src/mame/video/rungun.c b/src/mame/video/rungun.c index 7fbf72219c4..b8b015f9839 100644 --- a/src/mame/video/rungun.c +++ b/src/mame/video/rungun.c @@ -100,10 +100,10 @@ VIDEO_START(rng) machine->gfx[ttl_gfx_index] = allocgfx(&charlayout); decodegfx(machine->gfx[ttl_gfx_index], memory_region(REGION_GFX3), 0, machine->gfx[ttl_gfx_index]->total_elements); - if (machine->drv->color_table_len) - machine->gfx[ttl_gfx_index]->total_colors = machine->drv->color_table_len / 16; + if (machine->config->color_table_len) + machine->gfx[ttl_gfx_index]->total_colors = machine->config->color_table_len / 16; else - machine->gfx[ttl_gfx_index]->total_colors = machine->drv->total_colors / 16; + machine->gfx[ttl_gfx_index]->total_colors = machine->config->total_colors / 16; // create the tilemap ttl_tilemap = tilemap_create(ttl_get_tile_info, tilemap_scan_rows, 8, 8, 64, 32); diff --git a/src/mame/video/segaic24.c b/src/mame/video/segaic24.c index 79a8e288e18..656e4436347 100644 --- a/src/mame/video/segaic24.c +++ b/src/mame/video/segaic24.c @@ -40,7 +40,7 @@ static void set_color(running_machine *machine, int color, UINT8 r, UINT8 g, UIN g = 0.6*g; b = 0.6*b; } - palette_set_color(machine,color+machine->drv->total_colors/2, MAKE_RGB(r, g, b)); + palette_set_color(machine,color+machine->config->total_colors/2, MAKE_RGB(r, g, b)); } // 315-5242 @@ -166,10 +166,10 @@ void sys24_tile_vh_start(running_machine *machine, UINT16 tile_mask) machine->gfx[sys24_char_gfx_index] = allocgfx(&sys24_char_layout); - if (machine->drv->color_table_len) - machine->gfx[sys24_char_gfx_index]->total_colors = machine->drv->color_table_len / 16; + if (machine->config->color_table_len) + machine->gfx[sys24_char_gfx_index]->total_colors = machine->config->color_table_len / 16; else - machine->gfx[sys24_char_gfx_index]->total_colors = machine->drv->total_colors / 16; + machine->gfx[sys24_char_gfx_index]->total_colors = machine->config->total_colors / 16; state_save_register_global_pointer(sys24_tile_ram, 0x10000/2); state_save_register_global_pointer(sys24_char_ram, 0x80000/2); diff --git a/src/mame/video/seicross.c b/src/mame/video/seicross.c index 4be1b8fa35e..2ab48aa6459 100644 --- a/src/mame/video/seicross.c +++ b/src/mame/video/seicross.c @@ -33,7 +33,7 @@ PALETTE_INIT( seicross ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/seta.c b/src/mame/video/seta.c index 12a40907e40..b8baa762ec0 100644 --- a/src/mame/video/seta.c +++ b/src/mame/video/seta.c @@ -728,7 +728,7 @@ static void draw_sprites_map(running_machine *machine, mame_bitmap *bitmap,const int offs, col; int xoffs, yoffs; - int total_color_codes = machine->drv->gfxdecodeinfo[0].total_color_codes; + int total_color_codes = machine->config->gfxdecodeinfo[0].total_color_codes; int ctrl = spriteram16[ 0x600/2 ]; int ctrl2 = spriteram16[ 0x602/2 ]; @@ -832,7 +832,7 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap,const rec int offs; int xoffs, yoffs; - int total_color_codes = machine->drv->gfxdecodeinfo[0].total_color_codes; + int total_color_codes = machine->config->gfxdecodeinfo[0].total_color_codes; int ctrl = spriteram16[ 0x600/2 ]; int ctrl2 = spriteram16[ 0x602/2 ]; diff --git a/src/mame/video/shootout.c b/src/mame/video/shootout.c index 19a8a6e5dd0..3cc448d62c0 100644 --- a/src/mame/video/shootout.c +++ b/src/mame/video/shootout.c @@ -14,7 +14,7 @@ PALETTE_INIT( shootout ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/sidepckt.c b/src/mame/video/sidepckt.c index 48d55620c5b..2531e664b78 100644 --- a/src/mame/video/sidepckt.c +++ b/src/mame/video/sidepckt.c @@ -9,7 +9,7 @@ PALETTE_INIT( sidepckt ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -26,10 +26,10 @@ PALETTE_INIT( sidepckt ) bit3 = (color_prom[i] >> 3) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* blue component */ - bit0 = (color_prom[i + machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[i + machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[i + machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[i + machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[i + machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[i + machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[i + machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[i + machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/snk.c b/src/mame/video/snk.c index 68bd47b9159..9038de566d8 100644 --- a/src/mame/video/snk.c +++ b/src/mame/video/snk.c @@ -38,7 +38,7 @@ PALETTE_INIT( snk_3bpp_shadow ) int i; PALETTE_INIT_CALL(RRRR_GGGG_BBBB); - if(!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if(!(machine->config->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); /* prepare shadow draw table */ @@ -53,7 +53,7 @@ PALETTE_INIT( snk_4bpp_shadow ) int i; PALETTE_INIT_CALL(RRRR_GGGG_BBBB); - if(!(machine->drv->video_attributes & VIDEO_HAS_SHADOWS)) + if(!(machine->config->video_attributes & VIDEO_HAS_SHADOWS)) popmessage("driver should use VIDEO_HAS_SHADOWS"); /* prepare shadow draw table */ diff --git a/src/mame/video/spdodgeb.c b/src/mame/video/spdodgeb.c index f229ac93edb..e0569fa29e9 100644 --- a/src/mame/video/spdodgeb.c +++ b/src/mame/video/spdodgeb.c @@ -17,7 +17,7 @@ PALETTE_INIT( spdodgeb ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -35,10 +35,10 @@ PALETTE_INIT( spdodgeb ) bit3 = (color_prom[0] >> 7) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; /* blue component */ - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/srmp2.c b/src/mame/video/srmp2.c index 5fef0e4cb2e..134e72d2984 100644 --- a/src/mame/video/srmp2.c +++ b/src/mame/video/srmp2.c @@ -21,11 +21,11 @@ PALETTE_INIT( srmp2 ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int col; - col = (color_prom[i] << 8) + color_prom[i + machine->drv->total_colors]; + col = (color_prom[i] << 8) + color_prom[i + machine->config->total_colors]; palette_set_color_rgb(machine,i ^ 0x0f,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0)); } } @@ -35,11 +35,11 @@ PALETTE_INIT( srmp3 ) { int i; - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int col; - col = (color_prom[i] << 8) + color_prom[i + machine->drv->total_colors]; + col = (color_prom[i] << 8) + color_prom[i + machine->config->total_colors]; palette_set_color_rgb(machine,i,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0)); } } @@ -280,7 +280,7 @@ static void mjyuugi_draw_sprites_map(running_machine *machine, mame_bitmap *bitm int offs, col; int xoffs, yoffs; - int total_color_codes = machine->drv->gfxdecodeinfo[0].total_color_codes; + int total_color_codes = machine->config->gfxdecodeinfo[0].total_color_codes; int ctrl = spriteram16[ 0x600/2 ]; int ctrl2 = spriteram16[ 0x602/2 ]; diff --git a/src/mame/video/suna16.c b/src/mame/video/suna16.c index dddbd117ed3..5d8fa9661b7 100644 --- a/src/mame/video/suna16.c +++ b/src/mame/video/suna16.c @@ -93,7 +93,7 @@ WRITE16_HANDLER( bestbest_flipscreen_w ) VIDEO_START( suna16 ) { - paletteram16 = auto_malloc( machine->drv->total_colors * sizeof(UINT16) ); + paletteram16 = auto_malloc( machine->config->total_colors * sizeof(UINT16) ); } READ16_HANDLER( suna16_paletteram16_r ) diff --git a/src/mame/video/system16.c b/src/mame/video/system16.c index 9e0a3a72bdc..06dfd53a404 100644 --- a/src/mame/video/system16.c +++ b/src/mame/video/system16.c @@ -209,11 +209,11 @@ static void draw_sprite(running_machine *machine, int shadow, int shadow_pen, int eos ) { - const pen_t *shadow_base = machine->pens + machine->gfx[0]->color_base + (machine->drv->total_colors/2); + const pen_t *shadow_base = machine->pens + machine->gfx[0]->color_base + (machine->config->total_colors/2); const UINT8 *source; int full_shadow=shadow&SYS16_SPR_SHADOW; int partial_shadow=shadow&SYS16_SPR_PARTIAL_SHADOW; - int shadow_mask=(machine->drv->total_colors/2)-1; + int shadow_mask=(machine->config->total_colors/2)-1; int sx, x, xcount; int sy, y, ycount = 0; int dx,dy; @@ -526,7 +526,7 @@ WRITE16_HANDLER( sys16_paletteram_w ) palette_set_color( Machine, offset, MAKE_RGB(r, g, b) ); - palette_set_color( Machine, offset+Machine->drv->total_colors/2,MAKE_RGB(rs,gs,bs)); + palette_set_color( Machine, offset+Machine->config->total_colors/2,MAKE_RGB(rs,gs,bs)); } } @@ -821,7 +821,7 @@ VIDEO_START( system16 ){ { /* initialize all entries to black - needed for Golden Axe*/ int i; - for( i=0; i<machine->drv->total_colors; i++ ){ + for( i=0; i<machine->config->total_colors; i++ ){ palette_set_color( machine, i, MAKE_RGB(0,0,0) ); } diff --git a/src/mame/video/tagteam.c b/src/mame/video/tagteam.c index 0c6ac935624..7c9b4d61489 100644 --- a/src/mame/video/tagteam.c +++ b/src/mame/video/tagteam.c @@ -16,7 +16,7 @@ PALETTE_INIT( tagteam ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c index d6b62ca4998..abeac01b5c6 100644 --- a/src/mame/video/taitoic.c +++ b/src/mame/video/taitoic.c @@ -2306,7 +2306,7 @@ void TC0100SCN_vh_start(running_machine *machine, int chips,int gfxnum,int x_off Thundfox is the only one of those with two chips, and we're safe as it uses single width tilemaps. */ - myclip = machine->screen[(machine->drv->screen[i].tag == NULL) ? 0 : i].visarea; + myclip = machine->screen[(machine->config->screen[i].tag == NULL) ? 0 : i].visarea; TC0100SCN_cliprect[i] = myclip; diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c index ff9a04f7fc7..40d2d0a62bf 100644 --- a/src/mame/video/taitojc.c +++ b/src/mame/video/taitojc.c @@ -220,10 +220,10 @@ VIDEO_START( taitojc ) machine->gfx[taitojc_gfx_index] = allocgfx(&taitojc_char_layout); /* set the color information */ - if (machine->drv->color_table_len) - machine->gfx[taitojc_gfx_index]->total_colors = machine->drv->color_table_len / 16; + if (machine->config->color_table_len) + machine->gfx[taitojc_gfx_index]->total_colors = machine->config->color_table_len / 16; else - machine->gfx[taitojc_gfx_index]->total_colors = machine->drv->total_colors / 16; + machine->gfx[taitojc_gfx_index]->total_colors = machine->config->total_colors / 16; taitojc_texture = auto_malloc(0x400000); diff --git a/src/mame/video/taitosj.c b/src/mame/video/taitosj.c index b638e8b0996..c66aaca7130 100644 --- a/src/mame/video/taitosj.c +++ b/src/mame/video/taitosj.c @@ -111,7 +111,7 @@ static int draworder[32][4]; PALETTE_INIT( taitosj ) { int i; - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) /* all gfx elements use the same palette */ for (i = 0 ;i < 64; i++) diff --git a/src/mame/video/tankbatt.c b/src/mame/video/tankbatt.c index 6528ab877de..88c9a9ab5f3 100644 --- a/src/mame/video/tankbatt.c +++ b/src/mame/video/tankbatt.c @@ -31,7 +31,7 @@ PALETTE_INIT( tankbatt ) /* ? Skip the first byte ? */ color_prom++; - for (i = 1;i < machine->drv->total_colors;i++) + for (i = 1;i < machine->config->total_colors;i++) { int bit0, bit1, bit2, bit3, r, g, b; diff --git a/src/mame/video/terracre.c b/src/mame/video/terracre.c index b48e8c5b12b..91119635191 100644 --- a/src/mame/video/terracre.c +++ b/src/mame/video/terracre.c @@ -96,9 +96,9 @@ static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const re PALETTE_INIT( amazon ) { #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) int i; - for( i = 0; i<machine->drv->total_colors; i++) + for( i = 0; i<machine->config->total_colors; i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -107,22 +107,22 @@ PALETTE_INIT( amazon ) bit2 = (color_prom[0] >> 2) & 0x01; bit3 = (color_prom[0] >> 3) & 0x01; r = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; - bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[2*machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[2*machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[2*machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[2*machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x43 * bit2 + 0x8f * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); color_prom++; } - color_prom += 2*machine->drv->total_colors; + color_prom += 2*machine->config->total_colors; /* color_prom now points to the beginning of the lookup table */ diff --git a/src/mame/video/timelimt.c b/src/mame/video/timelimt.c index 0fafbe9a78e..a7954a0f7b6 100644 --- a/src/mame/video/timelimt.c +++ b/src/mame/video/timelimt.c @@ -30,7 +30,7 @@ static tilemap *bg_tilemap, *fg_tilemap; PALETTE_INIT( timelimt ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/tnzs.c b/src/mame/video/tnzs.c index d942cce0169..dac9ed12c29 100644 --- a/src/mame/video/tnzs.c +++ b/src/mame/video/tnzs.c @@ -36,7 +36,7 @@ PALETTE_INIT( arknoid2 ) { int i,col; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { col = (color_prom[i]<<8)+color_prom[i+512]; palette_set_color_rgb(machine,i,pal5bit(col >> 10),pal5bit(col >> 5),pal5bit(col >> 0)); diff --git a/src/mame/video/toaplan2.c b/src/mame/video/toaplan2.c index f9d0f53cbe0..4d1d7dc96d3 100644 --- a/src/mame/video/toaplan2.c +++ b/src/mame/video/toaplan2.c @@ -951,7 +951,7 @@ static void toaplan2_scroll_reg_data_w(offs_t offset, UINT16 data, UINT32 mem_ma if ((toaplan2_sub_cpu == CPU_2_Z80) && (data == 3)) { /* HACK! When tilted, sound CPU needs to be reset. */ - if (Machine->drv->sound[0].type == SOUND_YM3812) + if (Machine->config->sound[0].type == SOUND_YM3812) { cpunum_set_input_line(Machine, 1, INPUT_LINE_RESET, PULSE_LINE); sndti_reset(SOUND_YM3812, 0); diff --git a/src/mame/video/travrusa.c b/src/mame/video/travrusa.c index 2f242be262a..365a1421cae 100644 --- a/src/mame/video/travrusa.c +++ b/src/mame/video/travrusa.c @@ -46,7 +46,7 @@ PALETTE_INIT( travrusa ) { int i; #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) /* character palette */ @@ -114,7 +114,7 @@ PALETTE_INIT( shtrider ) { int i; #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) /* character palette */ diff --git a/src/mame/video/truco.c b/src/mame/video/truco.c index 4436f3ad111..a77f427f142 100644 --- a/src/mame/video/truco.c +++ b/src/mame/video/truco.c @@ -12,7 +12,7 @@ PALETTE_INIT( truco ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int r = ( i & 0x8 ) ? 0xff : 0x00; int g = ( i & 0x4 ) ? 0xff : 0x00; diff --git a/src/mame/video/tryout.c b/src/mame/video/tryout.c index 90bf6bf6d90..cdb96ad1e46 100644 --- a/src/mame/video/tryout.c +++ b/src/mame/video/tryout.c @@ -17,7 +17,7 @@ PALETTE_INIT( tryout ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/tubep.c b/src/mame/video/tubep.c index e485ac05cd2..e9eae59f537 100644 --- a/src/mame/video/tubep.c +++ b/src/mame/video/tubep.c @@ -171,7 +171,7 @@ PALETTE_INIT( tubep ) int i,r,g,b; #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) /* background/sprites palette variables */ @@ -718,7 +718,7 @@ PALETTE_INIT( rjammer ) { int i; #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) static const int resistors_rg[3] = { 1000, 470, 220 }; static const int resistors_b [2] = { 470, 220 }; @@ -730,7 +730,7 @@ PALETTE_INIT( rjammer ) 2, resistors_b, weights_b, 470, 0, 0, 0, 0, 0, 0 ); - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/warpwarp.c b/src/mame/video/warpwarp.c index 36bc4f802e5..08154ae61b8 100644 --- a/src/mame/video/warpwarp.c +++ b/src/mame/video/warpwarp.c @@ -86,7 +86,7 @@ PALETTE_INIT( warpwarp ) { int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; @@ -110,7 +110,7 @@ PALETTE_INIT( warpwarp ) palette_set_color(machine,i,MAKE_RGB(r,g,b)); } - for (i = 0;i < machine->drv->color_table_len;i += 2) + for (i = 0;i < machine->config->color_table_len;i += 2) { colortable[i] = 0; /* black background */ colortable[i + 1] = i / 2; /* colored foreground */ diff --git a/src/mame/video/wiz.c b/src/mame/video/wiz.c index b9f60ee0096..375279c046f 100644 --- a/src/mame/video/wiz.c +++ b/src/mame/video/wiz.c @@ -62,7 +62,7 @@ PALETTE_INIT( wiz ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,bit3,r,g,b; @@ -72,15 +72,15 @@ PALETTE_INIT( wiz ) bit2 = (color_prom[0] >> 2) & 0x01; bit3 = (color_prom[0] >> 3) & 0x01; r = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; g = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; - bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[2*machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[2*machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[2*machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[2*machine->config->total_colors] >> 3) & 0x01; b = 0x0e * bit0 + 0x1f * bit1 + 0x42 * bit2 + 0x90 * bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/xorworld.c b/src/mame/video/xorworld.c index 60cd9ae3a78..2dd9a1b3f33 100644 --- a/src/mame/video/xorworld.c +++ b/src/mame/video/xorworld.c @@ -20,7 +20,7 @@ PALETTE_INIT( xorworld ) { int i; - for (i = 0;i < machine->drv->total_colors;i++){ + for (i = 0;i < machine->config->total_colors;i++){ int bit0,bit1,bit2,bit3; int r,g,b; @@ -31,16 +31,16 @@ PALETTE_INIT( xorworld ) bit3 = (color_prom[0] >> 3) & 0x01; r = 0x0e*bit0 + 0x1e*bit1 + 0x44*bit2 + 0x8f*bit3; /* green component */ - bit0 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[machine->config->total_colors] >> 3) & 0x01; g = 0x0e*bit0 + 0x1e*bit1 + 0x44*bit2 + 0x8f*bit3; /* blue component */ - bit0 = (color_prom[2*machine->drv->total_colors] >> 0) & 0x01; - bit1 = (color_prom[2*machine->drv->total_colors] >> 1) & 0x01; - bit2 = (color_prom[2*machine->drv->total_colors] >> 2) & 0x01; - bit3 = (color_prom[2*machine->drv->total_colors] >> 3) & 0x01; + bit0 = (color_prom[2*machine->config->total_colors] >> 0) & 0x01; + bit1 = (color_prom[2*machine->config->total_colors] >> 1) & 0x01; + bit2 = (color_prom[2*machine->config->total_colors] >> 2) & 0x01; + bit3 = (color_prom[2*machine->config->total_colors] >> 3) & 0x01; b = 0x0e*bit0 + 0x1e * bit1 + 0x44*bit2 + 0x8f*bit3; palette_set_color(machine,i,MAKE_RGB(r,g,b)); diff --git a/src/mame/video/xyonix.c b/src/mame/video/xyonix.c index c67e35e08dc..6d2256654e6 100644 --- a/src/mame/video/xyonix.c +++ b/src/mame/video/xyonix.c @@ -11,7 +11,7 @@ PALETTE_INIT( xyonix ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/ygv608.c b/src/mame/video/ygv608.c index cfca310d2d7..40009a7c129 100644 --- a/src/mame/video/ygv608.c +++ b/src/mame/video/ygv608.c @@ -102,7 +102,7 @@ static TILEMAP_MAPPER( get_tile_offset ) } #define layout_total(x) \ -(machine->drv->gfxdecodeinfo[x].gfxlayout->total) +(machine->config->gfxdecodeinfo[x].gfxlayout->total) static TILE_GET_INFO( get_tile_info_A_8 ) { diff --git a/src/mame/video/yiear.c b/src/mame/video/yiear.c index 45d1fa3ac0c..e5ed3bcc2ca 100644 --- a/src/mame/video/yiear.c +++ b/src/mame/video/yiear.c @@ -34,7 +34,7 @@ PALETTE_INIT( yiear ) int i; - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; diff --git a/src/mame/video/zaccaria.c b/src/mame/video/zaccaria.c index 7eeac16b06a..b5e8b5b57ae 100644 --- a/src/mame/video/zaccaria.c +++ b/src/mame/video/zaccaria.c @@ -52,9 +52,9 @@ Here's the hookup from the proms (82s131) to the r-g-b-outputs PALETTE_INIT( zaccaria ) { int i,j,k; - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) - for (i = 0;i < machine->drv->total_colors;i++) + for (i = 0;i < machine->config->total_colors;i++) { int bit0,bit1,bit2,r,g,b; @@ -80,12 +80,12 @@ PALETTE_INIT( zaccaria ) r = 0x46 * bit0 + 0x53 * bit1 + 0x66 * bit2; /* green component */ bit0 = (color_prom[0] >> 0) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 3) & 0x01; - bit2 = (color_prom[machine->drv->total_colors] >> 2) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 3) & 0x01; + bit2 = (color_prom[machine->config->total_colors] >> 2) & 0x01; g = 0x46 * bit0 + 0x53 * bit1 + 0x66 * bit2; /* blue component */ - bit0 = (color_prom[machine->drv->total_colors] >> 1) & 0x01; - bit1 = (color_prom[machine->drv->total_colors] >> 0) & 0x01; + bit0 = (color_prom[machine->config->total_colors] >> 1) & 0x01; + bit1 = (color_prom[machine->config->total_colors] >> 0) & 0x01; b = 0x66 * bit0 + 0x96 * bit1; palette_set_color(machine,i,MAKE_RGB(r,g,b)); } diff --git a/src/mame/video/zaxxon.c b/src/mame/video/zaxxon.c index cba09d1efe8..74e44669fca 100644 --- a/src/mame/video/zaxxon.c +++ b/src/mame/video/zaxxon.c @@ -43,7 +43,7 @@ PALETTE_INIT( zaxxon ) 2, &resistances[1], bweights, 470, 0); /* initialize the palette with these colors */ - for (i = 0; i < machine->drv->total_colors; i++) + for (i = 0; i < machine->config->total_colors; i++) { int bit0, bit1, bit2; int r, g, b; diff --git a/src/mame/video/zodiack.c b/src/mame/video/zodiack.c index aa4027779cf..aca336b8e8f 100644 --- a/src/mame/video/zodiack.c +++ b/src/mame/video/zodiack.c @@ -58,10 +58,10 @@ PALETTE_INIT( zodiack ) int i; #define TOTAL_COLORS(gfxn) (machine->gfx[gfxn]->total_colors * machine->gfx[gfxn]->color_granularity) - #define COLOR(gfxn,offs) (colortable[machine->drv->gfxdecodeinfo[gfxn].color_codes_start + offs]) + #define COLOR(gfxn,offs) (colortable[machine->config->gfxdecodeinfo[gfxn].color_codes_start + offs]) /* first, the character/sprite palette */ - for (i = 0;i < machine->drv->total_colors-1; i++) + for (i = 0;i < machine->config->total_colors-1; i++) { int bit0,bit1,bit2,r,g,b; @@ -96,7 +96,7 @@ PALETTE_INIT( zodiack ) /* white for bullets */ - palette_set_color(machine,machine->drv->total_colors-1,MAKE_RGB(0xff,0xff,0xff)); + palette_set_color(machine,machine->config->total_colors-1,MAKE_RGB(0xff,0xff,0xff)); for (i = 0;i < TOTAL_COLORS(0);i+=2) { diff --git a/src/osd/windows/debugwin.c b/src/osd/windows/debugwin.c index f25ebdea0df..8663be1009e 100644 --- a/src/osd/windows/debugwin.c +++ b/src/osd/windows/debugwin.c @@ -2610,7 +2610,7 @@ void console_create_window(void) info->minwidth = 0; info->maxwidth = 0; for (cpunum = MAX_CPU - 1; (INT32)cpunum >= 0; cpunum--) - if (Machine->drv->cpu[cpunum].type != CPU_DUMMY) + if (Machine->config->cpu[cpunum].type != CPU_DUMMY) { UINT32 regchars, dischars, conchars; UINT32 minwidth, maxwidth; diff --git a/src/osd/windows/video.c b/src/osd/windows/video.c index 6928db82142..234c313166a 100644 --- a/src/osd/windows/video.c +++ b/src/osd/windows/video.c @@ -473,7 +473,7 @@ static void load_effect_overlay(const char *filename) // set the overlay on all screens for (scrnum = 0; scrnum < MAX_SCREENS; scrnum++) - if (Machine->drv->screen[scrnum].tag != NULL) + if (Machine->config->screen[scrnum].tag != NULL) render_container_set_overlay(render_container_get_screen(scrnum), effect_bitmap); free(tempstr); diff --git a/src/osd/windows/window.c b/src/osd/windows/window.c index 1fbf842a241..9b248440229 100644 --- a/src/osd/windows/window.c +++ b/src/osd/windows/window.c @@ -877,7 +877,7 @@ static void set_starting_view(int index, win_window_info *window, const char *vi int scrcount; // count the number of screens - for (scrcount = 0; Machine->drv->screen[scrcount].tag != NULL; scrcount++) ; + for (scrcount = 0; Machine->config->screen[scrcount].tag != NULL; scrcount++) ; // if we have enough screens to be one per monitor, assign in order if (video_config.numscreens >= scrcount) |